Appearance
sdc/duplicate-declaration
error Reports a name declared more than once on one item or on the root.What it checks
Looks for two declarations of the same name on the same item, or on the Questionnaire root: variables, other named expressions such as an itemPopulationContext, launchContexts and extractAllocateIds, in any combination. The later declaration is reported, with the first as a related location.
Example
The name %weight is declared more than once on item "BMI" (bmi), so it is unclear which value expressions that use it get.
fsh
Instance: duplicate-declaration-variables-on-item
InstanceOf: Questionnaire
Usage: #example
* status = #draft
* item[0].linkId = "bmi"
* item[=].type = #string
* item[=].text = "BMI"
* item[=].extension[0].url = "http://hl7.org/fhir/StructureDefinition/variable"
* item[=].extension[=].valueExpression.name = "weight"
* item[=].extension[=].valueExpression.language = #text/fhirpath
* item[=].extension[=].valueExpression.expression = "70"
* 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"