Skip to content

Commit

Permalink
add destination concept
Browse files Browse the repository at this point in the history
  • Loading branch information
jabahum committed Jan 25, 2024
1 parent 0769451 commit a95fb96
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
5 changes: 5 additions & 0 deletions src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export const configSchema = {
_default: "52a447d3-a64a-11e3-9aeb-50e549534c5e",
_description: "Uuid for orderType",
},
laboratoryReferalDestinationUuid: {
_type: Type.String,
_default: "b1f8b6c8-c255-4518-89f5-4236ab76025b",
_description: "Concept uuid for laboratory referals destinations",
},
};

export type Config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ import {
getOrderColor,
} from "../patient-laboratory-order-results.resource";
import { useLaboratoryOrderResultsPages } from "../patient-laboratory-order-results-table.resource";
import { CardHeader } from "@openmrs/esm-patient-common-lib";
import {
CardHeader,
launchPatientWorkspace,
} from "@openmrs/esm-patient-common-lib";

interface LaboratoryActiveTestOrderResultsProps {
patientUuid: string;
Expand Down Expand Up @@ -140,6 +143,22 @@ const LaboratoryActiveTestOrderResults: React.FC<
);
};

// const handleLabRequest = () => {
// launchPatientWorkspace("patient-form-entry-workspace", {
// workspaceTitle: "Lab Request Form",
// formInfo: {
// formUuid: "c6f3b5ad-b7eb-44ad-b212-fb26456e155b",
// },
// });
// };

const launchLabRequestForm = () => {
launchPatientWorkspace("clinical-forms-workspace", {
workspaceTitle: `Laboratory Request Form`,
formUuid: "c6f3b5ad-b7eb-44ad-b212-fb26456e155b",
});
};

const LaunchLabRequestForm: React.FC = () => {
return (
<IconButton label="Add">
Expand Down Expand Up @@ -268,24 +287,23 @@ const LaboratoryActiveTestOrderResults: React.FC<
if (items?.length >= 0) {
return (
<div className={styles.widgetCard}>
<div className={styles.cardHeaderDiv}>
<CardHeader title={displayText}>
{isLoading ? (
<span>
<InlineLoading />
</span>
) : null}
<div className={styles.buttons}>
<Button
kind="ghost"
renderIcon={(props) => <Add size={16} {...props} />}
iconDescription="Launch lab Request"
>
{t("add", "Add")}
</Button>
</div>
</CardHeader>
</div>
<CardHeader title={displayText}>
{isLoading ? (
<span>
<InlineLoading />
</span>
) : null}
<div className={styles.buttons}>
<Button
kind="ghost"
renderIcon={(props) => <Add size={16} {...props} />}
iconDescription="Launch lab Request"
onClick={launchLabRequestForm}
>
{t("add", "Add")}
</Button>
</div>
</CardHeader>

<DataTable rows={tableRows} headers={tableHeaders} useZebraStyles>
{({ rows, headers, getHeaderProps, getTableProps, getRowProps }) => (
Expand Down
4 changes: 4 additions & 0 deletions src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
"name": "results-summary",
"component": "resultsSummaryWorkSpace"
},
{
"name" :"",
"component": ""
},
{
"name": "edit-results-dialog",
"component": "editResultsDialog"
Expand Down

0 comments on commit a95fb96

Please sign in to comment.