Skip to content

Commit

Permalink
MAT-7981: If available, package the Human Readable from the Export ob…
Browse files Browse the repository at this point in the history
…ject. Else, generate from Bundle content.
  • Loading branch information
jkotanchik-SB committed Jan 14, 2025
1 parent 77aac5b commit 0b0d384
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>gov.cms.madie</groupId>
<artifactId>madie-java-models</artifactId>
<version>0.6.72-SNAPSHOT</version>
<version>0.6.74-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public byte[] getZipBundle(Object o, String exportFileName) throws InternalServe

org.hl7.fhir.r4.model.Bundle bundle =
(org.hl7.fhir.r4.model.Bundle) jsonParser.parseResource(measureBundle);
return getZipBundle(bundle, exportFileName);
return getZipBundle(bundle, exportFileName, export.getHumanReadable());
} else if (o instanceof Bundle) {
Bundle bundle = (Bundle) o;
return getZipBundle(bundle, exportFileName);
Expand All @@ -54,7 +54,7 @@ public byte[] getZipBundle(Object o, String exportFileName) throws InternalServe
"Calling gicore411.PackagingUtilityImpl with invalid object");
}

private byte[] getZipBundle(Bundle bundle, String exportFileName) throws InternalServerException {
private byte[] getZipBundle(Bundle bundle, String exportFileName, String humanReadable) throws InternalServerException {

IParser jsonParser = context.newJsonParser();
IParser xmlParser = context.newXmlParser();
Expand All @@ -65,7 +65,8 @@ private byte[] getZipBundle(Bundle bundle, String exportFileName) throws Interna
if (ResourceUtils.isMeasureBundle(bundle)) {
org.hl7.fhir.r4.model.DomainResource measure =
(org.hl7.fhir.r4.model.DomainResource) ResourceUtils.getResource(bundle, "Measure");
String humanReadableWithCSS = getHumanReadableWithCSS(measure);
String humanReadableWithCSS =
humanReadable == null ? getHumanReadableWithCSS(measure) : humanReadable;

return zipEntries(exportFileName, jsonParser, xmlParser, bundle, humanReadableWithCSS);
} else if (ResourceUtils.isPatientBundle(bundle)) {
Expand Down

0 comments on commit 0b0d384

Please sign in to comment.