浏览代码

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 1年前
父节点
当前提交
ce72f5d1d1
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 5 0
      controllers/zuobiao_api_controller.go
  2. 6 0
      service/zuobiao_service.go

+ 5 - 0
controllers/zuobiao_api_controller.go 查看文件

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

+ 6 - 0
service/zuobiao_service.go 查看文件

113
 	err = readDb.Model(&models.HisZuobiaoAdvice{}).Where("id = ? and status = 1", id).First(&zuobiao).Error
113
 	err = readDb.Model(&models.HisZuobiaoAdvice{}).Where("id = ? and status = 1", id).First(&zuobiao).Error
114
 	return
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
+}