diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageList.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageList.java index db822b265..b1a747e0e 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageList.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageList.java @@ -128,6 +128,33 @@ public class PackageList { public Instant instant() throws ParseException { return json.asInstant("date"); } + + /** + * only used for a technical correction. tcPath is the name of archive file (web reference) containing the content before correction + * + * @param asString + * @param webpath + * @param asString2 + * @param asString3 + * @param fhirVersion + * @param tcName + */ + public void update(String version, String path, String status, String sequence, FhirPublication fhirVersion, String tcPath, String date) { + JsonObject tc = new JsonObject(); + json.forceArray("corrections").add(tc); + tc.set("version", json.asString("version")); + tc.set("path", tcPath); + tc.set("date", date); + + json.set("version", version); + json.set("path", path); + json.set("status", status); + json.set("sequence", sequence); + if (fhirVersion != null) { + json.set("fhirversion", fhirVersion.toCode()); + } + setDate(date); + } } private String source;