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 static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     SuitableForSurgeryAssessment obj,
     java.util.HashMap domMap)
     throws Exception {
   org.dom4j.Element fldEl;
   fldEl = el.element("careContext");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setCareContext(
         ims.core.admin.domain.objects.CareContext.getCareContextfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("authoringInformation");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setAuthoringInformation(
         ims.core.clinical.domain.objects.AuthoringInformation.getAuthoringInformationfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("procedure");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setProcedure(
         ims.core.clinical.domain.objects.PatientProcedure.getPatientProcedurefromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("theatreType");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setTheatreType(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("historyPresComplaint");
   if (fldEl != null) {
     obj.setHistoryPresComplaint(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("examination");
   if (fldEl != null) {
     obj.setExamination(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("conclusions");
   if (fldEl != null) {
     obj.setConclusions(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("suitableForSurgery");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setSuitableForSurgery(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("reasonNotSuitable");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setReasonNotSuitable(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("notSuitableForSurgeyComments");
   if (fldEl != null) {
     obj.setNotSuitableForSurgeyComments(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("suitableForSurgeryAssessment");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setSuitableForSurgeryAssessment(
         ims.assessment.instantiation.domain.objects.PatientAssessment.getPatientAssessmentfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("comments");
   if (fldEl != null) {
     fldEl = fldEl.element("set");
     obj.setComments(
         ims.RefMan.domain.objects.SuitableForSurgeryComment.fromSetXMLString(
             fldEl, factory, obj.getComments(), domMap));
   }
   fldEl = el.element("procedurePerformed");
   if (fldEl != null) {
     obj.setProcedurePerformed(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("suitableForSurgeryDate");
   if (fldEl != null) {
     obj.setSuitableForSurgeryDate(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("requiredDurationInMins");
   if (fldEl != null) {
     obj.setRequiredDurationInMins(new Integer(fldEl.getTextTrim()));
   }
   fldEl = el.element("anaestheticType");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setAnaestheticType(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("namedSurgeon");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setNamedSurgeon(
         ims.core.resource.people.domain.objects.Medic.getMedicfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("specialEquipmentRequired");
   if (fldEl != null) {
     obj.setSpecialEquipmentRequired(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("specialEquipmentComments");
   if (fldEl != null) {
     obj.setSpecialEquipmentComments(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("specialInstructionsRequired");
   if (fldEl != null) {
     obj.setSpecialInstructionsRequired(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("specialInstructionsComments");
   if (fldEl != null) {
     obj.setSpecialInstructionsComments(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();
  }
  public String toAuditString() {
    StringBuffer auditStr = new StringBuffer();

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

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

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

      auditStr.append(procedure.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*theatreType* :");
    if (theatreType != null) auditStr.append(theatreType.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*historyPresComplaint* :");
    auditStr.append(historyPresComplaint);
    auditStr.append("; ");
    auditStr.append("\r\n*examination* :");
    auditStr.append(examination);
    auditStr.append("; ");
    auditStr.append("\r\n*conclusions* :");
    auditStr.append(conclusions);
    auditStr.append("; ");
    auditStr.append("\r\n*suitableForSurgery* :");
    if (suitableForSurgery != null) auditStr.append(suitableForSurgery.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*reasonNotSuitable* :");
    if (reasonNotSuitable != null) auditStr.append(reasonNotSuitable.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*notSuitableForSurgeyComments* :");
    auditStr.append(notSuitableForSurgeyComments);
    auditStr.append("; ");
    auditStr.append("\r\n*suitableForSurgeryAssessment* :");
    if (suitableForSurgeryAssessment != null) {
      auditStr.append(toShortClassName(suitableForSurgeryAssessment));

      auditStr.append(suitableForSurgeryAssessment.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*comments* :");
    if (comments != null) {
      java.util.Iterator it12 = comments.iterator();
      int i12 = 0;
      while (it12.hasNext()) {
        if (i12 > 0) auditStr.append(",");
        ims.RefMan.domain.objects.SuitableForSurgeryComment obj =
            (ims.RefMan.domain.objects.SuitableForSurgeryComment) it12.next();
        if (obj != null) {
          if (i12 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }

          auditStr.append(obj.getId());
        }
        i12++;
      }
      if (i12 > 0) auditStr.append("] " + i12);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*procedurePerformed* :");
    auditStr.append(procedurePerformed);
    auditStr.append("; ");
    auditStr.append("\r\n*suitableForSurgeryDate* :");
    auditStr.append(suitableForSurgeryDate);
    auditStr.append("; ");
    auditStr.append("\r\n*requiredDurationInMins* :");
    auditStr.append(requiredDurationInMins);
    auditStr.append("; ");
    auditStr.append("\r\n*anaestheticType* :");
    if (anaestheticType != null) auditStr.append(anaestheticType.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*namedSurgeon* :");
    if (namedSurgeon != null) {
      auditStr.append(toShortClassName(namedSurgeon));

      auditStr.append(namedSurgeon.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*specialEquipmentRequired* :");
    auditStr.append(specialEquipmentRequired);
    auditStr.append("; ");
    auditStr.append("\r\n*specialEquipmentComments* :");
    auditStr.append(specialEquipmentComments);
    auditStr.append("; ");
    auditStr.append("\r\n*specialInstructionsRequired* :");
    auditStr.append(specialInstructionsRequired);
    auditStr.append("; ");
    auditStr.append("\r\n*specialInstructionsComments* :");
    auditStr.append(specialInstructionsComments);
    auditStr.append("; ");
    return auditStr.toString();
  }