use of com.nedap.archie.rm.datavalues.DvIdentifier in project fhir-bridge by ehrbase.
the class DvIdentifierParser method parseObservationIntoDvIdentifier.
public static Optional<DvIdentifier> parseObservationIntoDvIdentifier(Observation observation) {
DvIdentifier dvIdentifier = new DvIdentifier();
mapAssigner(observation).ifPresent(dvIdentifier::setAssigner);
mapId(observation).ifPresent(dvIdentifier::setId);
mapType(observation).ifPresent(dvIdentifier::setType);
return Optional.of(dvIdentifier);
}
use of com.nedap.archie.rm.datavalues.DvIdentifier in project fhir-bridge by ehrbase.
the class AbstractConverter method buildFeederAudit.
protected FeederAudit buildFeederAudit(@NonNull S resource) {
FeederAudit result = new FeederAudit();
String systemId = resource.getMeta().hasSource() ? resource.getMeta().getSource() : DEFAULT_SYSTEM_ID;
result.setOriginatingSystemAudit(new FeederAuditDetails(systemId, null, null, null, null, null, null));
List<DvIdentifier> identifiers = new ArrayList<>();
if (resource.hasId()) {
DvIdentifier identifier = new DvIdentifier();
identifier.setId(resource.getId());
identifier.setType("fhir_logical_id");
identifiers.add(identifier);
}
identifiers.addAll(subjectIdentifiers(resource));
result.setOriginatingSystemItemIds(identifiers);
return result;
}
use of com.nedap.archie.rm.datavalues.DvIdentifier in project fhir-bridge by ehrbase.
the class DocumentReferenceToHipDocumentConverter method getIdentifiers.
private Optional<List<HipMetadataIdentifikatorElement>> getIdentifiers(DocumentReference documentReference) {
if (!documentReference.hasMasterIdentifier()) {
return Optional.empty();
}
DvIdentifier id = new DvIdentifier();
id.setAssigner(documentReference.getMasterIdentifier().getSystem());
id.setId(documentReference.getMasterIdentifier().getValue());
HipMetadataIdentifikatorElement idElem = new HipMetadataIdentifikatorElement();
idElem.setValue(id);
return Optional.of(List.of(idElem));
}
use of com.nedap.archie.rm.datavalues.DvIdentifier in project openEHR_SDK by ehrbase.
the class ParticipationConfig method buildChildValues.
/**
* {@inheritDoc}
*/
@Override
public Map<String, Object> buildChildValues(String currentTerm, Participation rmObject, Context<Map<String, Object>> context) {
Map<String, Object> result = new HashMap<>();
addValue(result, currentTerm, "id", Optional.of(rmObject).map(Participation::getPerformer).map(PartyProxy::getExternalRef).map(ObjectRef::getId).map(ObjectId::getValue).orElse(null));
addValue(result, currentTerm, "id_namespace", Optional.of(rmObject).map(Participation::getPerformer).map(PartyProxy::getExternalRef).map(ObjectRef::getNamespace).orElse(null));
addValue(result, currentTerm, "id_scheme", Optional.of(rmObject).map(Participation::getPerformer).map(PartyProxy::getExternalRef).map(PartyRef::getId).filter(cls -> GenericId.class.isAssignableFrom(cls.getClass())).map(GenericId.class::cast).map(GenericId::getScheme).orElse(null));
addValue(result, currentTerm, "name", Optional.of(rmObject).map(Participation::getPerformer).filter(p -> PartyIdentified.class.isAssignableFrom(p.getClass())).map(PartyIdentified.class::cast).map(PartyIdentified::getName).orElse(null));
addValue(result, currentTerm, "mode", Optional.of(rmObject).map(Participation::getMode).map(DvText::getValue).orElse(null));
addValue(result, currentTerm, "function", Optional.of(rmObject).map(Participation::getFunction).map(DvText::getValue).orElse(null));
List<DvIdentifier> dvIdentifiers = Optional.of(rmObject).map(Participation::getPerformer).filter(p -> PartyIdentified.class.isAssignableFrom(p.getClass())).map(PartyIdentified.class::cast).map(PartyIdentified::getIdentifiers).orElse(Collections.emptyList());
IntStream.range(0, dvIdentifiers.size()).forEach(i -> {
DvIdentifier identifier = dvIdentifiers.get(i);
addValue(result, currentTerm, "identifiers_id:" + i, identifier.getId());
addValue(result, currentTerm, "identifiers_issuer:" + i, identifier.getIssuer());
addValue(result, currentTerm, "identifiers_assigner:" + i, identifier.getAssigner());
addValue(result, currentTerm, "identifiers_type:" + i, identifier.getType());
});
return result;
}
use of com.nedap.archie.rm.datavalues.DvIdentifier in project openEHR_SDK by ehrbase.
the class DefaultValues method toDvIdentifier.
public static DvIdentifier toDvIdentifier(Map<String, String> valueMap) {
DvIdentifier dvIdentifier = new DvIdentifier();
dvIdentifier.setId(valueMap.get("id"));
if (StringUtils.isBlank(dvIdentifier.getId())) {
dvIdentifier.setId(valueMap.get(""));
}
dvIdentifier.setAssigner(valueMap.get("assigner"));
dvIdentifier.setIssuer(valueMap.get("issuer"));
dvIdentifier.setType(valueMap.get("type"));
return dvIdentifier;
}
Aggregations