diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/QuestionnaireMode.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/QuestionnaireMode.java index 06af19748..4d3ca4faf 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/QuestionnaireMode.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/QuestionnaireMode.java @@ -1,7 +1,26 @@ package org.hl7.fhir.validation.cli.utils; +import org.hl7.fhir.utilities.Utilities; + public enum QuestionnaireMode { NONE, CHECK, - REQUIRED + REQUIRED; + + public static QuestionnaireMode fromCode(String v) { + if (Utilities.noString(v)) { + return NONE; + } + v = v.toLowerCase(); + if (Utilities.existsInList(v, "none", "ignore")) { + return NONE; + } + if (Utilities.existsInList(v, "check")) { + return CHECK; + } + if (Utilities.existsInList(v, "require", "required")) { + return REQUIRED; + } + return NONE; + } } diff --git a/org.hl7.fhir.validation/src/main/resources/help.txt b/org.hl7.fhir.validation/src/main/resources/help.txt index b39419d5f..bf0d13dbe 100644 --- a/org.hl7.fhir.validation/src/main/resources/help.txt +++ b/org.hl7.fhir.validation/src/main/resources/help.txt @@ -41,7 +41,12 @@ The following parameters are supported: Note: the profile (and it's dependencies) have to be made available through one of the -ig parameters. Note that package dependencies will automatically be resolved --questionnaire [file|url}: the location of a questionnaire. If provided, then the validator will validate +-questionnaire mode: what to do with when validating QuestionnaireResponse resources + none (default): just ignore the questionnaire reference + required: check that the QuestionnaireResponse has a questionnaire and validate against it + check: if the QuestionnaireResponse has a questionnaire, validate against it + The questionnaire must be loaded using the -ig parameter +the location of a questionnaire. If provided, then the validator will validate any QuestionnaireResponse that claims to match the Questionnaire against it no default value. This parameter can appear any number of times -output [file]: a filename for the results (OperationOutcome)