Skip to content

Commit

Permalink
Add tabular profile and an example.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrush committed Apr 19, 2024
1 parent b62f8f7 commit 168950f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
37 changes: 37 additions & 0 deletions input/fsh/examples.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,43 @@ Usage: #example
* path = "family"
* name = "family_name"

Instance: ShareablePatientDemographics
InstanceOf: ViewDefinition
Description: """
Creates the same view as the 'PatientDemographics' example, but applies both the
ShareableViewDefinition and TabularViewDefinition profiles.
"""
Usage: #example
* url = "http://example.com/ShareablePatientDemographics"
* name = "patient_demographics"
* fhirVersion[+] = #4.0
* fhirVersion[+] = #5.0
* status = #draft
* resource = #Patient
* meta
* profile[+] = "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ShareableViewDefinition"
* profile[+] = "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/TabularViewDefinition"
* select[+]
* column[+]
* path = "getResourceKey()"
* name = "id"
* type = "string"
* column[+]
* path = "gender"
* name = "gender"
* type = "string"
* select[+]
* forEach = "name.where(use = 'official').first()"
* column[+]
* path = "given.join(' ')"
* name = "given_name"
* description = "A single given name field with all names joined together."
* type = "string"
* column[+]
* path = "family"
* name = "family_name"
* type = "string"

Instance: PatientAddresses
InstanceOf: ViewDefinition
Description: """An example of unnesting patient addresses into multiple
Expand Down
20 changes: 19 additions & 1 deletion input/fsh/profiles.fsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
Profile: ShareableViewDefinition
Title: "Shareable View Definition"
Parent: ViewDefinition
Description: "A Shareable View Definition"
Description: """
A profile for View Definitions intended to be shared between multiple systems. This requires there
be a defined URL, name, and version. Also, each column must have specified type so consuming
systems

Shareable View Definitions often also use the TabularViewDefinition profile, requiring
that the view be shareable and contain only tabular values, as is common in many databases
and analytic tools.
"""
* url 1..1
* name 1..1
* fhirVersion 1..*
* select.column.type 1..1

Profile: TabularViewDefinition
Title: "Tabular View Definition"
Parent: ViewDefinition
Description: """
A profile for View Definitions where each resulting field must contain only a simple scalar value.
This is sometimes referred to as 'CSV Mode', but applies to any system that explicitly constrains its
views or tables to tabluar data.
"""

This file was deleted.

0 comments on commit 168950f

Please sign in to comment.