张保健 hace 1 año
padre
commit
a71f4af45a
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      service/inspection_service.go

+ 4 - 0
service/inspection_service.go Ver fichero

@@ -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 {