|
@@ -100,6 +100,9 @@ func HisManagerApiRegistRouters() {
|
100
|
100
|
|
101
|
101
|
beego.Router("/api/uncharge/list", &HisApiController{}, "get:GetHisUnChargePatientList")
|
102
|
102
|
|
|
103
|
+ beego.Router("/api/monthcharge/info", &HisApiController{}, "get:GetHisMonthChargePatientInfo")
|
|
104
|
+ beego.Router("/api/monthhispatient/get", &HisApiController{}, "get:GetHisMonthPatientInfo")
|
|
105
|
+
|
103
|
106
|
}
|
104
|
107
|
|
105
|
108
|
func (c *HisApiController) GetHisUnChargePatientList() {
|
|
@@ -349,8 +352,8 @@ func (c *HisApiController) GetHisPatientInfo() {
|
349
|
352
|
his_patient_id, _ := c.GetInt64("his_patient_id")
|
350
|
353
|
record_date := c.GetString("record_date")
|
351
|
354
|
number := c.GetString("number")
|
352
|
|
- start_time := c.GetString("start_time")
|
353
|
|
- end_time := c.GetString("end_time")
|
|
355
|
+ //start_time := c.GetString("start_time")
|
|
356
|
+ //end_time := c.GetString("end_time")
|
354
|
357
|
p_type, _ := c.GetInt64("p_type")
|
355
|
358
|
|
356
|
359
|
timeLayout := "2006-01-02"
|
|
@@ -361,16 +364,16 @@ func (c *HisApiController) GetHisPatientInfo() {
|
361
|
364
|
return
|
362
|
365
|
}
|
363
|
366
|
recordDateTime := theTime.Unix()
|
364
|
|
- startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
365
|
|
- if err != nil {
|
366
|
|
-
|
367
|
|
- }
|
368
|
|
- startRecordDateTime := startTime.Unix()
|
369
|
|
- endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
370
|
|
- if err != nil {
|
371
|
|
-
|
372
|
|
- }
|
373
|
|
- endRecordDateTime := endTime.Unix()
|
|
367
|
+ //startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
368
|
+ //if err != nil {
|
|
369
|
+ //
|
|
370
|
+ //}
|
|
371
|
+ //startRecordDateTime := startTime.Unix()
|
|
372
|
+ //endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
373
|
+ //if err != nil {
|
|
374
|
+ //
|
|
375
|
+ //}
|
|
376
|
+ //endRecordDateTime := endTime.Unix()
|
374
|
377
|
admin := c.GetAdminUserInfo()
|
375
|
378
|
his_patient_info, _ := service.GetNewHisPatientInfoTwo(admin.CurrentOrgId, his_patient_id, recordDateTime)
|
376
|
379
|
xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
|
|
@@ -396,7 +399,7 @@ func (c *HisApiController) GetHisPatientInfo() {
|
396
|
399
|
|
397
|
400
|
}
|
398
|
401
|
//prescriptions, _ := service.GetHisPrescription(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime)
|
399
|
|
- monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
|
402
|
+ //monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
400
|
403
|
case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
|
401
|
404
|
patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
|
402
|
405
|
lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
|
|
@@ -409,21 +412,21 @@ func (c *HisApiController) GetHisPatientInfo() {
|
409
|
412
|
//获取所有科室信息
|
410
|
413
|
department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
|
411
|
414
|
c.ServeSuccessJSON(map[string]interface{}{
|
412
|
|
- "his_info": his_patient_info,
|
413
|
|
- "xt_info": xt_patient_info,
|
414
|
|
- "prescription": prescriptions,
|
415
|
|
- "case_history": case_history,
|
416
|
|
- "info": patientPrescriptionInfo,
|
417
|
|
- "month_prescriptions": monthPrescriptions,
|
418
|
|
- "order": order,
|
419
|
|
- "doctors": doctors,
|
420
|
|
- "department": department,
|
421
|
|
- "sch_prescriptions": sch_prescriptions,
|
422
|
|
- "last_prescriptions": last_prescriptions,
|
423
|
|
- "schedule": sch,
|
424
|
|
- "count": count,
|
425
|
|
- "drugStockConfig": drugStockConfig,
|
426
|
|
- "last_info": lastPatientPrescriptionInfo,
|
|
415
|
+ "his_info": his_patient_info,
|
|
416
|
+ "xt_info": xt_patient_info,
|
|
417
|
+ "prescription": prescriptions,
|
|
418
|
+ "case_history": case_history,
|
|
419
|
+ "info": patientPrescriptionInfo,
|
|
420
|
+ //"month_prescriptions": monthPrescriptions,
|
|
421
|
+ "order": order,
|
|
422
|
+ "doctors": doctors,
|
|
423
|
+ "department": department,
|
|
424
|
+ "sch_prescriptions": sch_prescriptions,
|
|
425
|
+ "last_prescriptions": last_prescriptions,
|
|
426
|
+ "schedule": sch,
|
|
427
|
+ "count": count,
|
|
428
|
+ "drugStockConfig": drugStockConfig,
|
|
429
|
+ "last_info": lastPatientPrescriptionInfo,
|
427
|
430
|
})
|
428
|
431
|
return
|
429
|
432
|
|
|
@@ -3492,8 +3495,8 @@ func (c *HisApiController) GetHisChargePatientInfo() {
|
3492
|
3495
|
patient_id, _ := c.GetInt64("patient_id")
|
3493
|
3496
|
his_patient_id, _ := c.GetInt64("his_patient_id")
|
3494
|
3497
|
record_date := c.GetString("record_date")
|
3495
|
|
- start_time := c.GetString("start_time")
|
3496
|
|
- end_time := c.GetString("end_time")
|
|
3498
|
+ //start_time := c.GetString("start_time")
|
|
3499
|
+ //end_time := c.GetString("end_time")
|
3497
|
3500
|
order_status, _ := c.GetInt64("type", 0)
|
3498
|
3501
|
p_type, _ := c.GetInt64("p_type", 0)
|
3499
|
3502
|
order_id, _ := c.GetInt64("order_id", 0)
|
|
@@ -3507,17 +3510,17 @@ func (c *HisApiController) GetHisChargePatientInfo() {
|
3507
|
3510
|
}
|
3508
|
3511
|
recordDateTime := theTime.Unix()
|
3509
|
3512
|
|
3510
|
|
- startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
3511
|
|
- if err != nil {
|
3512
|
|
-
|
3513
|
|
- }
|
3514
|
|
- startRecordDateTime := startTime.Unix()
|
3515
|
|
-
|
3516
|
|
- endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
3517
|
|
- if err != nil {
|
3518
|
|
-
|
3519
|
|
- }
|
3520
|
|
- endRecordDateTime := endTime.Unix()
|
|
3513
|
+ //startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
3514
|
+ //if err != nil {
|
|
3515
|
+ //
|
|
3516
|
+ //}
|
|
3517
|
+ //startRecordDateTime := startTime.Unix()
|
|
3518
|
+ //
|
|
3519
|
+ //endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
3520
|
+ //if err != nil {
|
|
3521
|
+ //
|
|
3522
|
+ //}
|
|
3523
|
+ //endRecordDateTime := endTime.Unix()
|
3521
|
3524
|
|
3522
|
3525
|
admin := c.GetAdminUserInfo()
|
3523
|
3526
|
his_patient_info, _ := service.GetNewHisPatientInfo(his_patient_id)
|
|
@@ -3533,12 +3536,13 @@ func (c *HisApiController) GetHisChargePatientInfo() {
|
3533
|
3536
|
prescriptions, _ = service.GetChargeHisPrescriptionSeven(admin.CurrentOrgId, patient_id, order.Number, p_type)
|
3534
|
3537
|
}
|
3535
|
3538
|
|
3536
|
|
- var monthPrescriptions []*models.HisPrescription
|
3537
|
|
- if order_status == 1 || order_status == 0 {
|
3538
|
|
- monthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
3539
|
|
- } else if order_status == 2 {
|
3540
|
|
- monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFive(admin.CurrentOrgId, patient_id, order.Number, p_type)
|
3541
|
|
- }
|
|
3539
|
+ //var monthPrescriptions []*models.HisPrescription
|
|
3540
|
+ //if order_status == 1 || order_status == 0 {
|
|
3541
|
+ // monthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
|
3542
|
+ //} else if order_status == 2 {
|
|
3543
|
+ // monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFive(admin.CurrentOrgId, patient_id, order.Number, p_type)
|
|
3544
|
+ //}
|
|
3545
|
+
|
3542
|
3546
|
case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
|
3543
|
3547
|
patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
|
3544
|
3548
|
|
|
@@ -3549,16 +3553,16 @@ func (c *HisApiController) GetHisChargePatientInfo() {
|
3549
|
3553
|
department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
|
3550
|
3554
|
|
3551
|
3555
|
c.ServeSuccessJSON(map[string]interface{}{
|
3552
|
|
- "his_info": his_patient_info,
|
3553
|
|
- "xt_info": xt_patient_info,
|
3554
|
|
- "prescription": prescriptions,
|
3555
|
|
- "case_history": case_history,
|
3556
|
|
- "info": patientPrescriptionInfo,
|
3557
|
|
- "last_info": lastPatientPrescriptionInfo,
|
3558
|
|
- "month_prescriptions": monthPrescriptions,
|
3559
|
|
- "order": order,
|
3560
|
|
- "doctors": doctors,
|
3561
|
|
- "department": department,
|
|
3556
|
+ "his_info": his_patient_info,
|
|
3557
|
+ "xt_info": xt_patient_info,
|
|
3558
|
+ "prescription": prescriptions,
|
|
3559
|
+ "case_history": case_history,
|
|
3560
|
+ "info": patientPrescriptionInfo,
|
|
3561
|
+ "last_info": lastPatientPrescriptionInfo,
|
|
3562
|
+ //"month_prescriptions": monthPrescriptions,
|
|
3563
|
+ "order": order,
|
|
3564
|
+ "doctors": doctors,
|
|
3565
|
+ "department": department,
|
3562
|
3566
|
})
|
3563
|
3567
|
return
|
3564
|
3568
|
|
|
@@ -5040,3 +5044,131 @@ func (this *HisApiController) ChangeMedType() {
|
5040
|
5044
|
}
|
5041
|
5045
|
|
5042
|
5046
|
}
|
|
5047
|
+
|
|
5048
|
+func (c *HisApiController) GetHisMonthChargePatientInfo() {
|
|
5049
|
+ patient_id, _ := c.GetInt64("patient_id")
|
|
5050
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
5051
|
+ record_date := c.GetString("record_date")
|
|
5052
|
+ start_time := c.GetString("start_time")
|
|
5053
|
+ end_time := c.GetString("end_time")
|
|
5054
|
+ order_status, _ := c.GetInt64("type", 0)
|
|
5055
|
+ p_type, _ := c.GetInt64("p_type", 0)
|
|
5056
|
+ order_id, _ := c.GetInt64("order_id", 0)
|
|
5057
|
+
|
|
5058
|
+ timeLayout := "2006-01-02"
|
|
5059
|
+ loc, _ := time.LoadLocation("Local")
|
|
5060
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
5061
|
+ if err != nil {
|
|
5062
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
5063
|
+ return
|
|
5064
|
+ }
|
|
5065
|
+ recordDateTime := theTime.Unix()
|
|
5066
|
+
|
|
5067
|
+ startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
5068
|
+ if err != nil {
|
|
5069
|
+
|
|
5070
|
+ }
|
|
5071
|
+ startRecordDateTime := startTime.Unix()
|
|
5072
|
+
|
|
5073
|
+ endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
5074
|
+ if err != nil {
|
|
5075
|
+
|
|
5076
|
+ }
|
|
5077
|
+ endRecordDateTime := endTime.Unix()
|
|
5078
|
+
|
|
5079
|
+ admin := c.GetAdminUserInfo()
|
|
5080
|
+ his_patient_info, _ := service.GetNewHisPatientInfo(his_patient_id)
|
|
5081
|
+ xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
|
|
5082
|
+
|
|
5083
|
+ order, _ := service.GetHisOrderByID(order_id)
|
|
5084
|
+
|
|
5085
|
+ var monthPrescriptions []*models.HisPrescription
|
|
5086
|
+ if order_status == 1 || order_status == 0 {
|
|
5087
|
+ monthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
|
5088
|
+ } else if order_status == 2 {
|
|
5089
|
+ monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFive(admin.CurrentOrgId, patient_id, order.Number, p_type)
|
|
5090
|
+ }
|
|
5091
|
+
|
|
5092
|
+ case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
|
|
5093
|
+ patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
|
|
5094
|
+
|
|
5095
|
+ lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
|
|
5096
|
+
|
|
5097
|
+ doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
|
|
5098
|
+ //获取所有科室信息
|
|
5099
|
+ department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
|
|
5100
|
+
|
|
5101
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
5102
|
+ "his_info": his_patient_info,
|
|
5103
|
+ "xt_info": xt_patient_info,
|
|
5104
|
+ "case_history": case_history,
|
|
5105
|
+ "info": patientPrescriptionInfo,
|
|
5106
|
+ "last_info": lastPatientPrescriptionInfo,
|
|
5107
|
+ "month_prescriptions": monthPrescriptions,
|
|
5108
|
+ "order": order,
|
|
5109
|
+ "doctors": doctors,
|
|
5110
|
+ "department": department,
|
|
5111
|
+ })
|
|
5112
|
+ return
|
|
5113
|
+}
|
|
5114
|
+
|
|
5115
|
+func (c *HisApiController) GetHisMonthPatientInfo() {
|
|
5116
|
+ patient_id, _ := c.GetInt64("patient_id")
|
|
5117
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
5118
|
+ record_date := c.GetString("record_date")
|
|
5119
|
+ number := c.GetString("number")
|
|
5120
|
+ start_time := c.GetString("start_time")
|
|
5121
|
+ end_time := c.GetString("end_time")
|
|
5122
|
+ p_type, _ := c.GetInt64("p_type")
|
|
5123
|
+
|
|
5124
|
+ timeLayout := "2006-01-02"
|
|
5125
|
+ loc, _ := time.LoadLocation("Local")
|
|
5126
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
5127
|
+ if err != nil {
|
|
5128
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
5129
|
+ return
|
|
5130
|
+ }
|
|
5131
|
+ recordDateTime := theTime.Unix()
|
|
5132
|
+ startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
5133
|
+ if err != nil {
|
|
5134
|
+
|
|
5135
|
+ }
|
|
5136
|
+ startRecordDateTime := startTime.Unix()
|
|
5137
|
+ endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
5138
|
+ if err != nil {
|
|
5139
|
+
|
|
5140
|
+ }
|
|
5141
|
+ endRecordDateTime := endTime.Unix()
|
|
5142
|
+ admin := c.GetAdminUserInfo()
|
|
5143
|
+ his_patient_info, _ := service.GetNewHisPatientInfoTwo(admin.CurrentOrgId, his_patient_id, recordDateTime)
|
|
5144
|
+ xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
|
|
5145
|
+
|
|
5146
|
+ count, _ := service.GetHisPatientCount(admin.CurrentOrgId, patient_id, recordDateTime)
|
|
5147
|
+
|
|
5148
|
+ monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
|
|
5149
|
+ case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
|
|
5150
|
+ patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
|
|
5151
|
+ lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
|
|
5152
|
+
|
|
5153
|
+ order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
|
|
5154
|
+ doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
|
|
5155
|
+
|
|
5156
|
+ _, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(admin.CurrentOrgId)
|
|
5157
|
+ //获取所有科室信息
|
|
5158
|
+ department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
|
|
5159
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
5160
|
+ "his_info": his_patient_info,
|
|
5161
|
+ "xt_info": xt_patient_info,
|
|
5162
|
+ "case_history": case_history,
|
|
5163
|
+ "info": patientPrescriptionInfo,
|
|
5164
|
+ "month_prescriptions": monthPrescriptions,
|
|
5165
|
+ "order": order,
|
|
5166
|
+ "doctors": doctors,
|
|
5167
|
+ "department": department,
|
|
5168
|
+ "count": count,
|
|
5169
|
+ "drugStockConfig": drugStockConfig,
|
|
5170
|
+ "last_info": lastPatientPrescriptionInfo,
|
|
5171
|
+ })
|
|
5172
|
+ return
|
|
5173
|
+
|
|
5174
|
+}
|