Пример #1
0
 // Work around HAPI #224: TSComponentOne implementation of isEmpty is buggy
 private static boolean isEmpty(Visitable v) throws HL7Exception {
   if (v == null) return true;
   if (v instanceof TSComponentOne) {
     TSComponentOne tsc1 = (TSComponentOne) v;
     return tsc1.getValue() == null || tsc1.getValue().isEmpty();
   }
   if (v instanceof Composite && v.getClass().getName().endsWith(".TS")) {
     Composite ts = (Composite) v;
     return isEmpty(ts.getComponent(0));
   }
   return v.isEmpty();
 }