@pih/esm-pathology-app 1.0.7 → 1.1.1-pre.22

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 (76) hide show
  1. package/.turbo/turbo-build.log +31 -0
  2. package/__mocks__/react-i18next.js +17 -16
  3. package/dist/39.js +2 -0
  4. package/dist/39.js.map +1 -0
  5. package/dist/574.js +1 -1
  6. package/dist/784.js +3 -0
  7. package/dist/{294.js.LICENSE.txt → 784.js.LICENSE.txt} +0 -0
  8. package/dist/784.js.map +1 -0
  9. package/dist/858.js +3 -0
  10. package/dist/858.js.LICENSE.txt +1 -0
  11. package/dist/858.js.map +1 -0
  12. package/dist/862.js +2 -0
  13. package/dist/862.js.map +1 -0
  14. package/dist/pih-esm-pathology-app.js +1 -2
  15. package/dist/pih-esm-pathology-app.js.buildmanifest.json +38 -98
  16. package/dist/pih-esm-pathology-app.js.map +1 -1
  17. package/dist/pih-esm-pathology-app.old +2 -0
  18. package/jest.config.json +2 -3
  19. package/package.json +10 -58
  20. package/src/Pathology-getter/Pathology-encounter-getter-resource.ts +15 -0
  21. package/src/Pathology-getter/Pathology-patient-encounters-getter-resource.ts +15 -0
  22. package/src/Pathology-getter/Pathology-patients-getter-resource.ts +12 -0
  23. package/src/config-schema.ts +22 -163
  24. package/src/declarations.d.tsx +1 -3
  25. package/src/pathology-report/ReportComponent.css +17 -39
  26. package/src/pathology-report/ReportComponent.tsx +38 -475
  27. package/src/pathology-report/TableRow.tsx +24 -0
  28. package/src/pathology.test.tsx +32 -0
  29. package/tsconfig.json +1 -19
  30. package/webpack.config.js +1 -30
  31. package/.babelrc +0 -10
  32. package/.eslintignore +0 -1
  33. package/.eslintrc +0 -5
  34. package/.gitattributes +0 -1
  35. package/.husky/pre-commit +0 -7
  36. package/.prettierignore +0 -2
  37. package/README.md +0 -4
  38. package/babel.config.json +0 -8
  39. package/dist/00ebb57bb20c59433e84.gif +0 -0
  40. package/dist/16.js +0 -3
  41. package/dist/16.js.LICENSE.txt +0 -1
  42. package/dist/16.js.map +0 -1
  43. package/dist/24.js +0 -3
  44. package/dist/24.js.LICENSE.txt +0 -16
  45. package/dist/24.js.map +0 -1
  46. package/dist/248.js +0 -3
  47. package/dist/248.js.LICENSE.txt +0 -99
  48. package/dist/248.js.map +0 -1
  49. package/dist/294.js +0 -3
  50. package/dist/294.js.map +0 -1
  51. package/dist/5b8bb278fcab4da4972e.ttf +0 -0
  52. package/dist/861.js +0 -2
  53. package/dist/861.js.map +0 -1
  54. package/dist/867.js +0 -2
  55. package/dist/867.js.map +0 -1
  56. package/dist/976.js +0 -3
  57. package/dist/976.js.LICENSE.txt +0 -8
  58. package/dist/976.js.map +0 -1
  59. package/dist/a5fad24f075c978ac04b.ttf +0 -0
  60. package/src/Fonts/georgia/GEORGIA4.TTF +0 -0
  61. package/src/Fonts/georgia/Georgia Bold Italic font.ttf +0 -0
  62. package/src/Fonts/georgia/Georgia Regular font.ttf +0 -0
  63. package/src/Fonts/georgia/Georgia.ttf +0 -0
  64. package/src/Fonts/georgia/georgia bold italic.ttf +0 -0
  65. package/src/Fonts/georgia/georgia italic.ttf +0 -0
  66. package/src/Fonts/georgia/georgia-bold.ttf +0 -0
  67. package/src/Fonts/georgia/georgiab.ttf +0 -0
  68. package/src/Fonts/georgia/georgiai.ttf +0 -0
  69. package/src/Fonts/georgia/georgiaz.ttf +0 -0
  70. package/src/Fonts/georgia/seriffic.ttf +0 -0
  71. package/src/Fonts/georgia/sharefonts.net.txt +0 -1
  72. package/src/Print-to-PDF/Document-Component.tsx +0 -296
  73. package/src/images/ButaroHospitalLogo.gif +0 -0
  74. package/src/pathology-report/ReportComponent.resource.ts +0 -279
  75. package/src/pathology-report/ReportComponent.test.tsx +0 -251
  76. package/src/test.html +0 -0
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@pih/esm-pathology-app",
3
- "version": "1.0.7",
3
+ "version": "1.1.1-pre.22",
4
4
  "license": "MPL-2.0",
5
- "description": "A microfrontend pathology OpenMRS",
5
+ "description": "A pathology app for IMB 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://imb.pih-emr.org:8096",
11
- "serve": "webpack serve --mode development",
10
+ "start": "openmrs develop",
11
+ "serve": "webpack serve --mode=development",
12
12
  "build": "webpack --mode production",
13
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",
17
17
  "test": "jest --config jest.config.json",
18
- "coverage": "npm run test -- --coverage",
19
- "prepare": "husky install"
18
+ "verify": "concurrently 'yarn:lint' 'yarn:test' 'yarn:typescript'",
19
+ "coverage": "yarn test --coverage"
20
20
  },
21
21
  "browserslist": [
22
22
  "extends browserslist-config-openmrs"
@@ -38,70 +38,22 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@carbon/icons-react": "^10.33.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",
41
+ "carbon-components-react": "^7.36.0",
46
42
  "i18next": "^20.3.1",
47
43
  "lodash-es": "^4.17.21",
48
- "node-polyfill-webpack-plugin": "^1.1.4",
49
- "npm": "^7.24.2",
50
- "process": "^0.11.10",
51
44
  "react": "^16.13.1",
52
45
  "react-dom": "^16.14.0",
53
46
  "react-i18next": "^11.7.0",
54
47
  "react-router-dom": "^5.2.0",
55
- "rxjs": "^6.5.4",
56
- "stream-browserify": "^3.0.0",
57
- "systemjs-webpack-interop": "^2.3.7",
58
- "util": "^0.12.4"
48
+ "rxjs": "^6.5.4"
59
49
  },
60
50
  "peerDependencies": {
61
- "@openmrs/esm-framework": "3.x",
51
+ "@openmrs/esm-framework": "^3.14.0-pre",
62
52
  "carbon-components": "^10.36.0",
63
53
  "carbon-icons": "^7.0.7",
64
54
  "react": "^16.13.1",
65
55
  "react-i18next": "^11.7.0",
66
56
  "rxjs": "^6.5.4"
67
57
  },
68
- "devDependencies": {
69
- "@babel/core": "^7.14.3",
70
- "@babel/plugin-proposal-class-properties": "^7.13.0",
71
- "@babel/preset-env": "^7.14.4",
72
- "@babel/preset-react": "^7.13.13",
73
- "@babel/preset-typescript": "^7.13.0",
74
- "@babel/runtime": "^7.14.0",
75
- "@openmrs/esm-framework": "^3.1.15-pre.791",
76
- "@testing-library/dom": "^7.31.2",
77
- "@testing-library/jest-dom": "^5.13.0",
78
- "@testing-library/react": "^11.2.7",
79
- "@testing-library/user-event": "^13.1.9",
80
- "@types/carbon-components-react": "^7.34.0",
81
- "@types/carbon__icons-react": "^10.31.0",
82
- "@types/jest": "^26.0.23",
83
- "@types/react": "^17.0.9",
84
- "@types/react-dom": "^17.0.6",
85
- "@types/react-router": "^5.1.14",
86
- "@types/react-router-dom": "^5.1.7",
87
- "@types/webpack-env": "^1.16.0",
88
- "@typescript-eslint/parser": "^4.26.0",
89
- "babel-eslint": "^10.1.0",
90
- "babel-jest": "^27.0.2",
91
- "carbon-components-react": "^7.48.1",
92
- "concurrently": "^6.2.0",
93
- "eslint": "^7.27.0",
94
- "eslint-config-prettier": "^8.3.0",
95
- "eslint-config-ts-react-important-stuff": "^3.0.0",
96
- "eslint-plugin-prettier": "^3.4.0",
97
- "husky": "^6.0.0",
98
- "identity-obj-proxy": "^3.0.0",
99
- "jest": "^27.0.4",
100
- "jest-cli": "^27.0.4",
101
- "openmrs": "^3.1.15-pre.791",
102
- "prettier": "^2.3.0",
103
- "pretty-quick": "^3.1.0",
104
- "typescript": "^4.3.2",
105
- "webpack": "^5.66.0"
106
- }
58
+ "gitHead": "f507819a1d7d8f5ddff15e248e936774aeee6a1b"
107
59
  }
@@ -0,0 +1,15 @@
1
+ import { openmrsFetch } from "@openmrs/esm-framework";
2
+
3
+ async function getEncounter(encounterUUID) {
4
+ const searchEncounters = await openmrsFetch(
5
+ `/ws/rest/v1/encounter/${encounterUUID}`,
6
+ {
7
+ method: "GET",
8
+ }
9
+ );
10
+ // const data = await searchPatientEncounters.json();
11
+ // console.log("------------------" + data);
12
+ return searchEncounters;
13
+ }
14
+
15
+ export default getEncounter;
@@ -0,0 +1,15 @@
1
+ import { openmrsFetch } from "@openmrs/esm-framework";
2
+
3
+ async function getPatientEncounters(patientuuid) {
4
+ const searchPatientEncounters = await openmrsFetch(
5
+ "/ws/rest/v1/encounter?patient=c604dabc-2700-102b-80cb-0017a47871b2",
6
+ {
7
+ method: "GET",
8
+ }
9
+ );
10
+ // const data = await searchPatientEncounters.json();
11
+ // console.log("------------------" + data);
12
+ return searchPatientEncounters;
13
+ }
14
+
15
+ export default getPatientEncounters;
@@ -0,0 +1,12 @@
1
+ // import { openmrsFetch } from '@openmrs/esm-framework';
2
+
3
+ // async function getPatients({location}){
4
+ // const searchPatientsResults = await openmrsFetch('/ws/rest/v1/patient?q=c604dabc-2700-102b-80cb-0017a47871b2',{
5
+ // method: 'GET',
6
+ // });
7
+ // const data = await searchResults.json();
8
+ // console.log("------------------" + data);
9
+ // return searchPatientsResults;
10
+ // }
11
+
12
+ // export default getPatients;
@@ -1,6 +1,12 @@
1
1
  import { Type, validator } from "@openmrs/esm-framework";
2
2
 
3
3
  /**
4
+ * This is the config schema. It expects a configuration object which
5
+ * looks like this:
6
+ *
7
+ * ```json
8
+ * { "casualGreeting": true, "whoToGreet": ["Mom"] }
9
+ * ```
4
10
  *
5
11
  * In OpenMRS Microfrontends, all config parameters are optional. Thus,
6
12
  * all elements must have a reasonable default. A good default is one
@@ -15,170 +21,23 @@ import { Type, validator } from "@openmrs/esm-framework";
15
21
  * https://openmrs.github.io/openmrs-esm-core/#/main/config?id=schema-reference
16
22
  */
17
23
  export const configSchema = {
18
- pathologyEncTypeUUID: {
19
- _type: Type.String,
20
- _default: "70f18a24-92ec-4de5-acdc-7cae77414e32",
21
- _description:
22
- "This is to determine the UUID of the Pathology encounterType in the instance",
23
- },
24
- healthCenterAttrTypeUUID: {
25
- _type: Type.String,
26
- _default: "8d87236c-c2cc-11de-8d13-0010c6dffd0f",
27
- _description:
28
- "This is to determine the UUID of the Health center attribute type in the instance",
29
- },
30
- pathologyFullAllowedLocationUUID: {
31
- _type: Type.String,
32
- _default: "a62fd59a-6577-43e0-b39c-ba42ac8cfbc9",
33
- _description:
34
- "This is to determine the location allowed to view all other location data",
35
- },
36
- sampleStatusConceptUUID: {
37
- _type: Type.String,
38
- _default: "3adca58e-9334-4be5-9bd3-74f7bbf82776",
39
- _description:
40
- "This is to determine the UUID of the sample status concept in the instance",
41
- },
42
- referralStatusConceptUUID: {
43
- _type: Type.String,
44
- _default: "5a7a931f-97b8-4d59-b0de-3a83603aaad9",
45
- _description:
46
- "This is to determine the UUID of the referral status concept in the instance",
47
- },
48
- sampleDropOffconceptUUID: {
49
- _type: Type.String,
50
- _default: "dc288e6c-84a4-4fd3-9136-ef9e13961b1e",
51
- _description:
52
- "This is to determine the UUID of the sample drop off concept in the instance",
53
- },
54
- yesConceptUUID: {
55
- _type: Type.String,
56
- _default: "3cd6f600-26fe-102b-80cb-0017a47871b2",
57
- _description:
58
- "This is to determine the UUID of the Yes concept in the instance",
59
- },
60
- yesConceptName: {
61
- _type: Type.String,
62
- _default: "YES",
63
- _description:
64
- "This is to determine the Name of the Yes concept in the instance",
65
- },
66
-
67
- pathologyResultsFromID: {
68
- _type: Type.Number,
69
- _default: 5613,
70
- _description:
71
- "This is to determine the ID of the pathology results form in the instance",
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
- },
24
+ // casualGreeting: {
25
+ // _type: Type.Boolean,
26
+ // _default: false,
27
+ // _description: 'Whether to use a casual greeting (or a formal one).',
28
+ // },
29
+ // whoToGreet: {
30
+ // _type: Type.Array,
31
+ // _default: ['World'],
32
+ // _description: 'Who should be greeted. Names will be separated by a comma and space.',
33
+ // _elements: {
34
+ // _type: Type.String,
35
+ // },
36
+ // _validators: [validator((v) => v.length > 0, 'At least one person must be greeted.')],
37
+ // },
157
38
  };
158
39
 
159
40
  export type Config = {
160
- pathologyEncTypeUUID: string;
161
- healthCenterAttrTypeUUID: string;
162
- pathologyFullAllowedLocationUUID: string;
163
- sampleStatusConceptUUID: string;
164
- referralStatusConceptUUID: string;
165
- sampleDropOffconceptUUID: string;
166
- yesConceptUUID: string;
167
- yesConceptName: string;
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;
41
+ // casualGreeting: boolean;
42
+ // whoToGreet: Array<String>;
184
43
  };
@@ -1,4 +1,2 @@
1
1
  declare module "*.css";
2
- declare module '*.png';
3
- declare module '*.gif';
4
- declare module '*.ttf';
2
+ declare module "*.scss";
@@ -1,39 +1,17 @@
1
- .tableContainer {
2
- height: 500px;
3
- overflow-x: auto;
4
- margin: 0 1rem;
5
- border: 2px solid lightgrey;
6
- border-radius: 0.25rem;
7
- }
8
-
9
- .filtersContainer {
10
- border-radius: 0.25rem;
11
- margin: 0 1rem;
12
- padding-top: 4%;
13
- }
14
-
15
- .dropdown {
16
- width: 10%;
17
- height: 2rem;
18
- background: transparent;
19
- border: 1px solid var(--omrs-color-ink-lowest-contrast);
20
- background-clip: padding-box;
21
- border-radius: 4px;
22
- margin: 1rem;
23
- }
24
- .dropdown:disabled {
25
- opacity: 0.8;
26
- background: lightgrey;
27
- cursor: not-allowed;
28
- }
29
- .dropdown:focus {
30
- border: 2px solid var(--omrs-color-interaction);
31
- outline: 0;
32
- }
33
- .textBox {
34
- background: transparent;
35
- border: 1px solid var(--omrs-color-ink-lowest-contrast);
36
- background-clip: padding-box;
37
- border-radius: 4px;
38
- margin: 1rem;
39
- }
1
+ .table {
2
+ width: 100%;
3
+ position: relative;
4
+ }
5
+
6
+ .tr {
7
+ border-bottom: 1px solid lightgrey;
8
+ line-height: 2rem;
9
+ }
10
+
11
+ .tr:nth-child(even) {
12
+ background-color: var(--omrs-color-bg-medium-contrast);
13
+ }
14
+
15
+ .table td {
16
+ padding: 0.25rem 0.5rem;
17
+ }