Skip to content

Questionnaire Profile

Canonical../StructureDefinition/nexus-emr-core-questionnaire
Statusdraft (experimental) · 1.26.0
BaseQuestionnaire (constraint)
SourceFSH · JSON

A Nexus EMR form definition: what it asks, what it produces, and where its answers land in the chart.

Invariants

Every rule in force on a conforming instance. This profile rows are stated here; inherited rows come from the base resource and are listed so that a constraint named on an element is findable. Invariant keys elsewhere on this page link into this table.

Key Source Severity On Rule
questionnaire-extract-bundle-is-contained this profile error Questionnaire templateExtractBundle SHALL be a local reference (#id) that resolves to a Bundle contained in this Questionnaire. The prototypes are that Bundle's entries.
extension.where(url = 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractBundle').all(value.ofType(Reference).reference.exists() and value.ofType(Reference).reference.startsWith('#') and value.ofType(Reference).reference.substring(1) in %resource.contained.where($this is Bundle).id)
questionnaire-extract-bundle-is-transaction this profile error Questionnaire A contained prototype Bundle SHALL be type transaction: extracting a form writes its prototypes, and the per-entry request that describes each write is only meaningful on a transaction.
contained.where($this is Bundle).all(type = 'transaction')
questionnaire-extract-is-bundle-only this profile error Questionnaire Prototypes are carried as entries of the contained transaction Bundle named by templateExtractBundle. The per-item templateExtract spelling is not used in this specification and SHALL NOT appear, at any depth of the item tree -- a prototype loose in contained cannot be cited by a Bundle entry, and one carried as an entry cannot be cited by an item.
descendants().ofType(Extension).where(url = 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtract').empty()
questionnaire-has-canonical this profile error Questionnaire A Nexus-authored form MUST carry url -- it is the form's identity, the target of every QuestionnaireResponse.questionnaire reference, and the only thing that makes a form versionable.
url.exists()
dom-2 inherited error Questionnaire If the resource is contained in another resource, it SHALL NOT contain nested Resources
contained.contained.empty()
dom-3 inherited error Questionnaire If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource
contained.where((('#'+id in (%resource.descendants().reference
dom-4 inherited error Questionnaire If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
dom-5 inherited error Questionnaire If a resource is contained in another resource, it SHALL NOT have a security label
contained.meta.security.empty()
dom-6 inherited warning Questionnaire A resource should have narrative for robust management
text.div.exists()
ele-1 inherited error Questionnaire.meta All FHIR elements must have a @value or children
hasValue() or (children().count() > id.count())
ext-1 inherited error Questionnaire.extension Must have either extensions or value[x], not both
extension.exists() != value.exists()
que-0 inherited warning Questionnaire Name should be usable as an identifier for the module by machine processing applications such as code generation
name.matches('A-Z{0,254}')
que-1 inherited error Questionnaire.item Group items must have nested items, display items cannot have nested items
(type='group' implies item.empty().not()) and (type.trace('type')='display' implies item.trace('item').empty())
que-10 inherited error Questionnaire.item Maximum length can only be declared for simple question types
(type in ('boolean'
que-11 inherited error Questionnaire.item If one or more answerOption is present, initial[x] must be missing
answerOption.empty() or initial.empty()
que-12 inherited error Questionnaire.item If there are more than one enableWhen, enableBehavior must be specified
enableWhen.count() > 2 implies enableBehavior.exists()
que-13 inherited error Questionnaire.item Can only have multiple initial values for repeating items
repeats=true or initial.count() <= 1
que-2 inherited error Questionnaire The link ids for groups and questions must be unique within the questionnaire
descendants().linkId.isDistinct()
que-3 inherited error Questionnaire.item Display items cannot have a "code" asserted
type!='display' or code.empty()
que-4 inherited error Questionnaire.item A question cannot have both answerOption and answerValueSet
answerOption.empty() or answerValueSet.empty()
que-5 inherited error Questionnaire.item Only 'choice' and 'open-choice' items can have answerValueSet
(type ='choice' or type = 'open-choice' or type = 'decimal' or type = 'integer' or type = 'date' or type = 'dateTime' or type = 'time' or type = 'string' or type = 'quantity') or (answerValueSet.empty() and answerOption.empty())
que-6 inherited error Questionnaire.item Required and repeat aren't permitted for display items
type!='display' or (required.empty() and repeats.empty())
que-7 inherited error Questionnaire.item.enableWhen If the operator is 'exists', the value must be a boolean
operator = 'exists' implies (answer is Boolean)
que-8 inherited error Questionnaire.item Initial values can't be specified for groups or display items
(type!='group' and type!='display') or initial.empty()
que-9 inherited error Questionnaire.item Read-only can't be specified for "display" items
type!='display' or readOnly.empty()