Browse Source

提交代码

陈少旭 1 year ago
parent
commit
ae628bc4c0
2 changed files with 11 additions and 0 deletions
  1. 5 0
      controllers/zuobiao_api_controller.go
  2. 6 0
      service/zuobiao_service.go

+ 5 - 0
controllers/zuobiao_api_controller.go View File

@@ -99,10 +99,13 @@ func (c *ZuobiaoApiController) GetHisZuoBiaoDetailInfo() {
99 99
 	} else if is_upload == 2 {
100 100
 		monthPrescriptions, _ = service.GetMonthUploadHisZuoBiaoPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
101 101
 	}
102
+	prescription_info, _ := service.GetZuoBiaoPrescriptionInfo(c.GetAdminUserInfo().CurrentOrgId, patient.ID)
103
+
102 104
 	c.ServeSuccessJSON(map[string]interface{}{
103 105
 		"prescription":        prescriptions,
104 106
 		"month_prescriptions": monthPrescriptions,
105 107
 		"patient":             patient,
108
+		"prescription_info":   prescription_info,
106 109
 	})
107 110
 }
108 111
 
@@ -112,10 +115,12 @@ func (c *ZuobiaoApiController) GetUploadHisZuoBiaoDetailInfo() {
112 115
 	patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, zuobiao_info.PatientId)
113 116
 	order, _ := service.GetHisOrderByID(zuobiao_info.Oid)
114 117
 	prescription, _ := service.GetHisPrescriptionByBatchNumber(c.GetAdminUserInfo().CurrentOrgId, order.Number)
118
+	prescription_info, _ := service.GetZuoBiaoPrescriptionInfo(c.GetAdminUserInfo().CurrentOrgId, patient.ID)
115 119
 	c.ServeSuccessJSON(map[string]interface{}{
116 120
 		"month_prescriptions": prescription,
117 121
 		"patient":             patient,
118 122
 		"zuobiao_info":        zuobiao_info,
123
+		"prescription_info":   prescription_info,
119 124
 	})
120 125
 }
121 126
 

+ 6 - 0
service/zuobiao_service.go View File

@@ -113,3 +113,9 @@ func GetZuobiaoInfoById(id int64) (err error, zuobiao models.HisZuobiaoAdvice) {
113 113
 	err = readDb.Model(&models.HisZuobiaoAdvice{}).Where("id = ? and status = 1", id).First(&zuobiao).Error
114 114
 	return
115 115
 }
116
+
117
+func GetZuoBiaoPrescriptionInfo(user_org_id int64, patient_id int64) (models.HisPrescriptionInfo, error) {
118
+	info := models.HisPrescriptionInfo{}
119
+	err := XTReadDB().Where("user_org_id = ? and patient_id =?  and status=1", user_org_id, patient_id).Last(&info).Error
120
+	return info, err
121
+}