rework xig into 3 steps
This commit is contained in:
parent
fb7ad19218
commit
64403db109
|
@ -72,6 +72,7 @@ public class PackageVisitor {
|
|||
private FilesystemPackageCacheManager pcm;
|
||||
private PackageClient pc;
|
||||
private String cache;
|
||||
private int step;
|
||||
|
||||
public List<String> getResourceTypes() {
|
||||
return resourceTypes;
|
||||
|
@ -164,6 +165,7 @@ public class PackageVisitor {
|
|||
if (pid != null) {
|
||||
if (!cpidSet.contains(pid)) {
|
||||
cpidSet.add(pid);
|
||||
if (step == 0 || step == 3) {
|
||||
List<String> vList = listVersions(pid);
|
||||
if (oldVersions) {
|
||||
for (String v : vList) {
|
||||
|
@ -174,12 +176,15 @@ public class PackageVisitor {
|
|||
} else {
|
||||
processPackage(pid, vList.get(vList.size() - 1), i, pidList.size());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
processor.alreadyVisited(pid);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (step == 0 || step == 3) {
|
||||
JsonObject json = JsonParser.parseObjectFromUrl("https://raw.githubusercontent.com/FHIR/ig-registry/master/fhir-ig-list.json");
|
||||
i = 0;
|
||||
List<JsonObject> objects = json.getJsonObjects("guides");
|
||||
|
@ -201,9 +206,12 @@ public class PackageVisitor {
|
|||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void processCurrentPackage(String url, String pid, Set<String> cpidSet, int i, int t) {
|
||||
try {
|
||||
cpidSet.add(pid);
|
||||
if (step == 0 || (step == 1 && i < t/2) || (step == 2 && i >= t/2)) {
|
||||
long ms1 = System.currentTimeMillis();
|
||||
String[] p = url.split("\\/");
|
||||
String repo = "https://build.fhir.org/ig/"+p[0]+"/"+p[1];
|
||||
|
@ -217,7 +225,6 @@ public class PackageVisitor {
|
|||
}
|
||||
NpmPackage npm = NpmPackage.fromPackage(new FileInputStream(co));
|
||||
String fv = npm.fhirVersion();
|
||||
cpidSet.add(pid);
|
||||
long ms2 = System.currentTimeMillis();
|
||||
|
||||
if (corePackages || !corePackage(npm)) {
|
||||
|
@ -252,6 +259,7 @@ public class PackageVisitor {
|
|||
System.out.println("Ignored: "+pid+"#current: no version");
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("Unable to process: "+pid+"#current: "+e.getMessage());
|
||||
}
|
||||
|
@ -370,4 +378,12 @@ public class PackageVisitor {
|
|||
npm.name().startsWith("hl7.fhir.r5."));
|
||||
}
|
||||
|
||||
public int getStep() {
|
||||
return step;
|
||||
}
|
||||
|
||||
public void setStep(int step) {
|
||||
this.step = step;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4507,7 +4507,7 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
|
||||
public static boolean isModifierExtension(StructureDefinition sd) {
|
||||
ElementDefinition defn = sd.getSnapshot().getElementByPath("Extension");
|
||||
return defn.getIsModifier();
|
||||
return defn != null && defn.getIsModifier();
|
||||
}
|
||||
|
||||
public boolean isForPublication() {
|
||||
|
|
Loading…
Reference in New Issue