Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/esm-ugandaemr-app/src/dashboard.meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@ export const generalCounsellingDashboardMeta = {
title: 'General Counselling',
path: 'general-counselling',
layoutMode: 'anchored',
};
};

export const treatmentRegimenDashboardMeta = {
slot: 'treatment-regimen-slot',
columns: 1,
title: 'Treatment Regimen',
path: 'treatment-regimen',
layoutMode: 'anchored'
}
7 changes: 5 additions & 2 deletions packages/esm-ugandaemr-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ import {
latestObs,
patientDSDM,
} from './custom-expressions/custom-expressions';
import { generalCounsellingDashboardMeta, hivCareAndTreatmentDashboardDMeta } from './dashboard.meta';
import { generalCounsellingDashboardMeta, hivCareAndTreatmentDashboardDMeta, treatmentRegimenDashboardMeta } from './dashboard.meta';
import GeneralCounsellingSummary from './views/hiv/hct/general-counselling/general-counselling-summary.component';
import TreatmentRegimen from './views/hiv/hct/treatment-regimen/treatment-regimen.component';

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

Expand Down Expand Up @@ -114,7 +115,6 @@ export const patientChartHIVCareAndTreatmentDashboard = getSyncLifecycle(
options,
);


export const generalCounsellingDashboardLink = getSyncLifecycle(
createDashboardLink({ ...generalCounsellingDashboardMeta, moduleName }),
options,
Expand All @@ -126,6 +126,9 @@ export const generalCounsellingDashboard = getSyncLifecycle(GeneralCounsellingSu
});


export const treatmentRegimenDashboardLink = getSyncLifecycle(createDashboardLink({ ...treatmentRegimenDashboardMeta, moduleName }), options)

export const treatmentRegimenDashboard = getSyncLifecycle(TreatmentRegimen, { featureName: 'treatment-regimen', moduleName })


export const clinicalPatientSummary = getSyncLifecycle(ClinicalPatientSummary, options);
Expand Down
16 changes: 16 additions & 0 deletions packages/esm-ugandaemr-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@
"slot": "general-counselling-summary-slot",
"component": "generalCounsellingDashboard"
},
{
"name": "treatment-regimen",
"slot": "hiv-care-and-treatment-slot",
"component": "treatmentRegimenDashboardLink",
"meta": {
"slot": "treatment-regimen-summary-slot",
"columns": 1,
"path": "treatment-regimen",
"layoutMode": "anchored"
}
},
{
"name": "treatment-regimen-summary-ext",
"slot": "treatment-regimen-summary-slot",
"component": "treatmentRegimenDashboard"
},
{
"name": "retrieve-facility-code-modal",
"component": "retrieveFacilityCodeModal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
}
],
"launchOptions": {
"displayText": "Add"
"displayText": "Add",
"moduleName": "@ugandaemr/esm-ugandaemr-app"
},
"formList": [
{
Expand Down Expand Up @@ -91,7 +92,8 @@
}
],
"launchOptions": {
"displayText": "Add"
"displayText": "Add",
"moduleName": "@ugandaemr/esm-ugandaemr-app"
},
"formList": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"menuId": "treatmentRegimen",
"tabDefinitions": [
{
"tabName": "Substitute Regimen",
"hasFilter": true,
"headerTitle": "Substitute Regimen",
"displayText": "Substitute Regimen",
"encounterType": "c11774c1-3b4a-4bdb-a847-6060895e006d",
"columns": [
{
"id": "substitutionDate",
"isDate": true,
"title": "Substitution Date",
"concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"id": "New Regimen",
"title": "New Regimen",
"concept": "dd2b0b4d-30ab-102d-86b0-7a5022ba4115"
},
{
"id": "reason",
"title": "Reason",
"concept": "dce0c977-30ab-102d-86b0-7a5022ba4115"
},
{
"id": "actions",
"title": "actionsTitle",
"actionOptions": [
{
"formName": "ART Regimen Change",
"label": "View Details",
"mode": "view"
},
{
"formName": "ART Regimen Change",
"label": "EditForm",
"mode": "edit"
}
]
}
],
"launchOptions": {
"displayText": "Add"
},
"formList": [
{
"uuid": "53a3850c-855a-11eb-8dcd-0242ac130003"
}
]
},
{
"tabName": "Switch Regimen",
"hasFilter": true,
"headerTitle": "Switch Regimen",
"displayText": "Switch Regimen",
"encounterType": "c11774c1-3b4a-4bdb-a847-6060895e006d",
"columns": [
{
"id": "substitutionDate",
"isDate": true,
"title": "Substitution Date",
"concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"id": "New Regimen",
"title": "New Regimen",
"concept": "dd2b0b4d-30ab-102d-86b0-7a5022ba4115"
},
{
"id": "reason",
"title": "Reason",
"concept": "dce0c977-30ab-102d-86b0-7a5022ba4115"
},
{
"id": "actions",
"title": "actionsTitle",
"actionOptions": [
{
"formName": "ART Regimen Change",
"label": "View Details",
"mode": "view"
},
{
"formName": "ART Regimen Change",
"label": "EditForm",
"mode": "edit"
}
]
}
],
"launchOptions": {
"displayText": "Add"
},
"formList": [
{
"uuid": "53a3850c-855a-11eb-8dcd-0242ac130003"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { EncounterListTabsComponent } from "@ohri/openmrs-esm-ohri-commons-lib";
import { useConfig } from "@openmrs/esm-framework";
import React from "react";
import treatmentRegimenConfigSchema from "./treatment-regimen-config.json"

interface OverviewListProps {
patientUuid: string;
}

const TreatmentRegimen: React.FC<OverviewListProps> = ({ patientUuid }) => {
const config = useConfig();

const tabFilter = (encounter, formName) => {
return encounter?.form?.name === formName;
};

return (
<EncounterListTabsComponent
patientUuid={patientUuid}
configSchema={treatmentRegimenConfigSchema}
config={config}
filter={tabFilter}
/>
);
};

export default TreatmentRegimen;