Search in sources :

Example 36 with org.hl7.fhir.r5.utils.validation.constants

use of org.hl7.fhir.r5.utils.validation.constants in project cqf-ruler by DBCG.

the class DetectedIssueBuilder method initializeDstu2_1.

@Override
protected void initializeDstu2_1(T theResource) {
    super.initializeDstu2_1(theResource);
    org.hl7.fhir.dstu2016may.model.DetectedIssue detectedIssue = (org.hl7.fhir.dstu2016may.model.DetectedIssue) theResource;
    detectedIssue.setIdentifier(new Identifier().setSystem(getIdentifier().getKey()).setValue(getIdentifier().getValue())).setPatient(new Reference(myPatient));
    getEvidenceDetails().forEach(detectedIssue::setReference);
}
Also used : Identifier(org.hl7.fhir.dstu2016may.model.Identifier) Reference(org.hl7.fhir.dstu2016may.model.Reference)

Example 37 with org.hl7.fhir.r5.utils.validation.constants

use of org.hl7.fhir.r5.utils.validation.constants in project cqf-ruler by DBCG.

the class IdsTest method testContextSupported.

@Test
public void testContextSupported() {
    IIdType id = Ids.newId(FhirContext.forDstu3Cached(), "Patient/123");
    assertTrue(id instanceof org.hl7.fhir.dstu3.model.IdType);
}
Also used : IIdType(org.hl7.fhir.instance.model.api.IIdType) Test(org.junit.jupiter.api.Test)

Example 38 with org.hl7.fhir.r5.utils.validation.constants

use of org.hl7.fhir.r5.utils.validation.constants in project cqf-ruler by DBCG.

the class IdsTest method testPartsSupported.

@Test
public void testPartsSupported() {
    IIdType id = Ids.newId(FhirVersionEnum.DSTU3, "Patient", "123");
    assertTrue(id instanceof org.hl7.fhir.dstu3.model.IdType);
    assertEquals("Patient", id.getResourceType());
    assertEquals("123", id.getIdPart());
}
Also used : IIdType(org.hl7.fhir.instance.model.api.IIdType) Test(org.junit.jupiter.api.Test)

Example 39 with org.hl7.fhir.r5.utils.validation.constants

use of org.hl7.fhir.r5.utils.validation.constants in project cqf-ruler by DBCG.

the class IdsTest method testClassSupported.

@Test
public void testClassSupported() {
    IIdType id = Ids.newId(org.hl7.fhir.dstu3.model.Library.class, "123");
    assertTrue(id instanceof org.hl7.fhir.dstu3.model.IdType);
    assertEquals("Library", id.getResourceType());
    assertEquals("123", id.getIdPart());
}
Also used : IIdType(org.hl7.fhir.instance.model.api.IIdType) Test(org.junit.jupiter.api.Test)

Example 40 with org.hl7.fhir.r5.utils.validation.constants

use of org.hl7.fhir.r5.utils.validation.constants in project cqf-ruler by DBCG.

the class DataRequirements method getModuleDefinitionLibraryDstu3.

public static org.hl7.fhir.dstu3.model.Library getModuleDefinitionLibraryDstu3(LibraryManager libraryManager, TranslatedLibrary translatedLibrary, CqlTranslatorOptions options) {
    org.hl7.fhir.r5.model.Library libraryR5 = getModuleDefinitionLibraryR5(libraryManager, translatedLibrary, options);
    BaseAdvisor_30_50 baseAdvisor_30_50 = new BaseAdvisor_30_50();
    VersionConvertor_30_50 versionConvertor_30_50 = new VersionConvertor_30_50(baseAdvisor_30_50);
    org.hl7.fhir.dstu3.model.Library libraryDstu3 = null;
    libraryDstu3 = (org.hl7.fhir.dstu3.model.Library) versionConvertor_30_50.convertResource(libraryR5);
    // There is no DSTU3 extension to support FHIRQueryPattern representation on a DataRequirement
    return libraryDstu3;
}
Also used : BaseAdvisor_30_50(org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_50) VersionConvertor_30_50(org.hl7.fhir.convertors.conv30_50.VersionConvertor_30_50)

Aggregations

Test (org.junit.jupiter.api.Test)427 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)334 Test (org.junit.Test)241 FHIRException (org.hl7.fhir.exceptions.FHIRException)104 ArrayList (java.util.ArrayList)101 IOException (java.io.IOException)78 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)70 Date (java.util.Date)65 List (java.util.List)64 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)61 FileOutputStream (java.io.FileOutputStream)59 CodeableReference (org.hl7.fhir.r5.model.CodeableReference)58 File (java.io.File)57 InputStream (java.io.InputStream)51 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)50 IBundleProvider (ca.uhn.fhir.rest.api.server.IBundleProvider)48 Bundle (org.hl7.fhir.dstu3.model.Bundle)48 MethodSource (org.junit.jupiter.params.provider.MethodSource)46 Arrays (java.util.Arrays)45 Collectors (java.util.stream.Collectors)45