use of com.nedap.archie.rm.generic.PartySelf in project openEHR_SDK by ehrbase.
the class TestData method buildEpisodeOfCareComposition.
public static EpisodeOfCareComposition buildEpisodeOfCareComposition() {
EpisodeOfCareComposition episode = new EpisodeOfCareComposition();
episode.setComposer(new PartyIdentified(null, "Test", null));
episode.setCategoryDefiningCode(Category.EVENT);
episode.setLanguage(Language.DE);
episode.setTerritory(Territory.DE);
episode.setEpisodeofcare(new ArrayList<>());
episode.setStartTimeValue(OffsetDateTime.now());
episode.setSettingDefiningCode(Setting.NURSING_HOME_CARE);
FeederAudit audit = new FeederAudit();
audit.setFeederSystemAudit(new FeederAuditDetails());
audit.getFeederSystemAudit().setSystemId("System 1");
audit.setOriginatingSystemAudit(new FeederAuditDetails());
audit.getOriginatingSystemAudit().setSystemId("System 2");
episode.setFeederAudit(audit);
EpisodeofcareAdminEntry episodeofcareAdminEntry = new EpisodeofcareAdminEntry();
episodeofcareAdminEntry.setUpperValue(OffsetDateTime.now());
episodeofcareAdminEntry.setLowerValue(OffsetDateTime.now());
episodeofcareAdminEntry.setLanguage(Language.DE);
episodeofcareAdminEntry.setSubject(new PartySelf());
episodeofcareAdminEntry.setIdentifier(new ArrayList<>());
EpisodeofcareIdentifierElement identifierElement = new EpisodeofcareIdentifierElement();
DvIdentifier value = new DvIdentifier();
value.setId("123");
identifierElement.setValue(value);
episodeofcareAdminEntry.getIdentifier().add(identifierElement);
EpisodeofcareIdentifierElement identifierElement2 = new EpisodeofcareIdentifierElement();
DvIdentifier value2 = new DvIdentifier();
value2.setId("456");
identifierElement2.setValue(value2);
episodeofcareAdminEntry.getIdentifier().add(identifierElement2);
episodeofcareAdminEntry.setTeam(new ArrayList<>());
EpisodeofcareTeamElement teamElement1 = new EpisodeofcareTeamElement();
teamElement1.setValue(URI.create("https://github.com/ehrbase"));
episodeofcareAdminEntry.getTeam().add(teamElement1);
episode.getEpisodeofcare().add(episodeofcareAdminEntry);
return episode;
}
use of com.nedap.archie.rm.generic.PartySelf 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;
}
use of com.nedap.archie.rm.generic.PartySelf in project openEHR_SDK by ehrbase.
the class ItemStructureVisitorTest method ehrVisitorTest.
@Test
public void ehrVisitorTest() throws Throwable {
String value = IOUtils.toString(ItemStruktureTestDataCanonicalJson.SIMPLE_EHR_OTHER_Details.getStream(), UTF_8);
RMJacksonConfiguration configuration = new RMJacksonConfiguration();
configuration.setTypePropertyName("_type");
ObjectMapper objectMapper = JacksonUtil.getObjectMapper(configuration);
ItemTree otherDetails = objectMapper.readValue(value, ItemTree.class);
EhrStatus ehrStatus = new EhrStatus("ehr_status", new DvText("ehr_status"), new PartySelf(new PartyRef()), true, true, otherDetails);
itemStructureVisitor.validate(ehrStatus);
assertEquals(3, itemStructureVisitor.getElementOccurrences());
}
use of com.nedap.archie.rm.generic.PartySelf in project ehrbase by ehrbase.
the class StatusAccess method getStatus.
@Override
public EhrStatus getStatus() {
EhrStatus status = new EhrStatus();
status.setModifiable(getStatusRecord().getIsModifiable());
status.setQueryable(getStatusRecord().getIsQueryable());
// set otherDetails if available
if (getStatusRecord().getOtherDetails() != null) {
status.setOtherDetails(getStatusRecord().getOtherDetails());
}
// Locatable attribute
status.setArchetypeNodeId(getStatusRecord().getArchetypeNodeId());
Object name = new RecordedDvCodedText().fromDB(getStatusRecord(), STATUS.NAME);
status.setName(name instanceof DvText ? (DvText) name : (DvCodedText) name);
UUID statusId = getStatusRecord().getId();
status.setUid(new HierObjectId(statusId.toString() + "::" + getServerConfig().getNodename() + "::" + I_StatusAccess.getLatestVersionNumber(this, statusId)));
PartySelf partySelf = (PartySelf) new PersistedPartyProxy(this).retrieve(getStatusRecord().getParty());
status.setSubject(partySelf);
return status;
}
Aggregations