This application simulates processing a healthcare claim, starting with the referral from the Primary Care Provider (PCP) and including the creation of an appointment with the radiologist, checking in the patient on the date of the appointment, checking out the patient after service delivery, generation of the claim, and finally, payment for the procedure.
Disclaimer: This reference application is intended to demonstrate the capabilities of Daml. You are recommended to consider other non-functional aspects, like security, resiliency, recoverability, etc prior to production use.
Be sure you have the following installed.
- Daml SDK
- Java 8 or higher
- Make
- Node v14.16.0 or higher
- NPM v7.14.0 or higher
- Python Pipenv
-
Build the App. Type:
make build
Note: If you change the Daml models locally, you need to re-run this command before starting the application.
-
Use separate terminals to launch the individual components:
launchers/sandbox+populate launchers/automation launchers/ui
- Stop each running command by pressing Ctrl+C.
Note: The custom UI does not work on Daml Hub yet, but you can use Daml Hub's live explorer to interact with the contracts by following the instructions below.
-
As a first step, build the whole project
make clean build
-
Create a project and a ledger in Daml Hub
-
Upload the DARs
-
Add the parties to the ledger
- PrimaryCareProvider
- Radiologist
- Patient1
- Operator
- InsuranceCompany
-
Download
participants.json
from the ledger settings -
Create the
ledger-setup.json
file manually or by runningnode scripts/create-ledger-setup.js participants.json ledger-setup.json
The resulting file should like this:
{ "parties": { "payer1": "ledger-party-92d3fc64-a589-4a18-9e47-30541fdc7824", "operator": "ledger-party-01328c4d-a7b1-49d4-92cc-400badcb46c2", "patient1": "ledger-party-841214e1-cb38-42fa-88a9-08710592f74d", "provider1": "ledger-party-5292e717-bbd6-43d5-8cdc-67b463427ee9", "provider2": "ledger-party-bd952624-9142-412d-ae39-f6025cd94ac8" } }
The following table contains the necessary name mapping:
Daml Hub name (in participants.json
)Ledger Setup name primaryCareProvider provider1 radiologist provider2 patient1 patient1 operator operator insuranceCompany payer1 -
Run the ledger setup
daml script \ --participant-config participants.json \ --json-api \ --dar models.dar \ --script-name DemoOnboardScenario.StartScript:setupLedger \ --input-file ledger-setup.json
-
Run the triggers from the Daml Hub UI
Party Trigger InsuranceCompany Triggers.AcceptClaimTrigger:acceptClaimTrigger InsuranceCompany Triggers.AcknowledgeAppointmentTrigger:acknowledgeAppointmentTrigger Radiologist Triggers.EvaluateReferralTrigger:evaluateReferralTrigger Radiologist Triggers.UpdateReferralDetailsTrigger:updateReferralDetailsTrigger Patient1 Triggers.AcknowledgeAndDiscloseTrigger:acknowledgeAndDiscloseTrigger Patient1 Triggers.AcceptPatientPaymentRequestTrigger:acceptPatientPaymentRequestTrigger
This User Guide will take you step-by-step through healthcare claims processing, executing one successful claim.
Note: This demo is designed to show successful processing of a claim without exceptions or error conditions. A full production implementation would include additional features, handle errors and exceptions, and incorporate appropriate security controls.
Roles and Responsibilities
Role | Responsibility |
---|---|
Primary Care Provider | A physician, who creates a referral for a Patient to a Radiologist |
Patient | Visits the Primary Care Provider and is referred to a Radiologist Pays their portion of the Bill/Claim after the Radiologist submits a Claim |
Radiologist | Checks Referrals and schedules an Appointment for a Patient On the Appointment date they Check-In the Patient in and perform a treatment Marks the Treatment as Completed which creates a Claim for the Insurance Company |
Insurance Company | Pays their portion of the Claim/Bill after the Radiologist submits a Claim |
Steps
The Healthcare Process workflow involves these steps:
-
Referral
The Primary Care Provider creates a referral for "John Doe" in the system, sending the patient to a radiology lab (Radiologist) for an x-ray of a possible fracture. The system checks to verify that the patient is eligible for treatment under their insurance and calculates the cost of the procedure for this patient.
Checks include:
- Validity of the patient’s insurance policy (in good standing, not expired)
- Network status of the radiologist (whether in or out of the insurance company’s approved provider list)
- Verification of eligibility and pre-authorization for the treatment
-
Appointment
The Radiologist now creates an appointment for the patient in the system. The system ensures that the treatment is appropriate for the diagnosis and that any necessary pre-authorization has been done. It checks again to ensure that the patient insurance status has not changed since the referral was created.
-
Check-In
The patient goes to the lab and is checked in. Again the system reruns all the previous checks to determine if any parameter has changed, for example, whether the patient has satisfied more of their deductible before this date.
-
Treatment Completion and Claim Creation
The x-ray is done. The treatment is completed, and the claim is automatically created. The system creates an obligation for the patient to pay their portion of the cost (if any) and for the insurance company to pay its portion.
-
Payment
The insurance company now pays the claim to the lab. The patient pays any required amount as well. The amounts paid are the verified amount established in first steps of the process.
When you launch the application, you will see a login screen with the option to choose your Role.
To switch from one Role to another click on "Change Roles" in the lower left hand corner of the screen.
Note: In this application each Role is represented by a different Party, this is a simplified design for demonstration purposes.
The workflow begins with the patient visiting their Primary Care Provider physician (PCP) for treatment. The PCP decides the patient needs an X-Ray and creates a referral to a Radiologist.
- Log in as the Primary Care Provider Role
- Go to Patients tab
- Click on the Patient "John Doe"
- Select "Refer Patient"
- Fill out the "Create Referral" screen and click "Create Referral.
- You can select the "Policy", "Diagnosis Code", and "Procedure Code" from their respective dropdowns
- Receiver must be "Radiologist" (without quotes)
- All other fields can contain any text
The next step is scheduling the appointment for the x-ray.
- Log in as the Radiologist
- Choose the Referrals tab
- Click on the referral for "John Doe" that you just created
- Choose Schedule Appointment
- Select the date and time for the appointment on the New Appointment pane and click the Schedule Appointment button.
-
You'll typically want to leave this as the current date and time, otherwise the system won't let you check in "John Doe" until the scheduled appointment time has passed.
-
This new appointment is now visible to the Radiologist and "John Doe".
-
The various checks are run again, and the payment requirements are displayed, showing now what payment the lab will receive and what the patient will owe.
-
The Primary Care Provider cannot see this part of the workflow, as the appointment scheduling is only disclosed to the Patient, the Radiologist, and the Insurance Company.
-
The next step is for the patient to arrive at the lab for the x-ray and be checked in.
-
Choose the Appointments tab as the Radiologist
-
Click on "John Doe"s appointment
-
Click "Check In Patient" and confirm in the dialog window
The various checks are run again to confirm that the patient is still eligible and to recalculate the payments to account for any changes, such as a situation where the patient has satisfied part of their deductible.
After the x-ray is done, the patient is checked out from the facility, and the claim is created.
- Choose the Treatments tab as the Radiologist
- On the Treatments tab, click on the treatment with "John Doe"s name and click Complete Treatment and confirm in the dialog window
- You can see the pending unpaid claim by locating it on the Claims tab. It will show both the Patient and Insurance Company's payment responsibilities.
The last step of this workflow is for payment to be made to the lab by both the Insurance Company and the Patient
-
Log in as Insurance Company and choose the Claims tab
-
On the Claims list screen, click on the claim made from the Radiologist to the Insurance Company
- Details of this claim will be displayed.
-
Click the Pay Claim button, and confirm in the dialog window
-
Log in as the Patient and choose the Bills tab
- In a production system, the patient would likely log in through a patient portal rather than through this application.
-
Click on the open claim from the Radiologist, click the Pay Bill button and confirm on the dialog window
And that's the whole workflow! You've just worked through a complicated but typical workflow involving 4 separate parties with their respective privacy preserved throughout and information disclosed only where necessary.
CONFIDENTIAL © 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. Any unauthorized use, duplication or distribution is strictly prohibited.