Эх сурвалжийг харах

开方保存时安全合理用药 超剂量药品 根据剂量判断

cc12458 6 сар өмнө
parent
commit
3ca5ced482

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

@@ -3457,7 +3457,8 @@ export default {
         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)
+      }).then(res => res.code === 0 ? Object.assign({medid: id}, res.data) : null).catch(err => null);
+      const get = (medid) => child.recipe_tabs[index].totalTableD.find(item => item.medid === medid);
 
       const rationalMed = await Promise.all(gather.map(request)).then(data => data.filter(Boolean));
       return rationalMed.reduce((data, item) => {
@@ -3540,12 +3541,17 @@ export default {
           </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>`);
+          try {
+            const dose = CC_Dosage2Basis(get(item.medid));
+            if (dose < item.matmindosage || dose > 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>`);
+            }
+          } catch (e) {}
         }
         return data;
       }, {title: `中药处方${index + 1}`});