-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from beda-software/issue-21
Issue 21
- Loading branch information
Showing
9 changed files
with
210 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
tests: | ||
# https://www.hl7.org/fhir/fhirpath.html#types | ||
- 'group: Extension and id for primitive types': | ||
|
||
- desc: '** id for primitive type' | ||
expression: Functions.attrtrue.id = 'someid' | ||
result: | ||
- true | ||
|
||
- desc: '** expression with extension for primitive type 1' | ||
inputfile: patient-example.json | ||
expression: Patient.birthDate.extension.where(url = '').empty() | ||
result: | ||
- true | ||
|
||
- desc: '** expression with extension for primitive type 2' | ||
inputfile: patient-example.json | ||
expression: >- | ||
Patient.birthDate.extension | ||
.where(url = 'http://hl7.org/fhir/StructureDefinition/patient-birthTime') | ||
.valueDateTime.toDateTime() = @1974-12-25T14:35:45-05:00 | ||
result: | ||
- true | ||
|
||
- desc: '** expression with extension for primitive type 3' | ||
inputfile: patient-example.json | ||
model: r4 | ||
expression: >- | ||
Patient.birthDate.extension | ||
.where(url = 'http://hl7.org/fhir/StructureDefinition/patient-birthTime') | ||
.value = @1974-12-25T14:35:45-05:00 | ||
result: | ||
- true | ||
|
||
# https://www.hl7.org/fhir/fhirpath.html#functions | ||
- 'group: Additional functions': | ||
- desc: 'extension(url : string) : collection' | ||
|
||
# If the url is empty ({ }), the result is empty. | ||
- desc: '** empty url' | ||
inputfile: patient-example.json | ||
expression: Patient.birthDate.extension('').empty() | ||
result: | ||
- true | ||
|
||
# If the input collection is empty ({ }), the result is empty. | ||
- desc: '** empty input collection' | ||
inputfile: patient-example.json | ||
expression: >- | ||
Patient.birthDate1 | ||
.extension('http://hl7.org/fhir/StructureDefinition/patient-birthTime').empty() | ||
result: | ||
- true | ||
|
||
- desc: '** expression with extension() for primitive type (without using FHIR model data)' | ||
inputfile: patient-example.json | ||
expression: >- | ||
Patient.birthDate.extension('http://hl7.org/fhir/StructureDefinition/patient-birthTime') | ||
.valueDateTime.toDateTime() = @1974-12-25T14:35:45-05:00 | ||
result: | ||
- true | ||
|
||
- desc: '** expression with extension() for primitive type (without using FHIR model data) when only extension is present' | ||
inputfile: patient-example-2.json | ||
expression: >- | ||
Patient.communication.preferred.extension('test').exists() | ||
result: | ||
- true | ||
|
||
- desc: '** expression with extension() for primitive type (using FHIR model data) when only extension is present' | ||
inputfile: patient-example-2.json | ||
model: r4 | ||
expression: >- | ||
Patient.communication.preferred.extension('test').value.id | ||
result: | ||
- testing | ||
|
||
- desc: '** expression with extension() for primitive type (using FHIR model data)' | ||
inputfile: patient-example.json | ||
model: r4 | ||
expression: >- | ||
Patient.birthDate.extension('http://hl7.org/fhir/StructureDefinition/patient-birthTime') | ||
.value = @1974-12-25T14:35:45-05:00 | ||
result: | ||
- true | ||
|
||
- desc: '** value of extension of extension (using FHIR model data)' | ||
model: r4 | ||
expression: Functions.attrtrue.extension('url1').extension('url2').value = 'someuri' | ||
result: | ||
- true | ||
|
||
- desc: '** id of extension of extension' | ||
expression: Functions.attrtrue.extension('url1').extension('url2').id = 'someid2' | ||
result: | ||
- true | ||
|
||
subject: | ||
resourceType: Functions | ||
attrtrue: true | ||
_attrtrue: | ||
id: someid | ||
extension: | ||
- url: url1 | ||
extension: | ||
- url: url2 | ||
id: someid2 | ||
valueUri: someuri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"resourceType": "Patient", | ||
"communication": [ | ||
{ | ||
"language": { | ||
"coding": [ | ||
{ | ||
"system": "urn:ietf:bcp:47", | ||
"code": "nl", | ||
"display": "Dutch" | ||
} | ||
] | ||
}, | ||
"_preferred": { | ||
"extension": [ | ||
{ | ||
"url": "test", | ||
"_valueString": { | ||
"id": "testing" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters