-
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.
Update date format and add Goal resource template
- Loading branch information
1 parent
2768a67
commit 601270a
Showing
14 changed files
with
200 additions
and
55 deletions.
There are no files selected for viewing
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
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,96 @@ | ||
<script lang="ts"> | ||
import { formatDate } from '$lib/utils/util'; | ||
import { Badge } from 'sveltestrap'; | ||
import type { Goal } from 'fhir/r4'; | ||
import type { ResourceTemplateParams } from '$lib/utils/types'; | ||
export let content: ResourceTemplateParams<Goal>; | ||
let resource: Goal = content.resource; | ||
// Extract start and due dates | ||
let startDate = '??'; | ||
if (resource.startDate) { | ||
startDate = formatDate(resource.startDate); | ||
} else if (resource.startCodeableConcept?.text) { | ||
startDate = resource.startCodeableConcept.text; | ||
} | ||
// Get first available due date or duration from targets | ||
let dueDate = '??'; | ||
if (resource.target && resource.target.length > 0) { | ||
const target = resource.target[0]; | ||
if (target.dueDate) { | ||
dueDate = formatDate(target.dueDate); | ||
} else if (target.dueDuration) { | ||
dueDate = `in ${target.dueDuration.value} ${target.dueDuration.unit}`; | ||
} | ||
} | ||
</script> | ||
|
||
<!-- Display resource type and lifecycle status --> | ||
<Badge color="primary"> | ||
{`${resource.resourceType} (${resource.lifecycleStatus})`} | ||
</Badge> | ||
|
||
<!-- Display priority if available --> | ||
{#if resource.priority} | ||
<Badge color="primary"> | ||
priority: | ||
{#if resource.priority.text} | ||
{resource.priority.text} | ||
{:else if resource.priority.coding} | ||
{#each resource.priority.coding as code} | ||
{code.system} : {code.code} | ||
{#if code.display} | ||
({code.display}) | ||
{/if} | ||
{/each} | ||
{/if} | ||
</Badge> | ||
{/if} | ||
|
||
<!-- Display achievementStatus if available --> | ||
{#if resource.achievementStatus} | ||
<Badge color="primary"> | ||
achievement: | ||
{#if resource.achievementStatus.text} | ||
{resource.achievementStatus.text} | ||
{:else if resource.achievementStatus.coding} | ||
{#each resource.achievementStatus.coding as status} | ||
{status.system} : {status.code} | ||
{#if status.display} | ||
({status.display}) | ||
{/if} | ||
{/each} | ||
{/if} | ||
</Badge> | ||
{/if} | ||
|
||
{#if resource.priority || resource.achievementStatus} | ||
<br /> | ||
{/if} | ||
|
||
<!-- Display description --> | ||
{#if resource.description} | ||
{#if resource.description.text} | ||
<strong>{resource.description.text}</strong> | ||
{:else if resource.description.coding} | ||
{#each resource.description.coding as code} | ||
{code.system} : {code.code} | ||
{#if code.display} | ||
<strong>({code.display})</strong> | ||
{/if} | ||
{/each} | ||
{/if} | ||
{:else} | ||
<em>No Description Provided</em> | ||
{/if} | ||
|
||
<!-- Display timeline --> | ||
<br /> | ||
{#if startDate === '??' && dueDate === '??'} | ||
<em>No timeline available.</em> | ||
{:else} | ||
<strong>Timeline:</strong> {startDate} ➔ {dueDate} | ||
{/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.