|
@@ -1715,10 +1715,8 @@ func (this *NewDialysisApiController) GetPatientName() {
|
1715
|
1715
|
func (this *NewDialysisApiController) GetInspectionDetail() {
|
1716
|
1716
|
|
1717
|
1717
|
patientid, _ := this.GetInt64("patientid")
|
1718
|
|
- fmt.Print("patientid", patientid)
|
1719
|
1718
|
patients, _ := service.GetPatientDetailTwo(patientid)
|
1720
|
1719
|
date, _ := this.GetInt64("date")
|
1721
|
|
- fmt.Print("date", date)
|
1722
|
1720
|
projectid, _ := this.GetInt64("projectid")
|
1723
|
1721
|
adminUser := this.GetMobileAdminUserInfo()
|
1724
|
1722
|
orgid := adminUser.Org.Id
|
|
@@ -2908,3 +2906,62 @@ func (this *NewDialysisApiController) GetAllInspectionReminds() {
|
2908
|
2906
|
}
|
2909
|
2907
|
|
2910
|
2908
|
}
|
|
2909
|
+
|
|
2910
|
+func (this *NewDialysisApiController) GetLastInspectionDetail() {
|
|
2911
|
+
|
|
2912
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
2913
|
+ patients, _ := service.GetPatientDetailTwo(patient_id)
|
|
2914
|
+ date, _ := this.GetInt64("date")
|
|
2915
|
+ project_id, _ := this.GetInt64("project_id")
|
|
2916
|
+
|
|
2917
|
+ org_id := this.GetMobileAdminUserInfo().Org.Id
|
|
2918
|
+
|
|
2919
|
+ inspection, _ := service.GetLastInspection(patients.BloodId, date, project_id, org_id)
|
|
2920
|
+
|
|
2921
|
+ if inspection.InspectDate > 0 {
|
|
2922
|
+ InspectionDetail, err := service.GetLastInspectionDetail(patients.BloodId, inspection.InspectDate, project_id, org_id)
|
|
2923
|
+ if err != nil {
|
|
2924
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
2925
|
+ return
|
|
2926
|
+ }
|
|
2927
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2928
|
+ "InspectionDetail": InspectionDetail,
|
|
2929
|
+ "inspectdate": inspection.InspectDate,
|
|
2930
|
+ })
|
|
2931
|
+ } else {
|
|
2932
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2933
|
+ "InspectionDetail": "",
|
|
2934
|
+ "inspectdate": date,
|
|
2935
|
+ })
|
|
2936
|
+ }
|
|
2937
|
+
|
|
2938
|
+}
|
|
2939
|
+
|
|
2940
|
+func (this *NewDialysisApiController) GetNextInspectionDetail() {
|
|
2941
|
+
|
|
2942
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
2943
|
+ patients, _ := service.GetPatientDetailTwo(patient_id)
|
|
2944
|
+ date, _ := this.GetInt64("date")
|
|
2945
|
+ project_id, _ := this.GetInt64("project_id")
|
|
2946
|
+
|
|
2947
|
+ org_id := this.GetMobileAdminUserInfo().Org.Id
|
|
2948
|
+
|
|
2949
|
+ inspection, _ := service.GetNextInspection(patients.BloodId, date, project_id, org_id)
|
|
2950
|
+ fmt.Println("inspection", inspection.InspectDate)
|
|
2951
|
+ if inspection.InspectDate > 0 {
|
|
2952
|
+ InspectionDetail, err := service.GetLastInspectionDetail(patients.BloodId, inspection.InspectDate, project_id, org_id)
|
|
2953
|
+ if err != nil {
|
|
2954
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
2955
|
+ return
|
|
2956
|
+ }
|
|
2957
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2958
|
+ "InspectionDetail": InspectionDetail,
|
|
2959
|
+ "inspectdate": inspection.InspectDate,
|
|
2960
|
+ })
|
|
2961
|
+ } else {
|
|
2962
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2963
|
+ "InspectionDetail": "",
|
|
2964
|
+ "inspectdate": date,
|
|
2965
|
+ })
|
|
2966
|
+ }
|
|
2967
|
+}
|