diff --git a/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriterTest.java b/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriterTest.java index e355de18..9861c1f3 100644 --- a/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriterTest.java +++ b/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriterTest.java @@ -5,6 +5,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import java.io.File; +import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.*; @@ -17,6 +18,15 @@ public void writeValidPFB() { PfbWriter pfbWriter = new PfbWriter(new File("target/test-result.avro")); pfbWriter.writeHeader(new String[] {"patient_id", "\\demographics\\age\\", "\\phs123\\stroke\\"}); + List> nullableList = new ArrayList<>(); + nullableList.add(List.of("123")); + nullableList.add(null); + nullableList.add(List.of("Y")); + pfbWriter.writeMultiValueEntity(List.of( + nullableList, + List.of(List.of("456"), null ,List.of("N", "Y")), + List.of(List.of(), List.of("75"), List.of()) + )); pfbWriter.writeMultiValueEntity(List.of( List.of(List.of("123"), List.of("80"), List.of("Y")), List.of(List.of("456"), List.of("70"),List.of("N", "Y")), diff --git a/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/PicSureService.java b/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/PicSureService.java index ff9cddac..1feccc8e 100644 --- a/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/PicSureService.java +++ b/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/PicSureService.java @@ -230,7 +230,7 @@ public ResponseEntity queryResult(@PathVariable("resourceQueryId") UUID queryId, result.open(); return ResponseEntity.ok() .contentType(MediaType.TEXT_PLAIN) - .body(new String(result.readAllBytes(), StandardCharsets.UTF_8)); + .body(result.readAllBytes()); } else { return ResponseEntity.status(400).body("Status : " + result.getStatus().name()); }