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*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();
  }