Explorar el Código

11月9日库存管理

XMLWAN hace 2 años
padre
commit
713f4d2b10

+ 3 - 0
controllers/dialysis_record_api_controller.go Ver fichero

@@ -1128,6 +1128,9 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1128 1128
 
1129 1129
 				record.Temperature = 36.5
1130 1130
 				record.ArterialPressure = -100
1131
+				record.Conductivity = 14
1132
+				record.BreathingRate = "20"
1133
+				record.DialysateTemperature = 36.5
1131 1134
 			}
1132 1135
 
1133 1136
 			err := service.CreateMonitor(&record)

+ 3 - 0
controllers/mobile_api_controllers/check_weight_api_controller.go Ver fichero

@@ -376,6 +376,8 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
376 376
 			newprescribe.DewaterAmount = dewater_amount
377 377
 			newprescribe.TargetUltrafiltration = dewater_amount
378 378
 			newprescribe.Status = 1
379
+			newprescribe.Remark = dialysisSolution.Remark
380
+
379 381
 			//插入透析处方
380 382
 			err := service.AddSigleRecord(&newprescribe)
381 383
 			key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
@@ -443,6 +445,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
443 445
 				newprescribe.DewaterAmount = dewater_amount
444 446
 				newprescribe.TargetUltrafiltration = dewater_amount
445 447
 				newprescribe.Status = 1
448
+				newprescribe.Remark = lastDialysisPrescribe.Remark
446 449
 
447 450
 				err := service.AddSigleRecord(&newprescribe)
448 451
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"

+ 16 - 21
controllers/mobile_api_controllers/dialysis_api_controller.go Ver fichero

@@ -87,10 +87,8 @@ func (this *DialysisAPIController) Scheduals() {
87 87
 	defer redis.Close()
88 88
 
89 89
 	key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
90
-	fmt.Println("key22332323232232323", key)
91 90
 	scheduals_json_str, _ := redis.Get(key).Result()
92
-	redis.Set(key, "", time.Second)
93
-	fmt.Println("scheduals_json_str2333223323232323232w", scheduals_json_str)
91
+	redis.Set(scheduals_json_str, "", time.Second)
94 92
 	patients, _ := service.GetAllPatientListSix(orgID)
95 93
 	if len(scheduals_json_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
96 94
 		scheduals, err := service.MobileGetDialysisScheduals(orgID, date.Unix(), schedualType)
@@ -100,13 +98,11 @@ func (this *DialysisAPIController) Scheduals() {
100 98
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
101 99
 		} else {
102 100
 			if len(scheduals) > 0 {
103
-
104 101
 				devices, _ := service.GetAllDevicetByListSix(orgID)
105 102
 				advices, _ := service.GetAllAdvicestByList(orgID, date.Unix())
106 103
 				prescriptions, _ := service.GetAllPrescriptionsByList(orgID, date.Unix())
107 104
 				assessmentBefores, _ := service.GetAllAssessmentBeforesByList(orgID, date.Unix())
108 105
 				dialysisOrders, _ := service.GetAllDialysisOrdersByList(orgID, date.Unix())
109
-
110 106
 				treatmentSummarys, _ := service.GetAllTreatmentSummarysByList(orgID, date.Unix())
111 107
 				AssessmentAfterDislysis, _ := service.GetAllAssessmentAfterDislysisByList(orgID, date.Unix())
112 108
 				hisAdvices, _ := service.GetAllHisAdvicesByList(orgID, date.Unix())
@@ -220,27 +216,11 @@ func (this *DialysisAPIController) Scheduals() {
220 216
 			project, _ = service.GetAllHisProjectPrescription(orgID, date.Unix())
221 217
 		}
222 218
 
223
-		//获取今日透析准备的数据
224
-		//goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
225
-		//fmt.Println("goodlist23323232323233232332233223323233", goodList, err)
226
-		//
227
-		//list, err := service.MobileGetDialysisGoodsSix(orgID, date.Unix())
228
-		//
229
-		//for _, item := range goodList {
230
-		//	for _, it := range list {
231
-		//		if item.RecordDate == it.RecordDate && item.PatientId == it.PatientId {
232
-		//			item.Children = append(item.Children, it)
233
-		//		}
234
-		//	}
235
-		//}
236
-		//autoList, _ := service.GetMobileAutoReduce(orgID, date.Unix())
237 219
 		this.ServeSuccessJSON(map[string]interface{}{
238 220
 			"scheduals": dat,
239 221
 			"redis":     "true",
240 222
 			"date":      schedualDate,
241 223
 			"project":   project,
242
-			//"goodList":  goodList,
243
-			//"autoList":  autoList,
244 224
 		})
245 225
 
246 226
 	}
@@ -2441,6 +2421,10 @@ func (this *DialysisAPIController) StartDialysis() {
2441 2421
 		if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 9675 {
2442 2422
 			record.Temperature = 36.5
2443 2423
 			record.ArterialPressure = -100
2424
+			record.DialysateTemperature = 36.5
2425
+			record.Conductivity = 14
2426
+			record.BreathingRate = "20"
2427
+
2444 2428
 		}
2445 2429
 		err := service.CreateMonitor(&record)
2446 2430
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":monitor_records"
@@ -6984,3 +6968,14 @@ func (this *DialysisAPIController) GetScheduleByPatient() {
6984 6968
 	})
6985 6969
 
6986 6970
 }
6971
+
6972
+func (this *DialysisAPIController) GetDialysisRecordOrder() {
6973
+
6974
+	org_id := this.GetMobileAdminUserInfo().Org.Id
6975
+	patient_id, _ := this.GetInt64("patient_id")
6976
+	schedule_date, _ := this.GetInt64("schedule_date")
6977
+	order, _ := service.GetDialysisRecordOrder(org_id, patient_id, schedule_date)
6978
+	this.ServeSuccessJSON(map[string]interface{}{
6979
+		"order": order,
6980
+	})
6981
+}

+ 1 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go Ver fichero

@@ -172,4 +172,5 @@ func MobileAPIControllersRegisterRouters() {
172 172
 
173 173
 	beego.Router("/m/api/patient/getschedulebypatient", &DialysisAPIController{}, "Get:GetScheduleByPatient")
174 174
 
175
+	beego.Router("/m/api/getdialysisrecordeorder", &DialysisAPIController{}, "Get:GetDialysisRecordOrder")
175 176
 }

+ 12 - 6
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Ver fichero

@@ -241,6 +241,8 @@ func (this *NewDialysisApiController) SavePatient() {
241 241
 
242 242
 	treatmentmethod := int64(dataBody["treatmentMethod"].(float64))
243 243
 
244
+	remark := dataBody["remark"].(string)
245
+
244 246
 	//查询身份证号码是否存在
245 247
 	thisPatientOne, _ := service.FindPatientByIdCardNoFive(orgid, idCard)
246 248
 	if thisPatientOne.ID > 0 {
@@ -289,6 +291,7 @@ func (this *NewDialysisApiController) SavePatient() {
289 291
 			IsInfectious:      is_infectious,
290 292
 			RegistrarsId:      adminInfo.AdminUser.Id,
291 293
 			RelativePhone:     relative_phone,
294
+			Remark:            remark,
292 295
 		}
293 296
 		err = service.CreateOldPatient(&patients)
294 297
 		fmt.Print("报错", err)
@@ -330,6 +333,7 @@ func (this *NewDialysisApiController) SavePatient() {
330 333
 			IdCardNo:          idCard,
331 334
 			RegistrarsId:      adminInfo.AdminUser.Id,
332 335
 			RelativePhone:     relative_phone,
336
+			Remark:            remark,
333 337
 		}
334 338
 		err = service.CreateNewPatient(&patientsNew)
335 339
 		key := strconv.FormatInt(orgid, 10) + ":" + strconv.FormatInt(patient.ID, 10) + ":patient_info"
@@ -346,12 +350,9 @@ func (this *NewDialysisApiController) SavePatient() {
346 350
 			"patient": patientsNew,
347 351
 		})
348 352
 	}
349
-
350
-	fmt.Print("slowpatient", slowpatient)
351 353
 	//如果是慢病病人
352 354
 	if slowpatient == 1 {
353 355
 		_, errcodetwo := service.GetSlowPatientData(phone, orgid)
354
-		fmt.Print("查询慢慢是吧", errcodetwo)
355 356
 		if errcodetwo == gorm.ErrRecordNotFound {
356 357
 			patients := models.CdmPatients{
357 358
 				Name:        name,
@@ -399,6 +400,7 @@ func (this *NewDialysisApiController) SavePatient() {
399 400
 					IsInfectious:      is_infectious,
400 401
 					IdCardNo:          idCard,
401 402
 					EquitmentId:       requipmentId,
403
+					Remark:            remark,
402 404
 				}
403 405
 				err = service.CreateNewPatient(&patientsNew)
404 406
 				if err != nil {
@@ -409,9 +411,8 @@ func (this *NewDialysisApiController) SavePatient() {
409 411
 					"patient": patientsNew,
410 412
 				})
411 413
 			} else if errcodetwo == nil {
412
-				fmt.Print("病人已存在")
414
+
413 415
 				if memberpatient == 1 {
414
-					fmt.Print("进来没有", memberpatient)
415 416
 					_, errmembercode := service.GetMemberPatientInfo(orgid, phone)
416 417
 					if errmembercode == gorm.ErrRecordNotFound {
417 418
 						customer := models.SgjUserCustomer{
@@ -498,7 +499,6 @@ func (this *NewDialysisApiController) SavePatient() {
498 499
 	}
499 500
 
500 501
 	if memberpatient == 1 {
501
-		fmt.Print("进来没有", memberpatient)
502 502
 		_, errmembercode := service.GetMemberPatientInfo(orgid, phone)
503 503
 		if errmembercode == gorm.ErrRecordNotFound {
504 504
 			customer := models.SgjUserCustomer{
@@ -547,6 +547,7 @@ func (this *NewDialysisApiController) SavePatient() {
547 547
 					MemberPatienttype: patient_type,
548 548
 					MemberTreatement:  treatmentmethod,
549 549
 					RelativePhone:     relative_phone,
550
+					Remark:            remark,
550 551
 				}
551 552
 				err = service.CreateNewPatient(&patientsNew)
552 553
 				fmt.Print("报错", err)
@@ -1330,6 +1331,7 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1330 1331
 
1331 1332
 	out_reason := dataBody["out_reason"].(string)
1332 1333
 
1334
+	remark := dataBody["remark"].(string)
1333 1335
 	fmt.Print(fisttime)
1334 1336
 	//如果是血透病人
1335 1337
 	if bloodPatient == 1 {
@@ -1384,6 +1386,7 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1384 1386
 			DeathTime:         death_time,
1385 1387
 			OutReason:         out_reason,
1386 1388
 			RelativePhone:     relative_phone,
1389
+			Remark:            remark,
1387 1390
 		}
1388 1391
 		err = service.UpdatedPatient(patients, patient.BloodId)
1389 1392
 		key := strconv.FormatInt(orgid, 10) + ":" + strconv.FormatInt(patient.BloodId, 10) + ":patient_info"
@@ -1414,6 +1417,7 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1414 1417
 			OutReason:         out_reason,
1415 1418
 			DeathTime:         death_time,
1416 1419
 			RelativePhone:     relative_phone,
1420
+			Remark:            remark,
1417 1421
 		}
1418 1422
 		err = service.UpdateXtPatientNew(patientsNew, id)
1419 1423
 		if err != nil {
@@ -1472,6 +1476,7 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1472 1476
 			OutReason:         out_reason,
1473 1477
 			DeathTime:         death_time,
1474 1478
 			RelativePhone:     relative_phone,
1479
+			Remark:            remark,
1475 1480
 		}
1476 1481
 		err = service.UpdateXtPatientNew(xtPatientsNew, id)
1477 1482
 		fmt.Print("更新失败", err)
@@ -1529,6 +1534,7 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1529 1534
 			OutReason:         out_reason,
1530 1535
 			DeathTime:         death_time,
1531 1536
 			RelativePhone:     relative_phone,
1537
+			Remark:            remark,
1532 1538
 		}
1533 1539
 		err = service.UpdateXtPatientNewOne(patientsNew, id)
1534 1540
 		if err != nil {

+ 0 - 1
controllers/new_mobile_api_controllers/new_manage_api_controller.go Ver fichero

@@ -230,7 +230,6 @@ func (this *NewManageApiController) GetDeviceInformation() {
230 230
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
231 231
 		return
232 232
 	}
233
-	fmt.Println("recordDate2222222", recordDate.Unix())
234 233
 	//查询今日所有设备使用登记
235 234
 	information, err := service.GetDeviceInfomation(orgid, recordDate.Unix())
236 235
 	if err != nil {

+ 21 - 0
models/patient_models.go Ver fichero

@@ -54,6 +54,27 @@ func (MDialysisOrderForList) TableName() string {
54 54
 	return "xt_dialysis_order"
55 55
 }
56 56
 
57
+type MDialysisOrderForListSix struct {
58
+	ID                 int64  `gorm:"column:id" json:"id"`
59
+	DialysisDate       int64  `gorm:"column:dialysis_date" json:"dialysis_date"`
60
+	UserOrgId          int64  `gorm:"column:user_org_id" json:"user_org_id"`
61
+	PatientId          int64  `gorm:"column:patient_id" json:"patient_id"`
62
+	Stage              int64  `gorm:"column:stage" json:"stage"`
63
+	BedID              int64  `gorm:"column:bed_id" json:"bed_id"`
64
+	StartNurse         int64  `gorm:"column:start_nurse" json:"start_nurse"`
65
+	Status             int64  `gorm:"column:status" json:"status"`
66
+	Creator            int64  `gorm:"column:creator" json:"creator"`
67
+	WashpipeNurse      int64  `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
68
+	NucleinDate        int64  `gorm:"column:nuclein_date" json:"nuclein_date" form:"nuclein_date"`
69
+	EndTime            int64  `gorm:"column:end_time" json:"end_time" form:"end_time"`
70
+	DialysisIrrigation string `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
71
+	DialysisDialyszers string `gorm:"column:dialysis_dialyszers" json:"dialysis_dialyszers" form:"dialysis_dialyszers"`
72
+}
73
+
74
+func (MDialysisOrderForListSix) TableName() string {
75
+	return "xt_dialysis_order"
76
+}
77
+
57 78
 type VMTreatmentSummaryForList struct {
58 79
 	ID              int64  `gorm:"column:id" json:"id"`
59 80
 	UserOrgId       int64  `gorm:"column:user_org_id" json:"user_org_id"`

+ 7 - 0
service/dialysis_service.go Ver fichero

@@ -1855,3 +1855,10 @@ func GetSchedulePrintListOne(page int64, limit int64, schedulType int64, partiti
1855 1855
 	err = db.Group("schedule_type,partition_id").Find(&list).Error
1856 1856
 	return list, err
1857 1857
 }
1858
+
1859
+func GetDialysisRecordOrder(org_id int64, patient_id int64, dialysis_date int64) (models.MDialysisOrderForListSix, error) {
1860
+
1861
+	order := models.MDialysisOrderForListSix{}
1862
+	err := XTReadDB().Where("user_org_id = ? and patient_id = ? and dialysis_date = ? and status =1 ", org_id, patient_id, dialysis_date).Find(&order).Error
1863
+	return order, err
1864
+}

+ 1 - 1
service/patient_service.go Ver fichero

@@ -304,7 +304,7 @@ func GetAllDialysisOrdersByList(orgID int64, scheduleDate int64) (dialysisOrders
304 304
 	defer redis.Close()
305 305
 	key := strconv.FormatInt(orgID, 10) + ":" + strconv.FormatInt(scheduleDate, 10) + ":dialysis_orders_list_all"
306 306
 	dialysis_orders_list_all, _ := redis.Get(key).Result()
307
-
307
+	redis.Set(dialysis_orders_list_all, "", time.Second)
308 308
 	if len(dialysis_orders_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
309 309
 		err = readDb.Model(&models.MDialysisOrderForList{}).Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).Where("status = 1 AND user_org_id = ? AND dialysis_date = ?", orgID, scheduleDate).Find(&dialysisOrders).Error
310 310
 

+ 1 - 1
service/patientmanage_service.go Ver fichero

@@ -957,7 +957,7 @@ func UpdatedPatient(patients models.Patients, id int64) error {
957 957
 
958 958
 func UpdateXtPatientNew(patients models.XtPatientsNew, id int64) error {
959 959
 
960
-	err := XTWriteDB().Model(&patients).Where("id=?", id).Update(map[string]interface{}{"name": patients.Name, "gender": patients.Gender, "birthday": patients.Birthday, "age": patients.Age, "phone": patients.Phone, "lapseto": patients.Lapseto, "admission_number": patients.AdmissionNumber, "first_dialysis_date": patients.FirstDialysisDate, "diagnose": patients.Diagnose, "source": patients.Source, "dialysis_no": patients.DialysisNo, "avatar": patients.Avatar, "id_card_no": patients.IdCardNo, "is_infectious": patients.IsInfectious, "out_reason": patients.OutReason, "death_time": patients.DeathTime, "relative_phone": patients.RelativePhone}).Error
960
+	err := XTWriteDB().Model(&patients).Where("id=?", id).Update(map[string]interface{}{"name": patients.Name, "gender": patients.Gender, "birthday": patients.Birthday, "age": patients.Age, "phone": patients.Phone, "lapseto": patients.Lapseto, "admission_number": patients.AdmissionNumber, "first_dialysis_date": patients.FirstDialysisDate, "diagnose": patients.Diagnose, "source": patients.Source, "dialysis_no": patients.DialysisNo, "avatar": patients.Avatar, "id_card_no": patients.IdCardNo, "is_infectious": patients.IsInfectious, "out_reason": patients.OutReason, "death_time": patients.DeathTime, "relative_phone": patients.RelativePhone, "remark": patients.Remark}).Error
961 961
 
962 962
 	return err
963 963
 }