Search in sources :

Example 26 with PartySelf

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;
}
Also used : FeederAudit(com.nedap.archie.rm.archetyped.FeederAudit) EpisodeofcareIdentifierElement(org.ehrbase.client.classgenerator.examples.episodeofcarecomposition.definition.EpisodeofcareIdentifierElement) EpisodeofcareTeamElement(org.ehrbase.client.classgenerator.examples.episodeofcarecomposition.definition.EpisodeofcareTeamElement) FeederAuditDetails(com.nedap.archie.rm.archetyped.FeederAuditDetails) PartyIdentified(com.nedap.archie.rm.generic.PartyIdentified) EpisodeofcareAdminEntry(org.ehrbase.client.classgenerator.examples.episodeofcarecomposition.definition.EpisodeofcareAdminEntry) EpisodeOfCareComposition(org.ehrbase.client.classgenerator.examples.episodeofcarecomposition.EpisodeOfCareComposition) PartySelf(com.nedap.archie.rm.generic.PartySelf) DvIdentifier(com.nedap.archie.rm.datavalues.DvIdentifier)

Example 27 with PartySelf

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;
}
Also used : BloodPressureTrainingSampleObservation(org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.definition.BloodPressureTrainingSampleObservation) PartySelf(com.nedap.archie.rm.generic.PartySelf)

Example 28 with PartySelf

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());
}
Also used : PartyRef(com.nedap.archie.rm.support.identification.PartyRef) EhrStatus(com.nedap.archie.rm.ehr.EhrStatus) ItemTree(com.nedap.archie.rm.datastructures.ItemTree) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) RMJacksonConfiguration(com.nedap.archie.json.RMJacksonConfiguration) DvText(com.nedap.archie.rm.datavalues.DvText) PartySelf(com.nedap.archie.rm.generic.PartySelf) Test(org.junit.Test)

Example 29 with PartySelf

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;
}
Also used : EhrStatus(com.nedap.archie.rm.ehr.EhrStatus) RecordedDvCodedText(org.ehrbase.service.RecordedDvCodedText) RecordedDvCodedText(org.ehrbase.service.RecordedDvCodedText) DvCodedText(com.nedap.archie.rm.datavalues.DvCodedText) UUID(java.util.UUID) HierObjectId(com.nedap.archie.rm.support.identification.HierObjectId) DvText(com.nedap.archie.rm.datavalues.DvText) PartySelf(com.nedap.archie.rm.generic.PartySelf) PersistedPartyProxy(org.ehrbase.dao.access.jooq.party.PersistedPartyProxy)

Aggregations

PartySelf (com.nedap.archie.rm.generic.PartySelf)29 DvText (com.nedap.archie.rm.datavalues.DvText)9 EhrStatus (com.nedap.archie.rm.ehr.EhrStatus)9 PartyIdentified (com.nedap.archie.rm.generic.PartyIdentified)8 PartyRef (com.nedap.archie.rm.support.identification.PartyRef)8 HierObjectId (com.nedap.archie.rm.support.identification.HierObjectId)7 UUID (java.util.UUID)5 Test (org.junit.Test)4 DvDateTime (com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime)3 URI (java.net.URI)3 ItemTree (com.nedap.archie.rm.datastructures.ItemTree)2 DvCodedText (com.nedap.archie.rm.datavalues.DvCodedText)2 DvIdentifier (com.nedap.archie.rm.datavalues.DvIdentifier)2 GenericId (com.nedap.archie.rm.support.identification.GenericId)2 BodyTemperatureAnyEventPointEvent (org.ehrbase.client.classgenerator.examples.ehrbasemultioccurrencedev1composition.definition.BodyTemperatureAnyEventPointEvent)2 BodyTemperatureObservation (org.ehrbase.client.classgenerator.examples.ehrbasemultioccurrencedev1composition.definition.BodyTemperatureObservation)2 VirologischerBefundComposition (org.ehrbase.client.classgenerator.examples.virologischerbefundcomposition.VirologischerBefundComposition)2 ProVirusCluster (org.ehrbase.client.classgenerator.examples.virologischerbefundcomposition.definition.ProVirusCluster)2 DefaultValuePath (org.ehrbase.serialisation.walker.defaultvalues.DefaultValuePath)2 DefaultValues (org.ehrbase.serialisation.walker.defaultvalues.DefaultValues)2