iClient HealthPoint Demo

Shows how to use Tyro iClient to make Private Health Fund claims.

by IntegrationSupport

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
<script src="https://iclientsimulator.test.tyro.com/iclient-with-ui-v1.js"></script>
<h3>Create Invoice for Patient: John Smith</h3>
<h5>
<p> <strong>Please pair using MID 99922 and TID 1 before clicking on Process Claim</strong> 
</p>
</h5>

<div style="width: 600px">
<div class="container">
    <div class="row">
        <div class="col-xs-6">
            <div class="form-group">
                <label for="Provider">Provider</label>
                <select class="form-control" id="provider">
                    <option>Select Provider</option>
                </select>
            </div>
        </div>
        <div class="col-xs-6">
            <div class="form-group">
                <label for="Service Type">Service Type</label>
                <select class="form-control" id="serviceType">
                    <option>Select Service Type</option>
                </select>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-6">
            <div class="form-group">
                <label for="serviceReference">Service Reference</label>
                <input class="form-control" id="serviceReference" placeholder="E.g. Tooth Number or Body Part"></input>
            </div>
        </div>
        <div class="col-xs-6">
            <div class="form-group">
                <label for="patientId">Patient ID</label>
                <input class="form-control" id="patientId" placeholder="Enter Patient ID from Card"></input>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="form-group">
                <label for="Services">Select Services</label>
                <div id="services">
                </div>
            </div>
        </div>
    </div>
</div>
<button type="button" class="mt10 btn btn-primary" onclick="processClaim()">Process Claim</button>
<button...

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: 99922 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";
  }
        }

var providers = [{
    name: "Katy Cobrin",
    providerNumber: "2159081W",
    serviceType: "P"
}, {
    name: "Leonore Marsh",
    providerNumber: "1455813F",
    serviceType: "P"
}];

$(function () {
    $.each(providers, function (index, provider) {
        //console.log("adding " + provider.name);
        $("#provider").append('<option value="' + provider.providerNumber + '">' + provider.name + ' (' + provider.providerNumber + ')</option>');
    });
});

var services = [
    {itemNumber: "500", fullDescription: "Assessment Consultation - $100 benefit - $101 gap", shortDescription: "ASSMENT CONSULT", fee: 20100, displayFee: "$201.00"},
    {itemNumber: "505", fullDescription: "Subsequent Consultation - $0 benefit - $101 gap", shortDescription: "SUB CONSULT", fee: 10100, displayFee: "$101.00"},
    {itemNumber: "506", fullDescription: "Long Subsequent Consult - $100 benefit - $0 gap - include with 505 for $101 gap)", shortDescription: "LONG CONS 2A", fee: 10000, displayFee: "$100.00"},
    {itemNumber: "526", fullDescription: "Refer claim to fund", shortDescription: "LONG CONS 2A", fee: 70010, displayFee: "$700.10"},
    {itemNumber: "530", fullDescription: "Cancellable claim", shortDescription: "ASSMENT CONS HOM", fee:...