Auto stash before merge of "master" and "origin/master"
This commit is contained in:
parent
56a68d4ea2
commit
2c47234f27
|
@ -208,6 +208,9 @@ public class ConceptMap40_50 {
|
|||
if (t.getEquivalence() == org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED) {
|
||||
tgt.setNoMap(true);
|
||||
if (t.hasComment()) {
|
||||
if (tgt.hasExtension("http://hl7.org/fhir/4.0/StructureDefinition/extension-ConceptMap.group.element.target.comment")) {
|
||||
throw new FHIRException("A source can only have one 'unmatched' relationship. Consider using 'disjoint' ");
|
||||
}
|
||||
tgt.addExtension("http://hl7.org/fhir/4.0/StructureDefinition/extension-ConceptMap.group.element.target.comment", ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(t.getCommentElement()));
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -96,6 +96,7 @@ import org.hl7.fhir.r5.utils.UserDataNames;
|
|||
import org.hl7.fhir.r5.utils.validation.ValidationContextCarrier;
|
||||
import org.hl7.fhir.r5.utils.validation.ValidationContextCarrier.ValidationContextResourceProxy;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.DebugUtilities;
|
||||
import org.hl7.fhir.utilities.FhirPublication;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
|
@ -183,6 +184,22 @@ public class ValueSetValidator extends ValueSetProcessBase {
|
|||
for (Extension s : valueset.getExtensionsByUrl(ExtensionConstants.EXT_VSSUPPLEMENT)) {
|
||||
requiredSupplements.add(s.getValue().primitiveValue());
|
||||
}
|
||||
|
||||
if (!requiredSupplements.isEmpty()) {
|
||||
for (ConceptSetComponent inc : valueset.getCompose().getInclude()) {
|
||||
if (inc.hasSystem()) {
|
||||
checkCodeSystemResolves(inc);
|
||||
}
|
||||
}
|
||||
for (ConceptSetComponent inc : valueset.getCompose().getExclude()) {
|
||||
if (inc.hasSystem()) {
|
||||
checkCodeSystemResolves(inc);
|
||||
}
|
||||
}
|
||||
if (!requiredSupplements.isEmpty()) {
|
||||
DebugUtilities.breakpoint();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
opContext.note("vs = null");
|
||||
}
|
||||
|
@ -202,6 +219,15 @@ public class ValueSetValidator extends ValueSetProcessBase {
|
|||
opContext.note("analysed");
|
||||
}
|
||||
|
||||
private void checkCodeSystemResolves(ConceptSetComponent c) {
|
||||
VersionInfo vi = new VersionInfo(this);
|
||||
CodeSystem cs = resolveCodeSystem(c.getSystem(), vi.getVersion(c.getSystem(), c.getVersion()));
|
||||
if (cs == null) {
|
||||
// well, it doesn't really matter at this point. Mainly we're triggering the supplement analysis to happen
|
||||
opContext.note("Unable to resolve "+c.getSystem()+"#"+vi.getVersion(c.getSystem(), c.getVersion()));
|
||||
}
|
||||
}
|
||||
|
||||
private void analyseComponent(ConceptSetComponent i, String name) {
|
||||
opContext.deadCheck("analyse Component "+name);
|
||||
if (i.getSystemElement().hasExtension(ToolingExtensions.EXT_VALUESET_SYSTEM)) {
|
||||
|
@ -446,7 +472,7 @@ public class ValueSetValidator extends ValueSetProcessBase {
|
|||
|
||||
private boolean checkRequiredSupplements(ValidationProcessInfo info) {
|
||||
if (!requiredSupplements.isEmpty()) {
|
||||
String msg= context.formatMessagePlural(requiredSupplements.size(), I18nConstants.VALUESET_SUPPLEMENT_MISSING, CommaSeparatedStringBuilder.build(requiredSupplements));
|
||||
String msg = context.formatMessagePlural(requiredSupplements.size(), I18nConstants.VALUESET_SUPPLEMENT_MISSING, CommaSeparatedStringBuilder.build(requiredSupplements));
|
||||
throw new TerminologyServiceProtectionException(msg, TerminologyServiceErrorClass.BUSINESS_RULE, IssueType.NOTFOUND);
|
||||
}
|
||||
return requiredSupplements.isEmpty();
|
||||
|
@ -492,6 +518,17 @@ public class ValueSetValidator extends ValueSetProcessBase {
|
|||
if (cs == null) {
|
||||
cs = findSpecialCodeSystem(system, version);
|
||||
}
|
||||
if (cs != null) {
|
||||
if (cs.hasUserData("supplements.installed")) {
|
||||
for (String s : cs.getUserString("supplements.installed").split("\\,")) {
|
||||
requiredSupplements.remove(s);
|
||||
if (s.contains("|")) {
|
||||
s = s.substring(0, s.indexOf("|"));
|
||||
requiredSupplements.remove(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return cs;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,10 @@ import org.hl7.fhir.r5.utils.validation.constants.BindingKind;
|
|||
|
||||
public interface IValidationPolicyAdvisor {
|
||||
|
||||
|
||||
public IValidationPolicyAdvisor getPolicyAdvisor();
|
||||
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor);
|
||||
|
||||
/**
|
||||
* Internal use, for chaining advisors
|
||||
*
|
||||
|
|
|
@ -1142,4 +1142,6 @@ public class I18nConstants {
|
|||
public static final String VIEWDEFINITION_TYPE_MISMATCH = "VIEWDEFINITION_TYPE_MISMATCH";
|
||||
public static final String VIEWDEFINITION_UNABLE_TO_TYPE = "VIEWDEFINITION_UNABLE_TO_TYPE";
|
||||
public static final String VIEWDEFINITION_COMPLEX_TYPE = "VIEWDEFINITION_COMPLEX_TYPE";
|
||||
public static final String CODESYSTEM_PROPERTY_ABSOLUTE_URI = "CODESYSTEM_PROPERTY_ABSOLUTE_URI";
|
||||
public static final String CODESYSTEM_CS_SUPP_HIERARCHY_MEANING = "CODESYSTEM_CS_SUPP_HIERARCHY_MEANING";
|
||||
}
|
||||
|
|
|
@ -1172,3 +1172,5 @@ VIEWDEFINITION_COLLECTION_NEEDED2 = This column is defined to be not a collectio
|
|||
VIEWDEFINITION_TYPE_MISMATCH = The path expression ''{0}'' does not return a value of the type ''{1}'' - found ''{2}''{3}
|
||||
VIEWDEFINITION_UNABLE_TO_TYPE = Unable to determine a type (found ''{0}''){1}
|
||||
VIEWDEFINITION_COMPLEX_TYPE = Column from path ''{0}'' is a complex type (''{1}''){2}. This is not supported in some Runners
|
||||
CODESYSTEM_PROPERTY_ABSOLUTE_URI = A property URI must be an absolute URI, but ''{0}'' is not
|
||||
CODESYSTEM_CS_SUPP_HIERARCHY_MEANING = The supplement declares a heirarchyMeaning of ''{0}'' that doesn''t match that in the base code system ''{1}''
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
package org.hl7.fhir.validation.cli.services;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.r5.elementmodel.Element;
|
||||
import org.hl7.fhir.r5.elementmodel.Element.SpecialElement;
|
||||
import org.hl7.fhir.r5.model.ElementDefinition;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition;
|
||||
import org.hl7.fhir.r5.model.ValueSet;
|
||||
import org.hl7.fhir.r5.utils.validation.IMessagingServices;
|
||||
import org.hl7.fhir.r5.utils.validation.IResourceValidator;
|
||||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor;
|
||||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor.AdditionalBindingPurpose;
|
||||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor.CodedContentValidationAction;
|
||||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor.ElementValidationAction;
|
||||
import org.hl7.fhir.r5.utils.validation.IValidationPolicyAdvisor.ResourceValidationAction;
|
||||
import org.hl7.fhir.r5.utils.validation.constants.BindingKind;
|
||||
import org.hl7.fhir.r5.utils.validation.constants.ContainedReferenceValidationPolicy;
|
||||
import org.hl7.fhir.r5.utils.validation.constants.ReferenceValidationPolicy;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage;
|
||||
|
||||
public class DisabledValidationPolicyAdvisor implements IValidationPolicyAdvisor {
|
||||
|
||||
private IValidationPolicyAdvisor policyAdvisor;
|
||||
|
||||
@Override
|
||||
public ReferenceValidationPolicy getReferencePolicy() {
|
||||
return ReferenceValidationPolicy.CHECK_TYPE_IF_EXISTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuppressMessageId(String path, String messageId) {
|
||||
return policyAdvisor.isSuppressMessageId(path, messageId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContainedReferenceValidationPolicy policyForContained(IResourceValidator validator, Object appContext,
|
||||
StructureDefinition structure, ElementDefinition element, String containerType, String containerId,
|
||||
SpecialElement containingResourceType, String path, String url) {
|
||||
return policyAdvisor.policyForContained(validator, appContext, structure, element, containerType, containerId, containingResourceType, path, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ResourceValidationAction> policyForResource(IResourceValidator validator, Object appContext,
|
||||
StructureDefinition type, String path) {
|
||||
return policyAdvisor.policyForResource(validator, appContext, type, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ElementValidationAction> policyForElement(IResourceValidator validator, Object appContext,
|
||||
StructureDefinition structure, ElementDefinition element, String path) {
|
||||
return policyAdvisor.policyForElement(validator, appContext, structure, element, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<CodedContentValidationAction> policyForCodedContent(IResourceValidator validator, Object appContext,
|
||||
String stackPath, ElementDefinition definition, StructureDefinition structure, BindingKind kind,
|
||||
AdditionalBindingPurpose purpose, ValueSet valueSet, List<String> systems) {
|
||||
return policyAdvisor.policyForCodedContent(validator, appContext, stackPath, definition, structure, kind, purpose, valueSet, systems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StructureDefinition> getImpliedProfilesForResource(IResourceValidator validator, Object appContext,
|
||||
String stackPath, ElementDefinition definition, StructureDefinition structure, Element resource, boolean valid,
|
||||
IMessagingServices msgServices, List<ValidationMessage> messages) {
|
||||
return policyAdvisor.getImpliedProfilesForResource(validator, appContext, stackPath, definition, structure, resource, valid, msgServices, messages);
|
||||
}
|
||||
|
||||
public IValidationPolicyAdvisor getPolicyAdvisor() {
|
||||
return policyAdvisor;
|
||||
}
|
||||
|
||||
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor) {
|
||||
this.policyAdvisor = policyAdvisor;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReferenceValidationPolicy policyForReference(IResourceValidator validator,
|
||||
Object appContext,
|
||||
String path,
|
||||
String url) {
|
||||
return ReferenceValidationPolicy.IGNORE;
|
||||
}
|
||||
}
|
|
@ -348,8 +348,9 @@ public class StandAloneValidatorFetcher implements IValidatorResourceFetcher, IV
|
|||
return policyAdvisor;
|
||||
}
|
||||
|
||||
public void setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor) {
|
||||
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor) {
|
||||
this.policyAdvisor = policyAdvisor;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ import org.hl7.fhir.r5.renderers.spreadsheets.ValueSetSpreadsheetGenerator;
|
|||
import org.hl7.fhir.r5.terminologies.CodeSystemUtilities;
|
||||
import org.hl7.fhir.r5.terminologies.client.TerminologyClientManager.InternalLogEvent;
|
||||
import org.hl7.fhir.r5.terminologies.utilities.TerminologyCache;
|
||||
import org.hl7.fhir.utilities.DebugUtilities;
|
||||
import org.hl7.fhir.utilities.FhirPublication;
|
||||
import org.hl7.fhir.utilities.SystemExitManager;
|
||||
import org.hl7.fhir.utilities.TextFile;
|
||||
|
@ -72,6 +73,7 @@ import org.hl7.fhir.validation.cli.renderers.ValidationOutputRenderer;
|
|||
import org.hl7.fhir.validation.cli.utils.Common;
|
||||
import org.hl7.fhir.validation.cli.utils.EngineMode;
|
||||
import org.hl7.fhir.validation.cli.utils.VersionSourceInformation;
|
||||
import org.hl7.fhir.validation.instance.advisor.BasePolicyAdvisorForFullValidation;
|
||||
import org.hl7.fhir.validation.instance.advisor.JsonDrivenPolicyAdvisor;
|
||||
import org.hl7.fhir.validation.instance.advisor.TextDrivenPolicyAdvisor;
|
||||
|
||||
|
@ -609,13 +611,18 @@ public class ValidationService {
|
|||
validationEngine.setFetcher(fetcher);
|
||||
validationEngine.getContext().setLocator(fetcher);
|
||||
validationEngine.setPolicyAdvisor(fetcher);
|
||||
if (cliContext.getAdvisorFile() != null) {
|
||||
if (cliContext.getAdvisorFile().endsWith(".json")) {
|
||||
fetcher.setPolicyAdvisor(new JsonDrivenPolicyAdvisor(fetcher.getPolicyAdvisor(), new File(cliContext.getAdvisorFile())));
|
||||
} else {
|
||||
fetcher.setPolicyAdvisor(new TextDrivenPolicyAdvisor(fetcher.getPolicyAdvisor(), new File(cliContext.getAdvisorFile())));
|
||||
}
|
||||
} else {
|
||||
DisabledValidationPolicyAdvisor fetcher = new DisabledValidationPolicyAdvisor();
|
||||
validationEngine.setPolicyAdvisor(fetcher);
|
||||
}
|
||||
if (cliContext.getAdvisorFile() != null) {
|
||||
if (cliContext.getAdvisorFile().endsWith(".json")) {
|
||||
validationEngine.getPolicyAdvisor().setPolicyAdvisor(new JsonDrivenPolicyAdvisor(validationEngine.getPolicyAdvisor().getPolicyAdvisor(), new File(cliContext.getAdvisorFile())));
|
||||
} else {
|
||||
validationEngine.getPolicyAdvisor().setPolicyAdvisor(new TextDrivenPolicyAdvisor(validationEngine.getPolicyAdvisor().getPolicyAdvisor(), new File(cliContext.getAdvisorFile())));
|
||||
}
|
||||
} else {
|
||||
validationEngine.getPolicyAdvisor().setPolicyAdvisor(new BasePolicyAdvisorForFullValidation(validationEngine.getPolicyAdvisor().getReferencePolicy()));
|
||||
}
|
||||
validationEngine.getBundleValidationRules().addAll(cliContext.getBundleValidationRules());
|
||||
validationEngine.setJurisdiction(CodeSystemUtilities.readCoding(cliContext.getJurisdiction()));
|
||||
|
|
|
@ -214,8 +214,12 @@ public class LoincChecker extends CodeSystemChecker {
|
|||
|
||||
if (Utilities.existsInList(property,
|
||||
"concept")) {
|
||||
return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None, addToOps(ops, PropertyOperation.IsA));
|
||||
return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None, addToOps(ops, PropertyOperation.Equals, PropertyOperation.IsA, PropertyOperation.IsNotA));
|
||||
}
|
||||
if (Utilities.existsInList(property,
|
||||
"code")) {
|
||||
return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None, addToOps(ops, PropertyOperation.Equals, PropertyOperation.IsA, PropertyOperation.IsNotA));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,14 @@ import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
|
|||
public class BasePolicyAdvisorForFullValidation implements IValidationPolicyAdvisor {
|
||||
|
||||
private ReferenceValidationPolicy refpol = ReferenceValidationPolicy.CHECK_VALID;
|
||||
|
||||
public IValidationPolicyAdvisor getPolicyAdvisor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor) {
|
||||
throw new Error("This policy advisor is the end of the chain");
|
||||
}
|
||||
|
||||
public BasePolicyAdvisorForFullValidation(ReferenceValidationPolicy refpol) {
|
||||
super();
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent;
|
|||
import org.hl7.fhir.r5.model.ValueSet;
|
||||
import org.hl7.fhir.r5.terminologies.CodeSystemUtilities;
|
||||
import org.hl7.fhir.utilities.CanonicalPair;
|
||||
import org.hl7.fhir.utilities.DebugUtilities;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
import org.hl7.fhir.utilities.i18n.I18nConstants;
|
||||
|
@ -159,9 +160,19 @@ public class CodeSystemValidator extends BaseValidator {
|
|||
}
|
||||
} // todo... try getting the value set the other way...
|
||||
|
||||
CodeSystem csSupp = null;
|
||||
if ("supplement".equals(content) || supp != null) {
|
||||
if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, stack.getLiteralPath(), !Utilities.noString(supp), I18nConstants.CODESYSTEM_CS_SUPP_NO_SUPP)) {
|
||||
if (context.supportsSystem(supp, options.getFhirVersion())) {
|
||||
csSupp = context.fetchCodeSystem(supp);
|
||||
if (csSupp != null) {
|
||||
if (csSupp.hasHierarchyMeaningElement() && cs.hasChild("hierarchyMeaning")) {
|
||||
String hm = cs.getNamedChildValue("hierarchyMeaning");
|
||||
ok = rule(errors, "2024-03-06", IssueType.BUSINESSRULE, stack.getLiteralPath(), hm.equals(csSupp.getHierarchyMeaning().toCode()), I18nConstants.CODESYSTEM_CS_SUPP_HIERARCHY_MEANING, hm, csSupp.getHierarchyMeaning().toCode()) & ok;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
List<Element> concepts = cs.getChildrenByName("concept");
|
||||
int ce = 0;
|
||||
for (Element concept : concepts) {
|
||||
|
@ -227,58 +238,66 @@ public class CodeSystemValidator extends BaseValidator {
|
|||
PropertyDef pd = new PropertyDef(uri, code, type);
|
||||
KnownProperty ukp = null;
|
||||
KnownProperty ckp = null;
|
||||
|
||||
|
||||
if (uri != null) {
|
||||
if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), !properties.containsKey(uri), I18nConstants.CODESYSTEM_PROPERTY_DUPLICATE_URI, uri)) {
|
||||
properties.put(uri, pd);
|
||||
if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), Utilities.isAbsoluteUrl(uri), I18nConstants.CODESYSTEM_PROPERTY_ABSOLUTE_URI, uri)) {
|
||||
if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), !properties.containsKey(uri), I18nConstants.CODESYSTEM_PROPERTY_DUPLICATE_URI, uri)) {
|
||||
properties.put(uri, pd);
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
if (uri.contains("hl7.org/fhir")) {
|
||||
switch (uri) {
|
||||
case "http://hl7.org/fhir/concept-properties#status" :
|
||||
ukp = KnownProperty.Status;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#inactive" :
|
||||
ukp = KnownProperty.Inactive;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#effectiveDate" :
|
||||
ukp = KnownProperty.EffectiveDate;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#deprecationDate" :
|
||||
ukp = KnownProperty.DeprecationDate;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#retirementDate" :
|
||||
ukp = KnownProperty.RetirementDate;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#notSelectable" :
|
||||
ukp = KnownProperty.NotSelectable;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#parent" :
|
||||
ukp = KnownProperty.Parent;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#child" :
|
||||
ukp = KnownProperty.Child;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#partOf" :
|
||||
ukp = KnownProperty.PartOf;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#synonym" :
|
||||
ukp = KnownProperty.Synonym;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#comment" :
|
||||
ukp = KnownProperty.Comment;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#itemWeight" :
|
||||
ukp = KnownProperty.ItemWeight;
|
||||
break;
|
||||
default:
|
||||
ok = rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), isBaseSpec(cs.getNamedChildValue("url")) || isSelfRef(cs.getNamedChildValue("url"), uri), I18nConstants.CODESYSTEM_PROPERTY_BAD_HL7_URI, uri);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
if (uri.contains("hl7.org/fhir")) {
|
||||
switch (uri) {
|
||||
case "http://hl7.org/fhir/concept-properties#status" :
|
||||
ukp = KnownProperty.Status;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#inactive" :
|
||||
ukp = KnownProperty.Inactive;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#effectiveDate" :
|
||||
ukp = KnownProperty.EffectiveDate;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#deprecationDate" :
|
||||
ukp = KnownProperty.DeprecationDate;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#retirementDate" :
|
||||
ukp = KnownProperty.RetirementDate;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#notSelectable" :
|
||||
ukp = KnownProperty.NotSelectable;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#parent" :
|
||||
ukp = KnownProperty.Parent;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#child" :
|
||||
ukp = KnownProperty.Child;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#partOf" :
|
||||
ukp = KnownProperty.PartOf;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#synonym" :
|
||||
ukp = KnownProperty.Synonym;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#comment" :
|
||||
ukp = KnownProperty.Comment;
|
||||
break;
|
||||
case "http://hl7.org/fhir/concept-properties#itemWeight" :
|
||||
ukp = KnownProperty.ItemWeight;
|
||||
break;
|
||||
default:
|
||||
ok = rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), isBaseSpec(cs.getNamedChildValue("url")) || isSelfRef(cs.getNamedChildValue("url"), uri), I18nConstants.CODESYSTEM_PROPERTY_BAD_HL7_URI, uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (code != null) {
|
||||
if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), !properties.containsKey(code), I18nConstants.CODESYSTEM_PROPERTY_DUPLICATE_CODE, code)) {
|
||||
boolean pcok = properties.containsKey(code);
|
||||
if (pcok) {
|
||||
DebugUtilities.breakpoint();
|
||||
}
|
||||
if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), !pcok, I18nConstants.CODESYSTEM_PROPERTY_DUPLICATE_CODE, code)) {
|
||||
properties.put(code, pd);
|
||||
} else {
|
||||
ok = false;
|
||||
|
@ -523,10 +542,11 @@ public class CodeSystemValidator extends BaseValidator {
|
|||
NodeStack s = stack.push(cs.getNamedChild("caseSensitive", false), -1, null, null);
|
||||
rule(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, s.getLiteralPath(), false, I18nConstants.CODESYSTEM_CS_HL7_PRESENT_ELEMENT_SUPPL, "caseSensitive");
|
||||
}
|
||||
if (!Utilities.noString(hierarchyMeaning)) {
|
||||
NodeStack s = stack.push(cs.getNamedChild("hierarchyMeaning", false), -1, null, null);
|
||||
rule(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, s.getLiteralPath(), false, I18nConstants.CODESYSTEM_CS_HL7_PRESENT_ELEMENT_SUPPL, "hierarchyMeaning");
|
||||
}
|
||||
// can't run this test because of csd-2/csd-3
|
||||
// if (!Utilities.noString(hierarchyMeaning)) {
|
||||
// NodeStack s = stack.push(cs.getNamedChild("hierarchyMeaning", false), -1, null, null);
|
||||
// rule(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, s.getLiteralPath(), false, I18nConstants.CODESYSTEM_CS_HL7_PRESENT_ELEMENT_SUPPL, "hierarchyMeaning");
|
||||
// }
|
||||
|
||||
} else {
|
||||
boolean isHL7 = url != null && (url.contains("hl7.org") || url.contains("fhir.org"));
|
||||
|
|
|
@ -562,7 +562,7 @@ public class StructureDefinitionValidator extends BaseValidator {
|
|||
}
|
||||
if (typeMustSupport) {
|
||||
if (snapshot) {
|
||||
ok = rule(errors, NO_RULE_DATE, IssueType.EXCEPTION, stack.getLiteralPath(), "true".equals(element.getChildValue("mustSupport")), I18nConstants.SD_NESTED_MUST_SUPPORT_SNAPSHOT, path) && ok;
|
||||
warning(errors, NO_RULE_DATE, IssueType.EXCEPTION, stack.getLiteralPath(), "true".equals(element.getChildValue("mustSupport")), I18nConstants.SD_NESTED_MUST_SUPPORT_SNAPSHOT, path);
|
||||
} else {
|
||||
hint(errors, NO_RULE_DATE, IssueType.EXCEPTION, stack.getLiteralPath(), hasSnapshot || "true".equals(element.getChildValue("mustSupport")), I18nConstants.SD_NESTED_MUST_SUPPORT_DIFF, path);
|
||||
}
|
||||
|
|
|
@ -921,4 +921,13 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
|
|||
public ReferenceValidationPolicy getReferencePolicy() {
|
||||
return ReferenceValidationPolicy.IGNORE;
|
||||
}
|
||||
|
||||
public IValidationPolicyAdvisor getPolicyAdvisor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor policyAdvisor) {
|
||||
throw new Error("This policy advisor is the test advisor");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"http://loinc.org|2.76" : null,
|
||||
"#f3b2bd36-199b-4591-b4db-f49db0912b6|null" : null,
|
||||
"#c1|null" : null,
|
||||
"http://something/something|null" : null,
|
||||
|
|
Loading…
Reference in New Issue