Skip to content

Commit

Permalink
SL-835 add link to O3 patient chart in ward app patient workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
chibongho committed Jan 8, 2025
1 parent 04df8ca commit 4437baf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { useActivePatientEnrollment } from '../hooks/useProgramEnrollment';
import O2IFrame from './o2-iframe.component';
import styles from './o2-pregnancy-infant-dashboard.scss';

/**
* Extension to display either the O2 pregnancy program or infant program dashboard,
Expand Down Expand Up @@ -50,13 +51,7 @@ const O2PregnancyInfantProgramDashboard: React.FC<{ patientUuid: string }> = ({

if (isLoading) {
return <InlineLoading />;
} else if (inInfantProgram) {
const src = `${window.openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&dashboard=${infantProgramUuid}`;
return <O2IFrame key={patientUuid} {...{ src, elementsToDisable, elementsToHide }} />;
} else if (inPregnancyProgram) {
const src = `${window.openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&dashboard=${pregnancyProgramUuid}`;
return <O2IFrame key={patientUuid} {...{ src, elementsToDisable, elementsToHide }} />;
} else {
} else if (!inInfantProgram && !inPregnancyProgram) {
return (
<div>
{t(
Expand All @@ -65,6 +60,19 @@ const O2PregnancyInfantProgramDashboard: React.FC<{ patientUuid: string }> = ({
)}
</div>
);
} else {
const iframeSrc = inInfantProgram
? `${window.openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&dashboard=${infantProgramUuid}`
: `${window.openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&dashboard=${pregnancyProgramUuid}`;

return (
<>
<div className={styles.patientChartLinkContainer}>
<a href={`/openmrs/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}`}>Full patient chart</a>
</div>
<O2IFrame key={patientUuid} {...{ src: iframeSrc, elementsToDisable, elementsToHide }} />
</>
);
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@use '@carbon/layout';

.patientChartLinkContainer {
padding: layout.$spacing-05;
}

0 comments on commit 4437baf

Please sign in to comment.