Skip to content

Commit

Permalink
Dev merging into working (#1793)
Browse files Browse the repository at this point in the history
* Added auth for publish to npm (#1775)

* OHRI-2122 Add Program Management under the TPT Program (#1779)

* OHRI-2122 Add Program Management under the TPT Program

* Tab Naming

* Add default translation values

* OHRI-2117 Add TPT program menu (#1781)

* (chore) remove condition for release on master push (#1778)

* OHRI-2109  Add TB Prevention link under Tuberculosis program in the clinical per… (#1782)

* Add TB Prevention link under Tuberculosis program in the clinical perspectives

* renaming

* renaming

* OHRI-2119: Populate the Recent TPT tiles on the TPT patient summary board (#1783)

* Populate the Recent TPT tiles on the TPT patient summary board

* update

* Update patient-summary.component.tsx

* Update patient-summary.component.tsx

* small update

* OHRI-2109: Add TB Prevention link under Tuberculosis program in the clinical perspectives (#1787)

* slight modification - the TB Prevention link comes first followed by TB Treatment

* update on the translator

* Update en.json

* Update en.json

* Update en.json

* OHRI-2011: Add a table of all enrolled clients in TPT Program (#1789)

* Add TB Prevention link under Tuberculosis program in the clinical perspectives

* Add a table of all enrolled clients in TPT Program

* Add a table of all enrolled clients in TPT Program

* Add the Previous TPT Cases Table on the patient summary board (#1790)

* OHRI-2123 TPT Enrolment List (#1786)

* OHRI-2123 TPT Enrolment List

* Exclude Intents in the formList prop

* Update config-schema.ts

* OHRI-1916 : Maternal visits list should indicate HIV Test status not … (#1791)

* OHRI-1916 : Maternal visits list should indicate HIV Test status not HIV test result

* add hivTestStatus to transilation

* Fix hyperlink on empty table list (#1792)

---------

Co-authored-by: AJAL ODORA JONATHAN <[email protected]>
Co-authored-by: Pius Rubangakene <[email protected]>
Co-authored-by: lucyjemutai <[email protected]>
Co-authored-by: Hero <[email protected]>
  • Loading branch information
5 people authored Jan 31, 2024
1 parent cd0f24b commit 16faa63
Show file tree
Hide file tree
Showing 18 changed files with 697 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.master.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

needs: build

if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' }}
if: ${{ github.event_name == 'release' }}

steps:
- uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface CohortPatientListProps {
queryParams?: Array<string>;
associatedEncounterType?: string;
viewPatientProgramSummary?: boolean;
viewTptPatientProgramSummary?: boolean;
addPatientToListOptions?: { isEnabled: boolean; excludeCohorts?: Array<string> };
launchableForm?: {
name: string;
Expand Down Expand Up @@ -54,6 +55,7 @@ export const CohortPatientList: React.FC<CohortPatientListProps> = ({
extraAssociatedEncounterTypes,
moduleName,
viewPatientProgramSummary,
viewTptPatientProgramSummary,
}) => {
const [isLoading, setIsLoading] = useState(true);
const [hasLoadedPatients, setHasLoadedPatients] = useState(false);
Expand Down Expand Up @@ -147,6 +149,7 @@ export const CohortPatientList: React.FC<CohortPatientListProps> = ({
...addPatientToListOptions,
displayText: t('moveToListSideNav', 'Move to list'),
},
viewTptPatientProgramSummary,
viewPatientProgramSummary,
}),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface PatientMetaConfig {
moduleName: string;
addPatientToListOptions: { isEnabled: boolean; excludeCohorts?: Array<string>; displayText: string };
viewPatientProgramSummary?: boolean;
viewTptPatientProgramSummary?: boolean;
}

export interface PatientListColumn {
Expand Down Expand Up @@ -112,7 +113,44 @@ export const ViewSummaryMenuItem = ({ patientUuid, ViewSummary, encounterType })
</>
);
};
export const ViewTptSummaryMenuItem = ({ patientUuid, ViewTptSummary, encounterType }) => {
const [actionText, setActionText] = useState(ViewTptSummary.actionText);
const [encounterUuid, setEncounterUuid] = useState(null);
const [isLoading, setIsLoading] = useState(false);
const viewTptSummaryActionText = ViewTptSummary.actionText || 'View Summary ';

useEffect(() => {
if (ViewTptSummary.editLatestEncounter && encounterType && !encounterUuid) {
setIsLoading(true);
fetchPatientLastEncounter(patientUuid, encounterType).then((latestEncounter) => {
if (latestEncounter) {
setActionText(viewTptSummaryActionText);
setEncounterUuid(latestEncounter.uuid);
}
setIsLoading(false);
});
} else {
setIsLoading(false);
}
}, []);

return (
<>
{isLoading ? (
<InlineLoading style={{ margin: '0 auto', width: '16px' }} />
) : (
<OverflowMenuItem
itemText={actionText}
onClick={() => {
navigate({
to: `/openmrs/spa/patient/${patientUuid}/chart/tpt-patient-summary`,
});
}}
/>
)}
</>
);
};
export function consolidatatePatientMeta(rawPatientMeta, form, config: PatientMetaConfig) {
const {
isDynamicCohort,
Expand All @@ -122,6 +160,7 @@ export function consolidatatePatientMeta(rawPatientMeta, form, config: PatientMe
moduleName,
addPatientToListOptions,
viewPatientProgramSummary,
viewTptPatientProgramSummary,
} = config;
const patientUuid = !isDynamicCohort ? rawPatientMeta.patient.uuid : rawPatientMeta.person.uuid;
dayjs.extend(localizedFormat);
Expand Down Expand Up @@ -155,6 +194,16 @@ export function consolidatatePatientMeta(rawPatientMeta, form, config: PatientMe
excludeCohorts={addPatientToListOptions?.excludeCohorts || []}
/>
)}
{viewTptPatientProgramSummary ? (
<ViewTptSummaryMenuItem
patientUuid={patientUuid}
ViewTptSummary={launchableFormProps}
encounterType={launchableFormProps.encounterType || encounterType}
key={patientUuid}
/>
) : (
<></>
)}
{viewPatientProgramSummary ? (
<ViewSummaryMenuItem
patientUuid={patientUuid}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function OHRIPatientListTabs({ patientListConfigs, moduleName }) {
extraAssociatedEncounterTypes={config.extraAssociatedEncounterTypes}
moduleName={moduleName}
viewPatientProgramSummary={config.viewPatientProgramSummary}
viewTptPatientProgramSummary={config.viewTptPatientProgramSummary}
/>
</TabPanel>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const AntenatalCareList: React.FC<AntenatalCareListProps> = ({ patientUuid }) =>
},
},
{
key: 'hivTestResults',
header: t('hivTestResults', 'HIV Test Results'),
key: 'hivTestStatus',
header: t('hivTestStatus', 'HIV Test Status'),
getValue: (encounter) => {
return getObsFromEncounter(encounter, config.obsConcepts.hivTestResultConcept);
return getObsFromEncounter(encounter, config.obsConcepts.hivTestStatus);
},
},
{
Expand Down
1 change: 1 addition & 0 deletions packages/esm-ohri-pmtct-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"hivMonitoring": "HIV Monitoring",
"hivStatus": "HIV Status",
"hivTestResults": "HIV Test Results",
"hivTestStatus": "HIV Test Status",
"infantPostnatalCare": "Infant Postnatal Care",
"infantPostnatalVisit": "Infant Postnatal Visit",
"infantStatus": "Infant Status at Birth",
Expand Down
22 changes: 22 additions & 0 deletions packages/esm-tb-app/src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export const configSchema = {
tbPatientTracing: '98c938e9-fb3e-4982-ae22-0305cbd12f8c',
tbProgramEnrollment: '9a199b59-b185-485b-b9b3-a9754e65ae57',
tbTreatmentAndFollowUp: '1881304a-4854-4927-b0b1-a6231d61e43c',
tptCaseEnrollment: 'dc6ce80c-83f8-4ace-a638-21df78542551',
tptTreatmentAndFollowUp: '1ac3de3f-8fc2-43a7-addb-e805c393ecae',
},
},
obsConcepts: {
Expand Down Expand Up @@ -47,13 +49,32 @@ export const configSchema = {
tBEnrollmentType: '163775AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
dsTBEnrollment: '160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
dRTBEnrollment: '160052AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptTreatmentId: '162727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptEnrollmentDate: '164852AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptIndication: '162276AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptRegimen: '1264AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptAppointmentDate: '5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptAdherence: '164075AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptTreatmentStartDate: '162320AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptOutcome: '1266AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptOutcomeDate: '163284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
tptDateOutcome: '163284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
},
},
cohorts: {
_type: Type.Object,
_description: 'TB Cohort uuid.',
_default: {
clientsEnrolledForTb: '98fd11ba-cb4d-46f7-9b82-40d49949c7ef',
clientsEnrolledForTpt: '5f28254f-0a80-4d15-ad91-68c6cf5ea715',
},
},
formNames: {
_type: Type.Object,
_description: 'TPT Form Names.',
_default: {
TptOutcomeFormName: 'TPT outcome form',
TptCaseEnrolmentFormName: 'TPT Case Enrolment form',
},
},
};
Expand All @@ -62,4 +83,5 @@ export interface ConfigObject {
identifiers: Object;
encounterTypes: Object;
obsConcepts: Object;
formNames: Object;
}
33 changes: 30 additions & 3 deletions packages/esm-tb-app/src/dashboard.meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,38 @@ export const tbClinicalViewDashboardMeta = {
isFolder: true,
title: 'Tuberculosis',
};
export const tbPreventionDashboardMeta = {
name: 'tb-prevention',
slot: 'tb-prevention-dashboard-slot',
config: { columns: 1, type: 'grid', programme: 'tpt', dashboardTitle: 'TB Prevention'},
title: 'TB Prevention',
};

export const tbCasesDashboardMeta = {
name: 'tb-cases',
slot: 'tb-cases-dashboard-slot',
config: { columns: 1, type: 'grid', programme: 'tb', dashboardTitle: 'TB Treatment', icon: PillsAdd },
config: { columns: 1, type: 'grid', programme: 'tb', dashboardTitle: 'TB Treatment' },
title: 'TB Treatment',
dashboardIcon: PillsAdd,
};
};

export const tptPatientChartMeta = {
title: 'TPT Program',
slotName: 'ohri-tpt-slot',
isExpanded: false,
};

export const tptPatientSummaryMeta = {
slot: 'tpt-patient-summary-slot',
columns: 1,
title: 'Patient Summary',
path: 'tpt-patient-summary',
layoutMode: 'anchored',
};

export const tptProgramManagementDashboardMeta = {
slot: 'tpt-program-management-summary-slot',
columns: 1,
title: 'Program Management',
path: 'tpt-program-management',
layoutMode: 'anchored',
};
45 changes: 45 additions & 0 deletions packages/esm-tb-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import {
tbTreatmentFollowUpDashboardMeta,
tbClinicalViewDashboardMeta,
tbCasesDashboardMeta,
tptProgramManagementDashboardMeta,
tptPatientChartMeta,
tptPatientSummaryMeta,
tbPreventionDashboardMeta,
} from './dashboard.meta';
import { configSchema } from './config-schema';
import TBSummaryOverviewList from './views/patient-summary/tb-patient-summary.component';
Expand All @@ -17,6 +21,10 @@ import TbTreatmentFollowUpList from './views/treatment-and-follow-up/tb-treatmen
import TbContactTracingList from './views/tb-contact-listing/tb-contact-list.component';
import TbSummaryTiles from './views/dashboard/summary-tiles/tb-summary-tiles.component';
import TbHomePatientTabs from './views/dashboard/patient-list-tabs/tb-patient-list-tabs.component';
import tptProgramManagementSummary from './views/tpt/program-management/tpt-program-management';
import tptPatientSummary from './views/tpt/patient-summary/patient-summary.component';
import TptPreventionSummaryTiles from './views/dashboard/summary-tiles/tpt-summary-tiles.component';
import TptPatientListTabs from './views/dashboard/patient-list-tabs/tpt-patient-list-tabs.component';

export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');

Expand All @@ -35,6 +43,8 @@ export function startupApp() {

export const patientChartTbDashboard = getSyncLifecycle(createDashboardGroup(tbPatientChartMeta), options);

export const patientChartTptDashboard = getSyncLifecycle(createDashboardGroup(tptPatientChartMeta), options);

export const tbPatientSummaryDashboardLink = getSyncLifecycle(
createDashboardLink({ ...tbPatientSummaryDashboardMeta, moduleName }),
options,
Expand Down Expand Up @@ -83,6 +93,36 @@ export const tbDashboardTabs = getSyncLifecycle(TbHomePatientTabs, {
featureName: 'tb-home-tabs',
moduleName,
});
export const tptDashboardHeader = getSyncLifecycle(OHRIWelcomeSection, {
featureName: 'tpt-home-header',
moduleName,
});
export const tptDashboardTiles = getSyncLifecycle(TptPreventionSummaryTiles, {
featureName: 'tpt-home-tiles',
moduleName,
});
export const tptDashboardTabs = getSyncLifecycle(TptPatientListTabs, {
featureName: 'tpt-home-tabs',
moduleName,
});

export const tptPatientSummaryDashboardLink = getSyncLifecycle(
createDashboardLink({ ...tptPatientSummaryMeta, moduleName }),
options,
);
export const tptPatientSummaryDashboard = getSyncLifecycle(tptPatientSummary, {
featureName: 'tpt-patient-summary',
moduleName,
});

export const tptProgramManagementDashboardLink = getSyncLifecycle(
createDashboardLink({ ...tptProgramManagementDashboardMeta, moduleName }),
options,
);
export const tptProgramManagementDashboard = getSyncLifecycle(tptProgramManagementSummary, {
featureName: 'tpt-program-management-summary',
moduleName,
});

// OHRI HOME
export const tbClinicalViewDashboardLink = getSyncLifecycle(
Expand All @@ -94,3 +134,8 @@ export const tbCasesDashboard = getSyncLifecycle(OHRIHome, {
featureName: 'tb cases dashboard',
moduleName,
});
export const tbPreventionDashboardLink = getSyncLifecycle(createOHRIDashboardLink(tbPreventionDashboardMeta), options);
export const tbPreventionDashboard = getSyncLifecycle(OHRIHome, {
featureName: 'tpt cases dashboard',
moduleName,
});
Loading

0 comments on commit 16faa63

Please sign in to comment.