From d75f0d51ce9fddf7e09ea22dadeec7a04f4b499a Mon Sep 17 00:00:00 2001 From: Daniel Lorigan Date: Tue, 14 May 2024 10:24:17 -0700 Subject: [PATCH] Fix effectivePeriod.start check in resource templates --- src/lib/resource-templates/DiagnosticReport.svelte | 4 ++-- src/lib/resource-templates/MedicationStatement.svelte | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/resource-templates/DiagnosticReport.svelte b/src/lib/resource-templates/DiagnosticReport.svelte index 14d46d1..9a49d49 100644 --- a/src/lib/resource-templates/DiagnosticReport.svelte +++ b/src/lib/resource-templates/DiagnosticReport.svelte @@ -16,8 +16,8 @@ {resource.code.text}
{/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} diff --git a/src/lib/resource-templates/MedicationStatement.svelte b/src/lib/resource-templates/MedicationStatement.svelte index 17a081b..f912399 100644 --- a/src/lib/resource-templates/MedicationStatement.svelte +++ b/src/lib/resource-templates/MedicationStatement.svelte @@ -22,8 +22,10 @@ {#if resource.resourceReference && resource.resourceReference.display} {resource.resourceReference.display}
{/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}