From 5b042f76a13ded7dd527386e46d49d3f4523aaef Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 13 Nov 2019 07:14:11 +1100 Subject: [PATCH 1/3] Add debugging --- .../org/hl7/fhir/utilities/cache/NpmPackage.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java index bf4a2d66b..c0ae6c885 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java @@ -184,8 +184,16 @@ public class NpmPackage { } res.content.put("package/.index.json", indexer.build().getBytes(Charsets.UTF_8)); } - res.npm = JsonTrackingParser.parseJson(res.content.get("package/package.json")); - res.readIndexFile((JsonObject) new com.google.gson.JsonParser().parse(new String(res.content.get("package/.index.json")))); + try { + res.npm = JsonTrackingParser.parseJson(res.content.get("package/package.json")); + } catch (Exception e) { + throw new IOException("Error parsing package/package.json: "+e.getMessage(), e); + } + try { + res.readIndexFile((JsonObject) JsonTrackingParser.parseJson(new String(res.content.get("package/.index.json")))); + } catch (Exception e) { + throw new IOException("Error parsing package/.index.json: "+e.getMessage(), e); + } return res; } From a418f9067232c57cfee4ec34109ae732787ee442 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 13 Nov 2019 07:17:27 +1100 Subject: [PATCH 2/3] Release new version --- 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.r5/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 | 4 ++-- release.bat | 4 ++-- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 545286e47..fa63fef20 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 389540289..9626145fb 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index a6b3d32c3..a22fc0476 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index c10c7f68d..2d8730bbe 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index ff5ff6e17..c1ce14bde 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index be406731e..087525d54 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index a0533c4cc..5aa800c41 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 0e0a20f1f..b0d02c0b6 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index c27990a4a..1405d5117 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 - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index ad144db01..8d5b56b7f 100644 --- a/pom.xml +++ b/pom.xml @@ -13,11 +13,11 @@ each other. It is fine to bump the point version of this POM without affecting HAPI FHIR. --> - 4.0.35-SNAPSHOT + 4.0.36-SNAPSHOT 4.1.0-SNAPSHOT - 1.0.5-SNAPSHOT + 1.0.6-SNAPSHOT org.hl7.fhir.core diff --git a/release.bat b/release.bat index 8f4026cf1..8305afa22 100644 --- a/release.bat +++ b/release.bat @@ -1,7 +1,7 @@ @echo off -set oldver=4.0.34 -set newver=4.0.35 +set oldver=4.0.35 +set newver=4.0.36 echo .. echo ===================================================================== From 3de429ae6ae243d507b11eecefa03b176e9119e8 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 13 Nov 2019 07:49:12 +1100 Subject: [PATCH 3/3] Release new version --- .../java/org/hl7/fhir/dstu3/importers/Mimic14Importer.java | 3 ++- .../main/java/org/hl7/fhir/r4/importers/Mimic14Importer.java | 3 ++- .../main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java | 2 +- .../main/java/org/hl7/fhir/utilities/cache/NpmPackage.java | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/importers/Mimic14Importer.java b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/importers/Mimic14Importer.java index 27cd9e2ab..69ad98622 100644 --- a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/importers/Mimic14Importer.java +++ b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/importers/Mimic14Importer.java @@ -80,6 +80,7 @@ import org.hl7.fhir.dstu3.model.Reference; import org.hl7.fhir.dstu3.model.Type; import org.hl7.fhir.utilities.CSVReader; import org.hl7.fhir.utilities.IniFile; +import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.Utilities; public class Mimic14Importer { @@ -561,7 +562,7 @@ public class Mimic14Importer { } else { throw new FHIRException("Unhandled Note type '"+cat+"'/'"+desc+"'"); } - dr.addContent().getAttachment().setContentType("text/plain; charset=UTF-8").setData(csv.cell("text").getBytes(Charset.forName("UTF-8"))); + dr.addContent().getAttachment().setContentType("text/plain; charset=UTF-8").setData(TextFile.stringToBytes(csv.cell("text"), false)); bnd.addEntry().setResource(dr); } System.out.println(Integer.toString(t)+" found"); diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/importers/Mimic14Importer.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/importers/Mimic14Importer.java index 09b4dd9ea..1b0d43e0e 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/importers/Mimic14Importer.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/importers/Mimic14Importer.java @@ -76,6 +76,7 @@ import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Type; import org.hl7.fhir.utilities.CSVReader; import org.hl7.fhir.utilities.IniFile; +import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.Utilities; public class Mimic14Importer { @@ -561,7 +562,7 @@ public class Mimic14Importer { } else { throw new FHIRException("Unhandled Note type '"+cat+"'/'"+desc+"'"); } - dr.addContent().getAttachment().setContentType("text/plain; charset=UTF-8").setData(csv.cell("text").getBytes(Charset.forName("UTF-8"))); + dr.addContent().getAttachment().setContentType("text/plain; charset=UTF-8").setData(TextFile.stringToBytes(csv.cell("text"), false)); bnd.addEntry().setResource(dr); } System.out.println(Integer.toString(t)+" found"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java index 0f853e6a6..0324000aa 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java @@ -324,7 +324,7 @@ public class NPMPackageGenerator { } private void buildIndexJson() throws IOException { - byte[] content = indexer.build().getBytes(Charset.forName("UTF-8")); + byte[] content = TextFile.stringToBytes(indexer.build(), false); addFile(Category.RESOURCE, ".index.json", content); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java index c0ae6c885..3c38f4e31 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java @@ -182,7 +182,7 @@ public class NpmPackage { indexer.seeFile(n.substring(8), res.content.get(n)); } } - res.content.put("package/.index.json", indexer.build().getBytes(Charsets.UTF_8)); + res.content.put("package/.index.json", TextFile.stringToBytes(indexer.build(), false)); } try { res.npm = JsonTrackingParser.parseJson(res.content.get("package/package.json")); @@ -526,7 +526,7 @@ public class NpmPackage { tar.closeArchiveEntry(); } } - byte[] cnt = new GsonBuilder().setPrettyPrinting().create().toJson(npm).getBytes(Charset.forName("UTF-8")); + byte[] cnt = TextFile.stringToBytes(new GsonBuilder().setPrettyPrinting().create().toJson(npm), false); TarArchiveEntry entry = new TarArchiveEntry("package/package.json"); entry.setSize(cnt.length); tar.putArchiveEntry(entry);