|
@@ -295,3 +295,78 @@ func (this *NewCommonApiController) GetAllPatientsMode() {
|
295
|
295
|
"total": total,
|
296
|
296
|
})
|
297
|
297
|
}
|
|
298
|
+
|
|
299
|
+func (this *NewCommonApiController) GetMobileInspectionList() {
|
|
300
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
301
|
+ orgid := adminUser.Org.Id
|
|
302
|
+ startime := this.GetString("startime")
|
|
303
|
+ fmt.Println(startime)
|
|
304
|
+ endtime := this.GetString("endtime")
|
|
305
|
+ startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
|
|
306
|
+ fmt.Println("parseDateErr", parseDateErr)
|
|
307
|
+ statime := startDate.Unix()
|
|
308
|
+ fmt.Println("开始时间", statime)
|
|
309
|
+ endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
|
|
310
|
+ entime := endDate.Unix()
|
|
311
|
+ fmt.Println("结束日期", entime)
|
|
312
|
+ references, err := service.GetInspectionTotalCount(orgid)
|
|
313
|
+ if err != nil {
|
|
314
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
315
|
+ return
|
|
316
|
+ }
|
|
317
|
+
|
|
318
|
+ counts, err := service.GetInspectionProjectCount(orgid, statime, entime)
|
|
319
|
+
|
|
320
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
321
|
+ "Inspection": references,
|
|
322
|
+ "counts": counts,
|
|
323
|
+ })
|
|
324
|
+}
|
|
325
|
+
|
|
326
|
+func (this *NewCommonApiController) GetPatientInspectionDetail() {
|
|
327
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
328
|
+ orgId := adminUser.Org.Id
|
|
329
|
+ id, _ := this.GetInt64("id")
|
|
330
|
+ fmt.Println("id", id)
|
|
331
|
+ startime := this.GetString("startime")
|
|
332
|
+ endtime := this.GetString("endtime")
|
|
333
|
+ startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
|
|
334
|
+ fmt.Println("parseDateErr", parseDateErr)
|
|
335
|
+ statime := startDate.Unix()
|
|
336
|
+ fmt.Println("开始时间", statime)
|
|
337
|
+ endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
|
|
338
|
+ entime := endDate.Unix()
|
|
339
|
+ fmt.Println("结束日期", entime)
|
|
340
|
+ patientdetail, err := service.GetInspectionDetailById(id, orgId, statime, entime)
|
|
341
|
+ if err != nil {
|
|
342
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
343
|
+ return
|
|
344
|
+ }
|
|
345
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
346
|
+ "patientdetail": patientdetail,
|
|
347
|
+ })
|
|
348
|
+}
|
|
349
|
+
|
|
350
|
+func (this *NewCommonApiController) GetSeachPatientDetail() {
|
|
351
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
352
|
+ orgId := adminUser.Org.Id
|
|
353
|
+ keyword := this.GetString("keyword")
|
|
354
|
+ fmt.Println("keyword", keyword)
|
|
355
|
+ startime := this.GetString("startime")
|
|
356
|
+ endtime := this.GetString("endtime")
|
|
357
|
+ startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
|
|
358
|
+ fmt.Println("parseDateErr", parseDateErr)
|
|
359
|
+ statime := startDate.Unix()
|
|
360
|
+ fmt.Println("开始时间", statime)
|
|
361
|
+ endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
|
|
362
|
+ entime := endDate.Unix()
|
|
363
|
+ fmt.Println("结束日期", entime)
|
|
364
|
+ PatientsInfo, err := service.GetSearchPatientInfo(orgId, keyword, statime, entime)
|
|
365
|
+ if err != nil {
|
|
366
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
367
|
+ return
|
|
368
|
+ }
|
|
369
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
370
|
+ "PatientsInfo": PatientsInfo,
|
|
371
|
+ })
|
|
372
|
+}
|