FHIR Chat · org.hl7.fhir to HAPI 1.6 · hapi

Stream: hapi

Topic: org.hl7.fhir to HAPI 1.6


view this post on Zulip Kevin Mayfield (Jul 11 2016 at 11:28):

I've just started moving over to HAPI 1.6 which has gone great. I have numerous business processes that used org.hl7.fhir classes.

view this post on Zulip Kevin Mayfield (Jul 11 2016 at 11:30):

What classes should I look to move these over to?

e.g. have code such as

                JsonParser parser = new JsonParser();
                try
                {
                    bundle = (Bundle) parser.parse(ContentBytes);
                }

view this post on Zulip Kevin Mayfield (Jul 11 2016 at 11:33):

Which use

import org.hl7.fhir.instance.formats.JsonParser;
import org.hl7.fhir.instance.formats.ParserType;
import org.hl7.fhir.instance.model.Bundle;

Do these move to new org.hl7.fhir classes or should I look to use the HAPI way of parsing data coming in? I originally used HAPI classes but the org,hl7.fhir classes seemed better suited to manipulating resources before sending them onto a HAPI server. Thanks.

view this post on Zulip Kevin Mayfield (Jul 11 2016 at 13:25):

Think I've resolved it.

                                   //JsonParser parser = new JsonParser();
                IParser parser = ctx.newJsonParser();

                try
                {
                    bundle = parser.parseBundle(reader);
                }

view this post on Zulip Kevin Mayfield (Jul 11 2016 at 13:25):

With classes moving to

view this post on Zulip Kevin Mayfield (Jul 11 2016 at 13:26):

With classes moving to

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.parser.IParser;

The Resource classes moving from import

org.hl7.fhir.instance.model.Appointment;

to

org.hl7.fhir.dstu3.model.Appointment;

view this post on Zulip James Agnew (Jul 11 2016 at 13:29):

yup, that should do it... although parsing would look like

bundle = parser.parseResource(Bundle.class, reader);

view this post on Zulip Kevin Mayfield (Jul 11 2016 at 14:26):

Thanks. Have been using that for resources.


Last updated: Apr 12 2022 at 19:14 UTC