fix validator bug (issue 47)
This commit is contained in:
parent
70ce1ded74
commit
3b76303d83
|
@ -1,7 +1,7 @@
|
||||||
package org.hl7.fhir.convertors.conv40_50;
|
package org.hl7.fhir.convertors.conv40_50;
|
||||||
|
|
||||||
import org.hl7.fhir.exceptions.FHIRException;
|
import org.hl7.fhir.exceptions.FHIRException;
|
||||||
|
import org.hl7.fhir.r5.model.SearchParameter.SearchModifierCodeEnumFactory;
|
||||||
import org.hl7.fhir.convertors.VersionConvertor_40_50;
|
import org.hl7.fhir.convertors.VersionConvertor_40_50;
|
||||||
|
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ public class SearchParameter extends VersionConvertor_40_50 {
|
||||||
public static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> convertSearchModifierCode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> src) throws FHIRException {
|
public static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> convertSearchModifierCode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> src) throws FHIRException {
|
||||||
if (src == null)
|
if (src == null)
|
||||||
return null;
|
return null;
|
||||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode>();
|
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode>(new org.hl7.fhir.r5.model.SearchParameter.SearchModifierCodeEnumFactory());
|
||||||
copyEnumeration(src, tgt);
|
copyEnumeration(src, tgt);
|
||||||
switch (src.getValue()) {
|
switch (src.getValue()) {
|
||||||
case MISSING: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.MISSING);
|
case MISSING: tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.MISSING);
|
||||||
|
@ -245,7 +245,7 @@ public class SearchParameter extends VersionConvertor_40_50 {
|
||||||
public static org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> convertSearchModifierCode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> src) throws FHIRException {
|
public static org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> convertSearchModifierCode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> src) throws FHIRException {
|
||||||
if (src == null)
|
if (src == null)
|
||||||
return null;
|
return null;
|
||||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> tgt = new org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode>();
|
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> tgt = new org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode>(new org.hl7.fhir.r4.model.SearchParameter.SearchModifierCodeEnumFactory());
|
||||||
copyEnumeration(src, tgt);
|
copyEnumeration(src, tgt);
|
||||||
switch (src.getValue()) {
|
switch (src.getValue()) {
|
||||||
case MISSING: tgt.setValue( org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING);
|
case MISSING: tgt.setValue( org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING);
|
||||||
|
|
|
@ -374,8 +374,10 @@ public class ExpressionNode {
|
||||||
b.append(" '");
|
b.append(" '");
|
||||||
b.append(Utilities.escapeJson(q.getUnit()));
|
b.append(Utilities.escapeJson(q.getUnit()));
|
||||||
b.append("'");
|
b.append("'");
|
||||||
} else
|
} else if (constant.primitiveValue() != null)
|
||||||
b.append(Utilities.escapeJson(constant.primitiveValue()));
|
b.append(Utilities.escapeJson(constant.primitiveValue()));
|
||||||
|
else
|
||||||
|
b.append(Utilities.escapeJson(constant.toString()));
|
||||||
break;
|
break;
|
||||||
case Group:
|
case Group:
|
||||||
b.append("(");
|
b.append("(");
|
||||||
|
|
|
@ -114,6 +114,11 @@ public class FHIRPathEngine {
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String primitiveValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ClassTypeInfo extends Base {
|
private class ClassTypeInfo extends Base {
|
||||||
|
|
|
@ -3734,15 +3734,7 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L
|
||||||
|
|
||||||
// System.out.println(" "+stack.getLiteralPath()+" "+Long.toString((System.nanoTime() - time) / 1000000));
|
// System.out.println(" "+stack.getLiteralPath()+" "+Long.toString((System.nanoTime() - time) / 1000000));
|
||||||
// time = System.nanoTime();
|
// time = System.nanoTime();
|
||||||
if (resource.getName().equals("contained")) {
|
checkInvariants(hostContext, errors, profile, definition, resource, element, stack);
|
||||||
NodeStack ancestor = stack;
|
|
||||||
while (!ancestor.element.isResource() || ancestor.element.getName().equals("contained"))
|
|
||||||
ancestor = ancestor.parent;
|
|
||||||
checkInvariants(hostContext, errors, stack.getLiteralPath(), profile, definition, null, null, ancestor.element, element);
|
|
||||||
} else
|
|
||||||
checkInvariants(hostContext, errors, stack.getLiteralPath(), profile, definition, null, null, resource, element);
|
|
||||||
if (definition.getFixed()!=null)
|
|
||||||
checkFixedValue(errors, stack.getLiteralPath(), element, definition.getFixed(), definition.getSliceName(), null);
|
|
||||||
|
|
||||||
|
|
||||||
// get the list of direct defined children, including slices
|
// get the list of direct defined children, including slices
|
||||||
|
@ -3750,7 +3742,6 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L
|
||||||
if (childDefinitions.isEmpty()) {
|
if (childDefinitions.isEmpty()) {
|
||||||
if (actualType == null)
|
if (actualType == null)
|
||||||
return; // there'll be an error elsewhere in this case, and we're going to stop.
|
return; // there'll be an error elsewhere in this case, and we're going to stop.
|
||||||
|
|
||||||
StructureDefinition dt = this.context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + actualType);
|
StructureDefinition dt = this.context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + actualType);
|
||||||
if (dt == null)
|
if (dt == null)
|
||||||
throw new DefinitionException("Unable to resolve actual type " + actualType);
|
throw new DefinitionException("Unable to resolve actual type " + actualType);
|
||||||
|
@ -3758,12 +3749,259 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L
|
||||||
childDefinitions = ProfileUtilities.getChildMap(dt, dt.getSnapshot().getElement().get(0));
|
childDefinitions = ProfileUtilities.getChildMap(dt, dt.getSnapshot().getElement().get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. List the children, and remember their exact path (convenience)
|
List<ElementInfo> children = listChildren(element, stack);
|
||||||
List<ElementInfo> children = new ArrayList<InstanceValidator.ElementInfo>();
|
List<String> problematicPaths = assignChildren(hostContext, errors, profile, resource, stack, childDefinitions, children);
|
||||||
ChildIterator iter = new ChildIterator(stack.getLiteralPath(), element);
|
|
||||||
while (iter.next())
|
|
||||||
children.add(new ElementInfo(iter.name(), iter.element(), iter.path(), iter.count()));
|
|
||||||
|
|
||||||
|
checkCardinalities(errors, profile, element, stack, childDefinitions, children, problematicPaths);
|
||||||
|
// 4. check order if any slices are ordered. (todo)
|
||||||
|
|
||||||
|
// 5. inspect each child for validity
|
||||||
|
for (ElementInfo ei : children) {
|
||||||
|
checkChild(hostContext, errors, profile, definition, resource, element, actualType, stack, inCodeableConcept, checkDisplayInContext, ei);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkChild(ValidatorHostContext hostContext, List<ValidationMessage> errors, StructureDefinition profile, ElementDefinition definition,
|
||||||
|
Element resource, Element element, String actualType, NodeStack stack, boolean inCodeableConcept, boolean checkDisplayInContext, ElementInfo ei)
|
||||||
|
throws FHIRException, IOException, DefinitionException {
|
||||||
|
List<String> profiles = new ArrayList<String>();
|
||||||
|
if (ei.definition != null) {
|
||||||
|
String type = null;
|
||||||
|
ElementDefinition typeDefn = null;
|
||||||
|
|
||||||
|
String usesMustSupport = profile.getUserString("usesMustSupport");
|
||||||
|
if (usesMustSupport == null) {
|
||||||
|
usesMustSupport = "N";
|
||||||
|
for (ElementDefinition pe: profile.getSnapshot().getElement()) {
|
||||||
|
if (pe.getMustSupport()) {
|
||||||
|
usesMustSupport = "Y";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
profile.setUserData("usesMustSupport", usesMustSupport);
|
||||||
|
}
|
||||||
|
if (usesMustSupport.equals("Y")) {
|
||||||
|
String elementSupported = ei.element.getUserString("elementSupported");
|
||||||
|
if (elementSupported==null || ei.definition.getMustSupport())
|
||||||
|
if (ei.definition.getMustSupport())
|
||||||
|
ei.element.setUserData("elementSupported", "Y");
|
||||||
|
else
|
||||||
|
ei.element.setUserData("elementSupported", "N");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ei.definition.getType().size() == 1 && !"*".equals(ei.definition.getType().get(0).getCode()) && !"Element".equals(ei.definition.getType().get(0).getCode())
|
||||||
|
&& !"BackboneElement".equals(ei.definition.getType().get(0).getCode())) {
|
||||||
|
type = ei.definition.getType().get(0).getCode();
|
||||||
|
// Excluding reference is a kludge to get around versioning issues
|
||||||
|
if (ei.definition.getType().get(0).hasProfile())
|
||||||
|
profiles.add(ei.definition.getType().get(0).getProfile().get(0).getValue());
|
||||||
|
|
||||||
|
} else if (ei.definition.getType().size() == 1 && "*".equals(ei.definition.getType().get(0).getCode())) {
|
||||||
|
String prefix = tail(ei.definition.getPath());
|
||||||
|
assert prefix.endsWith("[x]");
|
||||||
|
type = ei.name.substring(prefix.length() - 3);
|
||||||
|
if (isPrimitiveType(type))
|
||||||
|
type = Utilities.uncapitalize(type);
|
||||||
|
// Excluding reference is a kludge to get around versioning issues
|
||||||
|
if (ei.definition.getType().get(0).hasProfile() && !type.equals("Reference"))
|
||||||
|
profiles.add(ei.definition.getType().get(0).getProfile().get(0).getValue());
|
||||||
|
} else if (ei.definition.getType().size() > 1) {
|
||||||
|
|
||||||
|
String prefix = tail(ei.definition.getPath());
|
||||||
|
assert typesAreAllReference(ei.definition.getType()) || ei.definition.hasRepresentation(PropertyRepresentation.TYPEATTR) || prefix.endsWith("[x]") : prefix;
|
||||||
|
|
||||||
|
if (ei.definition.hasRepresentation(PropertyRepresentation.TYPEATTR))
|
||||||
|
type = ei.element.getType();
|
||||||
|
else {
|
||||||
|
prefix = prefix.substring(0, prefix.length() - 3);
|
||||||
|
for (TypeRefComponent t : ei.definition.getType())
|
||||||
|
if ((prefix + Utilities.capitalize(t.getCode())).equals(ei.name)) {
|
||||||
|
type = t.getCode();
|
||||||
|
// Excluding reference is a kludge to get around versioning issues
|
||||||
|
if (t.hasProfile() && !type.equals("Reference"))
|
||||||
|
profiles.add(t.getProfile().get(0).getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == null) {
|
||||||
|
TypeRefComponent trc = ei.definition.getType().get(0);
|
||||||
|
if (trc.getCode().equals("Reference"))
|
||||||
|
type = "Reference";
|
||||||
|
else
|
||||||
|
rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), stack.getLiteralPath(), false,
|
||||||
|
"The type of element " + ei.name + " is not known, which is illegal. Valid types at this point are " + describeTypes(ei.definition.getType()));
|
||||||
|
}
|
||||||
|
} else if (ei.definition.getContentReference() != null) {
|
||||||
|
typeDefn = resolveNameReference(profile.getSnapshot(), ei.definition.getContentReference());
|
||||||
|
} else if (ei.definition.getType().size() == 1 && ("Element".equals(ei.definition.getType().get(0).getCode()) || "BackboneElement".equals(ei.definition.getType().get(0).getCode()))) {
|
||||||
|
if (ei.definition.getType().get(0).hasProfile()) {
|
||||||
|
CanonicalType pu = ei.definition.getType().get(0).getProfile().get(0);
|
||||||
|
if (pu.hasExtension(ToolingExtensions.EXT_PROFILE_ELEMENT))
|
||||||
|
profiles.add(pu.getValue()+"#"+pu.getExtensionString(ToolingExtensions.EXT_PROFILE_ELEMENT));
|
||||||
|
else
|
||||||
|
profiles.add(pu.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type != null) {
|
||||||
|
if (type.startsWith("@")) {
|
||||||
|
ei.definition = findElement(profile, type.substring(1));
|
||||||
|
type = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
NodeStack localStack = stack.push(ei.element, ei.count, ei.definition, type == null ? typeDefn : resolveType(type, ei.definition.getType()));
|
||||||
|
String localStackLiterapPath = localStack.getLiteralPath();
|
||||||
|
String eiPath = ei.path;
|
||||||
|
assert(eiPath.equals(localStackLiterapPath)) : "ei.path: " + ei.path + " - localStack.getLiteralPath: " + localStackLiterapPath;
|
||||||
|
boolean thisIsCodeableConcept = false;
|
||||||
|
boolean checkDisplay = true;
|
||||||
|
|
||||||
|
ei.element.markValidation(profile, ei.definition);
|
||||||
|
if (type != null) {
|
||||||
|
if (isPrimitiveType(type)) {
|
||||||
|
checkPrimitive(hostContext, errors, ei.path, type, ei.definition, ei.element, profile, stack);
|
||||||
|
} else {
|
||||||
|
if (ei.definition.hasFixed()) {
|
||||||
|
checkFixedValue(errors,ei.path, ei.element, ei.definition.getFixed(), ei.definition.getSliceName(), null);
|
||||||
|
}
|
||||||
|
if (ei.definition.hasPattern()) {
|
||||||
|
checkFixedValue(errors,ei.path, ei.element, ei.definition.getPattern(), ei.definition.getSliceName(), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type.equals("Identifier")) {
|
||||||
|
checkIdentifier(errors, ei.path, ei.element, ei.definition);
|
||||||
|
} else if (type.equals("Coding")) {
|
||||||
|
checkCoding(errors, ei.path, ei.element, profile, ei.definition, inCodeableConcept, checkDisplayInContext, stack);
|
||||||
|
} else if (type.equals("CodeableConcept")) {
|
||||||
|
checkDisplay = checkCodeableConcept(errors, ei.path, ei.element, profile, ei.definition, stack);
|
||||||
|
thisIsCodeableConcept = true;
|
||||||
|
} else if (type.equals("Reference")) {
|
||||||
|
checkReference(hostContext, errors, ei.path, ei.element, profile, ei.definition, actualType, localStack);
|
||||||
|
// We only check extensions if we're not in a complex extension or if the element we're dealing with is not defined as part of that complex extension
|
||||||
|
} else if (type.equals("Extension") && ei.element.getChildValue("url") != null && ei.element.getChildValue("url").contains("/")) {
|
||||||
|
checkExtension(hostContext, errors, ei.path, resource, ei.element, ei.definition, profile, localStack);
|
||||||
|
} else if (type.equals("Resource")) {
|
||||||
|
validateContains(hostContext, errors, ei.path, ei.definition, definition, resource, ei.element, localStack, idStatusForEntry(element, ei)); // if
|
||||||
|
// (str.matches(".*([.,/])work\\1$"))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), stack.getLiteralPath(), ei.definition != null, "Unrecognised Content " + ei.name))
|
||||||
|
validateElement(hostContext, errors, profile, ei.definition, null, null, resource, ei.element, type, localStack, false, true);
|
||||||
|
}
|
||||||
|
StructureDefinition p = null;
|
||||||
|
boolean elementValidated = false;
|
||||||
|
String tail = null;
|
||||||
|
if (profiles.isEmpty()) {
|
||||||
|
if (type != null) {
|
||||||
|
p = getProfileForType(type, ei.definition.getType());
|
||||||
|
|
||||||
|
// If dealing with a primitive type, then we need to check the current child against
|
||||||
|
// the invariants (constraints) on the current element, because otherwise it only gets
|
||||||
|
// checked against the primary type's invariants: LLoyd
|
||||||
|
//if (p.getKind() == StructureDefinitionKind.PRIMITIVETYPE) {
|
||||||
|
// checkInvariants(hostContext, errors, ei.path, profile, ei.definition, null, null, resource, ei.element);
|
||||||
|
//}
|
||||||
|
|
||||||
|
rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, p != null, "Unknown type " + type);
|
||||||
|
}
|
||||||
|
} else if (profiles.size()==1) {
|
||||||
|
String url = profiles.get(0);
|
||||||
|
if (url.contains("#")) {
|
||||||
|
tail = url.substring(url.indexOf("#")+1);
|
||||||
|
url = url.substring(0, url.indexOf("#"));
|
||||||
|
}
|
||||||
|
p = this.context.fetchResource(StructureDefinition.class, url);
|
||||||
|
rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, p != null, "Unknown profile " + profiles.get(0));
|
||||||
|
} else {
|
||||||
|
elementValidated = true;
|
||||||
|
HashMap<String, List<ValidationMessage>> goodProfiles = new HashMap<String, List<ValidationMessage>>();
|
||||||
|
List<List<ValidationMessage>> badProfiles = new ArrayList<List<ValidationMessage>>();
|
||||||
|
for (String typeProfile : profiles) {
|
||||||
|
String url = typeProfile;
|
||||||
|
tail = null;
|
||||||
|
if (url.contains("#")) {
|
||||||
|
tail = url.substring(url.indexOf("#")+1);
|
||||||
|
url = url.substring(0, url.indexOf("#"));
|
||||||
|
}
|
||||||
|
p = this.context.fetchResource(StructureDefinition.class, typeProfile);
|
||||||
|
if (rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, p != null, "Unknown profile " + typeProfile)) {
|
||||||
|
List<ValidationMessage> profileErrors = new ArrayList<ValidationMessage>();
|
||||||
|
validateElement(hostContext, profileErrors, p, getElementByTail(p, tail), profile, ei.definition, resource, ei.element, type, localStack, thisIsCodeableConcept, checkDisplay);
|
||||||
|
if (hasErrors(profileErrors))
|
||||||
|
badProfiles.add(profileErrors);
|
||||||
|
else
|
||||||
|
goodProfiles.put(typeProfile, profileErrors);
|
||||||
|
}
|
||||||
|
if (goodProfiles.size()==1) {
|
||||||
|
errors.addAll(goodProfiles.values().iterator().next());
|
||||||
|
} else if (goodProfiles.size()==0) {
|
||||||
|
rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, false, "Unable to find matching profile among choices: " + StringUtils.join("; ", profiles));
|
||||||
|
for (List<ValidationMessage> messages : badProfiles) {
|
||||||
|
errors.addAll(messages);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
warning(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, false, "Found multiple matching profiles among choices: " + StringUtils.join("; ", goodProfiles.keySet()));
|
||||||
|
for (List<ValidationMessage> messages : goodProfiles.values()) {
|
||||||
|
errors.addAll(messages);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (p!=null) {
|
||||||
|
if (!elementValidated) {
|
||||||
|
if (ei.element.getSpecial() == SpecialElement.BUNDLE_ENTRY || ei.element.getSpecial() == SpecialElement.BUNDLE_OUTCOME || ei.element.getSpecial() == SpecialElement.PARAMETER )
|
||||||
|
validateElement(hostContext, errors, p, getElementByTail(p, tail), profile, ei.definition, ei.element, ei.element, type, localStack, thisIsCodeableConcept, checkDisplay);
|
||||||
|
else
|
||||||
|
validateElement(hostContext, errors, p, getElementByTail(p, tail), profile, ei.definition, resource, ei.element, type, localStack, thisIsCodeableConcept, checkDisplay);
|
||||||
|
}
|
||||||
|
int index = profile.getSnapshot().getElement().indexOf(ei.definition);
|
||||||
|
if (index < profile.getSnapshot().getElement().size() - 1) {
|
||||||
|
String nextPath = profile.getSnapshot().getElement().get(index+1).getPath();
|
||||||
|
if (!nextPath.equals(ei.definition.getPath()) && nextPath.startsWith(ei.definition.getPath()))
|
||||||
|
validateElement(hostContext, errors, profile, ei.definition, null, null, resource, ei.element, type, localStack, thisIsCodeableConcept, checkDisplay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkCardinalities(List<ValidationMessage> errors, StructureDefinition profile, Element element, NodeStack stack,
|
||||||
|
List<ElementDefinition> childDefinitions, List<ElementInfo> children, List<String> problematicPaths) throws DefinitionException {
|
||||||
|
// 3. report any definitions that have a cardinality problem
|
||||||
|
for (ElementDefinition ed : childDefinitions) {
|
||||||
|
if (ed.getRepresentation().isEmpty()) { // ignore xml attributes
|
||||||
|
int count = 0;
|
||||||
|
List<ElementDefinition> slices = null;
|
||||||
|
if (ed.hasSlicing())
|
||||||
|
slices = ProfileUtilities.getSliceList(profile, ed);
|
||||||
|
for (ElementInfo ei : children)
|
||||||
|
if (ei.definition == ed)
|
||||||
|
count++;
|
||||||
|
else if (slices!=null) {
|
||||||
|
for (ElementDefinition sed : slices) {
|
||||||
|
if (ei.definition == sed) {
|
||||||
|
count++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String location = "Profile " + profile.getUrl() + ", Element '" + stack.getLiteralPath() + "." + tail(ed.getPath()) + (ed.hasSliceName()? "[" + ed.getSliceName() + (ed.hasLabel() ? " ("+ed.getLabel()+")" : "")+"]": "") + "'";
|
||||||
|
if (ed.getMin() > 0) {
|
||||||
|
if (problematicPaths.contains(ed.getPath()))
|
||||||
|
hint(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count >= ed.getMin(), location + "': Unable to check minimum required (" + Integer.toString(ed.getMin()) + ") due to lack of slicing validation");
|
||||||
|
else
|
||||||
|
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), count >= ed.getMin(), location + ": minimum required = " + Integer.toString(ed.getMin()) + ", but only found " + Integer.toString(count));
|
||||||
|
}
|
||||||
|
if (ed.hasMax() && !ed.getMax().equals("*")) {
|
||||||
|
if (problematicPaths.contains(ed.getPath()))
|
||||||
|
hint(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count <= Integer.parseInt(ed.getMax()), location + ": Unable to check max allowed (" + ed.getMax() + ") due to lack of slicing validation");
|
||||||
|
else
|
||||||
|
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), count <= Integer.parseInt(ed.getMax()), location + ": max allowed = " + ed.getMax() + ", but found " + Integer.toString(count));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> assignChildren(ValidatorHostContext hostContext, List<ValidationMessage> errors, StructureDefinition profile, Element resource,
|
||||||
|
NodeStack stack, List<ElementDefinition> childDefinitions, List<ElementInfo> children) throws DefinitionException, IOException {
|
||||||
// 2. assign children to a definition
|
// 2. assign children to a definition
|
||||||
// for each definition, for each child, check whether it belongs in the slice
|
// for each definition, for each child, check whether it belongs in the slice
|
||||||
ElementDefinition slicer = null;
|
ElementDefinition slicer = null;
|
||||||
|
@ -3847,239 +4085,29 @@ private boolean isAnswerRequirementFulfilled(QuestionnaireItemComponent qItem, L
|
||||||
else
|
else
|
||||||
lastSlice = -1;
|
lastSlice = -1;
|
||||||
}
|
}
|
||||||
|
return problematicPaths;
|
||||||
|
}
|
||||||
|
|
||||||
// 3. report any definitions that have a cardinality problem
|
public List<ElementInfo> listChildren(Element element, NodeStack stack) {
|
||||||
for (ElementDefinition ed : childDefinitions) {
|
// 1. List the children, and remember their exact path (convenience)
|
||||||
if (ed.getRepresentation().isEmpty()) { // ignore xml attributes
|
List<ElementInfo> children = new ArrayList<InstanceValidator.ElementInfo>();
|
||||||
int count = 0;
|
ChildIterator iter = new ChildIterator(stack.getLiteralPath(), element);
|
||||||
List<ElementDefinition> slices = null;
|
while (iter.next())
|
||||||
if (ed.hasSlicing())
|
children.add(new ElementInfo(iter.name(), iter.element(), iter.path(), iter.count()));
|
||||||
slices = ProfileUtilities.getSliceList(profile, ed);
|
return children;
|
||||||
for (ElementInfo ei : children)
|
}
|
||||||
if (ei.definition == ed)
|
|
||||||
count++;
|
|
||||||
else if (slices!=null) {
|
|
||||||
for (ElementDefinition sed : slices) {
|
|
||||||
if (ei.definition == sed) {
|
|
||||||
count++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String location = "Profile " + profile.getUrl() + ", Element '" + stack.getLiteralPath() + "." + tail(ed.getPath()) + (ed.hasSliceName()? "[" + ed.getSliceName() + (ed.hasLabel() ? " ("+ed.getLabel()+")" : "")+"]": "") + "'";
|
|
||||||
if (ed.getMin() > 0) {
|
|
||||||
if (problematicPaths.contains(ed.getPath()))
|
|
||||||
hint(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count >= ed.getMin(), location + "': Unable to check minimum required (" + Integer.toString(ed.getMin()) + ") due to lack of slicing validation");
|
|
||||||
else
|
|
||||||
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), count >= ed.getMin(), location + ": minimum required = " + Integer.toString(ed.getMin()) + ", but only found " + Integer.toString(count));
|
|
||||||
}
|
|
||||||
if (ed.hasMax() && !ed.getMax().equals("*")) {
|
|
||||||
if (problematicPaths.contains(ed.getPath()))
|
|
||||||
hint(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count <= Integer.parseInt(ed.getMax()), location + ": Unable to check max allowed (" + ed.getMax() + ") due to lack of slicing validation");
|
|
||||||
else
|
|
||||||
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), count <= Integer.parseInt(ed.getMax()), location + ": max allowed = " + ed.getMax() + ", but found " + Integer.toString(count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 4. check order if any slices are ordered. (todo)
|
|
||||||
|
|
||||||
// 5. inspect each child for validity
|
public void checkInvariants(ValidatorHostContext hostContext, List<ValidationMessage> errors, StructureDefinition profile, ElementDefinition definition,
|
||||||
for (ElementInfo ei : children) {
|
Element resource, Element element, NodeStack stack) throws FHIRException {
|
||||||
List<String> profiles = new ArrayList<String>();
|
if (resource.getName().equals("contained")) {
|
||||||
if (ei.definition != null) {
|
NodeStack ancestor = stack;
|
||||||
String type = null;
|
while (!ancestor.element.isResource() || ancestor.element.getName().equals("contained"))
|
||||||
ElementDefinition typeDefn = null;
|
ancestor = ancestor.parent;
|
||||||
|
checkInvariants(hostContext, errors, stack.getLiteralPath(), profile, definition, null, null, ancestor.element, element);
|
||||||
String usesMustSupport = profile.getUserString("usesMustSupport");
|
} else
|
||||||
if (usesMustSupport == null) {
|
checkInvariants(hostContext, errors, stack.getLiteralPath(), profile, definition, null, null, resource, element);
|
||||||
usesMustSupport = "N";
|
if (definition.getFixed()!=null)
|
||||||
for (ElementDefinition pe: profile.getSnapshot().getElement()) {
|
checkFixedValue(errors, stack.getLiteralPath(), element, definition.getFixed(), definition.getSliceName(), null);
|
||||||
if (pe.getMustSupport()) {
|
|
||||||
usesMustSupport = "Y";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
profile.setUserData("usesMustSupport", usesMustSupport);
|
|
||||||
}
|
|
||||||
if (usesMustSupport.equals("Y")) {
|
|
||||||
String elementSupported = ei.element.getUserString("elementSupported");
|
|
||||||
if (elementSupported==null || ei.definition.getMustSupport())
|
|
||||||
if (ei.definition.getMustSupport())
|
|
||||||
ei.element.setUserData("elementSupported", "Y");
|
|
||||||
else
|
|
||||||
ei.element.setUserData("elementSupported", "N");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ei.definition.getType().size() == 1 && !"*".equals(ei.definition.getType().get(0).getCode()) && !"Element".equals(ei.definition.getType().get(0).getCode())
|
|
||||||
&& !"BackboneElement".equals(ei.definition.getType().get(0).getCode())) {
|
|
||||||
type = ei.definition.getType().get(0).getCode();
|
|
||||||
// Excluding reference is a kludge to get around versioning issues
|
|
||||||
if (ei.definition.getType().get(0).hasProfile())
|
|
||||||
profiles.add(ei.definition.getType().get(0).getProfile().get(0).getValue());
|
|
||||||
|
|
||||||
} else if (ei.definition.getType().size() == 1 && "*".equals(ei.definition.getType().get(0).getCode())) {
|
|
||||||
String prefix = tail(ei.definition.getPath());
|
|
||||||
assert prefix.endsWith("[x]");
|
|
||||||
type = ei.name.substring(prefix.length() - 3);
|
|
||||||
if (isPrimitiveType(type))
|
|
||||||
type = Utilities.uncapitalize(type);
|
|
||||||
// Excluding reference is a kludge to get around versioning issues
|
|
||||||
if (ei.definition.getType().get(0).hasProfile() && !type.equals("Reference"))
|
|
||||||
profiles.add(ei.definition.getType().get(0).getProfile().get(0).getValue());
|
|
||||||
} else if (ei.definition.getType().size() > 1) {
|
|
||||||
|
|
||||||
String prefix = tail(ei.definition.getPath());
|
|
||||||
assert typesAreAllReference(ei.definition.getType()) || ei.definition.hasRepresentation(PropertyRepresentation.TYPEATTR) || prefix.endsWith("[x]") : prefix;
|
|
||||||
|
|
||||||
if (ei.definition.hasRepresentation(PropertyRepresentation.TYPEATTR))
|
|
||||||
type = ei.element.getType();
|
|
||||||
else {
|
|
||||||
prefix = prefix.substring(0, prefix.length() - 3);
|
|
||||||
for (TypeRefComponent t : ei.definition.getType())
|
|
||||||
if ((prefix + Utilities.capitalize(t.getCode())).equals(ei.name)) {
|
|
||||||
type = t.getCode();
|
|
||||||
// Excluding reference is a kludge to get around versioning issues
|
|
||||||
if (t.hasProfile() && !type.equals("Reference"))
|
|
||||||
profiles.add(t.getProfile().get(0).getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (type == null) {
|
|
||||||
TypeRefComponent trc = ei.definition.getType().get(0);
|
|
||||||
if (trc.getCode().equals("Reference"))
|
|
||||||
type = "Reference";
|
|
||||||
else
|
|
||||||
rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), stack.getLiteralPath(), false,
|
|
||||||
"The type of element " + ei.name + " is not known, which is illegal. Valid types at this point are " + describeTypes(ei.definition.getType()));
|
|
||||||
}
|
|
||||||
} else if (ei.definition.getContentReference() != null) {
|
|
||||||
typeDefn = resolveNameReference(profile.getSnapshot(), ei.definition.getContentReference());
|
|
||||||
} else if (ei.definition.getType().size() == 1 && ("Element".equals(ei.definition.getType().get(0).getCode()) || "BackboneElement".equals(ei.definition.getType().get(0).getCode()))) {
|
|
||||||
if (ei.definition.getType().get(0).hasProfile()) {
|
|
||||||
CanonicalType pu = ei.definition.getType().get(0).getProfile().get(0);
|
|
||||||
if (pu.hasExtension(ToolingExtensions.EXT_PROFILE_ELEMENT))
|
|
||||||
profiles.add(pu.getValue()+"#"+pu.getExtensionString(ToolingExtensions.EXT_PROFILE_ELEMENT));
|
|
||||||
else
|
|
||||||
profiles.add(pu.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type != null) {
|
|
||||||
if (type.startsWith("@")) {
|
|
||||||
ei.definition = findElement(profile, type.substring(1));
|
|
||||||
type = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NodeStack localStack = stack.push(ei.element, ei.count, ei.definition, type == null ? typeDefn : resolveType(type, ei.definition.getType()));
|
|
||||||
String localStackLiterapPath = localStack.getLiteralPath();
|
|
||||||
String eiPath = ei.path;
|
|
||||||
assert(eiPath.equals(localStackLiterapPath)) : "ei.path: " + ei.path + " - localStack.getLiteralPath: " + localStackLiterapPath;
|
|
||||||
boolean thisIsCodeableConcept = false;
|
|
||||||
boolean checkDisplay = true;
|
|
||||||
|
|
||||||
ei.element.markValidation(profile, ei.definition);
|
|
||||||
if (type != null) {
|
|
||||||
if (isPrimitiveType(type)) {
|
|
||||||
checkPrimitive(hostContext, errors, ei.path, type, ei.definition, ei.element, profile, stack);
|
|
||||||
} else {
|
|
||||||
if (ei.definition.hasFixed()) {
|
|
||||||
checkFixedValue(errors,ei.path, ei.element, ei.definition.getFixed(), ei.definition.getSliceName(), null);
|
|
||||||
}
|
|
||||||
if (ei.definition.hasPattern()) {
|
|
||||||
checkFixedValue(errors,ei.path, ei.element, ei.definition.getPattern(), ei.definition.getSliceName(), null, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (type.equals("Identifier")) {
|
|
||||||
checkIdentifier(errors, ei.path, ei.element, ei.definition);
|
|
||||||
} else if (type.equals("Coding")) {
|
|
||||||
checkCoding(errors, ei.path, ei.element, profile, ei.definition, inCodeableConcept, checkDisplayInContext, stack);
|
|
||||||
} else if (type.equals("CodeableConcept")) {
|
|
||||||
checkDisplay = checkCodeableConcept(errors, ei.path, ei.element, profile, ei.definition, stack);
|
|
||||||
thisIsCodeableConcept = true;
|
|
||||||
} else if (type.equals("Reference")) {
|
|
||||||
checkReference(hostContext, errors, ei.path, ei.element, profile, ei.definition, actualType, localStack);
|
|
||||||
// We only check extensions if we're not in a complex extension or if the element we're dealing with is not defined as part of that complex extension
|
|
||||||
} else if (type.equals("Extension") && ei.element.getChildValue("url") != null && ei.element.getChildValue("url").contains("/")) {
|
|
||||||
checkExtension(hostContext, errors, ei.path, resource, ei.element, ei.definition, profile, localStack);
|
|
||||||
} else if (type.equals("Resource")) {
|
|
||||||
validateContains(hostContext, errors, ei.path, ei.definition, definition, resource, ei.element, localStack, idStatusForEntry(element, ei)); // if
|
|
||||||
// (str.matches(".*([.,/])work\\1$"))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), stack.getLiteralPath(), ei.definition != null, "Unrecognised Content " + ei.name))
|
|
||||||
validateElement(hostContext, errors, profile, ei.definition, null, null, resource, ei.element, type, localStack, false, true);
|
|
||||||
}
|
|
||||||
StructureDefinition p = null;
|
|
||||||
boolean elementValidated = false;
|
|
||||||
String tail = null;
|
|
||||||
if (profiles.isEmpty()) {
|
|
||||||
if (type != null) {
|
|
||||||
p = getProfileForType(type, ei.definition.getType());
|
|
||||||
|
|
||||||
// If dealing with a primitive type, then we need to check the current child against
|
|
||||||
// the invariants (constraints) on the current element, because otherwise it only gets
|
|
||||||
// checked against the primary type's invariants: LLoyd
|
|
||||||
//if (p.getKind() == StructureDefinitionKind.PRIMITIVETYPE) {
|
|
||||||
// checkInvariants(hostContext, errors, ei.path, profile, ei.definition, null, null, resource, ei.element);
|
|
||||||
//}
|
|
||||||
|
|
||||||
rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, p != null, "Unknown type " + type);
|
|
||||||
}
|
|
||||||
} else if (profiles.size()==1) {
|
|
||||||
String url = profiles.get(0);
|
|
||||||
if (url.contains("#")) {
|
|
||||||
tail = url.substring(url.indexOf("#")+1);
|
|
||||||
url = url.substring(0, url.indexOf("#"));
|
|
||||||
}
|
|
||||||
p = this.context.fetchResource(StructureDefinition.class, url);
|
|
||||||
rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, p != null, "Unknown profile " + profiles.get(0));
|
|
||||||
} else {
|
|
||||||
elementValidated = true;
|
|
||||||
HashMap<String, List<ValidationMessage>> goodProfiles = new HashMap<String, List<ValidationMessage>>();
|
|
||||||
List<List<ValidationMessage>> badProfiles = new ArrayList<List<ValidationMessage>>();
|
|
||||||
for (String typeProfile : profiles) {
|
|
||||||
String url = typeProfile;
|
|
||||||
tail = null;
|
|
||||||
if (url.contains("#")) {
|
|
||||||
tail = url.substring(url.indexOf("#")+1);
|
|
||||||
url = url.substring(0, url.indexOf("#"));
|
|
||||||
}
|
|
||||||
p = this.context.fetchResource(StructureDefinition.class, typeProfile);
|
|
||||||
if (rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, p != null, "Unknown profile " + typeProfile)) {
|
|
||||||
List<ValidationMessage> profileErrors = new ArrayList<ValidationMessage>();
|
|
||||||
validateElement(hostContext, profileErrors, p, getElementByTail(p, tail), profile, ei.definition, resource, ei.element, type, localStack, thisIsCodeableConcept, checkDisplay);
|
|
||||||
if (hasErrors(profileErrors))
|
|
||||||
badProfiles.add(profileErrors);
|
|
||||||
else
|
|
||||||
goodProfiles.put(typeProfile, profileErrors);
|
|
||||||
}
|
|
||||||
if (goodProfiles.size()==1) {
|
|
||||||
errors.addAll(goodProfiles.values().iterator().next());
|
|
||||||
} else if (goodProfiles.size()==0) {
|
|
||||||
rule(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, false, "Unable to find matching profile among choices: " + StringUtils.join("; ", profiles));
|
|
||||||
for (List<ValidationMessage> messages : badProfiles) {
|
|
||||||
errors.addAll(messages);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
warning(errors, IssueType.STRUCTURE, ei.line(), ei.col(), ei.path, false, "Found multiple matching profiles among choices: " + StringUtils.join("; ", goodProfiles.keySet()));
|
|
||||||
for (List<ValidationMessage> messages : goodProfiles.values()) {
|
|
||||||
errors.addAll(messages);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (p!=null) {
|
|
||||||
if (!elementValidated) {
|
|
||||||
validateElement(hostContext, errors, p, getElementByTail(p, tail), profile, ei.definition, resource, ei.element, type, localStack, thisIsCodeableConcept, checkDisplay);
|
|
||||||
}
|
|
||||||
int index = profile.getSnapshot().getElement().indexOf(ei.definition);
|
|
||||||
if (index < profile.getSnapshot().getElement().size() - 1) {
|
|
||||||
String nextPath = profile.getSnapshot().getElement().get(index+1).getPath();
|
|
||||||
if (!nextPath.equals(ei.definition.getPath()) && nextPath.startsWith(ei.definition.getPath()))
|
|
||||||
validateElement(hostContext, errors, profile, ei.definition, null, null, resource, ei.element, type, localStack, thisIsCodeableConcept, checkDisplay);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean matchSlice(ValidatorHostContext hostContext, List<ValidationMessage> errors, StructureDefinition profile, NodeStack stack,
|
public boolean matchSlice(ValidatorHostContext hostContext, List<ValidationMessage> errors, StructureDefinition profile, NodeStack stack,
|
||||||
|
|
|
@ -94,8 +94,8 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
||||||
this.content = content;
|
this.content = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private static final String DEF_TX = "http://tx.fhir.org";
|
private static final String DEF_TX = "http://tx.fhir.org";
|
||||||
private static final String DEF_TX = "http://local.fhir.org:960";
|
// private static final String DEF_TX = "http://local.fhir.org:960";
|
||||||
private static ValidationEngine ve;
|
private static ValidationEngine ve;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Bundle xmlns="http://hl7.org/fhir">
|
||||||
|
<type value="collection"/>
|
||||||
|
<entry>
|
||||||
|
<resource>
|
||||||
|
<Binary>
|
||||||
|
<id value="1"/>
|
||||||
|
<contentType value="text/plain"/>
|
||||||
|
<data value="VGVzdA=="/>
|
||||||
|
</Binary>
|
||||||
|
</resource>
|
||||||
|
</entry>
|
||||||
|
</Bundle>
|
|
@ -0,0 +1,22 @@
|
||||||
|
<Parameters xmlns="http://hl7.org/fhir">
|
||||||
|
<meta>
|
||||||
|
<profile value="http://example.org/fhir/StructureDefinition/param-profile"/>
|
||||||
|
</meta>
|
||||||
|
<parameter>
|
||||||
|
<name value="bundleparam"/>
|
||||||
|
<resource>
|
||||||
|
<Bundle>
|
||||||
|
<type value="collection"/>
|
||||||
|
<entry>
|
||||||
|
<resource>
|
||||||
|
<Binary>
|
||||||
|
<id value="1"/>
|
||||||
|
<contentType value="text/plain"/>
|
||||||
|
<data value="VGVzdA=="/>
|
||||||
|
</Binary>
|
||||||
|
</resource>
|
||||||
|
</entry>
|
||||||
|
</Bundle>
|
||||||
|
</resource>
|
||||||
|
</parameter>
|
||||||
|
</Parameters>
|
|
@ -0,0 +1,15 @@
|
||||||
|
<Parameters xmlns="http://hl7.org/fhir">
|
||||||
|
<meta>
|
||||||
|
<profile value="http://example.org/fhir/StructureDefinition/param-profile"/>
|
||||||
|
</meta>
|
||||||
|
<parameter>
|
||||||
|
<name value="binaryparam"/>
|
||||||
|
<resource>
|
||||||
|
<Binary>
|
||||||
|
<id value="1"/>
|
||||||
|
<contentType value="text/plain"/>
|
||||||
|
<data value="VGVzdA=="/>
|
||||||
|
</Binary>
|
||||||
|
</resource>
|
||||||
|
</parameter>
|
||||||
|
</Parameters>
|
|
@ -0,0 +1,59 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<StructureDefinition xmlns="http://hl7.org/fhir">
|
||||||
|
<url value="http://example.org/fhir/StructureDefinition/param-profile"/>
|
||||||
|
<name value="ParamProfile"/>
|
||||||
|
<status value="draft"/>
|
||||||
|
<fhirVersion value="4.0.0"/>
|
||||||
|
<kind value="resource"/>
|
||||||
|
<abstract value="false"/>
|
||||||
|
<type value="Parameters"/>
|
||||||
|
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Parameters"/>
|
||||||
|
<derivation value="constraint"/>
|
||||||
|
<differential>
|
||||||
|
<element id="Parameters.parameter">
|
||||||
|
<path value="Parameters.parameter"/>
|
||||||
|
<slicing>
|
||||||
|
<discriminator>
|
||||||
|
<type value="value"/>
|
||||||
|
<path value="name"/>
|
||||||
|
</discriminator>
|
||||||
|
<rules value="open"/>
|
||||||
|
</slicing>
|
||||||
|
</element>
|
||||||
|
<element id="Parameters.parameter:p1">
|
||||||
|
<path value="Parameters.parameter"/>
|
||||||
|
<sliceName value="p1"/>
|
||||||
|
<min value="0"/>
|
||||||
|
<max value="1"/>
|
||||||
|
</element>
|
||||||
|
<element id="Parameters.parameter:p1.name">
|
||||||
|
<path value="Parameters.parameter.name"/>
|
||||||
|
<fixedString value="binaryparam"/>
|
||||||
|
</element>
|
||||||
|
<element id="Parameters.parameter:p1.resource">
|
||||||
|
<path value="Parameters.parameter.resource"/>
|
||||||
|
<type>
|
||||||
|
<code value="Resource"/>
|
||||||
|
<profile value="http://example.org/fhir/StructureDefinition/text-binary"/>
|
||||||
|
</type>
|
||||||
|
</element>
|
||||||
|
<element id="Parameters.parameter:p2">
|
||||||
|
<path value="Parameters.parameter"/>
|
||||||
|
<sliceName value="p2"/>
|
||||||
|
<min value="0"/>
|
||||||
|
<max value="1"/>
|
||||||
|
</element>
|
||||||
|
<element id="Parameters.parameter:p2.name">
|
||||||
|
<path value="Parameters.parameter.name"/>
|
||||||
|
<fixedString value="bundleparam"/>
|
||||||
|
</element>
|
||||||
|
<element id="Parameters.parameter:p2.resource">
|
||||||
|
<path value="Parameters.parameter.resource"/>
|
||||||
|
<type>
|
||||||
|
<code value="Resource"/>
|
||||||
|
<profile value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
|
||||||
|
</type>
|
||||||
|
</element>
|
||||||
|
</differential>
|
||||||
|
</StructureDefinition>
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<StructureDefinition xmlns="http://hl7.org/fhir">
|
||||||
|
<id value="text-binary"/>
|
||||||
|
<url value="http://example.org/fhir/StructureDefinition/text-binary"/>
|
||||||
|
<name value="TextBinary"/>
|
||||||
|
<status value="draft"/>
|
||||||
|
<description value="Text represented as a FHIR Binary resource"/>
|
||||||
|
<fhirVersion value="4.0.0"/>
|
||||||
|
<kind value="resource"/>
|
||||||
|
<abstract value="false"/>
|
||||||
|
<type value="Binary"/>
|
||||||
|
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Binary"/>
|
||||||
|
<derivation value="constraint"/>
|
||||||
|
<differential>
|
||||||
|
<element id="Binary">
|
||||||
|
<path value="Binary"/>
|
||||||
|
</element>
|
||||||
|
<element id="Binary.contentType">
|
||||||
|
<path value="Binary.contentType"/>
|
||||||
|
<short value="MimeType for a test"/>
|
||||||
|
<fixedCode value="text/plain"/>
|
||||||
|
</element>
|
||||||
|
</differential>
|
||||||
|
</StructureDefinition>
|
||||||
|
|
|
@ -176,7 +176,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"medication-atc.json": {
|
"medication-atc.json": {
|
||||||
"errorCount": 0,
|
"errorCount": 1,
|
||||||
|
"errors-for-debugging" : ["ERROR: Medication.extension[2].valueCodeableConcept.coding: The code \"N02AA\" is not valid in the system http://www.whocc.no/atc; The code provided (http://www.whocc.no/atc#N02AA) is not valid in the value set All codes known to the system"],
|
||||||
"allowed-extension-domain": "https://api-v8-r4.hspconsortium.org/DrugFormulary0/open"
|
"allowed-extension-domain": "https://api-v8-r4.hspconsortium.org/DrugFormulary0/open"
|
||||||
},
|
},
|
||||||
"bp.json": {
|
"bp.json": {
|
||||||
|
@ -781,6 +782,14 @@
|
||||||
"loinc-lang-nl-3.xml" : {
|
"loinc-lang-nl-3.xml" : {
|
||||||
"errorCount": 0,
|
"errorCount": 0,
|
||||||
"warningCount": 0
|
"warningCount": 0
|
||||||
|
},
|
||||||
|
"azatadha/example-params-1.xml" : {
|
||||||
|
"errorCount": 0,
|
||||||
|
"warningCount": 1,
|
||||||
|
"profile": {
|
||||||
|
"source": "azatadha/param-profile.xml",
|
||||||
|
"errorCount": 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ pause
|
||||||
call mvn versions:set -DnewVersion=%newver%-SNAPSHOT
|
call mvn versions:set -DnewVersion=%newver%-SNAPSHOT
|
||||||
call git commit -a -m "Release new version"
|
call git commit -a -m "Release new version"
|
||||||
call git push origin master
|
call git push origin master
|
||||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.java" --includeSubDirectories --find "%oldver%-SNAPSHOT" --replace "%newver%-SNAPSHOT"
|
|
||||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.xml" --find "%oldver%-SNAPSHOT" --replace "%newver%-SNAPSHOT"
|
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.xml" --find "%oldver%-SNAPSHOT" --replace "%newver%-SNAPSHOT"
|
||||||
|
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\fhir-ig-publisher" --fileMask "*.xml" --find "%oldver%-SNAPSHOT" --replace "%newver%-SNAPSHOT"
|
||||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\latest-ig-publisher" --fileMask "*.html" --find "%oldver%" --replace "%newver%"
|
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\latest-ig-publisher" --fileMask "*.html" --find "%oldver%" --replace "%newver%"
|
||||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\latest-ig-publisher" --fileMask "*.json" --find "%oldver%" --replace "%newver%"
|
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\latest-ig-publisher" --fileMask "*.json" --find "%oldver%" --replace "%newver%"
|
||||||
call mvn deploy
|
call mvn deploy
|
||||||
|
|
Loading…
Reference in New Issue