|
@@ -151,3 +151,114 @@ func (this *NewCommonApiController) GetMobileTotalDialysisCount() {
|
151
|
151
|
"nowtime": nowtime,
|
152
|
152
|
})
|
153
|
153
|
}
|
|
154
|
+
|
|
155
|
+func (this *NewCommonApiController) GetMobilePatientList() {
|
|
156
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
157
|
+ orgid := adminUser.Org.Id
|
|
158
|
+ patients, err := service.GetCurentOrgPatients(orgid)
|
|
159
|
+ if err != nil {
|
|
160
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
161
|
+ return
|
|
162
|
+ }
|
|
163
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
164
|
+ "patients": patients,
|
|
165
|
+ })
|
|
166
|
+}
|
|
167
|
+
|
|
168
|
+func (this *NewCommonApiController) GetPrescriptionlist() {
|
|
169
|
+
|
|
170
|
+ startime := this.GetString("startime")
|
|
171
|
+ fmt.Println("startime", startime)
|
|
172
|
+ endtime := this.GetString("endtime")
|
|
173
|
+ fmt.Println("enditme", endtime)
|
|
174
|
+
|
|
175
|
+ startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
|
|
176
|
+ fmt.Println("parseDateErr", parseDateErr)
|
|
177
|
+ statime := startDate.Unix()
|
|
178
|
+ fmt.Println("开始时间", statime)
|
|
179
|
+ endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
|
|
180
|
+
|
|
181
|
+ entime := endDate.Unix()
|
|
182
|
+ fmt.Println("开始时间", statime)
|
|
183
|
+ page, _ := this.GetInt64("page")
|
|
184
|
+ fmt.Println("page", page)
|
|
185
|
+ limit, _ := this.GetInt64("limit")
|
|
186
|
+ fmt.Println("limit", limit)
|
|
187
|
+ adminInfo := this.GetMobileAdminUserInfo()
|
|
188
|
+ orgId := adminInfo.Org.Id
|
|
189
|
+ prescriptionList, _ := service.GetAllDialysisList(statime, entime, orgId)
|
|
190
|
+ list, totallist, err := service.GetDialysisPatientList(statime, entime, page, limit, orgId)
|
|
191
|
+ fmt.Println("err--------------------", err)
|
|
192
|
+ if err != nil {
|
|
193
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
194
|
+ return
|
|
195
|
+ }
|
|
196
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
197
|
+ "list": list,
|
|
198
|
+ "totallist": totallist,
|
|
199
|
+ "prescriptionList": prescriptionList,
|
|
200
|
+ })
|
|
201
|
+}
|
|
202
|
+
|
|
203
|
+func (this *NewCommonApiController) GetMobilePatientDetail() {
|
|
204
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
205
|
+ orgId := adminUser.Org.Id
|
|
206
|
+ id, _ := this.GetInt64("id")
|
|
207
|
+ fmt.Println("id", id)
|
|
208
|
+ startime := this.GetString("startime")
|
|
209
|
+ fmt.Println(startime)
|
|
210
|
+ endtime := this.GetString("endtime")
|
|
211
|
+ startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
|
|
212
|
+ fmt.Println("parseDateErr", parseDateErr)
|
|
213
|
+ statime := startDate.Unix()
|
|
214
|
+ fmt.Println("开始时间", statime)
|
|
215
|
+ endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
|
|
216
|
+
|
|
217
|
+ entime := endDate.Unix()
|
|
218
|
+ fmt.Println("开始时间", statime)
|
|
219
|
+ fmt.Println(endtime)
|
|
220
|
+ limit, _ := this.GetInt64("limit")
|
|
221
|
+ fmt.Println("limit", limit)
|
|
222
|
+ page, _ := this.GetInt64("page")
|
|
223
|
+ fmt.Println("page", page)
|
|
224
|
+ patients, total, err := service.GetDialysisDetailById(id, orgId, statime, entime, limit, page)
|
|
225
|
+ if err != nil {
|
|
226
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
227
|
+ return
|
|
228
|
+ }
|
|
229
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
230
|
+ "patients": patients,
|
|
231
|
+ "total": total,
|
|
232
|
+ })
|
|
233
|
+}
|
|
234
|
+
|
|
235
|
+func (this *NewCommonApiController) ToSearchPatient() {
|
|
236
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
237
|
+ orgId := adminUser.Org.Id
|
|
238
|
+ keyword := this.GetString("keyword")
|
|
239
|
+ startime := this.GetString("startime")
|
|
240
|
+ fmt.Println(startime)
|
|
241
|
+ endtime := this.GetString("endtime")
|
|
242
|
+ startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
|
|
243
|
+ fmt.Println("parseDateErr", parseDateErr)
|
|
244
|
+ statime := startDate.Unix()
|
|
245
|
+ fmt.Println("开始时间", statime)
|
|
246
|
+ endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
|
|
247
|
+
|
|
248
|
+ entime := endDate.Unix()
|
|
249
|
+ fmt.Println("开始时间", statime)
|
|
250
|
+ fmt.Println(endtime)
|
|
251
|
+ limit, _ := this.GetInt64("limit")
|
|
252
|
+ fmt.Println("limit", limit)
|
|
253
|
+ page, _ := this.GetInt64("page")
|
|
254
|
+ fmt.Println("page", page)
|
|
255
|
+ patient, total, err := service.GetPrescritionByName(orgId, keyword, statime, entime, limit, page)
|
|
256
|
+ if err != nil {
|
|
257
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
258
|
+ return
|
|
259
|
+ }
|
|
260
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
261
|
+ "patient": patient,
|
|
262
|
+ "total": total,
|
|
263
|
+ })
|
|
264
|
+}
|