Skip to content

Commit

Permalink
WIP bump core.
Browse files Browse the repository at this point in the history
  • Loading branch information
dotasek committed Jan 4, 2025
1 parent 6e7649d commit 5b2a5d3
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 25 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fhirCoreVersion = 6.4.1-SNAPSHOT
fhirCoreVersion = 6.5.3-SNAPSHOT
apachePoiVersion = 5.2.1
jacksonVersion = 2.16.0
apacheHttpcomponentsVersion = 4.5.13
Expand All @@ -8,7 +8,7 @@ log4jVersion = 2.17.1

slf4jVersion = 1.7.36
jettyVersion = 11.0.20
logbackVersion = 1.2.13
logbackVersion = 1.5.15
nettyConstrainedVersion = 4.1.101.Final

## Leave the subsequent line blank for additional properties appended by azure builds
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
import org.hl7.fhir.definitions.model.Invariant;
import org.hl7.fhir.definitions.model.TypeRef;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.DataType;
Expand All @@ -64,6 +63,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.r5.utils.UserDataNames;
import org.hl7.fhir.tools.publisher.PageProcessor;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.StandardsStatus;
Expand All @@ -84,7 +84,6 @@ public DictHTMLGenerator(OutputStream out, PageProcessor page, String prefix) th
}

public void generate(StructureDefinition profile) throws Exception {
int i = 1;
write("<table class=\"dict\">\r\n");

for (ElementDefinition ec : profile.getSnapshot().getElement()) {
Expand Down Expand Up @@ -112,7 +111,7 @@ public void generate(StructureDefinition profile) throws Exception {
}
}
write("</table>\r\n");
i++;

flush();
close();
}
Expand Down Expand Up @@ -152,7 +151,7 @@ public void generateExtension(StructureDefinition ed) throws Exception {
}
}
write("</table>\r\n");
i++;
i++;
flush();
close();
}
Expand Down Expand Up @@ -391,7 +390,7 @@ public int compare(String s0, String s1) {
return s0.compareTo(s1);
int comp = parts0[0].compareTo(parts1[0]);
if (comp == 0 && Utilities.isInteger(parts0[1]) && Utilities.isInteger(parts1[1]))
return new Integer(parts0[1]).compareTo(new Integer(parts1[1]));
return Integer.valueOf(parts0[1]).compareTo(Integer.valueOf(parts1[1]));
else
return parts0[1].compareTo(parts1[1]);
}
Expand Down Expand Up @@ -428,8 +427,8 @@ private String presentLevel(ElementDefinitionConstraintComponent inv) {
}

private boolean isInherited(ElementDefinitionConstraintComponent id, StructureDefinition sd) {
if (id.hasUserData(ProfileUtilities.UD_IS_DERIVED)) {
Boolean b = (Boolean) id.getUserData(ProfileUtilities.UD_IS_DERIVED);
if (id.hasUserData(UserDataNames.SNAPSHOT_IS_DERIVED)) {
Boolean b = (Boolean) id.getUserData(UserDataNames.SNAPSHOT_IS_DERIVED);
return b.booleanValue();
} else {
// if it was snapshotted in process? can't happen? - only happens on extensions... no id too, and then definitely inherited. see https://xkcd.com/2200/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ public void checkContextValid(StructureDefinitionContextComponent ec, String con
throw new Error("The element context '"+ec.getExpression()+"' is not valid @ "+context);
} else if (ec.getType() == ExtensionContextType.FHIRPATH) {
FHIRPathEngine fpe = new FHIRPathEngine(worker);
TypeDetails td = fpe.check(null, null, null, ec.getExpression());
TypeDetails td = fpe.check(null, null, null,null, ec.getExpression());
if (td.hasNoTypes())
throw new Error("The resource context '"+ec.getExpression()+"' is not valid @ "+context);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static class UsageT {


public ResourceValidator(Definitions definitions, Translations translations, CanonicalResourceManager<CodeSystem> map, String srcFolder, List<FHIRPathUsage> fpUsages, List<String> suppressedMessages, IWorkerContext context) throws IOException {
super(context, null, true);
super(context, null, true, null);
source = Source.ResourceValidator;
this.definitions = definitions;
this.translations = translations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public VSDuplicateList(ValueSet vs) {
private Map<String, CodeSystem> codeSystems = new HashMap<String, CodeSystem>();

public ValueSetValidator(BuildWorkerContext context, List<String> fixups, Set<String> styleExemptions) {
super(context, null, true);
super(context, null, true, null);
this.context = context;
this.fixups = fixups;
this.styleExemptions = styleExemptions;
Expand Down Expand Up @@ -354,7 +354,7 @@ private boolean isKnownCodeSystem(String system) {
"http://www.radlex.org", "http://www.whocc.no/atc",
"urn:ietf:bcp:47", "urn:ietf:bcp:13", "urn:ietf:rfc:3986",
"urn:iso:std:iso:4217", "urn:iso:std:iso:11073:10101", "urn:iso-astm:E1762-95:2013",
"urn:iso:std:iso:3166", "urn:iso:std:iso:3166:-2", "urn:iso:std:iso:3166:-3", "http://nucc.org/provider-taxonomy",
"urn:iso:std:iso:3166", "urn:iso:std:iso:3166:-2", "urn:iso:std:iso:3166:-3", "http://nucc.org/provider-taxonomy",
"http://example.com", "http://example.org", "https://precision.fda.gov/files/", "http://www.ebi.ac.uk/ipd/imgt/hla",
"https://www.iana.org/time-zones", "https://precision.fda.gov/jobs/"))
return true;
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/org/hl7/fhir/tools/publisher/ExampleInspector.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public ExampleInspector(IWorkerContext context, Logger logger, String rootDir, S
private FHIRVersion version;

public void prepare() throws Exception {
validator = new InstanceValidator(context, hostServices, null);
validator = new InstanceValidator(context, hostServices, null, null);
validator.setSuppressLoincSnomedMessages(true);
validator.setResourceIdRule(IdStatus.REQUIRED);
validator.setBestPracticeWarningLevel(BestPracticeWarningLevel.Warning);
Expand Down Expand Up @@ -882,6 +882,16 @@ public boolean isSuppressMessageId(String path, String messageId) {
return false;
}

@Override
public IValidationPolicyAdvisor getPolicyAdvisor() {
return this;
}

@Override
public IValidationPolicyAdvisor setPolicyAdvisor(IValidationPolicyAdvisor iValidationPolicyAdvisor) {
return this;
}

@Override
public ReferenceValidationPolicy getReferencePolicy() {
return ReferenceValidationPolicy.IGNORE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
import org.hl7.fhir.r5.utils.TypesUtilities;
import org.hl7.fhir.r5.utils.TypesUtilities.TypeClassification;
import org.hl7.fhir.r5.utils.TypesUtilities.WildcardInformation;
import org.hl7.fhir.r5.utils.UserDataNames;
import org.hl7.fhir.r5.utils.structuremap.StructureMapUtilities;
import org.hl7.fhir.r5.utils.validation.IResourceValidator;
import org.hl7.fhir.tools.converters.MarkDownPreProcessor;
Expand Down Expand Up @@ -9704,7 +9705,7 @@ private boolean parentChainHasOptional(ElementDefinition ed, StructureDefinition
if (!ed.getPath().contains("."))
return false;

ElementDefinition match = (ElementDefinition) ed.getUserData(ProfileUtilities.UD_DERIVATION_POINTER);
ElementDefinition match = (ElementDefinition) ed.getUserData(UserDataNames.SNAPSHOT_DERIVATION_POINTER);
if (match == null)
return true; // really, we shouldn't get here, but this appears to be common in the existing profiles?
// throw new Error("no matches for "+ed.getPath()+"/"+ed.getName()+" in "+profile.getUrl());
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/hl7/fhir/tools/publisher/Publisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -1015,9 +1015,9 @@ private boolean testSearchParameter(SearchParameter sp, StructureDefinition rd)
String exp = sp.getExpression().replace("{{name}}", rd.getType()); // for templates
TypeDetails td = null;
if (sp.getBase().size() > 1) {
td = fpe.check(null, rd.getType(), page.getWorkerContext().getResourceNames(), fpe.parse(exp), set);
td = fpe.check(null, rd.getType(), rd.getType(), page.getWorkerContext().getResourceNames(), fpe.parse(exp), set);
} else {
td = fpe.check(null, rd.getType(), rd.getType(), fpe.parse(exp), set);
td = fpe.check(null, rd.getType(), rd.getType(), rd.getType(), fpe.parse(exp), set);
}
if (!Utilities.existsInList(sp.getCode(), "_id", "_in") && sp.getType() != SearchParamType.COMPOSITE) {
String types = page.getDefinitions().getAllowedSearchTypes().get(sp.getType().toCode());
Expand Down Expand Up @@ -1189,9 +1189,9 @@ private boolean checkInvariant(FHIRPathEngine fpe, StructureDefinition sd,
try {
Set<ElementDefinition> set = new HashSet<>();
if (sd.getKind() == StructureDefinitionKind.RESOURCE) {
fpe.check(null, sd.getType(), ed.getPath(), fpe.parse(inv.getExpression()), set);
fpe.check(null, sd.getType(), sd.getType(), ed.getPath(), fpe.parse(inv.getExpression()), set);
} else {
fpe.check(null, "Resource", ed.getPath(), fpe.parse(inv.getExpression()), set);
fpe.check(null, "Resource", "DomainResource", ed.getPath(), fpe.parse(inv.getExpression()), set);
}
for (ElementDefinition edt : set) {
if (!edt.getPath().equals(ed.getPath()) && map.containsKey(edt.getPath())) {
Expand Down Expand Up @@ -1494,7 +1494,7 @@ private void checkExpression(StringBuilder b, FHIRPathEngine fp, FHIRPathUsage p
b.append(p.getResource() + " (" + p.getContext() + "): " + p.getExpression()+"\r\n");
try {
if (!"n/a".equals(p.getExpression())) {
fp.check(null, p.getResource(), p.getContext(), p.getExpression());
fp.check(null, p.getResource(), p.getResource(), p.getContext(), p.getExpression());
}
} catch (Exception e) {
ValidationMessage validationMessage = new ValidationMessage(Source.Publisher, IssueType.STRUCTURE, -1, -1, p.getLocation(),
Expand Down Expand Up @@ -1532,7 +1532,7 @@ private Profile makeConformancePack(ResourceDefn r) {

private void validateProfile(ConstraintStructure p) throws Exception {
if (pv == null) {
pv = new ProfileValidator(page.getWorkerContext(), null);
pv = new ProfileValidator(page.getWorkerContext(), null, null);
}
page.getValidationErrors().addAll(pv.validate(p.getResource(), true));
}
Expand Down Expand Up @@ -2534,7 +2534,7 @@ private void validate() throws Exception {
page.log("Validating", LogMessageType.Process);
ResourceValidator val = new ResourceValidator(page.getDefinitions(), page.getTranslations(), page.getCodeSystems(), page.getFolders().srcDir, fpUsages, page.getSuppressedMessages(), page.getWorkerContext());
val.resolvePatterns();
ProfileValidator valp = new ProfileValidator(page.getWorkerContext(), null);
ProfileValidator valp = new ProfileValidator(page.getWorkerContext(), null, null);

for (String n : page.getDefinitions().getTypes().keySet())
page.getValidationErrors().addAll(val.checkStucture(n, page.getDefinitions().getTypes().get(n)));
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/hl7/fhir/tools/publisher/WinRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ private static String readString(Preferences root, int hkey, String key, String
new Integer(hkey), toCstr(key), new Integer(KEY_ALL_ACCESS) });

regSetValueEx.invoke(root,
new Object[] {
new Integer(handles[0]), toCstr(valueName), toCstr(value)
new Object[] {
handles[0], toCstr(valueName), toCstr(value)
});
regCloseKey.invoke(root, new Object[] { new Integer(handles[0]) });
regCloseKey.invoke(root, new Object[] {handles[0]});
}

// utility
Expand Down

0 comments on commit 5b2a5d3

Please sign in to comment.