description: null package_name: uk.nhsdigital.r4.test derivation: constraint name: NHSDigitalQuestionnaireResponse type: QuestionnaireResponse elements: identifier: {mustSupport: true, index: 0} questionnaire: {mustSupport: true, index: 1} status: {mustSupport: true, index: 2} subject: type: Reference constraint: patient-reference: {human: An identifier reference or resource reference must be provided, source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse', severity: error, expression: (reference.exists() or (identifier.exists()))} patient-nhs: {human: Supplied NHS Number is outside the English and Welsh NHS Number range or length of the number is wrong., source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-Claim', severity: error, expression: 'identifier.where(system=''https://fhir.nhs.uk/Id/nhs-number'').exists().not() or (identifier.where(system=''https://fhir.nhs.uk/Id/nhs-number'').exists() and identifier.where(system=''https://fhir.nhs.uk/Id/nhs-number'').value.matches(''^([456789]{1}[0-9]{9})$''))'} mustSupport: true refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Patient'] index: 3 elements: identifier: elements: system: {mustSupport: true, index: 4} value: {mustSupport: true, index: 5} required: [value, system] display: {mustSupport: true, index: 6} authored: {mustSupport: true, index: 7} author: type: Reference mustSupport: true refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole-Minimal'] index: 8 elements: identifier: elements: system: {mustSupport: true, index: 9} value: {mustSupport: true, index: 10} required: [value, system] display: {mustSupport: true, index: 11} source: type: Reference constraint: usercode-reference: {human: An identifier reference or resource reference must be provided, source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse', severity: warning, expression: (reference.exists() or (identifier.exists()))} usercode-nmc: {human: NMC must be of the format NNANNNNA, source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').exists() and identifier.where(system=''https://fhir.hl7.org.uk/Id/nmc-number'').value.matches(''^[0-9]{2}[A-Z]{1}[0-9]{4}[A-Z]{1}$''))'} usercodee-gmp: {human: GMP must be of the format GNNNNNNN and not be a spurious code (starts with G6 or G7), source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').exists() and identifier.where(system=''https://fhir.hl7.org.uk/Id/gmp-number'').value.matches(''^[G]{1}[01234589]{1}[0-9]{6}$''))'} usercode-gmc: {human: GMC must be of the format CNNNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').exists() and identifier.where(system=''https://fhir.hl7.org.uk/Id/gmc-number'').value.matches(''^[C]{1}[0-9]{7}$''))'} usercode-gphc: {human: GPHC must be of the format NNNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').exists() and identifier.where(system=''https://fhir.hl7.org.uk/Id/gphc-number'').value.matches(''^[0-9]{7}$''))'} usercode-hcpc: {human: HCPC must be of the format AANNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').exists() and identifier.where(system=''https://fhir.hl7.org.uk/Id/hcpc-number'').value.matches(''^[A-Z]{2}[0-9]{6}$''))'} usercode-din: {human: DIN format must be NNNNNN, source: 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse', severity: error, expression: 'identifier.exists().not() or identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').exists().not() or (identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').exists() and identifier.where(system=''https://fhir.hl7.org.uk/Id/din-number'').value.matches(''^[0-9]{6}$''))'} mustSupport: true refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole'] index: 12 elements: identifier: mustSupport: true index: 13 elements: value: {index: 14} required: [value] display: {mustSupport: true, index: 15} required: [identifier] item: {mustSupport: true, index: 16} package_version: 2.8.5-prerelease class: profile kind: resource url: https://fhir.nhs.uk/StructureDefinition/NHSDigital-QuestionnaireResponse base: https://fhir.hl7.org.uk/StructureDefinition/UKCore-QuestionnaireResponse version: null required: [authored, item, questionnaire]