Project: Implement Spring Data to LibreHealth Toolkit

@yashdsaraf I’m getting following error in your latest master and merged code with my branch when viewing the patients. Do you have any idea?

There was an unexpected error (type=Internal Server Error, status=500).

JSON encoding error: org.hl7.fhir.dstu3.model.Encounter$EncounterStatus cannot be cast to org.hl7.fhir.dstu3.model.Enumerations$AdministrativeGender; nested exception is com.fasterxml.jackson.databind.JsonMappingException: org.hl7.fhir.dstu3.model.Encounter$EncounterStatus cannot be cast to org.hl7.fhir.dstu3.model.Enumerations$AdministrativeGender (through reference chain: java.util.ArrayList[0]->org.openmrs.model.CPatient[“gender”])

1 Like

The enumeration converter factory is the culprit here. It handles all the Enumeration<?> type data. I faced this issue as well when the data type couldn’t be determined properly and it tried to cast the data to the wrong type.
Here’s the code for enumeration converter factory - link.
I’ll try to fix the error, any inputs on this are welcome. :slight_smile:

1 Like

@yashdsaraf Yes, I wonder why it trying to cast for Encounter type object. I also digging to this problem.