@pih/esm-pathology-app 1.0.5 → 1.0.6
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/package.json +2 -2
- package/src/Print-to-PDF/Document-Component.tsx +204 -164
- package/src/pathology-report/ReportComponent.tsx +20 -34
- package/dist/00ebb57bb20c59433e84.gif +0 -0
- package/dist/16.js +0 -3
- package/dist/16.js.LICENSE.txt +0 -1
- package/dist/16.js.map +0 -1
- package/dist/24.js +0 -3
- package/dist/24.js.LICENSE.txt +0 -16
- package/dist/24.js.map +0 -1
- package/dist/248.js +0 -3
- package/dist/248.js.LICENSE.txt +0 -99
- package/dist/248.js.map +0 -1
- package/dist/294.js +0 -3
- package/dist/294.js.LICENSE.txt +0 -14
- package/dist/294.js.map +0 -1
- package/dist/574.js +0 -1
- package/dist/5b8bb278fcab4da4972e.ttf +0 -0
- package/dist/861.js +0 -2
- package/dist/861.js.map +0 -1
- package/dist/867.js +0 -2
- package/dist/867.js.map +0 -1
- package/dist/976.js +0 -3
- package/dist/976.js.LICENSE.txt +0 -8
- package/dist/976.js.map +0 -1
- package/dist/a5fad24f075c978ac04b.ttf +0 -0
- package/dist/pih-esm-pathology-app.js +0 -2
- package/dist/pih-esm-pathology-app.js.buildmanifest.json +0 -228
- package/dist/pih-esm-pathology-app.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pih/esm-pathology-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "A microfrontend pathology OpenMRS",
|
|
6
6
|
"browser": "dist/pih-esm-pathology-app.js",
|
|
7
7
|
"main": "src/index.ts",
|
|
8
8
|
"source": true,
|
|
9
9
|
"scripts": {
|
|
10
|
-
"start": "openmrs develop --backend http://
|
|
10
|
+
"start": "openmrs develop --backend http://imb.pih-emr.org:8096",
|
|
11
11
|
"serve": "webpack serve --mode development",
|
|
12
12
|
"build": "webpack --mode production",
|
|
13
13
|
"analyze": "webpack --mode=production --env.analyze=true",
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Font
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import {
|
|
3
|
+
Document,
|
|
4
|
+
Page,
|
|
5
|
+
Text,
|
|
6
|
+
Image,
|
|
7
|
+
View,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
Font,
|
|
10
|
+
} from "@react-pdf/renderer";
|
|
11
|
+
import ButaroLogo from "../images/ButaroHospitalLogo.gif";
|
|
12
|
+
import GeorgiaFontBold from "../Fonts/georgia/georgia-bold.ttf";
|
|
13
|
+
import GeorgiaFont from "../Fonts/georgia/Georgia.ttf";
|
|
14
14
|
|
|
15
|
+
Font.register({ family: "GeorgiaBold", src: GeorgiaFontBold });
|
|
16
|
+
Font.register({ family: "Georgia", src: GeorgiaFont });
|
|
15
17
|
|
|
16
18
|
// Create styles
|
|
17
19
|
const styles = StyleSheet.create({
|
|
@@ -25,232 +27,270 @@ const styles = StyleSheet.create({
|
|
|
25
27
|
},
|
|
26
28
|
textLabels: {
|
|
27
29
|
padding: 7,
|
|
28
|
-
fontFamily:"GeorgiaBold",
|
|
30
|
+
fontFamily: "GeorgiaBold",
|
|
29
31
|
fontSize: 16,
|
|
30
|
-
fontWeight:
|
|
31
|
-
paddingBottom:30,
|
|
32
|
+
fontWeight: "bold",
|
|
33
|
+
paddingBottom: 30,
|
|
32
34
|
},
|
|
33
35
|
sentenceLabels: {
|
|
34
36
|
paddingTop: 7,
|
|
35
|
-
fontFamily:"GeorgiaBold",
|
|
37
|
+
fontFamily: "GeorgiaBold",
|
|
36
38
|
fontSize: 16,
|
|
37
|
-
fontWeight:
|
|
38
|
-
paddingBottom:3,
|
|
39
|
+
fontWeight: "bold",
|
|
40
|
+
paddingBottom: 3,
|
|
39
41
|
},
|
|
40
42
|
textAnswers: {
|
|
41
43
|
margin: 10,
|
|
42
44
|
padding: 20,
|
|
43
|
-
fontFamily:"Georgia",
|
|
45
|
+
fontFamily: "Georgia",
|
|
44
46
|
fontSize: 14,
|
|
45
47
|
},
|
|
46
48
|
sentenceAnswers: {
|
|
47
49
|
marginBottom: 10,
|
|
48
50
|
paddingBottom: 20,
|
|
49
|
-
fontFamily:"Georgia",
|
|
51
|
+
fontFamily: "Georgia",
|
|
50
52
|
fontSize: 14,
|
|
51
53
|
},
|
|
52
54
|
logo: {
|
|
53
55
|
width: 61,
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
+
},
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
// Create Document Component
|
|
59
60
|
const MyDocument = (props) => (
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
<Document
|
|
62
|
+
title={`Pathology report
|
|
62
63
|
${props.encounterInfo.family_name}
|
|
63
64
|
${props.encounterInfo.given_name}
|
|
64
65
|
${props.encounterInfo.middle_name} `}
|
|
65
66
|
>
|
|
66
67
|
<Page size="A4" style={styles.page}>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
<Text style={{
|
|
71
|
-
|
|
72
|
-
<Text
|
|
73
|
-
Lab phone number:
|
|
74
|
-
</Text>
|
|
75
|
-
<Text>{" "}{" "}0784433618</Text>
|
|
68
|
+
<View style={styles.section}>
|
|
69
|
+
<Image style={styles.logo} src={ButaroLogo} />
|
|
70
|
+
<Text style={{ fontSize: 8 }}>Butaro Hospital</Text>
|
|
71
|
+
<Text style={{ position: "absolute", top: 0, left: 300, width: 300 }}>
|
|
72
|
+
<Text style={styles.textAnswers}>Lab phone number:</Text>
|
|
73
|
+
<Text> 0784433618</Text>
|
|
76
74
|
</Text>
|
|
77
|
-
<Text style={{ position: "absolute",top: 15,left: 300,width: 300 }}>
|
|
78
|
-
<Text style={styles.textAnswers}>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
<Text style={{ position: "absolute", top: 15, left: 300, width: 300 }}>
|
|
76
|
+
<Text style={styles.textAnswers}>Accession number:</Text>
|
|
77
|
+
<Text>
|
|
78
|
+
{" "}
|
|
79
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
80
|
+
(obser) =>
|
|
81
|
+
obser.concept.uuid == props.config.AccessionNumberconceptUUID &&
|
|
82
|
+
obser.value
|
|
83
|
+
)}
|
|
84
84
|
</Text>
|
|
85
85
|
</Text>
|
|
86
|
-
<Text
|
|
87
|
-
|
|
86
|
+
<Text
|
|
87
|
+
style={{
|
|
88
|
+
borderBottom: "1px",
|
|
89
|
+
textAlign: "center",
|
|
90
|
+
fontWeight: 1500,
|
|
91
|
+
marginBottom: 30,
|
|
92
|
+
fontFamily: "GeorgiaBold",
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
Pathology Report
|
|
88
96
|
</Text>
|
|
89
|
-
<Text style={{ paddingBottom: 10 }}
|
|
90
|
-
<Text style={styles.textAnswers}>
|
|
91
|
-
Patient Name:
|
|
92
|
-
</Text>
|
|
97
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
98
|
+
<Text style={styles.textAnswers}>Patient Name:</Text>
|
|
93
99
|
<Text style={styles.textAnswers}>
|
|
94
|
-
|
|
95
|
-
{props.encounterInfo.family_name} {" "}
|
|
96
|
-
{props.encounterInfo.
|
|
97
|
-
{props.encounterInfo.middle_name}
|
|
100
|
+
{" "}
|
|
101
|
+
{props.encounterInfo.family_name} {props.encounterInfo.given_name}{" "}
|
|
102
|
+
{props.encounterInfo.middle_name}
|
|
98
103
|
</Text>
|
|
99
|
-
|
|
100
104
|
</Text>
|
|
101
|
-
<Text
|
|
105
|
+
<Text
|
|
106
|
+
style={{
|
|
107
|
+
paddingBottom: 10,
|
|
108
|
+
position: "absolute",
|
|
109
|
+
top: 140,
|
|
110
|
+
left: 335,
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<Text style={styles.textAnswers}>Surgery Date:</Text>
|
|
102
114
|
<Text style={styles.textAnswers}>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
{" "}
|
|
116
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
117
|
+
(obser) =>
|
|
118
|
+
obser.concept.uuid ==
|
|
119
|
+
props.config.DateBiopsySpecimenTakenconceptUUID &&
|
|
120
|
+
new Date(obser.value).toLocaleString(
|
|
121
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
122
|
+
{ day: "numeric", month: "numeric", year: "numeric" }
|
|
123
|
+
)
|
|
124
|
+
)}
|
|
111
125
|
</Text>
|
|
112
|
-
|
|
113
126
|
</Text>
|
|
114
|
-
<Text style={{ paddingBottom: 10 }}
|
|
127
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
128
|
+
<Text style={styles.textAnswers}>Patient Birthdate:</Text>
|
|
115
129
|
<Text style={styles.textAnswers}>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
new Date(props.encounterInfo.personBirthdate)
|
|
122
|
-
.toLocaleString(["en-GB","en-US","en","fr-RW"],{day: 'numeric',month: 'numeric',year: 'numeric'})
|
|
123
|
-
}
|
|
130
|
+
{" "}
|
|
131
|
+
{new Date(props.encounterInfo.personBirthdate).toLocaleString(
|
|
132
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
133
|
+
{ day: "numeric", month: "numeric", year: "numeric" }
|
|
134
|
+
)}
|
|
124
135
|
</Text>
|
|
125
|
-
|
|
126
136
|
</Text>
|
|
127
|
-
<Text
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
<Text
|
|
138
|
+
style={{
|
|
139
|
+
paddingBottom: 10,
|
|
140
|
+
position: "absolute",
|
|
141
|
+
top: 168,
|
|
142
|
+
left: 335,
|
|
143
|
+
width: 200,
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
<Text style={styles.textAnswers}>Specimen Reception Date:</Text>
|
|
131
147
|
<Text style={styles.textAnswers}>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
148
|
+
{" "}
|
|
149
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
150
|
+
(obser) =>
|
|
151
|
+
obser.concept.uuid ==
|
|
152
|
+
props.config.SpecimenSubmissionDateconceptUUID &&
|
|
153
|
+
new Date(obser.value).toLocaleString(
|
|
154
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
155
|
+
{ day: "numeric", month: "numeric", year: "numeric" }
|
|
156
|
+
)
|
|
157
|
+
)}
|
|
137
158
|
</Text>
|
|
138
159
|
</Text>
|
|
139
|
-
<Text style={{ paddingBottom: 10,borderBottom:
|
|
160
|
+
<Text style={{ paddingBottom: 10, borderBottom: "1px" }}>
|
|
161
|
+
<Text style={styles.textAnswers}>Patient Gender:</Text>
|
|
140
162
|
<Text style={styles.textAnswers}>
|
|
141
|
-
|
|
142
|
-
</Text>
|
|
143
|
-
<Text style={styles.textAnswers}>
|
|
144
|
-
{" "}{" "}
|
|
163
|
+
{" "}
|
|
145
164
|
{props.encounterInfo.personGender}
|
|
146
165
|
</Text>
|
|
147
|
-
|
|
148
166
|
</Text>
|
|
149
|
-
<Text
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
167
|
+
<Text
|
|
168
|
+
style={{
|
|
169
|
+
paddingBottom: 10,
|
|
170
|
+
position: "absolute",
|
|
171
|
+
top: 200,
|
|
172
|
+
left: 335,
|
|
173
|
+
width: 250,
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<Text style={styles.textAnswers}>Signout Date:</Text>
|
|
153
177
|
<Text style={styles.textAnswers}>
|
|
154
|
-
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
178
|
+
{" "}
|
|
179
|
+
{new Date(
|
|
180
|
+
props.encounterInfo.resultsEncounter.encounterDatetime
|
|
181
|
+
).toLocaleString(["en-GB", "en-US", "en", "fr-RW"], {
|
|
182
|
+
day: "numeric",
|
|
183
|
+
month: "numeric",
|
|
184
|
+
year: "numeric",
|
|
185
|
+
})}
|
|
159
186
|
</Text>
|
|
160
187
|
</Text>
|
|
161
|
-
|
|
162
|
-
<Text style={{
|
|
163
|
-
<Text style={styles.textLabels}>
|
|
164
|
-
Sending Physician:
|
|
165
|
-
</Text>
|
|
188
|
+
|
|
189
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
190
|
+
<Text style={styles.textLabels}>Sending Physician:</Text>
|
|
166
191
|
<Text style={styles.textAnswers}>
|
|
167
|
-
|
|
168
|
-
|
|
192
|
+
{" "}
|
|
193
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
194
|
+
(obser) =>
|
|
195
|
+
obser.concept.uuid ==
|
|
196
|
+
props.config.SendingPhysicianconceptUUID && obser.value
|
|
197
|
+
)}
|
|
169
198
|
</Text>
|
|
170
199
|
</Text>
|
|
171
|
-
<Text style={{
|
|
172
|
-
<Text style={styles.textLabels}>
|
|
173
|
-
Sending Facility:
|
|
174
|
-
</Text>
|
|
200
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
201
|
+
<Text style={styles.textLabels}>Sending Facility:</Text>
|
|
175
202
|
<Text style={styles.textAnswers}>
|
|
176
|
-
|
|
177
|
-
|
|
203
|
+
{" "}
|
|
204
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
205
|
+
(obser) =>
|
|
206
|
+
obser.concept.uuid ==
|
|
207
|
+
props.config.OtherBiopsyLocationconceptUUID && obser.value
|
|
208
|
+
)}
|
|
178
209
|
</Text>
|
|
179
210
|
</Text>
|
|
180
|
-
<Text style={{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
211
|
+
<Text style={{ paddingBottom: 10, fontFamily: "Georgia" }}>
|
|
212
|
+
Anatomical location:
|
|
213
|
+
</Text>
|
|
214
|
+
<Text style={{ paddingBottom: 10, paddingLeft: 10 }}>
|
|
215
|
+
<Text style={styles.textLabels}>i.System:</Text>
|
|
185
216
|
<Text style={styles.textAnswers}>
|
|
186
|
-
|
|
187
|
-
|
|
217
|
+
{" "}
|
|
218
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
219
|
+
(obser) =>
|
|
220
|
+
obser.concept.uuid == props.config.OrganSystemconceptUUID &&
|
|
221
|
+
obser.value.name.display + ", "
|
|
222
|
+
)}
|
|
188
223
|
</Text>
|
|
189
224
|
</Text>
|
|
190
|
-
<Text style={{
|
|
191
|
-
<Text style={styles.textLabels}>
|
|
192
|
-
ii.Organ:
|
|
193
|
-
</Text>
|
|
225
|
+
<Text style={{ paddingBottom: 10, paddingLeft: 10 }}>
|
|
226
|
+
<Text style={styles.textLabels}>ii.Organ:</Text>
|
|
194
227
|
<Text style={styles.textAnswers}>
|
|
195
|
-
|
|
196
|
-
|
|
228
|
+
{" "}
|
|
229
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
230
|
+
(obser) =>
|
|
231
|
+
obser.concept.uuid == props.config.OrganconceptUUID &&
|
|
232
|
+
obser.value.name.display + ", "
|
|
233
|
+
)}
|
|
197
234
|
</Text>
|
|
198
235
|
</Text>
|
|
199
|
-
<Text style={{
|
|
200
|
-
<Text style={styles.textLabels}>
|
|
201
|
-
iii.Detail:
|
|
202
|
-
</Text>
|
|
236
|
+
<Text style={{ paddingBottom: 10, paddingLeft: 10 }}>
|
|
237
|
+
<Text style={styles.textLabels}>iii.Detail:</Text>
|
|
203
238
|
<Text style={styles.textAnswers}>
|
|
204
|
-
|
|
205
|
-
|
|
239
|
+
{" "}
|
|
240
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
241
|
+
(obser) =>
|
|
242
|
+
obser.concept.uuid == props.config.SpecimenDetailconceptUUID &&
|
|
243
|
+
obser.value
|
|
244
|
+
)}
|
|
206
245
|
</Text>
|
|
207
246
|
</Text>
|
|
208
|
-
<Text style={{
|
|
209
|
-
<Text style={styles.textLabels}>
|
|
210
|
-
Procedure type:
|
|
211
|
-
</Text>
|
|
247
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
248
|
+
<Text style={styles.textLabels}>Procedure type:</Text>
|
|
212
249
|
<Text style={styles.textAnswers}>
|
|
213
|
-
|
|
214
|
-
|
|
250
|
+
{" "}
|
|
251
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
252
|
+
(obser) =>
|
|
253
|
+
obser.concept.uuid ==
|
|
254
|
+
props.config.OtherTestsOrProceduresconceptUUID && obser.value
|
|
255
|
+
)}
|
|
215
256
|
</Text>
|
|
216
257
|
</Text>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
258
|
+
<Text style={[styles.sentenceLabels]}>Gross Description:</Text>
|
|
259
|
+
<Text style={[styles.sentenceAnswers]}>
|
|
260
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
261
|
+
(obser) =>
|
|
262
|
+
obser.concept.uuid == props.config.GrossDescriptionconceptUUID &&
|
|
263
|
+
obser.value
|
|
264
|
+
)}
|
|
265
|
+
</Text>
|
|
266
|
+
<Text style={styles.sentenceLabels}>Microscopic Examination:</Text>
|
|
267
|
+
<Text style={styles.sentenceAnswers}>
|
|
268
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
269
|
+
(obser) =>
|
|
270
|
+
obser.concept.uuid ==
|
|
271
|
+
props.config.MacroscopicExaminationconceptUUID && obser.value
|
|
272
|
+
)}
|
|
273
|
+
</Text>
|
|
274
|
+
<Text style={styles.sentenceLabels}>Conclusion:</Text>
|
|
275
|
+
<Text style={styles.sentenceAnswers}>
|
|
276
|
+
{props.encounterInfo.resultsEncounter.obs.map(
|
|
277
|
+
(obser) =>
|
|
278
|
+
obser.concept.uuid ==
|
|
279
|
+
props.config.COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID &&
|
|
280
|
+
obser.value
|
|
281
|
+
)}
|
|
282
|
+
</Text>
|
|
240
283
|
|
|
241
|
-
|
|
242
|
-
<Text style={styles.textLabels}>
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
<Text style= {[styles.textAnswers, { fontWeight: 'bold' }]}>
|
|
246
|
-
{" "}{" "}
|
|
284
|
+
<Text style={{ paddingBottom: 10 }}>
|
|
285
|
+
<Text style={styles.textLabels}>Validated by pathologist:</Text>
|
|
286
|
+
<Text style={[styles.textAnswers, { fontWeight: "bold" }]}>
|
|
287
|
+
{" "}
|
|
247
288
|
{props.encounterInfo.approvedBy}
|
|
248
289
|
</Text>
|
|
249
290
|
</Text>
|
|
250
|
-
</View>
|
|
291
|
+
</View>
|
|
251
292
|
</Page>
|
|
252
293
|
</Document>
|
|
253
294
|
);
|
|
254
295
|
|
|
255
296
|
export default MyDocument;
|
|
256
|
-
|
|
@@ -24,8 +24,6 @@ import {
|
|
|
24
24
|
postReferralStatusChangeObs,
|
|
25
25
|
updateReferralStatusChangeObs,
|
|
26
26
|
EncounterResult,
|
|
27
|
-
// postApproval,
|
|
28
|
-
// voidApprovalObs,
|
|
29
27
|
getUser,
|
|
30
28
|
Concept,
|
|
31
29
|
getEncounter,
|
|
@@ -109,9 +107,7 @@ const ReportComponent = () => {
|
|
|
109
107
|
getEncounters(
|
|
110
108
|
config.healthCenterAttrTypeUUID,
|
|
111
109
|
config.pathologyFullAllowedLocationUUID
|
|
112
|
-
).then(
|
|
113
|
-
setEncountersList
|
|
114
|
-
);
|
|
110
|
+
).then(setEncountersList);
|
|
115
111
|
}, []);
|
|
116
112
|
|
|
117
113
|
const filteredEncList = encountersList
|
|
@@ -148,8 +144,6 @@ const ReportComponent = () => {
|
|
|
148
144
|
|
|
149
145
|
const rows = filteredEncList.map((encounterInfo) => {
|
|
150
146
|
return {
|
|
151
|
-
// rows.push({
|
|
152
|
-
// patientLink: <a href={`/openmrs/patientDashboard.form?patientId=${encounterInfo.personId}`} >Link</a>,
|
|
153
147
|
id: encounterInfo.encounterId,
|
|
154
148
|
patientNames: (
|
|
155
149
|
<a
|
|
@@ -202,8 +196,10 @@ const ReportComponent = () => {
|
|
|
202
196
|
))}
|
|
203
197
|
</select>
|
|
204
198
|
),
|
|
205
|
-
dateOfRequest: new Date(encounterInfo.encounterDatetime)
|
|
206
|
-
|
|
199
|
+
dateOfRequest: new Date(encounterInfo.encounterDatetime).toLocaleString(
|
|
200
|
+
["en-GB", "en-US", "en", "fr-RW"],
|
|
201
|
+
{ day: "numeric", month: "numeric", year: "numeric" }
|
|
202
|
+
),
|
|
207
203
|
referralStatus: (
|
|
208
204
|
<select
|
|
209
205
|
onChange={(e) =>
|
|
@@ -259,18 +255,19 @@ const ReportComponent = () => {
|
|
|
259
255
|
</a>
|
|
260
256
|
)
|
|
261
257
|
),
|
|
262
|
-
PDFReport:
|
|
263
|
-
encounterInfo.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
258
|
+
PDFReport: encounterInfo.resultsEncounterId &&
|
|
259
|
+
encounterInfo.approvedBy && (
|
|
260
|
+
<PDFDownloadLink
|
|
261
|
+
document={
|
|
262
|
+
<MyDocument encounterInfo={encounterInfo} config={config} />
|
|
263
|
+
}
|
|
264
|
+
fileName="Pathology Report"
|
|
265
|
+
>
|
|
266
|
+
{({ loading }) =>
|
|
267
|
+
loading ? "loading..." : <button>Download</button>
|
|
268
|
+
}
|
|
269
|
+
</PDFDownloadLink>
|
|
270
|
+
),
|
|
274
271
|
};
|
|
275
272
|
});
|
|
276
273
|
|
|
@@ -300,14 +297,12 @@ const ReportComponent = () => {
|
|
|
300
297
|
);
|
|
301
298
|
tempEncList[encIndex].sampleDropoffObs = "";
|
|
302
299
|
tempEncList[encIndex].sampleDropoffObsUuid = "";
|
|
303
|
-
|
|
304
300
|
setEncountersList(tempEncList);
|
|
305
301
|
}
|
|
306
302
|
});
|
|
307
303
|
}
|
|
308
304
|
};
|
|
309
305
|
|
|
310
|
-
|
|
311
306
|
const sampleStatusChange = (
|
|
312
307
|
newStatus: { uuid: string; display: string },
|
|
313
308
|
encounterInfo
|
|
@@ -397,7 +392,6 @@ const ReportComponent = () => {
|
|
|
397
392
|
});
|
|
398
393
|
}
|
|
399
394
|
};
|
|
400
|
-
|
|
401
395
|
|
|
402
396
|
return (
|
|
403
397
|
<div>
|
|
@@ -462,7 +456,7 @@ const ReportComponent = () => {
|
|
|
462
456
|
onChange={(e) => setPatientName(e.target.value)}
|
|
463
457
|
/>
|
|
464
458
|
</div>
|
|
465
|
-
{console.log(
|
|
459
|
+
{console.log(encountersList)}
|
|
466
460
|
<div className={styles.tableContainer}>
|
|
467
461
|
<DataTable rows={rows} headers={headers}>
|
|
468
462
|
{({ rows, headers, getTableProps, getHeaderProps, getRowProps }) => (
|
|
@@ -489,15 +483,7 @@ const ReportComponent = () => {
|
|
|
489
483
|
)}
|
|
490
484
|
</DataTable>
|
|
491
485
|
</div>
|
|
492
|
-
<div>
|
|
493
|
-
{/* <PDFViewer>
|
|
494
|
-
<MyDocument />
|
|
495
|
-
</PDFViewer> */}
|
|
496
|
-
{/* <PDFDownloadLink document={<MyDocument />} fileName="Pathology Report">
|
|
497
|
-
{({loading}) => (loading ? 'loading...' : <button>Download</button>)}
|
|
498
|
-
</PDFDownloadLink> */}
|
|
499
|
-
|
|
500
|
-
</div>
|
|
486
|
+
<div></div>
|
|
501
487
|
</div>
|
|
502
488
|
);
|
|
503
489
|
};
|
|
Binary file
|