|
@@ -608,6 +608,15 @@ func GetDialyzerData(start_time int64, end_time int64, org_id int64) (dr []Dialy
|
608
|
608
|
return
|
609
|
609
|
}
|
610
|
610
|
|
|
611
|
+func GetIrrigationData(start_time int64, end_time int64, org_id int64) (dr []DialyzerResult, err error) {
|
|
612
|
+ err = XTReadDB().Model(&models.DialysisPrescription{}).
|
|
613
|
+ Select("dialysis_irrigation as dialyzer, COUNT(*) as count").
|
|
614
|
+ Where("record_date >= ? and record_date <= ? and user_org_id = ? and status = 1", start_time, end_time, org_id).
|
|
615
|
+ Group("dialysis_irrigation").
|
|
616
|
+ Scan(&dr).Error
|
|
617
|
+ return
|
|
618
|
+}
|
|
619
|
+
|
611
|
620
|
func GetDialyzerTotal(start_time int64, end_time int64, org_id int64) (total int64, err error) {
|
612
|
621
|
err = XTReadDB().Model(&models.DialysisPrescription{}).
|
613
|
622
|
Where("status = 1 and record_date >= ? and record_date <= ? and user_org_id = ? and dialysis_dialyszers <> ''", start_time, end_time, org_id).
|
|
@@ -617,7 +626,7 @@ func GetDialyzerTotal(start_time int64, end_time int64, org_id int64) (total int
|
617
|
626
|
|
618
|
627
|
func GetPrescriptionByAnticoagulant(page int64, limit int64, orgid int64, anticoagulant int64, start_time int64, end_time int64) (solution []*models.DialysisPrescription, total int64, err error) {
|
619
|
628
|
|
620
|
|
- db := XTReadDB().Model(&models.DialysisPrescription{}).Where("status = 1")
|
|
629
|
+ db := XTReadDB().Model(&models.DialysisPrescription{}).Preload("QCPatients", "status = 1 and user_org_id = ?", orgid).Where("status = 1")
|
621
|
630
|
if anticoagulant > 0 {
|
622
|
631
|
db = db.Where("anticoagulant = ?", anticoagulant)
|
623
|
632
|
}
|