@openmrs/esm-patient-search-app 9.2.1-pre.6809 → 9.2.1-pre.6821

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.
@@ -45,7 +45,7 @@
45
45
  "auxiliaryFiles": [
46
46
  "384.js.map"
47
47
  ],
48
- "hash": "c6692c99d3244011",
48
+ "hash": "fc3e281f24fda75a",
49
49
  "childrenByOrder": {}
50
50
  },
51
51
  {
@@ -207,9 +207,9 @@
207
207
  "entry": false,
208
208
  "recorded": false,
209
209
  "reason": "reused as split chunk (cache group: default)",
210
- "size": 318869,
210
+ "size": 318958,
211
211
  "sizes": {
212
- "javascript": 318869
212
+ "javascript": 318958
213
213
  },
214
214
  "names": [],
215
215
  "idHints": [],
@@ -223,7 +223,7 @@
223
223
  "auxiliaryFiles": [
224
224
  "1804.js.map"
225
225
  ],
226
- "hash": "6bbc8988446a20a1",
226
+ "hash": "19a6603ae4bf8060",
227
227
  "childrenByOrder": {}
228
228
  },
229
229
  {
@@ -497,9 +497,9 @@
497
497
  "entry": false,
498
498
  "recorded": false,
499
499
  "reason": "split chunk (cache group: default)",
500
- "size": 61186,
500
+ "size": 61053,
501
501
  "sizes": {
502
- "javascript": 61186
502
+ "javascript": 61053
503
503
  },
504
504
  "names": [],
505
505
  "idHints": [],
@@ -513,7 +513,7 @@
513
513
  "auxiliaryFiles": [
514
514
  "3842.js.map"
515
515
  ],
516
- "hash": "c5bf184ded9471e1",
516
+ "hash": "efd8a415e4bba98e",
517
517
  "childrenByOrder": {}
518
518
  },
519
519
  {
@@ -862,7 +862,7 @@
862
862
  "auxiliaryFiles": [
863
863
  "4946.js.map"
864
864
  ],
865
- "hash": "82469e4e29029447",
865
+ "hash": "0f7d3695e27f10ce",
866
866
  "childrenByOrder": {}
867
867
  },
868
868
  {
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"pages":[{"component":"root","route":"search"}],"extensions":[{"name":"patient-search-icon","component":"patientSearchIcon","slot":"top-nav-actions-slot","order":10},{"name":"patient-search-button","component":"patientSearchButton","slot":"patient-search-button-slot","offline":true},{"name":"patient-search-bar","component":"patientSearchBar","slot":"patient-search-bar-slot","offline":true}],"workspaces":[{"component":"patientSearchWorkspace","groups":["ward-patient-admission-requests"],"name":"patient-search-workspace","title":"searchPatient","type":"patient-search-workspace","width":"narrow"}],"version":"9.2.1-pre.6809"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"pages":[{"component":"root","route":"search"}],"extensions":[{"name":"patient-search-icon","component":"patientSearchIcon","slot":"top-nav-actions-slot","order":10},{"name":"patient-search-button","component":"patientSearchButton","slot":"patient-search-button-slot","offline":true},{"name":"patient-search-bar","component":"patientSearchBar","slot":"patient-search-bar-slot","offline":true}],"workspaces":[{"component":"patientSearchWorkspace","groups":["ward-patient-admission-requests"],"name":"patient-search-workspace","title":"searchPatient","type":"patient-search-workspace","width":"narrow"}],"version":"9.2.1-pre.6821"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-search-app",
3
- "version": "9.2.1-pre.6809",
3
+ "version": "9.2.1-pre.6821",
4
4
  "description": "Patient search microfrontend for O3",
5
5
  "browser": "dist/openmrs-esm-patient-search-app.js",
6
6
  "main": "src/index.ts",
@@ -16,7 +16,7 @@ import styles from './compact-patient-banner.scss';
16
16
 
17
17
  interface ClickablePatientContainerProps {
18
18
  children: React.ReactNode;
19
- patient: SearchedPatient;
19
+ patient: fhir.Patient;
20
20
  }
21
21
 
22
22
  interface CompactPatientBannerProps {
@@ -28,21 +28,18 @@ const CompactPatientBanner = forwardRef<HTMLDivElement, CompactPatientBannerProp
28
28
  return patients.map(mapToFhirPatient);
29
29
  }, [patients]);
30
30
 
31
- const renderPatient = useCallback(
32
- (patient: fhir.Patient, index: number) => {
33
- const patientName = getPatientName(patient);
31
+ const renderPatient = useCallback((patient: fhir.Patient) => {
32
+ const patientName = getPatientName(patient);
34
33
 
35
- return (
36
- <ClickablePatientContainer key={patient.id} patient={patients[index]}>
37
- <div className={styles.patientAvatar} role="img">
38
- <PatientPhoto patientUuid={patient.id} patientName={patientName} />
39
- </div>
40
- <PatientBannerPatientInfo patient={patient} />
41
- </ClickablePatientContainer>
42
- );
43
- },
44
- [patients],
45
- );
34
+ return (
35
+ <ClickablePatientContainer key={patient.id} patient={patient}>
36
+ <div className={styles.patientAvatar} role="img">
37
+ <PatientPhoto patientUuid={patient.id} patientName={patientName} />
38
+ </div>
39
+ <PatientBannerPatientInfo patient={patient} />
40
+ </ClickablePatientContainer>
41
+ );
42
+ }, []);
46
43
 
47
44
  return <div ref={ref}>{fhirMappedPatients.map(renderPatient)}</div>;
48
45
  });
@@ -50,7 +47,7 @@ const CompactPatientBanner = forwardRef<HTMLDivElement, CompactPatientBannerProp
50
47
  const ClickablePatientContainer = ({ patient, children }: ClickablePatientContainerProps) => {
51
48
  const { nonNavigationSelectPatientAction, patientClickSideEffect } = usePatientSearchContext();
52
49
  const config = useConfig<PatientSearchConfig>();
53
- const isDeceased = Boolean(patient?.person?.deathDate);
50
+ const isDeceased = Boolean(patient?.deceasedDateTime);
54
51
 
55
52
  if (nonNavigationSelectPatientAction) {
56
53
  return (
@@ -58,10 +55,10 @@ const ClickablePatientContainer = ({ patient, children }: ClickablePatientContai
58
55
  className={classNames(styles.patientSearchResult, styles.patientSearchResultButton, {
59
56
  [styles.deceased]: isDeceased,
60
57
  })}
61
- key={patient.uuid}
58
+ key={patient.id}
62
59
  onClick={() => {
63
- nonNavigationSelectPatientAction(patient.uuid);
64
- patientClickSideEffect?.(patient.uuid);
60
+ nonNavigationSelectPatientAction(patient.id, patient);
61
+ patientClickSideEffect?.(patient.id, patient);
65
62
  }}>
66
63
  {children}
67
64
  </button>
@@ -73,10 +70,10 @@ const ClickablePatientContainer = ({ patient, children }: ClickablePatientContai
73
70
  className={classNames(styles.patientSearchResult, {
74
71
  [styles.deceased]: isDeceased,
75
72
  })}
76
- key={patient.uuid}
77
- onBeforeNavigate={() => patientClickSideEffect?.(patient.uuid)}
73
+ key={patient.id}
74
+ onBeforeNavigate={() => patientClickSideEffect?.(patient.id, patient)}
78
75
  to={interpolateString(config.search.patientChartUrl, {
79
- patientUuid: patient.uuid,
76
+ patientUuid: patient.id,
80
77
  })}>
81
78
  {children}
82
79
  </ConfigurableLink>
@@ -13,7 +13,7 @@ interface PatientSearchButtonProps {
13
13
  isOpen?: boolean;
14
14
  searchQuery?: string;
15
15
  searchQueryUpdatedAction?: (query: string) => {};
16
- selectPatientAction?: (patientUuid: string) => {};
16
+ selectPatientAction?: (patientUuid: string, patient: fhir.Patient) => {};
17
17
  showPatientSearch?: () => void;
18
18
  workspaceTitle?: string;
19
19
  }
@@ -6,13 +6,13 @@ export interface PatientSearchContextProps {
6
6
  * dashboard. If null/undefined, patient results will be links to the
7
7
  * patient dashboard.
8
8
  */
9
- nonNavigationSelectPatientAction?: (patientUuid: string) => void;
9
+ nonNavigationSelectPatientAction?: (patientUuid: string, patient: fhir.Patient) => void;
10
10
  /**
11
11
  * A function to execute when the user clicks on a patient result. Will
12
12
  * be executed whether or not nonNavigationSelectPatientAction is defined,
13
13
  * just before navigation (or after nonNavigationSelectPatientAction is called).
14
14
  */
15
- patientClickSideEffect?: ((patientUuid: string) => void) | (() => void);
15
+ patientClickSideEffect?: ((patientUuid: string, patient: fhir.Patient) => void) | (() => void);
16
16
  handleReturnToSearchList?: () => void;
17
17
  showPatientSearch?: () => void;
18
18
  hidePatientSearch?: () => void;
@@ -21,7 +21,7 @@ import styles from './patient-banner.scss';
21
21
 
22
22
  interface ClickablePatientContainerProps {
23
23
  children: React.ReactNode;
24
- patientUuid: string;
24
+ patient: fhir.Patient;
25
25
  }
26
26
 
27
27
  interface PatientBannerProps {
@@ -56,7 +56,7 @@ const PatientBanner: React.FC<PatientBannerProps> = ({ patient, patientUuid, hid
56
56
  [styles.activePatientContainer]: !isDeceased,
57
57
  })}
58
58
  role="banner">
59
- <ClickablePatientContainer patientUuid={patientUuid}>
59
+ <ClickablePatientContainer patient={fhirMappedPatient}>
60
60
  <div className={styles.patientAvatar} role="img">
61
61
  <PatientPhoto patientUuid={patientUuid} patientName={patientName} />
62
62
  </div>
@@ -109,18 +109,19 @@ const PatientBanner: React.FC<PatientBannerProps> = ({ patient, patientUuid, hid
109
109
  );
110
110
  };
111
111
 
112
- const ClickablePatientContainer = ({ patientUuid, children }: ClickablePatientContainerProps) => {
112
+ const ClickablePatientContainer = ({ patient, children }: ClickablePatientContainerProps) => {
113
113
  const { nonNavigationSelectPatientAction, patientClickSideEffect } = usePatientSearchContext();
114
114
  const config = useConfig<PatientSearchConfig>();
115
+ const patientUuid = patient.id;
115
116
 
116
117
  const handleClick = useCallback(() => {
117
- nonNavigationSelectPatientAction(patientUuid);
118
- patientClickSideEffect?.(patientUuid);
119
- }, [nonNavigationSelectPatientAction, patientClickSideEffect, patientUuid]);
118
+ nonNavigationSelectPatientAction(patientUuid, patient);
119
+ patientClickSideEffect?.(patientUuid, patient);
120
+ }, [nonNavigationSelectPatientAction, patientClickSideEffect, patientUuid, patient]);
120
121
 
121
122
  const handleBeforeNavigate = useCallback(() => {
122
- patientClickSideEffect?.(patientUuid);
123
- }, [patientClickSideEffect, patientUuid]);
123
+ patientClickSideEffect?.(patientUuid, patient);
124
+ }, [patientClickSideEffect, patientUuid, patient]);
124
125
 
125
126
  if (nonNavigationSelectPatientAction) {
126
127
  return (