Search in sources :

Example 1 with BloodPressureTrainingSampleObservation

use of org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservation in project openEHR_SDK by ehrbase.

the class DefaultRestAqlEndpointTestIT method testExecuteEntityQueryWithList.

@Test
public void testExecuteEntityQueryWithList() {
    ehr = openEhrClient.ehrEndpoint().createEhr();
    EhrbaseBloodPressureSimpleDeV0Composition comp1 = openEhrClient.compositionEndpoint(ehr).mergeCompositionEntity(TestData.buildEhrbaseBloodPressureSimpleDeV0());
    EhrbaseBloodPressureSimpleDeV0Composition comp2 = openEhrClient.compositionEndpoint(ehr).mergeCompositionEntity(TestData.buildEhrbaseBloodPressureSimpleDeV0());
    EhrbaseBloodPressureSimpleDeV0CompositionContainment containmentComposition = EhrbaseBloodPressureSimpleDeV0CompositionContainment.getInstance();
    EntityQuery<Record2<TemporalAccessor, List<BloodPressureTrainingSampleObservation>>> entityQuery = Query.buildEntityQuery(containmentComposition, containmentComposition.START_TIME_VALUE, containmentComposition.BLOOD_PRESSURE_TRAINING_SAMPLE);
    Parameter<UUID> ehrIdParameter = entityQuery.buildParameter();
    entityQuery.where(Condition.equal(EhrFields.EHR_ID(), ehrIdParameter));
    List<Record2<TemporalAccessor, List<BloodPressureTrainingSampleObservation>>> actual = openEhrClient.aqlEndpoint().execute(entityQuery, ehrIdParameter.setValue(ehr));
    assertThat(actual).size().isEqualTo(2);
}
Also used : BloodPressureTrainingSampleObservation(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservation) EhrbaseBloodPressureSimpleDeV0Composition(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0Composition) UUID(java.util.UUID) Record2(org.ehrbase.client.aql.record.Record2) EhrbaseBloodPressureSimpleDeV0CompositionContainment(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0CompositionContainment) Test(org.junit.Test)

Example 2 with BloodPressureTrainingSampleObservation

use of org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservation in project openEHR_SDK by ehrbase.

the class DefaultRestAqlEndpointTestIT method testExecuteEntityQuery.

@Test
public void testExecuteEntityQuery() {
    ehr = openEhrClient.ehrEndpoint().createEhr();
    EhrbaseBloodPressureSimpleDeV0Composition comp1 = openEhrClient.compositionEndpoint(ehr).mergeCompositionEntity(TestData.buildEhrbaseBloodPressureSimpleDeV0());
    EhrbaseBloodPressureSimpleDeV0Composition comp2 = openEhrClient.compositionEndpoint(ehr).mergeCompositionEntity(TestData.buildEhrbaseBloodPressureSimpleDeV0());
    EhrbaseBloodPressureSimpleDeV0CompositionContainment containmentComposition = EhrbaseBloodPressureSimpleDeV0CompositionContainment.getInstance();
    BloodPressureTrainingSampleObservationContainment containmentObservation = BloodPressureTrainingSampleObservationContainment.getInstance();
    containmentComposition.setContains(containmentObservation);
    EntityQuery<Record3<TemporalAccessor, BloodPressureTrainingSampleObservation, CuffSizeDefiningCode>> entityQuery = Query.buildEntityQuery(containmentComposition, containmentComposition.START_TIME_VALUE, containmentObservation.BLOOD_PRESSURE_TRAINING_SAMPLE_OBSERVATION, containmentObservation.CUFF_SIZE_DEFINING_CODE);
    Parameter<UUID> ehrIdParameter = entityQuery.buildParameter();
    entityQuery.where(Condition.equal(EhrFields.EHR_ID(), ehrIdParameter));
    List<Record3<TemporalAccessor, BloodPressureTrainingSampleObservation, CuffSizeDefiningCode>> actual = openEhrClient.aqlEndpoint().execute(entityQuery, ehrIdParameter.setValue(ehr));
    assertThat(actual).size().isEqualTo(2);
    Record3<TemporalAccessor, BloodPressureTrainingSampleObservation, CuffSizeDefiningCode> record1 = actual.get(0);
    assertThat(record1.value1()).isEqualTo(OffsetDateTime.of(2019, 04, 03, 22, 00, 00, 00, ZoneOffset.UTC));
    assertThat(record1.value2().getKorotkoffSoundsDefiningCode()).isEqualTo(KorotkoffSoundsDefiningCode.FIFTH_SOUND);
    assertThat(record1.value3()).isEqualTo(CuffSizeDefiningCode.ADULT);
}
Also used : BloodPressureTrainingSampleObservation(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservation) BloodPressureTrainingSampleObservationContainment(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservationContainment) TemporalAccessor(java.time.temporal.TemporalAccessor) EhrbaseBloodPressureSimpleDeV0Composition(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0Composition) UUID(java.util.UUID) CuffSizeDefiningCode(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.CuffSizeDefiningCode) Record3(org.ehrbase.client.aql.record.Record3) EhrbaseBloodPressureSimpleDeV0CompositionContainment(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0CompositionContainment) Test(org.junit.Test)

Example 3 with BloodPressureTrainingSampleObservation

use of org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservation in project openEHR_SDK by ehrbase.

the class TestData method buildBloodPressureTrainingSampleObservation.

protected static BloodPressureTrainingSampleObservation buildBloodPressureTrainingSampleObservation() {
    BloodPressureTrainingSampleObservation bloodPressureTrainingSample = new BloodPressureTrainingSampleObservation();
    bloodPressureTrainingSample.setSubject(new PartySelf());
    bloodPressureTrainingSample.setOriginValue(OffsetDateTime.now());
    bloodPressureTrainingSample.setTimeValue(OffsetDateTime.now());
    bloodPressureTrainingSample.setLanguage(Language.DE);
    bloodPressureTrainingSample.setSystolicMagnitude(22d);
    bloodPressureTrainingSample.setSystolicUnits("mm[Hg]");
    bloodPressureTrainingSample.setDiastolicMagnitude(22d);
    bloodPressureTrainingSample.setDiastolicUnits("mm[Hg]");
    bloodPressureTrainingSample.setMeanArterialPressureMagnitude(22d);
    bloodPressureTrainingSample.setMeanArterialPressureUnits("mm[Hg]");
    bloodPressureTrainingSample.setPulsePressureMagnitude(22d);
    bloodPressureTrainingSample.setPulsePressureUnits("mm[Hg]");
    bloodPressureTrainingSample.setKorotkoffSoundsDefiningCode(KorotkoffSoundsDefiningCode.FIFTH_SOUND);
    bloodPressureTrainingSample.setCuffSizeDefiningCode(CuffSizeDefiningCode.ADULT);
    bloodPressureTrainingSample.setLocationOfMeasurementDefiningCode(LocationOfMeasurementDefiningCode.FINGER);
    return bloodPressureTrainingSample;
}
Also used : BloodPressureTrainingSampleObservation(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservation) PartySelf(com.nedap.archie.rm.generic.PartySelf)

Aggregations

BloodPressureTrainingSampleObservation (org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservation)3 UUID (java.util.UUID)2 EhrbaseBloodPressureSimpleDeV0Composition (org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0Composition)2 EhrbaseBloodPressureSimpleDeV0CompositionContainment (org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0CompositionContainment)2 Test (org.junit.Test)2 PartySelf (com.nedap.archie.rm.generic.PartySelf)1 TemporalAccessor (java.time.temporal.TemporalAccessor)1 Record2 (org.ehrbase.client.aql.record.Record2)1 Record3 (org.ehrbase.client.aql.record.Record3)1 BloodPressureTrainingSampleObservationContainment (org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservationContainment)1 CuffSizeDefiningCode (org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.CuffSizeDefiningCode)1