Unable to add/deploy FHIR2 module to OpenMRS platform

I’m working on a ticket for FHIR2 module, I’ve deployed the module in the openmrs-sdk server that I’ve set up. However, on running the server and navigating to http://localhost/openmrs/ws/fhir2/Observation results in a 404 Not found error.

The addon manager does not list the fhir2-1.0.0-SNAPSHOT module. On explicitly adding the omod file from the addon manager, the following error log is obtained.

I have the following modules under the webservices-dev/modules directory,

  • fhir2-1.0.0-SNAPSHOT.omod
  • owa-1.11.0.omod
  • webservices.rest-2.28.0-SNAPSHOT.omod

P.S: I deleted the fhir-1.2 module that was already present and which was working as expected.

What version of the platform are you using?

@captaindavinci I just created a PR to fix this here This is issue is caused because the module is trying to fetch records from an openmrs table concept_reference_source so as to insert to a module table, however the the table is empty hence the pre conditions failure.

Once the PR is merged you should be able to load the module without any more errors.

Something else to note is currently the endpoint you’re trying to hit is not currently supported, use this instead http://localhost/openmrs/ws/fhir2/Observation/{uuid}

1 Like

@ibacher I’m using the 2.3.1-SNAPSHOT version of the platform.

@jecihjoy thanks for the update!

In that case, I think the docs will have to be updated to reflect the same.

That URL is expected to work, though I’d note that on a base system, it should return an empty Bundle.

1 Like

@ibacher in-order to test the API do I download the demo data and then load that into the server database?

That would certainly be one way of doing things, assuming the demo data set has some actual observations. I know it has people in it, so you might start with that resource.

I downloaded one of the data sets from here openmrs-2.0.1 (platform) but after login it showed few database updates that have to be made.

P.S: I checked for data under obs table, the count showed quite a few rows in it.

1 Like

If you are running the reference application, you could also use the referencedemodata.createDemoPatientsOnNextStartup setting to have the number of demo patients that you want on next startup, which will have some observations.

2 Likes

I’m running the platform application, but couldn’t find demo data for the version that I’m currently running (2.3.1-SNAPSHOT). I’ll try with the reference application instead, but is there any updated demo data for platform 2.3.1?

You can generate it and upload it on the demo data wiki page. This is how to generate it. Install a platform version matching the latest available demo data. Load that demo data file into the platform. Then upgrade the platform to the one that you want to create demo data for. Finally dump a new sql file for the current database, which you can zip and upload.

Not sure if I should start a new talk post, but I’m facing this issue again.

This time with following error message shown in the web page when uploading the FHIR2 module. error message, server side logs.

I’m using the openmrs-sdk to setup a reference application, version 2.9.0, and using the current master branch of FHIR2 module to generate the omod file.

Code to the SDK server (~/openmrs/<name of server>/modules) and delete the fhir-1.18.0.OMOD file.

1 Like