PackagesCanonicalsLogsProblems
    Packages
    spire-healthcare.prod@1.3.0-beta
    https://www.spirehealthcare.com/fhir/StructureDefinition/SpireCore-SiteLocation
description: 'A physical site belonging to a Spire hospital, such as a clinic, outpatient centre or satellite premises. One instance per row of the RDS LocationSite table. Every site belongs to exactly one hospital, so partOf is mandatory and must reference a SpireCore Hospital Location; this mirrors the HospitalID foreign key in the RDS. The site''s classification (RDS SiteTypeCode) is carried in type, bound extensibly to the SpireCore Site Type value set. Identifiers: SiteID (8 characters, the RDS key) and SiteCode (up to 8 characters). The RDS holds no organisation link for a site, so managingOrganization is inherited unchanged; the hospital''s organisation is reached through partOf. Naming: name carries the public name, alias carries the internal name. Lifecycle: status is derived from the RDS StartDate and EndDate, which are also carried verbatim in the validity period extension. Address and contact details map one to one onto the RDS columns.'
package_name: spire-healthcare.prod
derivation: constraint
name: SpireCoreSiteLocation
type: Location
elements:
  address:
    elements:
      line: {short: 'AddressLine1, AddressLine2, AddressLine3 in order', mustSupport: true, array: true, max: 3, index: 24}
      city: {mustSupport: true, index: 25}
      postalCode:
        constraint:
          spire-postcode-len: {human: PostCode is stored as varchar(8) in the RDS. Values longer than 8 characters will not load., source: 'https://www.spirehealthcare.com/fhir/StructureDefinition/SpireCore-SiteLocation', severity: warning, expression: length() <= 8}
        mustSupport: true
        index: 26
      country: {mustSupport: true, index: 27}
  name: {short: Public (patient-facing) name, index: 11}
  type:
    short: RDS SiteTypeCode
    mustSupport: true
    binding: {strength: extensible, valueSet: 'https://www.spirehealthcare.com/fhir/ValueSet/SpireCore-SiteType'}
    index: 13
  extension:
    type: Extension
    short: RDS StartDate / EndDate
    mustSupport: true
    url: https://www.spirehealthcare.com/fhir/StructureDefinition/Extension-SpireCore-ValidityPeriod
    index: 0
    slicing:
      slices:
        validityPeriod:
          match: {}
          schema:
            type: Extension
            short: RDS StartDate / EndDate
            mustSupport: true
            url: https://www.spirehealthcare.com/fhir/StructureDefinition/Extension-SpireCore-ValidityPeriod
            index: 0
            elements:
              value[x]:
                elements:
                  start: {index: 1}
                  end: {index: 2}
  alias: {short: Internal name (as used in SAP-HMS and operational systems), mustSupport: true, index: 12}
  status: {short: 'active | inactive, derived by the RDS load from StartDate and EndDate', index: 10}
  identifier:
    mustSupport: true
    array: true
    min: 2
    index: 3
    slicing:
      slices:
        spireSiteId:
          match: {}
          schema:
            short: RDS SiteID (nchar 8)
            constraint:
              spire-site-id: {human: SiteID is stored as nchar(8) in the RDS. The identifier value must be exactly 8 characters., source: 'https://www.spirehealthcare.com/fhir/StructureDefinition/SpireCore-SiteLocation', severity: error, expression: 'value.matches(''^.{8}$'')'}
            mustSupport: true
            _required: true
            index: 4
            elements:
              system:
                pattern: {type: Uri, value: 'https://www.spirehealthcare.com/fhir/Id/site-id'}
                index: 5
              value: {index: 6}
            required: [value, system]
        spireSiteCode:
          match: {}
          schema:
            short: RDS SiteCode (varchar 8)
            constraint:
              spire-site-code: {human: SiteCode is stored as varchar(8) in the RDS. The identifier value must be 1 to 8 characters., source: 'https://www.spirehealthcare.com/fhir/StructureDefinition/SpireCore-SiteLocation', severity: error, expression: 'value.matches(''^.{1,8}$'')'}
            mustSupport: true
            _required: true
            index: 7
            elements:
              system:
                pattern: {type: Uri, value: 'https://www.spirehealthcare.com/fhir/Id/site-code'}
                index: 8
              value: {index: 9}
            required: [value, system]
  telecom:
    mustSupport: true
    index: 14
    slicing:
      rules: open
      description: One slot each for telephone, email and website, matching the RDS columns.
      discriminator:
      - {path: system, type: value}
      min: null
      slices:
        phone:
          match: {system: phone}
          schema:
            short: RDS TelephoneNumber
            constraint:
              spire-tel-len: {human: TelephoneNumber is stored as nchar(11) in the RDS. Values longer than 11 characters will not load; supply the number without spaces or a country prefix., source: 'https://www.spirehealthcare.com/fhir/StructureDefinition/SpireCore-SiteLocation', severity: warning, expression: value.length() <= 11}
            mustSupport: true
            index: 15
            elements:
              system:
                pattern: {type: Code, value: phone}
                index: 16
              value: {index: 17}
            required: [value, system]
        email:
          match: {system: email}
          schema:
            short: RDS Email
            mustSupport: true
            index: 18
            elements:
              system:
                pattern: {type: Code, value: email}
                index: 19
              value: {index: 20}
            required: [value, system]
        website:
          match: {system: url}
          schema:
            short: RDS Website
            mustSupport: true
            index: 21
            elements:
              system:
                pattern: {type: Code, value: url}
                index: 22
              value: {index: 23}
            required: [value, system]
  partOf:
    type: Reference
    short: The hospital this site belongs to (RDS HospitalID foreign key)
    mustSupport: true
    refers: ['https://www.spirehealthcare.com/fhir/StructureDefinition/SpireCore-HospitalLocation']
    index: 28
package_version: 1.3.0-beta
extensions:
  validityPeriod:
    url: https://www.spirehealthcare.com/fhir/StructureDefinition/Extension-SpireCore-ValidityPeriod
    type: Extension
    short: RDS StartDate / EndDate
    mustSupport: true
    index: 0
    elements:
      value[x]:
        elements:
          start: {index: 1}
          end: {index: 2}
class: profile
kind: resource
url: https://www.spirehealthcare.com/fhir/StructureDefinition/SpireCore-SiteLocation
base: https://fhir.hl7.org.uk/StructureDefinition/UKCore-Location
version: 0.1.0
required: [name, partOf, status, type, alias]