Add embedded SQL queries to ViewDefinition examples#313
Draft
johngrimes wants to merge 10 commits into
Draft
Conversation
- Create example FHIR resources (Patient, Observation, Condition,
Encounter) in FSH to provide data for ViewDefinition execution
- Register ViewDefinitions with IG Publisher via viewDefinition parameter
- Replace static markdown tables in notes files with {% sql %} Liquid tags
- Add new notes files for ConditionFlat and EncounterFlat examples
Note: The IG Publisher's SQL on FHIR validator currently rejects these
ViewDefinitions due to FHIR resource properties (id, meta) that SUSHI
adds to logical model instances. This requires an upstream fix in the
IG Publisher to strip these properties during validation.
Collaborator
|
4/7: Currently block with PR on IG Publisher with Lloyd |
Replace R4-only paths (period.start, period.end, participant.individual) with their R5 equivalents (actualPeriod.start, actualPeriod.end, participant.actor) and drop the R4 fhirVersion constraint. Update the notes page to embed a dynamic SQL query instead of a static columns table. Note: the rendered table is currently empty because of a separate IG Publisher bug that mis-types dateTime columns as integer; the view itself is now structurally correct against R5 Encounter resources.
Add a small vehicle CodeSystem (matching the hierarchy documented in the CodeSystemHierarchy notes) and two QuestionnaireResponse instances covering both flat and nested item structures. These will be picked up by the CodeSystemHierarchy and QuestionnaireResponseItems views once the upstream IG Publisher handles the `repeat` directive correctly.
Update the version field in publication-request.json from 2.0.0 to 2.1.0 to match the package version declared in sushi-config.yaml. The previous value caused IG Publisher to report errors that the publication request targeted a version mismatching the package, and that 2.0.0 had already been published.
Address several validation errors reported by the IG Publisher: - Update the blood pressure observations to comply with the implicit Observation BP profile. Change the UCUM code from 'mmHg' to 'mm[Hg]', use the official LOINC display 'Blood pressure panel with all children optional' for 85354-9, and add the required vital-signs category. - Add minimal Practitioner, Organization, and Location example instances referenced by ExampleEncounter1 and ExampleEncounter2 so that the references resolve. - Rename the vehicles CodeSystem id from '1' to 'vehicles'. The shared id was causing the IG Publisher's narrative renderer to mis-link integer cell values in ViewDefinition output tables to the CodeSystem, producing broken-link errors across many Binary pages. - Assign an OID identifier to the vehicles CodeSystem to satisfy the IG Publisher's OID requirement for CodeSystem resources.
Collaborator
Author
|
All work for this has been completed and we will be able to merge this once hapifhir/org.hl7.fhir.core#2453 flows through to the IG Publisher. |
Replace static markdown tables in the CodeSystemHierarchy and QuestionnaireResponseItems notes with embedded SQL query blocks so that the displayed results are generated from the live view definitions. Adds a new PatientNamesWithIndex example demonstrating the same approach, with a supporting additional name entry on the patient example and the corresponding path-resource entries in the IG config.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds dynamic SQL query generation to ViewDefinition example pages using the IG Publisher's SQL on FHIR integration feature.
Changes:
viewDefinitionparameter in sushi-config.yaml*-notes.mdfiles with{% sql %}Liquid tagsBlocking issue
IG Publisher validation rejects ViewDefinitions with FHIR resource properties
The IG Publisher's SQL on FHIR validator (
org.hl7.fhir.r5.utils.sql.Validator) fails with errors like:SUSHI generates ViewDefinition instances as Binary resources containing JSON with FHIR resource properties (
id,meta,fhirVersion) that the validator doesn't recognise. The validator expects pure ViewDefinition structure without these fields.Potential solutions:
input/resources/without FHIR metadataOutstanding tasks
Additional notes