﻿{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/CarePlan",
  "$ref": "#/definitions/CarePlan",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "CarePlan": {
      "allOf": [
        {
          "$ref": "DomainResource.schema.json/definitions/DomainResource"
        },
        {
          "description": "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.",
          "properties": {
            "resourceType": {
              "description": "This is a CarePlan resource",
              "type": "string",
              "enum": [
                "CarePlan"
              ]
            },
            "identifier": {
              "description": "This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json/definitions/Identifier"
              }
            },
            "subject": {
              "description": "Identifies the patient or group whose intended care is described by the plan.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "status": {
              "description": "Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "status_": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "context": {
              "description": "Identifies the context in which this particular CarePlan is defined.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "period": {
              "description": "Indicates when the plan did (or is intended to) come into effect and end.",
              "$ref": "Period.schema.json/definitions/Period"
            },
            "author": {
              "description": "Identifies the individual(s) or ogranization who is responsible for the content of the care plan.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "modified": {
              "description": "Identifies the most recent date on which the plan has been revised.",
              "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)))?)?)?"
            },
            "modified_": {
              "description": "Extensions for modified",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "category": {
              "description": "Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
              }
            },
            "description": {
              "description": "A description of the scope and nature of the plan.",
              "type": "string"
            },
            "description_": {
              "description": "Extensions for description",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "addresses": {
              "description": "Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "support": {
              "description": "Identifies portions of the patient\u0027s record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "relatedPlan": {
              "description": "Identifies CarePlans with some sort of formal relationship to the current plan.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/CarePlan.RelatedPlan"
              }
            },
            "careTeam": {
              "description": "Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "goal": {
              "description": "Describes the intended objective(s) of carrying out the care plan.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "activity": {
              "description": "Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/CarePlan.Activity"
              }
            },
            "note": {
              "description": "General notes about the care plan not covered elsewhere.",
              "$ref": "Annotation.schema.json/definitions/Annotation"
            }
          },
          "required": [
            "resourceType"
          ]
        }
      ]
    },
    "CarePlan.RelatedPlan": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.",
          "properties": {
            "code": {
              "description": "Identifies the type of relationship this plan has to the target plan.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "code_": {
              "description": "Extensions for code",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "plan": {
              "description": "A reference to the plan to which a relationship is asserted.",
              "$ref": "Reference.schema.json/definitions/Reference"
            }
          },
          "required": [
            "plan"
          ]
        }
      ]
    },
    "CarePlan.Activity": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.",
          "properties": {
            "actionResulting": {
              "description": "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "outcome": {
              "description": "Results of the careplan activity.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "progress": {
              "description": "Notes about the adherence/status/progress of the activity.",
              "type": "array",
              "items": {
                "$ref": "Annotation.schema.json/definitions/Annotation"
              }
            },
            "reference": {
              "description": "The details of the proposed activity represented in a specific resource.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "detail": {
              "description": "A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn\u0027t know about specific resources such as procedure etc.",
              "$ref": "#/definitions/CarePlan.Detail"
            }
          }
        }
      ]
    },
    "CarePlan.Detail": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.",
          "properties": {
            "category": {
              "description": "High-level categorization of the type of activity in a care plan.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "definition": {
              "description": "Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "code": {
              "description": "Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "reasonCode": {
              "description": "Provides the rationale that drove the inclusion of this particular activity as part of the plan.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
              }
            },
            "reasonReference": {
              "description": "Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "goal": {
              "description": "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "status": {
              "description": "Identifies what progress is being made for the specific activity.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "status_": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "statusReason": {
              "description": "Provides reason why the activity isn\u0027t yet started, is on hold, was cancelled, etc.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "prohibited": {
              "description": "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.",
              "type": "true | false"
            },
            "prohibited_": {
              "description": "Extensions for prohibited",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "scheduledTiming": {
              "description": "The period, timing or frequency upon which the described activity is to occur.",
              "$ref": "Timing.schema.json/definitions/Timing"
            },
            "scheduledPeriod": {
              "description": "The period, timing or frequency upon which the described activity is to occur.",
              "$ref": "Period.schema.json/definitions/Period"
            },
            "scheduledString": {
              "description": "The period, timing or frequency upon which the described activity is to occur.",
              "type": "string"
            },
            "scheduledString_": {
              "description": "Extensions for scheduledString",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "location": {
              "description": "Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "performer": {
              "description": "Identifies who\u0027s expected to be involved in the activity.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "productCodeableConcept": {
              "description": "Identifies the food, drug or other product to be consumed or supplied in the activity.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "productReference": {
              "description": "Identifies the food, drug or other product to be consumed or supplied in the activity.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "dailyAmount": {
              "description": "Identifies the quantity expected to be consumed in a given day.",
              "$ref": "SimpleQuantity.schema.json/definitions/SimpleQuantity"
            },
            "quantity": {
              "description": "Identifies the quantity expected to be supplied, administered or consumed by the subject.",
              "$ref": "SimpleQuantity.schema.json/definitions/SimpleQuantity"
            },
            "description": {
              "description": "This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.",
              "type": "string"
            },
            "description_": {
              "description": "Extensions for description",
              "$ref": "Element.schema.json/definitions/Element"
            }
          }
        }
      ]
    }
  }
}