{
  "resourceType": "OperationDefinition",
  "id": "op-claim-reverse-receipts",
  "url": "https://bpcs.exchange/fhir/OperationDefinition/op-claim-reverse-receipts",
  "name": "ClaimReverseReceipts",
  "title": "Claim Reverse Receipts",
  "status": "active",
  "kind": "operation",
  "experimental": false,
  "description": "Reverses the specified set of receipts found in claims previously adjudicated as final",
  "affectsState": true,
  "code": "coverageReject",
  "resource": [
    "Coverage"
  ],
  "system": false,
  "type": false,
  "instance": true,
  "inputProfile": "https://bpcs.exchange/fhir/StructureDefinition/profile-Parameters-reverse-receipts",
  "parameter": [
    {
      "name": "receipt",
      "use": "in",
      "min": 1,
      "max": "*",
      "documentation": "A receipt to reverse",
      "part": [
        {
          "name": "patient",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "The patient dispensed the drug on the receipt",
          "type": "Reference",
          "targetProfile": [
            "https://bpcs.exchange/fhir/StructureDefinition/profile-Patient-create"
          ]
        },
        {
          "name": "product",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "The code of the dispensed drug or other pharmacy product - either a DIN or PIN - on the receipt",
          "type": "Coding",
          "binding": {
            "strength": "required",
            "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-DinPin"
          }
        },
        {
          "name": "date",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "The date of the dispense for this receipt",
          "type": "date"
        },
        {
          "name": "duplicateVersion",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "A sequence number that increments for each time the same drug was dispensed for the patient on the same day and which acts as part of the key for the receipt",
          "type": "positiveInt"
        },
        {
          "name": "reason",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "The reason for reversing this receipt",
          "type": "Coding",
          "binding": {
            "strength": "required",
            "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-ReceiptReverseReason"
          }
        },
        {
          "name": "coverage",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "The public coverage the receipt was adjudicated against",
          "type": "Reference"
        }
      ]
    },
    {
      "name": "return",
      "use": "out",
      "min": 0,
      "max": "1",
      "documentation": "Warnings resulting from a successful operation",
      "type": "OperationOutcome"
    }
  ]
}