2023-04-10 09:29:10 +08:00
|
|
|
import { number } from 'yup';
|
|
|
|
import { IClient, IClientContact } from './client';
|
|
|
|
import { IPatient } from './patient';
|
|
|
|
import { IInstrument, IMethod, IUnit, IDepartment } from './setup';
|
|
|
|
import { IStorageContainer, IStorageSlot } from './storage';
|
2021-11-12 05:30:10 +08:00
|
|
|
|
|
|
|
export interface ISampleType {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
name?: string;
|
|
|
|
abbr?: string;
|
|
|
|
description?: string;
|
|
|
|
active?: boolean;
|
2021-11-12 05:30:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisService {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
name?: string;
|
|
|
|
keyword?: string;
|
|
|
|
description?: string;
|
2023-03-19 23:21:32 +08:00
|
|
|
unitUid?: string;
|
2022-03-14 05:05:53 +08:00
|
|
|
unit?: IUnit;
|
2023-04-10 09:29:10 +08:00
|
|
|
departmentUid?: string;
|
2022-03-14 05:05:53 +08:00
|
|
|
sampleTypes?: ISampleType[] | number[];
|
2022-02-06 23:56:47 +08:00
|
|
|
profiles?: IAnalysisProfile[];
|
|
|
|
category?: IAnalysisCategory;
|
2022-02-24 05:07:31 +08:00
|
|
|
resultOptions?: IResultOption[];
|
|
|
|
interims?: IAnalysisInterim[];
|
|
|
|
correctionFactors?: IAnalysisCorrectionFactor[];
|
|
|
|
specifications?: IAnalysisSpecification[];
|
2022-03-03 07:13:52 +08:00
|
|
|
detectionLimits?: IAnalysisDetectionLimit[];
|
2022-02-24 05:07:31 +08:00
|
|
|
uncertainties?: IAnalysisUncertainty[];
|
2022-03-01 20:24:50 +08:00
|
|
|
instruments?: IInstrument[];
|
2022-03-14 05:05:53 +08:00
|
|
|
methods?: IMethod[] | number[];
|
2023-04-10 09:29:10 +08:00
|
|
|
categoryUid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
sortKey?: number;
|
|
|
|
active?: boolean;
|
|
|
|
internalUse?: boolean;
|
2022-03-19 20:41:29 +08:00
|
|
|
tatLengthMinutes: number;
|
|
|
|
precision: number;
|
|
|
|
requiredVerifications: number;
|
|
|
|
selfVerification: boolean;
|
2022-02-06 23:56:47 +08:00
|
|
|
checked?: boolean;
|
2021-11-12 05:30:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisResult {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
|
|
|
analysisUid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
analysis?: IAnalysisService;
|
2023-03-19 23:21:32 +08:00
|
|
|
instrumentUid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
instrument?: IInstrument;
|
2023-03-19 23:21:32 +08:00
|
|
|
methodUid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
method?: IMethod;
|
2023-03-19 23:21:32 +08:00
|
|
|
analystUid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
analyst?: any;
|
|
|
|
worksheetPosition?: number;
|
2023-03-19 23:21:32 +08:00
|
|
|
sampleUid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
sample?: ISample;
|
|
|
|
status?: string;
|
|
|
|
result?: string;
|
|
|
|
retest?: boolean;
|
|
|
|
reportable?: boolean;
|
|
|
|
editResult?: string;
|
|
|
|
createdAt?: string;
|
|
|
|
checked?: boolean;
|
|
|
|
editable?: boolean;
|
2021-11-12 05:30:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisCategory {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
name?: string;
|
|
|
|
description?: string;
|
2023-03-19 23:21:32 +08:00
|
|
|
departmentUid?: string;
|
2022-03-14 05:05:53 +08:00
|
|
|
department?: IDepartment;
|
2022-02-06 23:56:47 +08:00
|
|
|
active?: boolean;
|
2021-11-12 05:30:10 +08:00
|
|
|
}
|
2023-04-10 09:29:10 +08:00
|
|
|
|
2021-11-12 05:30:10 +08:00
|
|
|
export interface IAnalysisProfile {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
name?: string;
|
|
|
|
description?: string;
|
2023-04-10 09:29:10 +08:00
|
|
|
keyword?: string;
|
|
|
|
departmentUid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
analyses?: IAnalysisService[] | number[];
|
2022-03-14 05:05:53 +08:00
|
|
|
sampleTypes?: ISampleType[] | number[];
|
2022-02-06 23:56:47 +08:00
|
|
|
active?: boolean;
|
2021-11-12 05:30:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IQCRequest {
|
2022-02-06 23:56:47 +08:00
|
|
|
qcTemplateUid?: string;
|
|
|
|
qcLevels?: string[]; // uids
|
|
|
|
analysisProfiles?: string[]; // uids
|
|
|
|
analysisServices?: string[]; // uids
|
2021-11-12 05:30:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IQCLevel {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2023-04-10 09:29:10 +08:00
|
|
|
level?: string;
|
2021-11-12 05:30:10 +08:00
|
|
|
}
|
2023-04-10 09:29:10 +08:00
|
|
|
|
2021-11-12 05:30:10 +08:00
|
|
|
export interface IQCTemplate {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2023-04-10 09:29:10 +08:00
|
|
|
name?: string;
|
|
|
|
description?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
qcLevels?: IQCLevel[];
|
|
|
|
departments?: any[];
|
2023-04-10 09:29:10 +08:00
|
|
|
category?: string;
|
2021-11-12 05:30:10 +08:00
|
|
|
}
|
|
|
|
|
2023-04-10 09:29:10 +08:00
|
|
|
export interface IResultOption {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
|
|
|
analysisUid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
optionKey?: number;
|
|
|
|
value?: string;
|
2023-04-10 09:29:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ISample {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
sampleId?: string;
|
|
|
|
sampleType?: ISampleType | undefined;
|
|
|
|
profiles?: IAnalysisProfile[];
|
|
|
|
analyses?: IAnalysisService[];
|
|
|
|
assigned?: boolean;
|
|
|
|
qcLevel?: IQCLevel;
|
|
|
|
analysisRequest?: IAnalysisRequest;
|
|
|
|
analysisResults?: IAnalysisResult[];
|
|
|
|
rejectionReasons?: IRejectionReason[];
|
|
|
|
status?: string;
|
|
|
|
priority?: number;
|
|
|
|
checked?: boolean;
|
2023-04-10 09:29:10 +08:00
|
|
|
dateReceived?: string;
|
2023-01-04 04:12:12 +08:00
|
|
|
storageContainerUid: number;
|
|
|
|
storageContainer: IStorageContainer;
|
2023-02-18 20:59:45 +08:00
|
|
|
storageSlotIndex: number;
|
|
|
|
storageSlot: string;
|
2023-04-10 09:29:10 +08:00
|
|
|
createdByUid?: string;
|
|
|
|
createdBy?: any;
|
|
|
|
createdAt?: string;
|
|
|
|
updatedByUid?: string;
|
|
|
|
updatedBy?: any;
|
|
|
|
updatedAt?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisRequest {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
clinicalData?: string;
|
2023-04-10 09:29:10 +08:00
|
|
|
patient?: IPatient;
|
|
|
|
cientUid?: string;
|
|
|
|
client?: IClient;
|
|
|
|
clientContactUid?: string;
|
|
|
|
clientContact?: IClientContact;
|
2021-11-28 18:42:56 +08:00
|
|
|
clientName?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
samples?: ISample[];
|
|
|
|
clientRequestId?: string;
|
|
|
|
priority?: number;
|
|
|
|
createdAt?: Date;
|
2023-04-10 09:29:10 +08:00
|
|
|
}
|
2021-11-12 05:30:10 +08:00
|
|
|
|
2023-04-10 09:29:10 +08:00
|
|
|
export interface IQCSet {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2023-04-10 09:29:10 +08:00
|
|
|
name?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
samples?: ISample[];
|
2023-04-10 09:29:10 +08:00
|
|
|
analytes?: IAnalysisService;
|
|
|
|
createdByUid?: string;
|
|
|
|
createdBy?: any;
|
|
|
|
createdAt?: string;
|
|
|
|
updatedByUid?: string;
|
|
|
|
updatedBy?: any;
|
|
|
|
updatedAt?: string;
|
|
|
|
}
|
2021-11-29 18:51:20 +08:00
|
|
|
|
2023-04-10 09:29:10 +08:00
|
|
|
export interface IRejectionReason {
|
2023-03-19 23:21:32 +08:00
|
|
|
uid?: string;
|
2022-02-06 23:56:47 +08:00
|
|
|
reason?: string;
|
2023-04-10 09:29:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisInterim {
|
|
|
|
uid?: string;
|
|
|
|
key?: number;
|
|
|
|
value?: string;
|
|
|
|
analysisUid?: string;
|
|
|
|
instrumentUid?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisCorrectionFactor {
|
|
|
|
uid?: string;
|
|
|
|
factor?: string;
|
|
|
|
analysisUid?: string;
|
|
|
|
instrumentUid?: string;
|
|
|
|
methodUid?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisDetectionLimit {
|
|
|
|
uid?: string;
|
|
|
|
lowerLimit?: number;
|
|
|
|
upperLimit?: number;
|
|
|
|
analysisUid?: string;
|
|
|
|
instrumentUid?: string;
|
|
|
|
methodUid?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisUncertainty {
|
|
|
|
uid?: string;
|
|
|
|
min?: number;
|
|
|
|
max?: number;
|
|
|
|
value?: number;
|
|
|
|
analysisUid?: string;
|
|
|
|
instrumentUid?: string;
|
|
|
|
methodUid?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAnalysisSpecification {
|
|
|
|
uid?: string;
|
|
|
|
analysisUid?: string;
|
|
|
|
unitUid?: string;
|
|
|
|
unit?: IUnit[];
|
|
|
|
min?: number;
|
|
|
|
max?: number;
|
|
|
|
minWarn?: number;
|
|
|
|
maxWarn?: number;
|
|
|
|
minReport?: string;
|
|
|
|
maxReport?: string;
|
|
|
|
warnValues?: string;
|
|
|
|
warnReport?: string;
|
|
|
|
gender?: string;
|
|
|
|
ageMin?: number;
|
|
|
|
ageMax?: number;
|
|
|
|
methodUid?: string;
|
|
|
|
}
|