PackagesCanonicalsLogsProblems
    Packages
    ch.fhir.ig.ch@core-1.2.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:
          valueCode:
            type: code
            pattern: {type: Code, value: addressLine1}
            index: 3
        required: [valueCode]
      addressLine2:
        url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
        type: Extension
        index: 4
        elements:
          valueCode:
            type: code
            pattern: {type: Code, value: addressLine2}
            index: 5
        required: [valueCode]
      street:
        url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
        type: Extension
        index: 6
        elements:
          valueCode:
            type: code
            pattern: {type: Code, value: street}
            index: 7
        required: [valueCode]
      houseNumber: {url: 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber', max: 1, type: Extension, short: houseNumber part of the street line, index: 8}
      unitID: {url: 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitID', max: 1, type: Extension, short: 'unitID, dwellingNumber part of the street line', index: 9}
      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: 10
        elements:
          valueCode:
            type: code
            pattern: {type: Code, value: postOfficeBoxText}
            index: 11
        required: [valueCode]
      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: 12}
    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: null}
              schema:
                type: Extension
                url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
                index: 2
                elements:
                  valueCode:
                    type: code
                    pattern: {type: Code, value: addressLine1}
                    index: 3
                required: [valueCode]
            addressLine2:
              match: {url: null, value: null}
              schema:
                type: Extension
                url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
                index: 4
                elements:
                  valueCode:
                    type: code
                    pattern: {type: Code, value: addressLine2}
                    index: 5
                required: [valueCode]
            street:
              match: {url: null, value: null}
              schema:
                type: Extension
                url: http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-10-linetype
                index: 6
                elements:
                  valueCode:
                    type: code
                    pattern: {type: Code, value: street}
                    index: 7
                required: [valueCode]
            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: 8}
              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: 9}
              max: 1
            postOfficeBoxText:
              match: {url: null, value: null}
              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: 10
                elements:
                  valueCode:
                    type: code
                    pattern: {type: Code, value: postOfficeBoxText}
                    index: 11
                required: [valueCode]
            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: 12}
              max: 1
  city:
    type: string
    isSummary: true
    index: 13
    extensions:
      bfs: {url: 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-ech-7-municipalityid', max: 1, type: Extension, index: 15}
    elements:
      extension:
        index: 14
        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: 15}
              max: 1
  district: {short: District name (aka county), type: string, isSummary: true, index: 16}
  state: {index: 17}
  postalCode: {type: string, short: Postal code for area, index: 18}
  country:
    type: string
    index: 19
    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: 21
    elements:
      extension:
        index: 20
        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: 21
              min: 0
              max: 1
package_version: core-1.2.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.2.0