Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connectathon 2025-01 PACIO track #58

Merged
merged 16 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/lib/components/app/ResourceSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import Practitioner from '$lib/components/resource-templates/Practitioner.svelte';
import Procedure from '$lib/components/resource-templates/Procedure.svelte';
import OccupationalData from '$lib/components/resource-templates/OccupationalData.svelte';
import QuestionnaireResponse from '$lib/components/resource-templates/QuestionnaireResponse.svelte';

export let submitting: boolean;
export let resourceCollection: IPSResourceCollection;
Expand All @@ -62,7 +63,8 @@
"Practitioner": Practitioner,
"Procedure": Procedure,
"Occupational Data": OccupationalData,
"Advance Directives": AdvanceDirective
"Advance Directives": AdvanceDirective,
"QuestionnaireResponse": QuestionnaireResponse
};

const ipsDispatch = createEventDispatcher<{ 'ips-retrieved': IPSRetrieveEvent }>();
Expand Down Expand Up @@ -339,4 +341,4 @@
:global(div.offcanvas-body) {
overflow-y: hidden !important;
}
</style>
</style>
68 changes: 68 additions & 0 deletions src/lib/components/resource-templates/QuestionnaireResponse.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<script lang="ts">
import { Badge } from 'sveltestrap';
import type { QuestionnaireResponse } from 'fhir/r4';

export let resource: QuestionnaireResponse; // Define a prop to pass the data to the component

</script>

<style>
.small-text-table {
font-size: 12px; /* Adjust this value as needed */
}
</style>

<Badge color="primary">{resource.identifier.value}</Badge><br/>
Questionnaire reference: <a href='{resource.questionnaire}' rel="noreferrer noopener" target='_blank'>{resource.questionnaire}</a><br />
Authored: {resource.authored.split("T")[0]}
{#if resource.source}
{#if resource.source.display}
<br />
Source: {resource.source.display}
{:else}
<br />
Source: (unknown)
{/if}
{/if}

<table class="table table-bordered table-responsive table-sm small-text-table">
<thead>
<tr><th colspan="3">Responses</th></tr>
</thead>
<tbody>
{#each resource.item as item}
<tr>
<td>{item.text ?? "No text provided"}</td>
<td>
<!-- Render answers if present -->
{#if item.answer}
{#each item.answer as ans}
{ans.valueString ?? ans.valueCoding?.display ?? "No answer text"}<br/>
{/each}
{/if}
</td>
<td>
<!-- Nested subitems -->
{#if item.item}
<table class="table table-bordered table-sm">
<tbody>
{#each item.item as subitem}
<tr>
<td>{subitem.text ?? "No subitem text provided"}</td>
<td>
{#if subitem.answer}
{#each subitem.answer as subAns}
{subAns.valueString ?? subAns.valueCoding?.display ?? "No sub-answer text"}<br/>
{/each}
{/if}
</td>
</tr>
{/each}
</tbody>
</table>
{/if}
</td>
</tr>
{/each}
</tbody>
</table>
6 changes: 5 additions & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const SOF_RESOURCES = [
'PractitionerRole', // can't search by patient; "An identifier, practitioner, organization, location, or specialty parameter is required."
'Procedure', // TODO change to subject
// 'Specimen', // Not in EPIC USCDI R4
'QuestionnaireResponse',
];

export const SOF_PATIENT_RESOURCES = [
Expand All @@ -90,6 +91,7 @@ export const SOF_PATIENT_RESOURCES = [
// 'PractitionerRole', // can't search by patient; "An identifier, practitioner, organization, location, or specialty parameter is required."
'Procedure', // TODO change to subject
// 'Specimen', // Not in EPIC USCDI R4
'QuestionnaireResponse',
];

export const VIEWER_BASE = new URL(
Expand All @@ -110,6 +112,8 @@ export const EXAMPLE_IPS = {
'Angela Roster': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/10965/$summary',
'Horace Skelly': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/11142/$summary',
'Anonymous': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/10999/$summary',
'Desiree': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/Pat1-System2/$summary'
'Desiree': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/Pat1-System2/$summary',
// 2025-01 Connectathon PACIO track:
'Jenny Mosley': 'https://hapi.fhir.org/baseR4/Patient/patientJM1/$summary'
};
export const IPS_DEFAULT = 'Maria SEATTLE Gravitate';
1 change: 1 addition & 0 deletions src/lib/utils/IPSResourceCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const allowableResourceTypes = [
'Practitioner',
// 'PractitionerRole', Not relevant to IPS
'Procedure',
'QuestionnaireResponse', // FIXME this is not part of IPS, should get a carve-out elsewhere...
'Specimen'
];

Expand Down
Loading