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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Code and Connect: MCP + MuleSoft
  • Generic and Dynamic API: MuleSoft
  • Releasing MuleSoft API
  • API-Led Example: MuleSoft

Trending

  • Containment Is a Feature: Sandboxing, Egress Control, and Provenance for Autonomous Agents
  • How Has AI Impacted Code Obfuscation?
  • What's Really in an Agent's Context Window
  • Why Your RAG Pipeline, Not Your LLM, Is Causing Hallucinations

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
Jun. 22, 21 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
18.5K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

  • Code and Connect: MCP + MuleSoft
  • Generic and Dynamic API: MuleSoft
  • Releasing MuleSoft API
  • API-Led Example: MuleSoft

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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