-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,839 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/org/openehealth/app/xdstofhir/registry/common/fhir/MhdFolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.openehealth.app.xdstofhir.registry.common.fhir; | ||
|
||
import java.util.List; | ||
|
||
import ca.uhn.fhir.model.api.annotation.Child; | ||
import ca.uhn.fhir.model.api.annotation.Description; | ||
import ca.uhn.fhir.model.api.annotation.Extension; | ||
import ca.uhn.fhir.model.api.annotation.ResourceDef; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.hl7.fhir.r4.model.CodeableConcept; | ||
import org.hl7.fhir.r4.model.Coding; | ||
import org.hl7.fhir.r4.model.ListResource; | ||
import org.openehealth.app.xdstofhir.registry.common.MappingSupport; | ||
|
||
@ResourceDef(name = "List", profile = MappingSupport.MHD_COMPREHENSIVE_FOLDER_PROFILE) | ||
public class MhdFolder extends ListResource { | ||
private static final long serialVersionUID = 6730967324453182475L; | ||
|
||
public static final CodeableConcept FOLDER_CODEING = new CodeableConcept( | ||
new Coding("https://profiles.ihe.net/ITI/MHD/CodeSystem/MHDlistTypes", "folder", | ||
"Folder as a FHIR List")); | ||
|
||
public MhdFolder() { | ||
super(); | ||
setCode(FOLDER_CODEING); | ||
setStatus(ListStatus.CURRENT); | ||
setMode(ListMode.WORKING); | ||
} | ||
|
||
@Child(name = "designationType", type = {CodeableConcept.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) | ||
@Extension(url = "https://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-designationType", definedLocally = false, isModifier = false) | ||
@Description(shortDefinition = "Clinical code of the List") | ||
@Getter @Setter | ||
private List<CodeableConcept> designationType; | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...main/java/org/openehealth/app/xdstofhir/registry/common/mapper/XdsToFhirFolderMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.openehealth.app.xdstofhir.registry.common.mapper; | ||
|
||
import java.util.Collections; | ||
import java.util.function.Function; | ||
import java.util.stream.Collectors; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.hl7.fhir.r4.model.Annotation; | ||
import org.hl7.fhir.r4.model.Identifier; | ||
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; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class XdsToFhirFolderMapper extends AbstractXdsToFhirMapper | ||
implements Function<Folder, MhdFolder> { | ||
@Override | ||
public MhdFolder apply(Folder xdFolder) { | ||
var mhdList = new MhdFolder(); | ||
mhdList.addIdentifier(fromIdentifier(xdFolder.getEntryUuid(), Identifier.IdentifierUse.OFFICIAL)); | ||
mhdList.addIdentifier( | ||
fromIdentifier(MappingSupport.OID_URN + xdFolder.getUniqueId(), Identifier.IdentifierUse.USUAL)); | ||
mhdList.setSubject(patientReferenceFrom(xdFolder)); | ||
mhdList.setDateElement(fromTimestamp(xdFolder.getLastUpdateTime())); | ||
mhdList.setDesignationType(xdFolder.getCodeList().stream().map(this::fromCode).collect(Collectors.toList())); | ||
if (xdFolder.getTitle() != null) | ||
mhdList.setTitle(xdFolder.getTitle().getValue()); | ||
if (xdFolder.getComments() != null) { | ||
Annotation annotation = new Annotation(); | ||
annotation.setText(xdFolder.getComments().getValue()); | ||
mhdList.setNote(Collections.singletonList(annotation)); | ||
} | ||
return mhdList; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.