From 9f7bce6d3a066a538cd26a5009ff26e86aacf16a Mon Sep 17 00:00:00 2001 From: Ryan Brush Date: Tue, 17 Oct 2023 13:55:06 -0700 Subject: [PATCH] Rename 'alias' to 'name' and make column name and paths required. --- input/fsh/examples.fsh | 37 ++++++++++--------- input/fsh/models.fsh | 8 ++-- ...tructureDefinition-ViewDefinition-intro.md | 6 +-- ...tructureDefinition-ViewDefinition-notes.md | 20 +++++----- input/pagecontent/index.md | 10 ++--- 5 files changed, 42 insertions(+), 39 deletions(-) diff --git a/input/fsh/examples.fsh b/input/fsh/examples.fsh index 7c4194a..3f2241f 100644 --- a/input/fsh/examples.fsh +++ b/input/fsh/examples.fsh @@ -9,18 +9,19 @@ Usage: #example * select[+] * column[+] * path = "getResourceKey()" - * alias = "id" + * name = "id" * column[+] * path = "gender" + * name = "gender" * select[+] * forEach = "name.where(use = 'official').first()" * column[+] * path = "given.join(' ')" - * alias = "given_name" + * name = "given_name" * description = "A single given name field with all names joined together." * column[+] * path = "family" - * alias = "family_name" + * name = "family_name" Instance: PatientAddresses InstanceOf: ViewDefinition @@ -37,20 +38,22 @@ Usage: #example * select[+] * column[+] * path = "getResourceKey()" - * alias = "patient_id" + * name = "patient_id" * select[+] * forEach = "address" * column[+] * path = "line.join('\n')" - * alias = "street" + * name = "street" * description = "The full street address, including newlines if present." * column[+] * path = "use" + * name = "use" * column[+] * path = "city" + * name = "city" * column[+] * path = "postalCode" - * alias = "zip" + * name = "zip" Instance: UsCoreBloodPressures InstanceOf: ViewDefinition @@ -72,41 +75,41 @@ Usage: #example * select[+] * column[+] * path = "getResourceKey()" - * alias = "id" + * name = "id" * column[+] * path = "subject.getReferenceKey('Patient')" - * alias = "patient_id" + * name = "patient_id" * description = "Can be used to join to patient tables created by other views." * column[+] * path = "effective.ofType(dateTime)" - * alias = "effective_date_time" + * name = "effective_date_time" * select[+] * forEach = "component.where(code.coding.exists(system='http://loinc.org' and code=%systolic_bp)).first()" * column[+] - * alias = "sbp_quantity_system" + * name = "sbp_quantity_system" * path = "value.ofType(Quantity).system" * column[+] - * alias = "sbp_quantity_code" + * name = "sbp_quantity_code" * path = "value.ofType(Quantity).code" * column[+] - * alias = "sbp_quantity_display" + * name = "sbp_quantity_display" * path = "value.ofType(Quantity).unit" * column[+] - * alias = "sbp_quantity_value" + * name = "sbp_quantity_value" * path = "value.ofType(Quantity).value" * select[+] * forEach = "component.where(code.coding.exists(system='http://loinc.org' and code=%diastolic_bp)).first()" * column[+] - * alias = "dbp_quantity_system" + * name = "dbp_quantity_system" * path = "value.ofType(Quantity).system" * column[+] - * alias = "dbp_quantity_code" + * name = "dbp_quantity_code" * path = "value.ofType(Quantity).code" * column[+] - * alias = "dbp_quantity_display" + * name = "dbp_quantity_display" * path = "value.ofType(Quantity).unit" * column[+] - * alias = "dbp_quantity_value" + * name = "dbp_quantity_value" * path = "value.ofType(Quantity).value" * where[+] * path = "code.coding.exists(system='http://loinc.org' and code=%bp_code)" \ No newline at end of file diff --git a/input/fsh/models.fsh b/input/fsh/models.fsh index cc6edb3..6640c0f 100644 --- a/input/fsh/models.fsh +++ b/input/fsh/models.fsh @@ -74,15 +74,15 @@ criteria are defined by FHIRPath expressions. A column to be produced in the resuting table. The column is relative to the select structure that contains it. """ - * path 0..1 string "FHIRPath expression that creates a column and defines its content" """ + * path 1..1 string "FHIRPath expression that creates a column and defines its content" """ A FHIRPath expression that evaluates to the value that will be output in the column for each resource. The input context is the collection of resources of the type specified in the resource element. Constants defined in Reference({constant}) can be referenced as %[name]. """ - * alias 0..1 string "Column alias produced in the output" """ - Alias of the column produced in the output, must be in a database-friendly format. + * name 1..1 string "Column name produced in the output" """ + Name of the column produced in the output, must be in a database-friendly format. """ - * alias obeys sql-name + * name obeys sql-name * description 0..1 markdown "Description of the column" """ A human-readable description of the column. """ diff --git a/input/pagecontent/StructureDefinition-ViewDefinition-intro.md b/input/pagecontent/StructureDefinition-ViewDefinition-intro.md index 827bba2..455eb35 100644 --- a/input/pagecontent/StructureDefinition-ViewDefinition-intro.md +++ b/input/pagecontent/StructureDefinition-ViewDefinition-intro.md @@ -14,8 +14,8 @@ observations, and so on. #### The selected fields The ViewDefinition has a [select](StructureDefinition-ViewDefinition-definitions.html#diff_ViewDefinition.select) structure that uses [FHIRPath] -(https://hl7.org/fhirpath/) expressions to select fields from the FHIR structure and an optional -alias for the output field name. +(https://hl7.org/fhirpath/) expressions to select fields from the FHIR structure and place them in the column with the specified name. + #### The "where" criteria The [where](StructureDefinition-ViewDefinition-definitions.html#diff_ViewDefinition.where) field determines which resources should be used in the view. @@ -25,4 +25,4 @@ For instance, users may have different views for blood pressure observations or Several other fields give the view a name, draft status, and other descriptive information as seen below. A system-specific *view runner* implementation can execute a view definition and -return the results as a table easily used in the user's tech stack. See the [layers](layers.html) page for details. \ No newline at end of file +return the results as a table easily used in the user's tech stack. See the [layers](layers.html) page for details. diff --git a/input/pagecontent/StructureDefinition-ViewDefinition-notes.md b/input/pagecontent/StructureDefinition-ViewDefinition-notes.md index ccd2b3c..37bf5a4 100644 --- a/input/pagecontent/StructureDefinition-ViewDefinition-notes.md +++ b/input/pagecontent/StructureDefinition-ViewDefinition-notes.md @@ -89,7 +89,7 @@ For example, a minimal view of Patients could look like this: "column": [ { "path": "getResourceKey()", - "alias": "id" + "name": "id" }, { "path": "active" @@ -110,13 +110,13 @@ like this: "column": [ { "path": "getResourceKey()", - "alias": "id" + "name": "id" }, { // The 'Patient' parameter is optional, but ensures the returned value // will either be a patient row key or null. "path": "subject.getReferenceKey('Patient')", - "alias": "patient_id", + "name": "patient_id", }, ] }], @@ -243,21 +243,21 @@ For example, the columns in this ViewDefinition will appear in alphabetical orde "resource": "..." "select": [{ "column": [ - { "path": "'A'", "alias": "a" }, - { "path": "'B'", "alias": "b" }, + { "path": "'A'", "name": "a" }, + { "path": "'B'", "name": "b" }, ] "select": [{ "forEach": "aNestedStructure", "column": [ - { "path": "'C'", "alias": "c" }, - { "path": "'D'", "alias": "d" }, + { "path": "'C'", "name": "c" }, + { "path": "'D'", "name": "d" }, ] }] }, { "column": [ - { "path": "'E'", "alias": "e" }, - { "path": "'F'", "alias": "f" }, + { "path": "'E'", "name": "e" }, + { "path": "'F'", "name": "f" }, ] }] } @@ -336,7 +336,7 @@ common and can simplify analysis in some systems. "column": [ { "path": "id" }, { - "alias": "birth_date", + "name": "birth_date", "path": "birthDate", "tags": [ { diff --git a/input/pagecontent/index.md b/input/pagecontent/index.md index 57971d1..fd1a97e 100644 --- a/input/pagecontent/index.md +++ b/input/pagecontent/index.md @@ -8,7 +8,7 @@ futher, making FHIR work well with familiar and efficient SQL engines and surrou We do this by creating simple, tabular *views* of the underlying FHIR data that are tailored to specific needs. Views are defined with [FHIRPath](https://hl7.org/fhirpath/) expressions in -a logical structure to specify things like column aliases and unnested items. +a logical structure to specify things like column names and unnested items. Let's start with a simple example, defining a "patient_demographics" view with the following [ViewDefinition](StructureDefinition-ViewDefinition.html) structure: @@ -20,8 +20,8 @@ Let's start with a simple example, defining a "patient_demographics" view with t "select": [ { "column": [ - { "path": "getResourceKey()", "alias": "id" }, - { "path": "gender" } + { "path": "getResourceKey()", "name": "id" }, + { "path": "gender", "name": "gender } ] }, { @@ -30,12 +30,12 @@ Let's start with a simple example, defining a "patient_demographics" view with t "column": [ { "path": "given.join(' ')", - "alias": "given_name", + "name": "given_name", "description": "A single given name field with all names joined together." }, { "path": "family", - "alias": "family_name" + "name": "family_name" } ] }