-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Viewer updates from connectathon Jan '25
- Loading branch information
1 parent
5140746
commit d288407
Showing
22 changed files
with
606 additions
and
169 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
src/lib/components/resource-templates/AdvanceDirective.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
src/lib/components/resource-templates/AllergyIntolerance.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import { Badge } from 'sveltestrap'; | ||
import type { Consent } from 'fhir/r4'; | ||
import type { ResourceTemplateParams } from '$lib/utils/types'; | ||
export let content: ResourceTemplateParams<Consent>; // Define a prop to pass the data to the component | ||
let resource: Consent = content.resource; | ||
</script> | ||
{#if resource.text?.div} | ||
{@html resource.text.div} | ||
<br> | ||
{/if} | ||
{#if resource.category?.[0]} | ||
{#if resource.category[0].coding} | ||
<Badge color="primary">{resource.category[0].coding[0].system} : {resource.category[0].coding[0].code}</Badge> | ||
<br /> | ||
{#if resource.category[0].coding[0].display} | ||
<strong>{resource.category[0].coding[0].display}</strong> | ||
{:else if resource.category[0].text} | ||
<strong>{resource.category[0].text}</strong> | ||
{/if} | ||
<br> | ||
{:else if resource.category[0].text} | ||
<strong>{resource.category[0].text}</strong> | ||
<br> | ||
{/if} | ||
{/if} | ||
{#if resource.provision?.code?.[0].coding} | ||
Intent: {resource.provision?.code?.[0].coding[0].display} | ||
{/if} |
89 changes: 69 additions & 20 deletions
89
src/lib/components/resource-templates/DiagnosticReport.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,91 @@ | ||
<script lang="ts"> | ||
import { Badge } from 'sveltestrap'; | ||
import type { DiagnosticReport } from 'fhir/r4'; | ||
import type { BundleEntry, DiagnosticReport, Observation } from 'fhir/r4'; | ||
import ObservationTemplate from './Observation.svelte'; | ||
import type { ResourceTemplateParams } from '$lib/utils/types'; | ||
import { getEntry } from '$lib/utils/util'; | ||
export let resource: DiagnosticReport; // Define a prop to pass the data to the component | ||
export let content: ResourceTemplateParams<DiagnosticReport>; // Define a prop to pass the data to the component | ||
let resource: DiagnosticReport = content.resource; | ||
let results: Observation[] | undefined = []; | ||
$: { | ||
if (resource) { | ||
if (resource.result) { | ||
for (let result of resource.result) { | ||
if (result.reference) { | ||
let resultResource; | ||
if (resource.contained?.[0]?.resourceType === 'Observation') { | ||
// If the result observation is contained in the resource | ||
resultResource = resource.contained[0]; | ||
} else { | ||
// If the result observation is referenced | ||
resultResource = getEntry( | ||
content.entries as BundleEntry[], | ||
result.reference | ||
) as Observation; | ||
} | ||
if (resultResource) { | ||
results.push(resultResource); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
{#if resource.category?.[0].coding} | ||
<Badge color="primary">{resource.category[0].coding[0].display ?? resource.category[0].coding[0].code}</Badge> | ||
{/if} | ||
{#if resource.code} | ||
{#if resource.code.coding} | ||
<Badge color="primary">{resource.code.coding[0].system} : {resource.code.coding[0].code}</Badge> | ||
<br /> | ||
{#if resource.code.coding[0].display} | ||
<strong>{resource.code.coding[0].display}</strong><br> | ||
<strong>{resource.code.coding[0].display}</strong> | ||
{:else if resource.code.text} | ||
<strong>{resource.code.text}</strong><br> | ||
<strong>{resource.code.text}</strong> | ||
{/if} | ||
{:else if resource.code.text} | ||
<strong>{resource.code.text}</strong><br> | ||
<br><strong>{resource.code.text}</strong> | ||
{/if} | ||
{/if} | ||
{#if resource.effectivePeriod?.start} | ||
Effective {resource.effectivePeriod.start}{resource.effectivePeriod.end | ||
<br> | ||
{#if resource.effectivePeriod} | ||
Effective: {resource.effectivePeriod.start ? resource.effectivePeriod.start : ''}{resource | ||
.effectivePeriod.end | ||
? ` - ${resource.effectivePeriod.end}` | ||
: ''} | ||
{:else if resource.effectiveDateTime} | ||
Date: {resource.effectiveDateTime.split("T")[0]} | ||
Date: {resource.effectiveDateTime.split('T')[0]} | ||
{/if} | ||
<br> | ||
{#if resource.result} | ||
<table class="table table-bordered table-sm"> | ||
<thead> | ||
<tr><th colspan="5">Result(s)</th></tr> | ||
</thead> | ||
{#each resource.result as result} | ||
{#if result.display} | ||
<tr> | ||
<td>{result.display}</td> | ||
</tr> | ||
{/if} | ||
{/each} | ||
</table> | ||
<table class="table table-bordered table-sm"> | ||
<thead> | ||
<tr><th>Result(s)</th></tr> | ||
</thead> | ||
<tbody> | ||
{#each results as result} | ||
<tr> | ||
<div class="ml-4"> | ||
<ObservationTemplate | ||
content={{ resource: result, entries: content.entries }} | ||
contained={resource.effectiveDateTime !== undefined || resource.effectivePeriod !== undefined} | ||
/> | ||
</div> | ||
</tr> | ||
{/each} | ||
{#each resource.result as result} | ||
{#if result.display} | ||
<tr> | ||
<td>{result.display}</td> | ||
</tr> | ||
{/if} | ||
{/each} | ||
</tbody> | ||
</table> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.