Przeglądaj źródła

库存调拨修改

28169 1 rok temu
rodzic
commit
fc63dec14d

+ 4 - 1
controllers/mobile_api_controllers/check_weight_api_controller.go Wyświetl plik

@@ -379,7 +379,10 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
379 379
 			newprescribe.DewaterAmount = dewater_amount
380 380
 			newprescribe.TargetUltrafiltration = dewater_amount
381 381
 			newprescribe.Status = 1
382
-			newprescribe.Remark = dialysisSolution.Remark
382
+			if adminUserInfo.Org.Id != 10013 && adminUserInfo.Org.Id != 10014 {
383
+				newprescribe.Remark = dialysisSolution.Remark
384
+			}
385
+
383 386
 			if adminUserInfo.Org.Id == 10340 {
384 387
 				newprescribe.TargetUltrafiltration = 0
385 388
 				newprescribe.Sodium = 138

+ 83 - 82
controllers/mobile_api_controllers/dialysis_api_controller.go Wyświetl plik

@@ -1898,7 +1898,7 @@ func (c *DialysisAPIController) Finish() {
1898 1898
 
1899 1899
 	}
1900 1900
 
1901
-	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 {
1901
+	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 {
1902 1902
 		evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
1903 1903
 		if evaluation.SystolicBloodPressure == 0 {
1904 1904
 			evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
@@ -2000,6 +2000,11 @@ func (c *DialysisAPIController) Finish() {
2000 2000
 		tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
2001 2001
 	}
2002 2002
 
2003
+	if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10432 {
2004
+		tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
2005
+		tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
2006
+	}
2007
+
2003 2008
 	if lastAssessmentAfterDislysis != nil {
2004 2009
 		tempassessmentAfterDislysis.BloodPressureType = lastAssessmentAfterDislysis.BloodPressureType
2005 2010
 
@@ -2087,85 +2092,6 @@ func (c *DialysisAPIController) Finish() {
2087 2092
 		return
2088 2093
 	}
2089 2094
 
2090
-	//下机完自动消毒,针对长沙南雅
2091
-	if dialysisOrder.Stage == 1 {
2092
-		if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
2093
-			//根据床位号获取设备型号
2094
-			unitType, _ := service.GetUnitType(dialysisOrder.BedID, dialysisOrder.UserOrgId)
2095
-			//查询使用消毒最后一条消毒记录
2096
-			_, err := service.GetLaseDeviceInfomation(dialysisOrder.UserOrgId, dialysisOrder.BedID, dialysisOrder.DialysisDate, dialysisOrder.SchedualType)
2097
-			fmt.Println("err", err)
2098
-			if err == gorm.ErrRecordNotFound {
2099
-				//查找排班
2100
-				scheduleByPatient, _ := service.GetScheduleByPatient(dialysisOrder.PatientId, dialysisOrder.DialysisDate, dialysisOrder.UserOrgId)
2101
-				//查询改设备是否有消毒计划
2102
-				plan, errcode := service.GetDisInfectionTime(dialysisOrder.UserOrgId, unitType.UnitType, dialysisOrder.SchedualType, scheduleByPatient.ScheduleWeek)
2103
-
2104
-				//根据床位号获取设备id
2105
-				addmacher, _ := service.GetEquimentIDTwo(dialysisOrder.BedID, dialysisOrder.UserOrgId)
2106
-
2107
-				//查询病人信息
2108
-				patients, _ := service.GetPatientInfoMation(dialysisOrder.PatientId)
2109
-				var con = ""
2110
-				if patients.IsInfectious == 0 {
2111
-					con = ""
2112
-				}
2113
-				if patients.IsInfectious == 1 {
2114
-					con = "无"
2115
-				}
2116
-				if patients.IsInfectious == 2 {
2117
-					con = "有"
2118
-				}
2119
-
2120
-				//如果没有消毒计划,去查询该设备的上次消毒时间
2121
-				if errcode == gorm.ErrRecordNotFound {
2122
-					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2123
-					return
2124
-				}
2125
-				if errcode == nil {
2126
-					var end_time int64
2127
-					end_time = endDate.Unix() + plan.DisinfecTime*60
2128
-					//新增消毒
2129
-					information := models.DeviceInformation{
2130
-						Date:                  dialysisOrder.DialysisDate,
2131
-						Zone:                  dialysisOrder.ZoneId,
2132
-						Class:                 dialysisOrder.SchedualType,
2133
-						BedNumber:             dialysisOrder.BedID,
2134
-						PatientId:             dialysisOrder.PatientId,
2135
-						DialysisMode:          scheduleByPatient.ModeId,
2136
-						LongTime:              strconv.FormatInt(plan.DisinfecTime, 10),
2137
-						Disinfection:          1,
2138
-						DialysisConcentration: 1,
2139
-						DisinfectionStatus:    1,
2140
-						Move:                  1,
2141
-						UserOrgId:             dialysisOrder.UserOrgId,
2142
-						DisinfectType:         plan.Way,
2143
-						DisinfectantType:      plan.MachineDisinfectant,
2144
-						FluidPath:             plan.DisinfectanWay, //液路消毒方式
2145
-						Disinfectant:          plan.Disinfectant,
2146
-						Ctime:                 time.Now().Unix(),
2147
-						Status:                1,
2148
-						SignName:              dialysisOrder.FinishNurse,
2149
-						EquimentId:            addmacher.ID,
2150
-						DisinfectionResidue:   2,
2151
-						Bed:                   addmacher.BedNumber,
2152
-						StartTime:             dialysisOrder.StartTime,
2153
-						EndTime:               dialysisOrder.EndTime,
2154
-						Contagion:             con,
2155
-						WeightLoss:            0,
2156
-						Hyperfiltratio:        0,
2157
-						DialysisHour:          "",
2158
-						MachineRun:            1,
2159
-						DisinfecStartime:      endDate.Unix(),
2160
-						DisinfecEndtime:       end_time,
2161
-					}
2162
-					err := service.CreateInformationTwo(&information)
2163
-					fmt.Println("报错", err)
2164
-				}
2165
-			}
2166
-		}
2167
-	}
2168
-
2169 2095
 	if dialysisOrder.Stage == 1 {
2170 2096
 		err := service.ModifyDialysisRecord(dialysisOrder.ID, nurseID, endDate.Unix(), adminUserInfo.AdminUser.Id, puncture_point_haematoma, internal_fistula, catheter, cruor, mission)
2171 2097
 
@@ -2180,6 +2106,80 @@ func (c *DialysisAPIController) Finish() {
2180 2106
 		//结束时候透析次数加1
2181 2107
 		service.UpdateSolutionByPatientId(id)
2182 2108
 
2109
+		//下机完自动消毒,针对长沙南雅
2110
+		if dialysisOrder.Stage == 1 {
2111
+			if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
2112
+				//根据床位号获取设备型号
2113
+				unitType, _ := service.GetUnitType(dialysisOrder.BedID, dialysisOrder.UserOrgId)
2114
+				//查询使用消毒最后一条消毒记录
2115
+				_, err := service.GetLaseDeviceInfomation(dialysisOrder.UserOrgId, dialysisOrder.BedID, dialysisOrder.DialysisDate, dialysisOrder.SchedualType)
2116
+				fmt.Println("err", err)
2117
+				if err == gorm.ErrRecordNotFound {
2118
+					//查找排班
2119
+					scheduleByPatient, _ := service.GetScheduleByPatient(dialysisOrder.PatientId, dialysisOrder.DialysisDate, dialysisOrder.UserOrgId)
2120
+					//查询改设备是否有消毒计划
2121
+					plan, errcode := service.GetDisInfectionTime(dialysisOrder.UserOrgId, unitType.UnitType, dialysisOrder.SchedualType, scheduleByPatient.ScheduleWeek)
2122
+
2123
+					//根据床位号获取设备id
2124
+					addmacher, _ := service.GetEquimentIDTwo(dialysisOrder.BedID, dialysisOrder.UserOrgId)
2125
+
2126
+					//查询病人信息
2127
+					patients, _ := service.GetPatientInfoMation(dialysisOrder.PatientId)
2128
+					var con = ""
2129
+					if patients.IsInfectious == 0 {
2130
+						con = ""
2131
+					}
2132
+					if patients.IsInfectious == 1 {
2133
+						con = "无"
2134
+					}
2135
+					if patients.IsInfectious == 2 {
2136
+						con = "有"
2137
+					}
2138
+
2139
+					if errcode == nil {
2140
+						var end_time int64
2141
+						end_time = endDate.Unix() + plan.DisinfecTime*60
2142
+						//新增消毒
2143
+						information := models.DeviceInformation{
2144
+							Date:                  dialysisOrder.DialysisDate,
2145
+							Zone:                  dialysisOrder.ZoneId,
2146
+							Class:                 dialysisOrder.SchedualType,
2147
+							BedNumber:             dialysisOrder.BedID,
2148
+							PatientId:             dialysisOrder.PatientId,
2149
+							DialysisMode:          scheduleByPatient.ModeId,
2150
+							LongTime:              strconv.FormatInt(plan.DisinfecTime, 10),
2151
+							Disinfection:          1,
2152
+							DialysisConcentration: 1,
2153
+							DisinfectionStatus:    1,
2154
+							Move:                  1,
2155
+							UserOrgId:             dialysisOrder.UserOrgId,
2156
+							DisinfectType:         plan.Way,
2157
+							DisinfectantType:      plan.MachineDisinfectant,
2158
+							FluidPath:             plan.DisinfectanWay, //液路消毒方式
2159
+							Disinfectant:          plan.Disinfectant,
2160
+							Ctime:                 time.Now().Unix(),
2161
+							Status:                1,
2162
+							SignName:              nurseID,
2163
+							EquimentId:            addmacher.ID,
2164
+							DisinfectionResidue:   2,
2165
+							Bed:                   addmacher.BedNumber,
2166
+							StartTime:             dialysisOrder.StartTime,
2167
+							EndTime:               dialysisOrder.EndTime,
2168
+							Contagion:             con,
2169
+							WeightLoss:            0,
2170
+							Hyperfiltratio:        0,
2171
+							DialysisHour:          "",
2172
+							MachineRun:            1,
2173
+							DisinfecStartime:      endDate.Unix(),
2174
+							DisinfecEndtime:       end_time,
2175
+						}
2176
+						err := service.CreateInformationTwo(&information)
2177
+						fmt.Println("报错", err)
2178
+					}
2179
+				}
2180
+			}
2181
+		}
2182
+
2183 2183
 		dialysisOrder.Stage = 2
2184 2184
 		dialysisOrder.FinishNurse = nurseID
2185 2185
 		dialysisOrder.FinishCreator = adminUserInfo.AdminUser.Id
@@ -2596,8 +2596,9 @@ func (this *DialysisAPIController) StartDialysis() {
2596 2596
 		if errcode == nil {
2597 2597
 			record.SystolicBloodPressure = befor.SystolicBloodPressure
2598 2598
 			record.DiastolicBloodPressure = befor.DiastolicBloodPressure
2599
-
2600
-			record.BreathingRate = befor.BreathingRate
2599
+			if adminUserInfo.Org.Id != 10445 {
2600
+				record.BreathingRate = befor.BreathingRate
2601
+			}
2601 2602
 			record.PulseFrequency = befor.PulseFrequency
2602 2603
 			record.Temperature = befor.Temperature
2603 2604
 		}

+ 8 - 1
controllers/print_data_api_controller.go Wyświetl plik

@@ -141,7 +141,14 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
141 141
 		for _, item := range schedules {
142 142
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
143 143
 			if this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 9671 && this.GetAdminUserInfo().CurrentOrgId != 10345 {
144
-				item.Count = list.Count
144
+				if this.GetAdminUserInfo().CurrentOrgId == 10445 {
145
+					listOrder, _ := service.GetDialysisOrderCountTen(item.PatientID, item.ScheduleDate)
146
+					item.Count = listOrder.DialysisTotal
147
+				}
148
+				if this.GetAdminUserInfo().CurrentOrgId != 10445 {
149
+					item.Count = list.Count
150
+				}
151
+
145 152
 			}
146 153
 			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 {
147 154
 				//listOne, _ := service.GetDialysisOrderCountEight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)

+ 7 - 6
models/dialysis.go Wyświetl plik

@@ -792,12 +792,13 @@ type DialysisOrders struct {
792 792
 }
793 793
 
794 794
 type VmDialysisOrder struct {
795
-	Count        int64
796
-	DialysisDate int64 `gorm:"column:dialysis_date" json:"dialysis_date"`
797
-	UserOrgId    int64 `gorm:"column:user_org_id" json:"user_org_id"`
798
-	PatientId    int64 `gorm:"column:patient_id" json:"patient_id"`
799
-	Stage        int64 `gorm:"column:stage" json:"stage"`
800
-	Status       int64 `gorm:"column:status" json:"status"`
795
+	Count         int64
796
+	DialysisDate  int64 `gorm:"column:dialysis_date" json:"dialysis_date"`
797
+	UserOrgId     int64 `gorm:"column:user_org_id" json:"user_org_id"`
798
+	PatientId     int64 `gorm:"column:patient_id" json:"patient_id"`
799
+	Stage         int64 `gorm:"column:stage" json:"stage"`
800
+	Status        int64 `gorm:"column:status" json:"status"`
801
+	DialysisTotal int64 `gorm:"column:dialysis_total" json:"dialysis_total" form:"dialysis_total"`
801 802
 }
802 803
 
803 804
 func (VmDialysisOrder) TableName() string {

+ 7 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go Wyświetl plik

@@ -207,7 +207,13 @@ func GetDialysisOrderCount(orgID int64, patient_id int64, recordDate int64) (cou
207 207
 
208 208
 func GetDialysisOrderCountSeven(patient_id int64, recordDate int64) (models.VmDialysisOrder, error) {
209 209
 	order := models.VmDialysisOrder{}
210
-	err := p_service.XTReadDB().Raw("SELECT Count(id) as count,Max(dialysis_date) as dialysis_date  from xt_dialysis_order where dialysis_date <= ? AND status = 1 AND stage = 2 AND patient_id = ?", recordDate, patient_id).Scan(&order).Error
210
+	err := p_service.XTReadDB().Raw("SELECT Count(id) as count,Max(dialysis_date) as dialysis_date,dialysis_total from xt_dialysis_order where dialysis_date <= ? AND status = 1 AND stage = 2 AND patient_id = ?", recordDate, patient_id).Scan(&order).Error
211
+	return order, err
212
+}
213
+
214
+func GetDialysisOrderCountTen(patient_id int64, recordDate int64) (models.VmDialysisOrder, error) {
215
+	order := models.VmDialysisOrder{}
216
+	err := p_service.XTReadDB().Where("patient_id = ? and dialysis_date = ? and status = 1", patient_id, recordDate).Last(&order).Error
211 217
 	return order, err
212 218
 }
213 219