张保健 1 gadu atpakaļ
vecāks
revīzija
a71f4af45a
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      service/inspection_service.go

+ 4 - 0
service/inspection_service.go Parādīt failu

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