Appearance
sdc/shadowed-declaration
info Reports a name an item declares that an ancestor item or the root also declares.What it checks
Looks for a declaration on an item of a name that an ancestor item or the Questionnaire root also declares: variables, other named expressions such as an itemPopulationContext, launchContexts and extractAllocateIds, in any combination that one expression could see: an extractAllocateId is seen only in extraction, where a variable is not. The declaration on the item is reported, with the nearest ancestor declaration of the name as a related location.
Example
The name %weight on item "BMI" (bmi) is also declared on the Questionnaire root, so other expressions on item "BMI" (bmi) and its descendant items get this declaration's value.
fsh
Instance: shadowed-declaration-root-and-item
InstanceOf: Questionnaire
Usage: #example
* status = #draft
* extension.url = "http://hl7.org/fhir/StructureDefinition/variable"
* extension.valueExpression.name = "weight"
* extension.valueExpression.language = #text/fhirpath
* extension.valueExpression.expression = "70"
* item[0].linkId = "bmi"
* item[=].type = #string
* item[=].extension.url = "http://hl7.org/fhir/StructureDefinition/variable"
* item[=].extension.valueExpression.name = "weight"
* item[=].extension.valueExpression.language = #text/fhirpath
* item[=].extension.valueExpression.expression = "80"