Search in sources :

Example 76 with Identifier

use of org.hl7.fhir.r4b.model.Identifier in project quality-measure-and-cohort-service by Alvearie.

the class R4LibraryDependencyGathererTest method library_with_no_valid_data___returns_nothing.

@Test
public void library_with_no_valid_data___returns_nothing() {
    String libraryId = "lib";
    Library lib = new Library();
    withIdentifiers(lib, libraryId, null, null);
    MapFhirResourceResolver<Library, Identifier> resourceResolver = getMapFhirResourceResolver();
    resourceResolver.addResource(lib);
    R4LibraryDependencyGatherer dependencyGatherer = new R4LibraryDependencyGatherer(resourceResolver);
    List<Library> libraries = dependencyGatherer.gatherForLibraryId(libraryId);
    Assert.assertTrue(libraries.isEmpty());
}
Also used : Identifier(org.hl7.fhir.r4.model.Identifier) Library(org.hl7.fhir.r4.model.Library) Test(org.junit.Test)

Example 77 with Identifier

use of org.hl7.fhir.r4b.model.Identifier in project quality-measure-and-cohort-service by Alvearie.

the class R4TranslatingLibraryLoaderTest method load_validCql.

@Test
public void load_validCql() throws IOException {
    Library library = new Library();
    withIdentifiers(library, NAME, VERSION);
    withContent(library, "/cql/basic/Test-1.0.0.cql", "text/cql");
    R4TranslatingLibraryLoader loader = getLoader(getLibraryResolver(NAME, VERSION, library));
    VersionedIdentifier identifier = new VersionedIdentifier().withId(NAME).withVersion(VERSION);
    org.cqframework.cql.elm.execution.Library actual = loader.load(identifier);
    Assert.assertEquals(identifier, actual.getIdentifier());
    Assert.assertEquals(4, actual.getStatements().getDef().size());
}
Also used : VersionedIdentifier(org.cqframework.cql.elm.execution.VersionedIdentifier) Library(org.hl7.fhir.r4.model.Library) Test(org.junit.Test)

Example 78 with Identifier

use of org.hl7.fhir.r4b.model.Identifier in project quality-measure-and-cohort-service by Alvearie.

the class R4LibraryResourceFieldHandlerTest method getIdentifiers.

@Test
public void getIdentifiers() {
    Identifier identifier = new Identifier().setSystem("system").setValue("value");
    Library library = new Library();
    library.addIdentifier(identifier);
    List<Identifier> libraryIdentifiers = libraryFieldHandler.getIdentifiers(library);
    Assert.assertEquals(1, libraryIdentifiers.size());
    Assert.assertTrue(identifier.equalsDeep(libraryIdentifiers.get(0)));
}
Also used : Identifier(org.hl7.fhir.r4.model.Identifier) Library(org.hl7.fhir.r4.model.Library) Test(org.junit.Test)

Example 79 with Identifier

use of org.hl7.fhir.r4b.model.Identifier in project quality-measure-and-cohort-service by Alvearie.

the class R4MeasureResourceFieldHandlerTest method getIdentifierValue.

@Test
public void getIdentifierValue() {
    String identifierValue = "value";
    Identifier identifier = new Identifier().setValue(identifierValue);
    Assert.assertEquals(identifierValue, measureFieldHandler.getIdentifierValue(identifier));
}
Also used : Identifier(org.hl7.fhir.r4.model.Identifier) Test(org.junit.Test)

Example 80 with Identifier

use of org.hl7.fhir.r4b.model.Identifier in project quality-measure-and-cohort-service by Alvearie.

the class R4MeasureResourceFieldHandlerTest method getIdentifiers.

@Test
public void getIdentifiers() {
    Identifier identifier = new Identifier().setSystem("system").setValue("value");
    Measure measure = new Measure();
    measure.addIdentifier(identifier);
    List<Identifier> measureIdentifiers = measureFieldHandler.getIdentifiers(measure);
    Assert.assertEquals(1, measureIdentifiers.size());
    Assert.assertTrue(identifier.equalsDeep(measureIdentifiers.get(0)));
}
Also used : Identifier(org.hl7.fhir.r4.model.Identifier) Measure(org.hl7.fhir.r4.model.Measure) Test(org.junit.Test)

Aggregations

Identifier (org.hl7.fhir.r4.model.Identifier)212 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)143 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)125 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)116 Test (org.junit.Test)90 Test (org.junit.jupiter.api.Test)84 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)66 ArrayList (java.util.ArrayList)62 Reference (org.hl7.fhir.r4.model.Reference)57 Identifier (org.hl7.fhir.dstu3.model.Identifier)55 Patient (org.hl7.fhir.r4.model.Patient)55 Coding (org.hl7.fhir.r4.model.Coding)49 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)41 Practitioner (org.hl7.fhir.r4.model.Practitioner)41 Date (java.util.Date)40 List (java.util.List)40 Resource (org.hl7.fhir.r4.model.Resource)37 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)36 InvalidRequestException (ca.uhn.fhir.rest.server.exceptions.InvalidRequestException)34 Collectors (java.util.stream.Collectors)31