{ "$schema": "http://json-schema.org/draft-04/schema#", "$id": "https://github.com/tewhatuora/schemas/json-schema/Request-Context", "description": "JSON schema for request context custom header schema for apps integrating with HNZ FHIR APIs", "$comment": "This schema version 2.0 extends the original Request-Context.json public schema, adding new properties. Properties from the original version remain but some have been deprecated due to the improved support for HPI references in this version", "type": "object", "properties": { "userIdentifier": { "type": "string", "description": "The alphanumeric user id as known to the system they have signed into (which is consuming the FHIR API)", "example": "LJRHODE" }, "userRole": { "type": "string", "enum": [ "PAT", "PROV" ] }, "hpiPractitioner": { "type": "object", "description": "User health practitioner identification as an HPI FHIR reference", "properties": { "type": { "type": "string", "description": "Fixed to refer to FHIR Practitioner resource type", "example": "Practitioner", "pattern": "^Practitioner$" }, "identifier": { "type": "object", "description": "These attributes constitute a FHIR Identifier for an HPI Practitioner resource", "properties": { "use": { "type": "string", "description": "Fixed to official", "const": "official" }, "system": { "type": "string", "description": "Fixed to HPI Practitioner identifier system", "const": "https://standards.digital.health.nz/ns/hpi-person-id" }, "value": { "type": "string", "description": "The practitioner's Common Person Number or CPN as defined by the HPI Practitioner Index) in the form NNXXXX where N is numeric and X is Alphabetic", "pattern": "^[0-9]{2}[A-Z0-9]{4}$", "example": "91ZABY" } }, "required": ["value"] }, "display": { "type": "string", "description": "The full name of the practitioner", "example": "Lyndi Jane Rhode" } }, "required": ["type","identifier"] }, "registrationAuthorityNumber": { "type": "object", "description": "These three attributes constitute a FHIR Identifier defining the registration number issued to a practitioner by their RA", "properties": { "use": { "type": "string", "description": "Fixed to official", "const": "official" }, "system": { "type": "string", "description": "Url identifying the practitioner's registration authority/council from https://standards.digital.health.nz/ns/hpi-ra-identifier-code", "example": "https://standards.digital.health.nz/ns/medical-council-id" }, "value": { "type": "string", "description": "Number issued to the practitioner by their registration authority", "example": "123456" } }, "required": ["system","value"] }, "hpiFacility": { "type": "object", "description": "Identifies the health facility where the practitioner is located, as an HPI Facility (Location) FHIR Reference", "properties": { "type": { "type": "string", "description": "Fixed to refer to a FHIR Location resource type", "example": "Location", "pattern": "^Location$" }, "identifier": { "type": "object", "description": "These three attributes constitute a FHIR Identifier for an HPI Facility (Location) resource", "properties": { "use": { "type": "string", "description": "Fixed to official", "const": "official" }, "system": { "type": "string", "description": "Fixed to HPI Facility identifier system", "const": "https://standards.digital.health.nz/ns/hpi-facility-id" }, "value": { "type": "string", "description": "HPI Facility Id in the form FXXNNN-C where X is alphanumeric, N is numeric and C is a check character", "pattern": "^F[A-Z0-9]{2}[0-9]{3}-[A-Z]{1}$", "example": "FZZ958-K" } }, "required": ["value"] }, "display": { "type": "string", "description": "The display name of the health facility", "example": "Medical Centre Flat-Unit" } }, "required": ["type","identifier"] }, "hpiOrganisation": { "type": "object", "description": "Defines the health provider the user is currently working in, as an HPI Organisation FHIR Reference", "properties": { "type": { "type": "string", "description": "Fixed to refer to FHIR Organization resources", "example": "Organization", "pattern": "^Organization$" }, "identifier": { "type": "object", "description": "These three attributes constitute a FHIR Identifier for an HPI Organisation resource", "properties": { "use": { "type": "string", "description": "Fixed to official", "const": "official" }, "system": { "type": "string", "description": "Fixwed to HPI Organisation identifier system", "const": "https://standards.digital.health.nz/ns/hpi-organisation-id" }, "value": { "type": "string", "description": "HPI Organisation Id in the form GXXNNN-C where X is alphanumeric, N is numeric and C is a check character", "pattern": "^G[A-Z0-9]{2}[0-9]{3}-[A-Z]{1}$", "example": "GZZ956-B" } }, "required": [ "value"] }, "display": { "type": "string", "description": "The display name of the organisation", "example": "Flat-Unit Address Org" } }, "required": ["type","identifier"] }, "secondaryIdentifier": { "type": "object", "properties": { "use": { "type": "string" }, "system": { "type": "string" }, "value": { "type": "string" } }, "required": [ "use", "system", "value" ] }, "purposeOfUse": { "type": "array", "items": { "$ref": "#/definitions/purposeOfUseTypes" } }, "userFullName": { "type": "string", "example": "Dr. Jane Doe" }, "orgIdentifier": { "type": "string", "example": "O12345", "deprecated": true }, "facilityIdentifier": { "type": "string", "example": "F12345", "deprecated": true } }, "required": [ "userIdentifier", "purposeOfUse", "userFullName" ], "definitions": { "purposeOfUseTypes": { "$id": "purposeOfUseTypes", "type": "string", "enum": [ "PATRQT", "POPHLTH", "TREAT", "ETREAT", "PUBHLTH", "SCREENING", "SYSDEV" ] } }, "examples": [ { "userIdentifier": "minimal", "purposeOfUse": [ "ETREAT" ], "userFullName": "mini mouse" }, { "userIdentifier": "LJRHODE", "userRole": "PROVIDER", "registrationAuthorityNumber": { "system" : "https://standards.digital.health.nz/ns/medical-council-id", "value" : "123456" }, "hpiFacility": { "type": "Location", "identifier": { "value": "GZZ956-B" }, "display": "Medical Centre Flat-Unit" }, "hpiPractitioner": { "type": "Practitioner", "identifier": { "value" : "91ZABY" }, "display": "Lyndi Jane Rhode" }, "purposeOfUse": [ "SCREENING" ], "userFullName": "Lyndi Jane Rhode" }, { "userIdentifier": "eu occaecat eiusmod", "userRole": "PAT", "hpiPractitioner": { "type": "Practitioner", "identifier": { "use": "official", "system": "https://standards.digital.health.nz/ns/hpi-person-id", "value": "00N2PO" }, "display": "ut amet cupidatat in" }, "registrationAuthorityNumber": { "use": "official", "system": "voluptate in", "value": "consequat" }, "hpiFacility": { "type": "Location", "identifier": { "use": "official", "system": "https://standards.digital.health.nz/ns/hpi-facility-id", "value": "FS6482-U" }, "display": "esse quis" }, "hpiOrganisation": { "type": "Organization", "identifier": { "use": "official", "system": "https://standards.digital.health.nz/ns/hpi-organisation-id", "value": "G02793-L" }, "display": "proident minim exercitation aliqua" }, "secondaryIdentifier": { "use": "esse", "system": "in", "value": "do et adipisicing Duis eiusmod" }, "purposeOfUse": [ "PATRQT", "PUBHLTH", "PUBHLTH" ], "userFullName": "Lorem aute veniam", "orgIdentifier": "fugiat ut", "facilityIdentifier": "sunt in ut minim nostrud" } ] }