{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/OrganizationRole",
  "$ref": "#/definitions/OrganizationRole",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "OrganizationRole": {
      "allOf": [
        {
          "$ref": "DomainResource#/definitions/DomainResource"
        },
        {
          "description": "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.",
          "properties": {
            "resourceType": {
              "description": "This is a OrganizationRole resource",
              "type": "string",
              "const": "OrganizationRole",
              "enum": [
                "OrganizationRole"
              ]
            },
            "identifier": {
              "description": "Business Identifiers that are specific to a role/location.",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json#/definitions/Identifier"
              }
            },
            "active": {
              "description": "Whether this practitioner role record is in active use.",
              "type": "boolean",
              "pattern": "true|false"
            },
            "_active": {
              "description": "Extensions for active",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "period": {
              "description": "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.",
              "$ref": "Period.schema.json#/definitions/Period"
            },
            "organization": {
              "description": "The organization where the Practitioner performs the roles associated.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "participatingOrganization": {
              "description": "Practitioner that is able to provide the defined services for the organization.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "network": {
              "description": "The network(s) this association applies to (if any).",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "code": {
              "description": "Roles which this practitioner is authorized to perform for the organization.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
              }
            },
            "specialty": {
              "description": "Specific specialty of the practitioner.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
              }
            },
            "location": {
              "description": "The location(s) at which this practitioner provides care.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "healthcareService": {
              "description": "The list of healthcare services that this worker provides for this role\u0027s Organization/Location(s).",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "telecom": {
              "description": "Contact details that are specific to the role/location/service.",
              "type": "array",
              "items": {
                "$ref": "ContactPoint.schema.json#/definitions/ContactPoint"
              }
            },
            "availableTime": {
              "description": "A collection of times that the Service Site is available.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganizationRole_AvailableTime"
              }
            },
            "notAvailable": {
              "description": "The HealthcareService is not available during this period of time due to the provided reason.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/OrganizationRole_NotAvailable"
              }
            },
            "availabilityExceptions": {
              "description": "A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.",
              "type": "string",
              "pattern": "\\s*(\\S|\\s)*"
            },
            "_availabilityExceptions": {
              "description": "Extensions for availabilityExceptions",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "endpoint": {
              "description": "Technical endpoints providing access to services operated for the practitioner with this role.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            }
          },
          "required": [
            "resourceType"
          ]
        }
      ]
    },
    "OrganizationRole_AvailableTime": {
      "allOf": [
        {
          "$ref": "BackboneElement#/definitions/BackboneElement"
        },
        {
          "description": "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.",
          "properties": {
            "daysOfWeek": {
              "description": "Indicates which days of the week are available between the start and end Times.",
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "[^\\s]+(\\s[^\\s]+)*"
              }
            },
            "_daysOfWeek": {
              "description": "Extensions for daysOfWeek",
              "type": "array",
              "items": {
                "$ref": "Element.schema.json#/definitions/Element"
              }
            },
            "allDay": {
              "description": "Is this always available? (hence times are irrelevant) e.g. 24 hour service.",
              "type": "boolean",
              "pattern": "true|false"
            },
            "_allDay": {
              "description": "Extensions for allDay",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "availableStartTime": {
              "description": "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.",
              "type": "string",
              "pattern": "([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?"
            },
            "_availableStartTime": {
              "description": "Extensions for availableStartTime",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "availableEndTime": {
              "description": "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.",
              "type": "string",
              "pattern": "([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?"
            },
            "_availableEndTime": {
              "description": "Extensions for availableEndTime",
              "$ref": "Element.schema.json#/definitions/Element"
            }
          }
        }
      ]
    },
    "OrganizationRole_NotAvailable": {
      "allOf": [
        {
          "$ref": "BackboneElement#/definitions/BackboneElement"
        },
        {
          "description": "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.",
          "properties": {
            "description": {
              "description": "The reason that can be presented to the user as to why this time is not available.",
              "type": "string",
              "pattern": "\\s*(\\S|\\s)*"
            },
            "_description": {
              "description": "Extensions for description",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "during": {
              "description": "Service is not available (seasonally or for a public holiday) from this date.",
              "$ref": "Period.schema.json#/definitions/Period"
            }
          }
        }
      ]
    }
  }
}