From 2d1254fcacff6cd6565e3961c03edca5c2cad006 Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 16 Mar 2022 17:09:54 -0400 Subject: [PATCH] Return null for conversions where isEmpty() == true --- .../fhir/convertors/conv30_40/datatypes30_40/Type30_40.java | 4 ++-- .../fhir/convertors/conv30_50/datatypes30_50/Type30_50.java | 4 ++-- .../fhir/convertors/conv40_50/datatypes40_50/Type40_50.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Type30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Type30_40.java index 3344a167c..838ac5fcd 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Type30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/Type30_40.java @@ -14,7 +14,7 @@ public class Type30_40 { } public org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException { - if (src == null) return null; + if (src == null || src.isEmpty()) return null; if (src instanceof org.hl7.fhir.dstu3.model.Base64BinaryType) return Base64Binary30_40.convertBase64Binary((org.hl7.fhir.dstu3.model.Base64BinaryType) src); if (src instanceof org.hl7.fhir.dstu3.model.BooleanType) @@ -122,7 +122,7 @@ public class Type30_40 { } public org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException { - if (src == null) return null; + if (src == null || src.isEmpty()) return null; if (src instanceof org.hl7.fhir.r4.model.Base64BinaryType) return Base64Binary30_40.convertBase64Binary((org.hl7.fhir.r4.model.Base64BinaryType) src); if (src instanceof org.hl7.fhir.r4.model.BooleanType) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Type30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Type30_50.java index 55ed82b1f..c046b4202 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Type30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/Type30_50.java @@ -14,7 +14,7 @@ public class Type30_50 { } public org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException { - if (src == null) return null; + if (src == null || src.isEmpty()) return null; if (src instanceof org.hl7.fhir.dstu3.model.Base64BinaryType) return Base64Binary30_50.convertBase64Binary((org.hl7.fhir.dstu3.model.Base64BinaryType) src); if (src instanceof org.hl7.fhir.dstu3.model.BooleanType) @@ -120,7 +120,7 @@ public class Type30_50 { } public org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException { - if (src == null) return null; + if (src == null || src.isEmpty()) return null; if (src instanceof org.hl7.fhir.r5.model.Base64BinaryType) return Base64Binary30_50.convertBase64Binary((org.hl7.fhir.r5.model.Base64BinaryType) src); if (src instanceof org.hl7.fhir.r5.model.BooleanType) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/Type40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/Type40_50.java index f72aee285..959859331 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/Type40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/Type40_50.java @@ -17,7 +17,7 @@ public class Type40_50 { } public org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException { - if (src == null) return null; + if (src == null || src.isEmpty()) return null; if (src instanceof org.hl7.fhir.r4.model.Base64BinaryType) return Base64Binary40_50.convertBase64Binary((org.hl7.fhir.r4.model.Base64BinaryType) src); if (src instanceof org.hl7.fhir.r4.model.BooleanType) @@ -136,7 +136,7 @@ public class Type40_50 { } public org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException { - if (src == null) return null; + if (src == null || src.isEmpty()) return null; if (src instanceof org.hl7.fhir.r5.model.Base64BinaryType) return Base64Binary40_50.convertBase64Binary((org.hl7.fhir.r5.model.Base64BinaryType) src); if (src instanceof org.hl7.fhir.r5.model.BooleanType)