diff --git a/web-admin/src/api/sample-storage-cert-qc.ts b/web-admin/src/api/sample-storage-cert-qc.ts new file mode 100644 index 00000000..eb5e6c30 --- /dev/null +++ b/web-admin/src/api/sample-storage-cert-qc.ts @@ -0,0 +1,30 @@ +import request from '@/utils/http' + +export type SampleStorageCertQcDetail = { + sampleCode: string + labFlowCode: string + protocolCode: string + motherName: string + sampleTypeName: string + sampleTypeKey: string | null + collectionProtocolId?: string + qcWorkOrderId?: string + filledFlag: boolean + payload: Record +} + +export function fetchSampleStorageCertQc(sampleCode: string) { + return request.get({ + url: `/web/admin/sample-storage-cert-qc/${encodeURIComponent(sampleCode)}` + }) +} + +export function saveSampleStorageCertQc( + sampleCode: string, + data: { payload: Record; qcWorkOrderId?: string } +) { + return request.put({ + url: `/web/admin/sample-storage-cert-qc/${encodeURIComponent(sampleCode)}`, + data + }) +} diff --git a/web-admin/src/utils/storage-cert-qc-fields.ts b/web-admin/src/utils/storage-cert-qc-fields.ts new file mode 100644 index 00000000..f0a57b0d --- /dev/null +++ b/web-admin/src/utils/storage-cert-qc-fields.ts @@ -0,0 +1,152 @@ +import { + SAMPLE_TYPE_PERINATAL_HSC, + SAMPLE_TYPE_UC_MSC +} from '@/utils/sample-production-reception-fields' + +export type StorageCertQcTypeKey = 'perinatal_hsc' | 'uc_msc' + +export type StorageCertQcControl = 'text' | 'textarea' | 'select_yny' + +export interface StorageCertQcField { + key: string + label: string + control?: StorageCertQcControl + span?: 1 | 2 | 3 +} + +export interface StorageCertQcGroup { + title: string + variant?: 'primary' | 'alt' | 'meta' + fields: StorageCertQcField[] +} + +export function resolveStorageCertQcTypeKey( + sampleTypeName?: string | null +): StorageCertQcTypeKey | null { + const name = String(sampleTypeName || '').trim() + if (name === SAMPLE_TYPE_PERINATAL_HSC) return 'perinatal_hsc' + if (name === SAMPLE_TYPE_UC_MSC) return 'uc_msc' + return null +} + +export function supportsStorageCertQc(sampleTypeName?: string | null): boolean { + return resolveStorageCertQcTypeKey(sampleTypeName) != null +} + +const MOTHER_BLOOD: StorageCertQcField[] = [ + { key: 'mother_hbsag', label: '乙型肝炎病毒表面抗原(HBsAg)', control: 'select_yny' }, + { key: 'mother_hbv_dna', label: '乙型肝炎病毒核酸(HBV DNA)', control: 'select_yny' }, + { key: 'mother_anti_hcv', label: '丙型肝炎病毒抗体(抗HCV)', control: 'select_yny' }, + { key: 'mother_hcv_rna', label: '丙型肝炎病毒核酸(HCV RNA)', control: 'select_yny' }, + { key: 'mother_anti_tp', label: '梅毒螺旋体特异性抗体(抗TP)', control: 'select_yny' }, + { key: 'mother_cmv_igm', label: '巨细胞病毒 IgM 抗体 (CMV IgM)', control: 'select_yny' }, + { key: 'mother_anti_hiv', label: '人类免疫缺陷病毒抗体(抗HIV-1/2)', control: 'select_yny' }, + { + key: 'mother_hiv1_rna', + label: '人类免疫缺陷病毒核酸(1型) (HIV-1RNA)', + control: 'select_yny' + } +] + +export const STORAGE_CERT_QC_GROUPS: Record = { + perinatal_hsc: [ + { + title: '采集与运输', + variant: 'alt', + fields: [ + { key: 'collection_time', label: '造血干细胞采集时间' }, + { key: 'transport_temp_c', label: '运输温度 /℃' } + ] + }, + { + title: '造血干细胞检测报告', + variant: 'primary', + fields: [ + { key: 'receive_time', label: '造血干细胞接收时间' }, + { key: 'process_time', label: '处理时间' }, + { key: 'cryo_time', label: '冻存时间' }, + { key: 'weight_g', label: '造血干细胞重量/g' }, + { key: 'cryo_volume_ml', label: '造血干细胞冻存体积/mL' }, + { key: 'tnc_1e8', label: '有核细胞数 TNC / *10E8' }, + { key: 'cd34_count_1e6', label: 'CD34+ 细胞计数 / *10E6' }, + { key: 'cd34_cd45dim_1e5', label: 'CD34+ CD45dim 细胞计数 / *10E5' }, + { key: 'viability_pct', label: '细胞活性/%' }, + { key: 'bacteria_test', label: '细菌检测', control: 'select_yny' }, + { key: 'hbsag', label: '乙型肝炎病毒表面抗原(HBsAg)', control: 'select_yny' }, + { key: 'anti_hcv', label: '丙型肝炎病毒抗体(抗HCV)', control: 'select_yny' }, + { key: 'anti_tp', label: '梅毒螺旋体特异性抗体(抗TP)', control: 'select_yny' }, + { + key: 'anti_hiv', + label: '人类免疫缺陷病毒抗体(抗HIV-1/2)', + control: 'select_yny' + }, + { key: 'cmv_igm', label: '巨细胞病毒 IgM 抗体 (CMV-IgM)', control: 'select_yny' } + ] + }, + { title: '母亲血液检测报告', variant: 'primary', fields: MOTHER_BLOOD }, + { + title: '储存证收尾信息', + variant: 'meta', + fields: [ + { key: 'hla_typing', label: 'HLA 分型', control: 'textarea', span: 3 }, + { key: 'storage_date', label: '储存日期' }, + { key: 'storage_years', label: '储存年限' }, + { key: 'result_comment', label: '检测结果评论' }, + { key: 'report_issue_date', label: '报告发出日期' } + ] + } + ], + uc_msc: [ + { + title: '采集与运输 / 邮寄', + variant: 'alt', + fields: [ + { key: 'mail_flag', label: '是否邮寄' }, + { key: 'collection_time', label: '脐带采集时间' }, + { key: 'transport_temp_c', label: '运输温度 /℃' } + ] + }, + { + title: '脐带间充质干细胞检测报告', + variant: 'primary', + fields: [ + { key: 'receive_time', label: '脐带接收时间' }, + { key: 'process_time', label: '处理时间' }, + { key: 'cryo_time', label: '冻存时间' }, + { key: 'storage_tube_count', label: '储存总量(管)' }, + { key: 'available_cell_type', label: '可提供细胞类型' }, + { key: 'available_cell_count_1e7', label: '可提供细胞数量 / *10E7' }, + { key: 'available_viability_pct', label: '可提供细胞存活率 %' }, + { key: 'endotoxin_test', label: '内毒素检测', control: 'select_yny' }, + { key: 'bacteria_test', label: '细菌检测', control: 'select_yny' }, + { key: 'fungus_test', label: '真菌检测', control: 'select_yny' }, + { key: 'mycoplasma_test', label: '支原体检测', control: 'select_yny' }, + { key: 'available_cell_morphology', label: '可提供细胞形态' }, + { + key: 'available_immunophenotype', + label: '可提供细胞免疫表型特征', + span: 2 + } + ] + }, + { title: '母亲血液检测报告', variant: 'primary', fields: MOTHER_BLOOD }, + { + title: '储存证收尾信息', + variant: 'meta', + fields: [ + { key: 'result_judgment', label: '检测结果评判' }, + { key: 'report_issue_date', label: '报告发出日期' }, + { key: 'storage_date_p2', label: '储存日期 (P2冻存日期)' }, + { key: 'freeze_method', label: '冷冻方式' }, + { key: 'storage_temp', label: '储存温度' }, + { key: 'storage_years', label: '储存年限' } + ] + } + ] +} + +export const YNY_OPTIONS = [ + { label: '阴', value: '阴' }, + { label: '阳', value: '阳' }, + { label: '/', value: '/' } +]