use of com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia in project ehrbase by ehrbase.
the class AttestationAccess method getAsAttestation.
@Override
public Attestation getAsAttestation() {
// take most values from super class entry
AuditDetails audit = auditDetailsAccess.getAsAuditDetails();
String systemId = audit.getSystemId();
PartyProxy committer = audit.getCommitter();
DvDateTime time = audit.getTimeCommitted();
DvCodedText changeType = audit.getChangeType();
DvText description = audit.getDescription();
// FIXME VERSIONED_OBJECT_POC: implement retrieval from "attested_view" table
DvMultimedia attestedView = null;
String proof = attestationRecord.getProof();
// FIXME VERSIONED_OBJECT_POC: implement?! seems to be completely unsupported right now
List<DvEHRURI> items = null;
DvText reason = new DvText(attestationRecord.getReason());
boolean isPending = attestationRecord.getIsPending();
return new Attestation(systemId, committer, time, changeType, description, attestedView, proof, items, reason, isPending);
}
use of com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia in project openEHR_SDK by ehrbase.
the class FeederAuditConfig method buildChildValues.
/**
* {@inheritDoc}
*/
@Override
public Map<String, Object> buildChildValues(String currentTerm, FeederAudit rmObject, Context<Map<String, Object>> context) {
Map<String, Object> result = new HashMap<>();
if (rmObject.getOriginalContent() instanceof DvParsable) {
result.putAll(DV_PARSABLE_CONFIG.buildChildValues(currentTerm + "/original_content", (DvParsable) rmObject.getOriginalContent(), context));
} else if (rmObject.getOriginalContent() instanceof DvMultimedia) {
result.putAll(DV_MULTIMEDIA_CONFIG.buildChildValues(currentTerm + "/original_content_multimedia", (DvMultimedia) rmObject.getOriginalContent(), context));
}
IntStream.range(0, rmObject.getFeederSystemItemIds().size()).forEach(i -> {
DvIdentifier identifier = rmObject.getFeederSystemItemIds().get(i);
result.putAll(DV_IDENTIFIER_CONFIG.buildChildValues(currentTerm + "/feeder_system_item_id:" + i, identifier, context));
});
IntStream.range(0, rmObject.getOriginatingSystemItemIds().size()).forEach(i -> {
DvIdentifier identifier = rmObject.getOriginatingSystemItemIds().get(i);
result.putAll(DV_IDENTIFIER_CONFIG.buildChildValues(currentTerm + "/originating_system_item_id:" + i, identifier, context));
});
if (rmObject.getOriginatingSystemAudit() != null) {
result.putAll(FEEDER_AUDI_DETAILS_STD_CONFIG.buildChildValues(currentTerm + "/originating_system_audit", rmObject.getOriginatingSystemAudit(), context));
}
return result;
}
use of com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia in project openEHR_SDK by ehrbase.
the class CanonicalJsonMarshallingTest method UnmarshalMultimedia.
@Test
public void UnmarshalMultimedia() throws IOException {
String value = new String(Files.readAllBytes(Paths.get("src/test/resources/sample_data/multimedia.json")));
CanonicalJson cut = new CanonicalJson();
DvMultimedia dvMultimedia = cut.unmarshal(value, DvMultimedia.class);
assertNotNull(dvMultimedia);
}
use of com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia in project openEHR_SDK by ehrbase.
the class DvMultimediaPostprocessor method process.
/**
* {@inheritDoc}
*/
@Override
public void process(String term, DvMultimedia rmObject, Map<FlatPathDto, String> values, Set<String> consumedPaths, Context<Map<FlatPathDto, String>> context) {
Map<FlatPathDto, String> thumbnailValues = filter(values, term + "/_thumbnail", false);
if (!thumbnailValues.isEmpty()) {
rmObject.setThumbnail(new DvMultimedia());
handleRmAttribute(term, rmObject.getThumbnail(), thumbnailValues, consumedPaths, context, "thumbnail");
}
}
use of com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia in project fhir-bridge by ehrbase.
the class DocumentReferenceToHipDocumentConverter method getMultimedia.
private MediendateiCluster getMultimedia(DocumentReference documentReference) {
Attachment attachment = documentReference.getContentFirstRep().getAttachment();
DvMultimedia multimedia = new DvMultimedia();
multimedia.setUri(new DvURI(attachment.getUrl()));
multimedia.setMediaType(new CodePhrase(new TerminologyId("IANA_media-types"), attachment.getContentType()));
multimedia.setSize(attachment.getSize());
MediendateiCluster result = new MediendateiCluster();
result.setMediendateiInhalt(multimedia);
result.setMediendateiInhaltValue(attachment.getTitle());
result.setBeschreibungValue(documentReference.getDescription());
getCreation(attachment).ifPresent(result::setErstelltValue);
return result;
}
Aggregations