Fix issue where .resolve() in FHIRPath didn't work with URL values (and fix typo in i18n system)

This commit is contained in:
Grahame Grieve 2023-10-24 17:37:01 +11:00
parent be9f5e0d36
commit 103984c10e
3 changed files with 9 additions and 3 deletions

View File

@ -3632,7 +3632,7 @@ public class FHIRPathEngine {
}
private void checkContextReference(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException {
if (!focus.hasType(worker, "string") && !focus.hasType(worker, "uri") && !focus.hasType(worker, "Reference") && !focus.hasType(worker, "canonical")) {
if (!focus.hasType(worker, "string") && !focus.hasType(worker, "uri") && !focus.hasType(worker, "url") && !focus.hasType(worker, "Reference") && !focus.hasType(worker, "canonical")) {
throw makeException(expr, I18nConstants.FHIRPATH_REFERENCE_ONLY, name, focus.describe());
}
}

View File

@ -10,7 +10,13 @@ public class ResourceSorters {
@Override
public int compare(CanonicalResource arg0, CanonicalResource arg1) {
return arg0.getUrl().compareTo(arg1.getUrl());
if (arg0.getUrl() != null) {
return arg0.getUrl().compareTo(arg1.getUrl());
} else if (arg1.getUrl() != null) {
return -arg1.getUrl().compareTo(arg0.getUrl());
} else {
return 0;
}
}
}

View File

@ -177,7 +177,7 @@ public class I18nConstants {
public static final String FHIRPATH_ORDERED_ONLY = "FHIRPATH_ORDERED_ONLY";
public static final String FHIRPATH_PARAM_WRONG = "FHIRPATH_PARAM_WRONG";
public static final String FHIRPATH_PRIMITIVE_ONLY = "FHIRPATH_PRIMITIVE_ONLY";
public static final String FHIRPATH_REFERENCE_ONLY = "FHIRPATH_ORDERED_ONLY";
public static final String FHIRPATH_REFERENCE_ONLY = "FHIRPATH_REFERENCE_ONLY";
public static final String FHIRPATH_RESOLVE_DISCRIMINATOR_CANT_FIND = "FHIRPATH_RESOLVE_DISCRIMINATOR_CANT_FIND";
public static final String FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET = "FHIRPATH_RESOLVE_DISCRIMINATOR_NO_TARGET";
public static final String FHIRPATH_RIGHT_VALUE = "FHIRPATH_RIGHT_VALUE";