Skip to content

Commit

Permalink
Fix effectivePeriod.start check in resource templates
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellrgn committed May 14, 2024
1 parent 940919e commit d75f0d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/resource-templates/DiagnosticReport.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<strong>{resource.code.text}</strong><br>
{/if}
{/if}
{#if resource.effectivePeriod}
Effective {resource.effectivePeriod.start}{resource.effectivePeriod.end
{#if resource.effectivePeriod?.start}
Effective {resource.effectivePeriod.start}{resource.effectivePeriod.end
? ` - ${resource.effectivePeriod.end}`
: ''}
{:else if resource.effectiveDateTime}
Expand Down
6 changes: 4 additions & 2 deletions src/lib/resource-templates/MedicationStatement.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
{#if resource.resourceReference && resource.resourceReference.display}
{resource.resourceReference.display}<br>
{/if}
{#if resource.effectivePeriod}
Effective period: {resource.effectivePeriod.start.split("T")[0]} - {resource.effectivePeriod.end.split("T")[0] ?? "*"}
{#if resource.effectivePeriod?.start}
Effective {resource.effectivePeriod.start}{resource.effectivePeriod.end
? ` - ${resource.effectivePeriod.end}`
: ''}
{:else if resource.effectiveDateTime}
{resource.effectiveDateTime ? `Effective date: ${resource.effectiveDateTime.split("T")[0]}` : ''}
{/if}
Expand Down

0 comments on commit d75f0d5

Please sign in to comment.