Browse Source

历史排班

28169 1 year ago
parent
commit
4717ada4be

+ 2 - 2
controllers/dialysis_api_controller.go View File

@@ -2536,13 +2536,13 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2536 2536
 		if dialysisFinish.ID == 0 {
2537 2537
 			service.CreateDialysisFinish(finish)
2538 2538
 		}
2539
-		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 {
2539
+		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 {
2540 2540
 			var dewater_amount float64
2541 2541
 			dewater_amount = 0
2542 2542
 			if dry_weight > 0 {
2543 2543
 				dewater_amount = weight_before - dry_weight - additional_weight
2544 2544
 
2545
-				if adminUserInfo.CurrentOrgId != 10551 {
2545
+				if adminUserInfo.CurrentOrgId != 10551 && adminUserInfo.CurrentOrgId != 10579 {
2546 2546
 					dewater_amount = dewater_amount * 1000
2547 2547
 				}
2548 2548
 

+ 2 - 2
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -2600,9 +2600,9 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2600 2600
 	if evaluation.DryWeight > 0 {
2601 2601
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
2602 2602
 
2603
-		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 || template.TemplateId == 32 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10551 {
2603
+		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 || template.TemplateId == 32 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10551 || adminUserInfo.Org.Id == 10579 {
2604 2604
 
2605
-			if adminUserInfo.Org.Id != 10551 {
2605
+			if adminUserInfo.Org.Id != 10551 && adminUserInfo.Org.Id != 10579 {
2606 2606
 				dewater_amount = dewater_amount * 1000
2607 2607
 			}
2608 2608
 

+ 1 - 1
controllers/schedule_api_controller.go View File

@@ -1360,7 +1360,7 @@ func (c *ScheduleApiController) GetPatients() {
1360 1360
 	weekEnd := theEndTime.Unix()
1361 1361
 
1362 1362
 	patients, _ := service.GetPatientWithScheduleAndSolution(adminInfo.CurrentOrgId, keywords, weekStart, weekEnd, schedule, contagion)
1363
-	fmt.Println("patinets23233232323232232322323wode", patients)
1363
+
1364 1364
 	c.ServeSuccessJSON(map[string]interface{}{
1365 1365
 		"patients": patients,
1366 1366
 	})

+ 1 - 1
models/schedule_models.go View File

@@ -342,7 +342,7 @@ type VmBloodSchedule struct {
342 342
 	DialysisPrescription       DialysisPrescription       `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"dialysis_prescription"`
343 343
 	XtAssessmentBeforeDislysis XtAssessmentBeforeDislysis `gorm:"ForeignKey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,ScheduleDate" json:"assessment_befor_dislysis"`
344 344
 	XtDoctorAdvice             XtDoctorAdvice             `gorm:"ForeignKey:PatientId,AdviceDate;AssociationForeignKey:PatientId,ScheduleDate" json:"xt_doctor_advice"`
345
-	XtDoctorAdviceOne          XtDoctorAdvice             `gorm:"ForeignKey:PatientId,AdviceDate;AssociationForeignKey:PatientId,ScheduleDate" json:"advice"`
345
+	XtDoctorAdviceOne          []*XtDoctorAdvice          `gorm:"ForeignKey:PatientId,AdviceDate;AssociationForeignKey:PatientId,ScheduleDate" json:"advice"`
346 346
 	HisDoctorAdvice            HisDoctorAdvice            `gorm:"ForeignKey:PatientId,AdviceDate;AssociationForeignKey:PatientId,ScheduleDate" json:"his_doctor_advice"`
347 347
 	ReceiveTreatmentAsses      ReceiveTreatmentAsses      `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"xt_receive_treatment_asses"`
348 348
 	XtAssessmentAfterDislysis  XtAssessmentAfterDislysis  `gorm:"ForeignKey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,ScheduleDate" json:"xt_assesment_after_dislysis"`

+ 6 - 5
service/patient_schedule_template_service.go View File

@@ -296,11 +296,11 @@ func CreatePatientScheduleTemplateThree(orgID int64) (*PatientScheduleTemplateVi
296 296
 }
297 297
 
298 298
 type PatientScheduleTemplatePatientVM struct {
299
-	ID         int64  `gorm:"column:id" json:"id" form:"id"`
300
-	Name       string `gorm:"column:name" json:"name" form:"name"`
301
-	DialysisNo string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
302
-
303
-	Contagions []*PatientScheduleContagion `gorm:"ForeignKey:PatientID" json:"contagions"`
299
+	ID          int64                       `gorm:"column:id" json:"id" form:"id"`
300
+	Name        string                      `gorm:"column:name" json:"name" form:"name"`
301
+	DialysisNo  string                      `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
302
+	FirstLetter string                      `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
303
+	Contagions  []*PatientScheduleContagion `gorm:"ForeignKey:PatientID" json:"contagions"`
304 304
 }
305 305
 
306 306
 func (PatientScheduleTemplatePatientVM) TableName() string {
@@ -897,6 +897,7 @@ type SchTemplatePatient struct {
897 897
 	Status       int64  `gorm:"column:status" json:"status" form:"status"`
898 898
 	DialysisNo   string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
899 899
 	IsInfectious int64  `gorm:"column:is_infectious" json:"is_infectious"`
900
+	FirstLetter  string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
900 901
 }
901 902
 
902 903
 func (SchTemplatePatient) TableName() string {

+ 2 - 2
service/schedule_service.go View File

@@ -52,7 +52,7 @@ func GetPatientWithScheduleAndSolution(orgID int64, keywords string, weekStart,
52 52
 		Where("p.user_org_id=? and p.lapseto=1 and p.status=1", orgID)
53 53
 	if len(keywords) > 0 {
54 54
 		likeKey := "%" + keywords + "%"
55
-		db = db.Where("p.name LIKE ?", likeKey)
55
+		db = db.Where("p.name LIKE ? or p.first_letter LIKE ?", likeKey, likeKey)
56 56
 	}
57 57
 
58 58
 	if schedule == 1 {
@@ -671,7 +671,7 @@ func GetSchedualPatientsByKeywordsAndWeek(keywords string, org_id int64, start_t
671 671
 		Preload("DeviceZone", "status = 1 ").
672 672
 		Preload("DeviceNumber", "status = 1 ").
673 673
 		Preload("TreatmentMode", "status = 1 ").
674
-		Joins("JOIN xt_patients as p ON p.id = s.patient_id AND (p.name LIKE ? OR p.dialysis_no LIKE ?)", likeKey, likeKey).
674
+		Joins("JOIN xt_patients as p ON p.id = s.patient_id AND (p.name LIKE ? OR p.dialysis_no LIKE ? OR p.first_letter LIKE ?)", likeKey, likeKey, likeKey).
675 675
 		Where("s.user_org_id=? and s.schedule_date >= ? and s.schedule_date <= ? and s.status=1", org_id, start_time, end_time).
676 676
 		Select("s.id, s.user_org_id, s.partition_id, s.bed_id, s.patient_id, s.schedule_date, s.schedule_type, s.schedule_week, s.mode_id, s.status, s.created_time, s.updated_time, p.name as patient").
677 677
 		Order("schedule_date asc").