Selaa lähdekoodia

fix: 更新基础病历

fan 2 vuotta sitten
vanhempi
commit
f71c559895

+ 35 - 12
src/views/biz/archives/patientBasic/data.ts

@@ -43,18 +43,41 @@ export const BasicData = [
     title: '诊断记录',
     type: 'record',
     data: [
-      {
-        field: 'first',
-        label: '首次透析',
-        value: '2022-01-19 ~',
-        tags: [{ id: '12', label: '活动中', type: 'error' }],
-      },
-      {
-        field: 'first',
-        label: '临床诊断',
-        value: '临床诊断结果',
-        tags: [{ id: '12', label: '活动中', type: 'error' }],
-      },
+      // {
+      //   field: 'firstDialysis',
+      //   label: '首次透析',
+      //   value: '2022-01-19 ~',
+      //   tags: [{ id: '12', label: '活动中', type: 'error' }],
+      // },
+      // {
+      //   field: 'clinic',
+      //   label: '临床诊断',
+      //   value: '临床诊断',
+      //   tags: [{ id: '12', label: '活动中', type: 'error' }],
+      // },
+      // {
+      //   field: 'pathological',
+      //   label: '病理诊断',
+      //   value: '病理诊断',
+      //   tags: [{ id: '12', label: '活动中', type: 'error' }],
+      // },
+      // {
+      //   field: 'complications',
+      //   label: '治疗前合并症',
+      //   value: '治疗前合并症',
+      //   tags: [{ id: '12', label: '活动中', type: 'error' }],
+      // },
+      // {
+      //   field: 'ckd',
+      //   label: 'CKD/AKI',
+      //   value: 'CKD/AKI',
+      //   tags: [{ id: '12', label: '活动中', type: 'error' }],
+      // },
+      // {
+      //   field: 'elseRemark',
+      //   label: '其他诊断',
+      //   value: '其他诊断',
+      // },
     ],
   },
 ];

+ 121 - 1
src/views/biz/archives/patientBasic/index.vue

@@ -23,9 +23,15 @@
   import FormModal from './FormModal.vue';
   import { archivesPatientBasicDetail } from '/@/api/biz/archives/patientBasicApi';
   import { archivesVascularAccessQueryCurrent } from '/@/api/biz/archives/vascularAccessApi';
+  import {
+    archivesDiagnosisHistoryQueryListSingle,
+    archivesDiagnosisHistoryQueryListMulti,
+  } from '@/api/biz/archives/diagnosisHistoryApi';
   import { listDictModelBatch } from '/@/api/common';
-  import { formatDictTags, formatDictValue } from '/@/utils';
+  import { formatDictColor, formatDictFontColor, formatDictTags, formatDictValue } from '/@/utils';
   import dayjs from 'dayjs';
+  import { nanoid } from 'nanoid';
+  import { DiagnosisEnum } from '../diagnosisHistory/data';
 
   const props = defineProps({
     info: {
@@ -48,6 +54,33 @@
     { key: 'type', dictCode: 'pb_type' },
     { key: 'infectiousDiseases', dictCode: 'pb_epidemic' },
     { key: 'accessType', dictCode: 'va_type' },
+    { key: 'dt', dictCode: 'dt' },
+    { key: 'allergic', dictCode: 'allergic' },
+    { key: 'allergic_food', dictCode: 'allergic_food' },
+    { key: 'allergic_touch', dictCode: 'allergic_touch' },
+    { key: 'allergic_air', dictCode: 'allergic_air' },
+    { key: 'allergic_inject', dictCode: 'allergic_inject' },
+    { key: 'contagious_status', dictCode: 'contagious_status' },
+    { key: 'pb_epidemic', dictCode: 'pb_epidemic' },
+    { key: 'complications', dictCode: 'complications' },
+    { key: 'complications_breath', dictCode: 'complications_breath' },
+    { key: 'complications_blood', dictCode: 'complications_blood' },
+    { key: 'complications_incretion', dictCode: 'complications_incretion' },
+    { key: 'clinic', dictCode: 'clinic' },
+    { key: 'clinic_breath', dictCode: 'clinic_breath' },
+    { key: 'clinic_heart', dictCode: 'clinic_heart' },
+    { key: 'clinic_blood', dictCode: 'clinic_blood' },
+    { key: 'clinic_hbgr', dictCode: 'clinic_hbgr' },
+    { key: 'pathological', dictCode: 'pathological' },
+    { key: 'pathological_breath', dictCode: 'pathological_breath' },
+    { key: 'pathological_heart', dictCode: 'pathological_heart' },
+    { key: 'pathological_blood', dictCode: 'pathological_blood' },
+    { key: 'pathological_hbgr', dictCode: 'pathological_hbgr' },
+    { key: 'ckd', dictCode: 'ckd' },
+    { key: 'ckd_breath', dictCode: 'ckd_breath' },
+    { key: 'ckd_heart', dictCode: 'ckd_heart' },
+    { key: 'ckd_blood', dictCode: 'ckd_blood' },
+    { key: 'ckd_hbgr', dictCode: 'ckd_hbgr' },
   ]);
   onMounted(async () => {
     const res = await listDictModelBatch(bizDictData.value.map(ele => ele.dictCode));
@@ -104,6 +137,93 @@
           return ele;
         })) ||
       [];
+    // 诊断记录
+    const DiagnosisHistoryMulti = await archivesDiagnosisHistoryQueryListMulti(props.info?.id);
+    console.log(
+      '🚀 ~ file: index.vue:158 ~ getData ~ DiagnosisHistoryMulti:',
+      DiagnosisHistoryMulti,
+    );
+    // basicData.value[2].data =
+    //   (DiagnosisHistoryMulti &&
+    //     basicData.value[2].data.map(ele => {
+    //       const detail = DiagnosisHistoryMulti[ele.field][0];
+    //       console.log('detail', ele.field, detail);
+    //       // const content = detail['multiContent'][0];
+    //       detail['multiContent'].forEach(content => {
+    //         if (detail.type == 'elseRemark') {
+    //           ele.value = content['remark'];
+    //           // ele.span = 12;
+    //           ele.field = 'elseRemark';
+    //           ele.title = '其他诊断';
+    //           return ele;
+    //         }
+    //         if (!content.type) {
+    //           return ele;
+    //         }
+    //         ele.value = formatDictValue(bizDictOptions[detail.type], content['type']);
+    //         ele.tags = content.multiName.map(mEle => {
+    //           return {
+    //             id: nanoid(),
+    //             label: formatDictValue(bizDictOptions[content.type], mEle),
+    //             fontColor: formatDictFontColor(bizDictOptions[detail.type], content.type),
+    //             bgColor: formatDictColor(bizDictOptions[detail.type], content.type),
+    //           };
+    //         });
+    //         // ele.span = 12;
+    //         return ele;
+    //       });
+    //     })) ||
+    //   [];
+    // const mapData = [];
+    for (const i in DiagnosisHistoryMulti) {
+      console.log('🚀 ~ file: index.vue:178 ~ getData ~  i:', i);
+      getDiagnosisMulti(DiagnosisHistoryMulti[i], i);
+    }
+    const firstDialysisRes = await archivesDiagnosisHistoryQueryListSingle(props.info?.id);
+    const firstDialysisResContent = firstDialysisRes.firstDialysis?.content[0];
+    basicData.value[2].data.unshift({
+      field: 'first',
+      label: '首次透析111',
+      value: firstDialysisResContent?.recordTime
+        ? dayjs(firstDialysisResContent?.recordTime).format('YYYY-MM-DD')
+        : '',
+      tags: [
+        {
+          id: nanoid(5),
+          label: formatDictValue(bizDictOptions['dt'], firstDialysisResContent?.contentType),
+          type: 'success',
+        },
+      ],
+    });
+  }
+
+  function getDiagnosisMulti(data, field) {
+    if (data.length) {
+      data.forEach(detail => {
+        detail['multiContent'].forEach(content => {
+          const obj = {} as any;
+          obj.field = field + '_field';
+          obj.label = DiagnosisEnum[field];
+
+          if (field == DiagnosisEnum.elseRemark_field) {
+            obj.value = content['remark'];
+          } else {
+            if (!content.type) return;
+            obj.value = formatDictValue(bizDictOptions[detail.type], content['type']);
+            obj.tags = content.multiName.map(mEle => {
+              return {
+                id: nanoid(),
+                label: formatDictValue(bizDictOptions[content.type], mEle),
+                fontColor: formatDictFontColor(bizDictOptions[detail.type], content.type),
+                bgColor: formatDictColor(bizDictOptions[detail.type], content.type),
+              };
+            });
+          }
+          // obj.span = 12;
+          basicData.value[2].data.push(obj);
+        });
+      });
+    }
   }
   // 回调
   function callIcon(data) {