OpenFn / instant-demo

A demo of OpenFn Microservice, OpenHIM and HAPI FHIR using Instant OpenHIE.
2 stars 0 forks source link

Demo FHIR-to-FHIR data exchange on Lightning #5

Closed aleksa-krolls closed 1 year ago

aleksa-krolls commented 1 year ago

Background

In issue #3 we created this demo openhie workflow, showcasing how to convert a CommCare payload to the FHIR format before routing to a HAPI FHIR server. This was an example workflow between a non-FHIR and a FHIR system.

Now we want to demonstrate FHIR-to-FHIR data exchange between 2 FHIR-compliant data systems.

Request

  1. Get bundle (or "array") of patients from this demo API: https://fhir.simplifier.net/R3/Bundle/c393585c-1f5d-4eab-b19e-2c51bdce0d11 (See demo docs. This will return a basic patient resource with attributes like name, gender, birthdate.

  2. Then create new patents in HAPI FHIR using the bundle endpoint to create multiple patients https://hapi.fhir.org/resource?serverId=home_r4&pretty=true&_summary=&resource=Bundle

Because these 2 systems are both compliant, there should be no need for mapping rules/special business logic.

I've already configured this workflow on app.openfn.org: https://app.openfn.org/projects/fdfdf286-aa8e-4c9e-a1d2-89c1e6928a2a/w/eca5ca64-6f53-4bc2-b117-2fc4d586a903/j/54103c45-ca87-4490-904b-bdae6d9b6b71#editor

Screen Shot 2023-06-05 at 8 45 00 AM

expression

2 new jobs:

  1. getPatientBundleFHIR.js
  2. createPatientBundleFHIR.js

state

  1. Source FHIR demo: https://fhir.simplifier.net/R3/Bundle/c393585c-1f5d-4eab-b19e-2c51bdce0d11
  2. Destination HAPI FHIR server: https://hapi.fhir.org/resource?serverId=home_r4&pretty=true&_summary=&resource=Bundle

Output

Sending a GET 'https://fhir.simplifier.net/R3/Bundle/c393585c-1f5d-4eab-b19e-2c51bdce0d117' will return an array of patient resources.

See sample payload here: https://simplifier.net/Patientexamplesfromt/Bundle-example/~json

aleksa-krolls commented 1 year ago

Hey @mtuchi I need your help putting together this simple demo showcasing how we might send data between 2 FHIR-compliant systems. Looping in @taylordowns2000 as well to support with any questions, thanks!

mtuchi commented 1 year ago

@aleksa-krolls This is done now, See PR #6, I will need to cut a new release of the fhir adaptor and update the adaptor version on lighting to use the latest version of fhir for createPatientBundleFHIR job

I have already updated the jobs on Lighting ⚡ , i am just waiting for PR approval from @taylordowns2000 on adaptors https://github.com/OpenFn/adaptors/pull/269

aleksa-krolls commented 1 year ago

Thanks, @mtuchi ... Lightning config looking good. So when @taylordowns2000 approves, please let me know the following for each job:

  1. which adaptor
  2. which adaptor version
  3. configuration schema

I will then test in the morning to make sure this is ready to go 😊

mtuchi commented 1 year ago

@aleksa-krolls i have just published a new release for fhir

adaptor: fhir
version: 2.0.0
configuration: {
        "baseUrl": "https://fhir.simplifier.net",
        "apiPath": "R3"
    }