From 69428baac676ae9a57c65eae835fabfe09a24f0a Mon Sep 17 00:00:00 2001 From: Thomas Papke Date: Tue, 12 Dec 2023 07:55:49 +0100 Subject: [PATCH] #1 Add some initial mapping for associations --- .../mapper/XdsToFhirDocumentMapper.java | 1 + .../common/mapper/XdsToFhirFolderMapper.java | 10 +- .../mapper/XdsToFhirSubmissionsetMapper.java | 10 +- .../registry/query/StoredQueryProcessor.java | 142 +++++++++++++----- .../register/RegisterDocumentsProcessor.java | 61 ++++++-- .../FhirToXdsSubmissionsetMapperTest.java | 8 +- .../common/mapper/FolderMappingImplTest.java | 8 +- 7 files changed, 180 insertions(+), 60 deletions(-) diff --git a/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirDocumentMapper.java b/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirDocumentMapper.java index 2f62b04..cc81ae6 100644 --- a/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirDocumentMapper.java +++ b/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirDocumentMapper.java @@ -44,6 +44,7 @@ public class XdsToFhirDocumentMapper extends AbstractXdsToFhirMapper @Override public DocumentReference apply(final DocumentEntry xdsDoc) { var fhirDoc = new DocumentReference(); + fhirDoc.setId(xdsDoc.getEntryUuid()); fhirDoc.getMeta().setProfile(singletonList(new CanonicalType(MHD_COMPREHENSIVE_PROFILE))); fhirDoc.setStatus(xdsDoc.getAvailabilityStatus() == APPROVED ? DocumentReferenceStatus.CURRENT : DocumentReferenceStatus.SUPERSEDED); diff --git a/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirFolderMapper.java b/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirFolderMapper.java index 9ebc733..4e7ff68 100644 --- a/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirFolderMapper.java +++ b/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirFolderMapper.java @@ -1,12 +1,14 @@ package org.openehealth.app.xdstofhir.registry.common.mapper; import java.util.Collections; -import java.util.function.Function; +import java.util.List; +import java.util.function.BiFunction; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.hl7.fhir.r4.model.Annotation; import org.hl7.fhir.r4.model.Identifier; +import org.hl7.fhir.r4.model.Reference; import org.openehealth.app.xdstofhir.registry.common.MappingSupport; import org.openehealth.app.xdstofhir.registry.common.fhir.MhdFolder; import org.openehealth.ipf.commons.ihe.xds.core.metadata.Folder; @@ -15,10 +17,11 @@ @Component @RequiredArgsConstructor public class XdsToFhirFolderMapper extends AbstractXdsToFhirMapper - implements Function { + implements BiFunction, MhdFolder> { @Override - public MhdFolder apply(Folder xdFolder) { + public MhdFolder apply(Folder xdFolder, List references) { var mhdList = new MhdFolder(); + mhdList.setId(xdFolder.getEntryUuid()); mhdList.addIdentifier(fromIdentifier(xdFolder.getEntryUuid(), Identifier.IdentifierUse.OFFICIAL)); mhdList.addIdentifier( fromIdentifier(MappingSupport.OID_URN + xdFolder.getUniqueId(), Identifier.IdentifierUse.USUAL)); @@ -32,6 +35,7 @@ public MhdFolder apply(Folder xdFolder) { annotation.setText(xdFolder.getComments().getValue()); mhdList.setNote(Collections.singletonList(annotation)); } + references.forEach(ref -> mhdList.addEntry().setItem(ref)); return mhdList; } diff --git a/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirSubmissionsetMapper.java b/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirSubmissionsetMapper.java index 25ecc45..88486c8 100644 --- a/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirSubmissionsetMapper.java +++ b/src/main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirSubmissionsetMapper.java @@ -1,11 +1,13 @@ package org.openehealth.app.xdstofhir.registry.common.mapper; import java.util.Collections; -import java.util.function.Function; +import java.util.List; +import java.util.function.BiFunction; import lombok.RequiredArgsConstructor; import org.hl7.fhir.r4.model.Annotation; import org.hl7.fhir.r4.model.Identifier; +import org.hl7.fhir.r4.model.Reference; import org.openehealth.app.xdstofhir.registry.common.MappingSupport; import org.openehealth.app.xdstofhir.registry.common.fhir.MhdSubmissionSet; import org.openehealth.ipf.commons.ihe.xds.core.metadata.SubmissionSet; @@ -14,10 +16,11 @@ @Component @RequiredArgsConstructor public class XdsToFhirSubmissionsetMapper extends AbstractXdsToFhirMapper - implements Function { + implements BiFunction, MhdSubmissionSet> { @Override - public MhdSubmissionSet apply(SubmissionSet xdsSub) { + public MhdSubmissionSet apply(SubmissionSet xdsSub, List references) { var mhdList = new MhdSubmissionSet(); + mhdList.setId(xdsSub.getEntryUuid()); mhdList.addIdentifier(fromIdentifier(xdsSub.getEntryUuid(), Identifier.IdentifierUse.OFFICIAL)); mhdList.addIdentifier( fromIdentifier(MappingSupport.OID_URN + xdsSub.getUniqueId(), Identifier.IdentifierUse.USUAL)); @@ -36,6 +39,7 @@ public MhdSubmissionSet apply(SubmissionSet xdsSub) { annotation.setText(xdsSub.getComments().getValue()); mhdList.setNote(Collections.singletonList(annotation)); } + references.forEach(ref -> mhdList.addEntry().setItem(ref)); return mhdList; } diff --git a/src/main/java/org/openehealth/app/xdstofhir/registry/query/StoredQueryProcessor.java b/src/main/java/org/openehealth/app/xdstofhir/registry/query/StoredQueryProcessor.java index 090607c..5f5e870 100644 --- a/src/main/java/org/openehealth/app/xdstofhir/registry/query/StoredQueryProcessor.java +++ b/src/main/java/org/openehealth/app/xdstofhir/registry/query/StoredQueryProcessor.java @@ -1,7 +1,10 @@ package org.openehealth.app.xdstofhir.registry.query; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; +import java.util.List; +import java.util.UUID; import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; @@ -9,9 +12,17 @@ import ca.uhn.fhir.rest.client.api.IGenericClient; import lombok.RequiredArgsConstructor; +import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.DocumentReference; +import org.hl7.fhir.r4.model.DomainResource; +import org.hl7.fhir.r4.model.Identifier; +import org.hl7.fhir.r4.model.ListResource; import org.openehealth.app.xdstofhir.registry.common.fhir.MhdFolder; import org.openehealth.app.xdstofhir.registry.common.fhir.MhdSubmissionSet; +import org.openehealth.ipf.commons.core.URN; +import org.openehealth.ipf.commons.ihe.xds.core.metadata.Association; +import org.openehealth.ipf.commons.ihe.xds.core.metadata.AssociationLabel; +import org.openehealth.ipf.commons.ihe.xds.core.metadata.AssociationType; import org.openehealth.ipf.commons.ihe.xds.core.metadata.DocumentEntry; import org.openehealth.ipf.commons.ihe.xds.core.metadata.Folder; import org.openehealth.ipf.commons.ihe.xds.core.metadata.ObjectReference; @@ -46,69 +57,120 @@ public QueryResponse processQuery(QueryRegistry query) { var response = new QueryResponse(Status.SUCCESS); - var fhirDocuments = visitor.getDocumentsFromResult(); - var fhirSubmissions = visitor.getSubmissionSetsFrom(); - var fhirFolder = visitor.getFoldersFrom(); - var xdsDocuments = new ArrayList(); - var xdsSubmissionSets = new ArrayList(); - var xdsFolders = new ArrayList(); + var fhirDocuments = mapDocuments(response, visitor.getDocumentsFromResult()); + var fhirSubmissions = mapSubmissionSets(response, visitor.getSubmissionSetsFrom()); + var fhirFolder = mapFolder(response, visitor.getFoldersFrom()); + response.getAssociations().addAll(createAssociationsFrom(fhirSubmissions, fhirDocuments)); + response.getAssociations().addAll(createAssociationsFrom(fhirSubmissions, fhirFolder)); + response.getAssociations().addAll(createAssociationsFrom(fhirFolder, fhirDocuments)); + // TODO: SS-FD-association is missing + // TODO: Doc-Doc association is missing - int currentResourceCount = 0; + if (query.getReturnType().equals(QueryReturnType.OBJECT_REF)) { + response.setReferences(Stream + .concat(Stream.concat(response.getDocumentEntries().stream(), + response.getSubmissionSets().stream()), response.getFolders().stream()) + .map(xdsObject -> new ObjectReference(xdsObject.getEntryUuid())).collect(Collectors.toList())); + response.getDocumentEntries().clear(); + response.getSubmissionSets().clear(); + response.getFolders().clear(); + } + + return response; + } + + private Collection createAssociationsFrom(List lists, + List fhirDocuments) { + var xdsAssocations = new ArrayList(); + for (var list : lists) { + for (var entry : list.getEntry()) { + for (var doc : fhirDocuments) { + if (doc.getId().contains(entry.getItem().getReference())) { + var targetId = entryUuidFrom(doc); + var sourceId = entryUuidFrom(list); + if (targetId != null && sourceId != null) { + Association submissionAssociation = new Association(AssociationType.HAS_MEMBER, + new URN(UUID.randomUUID()).toString(), sourceId, targetId); + submissionAssociation.setLabel(AssociationLabel.ORIGINAL); + xdsAssocations.add(submissionAssociation); + } + } + } + } + } + return xdsAssocations; + } - for (DocumentReference document : fhirDocuments) { - if (currentResourceCount > maxResultCount) { - response.setStatus(Status.PARTIAL_SUCCESS); - response.setErrors(Collections.singletonList(new ErrorInfo(ErrorCode.TOO_MANY_RESULTS, - "Result exceed maximum of " + maxResultCount, Severity.WARNING, null, null))); + private List mapFolder(QueryResponse response, Iterable fhirFolder) { + var processedFhirFolders = new ArrayList(); + for (var folder : fhirFolder) { + if (evaluateMaxCount(response)) { break; } - var xdsDoc = documentMapper.apply(document); - if (xdsDoc != null) { - assignDefaultVersioning().accept(xdsDoc); - xdsDocuments.add(xdsDoc); - currentResourceCount++; + var xdsFolder = folderMapper.apply(folder); + if (xdsFolder != null) { + assignDefaultVersioning().accept(xdsFolder); + response.getFolders().add(xdsFolder); + processedFhirFolders.add(folder); } } + return processedFhirFolders; + } - for (MhdSubmissionSet submissionset : fhirSubmissions) { - if (currentResourceCount > maxResultCount) { - response.setStatus(Status.PARTIAL_SUCCESS); - response.setErrors(Collections.singletonList(new ErrorInfo(ErrorCode.TOO_MANY_RESULTS, - "Result exceed maximum of " + maxResultCount, Severity.WARNING, null, null))); + private List mapSubmissionSets(QueryResponse response, Iterable fhirSubmissions) { + var processedFhirSubmissions = new ArrayList(); + for (var submissionset : fhirSubmissions) { + if (evaluateMaxCount(response)) { break; } var xdsSubmission = submissionMapper.apply(submissionset); if (xdsSubmission != null) { assignDefaultVersioning().accept(xdsSubmission); - xdsSubmissionSets.add(xdsSubmission); - currentResourceCount++; + response.getSubmissionSets().add(xdsSubmission); + processedFhirSubmissions.add(submissionset); } } + return processedFhirSubmissions; + } - for (MhdFolder folder : fhirFolder) { - if (currentResourceCount > maxResultCount) { - response.setStatus(Status.PARTIAL_SUCCESS); - response.setErrors(Collections.singletonList(new ErrorInfo(ErrorCode.TOO_MANY_RESULTS, - "Result exceed maximum of " + maxResultCount, Severity.WARNING, null, null))); + private List mapDocuments(QueryResponse response, Iterable fhirDocuments) { + var processedFhirDocs = new ArrayList(); + for (var document : fhirDocuments) { + if (evaluateMaxCount(response)) { break; } - var xdsFolder = folderMapper.apply(folder); - if (xdsFolder != null) { - assignDefaultVersioning().accept(xdsFolder); - xdsFolders.add(xdsFolder); - currentResourceCount++; + var xdsDoc = documentMapper.apply(document); + if (xdsDoc != null) { + assignDefaultVersioning().accept(xdsDoc); + response.getDocumentEntries().add(xdsDoc); + processedFhirDocs.add(document); } } + return processedFhirDocs; + } - if (query.getReturnType().equals(QueryReturnType.LEAF_CLASS)) { - response.setDocumentEntries(xdsDocuments); - response.setSubmissionSets(xdsSubmissionSets); + private String entryUuidFrom(IBaseResource resource) { + List identifier; + if (resource instanceof DocumentReference) { + identifier = ((DocumentReference) resource).getIdentifier(); + } else if (resource instanceof ListResource) { + identifier = ((ListResource) resource).getIdentifier(); } else { - response.setReferences(Stream.concat(xdsDocuments.stream(), xdsSubmissionSets.stream()) - .map(xdsObject -> new ObjectReference(xdsObject.getEntryUuid())).collect(Collectors.toList())); + return null; } + return identifier.stream().filter(id -> Identifier.IdentifierUse.OFFICIAL.equals(id.getUse())).findFirst() + .orElse(identifier.stream().findFirst().orElse(new Identifier())).getValue(); + } - return response; + private boolean evaluateMaxCount(QueryResponse response) { + int currentResourceCount = response.getDocumentEntries().size() + response.getSubmissionSets().size() + response.getFolders().size(); + if (currentResourceCount > maxResultCount) { + response.setStatus(Status.PARTIAL_SUCCESS); + response.setErrors(Collections.singletonList(new ErrorInfo(ErrorCode.TOO_MANY_RESULTS, + "Result exceed maximum of " + maxResultCount, Severity.WARNING, null, null))); + return true; + } + return false; } /** diff --git a/src/main/java/org/openehealth/app/xdstofhir/registry/register/RegisterDocumentsProcessor.java b/src/main/java/org/openehealth/app/xdstofhir/registry/register/RegisterDocumentsProcessor.java index 80c78f9..1ab8f79 100644 --- a/src/main/java/org/openehealth/app/xdstofhir/registry/register/RegisterDocumentsProcessor.java +++ b/src/main/java/org/openehealth/app/xdstofhir/registry/register/RegisterDocumentsProcessor.java @@ -3,7 +3,13 @@ import static org.openehealth.app.xdstofhir.registry.common.MappingSupport.OID_URN; import static org.openehealth.app.xdstofhir.registry.common.MappingSupport.URI_URN; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.BiFunction; import java.util.function.Function; +import java.util.stream.Collectors; import ca.uhn.fhir.rest.api.CacheControlDirective; import ca.uhn.fhir.rest.client.api.IGenericClient; @@ -13,11 +19,14 @@ import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.DocumentReference; import org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus; +import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.Reference; import org.openehealth.app.xdstofhir.registry.common.MappingSupport; import org.openehealth.app.xdstofhir.registry.common.RegistryConfiguration; import org.openehealth.app.xdstofhir.registry.common.fhir.MhdFolder; import org.openehealth.app.xdstofhir.registry.common.fhir.MhdSubmissionSet; +import org.openehealth.ipf.commons.ihe.xds.core.metadata.Association; import org.openehealth.ipf.commons.ihe.xds.core.metadata.AssociationType; import org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus; import org.openehealth.ipf.commons.ihe.xds.core.metadata.DocumentEntry; @@ -37,21 +46,20 @@ public class RegisterDocumentsProcessor implements Iti42Service { private final IGenericClient client; private final Function documentMapper; - private final Function submissionSetMapper; - private final Function folderMapper; + private final BiFunction, MhdSubmissionSet> submissionSetMapper; + private final BiFunction, MhdFolder> folderMapper; private final RegistryConfiguration registryConfig; @Override public Response processRegister(RegisterDocumentSet register) { - BundleBuilder builder = new BundleBuilder(client.getFhirContext()); - validateKnownRepository(register); - register.getDocumentEntries().forEach(this::assignRegistryValues); + register.getDocumentEntries().forEach(doc -> assignRegistryValues(doc, register.getAssociations())); register.getDocumentEntries().forEach(this::assignPatientId); - register.getFolders().forEach(this::assignRegistryValues); + register.getFolders().forEach(folder -> assignRegistryValues(folder, register.getAssociations())); register.getFolders().forEach(this::assignPatientId); assignPatientId(register.getSubmissionSet()); - assignRegistryValues(register.getSubmissionSet()); + assignRegistryValues(register.getSubmissionSet(), register.getAssociations()); + var builder = new BundleBuilder(client.getFhirContext()); register.getAssociations().stream().filter(assoc -> assoc.getAssociationType() == AssociationType.REPLACE) .forEach(assoc -> builder.addTransactionUpdateEntry(replacePreviousDocument(assoc.getTargetUuid(), register.getDocumentEntries().stream() @@ -59,8 +67,17 @@ public Response processRegister(RegisterDocumentSet register) { .orElseThrow(() -> new XDSMetaDataException(ValidationMessage.UNRESOLVED_REFERENCE, assoc.getSourceUuid()))))); register.getDocumentEntries().forEach(doc -> builder.addTransactionCreateEntry(documentMapper.apply(doc))); - register.getFolders().forEach(folder -> builder.addTransactionCreateEntry(folderMapper.apply(folder))); - builder.addTransactionCreateEntry(submissionSetMapper.apply(register.getSubmissionSet())); + + var documentMap = register.getDocumentEntries().stream() + .collect(Collectors.toMap(DocumentEntry::getEntryUuid, Function.identity())); + + var folderReferences = createReferences(register.getAssociations(), documentMap, + register.getFolders().stream().map(XDSMetaClass::getEntryUuid).collect(Collectors.toList())); + register.getFolders().forEach(folder -> builder.addTransactionCreateEntry(folderMapper.apply(folder, folderReferences))); + + var submissionReferences = createReferences(register.getAssociations(), documentMap, + Collections.singletonList(register.getSubmissionSet().getEntryUuid())); + builder.addTransactionCreateEntry(submissionSetMapper.apply(register.getSubmissionSet(), submissionReferences)); // Execute the transaction client.transaction().withBundle(builder.getBundle()).execute(); @@ -68,6 +85,25 @@ public Response processRegister(RegisterDocumentSet register) { return new Response(Status.SUCCESS); } + /** + * Build the references for the given assocations, where the sourceId is ony of sourceId and the target is one of the docs from the + * documentMap. + * + * @param associations + * @param documentMap + * @param sourceId + * @return the List of FHIR references. + */ + private List createReferences(List associations, Map documentMap, + List sourceId) { + return associations.stream() + .filter(assoc -> sourceId.contains(assoc.getSourceUuid())) + .map(assoc -> documentMap.get(assoc.getTargetUuid())).filter(Objects::nonNull) + .map(document -> new Reference( + new IdType(DocumentReference.class.getSimpleName(), document.getEntryUuid()))) + .collect(Collectors.toList()); + } + /** * Perform replace according to https://profiles.ihe.net/ITI/TF/Volume2/ITI-42.html#3.42.4.1.3.5 * @@ -103,9 +139,14 @@ private void validateKnownRepository(RegisterDocumentSet register) { }); } - private void assignRegistryValues(XDSMetaClass xdsObject) { + private void assignRegistryValues(XDSMetaClass xdsObject, List associations) { if (!xdsObject.getEntryUuid().startsWith(MappingSupport.UUID_URN)) { + var previousIdentifier = xdsObject.getEntryUuid(); xdsObject.assignEntryUuid(); + associations.stream().forEach(assoc -> { + assoc.setSourceUuid(assoc.getSourceUuid().replace(previousIdentifier, xdsObject.getEntryUuid())); + assoc.setTargetUuid(assoc.getTargetUuid().replace(previousIdentifier, xdsObject.getEntryUuid())); + });; } xdsObject.setAvailabilityStatus(AvailabilityStatus.APPROVED); } diff --git a/src/test/java/org/openehealth/app/xdstofhir/registry/common/mapper/FhirToXdsSubmissionsetMapperTest.java b/src/test/java/org/openehealth/app/xdstofhir/registry/common/mapper/FhirToXdsSubmissionsetMapperTest.java index db10558..fdd7f82 100644 --- a/src/test/java/org/openehealth/app/xdstofhir/registry/common/mapper/FhirToXdsSubmissionsetMapperTest.java +++ b/src/test/java/org/openehealth/app/xdstofhir/registry/common/mapper/FhirToXdsSubmissionsetMapperTest.java @@ -5,8 +5,12 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; +import java.util.Collections; +import java.util.List; +import java.util.function.BiFunction; import java.util.function.Function; +import org.hl7.fhir.r4.model.Reference; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openehealth.app.xdstofhir.registry.common.fhir.MhdSubmissionSet; @@ -17,7 +21,7 @@ import org.openehealth.ipf.commons.xml.XmlUtils; class FhirToXdsSubmissionsetMapperTest { - private Function xdsToFire; + private BiFunction, MhdSubmissionSet> xdsToFire; private Function fireToXds; @BeforeEach @@ -36,7 +40,7 @@ void verifyBirectionalMapping() throws JAXBException { } private void verifyFhirXdsMapping(SubmissionSet testSubmission) throws JAXBException { - MhdSubmissionSet mappedFhirSubmission = xdsToFire.apply(testSubmission); + MhdSubmissionSet mappedFhirSubmission = xdsToFire.apply(testSubmission, Collections.emptyList()); SubmissionSet reverseMappedSubmission = fireToXds.apply(mappedFhirSubmission); String transformedSubmission = XmlUtils.renderJaxb(JAXBContext.newInstance(SubmissionSet.class), reverseMappedSubmission, true); diff --git a/src/test/java/org/openehealth/app/xdstofhir/registry/common/mapper/FolderMappingImplTest.java b/src/test/java/org/openehealth/app/xdstofhir/registry/common/mapper/FolderMappingImplTest.java index e77d939..1fc35ec 100644 --- a/src/test/java/org/openehealth/app/xdstofhir/registry/common/mapper/FolderMappingImplTest.java +++ b/src/test/java/org/openehealth/app/xdstofhir/registry/common/mapper/FolderMappingImplTest.java @@ -5,8 +5,12 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; +import java.util.Collections; +import java.util.List; +import java.util.function.BiFunction; import java.util.function.Function; +import org.hl7.fhir.r4.model.Reference; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openehealth.app.xdstofhir.registry.common.fhir.MhdFolder; @@ -17,7 +21,7 @@ import org.openehealth.ipf.commons.xml.XmlUtils; class FolderMappingImplTest { - private Function xdsToFire; + private BiFunction, MhdFolder> xdsToFire; private Function fireToXds; @BeforeEach @@ -34,7 +38,7 @@ void verifyBirectionalMapping() throws JAXBException { } private void verifyFhirXdsMapping(Folder testFolder) throws JAXBException { - MhdFolder mappedFhirFolder = xdsToFire.apply(testFolder); + MhdFolder mappedFhirFolder = xdsToFire.apply(testFolder, Collections.emptyList()); Folder reverseMappedFolder = fireToXds.apply(mappedFhirFolder); String transformedFolder = XmlUtils.renderJaxb(JAXBContext.newInstance(Folder.class), reverseMappedFolder, true);