From c5f4d2396f4baceb8824b8ee9169fcc056a154a6 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 13 Aug 2020 14:28:28 +1000 Subject: [PATCH] more work on code validation --- .../r5/terminologies/ValueSetCheckerSimple.java | 13 ++++++++++--- .../instance/type/QuestionnaireValidator.java | 1 - 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java index d885ca2fb..ae9f901f7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java @@ -159,13 +159,20 @@ public class ValueSetCheckerSimple implements ValueSetChecker { } if (cs != null /*&& (cs.getContent() == CodeSystemContentMode.COMPLETE || cs.getContent() == CodeSystemContentMode.FRAGMENT)*/) { + if (!(cs.getContent() == CodeSystemContentMode.COMPLETE || cs.getContent() == CodeSystemContentMode.FRAGMENT)) { + // we can't validate that here. + throw new FHIRException("Unable to evaluate based on empty code system"); + } res = validateCode(code, cs); } else { - // it's in the expansion, but we could find it in a code system - res = findCodeInExpansion(code); + // well, we didn't find a code system - try the expansion? + // disabled waiting for discussion + throw new Error("No try the server"); } } else { - inExpansion = checkExpansion(code); + // disabled waiting for discussion + throw new Error("No try the server"); +// inExpansion = checkExpansion(code); } // then, if we have a value set, we check it's in the value set diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java index 227d68f94..492a689af 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java @@ -180,7 +180,6 @@ public class QuestionnaireValidator extends BaseValidator { } } if (hint(errors, IssueType.REQUIRED, element.line(), element.col(), stack.getLiteralPath(), questionnaire != null, I18nConstants.QUESTIONNAIRE_QR_Q_NONE)) { - long t = System.nanoTime(); Questionnaire qsrc = questionnaire.startsWith("#") ? loadQuestionnaire(element, questionnaire.substring(1)) : context.fetchResource(Questionnaire.class, questionnaire); if (warning(errors, IssueType.REQUIRED, q.line(), q.col(), stack.getLiteralPath(), qsrc != null, I18nConstants.QUESTIONNAIRE_QR_Q_NOTFOUND, questionnaire)) { boolean inProgress = "in-progress".equals(element.getNamedChildValue("status"));