|
@@ -32,6 +32,8 @@ func HisHospitalManagerApiRegistRouters() {
|
32
|
32
|
beego.Router("/api/hospitaldetail/list", &HisHospitalApiController{}, "get:GetHisHospitalDetailPatientList")
|
33
|
33
|
beego.Router("/api/hospitaldetail/info", &HisHospitalApiController{}, "get:GetHisHospitalDetailInfo")
|
34
|
34
|
|
|
35
|
+ beego.Router("/api/monthhospitaldetail/get", &HisHospitalApiController{}, "get:GetHisHospitalMonthDetailInfo")
|
|
36
|
+
|
35
|
37
|
}
|
36
|
38
|
|
37
|
39
|
func (c *HisHospitalApiController) GetHisHospitalPatientList() {
|
|
@@ -752,3 +754,41 @@ func (c *HisHospitalApiController) GetHisHospitalDetailInfo() {
|
752
|
754
|
"his_info": record,
|
753
|
755
|
})
|
754
|
756
|
}
|
|
757
|
+func (c *HisHospitalApiController) GetHisHospitalMonthDetailInfo() {
|
|
758
|
+ id, _ := c.GetInt64("id")
|
|
759
|
+ is_upload, _ := c.GetInt64("is_upload")
|
|
760
|
+ patient_id, _ := c.GetInt64("patient_id")
|
|
761
|
+ start_time_str := c.GetString("start_time")
|
|
762
|
+ end_time_str := c.GetString("end_time")
|
|
763
|
+
|
|
764
|
+ record, _ := service.GetInHospitalRecord(id)
|
|
765
|
+ timeLayout := "2006-01-02"
|
|
766
|
+ loc, _ := time.LoadLocation("Local")
|
|
767
|
+ adminInfo := c.GetAdminUserInfo()
|
|
768
|
+ theStartTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_str+" 00:00:00", loc)
|
|
769
|
+ if err != nil {
|
|
770
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
771
|
+ return
|
|
772
|
+ }
|
|
773
|
+ recordStartTime := theStartTime.Unix()
|
|
774
|
+ theEndTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_str+" 00:00:00", loc)
|
|
775
|
+ if err != nil {
|
|
776
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
777
|
+ return
|
|
778
|
+ }
|
|
779
|
+ recordEndTime := theEndTime.Unix()
|
|
780
|
+ //var prescriptions []*models.HisPrescription
|
|
781
|
+
|
|
782
|
+ var monthPrescriptions []*models.HisPrescription
|
|
783
|
+ if is_upload == 1 {
|
|
784
|
+ monthPrescriptions, _ = service.GetMonthUnUploadHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
|
|
785
|
+ } else if is_upload == 2 {
|
|
786
|
+ monthPrescriptions, _ = service.GetMonthUploadHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
|
|
787
|
+ } else {
|
|
788
|
+ monthPrescriptions, _ = service.GetAllMonthHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
|
|
789
|
+ }
|
|
790
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
791
|
+ "month_prescriptions": monthPrescriptions,
|
|
792
|
+ "his_info": record,
|
|
793
|
+ })
|
|
794
|
+}
|