I added the latest FHIR2 module which is having the functionalities to create & update the encounters in the openmrs. I’ve a proper r4 Encounter bundle which I want to save in my openmrs table by using this module.
What is the URL to the API call which will accept and save this r4 Encounter bundle to the openmrs ?
I used the fhir POST encounter call to save encounter. It initially thrown me errors. I resolved some of them but still it is not able to save encounter. I also tried to use the test encounter JSON available at github but it still didn’t work for me.
I’m getting 422 & 500 error codes with the following response
@chughrahul you can fetch some encounters with GET http://localhost:"server-port"/openmrs/ws/fhir2/R4/Encounter and then get a glimpse of what kind of payload to POST
So note that creating an encounter through the FHIR2 API requires you to have the necessary data already setup in your OpenMRS instance, so, for instance, the Visit that this encounter is partOf needs to already exist, the patient the encounter is for needs to exist, the patient needs to exist, the practitioner referenced needs to exist and be a valid OMRS provider, the location of the encounter needs to exist in your instance, as does the encounterType. That’s probably the issue with the first request. (So, in the context where we actually use that sample request for a test, we have the data shown here loaded into the database).
I can’t see why this has anything to do with the Lucene folder at all. The error you’re reporting there happens when there are two modules (e.g., the FHIR2 module and some other module) that both bundle hapi-fhir-base (either explicitly or implicitly) and where neither of the modules are aware of the other, causing OpenMRS to load two different versions of the same class in two different module class loaders.
The best long-term solution is if you can find whatever other module bundles hapi-fhir and change it so it instead depends on the FHIR2 module.
It’s not a matter of changing the dependency version. The thing to do would be to just make your module depend on the FHIR2 module, then you get those dependencies for free.
So in your POM.xml, you want something like this:
<!-- elsewhere -->
<properties>
<fhir2Version>1.2.1</fhir2Version>
</properties>
<!-- with your other dependencies -->
<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>fhir2-api</artifactId>
<version>${fhir2Version}</version>
<scope>provided</scope>
</dependency>
And then in omod/src/main/resources/config.xml you need a line that looks like this:
I’ve looked into the available resources in the FHIR R4 structure. We’ve diagnosticReport, Prescription OPConsultation & dischargeSummary resource to save.
I’m facing issues in saving the dischargeSummary through R4 call as it contains a documentReference and I’m confused in saving this with the help of FHIR module. Can you please guide me on this ?
Sample dischargeSummary documentReference bundle -
@chughrahul currently we dont yet have the implementation of the Document reference resource in the fhir2 module, though we do cater for the diagnosticReport resource
I’m working on to posting some observations from the FHIR2 module using POST R4/Observation call. However, the observation that I’m getting from the external resource has a concept which is not available in openmrs database. Is FHIR2 able to make new concept in this case ?