|
@@ -1389,6 +1389,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1389
|
1389
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
1390
|
1390
|
|
1391
|
1391
|
is_water := c.GetString("is_water")
|
|
1392
|
+
|
1392
|
1393
|
var is_war int64
|
1393
|
1394
|
if is_water == "是" {
|
1394
|
1395
|
is_war = 1
|
|
@@ -1407,6 +1408,13 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1407
|
1408
|
add_amount, _ := c.GetFloat("add_amount")
|
1408
|
1409
|
reduce_amount, _ := c.GetFloat("reduce_amount")
|
1409
|
1410
|
dialysis_remark := c.GetString("dialysis_remark")
|
|
1411
|
+
|
|
1412
|
+ prescribing_number, _ := c.GetFloat("prescribing_number")
|
|
1413
|
+ prescription_sodium := c.GetString("prescription_sodium")
|
|
1414
|
+ start_sodium := c.GetString("start_sodium")
|
|
1415
|
+ sodium_curve := c.GetString("sodium_curve")
|
|
1416
|
+ treatment_remark := c.GetString("treatment_remark")
|
|
1417
|
+
|
1410
|
1418
|
appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
|
1411
|
1419
|
|
1412
|
1420
|
//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
|
|
@@ -1532,6 +1540,11 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1532
|
1540
|
AddAmount: add_amount,
|
1533
|
1541
|
ReduceAmount: reduce_amount,
|
1534
|
1542
|
DialysisRemark: dialysis_remark,
|
|
1543
|
+ PrescribingNumber: prescribing_number,
|
|
1544
|
+ StartSodium: start_sodium,
|
|
1545
|
+ SodiumCurve: sodium_curve,
|
|
1546
|
+ TreatmentRemark: treatment_remark,
|
|
1547
|
+ PrescriptionSodium: prescription_sodium,
|
1535
|
1548
|
}
|
1536
|
1549
|
|
1537
|
1550
|
//查询最近透析准备表里是否存在 透析器 灌流器
|
|
@@ -1620,6 +1633,113 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1620
|
1633
|
|
1621
|
1634
|
err := service.AddSigleRecord(&prescription)
|
1622
|
1635
|
|
|
1636
|
+ //长沙南雅医院,自动生成抗凝剂的临时处方
|
|
1637
|
+ if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 {
|
|
1638
|
+ advice := models.DoctorAdvice{
|
|
1639
|
+ UserOrgId: adminUserInfo.Org.Id,
|
|
1640
|
+ PatientId: id,
|
|
1641
|
+ GroupNo: 0,
|
|
1642
|
+ AdviceType: 2,
|
|
1643
|
+ RecordDate: recordDate.Unix(),
|
|
1644
|
+ AdviceDate: recordDate.Unix(),
|
|
1645
|
+ StartTime: recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
|
|
1646
|
+ AdviceName: "", // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
|
|
1647
|
+ AdviceDesc: "",
|
|
1648
|
+ ReminderDate: 0,
|
|
1649
|
+ SingleDose: 5000,
|
|
1650
|
+ SingleDoseUnit: "iu",
|
|
1651
|
+ DrugSpec: 0,
|
|
1652
|
+ DrugSpecUnit: "",
|
|
1653
|
+ PrescribingNumber: prescribing_number, // 前端传过来的开药数量
|
|
1654
|
+ PrescribingNumberUnit: "支",
|
|
1655
|
+ DeliveryWay: "静脉注射",
|
|
1656
|
+ ExecutionFrequency: "上机前",
|
|
1657
|
+ AdviceDoctor: 0,
|
|
1658
|
+ Status: 1,
|
|
1659
|
+ CreatedTime: time.Now().Unix(),
|
|
1660
|
+ UpdatedTime: time.Now().Unix(),
|
|
1661
|
+ IsPrescription: 1,
|
|
1662
|
+ }
|
|
1663
|
+ // 查询排班信息
|
|
1664
|
+ schedulePatient, _ := service.GetScheduleByPatient(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
1665
|
+ if schedulePatient.ID > 0 {
|
|
1666
|
+ if schedulePatient.ScheduleType == 1 {
|
|
1667
|
+ advice.StartTime = recordDate.Unix() + 7*60*60
|
|
1668
|
+ }
|
|
1669
|
+
|
|
1670
|
+ if schedulePatient.ScheduleType == 2 {
|
|
1671
|
+ advice.StartTime = recordDate.Unix() + 11*60*60
|
|
1672
|
+ }
|
|
1673
|
+ }
|
|
1674
|
+ // 抗凝剂名称
|
|
1675
|
+ switch anticoagulant {
|
|
1676
|
+ case 1:
|
|
1677
|
+ advice.AdviceName = "无肝素"
|
|
1678
|
+ break
|
|
1679
|
+ case 2:
|
|
1680
|
+ advice.AdviceName = "普通肝素"
|
|
1681
|
+ break
|
|
1682
|
+ case 3:
|
|
1683
|
+ advice.AdviceName = "低分子肝素"
|
|
1684
|
+ break
|
|
1685
|
+ case 4:
|
|
1686
|
+ advice.AdviceName = "阿加曲班"
|
|
1687
|
+ break
|
|
1688
|
+ case 5:
|
|
1689
|
+ advice.AdviceName = "枸橼酸钠"
|
|
1690
|
+ break
|
|
1691
|
+ case 6:
|
|
1692
|
+ advice.AdviceName = "低分子肝素钙"
|
|
1693
|
+ break
|
|
1694
|
+ case 7:
|
|
1695
|
+ advice.AdviceName = "低分子肝素钠"
|
|
1696
|
+ break
|
|
1697
|
+ case 8:
|
|
1698
|
+ advice.AdviceName = "依诺肝素"
|
|
1699
|
+ break
|
|
1700
|
+ case 9:
|
|
1701
|
+ advice.AdviceName = "达肝素"
|
|
1702
|
+ break
|
|
1703
|
+ case 10:
|
|
1704
|
+ advice.AdviceName = "体外抗凝"
|
|
1705
|
+ break
|
|
1706
|
+ case 11:
|
|
1707
|
+ advice.AdviceName = "那曲肝素"
|
|
1708
|
+ break
|
|
1709
|
+ case 12:
|
|
1710
|
+ advice.AdviceName = "无抗凝剂"
|
|
1711
|
+ break
|
|
1712
|
+ }
|
|
1713
|
+ advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
|
|
1714
|
+ if appRole.UserType == 2 || appRole.UserType == 1 {
|
|
1715
|
+ advice.AdviceDoctor = appRole.AdminUserId
|
|
1716
|
+ }
|
|
1717
|
+
|
|
1718
|
+ // 患者的临时医嘱里查找是否有抗凝剂临时医嘱
|
|
1719
|
+ advicePrescription, _ := service.GetAdvicesByPrescription(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
1720
|
+ if advicePrescription.ID > 0 && (anticoagulant == 3 || anticoagulant == 5 || anticoagulant == 7) {
|
|
1721
|
+ advice.AdviceName = "低分子肝素钠注射液"
|
|
1722
|
+ // 修改患者临时医嘱里的抗凝剂医嘱
|
|
1723
|
+ advice.ID = advicePrescription.ID
|
|
1724
|
+ service.UpdateDoctorAdvice(&advice)
|
|
1725
|
+ } else {
|
|
1726
|
+ if anticoagulant == 3 || anticoagulant == 5 || anticoagulant == 7 {
|
|
1727
|
+ advice.AdviceName = "低分子肝素钠注射液"
|
|
1728
|
+ }
|
|
1729
|
+ // 新增患者临时医嘱里的抗凝剂医嘱
|
|
1730
|
+ service.CreateDoctorAdvice(&advice)
|
|
1731
|
+ }
|
|
1732
|
+
|
|
1733
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":doctor_advices"
|
|
1734
|
+ redis := service.RedisClient()
|
|
1735
|
+ defer redis.Close()
|
|
1736
|
+ //清空key 值
|
|
1737
|
+ redis.Set(key, "", time.Second)
|
|
1738
|
+ keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":advice_list_all"
|
|
1739
|
+ redis.Set(keyOne, "", time.Second)
|
|
1740
|
+
|
|
1741
|
+ }
|
|
1742
|
+
|
1623
|
1743
|
//获取key,清空redis
|
1624
|
1744
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
1625
|
1745
|
redis := service.RedisClient()
|
|
@@ -2597,9 +2717,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
2597
|
2717
|
record.SystolicBloodPressure = befor.SystolicBloodPressure
|
2598
|
2718
|
record.DiastolicBloodPressure = befor.DiastolicBloodPressure
|
2599
|
2719
|
record.BreathingRate = befor.BreathingRate
|
2600
|
|
- if adminUserInfo.Org.Id != 10445 {
|
2601
|
|
- record.PulseFrequency = befor.PulseFrequency
|
2602
|
|
- }
|
|
2720
|
+ record.PulseFrequency = befor.PulseFrequency
|
2603
|
2721
|
record.Temperature = befor.Temperature
|
2604
|
2722
|
}
|
2605
|
2723
|
}
|
|
@@ -2794,6 +2912,12 @@ func (c *DialysisAPIController) PostSolution() {
|
2794
|
2912
|
is_water := c.GetString("is_water")
|
2795
|
2913
|
add_amount, _ := c.GetFloat("add_amount")
|
2796
|
2914
|
reduce_amount, _ := c.GetFloat("reduce_amount")
|
|
2915
|
+
|
|
2916
|
+ prescribing_number, _ := c.GetFloat("prescribing_number")
|
|
2917
|
+ treatment_remark := c.GetString("treatment_remark")
|
|
2918
|
+ prescription_sodium := c.GetString("prescription_sodium")
|
|
2919
|
+ start_sodium := c.GetString("start_sodium")
|
|
2920
|
+ sodium_curve := c.GetString("sodium_curve")
|
2797
|
2921
|
var is_war int64
|
2798
|
2922
|
if is_water == "是" {
|
2799
|
2923
|
is_war = 1
|
|
@@ -2931,6 +3055,11 @@ func (c *DialysisAPIController) PostSolution() {
|
2931
|
3055
|
AddAmount: add_amount,
|
2932
|
3056
|
ReduceAmount: reduce_amount,
|
2933
|
3057
|
DialysisRemark: dialysis_remark,
|
|
3058
|
+ PrescribingNumber: prescribing_number,
|
|
3059
|
+ PrescriptionSodium: prescription_sodium,
|
|
3060
|
+ StartSodium: start_sodium,
|
|
3061
|
+ SodiumCurve: sodium_curve,
|
|
3062
|
+ TreatmentRemark: treatment_remark,
|
2934
|
3063
|
}
|
2935
|
3064
|
|
2936
|
3065
|
_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
@@ -3030,6 +3159,11 @@ func (c *DialysisAPIController) PostSolution() {
|
3030
|
3159
|
PreImpulse: impulse,
|
3031
|
3160
|
SolutionStatus: 1,
|
3032
|
3161
|
DialysisRemark: dialysis_remark,
|
|
3162
|
+ PrescribingNumber: prescribing_number,
|
|
3163
|
+ PrescriptionSodium: prescription_sodium,
|
|
3164
|
+ StartSodium: start_sodium,
|
|
3165
|
+ SodiumCurve: sodium_curve,
|
|
3166
|
+ TreatmentRemark: treatment_remark,
|
3033
|
3167
|
}
|
3034
|
3168
|
|
3035
|
3169
|
//针对河间咸的
|
|
@@ -3052,6 +3186,110 @@ func (c *DialysisAPIController) PostSolution() {
|
3052
|
3186
|
//更新状态
|
3053
|
3187
|
service.UpdateDialysisSolutionStatusTwo(dialysisSolution.ID, dialysisSolution.ModeId, dialysisSolution.UserOrgId, dialysisSolution.PatientId)
|
3054
|
3188
|
|
|
3189
|
+ //长沙南雅医院,自动生成抗凝剂的临时处方
|
|
3190
|
+ if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 {
|
|
3191
|
+ advice := models.DoctorAdvice{
|
|
3192
|
+ UserOrgId: adminUserInfo.Org.Id,
|
|
3193
|
+ PatientId: id,
|
|
3194
|
+ GroupNo: 0,
|
|
3195
|
+ AdviceType: 2,
|
|
3196
|
+ RecordDate: recordDate.Unix(),
|
|
3197
|
+ AdviceDate: recordDate.Unix(),
|
|
3198
|
+ StartTime: recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
|
|
3199
|
+ AdviceName: "", // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
|
|
3200
|
+ AdviceDesc: "",
|
|
3201
|
+ ReminderDate: 0,
|
|
3202
|
+ SingleDose: 5000,
|
|
3203
|
+ SingleDoseUnit: "iu",
|
|
3204
|
+ DrugSpec: 0,
|
|
3205
|
+ DrugSpecUnit: "",
|
|
3206
|
+ PrescribingNumber: prescribing_number, // 前端传过来的开药数量
|
|
3207
|
+ PrescribingNumberUnit: "支",
|
|
3208
|
+ DeliveryWay: "静脉注射",
|
|
3209
|
+ ExecutionFrequency: "上机前",
|
|
3210
|
+ AdviceDoctor: 0,
|
|
3211
|
+ Status: 1,
|
|
3212
|
+ CreatedTime: time.Now().Unix(),
|
|
3213
|
+ UpdatedTime: time.Now().Unix(),
|
|
3214
|
+ IsPrescription: 1,
|
|
3215
|
+ }
|
|
3216
|
+ // 查询排班信息
|
|
3217
|
+ schedulePatient, _ := service.GetScheduleByPatient(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
3218
|
+ if schedulePatient.ID > 0 {
|
|
3219
|
+ if schedulePatient.ScheduleType == 1 {
|
|
3220
|
+ advice.StartTime = recordDate.Unix() + 7*60*60
|
|
3221
|
+ }
|
|
3222
|
+
|
|
3223
|
+ if schedulePatient.ScheduleType == 2 {
|
|
3224
|
+ advice.StartTime = recordDate.Unix() + 11*60*60
|
|
3225
|
+ }
|
|
3226
|
+ }
|
|
3227
|
+ // 抗凝剂名称
|
|
3228
|
+ switch anticoagulant {
|
|
3229
|
+ case 1:
|
|
3230
|
+ advice.AdviceName = "无肝素"
|
|
3231
|
+ break
|
|
3232
|
+ case 2:
|
|
3233
|
+ advice.AdviceName = "普通肝素"
|
|
3234
|
+ break
|
|
3235
|
+ case 3:
|
|
3236
|
+ advice.AdviceName = "低分子肝素"
|
|
3237
|
+ break
|
|
3238
|
+ case 4:
|
|
3239
|
+ advice.AdviceName = "阿加曲班"
|
|
3240
|
+ break
|
|
3241
|
+ case 5:
|
|
3242
|
+ advice.AdviceName = "枸橼酸钠"
|
|
3243
|
+ break
|
|
3244
|
+ case 6:
|
|
3245
|
+ advice.AdviceName = "低分子肝素钙"
|
|
3246
|
+ break
|
|
3247
|
+ case 7:
|
|
3248
|
+ advice.AdviceName = "低分子肝素钠"
|
|
3249
|
+ break
|
|
3250
|
+ case 8:
|
|
3251
|
+ advice.AdviceName = "依诺肝素"
|
|
3252
|
+ break
|
|
3253
|
+ case 9:
|
|
3254
|
+ advice.AdviceName = "达肝素"
|
|
3255
|
+ break
|
|
3256
|
+ case 10:
|
|
3257
|
+ advice.AdviceName = "体外抗凝"
|
|
3258
|
+ break
|
|
3259
|
+ case 11:
|
|
3260
|
+ advice.AdviceName = "那曲肝素"
|
|
3261
|
+ break
|
|
3262
|
+ case 12:
|
|
3263
|
+ advice.AdviceName = "无抗凝剂"
|
|
3264
|
+ break
|
|
3265
|
+ }
|
|
3266
|
+ advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
|
|
3267
|
+ if appRole.UserType == 2 || appRole.UserType == 1 {
|
|
3268
|
+ advice.AdviceDoctor = appRole.AdminUserId
|
|
3269
|
+ }
|
|
3270
|
+
|
|
3271
|
+ // 患者的临时医嘱里查找是否有抗凝剂临时医嘱
|
|
3272
|
+ advicePrescription, _ := service.GetAdvicesByPrescription(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
3273
|
+
|
|
3274
|
+ if advicePrescription.ID > 0 {
|
|
3275
|
+ // 修改患者临时医嘱里的抗凝剂医嘱
|
|
3276
|
+ advice.ID = advicePrescription.ID
|
|
3277
|
+ service.UpdateDoctorAdvice(&advice)
|
|
3278
|
+ } else {
|
|
3279
|
+ // 新增患者临时医嘱里的抗凝剂医嘱
|
|
3280
|
+ service.CreateDoctorAdvice(&advice)
|
|
3281
|
+ }
|
|
3282
|
+
|
|
3283
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":doctor_advices"
|
|
3284
|
+ redis := service.RedisClient()
|
|
3285
|
+ defer redis.Close()
|
|
3286
|
+ //清空key 值
|
|
3287
|
+ redis.Set(key, "", time.Second)
|
|
3288
|
+ keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":advice_list_all"
|
|
3289
|
+ redis.Set(keyOne, "", time.Second)
|
|
3290
|
+
|
|
3291
|
+ }
|
|
3292
|
+
|
3055
|
3293
|
//获取key,清空redis
|
3056
|
3294
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
3057
|
3295
|
redis := service.RedisClient()
|