|
@@ -71,6 +71,8 @@ func PatientDataConfigAPIControllerRegistRouters() {
|
71
|
71
|
|
72
|
72
|
beego.Router("/api/patient/getpedpatientfallassessmentbyid", &PatientDataConfigAPIController{}, "Get:GetPedPatientFallassessmentById")
|
73
|
73
|
|
|
74
|
+ beego.Router("/api/patient/updatepatientfallassessmentbyid", &PatientDataConfigAPIController{}, "Post:UpdatePatientFallassessmentById")
|
|
75
|
+
|
74
|
76
|
beego.Router("/api/patient/deletepedpatientfallassment", &PatientDataConfigAPIController{}, "Get:DeletePadPatientFallassment")
|
75
|
77
|
|
76
|
78
|
beego.Router("/api/patient/savepatientpressuresore", &PatientDataConfigAPIController{}, "Post:SavePatientPressuresore")
|
|
@@ -2721,65 +2723,77 @@ func (this *PatientDataConfigAPIController) SavePediatrcFallassment() {
|
2721
|
2723
|
recordDate = theTime.Unix()
|
2722
|
2724
|
}
|
2723
|
2725
|
|
2724
|
|
- if dataBody["age"] != nil && reflect.TypeOf(dataBody["age"]).String() == "[]interface {}" {
|
2725
|
|
- ageList, _ := dataBody["age"].([]interface{})
|
2726
|
|
-
|
2727
|
|
- for _, item := range ageList {
|
2728
|
|
-
|
2729
|
|
- byterequest, _ := json.Marshal(item)
|
2730
|
|
- str += string(byterequest) + ","
|
2731
|
|
- }
|
2732
|
|
- }
|
2733
|
|
-
|
2734
|
|
- if dataBody["cognize"] != nil && reflect.TypeOf(dataBody["cognize"]).String() == "[]interface {}" {
|
2735
|
|
- cognizeList, _ := dataBody["cognize"].([]interface{})
|
2736
|
|
-
|
2737
|
|
- for _, item := range cognizeList {
|
2738
|
|
-
|
2739
|
|
- byterequest, _ := json.Marshal(item)
|
2740
|
|
- str += string(byterequest) + ","
|
2741
|
|
- }
|
2742
|
|
- }
|
2743
|
|
-
|
2744
|
|
- if dataBody["diagnosis"] != nil && reflect.TypeOf(dataBody["diagnosis"]).String() == "[]interface {}" {
|
2745
|
|
- diagnosisList, _ := dataBody["diagnosis"].([]interface{})
|
|
2726
|
+
|
|
2727
|
+
|
|
2728
|
+
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
|
|
2736
|
+
|
|
2737
|
+
|
|
2738
|
+
|
|
2739
|
+
|
|
2740
|
+
|
|
2741
|
+
|
|
2742
|
+
|
|
2743
|
+
|
|
2744
|
+
|
|
2745
|
+
|
|
2746
|
+
|
|
2747
|
+
|
|
2748
|
+
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
|
|
2752
|
+
|
|
2753
|
+
|
|
2754
|
+
|
|
2755
|
+
|
|
2756
|
+
|
|
2757
|
+
|
|
2758
|
+
|
|
2759
|
+
|
|
2760
|
+
|
|
2761
|
+
|
|
2762
|
+
|
|
2763
|
+
|
|
2764
|
+
|
|
2765
|
+
|
|
2766
|
+
|
|
2767
|
+
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
|
|
2773
|
+
|
|
2774
|
+
|
|
2775
|
+
|
|
2776
|
+
|
|
2777
|
+
|
|
2778
|
+
|
|
2779
|
+
|
|
2780
|
+
|
|
2781
|
+
|
|
2782
|
+
|
|
2783
|
+
|
|
2784
|
+
|
2746
|
2785
|
|
2747
|
|
- for _, item := range diagnosisList {
|
2748
|
|
-
|
2749
|
|
- byterequest, _ := json.Marshal(item)
|
2750
|
|
- str += string(byterequest) + ","
|
2751
|
|
- }
|
2752
|
|
- }
|
|
2786
|
+ age := int64(dataBody["age"].(float64))
|
2753
|
2787
|
|
2754
|
|
- if dataBody["environment"] != nil && reflect.TypeOf(dataBody["environment"]).String() == "[]interface {}" {
|
2755
|
|
- environmentList, _ := dataBody["environment"].([]interface{})
|
|
2788
|
+ sex := int64(dataBody["sex"].(float64))
|
2756
|
2789
|
|
2757
|
|
- for _, item := range environmentList {
|
2758
|
|
-
|
2759
|
|
- byterequest, _ := json.Marshal(item)
|
2760
|
|
- str += string(byterequest) + ","
|
2761
|
|
- }
|
2762
|
|
- }
|
|
2790
|
+ diagnosis := int64(dataBody["diagnosis"].(float64))
|
2763
|
2791
|
|
2764
|
|
- if dataBody["medicine"] != nil && reflect.TypeOf(dataBody["medicine"]).String() == "[]interface {}" {
|
2765
|
|
- medicineList, _ := dataBody["medicine"].([]interface{})
|
|
2792
|
+ environment := int64(dataBody["environment"].(float64))
|
2766
|
2793
|
|
2767
|
|
- for _, item := range medicineList {
|
2768
|
|
-
|
2769
|
|
- byterequest, _ := json.Marshal(item)
|
2770
|
|
- str += string(byterequest) + ","
|
2771
|
|
- }
|
2772
|
|
- }
|
|
2794
|
+ medicine := int64(dataBody["medicine"].(float64))
|
2773
|
2795
|
|
2774
|
|
- if dataBody["sex"] != nil && reflect.TypeOf(dataBody["sex"]).String() == "[]interface {}" {
|
2775
|
|
- sexList, _ := dataBody["medicine"].([]interface{})
|
2776
|
|
-
|
2777
|
|
- for _, item := range sexList {
|
2778
|
|
-
|
2779
|
|
- byterequest, _ := json.Marshal(item)
|
2780
|
|
- str += string(byterequest) + ","
|
2781
|
|
- }
|
2782
|
|
- }
|
|
2796
|
+ tumble := int64(dataBody["tumble"].(float64))
|
2783
|
2797
|
|
2784
|
2798
|
pedFallssessment := models.XtPatientPedFallssessment{
|
2785
|
2799
|
PatientId: patient_id,
|
|
@@ -2792,6 +2806,12 @@ func (this *PatientDataConfigAPIController) SavePediatrcFallassment() {
|
2792
|
2806
|
Total: total,
|
2793
|
2807
|
AdminUserId: admin_user_id,
|
2794
|
2808
|
Type: 1,
|
|
2809
|
+ Age: age,
|
|
2810
|
+ Sex: sex,
|
|
2811
|
+ Diagnosis: diagnosis,
|
|
2812
|
+ Environment: environment,
|
|
2813
|
+ Medicine: medicine,
|
|
2814
|
+ Tumble: tumble,
|
2795
|
2815
|
}
|
2796
|
2816
|
|
2797
|
2817
|
service.CreatePadFallssessment(pedFallssessment)
|
|
@@ -2828,6 +2848,10 @@ func (this *PatientDataConfigAPIController) GetPedPatientFallassessmentById() {
|
2828
|
2848
|
})
|
2829
|
2849
|
}
|
2830
|
2850
|
|
|
2851
|
+func (this *PatientDataConfigAPIController) UpdatePatientFallassessmentById() {
|
|
2852
|
+
|
|
2853
|
+}
|
|
2854
|
+
|
2831
|
2855
|
func (this *PatientDataConfigAPIController) DeletePadPatientFallassment() {
|
2832
|
2856
|
|
2833
|
2857
|
id, _ := this.GetInt64("id")
|
|
@@ -2845,4 +2869,73 @@ func (this *PatientDataConfigAPIController) SavePatientPressuresore() {
|
2845
|
2869
|
|
2846
|
2870
|
func (this *PatientDataConfigAPIController) SavePatientHpPressuresore() {
|
2847
|
2871
|
|
|
2872
|
+ dataBody := make(map[string]interface{}, 0)
|
|
2873
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
2874
|
+ if err != nil {
|
|
2875
|
+ utils.ErrorLog(err.Error())
|
|
2876
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
2877
|
+ return
|
|
2878
|
+ }
|
|
2879
|
+ user_org_id := this.GetAdminUserInfo().CurrentOrgId
|
|
2880
|
+
|
|
2881
|
+ id := int64(dataBody["id"].(float64))
|
|
2882
|
+
|
|
2883
|
+ admin_user_id := int64(dataBody["tumble"].(float64))
|
|
2884
|
+
|
|
2885
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
2886
|
+
|
|
2887
|
+ record_date := dataBody["date"].(string)
|
|
2888
|
+
|
|
2889
|
+ total := int64(dataBody["pedia_Totalpoints"].(float64))
|
|
2890
|
+
|
|
2891
|
+ timeLayout := "2006-01-02"
|
|
2892
|
+ loc, _ := time.LoadLocation("Local")
|
|
2893
|
+ var recordDate int64
|
|
2894
|
+ var str string
|
|
2895
|
+ if len(record_date) > 0 {
|
|
2896
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
2897
|
+ if err != nil {
|
|
2898
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
2899
|
+ return
|
|
2900
|
+ }
|
|
2901
|
+ recordDate = theTime.Unix()
|
|
2902
|
+ }
|
|
2903
|
+
|
|
2904
|
+ age := int64(dataBody["age"].(float64))
|
|
2905
|
+
|
|
2906
|
+ sex := int64(dataBody["sex"].(float64))
|
|
2907
|
+
|
|
2908
|
+ diagnosis := int64(dataBody["diagnosis"].(float64))
|
|
2909
|
+
|
|
2910
|
+ environment := int64(dataBody["environment"].(float64))
|
|
2911
|
+
|
|
2912
|
+ medicine := int64(dataBody["medicine"].(float64))
|
|
2913
|
+
|
|
2914
|
+ tumble := int64(dataBody["tumble"].(float64))
|
|
2915
|
+
|
|
2916
|
+ pedFallssessment := models.XtPatientPedFallssessment{
|
|
2917
|
+ ID: id,
|
|
2918
|
+ PatientId: patient_id,
|
|
2919
|
+ UserOrgId: user_org_id,
|
|
2920
|
+ Status: 1,
|
|
2921
|
+ Ctime: time.Now().Unix(),
|
|
2922
|
+ Mtime: 0,
|
|
2923
|
+ Text: str,
|
|
2924
|
+ RecordDate: recordDate,
|
|
2925
|
+ Total: total,
|
|
2926
|
+ AdminUserId: admin_user_id,
|
|
2927
|
+ Type: 1,
|
|
2928
|
+ Age: age,
|
|
2929
|
+ Sex: sex,
|
|
2930
|
+ Diagnosis: diagnosis,
|
|
2931
|
+ Environment: environment,
|
|
2932
|
+ Medicine: medicine,
|
|
2933
|
+ Tumble: tumble,
|
|
2934
|
+ }
|
|
2935
|
+
|
|
2936
|
+ service.UpdatePedFallssessment(pedFallssessment)
|
|
2937
|
+
|
|
2938
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2939
|
+ "pedFallssessment": pedFallssessment,
|
|
2940
|
+ })
|
2848
|
2941
|
}
|