Bläddra i källkod

Merge branch 'hotfix/20250206-06'

cc12458 1 år sedan
förälder
incheckning
3d37a06e89

+ 8 - 0
src/api/diagnosis.js

@@ -448,6 +448,14 @@ export function getMaxMinDoaseNumber(data) {
     })
 }
 
+// 获取合理安全用药规则
+export async function getRationalSafeUse() {
+    return request({
+        url: '/basis/medicalInsuranceRegulationMgr/minimumAndMaximumDosageNumber',
+        method: 'post',
+    })
+}
+
 export function getTongueAndFaceAnalysis(data) {
     return request({
         url: '/outpatient/electronicmedicalrecordMgr/getTongueFaceAnalysisResult',

+ 17 - 9
src/components/ChineseMedicine.vue

@@ -1118,7 +1118,7 @@ export default {
     // this.getAccordShareList()
     // this.getPharmacyID()
     // this.getTableDrug('', 1, 0)
-    this.customerQuery();
+    this.loaded();
     // this._getPharmacyIDS();
     this.getProver();
     this.getSelectType("中药药品用法", 0);
@@ -1130,7 +1130,21 @@ export default {
   mounted() {},
   methods: {
     async loaded(props) {
-      if (!this.pharmacyTypes.length) await this.customerQuery(props).catch(() => void 0);
+      if (!this.pharmacyTypes.length) await this.customerQuery().catch(() => void 0);
+
+      let defaultProps = {};
+      try {
+        this.recipe_tabs_c = props.recipe_tabs_c || 0;
+        defaultProps = props.recipe_tabs[this.recipe_tabs_c];
+      } catch(e) {}
+      try {
+        defaultProps = {...this.pharmacyTypes[0], ...defaultProps};
+        this.recipe_tabs[this.recipe_tabs_c].pharmacyID = defaultProps.pharmacyID || this.pharmacyList[0].pid;
+        this.recipe_tabs[this.recipe_tabs_c].radio = defaultProps.radio || defaultProps.ptype;
+        this.recipe_tabs[this.recipe_tabs_c].lastType = defaultProps.radio || defaultProps.ptype;
+      } catch (e) {}
+      this.$forceUpdate();
+      await this.getPharmacyMsg(this.recipe_tabs[this.recipe_tabs_c].pharmacyID);
       return this;
     },
     _splitDataToView(totalData) {
@@ -2351,7 +2365,7 @@ export default {
       }
     },
     // 选择药房
-    async customerQuery(defaultProps = {}) {
+    async customerQuery() {
       let res = await customerQuery({
         type: 0
       });
@@ -2367,14 +2381,8 @@ export default {
             });
           });
         });
-        defaultProps = {...pharmacyTypes[0], ...defaultProps};
-        this.recipe_tabs[this.recipe_tabs_c].pharmacyID = res.Data[0].pid;
-        this.recipe_tabs[this.recipe_tabs_c].radio = defaultProps.ptype;
-        this.recipe_tabs[this.recipe_tabs_c].lastType = defaultProps.ptype;
         this.pharmacyList = res.Data;
         this.pharmacyTypes = pharmacyTypes;
-        this.$forceUpdate();
-        this.getPharmacyMsg(res.Data[0].pid);
       }
     },
     // 获取药房id

+ 24 - 3
src/utils/minix/prescribing.js

@@ -1,4 +1,6 @@
-import { getMaxMinDoaseNumber } from '@/api/diagnosis.js'
+import { getMaxMinDoaseNumber, getRationalSafeUse } from '@/api/diagnosis.js'
+
+let hack_openAddress_true;
 
 export default {
     data() {
@@ -9,6 +11,8 @@ export default {
             showSafeD: false, // 安全合理用药
             isShrink: false, // 是否是收缩状态
 
+            saving: false,
+
             // 中药处方 中成药处方 适宜技术处方提交前暂存
             zhongPrescriptionVo: null,
             chengPrescriptionVo: null,
@@ -146,15 +150,18 @@ export default {
             this.isShowDj = isShowDj
             this.isShowPs = isShowPs
 
-            if (!this.isShowDj) this.isPs = 1;
             this.openAddress()
 
         },
         openAddress() {
+            clearTimeout(hack_openAddress_true);
+            if (!this.isShowPs) this.isPs = 1;
+            if (!this.isShowDj) this.isDaiJian = 2;
+
             if (this.isShowDj || this.isShowPs) {
                 this.showAddress = true;
 
-                setTimeout(() => {
+                hack_openAddress_true = setTimeout(() => {
                     let children = this.$children.filter(item => {
                         return (
                             item.name == "中药处方" ||
@@ -167,6 +174,8 @@ export default {
                     this.isDaiJian = child.recipe_tabs[child.recipe_tabs_c].bottom_form.isDaiJian
                     this.isPs = child.recipe_tabs[child.recipe_tabs_c].bottom_form.radio
                 }, 200)
+            } else {
+                this.showAddress = false;
             }
         },
         // 提交地址信息
@@ -176,6 +185,18 @@ export default {
             this.djChange(model.isDaiJian)
             this.showAddress = false;
         },
+        // 获取合理安全用药提醒配置
+        async getRationalSafeUse() {
+            try {
+                const res = await getRationalSafeUse();
+                return {
+                    options: res.Data.rational_safe.split(',').filter(Boolean),
+                    force: +res.Data.rational_safe_mandatoryOrNot === 1 // 0 否(可以继续开方) 1是(不可以继续开方)
+                }
+            } catch (e) {
+                return {options: [], force: false,}
+            }
+        },
         // 获取医保规则最大/最小药味数
         async getMaxMinDoaseNumber() {
             let res = await getMaxMinDoaseNumber()

+ 174 - 7
src/views/diagnosis/Prescribing.vue

@@ -316,8 +316,8 @@
         </div>
         <!-- 右侧按钮 -->
         <div class="flex-vertical-center-r flex-wrap">
-          <el-button size="mini" @click="openUnifyPrescPrec" type="primary">统建处方</el-button>
-          <el-button size="mini" :loading="tongueAndFaceLoading" :disabled="!tongueAndFaceAnalysis" @click="openTongueAndFaceAnalysis" type="primary">萧山区中医健康微管家</el-button>
+          <el-button size="mini" @click="openUnifyPrescPrec" type="primary">萧然医派协定方</el-button>
+          <el-button size="mini" :loading="tongueAndFaceLoading" :disabled="!tongueAndFaceAnalysis" @click="openTongueAndFaceAnalysis" type="primary">舌面诊影像</el-button>
           <el-button
             size="mini"
             type="primary"
@@ -1060,11 +1060,11 @@
       </div>
     </Popup>
 
-    <!-- 查询统建处方 页面768 -->
+    <!-- 查询萧然医派协定方 页面768 -->
     <Popup
       :showDialog="showUnifyPresc"
       @cancle="showUnifyPresc=false"
-      title="查询统建处方"
+      title="查询萧然医派协定方"
       :showBtns="false"
       width="78%"
       distanceTop="5vh"
@@ -1078,7 +1078,7 @@
     <Popup
         :showDialog="showTongueAnalysis"
         @cancle="showTongueAnalysis=false"
-        title="萧山区中医健康微管家"
+        title="舌面诊影像"
         :showBtns="false"
         width="70%"
         distanceTop="5vh"
@@ -2595,8 +2595,40 @@ export default {
       );
     },
     // 提交中药处方
-    submitRecipe1() {
+    async submitRecipe1() {
       let zhongPrescriptionVo = this.dealRecipe1();
+      if (!zhongPrescriptionVo.length) return;
+
+      this.saving = true;
+      try {
+        const {options, force} = await this.getRationalSafeUse();
+        if (options.length) {
+          const child = this.$children.find(item => item.name === "中药处方");
+          const results = await Promise.all(child.recipe_tabs.map((_, index) => this.getRationalMed2(index)));
+          const tips = results.map((item, index) => {
+            const value = options.map(i => item[i] ? `<div class="title">${item[i].title}</div><div class="content">${item[i].collection.join('')}</div>` : '').join('');
+            return value ? `<div style="padding-top: ${index ? 12 : 0}px;border-bottom: 1px dashed #dcdcdc;"><h2 style="margin-bottom: 16px;">${item.title}</h2>${value}</div>` : '';
+          }).join('');
+          if (tips) {
+            if (!force) {
+              this.$message({
+                dangerouslyUseHTMLString: true,
+                customClass: 'message-rational-safe-use-wrapper',
+                message: tips,
+                duration: 1000 * 3,
+                showClose: true,
+              })
+            } else if (await this.$confirm(tips, '温馨提示:是否保存处方?', {
+              confirmButtonText: '保存',
+              cancelButtonText: '取消',
+              dangerouslyUseHTMLString: true,
+              customClass: 'message-rational-safe-use-wrapper',
+            }).then(() => /* 继续 */ false, () => /* 取消 */ true)) return;
+          }
+        }
+      } catch (e) {}
+      this.saving = false;
+
       let chengPrescriptionVo = {};
       // setTimeout(() => {
       //   chengPrescriptionVo = this.dealRecipe2();
@@ -3421,6 +3453,108 @@ export default {
       }
     },
     // 获取右侧合理用药信息展示
+    async getRationalMed2(index) {
+      const child = this.$children.find(item => item.name === "中药处方");
+      if (index == null) index = child.recipe_tabs_c;
+      const gather = child.recipe_tabs[index].totalTableD.filter(item => item.name && item.medid).map(item => item.medid);
+
+      const request = (id, i, ids) => getRationalMed({
+        matID: id,
+        matIds: [...ids.slice(0, i), ...ids.slice(i + 1)],
+        orgId: this.getuserinfo.organizationid,
+      }).then(res => res.code === 0 ? Object.assign({matid: id}, res.data) : null).catch(err => null)
+
+      const rationalMed = await Promise.all(gather.map(request)).then(data => data.filter(Boolean));
+      return rationalMed.reduce((data, item) => {
+        const color = 'blue';
+
+        if (item.matdosage && item.showDose) {
+          const ref = {}, i = 1;
+          const child = data[i] || (data[i] = {title: '', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">${ref[item.matdosage]}</span>
+          </div>`);
+        }
+        if (item.matsjj) {
+          const ref = {1: '慎用', 2: '忌用', 3: '禁用'}, i = 2;
+          const child = data[i] || (data[i] = {title: '慎忌禁用药', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">${ref[item.matsjj]}</span>
+          </div>`);
+        }
+        if (item.matyfsjj) {
+          const color = item.matyfsjj === '3' ? 'red' : 'blue';
+          const ref = {1: '孕妇慎用', 2: '孕妇忌用', 3: '孕妇禁用'}, i = 3;
+          const child = data[i] || (data[i] = {title: '孕妇慎忌禁', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">${ref[item.matyfsjj]}</span>
+          </div>`);
+        }
+        if (item.matysjj) {
+          const ref = {}, i = 4;
+          const child = data[i] || (data[i] = {title: '服药饮食禁忌', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">${item.matysjj || '无'}</span>
+          </div>`);
+        }
+        if (item.matdxsm) {
+          const color = 'red';
+          const ref = {}, i = 5;
+          const child = data[i] || (data[i] = {title: '药物毒性说明', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">${item.matdxsm || '无'}</span>
+          </div>`);
+        }
+        if (item.matbzjj) {
+          const ref = {}, i = 6;
+          const child = data[i] || (data[i] = {title: '病证用药禁忌', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">${item.matbzjj || '无'}</span>
+          </div>`);
+        }
+        if (item.matsbf) {
+          const color = 'red';
+          const ref = {}, i = 7;
+          const child = data[i] || (data[i] = {title: '十八反', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">反${item.matsbf}</span>
+          </div>`);
+        }
+        if (item.matsjw) {
+          const color = 'red';
+          const ref = {}, i = 8;
+          const child = data[i] || (data[i] = {title: '十九畏', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">畏${item.matsjw}</span>
+          </div>`);
+        }
+        if (item.matby) {
+          const ref = {}, i = 9;
+          const child = data[i] || (data[i] = {title: '用药不宜', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value">不宜与${item.matby}同用</span>
+          </div>`);
+        }
+        if (item.matmindosage && item.matmaxdosage) {
+          const ref = {}, i = 10;
+          const child = data[i] || (data[i] = {title: '超剂量药品', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${item.matname}</span>
+            <span class="met-value" style="color: red;">(${item.matmindosage}-${item.matmaxdosage})</span>
+          </div>`);
+        }
+        return data;
+      }, {title: `中药处方${index + 1}`});
+    },
     async getRationalMed(id) {
       let ids = [];
       // this.rationalMed = []
@@ -5427,10 +5561,43 @@ export default {
 <style lang="scss" scoped>
 @import "../../style/media/diagnosis/prescribing.scss";
 </style>
-<style>
+<style lang="scss">
 /* @media screen and (max-width: 768px) {
   body {
     width: 100% !important;
   }
 } */
+
+.message-rational-safe-use-wrapper {
+  align-items: flex-start;
+  max-height: 80vh;
+  overflow-y: auto;
+
+  &.el-message-box {
+    overflow-y: hidden;
+
+    .el-message-box__content {
+      max-height: calc(80vh - 45px - 48px);
+      overflow: auto;
+    }
+  }
+
+  .title {
+    font-size: 16px;
+    font-weight: 700;
+  }
+
+  .content {
+    margin: 12px 0;
+
+    > div {
+      margin: 8px 0;
+    }
+  }
+
+  .el-message__content {
+    width: 100%;
+    color: #333;
+  }
+}
 </style>