# exchange Bahmni healthcare information with Health Information Exchange (HIE) platform that supports HL7 v2.5

**URL:** <https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226>\
**Category:** Bahmni\
**Tags:** hl7, bahmni\
**Created:** [March 22, 2022, 3:22pm UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226 "2022-03-22T15:22:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hassan180](https://talk.openmrs.org/letter_avatar/hassan180/32/6_22734026db12803ebb3e059622ac3534.png) [@hassan180](https://talk.openmrs.org/u/hassan180)\
**Post date:** [March 22, 2022, 3:22pm UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/1 "2022-03-22T15:22:36Z")

</div>

Hi there, I want to collect patient registration and clinical information within Bahmni EMR system. Forwards this information to a Health Information Exchange platform via HL7 message format

it seems that Bahmni supports Hl7 ! as I have connected to Bahmni openmrs database using MySql workbench and found in the Schema some tables related to HL7, also found in the openmrs Administration page a section also related to HL7 messages but i don’t know how to configure it.

I am new with Bahmni so any resources that might help, please ?!

---

<div class="post-metadata">

**Author:** ![gsluthra](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gsluthra/32/1453_2.png) [@gsluthra](https://talk.openmrs.org/u/gsluthra)\
**Post date:** [March 23, 2022, 10:45am UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/2 "2022-03-23T10:45:53Z")

</div>

One option could be to get this information from Bahmni Atom feed. See this discussion: [Introducing Bahmni HL7 LIS Integration](https://talk.openmrs.org/t/introducing-bahmni-hl7-lis-integration/34198)

You can also consider using the FHIR Module of OpenMRS. Add that to Bahmni. [GitHub - openmrs/openmrs-module-fhir2: This is a module implementing a FHIR interface for OpenMRS](https://github.com/openmrs/openmrs-module-fhir2)

---

<div class="post-metadata">

**Author:** ![gsluthra](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gsluthra/32/1453_2.png) [@gsluthra](https://talk.openmrs.org/u/gsluthra)\
**Post date:** [March 23, 2022, 12:55pm UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/3 "2022-03-23T12:55:58Z")

</div>

Some places in code where you can see HL7 being used as a reference are:

1. feed-integration-test: A repo that shows how to integrate with Bahmni Atom Feed: [bahmni-feed-integration-example/feed-integration-webapp/src/test/java/org/bahmni/module/feedintegration/integrationtest at main · Bahmni/bahmni-feed-integration-example · GitHub](https://github.com/Bahmni/bahmni-feed-integration-example/tree/main/feed-integration-webapp/src/test/java/org/bahmni/module/feedintegration/integrationtest)

2. Underlying OpenMRS Core also supports HL7. See this [documentation](https://wiki.openmrs.org/display/docs/HL7) and this [test code](https://github.com/openmrs/openmrs-core/blob/master/api/src/test/java/org/openmrs/hl7/HL7ServiceTest.java).

---

<div class="post-metadata">

**Author:** ![gsluthra](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gsluthra/32/1453_2.png) [@gsluthra](https://talk.openmrs.org/u/gsluthra)\
**Post date:** [March 23, 2022, 1:09pm UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/4 "2022-03-23T13:09:08Z")

</div>

It appears #jembi has written a sample [OpenHIM](http://openhim.org/) mediator, to pull patient information from OpenMRS/Bahmni and write out via FHIR to OpenHIM… which can then be written out to any connected system. This could be helpful to you too.

See [documentation](https://jembi.github.io/openhim-mediator-mapping/docs/gettingStarted/samples#bahmni-patient-to-fhir) and [sample code](https://github.com/jembi/openhim-mediator-mapping/tree/master/samples/bahmniPatientToFhir).

Apologies for multiple responses… but seems I have gone down a rabbit hole. : )

---

<div class="post-metadata">

**Author:** ![hassan180](https://talk.openmrs.org/letter_avatar/hassan180/32/6_22734026db12803ebb3e059622ac3534.png) [@hassan180](https://talk.openmrs.org/u/hassan180)\
**Post date:** [March 29, 2022, 3:13pm UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/5 "2022-03-29T15:13:00Z")

</div>

Thank you @gsluthra , I choosed the second option

> [@gsluthra](#):
>
> You can also consider using the FHIR Module of OpenMRS. Add that to Bahmni. [GitHub - openmrs/openmrs-module-fhir2: This is a module implementing a FHIR interface for OpenMRS](https://github.com/openmrs/openmrs-module-fhir2)

I have downloaded the fhir2-1.3.0.omod file and added it to openmrs using the administration page, I tried to call [https://192.168.33.10:443/openmrs/ws/fhir/R1/metada](https://192.168.33.10:443/openmrs/ws/fhir/R1/metada), I get back a response with “Resource does not exist.

Please let me know if I’m missing some configuration

---

<div class="post-metadata">

**Author:** ![abertnamanya](https://talk.openmrs.org/user_avatar/talk.openmrs.org/abertnamanya/32/17402_2.png) [@abertnamanya](https://talk.openmrs.org/u/abertnamanya)\
**Post date:** [March 30, 2022, 7:43am UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/6 "2022-03-30T07:43:27Z")

</div>

Hi @hassan180 I think the error came from the wrong url to metadata Fhir Resource try out this one [https://192.168.33.10:443/openmrs/ws/fhir2/R4/metadata](https://192.168.33.10:443/openmrs/ws/fhir2/R4/metadata) Any further information please follow this link [OpenMRS HL7 FHIR Solutions - Projects - OpenMRS Wiki](https://wiki.openmrs.org/display/projects/OpenMRS+HL7+FHIR+Solutions)

---

<div class="post-metadata">

**Author:** ![hassan180](https://talk.openmrs.org/letter_avatar/hassan180/32/6_22734026db12803ebb3e059622ac3534.png) [@hassan180](https://talk.openmrs.org/u/hassan180)\
**Post date:** [March 31, 2022, 11:39am UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/7 "2022-03-31T11:39:44Z")

</div>

Thank you @abertnamanya Although that i have already tested it with the R4 version, but it was a typo to send it , so sorry , after some help on slack i have restarted the openmrs service using this command `sudo service openmrs stop` then `start` , then refreshed the page with the correct [url](https://192.168.33.10/openmrs/ws/fhir2/R4/metadata) as you sent, and i have got a file called metadata and the same happens when i remove `metadata` with `patient` in URL the [file](https://pastebin.com/vKxgnptv) containing all the patients in openmrs , but i don’t need an xml file so is it possible to get the data as a JSON format using Postman ? cause i have already tried and it says it cant sent the request

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [March 31, 2022, 12:31pm UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/8 "2022-03-31T12:31:07Z")

</div>

> [@hassan180](#):
>
> but i don’t need an xml file so is it possible to get the data as a JSON format using Postman ?

Did you try loading any of those URLs in Postman? Because you would’ve gotten the JSON documents you’re looking for.

When you go to a URL in your browser, we use content negotiation (as covered by [the FHIR spec](https://www.hl7.org/fhir/http.html#mime-type)) to work out what format to respond with. Basically, this just means that we look at the “Accept” header of the request. If you browse to a FHIR endpoint in your browser, your browser probably sends it’s default `Accept` header which looks something like this (taken from Chrome):

`Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`

This lists the various MIME-types of documents your browser is willing to process. If you notice, the first group there says the browser can handle `application/xml`, so you end up getting an XML response. By default (i.e., with no Accept header) the response will be JSON.

Inside the browser, you can append `?_format=json` to the end of the URL to get back the JSON representation.

---

<div class="post-metadata">

**Author:** ![hassan180](https://talk.openmrs.org/letter_avatar/hassan180/32/6_22734026db12803ebb3e059622ac3534.png) [@hassan180](https://talk.openmrs.org/u/hassan180)\
**Post date:** [March 31, 2022, 2:45pm UTC](https://talk.openmrs.org/t/exchange-bahmni-healthcare-information-with-health-information-exchange-hie-platform-that-supports-hl7-v2-5/36226/9 "2022-03-31T14:45:23Z")

</div>

Wow, thank you @ibacher it’s you who I meant here, and sorry for the late thanks on slack,

> [@hassan180](#):
>
> after some help on slack

and now it works, BIG THANKS
