{
  "resourceType": "StructureDefinition",
  "id": "profile-ExplanationOfBenefit-expenses-quarterly",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/profile-ExplanationOfBenefit-expenses-quarterly",
  "name": "ExplanationOfBenefitExpensesQuarterly",
  "title": "Recipient Quarterly Expenses",
  "status": "active",
  "experimental": false,
  "description": "A profile on the EOB resources that allows reporting the total of eligible expenses for a quarter",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "ExplanationOfBenefit",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "ExplanationOfBenefit.id",
        "path": "ExplanationOfBenefit.id",
        "comment": "This id will always be a random UUID, which will change each time a query is done - because the calculation is performed anew each time",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "ExplanationOfBenefit.status",
        "path": "ExplanationOfBenefit.status",
        "patternCode": "active"
      },
      {
        "id": "ExplanationOfBenefit.type",
        "path": "ExplanationOfBenefit.type",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/claim-type",
              "code": "pharmacy"
            }
          ]
        }
      },
      {
        "id": "ExplanationOfBenefit.use",
        "path": "ExplanationOfBenefit.use",
        "patternCode": "claim"
      },
      {
        "id": "ExplanationOfBenefit.patient",
        "path": "ExplanationOfBenefit.patient",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Reference-rest"
            ],
            "targetProfile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Patient-search"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientExpensesDTO.odbNum"
          }
        ]
      },
      {
        "id": "ExplanationOfBenefit.created",
        "path": "ExplanationOfBenefit.created",
        "comment": "This will be the date/time the operation was executed",
        "mustSupport": true
      },
      {
        "id": "ExplanationOfBenefit.insurer",
        "path": "ExplanationOfBenefit.insurer",
        "patternReference": {
          "reference": "Organization/bpcs"
        }
      },
      {
        "id": "ExplanationOfBenefit.outcome",
        "path": "ExplanationOfBenefit.outcome",
        "patternCode": "complete"
      },
      {
        "id": "ExplanationOfBenefit.total",
        "path": "ExplanationOfBenefit.total",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "category"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "ExplanationOfBenefit.total:eligible",
        "path": "ExplanationOfBenefit.total",
        "sliceName": "eligible",
        "short": "Total eligible expenses submitted",
        "definition": "This is the total eligible amounts from submitted drug expenses for the specified coverage year",
        "mustSupport": true
      },
      {
        "id": "ExplanationOfBenefit.total:eligible.category",
        "path": "ExplanationOfBenefit.total.category",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-EOBIndividualCategories"
        }
      },
      {
        "id": "ExplanationOfBenefit.total:eligible.amount",
        "path": "ExplanationOfBenefit.total.amount",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientExpensesDTO.accumulatedAllowedExpenseCurrent or accumulatedAllowedExpensePrevious (depending on benefit year)"
          }
        ]
      },
      {
        "id": "ExplanationOfBenefit.benefitPeriod",
        "path": "ExplanationOfBenefit.benefitPeriod",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "ExplanationOfBenefit.benefitPeriod.start",
        "path": "ExplanationOfBenefit.benefitPeriod.start",
        "definition": "This is the start of the quarter (Aug. 1, Nov. 1, Feb 1, or May 1) for which the totals are being reported",
        "min": 1,
        "type": [
          {
            "code": "dateTime",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-dateTime-date"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ExplanationOfBenefit.benefitPeriod.end",
        "path": "ExplanationOfBenefit.benefitPeriod.end",
        "definition": "This is the end of the quarter (Oct 31, Jan 31, Apr 30, or Jul 31) for which the totals are being reported",
        "min": 1,
        "type": [
          {
            "code": "dateTime",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-dateTime-date"
            ]
          }
        ],
        "mustSupport": true
      }
    ]
  }
}