From ee7dc203f6b61f7445af9223e4f9710cc557ae8d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 7 Nov 2024 22:15:54 +1030 Subject: [PATCH] List measure choices when a match by version can't be found --- .../validation/instance/type/MeasureValidator.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/MeasureValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/MeasureValidator.java index ce526675e..2333cfc78 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/MeasureValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/MeasureValidator.java @@ -237,6 +237,17 @@ public class MeasureValidator extends BaseValidator { NodeStack ns = stack.push(m, -1, m.getProperty().getDefinition(), m.getProperty().getDefinition()); hint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, m.line(), m.col(), ns.getLiteralPath(), Utilities.existsInList(mc.scoring(), "proportion", "ratio", "continuous-variable", "cohort"), I18nConstants.MEASURE_MR_M_SCORING_UNK); ok = validateMeasureReportGroups(hostContext, mc, errors, element, stack, inComplete) && ok; + } else { + if (measure.contains("|")) { + List versionList = context.fetchResourcesByUrl(Measure.class, measure.substring(0, measure.indexOf("|"))); + if (versionList != null && !versionList.isEmpty()) { + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); + for (Measure mm : versionList) { + b.append(mm.getVersion()); + } + hint(errors, NO_RULE_DATE, IssueType.INFORMATIONAL, m.line(), m.col(), stack.getLiteralPath(), msrc != null, I18nConstants.CANONICAL_MULTIPLE_VERSIONS_KNOWN, "Measure", measure, measure.substring(measure.indexOf("|")+1), b.toString()); + } + } } } return ok;