Search in sources :

Example 46 with StringType

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

the class Patients method john_doe.

public static Patient john_doe() {
    Patient patient = new Patient();
    patient.setId("john-doe");
    patient.setName(Arrays.asList(new HumanName().setFamily("Doe").setGiven(Arrays.asList(new StringType("John")))));
    patient.setBirthDate(new Date());
    patient.setGender(AdministrativeGender.MALE);
    Extension usCoreRace = new Extension();
    usCoreRace.setUrl(EXT_URL_US_CORE_RACE).addExtension().setUrl(OMB_CATEGORY).setValue(new Coding().setSystem(URL_SYSTEM_RACE).setCode(OMB_CATEGORY_RACE_BLACK).setDisplay(BLACK_OR_AFRICAN_AMERICAN));
    patient.getExtension().add(usCoreRace);
    return patient;
}
Also used : Extension(org.hl7.fhir.r4.model.Extension) HumanName(org.hl7.fhir.r4.model.HumanName) StringType(org.hl7.fhir.r4.model.StringType) Coding(org.hl7.fhir.r4.model.Coding) Patient(org.hl7.fhir.r4.model.Patient) Date(java.util.Date)

Example 47 with StringType

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

the class CareGapsProviderIT method testPractitionerAndOrganization.

@Test
public void testPractitionerAndOrganization() throws Exception {
    Parameters params = new Parameters();
    params.addParameter().setName("periodStart").setValue(new StringType(periodStartValid));
    params.addParameter().setName("periodEnd").setValue(new StringType(periodEndValid));
    params.addParameter().setName("status").setValue(new StringType(statusValid));
    params.addParameter().setName("measureId").setValue(new StringType(measureIdValid));
    params.addParameter().setName("organization").setValue(new StringType(organizationValid));
    params.addParameter().setName("practitioner").setValue(new StringType(practitionerValid));
    assertThrows(InternalErrorException.class, () -> {
        getClient().operation().onType(Measure.class).named("$care-gaps").withParameters(params).useHttpGet().returnResourceType(Parameters.class).execute();
    });
// TODO: implement practitioner and organization
// assertDoesNotThrow(() -> {
// getClient().operation().onType(Measure.class).named("$care-gaps")
// .withParameters(params)
// .useHttpGet()
// .returnResourceType(Parameters.class)
// .execute();
// });
}
Also used : Parameters(org.hl7.fhir.r4.model.Parameters) StringType(org.hl7.fhir.r4.model.StringType) Measure(org.hl7.fhir.r4.model.Measure) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) RestIntegrationTest(org.opencds.cqf.ruler.test.RestIntegrationTest)

Example 48 with StringType

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

the class Patients method john_doe.

public static Patient john_doe() {
    Patient patient = new Patient();
    patient.setId("john-doe");
    patient.setName(Arrays.asList(new HumanName().setFamily("Doe").setGiven(Arrays.asList(new StringType("John")))));
    patient.setBirthDate(new Date());
    patient.setGender(AdministrativeGender.MALE);
    Extension usCoreRace = new Extension();
    usCoreRace.setUrl(EXT_URL_US_CORE_RACE).addExtension().setUrl(OMB_CATEGORY).setValue(new Coding().setSystem(URL_SYSTEM_RACE).setCode(OMB_CATEGORY_RACE_BLACK).setDisplay(BLACK_OR_AFRICAN_AMERICAN));
    patient.getExtension().add(usCoreRace);
    return patient;
}
Also used : Extension(org.hl7.fhir.dstu3.model.Extension) HumanName(org.hl7.fhir.dstu3.model.HumanName) StringType(org.hl7.fhir.dstu3.model.StringType) Coding(org.hl7.fhir.dstu3.model.Coding) Patient(org.hl7.fhir.dstu3.model.Patient) Date(java.util.Date)

Example 49 with StringType

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

the class DataOperationProviderIT method testDstu3MeasureDataRequirementsOperation.

@Disabled("Erroring because could not convert r5 Library to dstu3")
@Test
public void testDstu3MeasureDataRequirementsOperation() throws IOException {
    String bundleAsText = stringFromResource("Exm105Dstu3MeasureBundle.json");
    Bundle bundle = (Bundle) getFhirContext().newJsonParser().parseResource(bundleAsText);
    getClient().transaction().withBundle(bundle).execute();
    Parameters params = new Parameters();
    params.addParameter().setName("startPeriod").setValue(new StringType("2019-01-01"));
    params.addParameter().setName("endPeriod").setValue(new StringType("2020-01-01"));
    Library returnLibrary = getClient().operation().onInstance(new IdType("Measure", "measure-EXM105-FHIR3-8.0.000")).named("$data-requirements").withParameters(params).returnResourceType(Library.class).execute();
    assertNotNull(returnLibrary);
}
Also used : Parameters(org.hl7.fhir.dstu3.model.Parameters) StringType(org.hl7.fhir.dstu3.model.StringType) Bundle(org.hl7.fhir.dstu3.model.Bundle) Library(org.hl7.fhir.dstu3.model.Library) IdType(org.hl7.fhir.dstu3.model.IdType) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) RestIntegrationTest(org.opencds.cqf.ruler.test.RestIntegrationTest) Disabled(org.junit.jupiter.api.Disabled)

Example 50 with StringType

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

the class ActivityDefinitionApplyProvider method resolveCommunicationRequest.

// TODO - extend this to be more complete
private CommunicationRequest resolveCommunicationRequest(ActivityDefinition activityDefinition, String patientId) {
    CommunicationRequest communicationRequest = new CommunicationRequest();
    communicationRequest.setStatus(CommunicationRequest.CommunicationRequestStatus.UNKNOWN);
    communicationRequest.setSubject(new Reference(patientId));
    // Unsure if this is correct - this is the way Motive is doing it...
    if (activityDefinition.hasCode()) {
        if (activityDefinition.getCode().hasText()) {
            communicationRequest.addPayload().setContent(new StringType(activityDefinition.getCode().getText()));
        }
    }
    return communicationRequest;
}
Also used : StringType(org.hl7.fhir.dstu3.model.StringType) Reference(org.hl7.fhir.dstu3.model.Reference) CommunicationRequest(org.hl7.fhir.dstu3.model.CommunicationRequest)

Aggregations

StringType (org.hl7.fhir.r4.model.StringType)158 ArrayList (java.util.ArrayList)77 Test (org.junit.jupiter.api.Test)77 StringType (org.hl7.fhir.dstu3.model.StringType)65 Parameters (org.hl7.fhir.r4.model.Parameters)62 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)62 StringType (org.hl7.fhir.r5.model.StringType)61 RestIntegrationTest (org.opencds.cqf.ruler.test.RestIntegrationTest)58 StringType (org.hl7.fhir.r4b.model.StringType)45 FHIRException (org.hl7.fhir.exceptions.FHIRException)43 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)42 HashMap (java.util.HashMap)28 StringType (org.hl7.fhir.dstu2.model.StringType)27 StringType (org.hl7.fhir.dstu2016may.model.StringType)26 Coding (org.hl7.fhir.r4.model.Coding)26 Extension (org.hl7.fhir.r4.model.Extension)25 Measure (org.hl7.fhir.r4.model.Measure)23 Test (org.junit.Test)23 Base (org.hl7.fhir.r5.model.Base)20 NotImplementedException (org.apache.commons.lang3.NotImplementedException)19