Skip to content

Commit

Permalink
Merge branch 'main' into img-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellrgn committed Dec 20, 2024
2 parents 899f040 + a3d0fc6 commit 653b73f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/lib/components/app/FetchAD.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,13 @@
const contentResponse = await fetchAdvanceDirective(patient.id);
content = await contentResponse.json();
hostname = sources[selectedSource].url;
processing = false;
let resources: Array<DocumentReferencePOLST> = content.entry ? content.entry.map((e: BundleEntry) => {
return e.resource;
}) : [];
if (resources.length === 0) {
console.warn("No advance directives found for patient "+patient.id);
processing = false;
return;
}
// Filter out DR's with 'status' == 'superseded'. In May '24 we included these,
Expand Down Expand Up @@ -335,7 +336,7 @@
// if one of the DR's
const isPolst = (dr: DocumentReferencePOLST) => dr.type && dr.type.coding && dr.type.coding.some(coding => coding.system === 'http://loinc.org' && coding.code === '100821-8');
resources.forEach(async (dr: DocumentReferencePOLST) => {
for (let dr of resources) {
// If this DR is a POLST, add the following chain of queries:
if (isPolst(dr)){
dr.isPolst = true;
Expand Down Expand Up @@ -395,16 +396,18 @@
);
}
}
});
resources.forEach(async (dr: DocumentReferencePOLST) => {
}
for (let dr of resources) {
if (hasPdfContent(dr)) {
const pdfContent = dr.content.find(content => content.attachment && content.attachment.contentType === 'application/pdf');
if (pdfContent && pdfContent.attachment && pdfContent.attachment.url) {
await injectPdfIntoDocRef (pdfContent.attachment.url, pdfContent.attachment);
}
}
});
}
processing = false;
let result:ResourceRetrieveEvent = {
resources: resources,
sectionKey: sectionKey,
Expand Down
14 changes: 14 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,27 @@
$isOpen = false;
}
let navOpening = false;
document.addEventListener('click', (event) => {
// Ignore clicks on the navbar toggler
if (event.target?.className?.includes('navbar-toggler')) return;
// Ignore clicks on the dropdown toggle menu items
if (event.target?.className?.includes('nav-link') && event.target?.className?.includes('dropdown-toggle')) {
navOpening = true;
setTimeout(() => {
navOpening = false;
}, 100);
return;
}
closeNav();
});
document.addEventListener('keydown', (event) => {
closeNav();
});
window.addEventListener('scroll', (event) => {
if (document.getElementsByClassName('navbar-collapse collapsing').length > 0) return;
if (navOpening) return;
closeNav();
});
Expand Down

0 comments on commit 653b73f

Please sign in to comment.