From d63e66fa0bb94259ac356a9e3306b53507ad9b7e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 9 May 2024 19:15:10 +1000 Subject: [PATCH] fix bug passing wrong type to tx server when using inferSystem --- .../org/hl7/fhir/r5/context/BaseWorkerContext.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java index e408f6b35..a192597a9 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java @@ -1483,9 +1483,11 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte protected Parameters constructParameters(ValidationOptions options, Coding coding) { Parameters pIn = new Parameters(); - pIn.addParameter().setName("coding").setValue(coding); if (options.isGuessSystem()) { pIn.addParameter().setName("inferSystem").setValue(new BooleanType(true)); + pIn.addParameter().setName("code").setValue(coding.getCodeElement()); + } else { + pIn.addParameter().setName("coding").setValue(coding); } setTerminologyOptions(options, pIn); return pIn; @@ -1500,9 +1502,11 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte protected Parameters constructParameters(ValidationOptions options, CodingValidationRequest codingValidationRequest, ValueSet valueSet) { Parameters pIn = new Parameters(); - pIn.addParameter().setName("coding").setValue(codingValidationRequest.getCoding()); if (options.isGuessSystem()) { pIn.addParameter().setName("inferSystem").setValue(new BooleanType(true)); + pIn.addParameter().setName("code").setValue(codingValidationRequest.getCoding().getCodeElement()); + } else { + pIn.addParameter().setName("coding").setValue(codingValidationRequest.getCoding()); } if (valueSet != null) { pIn.addParameter().setName("valueSet").setResource(valueSet); @@ -1514,9 +1518,11 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte protected Parameters constructParameters(ValidationOptions options, CodingValidationRequest codingValidationRequest, String vsUrl) { Parameters pIn = new Parameters(); - pIn.addParameter().setName("coding").setValue(codingValidationRequest.getCoding()); if (options.isGuessSystem()) { pIn.addParameter().setName("inferSystem").setValue(new BooleanType(true)); + pIn.addParameter().setName("code").setValue(codingValidationRequest.getCoding().getCodeElement()); + } else { + pIn.addParameter().setName("coding").setValue(codingValidationRequest.getCoding()); } if (vsUrl != null) { pIn.addParameter().setName("url").setValue(new CanonicalType(vsUrl));