| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- import type { PeopleModel } from '@/model/people.model';
- import type { ReportModel } from '@/model/report.model';
- import dayjs from 'dayjs';
- export interface PatientQuery {
- patientName?: string;
- phone?: string;
- cardno?: string;
- isHaveHealthAnalysisReport?: boolean;
- tags?: string[];
- count?: number;
- }
- export interface PatientModel extends PeopleModel {
- tags?: string[];
- status?: string;
- [key: string]: any;
- }
- export interface EditPatientModel {
- patientId:number
- name: string;
- cardno: string;
- age: string;
- sex: string;
- height: string;
- weight: string;
- womenSpecialPeriod: string;
- foodAllergy: string;
- hobbyFlavor: string;
- drinkState: string;
- smokeState: string;
- detailAddress: string;
- job: string;
- provinceName: string;
- provinceCode: string;
- cityName: string;
- cityCode: string;
- areaCode: string;
- areaName: string;
- updateBy: string;
- }
- export interface PatientReportModel extends PatientModel {
- uid: string;
- report: ReportModel;
- }
- export interface PatientRecordModel extends PatientModel {
- recordDate: string;
- }
- export function transformPatient(data: any): PatientModel {
- return {
- ...data,
- id: data?.patientId ?? '',
- name: data?.patientName ?? data?.name ?? '',
- gender: data?.sex,
- age: data?.age,
- tags: data?.tags ?? [],
- foodAllergy2: data?.foodAllergy?.replace?.('8:', '') ?? '',
- };
- }
- export function transformPatientRecord(data: any): PatientRecordModel {
- return {
- ...transformPatient(data),
- recordDate: data?.analysisEndTime ?? dayjs(data.createTime).format('YYYY/MM/DD'),
- };
- }
- export interface PatientTagDTO {
- id: string;
- name: string;
- type: PatientTagVO['category'];
- status: string;
- }
- export interface PatientTagVO {
- id: string;
- name: string;
- category: '1' | '2';
- disabled?: boolean;
- color: string;
- }
- export function fromPatientTag(data: PatientTagDTO): PatientTagVO {
- return {
- id: data.id,
- name: data.name,
- category: data.type,
- disabled: data.status === '1',
- color: { 1: 'pink', 2: 'blue' }[data.type],
- }
- }
|