report.model.ts 591 B

12345678910111213141516171819
  1. export interface ReportModel {
  2. id: string;
  3. time?: string;
  4. [ key: string ]: any;
  5. };
  6. export function transformIndicator(data: any[]) {
  7. return data?.map((item: any) => {
  8. const { patientQuotaRecordDTOS = [], ..._item } = item;
  9. const lest = patientQuotaRecordDTOS?.[ patientQuotaRecordDTOS?.length - 1 ] ?? {};
  10. const abnormal = lest.abnormal ? 1 : 0;
  11. return {
  12. ..._item,
  13. ...lest,
  14. abnormal: abnormal && lest.abnormalDesc?.includes('偏高') ? 1 : lest.abnormalDesc?.includes('偏低') ? -1 : 0,
  15. };
  16. }).filter(item => item.quotaVal != null) ?? [];
  17. }