{
  "resourceType": "StructureDefinition",
  "id": "profile-Coverage-individual-public",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/profile-Coverage-individual-public",
  "name": "CoverageIndividualPublic",
  "title": "Coverage Individual Public Profile",
  "status": "active",
  "experimental": false,
  "description": "The set of coverage elements returned for individual private or bpcs coverage when returning a 'summary'",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Coverage",
  "baseDefinition": "https://bpcs.exchange/fhir/StructureDefinition/profile-Coverage-individual-public-create",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Coverage.id",
        "path": "Coverage.id",
        "short": "Unique identifier assigned to the coverage",
        "comment": "This id is used when querying history",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientPlanDTO.plan '.' program '.' odbNum '.' effDate"
          }
        ]
      },
      {
        "id": "Coverage.meta",
        "path": "Coverage.meta",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Coverage.meta.versionId",
        "path": "Coverage.meta.versionId",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientPlanDTO.recUpdateCustomTimestamp (concatenate time and nanos)"
          }
        ]
      },
      {
        "id": "Coverage.meta.lastUpdated",
        "path": "Coverage.meta.lastUpdated",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientPlanDTO.recUpdateCustomTimestamp (convert to valid FHIR format timestamp)"
          }
        ]
      },
      {
        "id": "Coverage.contained",
        "path": "Coverage.contained",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Coverage.contained:provenance",
        "path": "Coverage.contained",
        "sliceName": "provenance",
        "short": "Creation/Update/etc. Metadata",
        "definition": "Nested Provenance information referring to this resource that describes the creation, and sometimes the most recent update and/or inactivation of the record, specifically who was responsible and when it occurred",
        "min": 1,
        "type": [
          {
            "code": "Provenance",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Provenance"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Coverage.extension:goodFaith",
        "path": "Coverage.extension",
        "sliceName": "goodFaith",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-GoodFaith"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientPlanDTO.goodFaith (boolean, or true if date), RecipientPlanDTO.faithConfirmed (date)"
          }
        ]
      },
      {
        "id": "Coverage.class",
        "path": "Coverage.class",
        "slicing": {
          "rules": "open"
        }
      },
      {
        "id": "Coverage.class:program",
        "path": "Coverage.class",
        "sliceName": "program"
      },
      {
        "id": "Coverage.class:program.name",
        "path": "Coverage.class.name",
        "comment": "This will be omitted for private plans",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientPlanDTO.planDescription"
          }
        ]
      },
      {
        "id": "Coverage.class:plan",
        "path": "Coverage.class",
        "sliceName": "plan"
      },
      {
        "id": "Coverage.class:plan.name",
        "path": "Coverage.class.name",
        "comment": "This will be omitted for private plans",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientPlanDTO.planDescription"
          }
        ]
      },
      {
        "id": "Coverage.costToBeneficiary",
        "path": "Coverage.costToBeneficiary",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type"
            },
            {
              "type": "value",
              "path": "unit"
            },
            {
              "type": "value",
              "path": "term"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Coverage.costToBeneficiary:deductible",
        "path": "Coverage.costToBeneficiary",
        "sliceName": "deductible",
        "comment": "Deductible information will only be available for BPCS-managed coverages",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Coverage.costToBeneficiary:deductible.extension:deductibleCalculation",
        "path": "Coverage.costToBeneficiary.extension",
        "sliceName": "deductibleCalculation",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-DeductibleCalculation"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Coverage.costToBeneficiary:deductible.type",
        "path": "Coverage.costToBeneficiary.type",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/coverage-copay-type",
              "code": "deductible"
            }
          ]
        }
      },
      {
        "id": "Coverage.costToBeneficiary:deductible.unit",
        "path": "Coverage.costToBeneficiary.unit",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/benefit-unit",
              "code": "individual"
            }
          ]
        }
      },
      {
        "id": "Coverage.costToBeneficiary:deductible.term",
        "path": "Coverage.costToBeneficiary.term",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/benefit-term",
              "code": "annual"
            }
          ]
        }
      },
      {
        "id": "Coverage.costToBeneficiary:deductible.value[x]",
        "path": "Coverage.costToBeneficiary.value[x]",
        "comment": "This SHALL equal the base + adjustment amounts in the deductibleCalculation extension",
        "min": 1,
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientDeductibleDTO.netDeductibleAmount"
          }
        ]
      },
      {
        "id": "Coverage.costToBeneficiary:copay",
        "path": "Coverage.costToBeneficiary",
        "sliceName": "copay",
        "comment": "Copay information will only be available for BPCS-managed coverages",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Coverage.costToBeneficiary:copay.type",
        "path": "Coverage.costToBeneficiary.type",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/coverage-copay-type",
              "code": "copay"
            }
          ]
        }
      },
      {
        "id": "Coverage.costToBeneficiary:copay.unit",
        "path": "Coverage.costToBeneficiary.unit",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/benefit-unit",
              "code": "individual"
            }
          ]
        }
      },
      {
        "id": "Coverage.costToBeneficiary:copay.term",
        "path": "Coverage.costToBeneficiary.term",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/benefit-term",
              "code": "annual"
            }
          ]
        }
      },
      {
        "id": "Coverage.costToBeneficiary:copay.value[x]",
        "path": "Coverage.costToBeneficiary.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientDeductibleDTO.copayCeilingAmount"
          }
        ]
      }
    ]
  }
}