DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Generic and Dynamic API: MuleSoft
  • Releasing MuleSoft API
  • API-Led Example: MuleSoft
  • On-Demand-Schedulers With MuleSoft CloudHub APIs

Trending

  • Building a High-Throughput Distributed Sequence Generator Using the Hi-Lo Algorithm
  • Slopsquatting: Building a Scanner That Catches AI-Hallucinated Packages Before They Reach Production
  • Testing AI-Infused Apps: A Dual-Layer Framework for AI Quality Assurance
  • Beyond Manual Annotation: Engineering Self-Correcting Pseudo-Labeling Pipelines
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Mulesoft Accelerators for FHIR

Mulesoft Accelerators for FHIR

Mulesoft accelerators for FHIR: Accelerators are designed as modular building blocks. Customers can change the patterns, mappings, and endpoints to suit their needs.

By 
Gaurav Dhimate user avatar
Gaurav Dhimate
·
Jun. 22, 21 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
18.2K Views

Join the DZone community and get the full member experience.

Join For Free

First, what is FHIR (Fast Healthcare Interoperability Resources)? Well, it is a standard for exchanging healthcare information electronically. 

For more detail on FHIR check my other blog here. 

What are Mulesoft Accelerators?

Accelerators are a collection of technical assets (predominantly API specifications and implementation templates) and documentation to accelerate the implementation of multiple use cases supporting a larger business and/or industry problem.  

Accelerators are designed as modular building blocks. Customers can change the patterns, mappings, and endpoints to suit their needs. Customers save hours of discovery, design, development, and testing using accelerator assets.
- Mulesoft

Healthcare Accelerators Provided by Mulesoft

Complete Mulesoft healthcare accelerators can be found here.

MuleSoft Accelerator for Healthcare includes:

  • APIs (RAML),
  • API Specifications for FHIR R4 Resources,
  • Implementation templates.

You can use any one of the above or even multiple of them to deliver a working API. 

You can directly use the FHIR API or extended the FHIR API to create your own APIs.

For example, suppose you want to create an API to handle CRUD operation on the Patient object.

Solution Options

To start with API development we can start with RAML where we can use existing FHIR libraries of Mulesoft.

From the above diagram, you can use the FHIR R4 Patient library to create your own data types or directly use FHIR R4 Patient API to build an API.

Demonstration

Let's create our own API RAML using FHIR R4 Patient Library.

1. I will import the fhir-r4-patient library in my RAML. 

JSON
 
#%RAML 1.0
title: FHIR-demo

uses:
    patient: !import /exchange_modules/org.mule.examples/fhir-r4-patient-library/1.0.0/fhir-r4-patient-library.raml

/patients:
  get:
    responses:
      200:
        body:
          application/json:
            type: patient.PatientBundle
  post:
    body:
      application/json:
        type: patient.Patient


2. Now I will use Patient and PatientBundle datatypes from it to configure my endpoints.

3. Here I am using patient.Patient for post which means I can create Patient object with the data type that I get from the imported FHIR library.

4. Also patient.PatientBundle is used in getting to tell us that we can get a bundle of patient objects (or in a short array of Patient objects).

it will be something like below.

JSON
 
{
  "resourceType": "Bundle",
  "id": "bundle-example",
  "type": "searchset",
  "total": 3,
  "entry": [
    {
      "fullUrl": "https://example.com/base/Patient/3123",
      "resource": {
        "resourceType": "Patient",
        "id": "3123",
        "status": "unknown",
      }
    },
    {
      "fullUrl": "https://example.com/base/Patient/3124",
      "resource": {
        "resourceType": "Patient",
        "id": "3124",
        "status": "unknown",
      }
    }
	
  ]
}


Note: The example is just for demo purposes and I have removed a lot of fields that might be mandatory.

For the actual implementation of your API, you can get started with a template provided by Mulesoft.

Downloading Templates

Just download and import into your Anypoint Studio and you are ready to go. 

Conclusion

Here we have seen what is FHIR how we can use Mulesoft healthcare accelerators to create FHIR compliant APIs and also use templates to quick start the API implementation.

Accelerator (software) MuleSoft API

Opinions expressed by DZone contributors are their own.

Related

  • Generic and Dynamic API: MuleSoft
  • Releasing MuleSoft API
  • API-Led Example: MuleSoft
  • On-Demand-Schedulers With MuleSoft CloudHub APIs

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook