@pih/esm-pathology-app 1.0.3 → 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 CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@pih/esm-pathology-app",
3
- "version": "1.0.3",
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 https://imb.pih-emr.org:6464",
11
- "serve": "webpack serve --mode=development",
10
+ "start": "openmrs develop --backend http://imb.pih-emr.org:8096",
11
+ "serve": "webpack serve --mode development",
12
12
  "build": "webpack --mode production",
13
- "analyze": "webpack --mode=production --env analyze=true",
13
+ "analyze": "webpack --mode=production --env.analyze=true",
14
14
  "lint": "eslint src --ext js,jsx,ts,tsx",
15
15
  "prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
16
16
  "typescript": "tsc",
@@ -38,15 +38,24 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@carbon/icons-react": "^10.33.0",
41
- "carbon-components-react": "^7.36.0",
41
+ "@react-pdf/renderer": "^2.0.21",
42
+ "assert": "^2.0.0",
43
+ "browserify-zlib": "^0.2.0",
44
+ "buffer": "^6.0.3",
45
+ "carbon-components": "^10.36.0",
42
46
  "i18next": "^20.3.1",
43
47
  "lodash-es": "^4.17.21",
48
+ "node-polyfill-webpack-plugin": "^1.1.4",
49
+ "npm": "^7.24.2",
50
+ "process": "^0.11.10",
44
51
  "react": "^16.13.1",
45
52
  "react-dom": "^16.14.0",
46
53
  "react-i18next": "^11.7.0",
47
54
  "react-router-dom": "^5.2.0",
48
55
  "rxjs": "^6.5.4",
49
- "systemjs-webpack-interop": "^2.3.7"
56
+ "stream-browserify": "^3.0.0",
57
+ "systemjs-webpack-interop": "^2.3.7",
58
+ "util": "^0.12.4"
50
59
  },
51
60
  "peerDependencies": {
52
61
  "@openmrs/esm-framework": "3.x",
@@ -63,13 +72,13 @@
63
72
  "@babel/preset-react": "^7.13.13",
64
73
  "@babel/preset-typescript": "^7.13.0",
65
74
  "@babel/runtime": "^7.14.0",
66
- "@openmrs/esm-framework": "next",
75
+ "@openmrs/esm-framework": "^3.1.15-pre.791",
67
76
  "@testing-library/dom": "^7.31.2",
68
77
  "@testing-library/jest-dom": "^5.13.0",
69
78
  "@testing-library/react": "^11.2.7",
70
79
  "@testing-library/user-event": "^13.1.9",
71
- "@types/carbon__icons-react": "^10.31.0",
72
80
  "@types/carbon-components-react": "^7.34.0",
81
+ "@types/carbon__icons-react": "^10.31.0",
73
82
  "@types/jest": "^26.0.23",
74
83
  "@types/react": "^17.0.9",
75
84
  "@types/react-dom": "^17.0.6",
@@ -79,6 +88,7 @@
79
88
  "@typescript-eslint/parser": "^4.26.0",
80
89
  "babel-eslint": "^10.1.0",
81
90
  "babel-jest": "^27.0.2",
91
+ "carbon-components-react": "^7.48.1",
82
92
  "concurrently": "^6.2.0",
83
93
  "eslint": "^7.27.0",
84
94
  "eslint-config-prettier": "^8.3.0",
@@ -88,9 +98,10 @@
88
98
  "identity-obj-proxy": "^3.0.0",
89
99
  "jest": "^27.0.4",
90
100
  "jest-cli": "^27.0.4",
91
- "openmrs": "next",
101
+ "openmrs": "^3.1.15-pre.791",
92
102
  "prettier": "^2.3.0",
93
103
  "pretty-quick": "^3.1.0",
94
- "typescript": "^4.3.2"
104
+ "typescript": "^4.3.2",
105
+ "webpack": "^5.66.0"
95
106
  }
96
107
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ Free download fonts at http://sharefonts.net
@@ -0,0 +1,296 @@
1
+ import React from "react";
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
+
15
+ Font.register({ family: "GeorgiaBold", src: GeorgiaFontBold });
16
+ Font.register({ family: "Georgia", src: GeorgiaFont });
17
+
18
+ // Create styles
19
+ const styles = StyleSheet.create({
20
+ page: {
21
+ flexDirection: "row",
22
+ },
23
+ section: {
24
+ margin: 10,
25
+ padding: 20,
26
+ flexGrow: 1,
27
+ },
28
+ textLabels: {
29
+ padding: 7,
30
+ fontFamily: "GeorgiaBold",
31
+ fontSize: 16,
32
+ fontWeight: "bold",
33
+ paddingBottom: 30,
34
+ },
35
+ sentenceLabels: {
36
+ paddingTop: 7,
37
+ fontFamily: "GeorgiaBold",
38
+ fontSize: 16,
39
+ fontWeight: "bold",
40
+ paddingBottom: 3,
41
+ },
42
+ textAnswers: {
43
+ margin: 10,
44
+ padding: 20,
45
+ fontFamily: "Georgia",
46
+ fontSize: 14,
47
+ },
48
+ sentenceAnswers: {
49
+ marginBottom: 10,
50
+ paddingBottom: 20,
51
+ fontFamily: "Georgia",
52
+ fontSize: 14,
53
+ },
54
+ logo: {
55
+ width: 61,
56
+ },
57
+ });
58
+
59
+ // Create Document Component
60
+ const MyDocument = (props) => (
61
+ <Document
62
+ title={`Pathology report
63
+ ${props.encounterInfo.family_name}
64
+ ${props.encounterInfo.given_name}
65
+ ${props.encounterInfo.middle_name} `}
66
+ >
67
+ <Page size="A4" style={styles.page}>
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>
74
+ </Text>
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
+ </Text>
85
+ </Text>
86
+ <Text
87
+ style={{
88
+ borderBottom: "1px",
89
+ textAlign: "center",
90
+ fontWeight: 1500,
91
+ marginBottom: 30,
92
+ fontFamily: "GeorgiaBold",
93
+ }}
94
+ >
95
+ Pathology Report
96
+ </Text>
97
+ <Text style={{ paddingBottom: 10 }}>
98
+ <Text style={styles.textAnswers}>Patient Name:</Text>
99
+ <Text style={styles.textAnswers}>
100
+ {" "}
101
+ {props.encounterInfo.family_name} {props.encounterInfo.given_name}{" "}
102
+ {props.encounterInfo.middle_name}
103
+ </Text>
104
+ </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>
114
+ <Text style={styles.textAnswers}>
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
+ )}
125
+ </Text>
126
+ </Text>
127
+ <Text style={{ paddingBottom: 10 }}>
128
+ <Text style={styles.textAnswers}>Patient Birthdate:</Text>
129
+ <Text style={styles.textAnswers}>
130
+ {" "}
131
+ {new Date(props.encounterInfo.personBirthdate).toLocaleString(
132
+ ["en-GB", "en-US", "en", "fr-RW"],
133
+ { day: "numeric", month: "numeric", year: "numeric" }
134
+ )}
135
+ </Text>
136
+ </Text>
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>
147
+ <Text style={styles.textAnswers}>
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
+ )}
158
+ </Text>
159
+ </Text>
160
+ <Text style={{ paddingBottom: 10, borderBottom: "1px" }}>
161
+ <Text style={styles.textAnswers}>Patient Gender:</Text>
162
+ <Text style={styles.textAnswers}>
163
+ {" "}
164
+ {props.encounterInfo.personGender}
165
+ </Text>
166
+ </Text>
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>
177
+ <Text style={styles.textAnswers}>
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
+ })}
186
+ </Text>
187
+ </Text>
188
+
189
+ <Text style={{ paddingBottom: 10 }}>
190
+ <Text style={styles.textLabels}>Sending Physician:</Text>
191
+ <Text style={styles.textAnswers}>
192
+ {" "}
193
+ {props.encounterInfo.resultsEncounter.obs.map(
194
+ (obser) =>
195
+ obser.concept.uuid ==
196
+ props.config.SendingPhysicianconceptUUID && obser.value
197
+ )}
198
+ </Text>
199
+ </Text>
200
+ <Text style={{ paddingBottom: 10 }}>
201
+ <Text style={styles.textLabels}>Sending Facility:</Text>
202
+ <Text style={styles.textAnswers}>
203
+ {" "}
204
+ {props.encounterInfo.resultsEncounter.obs.map(
205
+ (obser) =>
206
+ obser.concept.uuid ==
207
+ props.config.OtherBiopsyLocationconceptUUID && obser.value
208
+ )}
209
+ </Text>
210
+ </Text>
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>
216
+ <Text style={styles.textAnswers}>
217
+ {" "}
218
+ {props.encounterInfo.resultsEncounter.obs.map(
219
+ (obser) =>
220
+ obser.concept.uuid == props.config.OrganSystemconceptUUID &&
221
+ obser.value.name.display + ", "
222
+ )}
223
+ </Text>
224
+ </Text>
225
+ <Text style={{ paddingBottom: 10, paddingLeft: 10 }}>
226
+ <Text style={styles.textLabels}>ii.Organ:</Text>
227
+ <Text style={styles.textAnswers}>
228
+ {" "}
229
+ {props.encounterInfo.resultsEncounter.obs.map(
230
+ (obser) =>
231
+ obser.concept.uuid == props.config.OrganconceptUUID &&
232
+ obser.value.name.display + ", "
233
+ )}
234
+ </Text>
235
+ </Text>
236
+ <Text style={{ paddingBottom: 10, paddingLeft: 10 }}>
237
+ <Text style={styles.textLabels}>iii.Detail:</Text>
238
+ <Text style={styles.textAnswers}>
239
+ {" "}
240
+ {props.encounterInfo.resultsEncounter.obs.map(
241
+ (obser) =>
242
+ obser.concept.uuid == props.config.SpecimenDetailconceptUUID &&
243
+ obser.value
244
+ )}
245
+ </Text>
246
+ </Text>
247
+ <Text style={{ paddingBottom: 10 }}>
248
+ <Text style={styles.textLabels}>Procedure type:</Text>
249
+ <Text style={styles.textAnswers}>
250
+ {" "}
251
+ {props.encounterInfo.resultsEncounter.obs.map(
252
+ (obser) =>
253
+ obser.concept.uuid ==
254
+ props.config.OtherTestsOrProceduresconceptUUID && obser.value
255
+ )}
256
+ </Text>
257
+ </Text>
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>
283
+
284
+ <Text style={{ paddingBottom: 10 }}>
285
+ <Text style={styles.textLabels}>Validated by pathologist:</Text>
286
+ <Text style={[styles.textAnswers, { fontWeight: "bold" }]}>
287
+ {" "}
288
+ {props.encounterInfo.approvedBy}
289
+ </Text>
290
+ </Text>
291
+ </View>
292
+ </Page>
293
+ </Document>
294
+ );
295
+
296
+ export default MyDocument;
@@ -17,7 +17,7 @@ import { Type, validator } from "@openmrs/esm-framework";
17
17
  export const configSchema = {
18
18
  pathologyEncTypeUUID: {
19
19
  _type: Type.String,
20
- _default: "4d911f5c-26fe-102b-80cb-0017a47871b2",
20
+ _default: "70f18a24-92ec-4de5-acdc-7cae77414e32",
21
21
  _description:
22
22
  "This is to determine the UUID of the Pathology encounterType in the instance",
23
23
  },
@@ -29,25 +29,25 @@ export const configSchema = {
29
29
  },
30
30
  pathologyFullAllowedLocationUUID: {
31
31
  _type: Type.String,
32
- _default: "38c4b94b-97a6-4f2c-bca6-c28a37cf60ed",
32
+ _default: "a62fd59a-6577-43e0-b39c-ba42ac8cfbc9",
33
33
  _description:
34
34
  "This is to determine the location allowed to view all other location data",
35
35
  },
36
36
  sampleStatusConceptUUID: {
37
37
  _type: Type.String,
38
- _default: "3ce163d8-26fe-102b-80cb-0017a47871b2",
38
+ _default: "3adca58e-9334-4be5-9bd3-74f7bbf82776",
39
39
  _description:
40
40
  "This is to determine the UUID of the sample status concept in the instance",
41
41
  },
42
42
  referralStatusConceptUUID: {
43
43
  _type: Type.String,
44
- _default: "3cd93302-26fe-102b-80cb-0017a47871b2",
44
+ _default: "5a7a931f-97b8-4d59-b0de-3a83603aaad9",
45
45
  _description:
46
46
  "This is to determine the UUID of the referral status concept in the instance",
47
47
  },
48
48
  sampleDropOffconceptUUID: {
49
49
  _type: Type.String,
50
- _default: "13662f27-9be5-4595-8bab-07b0e859d9f4",
50
+ _default: "dc288e6c-84a4-4fd3-9136-ef9e13961b1e",
51
51
  _description:
52
52
  "This is to determine the UUID of the sample drop off concept in the instance",
53
53
  },
@@ -66,10 +66,94 @@ export const configSchema = {
66
66
 
67
67
  pathologyResultsFromID: {
68
68
  _type: Type.Number,
69
- _default: 131,
69
+ _default: 5613,
70
70
  _description:
71
71
  "This is to determine the ID of the pathology results form in the instance",
72
72
  },
73
+ pathologyResultsApprovedconceptUUID: {
74
+ _type: Type.String,
75
+ _default: "1f7742f0-4571-44d8-a88b-8bc60dc11e29",
76
+ _description:
77
+ "This is to determine the pathology results approved concept uuid",
78
+ },
79
+ AccessionNumberconceptUUID: {
80
+ _type: Type.String,
81
+ _default: "0e466f59-8070-45b5-97d1-575ec5cfd85d",
82
+ _description:
83
+ "This is to determine the Accession Number concept uuid",
84
+ },
85
+ DateBiopsySpecimenTakenconceptUUID: {
86
+ _type: Type.String,
87
+ _default: "e0436a5b-dc19-4cb9-ac1b-acc005272c08",
88
+ _description:
89
+ "This is to determine the Date Biopsy Specimen Taken concept uuid",
90
+ },
91
+ SpecimenSubmissionDateconceptUUID: {
92
+ _type: Type.String,
93
+ _default: "3928b7fc-b3ae-40a5-846f-d480120b04f6",
94
+ _description:
95
+ "This is to determine the Specimen Submission Date concept uuid",
96
+ },
97
+ SendingPhysicianconceptUUID: {
98
+ _type: Type.String,
99
+ _default: "0a4a22db-0e82-4669-9aba-086d841505b5",
100
+ _description:
101
+ "This is to determine the Sending Physician concept uuid",
102
+ },
103
+ OtherBiopsyLocationconceptUUID: {
104
+ _type: Type.String,
105
+ _default: "7c4650ee-45d5-435a-b968-511ef127a016",
106
+ _description:
107
+ "This is to determine the Other Biopsy Location concept uuid",
108
+ },
109
+ OrganSystemconceptUUID: {
110
+ _type: Type.String,
111
+ _default: "b88f9524-6b39-41b3-9b3a-f9a7a4b08fed",
112
+ _description:
113
+ "This is to determine the Organ System concept uuid",
114
+ },
115
+ OrganconceptUUID: {
116
+ _type: Type.String,
117
+ _default: "488fe4a2-7903-41da-b21e-fb236a1ee356",
118
+ _description:
119
+ "This is to determine the Organ concept uuid",
120
+ },
121
+ SpecimenDetailconceptUUID: {
122
+ _type: Type.String,
123
+ _default: "e99170a5-f46b-490b-8fbb-bb9eacba3500",
124
+ _description:
125
+ "This is to determine the Specimen Detail concept uuid",
126
+ },
127
+ OtherTestsOrProceduresconceptUUID: {
128
+ _type: Type.String,
129
+ _default: "66ad3230-59b2-4232-821e-a9ae86819e03",
130
+ _description:
131
+ "This is to determine the Other tests or procedures concept uuid",
132
+ },
133
+ GrossDescriptionconceptUUID: {
134
+ _type: Type.String,
135
+ _default: "1e97a4d3-1691-4fb7-be78-18e526e82b0b",
136
+ _description:
137
+ "This is to determine the Gross Description concept uuid",
138
+ },
139
+ MacroscopicExaminationconceptUUID: {
140
+ _type: Type.String,
141
+ _default: "5d149510-0767-4da7-82cd-be406b34877d",
142
+ _description:
143
+ "This is to determine the Macroscopic Examination concept uuid",
144
+ },
145
+ COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID: {
146
+ _type: Type.String,
147
+ _default: "3cdc5938-26fe-102b-80cb-0017a47871b2",
148
+ _description:
149
+ "This is to determine the COMMENTS AT CONCLUSION OF EXAMINATION concept uuid",
150
+ },
151
+ CanregCodeconceptUUID: {
152
+ _type: Type.String,
153
+ _default: "16931672-e068-4ea8-a89c-2ee7dbc07ad1",
154
+ _description:
155
+ "This is to determine the Canreg Code concept uuid",
156
+ },
73
157
  };
74
158
 
75
159
  export type Config = {
@@ -82,4 +166,19 @@ export type Config = {
82
166
  yesConceptUUID: string;
83
167
  yesConceptName: string;
84
168
  pathologyResultsFromID: number;
169
+ pathologyResultsApprovedconceptUUID: string;
170
+
171
+ AccessionNumberconceptUUID: string;
172
+ DateBiopsySpecimenTakenconceptUUID: string;
173
+ SpecimenSubmissionDateconceptUUID: string;
174
+ SendingPhysicianconceptUUID: string;
175
+ OtherBiopsyLocationconceptUUID: string;
176
+ OrganSystemconceptUUID: string;
177
+ OrganconceptUUID: string;
178
+ SpecimenDetailconceptUUID: string;
179
+ OtherTestsOrProceduresconceptUUID: string;
180
+ GrossDescriptionconceptUUID: string;
181
+ MacroscopicExaminationconceptUUID: string;
182
+ COMMENTSATCONCLUSIONOFEXAMINATIONconceptUUID: string;
183
+ CanregCodeconceptUUID: string;
85
184
  };
@@ -1 +1,4 @@
1
1
  declare module "*.css";
2
+ declare module '*.png';
3
+ declare module '*.gif';
4
+ declare module '*.ttf';