public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     LoCallWaitingListDetails obj,
     java.util.HashMap domMap)
     throws Exception {
   org.dom4j.Element fldEl;
   fldEl = el.element("speciality");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setSpeciality(
         ims.core.clinical.domain.objects.Service.getServicefromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("procedure");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setProcedure(
         ims.core.resource.place.domain.objects.Activity.getActivityfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("procedureText");
   if (fldEl != null) {
     obj.setProcedureText(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("referringHospital");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setReferringHospital(
         ims.core.resource.place.domain.objects.Location.getLocationfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("referringConsultant");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setReferringConsultant(
         ims.core.resource.people.domain.objects.Medic.getMedicfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("referringConsultantText");
   if (fldEl != null) {
     obj.setReferringConsultantText(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("category");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setCategory(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("waitingListType");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setWaitingListType(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("waitingListDate");
   if (fldEl != null) {
     obj.setWaitingListDate(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("waitingListMonthInterval");
   if (fldEl != null) {
     obj.setWaitingListMonthInterval(new Integer(fldEl.getTextTrim()));
   }
   fldEl = el.element("waitingListLengthQualifier");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setWaitingListLengthQualifier(
         ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("faxTo");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setFaxTo(
         ims.core.resource.people.domain.objects.MemberOfStaff.getMemberOfStafffromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("faxDate");
   if (fldEl != null) {
     obj.setFaxDate(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("liaisonQuery");
   if (fldEl != null) {
     obj.setLiaisonQuery(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("statusHistory");
   if (fldEl != null) {
     fldEl = fldEl.element("set");
     obj.setStatusHistory(
         ims.ntpf.locall.domain.objects.LoCallStatus.fromSetXMLString(
             fldEl, factory, obj.getStatusHistory(), domMap));
   }
   fldEl = el.element("currentStatus");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setCurrentStatus(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("currentStatusReason");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setCurrentStatusReason(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("isLinkedtoCase");
   if (fldEl != null) {
     obj.setIsLinkedtoCase(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("assocCase");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setAssocCase(
         ims.ntpf.casereferral.domain.objects.CaseReferral.getCaseReferralfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("assocLocall");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setAssocLocall(
         ims.ntpf.locall.domain.objects.LoCall.getLoCallfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("hospital");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setHospital(
         ims.core.resource.place.domain.objects.Location.getLocationfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("mrn");
   if (fldEl != null) {
     obj.setMrn(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("episodeNumber");
   if (fldEl != null) {
     obj.setEpisodeNumber(new String(fldEl.getTextTrim()));
   }
 }
  public String toAuditString() {
    StringBuffer auditStr = new StringBuffer();

    auditStr.append("\r\n*speciality* :");
    if (speciality != null) {
      auditStr.append(toShortClassName(speciality));

      auditStr.append(speciality.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*procedure* :");
    if (procedure != null) {
      auditStr.append(toShortClassName(procedure));

      auditStr.append(procedure.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*procedureText* :");
    auditStr.append(procedureText);
    auditStr.append("; ");
    auditStr.append("\r\n*referringHospital* :");
    if (referringHospital != null) {
      auditStr.append(toShortClassName(referringHospital));

      auditStr.append(referringHospital.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*referringConsultant* :");
    if (referringConsultant != null) {
      auditStr.append(toShortClassName(referringConsultant));

      auditStr.append(referringConsultant.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*referringConsultantText* :");
    auditStr.append(referringConsultantText);
    auditStr.append("; ");
    auditStr.append("\r\n*category* :");
    if (category != null) auditStr.append(category.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*waitingListType* :");
    if (waitingListType != null) auditStr.append(waitingListType.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*waitingListDate* :");
    auditStr.append(waitingListDate);
    auditStr.append("; ");
    auditStr.append("\r\n*waitingListMonthInterval* :");
    auditStr.append(waitingListMonthInterval);
    auditStr.append("; ");
    auditStr.append("\r\n*waitingListLengthQualifier* :");
    if (waitingListLengthQualifier != null) auditStr.append(waitingListLengthQualifier.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*faxTo* :");
    if (faxTo != null) {
      auditStr.append(toShortClassName(faxTo));

      auditStr.append(faxTo.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*faxDate* :");
    auditStr.append(faxDate);
    auditStr.append("; ");
    auditStr.append("\r\n*liaisonQuery* :");
    auditStr.append(liaisonQuery);
    auditStr.append("; ");
    auditStr.append("\r\n*statusHistory* :");
    if (statusHistory != null) {
      java.util.Iterator it15 = statusHistory.iterator();
      int i15 = 0;
      while (it15.hasNext()) {
        if (i15 > 0) auditStr.append(",");
        ims.ntpf.locall.domain.objects.LoCallStatus obj =
            (ims.ntpf.locall.domain.objects.LoCallStatus) it15.next();
        if (obj != null) {
          if (i15 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }

          auditStr.append(obj.getId());
        }
        i15++;
      }
      if (i15 > 0) auditStr.append("] " + i15);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*currentStatus* :");
    if (currentStatus != null) auditStr.append(currentStatus.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*currentStatusReason* :");
    if (currentStatusReason != null) auditStr.append(currentStatusReason.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*isLinkedtoCase* :");
    auditStr.append(isLinkedtoCase);
    auditStr.append("; ");
    auditStr.append("\r\n*assocCase* :");
    if (assocCase != null) {
      auditStr.append(toShortClassName(assocCase));

      auditStr.append(assocCase.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*assocLocall* :");
    if (assocLocall != null) {
      auditStr.append(toShortClassName(assocLocall));

      auditStr.append(assocLocall.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*hospital* :");
    if (hospital != null) {
      auditStr.append(toShortClassName(hospital));

      auditStr.append(hospital.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*mrn* :");
    auditStr.append(mrn);
    auditStr.append("; ");
    auditStr.append("\r\n*episodeNumber* :");
    auditStr.append(episodeNumber);
    auditStr.append("; ");
    return auditStr.toString();
  }