FHIR R4 Patient Deserialization

1,767 views
Skip to first unread message

vgvi...@gmail.com

unread,
Feb 25, 2019, 11:41:47 AM2/25/19
to HAPI FHIR

I am using 3.7.0 verison of R4 Patient object and I am getting error while deserialization :
Caused by: java.lang.IllegalArgumentException: Conflicting setter definitions for property "referenceElement": org.hl7.fhir.r4.model.Reference#setReferenceElement(1 params) vs org.hl7.fhir.r4.model.Reference#setReferenceElement(1 params)
at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.getSetter(POJOPropertyBuilder.java:497)
at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.getPrimaryType(POJOPropertyBuilder.java:338)
at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.getRawPrimaryType(POJOPropertyBuilder.java:358)

  10:09 PM

<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>3.7.0</version>
</dependency>

  10:10 PM

There are two setters in Reference.java which is causing the problem
sample json :
https://www.hl7.org/fhir/patient-example-f001-pieter.json.html

  10:10 PM

Please revert back with correct approach .Its kind of urgent!

James Agnew

unread,
Feb 25, 2019, 11:45:57 AM2/25/19
to vgvi...@gmail.com, HAPI FHIR
You should not be using Jackson to serialize HAPI FHIR objects. Please see the following link for examples of how to use the HAPI FHIR parser: http://hapifhir.io/doc_intro.html

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/ad231b27-bb2e-4d47-91c1-f27826cc90ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vgvi...@gmail.com

unread,
Feb 25, 2019, 12:11:51 PM2/25/19
to HAPI FHIR
Thanks ...
I used the context json parser.

Getting error message  : "Error in serializing objectorg.hl7.fhir.r4.model.Patient@3beec3c7"
How to debug what caused the isse?

vgvi...@gmail.com

unread,
Feb 25, 2019, 12:22:32 PM2/25/19
to HAPI FHIR

Deserialization is working fine :)

How to serialize the same Patient Object to byte[]?

James Agnew

unread,
Feb 25, 2019, 1:03:36 PM2/25/19
to vgvi...@gmail.com, HAPI FHIR
Hi,

Please provide a relevant code snippet that illustrates your issue. This wiki page has some helpful information on how to ask effective questions in this group.

Cheers,
James

Reply all
Reply to author
Forward
0 new messages