{
  "resourceType": "StructureDefinition",
  "id": "ext-ExplanationOfBenefit-ItemSource",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/ext-ExplanationOfBenefit-ItemSource",
  "name": "ExplanationOfBenefitItemSource",
  "title": "Explanation of Benefit Item Source",
  "status": "active",
  "experimental": false,
  "description": "Indicates the system responsible for entering a receipt within an explanation of benefits extract",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "ExplanationOfBenefit.item"
    }
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "short": "Receipt source",
        "definition": "Indicates the system responsible for entering a receipt within an explanation of benefits extract",
        "max": "1"
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "https://bpcs.exchange/fhir/StructureDefinition/ext-ExplanationOfBenefit-ItemSource"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Identifier"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Extension.value[x].system",
        "path": "Extension.value[x].system",
        "min": 1,
        "patternUri": "https://bpcs.exchange/fhir/NamingSystem/receipt-source"
      },
      {
        "id": "Extension.value[x].value",
        "path": "Extension.value[x].value",
        "short": "'bpcs' or specific pharmacy",
        "comment": "This will always be 'bpcs' for patient-submitted receipts",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "bpcs",
            "map": "AllTransactionRecordDTO.agencyId, ClaimDetailDTO.agencyId, ClaimRecordDTO.agencyId, OverpaidDeductible.agencyId"
          }
        ]
      }
    ]
  }
}