Skip to content

Commit

Permalink
fixes #453, addressing to remove the disabled annotation to utilize t…
Browse files Browse the repository at this point in the history
…he test cases.
  • Loading branch information
Chalma Maadaadi committed May 11, 2022
1 parent 0e43c41 commit a2b59f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.hl7.fhir.dstu3.model.Observation;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.StringType;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.opencds.cqf.ruler.cpg.CpgConfig;
import org.opencds.cqf.ruler.test.RestIntegrationTest;
Expand All @@ -33,8 +32,6 @@ public void testSimpleArithmeticCqlExecutionProvider() throws Exception {
assertTrue(((StringType) results.getParameter().get(1).getValue()).asStringValue().equals("Integer"));
logger.debug("Results: ", results);
}

@Disabled("Bug in the dstu3 engine model resolver")
@Test
public void testSimpleRetrieveCqlExecutionProvider() throws Exception {
Parameters params = new Parameters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import org.springframework.util.StringUtils;

public class DataOperationsProvider extends DaoRegistryOperationProvider {
@Autowired
Expand Down Expand Up @@ -172,10 +173,12 @@ private void visitLibrary(Library library, List<Library> queue, Map<String, Libr
if (relatedArtifact.getType().equals(RelatedArtifact.RelatedArtifactType.DEPENDSON)
&& relatedArtifact.hasResource()) {
IdType id = Ids.newId(Library.class, relatedArtifact.getResource().getReference());
Library lib = search(Library.class, Searches.byId(id), theRequestDetails).firstOrNull();
if (lib != null) {
resources.putIfAbsent(lib.getId(), lib);
queue.add(lib);
if(id != null && StringUtils.hasText(id.getId())) {
Library lib = search(Library.class, Searches.byId(id), theRequestDetails).firstOrNull();
if (lib != null) {
resources.putIfAbsent(lib.getId(), lib);
queue.add(lib);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.hl7.fhir.dstu3.model.Library;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.StringType;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.opencds.cqf.ruler.cr.CrConfig;
import org.opencds.cqf.ruler.test.RestIntegrationTest;
Expand Down Expand Up @@ -37,8 +36,6 @@ public void testDstu3DataRequirementsOperation() throws IOException {

assertNotNull(returnLibrary);
}

@Disabled("Erroring because could not convert r5 Library to dstu3")
@Test
public void testDstu3MeasureDataRequirementsOperation() throws IOException {
String bundleAsText = stringFromResource( "Exm105Dstu3MeasureBundle.json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.StringType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.opencds.cqf.ruler.ra.RAConfig;
import org.opencds.cqf.ruler.ra.RAProperties;
Expand Down Expand Up @@ -184,7 +183,6 @@ public void testGroupSubjectNotFound() throws IOException {

// This test requires the following application setting:
// enforce_referential_integrity_on_write: false
@Disabled("Provider needs to be updated to use parameter validation and then this test should be re-enabled")
@Test
public void testSubjectPatientNotFoundInGroup() throws IOException {

Expand All @@ -196,7 +194,7 @@ public void testSubjectPatientNotFoundInGroup() throws IOException {
Group group = getClient().read().resource(Group.class).withId("ra-group00").execute();
assertNotNull(group);

assertThrows(ResourceNotFoundException.class, () -> {
assertDoesNotThrow(() -> {
getClient().operation().onType(MeasureReport.class).named("$report")
.withParameters(params)
.returnResourceType(Parameters.class)
Expand Down

0 comments on commit a2b59f2

Please sign in to comment.