Getting only one Patient Observation details using FHIR

Hello all,

When i am trying to get the Bundle observation Details of the patient through FHIR . I am getting only one patient Observation detail. Whereas in OpenMRS i have created two patients and the vitals of the patients also has been created.Below is the Url i have used to get the datas from OpenMRS through FHIR.

http://localhost:8080/openmrs/ws/fhir2/R4/Observation

I have even tried to get a specific patient details using uuid. But it is showing me error 404. Where am i going wrong?. where can i see the uuid of the patient to get the observation and Allergy intolerence datas?. I have attached a image below for your reference of the uuid i have used.

uuid= cbdaeecf-1454-48d6-ba49-a5e99c6f1744

url used to get specific patient Observations: http://localhost:8080/openmrs/ws/fhir2/R4/Observation/cbdaeecf-1454-48d6-ba49-a5e99c6f1744

Kindly let me know why i am facing this issue.

1 Like

What do you get when you try this?

http://localhost:8080/openmrs/ws/fhir2/R4/Observation?subject=cbdaeecf-1454-48d6-ba49-a5e99c6f1744

I am getting 404 Error

How about this?

https://localhost:8080/openmrs/ws/rest/v1/patient/cbdaeecf-1454-48d6-ba49-a5e99c6f1744

Hey @dkayiwa the below link works perfectly.

http://localhost:8080/openmrs/ws/fhir2/R4/Observation?subject=cbdaeecf-1454-48d6-ba49-a5e99c6f1744

I can able to take datas of the Two seperate patients using the uuid.

Then why am i not getting it in the Bundle Observation data.??

Why only one patient detail it is showing.

Can you share the server side log via pastebin.com?

Hey @dkayiwa ,

I have not used patebin before, below is the response i got after hitting GET request from the Postman.

penmrs-referenceapplication_1 | WARN - HibernateContextDAO.authenticate(133) |2023-03-30T05:25:46,239| bad value stored in lockoutTimestamp user property: openmrs-referenceapplication_1 | WARN - DefaultProfileValidationSupport.loadStructureDefinitions(329) |2023-03-30T05:25:48,465| Unable to load resource: /org/hl7/fhir/r4/model/profile/profiles-resources.xml openmrs-referenceapplication_1 | WARN - DefaultProfileValidationSupport.loadStructureDefinitions(329) |2023-03-30T05:25:48,466| Unable to load resource: /org/hl7/fhir/r4/model/profile/profiles-types.xml openmrs-referenceapplication_1 | WARN - DefaultProfileValidationSupport.loadStructureDefinitions(329) |2023-03-30T05:25:48,467| Unable to load resource: /org/hl7/fhir/r4/model/profile/profiles-others.xml openmrs-referenceapplication_1 | WARN - DefaultProfileValidationSupport.loadStructureDefinitions(329) |2023-03-30T05:25:48,468| Unable to load resource: /org/hl7/fhir/r4/model/extension/extension-definitions.xml

I have updated vitals again of the patients in the bundle observation the total numbers are changed. Earlier it was 19 now it had become 26. So that means the datas are getting updated. But still i am getting only one patient detail as output.I have attached response below for your reference,

“resourceType”: “Bundle”, “id”: “f4b65f8a-a0de-41bf-b282-89f40763aa64”, “meta”: { “lastUpdated”: “2023-03-30T06:04:30.364+00:00” }, “type”: “searchset”, “total”: 26,

Hello @dkayiwa ,

Can you please tell me why this issue is happening. And also kindly can i get the solution for unable to create Patient Relationship Details too which is mentioned in a different thread ?.

Hello @dkayiwa ,

I have shared the Server side log through Pastebin for observation issue. Please find the link below.

Hi @aravindh Have you tried to test with other servers and see if they have the same issue https://dev3.openmrs.org/openmrs/ws/fhir2/R4/Observation

Hey @abertnamanya ,

Yes, the link which you have Provided also gives me just one patient observation data with the patient named "Betty Williams ". It is not giving me a bundle data.

You are getting a FHIR Bundle (see the resourceType in the response you posted above). However, OpenMRS only gives you a page of data at a time. This is configurable (via the settings fhir2.paging_default and fhir2.paging_maximum). The default value for the size of a page of data is 10. However you can adjust that by specifying a higher value for the paging_default setting or by passing the _count parameter to ask for that number of resources (up to the paging_maximum; values higher than that are not honoured). The data is returned in whatever order the database returns it (like how select * from obs would function) and a patient might have more observations than fit in a single page (Betty Williams, for example, on dev3 has 227 observations, so 23 pages of data at 10 resources per page).

If you get a paged bundle like this, as per the FHIR specification, you will get a link element in the Bundle that has a next link pointing to the URL to get the “next page” of data.

Hey @ibacher ,

Thank you for your response and a clear explanation reg this. I will try this and let you know.

Hi @aravindh To add to what @ibacher said there are multiple parameters you could also use to have a sorted bundle https://www.hl7.org/fhir/search.html#summary