Browse Source

耗材参数

XMLWAN 3 years ago
parent
commit
948c8d7e91

+ 1 - 1
conf/app.conf View File

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

+ 2 - 1
controllers/dialysis_api_controller.go View File

@@ -3200,7 +3200,8 @@ func (this *DialysisApiController) GetTodayMonitor() {
3200 3200
 
3201 3201
 			if template.TemplateId == 6 && adminInfo.CurrentOrgId == 10234 {
3202 3202
 
3203
-				ultrafiltration_rate = math.Floor((prescription.TargetUltrafiltration) / float64(totalMin) * 60 * 1000)
3203
+				dehydration, _ := strconv.ParseFloat(evaluation.Dehydration, 64)
3204
+				ultrafiltration_rate = math.Floor((prescription.TargetUltrafiltration + dehydration) / float64(totalMin) * 60 * 1000)
3204 3205
 
3205 3206
 				record.UltrafiltrationRate = ultrafiltration_rate
3206 3207
 			}

+ 3 - 2
controllers/dialysis_record_api_controller.go View File

@@ -739,7 +739,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
739 739
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
740 740
 		return
741 741
 	}
742
-	fmt.Println("hhaaaaaaa888888888323232323232333232322333323232", adminUserInfo.CurrentOrgId)
742
+
743 743
 	dialysisRecord = &models.DialysisOrder{
744 744
 		DialysisDate:           recordDate.Unix(),
745 745
 		UserOrgId:              adminUserInfo.CurrentOrgId,
@@ -800,7 +800,8 @@ func (this *DialysisRecordAPIController) StartDialysis() {
800 800
 
801 801
 				if template.TemplateId == 6 && adminUserInfo.CurrentOrgId == 10234 {
802 802
 					if evaluation.ID > 0 {
803
-						ultrafiltration_rate = math.Floor((prescription.TargetUltrafiltration) / float64(totalMin) * 60 * 1000)
803
+						dehydration, _ := strconv.ParseFloat(evaluation.Dehydration, 64)
804
+						ultrafiltration_rate = math.Floor((prescription.TargetUltrafiltration + dehydration) / float64(totalMin) * 60 * 1000)
804 805
 					}
805 806
 				}
806 807
 

+ 1 - 1
controllers/gobal_config_api_controller.go View File

@@ -1854,7 +1854,7 @@ func (c *GobalConfigApiController) GetDrugStockList() {
1854 1854
 	adminUserInfo := c.GetAdminUserInfo()
1855 1855
 
1856 1856
 	list, total, err := service.GetAllBaseDurgListCount(page, limit, keyword, drug_type, startTime, endTime, adminUserInfo.CurrentOrgId)
1857
-	fmt.Println("total232323232323232232323", total)
1857
+
1858 1858
 	manufacturerList, _ := service.GetAllManufacturerList(adminUserInfo.CurrentOrgId)
1859 1859
 	if err != nil {
1860 1860
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)

+ 13 - 8
controllers/mobile_api_controllers/check_weight_api_controller.go View File

@@ -269,10 +269,12 @@ func (c *CheckWeightApiController) SaveBloodPressure() {
269 269
 		afterevaluation.DiastolicBloodPressure = diastolic_blood_pressure // 舒张压
270 270
 		afterevaluation.PulseFrequency = pulse_frequency                  // 脉率
271 271
 
272
-		afterevaluation.LeaveOfficeMethod = assessmentAfterDislysis.LeaveOfficeMethod //离科方式
273
-		afterevaluation.Lapse = assessmentAfterDislysis.Lapse                         //转归
274
-		afterevaluation.Consciousness = assessmentAfterDislysis.Consciousness         //意识
275
-		afterevaluation.Fallrisk = assessmentAfterDislysis.Fallrisk                   //跌倒风险
272
+		if adminUserInfo.Org.Id == 10138 {
273
+			afterevaluation.LeaveOfficeMethod = assessmentAfterDislysis.LeaveOfficeMethod //离科方式
274
+			afterevaluation.Lapse = assessmentAfterDislysis.Lapse                         //转归
275
+			afterevaluation.Consciousness = assessmentAfterDislysis.Consciousness         //意识
276
+			afterevaluation.Fallrisk = assessmentAfterDislysis.Fallrisk                   //跌倒风险
277
+		}
276 278
 
277 279
 		err := service.UpdateAssessmentAfterDislysisRecord(&afterevaluation)
278 280
 		if err == nil {
@@ -704,10 +706,13 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
704 706
 		afterevaluation.WeightAfter = weight_after
705 707
 		afterevaluation.WeightLoss = weight_loss
706 708
 
707
-		afterevaluation.LeaveOfficeMethod = assessmentAfterDislysis.LeaveOfficeMethod //离科方式
708
-		afterevaluation.Lapse = assessmentAfterDislysis.Lapse                         //转归
709
-		afterevaluation.Consciousness = assessmentAfterDislysis.Consciousness         //意识
710
-		afterevaluation.Fallrisk = assessmentAfterDislysis.Fallrisk
709
+		if adminUserInfo.Org.Id == 10138 {
710
+			afterevaluation.LeaveOfficeMethod = assessmentAfterDislysis.LeaveOfficeMethod //离科方式
711
+			afterevaluation.Lapse = assessmentAfterDislysis.Lapse                         //转归
712
+			afterevaluation.Consciousness = assessmentAfterDislysis.Consciousness         //意识
713
+			afterevaluation.Fallrisk = assessmentAfterDislysis.Fallrisk
714
+		}
715
+
711 716
 		// if (adminUserInfo.Org.Id == 9538){
712 717
 		// 	afterevaluation.ActualUltrafiltration = weight_loss * 1000  //中能建的计量单位是毫升(ml)
713 718
 		// } else {

+ 6 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -1493,7 +1493,7 @@ func (c *DialysisAPIController) Finish() {
1493 1493
 		tempassessmentAfterDislysis.ActualDisplacement = endmonitorRecords.DisplacementQuantity
1494 1494
 
1495 1495
 	}
1496
-	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 9671 {
1496
+	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 {
1497 1497
 		evaluation, _ := service.MobileGetPredialysisEvaluation(adminUserInfo.Org.Id, id, recordDate.Unix())
1498 1498
 		if evaluation.SystolicBloodPressure == 0 {
1499 1499
 			evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
@@ -1542,6 +1542,11 @@ func (c *DialysisAPIController) Finish() {
1542 1542
 		tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume / 1000
1543 1543
 	}
1544 1544
 
1545
+	if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10233 {
1546
+
1547
+		tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume / 1000
1548
+	}
1549
+
1545 1550
 	if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10060 {
1546 1551
 		tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
1547 1552
 	}

+ 2 - 1
controllers/schedule_api_controller.go View File

@@ -2369,6 +2369,7 @@ func (this *ScheduleApiController) GetBloodScheduleList() {
2369 2369
 	orgId := this.GetAdminUserInfo().CurrentOrgId
2370 2370
 	if week_type > 0 {
2371 2371
 		list, err := service.GetWeekDayScheduleByIdThee(orgId, targetDay.Unix(), week_time, zone)
2372
+
2372 2373
 		if err != nil {
2373 2374
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2374 2375
 			return
@@ -2383,7 +2384,7 @@ func (this *ScheduleApiController) GetBloodScheduleList() {
2383 2384
 	if week_type == 0 {
2384 2385
 		startDate, _ := utils.ParseTimeStringToTime("2006-01-02", startTime)
2385 2386
 		list, err := service.GetWeekDayScheduleByIdTwo(orgId, targetDay.Unix(), week_time, startDate.Unix(), zone)
2386
-		fmt.Println("e23332232323232323322323", err)
2387
+
2387 2388
 		if err != nil {
2388 2389
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2389 2390
 			return

+ 8 - 7
models/schedule_models.go View File

@@ -132,13 +132,13 @@ type WeekSchedule struct {
132 132
 	UpdatedTime  int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
133 133
 	IsExport     int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
134 134
 
135
-	Patient              string                 `gorm:"-" json:"patient" form:"patient"`
136
-	DeviceZone           DeviceZone             `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
137
-	DeviceNumber         DeviceNumber           `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
138
-	DialysisPrescription DialysisSolution       `json:"prescription" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
139
-	DoctorAdvice         []*DoctorAdvice        `json:"doctoradvice" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
140
-	HisDoctorAdviceInfo  []*HisDoctorAdviceInfo `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
141
-	//DialysisSolution     []*DialysisSolution    `json:"dialysissolution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
135
+	Patient                    string                     `gorm:"-" json:"patient" form:"patient"`
136
+	DeviceZone                 DeviceZone                 `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
137
+	DeviceNumber               DeviceNumber               `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
138
+	DialysisPrescription       DialysisSolution           `json:"prescription" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
139
+	DoctorAdvice               []*DoctorAdvice            `json:"doctoradvice" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
140
+	HisDoctorAdviceInfo        []*HisDoctorAdviceInfo     `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
141
+	Solution                   []*DialysisSolution        `json:"solution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
142 142
 	DialysisSolution           DialysisSolution           `json:"dialysissolution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
143 143
 	XtAssessmentBeforeDislysis XtAssessmentBeforeDislysis `json:"assessmentbefor" gorm:"foreignkey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,ScheduleDate"`
144 144
 }
@@ -197,6 +197,7 @@ type VmSchedulesRemind struct {
197 197
 	HisDoctorAdviceInfo        []*HisDoctorAdviceInfo     `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
198 198
 	DialysisSolution           DialysisSolution           `json:"dialysissolution" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
199 199
 	XtAssessmentBeforeDislysis XtAssessmentBeforeDislysis `json:"assessmentbefor" gorm:"foreignkey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
200
+	Solution                   []*DialysisSolution        `json:"solution" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
200 201
 }
201 202
 
202 203
 func (VmSchedulesRemind) TableName() string {

+ 8 - 2
service/schedule_service.go View File

@@ -608,7 +608,9 @@ func GetWeekDayScheduleByIdThee(orgid int64, scheduleDate int64, scheduleType in
608 608
 	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("XtAssessmentBeforeDislysis", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
609 609
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
610 610
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
611
-		return db.Where("status =1").Group("mode_id").Order("id asc")
611
+		return db.Where("status =1").Order("id asc")
612
+	}).Preload("Solution", func(db *gorm.DB) *gorm.DB {
613
+		return db.Where("status =1").Group("patient_id,mode_id").Order("id desc")
612 614
 	}).Find(&list).Error
613 615
 
614 616
 	return list, err
@@ -633,7 +635,9 @@ func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int
633 635
 	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("XtAssessmentBeforeDislysis", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
634 636
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
635 637
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
636
-		return db.Where("status =1").Group("mode_id").Order("id asc")
638
+		return db.Where("status =1").Order("id asc")
639
+	}).Preload("Solution", func(db *gorm.DB) *gorm.DB {
640
+		return db.Where("status =1").Group("patient_id,mode_id").Order("id desc")
637 641
 	}).Find(&list).Error
638 642
 
639 643
 	return list, err
@@ -820,6 +824,8 @@ func GetNextWeekDaySchedule(weektype int64, weektime int64, startime int64, endt
820 824
 			return db.Where("status = 1").Order("id asc")
821 825
 		}).Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
822 826
 		return db.Where("status = 1").Order("id asc")
827
+	}).Preload("Solution", func(db *gorm.DB) *gorm.DB {
828
+		return db.Where("status = 1").Group("patient_id,mode_id").Order("id desc")
823 829
 	}).Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
824 830
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
825 831
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Joins("JOIN xt_patients as p ON p.id = s.patient_id").