@openmrs/esm-patient-search-app 3.0.2-pre.309 → 3.0.2-pre.310
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/60.js +1 -1
- package/dist/60.js.map +1 -1
- package/dist/745.js +1 -1
- package/dist/745.js.map +1 -1
- package/dist/openmrs-esm-patient-search-app.js.buildmanifest.json +6 -6
- package/package.json +2 -2
- package/src/config-schema.ts +5 -0
- package/src/patient-search/patient-search.resource.tsx +3 -2
- package/src/patient-search-icon/patient-search-icon.component.scss +3 -3
- package/src/patient-search-icon/patient-search-icon.component.tsx +5 -4
- package/src/patient-search-result/patient-search-result.component.tsx +2 -0
- package/src/types/index.ts +2 -0
package/dist/745.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(self.webpackChunk_openmrs_esm_patient_search_app=self.webpackChunk_openmrs_esm_patient_search_app||[]).push([[745],{7745:(e,t,n)=>{"use strict";n.r(t),n.d(t,{backendDependencies:()=>i,frontendDependencies:()=>p,importTranslation:()=>
|
|
1
|
+
(self.webpackChunk_openmrs_esm_patient_search_app=self.webpackChunk_openmrs_esm_patient_search_app||[]).push([[745],{7745:(e,t,n)=>{"use strict";n.r(t),n.d(t,{backendDependencies:()=>i,frontendDependencies:()=>p,importTranslation:()=>r,setupOpenMRS:()=>o});var a=n(9035);const s={search:{patientResultUrl:{_default:"${openmrsSpaBase}/patient/${patientUuid}/chart",_description:"Where clicking a patient result takes the user. Accepts template parameter ${patientUuid}",_validators:[a.validators.isUrlWithTemplateParameters(["patientUuid"])]}},includeDead:{_type:a.Type.Boolean,_default:!0,_description:"Whether to include dead patients in search results"}},r=n(3979),i={"webservices.rest":"^2.2.0"},p={"@openmrs/esm-framework":"^3.1.15-pre.861"};function o(){const e="@openmrs/esm-patient-search-app",t={featureName:"patient-search",moduleName:e};return(0,a.defineConfigSchema)(e,s),{extensions:[{id:"patient-search-icon",slot:"top-nav-actions-slot",order:0,load:(0,a.getAsyncLifecycle)((()=>Promise.all([n.e(852),n.e(902),n.e(60)]).then(n.bind(n,5238))),t)}]}}},3979:(e,t,n)=>{var a={"./en.json":[3574,574],"./es.json":[8319,319]};function s(e){if(!n.o(a,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],s=t[0];return n.e(t[1]).then((()=>n(s)))}s.keys=()=>Object.keys(a),s.id=3979,e.exports=s}}]);
|
|
2
2
|
//# sourceMappingURL=745.js.map
|
package/dist/745.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"745.js","mappings":"+QACO,MAAMA,EAAe,CAC1BC,OAAQ,CACNC,iBAAkB,CAChBC,SAAU,iDACVC,aAAc,4FACdC,YAAa,CAACC,EAAAA,WAAAA,4BAAuC,CAAC,
|
|
1
|
+
{"version":3,"file":"745.js","mappings":"+QACO,MAAMA,EAAe,CAC1BC,OAAQ,CACNC,iBAAkB,CAChBC,SAAU,iDACVC,aAAc,4FACdC,YAAa,CAACC,EAAAA,WAAAA,4BAAuC,CAAC,mBAG1DC,YAAa,CACXC,MAAOC,EAAAA,KAAAA,QACPN,UAAU,EACVC,aAAc,uDCTZM,EAAoBC,EAAAA,MAEpBC,EAAsB,CAC1B,mBAAoB,UAGhBC,EAAuB,CAC3B,yBAA0BC,mBAG5B,SAASC,IACP,MAAMC,EAAa,kCAEbC,EAAU,CACdC,YAAa,iBACbF,WAAAA,GAKF,OAFAG,EAAAA,EAAAA,oBAAmBH,EAAYhB,GAExB,CACLoB,WAAY,CACV,CACEC,GAAI,sBACJC,KAAM,uBACNC,MAAO,EACPC,MAAMC,EAAAA,EAAAA,oBAAkB,IAAM,+DAA+DR,Q,eC7BrG,IAAIS,EAAM,CACT,YAAa,CACZ,KACA,KAED,YAAa,CACZ,KACA,MAGF,SAASC,EAAoBC,GAC5B,IAAIC,EAAoBC,EAAEJ,EAAKE,GAC9B,OAAOG,QAAQC,UAAUC,MAAK,KAC7B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBP,EAAM,KAEjD,MADAM,EAAEE,KAAO,mBACHF,KAIR,IAAIG,EAAMX,EAAIE,GAAMP,EAAKgB,EAAI,GAC7B,OAAOR,EAAoBK,EAAEG,EAAI,IAAIJ,MAAK,IAClCJ,EAAoBR,KAG7BM,EAAoBW,KAAO,IAAOC,OAAOD,KAAKZ,GAC9CC,EAAoBN,GAAK,KACzBmB,EAAOC,QAAUd","sources":["webpack://@openmrs/esm-patient-search-app/./src/config-schema.ts","webpack://@openmrs/esm-patient-search-app/./src/index.ts","webpack://@openmrs/esm-patient-search-app//home/runner/work/openmrs-esm-patient-management/openmrs-esm-patient-management/packages/esm-patient-search-app/translations|lazy|nonrecursive|/.json$/"],"sourcesContent":["import { Type, validators } from '@openmrs/esm-framework';\nexport const configSchema = {\n search: {\n patientResultUrl: {\n _default: '${openmrsSpaBase}/patient/${patientUuid}/chart',\n _description: 'Where clicking a patient result takes the user. Accepts template parameter ${patientUuid}',\n _validators: [validators.isUrlWithTemplateParameters(['patientUuid'])],\n },\n },\n includeDead: {\n _type: Type.Boolean,\n _default: true,\n _description: 'Whether to include dead patients in search results',\n },\n};\n","import { defineConfigSchema, getAsyncLifecycle } from '@openmrs/esm-framework';\nimport { configSchema } from './config-schema';\n\nconst importTranslation = require.context('../translations', false, /.json$/, 'lazy');\n\nconst backendDependencies = {\n 'webservices.rest': '^2.2.0',\n};\n\nconst frontendDependencies = {\n '@openmrs/esm-framework': process.env.FRAMEWORK_VERSION,\n};\n\nfunction setupOpenMRS() {\n const moduleName = '@openmrs/esm-patient-search-app';\n\n const options = {\n featureName: 'patient-search',\n moduleName,\n };\n\n defineConfigSchema(moduleName, configSchema);\n\n return {\n extensions: [\n {\n id: 'patient-search-icon',\n slot: 'top-nav-actions-slot',\n order: 0,\n load: getAsyncLifecycle(() => import('./patient-search-icon/patient-search-icon.component'), options),\n },\n ],\n };\n}\n\nexport { backendDependencies, frontendDependencies, importTranslation, setupOpenMRS };\n","var map = {\n\t\"./en.json\": [\n\t\t3574,\n\t\t574\n\t],\n\t\"./es.json\": [\n\t\t8319,\n\t\t319\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(() => {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(() => {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = () => (Object.keys(map));\nwebpackAsyncContext.id = 3979;\nmodule.exports = webpackAsyncContext;"],"names":["configSchema","search","patientResultUrl","_default","_description","_validators","validators","includeDead","_type","Type","importTranslation","require","backendDependencies","frontendDependencies","process","setupOpenMRS","moduleName","options","featureName","defineConfigSchema","extensions","id","slot","order","load","getAsyncLifecycle","map","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","Error","code","ids","keys","Object","module","exports"],"sourceRoot":""}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"initial": false,
|
|
6
6
|
"entry": false,
|
|
7
7
|
"recorded": false,
|
|
8
|
-
"size":
|
|
8
|
+
"size": 184515,
|
|
9
9
|
"sizes": {
|
|
10
|
-
"javascript":
|
|
10
|
+
"javascript": 184431,
|
|
11
11
|
"consume-shared": 84
|
|
12
12
|
},
|
|
13
13
|
"names": [],
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"auxiliaryFiles": [
|
|
22
22
|
"60.js.map"
|
|
23
23
|
],
|
|
24
|
-
"hash": "
|
|
24
|
+
"hash": "d1a616751a03d596b0ea",
|
|
25
25
|
"childrenByOrder": {}
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -199,9 +199,9 @@
|
|
|
199
199
|
"initial": false,
|
|
200
200
|
"entry": false,
|
|
201
201
|
"recorded": false,
|
|
202
|
-
"size":
|
|
202
|
+
"size": 1636,
|
|
203
203
|
"sizes": {
|
|
204
|
-
"javascript":
|
|
204
|
+
"javascript": 1594,
|
|
205
205
|
"consume-shared": 42
|
|
206
206
|
},
|
|
207
207
|
"names": [],
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"auxiliaryFiles": [
|
|
216
216
|
"745.js.map"
|
|
217
217
|
],
|
|
218
|
-
"hash": "
|
|
218
|
+
"hash": "9861ab69372bd723d02a",
|
|
219
219
|
"childrenByOrder": {}
|
|
220
220
|
},
|
|
221
221
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-patient-search-app",
|
|
3
|
-
"version": "3.0.2-pre.
|
|
3
|
+
"version": "3.0.2-pre.310",
|
|
4
4
|
"description": "Patient search microfrontend for the OpenMRS SPA",
|
|
5
5
|
"browser": "dist/openmrs-esm-patient-search-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"react-router-dom": "5.x",
|
|
50
50
|
"rxjs": "6.x"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "1b1d001b93abb0971ab8c730f5fc0580430dc3e1"
|
|
53
53
|
}
|
package/src/config-schema.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
2
|
|
|
3
|
-
export function performPatientSearch(query: string, objectVersion: string, ac: AbortController) {
|
|
4
|
-
|
|
3
|
+
export function performPatientSearch(query: string, objectVersion: string, ac: AbortController, includeDead: boolean) {
|
|
4
|
+
const url = `/ws/rest/v1/patient?q=${query}&v=${objectVersion}&includeDead=${includeDead}`;
|
|
5
|
+
return openmrsFetch(url, {
|
|
5
6
|
method: 'GET',
|
|
6
7
|
signal: ac.signal,
|
|
7
8
|
});
|
|
@@ -41,15 +41,15 @@ $inverse-02:#393939;
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.searchIconButton {
|
|
44
|
-
background-color:
|
|
44
|
+
background-color: var(--brand-01);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.activeSearchIconButton {
|
|
48
|
-
background-color:
|
|
48
|
+
background-color: var(--brand-02);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.closeButton {
|
|
52
|
-
background-color:
|
|
52
|
+
background-color: var(--brand-02);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.searchButton {
|
|
@@ -5,7 +5,7 @@ import { Button, HeaderGlobalAction, Search } from 'carbon-components-react';
|
|
|
5
5
|
import PatientSearch from '../patient-search/patient-search.component';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import debounce from 'lodash-es/debounce';
|
|
8
|
-
import { useLayoutType } from '@openmrs/esm-framework';
|
|
8
|
+
import { useConfig, useLayoutType } from '@openmrs/esm-framework';
|
|
9
9
|
import { performPatientSearch } from '../patient-search/patient-search.resource';
|
|
10
10
|
import isEmpty from 'lodash-es/isEmpty';
|
|
11
11
|
import { SearchedPatient } from '../types';
|
|
@@ -59,10 +59,11 @@ const searchTimeout = 300;
|
|
|
59
59
|
const customRepresentation =
|
|
60
60
|
'custom:(patientId,uuid,identifiers,display,' +
|
|
61
61
|
'patientIdentifier:(uuid,identifier),' +
|
|
62
|
-
'person:(gender,age,birthdate,birthdateEstimated,personName,addresses,display),' +
|
|
62
|
+
'person:(gender,age,birthdate,birthdateEstimated,personName,addresses,display,dead,deathDate),' +
|
|
63
63
|
'attributes:(value,attributeType:(name)))';
|
|
64
64
|
|
|
65
65
|
const PatientSearchLaunch: React.FC<PatientSearchLaunchProps> = () => {
|
|
66
|
+
const config = useConfig();
|
|
66
67
|
const { t } = useTranslation();
|
|
67
68
|
const layout = useLayoutType();
|
|
68
69
|
const [open, setOpen] = useState<boolean>(false);
|
|
@@ -77,7 +78,7 @@ const PatientSearchLaunch: React.FC<PatientSearchLaunchProps> = () => {
|
|
|
77
78
|
useEffect(() => {
|
|
78
79
|
if (searchTerm && status === 'searching') {
|
|
79
80
|
const ac = new AbortController();
|
|
80
|
-
performPatientSearch(searchTerm, customRepresentation, ac).then(
|
|
81
|
+
performPatientSearch(searchTerm, customRepresentation, ac, config.includeDead).then(
|
|
81
82
|
({ data }) => {
|
|
82
83
|
const results: Array<SearchedPatient> = data.results.map((res, i) => ({
|
|
83
84
|
...res,
|
|
@@ -91,7 +92,7 @@ const PatientSearchLaunch: React.FC<PatientSearchLaunchProps> = () => {
|
|
|
91
92
|
);
|
|
92
93
|
return () => ac.abort();
|
|
93
94
|
}
|
|
94
|
-
}, [searchTerm, status]);
|
|
95
|
+
}, [config.includeDead, searchTerm, status]);
|
|
95
96
|
|
|
96
97
|
const handleEnterKeyPressed = (event: React.KeyboardEvent<HTMLInputElement>) =>
|
|
97
98
|
event.key.toLowerCase() === 'enter' && performSearch();
|
|
@@ -28,6 +28,8 @@ const PatientSearchResults: React.FC<PatientSearchResultsProps> = ({ patients, h
|
|
|
28
28
|
],
|
|
29
29
|
gender: patient.person.gender,
|
|
30
30
|
birthDate: patient.person.birthdate,
|
|
31
|
+
deceasedDateTime: patient.person.deathDate,
|
|
32
|
+
deceasedBoolean: patient.person.death,
|
|
31
33
|
identifier: [
|
|
32
34
|
{
|
|
33
35
|
value: patient.patientIdentifier.identifier,
|