@ampath/esm-reports-app 1.0.0-next.2 → 1.0.0-next.4
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/184.js +1 -1
- package/dist/184.js.map +1 -1
- package/dist/260.js +1 -0
- package/dist/260.js.map +1 -0
- package/dist/282.js +1 -1
- package/dist/282.js.LICENSE.txt +3 -3
- package/dist/282.js.map +1 -1
- package/dist/311.js +1 -0
- package/dist/311.js.map +1 -0
- package/dist/353.js +1 -1
- package/dist/353.js.map +1 -1
- package/dist/367.js +2 -0
- package/dist/367.js.LICENSE.txt +20 -0
- package/dist/367.js.map +1 -0
- package/dist/478.js +2 -0
- package/dist/478.js.LICENSE.txt +9 -0
- package/dist/478.js.map +1 -0
- package/dist/540.js +1 -1
- package/dist/540.js.map +1 -1
- package/dist/812.js +1 -0
- package/dist/812.js.map +1 -0
- package/dist/86.js +1 -0
- package/dist/86.js.map +1 -0
- package/dist/961.js +1 -1
- package/dist/961.js.map +1 -1
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/ampath-esm-reports-app.js.buildmanifest.json +121 -165
- package/dist/ampath-esm-reports-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -1
- package/src/common/report-filters/report-filters.component.tsx +125 -0
- package/src/common/report-filters/report-filters.scss +49 -0
- package/src/config-schema.ts +6 -37
- package/src/createDashboardLink.tsx +9 -0
- package/src/dashboard/reports-dasboard.tsx +26 -0
- package/src/dashboard/reports-dashboard.module.scss +14 -0
- package/src/dashboard-meta/reports-dashboard.meta.ts +6 -0
- package/src/index.ts +6 -35
- package/src/reports/moh-710/moh-710.component.tsx +674 -0
- package/src/reports/moh-710/moh-710.scss +41 -0
- package/src/reports/moh-711/moh-711.component.tsx +1309 -0
- package/src/reports/moh-711/moh711.scss +41 -0
- package/src/reports/moh-717/moh-717.component.tsx +1025 -0
- package/src/reports/moh-717/moh717.scss +41 -0
- package/src/resources/moh-710.resource.ts +34 -0
- package/src/resources/moh-711.resource.ts +34 -0
- package/src/resources/moh-717.resource.ts +35 -0
- package/src/root.component.tsx +16 -32
- package/src/routes.json +14 -17
- package/src/utils/get-base-url.ts +12 -0
- package/dist/19.js +0 -2
- package/dist/19.js.LICENSE.txt +0 -39
- package/dist/19.js.map +0 -1
- package/dist/255.js +0 -1
- package/dist/255.js.map +0 -1
- package/dist/389.js +0 -1
- package/dist/389.js.map +0 -1
- package/dist/451.js +0 -1
- package/dist/451.js.map +0 -1
- package/dist/488.js +0 -1
- package/dist/488.js.map +0 -1
- package/dist/557.js +0 -1
- package/dist/557.js.map +0 -1
- package/dist/91.js +0 -1
- package/dist/91.js.map +0 -1
- package/dist/970.js +0 -1
- package/dist/970.js.map +0 -1
- package/src/boxes/extensions/blue-box.component.tsx +0 -15
- package/src/boxes/extensions/box.scss +0 -23
- package/src/boxes/extensions/brand-box.component.tsx +0 -15
- package/src/boxes/extensions/red-box.component.tsx +0 -15
- package/src/boxes/slot/boxes.component.tsx +0 -25
- package/src/boxes/slot/boxes.scss +0 -29
- package/src/greeter/greeter.component.tsx +0 -42
- package/src/greeter/greeter.scss +0 -20
- package/src/greeter/greeter.test.tsx +0 -28
- package/src/patient-getter/patient-getter.component.tsx +0 -40
- package/src/patient-getter/patient-getter.resource.ts +0 -39
- package/src/patient-getter/patient-getter.scss +0 -16
- package/src/patient-getter/patient-getter.test.tsx +0 -40
- package/src/resources/resources.component.tsx +0 -56
- package/src/resources/resources.scss +0 -68
- package/src/root.test.tsx +0 -51
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
h3 {
|
|
3
|
+
text-align: center;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.container {
|
|
7
|
+
border: 1px solid #ccc;
|
|
8
|
+
margin: 0 2rem;
|
|
9
|
+
margin-top: 0.5px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.tableContainer {
|
|
13
|
+
margin-left: 1rem;
|
|
14
|
+
margin-bottom: 1rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sectionTitle {
|
|
18
|
+
margin-left: 1rem ;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.title {
|
|
22
|
+
text-align: center;
|
|
23
|
+
font-size: 1rem;
|
|
24
|
+
margin: 1rem;
|
|
25
|
+
}
|
|
26
|
+
.table {
|
|
27
|
+
width: auto;
|
|
28
|
+
border-collapse: collapse;
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.tableBordered td,
|
|
33
|
+
.tableBordered th {
|
|
34
|
+
border: 1px solid #dee2e6;
|
|
35
|
+
padding: 0.3rem;
|
|
36
|
+
font-size: small;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tableStriped tbody tr:nth-of-type(odd) {
|
|
40
|
+
background-color: #f9f9f9;
|
|
41
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import { getEtlBaseUrl } from '../utils/get-base-url';
|
|
3
|
+
|
|
4
|
+
interface Moh710Params {
|
|
5
|
+
locationUuids: string;
|
|
6
|
+
startDate?: string;
|
|
7
|
+
endDate?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function getMoh710(params: Moh710Params): Promise<any> {
|
|
11
|
+
const etlBaseUrl = await getEtlBaseUrl();
|
|
12
|
+
const url = `${etlBaseUrl}/moh-710`;
|
|
13
|
+
const queryparams = {
|
|
14
|
+
locationUuids: params.locationUuids || '',
|
|
15
|
+
startDate: params.startDate || '',
|
|
16
|
+
endDate: params.endDate || '',
|
|
17
|
+
};
|
|
18
|
+
const queryString = new URLSearchParams(
|
|
19
|
+
Object.fromEntries(Object.entries(queryparams).filter(([_, v]) => v !== undefined && v !== null)),
|
|
20
|
+
).toString();
|
|
21
|
+
try {
|
|
22
|
+
const response = await openmrsFetch(`${url}?${queryString}`);
|
|
23
|
+
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
const errorText = await response.text();
|
|
26
|
+
throw new Error(`Failed to fetch dashboard summary: ${response.status} - ${errorText}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const data = await response.json();
|
|
30
|
+
return data;
|
|
31
|
+
} catch (error: any) {
|
|
32
|
+
throw new Error(`An error occurred while fetching the MOH-710 report: ${error.message}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import { getEtlBaseUrl } from '../utils/get-base-url';
|
|
3
|
+
|
|
4
|
+
interface Moh711Params {
|
|
5
|
+
locationUuids: string;
|
|
6
|
+
startDate?: string;
|
|
7
|
+
endDate?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function getMoh711(params: Moh711Params): Promise<any> {
|
|
11
|
+
const etlBaseUrl = await getEtlBaseUrl();
|
|
12
|
+
const url = `${etlBaseUrl}/moh-711`;
|
|
13
|
+
const queryparams = {
|
|
14
|
+
locationUuids: params.locationUuids || '',
|
|
15
|
+
startDate: params.startDate || '',
|
|
16
|
+
endDate: params.endDate || '',
|
|
17
|
+
};
|
|
18
|
+
const queryString = new URLSearchParams(
|
|
19
|
+
Object.fromEntries(Object.entries(queryparams).filter(([_, v]) => v !== undefined && v !== null)),
|
|
20
|
+
).toString();
|
|
21
|
+
try {
|
|
22
|
+
const response = await openmrsFetch(`${url}?${queryString}`);
|
|
23
|
+
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
const errorText = await response.text();
|
|
26
|
+
throw new Error(`Failed to fetch dashboard summary: ${response.status} - ${errorText}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const data = await response.json();
|
|
30
|
+
return data;
|
|
31
|
+
} catch (error: any) {
|
|
32
|
+
throw new Error(`An error occurred while fetching the MOH-711 report: ${error.message}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import { getEtlBaseUrl } from '../utils/get-base-url';
|
|
3
|
+
|
|
4
|
+
interface Moh717Params {
|
|
5
|
+
locationUuids: string;
|
|
6
|
+
startDate?: string;
|
|
7
|
+
endDate?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function getMoh717(params: Moh717Params): Promise<any> {
|
|
11
|
+
const etlBaseUrl = await getEtlBaseUrl();
|
|
12
|
+
const url = `${etlBaseUrl}/moh-717`;
|
|
13
|
+
const queryparams = {
|
|
14
|
+
locationUuids: params.locationUuids || '',
|
|
15
|
+
startDate: params.startDate || '',
|
|
16
|
+
endDate: params.endDate || '',
|
|
17
|
+
};
|
|
18
|
+
const queryString = new URLSearchParams(
|
|
19
|
+
Object.fromEntries(Object.entries(queryparams).filter(([_, v]) => v !== undefined && v !== null)),
|
|
20
|
+
).toString();
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const response = await openmrsFetch(`${url}?${queryString}`);
|
|
24
|
+
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
const errorText = await response.text();
|
|
27
|
+
throw new Error(`Failed to fetch dashboard summary: ${response.status} - ${errorText}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const data = await response.json();
|
|
31
|
+
return data;
|
|
32
|
+
} catch (error: any) {
|
|
33
|
+
throw new Error(`An error occurred while fetching the MOH-717 report: ${error.message}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/root.component.tsx
CHANGED
|
@@ -1,39 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* From here, the application is pretty typical React, but with lots of
|
|
3
|
-
* support from `@openmrs/esm-framework`. Check out `Greeter` to see
|
|
4
|
-
* usage of the configuration system, and check out `PatientGetter` to
|
|
5
|
-
* see data fetching using the OpenMRS FHIR API.
|
|
6
|
-
*
|
|
7
|
-
* Check out the Config docs:
|
|
8
|
-
* https://openmrs.github.io/openmrs-esm-core/#/main/config
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
1
|
import React from 'react';
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import styles from './root.scss';
|
|
2
|
+
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
3
|
+
import ReportsDashboard from './dashboard/reports-dasboard';
|
|
4
|
+
import Moh710Report from './reports/moh-710/moh-710.component';
|
|
5
|
+
import Moh711Report from './reports/moh-711/moh-711.component';
|
|
6
|
+
import Moh717Report from './reports/moh-717/moh-717.component';
|
|
18
7
|
|
|
19
|
-
const
|
|
20
|
-
const
|
|
8
|
+
const RootComponent: React.FC = () => {
|
|
9
|
+
const baseName = window.getOpenmrsSpaBase() + 'home/reports';
|
|
21
10
|
|
|
22
11
|
return (
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<Boxes />
|
|
32
|
-
{/* PatientGetter: demonstrates data fetching */}
|
|
33
|
-
<PatientGetter />
|
|
34
|
-
<Resources />
|
|
35
|
-
</div>
|
|
12
|
+
<BrowserRouter basename={baseName}>
|
|
13
|
+
<Routes>
|
|
14
|
+
<Route path="/" element={<ReportsDashboard />} />
|
|
15
|
+
<Route path="/moh-710" element={<Moh710Report />} />
|
|
16
|
+
<Route path="/moh-711" element={<Moh711Report />} />
|
|
17
|
+
<Route path="/moh-717" element={<Moh717Report />} />
|
|
18
|
+
</Routes>
|
|
19
|
+
</BrowserRouter>
|
|
36
20
|
);
|
|
37
21
|
};
|
|
38
22
|
|
|
39
|
-
export default
|
|
23
|
+
export default RootComponent;
|
package/src/routes.json
CHANGED
|
@@ -6,25 +6,22 @@
|
|
|
6
6
|
},
|
|
7
7
|
"extensions": [
|
|
8
8
|
{
|
|
9
|
-
"name": "
|
|
10
|
-
"component": "
|
|
11
|
-
"slot": "
|
|
9
|
+
"name": "ampath-reports-dashboard-link",
|
|
10
|
+
"component": "reportsDashboardLink",
|
|
11
|
+
"slot": "homepage-dashboard-slot",
|
|
12
|
+
"meta": {
|
|
13
|
+
"name": "reports",
|
|
14
|
+
"slot": "ampath-reports-dashboard-slot",
|
|
15
|
+
"title": "Reports"
|
|
16
|
+
},
|
|
17
|
+
"online": true,
|
|
18
|
+
"offline": true
|
|
12
19
|
},
|
|
13
|
-
{
|
|
14
|
-
"name": "Blue box",
|
|
15
|
-
"component": "blueBox",
|
|
16
|
-
"slot": "Boxes"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "Brand box",
|
|
20
|
-
"component": "blueBox",
|
|
21
|
-
"slot": "Boxes"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"pages": [
|
|
25
20
|
{
|
|
26
21
|
"component": "root",
|
|
27
|
-
"
|
|
22
|
+
"name": "ampath-reports-dashboard-root",
|
|
23
|
+
"slot": "ampath-reports-dashboard-slot"
|
|
28
24
|
}
|
|
29
|
-
]
|
|
25
|
+
],
|
|
26
|
+
"pages": []
|
|
30
27
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getConfig } from '@openmrs/esm-framework';
|
|
2
|
+
import { moduleName } from '../index';
|
|
3
|
+
|
|
4
|
+
export async function getEtlBaseUrl() {
|
|
5
|
+
const { etlBaseUrl } = await getConfig(moduleName);
|
|
6
|
+
return etlBaseUrl ?? null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function getSubDomain() {
|
|
10
|
+
const { subDomain } = await getConfig(moduleName);
|
|
11
|
+
return subDomain ?? null;
|
|
12
|
+
}
|