Search in sources :

Example 1 with DvMultimedia

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);
}
Also used : DvCodedText(com.nedap.archie.rm.datavalues.DvCodedText) DvEHRURI(com.nedap.archie.rm.datavalues.DvEHRURI) PartyProxy(com.nedap.archie.rm.generic.PartyProxy) AuditDetails(com.nedap.archie.rm.generic.AuditDetails) DvMultimedia(com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia) Attestation(com.nedap.archie.rm.generic.Attestation) DvDateTime(com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime) DvText(com.nedap.archie.rm.datavalues.DvText)

Example 2 with DvMultimedia

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;
}
Also used : HashMap(java.util.HashMap) DvMultimedia(com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia) DvParsable(com.nedap.archie.rm.datavalues.encapsulated.DvParsable) DvIdentifier(com.nedap.archie.rm.datavalues.DvIdentifier)

Example 3 with DvMultimedia

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);
}
Also used : DvMultimedia(com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia) Test(org.junit.Test)

Example 4 with 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");
    }
}
Also used : FlatPathDto(org.ehrbase.webtemplate.path.flat.FlatPathDto) DvMultimedia(com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia)

Example 5 with DvMultimedia

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;
}
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

DvMultimedia (com.nedap.archie.rm.datavalues.encapsulated.DvMultimedia)6 DvParsable (com.nedap.archie.rm.datavalues.encapsulated.DvParsable)2 FlatPathDto (org.ehrbase.webtemplate.path.flat.FlatPathDto)2 FeederAuditDetails (com.nedap.archie.rm.archetyped.FeederAuditDetails)1 CodePhrase (com.nedap.archie.rm.datatypes.CodePhrase)1 DvCodedText (com.nedap.archie.rm.datavalues.DvCodedText)1 DvEHRURI (com.nedap.archie.rm.datavalues.DvEHRURI)1 DvIdentifier (com.nedap.archie.rm.datavalues.DvIdentifier)1 DvText (com.nedap.archie.rm.datavalues.DvText)1 DvURI (com.nedap.archie.rm.datavalues.DvURI)1 DvDateTime (com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime)1 Attestation (com.nedap.archie.rm.generic.Attestation)1 AuditDetails (com.nedap.archie.rm.generic.AuditDetails)1 PartyProxy (com.nedap.archie.rm.generic.PartyProxy)1 TerminologyId (com.nedap.archie.rm.support.identification.TerminologyId)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 MediendateiCluster (org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.definition.MediendateiCluster)1 DefaultValues (org.ehrbase.serialisation.walker.defaultvalues.DefaultValues)1 Attachment (org.hl7.fhir.r4.model.Attachment)1