﻿{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/DeviceUseRequest",
  "$ref": "#/definitions/DeviceUseRequest",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "DeviceUseRequest": {
      "allOf": [
        {
          "$ref": "DomainResource.schema.json/definitions/DomainResource"
        },
        {
          "description": "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.",
          "properties": {
            "resourceType": {
              "description": "This is a DeviceUseRequest resource",
              "type": "string",
              "enum": [
                "DeviceUseRequest"
              ]
            },
            "identifier": {
              "description": "Identifiers assigned to this order by the orderer or by the receiver.",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json/definitions/Identifier"
              }
            },
            "definition": {
              "description": "Protocol or definition followed by this request. For example: The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "basedOn": {
              "description": "Plan/proposal/order fulfilled by this request.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "replaces": {
              "description": "The request takes the place of the referenced completed or terminated request(s).",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "requisition": {
              "description": "Composite request this is part of.",
              "$ref": "Identifier.schema.json/definitions/Identifier"
            },
            "status": {
              "description": "The status of the request.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "status_": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "stage": {
              "description": "Whether the request is a proposal, plan, an original order or a reflex order.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "deviceReference": {
              "description": "The details of the device to be used.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "deviceCodeableConcept": {
              "description": "The details of the device to be used.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "subject": {
              "description": "The patient who will use the device.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "context": {
              "description": "An encounter that provides additional context in which this request is made.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "occurrenceDateTime": {
              "description": "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".",
              "pattern": "-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?",
              "type": "string"
            },
            "occurrenceDateTime_": {
              "description": "Extensions for occurrenceDateTime",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "occurrencePeriod": {
              "description": "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".",
              "$ref": "Period.schema.json/definitions/Period"
            },
            "occurrenceTiming": {
              "description": "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".",
              "$ref": "Timing.schema.json/definitions/Timing"
            },
            "authored": {
              "description": "When the request transitioned to being actionable.",
              "type": "string",
              "pattern": "-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
            },
            "authored_": {
              "description": "Extensions for authored",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "requester": {
              "description": "Who/what is requesting diagnostics.  The practitioner that holds legal responsibility for ordering the investigation.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "performerType": {
              "description": "Desired type of performer for doing the diagnostic testing.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "performer": {
              "description": "The desired perfomer for doing the diagnostic testing.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "reasonCode": {
              "description": "Reason or justification for the use of this device.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
              }
            },
            "reasonReference": {
              "description": "Reason or justification for the use of this device.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "supportingInfo": {
              "description": "Additional clinical information about the patient that may influence the request fulfilment.  For example, this may includes body where on the subject\u0027s the device will be used ( i.e. the target site).",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "note": {
              "description": "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.",
              "type": "array",
              "items": {
                "$ref": "Annotation.schema.json/definitions/Annotation"
              }
            },
            "relevantHistory": {
              "description": "Key events in the history of the request.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            }
          },
          "required": [
            "stage",
            "subject",
            "resourceType"
          ]
        }
      ]
    }
  }
}