diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriter.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriter.java index 31f8c9b7..2d098a7a 100644 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriter.java +++ b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriter.java @@ -52,7 +52,7 @@ public void writeHeader(String[] data) { SchemaBuilder.FieldAssembler patientRecords = SchemaBuilder.record("patientData") .fields(); - fields.forEach(patientRecords::requiredString); + fields.forEach(field -> patientRecords.nullableString(field, "null")); patientDataSchema = patientRecords.endRecord(); Schema objectSchema = Schema.createUnion(metadataSchema, patientDataSchema); 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 9a527838..4094dd93 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 @@ -19,7 +19,7 @@ public void writeValidPFB() { pfbWriter.writeHeader(new String[] {"\\demographics\\age\\", "\\phs123\\stroke\\"}); pfbWriter.writeEntity(List.of(new String[]{"80", "Y"}, new String[]{"70", "N"}, - new String[]{"75", "N"} + new String[]{"75", null} )); pfbWriter.close(); // todo: validate this programatically