@kenyaemr/esm-facility-dashboard-app 5.4.1-pre.2027 → 5.4.1-pre.2036
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +7 -7
- package/dist/74.js +1 -1
- package/dist/74.js.map +1 -1
- package/dist/kenyaemr-esm-facility-dashboard-app.js.buildmanifest.json +6 -6
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/surveillance/surveillance-dashboard.component.tsx +40 -20
- package/src/surveillance/surveillance-filters.component.tsx +46 -41
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemrCharts":"^1.6.7"},"extensions":[{"component":"surveillanceDashboardLink","name":"surveillance-dashboard-link","slot":"facility-dashboard-left-panel-slot"},{"component":"aboveSiteDashboardLink","name":"above-site-dashboard-link","slot":"facility-dashboard-left-panel-slot"}],"workspaces":[],"modals":[],"pages":[{"component":"root","route":"facility-dashboard"}],"version":"5.4.1-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemrCharts":"^1.6.7"},"extensions":[{"component":"surveillanceDashboardLink","name":"surveillance-dashboard-link","slot":"facility-dashboard-left-panel-slot"},{"component":"aboveSiteDashboardLink","name":"above-site-dashboard-link","slot":"facility-dashboard-left-panel-slot"}],"workspaces":[],"modals":[],"pages":[{"component":"root","route":"facility-dashboard"}],"version":"5.4.1-pre.2036"}
|
package/package.json
CHANGED
|
@@ -10,35 +10,55 @@ import MissedOpportunityChart from './charts/missed-opportunity-vl-chart.compone
|
|
|
10
10
|
import DNAPCRPendingCharts from './charts/dna-pcr-pending-chart.component';
|
|
11
11
|
import HEIFinalOutcomesChart from './charts/hei-final-outcome.component';
|
|
12
12
|
import { SurveillanceindicatorsFilter } from '../types';
|
|
13
|
+
import { Tabs, TabList, Tab, TabPanels, TabPanel } from '@carbon/react';
|
|
13
14
|
const SurveillancelanceDashboard = () => {
|
|
14
15
|
const { t } = useTranslation();
|
|
15
16
|
const [currFilters, setCurrFilters] = useState<SurveillanceindicatorsFilter>({
|
|
16
17
|
indicator: 'getHivPositiveNotLinked',
|
|
17
18
|
});
|
|
19
|
+
const [activeTab, setActiveTab] = useState(0);
|
|
18
20
|
|
|
19
21
|
return (
|
|
20
22
|
<div>
|
|
21
23
|
<FacilityDashboardHeader title={t('surveillance', 'Surveillance')} />
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
|
|
25
|
+
<Tabs onChange={({ selectedIndex }) => setActiveTab(selectedIndex)}>
|
|
26
|
+
<TabList>
|
|
27
|
+
<Tab>{t('kpi', 'KPI')}</Tab>
|
|
28
|
+
<Tab>{t('monitoringCharts', 'Monitoring charts')}</Tab>
|
|
29
|
+
</TabList>
|
|
30
|
+
<TabPanels>
|
|
31
|
+
<TabPanel>
|
|
32
|
+
<>
|
|
33
|
+
<SurveillanceFilters filters={currFilters} onFiltersChange={setCurrFilters} tabSelected={activeTab} />
|
|
34
|
+
<SurveillanceSummaryCards startDate={currFilters.startdate} endDate={currFilters.endDate} />
|
|
35
|
+
</>
|
|
36
|
+
</TabPanel>
|
|
37
|
+
<TabPanel>
|
|
38
|
+
<>
|
|
39
|
+
<SurveillanceFilters filters={currFilters} onFiltersChange={setCurrFilters} tabSelected={activeTab} />
|
|
40
|
+
{currFilters.indicator === 'getHivPositiveNotLinked' && (
|
|
41
|
+
<HIVPositiveNotLinkedToART startDate={currFilters.startdate} endDate={currFilters.endDate} />
|
|
42
|
+
)}
|
|
43
|
+
{currFilters.indicator === 'getPregnantPostpartumNotInPrep' && (
|
|
44
|
+
<PBFWNotInPrep startDate={currFilters.startdate} endDate={currFilters.endDate} />
|
|
45
|
+
)}
|
|
46
|
+
{currFilters.indicator === 'getEligibleForVlSampleNotTaken' && (
|
|
47
|
+
<DelayedEACCharts startDate={currFilters.startdate} endDate={currFilters.endDate} />
|
|
48
|
+
)}
|
|
49
|
+
{currFilters.indicator === 'getVirallyUnsuppressedWithoutEAC' && (
|
|
50
|
+
<MissedOpportunityChart startDate={currFilters.startdate} endDate={currFilters.endDate} />
|
|
51
|
+
)}
|
|
52
|
+
{currFilters.indicator === 'getHeiSixToEightWeeksWithoutPCRResults' && (
|
|
53
|
+
<DNAPCRPendingCharts startDate={currFilters.startdate} endDate={currFilters.endDate} />
|
|
54
|
+
)}
|
|
55
|
+
{currFilters.indicator === 'getHei24MonthsWithoutDocumentedOutcome' && (
|
|
56
|
+
<HEIFinalOutcomesChart startDate={currFilters.startdate} endDate={currFilters.endDate} />
|
|
57
|
+
)}
|
|
58
|
+
</>
|
|
59
|
+
</TabPanel>
|
|
60
|
+
</TabPanels>
|
|
61
|
+
</Tabs>
|
|
42
62
|
</div>
|
|
43
63
|
);
|
|
44
64
|
};
|
|
@@ -9,8 +9,9 @@ import { formatDatetime } from '@openmrs/esm-framework';
|
|
|
9
9
|
type Props = {
|
|
10
10
|
filters: SurveillanceindicatorsFilter;
|
|
11
11
|
onFiltersChange?: (filters: SurveillanceindicatorsFilter) => void;
|
|
12
|
+
tabSelected?: number;
|
|
12
13
|
};
|
|
13
|
-
const SurveillanceFilters: React.FC<Props> = ({ filters, onFiltersChange }) => {
|
|
14
|
+
const SurveillanceFilters: React.FC<Props> = ({ filters, onFiltersChange, tabSelected }) => {
|
|
14
15
|
const { t } = useTranslation();
|
|
15
16
|
const MaxDate: Date = today();
|
|
16
17
|
const indicators = [
|
|
@@ -23,48 +24,52 @@ const SurveillanceFilters: React.FC<Props> = ({ filters, onFiltersChange }) => {
|
|
|
23
24
|
];
|
|
24
25
|
return (
|
|
25
26
|
<div className={styles.filtersContainer}>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
onFiltersChange
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
{tabSelected === 0 && (
|
|
28
|
+
<DatePicker
|
|
29
|
+
datePickerType="range"
|
|
30
|
+
minDate={formatDatetime(MaxDate)}
|
|
31
|
+
locale="en"
|
|
32
|
+
dateFormat={DATE_PICKER_CONTROL_FORMAT}
|
|
33
|
+
onChange={(dates: Array<Date>) => {
|
|
34
|
+
if (onFiltersChange) {
|
|
35
|
+
onFiltersChange({
|
|
36
|
+
...filters,
|
|
37
|
+
startdate: dates[0],
|
|
38
|
+
endDate: dates[1],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}}>
|
|
42
|
+
<DatePickerInput
|
|
43
|
+
id="date-picker-input-id-start"
|
|
44
|
+
placeholder={DATE_PICKER_FORMAT}
|
|
45
|
+
labelText={t('startDate', 'Start date')}
|
|
46
|
+
size="md"
|
|
47
|
+
/>
|
|
48
|
+
<DatePickerInput
|
|
49
|
+
id="date-picker-input-id-finish"
|
|
50
|
+
placeholder={DATE_PICKER_FORMAT}
|
|
51
|
+
labelText={t('endDate', 'End date')}
|
|
52
|
+
size="md"
|
|
53
|
+
/>
|
|
54
|
+
</DatePicker>
|
|
55
|
+
)}
|
|
56
|
+
|
|
57
|
+
{tabSelected === 1 && (
|
|
58
|
+
<Dropdown
|
|
59
|
+
className={styles.filterInput}
|
|
60
|
+
autoAlign
|
|
61
|
+
id="filters"
|
|
62
|
+
itemToString={(item: { key: string; label: string }) =>
|
|
63
|
+
indicators.find(({ key }) => key === item.key)?.label ?? ''
|
|
38
64
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/>
|
|
46
|
-
<DatePickerInput
|
|
47
|
-
id="date-picker-input-id-finish"
|
|
48
|
-
placeholder={DATE_PICKER_FORMAT}
|
|
49
|
-
labelText={t('endDate', 'End date')}
|
|
50
|
-
size="md"
|
|
65
|
+
items={indicators}
|
|
66
|
+
selectedItem={indicators.find(({ key }) => key === filters.indicator)}
|
|
67
|
+
label={t('indicator', 'Indicator')}
|
|
68
|
+
onChange={({ selectedItem: { key } }) => {
|
|
69
|
+
onFiltersChange({ ...filters, indicator: key });
|
|
70
|
+
}}
|
|
51
71
|
/>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<Dropdown
|
|
55
|
-
className={styles.filterInput}
|
|
56
|
-
autoAlign
|
|
57
|
-
id="filters"
|
|
58
|
-
itemToString={(item: { key: string; label: string }) =>
|
|
59
|
-
indicators.find(({ key }) => key === item.key)?.label ?? ''
|
|
60
|
-
}
|
|
61
|
-
items={indicators}
|
|
62
|
-
selectedItem={indicators.find(({ key }) => key === filters.indicator)}
|
|
63
|
-
label={t('indicator', 'Indicator')}
|
|
64
|
-
onChange={({ selectedItem: { key } }) => {
|
|
65
|
-
onFiltersChange({ ...filters, indicator: key });
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
72
|
+
)}
|
|
68
73
|
</div>
|
|
69
74
|
);
|
|
70
75
|
};
|