diff --git a/src/patient-chart/results-summary/print-results-table.component.tsx b/src/patient-chart/results-summary/print-results-table.component.tsx index abcd3930..f8e61281 100644 --- a/src/patient-chart/results-summary/print-results-table.component.tsx +++ b/src/patient-chart/results-summary/print-results-table.component.tsx @@ -1,6 +1,16 @@ import React from "react"; import styles from "./print-results-summary.scss"; import { GroupMember } from "../laboratory-order.resource"; +import { useGetConceptById } from "./results-summary.resource"; +import { + Button, + Form, + ModalBody, + ModalFooter, + ModalHeader, + InlineLoading, + Checkbox, +} from "@carbon/react"; interface PrintResultsTableProps { groupedResults: any[]; @@ -10,10 +20,57 @@ interface ResultsRowProps { groupMembers: GroupMember[]; } +interface ValueUnitsProps { + conceptUuid: string; +} + const PrintResultsTable: React.FC = ({ groupedResults, }) => { const RowTest: React.FC = ({ groupMembers }) => { + // get Units + const ValueUnits: React.FC = ({ conceptUuid }) => { + const { + concept: concept, + isLoading, + isError, + } = useGetConceptById(conceptUuid); + if (isLoading) { + return ; + } + if (isError) { + return Error; + } + return {concept?.units}; + }; + + // get Reference Range + const ReferenceRange: React.FC = ({ conceptUuid }) => { + const { + concept: concept, + isLoading, + isError, + } = useGetConceptById(conceptUuid); + if (isLoading) { + return ; + } + if (isError) { + return Error; + } + return ( + <> + {concept?.hiNormal === undefined || + concept?.lowNormal === undefined ? ( + "N/A" + ) : ( +
+ {concept?.lowNormal ? concept?.lowNormal : "--"} :{" "} + {concept?.hiNormal ? concept?.hiNormal : "--"} +
+ )} + + ); + }; return ( <> {groupMembers?.map((element, index) => { @@ -25,19 +82,42 @@ const PrintResultsTable: React.FC = ({ {element?.value} - -- + + { + + } + - -- + + { + + } + ) : typeof element.value === "object" ? ( <> {element?.concept.display} {element?.value.display} + + { + + } + - -- - - -- + + { + + } + ) : ( {element?.display}