support for sub-packages in packagelist.json

This commit is contained in:
Grahame Grieve 2023-09-04 13:39:59 +10:00
parent 68b30fe819
commit 3fa9a6725a
1 changed files with 16 additions and 1 deletions

View File

@ -67,7 +67,22 @@ public class PackageList {
json.set("date", date);
}
public boolean isPartofMainSpec() {
public List<String> subPackages() {
List<String> 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");
}