From c31836e73444a3f4bad496cb47e24fc88fc372f9 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 1 Jun 2023 06:58:46 +0300 Subject: [PATCH 01/34] better error reporting when parsing fails outright --- .../src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java index 5c27a16f4..4f9db4d3b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java @@ -129,7 +129,7 @@ public abstract class ParserBase { if (res == null) { throw new FHIRException("Parsing FHIR content failed: "+errors.get(0).summary()); } else if (res.size() == 0) { - throw new FHIRException("Parsing FHIR content returned no elements in a context where one element is required"); + throw new FHIRException("Parsing FHIR content returned no elements in a context where one element is required because: "+errors.get(0).summary()); } if (res.size() != 1) { throw new FHIRException("Parsing FHIR content returned multiple elements in a context where only one element is allowed"); From bf19a2d2faafb10e3a2331eb0fd825ffa2883360 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 5 Jun 2023 21:14:56 +0200 Subject: [PATCH 02/34] Remove logical models in minifier, and other improvements --- .../fhir/convertors/misc/PackageMinifier.java | 5 +- .../ResourceDependencyPackageBuilder.java | 4 +- .../hl7/fhir/r5/utils/ResourceMinifier.java | 50 +++++++++++-------- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/PackageMinifier.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/PackageMinifier.java index 544db8f12..3b298a7eb 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/PackageMinifier.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/PackageMinifier.java @@ -29,8 +29,9 @@ public class PackageMinifier { for (PackageResourceInformation pri : src.listIndexedResources()) { if (min.isMinified(pri.getResourceType())) { Resource res = new JsonParser().parse(src.load(pri)); - min.minify(res); - tgt.addFile("package", res.fhirType()+"-"+res.getIdPart()+".json", new JsonParser().composeBytes(res), null); + if (min.minify(res)) { + tgt.addFile("package", res.fhirType()+"-"+res.getIdPart()+".json", new JsonParser().composeBytes(res), null); + } } } tgt.save(new FileOutputStream(target)); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/ResourceDependencyPackageBuilder.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/ResourceDependencyPackageBuilder.java index bc2a9867f..2b6cbdc71 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/ResourceDependencyPackageBuilder.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/ResourceDependencyPackageBuilder.java @@ -91,7 +91,9 @@ public class ResourceDependencyPackageBuilder { ResourceMinifier min = new ResourceMinifier(); if (min.isMinified(resource.fhirType())) { resource = resource.copy(); - min.minify(resource); + if (!min.minify(resource)) { + return; + } } else { return; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceMinifier.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceMinifier.java index 397078c22..0d9a2dc7a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceMinifier.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceMinifier.java @@ -32,7 +32,9 @@ import org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterCom import org.hl7.fhir.r5.model.Questionnaire; import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent; import org.hl7.fhir.r5.model.Resource; +import org.hl7.fhir.r5.model.SearchParameter; import org.hl7.fhir.r5.model.StructureDefinition; +import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.utilities.Utilities; @@ -46,33 +48,32 @@ public class ResourceMinifier { "ConceptMap", "NamingSystem", "OperationDefinition", "SearchParameter", "Questionnaire"); } - public void minify(Resource res) { + public boolean minify(Resource res) { if (res instanceof StructureDefinition) { - minifySD((StructureDefinition) res); - } - if (res instanceof ValueSet) { + return minifySD((StructureDefinition) res); + } else if (res instanceof ValueSet) { minifyVS((ValueSet) res); - } - if (res instanceof CodeSystem) { + } else if (res instanceof CodeSystem) { minifyCS((CodeSystem) res); - } - if (res instanceof CapabilityStatement) { + } else if (res instanceof CapabilityStatement) { minifyCS((CapabilityStatement) res); - } - if (res instanceof ConceptMap) { + } else if (res instanceof ConceptMap) { minifyCM((ConceptMap) res); - } - if (res instanceof NamingSystem) { + } else if (res instanceof NamingSystem) { minifyNS((NamingSystem) res); - } - - if (res instanceof OperationDefinition) { + } else if (res instanceof OperationDefinition) { minifyOD((OperationDefinition) res); - } - - if (res instanceof Questionnaire) { + } else if (res instanceof Questionnaire) { minifyQ((Questionnaire) res); + } else if (res instanceof SearchParameter) { + minifySP((SearchParameter) res); } + return true; + } + + private void minifySP(SearchParameter sp) { + minCR(sp); + // nothing } private void minifyQ(Questionnaire q) { @@ -242,14 +243,20 @@ public class ResourceMinifier { // can't remove anything else } - private void minifySD(StructureDefinition sd) { + private boolean minifySD(StructureDefinition sd) { + if (sd.getKind() == StructureDefinitionKind.LOGICAL) { + return false; + } minCR(sd); sd.setKeyword(null); - sd.setMapping(null); - sd.setSnapshot(null); + sd.setMapping(null); + if (sd.hasDifferential()) { + sd.setSnapshot(null); + } for (ElementDefinition ed : sd.getDifferential().getElement()) { minifyED(ed); } + return true; } private void minifyED(ElementDefinition ed) { @@ -272,6 +279,7 @@ public class ResourceMinifier { abn.setShortDoco(null); } ed.setMapping(null); + ed.setMustSupportElement(null); } private void minCR(CanonicalResource cr) { From 1c4ef1fa0029c031ea8dee1716388d2a583a2235 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 5 Jun 2023 21:15:31 +0200 Subject: [PATCH 03/34] Improve message when there's multiple display options --- .../r5/terminologies/validation/ValueSetValidator.java | 10 +++++----- pom.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java index 6e32be61f..1079bea84 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java @@ -665,16 +665,16 @@ public class ValueSetValidator { if (code.getDisplay() == null) { return new ValidationResult(code.getSystem(), cs.getVersion(), cc, vc.getDisplay()); } - CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(", ", " or "); if (cc.hasDisplay() && isOkLanguage(cs.getLanguage())) { - b.append(cc.getDisplay()); + b.append("'"+cc.getDisplay()+"'"); if (code.getDisplay().equalsIgnoreCase(cc.getDisplay())) { return new ValidationResult(code.getSystem(), cs.getVersion(), cc, getPreferredDisplay(cc, cs)); } } for (ConceptDefinitionDesignationComponent ds : cc.getDesignation()) { if (isOkLanguage(ds.getLanguage())) { - b.append(ds.getValue()); + b.append("'"+ds.getValue()+"'"); if (code.getDisplay().equalsIgnoreCase(ds.getValue())) { return new ValidationResult(code.getSystem(),cs.getVersion(), cc, getPreferredDisplay(cc, cs)); } @@ -685,14 +685,14 @@ public class ValueSetValidator { ConceptReferencePair vs = findValueSetRef(code.getSystem(), code.getCode()); if (vs != null && (vs.getCc().hasDisplay() ||vs.getCc().hasDesignation())) { if (vs.getCc().hasDisplay() && isOkLanguage(vs.getValueset().getLanguage())) { - b.append(vs.getCc().getDisplay()); + b.append("'"+vs.getCc().getDisplay()+"'"); if (code.getDisplay().equalsIgnoreCase(vs.getCc().getDisplay())) { return new ValidationResult(code.getSystem(), cs.getVersion(), cc, getPreferredDisplay(cc, cs)); } } for (ConceptReferenceDesignationComponent ds : vs.getCc().getDesignation()) { if (isOkLanguage(ds.getLanguage())) { - b.append(ds.getValue()); + b.append("'"+ds.getValue()+"'"); if (code.getDisplay().equalsIgnoreCase(ds.getValue())) { return new ValidationResult(code.getSystem(), cs.getVersion(), cc, getPreferredDisplay(cc, cs)); } diff --git a/pom.xml b/pom.xml index c8c2087e4..c299bb8ad 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 6.4.1 - 1.3.8 + 1.3.9-SNAPSHOT 2.14.0 5.9.2 1.8.2 From fd346cc67bcefa079f304b083d91e4b0d8cc1204 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 5 Jun 2023 21:16:14 +0200 Subject: [PATCH 04/34] Auto update minimum slicing cardinality when slicer is assumed (extensions) --- .../profile/ProfilePathProcessor.java | 16 ++++++++-------- .../r5/conformance/profile/ProfileUtilities.java | 12 ++++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java index e216982f7..ace171827 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java @@ -157,8 +157,7 @@ public class ProfilePathProcessor { * @throws DefinitionException, FHIRException * @throws Exception */ - private ElementDefinition processPaths( - final ProfilePathProcessorState cursors) throws FHIRException { + private ElementDefinition processPaths(final ProfilePathProcessorState cursors) throws FHIRException { debugProcessPathsEntry(cursors); ElementDefinition res = null; List typeList = new ArrayList<>(); @@ -253,9 +252,8 @@ public class ProfilePathProcessor { .incrementDebugIndent() .withBaseLimit(newBaseLimit) .withDiffLimit(newDiffLimit) - .withProfileName(getProfileName() + profileUtilities.pathTail(diffMatches, 0)).withSlicing(new PathSlicingParams(true, null, null)). - processPaths(new ProfilePathProcessorState(cursors.base, cursors.baseCursor, newDiffCursor, - cursors.contextName, cursors.resultPathBase)); + .withProfileName(getProfileName() + profileUtilities.pathTail(diffMatches, 0)).withSlicing(new PathSlicingParams(true, null, null)) + .processPaths(new ProfilePathProcessorState(cursors.base, cursors.baseCursor, newDiffCursor, cursors.contextName, cursors.resultPathBase)); if (e == null) throw new FHIRException(profileUtilities.getContext().formatMessage(I18nConstants.DID_NOT_FIND_SINGLE_SLICE_, diffMatches.get(0).getPath())); e.setSlicing(diffMatches.get(0).getSlicing()); @@ -267,9 +265,10 @@ public class ProfilePathProcessor { outcome.setPath(profileUtilities.fixedPathDest(getContextPathTarget(), outcome.getPath(), getRedirector(), getContextPathSource())); profileUtilities.updateFromBase(outcome, currentBase, getSourceStructureDefinition().getUrl()); - if (!diffMatches.get(0).hasSlicing()) + if (!diffMatches.get(0).hasSlicing()) { outcome.setSlicing(profileUtilities.makeExtensionSlicing()); - else { + outcome.setUserData("auto-added-slicing", true); + } else { outcome.setSlicing(diffMatches.get(0).getSlicing().copy()); for (int i = 1; i < diffMatches.size(); i++) { if (diffMatches.get(i).hasSlicing()) { @@ -348,7 +347,8 @@ public class ProfilePathProcessor { .withBaseLimit(newBaseLimit) .withDiffLimit(newDiffLimit) .withProfileName(getProfileName() + profileUtilities.pathTail(diffMatches, i)) - .withSlicing(new PathSlicingParams(true, slicerElement, null)).processPaths(new ProfilePathProcessorState(cursors.base, cursors.baseCursor, newDiffCursor, cursors.contextName, cursors.resultPathBase)); + .withSlicing(new PathSlicingParams(true, slicerElement, null)) + .processPaths(new ProfilePathProcessorState(cursors.base, cursors.baseCursor, newDiffCursor, cursors.contextName, cursors.resultPathBase)); } // ok, done with that - next in the base list cursors.baseCursor = newBaseLimit + 1; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java index 29472eb34..5255bfb38 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java @@ -777,17 +777,21 @@ public class ProfileUtilities extends TranslatingUtilities { int count = slice.checkMin(); boolean repeats = !"1".equals(slice.getFocus().getBase().getMax()); // type slicing if repeats = 1 if (count > -1 && repeats) { - String msg = "The slice definition for "+slice.getFocus().getId()+" has a minimum of "+slice.getFocus().getMin()+" but the slices add up to a minimum of "+count; - messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url+"#"+ed.getId(), msg, forPublication ? ValidationMessage.IssueSeverity.ERROR : ValidationMessage.IssueSeverity.INFORMATION)); + if (slice.getFocus().hasUserData("auto-added-slicing")) { + slice.getFocus().setMin(count); + } else { + String msg = "The slice definition for "+slice.getFocus().getId()+" has a minimum of "+slice.getFocus().getMin()+" but the slices add up to a minimum of "+count; + messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url+"#"+slice.getFocus().getId(), msg, forPublication ? ValidationMessage.IssueSeverity.ERROR : ValidationMessage.IssueSeverity.INFORMATION)); + } } count = slice.checkMax(); if (count > -1 && repeats) { String msg = "The slice definition for "+slice.getFocus().getId()+" has a maximum of "+slice.getFocus().getMax()+" but the slices add up to a maximum of "+count+". Check that this is what is intended"; - messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url+"#"+ed.getId(), msg, ValidationMessage.IssueSeverity.INFORMATION)); + messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url+"#"+slice.getFocus().getId(), msg, ValidationMessage.IssueSeverity.INFORMATION)); } if (!slice.checkMinMax()) { String msg = "The slice definition for "+slice.getFocus().getId()+" has a maximum of "+slice.getFocus().getMax()+" which is less than the minimum of "+slice.getFocus().getMin(); - messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url+"#"+ed.getId(), msg, ValidationMessage.IssueSeverity.WARNING)); + messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url+"#"+slice.getFocus().getId(), msg, ValidationMessage.IssueSeverity.WARNING)); } slices.remove(s); } From fe7cd1f39a35760a252223dc423b88e8433261f6 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 5 Jun 2023 21:16:28 +0200 Subject: [PATCH 05/34] Clean up extension loading issue --- .../org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java index c44cd301f..1f1321470 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java @@ -123,16 +123,20 @@ public class R5ExtensionsLoader { if (Utilities.existsInList(lsd.info.getId(), types)) { StructureDefinition sd = lsd.getResource(); count++; + List rl = new ArrayList<>(); for (ElementDefinition ed : sd.getDifferential().getElement()) { if (!stripTypes(ed, sd, types)) { - System.out.println("A problem..."); + rl.add(ed); } } + sd.getDifferential().getElement().removeAll(rl); + rl.clear(); for (ElementDefinition ed : sd.getSnapshot().getElement()) { if (!stripTypes(ed, sd, types)) { - System.out.println("A problem..."); + rl.add(ed); } } + sd.getSnapshot().getElement().removeAll(rl); sd.setWebPath(Utilities.pathURL(lsd.source.getWebLocation(), sd.getId().toLowerCase()+".html")); registerTerminologies(sd); context.cacheResourceFromPackage(sd, new PackageInformation(lsd.source)); From 01b4219259c6f7f76ee7fee0509b3ea6ea8dafb6 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 5 Jun 2023 21:16:51 +0200 Subject: [PATCH 06/34] update language file handling to handle context properly --- .../fhir/r5/elementmodel/LanguageUtils.java | 25 ++++++++++--- .../r5/utils/ResourceLanguageFileBuilder.java | 7 +++- .../utilities/i18n/JsonLangFileProducer.java | 12 +++++-- .../utilities/i18n/LanguageFileProducer.java | 36 +++++++++++++++---- .../utilities/i18n/PoGetTextProducer.java | 18 +++++----- .../fhir/utilities/i18n/XLIFFProducer.java | 25 ++++++++----- 6 files changed, 91 insertions(+), 32 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java index d224dcfc5..29aec862a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java @@ -12,6 +12,8 @@ import org.hl7.fhir.r5.context.IWorkerContext; import org.hl7.fhir.r5.model.CodeSystem; import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent; import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent; +import org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent; +import org.hl7.fhir.r5.model.DataType; import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.terminologies.CodeSystemUtilities; import org.hl7.fhir.utilities.TextFile; @@ -36,7 +38,7 @@ import org.hl7.fhir.utilities.i18n.LanguageFileProducer.TranslationUnit; */ public class LanguageUtils { - public static final List TRANSLATION_SUPPLEMENT_RESOURCE_TYPES = Arrays.asList("CodeSystem", "StructureDefinition"); + public static final List TRANSLATION_SUPPLEMENT_RESOURCE_TYPES = Arrays.asList("CodeSystem", "StructureDefinition", "Questionnaire"); private static final String ORPHAN_TRANSLATIONS_NAME = "translations.orphans"; @@ -64,7 +66,7 @@ public class LanguageUtils { if (translation == null) { translation = element.getTranslation(langSession.getTargetLang()); } - langSession.entry(new TextUnit(pathForElement(element), base, translation)); + langSession.entry(new TextUnit(pathForElement(element), contextForElement(element), base, translation)); } } for (Element c: element.getChildren()) { @@ -75,6 +77,10 @@ public class LanguageUtils { } + private String contextForElement(Element element) { + throw new Error("Not done yet"); + } + private String getSpecialTranslation(Element parent, Element element, String targetLang) { if (parent == null) { return null; @@ -188,7 +194,7 @@ public class LanguageUtils { private Set findTranslations(String path, String src, Set translations) { Set res = new HashSet<>(); for (TranslationUnit translation : translations) { - if (path.equals(translation.getContext()) && src.equals(translation.getSrcText())) { + if (path.equals(translation.getId()) && src.equals(translation.getSrcText())) { res.add(translation); } } @@ -202,7 +208,7 @@ public class LanguageUtils { public static void fillSupplement(CodeSystem cs, List list) { cs.setUserData(SUPPLEMENT_NAME, "true"); for (TranslationUnit tu : list) { - ConceptDefinitionComponent cd = CodeSystemUtilities.getCode(cs, tu.getContext()); + ConceptDefinitionComponent cd = CodeSystemUtilities.getCode(cs, tu.getId()); if (cd != null && cd.hasDisplay() && cd.getDisplay().equals(tu.getSrcText())) { cd.addDesignation().setLanguage(tu.getLanguage()).setValue(tu.getTgtText()); } else { @@ -273,9 +279,18 @@ public class LanguageUtils { target = d.getValue(); } } - list.add(new TranslationUnit(lang, code, display, target)); + list.add(new TranslationUnit(lang, code, getDefinition(cd), display, target)); for (ConceptDefinitionComponent cd1 : cd.getConcept()) { generateTranslations(list, cd1, lang); } } + + private static String getDefinition(ConceptDefinitionComponent cd) { + ConceptPropertyComponent v = CodeSystemUtilities.getProperty(cd, "translation-context"); + if (v != null && v.hasValue()) { + return v.getValue().primitiveValue(); + } else { + return cd.getDefinition(); + } + } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceLanguageFileBuilder.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceLanguageFileBuilder.java index 8943beb01..27af2116f 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceLanguageFileBuilder.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceLanguageFileBuilder.java @@ -77,7 +77,7 @@ public class ResourceLanguageFileBuilder { String ppath = path+"."+p.getName()+(p.isList() ? "["+i+"]" : ""); i++; if (isTranslatable(p, b, pid)) { - sess.entry(new TextUnit(ppath, b.primitiveValue(), getTranslation(b, target))); + sess.entry(new TextUnit(ppath, getContext(), b.primitiveValue(), getTranslation(b, target))); } for (Property pp : b.children()) { process(sess, pp, pid, ppath); @@ -86,6 +86,11 @@ public class ResourceLanguageFileBuilder { } } + private String getContext() { + throw new Error("not done yet"); + } + + private boolean isTranslatable(Property p, Base b, String id) { if (new ContextUtilities(context).isPrimitiveDatatype(b.fhirType())) { // never any translations for non-primitives ElementDefinition ed = null; diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/JsonLangFileProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/JsonLangFileProducer.java index 2b5e1e8d1..d24e8b2f9 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/JsonLangFileProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/JsonLangFileProducer.java @@ -74,7 +74,10 @@ public class JsonLangFileProducer extends LanguageFileProducer { public void entry(TextUnit unit) { JsonObject entry = new JsonObject(); json.forceArray("entries").add(entry); - entry.add("context", unit.getContext()); + entry.add("id", unit.getId()); + if (unit.getContext1() != null) { + entry.add("context", unit.getContext1()); + } entry.add("source", unit.getSrcText()); entry.add("target", unit.getTgtText()); } @@ -88,7 +91,7 @@ public class JsonLangFileProducer extends LanguageFileProducer { JsonObject json = JsonParser.parseObject(source); for (JsonObject lang : json.forceArray("languages").asJsonObjects()) { for (JsonObject entry : lang.forceArray("entries").asJsonObjects()) { - list.add(new TranslationUnit(lang.asString("targetLang"), entry.asString("context"), entry.asString("source"), entry.asString("target"))); + list.add(new TranslationUnit(lang.asString("targetLang"), entry.asString("id"), entry.asString("context"), entry.asString("source"), entry.asString("target"))); } } return list; @@ -118,7 +121,10 @@ public class JsonLangFileProducer extends LanguageFileProducer { for (TranslationUnit tu : translations) { JsonObject entry = new JsonObject(); lj.forceArray("entries").add(entry); - entry.add("context", tu.getContext()); + entry.add("id", tu.getId()); + if (tu.getContext1() != null) { + entry.add("context", tu.getContext1()); + } entry.add("source", tu.getSrcText()); entry.add("target", tu.getTgtText()); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/LanguageFileProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/LanguageFileProducer.java index 97da04bb7..2b5a1e19d 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/LanguageFileProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/LanguageFileProducer.java @@ -18,35 +18,59 @@ import java.util.HashMap; public abstract class LanguageFileProducer { public static class TextUnit { + protected String id; protected String context; protected String srcText; protected String tgtText; - public TextUnit(String context, String srcText, String tgtText) { + public TextUnit(String id, String context, String srcText, String tgtText) { super(); + this.id = id; this.context = context; this.srcText = srcText; this.tgtText = tgtText; } - public String getContext() { + /** + * The identity of the item being translated + * + * @return + */ + public String getId() { + return id; + } + + /** + * Additional language that helps establish the context + * @return + */ + public String getContext1() { return context; } + /** + * The language that's being translated from + * + * @return + */ public String getSrcText() { return srcText; } + + /** + * The language that's being translated to + * + * @return + */ public String getTgtText() { return tgtText; } - - } public static class TranslationUnit extends TextUnit { private String language; - public TranslationUnit(String language, String context, String srcText, String tgtText) { - super(context, srcText, tgtText); + public TranslationUnit(String language, String id, String context, String srcText, String tgtText) { + super(id, context, srcText, tgtText); this.language = language; } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java index b035fb82e..798adc645 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java @@ -81,10 +81,10 @@ public class PoGetTextProducer extends LanguageFileProducer { @Override public void entry(TextUnit unit) { - ln("#: "+unit.getContext()); - // if (context != null) { - // ln("#. "+context); - // } + ln("#: "+unit.getId()); + if (unit.getContext1() != null) { + ln("#. "+unit.getContext1()); + } ln("msgid \""+unit.getSrcText()+"\""); ln("msgstr \""+(unit.getTgtText() == null ? "" : unit.getTgtText())+"\""); ln(""); @@ -117,7 +117,7 @@ public class PoGetTextProducer extends LanguageFileProducer { lang = p[1].trim(); } } else if (s.startsWith("#:")) { - tu = new TranslationUnit(lang, s.substring(2).trim(), null, null); + tu = new TranslationUnit(lang, s.substring(2).trim(), null, null, null); } else { throw new IOException("Encountered unexpected line '"+s+"'"); } @@ -166,10 +166,10 @@ public class PoGetTextProducer extends LanguageFileProducer { ln(po, "# "+baseLang+" -> "+targetLang); ln(po, ""); for (TranslationUnit tu : translations) { - ln(po, "#: "+tu.getContext()); - // if (context != null) { - // ln("#. "+context); - // } + ln(po, "#: "+tu.getId()); + if (tu.getContext1() != null) { + ln(po, "#. "+tu.getContext1()); + } ln(po, "msgid \""+tu.getSrcText()+"\""); ln(po, "msgstr \""+(tu.getTgtText() == null ? "" : tu.getTgtText())+"\""); ln(po, ""); diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java index d4c6c1ac1..33ad53b71 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java @@ -50,12 +50,12 @@ public class XLIFFProducer extends LanguageFileProducer { @Override public void entry(TextUnit unit) { i++; - ln(" "); -// if (context != null) { -// ln(" "); -// ln(" "+Utilities.escapeXml(context)+""); -// ln(" "); -// } + ln(" "); + if (unit.getContext1() != null) { + ln(" "); + ln(" "+Utilities.escapeXml(unit.getContext1())+""); + ln(" "); + } ln(" "+Utilities.escapeXml(unit.getSrcText())+""); ln(" "+Utilities.escapeXml(unit.getTgtText())+""); ln(" "); @@ -114,7 +114,9 @@ public class XLIFFProducer extends LanguageFileProducer { for (Element file : XMLUtil.getNamedChildren(xliff, "file")) { Element body = XMLUtil.getNamedChild(file, "body"); for (Element transUnit : XMLUtil.getNamedChildren(body, "trans-unit")) { - TranslationUnit tu = new TranslationUnit(file.getAttribute("target-language"), transUnit.getAttribute("id"), + Element notes = XMLUtil.getNamedChild(transUnit, "notes"); + TranslationUnit tu = new TranslationUnit(file.getAttribute("target-language"), transUnit.getAttribute("id"), + notes == null ? null : XMLUtil.getNamedChildText(notes, "note"), XMLUtil.getNamedChildText(transUnit, "source"), XMLUtil.getNamedChildText(transUnit, "target")); if (!Utilities.noString(tu.getSrcText()) && !Utilities.noString(tu.getTgtText())) { list.add(tu); @@ -149,7 +151,14 @@ public class XLIFFProducer extends LanguageFileProducer { ln(xml, " "); ln(xml, " "); for (TranslationUnit tu : translations) { - ln(xml, " "); + int i = 0; + ln(xml, " "); + if (tu.getContext1() != null) { + i++; + ln(xml, " "); + ln(xml, " "+Utilities.escapeXml(tu.getContext1())+""); + ln(xml, " "); + } ln(xml, " "+Utilities.escapeXml(tu.getSrcText())+""); ln(xml, " "+Utilities.escapeXml(tu.getTgtText())+""); ln(xml, " "); From 0bcb9d6196d394422a1222ee1abf1eada83b8928 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 5 Jun 2023 21:17:02 +0200 Subject: [PATCH 07/34] make NPM packages slightly smaller --- .../main/java/org/hl7/fhir/utilities/npm/NpmPackage.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackage.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackage.java index e9dc0283e..dd1aaa66d 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackage.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackage.java @@ -52,6 +52,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.zip.Deflater; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -60,6 +61,7 @@ import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; +import org.apache.commons.compress.compressors.gzip.GzipParameters; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.SimpleHTTPClient; @@ -946,7 +948,9 @@ public class NpmPackage { OutputStream = new ByteArrayOutputStream(); bufferedOutputStream = new BufferedOutputStream(OutputStream); - gzipOutputStream = new GzipCompressorOutputStream(bufferedOutputStream); + GzipParameters gp = new GzipParameters(); + gp.setCompressionLevel(Deflater.BEST_COMPRESSION); + gzipOutputStream = new GzipCompressorOutputStream(stream, gp); tar = new TarArchiveOutputStream(gzipOutputStream); From 33d60c2496bb74cc3959e2eb111a05eb32d17e63 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 5 Jun 2023 21:17:12 +0200 Subject: [PATCH 08/34] clean up display error messages --- org.hl7.fhir.utilities/src/main/resources/Messages.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index 8f9e00bc2..b32cf1441 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -463,8 +463,8 @@ Version_mismatch_The_context_has_version__loaded_and_the_new_content_being_loade Error_reading__from_package__ = Error reading {0} from package {1}#{2}: {3} Error_parsing_ = Error parsing {0}:{1} Unable_to_connect_to_terminology_server_Use_parameter_tx_na_tun_run_without_using_terminology_services_to_validate_LOINC_SNOMED_ICDX_etc_Error__ = Unable to connect to terminology server. Use parameter ''-tx n/a'' to run without using terminology services to validate LOINC, SNOMED, ICD-X etc. Error = {0} -Display_Name_for__should_be_one_of__instead_of_one = Wrong Display Name ''{4}'' for {1}#{2} - should be ''{3}'' (for the language(s) ''{5}'') -Display_Name_for__should_be_one_of__instead_of_other = Wrong Display Name ''{4}'' for {1}#{2} - should be one of {0} choices: ''{3}'' for the language(s) ''{5}'' +Display_Name_for__should_be_one_of__instead_of_one = Wrong Display Name ''{4}'' for {1}#{2} - should be {3} (for the language(s) ''{5}'') +Display_Name_for__should_be_one_of__instead_of_other = Wrong Display Name ''{4}'' for {1}#{2} - should be one of {0} choices: {3} (for the language(s) ''{5}'') Unknown_Code__in_ = Unknown Code ''{0}'' in the system ''{1}'' UNKNOWN_CODE__IN_FRAGMENT = Unknown Code ''{0}'' in the system ''{1}'' - note that the code system is labeled as a fragment, so the code may be valid in some other fragment Code_found_in_expansion_however_ = Code found in expansion, however: {0} From 8924aecf3803c4723fb733c45371479f7115b551 Mon Sep 17 00:00:00 2001 From: Mark Iantorno Date: Tue, 6 Jun 2023 19:15:16 +0000 Subject: [PATCH 09/34] Updating test case dependency to v1.3.9 ***NO_CI*** --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7c0bf1213..e2dab2bfe 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 6.4.1 - 1.3.9-SNAPSHOT + 1.3.9 2.14.0 5.9.2 1.8.2 From 5ddecd1ef86e1398be2db8a869b9d4fda0998a2d Mon Sep 17 00:00:00 2001 From: dotasek Date: Tue, 6 Jun 2023 15:38:11 -0400 Subject: [PATCH 10/34] Bump test cases to release 1.3.9 (#1292) * Bump test cases to release version * Release notes. --- RELEASE_NOTES.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7b06c6ab5..e8da51b47 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,11 @@ ## Validator Changes -* no changes +* Improve message when there's multiple display options ## Other code changes -* no changes \ No newline at end of file +* Fix loading issue with r5 extensions +* NPM package compression improvements +* Update language file handling to handle context +* Remove logical models in minifier, and other improvements +* Auto update minimum slicing cardinality when slicer is assumed (extensions) \ No newline at end of file From 8edd61a1972d82207985a228dfb152fffb374e5a Mon Sep 17 00:00:00 2001 From: markiantorno Date: Tue, 6 Jun 2023 20:55:08 +0000 Subject: [PATCH 11/34] Release: v6.0.12 ## Validator Changes * Improve message when there's multiple display options ## Other code changes * Fix loading issue with r5 extensions * NPM package compression improvements * Update language file handling to handle context * Remove logical models in minifier, and other improvements * Auto update minimum slicing cardinality when slicer is assumed (extensions) ***NO_CI*** --- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 5a2867c84..4519c9899 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index eb823af56..acf380982 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index dec0cdf1e..85f572e1b 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index 1904c1004..bf923d755 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index fc5f73b2c..a338d6ae1 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index c8ddbce9d..df5148482 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 2d01770c8..824c5fd07 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index 587cec06f..8c2cfcd64 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 0def980d4..0ab674310 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 07c476427..eb81efc22 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 5429e5883..b1e6d276c 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 ../pom.xml diff --git a/pom.xml b/pom.xml index e2dab2bfe..b61e4cad3 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.0.12-SNAPSHOT + 6.0.12 pom From a605d944bcbbaa4cb9d5532f69bfbbd950e82520 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Tue, 6 Jun 2023 21:27:18 +0000 Subject: [PATCH 12/34] Updating version to: 6.0.13-SNAPSHOT and incrementing test cases dependency. --- RELEASE_NOTES.md | 8 ++------ org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 14 insertions(+), 18 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e8da51b47..7b06c6ab5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,11 +1,7 @@ ## Validator Changes -* Improve message when there's multiple display options +* no changes ## Other code changes -* Fix loading issue with r5 extensions -* NPM package compression improvements -* Update language file handling to handle context -* Remove logical models in minifier, and other improvements -* Auto update minimum slicing cardinality when slicer is assumed (extensions) \ No newline at end of file +* no changes \ No newline at end of file diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 4519c9899..3728f95bd 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index acf380982..fb977bf01 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 85f572e1b..fbbb11729 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index bf923d755..35cec9e81 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index a338d6ae1..4304e641e 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index df5148482..6b04fcfd6 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 824c5fd07..9218e5b0e 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index 8c2cfcd64..d6320c9b0 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 0ab674310..1eda5c029 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index eb81efc22..26a73b4a6 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index b1e6d276c..373cdf616 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index b61e4cad3..b853a5bfb 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.0.12 + 6.0.13-SNAPSHOT pom From bfdb28b96efe6828d622cefcb510c393fbdcce55 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 7 Jun 2023 13:57:56 +0200 Subject: [PATCH 13/34] add JsonObject.clear() --- .../hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java | 1 - .../java/org/hl7/fhir/utilities/json/model/JsonObject.java | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java index ace171827..467b913a6 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java @@ -169,7 +169,6 @@ public class ProfilePathProcessor { debugProcessPathsIteration(cursors, currentBasePath); List diffMatches = profileUtilities.getDiffMatches(getDifferential(), currentBasePath, cursors.diffCursor, getDiffLimit(), getProfileName()); // get a list of matching elements in scope - // in the simple case, source is not sliced. if (!currentBase.hasSlicing() || currentBasePath.equals(getSlicing().getPath())) { diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/model/JsonObject.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/model/JsonObject.java index ff24e28c8..27496aeed 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/model/JsonObject.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/model/JsonObject.java @@ -389,5 +389,9 @@ public class JsonObject extends JsonElement { this.extraComma = extraComma; } + public void clear() { + properties.clear(); + propMap.clear(); + } } From 9b9e50e0be9f51e6579f898c1d9b060216291994 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 7 Jun 2023 14:08:22 +0200 Subject: [PATCH 14/34] release notes --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7b06c6ab5..63230ff10 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,4 +4,4 @@ ## Other code changes -* no changes \ No newline at end of file +* add clear() to JsonObject From b704ea50fc5b22f3380fa539f7c646e47b068299 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Wed, 7 Jun 2023 12:48:04 +0000 Subject: [PATCH 15/34] Release: v6.0.13 ## Validator Changes * no changes ## Other code changes * add clear() to JsonObject ***NO_CI*** --- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 3728f95bd..76a140cea 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index fb977bf01..31062b961 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index fbbb11729..b33a8cdfb 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index 35cec9e81..c80a1b020 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 4304e641e..fddd25f6a 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 6b04fcfd6..911ebe564 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 9218e5b0e..fa30fef3b 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index d6320c9b0..f85672543 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 1eda5c029..84048dff6 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 26a73b4a6..12c096f45 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 373cdf616..8c18d4395 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 ../pom.xml diff --git a/pom.xml b/pom.xml index b853a5bfb..7a19bca36 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.0.13-SNAPSHOT + 6.0.13 pom From 619703dbf86f62c4a315f3d36eb8e3ca43a6c181 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Wed, 7 Jun 2023 13:14:17 +0000 Subject: [PATCH 16/34] Updating version to: 6.0.14-SNAPSHOT and incrementing test cases dependency. --- RELEASE_NOTES.md | 2 +- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 63230ff10..7b06c6ab5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,4 +4,4 @@ ## Other code changes -* add clear() to JsonObject +* no changes \ No newline at end of file diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 76a140cea..593b8271e 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 31062b961..4399b1341 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index b33a8cdfb..c52c586b0 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index c80a1b020..04c47f95b 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index fddd25f6a..da083f383 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 911ebe564..a400bea99 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index fa30fef3b..0df0643db 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index f85672543..ffcd949e4 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 84048dff6..74af1f639 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 12c096f45..1865cd329 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 8c18d4395..9a8ba4127 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 7a19bca36..3f6c82c2e 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.0.13 + 6.0.14-SNAPSHOT pom From f05345774d0ef4ffc7f372a1e0cdf335d20a56cf Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 7 Jun 2023 13:52:14 -0400 Subject: [PATCH 17/34] Trivy vulnerability scan (#1293) * Create trivy.yml * Update trivy.yml * Change scanning config --- .github/workflows/trivy.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/trivy.yml diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml new file mode 100644 index 000000000..17379c852 --- /dev/null +++ b/.github/workflows/trivy.yml @@ -0,0 +1,34 @@ +name: Security Scans + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + + +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run static analysis + uses: aquasecurity/trivy-action@master + with: + scan-type: 'fs' + vuln-type: 'library' + scanners: 'vuln,secret,config' + ignore-unfixed: true + format: 'sarif' + output: 'trivy-results.sarif' + severity: 'MEDIUM,HIGH,CRITICAL' + + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'trivy-results.sarif' + category: 'code' From 2a35adf5d0fa0f64f47c24ae4ef24a75c1720c9a Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 7 Jun 2023 13:55:24 -0400 Subject: [PATCH 18/34] Update trivy.yml --- .github/workflows/trivy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 17379c852..08cc7559b 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -5,7 +5,8 @@ on: branches: [ "master" ] pull_request: branches: [ "master" ] - + + workflow_dispatch: jobs: build: From 85c215229d1f5a0c72b82a378722adc42c5d02ab Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 7 Jun 2023 14:12:25 -0400 Subject: [PATCH 19/34] Bump code to trigger master pipeline --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7b06c6ab5..3b263f099 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,4 +4,4 @@ ## Other code changes -* no changes \ No newline at end of file +* no changes From 19c68486e846eef7e963e70e596eef6d9028f6a9 Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 7 Jun 2023 14:35:40 -0400 Subject: [PATCH 20/34] Test master trigger (delete blank line) From 8c412d78ef767878df60134e9c0c3e0c43e8afb2 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 7 Jun 2023 21:31:25 +0200 Subject: [PATCH 21/34] fix bugs in language handling --- .../java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java | 4 ++++ .../main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java index 798adc645..aea09cdfe 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java @@ -118,6 +118,10 @@ public class PoGetTextProducer extends LanguageFileProducer { } } else if (s.startsWith("#:")) { tu = new TranslationUnit(lang, s.substring(2).trim(), null, null, null); + } else if (s.startsWith("#.")) { + if (tu != null) { + tu.setContext(s.substring(2).trim()); + } } else { throw new IOException("Encountered unexpected line '"+s+"'"); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java index 33ad53b71..f15fdbc27 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java @@ -115,7 +115,7 @@ public class XLIFFProducer extends LanguageFileProducer { Element body = XMLUtil.getNamedChild(file, "body"); for (Element transUnit : XMLUtil.getNamedChildren(body, "trans-unit")) { Element notes = XMLUtil.getNamedChild(transUnit, "notes"); - TranslationUnit tu = new TranslationUnit(file.getAttribute("target-language"), transUnit.getAttribute("id"), + TranslationUnit tu = new TranslationUnit(file.getAttribute("target-language"), transUnit.getAttribute("resname"), notes == null ? null : XMLUtil.getNamedChildText(notes, "note"), XMLUtil.getNamedChildText(transUnit, "source"), XMLUtil.getNamedChildText(transUnit, "target")); if (!Utilities.noString(tu.getSrcText()) && !Utilities.noString(tu.getTgtText())) { From 681470812c675f614f95072856b7566c3cf24856 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 7 Jun 2023 23:12:26 +0200 Subject: [PATCH 22/34] release notes --- RELEASE_NOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3b263f099..c376e32d8 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,4 +4,5 @@ ## Other code changes -* no changes +* Fix bugs in language handling + From fed11c88efffdb93fe55f9b8757176060b814d37 Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 7 Jun 2023 17:25:27 -0400 Subject: [PATCH 23/34] Bump okhttp3 version (#1295) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3f6c82c2e..b4ff8a1e5 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ 1.8.2 3.0.0-M5 3.1.0 - 4.9.3 + 4.10.0 0.8.9 1.5.12 1.18.22 From 5700a5022b8e2f85cfad996a0818301fc8b851e0 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 8 Jun 2023 06:00:11 +0200 Subject: [PATCH 24/34] release notes --- RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c376e32d8..80d010330 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -5,4 +5,5 @@ ## Other code changes * Fix bugs in language handling +* Implement Trivy vulnerability scanning and update POI and okhttp libraries From 3969ac75c45056832f8d816d20f4d3ee186297d6 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Thu, 8 Jun 2023 04:33:30 +0000 Subject: [PATCH 25/34] Release: v6.0.14 ## Validator Changes * no changes ## Other code changes * Fix bugs in language handling * Implement Trivy vulnerability scanning and update POI and okhttp libraries ***NO_CI*** --- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 593b8271e..b332b630c 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 4399b1341..637f89be0 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index c52c586b0..71170e926 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index 04c47f95b..17b0644b6 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index da083f383..04311b72d 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index a400bea99..5900a3118 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 0df0643db..5191eb431 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index ffcd949e4..51f4bcbdd 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 74af1f639..4fe86bfd4 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 1865cd329..4f604c365 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 9a8ba4127..4baa8fa8c 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 ../pom.xml diff --git a/pom.xml b/pom.xml index b4ff8a1e5..37d00ecd9 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.0.14-SNAPSHOT + 6.0.14 pom From 10f466487bddebac658f401088babf28d2c0c163 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Thu, 8 Jun 2023 05:03:27 +0000 Subject: [PATCH 26/34] Updating version to: 6.0.15-SNAPSHOT and incrementing test cases dependency. --- RELEASE_NOTES.md | 4 +--- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 15 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 80d010330..7b06c6ab5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,6 +4,4 @@ ## Other code changes -* Fix bugs in language handling -* Implement Trivy vulnerability scanning and update POI and okhttp libraries - +* no changes \ No newline at end of file diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index b332b630c..70c2a3f4e 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 637f89be0..c454f712b 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 71170e926..683ce8327 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index 17b0644b6..6ea4ae6bc 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 04311b72d..fcbbc9b8a 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 5900a3118..f9bf9c2c9 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 5191eb431..f61e158cb 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index 51f4bcbdd..0e73bf1c8 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 4fe86bfd4..fded1f7c3 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 4f604c365..30ca91402 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 4baa8fa8c..64b5f2a47 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 37d00ecd9..43bc461d2 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.0.14 + 6.0.15-SNAPSHOT pom From 62094071a06c84ba78a8866d396852b798b16d65 Mon Sep 17 00:00:00 2001 From: dotasek Date: Thu, 8 Jun 2023 10:37:47 -0400 Subject: [PATCH 27/34] Update trivy.yml --- .github/workflows/trivy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 08cc7559b..a2dddfc89 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -1,4 +1,4 @@ -name: Security Scans +name: Trivy Security Scans on: push: From 7b05c7514e43b9c9dda5bcd8832f6e5497309cbe Mon Sep 17 00:00:00 2001 From: dotasek Date: Thu, 8 Jun 2023 10:47:37 -0400 Subject: [PATCH 28/34] Bump poi version, remove unused old dependencies (#1296) --- org.hl7.fhir.dstu2/pom.xml | 11 +-------- org.hl7.fhir.dstu2016may/pom.xml | 11 +-------- org.hl7.fhir.dstu3/pom.xml | 11 +-------- org.hl7.fhir.r4/pom.xml | 12 ++-------- org.hl7.fhir.r4b/pom.xml | 11 +-------- .../fhir/r4b/utils/GraphDefinitionEngine.java | 2 +- org.hl7.fhir.r5/pom.xml | 11 +-------- org.hl7.fhir.validation.cli/pom.xml | 9 +++++-- pom.xml | 24 ++++++++++++++++++- 9 files changed, 38 insertions(+), 64 deletions(-) diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index c454f712b..310a9a9f2 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -59,25 +59,16 @@ org.apache.poi poi - ${apache_poi_version} true org.apache.poi poi-ooxml - ${apache_poi_version} true org.apache.poi - poi-ooxml-schemas - ${apache_poi_version} - true - - - org.apache.poi - ooxml-schemas - 1.4 + poi-ooxml-full true diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 683ce8327..4b4db8d78 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -73,25 +73,16 @@ org.apache.poi poi - ${apache_poi_version} true org.apache.poi poi-ooxml - ${apache_poi_version} true org.apache.poi - poi-ooxml-schemas - ${apache_poi_version} - true - - - org.apache.poi - ooxml-schemas - 1.4 + poi-ooxml-full true diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index 6ea4ae6bc..da227aac7 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -67,25 +67,16 @@ org.apache.poi poi - ${apache_poi_version} true org.apache.poi poi-ooxml - ${apache_poi_version} true org.apache.poi - poi-ooxml-schemas - ${apache_poi_version} - true - - - org.apache.poi - ooxml-schemas - 1.4 + poi-ooxml-full true diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index fcbbc9b8a..fb9d82d17 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -80,29 +80,21 @@ ${validator_test_case_version} test + org.apache.poi poi - ${apache_poi_version} true org.apache.poi poi-ooxml - ${apache_poi_version} true org.apache.poi - poi-ooxml-schemas - ${apache_poi_version} - true - - - org.apache.poi - ooxml-schemas - 1.4 + poi-ooxml-full true diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index f9bf9c2c9..2371c5345 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -86,25 +86,16 @@ org.apache.poi poi - ${apache_poi_version} true org.apache.poi poi-ooxml - ${apache_poi_version} true org.apache.poi - poi-ooxml-schemas - ${apache_poi_version} - true - - - org.apache.poi - ooxml-schemas - 1.4 + poi-ooxml-full true diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/GraphDefinitionEngine.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/GraphDefinitionEngine.java index 457768c6d..0c1f170dd 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/GraphDefinitionEngine.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/GraphDefinitionEngine.java @@ -8,7 +8,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import org.apache.xmlbeans.xml.stream.ReferenceResolver; + import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4b.context.IWorkerContext; import org.hl7.fhir.r4b.model.Base; diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index f61e158cb..791510102 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -73,25 +73,16 @@ org.apache.poi poi - ${apache_poi_version} true org.apache.poi poi-ooxml - ${apache_poi_version} true org.apache.poi - poi-ooxml-schemas - ${apache_poi_version} - true - - - org.apache.poi - ooxml-schemas - 1.4 + poi-ooxml-full true diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 30ca91402..aa5fb5432 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -204,7 +204,6 @@ org.apache.poi poi - ${apache_poi_version} false compile @@ -212,7 +211,13 @@ org.apache.poi poi-ooxml - ${apache_poi_version} + false + compile + + + + org.apache.poi + poi-ooxml-full false compile diff --git a/pom.xml b/pom.xml index 43bc461d2..a1e7d94a1 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 1.5.12 1.18.22 1.12.14 - 4.1.1 + 5.2.1 9.8.0-15 11 11 @@ -164,7 +164,29 @@ net.sf.saxon Saxon-HE ${saxon_he_version} + + + + org.apache.poi + poi + ${apache_poi_version} + + + org.apache.poi + poi-ooxml + ${apache_poi_version} + + + org.apache.poi + poi-ooxml-lite + + + + + org.apache.poi + poi-ooxml-full + ${apache_poi_version} From 05134dc99dc07a13839013ffb8534ba6e548488d Mon Sep 17 00:00:00 2001 From: dotasek Date: Thu, 8 Jun 2023 15:40:08 -0400 Subject: [PATCH 29/34] Do 20230607 commons beanutils bump (#1297) * Move property to module * Document dependency exclusions, RELEASE_NOTES --- RELEASE_NOTES.md | 2 +- org.hl7.fhir.validation/pom.xml | 14 +++++++++++++- pom.xml | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7b06c6ab5..a2eeac7b3 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,4 +4,4 @@ ## Other code changes -* no changes \ No newline at end of file +* Update commons-beanutils and apache.poi dependencies \ No newline at end of file diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 64b5f2a47..6f306b9ef 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -14,6 +14,7 @@ ${project.parent.basedir} + 1.5.12 @@ -132,6 +133,13 @@ info.cqframework model ${info_cqframework_version} + + + + commons-beanutils + commons-beanutils + + info.cqframework @@ -153,7 +161,11 @@ qdm ${info_cqframework_version} - + + commons-beanutils + commons-beanutils + 1.9.4 + com.squareup.okhttp3 diff --git a/pom.xml b/pom.xml index a1e7d94a1..1b3621d35 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,6 @@ 3.1.0 4.10.0 0.8.9 - 1.5.12 1.18.22 1.12.14 5.2.1 @@ -177,7 +176,8 @@ poi-ooxml ${apache_poi_version} - + + org.apache.poi poi-ooxml-lite From cc14a4142f4057a1b135f0f4500f0939f1bda9a9 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Thu, 8 Jun 2023 20:56:04 +0000 Subject: [PATCH 30/34] Release: v6.0.15 ## Validator Changes * no changes ## Other code changes * Update commons-beanutils and apache.poi dependencies ***NO_CI*** --- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 70c2a3f4e..5fffc7b40 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 310a9a9f2..01b1bcc80 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 4b4db8d78..225ff3351 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index da227aac7..f56e7eca1 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index fb9d82d17..43ac9f503 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 2371c5345..9f0de31d5 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 791510102..62c305b2d 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index 0e73bf1c8..924b392a8 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index fded1f7c3..3d1052996 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index aa5fb5432..fd0169c6c 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 6f306b9ef..27fe111d6 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 ../pom.xml diff --git a/pom.xml b/pom.xml index 1b3621d35..3cae9495d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.0.15-SNAPSHOT + 6.0.15 pom From 8237fb862b44bcb8d1452eec9d5541a112fac297 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Thu, 8 Jun 2023 21:23:36 +0000 Subject: [PATCH 31/34] Updating version to: 6.0.16-SNAPSHOT and incrementing test cases dependency. --- RELEASE_NOTES.md | 2 +- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a2eeac7b3..7b06c6ab5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,4 +4,4 @@ ## Other code changes -* Update commons-beanutils and apache.poi dependencies \ No newline at end of file +* no changes \ No newline at end of file diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 5fffc7b40..467aff0c7 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 01b1bcc80..2cf7c7350 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 225ff3351..996bbc997 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index f56e7eca1..e8ef17170 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 43ac9f503..4a258339f 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 9f0de31d5..981c144b3 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 62c305b2d..d75fb8bf7 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index 924b392a8..2eb490872 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 3d1052996..9e3368785 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index fd0169c6c..5f1e9af8e 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 27fe111d6..c46bdba11 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 3cae9495d..fbddf71fd 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.0.15 + 6.0.16-SNAPSHOT pom From ff7997d7d28b11bcb296d30e3bdcb36d60ab9b91 Mon Sep 17 00:00:00 2001 From: dotasek Date: Fri, 9 Jun 2023 14:43:49 -0400 Subject: [PATCH 32/34] Fix older jetbrains annotations transitive dependency (#1299) --- org.hl7.fhir.convertors/pom.xml | 1 - org.hl7.fhir.dstu3/pom.xml | 1 - org.hl7.fhir.r4/pom.xml | 1 - org.hl7.fhir.r4b/pom.xml | 1 - org.hl7.fhir.r5/pom.xml | 1 - org.hl7.fhir.utilities/pom.xml | 1 - org.hl7.fhir.validation.cli/pom.xml | 1 - org.hl7.fhir.validation/pom.xml | 1 - pom.xml | 21 +++++++++++++++++++++ 9 files changed, 21 insertions(+), 8 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 467aff0c7..497f3fbf3 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -91,7 +91,6 @@ com.squareup.okhttp3 okhttp - ${okhttp.version} true diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index e8ef17170..aca202d8c 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -59,7 +59,6 @@ com.squareup.okhttp3 okhttp - ${okhttp.version} true diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 4a258339f..5c6be4f22 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -71,7 +71,6 @@ com.squareup.okhttp3 okhttp - ${okhttp.version} true diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 981c144b3..bf58f6176 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -65,7 +65,6 @@ com.squareup.okhttp3 okhttp - ${okhttp.version} true diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index d75fb8bf7..79b52670d 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -107,7 +107,6 @@ com.squareup.okhttp3 okhttp - ${okhttp.version} true diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 9e3368785..95a7f022b 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -49,7 +49,6 @@ com.squareup.okhttp3 okhttp - ${okhttp.version} true diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 5f1e9af8e..a8e47b15b 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -280,7 +280,6 @@ com.squareup.okhttp3 okhttp - ${okhttp.version} com.atlassian.commonmark diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index c46bdba11..fad93d118 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -170,7 +170,6 @@ com.squareup.okhttp3 okhttp - ${okhttp.version} true diff --git a/pom.xml b/pom.xml index fbddf71fd..018cd5dda 100644 --- a/pom.xml +++ b/pom.xml @@ -183,11 +183,32 @@ + + org.apache.poi poi-ooxml-full ${apache_poi_version} + + com.squareup.okhttp3 + okhttp + ${okhttp.version} + + + + org.jetbrains + annotations + + + + + + + org.jetbrains + annotations + 16.0.1 + From 481698cf240b7ced283b2c4ed48e09462f05e0f9 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 12 Jun 2023 17:17:30 +0100 Subject: [PATCH 33/34] Fix up terminology tests to ignore irrelevant extensions --- .../org/hl7/fhir/r5/utils/ElementVisitor.java | 45 +++++++++++ .../org/hl7/fhir/validation/ValidatorCli.java | 2 +- .../hl7/fhir/validation/special/TxTester.java | 12 +-- .../validation/special/TxTesterScrubbers.java | 75 +++++++++++++++++-- .../ExternalTerminologyServiceTests.java | 2 +- .../tests/TerminologyServiceTests.java | 6 +- pom.xml | 2 +- 7 files changed, 128 insertions(+), 16 deletions(-) create mode 100644 org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ElementVisitor.java diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ElementVisitor.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ElementVisitor.java new file mode 100644 index 000000000..0ae4b1a56 --- /dev/null +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ElementVisitor.java @@ -0,0 +1,45 @@ +package org.hl7.fhir.r5.utils; + +import org.hl7.fhir.r5.model.Base; +import org.hl7.fhir.r5.model.Element; +import org.hl7.fhir.r5.model.Property; +import org.hl7.fhir.r5.model.Resource; + +public class ElementVisitor { + + public interface IElementVisitor { + public void visit(Resource resource); + public void visit(Element element); + } + + private IElementVisitor visitor; + + public ElementVisitor(IElementVisitor visitor) { + this.visitor = visitor; + } + + private void visitBase(Base base) { + for (Property p : base.children()) { + if (p.hasValues()) { + for (Base b : p.getValues()) { + if (b instanceof Resource) { + visit((Resource) b); + } else { + visit((Element) b); + } + } + } + } + } + + public void visit(Resource res) { + visitor.visit(res); + visitBase(res); + } + + public void visit(Element e) { + visitor.visit(e); + visitBase(e); + } + +} diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java index 76d019efc..4057eedd9 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java @@ -224,7 +224,7 @@ public class ValidatorCli { final String version = Params.getParam(args, Params.VERSION); final String tx = Params.getParam(args, Params.TERMINOLOGY); final String filter = Params.getParam(args, Params.FILTER); - boolean ok = new TxTester(new InternalTxLoader(source, output), tx).setOutput(output).execute(version, filter); + boolean ok = new TxTester(new InternalTxLoader(source, output), tx, false).setOutput(output).execute(version, filter); System.exit(ok ? 1 : 0); } else { final String testModuleParam = Params.getParam(args, Params.TEST_MODULES); diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/TxTester.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/TxTester.java index 0b7ffcdb9..eb31c7727 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/TxTester.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/TxTester.java @@ -58,16 +58,18 @@ public class TxTester { private String error; private String output; private ITerminologyClient tx; + private boolean tight; - public TxTester(ITxTesterLoader loader, String server) { + public TxTester(ITxTesterLoader loader, String server, boolean tight) { super(); this.server = server; this.loader = loader; + this.tight = tight; } public static void main(String[] args) throws Exception { - new TxTester(new InternalTxLoader(args[0]), args[1]).execute(args[2], args[3]); + new TxTester(new InternalTxLoader(args[0]), args[1], "true".equals(args[2])).execute(args[2], args[3]); } public boolean execute(String version, String filter) throws IOException, URISyntaxException { @@ -239,12 +241,12 @@ public class TxTester { String vsj; try { ValueSet vs = tx.expandValueset(null, p, null); - TxTesterScrubbers.scrub(vs); + TxTesterScrubbers.scrubVS(vs, tight); TxTesterSorters.sortValueSet(vs); vsj = new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(vs); } catch (EFhirClientException e) { OperationOutcome oo = e.getServerErrors().get(0); - TxTesterScrubbers.scrub(oo); + TxTesterScrubbers.scrubOO(oo, tight); vsj = new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(oo); } String diff = CompareUtilities.checkJsonSrcIsSame(resp, vsj); @@ -263,7 +265,7 @@ public class TxTester { String pj; try { Parameters po = tx.validateVS(p); - TxTesterScrubbers.scrub(po); + TxTesterScrubbers.scrubParams(po); TxTesterSorters.sortParameters(po); pj = new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(po); } catch (EFhirClientException e) { diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/TxTesterScrubbers.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/TxTesterScrubbers.java index cf9920040..5d565f958 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/TxTesterScrubbers.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/TxTesterScrubbers.java @@ -1,20 +1,85 @@ package org.hl7.fhir.validation.special; import org.hl7.fhir.r5.model.DomainResource; +import org.hl7.fhir.r5.model.Element; +import org.hl7.fhir.r5.model.Extension; +import org.hl7.fhir.r5.model.OperationOutcome; import org.hl7.fhir.r5.model.Parameters; +import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.ValueSet; +import org.hl7.fhir.r5.utils.ElementVisitor; +import org.hl7.fhir.r5.utils.ElementVisitor.IElementVisitor; +import org.hl7.fhir.utilities.Utilities; public class TxTesterScrubbers { - public static void scrub(DomainResource dr) { - dr.setText(null); - dr.setMeta(null); + + public static class TxTesterScrubberVisitor implements IElementVisitor { + + private boolean tight; + protected TxTesterScrubberVisitor(boolean tight) { + super(); + this.tight = tight; + } + + private boolean isManagedExtension(Extension extension) { + return !tight || !Utilities.isAbsoluteUrl(extension.getUrl()) || Utilities.existsInList(extension.getUrl(), + "http://hl7.org/fhir/StructureDefinition/codesystem-alternate", + "http://hl7.org/fhir/StructureDefinition/codesystem-conceptOrder", + "http://hl7.org/fhir/StructureDefinition/codesystem-label", + "http://hl7.org/fhir/StructureDefinition/coding-sctdescid", + "http://hl7.org/fhir/StructureDefinition/itemWeight", + "http://hl7.org/fhir/StructureDefinition/rendering-style", + "http://hl7.org/fhir/StructureDefinition/rendering-xhtml", + "http://hl7.org/fhir/StructureDefinition/translation", + "http://hl7.org/fhir/StructureDefinition/valueset-concept-definition", + "http://hl7.org/fhir/StructureDefinition/valueset-conceptOrder", + "http://hl7.org/fhir/StructureDefinition/valueset-deprecated", + "http://hl7.org/fhir/StructureDefinition/valueset-label", + "http://hl7.org/fhir/StructureDefinition/valueset-supplement", + "http://hl7.org/fhir/test/CodeSystem/de-multi", + "http://hl7.org/fhir/test/CodeSystem/en-multi", + "http://hl7.org/fhir/test/StructureDefinition/unknown-extension-1", + "http://hl7.org/fhir/test/StructureDefinition/unknown-extension-3", + "http://hl7.org/fhir/test/StructureDefinition/unknown-extension-4", + "http://hl7.org/fhir/test/StructureDefinition/unknown-extension-5", + "http://hl7.org/fhir/test/ValueSet/extensions-bad-supplement", + "http://hl7.org/fhir/test/ValueSet/simple-all", + "http://hl7.org/fhir/test/ValueSet/simple-enumerated", + "http://hl7.org/fhir/test/ValueSet/simple-filter-isa"); + } + + @Override + public void visit(Resource resource) { + if (resource instanceof DomainResource) { + DomainResource dr = (DomainResource) resource; + dr.getExtension().removeIf(ext -> !isManagedExtension(ext)); + } + } + + @Override + public void visit(Element element) { + element.getExtension().removeIf(ext -> !isManagedExtension(ext)); + } + } + + public static void scrubDR(DomainResource dr, boolean tight) { + dr.setText(null); + dr.setMeta(null); + new ElementVisitor(new TxTesterScrubberVisitor(tight)).visit(dr); } - public static void scrub(Parameters po) { + public static void scrubVS(ValueSet vs, boolean tight) { + scrubDR(vs, tight); + } + + public static void scrubParams(Parameters po) { po.setMeta(null); - + } + + public static void scrubOO(OperationOutcome po, boolean tight) { + scrubDR(po, tight); } } diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/ExternalTerminologyServiceTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/ExternalTerminologyServiceTests.java index 744a08f0c..b4225c1d8 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/ExternalTerminologyServiceTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/ExternalTerminologyServiceTests.java @@ -93,7 +93,7 @@ public class ExternalTerminologyServiceTests implements ITxTesterLoader { public void test() throws Exception { if (SERVER != null) { if (tester == null) { - tester = new TxTester(this, SERVER); + tester = new TxTester(this, SERVER, true); } String err = tester.executeTest(setup.suite, setup.test); Assertions.assertTrue(err == null, err); diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/TerminologyServiceTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/TerminologyServiceTests.java index 6a7bb24ec..dd7959496 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/TerminologyServiceTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/TerminologyServiceTests.java @@ -161,7 +161,7 @@ public class TerminologyServiceTests { removeParameter(vse.getValueset(), "excludeNested"); } TxTesterSorters.sortValueSet(vse.getValueset()); - TxTesterScrubbers.scrub(vse.getValueset()); + TxTesterScrubbers.scrubVS(vse.getValueset(), false); String vsj = new JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(vse.getValueset()); String diff = CompareUtilities.checkJsonSrcIsSame(resp, vsj); if (diff != null) { @@ -205,7 +205,7 @@ public class TerminologyServiceTests { } e.getDetails().setText(vse.getError()); oo.addIssue(e); - TxTesterScrubbers.scrub(oo); + TxTesterScrubbers.scrubOO(oo, false); String ooj = new JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(oo); String diff = CompareUtilities.checkJsonSrcIsSame(resp, ooj); @@ -291,7 +291,7 @@ public class TerminologyServiceTests { res.addParameter().setName("issues").setResource(oo); } TxTesterSorters.sortParameters(res); - TxTesterScrubbers.scrub(res); + TxTesterScrubbers.scrubParams(res); String pj = new JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(res); String diff = CompareUtilities.checkJsonSrcIsSame(resp, pj); diff --git a/pom.xml b/pom.xml index 018cd5dda..2e9dc5843 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 6.4.1 - 1.3.9 + 1.3.10-SNAPSHOT 2.14.0 5.9.2 1.8.2 From 28bfe9c7578afbc807e99c004bcbc068c4e09bc7 Mon Sep 17 00:00:00 2001 From: dotasek Date: Mon, 12 Jun 2023 15:08:26 -0400 Subject: [PATCH 34/34] CodeQL coverage (#1298) * Create codeql.yml * Try limiting to the run to a single module * Try matrix config * Use category to prevent overwritten results * Add remaining modules * Update codeql.yml * Update codeql.yml --- .github/workflows/codeql.yml | 73 ++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..53a3d77b4 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,73 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + schedule: + - cron: '0 0 * * *' + + workflow_dispatch: + +jobs: + analyze: + name: Analyze + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + module: [ 'org.hl7.fhir.utilities','org.hl7.fhir.dstu2','org.hl7.fhir.dstu2016may', 'org.hl7.fhir.dstu3', 'org.hl7.fhir.r4', 'org.hl7.fhir.r4b','org.hl7.fhir.r5','org.hl7.fhir.convertors','org.hl7.fhir.validation' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Use only 'java' to analyze code written in Java, Kotlin or both + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + # - name: Autobuild + # uses: github/codeql-action/autobuild@v2 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + - run: | + mvn install -DskipTests -pl ${{ matrix.module }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}:${{ matrix.module }}"