Skip to content

Commit

Permalink
Merge branch 'main' of github.com:DIPSAS/hello-open-dips
Browse files Browse the repository at this point in the history
  • Loading branch information
AskThomassen committed Jun 26, 2024
2 parents f3b3520 + 3aa2c10 commit 26d7938
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 159 deletions.
240 changes: 120 additions & 120 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import clientContext from "../context/clientContext";

function MyApp({ Component, pageProps }: AppProps) {
const [client, setClient] = useState<Client>(undefined!);
const [loading, setLoading] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(true);

useEffect(() => {
setLoading(true);
Expand All @@ -33,7 +33,7 @@ function MyApp({ Component, pageProps }: AppProps) {
<clientContext.Provider value={{ client: client, setClient: setClient }}>
<Header/>
<div className="wrapper">
<Component {...pageProps}>
<Component {...pageProps} clientLoading={loading}>
</Component>
</div>
</clientContext.Provider>
Expand Down
12 changes: 7 additions & 5 deletions src/pages/appointments/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const Patient: React.FC = () => {
if (!extensions) return 'No details available';
for (let i = 0; i < extensions.length; i++) {
const extension = extensions?.[i];
// console.log(extension);
if (extension.valueCodeableConcept?.coding) {
for (let j = 0; j < extension.valueCodeableConcept.coding.length; j++) {
const coding = extension.valueCodeableConcept?.coding?.[j];
Expand Down Expand Up @@ -81,6 +80,7 @@ if (!patient) {
);
}


if(patient && appointments && encounters){

return (
Expand Down Expand Up @@ -112,7 +112,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 +125,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 +138,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 +151,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
Loading

0 comments on commit 26d7938

Please sign in to comment.