@ampath/esm-reports-app 1.0.0-next.3 → 1.0.0-next.30

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.
Files changed (140) hide show
  1. package/dist/138.js +2 -0
  2. package/dist/138.js.LICENSE.txt +20 -0
  3. package/dist/138.js.map +1 -0
  4. package/dist/184.js +1 -1
  5. package/dist/184.js.map +1 -1
  6. package/dist/205.js +1 -0
  7. package/dist/205.js.map +1 -0
  8. package/dist/282.js +1 -1
  9. package/dist/282.js.LICENSE.txt +3 -3
  10. package/dist/282.js.map +1 -1
  11. package/dist/311.js +1 -0
  12. package/dist/311.js.map +1 -0
  13. package/dist/353.js +1 -2
  14. package/dist/353.js.map +1 -1
  15. package/dist/478.js +2 -0
  16. package/dist/478.js.LICENSE.txt +9 -0
  17. package/dist/478.js.map +1 -0
  18. package/dist/540.js +1 -1
  19. package/dist/540.js.map +1 -1
  20. package/dist/645.js +1 -0
  21. package/dist/645.js.map +1 -0
  22. package/dist/812.js +1 -0
  23. package/dist/812.js.map +1 -0
  24. package/dist/961.js +1 -1
  25. package/dist/961.js.map +1 -1
  26. package/dist/ampath-esm-reports-app.js +1 -1
  27. package/dist/ampath-esm-reports-app.js.buildmanifest.json +174 -99
  28. package/dist/ampath-esm-reports-app.js.map +1 -1
  29. package/dist/main.js +1 -1
  30. package/dist/main.js.map +1 -1
  31. package/dist/routes.json +1 -1
  32. package/package.json +2 -1
  33. package/src/common/report-filters/report-filters.component.tsx +127 -0
  34. package/src/common/report-filters/report-filters.scss +49 -0
  35. package/src/dashboard/reports-dasboard.tsx +38 -1
  36. package/src/dashboard/reports-dashboard.module.scss +14 -0
  37. package/src/index.ts +1 -1
  38. package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +54 -0
  39. package/src/reports/moh-240/moh-240-header.component.tsx +61 -0
  40. package/src/reports/moh-240/moh-240.component.tsx +68 -0
  41. package/src/reports/moh-240/moh-240.scss +3 -0
  42. package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +72 -0
  43. package/src/reports/moh-240/sub-reports/page-summary.component.tsx +95 -0
  44. package/src/reports/moh-505/moh-505-header.component.tsx +62 -0
  45. package/src/reports/moh-505/moh-505.component.tsx +240 -0
  46. package/src/reports/moh-505/moh-505.scss +3 -0
  47. package/src/reports/moh-705B/moh-204b-register.component.tsx +235 -0
  48. package/src/reports/moh-705B/moh-705b.component.tsx +524 -0
  49. package/src/reports/moh-705B/moh-705b.scss +44 -0
  50. package/src/reports/moh-705a/moh-705a.component.tsx +528 -0
  51. package/src/reports/moh-705a/moh-705a.scss +45 -0
  52. package/src/reports/moh-705a/registers/moh-204a-register.component.tsx +320 -0
  53. package/src/reports/moh-705a/type.ts +6 -0
  54. package/src/reports/moh-706/moh-706-header.component.tsx +61 -0
  55. package/src/reports/moh-706/moh-706.component.tsx +104 -0
  56. package/src/reports/moh-706/moh-706.scss +30 -0
  57. package/src/reports/moh-706/sub-reports/bacteriology/bacteriology.component.tsx +124 -0
  58. package/src/reports/moh-706/sub-reports/blood-chemistry/blood-chemistry.component.tsx +318 -0
  59. package/src/reports/moh-706/sub-reports/drug-susceptibility-testing/drug-susceptibility-testing.component.tsx +137 -0
  60. package/src/reports/moh-706/sub-reports/haematology/haematology.component.tsx +179 -0
  61. package/src/reports/moh-706/sub-reports/histology-and-cytology/histology-and-cytology.component.tsx +88 -0
  62. package/src/reports/moh-706/sub-reports/parasitology/parasitology.component.tsx +121 -0
  63. package/src/reports/moh-706/sub-reports/serology/serology.component.tsx +47 -0
  64. package/src/reports/moh-706/sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component.tsx +39 -0
  65. package/src/reports/moh-706/sub-reports/urine-analysis/urine-analysis.component.tsx +108 -0
  66. package/src/reports/moh-710/moh-710.component.tsx +665 -0
  67. package/src/reports/moh-710/moh-710.scss +45 -0
  68. package/src/reports/moh-710/patient-list/moh-710-patient-list.component.tsx +13 -0
  69. package/src/reports/moh-711/moh-711.component.tsx +139 -0
  70. package/src/reports/moh-711/moh711.scss +82 -0
  71. package/src/reports/moh-711/registers/moh-333-register.component.tsx +636 -0
  72. package/src/reports/moh-711/registers/moh-405-register.component.tsx +518 -0
  73. package/src/reports/moh-711/registers/moh-406-register.component.tsx +530 -0
  74. package/src/reports/moh-711/registers/moh-510-register.component.tsx +61 -0
  75. package/src/reports/moh-711/registers/moh-511-register.component.tsx +263 -0
  76. package/src/reports/moh-711/registers/type.ts +194 -0
  77. package/src/reports/moh-711/sections/anc.component.tsx +153 -0
  78. package/src/reports/moh-711/sections/cervical-cancer.component.tsx +104 -0
  79. package/src/reports/moh-711/sections/chanis.component.tsx +367 -0
  80. package/src/reports/moh-711/sections/family-planning.component.tsx +221 -0
  81. package/src/reports/moh-711/sections/gbv.component.tsx +115 -0
  82. package/src/reports/moh-711/sections/maternity.component.tsx +319 -0
  83. package/src/reports/moh-711/sections/medical-social-work.component.tsx +83 -0
  84. package/src/reports/moh-711/sections/other.component.tsx +47 -0
  85. package/src/reports/moh-711/sections/physiotherapy.component.tsx +61 -0
  86. package/src/reports/moh-711/sections/pnc.component.tsx +118 -0
  87. package/src/reports/moh-711/sections/post-abortion.component.tsx +42 -0
  88. package/src/reports/moh-711/sections/rehabilitation.component.tsx +57 -0
  89. package/src/reports/moh-711/sections/report-compiled-by.component.tsx +42 -0
  90. package/src/reports/moh-711/sections/tb-screening.component.tsx +57 -0
  91. package/src/reports/moh-717/moh-717.component.tsx +170 -0
  92. package/src/reports/moh-717/moh717.scss +154 -0
  93. package/src/reports/moh-717/sections/finance.component.tsx +42 -0
  94. package/src/reports/moh-717/sections/inpatient.component.tsx +374 -0
  95. package/src/reports/moh-717/sections/maternity.component.tsx +119 -0
  96. package/src/reports/moh-717/sections/medical-records.component.tsx +35 -0
  97. package/src/reports/moh-717/sections/mortuary.component.tsx +43 -0
  98. package/src/reports/moh-717/sections/operations.component.tsx +53 -0
  99. package/src/reports/moh-717/sections/orthopaedic-trauma.component.tsx +98 -0
  100. package/src/reports/moh-717/sections/outpatient.component.tsx +489 -0
  101. package/src/reports/moh-717/sections/pharmacy.component.tsx +43 -0
  102. package/src/reports/moh-717/sections/preparedby.component.tsx +47 -0
  103. package/src/reports/moh-717/sections/special-services.component.tsx +114 -0
  104. package/src/reports/moh-740/moh-740.component.scss +120 -0
  105. package/src/reports/moh-740/moh-740.component.tsx +1263 -0
  106. package/src/reports/moh-740/moh-740.resource.ts +42 -0
  107. package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.tsx +6 -0
  108. package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.scss +18 -0
  109. package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +79 -0
  110. package/src/reports/moh-740/registers/moh-740-patient-list.scss +0 -0
  111. package/src/reports/moh-740/registers/moh-740-patient-list.tsx +43 -0
  112. package/src/reports/moh-740/shared/data-cell/data-cell.scss +6 -0
  113. package/src/reports/moh-740/shared/data-cell/data-cell.tsx +23 -0
  114. package/src/reports/moh-740/shared/utils/format-indicator.ts +22 -0
  115. package/src/reports/moh-740/types/index.ts +183 -0
  116. package/src/reports/moh-745/moh-745.component.tsx +928 -0
  117. package/src/reports/moh-745/moh-745.scss +74 -0
  118. package/src/reports/moh-745/registers/moh-412-register.component.tsx +191 -0
  119. package/src/reports/moh-745/registers/type.ts +29 -0
  120. package/src/reports/table-wrapper/table-row-mapper.component.tsx +51 -0
  121. package/src/reports/table-wrapper/table-wrapper.component.tsx +21 -0
  122. package/src/reports/table-wrapper/table-wrapper.scss +31 -0
  123. package/src/resources/moh-705.resource.ts +117 -0
  124. package/src/resources/moh-706.resource.ts +86 -0
  125. package/src/resources/moh-710.resource.ts +60 -0
  126. package/src/resources/moh-711.resource.ts +175 -0
  127. package/src/resources/moh-717.resource.ts +35 -0
  128. package/src/resources/moh-745.resource.ts +64 -0
  129. package/src/root.component.tsx +38 -0
  130. package/src/utils/get-base-url.ts +12 -0
  131. package/src/utils/utils.ts +36 -0
  132. package/dist/255.js +0 -1
  133. package/dist/255.js.map +0 -1
  134. package/dist/353.js.LICENSE.txt +0 -39
  135. package/dist/36.js +0 -1
  136. package/dist/36.js.map +0 -1
  137. package/dist/734.js +0 -1
  138. package/dist/734.js.map +0 -1
  139. package/dist/97.js +0 -1
  140. package/dist/97.js.map +0 -1
@@ -0,0 +1,45 @@
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 black;
35
+ padding: 0.3rem;
36
+ font-size: small;
37
+ }
38
+
39
+ .tableStriped tbody tr:nth-of-type(odd) {
40
+ background-color: #f9f9f9;
41
+ }
42
+
43
+ .buttonContainer {
44
+ margin: 1rem;
45
+ }
@@ -0,0 +1,13 @@
1
+ import { useSession } from '@openmrs/esm-framework';
2
+ import React, { useState } from 'react';
3
+ import { getMoh710PatientList } from '../../../resources/moh-710.resource';
4
+
5
+ const Moh710PatientList: React.FC = () => {
6
+ const [moh710PatientListData, setMoh710PatientListData] = useState<any>([]);
7
+ const [isLoading, setIsLoading] = useState<boolean>(false);
8
+ const session = useSession();
9
+ const locationUuid = session?.sessionLocation?.uuid;
10
+ return <></>;
11
+ };
12
+
13
+ export default Moh710PatientList;
@@ -0,0 +1,139 @@
1
+ import React, { useState } from 'react';
2
+ import ReportFiltersComponent from '../../common/report-filters/report-filters.component';
3
+
4
+ import styles from './moh711.scss';
5
+ import classNames from 'classnames';
6
+ import { useSession } from '@openmrs/esm-framework';
7
+ import { getMoh711 } from '../../resources/moh-711.resource';
8
+ import { Loading } from '@carbon/react';
9
+ import TBScreeningComponent from './sections/tb-screening.component';
10
+ import ANCComponent from './sections/anc.component';
11
+ import MaternityComponent from './sections/maternity.component';
12
+ import GBVComponent from './sections/gbv.component';
13
+ import FamilyPlanningComponent from './sections/family-planning.component';
14
+ import CervicalCancerComponent from './sections/cervical-cancer.component';
15
+ import PostAbortion from './sections/post-abortion.component';
16
+ import ChanisComponent from './sections/chanis.component';
17
+ import PNCComponent from './sections/pnc.component';
18
+ import RehabilitationComponent from './sections/rehabilitation.component';
19
+ import MedicalSocialWorkComponent from './sections/medical-social-work.component';
20
+ import PhysiotherapyComponent from './sections/physiotherapy.component';
21
+ import OtherComponent from './sections/other.component';
22
+ import ReportCompiledByComponent from './sections/report-compiled-by.component';
23
+ import { type ReportFilters } from '../moh-705a/type';
24
+
25
+ const Moh711Report: React.FC = () => {
26
+ let errorMessage: string = '';
27
+ const [moh711Data, setMoh711Data] = useState<any>([]);
28
+ const [isLoading, setIsLoading] = useState<boolean>(false);
29
+ const [startDate, setStartDate] = useState<string>('');
30
+ const [endDate, setEndDate] = useState<string>('');
31
+
32
+ const session = useSession();
33
+ const locationUuid = session?.sessionLocation?.uuid;
34
+
35
+ const getReportParams = (filters: ReportFilters) => {
36
+ let { startDate: sDate, endDate: eDate } = filters;
37
+
38
+ if (filters.month) {
39
+ const [year, monthIndex] = filters.month.split('-').map(Number);
40
+
41
+ const start = new Date(year, monthIndex - 1, 1);
42
+ const end = new Date(year, monthIndex, 0);
43
+
44
+ const formatLocalDate = (d: Date) => {
45
+ const y = d.getFullYear();
46
+ const m = String(d.getMonth() + 1).padStart(2, '0');
47
+ const day = String(d.getDate()).padStart(2, '0');
48
+ return `${y}-${m}-${day}`;
49
+ };
50
+
51
+ sDate = formatLocalDate(start);
52
+ eDate = formatLocalDate(end);
53
+ }
54
+
55
+ setStartDate(sDate || '');
56
+ setEndDate(eDate || '');
57
+
58
+ return { startDate: sDate, endDate: eDate };
59
+ };
60
+
61
+ const fetchMoh711ReportData = async (filters: { startDate?: string; endDate?: string; month?: string }) => {
62
+ setIsLoading(true);
63
+
64
+ const { startDate, endDate } = getReportParams(filters);
65
+
66
+ const params = {
67
+ locationUuids: locationUuid || '',
68
+ startDate,
69
+ endDate,
70
+ };
71
+ try {
72
+ const data = await getMoh711(params);
73
+ const flatData = Object.assign({}, ...data.result);
74
+ setMoh711Data(flatData);
75
+ setIsLoading(false);
76
+ } catch (error) {
77
+ setIsLoading(false);
78
+ errorMessage = error instanceof Error ? error.message : String(error);
79
+ throw new Error(`Failed to fetch MOH-711 report data: ${error instanceof Error ? error.message : String(error)}`);
80
+ }
81
+ };
82
+ return (
83
+ <>
84
+ <ReportFiltersComponent
85
+ reportName="MOH-711 Report"
86
+ mode="monthly"
87
+ onGenerate={fetchMoh711ReportData}
88
+ isLoding={isLoading}
89
+ />
90
+ {isLoading && <Loading description="Fetching data...." />}
91
+ {!isLoading && errorMessage && (
92
+ <div>
93
+ <a href="#" className="close" data-dismiss="alert">
94
+ &times;
95
+ </a>
96
+ <h4>
97
+ <strong>
98
+ <span className="glyphicon glyphicon-warning-sign"></span>{' '}
99
+ </strong>{' '}
100
+ An error occurred while trying to load the report. Please try again.
101
+ </h4>
102
+ <p>
103
+ <small>{errorMessage}</small>
104
+ </p>
105
+ </div>
106
+ )}
107
+ <h5>
108
+ INTEGRATED PROGRAM SUMMARY REPORT FORM: REPRODUCTIVE AND CHILD HEALTH, MEDICAL AND REHABILITATION SERVICES
109
+ </h5>
110
+ <div className={styles.container}>
111
+ <div className={styles.left}>
112
+ <ANCComponent moh711Data={moh711Data} startDate={startDate} endDate={endDate} locationUuids={locationUuid!} />
113
+ <GBVComponent moh711Data={moh711Data} />
114
+ <FamilyPlanningComponent moh711Data={moh711Data} />
115
+ <CervicalCancerComponent moh711Data={moh711Data} />
116
+ <PNCComponent moh711Data={moh711Data} startDate={startDate} endDate={endDate} locationUuids={locationUuid!} />
117
+ <RehabilitationComponent moh711Data={moh711Data} />
118
+ <MedicalSocialWorkComponent moh711Data={moh711Data} />
119
+ <ReportCompiledByComponent />
120
+ </div>
121
+ <div className={styles.right}>
122
+ <MaternityComponent
123
+ moh711Data={moh711Data}
124
+ startDate={startDate}
125
+ endDate={endDate}
126
+ locationUuids={locationUuid!}
127
+ />
128
+ <PostAbortion moh711Data={moh711Data} />
129
+ <ChanisComponent moh711Data={moh711Data} />
130
+ <PhysiotherapyComponent moh711Data={moh711Data} />
131
+ <OtherComponent moh711Data={MaternityComponent} />
132
+ <TBScreeningComponent moh711Data={moh711Data} />
133
+ </div>
134
+ </div>
135
+ </>
136
+ );
137
+ };
138
+
139
+ export default Moh711Report;
@@ -0,0 +1,82 @@
1
+
2
+ h5 {
3
+ text-align: center;
4
+ }
5
+
6
+ .container {
7
+ margin: 2rem 2rem;
8
+ display: grid;
9
+ grid-template-columns: 1fr 1fr;
10
+ gap: 1rem;
11
+ padding: 0 2rem;
12
+
13
+ grid-template-areas:
14
+ "left right";
15
+ }
16
+
17
+
18
+ .left {
19
+ grid-area: left;
20
+ }
21
+
22
+ .right {
23
+ grid-area: right;
24
+ }
25
+
26
+ /* 📱 Stack on small screens */
27
+ @media (max-width: 768px) {
28
+ .container {
29
+ grid-template-columns: 1fr;
30
+ grid-template-areas:
31
+ "left"
32
+ "right";
33
+ }
34
+ }
35
+
36
+ .sectionTitle {
37
+ margin-left: 1rem ;
38
+ }
39
+
40
+ .title {
41
+ text-align: center;
42
+ font-size: 1rem;
43
+ margin: 1rem;
44
+ }
45
+ .table {
46
+ width: auto;
47
+ border-collapse: collapse;
48
+
49
+ }
50
+
51
+ .tableBordered td,
52
+ .tableBordered th {
53
+ border: 1px solid black;
54
+ padding: 0.3rem;
55
+ font-size: small;
56
+ }
57
+
58
+ .tableBordered th {
59
+ font-weight: bold;
60
+ }
61
+
62
+ .tableStriped tbody tr:nth-of-type(odd) {
63
+ background-color: #f9f9f9;
64
+ }
65
+
66
+ .greyBackground {
67
+ background-color: #ccc;
68
+ }
69
+ .compiledBy {
70
+ width: 10rem
71
+ }
72
+
73
+ .buttonContainer {
74
+ margin: 1rem;
75
+ }
76
+
77
+ .textCenter {
78
+ text-align: center;
79
+ }
80
+ .tableContainer {
81
+ margin: 1rem;
82
+ }