Skip to content
Draft
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
30 changes: 27 additions & 3 deletions input/fsh/models.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,36 @@ Expression: "(forEach.exists().toInteger() + forEachOrNull.exists().toInteger()
// NOTE: Using RuleSet with LogicalModels where you pass parameters seems to be broken
Logical: ViewDefinition
Title: "View Definition"
Parent: CanonicalResource
Parent: DomainResource
Description: """
A ViewDefinition represents a tabular projection of a FHIR resource, where the columns and inclusion
criteria are defined by FHIRPath expressions.
A ViewDefinition represents a tabular projection of a FHIR resource, where the columns and inclusion
criteria are defined by FHIRPath expressions.
"""
// Canonical resource metadata. ViewDefinition was previously parented on
// CanonicalResource to inherit these fields, but CanonicalResource is only
// defined as an abstract type from R5 onward. Defining the fields directly
// keeps the on-wire shape consistent with other canonical resources while
// allowing the IG publisher to emit version-specific packages back to R4.
* url 0..1 uri "Canonical identifier for this view definition" """
An absolute URI that is used to identify this view definition when it is referenced in a specification,
model, design or an instance; also called its canonical identifier.
"""
* identifier 0..* Identifier "Additional identifier for the view definition"
* version 0..1 string "Business version of the view definition"
* name 0..1 string "Name for this view definition (machine friendly)"
* name obeys sql-name
* title 0..1 string "Name for this view definition (human friendly)"
* status 1..1 code "draft | active | retired | unknown"
* status from http://hl7.org/fhir/ValueSet/publication-status (required)
* experimental 0..1 boolean "For testing purposes, not real usage"
* date 0..1 dateTime "Date last changed"
* publisher 0..1 string "Name of the publisher/steward (organization or individual)"
* contact 0..* ContactDetail "Contact details for the publisher"
* description 0..1 markdown "Natural language description of the view definition"
* useContext 0..* UsageContext "The context that the content is intended to support"
* jurisdiction 0..* CodeableConcept "Intended jurisdiction for view definition (if applicable)"
* purpose 0..1 markdown "Why this view definition is defined"
* copyright 0..1 markdown "Use and/or publishing restrictions"
* resource 1..1 code "FHIR resource for the ViewDefinition" """
The FHIR resource that the view is based upon, e.g. 'Patient' or 'Observation'.
"""
Expand Down
4 changes: 2 additions & 2 deletions input/pagecontent/StructureDefinition-ViewDefinition-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ For instance, each Patient resource can have multiple addresses, which users can
expand into a separate `patient_addresses` table with one row per address. Each
row would still have a `patient_id` field to know which patient that address row
is associated with. You can see this in
the [PatientAddresses example](Binary-PatientAddresses.html), which unrolls
the [PatientAddresses example](ViewDefinition-PatientAddresses.html), which unrolls
addresses as described above.

[forEach](StructureDefinition-ViewDefinition-definitions.html#diff_ViewDefinition.select.forEach)
Expand Down Expand Up @@ -319,7 +319,7 @@ produce the same columns including their specified names and FHIR types.
The above example uses `forEach` to select different data elements from the
resources to be included in the union. For other use cases, it is possible to
define the columns directly in the `select`. See
the [PatientAndContactAddressUnion example](Binary-PatientAndContactAddressUnion.html)
the [PatientAndContactAddressUnion example](ViewDefinition-PatientAndContactAddressUnion.html)
for a complete version of the above.

The columns produced from the `unionAll` list are effectively added to the
Expand Down
11 changes: 11 additions & 0 deletions sushi-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ dependencies:
parameters:
excludettl: true
path-test: tests
# Promote the ViewDefinition logical model to a published resource type so
# FHIR servers can store and serve view definitions through the standard
# REST API. The IG publisher auto-promotes kind=logical to kind=resource
# when a StructureDefinition is loaded as a custom resource. This IG is
# listed in https://fhir.github.io/ig-registry/igs-approved-for-custom-resource.json.
custom-resource: fsh-generated/resources/StructureDefinition-ViewDefinition.json
# Emit a sibling R4 package (org.sql-on-fhir.ig.r4.tgz) alongside the
# primary R5 package, so R4-based servers can load the IG without
# rewriting its dependencies. The publisher rewrites *.r5 dependencies to
# *.r4 in the variant package.
generate-version: r4

# validation: [allow-any-extensions, no-broken-links]
#
Expand Down
Loading