FHIR module on standalone app

Module: FHIR

Module Version: 1.20.0

System Version: 2.3.0 Build b3ade0

Issue or Question: I’m not having any luck accessing the FHIR module endpoints on the standalone app.

I’ve got the standalone app running locally, and looking at the Module Management page, it seems to include the FHIR Module by default.

However, I’m attempting to pull some patients following the process described here, but only get 404 Not Found errors.

The URL I’m attempting to GET from is:

http://localhost:8081/openmrs-standalone/ws/fhir2/Patient?name=Clark

(I’ve also tried multiple variations, including changing /openmers-standalone/ to just /openmrs/, changing /fhir2/ to just /fhir/, etc…with no luck).

Is there an additional configuration needed in order to access the FHIR endpoints? Do I need to modify the URL or my approach? Or does this module just not work with the standalone version?

Thanks for your help!

@captplanet if am not mistaken , Fhir2 is an extension of Fhir , so question are you using Post man or Refapp UI ?If Refapp , I wonder wether Fhir2 has a UI extension,I manipulted that by using Fhir Rest Client and changing the endpoint from /openmrs/ws/fhir/ to /openmrs/ws/fhir2/

Thoughts @ibacher

Hi @tendomart ,

I’ve made these GET calls both using curl, and using the chrome Advanced Rest Client extension. I’ve tested all these variations:

  • /openmrs-standalone/ws/fhir2/
  • /openmrs-standalone/ws/fhir/
  • /openmrs/ws/fhir2/
  • /openmrs/ws/fhir/

Are you able to spin up the standalone app and make successful GET calls to that /openmrs/ws/fhir2/ address? If it’s working for you (specifically with the local jar-based standalone app, not the web demo), that would suggest I’m just doing something wrong on my end…

I removed this because of some issue.

I never worked with the stand lone but rather , the SDK Instance , and atleast , person and patient endpoints worked , on doing a GET Requests.

Ah! I’ve tested a bit more, and realized that the /fhir/ address isn’t actually returning 404s, it’s returning 401s (unauthorized)! Definitely missed that on my first round of testing.

Do you happen to know the header names for authenticating API calls?

You didn’t even give me feed back wether the options which provided worked.Did they work for you ?

You didn’t even give me feed back wether the options which provided worked.Did they work for you ?

For the standalone app, the only address that doesn’t return a 404 error is /openmrs-standalone/ws/fhir/, which is actually instead returning a 401 unauthorized error. I’m trying to figure out the expected header format for authorization is, but I can’t seem to find anything in the documentation.

I never worked with the stand lone but rather , the SDK Instance

I haven’t yet had a chance to try this with the SDK instance.

This is actually what i needed .Did you do this ?

Standalone is not any different from Enterprise or sdk instances. They are only configured differently.

As mentioned previously, changing to /openmrs/ws/fhir2/ just returns a 404 error instead.

Did you try it with Fhir Rest Client ?

With a person or patient Id that exists in the Database .

With a person or patient Id that exists in the Database .

Yep, I’ve been trying with an existing patient id.

However, I should be good now. I dug through the normal (non-FHIR) REST API documentation, and was able to find that API calls simply need Basic base64-encoded auth headers.

I’ve added those, and now the FHIR endpoints are working as expected.

Thanks for your help.

2 Likes

Glad they work now.