|
@@ -38,6 +38,8 @@ func PatientDataConfigAPIControllerRegistRouters() {
|
38
|
38
|
|
39
|
39
|
beego.Router("/api/patient/getpatientdialysisinforlist", &PatientDataConfigAPIController{}, "get:GetPatientDialysisInforList")
|
40
|
40
|
|
|
41
|
+ beego.Router("/api/patient/getcontextschedulelist", &PatientDataConfigAPIController{}, "Get:GetContextScheduleList")
|
|
42
|
+
|
41
|
43
|
}
|
42
|
44
|
|
43
|
45
|
type PatientDataConfigAPIController struct {
|
|
@@ -1056,7 +1058,6 @@ func (this *PatientDataConfigAPIController) GetPatientDialysisInforList() {
|
1056
|
1058
|
}
|
1057
|
1059
|
startTime = theTime.Unix()
|
1058
|
1060
|
}
|
1059
|
|
- fmt.Println("startTime0000000000000000", startTime)
|
1060
|
1061
|
|
1061
|
1062
|
//获取患者姓名
|
1062
|
1063
|
patient, _ := service.GetPatientName(patientID)
|
|
@@ -1090,3 +1091,53 @@ func (this *PatientDataConfigAPIController) GetPatientDialysisInforList() {
|
1090
|
1091
|
"afterDislysis": afterDislysis,
|
1091
|
1092
|
})
|
1092
|
1093
|
}
|
|
1094
|
+
|
|
1095
|
+func (this *PatientDataConfigAPIController) GetContextScheduleList() {
|
|
1096
|
+
|
|
1097
|
+ limit, _ := this.GetInt64("limit")
|
|
1098
|
+
|
|
1099
|
+ page, _ := this.GetInt64("page")
|
|
1100
|
+
|
|
1101
|
+ start_time := this.GetString("start_time")
|
|
1102
|
+
|
|
1103
|
+ end_time := this.GetString("end_time")
|
|
1104
|
+
|
|
1105
|
+ timeLayout := "2006-01-02"
|
|
1106
|
+ loc, _ := time.LoadLocation("Local")
|
|
1107
|
+ var startTime int64
|
|
1108
|
+ if len(start_time) > 0 {
|
|
1109
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
1110
|
+ if err != nil {
|
|
1111
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
1112
|
+ return
|
|
1113
|
+ }
|
|
1114
|
+ startTime = theTime.Unix()
|
|
1115
|
+ }
|
|
1116
|
+
|
|
1117
|
+ var endTime int64
|
|
1118
|
+ if len(end_time) > 0 {
|
|
1119
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
|
|
1120
|
+ if err != nil {
|
|
1121
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
1122
|
+ return
|
|
1123
|
+ }
|
|
1124
|
+ startTime = theTime.Unix()
|
|
1125
|
+ }
|
|
1126
|
+
|
|
1127
|
+ org_id := this.GetAdminUserInfo().CurrentOrgId
|
|
1128
|
+
|
|
1129
|
+ schedule, total, _ := service.GetContextScheduleListGroupPatientId(limit, page, startTime, endTime, org_id)
|
|
1130
|
+
|
|
1131
|
+ list, _, _ := service.GetContextScheduleListPatientId(startTime, endTime, org_id)
|
|
1132
|
+
|
|
1133
|
+ patients, _ := service.GetAllpatientThirty(org_id)
|
|
1134
|
+
|
|
1135
|
+ devicenumber, _ := service.GetAllBedNumber(org_id)
|
|
1136
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1137
|
+ "schedule": schedule,
|
|
1138
|
+ "total": total,
|
|
1139
|
+ "list": list,
|
|
1140
|
+ "patients": patients,
|
|
1141
|
+ "devicenumber": devicenumber,
|
|
1142
|
+ })
|
|
1143
|
+}
|