Skip to content

Commit

Permalink
Merge pull request #254 from FHIR/test-tags
Browse files Browse the repository at this point in the history
Add tags to test definitions and add core tag to mandatory functionality
  • Loading branch information
johngrimes authored Sep 9, 2024
2 parents a21dc16 + 56926f1 commit ecb80c7
Show file tree
Hide file tree
Showing 27 changed files with 395 additions and 210 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ components of a test case file are:
scenario within the case. Every test object includes:
- **Title** (`title` attribute): A unique, descriptive title for the test object, differentiating
it from others in the same test case.
- **Tags** (`tags` attribute): A list of strings that categorize the test
case into relevant groups. This attribute helps in organizing and
filtering test cases based on their scope or focus. See [Reserved Tags](#reserved-tags).
- **ViewDefinition** (`view` attribute): Specifies the [ViewDefinition][] being
tested. This attribute outlines the expected data view or transformation
applied to the input fixtures.
Expand All @@ -129,6 +132,7 @@ Below is an abstract representation of what a test case file might look like:
...
{
'title': 'title of test case',
'tags': ['shareable'],
// ViewDefintion
'view': {
'select': [
Expand All @@ -145,6 +149,15 @@ Below is an abstract representation of what a test case file might look like:
}
```

### Reserved Tags

The following tags are reserved for categorizing test cases based on their
applicability to profiles within the core specification:

- **shareable**: Test cases that validate conformance with the Shareable View Definition profile.
- **tabular**: Test cases that validate conformance with the Tabular View Definition profile.
- **experimental**: Test cases that cover experimental aspects of the specification.

## Implement Test Runner

To ensure comprehensive validation and interoperability, it is recommended for
Expand Down
17 changes: 7 additions & 10 deletions input/fsh/profiles.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ Profile: ShareableViewDefinition
Title: "Shareable View Definition"
Parent: ViewDefinition
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.
A profile for View Definitions intended to be shared between multiple systems. This requires that
the View Definition have a defined URL and name. It also requires declaration of the FHIR version
that the view is intended to be executed over, and the FHIR type of each column. This ensures
consistent interpretation of the view across different view runner implementations.
"""
* url 1..1
* name 1..1
Expand All @@ -34,8 +31,8 @@ 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 is sometimes referred to as 'CSV Mode', but applies to any system that explicitly constrains
its views or tables to tabular data.
"""
* select.column obeys no-collections
* select.column obeys primitives-only
* select.column obeys primitives-only
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
### Required FHIRPath Expressions/Functions

All View Runners claiming conformance to the Shareable View Definition profile must implement these [FHIRPath](https://hl7.org/fhirpath/)
capabilities:

- [Literals](https://hl7.org/fhirpath/#literals) for String, Integer and Decimal
- [where](https://hl7.org/fhirpath/#wherecriteria-expression-collection)function
- [exists](https://hl7.org/fhirpath/#existscriteria-expression-boolean) function
- [empty](https://hl7.org/fhirpath/#empty-boolean) function
- [extension](https://hl7.org/fhir/R4/fhirpath.html#functions) function
- [ofType](https://hl7.org/fhirpath/#oftypetype-type-specifier-collection)
function
- [first](https://hl7.org/fhirpath/#first-collection) function
- Boolean
operators: [and](https://hl7.org/fhirpath/#and), [or](https://hl7.org/fhirpath/#or), [not](https://hl7.org/fhirpath/#not-boolean)
- Math
operators: [addition (+)](https://hl7.org/fhirpath/#addition), [subtraction (-)](https://hl7.org/fhirpath/#subtraction), [multiplication (\*)](https://hl7.org/fhirpath/#multiplication), [division (/)](https://hl7.org/fhirpath/#division)
- Comparison
operators: [equals (=)](https://hl7.org/fhirpath/#equals), [not equals (!=)](https://hl7.org/fhirpath/#not-equals), [greater than (>)](https://hl7.org/fhirpath/#greater-than), [less or equal (<=)](https://hl7.org/fhirpath/#less-or-equal)
- [Indexer expressions](https://hl7.org/fhirpath/#index-integer-collection)

### Experimental FHIRPath Functions

The following functions are intended for eventual inclusion in the required subset, however they are not yet a part of the normative [FHIRPath](https://hl7.org/fhirpath/) release and may still be subject to change:

- [join](https://build.fhir.org/ig/HL7/FHIRPath/#joinseparator-string-string)
function
- [lowBoundary](https://build.fhir.org/ig/HL7/FHIRPath/#lowboundaryprecision-integer-decimal--date--datetime--time)
and [highBoundary](https://build.fhir.org/ig/HL7/FHIRPath/#highboundaryprecision-integer-decimal--date--datetime--time)
functions (including on [Period](https://hl7.org/fhir/datatypes.html#Period))
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ chosen tech stack. See [System Layers](index.html#system-layers) for details.
## Profiling

ViewDefinitions may be profiled to meet specific needs. For instance,
the [ShareableViewDefinition](StructureDefinition-ShareableViewDefinition.html)
the [Shareable View Definition](StructureDefinition-ShareableViewDefinition.html)
profile adds constraints for ViewDefinitions intended to be shared between
systems. Implementers may create their own ViewDefinition profiles for further
specialized needs.
Loading

0 comments on commit ecb80c7

Please sign in to comment.