Browse Source

健康档案添加随访记录

cc12458 1 năm trước cách đây
mục cha
commit
86598879c0

+ 6 - 0
src/components/PatientHealthRecordPreview.vue

@@ -71,6 +71,12 @@ const panels = shallowReactive([
     title: '就诊记录',
     title: '就诊记录',
     component: defineAsyncComponent(() => import('@/widgets/PatientDiagnosisRecordsWidget.vue')),
     component: defineAsyncComponent(() => import('@/widgets/PatientDiagnosisRecordsWidget.vue')),
   },
   },
+  {
+    id: 'patient-followUp-records',
+    title: '就诊随访',
+    component: defineAsyncComponent(() => import('@/widgets/PatientFollowUpRecordsWidget.vue')),
+  },
+  { id: 'patient-service-records', title: '调养记录', disabled: true },
   {
   {
     id: 'patient-health-records',
     id: 'patient-health-records',
     title: '健康分析记录',
     title: '健康分析记录',

+ 2 - 2
src/model/diagnosis-report.model.ts

@@ -50,7 +50,7 @@ export function fromDiagnosisReport(data: DiagnosisReportDTO): DiagnosisReportVO
   return vo;
   return vo;
 }
 }
 
 
-interface PatientVO {
+export interface PatientVO {
   id: string;
   id: string;
   name: string;
   name: string;
   avatar?: string;
   avatar?: string;
@@ -63,7 +63,7 @@ interface PatientVO {
   address?: string;
   address?: string;
 }
 }
 
 
-interface PatientDTO {
+export interface PatientDTO {
   name: string;
   name: string;
   sex: string;
   sex: string;
   age: string;
   age: string;

+ 74 - 0
src/model/follow-up-report.model.ts

@@ -0,0 +1,74 @@
+import { type DiagnosisReportVO, fromDiagnosisReport, type PatientVO } from '@/model/diagnosis-report.model';
+
+export interface FollowUpEvaluationReportDTO {
+  id: string;
+
+  patientId: string;
+  patientName: string;
+  sex: '1' | '2';
+  age: string | number;
+  phone: string;
+  tagNames: string;
+
+  followupPlanName: string;
+
+  progress: '0' | '1' | '2';
+  evaluateProgress: '0' | '1';
+  evaluateDeal: '1' | '2';
+  evaluateBy: string;
+
+  evaluate?: {
+    evaluateDeal: '1' | '2';
+  }
+}
+
+export interface FollowUpEvaluationReportVO {
+  id: string;
+  plan: {
+    name: string;
+  };
+  followUp: {
+    status: string | { value: '0' | '1' | '2'; label: string };
+  };
+  evaluation: {
+    status: string | { value: '0' | '1'; label: string };
+    result: string | { value: '1' | '2'; label: string };
+    operator: {
+      name: string;
+    };
+  };
+  patient: PatientVO;
+  diagnosis: DiagnosisReportVO;
+  tags: string;
+
+  __origin__?: FollowUpEvaluationReportDTO;
+}
+
+export function fromFollowUpEvaluationReport({ id, ...data }: FollowUpEvaluationReportDTO): FollowUpEvaluationReportVO {
+  Object.assign(data, data.evaluate)
+  return {
+    id,
+    diagnosis: fromDiagnosisReport(data as any),
+    patient: {
+      id: data.patientId,
+      name: data.patientName,
+      gender: data.sex as PatientVO['gender'],
+      age: data.age,
+      phone: data.phone,
+    },
+    tags: data.tagNames,
+    plan: {
+      name: data.followupPlanName,
+    },
+    evaluation: {
+      status: { value: data.evaluateProgress, label: { 0: '未完成', 1: '已完成' }[data.evaluateProgress] },
+      result: { value: data.evaluateDeal, label: { 1: '复诊', 2: '中医调养' }[data.evaluateDeal] },
+      operator: { name: data.evaluateBy },
+    },
+    followUp: {
+      status: { value: data.progress, label: { 0: '未开始', 1: '未完成', 2: '已完成' }[data.progress] },
+    },
+
+    __origin__: { id, ...data },
+  };
+}

+ 16 - 0
src/request/api/report.api.ts

@@ -17,6 +17,7 @@ import dayjs from 'dayjs';
 
 
 import { fromHealthIndicator, fromHealthReport, type HealthIndicatorItemVO, type HealthIndicatorVO, type HealthReportDTO, type HealthReportVO } from '@/model/health-report.model';
 import { fromHealthIndicator, fromHealthReport, type HealthIndicatorItemVO, type HealthIndicatorVO, type HealthReportDTO, type HealthReportVO } from '@/model/health-report.model';
 import { type DiagnosisReportDTO, type DiagnosisReportVO, fromDiagnosisReport } from '@/model/diagnosis-report.model';
 import { type DiagnosisReportDTO, type DiagnosisReportVO, fromDiagnosisReport } from '@/model/diagnosis-report.model';
+import { type FollowUpEvaluationReportDTO, type FollowUpEvaluationReportVO, fromFollowUpEvaluationReport } from '@/model/follow-up-report.model';
 
 
 
 
 export function reportsMethod(patientId: string) {
 export function reportsMethod(patientId: string) {
@@ -306,4 +307,19 @@ export function getPatientDiagnosisReportMethod(id: string | number, patientId?:
       },
       },
     },
     },
   );
   );
+}
+
+/**
+ * 获取患者随访评估记录列表
+ * @param page
+ * @param size
+ * @param query
+ */
+export function getPatientFollowUpEvaluationRecordsMethod(page: number, size: number, query: { patientId: string }) {
+  return request.Post<{ total: number; data: FollowUpEvaluationReportVO[] }, { total: number; data: FollowUpEvaluationReportDTO[] }>(`/fdhb-pc/followupTaskManage/pageFollowupTaskGroup`, query, {
+    params: { pageNum: page, pageSize: size, ...query },
+    transform({ data, total }) {
+      return { total, data: data.map(fromFollowUpEvaluationReport) };
+    },
+  });
 }
 }

+ 89 - 0
src/widgets/PatientFollowUpRecordsWidget.vue

@@ -0,0 +1,89 @@
+<script setup lang="ts">
+import { usePagination } from 'alova/client';
+import { getPatientFollowUpEvaluationRecordsMethod } from '@/request/api/report.api';
+import type { VxeGridInstance, VxeGridListeners, VxeGridProps } from 'vxe-table';
+import type { DiagnosisReportVO } from '@/model/diagnosis-report.model';
+import { VxeUI } from 'vxe-pc-ui';
+import type { FollowUpEvaluationReportVO } from '@/model/follow-up-report.model';
+import type { EvaluationModel } from '@/model';
+
+const props = defineProps<{ patient: { id: string } }>();
+
+const grid = ref<VxeGridInstance>();
+const { data, loading, page, isLastPage, refresh } = usePagination((page, size) => getPatientFollowUpEvaluationRecordsMethod(page, size, { patientId: props.patient.id }), {
+  initialData: { total: 0, data: [] },
+  initialPage: 0,
+  initialPageSize: 100,
+  append: true,
+  watchingStates: [() => props.patient.id],
+}).onSuccess(({ data: { data } }) => {});
+const gridOptions = reactive<VxeGridProps<DiagnosisReportVO>>({
+  // @ts-ignore
+  loading,
+  height: 'auto',
+  headerAlign: 'center',
+  align: 'center',
+  columnConfig: {
+    resizable: true,
+  },
+  columns: [
+    { field: 'followUp.status.label', title: '随访状态' },
+    { field: 'plan.name', title: '随访计划' },
+    { field: 'diagnosis.date', title: '就诊时间', width: '150px' },
+    { field: 'diagnosis.doctor.name', title: '就诊医生' },
+    { field: 'patient.phone', title: '手机号码' },
+    { field: 'tags', title: '标签' },
+    { field: 'evaluation.status.label', title: '评估状态' },
+    { field: 'evaluation.result.label', title: '评估结果' },
+    { field: 'evaluation.operator.name', title: '评估人' },
+    { title: '操作', align: 'center', width: 120, slots: { default: 'cell-operation' } },
+  ],
+  // @ts-ignore
+  data,
+  scrollY: {
+    gt: 0,
+  },
+});
+const gridEvents: VxeGridListeners = {
+  scrollBoundary({ direction, isBottom }) {
+    if (isBottom && direction === 'bottom' && !isLastPage.value) page.value++;
+  },
+};
+
+function openPatientDiagnosisRecordPreview(row: FollowUpEvaluationReportVO, index: number) {
+  const component = defineAsyncComponent(() => import('@/components/Evaluation.vue'));
+  const id = `assess-modal`;
+  const onDestroy = () => { VxeUI.modal.close(id); };
+  onDestroy();
+  VxeUI.modal.open({
+    id, title: `随访评估详情`,
+    escClosable: true,
+    destroyOnClose: true,
+    resize: true,
+    width: window.innerWidth * 0.6,
+    height: window.innerHeight * 0.8,
+    minWidth: Math.min(window.innerWidth * 0.98, 1200),
+    slots: {
+      default() {
+        return h(component, {
+          data: row.__origin__! as any,
+          onSubmit() {
+            refresh(page.value);
+            onDestroy();
+          },
+        });
+      },
+    },
+  });
+}
+</script>
+
+<template>
+  <vxe-grid ref="grid" v-bind="gridOptions" v-on="gridEvents">
+    <template #cell-operation="{ row, rowIndex }">
+      <vxe-button @click="openPatientDiagnosisRecordPreview(row, rowIndex)">{{ row.evaluation.status.value === '1' ? '查看' : '评估' }}</vxe-button>
+    </template>
+  </vxe-grid>
+</template>
+
+<style scoped lang="scss"></style>