diff --git a/src/main/java/de/uksh/medic/etl/jobs/mdr/centraxx/CxxMdrAttributes.java b/src/main/java/de/uksh/medic/etl/jobs/mdr/centraxx/CxxMdrAttributes.java index a70553e..41fe092 100644 --- a/src/main/java/de/uksh/medic/etl/jobs/mdr/centraxx/CxxMdrAttributes.java +++ b/src/main/java/de/uksh/medic/etl/jobs/mdr/centraxx/CxxMdrAttributes.java @@ -1,6 +1,6 @@ package de.uksh.medic.etl.jobs.mdr.centraxx; -import de.uksh.medic.etl.model.FhirAttributes; +import de.uksh.medic.etl.model.MappingAttributes; import de.uksh.medic.etl.model.mdr.centraxx.CxxAttributeValue; import de.uksh.medic.etl.model.mdr.centraxx.CxxList; import de.uksh.medic.etl.settings.CxxMdrSettings; @@ -35,7 +35,7 @@ private CxxMdrAttributes() { * @return FhirAttributes object * @throws URISyntaxException */ - public static FhirAttributes getAttributes(CxxMdrSettings mdr, String mdrProfile, String key) + public static MappingAttributes getAttributes(CxxMdrSettings mdr, String mdrProfile, String domain, String key) throws URISyntaxException { if (mdr.isTokenExpired()) { @@ -44,7 +44,7 @@ public static FhirAttributes getAttributes(CxxMdrSettings mdr, String mdrProfile MultiValueMap form = new LinkedMultiValueMap<>(); form.set("code", mdrProfile); - form.set("domainCode", "fhir"); + form.set("domainCode", domain); form.set("itemCode", key); RestTemplate rt = new RestTemplate(); @@ -60,7 +60,7 @@ public static FhirAttributes getAttributes(CxxMdrSettings mdr, String mdrProfile new HttpEntity<>(headers), CxxList.class); CxxList l = response.getBody(); if (l != null && l.getContent() != null) { - FhirAttributes ch = new FhirAttributes(); + MappingAttributes ch = new MappingAttributes(); for (CxxAttributeValue av : l.getContent()) { switch (av.getAttribute()) { case SYSTEM -> ch.setSystem(new URI(av.getValue())); @@ -70,6 +70,7 @@ public static FhirAttributes getAttributes(CxxMdrSettings mdr, String mdrProfile case CONCEPTMAP -> ch.setConceptMap(new URI(av.getValue())); case CODE -> ch.setCode(av.getValue()); case VERSION -> ch.setVersion(av.getValue()); + case PATH -> ch.setPath(av.getValue()); default -> { } } diff --git a/src/main/java/de/uksh/medic/etl/model/FhirAttributes.java b/src/main/java/de/uksh/medic/etl/model/MappingAttributes.java similarity index 84% rename from src/main/java/de/uksh/medic/etl/model/FhirAttributes.java rename to src/main/java/de/uksh/medic/etl/model/MappingAttributes.java index 6602dea..d95f63d 100644 --- a/src/main/java/de/uksh/medic/etl/model/FhirAttributes.java +++ b/src/main/java/de/uksh/medic/etl/model/MappingAttributes.java @@ -2,7 +2,7 @@ import java.net.URI; -public class FhirAttributes { +public class MappingAttributes { private URI system; private URI source; @@ -11,8 +11,9 @@ public class FhirAttributes { private String id; private String code; private String version; + private String path; - public FhirAttributes() { + public MappingAttributes() { } public URI getSystem() { @@ -71,4 +72,12 @@ public void setVersion(String version) { this.version = version; } + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + } diff --git a/src/main/java/de/uksh/medic/etl/model/mdr/MdrAttributes.java b/src/main/java/de/uksh/medic/etl/model/mdr/MdrAttributes.java index 6d227c3..0d24b1b 100644 --- a/src/main/java/de/uksh/medic/etl/model/mdr/MdrAttributes.java +++ b/src/main/java/de/uksh/medic/etl/model/mdr/MdrAttributes.java @@ -34,7 +34,11 @@ public enum MdrAttributes { /** * version attribute in MDR. */ - VERSION("version"); + VERSION("version"), + /** + * version attribute in MDR. + */ + PATH("path"); private final String label;