Skip to content

Commit

Permalink
Fixed text for patients without encounters and appointments
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiejoha committed Jun 26, 2024
1 parent e04ff0f commit 4072b81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/pages/appointments/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ if (!patient) {
);
}

// console.log(appointments?.total)

if(patient && appointments && encounters){

return (
Expand Down Expand Up @@ -112,7 +114,7 @@ if(patient && appointments && encounters){
<AppointmentsEncountersInfo title= "Appointments" onClose={handleCloseList}>
<ul className={styles.appointmentList}>
<div>
<ul className={styles.appointmentWrapper}>
{appointments?.total && <ul className={styles.appointmentWrapper}>
{appointments?.entry?.map((entry) => {
const resource = entry.resource as R4.IAppointment;
const display = getDisplayFromExtensions(resource.extension);
Expand All @@ -125,7 +127,8 @@ if(patient && appointments && encounters){
</li>
);
})}
</ul>
</ul>}
{!appointments?.total && <p className="conditions-error">The patient has no appointments.</p>}
</div>
</ul>
</AppointmentsEncountersInfo>
Expand All @@ -137,7 +140,7 @@ if(patient && appointments && encounters){
<AppointmentsEncountersInfo title="Encounters" onClose={handleCloseList}>
<ul className={styles.encounterList}>
<div>
<ul className={styles.appointmentWrapper}>
{encounters?.total && <ul className={styles.appointmentWrapper}>
{encounters?.entry?.map((entry) => {
const resource = entry.resource as R4.IEncounter;
return (
Expand All @@ -150,7 +153,8 @@ if(patient && appointments && encounters){
</li>
)
})}
</ul>
</ul>}
{!encounters?.total && <p className="conditions-error">The patient has no encounters.</p>}
</div>
</ul>
</AppointmentsEncountersInfo>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/appointment.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.appointmentList, .encounterList {
list-style-type: none;
padding: 0;
height: calc(90vh - 100pt);
height: calc(80vh - 100pt);
overflow-y: auto;
}

Expand Down

0 comments on commit 4072b81

Please sign in to comment.