Search in sources :

Example 1 with MediendateiCluster

use of org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.definition.MediendateiCluster 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;
}
Also used : TerminologyId(com.nedap.archie.rm.support.identification.TerminologyId) CodePhrase(com.nedap.archie.rm.datatypes.CodePhrase) Attachment(org.hl7.fhir.r4.model.Attachment) DvMultimedia(com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia) MediendateiCluster(org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.definition.MediendateiCluster) DvURI(com.nedap.archie.rm.datavalues.DvURI)

Aggregations

CodePhrase (com.nedap.archie.rm.datatypes.CodePhrase)1 DvURI (com.nedap.archie.rm.datavalues.DvURI)1 DvMultimedia (com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia)1 TerminologyId (com.nedap.archie.rm.support.identification.TerminologyId)1 MediendateiCluster (org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.definition.MediendateiCluster)1 Attachment (org.hl7.fhir.r4.model.Attachment)1