Skip to content

Commit

Permalink
Merge pull request #1501 from lmd59/flexporter-jsids
Browse files Browse the repository at this point in the history
Fix ids for flexporter executeScript
  • Loading branch information
dehall authored Sep 5, 2024
2 parents 055d977 + 2ab3200 commit eeb6539
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/org/mitre/synthea/export/flexporter/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,18 @@ public static Bundle executeScript(List<Map<String, String>> scripts, Bundle bun
String outBundleJson = fjContext.getBundle();

Bundle newBundle = parser.parseResource(Bundle.class, outBundleJson);
for (BundleEntryComponent bec : newBundle.getEntry()) {
Resource r = bec.getResource();
if (r.getId() != null && r.getId().startsWith("urn:uuid:")) {
// HAPI does some weird stuff with IDs
// by default in Synthea they are just plain UUIDs
// and the entry.fullUrl is urn:uuid:(id)
// but somehow when they get parsed back in, the id is urn:uuid:etc
// which then doesn't get written back out at the end
// so this removes the "urn:uuid:" bit if it got added
r.setId(r.getId().substring(9));
}
}

return newBundle;
}
Expand Down

0 comments on commit eeb6539

Please sign in to comment.