Bahmni REST API & FHIR APIs
FHIR Overview Video
If you are new to FHIR and want to understand what is FHIR, profiles / implementation guides, FHIR Terminology Server, etc. watch this excellent 18min overview YouTube video:
Bahmni (and OpenMRS) REST API swagger can be accessed on a running Bahmni instance on this url:
https://<bahmni-ip>:<port>/openmrs/module/webservices/rest/apiDocs.htm
For instance on the Bahmni Demo server, the URL will be: REST API (Demo Server).
Login to OpenMRS as Admin.
Click on Administration tab.
Click on "API Documentation" link in the "REST Web Services" group.
To see sample code on how to call Bahmni REST APIs, you can refer to the Bahmni Performance Tests written using Gatling (Scala DSL) here: https://github.com/Bahmni/performance-test/blob/old-framework/src/test/scala/org/bahmni/gatling/HttpRequests.scala
FHIR Api endpoints
To see the FHIR endpoints exposed by Bahmni, see the underlying OpenMRS documentation. With Bahmni LIte v1.0, these endpoints are also available, since the latest version of Bahmni ships with OpenMRS FHIR module that exposes these endpoints.
See FHIR endpoint documentation here:
You can try these URLs out on the Bahmni Lite environments. For instance this command on terminal will work:
# where last paremeter is UUID of the patient in Bahmni/OpenMRS curl -u"superman:Admin123" -H "Content-Type: application/json" https://dev.lite.mybahmni.in/openmrs/ws/fhir2/R4/Patient/1457e050-06aa-4b9e-99fc-342d79e09b05If you want to write a client code (in Java) to call Bahmni/OpenMRS FHIR endpoints, you can use the HAPI FHIR library. See sample code written by Siva Reddy Pathuri (Deactivated) here: https://github.com/sivareddyp/fhir-client-demo/blob/main/src/main/java/org/bahmni/fhirclientdemo/service/FhirResourceService.java
Since the upgrade of Bahmni’s underlying OpenMRS to 2.5.x, the capability to provider FHIR based responses is also available. For more information on FHIR APIs inherited automatically from OpenMRS, please see this documentation: https://wiki.openmrs.org/display/projects/FHIR+Support+in+1.3.0
One can try these FHIR apis on Bahmni Lite environments: Click here.