﻿{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/RiskAssessment",
  "$ref": "#/definitions/RiskAssessment",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "RiskAssessment": {
      "allOf": [
        {
          "$ref": "DomainResource.schema.json/definitions/DomainResource"
        },
        {
          "description": "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.",
          "properties": {
            "resourceType": {
              "description": "This is a RiskAssessment resource",
              "type": "string",
              "enum": [
                "RiskAssessment"
              ]
            },
            "identifier": {
              "description": "Business identifier assigned to the risk assessment.",
              "$ref": "Identifier.schema.json/definitions/Identifier"
            },
            "basedOn": {
              "description": "A reference to the request that is fulfilled by this risk assessment.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "parent": {
              "description": "A reference to a resource that this risk assessment is part of, such as a Procedure.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "status": {
              "description": "The status of the RiskAssessment, using the same statuses as an Observation.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "status_": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "code": {
              "description": "The type of the risk assessment performed.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "subject": {
              "description": "The patient or group the risk assessment applies to.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "context": {
              "description": "The encounter where the assessment was performed.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "occurrenceDateTime": {
              "description": "The date (and possibly time) the risk assessment was 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"
            },
            "occurrenceDateTime_": {
              "description": "Extensions for occurrenceDateTime",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "occurrencePeriod": {
              "description": "The date (and possibly time) the risk assessment was performed.",
              "$ref": "Period.schema.json/definitions/Period"
            },
            "condition": {
              "description": "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "performer": {
              "description": "The provider or software application that performed the assessment.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "reasonCodeableConcept": {
              "description": "The reason the risk assessment was performed.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "reasonReference": {
              "description": "The reason the risk assessment was performed.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "method": {
              "description": "The algorithm, process or mechanism used to evaluate the risk.",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "basis": {
              "description": "Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json/definitions/Reference"
              }
            },
            "prediction": {
              "description": "Describes the expected outcome for the subject.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/RiskAssessment.Prediction"
              }
            },
            "mitigation": {
              "description": "A description of the steps that might be taken to reduce the identified risk(s).",
              "type": "string"
            },
            "mitigation_": {
              "description": "Extensions for mitigation",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "note": {
              "description": "Additional comments about the risk assessment.",
              "$ref": "Annotation.schema.json/definitions/Annotation"
            }
          },
          "required": [
            "resourceType"
          ]
        }
      ]
    },
    "RiskAssessment.Prediction": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.",
          "properties": {
            "outcome": {
              "description": "One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "probabilityDecimal": {
              "description": "How likely is the outcome (in the specified timeframe).",
              "pattern": "-?([0]|([1-9][0-9]*))(\\.[0-9]+)?",
              "type": "number"
            },
            "probabilityDecimal_": {
              "description": "Extensions for probabilityDecimal",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "probabilityRange": {
              "description": "How likely is the outcome (in the specified timeframe).",
              "$ref": "Range.schema.json/definitions/Range"
            },
            "probabilityCodeableConcept": {
              "description": "How likely is the outcome (in the specified timeframe).",
              "$ref": "CodeableConcept.schema.json/definitions/CodeableConcept"
            },
            "relativeRisk": {
              "description": "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general.  (Numbers greater than 1 \u003d higher risk than the population, numbers less than 1 \u003d lower risk.).",
              "type": "number",
              "pattern": "-?([0]|([1-9][0-9]*))(\\.[0-9]+)?"
            },
            "relativeRisk_": {
              "description": "Extensions for relativeRisk",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "whenPeriod": {
              "description": "Indicates the period of time or age range of the subject to which the specified probability applies.",
              "$ref": "Period.schema.json/definitions/Period"
            },
            "whenRange": {
              "description": "Indicates the period of time or age range of the subject to which the specified probability applies.",
              "$ref": "Range.schema.json/definitions/Range"
            },
            "rationale": {
              "description": "Additional information explaining the basis for the prediction.",
              "type": "string"
            },
            "rationale_": {
              "description": "Extensions for rationale",
              "$ref": "Element.schema.json/definitions/Element"
            }
          },
          "required": [
            "outcome"
          ]
        }
      ]
    }
  }
}