Sfoglia il codice sorgente

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

陈少旭 2 settimane fa
parent
commit
2dc7041f7e

BIN
XT_New.exe Vedi File


+ 6 - 6
controllers/base_api_controller.go Vedi File

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10164 //机构id
86
+		subscibe.OrgId = 10206 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,8 +93,8 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 12627 //4
96
+		adminUserInfo.CurrentOrgId = 10206 //机构id小英9675或4
97
+		adminUserInfo.CurrentAppId = 7421  //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
100 100
 		this.SetSession("admin_user_info", &adminUserInfo)
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10164 //机构id小英9675或4
332
+		subscibe.OrgId = 10206 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,8 +339,8 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 12627 //4
342
+		adminUserInfo.CurrentOrgId = 10206 //机构id小英9675或4
343
+		adminUserInfo.CurrentAppId = 7421  //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes
346 346
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 44 - 1
controllers/dialysis_api_controller.go Vedi File

@@ -2573,7 +2573,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2573 2573
 			service.CreateDialysisFinish(finish)
2574 2574
 		}
2575 2575
 
2576
-		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 || adminUserInfo.CurrentOrgId == 10580 || adminUserInfo.CurrentOrgId == 10585 || adminUserInfo.CurrentOrgId == 10344 || adminUserInfo.CurrentOrgId == 10622 || adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10635 || adminUserInfo.CurrentOrgId == 10723 || adminUserInfo.CurrentOrgId == 10164 {
2576
+		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 || adminUserInfo.CurrentOrgId == 10580 || adminUserInfo.CurrentOrgId == 10585 || adminUserInfo.CurrentOrgId == 10344 || adminUserInfo.CurrentOrgId == 10622 || adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10635 || adminUserInfo.CurrentOrgId == 10723 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10727 {
2577 2577
 			var dewater_amount float64
2578 2578
 			dewater_amount = 0
2579 2579
 			if dry_weight > 0 {
@@ -5612,6 +5612,49 @@ func (c *DialysisApiController) UploadDryWeight() {
5612 5612
 		fmt.Println(value)
5613 5613
 
5614 5614
 		createErr := service.CreatePatientWeightAdjust(dryWeight)
5615
+
5616
+		//康桥
5617
+		if adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10164 {
5618
+			timeNowStr := time.Now().Format("2006-01-02")
5619
+			timeNewDate, _ := utils.ParseTimeStringToTime("2006-01-02", timeNowStr)
5620
+
5621
+			beforAssesment, _ := service.GetPatientAssesmentBefor(patient_id, timeNewDate.Unix(), adminUserInfo.CurrentOrgId)
5622
+
5623
+			dialysisPrescription, _ := service.GetPatientDialysisPrescription(patient_id, timeNewDate.Unix(), adminUserInfo.CurrentOrgId)
5624
+
5625
+			if beforAssesment.ID > 0 {
5626
+
5627
+				service.UpdatePatientAssesmentBefor(beforAssesment.ID, dry_weight)
5628
+
5629
+				var dewater_amount float64
5630
+
5631
+				dewater_amount = beforAssesment.WeightBefore - dry_weight - beforAssesment.AdditionalWeight
5632
+
5633
+				service.UpdatePatientDialysisPrscription(dialysisPrescription.ID, dewater_amount)
5634
+				//获取key,清空redis
5635
+				key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":" + strconv.FormatInt(dialysisPrescription.ModeId, 10) + ":dialysis_prescribe"
5636
+				redis := service.RedisClient()
5637
+
5638
+				//清空key 值
5639
+				redis.Set(key, "", time.Second)
5640
+
5641
+				keyOne := "scheduals_" + timeNowStr + "_" + strconv.FormatInt(adminUserInfo.CurrentOrgId, 10)
5642
+				//清空key 值
5643
+				redis.Set(keyOne, "", time.Second)
5644
+
5645
+				keyTwo := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysisPrescription.ModeId, 10) + ":dialysis_solution"
5646
+				//清空key 值
5647
+				redis.Set(keyTwo, "", time.Second)
5648
+
5649
+				keySix := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":prescriptions_list_all"
5650
+				redis.Set(keySix, "", time.Second)
5651
+
5652
+				keySeven := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":dialysis_prescribe_by_mode"
5653
+				redis.Set(keySeven, "", time.Second)
5654
+			}
5655
+
5656
+		}
5657
+
5615 5658
 		loc, _ := time.LoadLocation("Local")
5616 5659
 		nowTime := time.Now()
5617 5660
 		nowDay := nowTime.Format("2006-01-02")

+ 5 - 0
controllers/dialysis_record_api_controller.go Vedi File

@@ -1489,6 +1489,11 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1489 1489
 				record.PulseFrequency = befor.PulseFrequency
1490 1490
 			}
1491 1491
 
1492
+			//濉溪杏康血液透析中心
1493
+			if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
1494
+				record.BloodFlowVolume = prescription.BloodFlowVolume
1495
+			}
1496
+
1492 1497
 			err := service.CreateMonitor(&record)
1493 1498
 
1494 1499
 			//记录日志

+ 43 - 0
controllers/doctors_api_controller.go Vedi File

@@ -347,6 +347,49 @@ func (c *DoctorsApiController) UpdatedDryWeightData() {
347 347
 		errors := service.UpdateDialysisPrescription(patientid, orgid, dryweight, prescription)
348 348
 		fmt.Println(errors)
349 349
 	}
350
+
351
+	//康桥
352
+	if adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10164 {
353
+		timeNowStr := time.Now().Format("2006-01-02")
354
+		timeNewDate, _ := utils.ParseTimeStringToTime("2006-01-02", timeNowStr)
355
+
356
+		beforAssesment, _ := service.GetPatientAssesmentBefor(patientid, timeNewDate.Unix(), adminUserInfo.CurrentOrgId)
357
+
358
+		dialysisPrescription, _ := service.GetPatientDialysisPrescription(patientid, timeNewDate.Unix(), adminUserInfo.CurrentOrgId)
359
+
360
+		if beforAssesment.ID > 0 {
361
+
362
+			service.UpdatePatientAssesmentBefor(beforAssesment.ID, dry_weight)
363
+
364
+			var dewater_amount float64
365
+
366
+			dewater_amount = beforAssesment.WeightBefore - dry_weight - beforAssesment.AdditionalWeight
367
+
368
+			service.UpdatePatientDialysisPrscription(dialysisPrescription.ID, dewater_amount)
369
+			//获取key,清空redis
370
+			key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientid, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":" + strconv.FormatInt(dialysisPrescription.ModeId, 10) + ":dialysis_prescribe"
371
+			redis := service.RedisClient()
372
+
373
+			//清空key 值
374
+			redis.Set(key, "", time.Second)
375
+
376
+			keyOne := "scheduals_" + timeNowStr + "_" + strconv.FormatInt(adminUserInfo.CurrentOrgId, 10)
377
+			//清空key 值
378
+			redis.Set(keyOne, "", time.Second)
379
+
380
+			keyTwo := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientid, 10) + ":" + strconv.FormatInt(dialysisPrescription.ModeId, 10) + ":dialysis_solution"
381
+			//清空key 值
382
+			redis.Set(keyTwo, "", time.Second)
383
+
384
+			keySix := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":prescriptions_list_all"
385
+			redis.Set(keySix, "", time.Second)
386
+
387
+			keySeven := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientid, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":dialysis_prescribe_by_mode"
388
+			redis.Set(keySeven, "", time.Second)
389
+		}
390
+
391
+	}
392
+
350 393
 	key := strconv.FormatInt(orgid, 10) + ":" + strconv.FormatInt(patientid, 10) + ":" + strconv.FormatInt(dayTime.Unix(), 10) + ":assessment_before_dislysis"
351 394
 	redis.Set(key, "", time.Second)
352 395
 	keySix := strconv.FormatInt(orgid, 10) + ":" + strconv.FormatInt(dayTime.Unix(), 10) + ":assessment_befores_list_all"

+ 1 - 1
controllers/his_api_controller.go Vedi File

@@ -3197,7 +3197,7 @@ func (c *HisApiController) CreateHisPrescription() {
3197 3197
 	var adviceList []models.HisDoctorAdviceInfo
3198 3198
 	var projectList []models.HisPrescriptionProject
3199 3199
 
3200
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 {
3200
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10635 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 {
3201 3201
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3202 3202
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3203 3203
 

+ 11 - 0
controllers/mobile_api_controllers/check_weight_api_controller.go Vedi File

@@ -326,6 +326,10 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
326 326
 
327 327
 	}
328 328
 
329
+	if adminUserInfo.Org.Id == 10727 {
330
+		dewater_amount = dewater_amount * 1000
331
+	}
332
+
329 333
 	if dewater_amount < 0 {
330 334
 		dewater_amount = 0
331 335
 	}
@@ -939,6 +943,10 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
939 943
 				if adminUserInfo.Org.Id == 10471 {
940 944
 					evaluation.Temperature = 36.5
941 945
 				}
946
+
947
+				if adminUserInfo.Org.Id == 10721 {
948
+					evaluation.Temperature = 36.5
949
+				}
942 950
 			}
943 951
 		} else {
944 952
 			evaluation.UpdatedTime = time.Now().Unix()
@@ -1095,6 +1103,9 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
1095 1103
 				afterevaluation.ActualDisplacement = DisplacementQuantityOne
1096 1104
 			}
1097 1105
 		}
1106
+		if adminUserInfo.Org.Id == 10721 {
1107
+			afterevaluation.Temperature = 36.5
1108
+		}
1098 1109
 
1099 1110
 		err := service.UpdateAssessmentAfterDislysisRecord(&afterevaluation)
1100 1111
 

+ 65 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go Vedi File

@@ -3746,6 +3746,11 @@ func (this *DialysisAPIController) StartDialysis() {
3746 3746
 				ultrafiltration_rate = ultrafiltration_rate / 1000
3747 3747
 			}
3748 3748
 
3749
+			if adminUserInfo.Org.Id == 10721 {
3750
+				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)
3751
+				ultrafiltration_rate = ultrafiltration_rate / 1000
3752
+			}
3753
+
3749 3754
 		}
3750 3755
 	}
3751 3756
 
@@ -3861,6 +3866,11 @@ func (this *DialysisAPIController) StartDialysis() {
3861 3866
 			record.DialysateTemperature = 36.5
3862 3867
 		}
3863 3868
 
3869
+		//濉溪杏康血液透析中心
3870
+		if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 {
3871
+			record.BloodFlowVolume = prescription.BloodFlowVolume
3872
+		}
3873
+
3864 3874
 		if adminUserInfo.Org.Id != 10683 {
3865 3875
 			err = service.CreateMonitor(&record)
3866 3876
 		}
@@ -4823,6 +4833,11 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4823 4833
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4824 4834
 			}
4825 4835
 
4836
+			if adminInfo.Org.Id == 10721 {
4837
+				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)
4838
+				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4839
+			}
4840
+
4826 4841
 			if adminInfo.Org.Id == 10597 || adminInfo.Org.Id == 10599 || adminInfo.Org.Id == 10679 {
4827 4842
 				record.UltrafiltrationRate = 0
4828 4843
 			}
@@ -4898,6 +4913,14 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4898 4913
 	if adminInfo.Org.Id == 10510 {
4899 4914
 		record.UltrafiltrationVolume = 0
4900 4915
 	}
4916
+
4917
+	if adminInfo.Org.Id == 10721 {
4918
+		if ultrafiltration_rate > 0 {
4919
+			ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4920
+			record.UltrafiltrationVolume = ultrafiltration_volume / 1000
4921
+		}
4922
+
4923
+	}
4901 4924
 	lastMonitorRecordList, _ := service.GetLastMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
4902 4925
 
4903 4926
 	this.ServeSuccessJSON(map[string]interface{}{
@@ -6139,6 +6162,48 @@ func (c *DialysisAPIController) UploadDryWeight() {
6139 6162
 		}
6140 6163
 
6141 6164
 		createErr := service.CreatePatientWeightAdjust(dryWeight)
6165
+
6166
+		//康桥
6167
+		if adminUserInfo.Org.Id == 10702 || adminUserInfo.Org.Id == 10164 {
6168
+			timeNowStr := time.Now().Format("2006-01-02")
6169
+			timeNewDate, _ := utils.ParseTimeStringToTime("2006-01-02", timeNowStr)
6170
+
6171
+			beforAssesment, _ := service.GetPatientAssesmentBefor(patient_id, timeNewDate.Unix(), adminUserInfo.Org.Id)
6172
+
6173
+			dialysisPrescription, _ := service.GetPatientDialysisPrescription(patient_id, timeNewDate.Unix(), adminUserInfo.Org.Id)
6174
+
6175
+			if beforAssesment.ID > 0 {
6176
+
6177
+				service.UpdatePatientAssesmentBefor(beforAssesment.ID, dry_weight)
6178
+
6179
+				var dewater_amount float64
6180
+
6181
+				dewater_amount = beforAssesment.WeightBefore - dry_weight - beforAssesment.AdditionalWeight
6182
+
6183
+				service.UpdatePatientDialysisPrscription(dialysisPrescription.ID, dewater_amount)
6184
+				//获取key,清空redis
6185
+				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":" + strconv.FormatInt(dialysisPrescription.ModeId, 10) + ":dialysis_prescribe"
6186
+				redis := service.RedisClient()
6187
+
6188
+				//清空key 值
6189
+				redis.Set(key, "", time.Second)
6190
+
6191
+				keyOne := "scheduals_" + timeNowStr + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
6192
+				//清空key 值
6193
+				redis.Set(keyOne, "", time.Second)
6194
+
6195
+				keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysisPrescription.ModeId, 10) + ":dialysis_solution"
6196
+				//清空key 值
6197
+				redis.Set(keyTwo, "", time.Second)
6198
+
6199
+				keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":prescriptions_list_all"
6200
+				redis.Set(keySix, "", time.Second)
6201
+
6202
+				keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(timeNewDate.Unix(), 10) + ":dialysis_prescribe_by_mode"
6203
+				redis.Set(keySeven, "", time.Second)
6204
+			}
6205
+
6206
+		}
6142 6207
 		redis := service.RedisClient()
6143 6208
 		loc, _ := time.LoadLocation("Local")
6144 6209
 		nowTime := time.Now()

+ 1 - 1
controllers/mobile_api_controllers/patient_api_controller.go Vedi File

@@ -3486,7 +3486,7 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
3486 3486
 	if evaluation.DryWeight > 0 {
3487 3487
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
3488 3488
 
3489
-		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 || adminUserInfo.Org.Id == 10580 || adminUserInfo.Org.Id == 10585 || adminUserInfo.Org.Id == 10635 {
3489
+		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 || adminUserInfo.Org.Id == 10580 || adminUserInfo.Org.Id == 10585 || adminUserInfo.Org.Id == 10635 || adminUserInfo.Org.Id == 10727 {
3490 3490
 
3491 3491
 			if adminUserInfo.Org.Id != 10551 && adminUserInfo.Org.Id != 10579 && adminUserInfo.Org.Id != 10580 && adminUserInfo.Org.Id != 10585 {
3492 3492
 				dewater_amount = dewater_amount * 1000

+ 11 - 0
controllers/patient_api_controller.go Vedi File

@@ -533,6 +533,7 @@ func (c *PatientApiController) CreatePatient() {
533 533
 		AllergicHistory:              patient.AllergicHistory,
534 534
 		PatientAddress:               patient.PatientAddress,
535 535
 		PrintDate:                    patient.PrintDate,
536
+		FamalityRecord:               patient.FamalityRecord,
536 537
 	}
537 538
 	patientsNew.FirstLetter = firstLetter
538 539
 
@@ -774,6 +775,7 @@ func (c *PatientApiController) EditPatient() {
774 775
 		AllergicHistory:           patient.AllergicHistory,
775 776
 		PatientAddress:            patient.PatientAddress,
776 777
 		PrintDate:                 patient.PrintDate,
778
+		FamalityRecord:            patient.FamalityRecord,
777 779
 	}
778 780
 	//	//更新病人ID获取新表病人ID
779 781
 	err = service.UpdatepatientTwo(&patientsNew, id)
@@ -6065,6 +6067,11 @@ func patientFormData(patient *models.Patients, data []byte, method string) (cont
6065 6067
 		patient.PatientAddress = patient_address
6066 6068
 	}
6067 6069
 
6070
+	if patientBody["famality_record"] != nil && reflect.TypeOf(patientBody["famality_record"]).String() == "string" {
6071
+		famality_record := patientBody["famality_record"].(string)
6072
+		patient.FamalityRecord = famality_record
6073
+	}
6074
+
6068 6075
 	if patientBody["print_date"] != nil && reflect.TypeOf(patientBody["print_date"]).String() == "string" {
6069 6076
 		print_date := patientBody["print_date"].(string)
6070 6077
 		printDateTime, err := time.ParseInLocation(timeLayout, print_date, loc)
@@ -6073,6 +6080,10 @@ func patientFormData(patient *models.Patients, data []byte, method string) (cont
6073 6080
 		}
6074 6081
 	}
6075 6082
 
6083
+	if patientBody["patient_type"] != nil && reflect.TypeOf(patientBody["patient_type"]).String() == "float64" {
6084
+		patient_type := int64(patientBody["patient_type"].(float64))
6085
+		patient.PatientType = patient_type
6086
+	}
6076 6087
 	return
6077 6088
 
6078 6089
 }

+ 9 - 9
controllers/patient_dataconfig_api_controller.go Vedi File

@@ -571,15 +571,15 @@ func (this *PatientDataConfigAPIController) DeletePhysiqueCheck() {
571 571
 	}
572 572
 
573 573
 	adminUserInfo := this.GetAdminUserInfo()
574
-	patient, getPatientErr := service.GetPatientByID(adminUserInfo.CurrentOrgId, patientID)
575
-	if getPatientErr != nil {
576
-		this.ErrorLog("获取患者信息失败:%v", getPatientErr)
577
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
578
-		return
579
-	} else if patient == nil {
580
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientNoExist)
581
-		return
582
-	}
574
+	//patient, getPatientErr := service.GetPatientByID(adminUserInfo.CurrentOrgId, patientID)
575
+	//if getPatientErr != nil {
576
+	//	this.ErrorLog("获取患者信息失败:%v", getPatientErr)
577
+	//	this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
578
+	//	return
579
+	//} else if patient == nil {
580
+	//	this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientNoExist)
581
+	//	return
582
+	//}
583 583
 
584 584
 	recordIDStrs := strings.Split(idsStr, ",")
585 585
 	recordIDs := make([]int64, 0, len(recordIDStrs))

+ 23 - 0
controllers/self_drug_api_congtroller.go Vedi File

@@ -189,6 +189,8 @@ func SelfDrugRouters() {
189 189
 
190 190
 	beego.Router("/api/drug/getdruginventorymodeprintlist", &SelfDrugApiController{}, "Get:GetDrugInventoryModePrintList")
191 191
 
192
+	beego.Router("/api/drug/modifydrugcodewarehouseinfo", &SelfDrugApiController{}, "Post:ModifyDrugCodeWarehosueInfo")
193
+
192 194
 }
193 195
 
194 196
 func (this *SelfDrugApiController) GetCurrentPatient() {
@@ -6456,3 +6458,24 @@ func (c *SelfDrugApiController) GetDrugInventoryModePrintList() {
6456 6458
 		"cancelOutInfo":     cancelOutInfo,
6457 6459
 	})
6458 6460
 }
6461
+
6462
+func (c *SelfDrugApiController) ModifyDrugCodeWarehosueInfo() {
6463
+
6464
+	dataBody := make(map[string]interface{}, 0)
6465
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6466
+	if err != nil {
6467
+		utils.ErrorLog(err.Error())
6468
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
6469
+		return
6470
+	}
6471
+
6472
+	drug_code := dataBody["drug_code"].(string)
6473
+
6474
+	id := int64(dataBody["id"].(float64))
6475
+
6476
+	info, _ := service.ModifyDrugCodeWarehosueInfo(id, drug_code)
6477
+	c.ServeSuccessJSON(map[string]interface{}{
6478
+		"info": info,
6479
+	})
6480
+
6481
+}

+ 2 - 3
controllers/stock_in_api_controller.go Vedi File

@@ -4920,14 +4920,13 @@ func (this *StockManagerApiController) GetOrderDetailById() {
4920 4920
 	orgId := this.GetAdminUserInfo().CurrentOrgId
4921 4921
 	//自动出库
4922 4922
 	userDetails, err, total := service.FindUserDetailByIdOne(good_id, record_time, orgId)
4923
-	fmt.Println("userDetails00---------", userDetails)
4923
+
4924 4924
 	//手动出库
4925 4925
 	info, _ := service.GetWarehouseOutInfoById(id, good_id)
4926 4926
 
4927 4927
 	//出库数据
4928 4928
 	stockFlowList, err := service.GetStockFlowBatchNumberOne(id, good_id)
4929 4929
 
4930
-	fmt.Println("stockFlowList", stockFlowList)
4931 4930
 	//退库数据
4932 4931
 	cancelInfo, err := service.GetStockFlowCancelInfo(id, good_id)
4933 4932
 	if err == nil {
@@ -8238,7 +8237,7 @@ func (this *StockManagerApiController) UpdateBaseDrugListByUserOrgID() {
8238 8237
 	//	service.UpdateDealerManufacturerOne(item.ID, manufacturer.ManufacturerName)
8239 8238
 	//}
8240 8239
 
8241
-	drugList, _ := service.GetAllBaseDrugListTwenty(10644)
8240
+	drugList, _ := service.GetAllBaseDrugListTwentyOne(10598)
8242 8241
 
8243 8242
 	for _, item := range drugList {
8244 8243
 		var drug_spec = item.Dose + item.DoseUnit + "*" + strconv.FormatInt(item.MinNumber, 10) + item.MinUnit + "/" + item.MaxUnit

+ 2 - 0
models/patient_models.go Vedi File

@@ -233,6 +233,7 @@ type Patients struct {
233 233
 	PatientAddress           string  `gorm:"column:patient_address" json:"patient_address" form:"patient_address"`
234 234
 	FirstLetter              string  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
235 235
 	PrintDate                int64   `gorm:"column:print_date" json:"print_date" form:"print_date"`
236
+	FamalityRecord           string  `gorm:"column:famality_record" json:"famality_record" form:"famality_record"`
236 237
 }
237 238
 
238 239
 func (Patients) TableName() string {
@@ -862,6 +863,7 @@ type XtPatientsNew struct {
862 863
 	PatientAddress               string  `gorm:"column:patient_address" json:"patient_address" form:"patient_address"`
863 864
 	FirstLetter                  string  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
864 865
 	PrintDate                    int64   `gorm:"column:print_date" json:"print_date" form:"print_date"`
866
+	FamalityRecord               string  `gorm:"column:famality_record" json:"famality_record" form:"famality_record"`
865 867
 }
866 868
 
867 869
 func (XtPatientsNew) TableName() string {

+ 1 - 0
models/self_drug_models.go Vedi File

@@ -499,6 +499,7 @@ type BloodDrugWarehouseInfo struct {
499 499
 	CountUnit        string  `json:"count_unit"`
500 500
 	IsCheck          string  `gorm:"column:is_check" json:"is_check" form:"is_check"`
501 501
 	BatchNumber      string  `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
502
+	DrugCode         string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
502 503
 }
503 504
 
504 505
 type BloodDrugCancelStockInfo struct {

+ 1 - 0
models/user_models.go Vedi File

@@ -202,6 +202,7 @@ type XtDialysisPrescription struct {
202 202
 	DialysisStrainer           string  `gorm:"column:dialysis_strainer" json:"dialysis_strainer" form:"dialysis_strainer"`
203 203
 	DialysisDialyszers         string  `gorm:"column:dialysis_dialyszers" json:"dialysis_dialyszers" form:"dialysis_dialyszers"`
204 204
 	DialysisIrrigation         string  `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
205
+	PrescriptionWater          float64 `gorm:"column:prescription_water" json:"prescription_water" form:"prescription_water"`
205 206
 }
206 207
 
207 208
 func (XtDialysisPrescription) TableName() string {

+ 8 - 2
service/gobal_config_service.go Vedi File

@@ -349,9 +349,9 @@ func GetDrugInOrderDetail(startime int64, endtime int64, orgid int64, orderType
349 349
 	}
350 350
 
351 351
 	if manufacturerId > 0 {
352
-		err = db.Select("x.id,x.warehousing_id,x.drug_id,x.batch_number,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,t.manufacturer,x.remark,x.ctime,x.org_id,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.storehouse_id,x.max_unit as count_unit,t.drug_type,t.drug_name,t.drug_spec,t.min_unit,t.dose,t.dose_unit,t.max_unit,t.min_number,s.creater").Joins("left join xt_base_drug as t on t.id = x.drug_id and t.org_id = ? and t.status =1", orgid).Where("t.manufacturer = ?", manufacturerId).Joins("left join xt_drug_warehouse as s on s.id = x.warehousing_id and s.org_id = ? and s.status =1", orgid).Order("x.id desc").Count(&total).Offset(offset).Limit(limit).Scan(&drugInfo).Error
352
+		err = db.Select("x.id,x.warehousing_id,x.drug_id,x.batch_number,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,t.manufacturer,x.remark,x.ctime,x.org_id,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.storehouse_id,x.max_unit as count_unit,t.drug_type,t.drug_name,t.drug_spec,t.min_unit,t.dose,t.dose_unit,t.max_unit,t.min_number,s.creater,x.drug_code").Joins("left join xt_base_drug as t on t.id = x.drug_id and t.org_id = ? and t.status =1", orgid).Where("t.manufacturer = ?", manufacturerId).Joins("left join xt_drug_warehouse as s on s.id = x.warehousing_id and s.org_id = ? and s.status =1", orgid).Order("x.id desc").Count(&total).Offset(offset).Limit(limit).Scan(&drugInfo).Error
353 353
 	} else {
354
-		err = db.Select("x.id,x.warehousing_id,x.drug_id,x.batch_number,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,t.manufacturer,x.remark,x.ctime,x.org_id,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.storehouse_id,x.max_unit as count_unit,t.drug_type,t.drug_name,t.drug_spec,t.min_unit,t.dose,t.dose_unit,t.max_unit,t.min_number,s.creater").Joins("left join xt_base_drug as t on t.id = x.drug_id and t.org_id = ? and t.status =1", orgid).Joins("left join xt_drug_warehouse as s on s.id = x.warehousing_id and s.org_id = ? and s.status =1", orgid).Order("x.id desc").Count(&total).Offset(offset).Limit(limit).Scan(&drugInfo).Error
354
+		err = db.Select("x.id,x.warehousing_id,x.drug_id,x.batch_number,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.price,x.total_price,x.dealer,t.manufacturer,x.remark,x.ctime,x.org_id,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.storehouse_id,x.max_unit as count_unit,t.drug_type,t.drug_name,t.drug_spec,t.min_unit,t.dose,t.dose_unit,t.max_unit,t.min_number,s.creater,x.drug_code").Joins("left join xt_base_drug as t on t.id = x.drug_id and t.org_id = ? and t.status =1", orgid).Joins("left join xt_drug_warehouse as s on s.id = x.warehousing_id and s.org_id = ? and s.status =1", orgid).Order("x.id desc").Count(&total).Offset(offset).Limit(limit).Scan(&drugInfo).Error
355 355
 	}
356 356
 
357 357
 	return drugInfo, total, err
@@ -1088,6 +1088,12 @@ func GetAllBaseDrugListTwenty(orgid int64) (drug []*models.BaseDrugLibTwenty, er
1088 1088
 	return drug, err
1089 1089
 }
1090 1090
 
1091
+func GetAllBaseDrugListTwentyOne(orgid int64) (drug []*models.BaseDrugLibTwenty, err error) {
1092
+
1093
+	err = XTReadDB().Model(&drug).Where("org_id = ? and status = 1", orgid).Find(&drug).Error
1094
+	return drug, err
1095
+}
1096
+
1091 1097
 func UpdateBaseDrugList(drug_id int64, specification_name string) error {
1092 1098
 
1093 1099
 	err := XTWriteDB().Model(&models.XtBaseDrug{}).Where("id = ? and status=1", drug_id).Updates(map[string]interface{}{"specification_name": specification_name}).Error

+ 11 - 9
service/his_service.go Vedi File

@@ -122,6 +122,7 @@ type Patients struct {
122 122
 	HisPrescription       []*HisPrescription    `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"prescription"`
123 123
 	VMHisPrescriptionInfo VMHisPrescriptionInfo `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"info"`
124 124
 	VMHisOrder            VMHisOrder            `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"order"`
125
+	PatientType           int64                 `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
125 126
 }
126 127
 
127 128
 func (Patients) TableName() string {
@@ -144,7 +145,7 @@ func (HisPrescription) TableName() string {
144 145
 }
145 146
 
146 147
 func GetScheduleHisPatientList(org_id int64, keywords string, record_date int64, sch_type int64) (patients []*Patients, err error) {
147
-	db := readDb.Model(&Patients{}).Select("xt_patients.id,xt_patients.user_org_id,xt_patients.name,xt_patients.status,xt_patients.id_card_no,xt_patients.first_letter,sch.schedule_type as sch_type").Where("xt_patients.user_org_id = ? AND xt_patients.status = 1", org_id)
148
+	db := readDb.Model(&Patients{}).Select("xt_patients.id,xt_patients.user_org_id,xt_patients.name,xt_patients.status,xt_patients.id_card_no,xt_patients.first_letter,xt_patients.patient_type,sch.schedule_type as sch_type").Where("xt_patients.user_org_id = ? AND xt_patients.status = 1", org_id)
148 149
 
149 150
 	if sch_type != 0 {
150 151
 		db = db.Joins("join xt_schedule as sch ON sch.patient_id = xt_patients.id AND sch.schedule_date = ? AND sch.status = 1 AND sch.user_org_id = ? AND sch.schedule_type = ?", record_date, org_id, sch_type)
@@ -204,6 +205,7 @@ type PatientTwo struct {
204 205
 	HisPatient            []*HisPatientTwo      `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"his_patient"`
205 206
 	VMHisPrescriptionInfo VMHisPrescriptionInfo `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"info"`
206 207
 	FirstLetter           string                `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
208
+	PatientType           int64                 `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
207 209
 }
208 210
 
209 211
 func (PatientTwo) TableName() string {
@@ -2298,14 +2300,14 @@ func (NewSZCustomPatients) TableName() string {
2298 2300
 //}
2299 2301
 
2300 2302
 type NewTempPatients struct {
2301
-	ID           int64  `gorm:"column:id" json:"id" form:"id"`
2302
-	UserOrgId    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2303
-	Name         string `gorm:"column:name" json:"name" form:"name"`
2304
-	Status       int64  `gorm:"column:status" json:"status" form:"status"`
2305
-	IdCardNo     string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
2306
-	ScheduleType int64  `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
2307
-	FirstLetter  string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
2308
-
2303
+	ID                    int64                 `gorm:"column:id" json:"id" form:"id"`
2304
+	UserOrgId             int64                 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2305
+	Name                  string                `gorm:"column:name" json:"name" form:"name"`
2306
+	Status                int64                 `gorm:"column:status" json:"status" form:"status"`
2307
+	IdCardNo              string                `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
2308
+	ScheduleType          int64                 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
2309
+	FirstLetter           string                `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
2310
+	PatientType           int64                 `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
2309 2311
 	Schedule              Schedule              `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"schedule"`
2310 2312
 	HisPatient            []*HisPatient         `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"his_patient"`
2311 2313
 	HisPrescription       []*HisPrescription    `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"prescription"`

+ 40 - 5
service/patient_service.go Vedi File

@@ -76,20 +76,20 @@ func GetPatientList(orgID int64, keywords string, page, limit, schedulType, bind
76 76
 
77 77
 	offset := (page - 1) * limit
78 78
 	if lapseto == 2 || lapseto == 3 {
79
-		err = db.Order("p.death_time desc").Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time,p.user_sys_before_count,p.out_reason,p.death_time,p.is_infectious").Group("p.id").Count(&total).Offset(offset).Limit(limit).Find(&patients).Error
79
+		err = db.Order("p.death_time desc").Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time,p.user_sys_before_count,p.out_reason,p.death_time,p.is_infectious,p.patient_type").Group("p.id").Count(&total).Offset(offset).Limit(limit).Find(&patients).Error
80 80
 
81 81
 	}
82 82
 	if lapseto != 2 && lapseto != 3 {
83 83
 		if orgID != 10579 && orgID != 10600 && orgID != 10587 {
84
-			err = db.Order("p.id desc").Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time,p.user_sys_before_count,p.out_reason,p.death_time,p.is_infectious").Group("p.id").Count(&total).Offset(offset).Limit(limit).Find(&patients).Error
84
+			err = db.Order("p.id desc").Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time,p.user_sys_before_count,p.out_reason,p.death_time,p.is_infectious,p.patient_type").Group("p.id").Count(&total).Offset(offset).Limit(limit).Find(&patients).Error
85 85
 		}
86 86
 
87 87
 		if orgID == 10579 || orgID == 10600 {
88
-			err = db.Order("p.dialysis_no asc").Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time,p.user_sys_before_count,p.out_reason,p.death_time,p.is_infectious").Group("p.id").Count(&total).Offset(offset).Limit(limit).Find(&patients).Error
88
+			err = db.Order("p.dialysis_no asc").Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time,p.user_sys_before_count,p.out_reason,p.death_time,p.is_infectious,p.patient_type").Group("p.id").Count(&total).Offset(offset).Limit(limit).Find(&patients).Error
89 89
 		}
90 90
 
91 91
 		if orgID == 10587 {
92
-			err = db.Order("p.created_time desc").Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time,p.user_sys_before_count,p.out_reason,p.death_time,p.is_infectious").Group("p.id").Count(&total).Offset(offset).Limit(limit).Find(&patients).Error
92
+			err = db.Order("p.created_time desc").Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time,p.user_sys_before_count,p.out_reason,p.death_time,p.is_infectious,p.patient_type").Group("p.id").Count(&total).Offset(offset).Limit(limit).Find(&patients).Error
93 93
 		}
94 94
 
95 95
 	}
@@ -902,7 +902,7 @@ func UpdatePatientLapseto(patientid int64, lapseto models.PatientLapseto) error
902 902
 func UpdatepatientTwo(patientsNew *models.XtPatientsNew, id int64) error {
903 903
 
904 904
 	err := XTWriteDB().Model(&patientsNew).Where("blood_id = ?", id).Update(map[string]interface{}{"user_org_id": patientsNew.UserOrgId, "user_id": patientsNew.UserId, "avatar": patientsNew.Avatar, "patient_type": patientsNew.Avatar, "dialysis_no": patientsNew.DialysisNo, "admission_number": patientsNew.AdmissionNumber, "source": patientsNew.Source, "lapseto": patientsNew.Lapseto, "partition_id": patientsNew.PartitionId, "bed_id": patientsNew.BedId, "name": patientsNew.Name, "alias": patientsNew.Alias, "gender": patientsNew.Gender, "marital_status": patientsNew.MaritalStatus, "id_card_no": patientsNew.IdCardNo, "birthday": patientsNew.Birthday, "reimbursement_way_id": patientsNew.ReimbursementWayId, "health_care_type": patientsNew.HealthCareType, "health_care_no": patientsNew.HealthCareType, "health_care_due_date": patientsNew.HealthCareType, "height": patientsNew.Height, "blood_type": patientsNew.BloodType, "rh": patientsNew.Rh, "health_care_due_alert_date": patientsNew.HealthCareDueAlertDate, "education_level": patientsNew.EducationLevel, "profession": patientsNew.Profession, "phone": patientsNew.Phone, "home_telephone": patientsNew.HomeTelephone, "relative_phone": patientsNew.RelativePhone, "relative_relations": patientsNew.RelativeRelations, "home_address": patientsNew.HomeAddress, "work_unit": patientsNew.WorkUnit, "unit_address": patientsNew.UnitAddress, "children": patientsNew.Children, "receiving_date": patientsNew.ReceivingDate, "is_hospital_first_dialysis": patientsNew.IsHospitalFirstDialysis, "first_dialysis_date": patientsNew.FirstDialysisDate, "first_dialysis_hospital": patientsNew.FirstDialysisHospital, "predialysis_condition": patientsNew.PredialysisCondition, "pre_hospital_dialysis_frequency": patientsNew.PreHospitalDialysisFrequency, "pre_hospital_dialysis_times": patientsNew.PreHospitalDialysisFrequency, "hospital_first_dialysis_date": patientsNew.HospitalFirstDialysisDate, "induction_period": patientsNew.InductionPeriod, "initial_dialysis": patientsNew.InitialDialysis, "total_dialysis": patientsNew.TotalDialysis, "attending_doctor_id": patientsNew.AttendingDoctorId, "head_nurse_id": patientsNew.HeadNurseId, "evaluate": patientsNew.Evaluate, "diagnose": patientsNew.Diagnose, "remark": patientsNew.Remark, "registrars_id": patientsNew.RegistrarsId, "registrars": patientsNew.Registrars, "qr_code": patientsNew.QrCode, "binding_state": patientsNew.BindingState, "patient_complains": patientsNew.PatientComplains, "present_history": patientsNew.PresentHistory, "past_history": patientsNew.PastHistory, "temperature": patientsNew.Temperature,
905
-		"pulse": patientsNew.Pulse, "respiratory": patientsNew.Respiratory, "sbp": patientsNew.Sbp, "dbp": patientsNew.Dbp, "nation": patientsNew.Nation, "native_place": patientsNew.NativePlace, "age": patientsNew.Age, "infectious_next_record_time": patientsNew.InfectiousNextRecordTime, "is_infectious": patientsNew.IsInfectious, "remind_cycle": patientsNew.RemindCycle, "response_result": patientsNew.ResponseResult, "is_open_remind": patientsNew.IsOpenRemind, "first_treatment_date": patientsNew.FirstTreatmentDate, "dialysis_age": patientsNew.DialysisAge, "expense_kind": patientsNew.ExpenseKind, "tell_phone": patientsNew.ExpenseKind, "contact_name": patientsNew.ContactName, "blood_patients": patientsNew.BloodPatients, "slow_patients": patientsNew.SlowPatients, "member_patients": patientsNew.MemberPatients, "ecommer_patients": patientsNew.EcommerPatients, "troble_shoot": patientsNew.TrobleShoot, "sch_remark": patientsNew.SchRemark, "treatment_plan": patientsNew.TreatmentPlan, "record_number": patientsNew.RecordNumber, "patient_start_time": patientsNew.PatientStartTime, "patient_end_time": patientsNew.PatientEndTime, "infectious_remark": patientsNew.InfectiousRemark, "allergic_history": patientsNew.AllergicHistory, "patient_address": patientsNew.PatientAddress, "print_date": patientsNew.PrintDate}).Error
905
+		"pulse": patientsNew.Pulse, "respiratory": patientsNew.Respiratory, "sbp": patientsNew.Sbp, "dbp": patientsNew.Dbp, "nation": patientsNew.Nation, "native_place": patientsNew.NativePlace, "age": patientsNew.Age, "infectious_next_record_time": patientsNew.InfectiousNextRecordTime, "is_infectious": patientsNew.IsInfectious, "remind_cycle": patientsNew.RemindCycle, "response_result": patientsNew.ResponseResult, "is_open_remind": patientsNew.IsOpenRemind, "first_treatment_date": patientsNew.FirstTreatmentDate, "dialysis_age": patientsNew.DialysisAge, "expense_kind": patientsNew.ExpenseKind, "tell_phone": patientsNew.ExpenseKind, "contact_name": patientsNew.ContactName, "blood_patients": patientsNew.BloodPatients, "slow_patients": patientsNew.SlowPatients, "member_patients": patientsNew.MemberPatients, "ecommer_patients": patientsNew.EcommerPatients, "troble_shoot": patientsNew.TrobleShoot, "sch_remark": patientsNew.SchRemark, "treatment_plan": patientsNew.TreatmentPlan, "record_number": patientsNew.RecordNumber, "patient_start_time": patientsNew.PatientStartTime, "patient_end_time": patientsNew.PatientEndTime, "infectious_remark": patientsNew.InfectiousRemark, "allergic_history": patientsNew.AllergicHistory, "patient_address": patientsNew.PatientAddress, "print_date": patientsNew.PrintDate, "patient_type:": patientsNew.PatientType}).Error
906 906
 	return err
907 907
 }
908 908
 
@@ -1826,6 +1826,41 @@ func CreatePatientWeightAdjust(m *models.SgjPatientDryweight) (err error) {
1826 1826
 	return
1827 1827
 }
1828 1828
 
1829
+func GetPatientAssesmentBefor(patient_id int64, assessment_date int64, org_id int64) (models.XtAssessmentBeforeDislysis, error) {
1830
+
1831
+	beforeDislysis := models.XtAssessmentBeforeDislysis{}
1832
+
1833
+	err := XTReadDB().Where("patient_id = ? and assessment_date = ? and user_org_id = ? and status=1", patient_id, assessment_date, org_id).Find(&beforeDislysis).Error
1834
+
1835
+	return beforeDislysis, err
1836
+}
1837
+
1838
+func GetPatientDialysisPrescription(patient_id int64, record_date int64, org_id int64) (models.XtDialysisPrescription, error) {
1839
+
1840
+	prescription := models.XtDialysisPrescription{}
1841
+
1842
+	err := XTReadDB().Where("patient_id = ? and record_date = ? and user_org_id = ? and status=1", patient_id, record_date, org_id).Find(&prescription).Error
1843
+
1844
+	return prescription, err
1845
+}
1846
+
1847
+func UpdatePatientAssesmentBefor(id int64, dry_weight float64) (models.XtAssessmentBeforeDislysis, error) {
1848
+
1849
+	beforeDislysis := models.XtAssessmentBeforeDislysis{}
1850
+	err := XTWriteDB().Model(&beforeDislysis).Where("id = ? and status=1", id).Update(map[string]interface{}{"dry_weight": dry_weight}).Error
1851
+
1852
+	return beforeDislysis, err
1853
+}
1854
+
1855
+func UpdatePatientDialysisPrscription(id int64, dewater_amount float64) (models.XtDialysisPrescription, error) {
1856
+
1857
+	prescription := models.XtDialysisPrescription{}
1858
+
1859
+	err := XTWriteDB().Model(&prescription).Where("id = ? and status =1", id).Update(map[string]interface{}{"target_ultrafiltration": dewater_amount, "prescription_water": dewater_amount}).Error
1860
+
1861
+	return prescription, err
1862
+}
1863
+
1829 1864
 func FindLastDryWeightAdjust(orgID int64, id int64) (weight models.SgjPatientDryweight, err error) {
1830 1865
 	err = readDb.Model(&models.SgjPatientDryweight{}).Where("user_org_id=? and patient_id=? and status=1", orgID, id).Order("id desc").First(&weight).Error
1831 1866
 	return

+ 8 - 0
service/self_drug_service.go Vedi File

@@ -5371,3 +5371,11 @@ func GetDrugMonthCancelOutInfo(org_id int64, start_time int64) (flow []*models.X
5371 5371
 
5372 5372
 	return flow, err
5373 5373
 }
5374
+
5375
+func ModifyDrugCodeWarehosueInfo(id int64, drug_code string) (models.XtDrugWarehouseInfo, error) {
5376
+
5377
+	drugWarehouseInfo := models.XtDrugWarehouseInfo{}
5378
+	err := XTWriteDB().Model(&models.XtDrugWarehouseInfo{}).Where("id = ? and status=1", id).Update(map[string]interface{}{"drug_code": drug_code}).Error
5379
+
5380
+	return drugWarehouseInfo, err
5381
+}

+ 1 - 1
service/stock_service.go Vedi File

@@ -463,7 +463,7 @@ func CreateWarehousingInfo(warehousingInfo []*models.WarehousingInfo) (err error
463 463
 	if len(warehousingInfo) > 0 {
464 464
 		utx := writeDb.Begin()
465 465
 		if len(warehousingInfo) > 0 {
466
-			thisSQL := "INSERT INTO xt_warehouse_info (warehousing_id, good_id, good_type_id, number, product_date,expiry_date,warehousing_count,price,total_price,dealer,manufacturer,remark,ctime,mtime,status,org_id,warehousing_order,type,stock_count,license_number,packing_price,storehouse_id) VALUES "
466
+			thisSQL := "INSERT INTO xt_warehouse_info (warehousing_id, good_id, good_type_id, number, product_date,expiry_date,warehousing_count,price,total_price,dealer,manufacturer,remark,ctime,mtime,status,org_id,warehousing_order,type,stock_count,license_number,packing_price,storehouse_id,good_code) VALUES "
467 467
 			insertParams := make([]string, 0)
468 468
 			insertData := make([]interface{}, 0)
469 469
 			for _, info := range warehousingInfo {