Search in sources :

Example 51 with org.hl7.fhir.r5.model

use of org.hl7.fhir.r5.model in project cqf-ruler by DBCG.

the class DetectedIssueBuilder method initializeR4.

@Override
protected void initializeR4(T theResource) {
    super.initializeR4(theResource);
    org.hl7.fhir.r4.model.DetectedIssue detectedIssue = (org.hl7.fhir.r4.model.DetectedIssue) theResource;
    List<org.hl7.fhir.r4.model.Identifier> identifier = new ArrayList<>();
    identifier.add(new org.hl7.fhir.r4.model.Identifier().setSystem(getIdentifier().getKey()).setValue(getIdentifier().getValue()));
    detectedIssue.setIdentifier(identifier).setPatient(new org.hl7.fhir.r4.model.Reference(myPatient)).setStatus(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.valueOf(myStatus)).setCode(new CodeableConcept().addCoding(new Coding().setSystem(getCodeSetting().getSystem()).setCode(getCodeSetting().getCode()).setDisplay(getCodeSetting().getDisplay())));
    getEvidenceDetails().forEach(evidence -> detectedIssue.addEvidence(new DetectedIssueEvidenceComponent().addDetail(new org.hl7.fhir.r4.model.Reference(evidence))));
}
Also used : ArrayList(java.util.ArrayList) Identifier(org.hl7.fhir.dstu2016may.model.Identifier) Coding(org.hl7.fhir.r4.model.Coding) DetectedIssueEvidenceComponent(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 52 with org.hl7.fhir.r5.model

use of org.hl7.fhir.r5.model 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 53 with org.hl7.fhir.r5.model

use of org.hl7.fhir.r5.model 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 54 with org.hl7.fhir.r5.model

use of org.hl7.fhir.r5.model 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 55 with org.hl7.fhir.r5.model

use of org.hl7.fhir.r5.model 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)

Aggregations

Test (org.junit.jupiter.api.Test)435 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)334 Test (org.junit.Test)289 ArrayList (java.util.ArrayList)112 FHIRException (org.hl7.fhir.exceptions.FHIRException)111 IOException (java.io.IOException)84 List (java.util.List)73 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)70 Date (java.util.Date)68 FileOutputStream (java.io.FileOutputStream)66 File (java.io.File)61 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)61 CodeableReference (org.hl7.fhir.r5.model.CodeableReference)58 InputStream (java.io.InputStream)55 TableModel (org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel)51 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)50 Bundle (org.hl7.fhir.dstu3.model.Bundle)49 IBundleProvider (ca.uhn.fhir.rest.api.server.IBundleProvider)48 Collectors (java.util.stream.Collectors)48 Arrays (java.util.Arrays)46