{
  "resourceType": "StructureDefinition",
  "id": "profile-Coverage-individual-private-create",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/profile-Coverage-individual-private-create",
  "name": "CoverageIndividualPrivateCreate",
  "title": "Coverage Individual Private Creation Profile",
  "status": "active",
  "experimental": false,
  "description": "The set of coverage elements used when creating or updating an individual private coverage",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Coverage",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Coverage",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Coverage",
        "path": "Coverage",
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientInsuranceDTO, FamilyMemberHistoryDTO - separate repetitions for insurance...1 and insurance...2 fields, InsuranceDTO"
          }
        ]
      },
      {
        "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": "RecipientInsuranceDTO.insuranceId '.' policyNum '.' id '.' coverageBegin (for insurance 1 or 2)"
          }
        ]
      },
      {
        "id": "Coverage.extension",
        "path": "Coverage.extension",
        "min": 1
      },
      {
        "id": "Coverage.extension:application",
        "path": "Coverage.extension",
        "sliceName": "application",
        "min": 1,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-Application"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Coverage.extension:premiumPaid",
        "path": "Coverage.extension",
        "sliceName": "premiumPaid",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-PremiumPaid"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Coverage.status",
        "path": "Coverage.status",
        "short": "active",
        "patternCode": "active",
        "mustSupport": true
      },
      {
        "id": "Coverage.kind",
        "path": "Coverage.kind",
        "patternCode": "insurance",
        "mustSupport": true
      },
      {
        "id": "Coverage.subscriber",
        "path": "Coverage.subscriber",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Reference-rest"
            ],
            "targetProfile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Patient-create"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "FamilyMemberHistoryDTO.policyHolderOdbNum1 or policyHolderOdbNum2, InsuranceDTO.policyHolderOdbNum"
          }
        ]
      },
      {
        "id": "Coverage.subscriberId",
        "path": "Coverage.subscriberId",
        "definition": "A unique identifier for a recipient within a policy offered by a private insurer.",
        "mustSupport": true
      },
      {
        "id": "Coverage.subscriberId.value",
        "path": "Coverage.subscriberId.value",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientInsuranceDTO.id1 or id2, FamilyMemberHistoryDTO.identification1 or identification2, InsuranceDTO.identification"
          }
        ]
      },
      {
        "id": "Coverage.beneficiary",
        "path": "Coverage.beneficiary",
        "definition": "The patient for whom the insurance applies",
        "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": "RecipientInsuranceDTO.odbNum, InsuranceDTO.policyHolderOdbNum (when coverage is for policy holder)"
          }
        ]
      },
      {
        "id": "Coverage.period",
        "path": "Coverage.period",
        "mustSupport": true
      },
      {
        "id": "Coverage.period.extension:notPayingPeriod",
        "path": "Coverage.period.extension",
        "sliceName": "notPayingPeriod",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-NotPayingPeriod"
            ]
          }
        ],
        "mustSupport": true,
        "isModifier": false
      },
      {
        "id": "Coverage.period.start",
        "path": "Coverage.period.start",
        "definition": "The earliest date on which benefits under this policy were available",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientInsuranceDTO.coverageBegin1 or coverageBegin2, FamilyMemberHistoryDTO.coverageStartDate1 or coverageStartDate2, FamilyMemberInsuranceDTO.coverageStartDate, InsuranceDTO.coverageStartDate"
          }
        ]
      },
      {
        "id": "Coverage.period.end",
        "path": "Coverage.period.end",
        "short": "coverageEnd/enrollmentEndDate/mbrshpEndDate/mbrshpEndDate",
        "definition": "The last date on which benefits under this policy were/will be available",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientInsuranceDTO.coverageEnd1 or coverageEnd2, FamilyMemberHistoryDTO.coverageEndDate1 or coverageEndDate2, FamilyMemberInsuranceDTO.coverageEndDate, InsuranceDTO.coverageEndDate"
          }
        ]
      },
      {
        "id": "Coverage.insurer",
        "path": "Coverage.insurer",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Coverage.insurer.reference",
        "path": "Coverage.insurer.reference",
        "max": "0"
      },
      {
        "id": "Coverage.insurer.identifier",
        "path": "Coverage.insurer.identifier",
        "definition": "A unique identifier assigned to a private insurer.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Coverage.insurer.identifier.system",
        "path": "Coverage.insurer.identifier.system",
        "min": 1,
        "patternUri": "https://bpcs.exchange/fhir/NamingSystem/insurer-id",
        "mustSupport": true
      },
      {
        "id": "Coverage.insurer.identifier.value",
        "path": "Coverage.insurer.identifier.value",
        "short": "BPCS id for private insurer",
        "comment": "The binding is extensible to allow for the addition of new codes.  Codes must be found in the current expansion of the value set.",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-PrivateInsurer"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientInsuranceDTO.insuranceId1 or insuranceid2, FamilyMemberHistoryDTO.companyId1 or companyId2, InsuranceDTO.companyId"
          }
        ]
      },
      {
        "id": "Coverage.class",
        "path": "Coverage.class",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type"
            }
          ],
          "rules": "closed"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Coverage.class:program",
        "path": "Coverage.class",
        "sliceName": "program",
        "short": "Coverage plan info",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Coverage.class:program.type",
        "path": "Coverage.class.type",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/coverage-class",
              "code": "plan"
            }
          ]
        },
        "mustSupport": true
      },
      {
        "id": "Coverage.class:program.value",
        "path": "Coverage.class.value",
        "short": "Plan id",
        "mustSupport": true
      },
      {
        "id": "Coverage.class:program.value.value",
        "path": "Coverage.class.value.value",
        "short": "Plan id",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RecipientInsuranceDTO/FamilyMemberHistoryDTO.policyNum1 or policyNum2, InsuranceDTO.policyNum, FamilyMemberInsuranceDTO.policyNum"
          }
        ]
      }
    ]
  }
}