Improve message when there's multiple display options

This commit is contained in:
Grahame Grieve 2023-06-05 21:15:31 +02:00
parent bf19a2d2fa
commit 1c4ef1fa00
2 changed files with 6 additions and 6 deletions

View File

@ -665,16 +665,16 @@ public class ValueSetValidator {
if (code.getDisplay() == null) {
return new ValidationResult(code.getSystem(), cs.getVersion(), cc, vc.getDisplay());
}
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(", ", " or ");
if (cc.hasDisplay() && isOkLanguage(cs.getLanguage())) {
b.append(cc.getDisplay());
b.append("'"+cc.getDisplay()+"'");
if (code.getDisplay().equalsIgnoreCase(cc.getDisplay())) {
return new ValidationResult(code.getSystem(), cs.getVersion(), cc, getPreferredDisplay(cc, cs));
}
}
for (ConceptDefinitionDesignationComponent ds : cc.getDesignation()) {
if (isOkLanguage(ds.getLanguage())) {
b.append(ds.getValue());
b.append("'"+ds.getValue()+"'");
if (code.getDisplay().equalsIgnoreCase(ds.getValue())) {
return new ValidationResult(code.getSystem(),cs.getVersion(), cc, getPreferredDisplay(cc, cs));
}
@ -685,14 +685,14 @@ public class ValueSetValidator {
ConceptReferencePair vs = findValueSetRef(code.getSystem(), code.getCode());
if (vs != null && (vs.getCc().hasDisplay() ||vs.getCc().hasDesignation())) {
if (vs.getCc().hasDisplay() && isOkLanguage(vs.getValueset().getLanguage())) {
b.append(vs.getCc().getDisplay());
b.append("'"+vs.getCc().getDisplay()+"'");
if (code.getDisplay().equalsIgnoreCase(vs.getCc().getDisplay())) {
return new ValidationResult(code.getSystem(), cs.getVersion(), cc, getPreferredDisplay(cc, cs));
}
}
for (ConceptReferenceDesignationComponent ds : vs.getCc().getDesignation()) {
if (isOkLanguage(ds.getLanguage())) {
b.append(ds.getValue());
b.append("'"+ds.getValue()+"'");
if (code.getDisplay().equalsIgnoreCase(ds.getValue())) {
return new ValidationResult(code.getSystem(), cs.getVersion(), cc, getPreferredDisplay(cc, cs));
}

View File

@ -19,7 +19,7 @@
<properties>
<hapi_fhir_version>6.4.1</hapi_fhir_version>
<validator_test_case_version>1.3.8</validator_test_case_version>
<validator_test_case_version>1.3.9-SNAPSHOT</validator_test_case_version>
<jackson_version>2.14.0</jackson_version>
<junit_jupiter_version>5.9.2</junit_jupiter_version>
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>