XMLWAN пре 2 година
родитељ
комит
7c5d97ea97

+ 1 - 1
conf/app.conf Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9531
2
+httpport = 9529
3 3
 runmode = dev
4 4
 #dev/prod
5 5
 

+ 4 - 1
controllers/dialysis_api_controller.go Прегледај датотеку

@@ -4711,7 +4711,10 @@ func (c *DialysisApiController) GetSchedulePrintList() {
4711 4711
 	adminUserInfo := c.GetAdminUserInfo()
4712 4712
 
4713 4713
 	list, total, _ := service.GetSchedulePrintList(page, limit, schedulType, partitionType, keywords, theStartTime, adminUserInfo.CurrentOrgId)
4714
-
4714
+	for _, item := range list {
4715
+		order, _ := service.GetLastOrder(item.UserOrgId, item.PatientId, item.ScheduleDate)
4716
+		item.DialysisOrderTwenty = order
4717
+	}
4715 4718
 	listOne, _ := service.GetSchedulePrintListOne(page, limit, schedulType, partitionType, keywords, theStartTime, adminUserInfo.CurrentOrgId)
4716 4719
 	numberList, _ := service.GetAllBedNumberSix(adminUserInfo.CurrentOrgId)
4717 4720
 	c.ServeSuccessJSON(map[string]interface{}{

+ 43 - 3
controllers/print_data_api_controller.go Прегледај датотеку

@@ -37,9 +37,49 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
37 37
 	idStrs := strings.Split(schIDStr, ",")
38 38
 	adminUserInfo := this.GetAdminUserInfo()
39 39
 
40
-	if this.GetAdminUserInfo().CurrentOrgId == 10016 {
41
-		schedules, getScheduleErr := service.GetSchedulesSix(adminUserInfo.CurrentOrgId, idStrs)
40
+	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9671 {
41
+		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
42 42
 		for _, item := range schedules {
43
+
44
+			//获取透析上机
45
+			order, _ := service.GetBatchDialysisOrder(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
46
+			item.DialysisOrder = order
47
+
48
+			//获取透析处方
49
+			prescription, _ := service.GetBatchPrescription(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
50
+			item.Prescription = prescription
51
+			//接诊评估
52
+			receiveTreatmentAsses, _ := service.GetBatchReceiveTreatmentAsses(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
53
+			item.ReceiveAssessment = receiveTreatmentAsses
54
+
55
+			//透前评估
56
+			assessmentBeforeDislysisVM, _ := service.GetBatchAssessmentBeforeDislysisVM(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
57
+			item.AssessmentBeforeDislysis = assessmentBeforeDislysisVM
58
+
59
+			//透后评估
60
+			assessmentAfterDislysisVM, _ := service.GetBatchAssessmentAfterDislysisVM(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
61
+			item.AssessmentAfterDislysis = assessmentAfterDislysisVM
62
+
63
+			//上次透后体重
64
+			lastAfterWeight, _ := service.GetBatchLastAfterWeight(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
65
+			item.LastAfterWeight = lastAfterWeight
66
+
67
+			//透析监测
68
+			monitor, _ := service.GetBatchMonitor(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
69
+			item.MonitoringRecords = monitor
70
+
71
+			//透析医嘱
72
+			advice, _ := service.GetBatchDoctorAdvice(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
73
+			item.Advices = advice
74
+
75
+			//双人核对
76
+			dobuleCheck, _ := service.GetBatchDobuleCheck(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
77
+			item.DoubleCheck = dobuleCheck
78
+
79
+			//透析小结
80
+			summerVM, _ := service.GetBatchSummerVM(this.GetAdminUserInfo().CurrentOrgId, item.PatientID, item.ScheduleDate)
81
+			item.Summer = summerVM
82
+
43 83
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
44 84
 			if this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 9671 {
45 85
 				item.Count = list.Count
@@ -77,7 +117,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
77 117
 		})
78 118
 	}
79 119
 
80
-	if this.GetAdminUserInfo().CurrentOrgId != 10016 {
120
+	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9671 {
81 121
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
82 122
 		for _, item := range schedules {
83 123
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)

+ 29 - 23
models/dialysis.go Прегледај датотеку

@@ -1232,17 +1232,18 @@ func (HisDoctorAdvice) TableName() string {
1232 1232
 }
1233 1233
 
1234 1234
 type DialysisScheduleSix struct {
1235
-	ID           int64  `gorm:"column:id" json:"id" form:"id"`
1236
-	UserOrgId    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1237
-	PartitionId  int64  `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
1238
-	BedId        int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
1239
-	PatientId    int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1240
-	ScheduleDate int64  `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
1241
-	ScheduleType int64  `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
1242
-	ScheduleWeek int64  `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
1243
-	ModeId       int64  `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
1244
-	Status       int64  `gorm:"column:status" json:"status" form:"status"`
1245
-	Name         string `gorm:"column:name" json:"name" form:"name"`
1235
+	ID                  int64  `gorm:"column:id" json:"id" form:"id"`
1236
+	UserOrgId           int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1237
+	PartitionId         int64  `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
1238
+	BedId               int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
1239
+	PatientId           int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1240
+	ScheduleDate        int64  `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
1241
+	ScheduleType        int64  `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
1242
+	ScheduleWeek        int64  `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
1243
+	ModeId              int64  `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
1244
+	Status              int64  `gorm:"column:status" json:"status" form:"status"`
1245
+	Name                string `gorm:"column:name" json:"name" form:"name"`
1246
+	DialysisOrderTwenty `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"order"`
1246 1247
 }
1247 1248
 
1248 1249
 type DialysisScheduleSeven struct {
@@ -1258,18 +1259,23 @@ func (DialysisScheduleSeven) TableName() string {
1258 1259
 }
1259 1260
 
1260 1261
 type DialysisOrderTwenty struct {
1261
-	ID           int64        `gorm:"column:id" json:"id"`
1262
-	DialysisDate int64        `gorm:"column:dialysis_date" json:"dialysis_date"`
1263
-	UserOrgId    int64        `gorm:"column:user_org_id" json:"user_org_id"`
1264
-	PatientId    int64        `gorm:"column:patient_id" json:"patient_id"`
1265
-	Stage        int64        `gorm:"column:stage" json:"stage"`
1266
-	Remark       string       `gorm:"column:remark" json:"remark"`
1267
-	BedID        int64        `gorm:"column:bed_id" json:"bed_id"`
1268
-	Status       int64        `gorm:"column:status" json:"status"`
1269
-	DeviceNumber DeviceNumber `gorm:"ForeignKey:BedID"`
1270
-	StartTime    int64        `gorm:"column:start_time" json:"start_time"`
1271
-	SchedualType int64        `gorm:"column:schedual_type" json:"schedual_type"`
1272
-	ZoneId       int64        `gorm:"column:zone_id" json:"zone_id" form:"zone_id"`
1262
+	ID                 int64        `gorm:"column:id" json:"id"`
1263
+	DialysisDate       int64        `gorm:"column:dialysis_date" json:"dialysis_date"`
1264
+	UserOrgId          int64        `gorm:"column:user_org_id" json:"user_org_id"`
1265
+	PatientId          int64        `gorm:"column:patient_id" json:"patient_id"`
1266
+	Stage              int64        `gorm:"column:stage" json:"stage"`
1267
+	Remark             string       `gorm:"column:remark" json:"remark"`
1268
+	BedID              int64        `gorm:"column:bed_id" json:"bed_id"`
1269
+	Status             int64        `gorm:"column:status" json:"status"`
1270
+	DeviceNumber       DeviceNumber `gorm:"ForeignKey:BedID"`
1271
+	StartTime          int64        `gorm:"column:start_time" json:"start_time"`
1272
+	SchedualType       int64        `gorm:"column:schedual_type" json:"schedual_type"`
1273
+	ZoneId             int64        `gorm:"column:zone_id" json:"zone_id" form:"zone_id"`
1274
+	BloodAccessId      int64        `gorm:"column:blood_access_id" json:"blood_access_id" form:"blood_access_id"`
1275
+	DialysisIrrigation string       `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
1276
+	DialysisDialyszers string       `gorm:"column:dialysis_dialyszers" json:"dialysis_dialyszers" form:"dialysis_dialyszers"`
1277
+	OrderRemark        string       `gorm:"column:order_remark" json:"order_remark" form:"order_remark"`
1278
+	ScheduleRemark     string       `gorm:"column:schedule_remark" json:"schedule_remark" form:"schedule_remark"`
1273 1279
 }
1274 1280
 
1275 1281
 func (DialysisOrderTwenty) TableName() string {

+ 11 - 0
service/dialysis_service.go Прегледај датотеку

@@ -2027,3 +2027,14 @@ func CheckHisMobileDoctorAdvice(orgid int64, ids []string, advice models.HisDoct
2027 2027
 	err := XTWriteDB().Model(&advice).Where("user_org_id = ? and id in(?) and status = 1", orgid, ids).Updates(map[string]interface{}{"check_time": advice.CheckTime, "checker": advice.Checker, "check_state": 1}).Error
2028 2028
 	return err
2029 2029
 }
2030
+
2031
+func GetLastOrder(user_org_id int64, patient_id int64, dialysis_date int64) (models.DialysisOrderTwenty, error) {
2032
+
2033
+	twenty := models.DialysisOrderTwenty{}
2034
+
2035
+	err := XTReadDB().Where("user_org_id = ? and patient_id =? and dialysis_date < ? and status = 1", user_org_id, patient_id, dialysis_date).Preload("DeviceNumber", func(db *gorm.DB) *gorm.DB {
2036
+		return db.Preload("DeviceZone", "status =1").Where("org_id = ? AND status = 1", user_org_id)
2037
+	}).Order("id desc").First(&twenty).Error
2038
+
2039
+	return twenty, err
2040
+}

+ 7 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go Прегледај датотеку

@@ -102,6 +102,7 @@ type DialysisOrderVM struct {
102 102
 	FinishModifier int64           `gorm:"column:finish_modifier" json:"finish_modifier"`
103 103
 	SchedualType   int64           `gorm:"column:schedual_type" json:"schedual_type"`
104 104
 	WashpipeNurse  int64           `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
105
+	UserOrgId      int64           `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
105 106
 }
106 107
 
107 108
 func (DialysisOrderVM) TableName() string {
@@ -203,7 +204,7 @@ type PrescriptionVM struct {
203 204
 	ReplacementFlow            string  `gorm:"column:replacement_flow" json:"replacement_flow" form:"replacement_flow"`
204 205
 	PlasmaSeparator            string  `gorm:"column:plasma_separator" json:"plasma_separator" form:"plasma_separator"`
205 206
 	BilirubinAdsorptionColumn  string  `gorm:"column:bilirubin_adsorption_column" json:"bilirubin_adsorption_column" form:"bilirubin_adsorption_column"`
206
-
207
+	UserOrgId                  int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
207 208
 	HemodialysisPipelines      string  `gorm:"column:hemodialysis_pipelines" json:"hemodialysis_pipelines" form:"hemodialysis_pipelines"`
208 209
 	HemodialysisPipelinesCount float64 `gorm:"column:hemodialysis_pipelines_count" json:"hemodialysis_pipelines_count" form:"hemodialysis_pipelines_count"`
209 210
 	PunctureNeedle             string  `gorm:"column:puncture_needle" json:"puncture_needle" form:"puncture_needle"`
@@ -288,6 +289,7 @@ type AssessmentBeforeDislysisVM struct {
288 289
 	PreDialysisDrugs               string  `gorm:"column:pre_dialysis_drugs" json:"pre_dialysis_drugs" form:"pre_dialysis_drugs"`
289 290
 	Period                         int64   `gorm:"column:period" json:"period" form:"period"`
290 291
 	EstimatedFoodIntake            string  `gorm:"column:estimated_food_intake" json:"estimated_food_intake" form:"estimated_food_intake"`
292
+	UserOrgId                      int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
291 293
 }
292 294
 
293 295
 func (AssessmentBeforeDislysisVM) TableName() string {
@@ -370,6 +372,7 @@ type AssessmentAfterDislysisVM struct {
370 372
 	Lapse                           int64   `gorm:"column:lapse" json:"lapse" form:"lapse"`
371 373
 	Consciousness                   int64   `gorm:"column:consciousness" json:"consciousness" form:"consciousness"`
372 374
 	Fallrisk                        int64   `gorm:"column:fallrisk" json:"fallrisk" form:"fallrisk"`
375
+	UserOrgId                       int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
373 376
 }
374 377
 
375 378
 func (AssessmentAfterDislysisVM) TableName() string {
@@ -436,6 +439,7 @@ type XtAssessmentAfterDislysisVM struct {
436 439
 	CvcA                            float64 `gorm:"column:cvc_a" json:"cvc_a" form:"cvc_a"`
437 440
 	CvcV                            float64 `gorm:"column:cvc_v" json:"cvc_v" form:"cvc_v"`
438 441
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
442
+	UserOrgId                       int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
439 443
 }
440 444
 
441 445
 func (XtAssessmentAfterDislysisVM) TableName() string {
@@ -464,6 +468,7 @@ type ReceiveAssessmentVM struct {
464 468
 	PsychologicalOther           string `gorm:"column:psychological_other" json:"psychological_other"`
465 469
 	IsPrecaution                 int64  `gorm:"column:is_precaution" json:"is_precaution"`
466 470
 	AdmissionNumber              string `gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
471
+	UserOrgId                    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
467 472
 }
468 473
 
469 474
 func (ReceiveAssessmentVM) TableName() string {
@@ -547,6 +552,7 @@ type MonitoringRecordVM struct {
547 552
 	BloodThickness              float64 `gorm:"column:blood_thickness" json:"blood_thickness" form:"blood_thickness"`
548 553
 	BloodMonitor                float64 `gorm:"column:blood_monitor" json:"blood_monitor" form:"blood_monitor"`
549 554
 	BloodPressureMonitoringSite int64   `gorm:"column:blood_pressure_monitoring_site" json:"blood_pressure_monitoring_site" form:"blood_pressure_monitoring_site"`
555
+	UserOrgId                   int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
550 556
 }
551 557
 
552 558
 func (MonitoringRecordVM) TableName() string {

+ 90 - 0
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go Прегледај датотеку

@@ -322,6 +322,28 @@ func GetWarehouseCancelPrintList(orgid int64, startime int64, endtime int64) (ca
322 322
 	return cancel, err
323 323
 }
324 324
 
325
+func GetSchedulesSeven(orgID int64, schIDs []string) ([]*ScheduleVMSix, error) {
326
+	//recordDateStr := time.Now().Format("2006-01-02")
327
+	//recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
328
+	var schedules []*ScheduleVMSix
329
+	db := p_service.XTReadDB()
330
+	err := db.Model(&ScheduleVMSix{}).
331
+		Preload("Patient", "user_org_id = ? AND status = 1", orgID).
332
+		Preload("DeviceNumber", "org_id = ?", orgID).
333
+		Preload("DeviceZone", "org_id = ?", orgID).
334
+		Where("user_org_id = ? AND status = 1 AND id in (?)", orgID, schIDs).Order("schedule_date asc").
335
+		Find(&schedules).
336
+		Error
337
+	if err != nil {
338
+		return nil, err
339
+	}
340
+	for _, item := range schedules {
341
+		dialysis_count, _ := GetDialysisOrderCount(orgID, item.PatientID, item.ScheduleDate)
342
+		item.Patient.TotalDialysis = dialysis_count
343
+	}
344
+	return schedules, nil
345
+}
346
+
325 347
 func GetSchedulesSix(orgID int64, schIDs []string) ([]*ScheduleVMSix, error) {
326 348
 	recordDateStr := time.Now().Format("2006-01-02")
327 349
 	recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
@@ -365,3 +387,71 @@ func GetSchedulesSix(orgID int64, schIDs []string) ([]*ScheduleVMSix, error) {
365 387
 	}
366 388
 	return schedules, nil
367 389
 }
390
+
391
+func GetBatchDialysisOrder(orgid int64, patient_id int64, dialysis_date int64) (DialysisOrderVM, error) {
392
+
393
+	orderVM := DialysisOrderVM{}
394
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and dialysis_date = ? and status = 1", orgid, patient_id, dialysis_date).Preload("DeviceNumber", "org_id = ? AND status = 1", orgid).Find(&orderVM).Error
395
+	return orderVM, err
396
+}
397
+
398
+func GetBatchPrescription(orgid int64, patient_id int64, record_date int64) (PrescriptionVM, error) {
399
+
400
+	prescriptionVM := PrescriptionVM{}
401
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and record_date = ? and status = 1", orgid, patient_id, record_date).Find(&prescriptionVM).Error
402
+	return prescriptionVM, err
403
+}
404
+
405
+func GetBatchReceiveTreatmentAsses(orgid int64, patient_id int64, record_date int64) (ReceiveAssessmentVM, error) {
406
+
407
+	receiveAssessmentVM := ReceiveAssessmentVM{}
408
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and record_date = ? and status = 1", orgid, patient_id, record_date).Find(&receiveAssessmentVM).Error
409
+	return receiveAssessmentVM, err
410
+}
411
+
412
+func GetBatchAssessmentBeforeDislysisVM(orgid int64, patient_id int64, assessment_date int64) (AssessmentBeforeDislysisVM, error) {
413
+
414
+	AssessmentBeforeDislysisVM := AssessmentBeforeDislysisVM{}
415
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and assessment_date = ? and status = 1", orgid, patient_id, assessment_date).Find(&AssessmentBeforeDislysisVM).Error
416
+	return AssessmentBeforeDislysisVM, err
417
+}
418
+
419
+func GetBatchAssessmentAfterDislysisVM(orgid int64, patient_id int64, assessment_date int64) (AssessmentAfterDislysisVM, error) {
420
+
421
+	assessmentAfterDislysisVM := AssessmentAfterDislysisVM{}
422
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and assessment_date = ? and status = 1", orgid, patient_id, assessment_date).Find(&assessmentAfterDislysisVM).Error
423
+	return assessmentAfterDislysisVM, err
424
+}
425
+
426
+func GetBatchLastAfterWeight(orgid int64, patient_id int64, assessment_date int64) (XtAssessmentAfterDislysisVM, error) {
427
+
428
+	xtAssessmentAfterDislysisVM := XtAssessmentAfterDislysisVM{}
429
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and assessment_date < ? and status = 1", orgid, patient_id, assessment_date).Order("id desc").First(&xtAssessmentAfterDislysisVM).Error
430
+	return xtAssessmentAfterDislysisVM, err
431
+}
432
+
433
+func GetBatchMonitor(orgid int64, patient_id int64, monitoring_date int64) (MonitoringRecordVM []*MonitoringRecordVM, err error) {
434
+
435
+	err = p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and monitoring_date = ? and status = 1", orgid, patient_id, monitoring_date).Order("operate_time asc").Find(&MonitoringRecordVM).Error
436
+	return MonitoringRecordVM, err
437
+}
438
+
439
+func GetBatchDoctorAdvice(orgid int64, patient_id int64, advice_date int64) (DoctorAdviceVM []*DoctorAdviceVM, err error) {
440
+
441
+	err = p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and advice_date = ? and status = 1 and  advice_type = 2", orgid, patient_id, advice_date).Order("start_time asc, groupno desc, id asc").Find(&DoctorAdviceVM).Error
442
+	return DoctorAdviceVM, err
443
+}
444
+
445
+func GetBatchDobuleCheck(orgid int64, patient_id int64, check_date int64) (*DoubleCheckVM, error) {
446
+
447
+	doubleCheckVM := DoubleCheckVM{}
448
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and check_date =? and status = 1", orgid, patient_id, check_date).Find(&doubleCheckVM).Error
449
+	return &doubleCheckVM, err
450
+}
451
+
452
+func GetBatchSummerVM(orgid int64, patient_id int64, assessment_date int64) (*SummerVM, error) {
453
+
454
+	SummerVM := SummerVM{}
455
+	err := p_service.XTReadDB().Where("user_org_id = ? and patient_id = ? and assessment_date =? and status = 1", orgid, patient_id, assessment_date).Find(&SummerVM).Error
456
+	return &SummerVM, err
457
+}