28169 vor 2 Monaten
Ursprung
Commit
df8703e284

BIN
XT_New.exe Datei anzeigen


+ 14 - 5
controllers/mobile_api_controllers/check_weight_api_controller.go Datei anzeigen

@@ -547,7 +547,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
547 547
 				}
548 548
 				//err := service.AddSigleRecord(&newprescribe)
549 549
 				var err error
550
-				if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 10599 {
550
+				if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 10599 || adminUserInfo.Org.Id == 3877 {
551 551
 					prescriptionTwenty, _ := service.GetLastDialysisPrescriptionTwenty(newprescribe.PatientId, newprescribe.RecordDate, newprescribe.UserOrgId)
552 552
 					if prescriptionTwenty.ID == 0 {
553 553
 						//插入透析处方
@@ -654,7 +654,19 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
654 654
 					lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)
655 655
 					newprescribe.Remark = lastDialysisPrescription.Remark
656 656
 				}
657
-				err := service.AddSigleRecord(&newprescribe)
657
+
658
+				if adminUserInfo.Org.Id == 10597 || adminUserInfo.Org.Id == 10599 || adminUserInfo.Org.Id == 3877 {
659
+					prescriptionTwenty, _ := service.GetLastDialysisPrescriptionTwenty(newprescribe.PatientId, newprescribe.RecordDate, newprescribe.UserOrgId)
660
+					if prescriptionTwenty.ID == 0 {
661
+						//插入透析处方
662
+						service.AddSigleRecord(&newprescribe)
663
+					} else {
664
+						//插入透析处方
665
+						service.UpdateAddSigleRecord(prescriptionTwenty.ID, newprescribe.TargetUltrafiltration)
666
+					}
667
+				} else {
668
+					service.AddSigleRecord(&newprescribe)
669
+				}
658 670
 
659 671
 				//记录日志
660 672
 				byterequest, _ := json.Marshal(newprescribe)
@@ -681,9 +693,6 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
681 693
 				keyThree := "scheduals_" + scheduleDateStartOne + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
682 694
 				redis.Set(keyThree, "", time.Second)
683 695
 				defer redis.Close()
684
-				if err != nil {
685
-					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
686
-				}
687 696
 
688 697
 			} else {
689 698
 				var newprescribe models.DialysisPrescription

+ 132 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go Datei anzeigen

@@ -3421,6 +3421,11 @@ func (this *DialysisAPIController) StartDialysis() {
3421 3421
 				ultrafiltration_rate = ultrafiltration_rate / 1000
3422 3422
 			}
3423 3423
 
3424
+			if adminUserInfo.Org.Id == 10612 {
3425
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 1000 / float64(totalMin) * 60 * 1000)
3426
+				ultrafiltration_rate = ultrafiltration_rate / 1000
3427
+			}
3428
+
3424 3429
 		}
3425 3430
 	}
3426 3431
 
@@ -4069,7 +4074,7 @@ func (c *DialysisAPIController) PostSolution() {
4069 4074
 		AdminUserId: adminUserInfo.AdminUser.Id,
4070 4075
 		RecordDate:  prescription.RecordDate,
4071 4076
 		PatientId:   prescription.PatientId,
4072
-		Source:      "手机端新增处方",
4077
+		Source:      "手机端新增长期处方",
4073 4078
 		Status:      1,
4074 4079
 	}
4075 4080
 
@@ -10489,3 +10494,129 @@ func (c *DialysisAPIController) GetLastAcceptRecrods() {
10489 10494
 		"recrods": recrods,
10490 10495
 	})
10491 10496
 }
10497
+
10498
+func (c *DialysisAPIController) ExMobileChangeSch() {
10499
+
10500
+	id_one, _ := c.GetInt64("id_one")
10501
+	id_two, _ := c.GetInt64("id_two")
10502
+	sch, _ := service.GetSchedule(c.GetMobileAdminUserInfo().Org.Id, id_one)
10503
+	sch_two, _ := service.GetSchedule(c.GetMobileAdminUserInfo().Org.Id, id_two)
10504
+
10505
+	//order2, _ := service.GetDialysisOrder(sch_two.ScheduleDate, sch_two.PatientId, sch_two.UserOrgId)
10506
+	//if order2.ID > 0 {
10507
+	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientDialysisOrderTwo)
10508
+	//	return
10509
+	//}
10510
+
10511
+	//替换者和被替换的排班日期不是同一天,则进行一个患者一天不能有多个排班提醒
10512
+	if sch.ScheduleDate != sch_two.ScheduleDate && sch.PatientId != sch_two.PatientId {
10513
+		count, _ := service.GetScheduleCountByDate(c.GetMobileAdminUserInfo().Org.Id, sch_two.ScheduleDate, sch.PatientId)
10514
+		if count > 0 {
10515
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientScheduleRepeat)
10516
+			return
10517
+		}
10518
+
10519
+		count1, _ := service.GetScheduleCountByDate(c.GetMobileAdminUserInfo().Org.Id, sch.ScheduleDate, sch_two.PatientId)
10520
+		if count1 > 0 {
10521
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientScheduleRepeat)
10522
+			return
10523
+		}
10524
+	}
10525
+
10526
+	err := service.UpdateScheduleThree(sch, sch_two)
10527
+
10528
+	order, _ := service.GetOneDialysisOrderOne(sch.ScheduleDate, sch.PatientId, sch.UserOrgId)
10529
+	if order.ID > 0 {
10530
+		//查询该患者的排班机位
10531
+		pSchedule, _ := service.GetPscheduleDate(sch.ScheduleDate, sch.PatientId, sch.UserOrgId)
10532
+		service.UpdateDialysiOrderByPatientId(id_two, pSchedule.ScheduleType, pSchedule.PartitionId, pSchedule.BedId)
10533
+		redis := service.RedisClient()
10534
+		key := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.PatientId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_order"
10535
+		redis.Set(key, "", time.Second)
10536
+		keyOne := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_orders_list_all"
10537
+
10538
+		//清空key 值
10539
+		redis.Set(keyOne, "", time.Second)
10540
+		//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientDialysisOrderOne)
10541
+		//return
10542
+	}
10543
+	if err == nil {
10544
+
10545
+		//去除当天患者排班中重复数据,保留最后一条数据
10546
+		service.UpdateRepeatSchStatus(sch.UserOrgId, sch.ScheduleDate)
10547
+		service.UpdateRepeatSchStatus(sch_two.UserOrgId, sch_two.ScheduleDate)
10548
+
10549
+		c.ServeSuccessJSON(map[string]interface{}{
10550
+			"msg": "交换成功",
10551
+		})
10552
+
10553
+	} else {
10554
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
10555
+		return
10556
+
10557
+	}
10558
+}
10559
+
10560
+func (c *DialysisAPIController) MobileCoverSch() {
10561
+
10562
+	id_one, _ := c.GetInt64("id_one")
10563
+	id_two, _ := c.GetInt64("id_two")
10564
+	sch, _ := service.GetScheduleTen(c.GetMobileAdminUserInfo().Org.Id, id_one)
10565
+	sch_two, _ := service.GetScheduleTen(c.GetMobileAdminUserInfo().Org.Id, id_two)
10566
+
10567
+	order, _ := service.GetOneDialysisOrderOne(sch.ScheduleDate, sch.PatientId, sch.UserOrgId)
10568
+	if order.ID > 0 {
10569
+
10570
+		service.UpdateDialysiOrderByPatientId(id_two, sch_two.ScheduleType, sch_two.PartitionId, sch_two.BedId)
10571
+		redis := service.RedisClient()
10572
+		key := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.PatientId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_order"
10573
+		redis.Set(key, "", time.Second)
10574
+		keyOne := strconv.FormatInt(sch_two.UserOrgId, 10) + ":" + strconv.FormatInt(sch_two.ScheduleDate, 10) + ":dialysis_orders_list_all"
10575
+
10576
+		//清空key 值
10577
+		redis.Set(keyOne, "", time.Second)
10578
+
10579
+		//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientDialysisOrderTwo)
10580
+		//return
10581
+	}
10582
+	//替换者和被替换的排班日期不是同一天,则进行一个患者一天不能有多个排班提醒
10583
+	if sch.ScheduleDate != sch_two.ScheduleDate && sch.PatientId != sch_two.PatientId {
10584
+		count, _ := service.GetScheduleCountByDate(c.GetMobileAdminUserInfo().Org.Id, sch_two.ScheduleDate, sch.PatientId)
10585
+		if count > 0 {
10586
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientScheduleRepeat)
10587
+			return
10588
+		}
10589
+	}
10590
+
10591
+	var new_sch models.Schedule
10592
+	new_sch = sch
10593
+	new_sch.BedId = sch_two.BedId
10594
+	new_sch.ScheduleDate = sch_two.ScheduleDate
10595
+	new_sch.ScheduleWeek = sch_two.ScheduleWeek
10596
+	new_sch.PartitionId = sch_two.PartitionId
10597
+	new_sch.ScheduleType = sch_two.ScheduleType
10598
+	new_sch.ID = 0
10599
+	//删除原来的排班
10600
+	err := service.SaveSchTwo(sch, sch_two)
10601
+	//生成新的排班
10602
+	if err == nil {
10603
+		err2 := service.SaveSch(&new_sch)
10604
+		if err2 == nil {
10605
+			//去除当天患者排班中重复数据,保留最后一条数据
10606
+			service.UpdateRepeatSchStatus(sch.UserOrgId, sch.ScheduleDate)
10607
+			service.UpdateRepeatSchStatus(sch_two.UserOrgId, sch_two.ScheduleDate)
10608
+			service.UpdateRepeatSchStatus(new_sch.UserOrgId, new_sch.ScheduleDate)
10609
+
10610
+			c.ServeSuccessJSON(map[string]interface{}{
10611
+				"msg":     "覆盖成功",
10612
+				"new_sch": new_sch,
10613
+			})
10614
+		} else {
10615
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
10616
+			return
10617
+		}
10618
+	} else {
10619
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
10620
+		return
10621
+	}
10622
+}

+ 4 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go Datei anzeigen

@@ -208,4 +208,8 @@ func MobileAPIControllersRegisterRouters() {
208 208
 
209 209
 	beego.Router("/m/api/getlastacceptrecrods", &DialysisAPIController{}, "Get:GetLastAcceptRecrods")
210 210
 
211
+	beego.Router("/m/api/sch/exchange", &DialysisAPIController{}, "Get:ExMobileChangeSch")
212
+
213
+	beego.Router("/m/api/sch/coversch", &DialysisAPIController{}, "Get:MobileCoverSch")
214
+
211 215
 }

+ 571 - 0
controllers/patient_api_controller.go Datei anzeigen

@@ -84,6 +84,54 @@ func PatientApiRegistRouters() {
84 84
 
85 85
 	beego.Router("/api/patient/getexportlist", &PatientApiController{}, "Get:GetExportList")
86 86
 
87
+	beego.Router("/api/patient/savefalloutbedprint", &PatientApiController{}, "Post:SaveFallOutBedPrint")
88
+
89
+	beego.Router("/api/patient/getfalloutbedprintlist", &PatientApiController{}, "Get:GetFallOutBedPrintList")
90
+
91
+	beego.Router("/api/patient/savefilterinformed", &PatientApiController{}, "Post:SaveFilterInformed")
92
+
93
+	beego.Router("/api/patient/getfilterinformed", &PatientApiController{}, "Get:GetFilterInformed")
94
+
95
+	beego.Router("/api/patient/saveprofundainformed", &PatientApiController{}, "Post:SaveProfundaInformed")
96
+
97
+	beego.Router("/api/patient/getprofundainformed", &PatientApiController{}, "Get:GetProfundaInformed")
98
+
99
+	beego.Router("/api/patient/arterovenous", &PatientApiController{}, "Post:SaveArterOvenous")
100
+
101
+	beego.Router("/api/patient/getarterovernous", &PatientApiController{}, "Get:GetArterOverNous")
102
+
103
+	beego.Router("/api/patient/savehighrikinformed", &PatientApiController{}, "Post:SaveHighRikInformed")
104
+
105
+	beego.Router("/api/patient/gethighriskinformed", &PatientApiController{}, "Get:GetHighRiskInformed")
106
+
107
+	beego.Router("/api/patient/saveanticoagulation", &PatientApiController{}, "Post:SaveAnticoagulation")
108
+
109
+	beego.Router("/api/patient/getanticoagulationInformed", &PatientApiController{}, "Get:GetAnticoagulationInformed")
110
+
111
+	beego.Router("/api/patient/savecriticalinfomed", &PatientApiController{}, "Post:SaveCriticalInfomed")
112
+
113
+	beego.Router("/api/patient/getcriticalinformed", &PatientApiController{}, "Get:GetCriticalInformed")
114
+
115
+	beego.Router("/api/patient/savehemoperfusioninformed", &PatientApiController{}, "Post:SaveHemoperfusionInformed")
116
+
117
+	beego.Router("/api/patient/gethemoperfusioninformed", &PatientApiController{}, "Get:GetHemoperfusionInformed")
118
+
119
+	beego.Router("/api/patient/savebringinformed", &PatientApiController{}, "Post:SaveBringInformed")
120
+
121
+	beego.Router("/api/patient/getinformedcontsent", &PatientApiController{}, "Get:GetInformedContsent")
122
+
123
+	beego.Router("/api/patient/savecatheterization", &PatientApiController{}, "Post:SaveCatheterization")
124
+
125
+	beego.Router("/api/patient/getcatheterization", &PatientApiController{}, "Get:GetCatheterization")
126
+
127
+	beego.Router("/api/patient/savedialyzerInformed", &PatientApiController{}, "Post:SaveDialyzerInformed")
128
+
129
+	beego.Router("/api/patient/getdialyzerinformed", &PatientApiController{}, "Get:GetDialyzerInformed")
130
+
131
+	beego.Router("/api/patient/savetheapyinformed", &PatientApiController{}, "Post:SaveTheapyInformed")
132
+
133
+	beego.Router("api/patient/gettherapyinformed", &PatientApiController{}, "Get:GetTherapyInformed")
134
+
87 135
 }
88 136
 func (c *PatientApiController) GetExportList() {
89 137
 	startTime := c.GetString("start_time")
@@ -6060,3 +6108,526 @@ func (c *PatientApiController) GetDialysisSolutionDetailList() {
6060 6108
 		"total": total,
6061 6109
 	})
6062 6110
 }
6111
+
6112
+func (c *PatientApiController) SaveFallOutBedPrint() {
6113
+
6114
+	adminInfo := c.GetAdminUserInfo()
6115
+	orgid := adminInfo.CurrentOrgId
6116
+	dataBody := make(map[string]interface{}, 0)
6117
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6118
+	fmt.Println("err", err)
6119
+	content := dataBody["content"].(string)
6120
+
6121
+	outPrint := models.XtFallOutPrint{
6122
+		UserOrgId: orgid,
6123
+		Content:   content,
6124
+		Status:    1,
6125
+		Ctime:     time.Now().Unix(),
6126
+		Mtime:     time.Now().Unix(),
6127
+	}
6128
+
6129
+	//查询该机构是否存在
6130
+	list, err := service.GetOutPrintList(orgid)
6131
+
6132
+	if list.ID == 0 {
6133
+		service.CreateFallOutBedPrint(outPrint)
6134
+	}
6135
+
6136
+	if list.ID > 0 {
6137
+		service.UpdateFallOutBedPrint(list.ID, content)
6138
+	}
6139
+
6140
+	c.ServeSuccessJSON(map[string]interface{}{
6141
+		"list": list,
6142
+	})
6143
+}
6144
+
6145
+func (c *PatientApiController) GetFallOutBedPrintList() {
6146
+
6147
+	adminInfo := c.GetAdminUserInfo()
6148
+	orgid := adminInfo.CurrentOrgId
6149
+
6150
+	list, _ := service.GetFallOutBedPrintList(orgid)
6151
+	c.ServeSuccessJSON(map[string]interface{}{
6152
+		"list": list,
6153
+	})
6154
+}
6155
+
6156
+func (c *PatientApiController) SaveFilterInformed() {
6157
+
6158
+	adminInfo := c.GetAdminUserInfo()
6159
+	orgid := adminInfo.CurrentOrgId
6160
+	dataBody := make(map[string]interface{}, 0)
6161
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6162
+	fmt.Println("err", err)
6163
+	content := dataBody["content"].(string)
6164
+	informed := models.XtFilterInformed{
6165
+		UserOrgId: orgid,
6166
+		Content:   content,
6167
+		Status:    1,
6168
+		Ctime:     time.Now().Unix(),
6169
+		Mtime:     time.Now().Unix(),
6170
+	}
6171
+
6172
+	filterInformed, _ := service.GetFilterInformed(orgid)
6173
+
6174
+	if filterInformed.ID == 0 {
6175
+
6176
+		service.CreateFilterInformed(informed)
6177
+	}
6178
+
6179
+	if filterInformed.ID > 0 {
6180
+
6181
+		service.UpdateFilterInformed(filterInformed.ID, content)
6182
+	}
6183
+
6184
+	c.ServeSuccessJSON(map[string]interface{}{
6185
+		"informed": informed,
6186
+	})
6187
+
6188
+}
6189
+
6190
+func (c *PatientApiController) GetFilterInformed() {
6191
+
6192
+	adminInfo := c.GetAdminUserInfo()
6193
+	orgid := adminInfo.CurrentOrgId
6194
+	filterInformed, _ := service.GetFilterInformed(orgid)
6195
+
6196
+	c.ServeSuccessJSON(map[string]interface{}{
6197
+		"list": filterInformed,
6198
+	})
6199
+}
6200
+
6201
+func (c *PatientApiController) SaveProfundaInformed() {
6202
+
6203
+	adminInfo := c.GetAdminUserInfo()
6204
+	orgid := adminInfo.CurrentOrgId
6205
+	dataBody := make(map[string]interface{}, 0)
6206
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6207
+	fmt.Println("err", err)
6208
+	content := dataBody["content"].(string)
6209
+
6210
+	informed := models.XtProfundaInformed{
6211
+		UserOrgId: orgid,
6212
+		Content:   content,
6213
+		Status:    1,
6214
+		Ctime:     time.Now().Unix(),
6215
+		Mtime:     time.Now().Unix(),
6216
+	}
6217
+
6218
+	profundaInformed, _ := service.GetProfundaInformed(orgid)
6219
+
6220
+	if profundaInformed.ID == 0 {
6221
+		service.CreateProfundaInformed(informed)
6222
+	}
6223
+
6224
+	if profundaInformed.ID > 0 {
6225
+
6226
+		service.UpdateProfundaInformed(profundaInformed.ID, content)
6227
+	}
6228
+
6229
+	c.ServeSuccessJSON(map[string]interface{}{
6230
+		"list": profundaInformed,
6231
+	})
6232
+}
6233
+
6234
+func (c *PatientApiController) GetProfundaInformed() {
6235
+
6236
+	adminInfo := c.GetAdminUserInfo()
6237
+	orgid := adminInfo.CurrentOrgId
6238
+
6239
+	profundaInformed, _ := service.GetProfundaInformed(orgid)
6240
+
6241
+	c.ServeSuccessJSON(map[string]interface{}{
6242
+		"list": profundaInformed,
6243
+	})
6244
+}
6245
+
6246
+func (c *PatientApiController) SaveArterOvenous() {
6247
+
6248
+	adminInfo := c.GetAdminUserInfo()
6249
+	orgid := adminInfo.CurrentOrgId
6250
+
6251
+	dataBody := make(map[string]interface{}, 0)
6252
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6253
+	fmt.Println("err", err)
6254
+	content := dataBody["content"].(string)
6255
+
6256
+	arterOvenous := models.XtArterOvenous{
6257
+		UserOrgId: orgid,
6258
+		Content:   content,
6259
+		Status:    1,
6260
+		Ctime:     time.Now().Unix(),
6261
+		Mtime:     time.Now().Unix(),
6262
+	}
6263
+
6264
+	list, _ := service.GetArterOvenousList(orgid)
6265
+
6266
+	if list.ID == 0 {
6267
+
6268
+		service.CreateArterOvernous(arterOvenous)
6269
+	}
6270
+
6271
+	if list.ID > 0 {
6272
+		service.UpdateArterOvernous(list.ID, content)
6273
+	}
6274
+
6275
+	c.ServeSuccessJSON(map[string]interface{}{
6276
+		"list": list,
6277
+	})
6278
+}
6279
+
6280
+func (c *PatientApiController) GetArterOverNous() {
6281
+
6282
+	adminInfo := c.GetAdminUserInfo()
6283
+	orgid := adminInfo.CurrentOrgId
6284
+
6285
+	list, _ := service.GetArterOvenousList(orgid)
6286
+
6287
+	c.ServeSuccessJSON(map[string]interface{}{
6288
+		"list": list,
6289
+	})
6290
+
6291
+}
6292
+
6293
+func (c *PatientApiController) SaveHighRikInformed() {
6294
+
6295
+	adminInfo := c.GetAdminUserInfo()
6296
+	orgid := adminInfo.CurrentOrgId
6297
+
6298
+	dataBody := make(map[string]interface{}, 0)
6299
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6300
+	fmt.Println("err", err)
6301
+	content := dataBody["content"].(string)
6302
+
6303
+	risk := models.XtHightRisk{
6304
+		UserOrgId: orgid,
6305
+		Content:   content,
6306
+		Status:    1,
6307
+		Ctime:     time.Now().Unix(),
6308
+		Mtime:     time.Now().Unix(),
6309
+	}
6310
+
6311
+	highRik, _ := service.GetHightRikInformed(orgid)
6312
+
6313
+	if highRik.ID == 0 {
6314
+
6315
+		service.CreateHighRik(risk)
6316
+	}
6317
+
6318
+	if highRik.ID > 0 {
6319
+
6320
+		service.UpdateHighRik(highRik.ID, content)
6321
+	}
6322
+
6323
+	c.ServeSuccessJSON(map[string]interface{}{
6324
+		"list": risk,
6325
+	})
6326
+}
6327
+
6328
+func (c *PatientApiController) GetHighRiskInformed() {
6329
+
6330
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6331
+
6332
+	rikInformed, _ := service.GetHightRikInformed(orgId)
6333
+
6334
+	c.ServeSuccessJSON(map[string]interface{}{
6335
+		"list": rikInformed,
6336
+	})
6337
+}
6338
+
6339
+func (c *PatientApiController) SaveAnticoagulation() {
6340
+
6341
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6342
+	dataBody := make(map[string]interface{}, 0)
6343
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6344
+	fmt.Println("err", err)
6345
+	content := dataBody["content"].(string)
6346
+
6347
+	auticoagutionPrint := models.XtAuticoagutionPrint{
6348
+		Content:   content,
6349
+		UserOrgId: orgId,
6350
+		Status:    1,
6351
+		Ctime:     time.Now().Unix(),
6352
+		Mtime:     time.Now().Unix(),
6353
+	}
6354
+
6355
+	anticoagulation, _ := service.GetAnticoagulation(orgId)
6356
+
6357
+	if anticoagulation.ID == 0 {
6358
+
6359
+		service.CreateAnticoagulation(auticoagutionPrint)
6360
+	}
6361
+
6362
+	if anticoagulation.ID > 0 {
6363
+
6364
+		service.UpdateAnticoagulation(anticoagulation.ID, content)
6365
+	}
6366
+
6367
+	c.ServeSuccessJSON(map[string]interface{}{
6368
+		"list": auticoagutionPrint,
6369
+	})
6370
+
6371
+}
6372
+
6373
+func (c *PatientApiController) GetAnticoagulationInformed() {
6374
+
6375
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6376
+
6377
+	anticoagulation, _ := service.GetAnticoagulation(orgId)
6378
+
6379
+	c.ServeSuccessJSON(map[string]interface{}{
6380
+		"list": anticoagulation,
6381
+	})
6382
+}
6383
+
6384
+func (c *PatientApiController) SaveCriticalInfomed() {
6385
+
6386
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6387
+	dataBody := make(map[string]interface{}, 0)
6388
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6389
+	fmt.Println("err", err)
6390
+	content := dataBody["content"].(string)
6391
+
6392
+	criticalinfomedPrint := models.XtCriticalinfomedPrint{
6393
+		UserOrgId: orgId,
6394
+		Content:   content,
6395
+		Status:    1,
6396
+		Ctime:     time.Now().Unix(),
6397
+		Mtime:     time.Now().Unix(),
6398
+	}
6399
+
6400
+	infomed, _ := service.GetCriticalInfomed(orgId)
6401
+
6402
+	if infomed.ID == 0 {
6403
+		service.CreatedCriticalInfomed(criticalinfomedPrint)
6404
+	}
6405
+
6406
+	if infomed.ID > 0 {
6407
+		service.UpdateCriticalInfomed(infomed.ID, content)
6408
+	}
6409
+
6410
+	c.ServeSuccessJSON(map[string]interface{}{
6411
+		"list": criticalinfomedPrint,
6412
+	})
6413
+}
6414
+
6415
+func (c *PatientApiController) GetCriticalInformed() {
6416
+
6417
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6418
+
6419
+	infomed, _ := service.GetCriticalInfomed(orgId)
6420
+
6421
+	c.ServeSuccessJSON(map[string]interface{}{
6422
+		"list": infomed,
6423
+	})
6424
+}
6425
+
6426
+func (c *PatientApiController) SaveHemoperfusionInformed() {
6427
+
6428
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6429
+	dataBody := make(map[string]interface{}, 0)
6430
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6431
+	fmt.Println("err", err)
6432
+	content := dataBody["content"].(string)
6433
+
6434
+	hemoperfusionmedPrint := models.XtHemoperfusionmedPrint{
6435
+		UserOrgId: orgId,
6436
+		Content:   content,
6437
+		Status:    1,
6438
+		Ctime:     time.Now().Unix(),
6439
+		Mtime:     time.Now().Unix(),
6440
+	}
6441
+
6442
+	informed, _ := service.GetHemoperfusionInformed(orgId)
6443
+
6444
+	if informed.ID == 0 {
6445
+
6446
+		service.CreateHemoperfusionInformed(hemoperfusionmedPrint)
6447
+	}
6448
+
6449
+	if informed.ID > 0 {
6450
+
6451
+		service.UpdateHemoperfusionInformed(informed.ID, content)
6452
+	}
6453
+
6454
+	c.ServeSuccessJSON(map[string]interface{}{
6455
+		"list": hemoperfusionmedPrint,
6456
+	})
6457
+}
6458
+
6459
+func (c *PatientApiController) GetHemoperfusionInformed() {
6460
+
6461
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6462
+
6463
+	informed, _ := service.GetHemoperfusionInformed(orgId)
6464
+
6465
+	c.ServeSuccessJSON(map[string]interface{}{
6466
+		"list": informed,
6467
+	})
6468
+}
6469
+
6470
+func (c *PatientApiController) SaveBringInformed() {
6471
+
6472
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6473
+	dataBody := make(map[string]interface{}, 0)
6474
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6475
+	fmt.Println("err", err)
6476
+	content := dataBody["content"].(string)
6477
+
6478
+	bringinformedPrint := models.XtBringinformedPrint{
6479
+		Content:   content,
6480
+		UserOrgId: orgId,
6481
+		Ctime:     time.Now().Unix(),
6482
+		Mtime:     time.Now().Unix(),
6483
+		Status:    1,
6484
+	}
6485
+
6486
+	informed, _ := service.GetBringInformed(orgId)
6487
+
6488
+	if informed.ID == 0 {
6489
+		service.CreateBringInformed(bringinformedPrint)
6490
+	}
6491
+	if informed.ID > 0 {
6492
+		service.UpdateBringInformed(informed.ID, content)
6493
+	}
6494
+
6495
+	c.ServeSuccessJSON(map[string]interface{}{
6496
+		"list": bringinformedPrint,
6497
+	})
6498
+}
6499
+
6500
+func (c *PatientApiController) GetInformedContsent() {
6501
+
6502
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6503
+	informed, _ := service.GetBringInformed(orgId)
6504
+
6505
+	c.ServeSuccessJSON(map[string]interface{}{
6506
+		"list": informed,
6507
+	})
6508
+}
6509
+
6510
+func (c *PatientApiController) SaveCatheterization() {
6511
+
6512
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6513
+	dataBody := make(map[string]interface{}, 0)
6514
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6515
+	fmt.Println("err", err)
6516
+	content := dataBody["content"].(string)
6517
+
6518
+	cathetercationPrint := models.XtCathetercationPrint{
6519
+		UserOrgId: orgId,
6520
+		Content:   content,
6521
+		Status:    1,
6522
+		Ctime:     time.Now().Unix(),
6523
+		Mtime:     time.Now().Unix(),
6524
+	}
6525
+
6526
+	catheterization, _ := service.GetCatheterization(orgId)
6527
+
6528
+	if cathetercationPrint.ID == 0 {
6529
+
6530
+		service.CreateCatheteriztion(cathetercationPrint)
6531
+	}
6532
+
6533
+	if cathetercationPrint.ID > 0 {
6534
+
6535
+		service.UpdateCatheterization(catheterization.ID, content)
6536
+	}
6537
+
6538
+	c.ServeSuccessJSON(map[string]interface{}{
6539
+		"list": catheterization,
6540
+	})
6541
+}
6542
+
6543
+func (c *PatientApiController) GetCatheterization() {
6544
+
6545
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6546
+	catheterization, _ := service.GetCatheterization(orgId)
6547
+	c.ServeSuccessJSON(map[string]interface{}{
6548
+		"list": catheterization,
6549
+	})
6550
+}
6551
+
6552
+func (c *PatientApiController) SaveDialyzerInformed() {
6553
+
6554
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6555
+	dataBody := make(map[string]interface{}, 0)
6556
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6557
+	fmt.Println("err", err)
6558
+	content := dataBody["content"].(string)
6559
+
6560
+	dialyszerinformedPrint := models.XtDialyszerinformedPrint{
6561
+		UserOrgId: orgId,
6562
+		Content:   content,
6563
+		Status:    1,
6564
+		Ctime:     time.Now().Unix(),
6565
+		Mtime:     time.Now().Unix(),
6566
+	}
6567
+
6568
+	informed, _ := service.GetDialyzerInformed(orgId)
6569
+
6570
+	if informed.ID == 0 {
6571
+
6572
+		service.CreateDialyzerInformed(dialyszerinformedPrint)
6573
+	}
6574
+
6575
+	if informed.ID > 0 {
6576
+		service.UpdateDialyszerInformed(informed.ID, content)
6577
+	}
6578
+	c.ServeSuccessJSON(map[string]interface{}{
6579
+		"list": dialyszerinformedPrint,
6580
+	})
6581
+}
6582
+
6583
+func (c *PatientApiController) GetDialyzerInformed() {
6584
+
6585
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6586
+	informed, _ := service.GetDialyzerInformed(orgId)
6587
+	c.ServeSuccessJSON(map[string]interface{}{
6588
+		"list": informed,
6589
+	})
6590
+}
6591
+
6592
+func (c *PatientApiController) SaveTheapyInformed() {
6593
+
6594
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6595
+	dataBody := make(map[string]interface{}, 0)
6596
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
6597
+	fmt.Println("err", err)
6598
+	content := dataBody["content"].(string)
6599
+
6600
+	theapyinformedPrint := models.XtTheapyinformedPrint{
6601
+		Content:   content,
6602
+		UserOrgId: orgId,
6603
+		Status:    1,
6604
+		Ctime:     time.Now().Unix(),
6605
+		Mtime:     time.Now().Unix(),
6606
+	}
6607
+
6608
+	theapyInformed, _ := service.GetTheapyInformed(orgId)
6609
+
6610
+	if theapyInformed.ID == 0 {
6611
+
6612
+		service.CreateTheapyInformed(theapyinformedPrint)
6613
+	}
6614
+
6615
+	if theapyInformed.ID > 0 {
6616
+
6617
+		service.UpdateTheaphInformed(theapyInformed.ID, content)
6618
+	}
6619
+
6620
+	c.ServeSuccessJSON(map[string]interface{}{
6621
+		"list": theapyinformedPrint,
6622
+	})
6623
+
6624
+}
6625
+
6626
+func (c *PatientApiController) GetTherapyInformed() {
6627
+
6628
+	orgId := c.GetAdminUserInfo().CurrentOrgId
6629
+	theapyInformed, _ := service.GetTheapyInformed(orgId)
6630
+	c.ServeSuccessJSON(map[string]interface{}{
6631
+		"list": theapyInformed,
6632
+	})
6633
+}

+ 3 - 0
controllers/self_drug_api_congtroller.go Datei anzeigen

@@ -4361,6 +4361,9 @@ func (this *SelfDrugApiController) GetPurchaseStockQueryList() {
4361 4361
 		for _, it := range losses {
4362 4362
 			item.WareStartEndStockInventoryLosses = append(item.WareStartEndStockInventoryLosses, it)
4363 4363
 		}
4364
+
4365
+		//获取期初结余
4366
+		//service.GetNewOverInCount(item.ID, orgId, startTime, storeConfig.StorehouseOutInfo)
4364 4367
 	}
4365 4368
 
4366 4369
 	if err != nil {

+ 19 - 23
controllers/sign_api_controller.go Datei anzeigen

@@ -8,6 +8,7 @@ import (
8 8
 	"fmt"
9 9
 	"github.com/astaxie/beego"
10 10
 	"github.com/jung-kurt/gofpdf"
11
+	"github.com/mozillazg/go-pinyin"
11 12
 	"io/ioutil"
12 13
 	"time"
13 14
 )
@@ -664,12 +665,7 @@ func (this *SignApiController) GetEnterPriseDetail() {
664 665
 
665 666
 func (this *SignApiController) UploadPrintOrder() {
666 667
 
667
-	orderList, _ := service.GetWarehouseOutOrderList()
668
-
669
-	for _, item := range orderList {
670
-		service.UpdateWarehouseOutOrderInfo(item.ID, item.WarehouseOutOrderNumber)
671
-	}
672
-	//list, _ := service.GetAllPatientNew(10318)
668
+	//list, _ := service.GetAllPatientNew(10622)
673 669
 	//for _, item := range list {
674 670
 	//
675 671
 	//	hans := item.Name // 要转换的汉字字符串
@@ -696,23 +692,23 @@ func (this *SignApiController) UploadPrintOrder() {
696 692
 	//	//fmt.Println("First Letter:", firstLetter)
697 693
 	//}
698 694
 
699
-	//baseList, _ := service.GeteAllBaseList(10587)
700
-	//for _, item := range baseList {
701
-	//	hans := item.DrugName // 要转换的汉字字符串
702
-	//	// 创建一个拼音转换器
703
-	//	p := pinyin.NewArgs()
704
-	//	// 将汉字转为拼音
705
-	//	pinyinSlice := pinyin.Pinyin(hans, p)
706
-	//	// 获取首字母
707
-	//	firstLetter := ""
708
-	//	for _, py := range pinyinSlice {
709
-	//		if len(py) > 0 {
710
-	//			firstLetter += string(py[0][0])
711
-	//		}
712
-	//	}
713
-	//	item.FirstLetter = firstLetter
714
-	//	service.UpdateBaseList(item.ID, item.FirstLetter)
715
-	//}
695
+	baseList, _ := service.GeteAllBaseList(10622)
696
+	for _, item := range baseList {
697
+		hans := item.DrugName // 要转换的汉字字符串
698
+		// 创建一个拼音转换器
699
+		p := pinyin.NewArgs()
700
+		// 将汉字转为拼音
701
+		pinyinSlice := pinyin.Pinyin(hans, p)
702
+		// 获取首字母
703
+		firstLetter := ""
704
+		for _, py := range pinyinSlice {
705
+			if len(py) > 0 {
706
+				firstLetter += string(py[0][0])
707
+			}
708
+		}
709
+		item.FirstLetter = firstLetter
710
+		service.UpdateBaseList(item.ID, item.FirstLetter)
711
+	}
716 712
 	//pdf := gofpdf.New("P", "mm", "A4", "")
717 713
 	//pdf.AddPage()
718 714
 	//pdf.Text(5, 10, "血液净化治疗记录单")

+ 1 - 0
go.mod Datei anzeigen

@@ -22,6 +22,7 @@ require (
22 22
 	github.com/jung-kurt/gofpdf v1.16.2 // indirect
23 23
 	github.com/kr/text v0.2.0 // indirect
24 24
 	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
25
+	github.com/mozillazg/go-pinyin v0.20.0 // indirect
25 26
 	github.com/prometheus/client_golang v1.7.0 // indirect
26 27
 	github.com/prometheus/client_model v0.2.0 // indirect
27 28
 	github.com/prometheus/common v0.10.0 // indirect

+ 2 - 0
go.sum Datei anzeigen

@@ -112,6 +112,8 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
112 112
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
113 113
 github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
114 114
 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
115
+github.com/mozillazg/go-pinyin v0.20.0 h1:BtR3DsxpApHfKReaPO1fCqF4pThRwH9uwvXzm+GnMFQ=
116
+github.com/mozillazg/go-pinyin v0.20.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
115 117
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
116 118
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
117 119
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=

+ 4 - 0
models/new_stock_models.go Datei anzeigen

@@ -307,6 +307,10 @@ type GoodInfoTwenty struct {
307 307
 	WareStartEndStockInventoryProfit []*VmStockFlowTwenty //期间盘盈
308 308
 	WareStartEndStockInventoryLosses []*VmStockFlowTwenty //期间盘亏
309 309
 
310
+	//newOverInCount     []*VmStockFlowTwenty
311
+	//newOverOuntCount   []*VmStockFlowTwenty
312
+	//newOverCancelCount []*VmStockFlowTwenty
313
+
310 314
 	//期初结余
311 315
 	GoodStartFlowInfo VmStockFlowTwenty
312 316
 	//期末结余

+ 156 - 0
models/patient_models.go Datei anzeigen

@@ -2376,3 +2376,159 @@ type PatientsTwenty struct {
2376 2376
 func (PatientsTwenty) TableName() string {
2377 2377
 	return "xt_patients"
2378 2378
 }
2379
+
2380
+type XtFallOutPrint struct {
2381
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2382
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2383
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2384
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2385
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2386
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2387
+}
2388
+
2389
+func (XtFallOutPrint) TableName() string {
2390
+	return "xt_fall_out_print"
2391
+}
2392
+
2393
+type XtFilterInformed struct {
2394
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2395
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2396
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2397
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2398
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2399
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2400
+}
2401
+
2402
+func (XtFilterInformed) TableName() string {
2403
+	return "xt_filter_informed"
2404
+}
2405
+
2406
+type XtProfundaInformed struct {
2407
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2408
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2409
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2410
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2411
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2412
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2413
+}
2414
+
2415
+func (XtProfundaInformed) TableName() string {
2416
+	return "xt_profunda_informed"
2417
+}
2418
+
2419
+type XtArterOvenous struct {
2420
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2421
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2422
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2423
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2424
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2425
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2426
+}
2427
+
2428
+func (XtArterOvenous) TableName() string {
2429
+	return "xt_arter_ovenous"
2430
+}
2431
+
2432
+type XtHightRisk struct {
2433
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2434
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2435
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2436
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2437
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2438
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2439
+}
2440
+
2441
+func (XtHightRisk) TableName() string {
2442
+	return "xt_hight_risk"
2443
+}
2444
+
2445
+type XtAuticoagutionPrint struct {
2446
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2447
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2448
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2449
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2450
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2451
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2452
+}
2453
+
2454
+func (XtAuticoagutionPrint) TableName() string {
2455
+	return "xt_auticoagution_print"
2456
+}
2457
+
2458
+type XtCriticalinfomedPrint struct {
2459
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2460
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2461
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2462
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2463
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2464
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2465
+}
2466
+
2467
+func (XtCriticalinfomedPrint) TableName() string {
2468
+	return "xt_criticalinfomed_print"
2469
+}
2470
+
2471
+type XtHemoperfusionmedPrint struct {
2472
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2473
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2474
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2475
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2476
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2477
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2478
+}
2479
+
2480
+func (XtHemoperfusionmedPrint) TableName() string {
2481
+	return "xt_hemoperfusionmed_print"
2482
+}
2483
+
2484
+type XtBringinformedPrint struct {
2485
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2486
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2487
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2488
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2489
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2490
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2491
+}
2492
+
2493
+func (XtBringinformedPrint) TableName() string {
2494
+	return "xt_bring_print"
2495
+}
2496
+
2497
+type XtCathetercationPrint struct {
2498
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2499
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2500
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2501
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2502
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2503
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2504
+}
2505
+
2506
+func (XtCathetercationPrint) TableName() string {
2507
+	return "xt_cathetercation_print"
2508
+}
2509
+
2510
+type XtDialyszerinformedPrint struct {
2511
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2512
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2513
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2514
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2515
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2516
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2517
+}
2518
+
2519
+func (XtDialyszerinformedPrint) TableName() string {
2520
+	return "xt_dialyszerinformed_print"
2521
+}
2522
+
2523
+type XtTheapyinformedPrint struct {
2524
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
2525
+	Content   string `gorm:"column:content" json:"content" form:"content"`
2526
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2527
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
2528
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
2529
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
2530
+}
2531
+
2532
+func (XtTheapyinformedPrint) TableName() string {
2533
+	return "xt_theapyinformed_print"
2534
+}

+ 279 - 1
service/patient_service.go Datei anzeigen

@@ -1531,7 +1531,7 @@ func GetPatientDialysisRecord(orgID, patientID int64, page, limit, start, end, m
1531 1531
 		Preload("PredialysisEvaluation", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
1532 1532
 		Preload("DialysisPrescription", func(db *gorm.DB) *gorm.DB {
1533 1533
 			return readDb.Where("patient_id=? and user_org_id=? and status=1", patientID, orgID).Preload("UserAdminRole", func(db *gorm.DB) *gorm.DB {
1534
-				return readUserDb.Where("status = 1")
1534
+				return readUserDb.Where("status = 1 and org_id=?", orgID)
1535 1535
 			})
1536 1536
 		}).
1537 1537
 		Preload("AssessmentAfterDislysis", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
@@ -3404,3 +3404,281 @@ func GetLastAcceptRecrods(patient_id int64) (models.ReceiveTreatmentAsses, error
3404 3404
 	err := XTReadDB().Where("patient_id = ? and status= 1 and admission_number!=''", patient_id).Last(&treatmentAsses).Error
3405 3405
 	return treatmentAsses, err
3406 3406
 }
3407
+
3408
+func GetOutPrintList(user_org_id int64) (models.XtFallOutPrint, error) {
3409
+
3410
+	outPrint := models.XtFallOutPrint{}
3411
+
3412
+	err := XTReadDB().Where("user_org_id = ? and status =1", user_org_id).Find(&outPrint).Error
3413
+
3414
+	return outPrint, err
3415
+}
3416
+
3417
+func CreateFallOutBedPrint(outPrint models.XtFallOutPrint) error {
3418
+
3419
+	err := XTWriteDB().Create(&outPrint).Error
3420
+
3421
+	return err
3422
+}
3423
+
3424
+func UpdateFallOutBedPrint(id int64, content string) error {
3425
+
3426
+	err := XTWriteDB().Model(&models.XtFallOutPrint{}).Where("id = ? and status=1", id).Updates(map[string]interface{}{"content": content}).Error
3427
+
3428
+	return err
3429
+}
3430
+
3431
+func GetFallOutBedPrintList(user_org_id int64) (models.XtFallOutPrint, error) {
3432
+
3433
+	outPrint := models.XtFallOutPrint{}
3434
+
3435
+	err := XTReadDB().Where("user_org_id = ? and status=1", user_org_id).Find(&outPrint).Error
3436
+
3437
+	return outPrint, err
3438
+}
3439
+
3440
+func GetFilterInformed(user_org_id int64) (models.XtFilterInformed, error) {
3441
+
3442
+	informed := models.XtFilterInformed{}
3443
+
3444
+	err := XTReadDB().Where("user_org_id = ? and status =1", user_org_id).Find(&informed).Error
3445
+
3446
+	return informed, err
3447
+}
3448
+
3449
+func CreateFilterInformed(informed models.XtFilterInformed) error {
3450
+
3451
+	err := XTWriteDB().Create(&informed).Error
3452
+
3453
+	return err
3454
+}
3455
+
3456
+func UpdateFilterInformed(id int64, content string) error {
3457
+
3458
+	err := XTWriteDB().Model(&models.XtFilterInformed{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"content": content}).Error
3459
+
3460
+	return err
3461
+}
3462
+
3463
+func GetProfundaInformed(user_org_id int64) (models.XtProfundaInformed, error) {
3464
+
3465
+	informed := models.XtProfundaInformed{}
3466
+
3467
+	err := XTReadDB().Where("user_org_id = ? and status =1", user_org_id).Find(&informed).Error
3468
+
3469
+	return informed, err
3470
+}
3471
+
3472
+func CreateProfundaInformed(informed models.XtProfundaInformed) error {
3473
+
3474
+	err := XTWriteDB().Create(&informed).Error
3475
+
3476
+	return err
3477
+}
3478
+
3479
+func UpdateProfundaInformed(id int64, content string) error {
3480
+
3481
+	profundaInformed := models.XtProfundaInformed{}
3482
+
3483
+	err := XTWriteDB().Model(&profundaInformed).Where("id = ? and status=1", id).Updates(map[string]interface{}{"content": content}).Error
3484
+	return err
3485
+}
3486
+
3487
+func GetArterOvenousList(user_org_id int64) (models.XtArterOvenous, error) {
3488
+
3489
+	ovenous := models.XtArterOvenous{}
3490
+	err := XTReadDB().Where("user_org_id = ? and status=1", user_org_id).Find(&ovenous).Error
3491
+	return ovenous, err
3492
+}
3493
+
3494
+func CreateArterOvernous(ovenous models.XtArterOvenous) error {
3495
+
3496
+	err := XTWriteDB().Create(&ovenous).Error
3497
+
3498
+	return err
3499
+}
3500
+
3501
+func UpdateArterOvernous(id int64, content string) error {
3502
+
3503
+	err := XTWriteDB().Model(&models.XtArterOvenous{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"content": content}).Error
3504
+
3505
+	return err
3506
+}
3507
+
3508
+func GetHightRikInformed(user_org_id int64) (models.XtHightRisk, error) {
3509
+
3510
+	risk := models.XtHightRisk{}
3511
+
3512
+	err := XTReadDB().Where("user_org_id = ? and status =1", user_org_id).Find(&risk).Error
3513
+
3514
+	return risk, err
3515
+}
3516
+
3517
+func CreateHighRik(risk models.XtHightRisk) error {
3518
+
3519
+	err := XTWriteDB().Create(&risk).Error
3520
+
3521
+	return err
3522
+}
3523
+
3524
+func UpdateHighRik(id int64, content string) error {
3525
+
3526
+	err := XTWriteDB().Model(&models.XtHightRisk{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"content": content}).Error
3527
+
3528
+	return err
3529
+}
3530
+
3531
+func GetAnticoagulation(user_org_id int64) (models.XtAuticoagutionPrint, error) {
3532
+
3533
+	auticoagutionPrint := models.XtAuticoagutionPrint{}
3534
+
3535
+	err := XTReadDB().Where("user_org_id = ? and status =1", user_org_id).Find(&auticoagutionPrint).Error
3536
+
3537
+	return auticoagutionPrint, err
3538
+}
3539
+
3540
+func CreateAnticoagulation(auticoagutionPrint models.XtAuticoagutionPrint) error {
3541
+
3542
+	err := XTWriteDB().Create(&auticoagutionPrint).Error
3543
+
3544
+	return err
3545
+}
3546
+
3547
+func UpdateAnticoagulation(id int64, content string) error {
3548
+
3549
+	err := XTWriteDB().Model(&models.XtAuticoagutionPrint{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"content": content}).Error
3550
+
3551
+	return err
3552
+}
3553
+
3554
+func GetCriticalInfomed(org_id int64) (models.XtCriticalinfomedPrint, error) {
3555
+
3556
+	criticalinfomedPrint := models.XtCriticalinfomedPrint{}
3557
+
3558
+	err := XTReadDB().Where("user_org_id = ? and status=1", org_id).Find(&criticalinfomedPrint).Error
3559
+
3560
+	return criticalinfomedPrint, err
3561
+}
3562
+
3563
+func CreatedCriticalInfomed(criticalinfomedPrint models.XtCriticalinfomedPrint) error {
3564
+
3565
+	err := XTWriteDB().Create(&criticalinfomedPrint).Error
3566
+
3567
+	return err
3568
+}
3569
+
3570
+func UpdateCriticalInfomed(id int64, content string) error {
3571
+
3572
+	err := XTWriteDB().Model(&models.XtCriticalinfomedPrint{}).Where("id = ? and status=1", id).Updates(map[string]interface{}{"content": content}).Error
3573
+
3574
+	return err
3575
+}
3576
+
3577
+func GetHemoperfusionInformed(user_org_id int64) (models.XtHemoperfusionmedPrint, error) {
3578
+
3579
+	hemoperfusionmedPrint := models.XtHemoperfusionmedPrint{}
3580
+
3581
+	err := XTReadDB().Where("user_org_id = ? and status =1", user_org_id).Find(&hemoperfusionmedPrint).Error
3582
+
3583
+	return hemoperfusionmedPrint, err
3584
+}
3585
+
3586
+func CreateHemoperfusionInformed(hemoperfusionmedPrint models.XtHemoperfusionmedPrint) error {
3587
+
3588
+	err := XTWriteDB().Create(&hemoperfusionmedPrint).Error
3589
+
3590
+	return err
3591
+}
3592
+
3593
+func UpdateHemoperfusionInformed(id int64, content string) error {
3594
+
3595
+	err := XTWriteDB().Model(&models.XtHemoperfusionmedPrint{}).Where("id = ? and status=1", id).Updates(map[string]interface{}{"content": content}).Error
3596
+
3597
+	return err
3598
+}
3599
+
3600
+func GetBringInformed(org_id int64) (models.XtBringinformedPrint, error) {
3601
+
3602
+	bringinformedPrint := models.XtBringinformedPrint{}
3603
+	err := XTReadDB().Where("user_org_id = ? and status=1", org_id).Find(&bringinformedPrint).Error
3604
+
3605
+	return bringinformedPrint, err
3606
+}
3607
+
3608
+func CreateBringInformed(bringinformedPrint models.XtBringinformedPrint) error {
3609
+
3610
+	err := XTWriteDB().Create(&bringinformedPrint).Error
3611
+
3612
+	return err
3613
+}
3614
+
3615
+func UpdateBringInformed(id int64, content string) error {
3616
+
3617
+	err := XTWriteDB().Model(&models.XtBringinformedPrint{}).Where("id =? and status= 1", id).Updates(map[string]interface{}{"content": content}).Error
3618
+
3619
+	return err
3620
+}
3621
+
3622
+func GetCatheterization(user_org_id int64) (models.XtCathetercationPrint, error) {
3623
+
3624
+	cathetercationPrint := models.XtCathetercationPrint{}
3625
+
3626
+	err := XTReadDB().Where("user_org_id = ? and status= 1", user_org_id).Find(&cathetercationPrint).Error
3627
+	return cathetercationPrint, err
3628
+}
3629
+
3630
+func CreateCatheteriztion(cathetercationPrint models.XtCathetercationPrint) error {
3631
+
3632
+	err := XTWriteDB().Create(&cathetercationPrint).Error
3633
+	return err
3634
+}
3635
+
3636
+func UpdateCatheterization(id int64, content string) error {
3637
+
3638
+	err := XTWriteDB().Model(models.XtCathetercationPrint{}).Where("id=? and status =1", id).Updates(map[string]interface{}{"content": content}).Error
3639
+
3640
+	return err
3641
+}
3642
+
3643
+func GetDialyzerInformed(org_id int64) (models.XtDialyszerinformedPrint, error) {
3644
+
3645
+	dialyszerinformedPrint := models.XtDialyszerinformedPrint{}
3646
+
3647
+	err := XTReadDB().Where("user_org_id = ? and status=1", org_id).Find(&dialyszerinformedPrint).Error
3648
+
3649
+	return dialyszerinformedPrint, err
3650
+}
3651
+
3652
+func CreateDialyzerInformed(dialyszerinformedPrint models.XtDialyszerinformedPrint) error {
3653
+
3654
+	err := XTWriteDB().Create(&dialyszerinformedPrint).Error
3655
+
3656
+	return err
3657
+}
3658
+
3659
+func UpdateDialyszerInformed(id int64, content string) error {
3660
+
3661
+	err := XTWriteDB().Model(&models.XtDialyszerinformedPrint{}).Where("id = ? and status=1", id).Updates(map[string]interface{}{"content": content}).Error
3662
+	return err
3663
+}
3664
+
3665
+func GetTheapyInformed(org_id int64) (models.XtTheapyinformedPrint, error) {
3666
+
3667
+	theapyinformedPrint := models.XtTheapyinformedPrint{}
3668
+
3669
+	err := XTReadDB().Where("user_org_id = ? and status=1", org_id).Find(&theapyinformedPrint).Error
3670
+
3671
+	return theapyinformedPrint, err
3672
+}
3673
+
3674
+func CreateTheapyInformed(theapyinformedPrint models.XtTheapyinformedPrint) error {
3675
+
3676
+	err := XTWriteDB().Create(&theapyinformedPrint).Error
3677
+	return err
3678
+}
3679
+
3680
+func UpdateTheaphInformed(id int64, content string) error {
3681
+
3682
+	err := XTWriteDB().Model(&models.XtTheapyinformedPrint{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"content": content}).Error
3683
+	return err
3684
+}