|
@@ -5,6 +5,7 @@ import (
|
5
|
5
|
"XT_New/models"
|
6
|
6
|
"XT_New/service"
|
7
|
7
|
"XT_New/utils"
|
|
8
|
+ "encoding/json"
|
8
|
9
|
"fmt"
|
9
|
10
|
"github.com/astaxie/beego"
|
10
|
11
|
"github.com/jinzhu/gorm"
|
|
@@ -46,11 +47,11 @@ func DoctorApiRegistRouters() {
|
46
|
47
|
beego.Router("/api/patient/getinspectiondetail", &DoctorsApiController{}, "Get:GetInspectionDetailByProject")
|
47
|
48
|
beego.Router("/api/patient/getinspectionitemlist", &DoctorsApiController{}, "Get:GetInspectionItemlist")
|
48
|
49
|
beego.Router("/api/patient/getinitdatelist", &DoctorsApiController{}, "Get:GetInitDateList")
|
49
|
|
- beego.Router("/api/patient/savecreationinspection", &DoctorsApiController{}, "Get:SaveCreationInspection")
|
|
50
|
+ beego.Router("/api/patient/savecreationinspection", &DoctorsApiController{}, "Post:SaveCreationInspection")
|
50
|
51
|
beego.Router("/api/patient/getemlatesummarylist", &DoctorsApiController{}, "Get:GetTemplateSummaryList")
|
51
|
52
|
beego.Router("/api/patient/gettemplatesummarydetail", &DoctorsApiController{}, "Get:GetTemplateSummaryDetail")
|
52
|
53
|
beego.Router("/api/patient/gettemplatesummaryprintdetail", &DoctorsApiController{}, "Get:GetTemplateSummaryPrintDetail")
|
53
|
|
- beego.Router("/api/patient/updatetemplatesummary", &DoctorsApiController{}, "Get:UpdateTempalteSummary")
|
|
54
|
+ beego.Router("/api/patient/updatetemplatesummary", &DoctorsApiController{}, "Post:UpdateTempalteSummary")
|
54
|
55
|
beego.Router("/api/patient/deletesummary", &DoctorsApiController{}, "Get:DeleteSummary")
|
55
|
56
|
}
|
56
|
57
|
|
|
@@ -763,48 +764,93 @@ func (this *DoctorsApiController) GetInitDateList() {
|
763
|
764
|
|
764
|
765
|
func (this *DoctorsApiController) SaveCreationInspection() {
|
765
|
766
|
|
766
|
|
- title := this.GetString("title")
|
767
|
|
-
|
768
|
|
- dryWeight := this.GetString("dry_weight")
|
|
767
|
+ dataBody := make(map[string]interface{}, 0)
|
|
768
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
769
|
+ if err != nil {
|
|
770
|
+ utils.ErrorLog(err.Error())
|
|
771
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
772
|
+ return
|
|
773
|
+ }
|
|
774
|
+ title := dataBody["title"].(string)
|
|
775
|
+ dryWeight := dataBody["dry_weight"].(string)
|
769
|
776
|
dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
|
770
|
|
- dialysis_count, _ := this.GetInt64("dialysis_count")
|
771
|
|
- hd_count, _ := this.GetInt64("hd_count")
|
772
|
|
- hdf_count, _ := this.GetInt64("hdf_count")
|
773
|
|
- hp_count, _ := this.GetInt64("hp_count")
|
774
|
|
- other_count, _ := this.GetInt64("other_count")
|
775
|
|
- dialzer_apparatus := this.GetString("dialzer_apparatus")
|
776
|
|
- perfusion_apparatus := this.GetString("perfusion_apparatus")
|
777
|
|
- anticoagulant, _ := this.GetInt64("anticoagulant")
|
778
|
|
- kaliumstr := this.GetString("kalium")
|
|
777
|
+ dialysis_count := int64(dataBody["dialysis_count"].(float64))
|
|
778
|
+ hd_count := int64(dataBody["hd_count"].(float64))
|
|
779
|
+ hdf_count := int64(dataBody["hdf_count"].(float64))
|
|
780
|
+ hp_count := int64(dataBody["hp_count"].(float64))
|
|
781
|
+ other_count := int64(dataBody["other_count"].(float64))
|
|
782
|
+ dialzer_apparatus := dataBody["dialzer_apparatus"].(string)
|
|
783
|
+ perfusion_apparatus := dataBody["perfusion_apparatus"].(string)
|
|
784
|
+ anticoagulant := int64(dataBody["anticoagulant"].(float64))
|
|
785
|
+ kaliumstr := dataBody["kalium"].(string)
|
779
|
786
|
kalium, _ := strconv.ParseFloat(kaliumstr, 64)
|
780
|
|
-
|
781
|
|
- autunitestr := this.GetString("autunite")
|
|
787
|
+ autunitestr := dataBody["autunite"].(string)
|
782
|
788
|
autunite, _ := strconv.ParseFloat(autunitestr, 64)
|
783
|
|
- natriumstr := this.GetString("natrium")
|
|
789
|
+ natriumstr := dataBody["natrium"].(string)
|
784
|
790
|
natrium, _ := strconv.ParseFloat(natriumstr, 64)
|
785
|
|
- hour, _ := this.GetInt64("hour")
|
786
|
|
- minute, _ := this.GetInt64("minute")
|
787
|
|
- beforWeight := this.GetString("befor_weight")
|
|
791
|
+ hour := int64(dataBody["hour"].(float64))
|
|
792
|
+ minute := int64(dataBody["minute"].(float64))
|
|
793
|
+ beforWeight := dataBody["befor_weight"].(string)
|
788
|
794
|
befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
|
789
|
|
- afterWeight := this.GetString("after_weight")
|
|
795
|
+ afterWeight := dataBody["after_weight"].(string)
|
790
|
796
|
after_weight, _ := strconv.ParseFloat(afterWeight, 64)
|
791
|
|
- befor_pressure := this.GetString("befor_pressure")
|
792
|
|
- template_summary_content := this.GetString("template_summary_content")
|
793
|
|
- template_plan_content := this.GetString("template_plan_content")
|
794
|
|
- admin_user_id, _ := this.GetInt64("admin_user_id")
|
795
|
|
- record_time := this.GetString("record_time")
|
|
797
|
+ befor_pressure := dataBody["befor_pressure"].(string)
|
|
798
|
+ template_summary_content := dataBody["template_summary_content"].(string)
|
|
799
|
+ template_plan_content := dataBody["template_plan_content"].(string)
|
|
800
|
+ admin_user_id := int64(dataBody["admin_user_id"].(float64))
|
|
801
|
+ record_time := dataBody["record_time"].(string)
|
796
|
802
|
timeLayout := "2006-01-02"
|
797
|
803
|
loc, _ := time.LoadLocation("Local")
|
798
|
804
|
recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
|
799
|
|
- after_pressure := this.GetString("after_pressure")
|
800
|
|
- template_summary_id, _ := this.GetInt64("template_summary_id")
|
801
|
|
- template_plan_id, _ := this.GetInt64("template_plan_id")
|
802
|
|
- template_inspection_id, _ := this.GetInt64("template_inspection_id")
|
803
|
|
- patient_id, _ := this.GetInt64("patient_id")
|
804
|
|
- fmt.Println("patient_id", patient_id)
|
|
805
|
+ after_pressure := dataBody["after_pressure"].(string)
|
|
806
|
+ template_summary_id := int64(dataBody["template_summary_id"].(float64))
|
|
807
|
+ template_plan_id := int64(dataBody["template_plan_id"].(float64))
|
|
808
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
805
|
809
|
orgId := this.GetAdminUserInfo().CurrentOrgId
|
806
|
|
- inspect_date := this.GetString("inspect_date")
|
807
|
|
- project_id := this.GetString("project_id")
|
|
810
|
+ inspect_date := dataBody["inspect_date"].(string)
|
|
811
|
+ project_id := dataBody["project_id"].(string)
|
|
812
|
+ template_inspection_id := int64(dataBody["template_inspection_id"].(float64))
|
|
813
|
+ //title := this.GetString("title")
|
|
814
|
+ //dryWeight := this.GetString("dry_weight")
|
|
815
|
+ //dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
|
|
816
|
+ //dialysis_count, _ := this.GetInt64("dialysis_count")
|
|
817
|
+ //hd_count, _ := this.GetInt64("hd_count")
|
|
818
|
+ //hdf_count, _ := this.GetInt64("hdf_count")
|
|
819
|
+ //hp_count, _ := this.GetInt64("hp_count")
|
|
820
|
+ //other_count, _ := this.GetInt64("other_count")
|
|
821
|
+ //dialzer_apparatus := this.GetString("dialzer_apparatus")
|
|
822
|
+ //perfusion_apparatus := this.GetString("perfusion_apparatus")
|
|
823
|
+ //anticoagulant, _ := this.GetInt64("anticoagulant")
|
|
824
|
+ //kaliumstr := this.GetString("kalium")
|
|
825
|
+ //kalium, _ := strconv.ParseFloat(kaliumstr, 64)
|
|
826
|
+ //
|
|
827
|
+ //autunitestr := this.GetString("autunite")
|
|
828
|
+ //autunite, _ := strconv.ParseFloat(autunitestr, 64)
|
|
829
|
+ //natriumstr := this.GetString("natrium")
|
|
830
|
+ //natrium, _ := strconv.ParseFloat(natriumstr, 64)
|
|
831
|
+ //hour, _ := this.GetInt64("hour")
|
|
832
|
+ //minute, _ := this.GetInt64("minute")
|
|
833
|
+ //beforWeight := this.GetString("befor_weight")
|
|
834
|
+ //befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
|
|
835
|
+ //afterWeight := this.GetString("after_weight")
|
|
836
|
+ //after_weight, _ := strconv.ParseFloat(afterWeight, 64)
|
|
837
|
+ //befor_pressure := this.GetString("befor_pressure")
|
|
838
|
+ //template_summary_content := this.GetString("template_summary_content")
|
|
839
|
+ //template_plan_content := this.GetString("template_plan_content")
|
|
840
|
+ //admin_user_id, _ := this.GetInt64("admin_user_id")
|
|
841
|
+ //record_time := this.GetString("record_time")
|
|
842
|
+ //timeLayout := "2006-01-02"
|
|
843
|
+ //loc, _ := time.LoadLocation("Local")
|
|
844
|
+ //recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
|
|
845
|
+ //after_pressure := this.GetString("after_pressure")
|
|
846
|
+ //template_summary_id, _ := this.GetInt64("template_summary_id")
|
|
847
|
+ //template_plan_id, _ := this.GetInt64("template_plan_id")
|
|
848
|
+ //template_inspection_id, _ := this.GetInt64("template_inspection_id")
|
|
849
|
+ //patient_id, _ := this.GetInt64("patient_id")
|
|
850
|
+ //fmt.Println("patient_id", patient_id)
|
|
851
|
+ //orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
852
|
+ //inspect_date := this.GetString("inspect_date")
|
|
853
|
+ //project_id := this.GetString("project_id")
|
808
|
854
|
summary := models.XtTemplateSummary{
|
809
|
855
|
StartYear: 0,
|
810
|
856
|
StartMonth: 0,
|
|
@@ -845,7 +891,7 @@ func (this *DoctorsApiController) SaveCreationInspection() {
|
845
|
891
|
ProjectId: project_id,
|
846
|
892
|
}
|
847
|
893
|
|
848
|
|
- err := service.CreateSummary(&summary)
|
|
894
|
+ err = service.CreateSummary(&summary)
|
849
|
895
|
if err == nil {
|
850
|
896
|
this.ServeSuccessJSON(map[string]interface{}{
|
851
|
897
|
"summary": summary,
|
|
@@ -912,49 +958,97 @@ func (this *DoctorsApiController) GetTemplateSummaryPrintDetail() {
|
912
|
958
|
|
913
|
959
|
func (this *DoctorsApiController) UpdateTempalteSummary() {
|
914
|
960
|
|
915
|
|
- id, _ := this.GetInt64("id")
|
916
|
|
- title := this.GetString("title")
|
917
|
|
-
|
918
|
|
- dryWeight := this.GetString("dry_weight")
|
|
961
|
+ dataBody := make(map[string]interface{}, 0)
|
|
962
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
963
|
+ if err != nil {
|
|
964
|
+ utils.ErrorLog(err.Error())
|
|
965
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
966
|
+ return
|
|
967
|
+ }
|
|
968
|
+ id := int64(dataBody["id"].(float64))
|
|
969
|
+ title := dataBody["title"].(string)
|
|
970
|
+ dryWeight := dataBody["dry_weight"].(string)
|
919
|
971
|
dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
|
920
|
|
- dialysis_count, _ := this.GetInt64("dialysis_count")
|
921
|
|
- hd_count, _ := this.GetInt64("hd_count")
|
922
|
|
- hdf_count, _ := this.GetInt64("hdf_count")
|
923
|
|
- hp_count, _ := this.GetInt64("hp_count")
|
924
|
|
- other_count, _ := this.GetInt64("other_count")
|
925
|
|
- dialzer_apparatus := this.GetString("dialzer_apparatus")
|
926
|
|
- perfusion_apparatus := this.GetString("perfusion_apparatus")
|
927
|
|
- anticoagulant, _ := this.GetInt64("anticoagulant")
|
928
|
|
- kaliumstr := this.GetString("kalium")
|
|
972
|
+ dialysis_count := int64(dataBody["dialysis_count"].(float64))
|
|
973
|
+ hd_count := int64(dataBody["hd_count"].(float64))
|
|
974
|
+ hdf_count := int64(dataBody["hdf_count"].(float64))
|
|
975
|
+ hp_count := int64(dataBody["hp_count"].(float64))
|
|
976
|
+ other_count := int64(dataBody["other_count"].(float64))
|
|
977
|
+ dialzer_apparatus := dataBody["dialzer_apparatus"].(string)
|
|
978
|
+ perfusion_apparatus := dataBody["perfusion_apparatus"].(string)
|
|
979
|
+ anticoagulant := int64(dataBody["anticoagulant"].(float64))
|
|
980
|
+ kaliumstr := dataBody["kalium"].(string)
|
929
|
981
|
kalium, _ := strconv.ParseFloat(kaliumstr, 64)
|
930
|
|
-
|
931
|
|
- autunitestr := this.GetString("autunite")
|
|
982
|
+ autunitestr := dataBody["autunite"].(string)
|
932
|
983
|
autunite, _ := strconv.ParseFloat(autunitestr, 64)
|
933
|
|
- natriumstr := this.GetString("natrium")
|
|
984
|
+ natriumstr := dataBody["natrium"].(string)
|
934
|
985
|
natrium, _ := strconv.ParseFloat(natriumstr, 64)
|
935
|
|
- hour, _ := this.GetInt64("hour")
|
936
|
|
- minute, _ := this.GetInt64("minute")
|
937
|
|
- beforWeight := this.GetString("befor_weight")
|
|
986
|
+ hour := int64(dataBody["hour"].(float64))
|
|
987
|
+ minute := int64(dataBody["minute"].(float64))
|
|
988
|
+ beforWeight := dataBody["befor_weight"].(string)
|
938
|
989
|
befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
|
939
|
|
- afterWeight := this.GetString("after_weight")
|
|
990
|
+ afterWeight := dataBody["after_weight"].(string)
|
940
|
991
|
after_weight, _ := strconv.ParseFloat(afterWeight, 64)
|
941
|
|
- befor_pressure := this.GetString("befor_pressure")
|
942
|
|
- template_summary_content := this.GetString("template_summary_content")
|
943
|
|
- template_plan_content := this.GetString("template_plan_content")
|
944
|
|
- admin_user_id, _ := this.GetInt64("admin_user_id")
|
945
|
|
- record_time := this.GetString("record_time")
|
|
992
|
+ befor_pressure := dataBody["befor_pressure"].(string)
|
|
993
|
+ template_summary_content := dataBody["template_summary_content"].(string)
|
|
994
|
+ template_plan_content := dataBody["template_plan_content"].(string)
|
|
995
|
+ admin_user_id := int64(dataBody["admin_user_id"].(float64))
|
|
996
|
+ record_time := dataBody["record_time"].(string)
|
946
|
997
|
timeLayout := "2006-01-02"
|
947
|
998
|
loc, _ := time.LoadLocation("Local")
|
948
|
999
|
recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
|
949
|
|
- after_pressure := this.GetString("after_pressure")
|
950
|
|
- template_summary_id, _ := this.GetInt64("template_summary_id")
|
951
|
|
- template_plan_id, _ := this.GetInt64("template_plan_id")
|
952
|
|
- template_inspection_id, _ := this.GetInt64("template_inspection_id")
|
953
|
|
- patient_id, _ := this.GetInt64("patient_id")
|
954
|
|
- fmt.Println("patient_id", patient_id)
|
|
1000
|
+ after_pressure := dataBody["after_pressure"].(string)
|
|
1001
|
+ template_summary_id := int64(dataBody["template_summary_id"].(float64))
|
|
1002
|
+ template_plan_id := int64(dataBody["template_plan_id"].(float64))
|
|
1003
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
955
|
1004
|
orgId := this.GetAdminUserInfo().CurrentOrgId
|
956
|
|
- inspect_date := this.GetString("inspect_date")
|
957
|
|
- project_id := this.GetString("project_id")
|
|
1005
|
+ inspect_date := dataBody["inspect_date"].(string)
|
|
1006
|
+ project_id := dataBody["project_id"].(string)
|
|
1007
|
+ template_inspection_id := int64(dataBody["template_inspection_id"].(float64))
|
|
1008
|
+
|
|
1009
|
+ //id, _ := this.GetInt64("id")
|
|
1010
|
+ //title := this.GetString("title")
|
|
1011
|
+ //
|
|
1012
|
+ //dryWeight := this.GetString("dry_weight")
|
|
1013
|
+ //dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
|
|
1014
|
+ //dialysis_count, _ := this.GetInt64("dialysis_count")
|
|
1015
|
+ //hd_count, _ := this.GetInt64("hd_count")
|
|
1016
|
+ //hdf_count, _ := this.GetInt64("hdf_count")
|
|
1017
|
+ //hp_count, _ := this.GetInt64("hp_count")
|
|
1018
|
+ //other_count, _ := this.GetInt64("other_count")
|
|
1019
|
+ //dialzer_apparatus := this.GetString("dialzer_apparatus")
|
|
1020
|
+ //perfusion_apparatus := this.GetString("perfusion_apparatus")
|
|
1021
|
+ //anticoagulant, _ := this.GetInt64("anticoagulant")
|
|
1022
|
+ //kaliumstr := this.GetString("kalium")
|
|
1023
|
+ //kalium, _ := strconv.ParseFloat(kaliumstr, 64)
|
|
1024
|
+ //
|
|
1025
|
+ //autunitestr := this.GetString("autunite")
|
|
1026
|
+ //autunite, _ := strconv.ParseFloat(autunitestr, 64)
|
|
1027
|
+ //natriumstr := this.GetString("natrium")
|
|
1028
|
+ //natrium, _ := strconv.ParseFloat(natriumstr, 64)
|
|
1029
|
+ //hour, _ := this.GetInt64("hour")
|
|
1030
|
+ //minute, _ := this.GetInt64("minute")
|
|
1031
|
+ //beforWeight := this.GetString("befor_weight")
|
|
1032
|
+ //befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
|
|
1033
|
+ //afterWeight := this.GetString("after_weight")
|
|
1034
|
+ //after_weight, _ := strconv.ParseFloat(afterWeight, 64)
|
|
1035
|
+ //befor_pressure := this.GetString("befor_pressure")
|
|
1036
|
+ //template_summary_content := this.GetString("template_summary_content")
|
|
1037
|
+ //template_plan_content := this.GetString("template_plan_content")
|
|
1038
|
+ //admin_user_id, _ := this.GetInt64("admin_user_id")
|
|
1039
|
+ //record_time := this.GetString("record_time")
|
|
1040
|
+ //timeLayout := "2006-01-02"
|
|
1041
|
+ //loc, _ := time.LoadLocation("Local")
|
|
1042
|
+ //recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
|
|
1043
|
+ //after_pressure := this.GetString("after_pressure")
|
|
1044
|
+ //template_summary_id, _ := this.GetInt64("template_summary_id")
|
|
1045
|
+ //template_plan_id, _ := this.GetInt64("template_plan_id")
|
|
1046
|
+ //template_inspection_id, _ := this.GetInt64("template_inspection_id")
|
|
1047
|
+ //patient_id, _ := this.GetInt64("patient_id")
|
|
1048
|
+ //fmt.Println("patient_id", patient_id)
|
|
1049
|
+ //orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
1050
|
+ //inspect_date := this.GetString("inspect_date")
|
|
1051
|
+ //project_id := this.GetString("project_id")
|
958
|
1052
|
summary := models.XtTemplateSummary{
|
959
|
1053
|
ID: id,
|
960
|
1054
|
StartYear: 0,
|
|
@@ -995,7 +1089,7 @@ func (this *DoctorsApiController) UpdateTempalteSummary() {
|
995
|
1089
|
ProjectId: project_id,
|
996
|
1090
|
InspectDate: inspect_date,
|
997
|
1091
|
}
|
998
|
|
- err := service.UpdateTempalteSummary(&summary)
|
|
1092
|
+ err = service.UpdateTempalteSummary(&summary)
|
999
|
1093
|
if err == nil {
|
1000
|
1094
|
this.ServeSuccessJSON(map[string]interface{}{
|
1001
|
1095
|
"list": summary,
|