From ac660aa5dc1ca27aea5969c29f4242f765b2aa84 Mon Sep 17 00:00:00 2001 From: John Grimes Date: Fri, 23 Feb 2024 13:54:05 +1000 Subject: [PATCH 1/2] Qualify requirement for column ordering to only output formats that support it --- input/pagecontent/StructureDefinition-ViewDefinition-notes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/input/pagecontent/StructureDefinition-ViewDefinition-notes.md b/input/pagecontent/StructureDefinition-ViewDefinition-notes.md index fe3121a..ab0e17e 100644 --- a/input/pagecontent/StructureDefinition-ViewDefinition-notes.md +++ b/input/pagecontent/StructureDefinition-ViewDefinition-notes.md @@ -353,7 +353,8 @@ And, the equivalent with nested structure: Note the former example is preferred due to its simplicity and the latter is included purely for illustrative purposes. ### Column Ordering -*View runners* MUST produce output in the order that the columns appear in the ViewDefinition. + +*View runners* that support column ordering in their output format MUST order the columns of the result to match the order that they appear in the ViewDefinition. `select`s that have nested `select`s will place the columns of the parent `select` before the columns of the nested `select`, and the columns from a `unionAll` list are placed last. To change the column ordering, it is possible to place the columns or the `unionAll` in a nested `select`, which can be ordered relative to other nested `select`s as desired. From fe6cb5cfb8971534f7c801caaf8aaaf57942a9e6 Mon Sep 17 00:00:00 2001 From: John Grimes Date: Tue, 27 Feb 2024 14:18:41 +1000 Subject: [PATCH 2/2] Further clarification to wording of column ordering requirements --- .../pagecontent/StructureDefinition-ViewDefinition-notes.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/input/pagecontent/StructureDefinition-ViewDefinition-notes.md b/input/pagecontent/StructureDefinition-ViewDefinition-notes.md index ab0e17e..b9e5f79 100644 --- a/input/pagecontent/StructureDefinition-ViewDefinition-notes.md +++ b/input/pagecontent/StructureDefinition-ViewDefinition-notes.md @@ -354,9 +354,11 @@ Note the former example is preferred due to its simplicity and the latter is inc ### Column Ordering -*View runners* that support column ordering in their output format MUST order the columns of the result to match the order that they appear in the ViewDefinition. +*View runners* that support column ordering in their output format MUST order the columns of the result according to the rules defined in this section. -`select`s that have nested `select`s will place the columns of the parent `select` before the columns of the nested `select`, and the columns from a `unionAll` list are placed last. To change the column ordering, it is possible to place the columns or the `unionAll` in a nested `select`, which can be ordered relative to other nested `select`s as desired. +`select`s that have nested `select`s will place the columns of the parent `select` before the columns of the nested `select`, and the columns from a `unionAll` list are placed last. + +To change the column ordering, it is possible to place the columns or the `unionAll` in a nested `select`, which can be ordered relative to other nested `select`s as desired. For example, the `column`s in this ViewDefinition will appear in alphabetical order: