Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4 FHIR Path resolve broken #1922

Closed
madduci opened this issue Mar 4, 2025 · 1 comment
Closed

R4 FHIR Path resolve broken #1922

madduci opened this issue Mar 4, 2025 · 1 comment

Comments

@madduci
Copy link

madduci commented Mar 4, 2025

Hello

I've bumped the Core Library in HAPI FHIR to the 6.5.13 with this PR: hapifhir/hapi-fhir#6769

A test case for R4 fails, when it comes to evaluate the presence of a reference.
The test case is as follows:

org/hl7/fhir/r4/utils/FhirPathEngineR4Test.java

       @Test
	public void testCrossResourceBoundaries() throws FHIRException {
		Specimen specimen = new Specimen();
		specimen.setReceivedTimeElement(new DateTimeType("2011-01-01"));

		Observation o = new Observation();
		o.setId("O1");
		o.setStatus(Observation.ObservationStatus.FINAL);
		o.setSpecimen(new Reference(specimen));

		IParser p = ourCtx.newJsonParser();
		o = (Observation) p.parseResource(p.encodeResourceToString(o));

		List<Base> value;

		value = ourCtx.newFhirPath().evaluate(o, "Observation.specimen", Base.class);
		assertThat(value).hasSize(1);
		value = ourCtx.newFhirPath().evaluate(o, "Observation.specimen.resolve()", Base.class);
		assertThat(value).hasSize(1);

		value = ourCtx.newFhirPath().evaluate(o, "Observation.specimen.resolve().receivedTime", Base.class);
		assertThat(value).hasSize(1);
		assertEquals("2011-01-01", ((DateTimeType) value.get(0)).getValueAsString());
	}

The assertion testing that Observation.speciment.resolve() has size 1 fails.

The evaluated JSON is

{"resourceType":"Observation","id":"O1","contained":[{"resourceType":"Specimen","id":"a2567398-191d-456b-8d78-112da93728f4","receivedTime":"2011-01-01"}],"status":"final","specimen":{"reference":"#a2567398-191d-456b-8d78-112da93728f4"}}
@madduci madduci changed the title R4 Cross Resource Boundaries broken R4 FHIR Path resolve broken Mar 4, 2025
@madduci
Copy link
Author

madduci commented Mar 4, 2025

I've seen that the Parsing is whole handled in HAPI-FHIR Framework itself, i close the issue here

@madduci madduci closed this as completed Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant