Appearance
smart-forms/variable-name-collision
error Reports a name declared on two elements, or named like a sourceQueries result, which Smart Forms stores as one value.What it checks
The names Smart Forms stores a value under: variables in text/fhirpath or application/x-fhir-query on the root and on items, the itemPopulationContexts population reads, root launchContexts under the name population reads, and the sourceQueries results population binds. It reports each such name that is also declared on another element, the ancestors and descendants of an item included, and each declaration named like a sourceQueries result.
Example
%score is also declared on item "Total" (total); Smart Forms keeps one value for each name, so expressions on either element can get the other's value.
fsh
Instance: variable-name-collision-siblings
InstanceOf: Questionnaire
Usage: #example
* status = #draft
* item[0].linkId = "a"
* item[=].type = #string
* item[=].extension.url = "http://hl7.org/fhir/StructureDefinition/variable"
* item[=].extension.valueExpression.name = "x"
* item[=].extension.valueExpression.language = #text/fhirpath
* item[=].extension.valueExpression.expression = "'a'"
* item[+].linkId = "b"
* item[=].type = #string
* item[=].extension.url = "http://hl7.org/fhir/StructureDefinition/variable"
* item[=].extension.valueExpression.name = "x"
* item[=].extension.valueExpression.language = #text/fhirpath
* item[=].extension.valueExpression.expression = "'b'"