Search in sources :

Example 26 with PartyIdentified

use of com.nedap.archie.rm.generic.PartyIdentified in project openEHR_SDK by ehrbase.

the class PartyIdentifiedStdConfig method buildChildValues.

/**
 * {@inheritDoc}
 */
@Override
public Map<String, Object> buildChildValues(String currentTerm, PartyIdentified rmObject, Context<Map<String, Object>> context) {
    Map<String, Object> result = new HashMap<>();
    addValue(result, currentTerm, "name", rmObject.getName());
    addValue(result, currentTerm, "id", Optional.of(rmObject).map(PartyProxy::getExternalRef).map(ObjectRef::getId).map(ObjectId::getValue).orElse(null));
    addValue(result, currentTerm, "id_namespace", Optional.of(rmObject).map(PartyProxy::getExternalRef).map(ObjectRef::getNamespace).orElse(null));
    GenericId genericId = Optional.of(rmObject).map(PartyProxy::getExternalRef).map(ObjectRef::getId).filter(i -> i.getClass().equals(GenericId.class)).map(i -> (GenericId) i).orElse(null);
    if (genericId != null) {
        addValue(result, currentTerm, "id_scheme", genericId.getScheme());
    }
    if (rmObject.getIdentifiers() != null) {
        IntStream.range(0, rmObject.getIdentifiers().size()).forEach(i -> result.putAll(DV_IDENTIFIER_CONFIG.buildChildValues(currentTerm + "/_identifier:" + i, rmObject.getIdentifiers().get(i), context)));
    }
    return result;
}
Also used : PartyProxy(com.nedap.archie.rm.generic.PartyProxy) IntStream(java.util.stream.IntStream) ObjectRef(com.nedap.archie.rm.support.identification.ObjectRef) Context(org.ehrbase.serialisation.walker.Context) PartyIdentified(com.nedap.archie.rm.generic.PartyIdentified) GenericId(com.nedap.archie.rm.support.identification.GenericId) Map(java.util.Map) Optional(java.util.Optional) HashMap(java.util.HashMap) ObjectId(com.nedap.archie.rm.support.identification.ObjectId) GenericId(com.nedap.archie.rm.support.identification.GenericId) HashMap(java.util.HashMap) ObjectId(com.nedap.archie.rm.support.identification.ObjectId) PartyProxy(com.nedap.archie.rm.generic.PartyProxy) ObjectRef(com.nedap.archie.rm.support.identification.ObjectRef)

Example 27 with PartyIdentified

use of com.nedap.archie.rm.generic.PartyIdentified in project openEHR_SDK by ehrbase.

the class TestData method buildTestStationarerVersorgungsfallComposition.

public static StationarerVersorgungsfallComposition buildTestStationarerVersorgungsfallComposition() {
    StationarerVersorgungsfallComposition stationarerVersorgungsfallComposition = new StationarerVersorgungsfallComposition();
    stationarerVersorgungsfallComposition.setComposer(new PartyIdentified(null, "Test", null));
    stationarerVersorgungsfallComposition.setCategoryDefiningCode(Category.EVENT);
    stationarerVersorgungsfallComposition.setLanguage(Language.DE);
    stationarerVersorgungsfallComposition.setTerritory(Territory.DE);
    // context
    stationarerVersorgungsfallComposition.setStartTimeValue(new DvDateTime("2020-04-02T12:00:00Z").getValue());
    stationarerVersorgungsfallComposition.setSettingDefiningCode(Setting.NURSING_HOME_CARE);
    // other_context
    stationarerVersorgungsfallComposition.setFalltypDefiningCode(FalltypDefiningCode.VERSORGUNGSFALL);
    stationarerVersorgungsfallComposition.setFallKennungValue("45657678");
    // openEHR-EHR-ADMIN_ENTRY.admission.v0
    AufnahmedatenAdminEntry aufnahmedatenAdminEntry = new AufnahmedatenAdminEntry();
    aufnahmedatenAdminEntry.setDatumUhrzeitDerAufnahmeValue(new DvDateTime("2020-04-02T12:00:00Z").getValue());
    aufnahmedatenAdminEntry.setLanguage(Language.DE);
    aufnahmedatenAdminEntry.setSubject(new PartySelf());
    // openEHR-EHR-ADMIN_ENTRY.discharge_summary.v0
    EntlassungsdatenAdminEntry entlassungsdatenAdminEntry = new EntlassungsdatenAdminEntry();
    entlassungsdatenAdminEntry.setLanguage(Language.DE);
    entlassungsdatenAdminEntry.setSubject(new PartySelf());
    entlassungsdatenAdminEntry.setKlinischerZustandDesPatientenDefiningCode(KlinischerZustandDesPatientenDefiningCode.UNBESTIMMT);
    entlassungsdatenAdminEntry.setDatumUhrzeitDerEntlassungValue(new DvDateTime("2020-04-02T12:00:00Z").getValue());
    // assemble
    stationarerVersorgungsfallComposition.setAufnahmedaten(aufnahmedatenAdminEntry);
    stationarerVersorgungsfallComposition.setEntlassungsdaten(entlassungsdatenAdminEntry);
    return stationarerVersorgungsfallComposition;
}
Also used : StationarerVersorgungsfallComposition(org.ehrbase.client.classgenerator.examples.stationarerversorgungsfallcomposition.StationarerVersorgungsfallComposition) PartyIdentified(com.nedap.archie.rm.generic.PartyIdentified) AufnahmedatenAdminEntry(org.ehrbase.client.classgenerator.examples.stationarerversorgungsfallcomposition.definition.AufnahmedatenAdminEntry) EntlassungsdatenAdminEntry(org.ehrbase.client.classgenerator.examples.stationarerversorgungsfallcomposition.definition.EntlassungsdatenAdminEntry) DvDateTime(com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime) PartySelf(com.nedap.archie.rm.generic.PartySelf)

Example 28 with PartyIdentified

use of com.nedap.archie.rm.generic.PartyIdentified in project openEHR_SDK by ehrbase.

the class TestData method buildAlternativeEventsComposition.

public static AlternativeEventsComposition buildAlternativeEventsComposition() {
    AlternativeEventsComposition alternativeEventsComposition = new AlternativeEventsComposition();
    alternativeEventsComposition.setStartTimeValue(OffsetDateTime.of(2010, 11, 02, 12, 00, 00, 00, ZoneOffset.UTC));
    alternativeEventsComposition.setComposer(new PartyIdentified(null, "Test", null));
    alternativeEventsComposition.setLanguage(Language.EN);
    alternativeEventsComposition.setTerritory(Territory.DE);
    alternativeEventsComposition.setCategoryDefiningCode(Category.EVENT);
    alternativeEventsComposition.setSettingDefiningCode(Setting.COMPLEMENTARY_HEALTH_CARE);
    alternativeEventsComposition.setKorpergewicht(new ArrayList<>());
    KorpergewichtObservation korpergewichtObservation = new KorpergewichtObservation();
    korpergewichtObservation.setLanguage(Language.EN);
    korpergewichtObservation.setSubject(new PartySelf());
    korpergewichtObservation.setOriginValue(OffsetDateTime.of(1990, 11, 02, 12, 00, 00, 00, ZoneOffset.UTC));
    alternativeEventsComposition.getKorpergewicht().add(korpergewichtObservation);
    KorpergewichtBirthEnPointEvent birthEnEvent = new KorpergewichtBirthEnPointEvent();
    birthEnEvent.setGewichtMagnitude(30d);
    birthEnEvent.setGewichtUnits("kg");
    birthEnEvent.setTimeValue(OffsetDateTime.of(1990, 11, 02, 12, 00, 00, 00, ZoneOffset.UTC));
    korpergewichtObservation.setBirthEn(birthEnEvent);
    korpergewichtObservation.setAnyEventEn(new ArrayList<>());
    KorpergewichtAnyEventEnPointEvent pointEvent = new KorpergewichtAnyEventEnPointEvent();
    pointEvent.setGewichtMagnitude(55d);
    pointEvent.setGewichtUnits("kg");
    pointEvent.setTimeValue(OffsetDateTime.of(2013, 11, 02, 12, 00, 00, 00, ZoneOffset.UTC));
    korpergewichtObservation.getAnyEventEn().add(pointEvent);
    KorpergewichtAnyEventEnIntervalEvent intervalEvent = new KorpergewichtAnyEventEnIntervalEvent();
    intervalEvent.setGewichtMagnitude(60d);
    intervalEvent.setGewichtUnits("kg");
    intervalEvent.setTimeValue(OffsetDateTime.of(2015, 11, 02, 12, 00, 00, 00, ZoneOffset.UTC));
    intervalEvent.setWidthValue(Duration.ofDays(30));
    intervalEvent.setMathFunctionDefiningCode(MathFunction.MEAN);
    korpergewichtObservation.getAnyEventEn().add(intervalEvent);
    return alternativeEventsComposition;
}
Also used : KorpergewichtObservation(org.ehrbase.client.classgenerator.examples.alternativeeventscomposition.definition.KorpergewichtObservation) PartyIdentified(com.nedap.archie.rm.generic.PartyIdentified) KorpergewichtBirthEnPointEvent(org.ehrbase.client.classgenerator.examples.alternativeeventscomposition.definition.KorpergewichtBirthEnPointEvent) KorpergewichtAnyEventEnIntervalEvent(org.ehrbase.client.classgenerator.examples.alternativeeventscomposition.definition.KorpergewichtAnyEventEnIntervalEvent) KorpergewichtAnyEventEnPointEvent(org.ehrbase.client.classgenerator.examples.alternativeeventscomposition.definition.KorpergewichtAnyEventEnPointEvent) AlternativeEventsComposition(org.ehrbase.client.classgenerator.examples.alternativeeventscomposition.AlternativeEventsComposition) PartySelf(com.nedap.archie.rm.generic.PartySelf)

Example 29 with PartyIdentified

use of com.nedap.archie.rm.generic.PartyIdentified in project openEHR_SDK by ehrbase.

the class TestData method buildGeccoSerologischerBefundComposition.

public static GECCOSerologischerBefundComposition buildGeccoSerologischerBefundComposition() {
    GECCOSerologischerBefundComposition composition = new GECCOSerologischerBefundComposition();
    composition.setLanguage(Language.DE);
    composition.setTerritory(Territory.DE);
    composition.setCategoryDefiningCode(Category.EVENT);
    composition.setSettingDefiningCode(Setting.NURSING_HOME_CARE);
    composition.setComposer(new PartyIdentified(null, "Test", null));
    composition.setStartTimeValue(OffsetDateTime.of(2019, 04, 03, 22, 00, 00, 00, ZoneOffset.UTC));
    composition.setParticipations(new ArrayList<>());
    composition.setBefund(new ArrayList<>());
    var befundObservation = new org.ehrbase.client.classgenerator.examples.geccoserologischerbefundcomposition.definition.BefundObservation();
    composition.getBefund().add(befundObservation);
    befundObservation.setSubject(new PartySelf());
    befundObservation.setJedesEreignis(new ArrayList<>());
    befundObservation.setLanguage(Language.DE);
    befundObservation.setAnforderungDefiningCode(AnforderungDefiningCode.SARS_COV2_COVID19_AB_PANEL_SERUM_OR_PLASMA_BY_IMMUNOASSAY);
    befundObservation.setOriginValue(OffsetDateTime.of(2019, 04, 03, 22, 00, 00, 00, ZoneOffset.UTC));
    BefundJedesEreignisPointEvent event = new BefundJedesEreignisPointEvent();
    event.setTimeValue(OffsetDateTime.of(2019, 04, 03, 22, 00, 00, 00, ZoneOffset.UTC));
    event.setErgebnisStatusValue("registered");
    event.setLabortestBezeichnungDefiningCode(LabortestBezeichnungDefiningCode.SEROLOGIC_TEST_PROCEDURE);
    event.setVirusnachweistestDefiningCode(VirusnachweistestDefiningCode.SARS_COV2_COVID19_AB_PRESENCE_IN_SERUM_OR_PLASMA_BY_IMMUNOASSAY);
    befundObservation.getJedesEreignis().add(event);
    ProAnalytQuantitativesErgebnisDvCount quantitativesErgebnis = new ProAnalytQuantitativesErgebnisDvCount();
    quantitativesErgebnis.setQuantitativesErgebnisMagnitude(22l);
    event.setQuantitativesErgebnis(quantitativesErgebnis);
    return composition;
}
Also used : GECCOSerologischerBefundComposition(org.ehrbase.client.classgenerator.examples.geccoserologischerbefundcomposition.GECCOSerologischerBefundComposition) BefundJedesEreignisPointEvent(org.ehrbase.client.classgenerator.examples.geccoserologischerbefundcomposition.definition.BefundJedesEreignisPointEvent) BefundObservation(org.ehrbase.client.classgenerator.examples.virologischerbefundcomposition.definition.BefundObservation) PartyIdentified(com.nedap.archie.rm.generic.PartyIdentified) ProAnalytQuantitativesErgebnisDvCount(org.ehrbase.client.classgenerator.examples.geccoserologischerbefundcomposition.definition.ProAnalytQuantitativesErgebnisDvCount) PartySelf(com.nedap.archie.rm.generic.PartySelf)

Example 30 with PartyIdentified

use of com.nedap.archie.rm.generic.PartyIdentified 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)

Aggregations

PartyIdentified (com.nedap.archie.rm.generic.PartyIdentified)41 DvDateTime (com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime)12 PartySelf (com.nedap.archie.rm.generic.PartySelf)12 Participation (com.nedap.archie.rm.generic.Participation)11 GenericId (com.nedap.archie.rm.support.identification.GenericId)11 DvIdentifier (com.nedap.archie.rm.datavalues.DvIdentifier)10 Test (org.junit.Test)10 Composition (com.nedap.archie.rm.composition.Composition)9 DvText (com.nedap.archie.rm.datavalues.DvText)9 EhrbaseBloodPressureSimpleDeV0Composition (org.ehrbase.client.classgenerator.examples.ehrbasebloodpressuresimpledev0composition.EhrbaseBloodPressureSimpleDeV0Composition)9 PartyProxy (com.nedap.archie.rm.generic.PartyProxy)8 IOException (java.io.IOException)8 StandardCharsets (java.nio.charset.StandardCharsets)8 IOUtils (org.apache.commons.io.IOUtils)8 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)8 Tuple (org.assertj.core.groups.Tuple)8 DvCodedText (com.nedap.archie.rm.datavalues.DvCodedText)7 PartyRef (com.nedap.archie.rm.support.identification.PartyRef)6 Optional (java.util.Optional)6 TestData (org.ehrbase.client.TestData)6