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);
}
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);
}
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;
}
Aggregations