Medicare demo

by IntegrationSupport

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
<script src="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/vkbeautify/vkbeautify.0.99.00.beta.js"></script>
<script src="https://iclientsimulator.test.tyro.com/iclient-with-ui-v1.js"></script>
<h3>Medicare Easyclaim Demo</h3>
<h5>
<p> <strong>Please pair using MID 99922 and TID 1 before processing a claim.</strong> Click on the "Pairing" button twice, complete the pairing process, and then click on the "Pairing" button to hide the frame.
</p>
</h5>

<button type="button" class="mt10 btn btn-primary" onclick="pairing()">Pairing</button>
<button type="button" class="mt10 btn btn-primary" onclick="iClientlogs()">iClientLogs</button>

<h2 class="mt10">
 <iframe id="iClientFrame" src="" 
       style="height: 400px; width: 400px;">
    </iframe>
    </h2>


<div class="form-group" style="width: 200px;">
    <select class="form-control" id="claim" onchange="claimSelected(this.value)">
        <option value="-1">Select claim</option>
    </select>
</div>
<label>
    Payload to send to Medicare:
</label>
<textarea id="payload" name="payload" style="width:100%; height:200px; font-size:12px;"></textarea>

<button id="processFullyPaidClaimButton" type="button" class="mt10 btn btn-primary" onclick="processClaim()" style="display: none;">Process Fully Paid Claim</button>
<button id="processPartPaidClaimButton" type="button" class="mt10 btn btn-primary" onclick="processClaim()" style="display: none;">Process Part Paid Claim</button>
<button id="processBulkBillClaimButton" type="button" class="mt10 btn btn-primary" onclick="processClaim()" style="display: none;">Process Bulk Bill Claim</button>



<h3 class="mt10">Claim result</h3>

<table style="width: 100%;">
    <tr valign="top">
        <td>
            <div id="result"></div>
        </td>
    </tr>
</table>
</div>

CSS

body {
    margin: 10px;
}
h3 {
    margin-top: 0;
}
td {
    padding: 3px;
}
.mt10 {
    margin-top: 10px;
}

JavaScript

// Before running this fiddle, you will need to pair your virtual terminal with the browser using this page:
// https://iclientsimulator.test.tyro.com/configuration.html
// Use Merchant ID: 12345 and Terminal ID: 1

var apiKey = "Test API Key"; // API Key not validated test environments
var posProductInfo = {
    posProductVendor: "Acme Co",
    posProductName: "Acme Cloud POS",
    posProductVersion: "1.0.0"
};
var iclient = new TYRO.IClientWithUI(apiKey, posProductInfo);

function pairing() {
   var x = document.getElementById("iClientFrame")
   x.src
   = "https://iclientsimulator.test.tyro.com/configuration.html";
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
        }
        
function iClientlogs() {
   var x=document.getElementById("iClientFrame")
       x.src
   = "https://iclientsimulator.test.tyro.com/logs.html";
   
     if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
        }

var fullyPaidPayload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns1:patienteClaimingRequest xmlns:ns1=\"http://medicareaustralia.gov.au/eclaiming/version-2\"><claim accountPaidInd=\"Y\">        <voucher voucherId=\"01\" serviceTypeCde=\"O\"><service dateOfService=\"$$DATE$$\" itemOverrideCde=\"AP\" mbsItemNum=\"23\" chargeAmount=\"5000\" serviceId=\"0001\"/></voucher><patient memberNum=\"2950774911\" memberRefNum=\"1\"/><servicingProvider providerNum=\"2147661H\"/></claim></ns1:patienteClaimingRequest>";

var partPaidPayload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns1:patienteClaimingRequest xmlns:ns1=\"http://medicareaustralia.gov.au/eclaiming/version-2\"><claim accountReferenceNum=\"123456789\" accountPaidInd=\"N\"><voucher voucherId=\"01\" serviceTypeCde=\"O\"><service lspnNum=\"1\" dateOfService=\"$$DATE$$\" itemOverrideCde=\"AP\" mbsItemNum=\"23\" chargeAmount=\"5000\" patientContribAmt=\"1000\" serviceId=\"0001\"/></voucher><patient...