{
  "resourceType": "StructureDefinition",
  "id": "ext-Coverage-DeductibleCalculation",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-DeductibleCalculation",
  "name": "CoverageDeductibleCalculation",
  "title": "Coverage Deductible Calculation",
  "status": "active",
  "experimental": false,
  "description": "Information related to the calculation of the deductible for this particular coverage for this recipient for this coverage period",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "Coverage.costToBeneficiary"
    }
  ],
  "contextInvariant": [
    "type.coding.exists(system='http://terminology.hl7.org/CodeSystem/coverage-copay-type' and code='deductible')"
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "short": "Deductible calculation information",
        "definition": "Information related to the calculation of the deductible for this particular coverage for this recipient for this coverage period",
        "max": "1"
      },
      {
        "id": "Extension.extension",
        "path": "Extension.extension",
        "min": 3,
        "mustSupport": true
      },
      {
        "id": "Extension.extension:createdDate",
        "path": "Extension.extension",
        "sliceName": "createdDate",
        "short": "When deductible available to system",
        "definition": "The date on which this current version of the deductible information became available to the system",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:createdDate.url",
        "path": "Extension.extension.url",
        "fixedUri": "createdDate"
      },
      {
        "id": "Extension.extension:createdDate.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "instant"
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientDeductibleDTO.recCreateCustomTimestamp"
          }
        ]
      },
      {
        "id": "Extension.extension:createdBy",
        "path": "Extension.extension",
        "sliceName": "createdBy",
        "short": "Deductible createdBy timestamp",
        "definition": "The user responsible for setting the dedictible information",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:createdBy.url",
        "path": "Extension.extension.url",
        "fixedUri": "createdBy"
      },
      {
        "id": "Extension.extension:createdBy.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "string"
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientDeductibleDTO.recCreateUserId"
          }
        ]
      },
      {
        "id": "Extension.extension:established",
        "path": "Extension.extension",
        "sliceName": "established",
        "short": "Deductible established timestamp",
        "definition": "The specific time that the dedictible information was last captured",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:established.url",
        "path": "Extension.extension.url",
        "fixedUri": "established"
      },
      {
        "id": "Extension.extension:established.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "instant"
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientDeductibleDTO.deductibleEstablishedTimestamp"
          }
        ]
      },
      {
        "id": "Extension.extension:base",
        "path": "Extension.extension",
        "sliceName": "base",
        "short": "Base deductible value",
        "definition": "The default deductible value for this type of coverage for the specified period, before any adjustments",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:base.url",
        "path": "Extension.extension.url",
        "fixedUri": "base"
      },
      {
        "id": "Extension.extension:base.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientDeductibleDTO.annualDeductibleAmount"
          }
        ]
      },
      {
        "id": "Extension.extension:proratedAdjustment",
        "path": "Extension.extension",
        "sliceName": "proratedAdjustment",
        "short": "Adjustment to prorate for partial year coverage",
        "definition": "For coverages that do not cover the full coverage period (e.g. started part-way through the year), represents an amount to reduce the base deductible by to account for the fact the patient is only covered for part of the year.",
        "comment": "This will always be either 0 or a negative value.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:proratedAdjustment.url",
        "path": "Extension.extension.url",
        "fixedUri": "proratedAdjustment"
      },
      {
        "id": "Extension.extension:proratedAdjustment.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientDeductibleDTO.proratedDedectibleAdjustmentAmount"
          }
        ]
      },
      {
        "id": "Extension.extension:proratedAdjustment.value[x].value",
        "path": "Extension.extension.value[x].value",
        "maxValueDecimal": 0
      },
      {
        "id": "Extension.extension:otherAdjustment",
        "path": "Extension.extension",
        "sliceName": "otherAdjustment",
        "short": "Other deductible adjustments",
        "definition": "Additional adjustments to the base deductible (could be positive or negative).",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:otherAdjustment.url",
        "path": "Extension.extension.url",
        "fixedUri": "otherAdjustment"
      },
      {
        "id": "Extension.extension:otherAdjustment.value[x]",
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientDeductibleDTO.deductibleAdjustmentAmount"
          }
        ]
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-DeductibleCalculation"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "max": "0"
      }
    ]
  }
}