Skip to content

Commit

Permalink
Merge pull request #37 from MeasureAuthoringTool/feature/mat-7981-exp…
Browse files Browse the repository at this point in the history
…ort-saved-human-readable

[MAT-7981] Package saved HR if available
  • Loading branch information
jkotanchik-SB authored Jan 14, 2025
2 parents 77aac5b + f657f84 commit fcb3a9b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1,107 deletions.
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## MADiE PR

Jira Ticket: [MAT-0000](https://jira.cms.gov/browse/MAT-0000)
(Optional) Related Tickets:

### Summary

### All Submissions
* [ ] This PR has the JIRA linked.
* [ ] Required tests are included.
* [ ] No extemporaneous files are included (i.e Complied files or testing results).
* [ ] This PR is merging into the **correct branch**.
* [ ] All Documentation needed for this PR is Complete (or noted in a TODO or other Ticket).
* [ ] Any breaking changes or failing automations are noted by placing a comment on this PR.

### DevSecOps
If there is a question if this PR has a security or infrastructure impact, please contact the Security or DevOps engineer assigned to this project to discuss it further.

* [ ] This PR has NO significant security impact (i.e Changing auth methods, Adding a new user type, Adding a required but vulnerable package).

### Reviewers
By Approving this PR you are attesting to the following:

* Code is maintainable and reusable, reuses existing code and infrastructure where appropriate, and accomplishes the task’s purpose.
* The tests appropriately test the new code, including edge cases.
* If you have any concerns they are brought up either to the developer assigned, security engineer, or leads.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>gov.cms.madie.packaging</groupId>
<artifactId>packaging-utility</artifactId>
<version>0.2.6</version>
<version>0.2.7</version>

<name>packaging-utility</name>
<description>A simple packaging-utility.</description>
Expand Down 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,10 +42,10 @@ 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);
return getZipBundle(bundle, exportFileName, null);
} else if (o instanceof Map) {
Map map = (Map) o;
return getTestCaseZipBundle(map);
Expand All @@ -54,7 +54,8 @@ 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 +66,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
Loading

0 comments on commit fcb3a9b

Please sign in to comment.