Skip to content
This repository was archived by the owner on Dec 21, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ public Object getContextPath(String contextType, String targetType) {
return "subject";
}

if (contextType.equals("Patient") && targetType.equals("Task")) {
return "for";
}

return super.getContextPath(contextType, targetType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ public Object getContextPath(String contextType, String targetType) {
return "subject";
}

if (contextType.equals("Patient") && targetType.equals("Task")) {
return "for";
}

return super.getContextPath(contextType, targetType);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.opencds.cqf.cql.engine.fhir.model;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
Expand Down Expand Up @@ -218,7 +219,7 @@ public void contextPathTests() {

String path = (String) resolver.getContextPath("Patient", "Patient");
assertNotNull(path);
assertTrue(path.equals("id"));
assertEquals(path, "id");

path = (String) resolver.getContextPath(null, "Encounter");
assertNull(path);
Expand All @@ -230,22 +231,25 @@ public void contextPathTests() {

path = (String) resolver.getContextPath("Patient", "Condition");
assertNotNull(path);
assertTrue(path.equals("subject"));
assertEquals(path, "subject");

path = (String) resolver.getContextPath("Patient", "Appointment");
assertNotNull(path);
assertTrue(path.equals("participant.actor"));
assertEquals(path, "participant.actor");

path = (String) resolver.getContextPath("Patient", "Account");
assertNotNull(path);
assertTrue(path.equals("subject"));
assertEquals(path, "subject");

path = (String) resolver.getContextPath("Patient", "Encounter");
assertNotNull(path);
assertTrue(path.equals("subject"));
assertEquals(path, "subject");

path = (String) resolver.getContextPath("Patient", "MedicationStatement");
assertTrue(path.equals("subject"));
assertEquals(path, "subject");

path = (String) resolver.getContextPath("Patient", "Task");
assertEquals(path, "for");

// Issue 527 - https://github.com/DBCG/cql_engine/issues/527
path = (String) resolver.getContextPath("Unfiltered", "MedicationStatement");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
Expand Down Expand Up @@ -291,7 +292,7 @@ public void createInstanceTests() {

@Test
public void contextPathTests() {
ModelResolver resolver = new Dstu3FhirModelResolver(FhirContext.forCached(FhirVersionEnum.DSTU3));
ModelResolver resolver = new R4FhirModelResolver(FhirContext.forCached(FhirVersionEnum.R4));

String path = (String)resolver.getContextPath("Patient", "Patient");
assertNotNull(path);
Expand All @@ -307,25 +308,28 @@ public void contextPathTests() {

path = (String)resolver.getContextPath("Patient", "Condition");
assertNotNull(path);
assertTrue(path.equals("subject"));
assertEquals(path, "subject");

path = (String)resolver.getContextPath("Patient", "Appointment");
assertNotNull(path);
assertTrue(path.equals("participant.actor"));
assertEquals(path, "participant.actor");

path = (String)resolver.getContextPath("Patient", "Account");
assertNotNull(path);
assertTrue(path.equals("subject"));
assertEquals(path, "subject");

path = (String)resolver.getContextPath("Patient", "Encounter");
assertNotNull(path);
assertTrue(path.equals("subject"));
assertEquals(path, "subject");

path = (String)resolver.getContextPath("Patient", "ValueSet");
assertNull(path);

path = (String)resolver.getContextPath("Patient", "MedicationStatement");
assertTrue(path.equals("subject"));
assertEquals(path, "subject");

path = (String)resolver.getContextPath("Patient", "Task");
assertEquals(path, "for");

// Issue 527 - https://github.com/DBCG/cql_engine/issues/527
path = (String)resolver.getContextPath("Unfiltered", "MedicationStatement");
Expand Down
14 changes: 14 additions & 0 deletions engine.jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@
<artifactId>elm-jackson</artifactId>
<scope>test</scope>
</dependency>

<!-- dependencies required for Android -->
<!-- required to add due to the special QName Processor -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.2</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -125,6 +135,10 @@
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down