Merge pull request #693 from hapifhir/gg-202112-3986-id

fix up determination criteria for IRIs on identifiers in urn:ietf:rfc…
This commit is contained in:
dotasek 2021-12-17 17:22:53 -05:00 committed by GitHub
commit ca591295fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -1,6 +1,8 @@
Validator:
* check StructureDefinition derivation consistency
* fix bug looking for contained resources inside bundles
* fix up determination criteria for IRIs on identifiers in urn:ietf:rfc:3986
Other code changes:
* Add support for new FHIR releases
* Fix escaping bug in graphQL encoder

View File

@ -3490,8 +3490,22 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
return fmt.length() > 10 && (fmt.substring(10).contains("-") || fmt.substring(10).contains("+") || fmt.substring(10).contains("Z"));
}
private boolean isAbsolute(String uri, String... protocols) {
return Utilities.noString(uri) || uri.startsWith("http:") || uri.startsWith("https:") || uri.startsWith("urn:");
private boolean isAbsolute(String uri) {
String protocol = null;
String tail = null;
if (uri.contains(":")) {
protocol = uri.substring(0, uri.indexOf(":"));
tail = uri.substring(uri.indexOf(":")+1);
}
if (Utilities.isToken(protocol)) {
if ("file".equals(protocol)) {
return tail.startsWith("/") || tail.contains(":");
} else {
return true;
}
} else {
return false;
}
}
private boolean isCodeSystemReferenceValid(String uri) {