From d019dee786b9c741a4d10cc348d9b320591f56b4 Mon Sep 17 00:00:00 2001 From: Frank Tao Date: Sun, 6 Sep 2020 16:11:09 -0400 Subject: [PATCH] Added url/conceptMapVersion for ConceptMap to support translate --- .../fhir/jpa/api/model/TranslationQuery.java | 33 ++++++++++++++ .../jpa/api/model/TranslationRequest.java | 43 +++++++++++++++++-- 2 files changed, 73 insertions(+), 3 deletions(-) diff --git a/hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java b/hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java index 6aefcf9ae3a..06bfd9cd07a 100644 --- a/hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java +++ b/hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationQuery.java @@ -23,11 +23,14 @@ package ca.uhn.fhir.jpa.api.model; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.hl7.fhir.r4.model.Coding; +import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.UriType; public class TranslationQuery { private Coding myCoding; private Long myResourceId; + private UriType myUrl; + private StringType myConceptMapVersion; private UriType mySource; private UriType myTarget; private UriType myTargetSystem; @@ -58,6 +61,32 @@ public class TranslationQuery { myResourceId = theResourceId; } + //-- url + public boolean hasUrl() { + return myUrl != null && myUrl.hasValue(); + } + + public UriType getUrl() { + return myUrl; + } + + public void setUrl(UriType theUrl) { + myUrl = theUrl; + } + + //-- ConceptMapVersion + public boolean hasConceptMapVersion() { + return myConceptMapVersion != null && myConceptMapVersion.hasValue(); + } + + public StringType getConceptMapVersion() { + return myConceptMapVersion; + } + + public void setConceptMapVersion(StringType theConceptMapVersion) { + myConceptMapVersion = theConceptMapVersion; + } + public boolean hasSource() { return mySource != null && mySource.hasValue(); } @@ -107,6 +136,8 @@ public class TranslationQuery { .append(getCoding().getSystem(), that.getCoding().getSystem()) .append(getCoding().getVersion(), that.getCoding().getVersion()) .append(getResourceId(), that.getResourceId()) + .append(getUrl(), that.getUrl()) + .append(getConceptMapVersion(), that.getConceptMapVersion()) .append(getSource(), that.getSource()) .append(getTarget(), that.getTarget()) .append(getTargetSystem(), that.getTargetSystem()) @@ -120,6 +151,8 @@ public class TranslationQuery { .append(getCoding().getSystem()) .append(getCoding().getVersion()) .append(getResourceId()) + .append(getUrl()) + .append(getConceptMapVersion()) .append(getSource()) .append(getTarget()) .append(getTargetSystem()) diff --git a/hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java b/hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java index 19d6388b96c..732114732ea 100644 --- a/hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java +++ b/hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/model/TranslationRequest.java @@ -1,5 +1,8 @@ package ca.uhn.fhir.jpa.api.model; +import java.util.ArrayList; +import java.util.List; + /* * #%L * HAPI FHIR JPA API @@ -24,15 +27,15 @@ import org.apache.commons.lang3.Validate; import org.hl7.fhir.r4.model.BooleanType; import org.hl7.fhir.r4.model.CodeableConcept; import org.hl7.fhir.r4.model.Coding; +import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.UriType; -import java.util.ArrayList; -import java.util.List; - public class TranslationRequest { private CodeableConcept myCodeableConcept; private Long myResourceId; private BooleanType myReverse; + private UriType myUrl; + private StringType myConceptMapVersion; private UriType mySource; private UriType myTarget; private UriType myTargetSystem; @@ -90,6 +93,24 @@ public class TranslationRequest { return false; } + public UriType getUrl() { + return myUrl; + } + + public TranslationRequest setUrl(UriType theUrl) { + myUrl = theUrl; + return this; + } + + public StringType getConceptMapVersion() { + return myConceptMapVersion; + } + + public TranslationRequest setConceptMapVersion(StringType theConceptMapVersion) { + myConceptMapVersion = theConceptMapVersion; + return this; + } + public UriType getSource() { return mySource; } @@ -130,6 +151,14 @@ public class TranslationRequest { translationQuery.setResourceId(this.getResourceId()); } + if (this.hasUrl()) { + translationQuery.setUrl(this.getUrl()); + } + + if (this.hasConceptMapVersion()) { + translationQuery.setConceptMapVersion(this.getConceptMapVersion()); + } + if (this.hasSource()) { translationQuery.setSource(this.getSource()); } @@ -156,6 +185,14 @@ public class TranslationRequest { return myReverse != null; } + public boolean hasUrl() { + return myUrl != null && myUrl.hasValue(); + } + + public boolean hasConceptMapVersion() { + return myConceptMapVersion != null && myConceptMapVersion.hasValue(); + } + public boolean hasSource() { return mySource != null && mySource.hasValue(); }