<OperationDefinition xmlns="http://hl7.org/fhir" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hl7.org/fhir ../../input-cache/schemas/R5/fhir-single.xsd">
  <id value="op-claim-reverse-receipts" />
  <url value="https://bpcs.exchange/fhir/OperationDefinition/op-claim-reverse-receipts" />
  <name value="ClaimReverseReceipts" />
  <title value="Claim Reverse Receipts" />
  <status value="active" />
  <kind value="operation" />
  <experimental value="false" />
  <description value="Reverses the specified set of receipts found in claims previously adjudicated as final" />
  <affectsState value="true" />
  <code value="coverageReject" />
  <resource value="Coverage" />
  <system value="false" />
  <type value="false" />
  <instance value="true" />
  <inputProfile value="https://bpcs.exchange/fhir/StructureDefinition/profile-Parameters-reverse-receipts" />
  <parameter>
    <name value="receipt" />
    <use value="in" />
    <min value="1" />
    <max value="*" />
    <documentation value="A receipt to reverse" />
    <part>
      <name value="patient" />
      <use value="in" />
      <min value="1" />
      <max value="1" />
      <documentation value="The patient dispensed the drug on the receipt" />
      <type value="Reference" />
      <targetProfile value="https://bpcs.exchange/fhir/StructureDefinition/profile-Patient-create" />
    </part>
    <part>
      <name value="product" />
      <use value="in" />
      <min value="1" />
      <max value="1" />
      <documentation value="The code of the dispensed drug or other pharmacy product - either a DIN or PIN - on the receipt" />
      <type value="Coding" />
      <binding>
        <strength value="required" />
        <valueSet value="https://bpcs.exchange/fhir/ValueSet/vs-DinPin" />
      </binding>
    </part>
    <part>
      <name value="date" />
      <use value="in" />
      <min value="1" />
      <max value="1" />
      <documentation value="The date of the dispense for this receipt" />
      <type value="date" />
    </part>
    <part>
      <name value="duplicateVersion" />
      <use value="in" />
      <min value="1" />
      <max value="1" />
      <documentation value="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 value="positiveInt" />
    </part>
    <part>
      <name value="reason" />
      <use value="in" />
      <min value="1" />
      <max value="1" />
      <documentation value="The reason for reversing this receipt" />
      <type value="Coding" />
      <binding>
        <strength value="required" />
        <valueSet value="https://bpcs.exchange/fhir/ValueSet/vs-ReceiptReverseReason" />
      </binding>
    </part>
    <part>
      <name value="coverage" />
      <use value="in" />
      <min value="1" />
      <max value="1" />
      <documentation value="The public coverage the receipt was adjudicated against" />
      <type value="Reference" />
    </part>
  </parameter>
  <parameter>
    <name value="return" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <documentation value="Warnings resulting from a successful operation" />
    <type value="OperationOutcome" />
  </parameter>
</OperationDefinition>