compile fix
This commit is contained in:
parent
9c74e94e68
commit
515bead90d
|
@ -1,26 +1,18 @@
|
|||
package org.hl7.fhir.r5.renderers.spreadsheets;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.hl7.fhir.exceptions.DefinitionException;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext;
|
||||
import org.hl7.fhir.r5.context.SimpleWorkerContext;
|
||||
import org.hl7.fhir.r5.model.CanonicalType;
|
||||
import org.hl7.fhir.r5.model.ElementDefinition;
|
||||
import org.hl7.fhir.r5.model.ValueSet;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent;
|
||||
import org.hl7.fhir.utilities.DebugUtilities;
|
||||
import org.hl7.fhir.utilities.i18n.I18nConstants;
|
||||
|
||||
public class ValueSetSpreadsheetGenerator extends CanonicalSpreadsheetGenerator {
|
||||
|
||||
|
|
|
@ -31,7 +31,18 @@ public class PackageHacker {
|
|||
|
||||
public static void main(String[] args) throws FileNotFoundException, IOException {
|
||||
// new PackageHacker().massEdit(new File("/Users/grahamegrieve/web/hl7.org/fhir"));
|
||||
new PackageHacker().edit(args[0]);
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot1/hl7.fhir.r6.core.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot1/hl7.fhir.r6.corexml.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot1/hl7.fhir.r6.examples.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot1/hl7.fhir.r6.expansions.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot1/hl7.fhir.r6.search.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot2/hl7.fhir.r6.core.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot2/hl7.fhir.r6.corexml.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot2/hl7.fhir.r6.examples.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot2/hl7.fhir.r6.expansions.tgz");
|
||||
new PackageHacker().edit("/Users/grahamegrieve/web/hl7.org/fhir/6.0.0-ballot2/hl7.fhir.r6.search.tgz");
|
||||
|
||||
// new PackageHacker().edit(args[0]);
|
||||
}
|
||||
|
||||
// private void massEdit(File dir) throws IOException {
|
||||
|
@ -85,6 +96,7 @@ public class PackageHacker {
|
|||
if (!f.exists())
|
||||
throw new Error("Unable to find "+f.getAbsolutePath());
|
||||
|
||||
System.out.println("Loading Package "+f.getAbsolutePath());
|
||||
NpmPackage pck = null;
|
||||
FileInputStream fs = ManagedFileAccess.inStream(f);
|
||||
try {
|
||||
|
@ -95,15 +107,15 @@ public class PackageHacker {
|
|||
System.out.println("Altering Package "+f.getAbsolutePath());
|
||||
System.out.println(nice(pck.getNpm()));
|
||||
|
||||
change(pck.getNpm());
|
||||
if (change(pck.getNpm())) {
|
||||
|
||||
System.out.println("Revised Package");
|
||||
System.out.println("=======================");
|
||||
System.out.println(nice(pck.getNpm()));
|
||||
System.out.println("=======================");
|
||||
System.out.print("save? y/n: ");
|
||||
int r = System.in.read();
|
||||
if (r == 'y') {
|
||||
// System.out.print("save? y/n: ");
|
||||
// int r = System.in.read();
|
||||
// if (r == 'y') {
|
||||
f.renameTo(ManagedFileAccess.file(Utilities.changeFileExt(name, ".tgz.bak")));
|
||||
FileOutputStream fso = ManagedFileAccess.outStream(f);
|
||||
try {
|
||||
|
@ -111,7 +123,8 @@ public class PackageHacker {
|
|||
} finally {
|
||||
fso.close();
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
private void fixExampleContent(Map<String, byte[]> content) {
|
||||
|
@ -129,17 +142,13 @@ public class PackageHacker {
|
|||
return JsonParser.compose(json, true);
|
||||
}
|
||||
|
||||
private void change(JsonObject npm) throws FileNotFoundException, IOException {
|
||||
private boolean change(JsonObject npm) throws FileNotFoundException, IOException {
|
||||
// fixVersions(npm, ver);
|
||||
npm.remove("notForPublication");
|
||||
npm.set("name", "hl7.fhir.us.core.v700");
|
||||
npm.set("version", "7.0.0");
|
||||
npm.set("canonical", "http://hl7.org/fhir/us/core/v700");
|
||||
npm.set("url", "http://hl7.org/fhir/us/core/v700");
|
||||
npm.remove("dependencies");
|
||||
JsonObject dep = new JsonObject();
|
||||
npm.add("dependencies", dep);
|
||||
dep.add("hl7.fhir.us.core", "7.0.0");
|
||||
if (npm.has("notForPublication")) {
|
||||
npm.remove("notForPublication");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void fixVersionInContent(Map<String, byte[]> content) {
|
||||
|
|
Loading…
Reference in New Issue