|
@@ -3209,8 +3209,72 @@ func CreateDeviceValusalMapVrr(vrr models.XtDeviceValusalMapVrr) error {
|
3209
|
3209
|
return err
|
3210
|
3210
|
}
|
3211
|
3211
|
|
3212
|
|
-func GetAdviceListNoExecution(advice_date int64, user_org_id int64) (advice []*models.XtDoctorAdvice, err error) {
|
|
3212
|
+func GetDialysisOrderNoExecution(start_nurse int64, user_org_id int64) (order []*models.XtDialysisOrder, err error) {
|
|
3213
|
+
|
|
3214
|
+ err = XTReadDB().Where("start_nurse = ? and user_org_id =? and status =1", start_nurse, user_org_id).Find(&order).Error
|
|
3215
|
+ return order, err
|
|
3216
|
+}
|
|
3217
|
+
|
|
3218
|
+func GetAdviceListNoExecution(advice_date int64, user_org_id int64, patientIds []int64) (advice []*models.NoDoctorAdvice, err error) {
|
|
3219
|
+
|
|
3220
|
+ db := XTReadDB().Model(advice).Where("status=1 and execution_state = 2 and advice_type = 2")
|
|
3221
|
+
|
|
3222
|
+ if advice_date > 0 {
|
|
3223
|
+ db = db.Where("advice_date= ?", advice_date)
|
|
3224
|
+ }
|
|
3225
|
+ if user_org_id > 0 {
|
|
3226
|
+ db = db.Where("user_org_id =?", user_org_id)
|
|
3227
|
+ }
|
|
3228
|
+ if len(patientIds) > 0 {
|
|
3229
|
+ db = db.Where("patient_id in(?)", patientIds)
|
|
3230
|
+ }
|
|
3231
|
+
|
|
3232
|
+ err = db.Select("patient_id,Count(id) as count,advice_date").Group("patient_id").Find(&advice).Error
|
|
3233
|
+ return advice, err
|
|
3234
|
+}
|
|
3235
|
+
|
|
3236
|
+func GetHisAdviceListNoExecution(advice_date int64, user_org_id int64, patientIds []int64) (advice []*models.HisNoDoctorAdvice, err error) {
|
|
3237
|
+
|
|
3238
|
+ db := XTReadDB().Model(advice).Where("status=1 and execution_state = 2")
|
|
3239
|
+
|
|
3240
|
+ if advice_date > 0 {
|
|
3241
|
+ db = db.Where("advice_date= ?", advice_date)
|
|
3242
|
+ }
|
|
3243
|
+ if user_org_id > 0 {
|
|
3244
|
+ db = db.Where("user_org_id =?", user_org_id)
|
|
3245
|
+ }
|
|
3246
|
+ if len(patientIds) > 0 {
|
|
3247
|
+ db = db.Where("patient_id in(?)", patientIds)
|
|
3248
|
+ }
|
|
3249
|
+
|
|
3250
|
+ err = db.Select("patient_id,Count(id) as count").Group("patient_id").Find(&advice).Error
|
3213
|
3251
|
|
3214
|
|
- err = XTReadDB().Where("advice_date = ? and user_org_id = ? and status =1 and execution_state = 2", advice_date, user_org_id).Find(&advice).Error
|
3215
|
3252
|
return advice, err
|
3216
|
3253
|
}
|
|
3254
|
+
|
|
3255
|
+func GetProjectListNoExecution(record_date int64, user_org_id int64, patientIds []int64) (project []*models.NoHisPrescriptionProject, err error) {
|
|
3256
|
+
|
|
3257
|
+ db := XTReadDB().Model(&project).Where("status=1 and execution_state =0")
|
|
3258
|
+ if record_date > 0 {
|
|
3259
|
+ db = db.Where("record_date= ?", record_date)
|
|
3260
|
+ }
|
|
3261
|
+ if user_org_id > 0 {
|
|
3262
|
+ db = db.Where("user_org_id =?", user_org_id)
|
|
3263
|
+ }
|
|
3264
|
+ if len(patientIds) > 0 {
|
|
3265
|
+ db = db.Where("patient_id in(?)", patientIds)
|
|
3266
|
+ }
|
|
3267
|
+
|
|
3268
|
+ err = db.Select("patient_id,Count(id) as count,record_date as advice_date").Group("patient_id").Find(&project).Error
|
|
3269
|
+ return project, err
|
|
3270
|
+}
|
|
3271
|
+
|
|
3272
|
+func GetPatientNoExecutionList(org_id int64, patientsIds []int64) (patient []*models.XtPatients, err error) {
|
|
3273
|
+
|
|
3274
|
+ err = XTReadDB().Where("user_org_id = ? and id in(?)", org_id, patientsIds).Find(&patient).Error
|
|
3275
|
+ return patient, err
|
|
3276
|
+}
|
|
3277
|
+func FindHisConfig(org_id int64) (err error, config models.XtHisConfig) {
|
|
3278
|
+ err = readDb.Model(&models.XtHisConfig{}).Where("status = 1 AND user_org_id = ?", org_id).First(&config).Error
|
|
3279
|
+ return
|
|
3280
|
+}
|