|
@@ -296,7 +296,7 @@ func GetHisPrescription(org_id int64, patient_id int64, record_date int64) (pres
|
296
|
296
|
return
|
297
|
297
|
}
|
298
|
298
|
|
299
|
|
-func GetNewHisPrescription(org_id int64, his_patient_id int64, record_date int64) (prescription []*models.HisPrescription, err error) {
|
|
299
|
+func GetNewHisPrescription(org_id int64, his_patient_id int64, record_date int64, reg_type string) (prescription []*models.HisPrescription, err error) {
|
300
|
300
|
err = readDb.Model(&models.HisPrescription{}).
|
301
|
301
|
Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
|
302
|
302
|
return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("XtHisAddtionConfig", "status=1")
|
|
@@ -307,7 +307,7 @@ func GetNewHisPrescription(org_id int64, his_patient_id int64, record_date int64
|
307
|
307
|
Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
|
308
|
308
|
return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1").Preload("GoodInfo", "status=1")
|
309
|
309
|
}).
|
310
|
|
- Where("user_org_id = ? AND status = 1 AND record_date = ? AND his_patient_id = ? AND order_status <> 2 AND p_type <> 1", org_id, record_date, his_patient_id).
|
|
310
|
+ Where("user_org_id = ? AND status = 1 AND record_date = ? AND his_patient_id = ? AND order_status <> 2 AND p_type <> 1 AND med_type = ?", org_id, record_date, his_patient_id, reg_type).
|
311
|
311
|
Find(&prescription).Error
|
312
|
312
|
return
|
313
|
313
|
}
|
|
@@ -1023,7 +1023,7 @@ func FindSickById(id int64) (*models.OutpatientServiceSick, error) {
|
1023
|
1023
|
// return "his_prescription"
|
1024
|
1024
|
//}
|
1025
|
1025
|
|
1026
|
|
-func GetMonthHisPrescription(org_id int64, patient_id int64, start_time int64, end_time int64) (prescription []*models.HisPrescription, err error) {
|
|
1026
|
+func GetMonthHisPrescription(org_id int64, patient_id int64, start_time int64, end_time int64, reg_type string) (prescription []*models.HisPrescription, err error) {
|
1027
|
1027
|
err = readDb.Model(&models.HisPrescription{}).
|
1028
|
1028
|
Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
|
1029
|
1029
|
return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("XtHisAddtionConfig", "status=1")
|
|
@@ -1034,7 +1034,7 @@ func GetMonthHisPrescription(org_id int64, patient_id int64, start_time int64, e
|
1034
|
1034
|
Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
|
1035
|
1035
|
return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1").Preload("GoodInfo", "status=1")
|
1036
|
1036
|
}).
|
1037
|
|
- Where("user_org_id = ? AND record_date >= ? AND record_date <= ? AND patient_id = ? AND order_status <> 2 AND status = 1 AND p_type <> 1", org_id, start_time, end_time, patient_id).
|
|
1037
|
+ Where("user_org_id = ? AND record_date >= ? AND record_date <= ? AND patient_id = ? AND order_status <> 2 AND status = 1 AND p_type <> 1 AND med_type = ?", org_id, start_time, end_time, patient_id, reg_type).
|
1038
|
1038
|
Find(&prescription).Error
|
1039
|
1039
|
return
|
1040
|
1040
|
}
|