Skip to content

Commit

Permalink
remove R4 maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Aug 5, 2024
1 parent f044e7f commit 594b57f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 129 deletions.
128 changes: 0 additions & 128 deletions src/main/java/org/hl7/fhir/tools/publisher/PageProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ public int compare(String arg0, String arg1) {
private SpecDifferenceEvaluator diffEngine;
private Bundle typeBundle;
private Bundle resourceBundle;
private JsonObject r4r5Outcomes;
private Map<String, Map<String, PageInfo>> normativePackages = new HashMap<String, Map<String, PageInfo>>();
private List<String> normativePages = new ArrayList<String>();
private MarkDownProcessor processor = new MarkDownProcessor(Dialect.COMMON_MARK);
Expand Down Expand Up @@ -10490,7 +10489,6 @@ private org.hl7.fhir.tools.publisher.SpecMapManager loadSpecMap(NpmPackage npm)

public void setFolders(FolderManager folders) throws Exception {
this.folders = folders;
r4r5Outcomes = (JsonObject) new com.google.gson.JsonParser().parse(TextFile.fileToString(Utilities.path(folders.rootDir, "implementations", "r4maps", "outcomes.json")));

for (File f : new File(Utilities.path(folders.rootDir, "tools", "macros")).listFiles()) {
if (f.getAbsolutePath().endsWith(".html")) {
Expand Down Expand Up @@ -11606,7 +11604,6 @@ public void clean() {
diffEngine = null;
typeBundle = null;
resourceBundle = null;
r4r5Outcomes = null;
normativePackages = null;
processor = null;

Expand Down Expand Up @@ -11958,66 +11955,6 @@ public void logDebugMessage(LogCategory category, String message) {
// System.out.println(message);
}


public class ResourceSummary {

boolean mapped;
int testCount;
int executeFailCount;
int roundTripFailCount;
int r5ValidationFailCount;
int r5ValidationErrors;
public boolean isMapped() {
return mapped;
}
public void setMapped(boolean mapped) {
this.mapped = mapped;
}
public int getTestCount() {
return testCount;
}
public void setTestCount(int testCount) {
this.testCount = testCount;
}
public int getExecuteFailCount() {
return executeFailCount;
}
public void setExecuteFailCount(int value) {
this.executeFailCount = value;
}
public int getRoundTripFailCount() {
return roundTripFailCount;
}
public void setRoundTripFailCount(int value) {
this.roundTripFailCount = value;
}
public int getR5ValidationFailCount() {
return r5ValidationFailCount;
}
public void setR5ValidationFailCount(int value) {
this.r5ValidationFailCount = value;
}
public int getR5ValidationErrors() {
return r5ValidationErrors;
}
public void setR5ValidationErrors(int value) {
this.r5ValidationErrors = value;
}
public int executePct() {
return (executeCount() * 100) / testCount;
}
private int executeCount() {
return testCount - executeFailCount;
}
public int roundTripPct() {
return executeCount() == 0 ? 0 : ((executeCount() - roundTripFailCount) * 100) / executeCount();
}
public int r4ValidPct() {
return executeCount() == 0 ? 0 : ((executeCount() - r5ValidationFailCount) * 100) / executeCount();
}

}

private String genR3MapsSummary() throws IOException {
StringBuilder b = new StringBuilder();
// for (String n : definitions.sortedResourceNames()) {
Expand All @@ -12042,32 +11979,6 @@ private String genR3MapsSummary() throws IOException {
return b.toString();
}

private ResourceSummary getResourceSummary(String n) throws IOException {
ResourceSummary rs = new ResourceSummary();
JsonObject r = r4r5Outcomes.getAsJsonObject(n);
if (r != null && (new File(Utilities.path(folders.rootDir, "implementations", "r4maps", "R5toR4", n+".map")).exists())) {
rs.setMapped(true);
for (Entry<String, JsonElement> e : r.entrySet()) {
JsonObject el = (JsonObject) e.getValue();
rs.testCount++;
JsonPrimitive p = el.getAsJsonPrimitive("execution");
if (p!= null && !p.isBoolean())
rs.executeFailCount++;
if (el.has("r5.errors")) {
rs.r5ValidationFailCount++;
if (el.getAsJsonArray("r4.errors") != null)
rs.r5ValidationErrors = rs.r5ValidationErrors+el.getAsJsonArray("r4.errors").size();
else
rs.r5ValidationErrors = rs.r5ValidationErrors;
}
if (el.has("round-trip"))
rs.roundTripFailCount++;
}
} else
rs.setMapped(false);
return rs;
}

private String mapsBckColor(int pct, String badColor, String goodColor) {
return pct == 100 ? goodColor : badColor;
}
Expand Down Expand Up @@ -12107,45 +12018,6 @@ public String getLink(String typeName) {
return null;
}

public String getR4R5ValidationErrors(String name) {
StringBuilder b = new StringBuilder();
JsonObject r = r4r5Outcomes.getAsJsonObject(name);
if (r != null) {
boolean first = true;
for (Entry<String, JsonElement> e : r.entrySet()) {
JsonObject el = (JsonObject) e.getValue();
if (el.has("r3.errors")) {
if (first) {
first = false;
b.append("<table class=\"grid\">\r\n");
}
b.append(" <tr>\r\n");
b.append(" <td>");
b.append(e.getKey());
b.append("</td>\r\n");
JsonArray arr = el.getAsJsonArray("r4.errors");
b.append(" <td>");
b.append(" <ul>");
for (JsonElement n : arr) {
b.append(" <li>");
b.append(n.getAsString());
b.append("</li>\r\n");
}
b.append(" </ul>\r\n");
b.append(" </td>\r\n");
b.append(" </tr>\r\n");
}
}
if (!first) {
b.append("</table>\r\n");
}
if (first)
b.append("<p>No validation errors - all conversions are clean</p>\r\n");
} else
b.append("<p>n/a</p>\r\n");
return b.toString();
}

public Map<String, Map<String, PageInfo>> getNormativePackages() {
return normativePackages;
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/hl7/fhir/tools/publisher/Publisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -3763,7 +3763,6 @@ private void produceMap(String name, SectionTracker st, ResourceDefn res) throws
values.put("bcks", Utilities.escapeXml(bcks));
values.put("fwds-status", "");
values.put("bcks-status", "");
values.put("r4errs", page.getR4R5ValidationErrors(name));
try {
new StructureMapUtilities(page.getWorkerContext()).parse(fwds, page.r4nameForResource(name)+".map");
} catch (FHIRException e) {
Expand Down

0 comments on commit 594b57f

Please sign in to comment.