﻿{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/EligibilityResponse",
  "$ref": "#/definitions/EligibilityResponse",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "EligibilityResponse": {
      "allOf": [
        {
          "$ref": "DomainResource.schema.json/definitions/DomainResource"
        },
        {
          "description": "This resource provides eligibility and plan details from the processing of an Eligibility resource.",
          "properties": {
            "resourceType": {
              "description": "This is a EligibilityResponse resource",
              "type": "string",
              "enum": [
                "EligibilityResponse"
              ]
            },
            "identifier": {
              "description": "The Response business identifier.",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json/definitions/Identifier"
              }
            },
            "status": {
              "description": "The status of the resource instance.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "status_": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "requestIdentifier": {
              "description": "Original request resource reference.",
              "$ref": "Identifier.schema.json/definitions/Identifier"
            },
            "requestReference": {
              "description": "Original request resource reference.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "outcome": {
              "description": "Transaction status: error, complete.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "outcome_": {
              "description": "Extensions for outcome",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "disposition": {
              "description": "A description of the status of the adjudication.",
              "type": "string"
            },
            "disposition_": {
              "description": "Extensions for disposition",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "ruleset": {
              "description": "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "originalRuleset": {
              "description": "The style (standard) and version of the original material which was converted into this resource.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "created": {
              "description": "The date when the enclosed suite of services were performed or completed.",
              "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)))?)?)?"
            },
            "created_": {
              "description": "Extensions for created",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "organizationIdentifier": {
              "description": "The Insurer who produced this adjudicated response.",
              "$ref": "Identifier.schema.json/definitions/Identifier"
            },
            "organizationReference": {
              "description": "The Insurer who produced this adjudicated response.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "requestProviderIdentifier": {
              "description": "The practitioner who is responsible for the services rendered to the patient.",
              "$ref": "Identifier.schema.json/definitions/Identifier"
            },
            "requestProviderReference": {
              "description": "The practitioner who is responsible for the services rendered to the patient.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "requestOrganizationIdentifier": {
              "description": "The organization which is responsible for the services rendered to the patient.",
              "$ref": "Identifier.schema.json/definitions/Identifier"
            },
            "requestOrganizationReference": {
              "description": "The organization which is responsible for the services rendered to the patient.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "inforce": {
              "description": "Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.",
              "type": "true | false"
            },
            "inforce_": {
              "description": "Extensions for inforce",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "contract": {
              "description": "The contract resource which may provide more detailed information.",
              "$ref": "Reference.schema.json/definitions/Reference"
            },
            "form": {
              "description": "The form to be used for printing the content.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "benefitBalance": {
              "description": "Benefits and optionally current balances by Category.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/EligibilityResponse.BenefitBalance"
              }
            },
            "error": {
              "description": "Mutually exclusive with Services Provided (Item).",
              "type": "array",
              "items": {
                "$ref": "#/definitions/EligibilityResponse.Error"
              }
            }
          },
          "required": [
            "resourceType"
          ]
        }
      ]
    },
    "EligibilityResponse.BenefitBalance": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "This resource provides eligibility and plan details from the processing of an Eligibility resource.",
          "properties": {
            "category": {
              "description": "Dental, Vision, Medical, Pharmacy, Rehab etc.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "subCategory": {
              "description": "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "name": {
              "description": "A short name or tag for the benefit, for example MED01, or DENT2.",
              "type": "string"
            },
            "name_": {
              "description": "Extensions for name",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "description": {
              "description": "A richer description of the benefit, for example \u0027DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services\u0027.",
              "type": "string"
            },
            "description_": {
              "description": "Extensions for description",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "network": {
              "description": "Network designation.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "unit": {
              "description": "Unit designation: individual or family.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "term": {
              "description": "The term or period of the values such as \u0027maximum lifetime benefit\u0027 or \u0027maximum annual vistis\u0027.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "financial": {
              "description": "Benefits Used to date.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/EligibilityResponse.Financial"
              }
            }
          },
          "required": [
            "category"
          ]
        }
      ]
    },
    "EligibilityResponse.Financial": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "This resource provides eligibility and plan details from the processing of an Eligibility resource.",
          "properties": {
            "type": {
              "description": "Deductable, visits, benefit amount.",
              "$ref": "Coding.schema.json/definitions/Coding"
            },
            "benefitUnsignedInt": {
              "description": "Benefits allowed.",
              "pattern": "[0]|([1-9][0-9]*)",
              "type": "number"
            },
            "benefitUnsignedInt_": {
              "description": "Extensions for benefitUnsignedInt",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "benefitString": {
              "description": "Benefits allowed.",
              "type": "string"
            },
            "benefitString_": {
              "description": "Extensions for benefitString",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "benefitMoney": {
              "description": "Benefits allowed.",
              "$ref": "Money.schema.json/definitions/Money"
            },
            "benefitUsedUnsignedInt": {
              "description": "Benefits used.",
              "pattern": "[0]|([1-9][0-9]*)",
              "type": "number"
            },
            "benefitUsedUnsignedInt_": {
              "description": "Extensions for benefitUsedUnsignedInt",
              "$ref": "Element.schema.json/definitions/Element"
            },
            "benefitUsedMoney": {
              "description": "Benefits used.",
              "$ref": "Money.schema.json/definitions/Money"
            }
          },
          "required": [
            "type"
          ]
        }
      ]
    },
    "EligibilityResponse.Error": {
      "allOf": [
        {
          "$ref": "BackboneElement.schema.json/definitions/BackboneElement"
        },
        {
          "description": "This resource provides eligibility and plan details from the processing of an Eligibility resource.",
          "properties": {
            "code": {
              "description": "An error code,from a specified code system, which details why the eligibility check could not be performed.",
              "$ref": "Coding.schema.json/definitions/Coding"
            }
          },
          "required": [
            "code"
          ]
        }
      ]
    }
  }
}