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 d89b7558d..220e610ef 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 @@ -67,7 +67,22 @@ public class PackageList { json.set("date", date); } - public boolean isPartofMainSpec() { + public List subPackages() { + List list = new ArrayList<>(); + if (json.has("sub-packages")) { + list.addAll(json.getStrings("sub-packages")); + } + return list; + } + + public void clearSubPackages() { + json.remove("sub-packages"); + } + public void addSubPackage(String s) { + json.forceArray("sub-packages").add(s); + } + + private boolean isPartofMainSpec() { return Utilities.startsWithInList(path(), "http://hl7.org/fhir/DSTU2", "http://hl7.org/fhir/2015Sep", "http://hl7.org/fhir/2015May"); }