|
@@ -883,7 +883,7 @@ func GetAllInspection(orgid int64) (inspection []*models.XtInspectionReference,
|
883
|
883
|
}
|
884
|
884
|
|
885
|
885
|
func GetInspection(patientid int64, startime int64, endtime int64, limit int64, page int64, orgid int64) (inspection []*models.Inspection, total int64, err error) {
|
886
|
|
- fmt.Print(limit, page)
|
|
886
|
+
|
887
|
887
|
db := XTReadDB().Table("xt_inspection as x").Where("x.status = 1")
|
888
|
888
|
if patientid > 0 {
|
889
|
889
|
db = db.Where("x.patient_id = ?", patientid)
|
|
@@ -901,3 +901,25 @@ func GetInspection(patientid int64, startime int64, endtime int64, limit int64,
|
901
|
901
|
Select("x.id,x.patient_id,x.org_id,x.project_id,x.item_id,x.item_name,x.project_name,x.inspect_type,x.inspect_value,x.inspect_date,x.created_time").Find(&inspection).Error
|
902
|
902
|
return inspection, total, err
|
903
|
903
|
}
|
|
904
|
+
|
|
905
|
+func GetInspectionDetail(patientid int64, date int64, orgid int64, projectid int64) (inspection []*models.Inspection, err error) {
|
|
906
|
+
|
|
907
|
+ db := XTReadDB().Table("xt_inspection as x").Where("x.status =1")
|
|
908
|
+
|
|
909
|
+ if patientid > 0 {
|
|
910
|
+ db = db.Where("x.patient_id = ?", patientid)
|
|
911
|
+ }
|
|
912
|
+
|
|
913
|
+ if date > 0 {
|
|
914
|
+ db = db.Where("x.inspect_date = ?", date)
|
|
915
|
+ }
|
|
916
|
+ if orgid > 0 {
|
|
917
|
+
|
|
918
|
+ db = db.Where("x.org_id = ?", orgid)
|
|
919
|
+ }
|
|
920
|
+ if projectid > 0 {
|
|
921
|
+ db = db.Where("x.project_id = ?", projectid)
|
|
922
|
+ }
|
|
923
|
+ err = db.Select("x.id,x.patient_id,x.org_id,x.project_id,x.item_id,x.item_name,x.project_name,x.inspect_type,x.inspect_value,x.inspect_date,x.status,x.created_time,x.updated_time").Scan(&inspection).Error
|
|
924
|
+ return inspection, err
|
|
925
|
+}
|