|
@@ -65,6 +65,10 @@ func PatientDataConfigAPIControllerRegistRouters() {
|
65
|
65
|
|
66
|
66
|
beego.Router("/api/patient/updatepatientfallassment", &PatientDataConfigAPIController{}, "Post:UpdatePatientFallassment")
|
67
|
67
|
|
|
68
|
+ beego.Router("/api/patient/savepediatrcfallassesment", &PatientDataConfigAPIController{}, "Post:SavePediatrcFallassment")
|
|
69
|
+
|
|
70
|
+ beego.Router("/api/patient/getbeddiatricfallassessmentlist", &PatientDataConfigAPIController{}, "Get:GetBedDiatricFallassessmentList")
|
|
71
|
+
|
68
|
72
|
}
|
69
|
73
|
|
70
|
74
|
type PatientDataConfigAPIController struct {
|
|
@@ -2676,3 +2680,131 @@ func (this *PatientDataConfigAPIController) UpdatePatientFallassment() {
|
2676
|
2680
|
"patientFallassessment": patientFallassessment,
|
2677
|
2681
|
})
|
2678
|
2682
|
}
|
|
2683
|
+
|
|
2684
|
+func (this *PatientDataConfigAPIController) SavePediatrcFallassment() {
|
|
2685
|
+
|
|
2686
|
+ dataBody := make(map[string]interface{}, 0)
|
|
2687
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
2688
|
+ if err != nil {
|
|
2689
|
+ utils.ErrorLog(err.Error())
|
|
2690
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
2691
|
+ return
|
|
2692
|
+ }
|
|
2693
|
+ user_org_id := this.GetAdminUserInfo().CurrentOrgId
|
|
2694
|
+
|
|
2695
|
+ admin_user_id := int64(dataBody["tumble"].(float64))
|
|
2696
|
+
|
|
2697
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
2698
|
+
|
|
2699
|
+ record_date := dataBody["date"].(string)
|
|
2700
|
+
|
|
2701
|
+ total := int64(dataBody["pedia_Totalpoints"].(float64))
|
|
2702
|
+
|
|
2703
|
+ timeLayout := "2006-01-02"
|
|
2704
|
+ loc, _ := time.LoadLocation("Local")
|
|
2705
|
+ var recordDate int64
|
|
2706
|
+ var str string
|
|
2707
|
+ if len(record_date) > 0 {
|
|
2708
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
2709
|
+ if err != nil {
|
|
2710
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
2711
|
+ return
|
|
2712
|
+ }
|
|
2713
|
+ recordDate = theTime.Unix()
|
|
2714
|
+ }
|
|
2715
|
+
|
|
2716
|
+ if dataBody["age"] != nil && reflect.TypeOf(dataBody["age"]).String() == "[]interface {}" {
|
|
2717
|
+ ageList, _ := dataBody["age"].([]interface{})
|
|
2718
|
+
|
|
2719
|
+ for _, item := range ageList {
|
|
2720
|
+ //记录日志
|
|
2721
|
+ byterequest, _ := json.Marshal(item)
|
|
2722
|
+ str += string(byterequest) + ","
|
|
2723
|
+ }
|
|
2724
|
+ }
|
|
2725
|
+
|
|
2726
|
+ if dataBody["cognize"] != nil && reflect.TypeOf(dataBody["cognize"]).String() == "[]interface {}" {
|
|
2727
|
+ cognizeList, _ := dataBody["cognize"].([]interface{})
|
|
2728
|
+
|
|
2729
|
+ for _, item := range cognizeList {
|
|
2730
|
+ //记录日志
|
|
2731
|
+ byterequest, _ := json.Marshal(item)
|
|
2732
|
+ str += string(byterequest) + ","
|
|
2733
|
+ }
|
|
2734
|
+ }
|
|
2735
|
+
|
|
2736
|
+ if dataBody["diagnosis"] != nil && reflect.TypeOf(dataBody["diagnosis"]).String() == "[]interface {}" {
|
|
2737
|
+ diagnosisList, _ := dataBody["diagnosis"].([]interface{})
|
|
2738
|
+
|
|
2739
|
+ for _, item := range diagnosisList {
|
|
2740
|
+ //记录日志
|
|
2741
|
+ byterequest, _ := json.Marshal(item)
|
|
2742
|
+ str += string(byterequest) + ","
|
|
2743
|
+ }
|
|
2744
|
+ }
|
|
2745
|
+
|
|
2746
|
+ if dataBody["environment"] != nil && reflect.TypeOf(dataBody["environment"]).String() == "[]interface {}" {
|
|
2747
|
+ environmentList, _ := dataBody["environment"].([]interface{})
|
|
2748
|
+
|
|
2749
|
+ for _, item := range environmentList {
|
|
2750
|
+ //记录日志
|
|
2751
|
+ byterequest, _ := json.Marshal(item)
|
|
2752
|
+ str += string(byterequest) + ","
|
|
2753
|
+ }
|
|
2754
|
+ }
|
|
2755
|
+
|
|
2756
|
+ if dataBody["medicine"] != nil && reflect.TypeOf(dataBody["medicine"]).String() == "[]interface {}" {
|
|
2757
|
+ medicineList, _ := dataBody["medicine"].([]interface{})
|
|
2758
|
+
|
|
2759
|
+ for _, item := range medicineList {
|
|
2760
|
+ //记录日志
|
|
2761
|
+ byterequest, _ := json.Marshal(item)
|
|
2762
|
+ str += string(byterequest) + ","
|
|
2763
|
+ }
|
|
2764
|
+ }
|
|
2765
|
+
|
|
2766
|
+ if dataBody["sex"] != nil && reflect.TypeOf(dataBody["sex"]).String() == "[]interface {}" {
|
|
2767
|
+ sexList, _ := dataBody["medicine"].([]interface{})
|
|
2768
|
+
|
|
2769
|
+ for _, item := range sexList {
|
|
2770
|
+ //记录日志
|
|
2771
|
+ byterequest, _ := json.Marshal(item)
|
|
2772
|
+ str += string(byterequest) + ","
|
|
2773
|
+ }
|
|
2774
|
+ }
|
|
2775
|
+
|
|
2776
|
+ pedFallssessment := models.XtPatientPedFallssessment{
|
|
2777
|
+ PatientId: patient_id,
|
|
2778
|
+ UserOrgId: user_org_id,
|
|
2779
|
+ Status: 1,
|
|
2780
|
+ Ctime: time.Now().Unix(),
|
|
2781
|
+ Mtime: 0,
|
|
2782
|
+ Text: str,
|
|
2783
|
+ RecordDate: recordDate,
|
|
2784
|
+ Total: total,
|
|
2785
|
+ AdminUserId: admin_user_id,
|
|
2786
|
+ Type: 1,
|
|
2787
|
+ }
|
|
2788
|
+
|
|
2789
|
+ service.CreatePadFallssessment(pedFallssessment)
|
|
2790
|
+
|
|
2791
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2792
|
+ "pedFallssessment": pedFallssessment,
|
|
2793
|
+ })
|
|
2794
|
+
|
|
2795
|
+}
|
|
2796
|
+
|
|
2797
|
+func (this *PatientDataConfigAPIController) GetBedDiatricFallassessmentList() {
|
|
2798
|
+
|
|
2799
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
2800
|
+ is_type, _ := this.GetInt64("is_type")
|
|
2801
|
+ limit, _ := this.GetInt64("limit")
|
|
2802
|
+ page, _ := this.GetInt64("page")
|
|
2803
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
2804
|
+ list, total, _ := service.GetBedDiatricFallassessmentList(patient_id, is_type, orgId, limit, page)
|
|
2805
|
+
|
|
2806
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2807
|
+ "list": list,
|
|
2808
|
+ "total": total,
|
|
2809
|
+ })
|
|
2810
|
+}
|