{
  "resourceType": "StructureDefinition",
  "id": "profile-Claim-create",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/profile-Claim-create",
  "name": "ClaimCreate",
  "title": "Claim Creation Profile",
  "status": "active",
  "experimental": false,
  "description": "Information about a claim used when storing a claim for the first time",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "resource",
  "abstract": true,
  "type": "Claim",
  "baseDefinition": "https://bpcs.exchange/fhir/StructureDefinition/profile-Claim-base",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Claim.extension:note",
        "path": "Claim.extension",
        "sliceName": "note",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Claim-Note"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Claim.item",
        "path": "Claim.item",
        "comment": "There will be a separate item repetition for each receipt being submitted for adjudication as part of a single 'batch'",
        "mustSupport": true
      },
      {
        "id": "Claim.item.extension",
        "path": "Claim.item.extension",
        "min": 2,
        "mustSupport": true
      },
      {
        "id": "Claim.item.extension:patient",
        "path": "Claim.item.extension",
        "sliceName": "patient",
        "comment": "This will only be present if the search was performed on a family rather than an individual recipient",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Claim-ReceiptPatient"
            ]
          }
        ],
        "condition": [
          "BPCS-EOB-1a",
          "BPCS-EOB-1b"
        ],
        "mustSupport": true
      },
      {
        "id": "Claim.item.extension:entryMode",
        "path": "Claim.item.extension",
        "sliceName": "entryMode",
        "min": 1,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Resource-Mode"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Claim.item.extension:overrideAmount",
        "path": "Claim.item.extension",
        "sliceName": "overrideAmount",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Claim-OverrideNet"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.adjRecpntPaidAmt (if amountOflag is set), AssessmentFlag.amountOflag (Y if this extension is present)"
          }
        ]
      },
      {
        "id": "Claim.item.extension:received",
        "path": "Claim.item.extension",
        "sliceName": "received",
        "min": 1,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/ext-Claim-ReceivedDate"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Claim.item.sequence",
        "path": "Claim.item.sequence",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.seqNo"
          }
        ]
      },
      {
        "id": "Claim.item.informationSequence",
        "path": "Claim.item.informationSequence",
        "comment": "Must be at least one informationSequence which will point to the Claim.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Claim.item.productOrService",
        "path": "Claim.item.productOrService",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Claim.item.productOrService.coding",
        "path": "Claim.item.productOrService.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 2,
        "mustSupport": true
      },
      {
        "id": "Claim.item.productOrService.coding:receiptDinPin",
        "path": "Claim.item.productOrService.coding",
        "sliceName": "receiptDinPin",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Claim.item.productOrService.coding:receiptDinPin.system",
        "path": "Claim.item.productOrService.coding.system",
        "comment": "Clients are required to differentiate which codes are true DINs vs. Ontario-defined PINs",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-DinPinSystem"
        }
      },
      {
        "id": "Claim.item.productOrService.coding:receiptDinPin.code",
        "path": "Claim.item.productOrService.coding.code",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "DrugDTO.dinPin"
          }
        ]
      },
      {
        "id": "Claim.item.productOrService.coding:receiptDinPin.display",
        "path": "Claim.item.productOrService.coding.display",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "DrugDTO.drugBrandName"
          }
        ]
      },
      {
        "id": "Claim.item.productOrService.coding:generic",
        "path": "Claim.item.productOrService.coding",
        "sliceName": "generic",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Claim.item.productOrService.coding:generic.system",
        "path": "Claim.item.productOrService.coding.system",
        "min": 1,
        "patternUri": "http://terminology.hl7.org/CodeSystem/hc-CCDD"
      },
      {
        "id": "Claim.item.productOrService.coding:generic.display",
        "path": "Claim.item.productOrService.coding.display",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "DrugDTO.genericName"
          }
        ]
      },
      {
        "id": "Claim.item.productOrService.coding:dummyPIN",
        "path": "Claim.item.productOrService.coding",
        "sliceName": "dummyPIN",
        "mustSupport": true
      },
      {
        "id": "Claim.item.productOrService.coding:dummyPIN.system",
        "path": "Claim.item.productOrService.coding.system",
        "min": 1,
        "patternUri": "https://bpcs.exchange/fhir/CodeSystem/cs-DummyPIN"
      },
      {
        "id": "Claim.item.productOrService.coding:dummyPIN.display",
        "path": "Claim.item.productOrService.coding.display",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "DrugDTO.dummyPIN"
          }
        ]
      },
      {
        "id": "Claim.item.modifier",
        "path": "Claim.item.modifier",
        "comment": "This will include both overrides or additional response codes asserted by the user, as well as any response codes returned in prior adjudication that the user has opted to not override (or that were not overrideable).",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-Claim-Modifiers"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.assessFormInd, AssessmentFlag.(various OFlags), ReceiptDTO.responseCds"
          }
        ]
      },
      {
        "id": "Claim.item.serviced[x]",
        "path": "Claim.item.serviced[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Claim.item.serviced[x]:servicedDate",
        "path": "Claim.item.serviced[x]",
        "sliceName": "servicedDate",
        "min": 1,
        "type": [
          {
            "code": "date"
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.serviceDate"
          }
        ]
      },
      {
        "id": "Claim.item.patientPaid",
        "path": "Claim.item.patientPaid",
        "min": 1,
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.recipientAmountPaid"
          }
        ]
      },
      {
        "id": "Claim.item.quantity",
        "path": "Claim.item.quantity",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Claim.item.quantity.value",
        "path": "Claim.item.quantity.value",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.quantity"
          }
        ]
      },
      {
        "id": "Claim.item.net",
        "path": "Claim.item.net",
        "min": 1,
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD-Pos"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.receiptTotalAmount"
          }
        ]
      },
      {
        "id": "Claim.item.detail",
        "path": "Claim.item.detail",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "productOrService"
            }
          ],
          "rules": "open"
        },
        "min": 2
      },
      {
        "id": "Claim.item.detail:drugCost",
        "path": "Claim.item.detail",
        "sliceName": "drugCost",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Claim.item.detail:drugCost.sequence",
        "path": "Claim.item.detail.sequence",
        "comment": "A unique number within the scope of the item.  Typically '2'.",
        "mustSupport": true
      },
      {
        "id": "Claim.item.detail:drugCost.productOrService",
        "path": "Claim.item.detail.productOrService",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://bpcs.exchange/fhir/CodeSystem/cs-CostFee",
              "code": "drugCost"
            }
          ]
        }
      },
      {
        "id": "Claim.item.detail:drugCost.net",
        "path": "Claim.item.detail.net",
        "min": 1,
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD-Pos"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.drugCost"
          }
        ]
      },
      {
        "id": "Claim.item.detail:pharmacistFee",
        "path": "Claim.item.detail",
        "sliceName": "pharmacistFee",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Claim.item.detail:pharmacistFee.sequence",
        "path": "Claim.item.detail.sequence",
        "comment": "A unique number within the scope of the item.  Typically '2'.",
        "mustSupport": true
      },
      {
        "id": "Claim.item.detail:pharmacistFee.productOrService",
        "path": "Claim.item.detail.productOrService",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://bpcs.exchange/fhir/CodeSystem/cs-CostFee",
              "code": "pharmacistFee"
            }
          ]
        }
      },
      {
        "id": "Claim.item.detail:pharmacistFee.net",
        "path": "Claim.item.detail.net",
        "type": [
          {
            "code": "Money",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Money-CAD-NonNeg"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ReceiptDTO.fee"
          }
        ]
      }
    ]
  }
}