|
@@ -1658,6 +1658,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1658
|
1658
|
|
1659
|
1659
|
//长沙南雅医院,自动生成抗凝剂的临时处方
|
1660
|
1660
|
if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
|
|
1661
|
+
|
1661
|
1662
|
advice := models.DoctorAdvice{
|
1662
|
1663
|
UserOrgId: adminUserInfo.Org.Id,
|
1663
|
1664
|
PatientId: id,
|
|
@@ -1734,19 +1735,20 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1734
|
1735
|
break
|
1735
|
1736
|
}
|
1736
|
1737
|
//advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
|
1737
|
|
- if appRole.UserType == 2 || appRole.UserType == 1 {
|
|
1738
|
+
|
|
1739
|
+ if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 4 {
|
1738
|
1740
|
advice.AdviceDoctor = appRole.AdminUserId
|
1739
|
1741
|
}
|
1740
|
1742
|
|
1741
|
1743
|
// 患者的临时医嘱里查找是否有抗凝剂临时医嘱
|
1742
|
1744
|
advicePrescription, _ := service.GetAdvicesByPrescription(adminUserInfo.Org.Id, id, recordDate.Unix())
|
1743
|
|
- if advicePrescription.ID > 0 && (anticoagulant == 3 || anticoagulant == 5 || anticoagulant == 7) {
|
|
1745
|
+ if advicePrescription.ID > 0 && (anticoagulant == 3 || anticoagulant == 6 || anticoagulant == 7) {
|
1744
|
1746
|
advice.AdviceName = "低分子肝素钠注射液"
|
1745
|
1747
|
// 修改患者临时医嘱里的抗凝剂医嘱
|
1746
|
1748
|
advice.ID = advicePrescription.ID
|
1747
|
1749
|
service.UpdateDoctorAdvice(&advice)
|
1748
|
1750
|
} else {
|
1749
|
|
- if anticoagulant == 3 || anticoagulant == 5 || anticoagulant == 7 {
|
|
1751
|
+ if anticoagulant == 3 || anticoagulant == 6 || anticoagulant == 7 {
|
1750
|
1752
|
advice.AdviceName = "低分子肝素钠注射液"
|
1751
|
1753
|
// 新增患者临时医嘱里的抗凝剂医嘱
|
1752
|
1754
|
service.CreateDoctorAdvice(&advice)
|
|
@@ -1854,6 +1856,25 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1854
|
1856
|
prescription.ID = dialysisPrescription.ID
|
1855
|
1857
|
|
1856
|
1858
|
err := service.UpDateDialysisPrescription(&prescription)
|
|
1859
|
+
|
|
1860
|
+ //修改处方
|
|
1861
|
+ if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
|
|
1862
|
+ // 患者的临时医嘱里查找是否有抗凝剂临时医嘱
|
|
1863
|
+ advicePrescription, _ := service.GetAdvicesByPrescription(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
1864
|
+ if advicePrescription.ID > 0 {
|
|
1865
|
+
|
|
1866
|
+ service.UpdateDoctorAdvieById(advicePrescription.ID, prescribing_number)
|
|
1867
|
+
|
|
1868
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":doctor_advices"
|
|
1869
|
+ redis := service.RedisClient()
|
|
1870
|
+ defer redis.Close()
|
|
1871
|
+ //清空key 值
|
|
1872
|
+ redis.Set(key, "", time.Second)
|
|
1873
|
+ keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":advice_list_all"
|
|
1874
|
+ redis.Set(keyOne, "", time.Second)
|
|
1875
|
+ }
|
|
1876
|
+ }
|
|
1877
|
+
|
1857
|
1878
|
//获取key,清空redis
|
1858
|
1879
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
1859
|
1880
|
redis := service.RedisClient()
|
|
@@ -3289,7 +3310,7 @@ func (c *DialysisAPIController) PostSolution() {
|
3289
|
3310
|
break
|
3290
|
3311
|
}
|
3291
|
3312
|
//advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
|
3292
|
|
- if appRole.UserType == 2 || appRole.UserType == 1 {
|
|
3313
|
+ if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 4 {
|
3293
|
3314
|
advice.AdviceDoctor = appRole.AdminUserId
|
3294
|
3315
|
}
|
3295
|
3316
|
|