Skip to content

Commit b6e5f7d

Browse files
authored
(feat): Hide patient banner (#135)
* Enable toggling showPatientBanner for non-workspace zones * fix test * Move the Implementation specific config to another pr * Keep the WarningAlt icon Unitl concrete UX advice
1 parent 129f9f4 commit b6e5f7d

File tree

5 files changed

+31
-16
lines changed

5 files changed

+31
-16
lines changed

src/FormBootstrap.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ interface FormParams {
115115
handlePostResponse?: (Encounter) => void;
116116
handleEncounterCreate?: (Object) => void;
117117
handleOnValidate?: (boolean) => void;
118+
hidePatientBanner?: boolean;
118119
}
119120

120121
const FormBootstrap = ({
@@ -126,6 +127,7 @@ const FormBootstrap = ({
126127
handlePostResponse,
127128
handleEncounterCreate,
128129
handleOnValidate,
130+
hidePatientBanner,
129131
}: FormParams) => {
130132
const patient = useGetPatient(patientUuid);
131133
const { activeSessionMeta } = useContext(GroupFormWorkflowContext);
@@ -170,6 +172,7 @@ const FormBootstrap = ({
170172
encDate: activeSessionMeta.sessionDate,
171173
},
172174
hideControls: true,
175+
hidePatientBanner: hidePatientBanner,
173176
}}
174177
/>
175178
)}

src/form-entry-workflow/FormEntryWorkflow.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ const FormWorkspace = () => {
127127
handlePostResponse,
128128
handleEncounterCreate,
129129
}}
130+
hidePatientBanner={true}
130131
/>
131132
</div>
132133
<div className={styles.rightPanel}>

src/form-entry-workflow/patient-banner/PatientBanner.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,20 @@ const PatientBanner = () => {
4949
return <SkeletonPatientInfo />;
5050
}
5151

52+
return <Banner patient={patient} hideActionsOverflow />;
53+
};
54+
55+
const Banner = ({ patient, hideActionsOverflow }) => {
5256
return (
53-
<div className={styles.container}>
54-
<ExtensionSlot name="patient-photo-slot" state={patientPhotoSlotState} />
55-
<div className={styles.patientInfoContent}>
56-
<div className={styles.patientInfoRow}>
57-
<span className={styles.patientName}>{patientName}</span>
58-
</div>
59-
<div className={styles.patientInfoRow}>
60-
<span>{(patient.gender ?? t('unknown', 'Unknown')).replace(/^\w/, (c) => c.toUpperCase())}</span>
61-
<span>&middot;</span>
62-
<span>{age(patient.birthDate)}</span>
63-
<span>&middot;</span>
64-
<span>
65-
{patient.identifier.length ? patient.identifier.map((identifier) => identifier.value).join(', ') : '--'}
66-
</span>
67-
</div>
68-
</div>
57+
<div className={styles.patientBannerContainer}>
58+
<ExtensionSlot
59+
name="patient-header-slot"
60+
state={{
61+
patient,
62+
patientUuid: patient.id,
63+
hideActionsOverflow,
64+
}}
65+
/>
6966
</div>
7067
);
7168
};

src/form-entry-workflow/patient-banner/styles.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,16 @@
4242
color: colors.$gray-100;
4343
margin: layout.$spacing-03;
4444
}
45+
46+
.patientBannerContainer {
47+
display: flex;
48+
width: 100%;
49+
position: sticky;
50+
flex-direction: row;
51+
align-items: baseline;
52+
padding: 0;
53+
}
54+
55+
.patientBannerContainer > div {
56+
width: 100%;
57+
}

src/group-form-entry-workflow/GroupSessionWorkspace.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ const GroupSessionWorkspace = () => {
186186
handlePostResponse,
187187
handleEncounterCreate,
188188
}}
189+
hidePatientBanner={false}
189190
/>
190191
</div>
191192
<div className={styles.rightPanel}>

0 commit comments

Comments
 (0)