validation related updates for IG publication

This commit is contained in:
Grahame Grieve 2019-04-09 14:24:05 +10:00
parent c502aad9ba
commit 0dad5ac58e
2 changed files with 37 additions and 12 deletions

View File

@ -2915,28 +2915,52 @@ public class VersionConvertor_30_50 {
throw new FHIRException("Unknown type "+src.fhirType()); throw new FHIRException("Unknown type "+src.fhirType());
} }
private static void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException { private static void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt, String... extensionsToIgnore) throws FHIRException {
copyResource(src, tgt); copyResource(src, tgt);
if (src.hasText()) if (src.hasText())
tgt.setText(convertNarrative(src.getText())); tgt.setText(convertNarrative(src.getText()));
for (org.hl7.fhir.dstu3.model.Resource t1 : src.getContained()) for (org.hl7.fhir.dstu3.model.Resource t1 : src.getContained())
tgt.addContained(convertResource(t1, false)); tgt.addContained(convertResource(t1, false));
for (org.hl7.fhir.dstu3.model.Extension t2 : src.getExtension()) for (org.hl7.fhir.dstu3.model.Extension t2 : src.getExtension()) {
boolean ok = true;
for (String s : extensionsToIgnore)
if (s.equals(t2.getUrl()))
ok = false;
if (ok)
tgt.addExtension(convertExtension(t2)); tgt.addExtension(convertExtension(t2));
for (org.hl7.fhir.dstu3.model.Extension t3 : src.getModifierExtension()) }
for (org.hl7.fhir.dstu3.model.Extension t3 : src.getModifierExtension()) {
boolean ok = true;
for (String s : extensionsToIgnore)
if (s.equals(t3.getUrl()))
ok = false;
if (ok)
tgt.addModifierExtension(convertExtension(t3)); tgt.addModifierExtension(convertExtension(t3));
} }
private static void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException { }
private static void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.dstu3.model.DomainResource tgt, String... extensionsToIgnore) throws FHIRException {
copyResource(src, tgt); copyResource(src, tgt);
if (src.hasText()) if (src.hasText())
tgt.setText(convertNarrative(src.getText())); tgt.setText(convertNarrative(src.getText()));
for (org.hl7.fhir.r5.model.Resource t1 : src.getContained()) for (org.hl7.fhir.r5.model.Resource t1 : src.getContained())
tgt.addContained(convertResource(t1, false)); tgt.addContained(convertResource(t1, false));
for (org.hl7.fhir.r5.model.Extension t2 : src.getExtension()) for (org.hl7.fhir.r5.model.Extension t2 : src.getExtension()) {
boolean ok = true;
for (String s : extensionsToIgnore)
if (s.equals(t2.getUrl()))
ok = false;
if (ok)
tgt.addExtension(convertExtension(t2)); tgt.addExtension(convertExtension(t2));
for (org.hl7.fhir.r5.model.Extension t3 : src.getModifierExtension()) }
for (org.hl7.fhir.r5.model.Extension t3 : src.getModifierExtension()) {
boolean ok = true;
for (String s : extensionsToIgnore)
if (s.equals(t3.getUrl()))
ok = false;
if (ok)
tgt.addModifierExtension(convertExtension(t3)); tgt.addModifierExtension(convertExtension(t3));
} }
}
public static org.hl7.fhir.r5.model.Parameters convertParameters(org.hl7.fhir.dstu3.model.Parameters src) throws FHIRException { public static org.hl7.fhir.r5.model.Parameters convertParameters(org.hl7.fhir.dstu3.model.Parameters src) throws FHIRException {
if (src == null) if (src == null)
return null; return null;
@ -19794,7 +19818,7 @@ public class VersionConvertor_30_50 {
if (src == null) if (src == null)
return null; return null;
org.hl7.fhir.r5.model.ValueSet tgt = new org.hl7.fhir.r5.model.ValueSet(); org.hl7.fhir.r5.model.ValueSet tgt = new org.hl7.fhir.r5.model.ValueSet();
copyDomainResource(src, tgt); copyDomainResource(src, tgt, "http://hl7.org/fhir/StructureDefinition/valueset-extensible");
if (src.hasUrl()) if (src.hasUrl())
tgt.setUrl(src.getUrl()); tgt.setUrl(src.getUrl());
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
@ -19840,7 +19864,7 @@ public class VersionConvertor_30_50 {
if (src == null) if (src == null)
return null; return null;
org.hl7.fhir.dstu3.model.ValueSet tgt = new org.hl7.fhir.dstu3.model.ValueSet(); org.hl7.fhir.dstu3.model.ValueSet tgt = new org.hl7.fhir.dstu3.model.ValueSet();
copyDomainResource(src, tgt); copyDomainResource(src, tgt, "http://hl7.org/fhir/StructureDefinition/valueset-extensible");
if (src.hasUrl()) if (src.hasUrl())
tgt.setUrl(src.getUrl()); tgt.setUrl(src.getUrl());
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())

View File

@ -1467,7 +1467,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
// now, do we check the URI target? // now, do we check the URI target?
if (fetcher != null) { if (fetcher != null) {
rule(errors, IssueType.INVALID, e.line(), e.col(), path, fetcher.resolveURL(appContext, path, e.primitiveValue()), "URL value '"+e.primitiveValue()+"' does not resolve"); boolean found = fetcher.resolveURL(appContext, path, e.primitiveValue());
rule(errors, IssueType.INVALID, e.line(), e.col(), path, found, "URL value '"+e.primitiveValue()+"' does not resolve");
} }
} }
if (type.equals("id")) { if (type.equals("id")) {