Stream: implementers
Topic: FHIR ERROR
Dung Tran (Feb 15 2019 at 02:52):
Hello,
I am a newbie to FHIR. I have a question related to one of the FHIR error that I wish to get your help. I got an error saying that ca.uhn.fhir.context.ConfigurationException: Resource class[org.hl7.fhir.utilities.xhtml.XhtmlNode] does not contain any valid HAPI-FHIR.
I try to figure out what the error meant so if you could help, I would be very appreciated.
The error is happened at this line of code
Patient myPatient = (Patient)client.read().resource(Patient.class).withId(id).execute();
Thanks!
Lloyd McKenzie (Feb 15 2019 at 03:05):
It sounds like what's coming back from the server isn't valid FHIR - probably not in the FHIR namespace. Are you testing against one of the official test servers or something else (that might not be right)?
Dung Tran (Feb 15 2019 at 04:10):
I am testing against this server String serverBase ="http://hapi.fhir.org/baseDstu3";
and I am passing patientID String patientID = "1326789";
I hope to get back patient information
Lloyd McKenzie (Feb 15 2019 at 07:21):
@James Agnew ?
Craig McClendon (Feb 15 2019 at 17:31):
The following code works for me:
FhirContext fhirCtx = FhirContext.forDstu3(); IGenericClient client = fhirCtx.newRestfulGenericClient("http://hapi.fhir.org/baseDstu3"); Patient myPatient = client.read().resource(Patient.class).withId("1326789").execute(); System.out.println("Family name: " + myPatient.getNameFirstRep().getFamily());
Last updated: Apr 12 2022 at 19:14 UTC