Search in sources :

Example 1 with HIPDocumentComposition

use of org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.HIPDocumentComposition in project fhir-bridge by ehrbase.

the class DocumentReferenceToHipDocumentConverter method convertInternal.

@Override
protected HIPDocumentComposition convertInternal(DocumentReference documentReference) {
    HIPDocumentComposition composition = new HIPDocumentComposition();
    composition.setStartTimeValue(getStartTime(documentReference));
    getMetadata(documentReference).ifPresent(composition::setHipMetadata);
    composition.setMediendatei(getMultimedia(documentReference));
    return composition;
}
Also used : HIPDocumentComposition(org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.HIPDocumentComposition)

Example 2 with HIPDocumentComposition

use of org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.HIPDocumentComposition in project fhir-bridge by ehrbase.

the class DocumentReferenceIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    DocumentReference documentReference = (DocumentReference) super.testFileLoader.loadResource(resourcePath);
    DocumentReferenceToHipDocumentConverter converter = new DocumentReferenceToHipDocumentConverter();
    HIPDocumentComposition result = converter.convert(documentReference);
    Diff diff = compareCompositions(getJavers(), paragonPath, result);
    assertEquals(0, diff.getChanges().size());
}
Also used : Diff(org.javers.core.diff.Diff) DocumentReferenceToHipDocumentConverter(org.ehrbase.fhirbridge.ehr.converter.specific.hipdocument.DocumentReferenceToHipDocumentConverter) HIPDocumentComposition(org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.HIPDocumentComposition) DocumentReference(org.hl7.fhir.r4.model.DocumentReference)

Aggregations

HIPDocumentComposition (org.ehrbase.fhirbridge.ehr.opt.hipdocumentcomposition.HIPDocumentComposition)2 DocumentReferenceToHipDocumentConverter (org.ehrbase.fhirbridge.ehr.converter.specific.hipdocument.DocumentReferenceToHipDocumentConverter)1 DocumentReference (org.hl7.fhir.r4.model.DocumentReference)1 Diff (org.javers.core.diff.Diff)1