Stream: shorthand
Topic: FSH
Dipanjan Mukherjee (Apr 07 2021 at 14:38):
Hi, I am trying to implement a constraint in fsh script through Invariant on FHIR resource. The invariant rule FHIR Path expression has an extension element, however, the extension element is not being recognised during Sushi compilation for FHIR IG generation and is giving error ' No element found at path extension.coverageMonth.valueDate for CDMCoverage, skipping rule”.
This is my Invariant definition in fsh:
- extension.coverageMonth.valueDate obeys coverage-eligibility-birth-date
(Note: there is an extension element coverageMonth of value type Date already created in Coverage resource).
Any suggestion, what is incorrect in this invariant obeys syntax? Thanks
Chris Moesel (Apr 07 2021 at 14:47):
Specific extensions are referenced the same way we reference slices in FSH -- using [extensionSliceName]
. So is this what you're looking for?
extension[coverageMonth].valueDate obeys coverage-eligibility-birth-date
Dipanjan Mukherjee (Apr 07 2021 at 14:52):
exactly thanks Chris, much appreciated
Dipanjan Mukherjee (Apr 07 2021 at 14:53):
if I want to access an element from a reference resource in FHIRPATH, what is the syntax? eg beneficiary is a reference from coverage to patient resource, if I want to access an element from patient resource in FHIRpath on coverage resource, what syntax is required? Is that allowed?
Chris Moesel (Apr 07 2021 at 15:28):
You can use .resolve()
to follow references in FHIRPath. For example: beneficiary.resolve().birthDate
. This is covered in the "Additional Functions" section of FHIR's FHIRPath page: https://hl7.org/fhir/fhirpath.html#functions
Last updated: Apr 12 2022 at 19:14 UTC