{
  "resourceType": "StructureDefinition",
  "id": "au-organisation",
  "url": "http://hl7.org.au/fhir/StructureDefinition/au-organisation",
  "version": "1.1.0",
  "name": "AUBaseOrganisation",
  "title": "AU Base Organisation",
  "status": "draft",
  "date": "2018-08-03",
  "publisher": "Health Level Seven Australia (Patient Administration WG)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org.au/fhir",
          "use": "work"
        }
      ]
    }
  ],
  "description": "This profile defines an organisation administration details structure that includes core localisation concepts for use in an Australian context.",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Organization",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Organization",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Organization",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "trial-use"
          }
        ],
        "path": "Organization",
        "short": "An organisation in an Australian healthcare context"
      },
      {
        "id": "Organization.identifier",
        "path": "Organization.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "short": "Organisation identifiers"
      },
      {
        "id": "Organization.identifier:hpio",
        "path": "Organization.identifier",
        "sliceName": "hpio",
        "short": "Healthcare Provider Identifier – Organisation (HPI-O)",
        "definition": "National identifier Health Provider Identifier for Organisations (HPI-O).",
        "constraint": [
          {
            "key": "inv-hpio-value-0",
            "severity": "error",
            "human": "HPI-O shall be an exactly 16 digit number",
            "expression": "value.matches('^([0-9]{16})$')"
          },
          {
            "key": "inv-hpio-value-1",
            "severity": "error",
            "human": "HPI-O prefix is 800362",
            "expression": "value.startsWith('800362')"
          },
          {
            "key": "inv-hpio-value-2",
            "requirements": "HPI-O shall pass the Luhn algorithm check",
            "severity": "error",
            "human": "The identifier shall pass the Luhn algorithm check",
            "expression": "(((select(value.substring(0,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(1,1).toInteger())+(select(value.substring(2,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(3,1).toInteger())+(select(value.substring(4,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(5,1).toInteger())+(select(value.substring(6,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(7,1).toInteger())+(select(value.substring(8,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(9,1).toInteger())+(select(value.substring(10,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(11,1).toInteger())+(select(value.substring(12,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(13,1).toInteger())+(select(value.substring(14,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(15,1).toInteger()))mod 10=0)"
          }
        ]
      },
      {
        "id": "Organization.identifier:hpio.type",
        "path": "Organization.identifier.type",
        "short": "Identifier type for HPI-O",
        "definition": "Healthcare Provider Identifier – Organisation (HPI-O) identifier type.",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://hl7.org.au/fhir/v2/0203",
              "code": "NOI"
            }
          ]
        },
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "IdentifierType"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "required",
          "description": "Local identifier type",
          "valueSetReference": {
            "reference": "http://hl7.org.au/fhir/ValueSet/au-hl7v2-0203"
          }
        }
      },
      {
        "id": "Organization.identifier:hpio.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Organization.identifier.type.text",
        "definition": "hpi-o",
        "fixedString": "HPI-O"
      },
      {
        "id": "Organization.identifier:hpio.system",
        "path": "Organization.identifier.system",
        "short": "Namespace for HPI-O",
        "definition": "This namespace is used for qualified identifiers to represent Healthcare Provider Identifier for Organisations (HPI-O) numbers. An example of the syntax of a HPI-O represented as a qualified identifer using this namespace is: http://ns.electronichealth.net.au/id/hi/hpio/1.0/8003620000000000",
        "min": 1,
        "fixedUri": "http://ns.electronichealth.net.au/id/hi/hpio/1.0"
      },
      {
        "id": "Organization.identifier:hpio.value",
        "path": "Organization.identifier.value",
        "short": "HPI-O number",
        "definition": "Identifier for the organization that is used to identify the organization across multiple disparate systems.",
        "min": 1,
        "example": [
          {
            "label": "HPI-O number",
            "valueString": "8003621566684455"
          }
        ],
        "maxLength": 16
      },
      {
        "id": "Organization.identifier:abn",
        "path": "Organization.identifier",
        "sliceName": "abn",
        "short": "Australian Business Number (ABN)",
        "definition": "Australian Securities and Investment Commission (ASIC) assigned identifier for business/entity. ABN (Australian Business Number).",
        "constraint": [
          {
            "key": "inv-asic-abn-length",
            "severity": "error",
            "human": "ABN shall be exactly 11 digits",
            "expression": "value.length()=11"
          }
        ]
      },
      {
        "id": "Organization.identifier:abn.type",
        "path": "Organization.identifier.type",
        "short": "Coded identifier type for ABN"
      },
      {
        "id": "Organization.identifier:abn.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Organization.identifier.type.text",
        "fixedString": "ABN"
      },
      {
        "id": "Organization.identifier:abn.system",
        "path": "Organization.identifier.system",
        "short": "Namespace for ABN",
        "min": 1,
        "fixedUri": "http://hl7.org.au/id/abn"
      },
      {
        "id": "Organization.identifier:abn.value",
        "path": "Organization.identifier.value",
        "short": "ABN",
        "definition": "Australian Business Number (ABN) identifier .",
        "min": 1
      },
      {
        "id": "Organization.identifier:acn",
        "path": "Organization.identifier",
        "sliceName": "acn",
        "short": "Australian Company Number (ACN)",
        "definition": "Australian Securities and Investment Commission (ASIC) assigned identifier for business/entity. ACN (Australian Company Number).",
        "constraint": [
          {
            "key": "inv-asic-acn-length",
            "severity": "error",
            "human": "ACN shall be exactly 9 digits",
            "expression": "value.length()=9"
          }
        ]
      },
      {
        "id": "Organization.identifier:acn.type",
        "path": "Organization.identifier.type",
        "short": "Coded identifier type for ACN"
      },
      {
        "id": "Organization.identifier:acn.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Organization.identifier.type.text",
        "fixedString": "ACN"
      },
      {
        "id": "Organization.identifier:acn.system",
        "path": "Organization.identifier.system",
        "short": "Namespace for ACN",
        "min": 1,
        "fixedUri": "http://hl7.org.au/id/acn"
      },
      {
        "id": "Organization.identifier:acn.value",
        "path": "Organization.identifier.value",
        "short": "ACN",
        "definition": "Australian Company Number (ACN) identifier",
        "min": 1
      },
      {
        "id": "Organization.identifier:arbn",
        "path": "Organization.identifier",
        "sliceName": "arbn",
        "short": "Australian Registered Body Number (ARBN)",
        "definition": "Australian Securities and Investment Commission (ASIC) assigned identifier for business/entity. ARBN (Australian Registered Body Number).",
        "constraint": [
          {
            "key": "inv-asic-arbn-length",
            "severity": "error",
            "human": "ARBN shall be exactly 9 digits",
            "expression": "value.length()=9"
          }
        ]
      },
      {
        "id": "Organization.identifier:arbn.type",
        "path": "Organization.identifier.type",
        "binding": {
          "strength": "extensible",
          "valueSetUri": "http://hl7.org/fhir/ValueSet/identifier-type"
        }
      },
      {
        "id": "Organization.identifier:arbn.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Organization.identifier.type.text",
        "fixedString": "ARBN"
      },
      {
        "id": "Organization.identifier:arbn.system",
        "path": "Organization.identifier.system",
        "short": "Namespace for ARBN",
        "min": 1,
        "fixedUri": "http://hl7.org.au/id/arbn"
      },
      {
        "id": "Organization.identifier:arbn.value",
        "path": "Organization.identifier.value",
        "short": "ARBN",
        "definition": "Australian Registered Body Number (ARBN) identifier.",
        "min": 1
      },
      {
        "id": "Organization.identifier:paio",
        "path": "Organization.identifier",
        "sliceName": "paio",
        "short": "My Health Record Assigned Identity for Organisations (PAI-O)",
        "definition": "My Health Record Assigned Identity for Organisations (PAI-O).",
        "constraint": [
          {
            "key": "inv-paio-value-0",
            "severity": "error",
            "human": "PAI-O shall be an exactly 16 digit number",
            "expression": "value.matches('^([0-9]{16})$')"
          },
          {
            "key": "inv-paio-value-1",
            "severity": "error",
            "human": "PAI-O prefix is 800364",
            "expression": "value.startsWith('800364')"
          },
          {
            "key": "inv-paio-value-2",
            "requirements": "PAI-O shall pass the Luhn algorithm check",
            "severity": "error",
            "human": "The identifier shall pass the Luhn algorithm check",
            "expression": "(((select(value.substring(0,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(1,1).toInteger())+(select(value.substring(2,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(3,1).toInteger())+(select(value.substring(4,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(5,1).toInteger())+(select(value.substring(6,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(7,1).toInteger())+(select(value.substring(8,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(9,1).toInteger())+(select(value.substring(10,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(11,1).toInteger())+(select(value.substring(12,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(13,1).toInteger())+(select(value.substring(14,1).toInteger()).select(iif($this<5, $this*2, (($this*2)-9))))+(value.substring(15,1).toInteger()))mod 10=0)"
          }
        ]
      },
      {
        "id": "Organization.identifier:paio.type",
        "path": "Organization.identifier.type",
        "short": "Identifier type for PAI-O",
        "definition": "Element describing the type of identifier"
      },
      {
        "id": "Organization.identifier:paio.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Organization.identifier.type.text",
        "fixedString": "PAI-O"
      },
      {
        "id": "Organization.identifier:paio.system",
        "path": "Organization.identifier.system",
        "short": "Namespace for PAI-O",
        "definition": "This namespace is used for qualified identifiers to represent My Health Record (PCEHR) Assigned Identity for Organisations (PAI-O) numbers. This is an organisational identifier for organisations who are not eligible for an Healthcare Provider Identifier – Organisation (HPI-O). When represented as an OID, the prefix would be 1.2.36.1.2001.1007.1 An example of the syntax of a PAI-O represented as a qualified identifier using this namespace is:  http://ns.electronichealth.net.au/id/pcehr/paio/1.0/800364wwwwxxxxxz where:   wwww is '0001' is the resource management partition; xxxxx is issued by the system operator; z is the check digit derived using ISO/IEC 7812 across the 15-digit number.",
        "min": 1,
        "fixedUri": "http://ns.electronichealth.net.au/id/pcehr/paio/1.0"
      },
      {
        "id": "Organization.identifier:paio.value",
        "path": "Organization.identifier.value",
        "short": "PAI-O number",
        "definition": "PAI-O number",
        "min": 1,
        "example": [
          {
            "label": "PAI-O number",
            "valueString": "8003647500000328"
          }
        ],
        "maxLength": 16
      },
      {
        "id": "Organization.identifier:csp",
        "path": "Organization.identifier",
        "sliceName": "csp",
        "short": "Contracted Service Provider (CSP) Number",
        "definition": "Contracted Service Provider (CSP) number identifier for organisations",
        "constraint": [
          {
            "key": "inv-csp-0",
            "severity": "error",
            "human": "CSP number is exactly 16 characters",
            "expression": "value.length() = 16"
          },
          {
            "key": "inv-csp-1",
            "severity": "error",
            "human": "CSP number prefix is 800363",
            "expression": "value.startsWith('800363')"
          }
        ]
      },
      {
        "id": "Organization.identifier:csp.type",
        "path": "Organization.identifier.type",
        "short": "Identifier type for CSP number",
        "definition": "Element describing the type of identifier"
      },
      {
        "id": "Organization.identifier:csp.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Organization.identifier.type.text",
        "fixedString": "CSP"
      },
      {
        "id": "Organization.identifier:csp.system",
        "path": "Organization.identifier.system",
        "short": "Namespace for CSP number",
        "definition": "This namespace is used for qualified identifiers to represent Contracted Service Provider (CSP) numbers. An example of the syntax of a CSP number represented as a qualified identifer using this namespace is: http://ns.electronichealth.net.au/id/hi/csp/1.0/8003630000000000",
        "min": 1,
        "fixedUri": "http://ns.electronichealth.net.au/id/hi/csp/1.0"
      },
      {
        "id": "Organization.identifier:csp.value",
        "path": "Organization.identifier.value",
        "short": "CSP number",
        "definition": "This is an organisational identifier for organisations that are contracted service providers.",
        "min": 1,
        "example": [
          {
            "label": "CSP number",
            "valueString": "8003635500000327"
          }
        ],
        "maxLength": 16
      },
      {
        "id": "Organization.identifier:nataAccreditation",
        "path": "Organization.identifier",
        "sliceName": "nataAccreditation",
        "short": "National Association of Testing Authorities (NATA) Accreditation Number",
        "definition": "Identifier of an organization accredited by the National Association of Testing Authorities (NATA)"
      },
      {
        "id": "Organization.identifier:nataAccreditation.type",
        "path": "Organization.identifier.type",
        "short": "Identifier type for NATA accreditation number"
      },
      {
        "id": "Organization.identifier:nataAccreditation.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Organization.identifier.type.text",
        "fixedString": "NATA Accreditation Number"
      },
      {
        "id": "Organization.identifier:nataAccreditation.system",
        "path": "Organization.identifier.system",
        "short": "Namespace for NATA accreditation number",
        "min": 1,
        "fixedUri": "http://hl7.org.au/id/nata-accreditation"
      },
      {
        "id": "Organization.identifier:nataAccreditation.value",
        "path": "Organization.identifier.value",
        "short": "NATA accreditation number",
        "min": 1,
        "example": [
          {
            "label": "NATA accreditation number",
            "valueString": "24482"
          }
        ]
      }
    ]
  }
}