@ampath/esm-reports-app 1.0.0-next.41 → 1.0.0-next.45
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/dist/143.css +1 -0
- package/dist/143.css.map +1 -0
- package/dist/143.js +1 -0
- package/dist/143.js.map +1 -0
- package/dist/197.js +1 -1
- package/dist/282.js +1 -1
- package/dist/282.js.map +1 -1
- package/dist/295.css +1 -0
- package/dist/295.css.map +1 -0
- package/dist/295.js +1 -0
- package/dist/295.js.map +1 -0
- package/dist/300.js +1 -1
- package/dist/311.js +1 -1
- package/dist/311.js.map +1 -1
- package/dist/335.js +1 -1
- package/dist/353.js +1 -1
- package/dist/353.js.map +1 -1
- package/dist/410.js +1 -0
- package/dist/410.js.map +1 -0
- package/dist/427.js +2 -0
- package/dist/427.js.LICENSE.txt +35 -0
- package/dist/427.js.map +1 -0
- package/dist/441.js +1 -0
- package/dist/441.js.map +1 -0
- package/dist/478.js +1 -1
- package/dist/478.js.map +1 -1
- package/dist/540.js +1 -1
- package/dist/540.js.map +1 -1
- package/dist/55.js +1 -1
- package/dist/652.js +1 -1
- package/dist/961.js +1 -1
- package/dist/961.js.map +1 -1
- package/dist/99.js +1 -1
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/ampath-esm-reports-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/common/report-error/index.ts +1 -0
- package/src/common/report-error/show-report-error.ts +25 -0
- package/src/common/report-filters/date-range.ts +137 -0
- package/src/common/report-filters/index.ts +4 -0
- package/src/common/report-filters/report-filters.component.tsx +281 -151
- package/src/common/report-filters/report-filters.scss +180 -55
- package/src/common/report-filters/types.ts +66 -0
- package/src/common/report-filters/use-restore-period.ts +43 -0
- package/src/common/report-page/index.ts +2 -0
- package/src/common/report-page/report-page.component.tsx +32 -0
- package/src/common/report-page/report-page.scss +45 -0
- package/src/common/report-page/use-page-scale.ts +50 -0
- package/src/common/report-placeholder/has-report-data.ts +15 -0
- package/src/common/report-placeholder/index.ts +2 -0
- package/src/common/report-placeholder/report-placeholder.component.tsx +56 -0
- package/src/common/report-placeholder/report-placeholder.scss +46 -0
- package/src/common/report-register/index.ts +5 -0
- package/src/common/report-register/register-columns.ts +34 -0
- package/src/common/report-register/register-layout.component.tsx +237 -0
- package/src/common/report-register/register-layout.scss +140 -0
- package/src/common/report-register/register-table.scss +62 -0
- package/src/common/report-register/report-parents.ts +27 -0
- package/src/common/report-register/rows-to-csv.ts +59 -0
- package/src/common/report-register/use-patient-list.ts +92 -0
- package/src/common/report-skeleton/index.ts +1 -0
- package/src/common/report-skeleton/report-skeleton.component.tsx +46 -0
- package/src/common/report-skeleton/report-skeleton.scss +29 -0
- package/src/config-schema.ts +9 -1
- package/src/dashboard/report-catalog.ts +173 -0
- package/src/dashboard/reports-dasboard.tsx +101 -35
- package/src/dashboard/reports-dashboard.module.scss +269 -11
- package/src/index.ts +13 -1
- package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +50 -48
- package/src/reports/moh-240/moh-240-header.component.tsx +54 -56
- package/src/reports/moh-240/moh-240.columns.ts +64 -0
- package/src/reports/moh-240/moh-240.component.tsx +65 -84
- package/src/reports/moh-240/moh-240.scss +36 -7
- package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +27 -65
- package/src/reports/moh-240/sub-reports/page-summary.component.tsx +2 -2
- package/src/reports/moh-505/moh-505-header.component.tsx +59 -57
- package/src/reports/moh-505/moh-505.component.tsx +51 -56
- package/src/reports/moh-505/moh-505.scss +116 -2
- package/src/reports/moh-705B/moh-204b-register.component.tsx +41 -42
- package/src/reports/moh-705B/moh-204b.columns.ts +39 -0
- package/src/reports/moh-705B/moh-705b.component.tsx +492 -473
- package/src/reports/moh-705B/moh-705b.scss +110 -24
- package/src/reports/moh-705a/moh-705a.component.tsx +496 -476
- package/src/reports/moh-705a/moh-705a.scss +109 -24
- package/src/reports/moh-705a/registers/moh-204a-register.component.tsx +41 -42
- package/src/reports/moh-705a/registers/moh-204a.columns.ts +57 -0
- package/src/reports/moh-706/moh-706-header.component.tsx +58 -56
- package/src/reports/moh-706/moh-706.component.tsx +84 -55
- package/src/reports/moh-706/moh-706.scss +115 -19
- package/src/reports/moh-710/moh-710.component.tsx +743 -727
- package/src/reports/moh-710/moh-710.scss +140 -23
- package/src/reports/moh-710/registers/moh-511-710-register.component.tsx +48 -43
- package/src/reports/moh-710/registers/moh-511-710.columns.ts +52 -0
- package/src/reports/moh-711/moh-711.component.tsx +94 -106
- package/src/reports/moh-711/moh711.scss +95 -64
- package/src/reports/moh-711/registers/moh-333-register.component.tsx +92 -94
- package/src/reports/moh-711/registers/moh-333.columns.ts +119 -0
- package/src/reports/moh-711/registers/moh-405-register.component.tsx +88 -89
- package/src/reports/moh-711/registers/moh-405.columns.ts +120 -0
- package/src/reports/moh-711/registers/moh-406-register.component.tsx +85 -88
- package/src/reports/moh-711/registers/moh-406.columns.ts +133 -0
- package/src/reports/moh-711/registers/moh-510-register.component.tsx +38 -44
- package/src/reports/moh-711/registers/moh-511-register.component.tsx +42 -43
- package/src/reports/moh-711/registers/moh-511.columns.ts +59 -0
- package/src/reports/moh-711/sections/anc.component.tsx +3 -3
- package/src/reports/moh-711/sections/cervical-cancer.component.tsx +3 -3
- package/src/reports/moh-711/sections/chanis.component.tsx +2 -3
- package/src/reports/moh-711/sections/family-planning.component.tsx +2 -2
- package/src/reports/moh-711/sections/gbv.component.tsx +2 -2
- package/src/reports/moh-711/sections/maternity.component.tsx +3 -8
- package/src/reports/moh-711/sections/medical-social-work.component.tsx +2 -12
- package/src/reports/moh-711/sections/other.component.tsx +2 -2
- package/src/reports/moh-711/sections/physiotherapy.component.tsx +2 -2
- package/src/reports/moh-711/sections/pnc.component.tsx +7 -5
- package/src/reports/moh-711/sections/post-abortion.component.tsx +2 -2
- package/src/reports/moh-711/sections/rehabilitation.component.tsx +2 -2
- package/src/reports/moh-711/sections/report-compiled-by.component.tsx +12 -4
- package/src/reports/moh-711/sections/tb-screening.component.tsx +2 -2
- package/src/reports/moh-717/moh-717.component.tsx +100 -121
- package/src/reports/moh-717/moh717.scss +163 -102
- package/src/reports/moh-717/sections/maternity.component.tsx +1 -1
- package/src/reports/moh-717/sections/orthopaedic-trauma.component.tsx +1 -1
- package/src/reports/moh-717/sections/outpatient.component.tsx +23 -23
- package/src/reports/moh-717/sections/preparedby.component.tsx +7 -2
- package/src/reports/moh-717/sections/special-services.component.tsx +1 -1
- package/src/reports/moh-731/moh-731.component.tsx +127 -110
- package/src/reports/moh-731/moh-731.scss +396 -68
- package/src/reports/moh-731/registers/moh-366.columns.ts +38 -0
- package/src/reports/moh-731/registers/moh-366.component.tsx +76 -83
- package/src/reports/moh-731/registers/prep-register.component.tsx +70 -78
- package/src/reports/moh-731/registers/prep.columns.ts +34 -0
- package/src/reports/moh-731/sections/hiv-and-tb-treatment.component.tsx +1031 -751
- package/src/reports/moh-731/sections/hiv-testing-and-pre-exposure.component.tsx +230 -86
- package/src/reports/moh-731/sections/pmtct.component.tsx +185 -64
- package/src/reports/moh-740/moh-740.component.scss +159 -79
- package/src/reports/moh-740/moh-740.component.tsx +261 -230
- package/src/reports/moh-740/moh-740.resource.ts +17 -10
- package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.tsx +77 -96
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +50 -70
- package/src/reports/moh-740/registers/moh-740-patient-list.tsx +61 -32
- package/src/reports/moh-740/registers/moh-740.columns.ts +52 -0
- package/src/reports/moh-740/shared/utils/indicator-register-map.ts +3 -3
- package/src/reports/moh-740/types/index.ts +3 -3
- package/src/reports/moh-745/moh-745.component.tsx +897 -877
- package/src/reports/moh-745/moh-745.scss +104 -46
- package/src/reports/moh-745/registers/moh-412-register.component.tsx +42 -43
- package/src/reports/moh-745/registers/moh-412.columns.ts +52 -0
- package/src/reports/table-wrapper/table-wrapper.component.tsx +23 -14
- package/src/reports/table-wrapper/table-wrapper.scss +1 -16
- package/src/resources/moh-505.resource.ts +18 -35
- package/src/resources/moh-705.resource.ts +28 -39
- package/src/resources/moh-706.resource.ts +17 -30
- package/src/resources/moh-710.resource.ts +7 -17
- package/src/resources/moh-711.resource.ts +46 -64
- package/src/resources/moh-717.resource.ts +7 -17
- package/src/resources/moh-731.resource.ts +26 -32
- package/src/resources/moh-745.resource.ts +18 -20
- package/src/resources/patient-list-page.ts +66 -0
- package/src/root.component.tsx +28 -26
- package/src/root.scss +36 -0
- package/src/utils/get-base-url.ts +39 -7
- package/tsconfig.json +1 -1
- package/dist/110.js +0 -1
- package/dist/110.js.map +0 -1
- package/dist/184.js +0 -2
- package/dist/184.js.LICENSE.txt +0 -14
- package/dist/184.js.map +0 -1
- package/dist/205.js +0 -1
- package/dist/205.js.map +0 -1
- package/dist/812.js +0 -1
- package/dist/812.js.map +0 -1
- package/dist/822.js +0 -2
- package/dist/822.js.LICENSE.txt +0 -20
- package/dist/822.js.map +0 -1
- package/dist/ampath-esm-reports-app.js.buildmanifest.json +0 -560
- package/dist/main.js +0 -1
- package/dist/main.js.map +0 -1
- package/src/reports/moh-731/registers/moh-366.scss +0 -45
- package/src/reports/moh-731/registers/prep-registers.scss +0 -45
- package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.scss +0 -18
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.scss +0 -18
- /package/src/{reports/moh-740/shared/utils → utils}/format-indicator.ts +0 -0
package/src/root.component.tsx
CHANGED
|
@@ -23,38 +23,40 @@ import Moh511710Register from './reports/moh-710/registers/moh-511-710-register.
|
|
|
23
23
|
import Moh731Report from './reports/moh-731/moh-731.component';
|
|
24
24
|
import Moh366Register from './reports/moh-731/registers/moh-366.component';
|
|
25
25
|
import PrepRegisterComponent from './reports/moh-731/registers/prep-register.component';
|
|
26
|
+
import styles from './root.scss';
|
|
26
27
|
|
|
27
28
|
const RootComponent: React.FC = () => {
|
|
28
29
|
const baseName = window.getOpenmrsSpaBase() + 'home/reports';
|
|
29
30
|
|
|
30
31
|
return (
|
|
31
32
|
<BrowserRouter basename={baseName}>
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
<div className={styles.page}>
|
|
34
|
+
<Routes>
|
|
35
|
+
<Route path="/" element={<ReportsDashboard />} />
|
|
36
|
+
<Route path="/moh-710" element={<Moh710Report />} />
|
|
37
|
+
<Route path="/moh-711" element={<Moh711Report />} />
|
|
38
|
+
<Route path="/moh-717" element={<Moh717Report />} />
|
|
39
|
+
<Route path="/moh-706" element={<MoH706Report />} />
|
|
40
|
+
<Route path="/moh-240" element={<Moh240Report />} />
|
|
41
|
+
<Route path="/moh-505" element={<Moh505Report />} />
|
|
42
|
+
<Route path="/moh-705a" element={<Moh705AComponent />} />
|
|
43
|
+
<Route path="/moh-705b" element={<Moh705BComponent />} />
|
|
44
|
+
<Route path="/moh-745" element={<Moh745Component />} />
|
|
45
|
+
<Route path="/moh-740" element={<Moh740Report />} />
|
|
46
|
+
<Route path="/moh-412-register" element={<Moh412Register />} />
|
|
47
|
+
<Route path="/moh-204b" element={<Moh204BRegisterComponent />} />
|
|
48
|
+
<Route path="/moh-204a" element={<Moh204ARegisterComponent />} />
|
|
49
|
+
<Route path="/moh-405-register" element={<Moh405Register />} />
|
|
50
|
+
<Route path="/moh-406-register" element={<Moh406Register />} />
|
|
51
|
+
<Route path="/moh-333-register" element={<Moh333Register />} />
|
|
52
|
+
<Route path="/moh-511-register" element={<Moh511Register />} />
|
|
53
|
+
<Route path="/moh-510-register" element={<Moh510Register />} />
|
|
54
|
+
<Route path="/moh-511-710-register" element={<Moh511710Register />} />
|
|
55
|
+
<Route path="/moh-731" element={<Moh731Report />} />
|
|
56
|
+
<Route path="/moh-366-register" element={<Moh366Register />} />
|
|
57
|
+
<Route path="/prep-register" element={<PrepRegisterComponent />} />
|
|
58
|
+
</Routes>
|
|
59
|
+
</div>
|
|
58
60
|
</BrowserRouter>
|
|
59
61
|
);
|
|
60
62
|
};
|
package/src/root.scss
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
@use '@carbon/layout';
|
|
2
2
|
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
|
+
|
|
5
|
+
/* Single gutter for every route, so the dashboard and the individual reports
|
|
6
|
+
all clear the left nav by the same amount. */
|
|
7
|
+
.page {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
min-height: 100%;
|
|
10
|
+
padding: 0 layout.$spacing-06;
|
|
11
|
+
}
|
|
3
12
|
|
|
4
13
|
.container {
|
|
5
14
|
padding: layout.$spacing-07;
|
|
6
15
|
}
|
|
7
16
|
|
|
17
|
+
@media (max-width: $breakpoint-tablet-max) {
|
|
18
|
+
.page {
|
|
19
|
+
padding: 0 layout.$spacing-05;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
8
23
|
.welcome {
|
|
9
24
|
@include type.type-style('heading-04');
|
|
10
25
|
margin: layout.$spacing-05 0;
|
|
@@ -13,3 +28,24 @@
|
|
|
13
28
|
.explainer {
|
|
14
29
|
margin-bottom: layout.$spacing-07;
|
|
15
30
|
}
|
|
31
|
+
|
|
32
|
+
/* Printing a report should put the report on the paper, not the application
|
|
33
|
+
around it. Every route renders inside `.page`, so the chrome is hidden once
|
|
34
|
+
here; the filter bar hides itself (see report-filters.scss), and a report
|
|
35
|
+
with its own sheet geometry (MOH-731) refines this further. */
|
|
36
|
+
|
|
37
|
+
@media print {
|
|
38
|
+
|
|
39
|
+
.page,
|
|
40
|
+
.page * {
|
|
41
|
+
visibility: visible;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.page {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 0;
|
|
47
|
+
left: 0;
|
|
48
|
+
width: 100%;
|
|
49
|
+
padding: 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
import { getConfig } from '@openmrs/esm-framework';
|
|
2
|
-
import {
|
|
2
|
+
import { configSectionName } from '../index';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The ETL host every report reads from, taken from this module's frontend
|
|
6
|
+
* configuration (`etlBaseUrl`).
|
|
7
|
+
*
|
|
8
|
+
* Throws when it is unset rather than returning an empty string: an empty base
|
|
9
|
+
* collapses every report URL onto the OpenMRS root, which surfaces as a bare
|
|
10
|
+
* 404 that reads like a missing endpoint instead of missing configuration.
|
|
11
|
+
*/
|
|
12
|
+
export async function getEtlBaseUrl(): Promise<string> {
|
|
13
|
+
const { etlBaseUrl } = await getConfig(configSectionName);
|
|
14
|
+
const baseUrl = typeof etlBaseUrl === 'string' ? etlBaseUrl.trim() : '';
|
|
15
|
+
|
|
16
|
+
if (!baseUrl) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
`The ETL base URL is not configured. Set "etlBaseUrl" for ${configSectionName} in the frontend configuration.`,
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// trailing slash trimmed so callers can join with a leading slash safely
|
|
23
|
+
return baseUrl.replace(/\/+$/, '');
|
|
7
24
|
}
|
|
8
25
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
26
|
+
export type EtlQueryParams = Record<string, string | number | undefined | null>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Builds a report URL from the configured ETL base, a path and its query
|
|
30
|
+
* parameters. Blank parameters are dropped rather than sent as empty values.
|
|
31
|
+
*/
|
|
32
|
+
export async function buildEtlUrl(path: string, params: EtlQueryParams = {}): Promise<string> {
|
|
33
|
+
const baseUrl = await getEtlBaseUrl();
|
|
34
|
+
|
|
35
|
+
const query = new URLSearchParams(
|
|
36
|
+
Object.entries(params)
|
|
37
|
+
.filter(([, value]) => value !== undefined && value !== null && value !== '')
|
|
38
|
+
.map(([key, value]) => [key, String(value)]),
|
|
39
|
+
).toString();
|
|
40
|
+
|
|
41
|
+
const url = `${baseUrl}/${path.replace(/^\/+/, '')}`;
|
|
42
|
+
|
|
43
|
+
return query ? `${url}?${query}` : url;
|
|
12
44
|
}
|