# SameDayDelete

POST https://Medicare/samedaydelete/v1
Content-Type: application/json

Same Day Delete Web Service is a function that provides the Health Care Location with the ability to **delete a Patient Claim Interactive Web Service claim** that was transmitted earlier on the **same day**.  
This delete request can only be applied to a claim that was successfully processed i.e. the claim status is **`MEDICARE_ASSESSED`**.

## 📑 Request Fields

#### 🔸correlationId

The correlationId from the original claim to be deleted.

---

#### 🔸sameDayDelete.reasonCode

Reason code supporting the same day delete.

- **Valid values:**
    
    - `001` – Incorrect Patient Selection
        
    - `002` – Incorrect Provider Details
        
    - `003` – Incorrect Date of Service
        
    - `004` – Incorrect Item Number Claimed
        
    - `005` – Omitted Text on Original Claim
        
    - `006` – Incorrect Payment Type (Paid / Unpaid)
        
    - `007` – Other
        

---

#### 🔸sameDayDelete.patient.identity.familyName

The patient’s family name.

---

#### 🔸sameDayDelete.patient.identity.givenName

The patient’s first given name.

---

#### 🔸sameDayDelete.patient.medicare.memberNumber

The patient’s Medicare card number.

---

### 🔸sameDayDelete.patient.medicare.memberRefNumber

The patient’s individual reference number (IRN) on their Medicare card.

Reference: https://developers.rebateright.com.au/rebate-right/advanced/claiming/patient-claim-interactive/same-day-delete

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /Medicare/samedaydelete/v1:
    post:
      operationId: same-day-delete
      summary: SameDayDelete
      description: >-
        Same Day Delete Web Service is a function that provides the Health Care
        Location with the ability to **delete a Patient Claim Interactive Web
        Service claim** that was transmitted earlier on the **same day**.  

        This delete request can only be applied to a claim that was successfully
        processed i.e. the claim status is **`MEDICARE_ASSESSED`**.


        ## 📑 Request Fields


        #### 🔸correlationId


        The correlationId from the original claim to be deleted.


        ---


        #### 🔸sameDayDelete.reasonCode


        Reason code supporting the same day delete.


        - **Valid values:**
            
            - `001` – Incorrect Patient Selection
                
            - `002` – Incorrect Provider Details
                
            - `003` – Incorrect Date of Service
                
            - `004` – Incorrect Item Number Claimed
                
            - `005` – Omitted Text on Original Claim
                
            - `006` – Incorrect Payment Type (Paid / Unpaid)
                
            - `007` – Other
                

        ---


        #### 🔸sameDayDelete.patient.identity.familyName


        The patient’s family name.


        ---


        #### 🔸sameDayDelete.patient.identity.givenName


        The patient’s first given name.


        ---


        #### 🔸sameDayDelete.patient.medicare.memberNumber


        The patient’s Medicare card number.


        ---


        ### 🔸sameDayDelete.patient.medicare.memberRefNumber


        The patient’s individual reference number (IRN) on their Medicare card.
      tags:
        - >-
          subpackage_advanced.subpackage_advanced/claiming.subpackage_advanced/claiming/patientClaimInteractive
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
        - name: x-minor-id
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Advanced_Claiming_Patient Claim
                  Interactive_SameDayDelete_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostMedicareSamedaydeleteV1RequestBadRequestError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                correlationId:
                  type: string
                sameDayDelete:
                  $ref: >-
                    #/components/schemas/MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDelete
              required:
                - correlationId
                - sameDayDelete
servers:
  - url: https:/
components:
  schemas:
    MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatientIdentity:
      type: object
      properties:
        givenName:
          type: string
        familyName:
          type: string
      required:
        - givenName
        - familyName
      title: >-
        MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatientIdentity
    MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatientMedicare:
      type: object
      properties:
        memberNumber:
          type: string
        memberRefNumber:
          type: string
      required:
        - memberNumber
        - memberRefNumber
      title: >-
        MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatientMedicare
    MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatient:
      type: object
      properties:
        identity:
          $ref: >-
            #/components/schemas/MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatientIdentity
        medicare:
          $ref: >-
            #/components/schemas/MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatientMedicare
      required:
        - identity
        - medicare
      title: >-
        MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatient
    MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDelete:
      type: object
      properties:
        patient:
          $ref: >-
            #/components/schemas/MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDeletePatient
        reasonCode:
          type: string
      required:
        - patient
        - reasonCode
      title: >-
        MedicareSamedaydeleteV1PostRequestBodyContentApplicationJsonSchemaSameDayDelete
    Advanced_Claiming_Patient Claim Interactive_SameDayDelete_Response_200:
      type: object
      properties:
        status:
          type: string
        correlationId:
          type: string
      required:
        - status
        - correlationId
      title: Advanced_Claiming_Patient Claim Interactive_SameDayDelete_Response_200
    MedicareSamedaydeleteV1PostResponsesContentApplicationJsonSchemaServiceMessageItems:
      type: object
      properties:
        code:
          type: string
        reason:
          type: string
        severity:
          type: string
      required:
        - code
        - reason
        - severity
      title: >-
        MedicareSamedaydeleteV1PostResponsesContentApplicationJsonSchemaServiceMessageItems
    PostMedicareSamedaydeleteV1RequestBadRequestError:
      type: object
      properties:
        correlationId:
          type: string
        serviceMessage:
          type: array
          items:
            $ref: >-
              #/components/schemas/MedicareSamedaydeleteV1PostResponsesContentApplicationJsonSchemaServiceMessageItems
        highestSeverity:
          type: string
      required:
        - correlationId
        - serviceMessage
        - highestSeverity
      title: PostMedicareSamedaydeleteV1RequestBadRequestError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

```

## SDK Code Examples

```python 7.1.1
import requests

url = "https://https/Medicare/samedaydelete/v1"

headers = {
    "x-minor-id": "{{MinorId}}",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript 7.1.1
const url = 'https://https/Medicare/samedaydelete/v1';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '{{MinorId}}',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 7.1.1
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://https/Medicare/samedaydelete/v1"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-minor-id", "{{MinorId}}")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 7.1.1
require 'uri'
require 'net/http'

url = URI("https://https/Medicare/samedaydelete/v1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-minor-id"] = '{{MinorId}}'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java 7.1.1
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/Medicare/samedaydelete/v1")
  .header("x-minor-id", "{{MinorId}}")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php 7.1.1
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/Medicare/samedaydelete/v1', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '{{MinorId}}',
  ],
]);

echo $response->getBody();
```

```csharp 7.1.1
using RestSharp;

var client = new RestClient("https://https/Medicare/samedaydelete/v1");
var request = new RestRequest(Method.POST);
request.AddHeader("x-minor-id", "{{MinorId}}");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift 7.1.1
import Foundation

let headers = [
  "x-minor-id": "{{MinorId}}",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://https/Medicare/samedaydelete/v1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Success
import requests

url = "https://https/Medicare/samedaydelete/v1"

headers = {
    "x-minor-id": "{{MinorId}}",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Success
const url = 'https://https/Medicare/samedaydelete/v1';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '{{MinorId}}',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Success
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://https/Medicare/samedaydelete/v1"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-minor-id", "{{MinorId}}")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Success
require 'uri'
require 'net/http'

url = URI("https://https/Medicare/samedaydelete/v1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-minor-id"] = '{{MinorId}}'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/Medicare/samedaydelete/v1")
  .header("x-minor-id", "{{MinorId}}")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/Medicare/samedaydelete/v1', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '{{MinorId}}',
  ],
]);

echo $response->getBody();
```

```csharp Success
using RestSharp;

var client = new RestClient("https://https/Medicare/samedaydelete/v1");
var request = new RestRequest(Method.POST);
request.AddHeader("x-minor-id", "{{MinorId}}");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Success
import Foundation

let headers = [
  "x-minor-id": "{{MinorId}}",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://https/Medicare/samedaydelete/v1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Advanced_Claiming_Patient Claim Interactive_SameDayDelete_example
import requests

url = "https://https/Medicare/samedaydelete/v1"

payload = {
    "correlationId": "urn:uuid:MDE0000098d9c9097a8d474e",
    "sameDayDelete": {
        "patient": {
            "identity": {
                "givenName": "Clint",
                "familyName": "FLETCHER"
            },
            "medicare": {
                "memberNumber": "4951525561",
                "memberRefNumber": "3"
            }
        },
        "reasonCode": "001"
    }
}
headers = {
    "x-minor-id": "{{MinorId}}",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Advanced_Claiming_Patient Claim Interactive_SameDayDelete_example
const url = 'https://https/Medicare/samedaydelete/v1';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '{{MinorId}}',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"correlationId":"urn:uuid:MDE0000098d9c9097a8d474e","sameDayDelete":{"patient":{"identity":{"givenName":"Clint","familyName":"FLETCHER"},"medicare":{"memberNumber":"4951525561","memberRefNumber":"3"}},"reasonCode":"001"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Advanced_Claiming_Patient Claim Interactive_SameDayDelete_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/Medicare/samedaydelete/v1"

	payload := strings.NewReader("{\n  \"correlationId\": \"urn:uuid:MDE0000098d9c9097a8d474e\",\n  \"sameDayDelete\": {\n    \"patient\": {\n      \"identity\": {\n        \"givenName\": \"Clint\",\n        \"familyName\": \"FLETCHER\"\n      },\n      \"medicare\": {\n        \"memberNumber\": \"4951525561\",\n        \"memberRefNumber\": \"3\"\n      }\n    },\n    \"reasonCode\": \"001\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-minor-id", "{{MinorId}}")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Advanced_Claiming_Patient Claim Interactive_SameDayDelete_example
require 'uri'
require 'net/http'

url = URI("https://https/Medicare/samedaydelete/v1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-minor-id"] = '{{MinorId}}'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"correlationId\": \"urn:uuid:MDE0000098d9c9097a8d474e\",\n  \"sameDayDelete\": {\n    \"patient\": {\n      \"identity\": {\n        \"givenName\": \"Clint\",\n        \"familyName\": \"FLETCHER\"\n      },\n      \"medicare\": {\n        \"memberNumber\": \"4951525561\",\n        \"memberRefNumber\": \"3\"\n      }\n    },\n    \"reasonCode\": \"001\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Advanced_Claiming_Patient Claim Interactive_SameDayDelete_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/Medicare/samedaydelete/v1")
  .header("x-minor-id", "{{MinorId}}")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"correlationId\": \"urn:uuid:MDE0000098d9c9097a8d474e\",\n  \"sameDayDelete\": {\n    \"patient\": {\n      \"identity\": {\n        \"givenName\": \"Clint\",\n        \"familyName\": \"FLETCHER\"\n      },\n      \"medicare\": {\n        \"memberNumber\": \"4951525561\",\n        \"memberRefNumber\": \"3\"\n      }\n    },\n    \"reasonCode\": \"001\"\n  }\n}")
  .asString();
```

```php Advanced_Claiming_Patient Claim Interactive_SameDayDelete_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/Medicare/samedaydelete/v1', [
  'body' => '{
  "correlationId": "urn:uuid:MDE0000098d9c9097a8d474e",
  "sameDayDelete": {
    "patient": {
      "identity": {
        "givenName": "Clint",
        "familyName": "FLETCHER"
      },
      "medicare": {
        "memberNumber": "4951525561",
        "memberRefNumber": "3"
      }
    },
    "reasonCode": "001"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '{{MinorId}}',
  ],
]);

echo $response->getBody();
```

```csharp Advanced_Claiming_Patient Claim Interactive_SameDayDelete_example
using RestSharp;

var client = new RestClient("https://https/Medicare/samedaydelete/v1");
var request = new RestRequest(Method.POST);
request.AddHeader("x-minor-id", "{{MinorId}}");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"correlationId\": \"urn:uuid:MDE0000098d9c9097a8d474e\",\n  \"sameDayDelete\": {\n    \"patient\": {\n      \"identity\": {\n        \"givenName\": \"Clint\",\n        \"familyName\": \"FLETCHER\"\n      },\n      \"medicare\": {\n        \"memberNumber\": \"4951525561\",\n        \"memberRefNumber\": \"3\"\n      }\n    },\n    \"reasonCode\": \"001\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Advanced_Claiming_Patient Claim Interactive_SameDayDelete_example
import Foundation

let headers = [
  "x-minor-id": "{{MinorId}}",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "correlationId": "urn:uuid:MDE0000098d9c9097a8d474e",
  "sameDayDelete": [
    "patient": [
      "identity": [
        "givenName": "Clint",
        "familyName": "FLETCHER"
      ],
      "medicare": [
        "memberNumber": "4951525561",
        "memberRefNumber": "3"
      ]
    ],
    "reasonCode": "001"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://https/Medicare/samedaydelete/v1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```