code: public void setDate(String itemName, Date date) {
          if (date == null) {
              setItem(itemName, null);
          } else {
              setItem(itemName, DateUtil.toHL7(date));
          }
      }
docs: Saves a date item object as a context item.
  
  @param itemName Item name
  @param date Date value