{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/RequestGroup",
  "$ref": "#/definitions/RequestGroup",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "RequestGroup": {
      "allOf": [
        {
          "$ref": "DomainResource#/definitions/DomainResource"
        },
        {
          "description": "A group of related requests that can be used to capture intended activities that have inter-dependencies such as \"give this medication after that one\".",
          "properties": {
            "resourceType": {
              "description": "This is a RequestGroup resource",
              "type": "string",
              "enum": [
                "RequestGroup"
              ]
            },
            "identifier": {
              "description": "Allows a service to provide a unique, business identifier for the request.",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json#/definitions/Identifier"
              }
            },
            "definition": {
              "description": "A protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "basedOn": {
              "description": "A plan, proposal or order that is fulfilled in whole or in part by this request.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "replaces": {
              "description": "Completed or terminated request(s) whose function is taken by this new request.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "groupIdentifier": {
              "description": "A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.",
              "$ref": "Identifier.schema.json#/definitions/Identifier"
            },
            "status": {
              "description": "The current state of the request. For request groups, the status reflects the status of all the requests in the group.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_status": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "intent": {
              "description": "Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_intent": {
              "description": "Extensions for intent",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "priority": {
              "description": "Indicates how quickly the request should be addressed with respect to other requests.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_priority": {
              "description": "Extensions for priority",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "subject": {
              "description": "The subject for which the request group was created.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "context": {
              "description": "Describes the context of the request group, if any.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "authoredOn": {
              "description": "Indicates when the request group was created.",
              "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)))?)?)?"
            },
            "_authoredOn": {
              "description": "Extensions for authoredOn",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "author": {
              "description": "Provides a reference to the author of the request group.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "reasonCodeableConcept": {
              "description": "Indicates the reason the request group was created. This is typically provided as a parameter to the evaluation and echoed by the service, although for some use cases, such as subscription- or event-based scenarios, it may provide an indication of the cause for the response.",
              "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
            },
            "reasonReference": {
              "description": "Indicates the reason the request group was created. This is typically provided as a parameter to the evaluation and echoed by the service, although for some use cases, such as subscription- or event-based scenarios, it may provide an indication of the cause for the response.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "note": {
              "description": "Provides a mechanism to communicate additional information about the response.",
              "type": "array",
              "items": {
                "$ref": "Annotation.schema.json#/definitions/Annotation"
              }
            },
            "action": {
              "description": "The actions, if any, produced by the evaluation of the artifact.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/RequestGroup_Action"
              }
            }
          },
          "required": [
            "resourceType"
          ]
        }
      ]
    },
    "RequestGroup_Action": {
      "allOf": [
        {
          "$ref": "BackboneElement#/definitions/BackboneElement"
        },
        {
          "description": "A group of related requests that can be used to capture intended activities that have inter-dependencies such as \"give this medication after that one\".",
          "properties": {
            "label": {
              "description": "A user-visible label for the action.",
              "type": "string"
            },
            "_label": {
              "description": "Extensions for label",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "title": {
              "description": "The title of the action displayed to a user.",
              "type": "string"
            },
            "_title": {
              "description": "Extensions for title",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "description": {
              "description": "A short description of the action used to provide a summary to display to the user.",
              "type": "string"
            },
            "_description": {
              "description": "Extensions for description",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "textEquivalent": {
              "description": "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.",
              "type": "string"
            },
            "_textEquivalent": {
              "description": "Extensions for textEquivalent",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "code": {
              "description": "A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a the section of a documentation template.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
              }
            },
            "documentation": {
              "description": "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.",
              "type": "array",
              "items": {
                "$ref": "RelatedArtifact.schema.json#/definitions/RelatedArtifact"
              }
            },
            "condition": {
              "description": "An expression that describes applicability criteria, or start/stop conditions for the action.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/RequestGroup_Condition"
              }
            },
            "relatedAction": {
              "description": "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".",
              "type": "array",
              "items": {
                "$ref": "#/definitions/RequestGroup_RelatedAction"
              }
            },
            "timingDateTime": {
              "description": "An optional value describing when the action should be performed.",
              "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"
            },
            "_timingDateTime": {
              "description": "Extensions for timingDateTime",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "timingPeriod": {
              "description": "An optional value describing when the action should be performed.",
              "$ref": "Period.schema.json#/definitions/Period"
            },
            "timingDuration": {
              "description": "An optional value describing when the action should be performed.",
              "$ref": "Duration.schema.json#/definitions/Duration"
            },
            "timingRange": {
              "description": "An optional value describing when the action should be performed.",
              "$ref": "Range.schema.json#/definitions/Range"
            },
            "timingTiming": {
              "description": "An optional value describing when the action should be performed.",
              "$ref": "Timing.schema.json#/definitions/Timing"
            },
            "participant": {
              "description": "The participant that should perform or be responsible for this action.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "type": {
              "description": "The type of action to perform (create, update, remove).",
              "$ref": "Coding.schema.json#/definitions/Coding"
            },
            "groupingBehavior": {
              "description": "Defines the grouping behavior for the action and its children.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_groupingBehavior": {
              "description": "Extensions for groupingBehavior",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "selectionBehavior": {
              "description": "Defines the selection behavior for the action and its children.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_selectionBehavior": {
              "description": "Extensions for selectionBehavior",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "requiredBehavior": {
              "description": "Defines the requiredness behavior for the action.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_requiredBehavior": {
              "description": "Extensions for requiredBehavior",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "precheckBehavior": {
              "description": "Defines whether the action should usually be preselected.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_precheckBehavior": {
              "description": "Extensions for precheckBehavior",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "cardinalityBehavior": {
              "description": "Defines whether the action can be selected multiple times.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_cardinalityBehavior": {
              "description": "Extensions for cardinalityBehavior",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "resource": {
              "description": "The resource that is the target of the action (e.g. CommunicationRequest).",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "action": {
              "description": "Sub actions.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/RequestGroup_Action"
              }
            }
          }
        }
      ]
    },
    "RequestGroup_Condition": {
      "allOf": [
        {
          "$ref": "BackboneElement#/definitions/BackboneElement"
        },
        {
          "description": "A group of related requests that can be used to capture intended activities that have inter-dependencies such as \"give this medication after that one\".",
          "properties": {
            "kind": {
              "description": "The kind of condition.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_kind": {
              "description": "Extensions for kind",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "description": {
              "description": "A brief, natural language description of the condition that effectively communicates the intended semantics.",
              "type": "string"
            },
            "_description": {
              "description": "Extensions for description",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "language": {
              "description": "The media type of the language for the expression.",
              "type": "string"
            },
            "_language": {
              "description": "Extensions for language",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "expression": {
              "description": "An expression that returns true or false, indicating whether or not the condition is satisfied.",
              "type": "string"
            },
            "_expression": {
              "description": "Extensions for expression",
              "$ref": "Element.schema.json#/definitions/Element"
            }
          }
        }
      ]
    },
    "RequestGroup_RelatedAction": {
      "allOf": [
        {
          "$ref": "BackboneElement#/definitions/BackboneElement"
        },
        {
          "description": "A group of related requests that can be used to capture intended activities that have inter-dependencies such as \"give this medication after that one\".",
          "properties": {
            "actionId": {
              "description": "The element id of the action this is related to.",
              "type": "string",
              "pattern": "[A-Za-z0-9\\-\\.]{1,64}"
            },
            "_actionId": {
              "description": "Extensions for actionId",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "relationship": {
              "description": "The relationship of this action to the related action.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_relationship": {
              "description": "Extensions for relationship",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "offsetDuration": {
              "description": "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.",
              "$ref": "Duration.schema.json#/definitions/Duration"
            },
            "offsetRange": {
              "description": "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.",
              "$ref": "Range.schema.json#/definitions/Range"
            }
          }
        }
      ]
    }
  }
}