FHIR Chat · FHIR Integration with BPM Engine · implementers

Stream: implementers

Topic: FHIR Integration with BPM Engine


view this post on Zulip Muhammad Abubakar Ikram (Feb 07 2017 at 06:14):

Hello All,
I am really curious about the integration of both BPM Engine and FHIR. I have seen the relative slide on this topic but I didn't understand much out of it. I just know that there is PlanDefinition that somehow work with BPM engine. Can anyone please guide me or help me to figure out. for example, I have a use case that I want to place an appointment with the doctor using BPM Engine and having FHIR integrated with the BPM Engine.

view this post on Zulip Bryn Rhodes (Feb 07 2017 at 22:13):

I'm not sure I understand the question. Can you provide some more detail on how you have a BPMN engine that places an appointment with the doctor? Do you already have an implementation in place that does this, and you want to know how to represent that in FHIR?

view this post on Zulip Muhammad Abubakar Ikram (Feb 08 2017 at 04:45):

@Bryn Rhodes for example my scenario is if I am using an open source BPM engine that is also rest based and can be consumed from any app and there is a FHIR server that is also rest based and can be consumed from any app. Now if I have to make an EHR based on FHIR and I want all the processes in the EHR to be done using BPM processes. Now the three things in the picture FHIR Server, BPM Engine Server both rest based and my APP interacting with both. Now what comes in my mind is that If I have to make an appointment in my system I'll request an appointment in my app that will initiate the process of appointment in the BPM and a script in the step of BPM process will call the FHIR server for appointment this is how I think the integration will be but I am not sure about that. There is plan definition in FHIR and some stuff about workflow that is I am not understanding I just saw a slide about that no tutorials no examples.

view this post on Zulip Kevin Mayfield (Feb 09 2017 at 13:48):

I've done a little work with this with Activiti. I kept it all as FHIR, so if the BPM engine wanted to send out a document I did the mapping to FHIR in the BPM engine and called a FHIR endpoint. If an external system wanted to start a process (say ReferralRequest), a facade on the BPM would convert that resource to a (activiti) task.

view this post on Zulip Muhammad Abubakar Ikram (Feb 13 2017 at 11:08):

What is the meaning of converting fhir resource to BPM task?
What is PlanDefinition is what is the purpose of it? in the fhir?

view this post on Zulip Bryn Rhodes (Feb 13 2017 at 15:43):

PlanDefinition supports the description of various types of knowledge artifacts, including protocols, order sets, and event-condition-action rules. Such definitions could be automated by transforming them to BPMN definitions. See the examples in the spec for illustrations of each of these types of artifacts.

view this post on Zulip Muhammad Abubakar Ikram (Feb 15 2017 at 10:58):

So, PlanDefinition is a definition or a plan to perform a task in FHIR and it contains a collection of Actions and each action defines activity in terms of ActivityDefinition.
And we can execute a process within FHIR using operations like $process-start, $finish-task etc.

I HAVE NOT SEEN THE TRANSFORMATION FROM PlanDefinition to BPMN definitions? kindly refer me to any examples

And there is also Task resource how it relates with PlanDefinition?

view this post on Zulip Muhammad Abubakar Ikram (Feb 15 2017 at 11:02):

And kindly tell me in (http://hl7.org/fhir/2017Jan/workflow.html#optionh) example workflow broker term is referring to an external BPM Engine?

view this post on Zulip Lloyd McKenzie (Feb 15 2017 at 18:43):

It could be a BPM engine but certainly wouldn't have to be. We don't have any examples of conversion to BPMN yet Also, the Task operations will be pulled for this release as we haven't had enough thought about when they should be used in place of a standard RESTful update.

view this post on Zulip Muhammad Abubakar Ikram (Feb 16 2017 at 09:47):

@Kevin Mayfield According to your answer I understood somehow and I want to know that I am correct or not.

1. "so if the BPM engine wanted to send out a document"
for example. proposing an appointment and sending appointment resource to FHIR server from BPM task. Am I right?

2. "I did the mapping to FHIR in the BPM engine"
for example. putting the value of BPM variable in the FHIR resource in BPM engine. Am I right?

3. "called a FHIR endpoint"
for example. HTTP post request to appointment endpoint from the script in BPM Engine task with the appointment resource in the request body for proposing an appointment. Am I right?

4. "If an external system wanted to start a process (say ReferralRequest)"
you are talking about BPMN process? or a FHIR process?

5. "a facade on the BPM would convert that resource to a (activiti) task."
how a FHIR resource can be converted to a BPM task?

view this post on Zulip Kevin Mayfield (Feb 16 2017 at 14:17):

I used Apache Camel (+HAPI libs) to map between FHIR and BPMN. Basic ideas are documented in Camel In action and Activiti in Action books. Also https://www.activiti.org/userguide/index.html#bpmnCamelTask

1,2 It was a camel activiti component that intercepted the task which was converted to FHIR
4 bpmn process
3.5 Used a camel REST adapter to present a FHIR endpoint, within the camel processing I'd access activiti (either with camel lib or activiti libs)

view this post on Zulip Muhammad Abubakar Ikram (Feb 17 2017 at 07:53):

@Kevin Mayfield So what I have done using Camunda
--> I have updated the status of appointment
1. I have used the Camunda Service task with http rest connector
2. I have put the updated appointment resource in the request payload
3. Performed a PUT request to a FHIR server
4. Appointment resource updated, Done.

now I want to know is this is the correct way of combining BPM engine and FHIR?
or I am missing something?

Because in my these steps I have not faced PlanDefinition, FHIR and BPMN mapping and conversion between BPMN to PlanDefinition : | even I don't know where why when and for what purpose I will face these things.

Kindly correct me if I am wrong

view this post on Zulip Kevin Mayfield (Feb 17 2017 at 08:30):

It seems the correct way to me but I'm still looking myself.

view this post on Zulip Bryn Rhodes (Feb 17 2017 at 15:30):

That sounds reasonable for your use case. The point of PlanDefinition is if you want to exchange the descriptions of your workflow, as in protocols, order sets, or event-condition-action rules.

view this post on Zulip Oliver Krauss (Feb 20 2017 at 11:35):

Hello @Muhammad Abubakar,

sorry for the late reply. I was away last week. Having read your approach in this thread, I think it is a good one. Using Camunda to drive the process and update FHIR ressources as you go along is a good way to drive it client-side / externally.

We do the exact opposite and use FHIR and BPMN to handle process executions. For that we have a BPMN Workflow Engine (Camunda) integrated in a FHIR server. So internally the WFE is processing BPMN but externally everything is FHIR.

How do we get FHIR and BPMN together? Basically we see a PlanDefinition as a BPMN. Inside an ActionDefinition is equivalent to a task. Sequence flow is releatedAction, and data flow is the input/output Data Requirements. We use the Atlas Transformation Language (https://en.wikipedia.org/wiki/ATLAS_Transformation_Language) to map between the two. Note that ATL will probably be outdated in a few months/years because FHIR has StructureMap with its own transformation language. See this talk by @Grahame Grieve. But for now it is the way to go being the only Model to Model Transformation language available. We are currently working on a publication with details, which I will be happy to link here as soon as it is published and if anyone is interested.

We do define FHIR operations to drive the Workflow Engine. However this is only one option, as we want all participants to only have to talk FHIR, and we do not require the WFE to be Camunda, it is one choice of many. The operations basically do nothing more than call the WFE in the Server, and the WFE is responsible for creating appropriate FHIR Ressources along the way. So for example $process-start calls the appropriate Java-code to start up a new process in the WFE. You may as well use the REST-Interface that Camunda provides out of the box.

Lastly, when you execute a PlanDefinition/BPMN, every currently running BPMN-UserTask equates to a FHIR-Task. The reason being that you can update the task according to the workflow-state, store the actual input and output produced that were defined in the corresponding ActionDefinition and of course store information about the process in FHIR.

view this post on Zulip Muhammad Abubakar Ikram (Feb 20 2017 at 14:07):

@Oliver Krauss Thank you so much for such a detailed answer.
1. So, can you please compare the FHIR's approach with mine in some pros and cons manner?
2. Can you please hint what kind of goals (processes) is being achieved having a BPM engine inside FHIR? example one or two?
3. The goals (processes) which are being achieved having a BPM engine inside FHIR, can they be achieved while not using BPM engine in FHIR and using just FHIR CRUD operations?

view this post on Zulip Oliver Krauss (Feb 21 2017 at 08:34):

1) Your approach is independent of any FHIR server, so you can communicate with any of the implementations out there. Ours demands modificaton of a specific one, or writing your own. The disadvantage of your solution is that anyone involved in guiding the process needs to implement not only FHIR but also the Camunda interfaces, while applications using our solution stay in FHIR only. The biggest advantage, and main reason of our aproach is interoperability between different healthcare and health-IT providers. When you have a FHIR specification of your process anyone that can read and implement the spec can also participate in the process, whereas a proprietary BPMN implementation demands (more) up front negotiation.

2) Not sure I undestand the question. If you mean what we use it for, then Multi Disciplinary Team Meetings (MDTM - Tumor Boards in particular) for details on the process there is a paper and a presentation detailing them. So as an example, we get several medical-professionals that work in different organizations / are in different physical places together at the same time, and they conduct a Meeting about several patients healthcare-status. The WFE drives the process, provides data when the participants need it, and documents both the process and the decisions made by the team.

3) Everything we do can also be achieved by just using the existing FHIR operations (Crud and search primarily). You can even still do shared-processes using the workflow communication patterns. In fact some of our project partners participate in the workflows witout using a WFE. Using the WFE is just one possibility with the advantage over writing everything by hand mainly being reusability, and adhering to a simple understandable pattern.


Last updated: Apr 12 2022 at 19:14 UTC