use of com.nedap.archie.rm.datavalues.DvIdentifier 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.datavalues.DvIdentifier in project ehrbase by ehrbase.
the class PartyIdentifiersTest method isIdentical.
@Test
public void isIdentical() {
// set 1
DvIdentifier dvIdentifier11 = new DvIdentifier();
dvIdentifier11.setId("A");
dvIdentifier11.setAssigner("A");
dvIdentifier11.setIssuer("A");
dvIdentifier11.setType("A");
DvIdentifier dvIdentifier12 = new DvIdentifier();
dvIdentifier12.setId("B");
dvIdentifier12.setAssigner("B");
dvIdentifier12.setIssuer("B");
dvIdentifier12.setType("B");
List<DvIdentifier> set1 = new ArrayList<>();
set1.add(dvIdentifier11);
set1.add(dvIdentifier12);
// set 2
DvIdentifier dvIdentifier21 = new DvIdentifier();
dvIdentifier21.setId("A");
dvIdentifier21.setAssigner("A");
dvIdentifier21.setIssuer("A");
dvIdentifier21.setType("A");
DvIdentifier dvIdentifier22 = new DvIdentifier();
dvIdentifier22.setId("B");
dvIdentifier22.setAssigner("B");
dvIdentifier22.setIssuer("B");
dvIdentifier22.setType("B");
List<DvIdentifier> set2 = new ArrayList<>();
set2.add(dvIdentifier21);
set2.add(dvIdentifier22);
assertTrue(new PartyIdentifiers(null).compare(set1, set2));
// set 3
DvIdentifier dvIdentifier31 = new DvIdentifier();
dvIdentifier31.setId("A");
dvIdentifier31.setAssigner("A");
dvIdentifier31.setIssuer("A");
dvIdentifier31.setType("A");
DvIdentifier dvIdentifier32 = new DvIdentifier();
dvIdentifier32.setId("C");
dvIdentifier32.setAssigner("C");
dvIdentifier32.setIssuer("C");
dvIdentifier32.setType("C");
List<DvIdentifier> set3 = new ArrayList<>();
set3.add(dvIdentifier31);
set3.add(dvIdentifier32);
assertFalse(new PartyIdentifiers(null).compare(set1, set3));
}
use of com.nedap.archie.rm.datavalues.DvIdentifier in project ehrbase by ehrbase.
the class PartyIdentifiersTest method isIdenticalWithNull.
@Test
public void isIdenticalWithNull() {
// set 1
DvIdentifier dvIdentifier11 = new DvIdentifier();
dvIdentifier11.setId("A");
DvIdentifier dvIdentifier12 = new DvIdentifier();
dvIdentifier12.setId("B");
List<DvIdentifier> set1 = new ArrayList<>();
set1.add(dvIdentifier11);
set1.add(dvIdentifier12);
// set 2
DvIdentifier dvIdentifier21 = new DvIdentifier();
dvIdentifier21.setId("A");
DvIdentifier dvIdentifier22 = new DvIdentifier();
dvIdentifier22.setId("B");
List<DvIdentifier> set2 = new ArrayList<>();
set2.add(dvIdentifier21);
set2.add(dvIdentifier22);
assertTrue(new PartyIdentifiers(null).compare(set1, set2));
}
use of com.nedap.archie.rm.datavalues.DvIdentifier in project ehrbase by ehrbase.
the class PartyIdentifiers method retrieve.
List<DvIdentifier> retrieve(PartyIdentifiedRecord partyIdentifiedRecord) {
List<DvIdentifier> identifierList = new ArrayList<>();
domainAccess.getContext().fetch(IDENTIFIER, IDENTIFIER.PARTY.eq(partyIdentifiedRecord.getId())).forEach(record -> {
DvIdentifier identifier = new DvIdentifier();
identifier.setIssuer(record.getIssuer());
identifier.setAssigner(record.getAssigner());
identifier.setId(record.getIdValue());
identifier.setType(record.getTypeName());
identifierList.add(identifier);
});
return identifierList;
}
use of com.nedap.archie.rm.datavalues.DvIdentifier in project ehrbase by ehrbase.
the class PersistedPartyIdentified method render.
@Override
public PartyProxy render(PartyIdentifiedRecord partyIdentifiedRecord) {
PartyRef partyRef = null;
if (partyIdentifiedRecord.getPartyRefType() != null) {
ObjectId objectID = new PersistedObjectId().fromDB(partyIdentifiedRecord);
partyRef = new PartyRef(objectID, partyIdentifiedRecord.getPartyRefNamespace(), partyIdentifiedRecord.getPartyRefType());
}
List<DvIdentifier> identifierList = new PartyIdentifiers(domainAccess).retrieve(partyIdentifiedRecord);
PartyIdentified partyIdentified = new PartyIdentified(partyRef, partyIdentifiedRecord.getName(), identifierList.isEmpty() ? null : identifierList);
return partyIdentified;
}
Aggregations