{
  "resourceType": "StructureDefinition",
  "id": "au-practitioner",
  "url": "http://hl7.org.au/fhir/StructureDefinition/au-practitioner",
  "version": "1.1.0",
  "name": "AUBasePractitioner",
  "title": "AU Base Practitioner",
  "status": "draft",
  "date": "2017-03-11T06:30:54+00:00",
  "publisher": "Health Level Seven Australia (Patient Administration WG)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org.au",
          "use": "work"
        }
      ]
    }
  ],
  "description": "This profile defines a practitioner administration details structure that includes core localisation concepts for use in an Australian context.",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Practitioner",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Practitioner",
  "derivation": "constraint",
  "snapshot": {},
  "differential": {
    "element": [
      {
        "id": "Practitioner",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "trial-use"
          }
        ],
        "path": "Practitioner",
        "short": "A practitioner in an Australian healthcare context"
      },
      {
        "id": "Practitioner.identifier",
        "path": "Practitioner.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "type"
            },
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Practitioner.identifier:hpii",
        "path": "Practitioner.identifier",
        "sliceName": "hpii",
        "short": "Healthcare Provider Identifier – Individual (HPI-I)",
        "definition": "National identifier Healthcare Provider Identifier for Individuals (HPI-I).",
        "max": "1",
        "constraint": [
          {
            "key": "inv-hpii-value-0",
            "requirements": "The value shall be a 16 digit number.",
            "severity": "error",
            "human": "HPI-I shall be an exactly 16 digit number",
            "expression": "value.matches('^([0-9]{16})$')"
          },
          {
            "key": "inv-hpii-value-1",
            "severity": "error",
            "human": "HPI-I prefix is 800361",
            "expression": "value.startsWith('800361')"
          },
          {
            "key": "inv-hpii-value-2",
            "requirements": "HPI-I 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": "Practitioner.identifier:hpii.type",
        "path": "Practitioner.identifier.type",
        "short": "Coded identifier type for HPI-I",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://hl7.org/fhir/v2/0203",
              "code": "NPI"
            }
          ]
        },
        "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": "Practitioner.identifier:hpii.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Practitioner.identifier.type.text",
        "fixedString": "HPI-I"
      },
      {
        "id": "Practitioner.identifier:hpii.system",
        "path": "Practitioner.identifier.system",
        "short": "Namespace for HPI-I",
        "definition": "This namespace is used for qualified identifiers to represent Healthcare Providier Identifier for Individuals (HPI-I) numbers. An example of the syntax of a HPI-I represented as a qualified identifer using this namespace is: http://ns.electronichealth.net.au/id/hi/hpii/1.0/8003610000000000",
        "min": 1,
        "fixedUri": "http://ns.electronichealth.net.au/id/hi/hpii/1.0"
      },
      {
        "id": "Practitioner.identifier:hpii.value",
        "path": "Practitioner.identifier.value",
        "short": "HPI-I number",
        "min": 1,
        "example": [
          {
            "label": "HPI-I number",
            "valueString": "8003619900015717"
          }
        ],
        "maxLength": 16
      },
      {
        "id": "Practitioner.identifier:medicarePrescriberNumber",
        "path": "Practitioner.identifier",
        "sliceName": "medicarePrescriberNumber",
        "short": "Medicare Prescriber Number",
        "definition": "Medicare Australia allocated prescriber number."
      },
      {
        "id": "Practitioner.identifier:medicarePrescriberNumber.type",
        "path": "Practitioner.identifier.type",
        "short": "Coded identifier type for prescriber number",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://hl7.org.au/fhir/v2/0203",
              "code": "PRES"
            }
          ]
        },
        "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": "Practitioner.identifier:medicarePrescriberNumber.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Practitioner.identifier.type.text",
        "fixedString": "Prescriber Number"
      },
      {
        "id": "Practitioner.identifier:medicarePrescriberNumber.system",
        "path": "Practitioner.identifier.system",
        "short": "Namespace for prescriber number",
        "min": 1,
        "fixedUri": "http://ns.electronichealth.net.au/id/medicare-prescriber-number"
      },
      {
        "id": "Practitioner.identifier:medicarePrescriberNumber.value",
        "path": "Practitioner.identifier.value",
        "short": "Medicare Prescriber number",
        "min": 1,
        "example": [
          {
            "label": "prescriber number",
            "valueString": "453221"
          }
        ]
      },
      {
        "id": "Practitioner.identifier:careAgencyEmployeeIdentifier",
        "path": "Practitioner.identifier",
        "sliceName": "careAgencyEmployeeIdentifier",
        "short": "Care Agency Employee (CAE) Identifier",
        "definition": "An identifier that applies to this person in this role. This identifier is used for qualified identifiers to represent a My Health Record Care Agency Employees Identifier (CAE-I) numbers.",
        "constraint": [
          {
            "key": "inv-caei-value-0",
            "requirements": "The value shall be a 16 digit number.",
            "severity": "error",
            "human": "CAE identifier shall be an exactly 16 digit number",
            "expression": "value.matches('^([0-9]{16})$')"
          },
          {
            "key": "inv-caei-value-1",
            "severity": "error",
            "human": "CAE identifier shall contain a prefix of 900360",
            "expression": "value.startsWith('900360')"
          },
          {
            "key": "inv-caei-value-2",
            "severity": "error",
            "human": "CAE 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": "Practitioner.identifier:careAgencyEmployeeIdentifier.type",
        "path": "Practitioner.identifier.type",
        "short": "Identifier type for CAE identifier",
        "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": "Practitioner.identifier:careAgencyEmployeeIdentifier.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Practitioner.identifier.type.text",
        "fixedString": "Care Agency Employee Identifier"
      },
      {
        "id": "Practitioner.identifier:careAgencyEmployeeIdentifier.system",
        "path": "Practitioner.identifier.system",
        "short": "Namespace for CAE identifier",
        "min": 1,
        "fixedUri": "http://ns.electronichealth.net.au/id/pcehr/caei/1.0"
      },
      {
        "id": "Practitioner.identifier:careAgencyEmployeeIdentifier.value",
        "path": "Practitioner.identifier.value",
        "short": "CAE identifier number",
        "min": 1
      },
      {
        "id": "Practitioner.identifier:ahpraRegistration",
        "path": "Practitioner.identifier",
        "sliceName": "ahpraRegistration",
        "short": "Australian Health Practitioner Regulation Agency (AHPRA) registration as identifier",
        "definition": "Details of registration identifier of the Australian Health Practitioner Regulation Authority (AHPRA).",
        "constraint": [
          {
            "key": "inv-ahpra-value-id-0",
            "severity": "error",
            "human": "The AHPRA identifier value shall start with 3 uppercase letters, followed by 10 digits.",
            "expression": "value.matches('^[A-Z]{3}[0-9]{10}$')"
          }
        ]
      },
      {
        "id": "Practitioner.identifier:ahpraRegistration.type",
        "path": "Practitioner.identifier.type",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://hl7.org.au/fhir/v2/0203",
              "code": "AHPRA"
            }
          ]
        },
        "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": "Practitioner.identifier:ahpraRegistration.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Practitioner.identifier.type.text",
        "min": 1,
        "fixedString": "AHPRA Registration Number"
      },
      {
        "id": "Practitioner.identifier:ahpraRegistration.system",
        "path": "Practitioner.identifier.system",
        "min": 1,
        "fixedUri": "http://hl7.org.au/id/ahpra-registration-number"
      },
      {
        "id": "Practitioner.identifier:ahpraRegistration.value",
        "path": "Practitioner.identifier.value",
        "min": 1,
        "example": [
          {
            "label": "AHPRA registration number",
            "valueString": "ANZ1234567890"
          }
        ]
      },
      {
        "id": "Practitioner.qualification",
        "path": "Practitioner.qualification",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "identifier.system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration",
        "path": "Practitioner.qualification",
        "sliceName": "ahpraRegistration",
        "short": "Australian Health Practitioner Regulation Agency (AHPRA) qualification details",
        "definition": "Details of registration with the Australian Health Practitioner Regulation Authority (AHPRA)."
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration.identifier",
        "path": "Practitioner.qualification.identifier",
        "short": "AHPRA Registration Number",
        "min": 1,
        "max": "1",
        "constraint": [
          {
            "key": "inv-ahpra-qual-value-0",
            "severity": "error",
            "human": "The AHPRA registration value shall start with 3 uppercase letters, followed by 10 digits.",
            "expression": "value.matches('^[A-Z]{3}[0-9]{10}$')"
          }
        ]
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration.identifier.type",
        "path": "Practitioner.qualification.identifier.type",
        "short": "Coded identifier type for AHPRA registration number",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://hl7.org.au/fhir/v2/0203",
              "code": "AHPRA"
            }
          ]
        },
        "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": "Practitioner.qualification:ahpraRegistration.identifier.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Practitioner.qualification.identifier.type.text",
        "min": 1,
        "fixedString": "AHPRA Registration Number"
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration.identifier.system",
        "path": "Practitioner.qualification.identifier.system",
        "short": "Namespace for AHPRA registration number",
        "min": 1,
        "fixedUri": "http://hl7.org.au/id/ahpra-registration-number"
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration.identifier.value",
        "path": "Practitioner.qualification.identifier.value",
        "short": "AHPRA registration number",
        "min": 1,
        "example": [
          {
            "label": "AHPRA registration number",
            "valueString": "ANZ1234567890"
          }
        ]
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration.code",
        "path": "Practitioner.qualification.code",
        "short": "AHPRA codings",
        "definition": "AHPRA registration type, sub-type, profession, division and specialty."
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration.code.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Practitioner.qualification.code.text",
        "short": "AHPRA Registration Role",
        "min": 1
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration.issuer",
        "path": "Practitioner.qualification.issuer",
        "min": 1
      },
      {
        "id": "Practitioner.qualification:ahpraRegistration.issuer.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Practitioner.qualification.issuer.display",
        "min": 1,
        "fixedString": "AHPRA"
      },
      {
        "id": "Practitioner.communication",
        "path": "Practitioner.communication",
        "binding": {
          "strength": "extensible",
          "valueSetReference": {
            "reference": "https://healthterminologies.gov.au/fhir/ValueSet/common-languages-australia-2"
          }
        }
      }
    ]
  }
}