PackagesCanonicalsLogsProblems
    Packages
    ch.fhir.ig.ch@core-1.0.0
    http://fhir.ch/ig/ch-core/StructureDefinition/ch-core-address
description: address incorporating eCH-0010 postal address extensions
package_name: ch.fhir.ig.ch
derivation: constraint
name: CHCoreAddress
type: Address
elements:
  line:
    type: string
    short: Street name, number, direction & P.O. Box etc.
    index: 0
    extensions:
      addressLine1:
        url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
        type: Extension
        index: 2
        elements:
          value:
            pattern: {type: Code, value: addressLine1}
            choices: [valueCode]
            index: 4
          valueCode:
            type: code
            pattern: {type: Code, value: addressLine1}
            choiceOf: value
            index: 5
        required: [valueCode, value]
      addressLine2:
        url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
        type: Extension
        index: 6
        elements:
          value:
            pattern: {type: Code, value: addressLine2}
            choices: [valueCode]
            index: 8
          valueCode:
            type: code
            pattern: {type: Code, value: addressLine2}
            choiceOf: value
            index: 9
        required: [valueCode, value]
      street:
        url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
        type: Extension
        index: 10
        elements:
          value:
            pattern: {type: Code, value: street}
            choices: [valueCode]
            index: 12
          valueCode:
            type: code
            pattern: {type: Code, value: street}
            choiceOf: value
            index: 13
        required: [valueCode, value]
      houseNumber: {url: 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber', max: 1, type: Extension, short: houseNumber part of the street line, index: 14}
      unitID: {url: 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitID', max: 1, type: Extension, short: 'unitID, dwellingNumber part of the street line', index: 15}
      postOfficeBoxText:
        url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
        type: Extension
        short: Postbox addresses need an postbox text and optional postbox number
        index: 16
        elements:
          value:
            pattern: {type: Code, value: postOfficeBoxText}
            choices: [valueCode]
            index: 18
          valueCode:
            type: code
            pattern: {type: Code, value: postOfficeBoxText}
            choiceOf: value
            index: 19
        required: [valueCode, value]
      postOfficeBoxNumber: {url: 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox', max: 1, type: Extension, short: Optional postOfficeBoxNumber as a separate part of the postOfficeBoxText, index: 20}
    elements:
      extension:
        index: 1
        slicing:
          rules: open
          ordered: true
          discriminator:
          - {path: url, type: value}
          - {path: value, type: value}
          min: null
          slices:
            addressLine1:
              match: {url: null, value: addressLine1}
              schema:
                type: Extension
                url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
                index: 2
                elements:
                  value:
                    pattern: {type: Code, value: addressLine1}
                    choices: [valueCode]
                    index: 4
                  valueCode:
                    type: code
                    pattern: {type: Code, value: addressLine1}
                    choiceOf: value
                    index: 5
                required: [valueCode, value]
            addressLine2:
              match: {url: null, value: addressLine2}
              schema:
                type: Extension
                url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
                index: 6
                elements:
                  value:
                    pattern: {type: Code, value: addressLine2}
                    choices: [valueCode]
                    index: 8
                  valueCode:
                    type: code
                    pattern: {type: Code, value: addressLine2}
                    choiceOf: value
                    index: 9
                required: [valueCode, value]
            street:
              match: {url: null, value: street}
              schema:
                type: Extension
                url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
                index: 10
                elements:
                  value:
                    pattern: {type: Code, value: street}
                    choices: [valueCode]
                    index: 12
                  valueCode:
                    type: code
                    pattern: {type: Code, value: street}
                    choiceOf: value
                    index: 13
                required: [valueCode, value]
            houseNumber:
              match: {url: null, value: null}
              schema: {type: Extension, short: houseNumber part of the street line, url: 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber', index: 14}
              max: 1
            unitID:
              match: {url: null, value: null}
              schema: {type: Extension, short: 'unitID, dwellingNumber part of the street line', url: 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitID', index: 15}
              max: 1
            postOfficeBoxText:
              match: {url: null, value: postOfficeBoxText}
              schema:
                type: Extension
                short: Postbox addresses need an postbox text and optional postbox number
                url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
                index: 16
                elements:
                  value:
                    pattern: {type: Code, value: postOfficeBoxText}
                    choices: [valueCode]
                    index: 18
                  valueCode:
                    type: code
                    pattern: {type: Code, value: postOfficeBoxText}
                    choiceOf: value
                    index: 19
                required: [valueCode, value]
            postOfficeBoxNumber:
              match: {url: null, value: null}
              schema: {type: Extension, short: Optional postOfficeBoxNumber as a separate part of the postOfficeBoxText, url: 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox', index: 20}
              max: 1
  city:
    type: string
    isSummary: true
    index: 21
    extensions:
      bfs: {url: 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-7-municipalityid', max: 1, type: Extension, index: 23}
    elements:
      extension:
        index: 22
        slicing:
          rules: open
          discriminator:
          - {path: url, type: value}
          min: null
          slices:
            bfs:
              match: {url: null}
              schema: {type: Extension, url: 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-7-municipalityid', index: 23}
              max: 1
  district: {short: District name (aka county), type: string, isSummary: true, index: 24}
  state: {index: 25}
  postalCode: {type: string, short: Postal code for area, index: 26}
  country:
    type: string
    index: 27
    extensions:
      countrycode:
        url: http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding
        min: 0
        max: 1
        constraint:
          ch-addr-1: {human: ISO Country Alpha-2 or ISO Country Alpha-3 code, severity: error, expression: '((valueCoding.code.length()=2) and valueCoding.code.memberOf(''http://hl7.org/fhir/ValueSet/iso3166-1-2'')) or ((valueCoding.code.length() = 3) and valueCoding.code.memberOf(''http://hl7.org/fhir/ValueSet/iso3166-1-3''))'}
        short: ISO Country Alpha-2 or ISO Country Alpha-3 code
        type: Extension
        index: 29
    elements:
      extension:
        index: 28
        slicing:
          rules: open
          discriminator:
          - {path: url, type: value}
          min: null
          slices:
            countrycode:
              match: {url: null}
              schema:
                constraint:
                  ch-addr-1: {human: ISO Country Alpha-2 or ISO Country Alpha-3 code, severity: error, expression: '((valueCoding.code.length()=2) and valueCoding.code.memberOf(''http://hl7.org/fhir/ValueSet/iso3166-1-2'')) or ((valueCoding.code.length() = 3) and valueCoding.code.memberOf(''http://hl7.org/fhir/ValueSet/iso3166-1-3''))'}
                short: ISO Country Alpha-2 or ISO Country Alpha-3 code
                type: Extension
                url: http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding
                index: 29
              min: 0
              max: 1
package_version: core-1.0.0
class: complex-type
kind: complex-type
url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-core-address
base: http://hl7.org/fhir/StructureDefinition/Address
version: 1.0.0