张保健 1 year ago
parent
commit
a71f4af45a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      service/inspection_service.go

+ 4 - 0
service/inspection_service.go View File

@@ -33,6 +33,10 @@ func GetAdvices(orgid int64, patientid int64, recorddate int64) (advcie []*model
33 33
 	err = XTReadDB().Model(&models.DoctorAdvice{}).Where("patient_id = ? and user_org_id = ? and record_date = ? and status =1", patientid, orgid, recorddate).Find(&advcie).Error
34 34
 	return
35 35
 }
36
+func GetAdvicesByPrescription(orgid int64, patientid int64, recorddate int64) (advcie *models.DoctorAdvice, err error) {
37
+	err = XTReadDB().Model(&models.DoctorAdvice{}).Where("patient_id = ? and user_org_id = ? and record_date = ? and status =1 and is_prescription = 1", patientid, orgid, recorddate).Find(&advcie).Error
38
+	return
39
+}
36 40
 
37 41
 func CreatePatientInspection(inspectins []models.Inspection) (err error) {
38 42
 	if len(inspectins) == 0 {