/**
   * Create the ValueObject collection to hold the set of DomainObjects.
   *
   * @param map - maps DomainObjects to created ValueObjects
   * @param domainObjectSet - Set of ims.core.admin.domain.objects.CareContext objects.
   */
  public static ims.core.vo.CareContextSmallVoCollection
      createCareContextSmallVoCollectionFromCareContext(
          DomainObjectMap map, java.util.Set domainObjectSet) {
    ims.core.vo.CareContextSmallVoCollection voList =
        new ims.core.vo.CareContextSmallVoCollection();
    if (null == domainObjectSet) {
      return voList;
    }
    int rieCount = 0;
    int activeCount = 0;
    java.util.Iterator iterator = domainObjectSet.iterator();
    while (iterator.hasNext()) {
      ims.core.admin.domain.objects.CareContext domainObject =
          (ims.core.admin.domain.objects.CareContext) iterator.next();
      ims.core.vo.CareContextSmallVo vo = create(map, domainObject);

      if (vo != null) voList.add(vo);

      if (domainObject != null) {
        if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
          rieCount++;
        else activeCount++;
      }
    }
    voList.setRieCount(rieCount);
    voList.setActiveCount(activeCount);
    return voList;
  }
  /**
   * Create the ValueObject collection to hold the list of DomainObjects.
   *
   * @param map - maps DomainObjects to created ValueObjects
   * @param domainObjectList - List of ims.core.admin.domain.objects.CareContext objects.
   */
  public static ims.core.vo.CareContextSmallVoCollection
      createCareContextSmallVoCollectionFromCareContext(
          DomainObjectMap map, java.util.List domainObjectList) {
    ims.core.vo.CareContextSmallVoCollection voList =
        new ims.core.vo.CareContextSmallVoCollection();
    if (null == domainObjectList) {
      return voList;
    }
    int rieCount = 0;
    int activeCount = 0;
    for (int i = 0; i < domainObjectList.size(); i++) {
      ims.core.admin.domain.objects.CareContext domainObject =
          (ims.core.admin.domain.objects.CareContext) domainObjectList.get(i);
      ims.core.vo.CareContextSmallVo vo = create(map, domainObject);

      if (vo != null) voList.add(vo);

      if (domainObject != null) {
        if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
          rieCount++;
        else activeCount++;
      }
    }

    voList.setRieCount(rieCount);
    voList.setActiveCount(activeCount);
    return voList;
  }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.core.admin.domain.objects.CareContext
   */
  public static ims.core.vo.CareContextMinVo insert(
      DomainObjectMap map,
      ims.core.vo.CareContextMinVo valueObject,
      ims.core.admin.domain.objects.CareContext domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

    valueObject.setID_CareContext(domainObject.getId());
    valueObject.setIsRIE(domainObject.getIsRIE());

    // If this is a recordedInError record, and the domainObject
    // value isIncludeRecord has not been set, then we return null and
    // not the value object
    if (valueObject.getIsRIE() != null
        && valueObject.getIsRIE().booleanValue() == true
        && !domainObject.isIncludeRecord()) return null;

    // If this is not a recordedInError record, and the domainObject
    // value isIncludeRecord has been set, then we return null and
    // not the value object
    if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false)
        && domainObject.isIncludeRecord()) return null;

    // EpisodeOfCare
    valueObject.setEpisodeOfCare(
        ims.core.vo.domain.EpisodeOfCareForPatientDocumentsVoAssembler.create(
            map, domainObject.getEpisodeOfCare()));
    // StartDateTime
    java.util.Date StartDateTime = domainObject.getStartDateTime();
    if (null != StartDateTime) {
      valueObject.setStartDateTime(new ims.framework.utils.DateTime(StartDateTime));
    }
    // ResponsibleHCP
    if (domainObject.getResponsibleHCP() != null) {
      if (domainObject.getResponsibleHCP()
          instanceof
          HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the
      // id already.
      {
        HibernateProxy p = (HibernateProxy) domainObject.getResponsibleHCP();
        int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString());
        valueObject.setResponsibleHCP(new ims.core.resource.people.vo.HcpRefVo(id, -1));
      } else {
        valueObject.setResponsibleHCP(
            new ims.core.resource.people.vo.HcpRefVo(
                domainObject.getResponsibleHCP().getId(),
                domainObject.getResponsibleHCP().getVersion()));
      }
    }
    return valueObject;
  }
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     OutpatientPreAssessment 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("suitableForSurgeryAssessment");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setSuitableForSurgeryAssessment(
         ims.RefMan.domain.objects.SuitableForSurgeryAssessment
             .getSuitableForSurgeryAssessmentfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("fitForSurgeryAssesment");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setFitForSurgeryAssesment(
         ims.RefMan.domain.objects.FitForSurgeryAssesment.getFitForSurgeryAssesmentfromXML(
             fldEl, factory, domMap));
   }
 }
  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*suitableForSurgeryAssessment* :");
    if (suitableForSurgeryAssessment != null) {
      auditStr.append(toShortClassName(suitableForSurgeryAssessment));

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

      auditStr.append(fitForSurgeryAssesment.getId());
    }
    auditStr.append("; ");
    return auditStr.toString();
  }
  /**
   * Create the ValueObject from the ims.core.admin.domain.objects.CareContext object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param domainObject
   */
  public static ims.core.vo.CareContextSmallVo create(
      DomainObjectMap map, ims.core.admin.domain.objects.CareContext domainObject) {
    if (null == domainObject) {
      return null;
    }
    // check if the domainObject already has a valueObject created for it
    ims.core.vo.CareContextSmallVo valueObject =
        (ims.core.vo.CareContextSmallVo)
            map.getValueObject(domainObject, ims.core.vo.CareContextSmallVo.class);
    if (null == valueObject) {
      valueObject =
          new ims.core.vo.CareContextSmallVo(domainObject.getId(), domainObject.getVersion());
      map.addValueObject(domainObject, valueObject);

      valueObject = insert(map, valueObject, domainObject);
    }
    return valueObject;
  }
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     SentToXray obj,
     java.util.HashMap domMap)
     throws Exception {
   org.dom4j.Element fldEl;
   fldEl = el.element("patient");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setPatient(
         ims.core.patient.domain.objects.Patient.getPatientfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("episode");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setEpisode(
         ims.core.admin.domain.objects.EpisodeOfCare.getEpisodeOfCarefromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("attendance");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setAttendance(
         ims.core.admin.domain.objects.CareContext.getCareContextfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("trackingArea");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setTrackingArea(
         ims.emergency.configuration.domain.objects.TrackingArea.getTrackingAreafromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("sentDateTime");
   if (fldEl != null) {
     obj.setSentDateTime(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("sentBy");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setSentBy(
         ims.core.resource.people.domain.objects.MemberOfStaff.getMemberOfStafffromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("returnedDateTime");
   if (fldEl != null) {
     obj.setReturnedDateTime(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
 }
  public String toAuditString() {
    StringBuffer auditStr = new StringBuffer();

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

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

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

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

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

      auditStr.append(sentBy.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*returnedDateTime* :");
    auditStr.append(returnedDateTime);
    auditStr.append("; ");
    return auditStr.toString();
  }
 private MedicationDetails getMedicationDetailsFromCareContext(CareContext careContext) {
   DomainFactory factory = getDomainFactory();
   MedicationDetails md;
   List<?> medicationDetailsList =
       factory.find(
           "select md from MedicationDetails md left join md.careContext cc where cc.id = :CC",
           new String[] {"CC"},
           new Object[] {careContext.getId()});
   if (medicationDetailsList == null
       || medicationDetailsList.size() == 0
       || medicationDetailsList.get(0) == null) {
     // Create one
     md = new MedicationDetails();
     md.setCareContext(careContext);
     md.setTTARequired(getDomLookup(TTORequired.REQUIRED));
     return md;
   }
   return (MedicationDetails) medicationDetailsList.get(0);
 }
示例#10
0
  public String toAuditString() {
    StringBuffer auditStr = new StringBuffer();

    auditStr.append("\r\n*itemCategory* :");
    if (itemCategory != null) auditStr.append(itemCategory.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*itemType* :");
    if (itemType != null) auditStr.append(itemType.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*supplier* :");
    if (supplier != null) auditStr.append(supplier.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*dateRequired* :");
    auditStr.append(dateRequired);
    auditStr.append("; ");
    auditStr.append("\r\n*dateSupplied* :");
    auditStr.append(dateSupplied);
    auditStr.append("; ");
    auditStr.append("\r\n*suppliedFor* :");
    if (suppliedFor != null) auditStr.append(suppliedFor.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*loan* :");
    if (loan != null) auditStr.append(loan.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*fundedBy* :");
    if (fundedBy != null) auditStr.append(fundedBy.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*clinicalContact* :");
    if (clinicalContact != null) {
      auditStr.append(toShortClassName(clinicalContact));

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

      auditStr.append(careContext.getId());
    }
    auditStr.append("; ");
    return auditStr.toString();
  }
  public OrderInvestigationForAttendenceNotesCcVoCollection listOrderInvestigations(
      PatientRefVo patient, CareContextRefVo careContext, String investigationsAlreadyAdded) {
    if (patient == null || patient.getID_Patient() == null)
      throw new CodingRuntimeException(
          "Patient parameter can not be null when listing OrderInvestigations.");

    DomainFactory factory = getDomainFactory();
    java.util.Date fromDate = null;
    java.util.Date dateTo = null;

    if (careContext != null && careContext.getID_CareContext() != null) {
      CareContext doCareContext =
          (CareContext) factory.getDomainObject(CareContext.class, careContext.getID_CareContext());
      if (doCareContext != null) {
        if (doCareContext.getStartDateTime() != null) {
          fromDate = doCareContext.getStartDateTime();
        }

        if (doCareContext.getEndDateTime() != null) {
          return null;
        }

        dateTo = new java.util.Date();
      }
    }

    StringBuilder query = new StringBuilder();

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    query.append("SELECT orderInv FROM OrderInvestigation AS orderInv ");
    query.append(
        " LEFT JOIN FETCH orderInv.orderDetails AS details LEFT JOIN details.patient AS patient left join orderInv.investigation as inv left join inv.investigationIndex as invIndex left join orderInv.ordInvCurrentStatus.ordInvStatus as ordStatus ");

    query.append(
        "WHERE patient.id = :PATIENT_ID and ordStatus.id <> :cancelledStatusId and ordStatus.id <> :cancelRequestStatusId");
    paramNames.add("PATIENT_ID");
    paramValues.add(patient.getID_Patient());

    // WDEV-17303
    paramNames.add("cancelledStatusId");
    paramValues.add(OrderInvStatus.CANCELLED.getID());
    paramNames.add("cancelRequestStatusId");
    paramValues.add(OrderInvStatus.CANCEL_REQUEST.getID());

    if (fromDate != null && dateTo != null) {
      query.append(
          " AND orderInv.systemInformation.creationDateTime BETWEEN :FROM_DATE AND :END_DATE ");

      paramNames.add("FROM_DATE");
      paramValues.add(fromDate);
      paramNames.add("END_DATE");
      paramValues.add(dateTo);
    }

    if (investigationsAlreadyAdded != null && investigationsAlreadyAdded.length() > 0) {
      query.append(" AND orderInv.id not in (");
      query.append(investigationsAlreadyAdded);
      query.append(") ");
    }

    query.append(" order by UPPER(invIndex.name) asc");

    return OrderInvestigationForAttendenceNotesCcVoAssembler
        .createOrderInvestigationForAttendenceNotesCcVoCollectionFromOrderInvestigation(
            factory.find(query.toString(), paramNames, paramValues));
  }
示例#12
0
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     PlanOfCare obj,
     java.util.HashMap domMap)
     throws Exception {
   org.dom4j.Element fldEl;
   fldEl = el.element("clinicalContact");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setClinicalContact(
         ims.core.admin.domain.objects.ClinicalContact.getClinicalContactfromXML(
             fldEl, factory, domMap));
   }
   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("startDateTime");
   if (fldEl != null) {
     obj.setStartDateTime(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("startHCP");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setStartHCP(
         ims.core.resource.people.domain.objects.Hcp.getHcpfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("levelOfIntervention");
   if (fldEl != null) {
     obj.setLevelOfIntervention(ims.framework.utils.Color.getColor(fldEl.getTextTrim()));
   }
   fldEl = el.element("group");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setGroup(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("title");
   if (fldEl != null) {
     obj.setTitle(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("status");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setStatus(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("resolvedDateTime");
   if (fldEl != null) {
     obj.setResolvedDateTime(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("resolvingHCP");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setResolvingHCP(
         ims.core.resource.people.domain.objects.Hcp.getHcpfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("confirmingDateTime");
   if (fldEl != null) {
     obj.setConfirmingDateTime(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("confirmingHCP");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setConfirmingHCP(
         ims.core.resource.people.domain.objects.Hcp.getHcpfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("actions");
   if (fldEl != null) {
     fldEl = fldEl.element("set");
     obj.setActions(
         ims.nursing.domain.objects.PlanOfCareActions.fromSetXMLString(
             fldEl, factory, obj.getActions(), domMap));
   }
   fldEl = el.element("assessmentQuestion");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setAssessmentQuestion(
         ims.assessment.configuration.domain.objects.AssessmentQuestion
             .getAssessmentQuestionfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("answerHistory");
   if (fldEl != null) {
     fldEl = fldEl.element("set");
     obj.setAnswerHistory(
         ims.nursing.domain.objects.PlanOfCareHistory.fromSetXMLString(
             fldEl, factory, obj.getAnswerHistory(), domMap));
   }
 }
示例#13
0
  public String toAuditString() {
    StringBuffer auditStr = new StringBuffer();

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

      auditStr.append(clinicalContact.getId());
    }
    auditStr.append("; ");
    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*startDateTime* :");
    auditStr.append(startDateTime);
    auditStr.append("; ");
    auditStr.append("\r\n*startHCP* :");
    if (startHCP != null) {
      auditStr.append(toShortClassName(startHCP));

      auditStr.append(startHCP.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*levelOfIntervention* :");
    auditStr.append(levelOfIntervention);
    auditStr.append("; ");
    auditStr.append("\r\n*group* :");
    if (group != null) auditStr.append(group.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*title* :");
    auditStr.append(title);
    auditStr.append("; ");
    auditStr.append("\r\n*status* :");
    if (status != null) auditStr.append(status.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*resolvedDateTime* :");
    auditStr.append(resolvedDateTime);
    auditStr.append("; ");
    auditStr.append("\r\n*resolvingHCP* :");
    if (resolvingHCP != null) {
      auditStr.append(toShortClassName(resolvingHCP));

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

      auditStr.append(confirmingHCP.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*actions* :");
    if (actions != null) {
      java.util.Iterator it14 = actions.iterator();
      int i14 = 0;
      while (it14.hasNext()) {
        if (i14 > 0) auditStr.append(",");
        ims.nursing.domain.objects.PlanOfCareActions obj =
            (ims.nursing.domain.objects.PlanOfCareActions) it14.next();
        if (obj != null) {
          if (i14 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }

          auditStr.append(obj.getId());
        }
        i14++;
      }
      if (i14 > 0) auditStr.append("] " + i14);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*assessmentQuestion* :");
    if (assessmentQuestion != null) {
      auditStr.append(toShortClassName(assessmentQuestion));

      auditStr.append(assessmentQuestion.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*answerHistory* :");
    if (answerHistory != null) {
      java.util.Iterator it16 = answerHistory.iterator();
      int i16 = 0;
      while (it16.hasNext()) {
        if (i16 > 0) auditStr.append(",");
        ims.nursing.domain.objects.PlanOfCareHistory obj =
            (ims.nursing.domain.objects.PlanOfCareHistory) it16.next();
        if (obj != null) {
          if (i16 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }

          auditStr.append(obj.getId());
        }
        i16++;
      }
      if (i16 > 0) auditStr.append("] " + i16);
    }
    auditStr.append("; ");
    return auditStr.toString();
  }
示例#14
0
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     Adaptations obj,
     java.util.HashMap domMap)
     throws Exception {
   org.dom4j.Element fldEl;
   fldEl = el.element("itemCategory");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setItemCategory(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("itemType");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setItemType(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("supplier");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setSupplier(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("dateRequired");
   if (fldEl != null) {
     obj.setDateRequired(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("dateSupplied");
   if (fldEl != null) {
     obj.setDateSupplied(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("suppliedFor");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setSuppliedFor(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("loan");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setLoan(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("fundedBy");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setFundedBy(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("clinicalContact");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setClinicalContact(
         ims.core.admin.domain.objects.ClinicalContact.getClinicalContactfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("careContext");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setCareContext(
         ims.core.admin.domain.objects.CareContext.getCareContextfromXML(fldEl, factory, domMap));
   }
 }
  public static ims.core.admin.domain.objects.CareContext extractCareContext(
      ims.domain.ILightweightDomainFactory domainFactory,
      ims.core.vo.CareContextSmallVo valueObject,
      HashMap domMap) {
    if (null == valueObject) {
      return null;
    }
    Integer id = valueObject.getID_CareContext();
    ims.core.admin.domain.objects.CareContext domainObject = null;
    if (null == id) {
      if (domMap.get(valueObject) != null) {
        return (ims.core.admin.domain.objects.CareContext) domMap.get(valueObject);
      }
      // ims.core.vo.CareContextSmallVo ID_CareContext field is unknown
      domainObject = new ims.core.admin.domain.objects.CareContext();
      domMap.put(valueObject, domainObject);
    } else {
      String key = (valueObject.getClass().getName() + "__" + valueObject.getID_CareContext());
      if (domMap.get(key) != null) {
        return (ims.core.admin.domain.objects.CareContext) domMap.get(key);
      }
      domainObject =
          (ims.core.admin.domain.objects.CareContext)
              domainFactory.getDomainObject(ims.core.admin.domain.objects.CareContext.class, id);

      // TODO: Not sure how this should be handled. Effectively it must be a staleobject exception,
      // but maybe should be handled as that further up.
      if (domainObject == null) return null;

      domMap.put(key, domainObject);
    }
    domainObject.setVersion(valueObject.getVersion_CareContext());

    // create LookupInstance from vo LookupType
    ims.domain.lookups.LookupInstance value1 = null;
    if (null != valueObject.getContext()) {
      value1 = domainFactory.getLookupInstance(valueObject.getContext().getID());
    }
    domainObject.setContext(value1);
    ims.framework.utils.DateTime dateTime2 = valueObject.getStartDateTime();
    java.util.Date value2 = null;
    if (dateTime2 != null) {
      value2 = dateTime2.getJavaDate();
    }
    domainObject.setStartDateTime(value2);
    ims.framework.utils.DateTime dateTime3 = valueObject.getEndDateTime();
    java.util.Date value3 = null;
    if (dateTime3 != null) {
      value3 = dateTime3.getJavaDate();
    }
    domainObject.setEndDateTime(value3);

    // SaveAsRefVO treated as RefValueObject
    ims.core.admin.vo.CareContextHistoryRefVoCollection refCollection4 =
        new ims.core.admin.vo.CareContextHistoryRefVoCollection();
    if (valueObject.getCareContextHistory() != null) {
      for (int i4 = 0; i4 < valueObject.getCareContextHistory().size(); i4++) {
        ims.core.admin.vo.CareContextHistoryRefVo ref4 =
            (ims.core.admin.vo.CareContextHistoryRefVo) valueObject.getCareContextHistory().get(i4);
        refCollection4.add(ref4);
      }
    }
    int size4 = (null == refCollection4) ? 0 : refCollection4.size();
    java.util.Set domainCareContextHistory4 = domainObject.getCareContextHistory();
    if (domainCareContextHistory4 == null) {
      domainCareContextHistory4 = new java.util.HashSet();
    }
    java.util.Set newSet4 = new java.util.HashSet();
    for (int i = 0; i < size4; i++) {
      ims.core.admin.vo.CareContextHistoryRefVo vo = refCollection4.get(i);
      ims.core.admin.domain.objects.CareContextHistory dom = null;
      if (null != vo) {
        if (vo.getBoId() == null) {
          if (domMap.get(vo) != null) {
            dom = (ims.core.admin.domain.objects.CareContextHistory) domMap.get(vo);
          }
        } else {
          dom =
              (ims.core.admin.domain.objects.CareContextHistory)
                  domainFactory.getDomainObject(
                      ims.core.admin.domain.objects.CareContextHistory.class, vo.getBoId());
        }
      }

      // Trying to avoid the hibernate collection being marked as dirty via its public interface
      // methods. (like add)
      if (!domainCareContextHistory4.contains(dom)) {
        domainCareContextHistory4.add(dom);
      }
      newSet4.add(dom);
    }
    java.util.Set removedSet4 = new java.util.HashSet();
    java.util.Iterator iter4 = domainCareContextHistory4.iterator();
    // Find out which objects need to be removed
    while (iter4.hasNext()) {
      ims.domain.DomainObject o = (ims.domain.DomainObject) iter4.next();
      if ((o == null || o.getIsRIE() == null || !o.getIsRIE().booleanValue())
          && !newSet4.contains(o)) {
        removedSet4.add(o);
      }
    }
    iter4 = removedSet4.iterator();
    // Remove the unwanted objects
    while (iter4.hasNext()) {
      domainCareContextHistory4.remove(iter4.next());
    }

    domainObject.setCareContextHistory(domainCareContextHistory4);

    return domainObject;
  }
  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*dischargingNurse* :");
    if (dischargingNurse != null) {
      auditStr.append(toShortClassName(dischargingNurse));

      auditStr.append(dischargingNurse.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*gestationWeeks* :");
    auditStr.append(gestationWeeks);
    auditStr.append("; ");
    auditStr.append("\r\n*isMidwife* :");
    auditStr.append(isMidwife);
    auditStr.append("; ");
    auditStr.append("\r\n*isHealthVisitor* :");
    auditStr.append(isHealthVisitor);
    auditStr.append("; ");
    auditStr.append("\r\n*feeding* :");
    if (feeding != null) auditStr.append(feeding.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*isVitaminKGiven* :");
    auditStr.append(isVitaminKGiven);
    auditStr.append("; ");
    auditStr.append("\r\n*route* :");
    if (route != null) auditStr.append(route.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*_1stPKUTestDate* :");
    auditStr.append(_1stPKUTestDate);
    auditStr.append("; ");
    auditStr.append("\r\n*_2ndPKUTestDate* :");
    auditStr.append(_2ndPKUTestDate);
    auditStr.append("; ");
    auditStr.append("\r\n*apgar1Minute* :");
    auditStr.append(apgar1Minute);
    auditStr.append("; ");
    auditStr.append("\r\n*apgar5Minute* :");
    auditStr.append(apgar5Minute);
    auditStr.append("; ");
    auditStr.append("\r\n*birthWeight* :");
    auditStr.append(birthWeight);
    auditStr.append("; ");
    auditStr.append("\r\n*length* :");
    auditStr.append(length);
    auditStr.append("; ");
    auditStr.append("\r\n*dischargeWeight* :");
    auditStr.append(dischargeWeight);
    auditStr.append("; ");
    auditStr.append("\r\n*isComplete* :");
    auditStr.append(isComplete);
    auditStr.append("; ");
    return auditStr.toString();
  }
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     NeoNatal 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("dischargingNurse");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setDischargingNurse(
         ims.core.resource.people.domain.objects.Nurse.getNursefromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("gestationWeeks");
   if (fldEl != null) {
     obj.setGestationWeeks(new Integer(fldEl.getTextTrim()));
   }
   fldEl = el.element("isMidwife");
   if (fldEl != null) {
     obj.setIsMidwife(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("isHealthVisitor");
   if (fldEl != null) {
     obj.setIsHealthVisitor(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("feeding");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setFeeding(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("isVitaminKGiven");
   if (fldEl != null) {
     obj.setIsVitaminKGiven(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("route");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setRoute(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("_1stPKUTestDate");
   if (fldEl != null) {
     obj.set_1stPKUTestDate(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("_2ndPKUTestDate");
   if (fldEl != null) {
     obj.set_2ndPKUTestDate(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("apgar1Minute");
   if (fldEl != null) {
     obj.setApgar1Minute(new Integer(fldEl.getTextTrim()));
   }
   fldEl = el.element("apgar5Minute");
   if (fldEl != null) {
     obj.setApgar5Minute(new Integer(fldEl.getTextTrim()));
   }
   fldEl = el.element("birthWeight");
   if (fldEl != null) {
     obj.setBirthWeight(new java.lang.Float(fldEl.getTextTrim()));
   }
   fldEl = el.element("length");
   if (fldEl != null) {
     obj.setLength(new Integer(fldEl.getTextTrim()));
   }
   fldEl = el.element("dischargeWeight");
   if (fldEl != null) {
     obj.setDischargeWeight(new java.lang.Float(fldEl.getTextTrim()));
   }
   fldEl = el.element("isComplete");
   if (fldEl != null) {
     obj.setIsComplete(new Boolean(fldEl.getTextTrim()));
   }
 }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.core.admin.domain.objects.CareContext
   */
  public static ims.core.vo.CareContextSmallVo insert(
      DomainObjectMap map,
      ims.core.vo.CareContextSmallVo valueObject,
      ims.core.admin.domain.objects.CareContext domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

    valueObject.setID_CareContext(domainObject.getId());
    valueObject.setIsRIE(domainObject.getIsRIE());

    // If this is a recordedInError record, and the domainObject
    // value isIncludeRecord has not been set, then we return null and
    // not the value object
    if (valueObject.getIsRIE() != null
        && valueObject.getIsRIE().booleanValue() == true
        && !domainObject.isIncludeRecord()) return null;

    // If this is not a recordedInError record, and the domainObject
    // value isIncludeRecord has been set, then we return null and
    // not the value object
    if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false)
        && domainObject.isIncludeRecord()) return null;

    // Context
    ims.domain.lookups.LookupInstance instance1 = domainObject.getContext();
    if (null != instance1) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance1.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance1.getImage().getImageId(), instance1.getImage().getImagePath());
      }
      color = instance1.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.ContextType voLookup1 =
          new ims.core.vo.lookups.ContextType(
              instance1.getId(), instance1.getText(), instance1.isActive(), null, img, color);
      ims.core.vo.lookups.ContextType parentVoLookup1 = voLookup1;
      ims.domain.lookups.LookupInstance parent1 = instance1.getParent();
      while (parent1 != null) {
        if (parent1.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent1.getImage().getImageId(), parent1.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent1.getColor();
        if (color != null) color.getValue();
        parentVoLookup1.setParent(
            new ims.core.vo.lookups.ContextType(
                parent1.getId(), parent1.getText(), parent1.isActive(), null, img, color));
        parentVoLookup1 = parentVoLookup1.getParent();
        parent1 = parent1.getParent();
      }
      valueObject.setContext(voLookup1);
    }
    // StartDateTime
    java.util.Date StartDateTime = domainObject.getStartDateTime();
    if (null != StartDateTime) {
      valueObject.setStartDateTime(new ims.framework.utils.DateTime(StartDateTime));
    }
    // EndDateTime
    java.util.Date EndDateTime = domainObject.getEndDateTime();
    if (null != EndDateTime) {
      valueObject.setEndDateTime(new ims.framework.utils.DateTime(EndDateTime));
    }
    // CareContextHistory
    valueObject.setCareContextHistory(
        ims.core.vo.domain.CareContextHistVoAssembler
            .createCareContextHistVoCollectionFromCareContextHistory(
                map, domainObject.getCareContextHistory()));
    return valueObject;
  }
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     SurgicalOpNotes 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("intraOperativeCareRecord");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setIntraOperativeCareRecord(
         ims.core.clinical.domain.objects.IntraOperativeCareRecord
             .getIntraOperativeCareRecordfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("preOperativeDiagnosis");
   if (fldEl != null) {
     obj.setPreOperativeDiagnosis(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("antibiotics");
   if (fldEl != null) {
     obj.setAntibiotics(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("vTE");
   if (fldEl != null) {
     obj.setVTE(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("incision");
   if (fldEl != null) {
     obj.setIncision(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("findings");
   if (fldEl != null) {
     obj.setFindings(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("procedure");
   if (fldEl != null) {
     obj.setProcedure(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("complications");
   if (fldEl != null) {
     obj.setComplications(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("closure");
   if (fldEl != null) {
     obj.setClosure(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("lAInfiltration");
   if (fldEl != null) {
     obj.setLAInfiltration(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("postOpInstructions");
   if (fldEl != null) {
     obj.setPostOpInstructions(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("eBI");
   if (fldEl != null) {
     obj.setEBI(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("followUpType");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setFollowUpType(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("followUpTypeIn");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setFollowUpTypeIn(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
 }
  public String toAuditString() {
    StringBuffer auditStr = new StringBuffer();

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

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

      auditStr.append(patient.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*investigations* :");
    if (investigations != null) {
      java.util.Iterator it3 = investigations.iterator();
      int i3 = 0;
      while (it3.hasNext()) {
        if (i3 > 0) auditStr.append(",");
        ims.ocrr.orderingresults.domain.objects.OrderInvestigation obj =
            (ims.ocrr.orderingresults.domain.objects.OrderInvestigation) it3.next();
        if (obj != null) {
          if (i3 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }

          auditStr.append(obj.getId());
        }
        i3++;
      }
      if (i3 > 0) auditStr.append("] " + i3);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*orderedBy* :");
    if (orderedBy != null) {
      auditStr.append(toShortClassName(orderedBy));

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

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

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

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

      auditStr.append(patientClinic.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*hcpAlerts* :");
    if (hcpAlerts != null) {
      java.util.Iterator it9 = hcpAlerts.iterator();
      int i9 = 0;
      while (it9.hasNext()) {
        if (i9 > 0) auditStr.append(",");
        ims.ocrr.orderingresults.domain.objects.OrderHCPAlert obj =
            (ims.ocrr.orderingresults.domain.objects.OrderHCPAlert) it9.next();
        if (obj != null) {
          if (i9 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }

          auditStr.append(obj.getId());
        }
        i9++;
      }
      if (i9 > 0) auditStr.append("] " + i9);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*clinicalTrial* :");
    auditStr.append(clinicalTrial);
    auditStr.append("; ");
    auditStr.append("\r\n*clinicalTrialTxt* :");
    auditStr.append(clinicalTrialTxt);
    auditStr.append("; ");
    auditStr.append("\r\n*clinicalInfo* :");
    if (clinicalInfo != null) {
      auditStr.append(toShortClassName(clinicalInfo));

      auditStr.append(clinicalInfo.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*additClinNotes* :");
    auditStr.append(additClinNotes);
    auditStr.append("; ");
    auditStr.append("\r\n*patMobility* :");
    if (patMobility != null) auditStr.append(patMobility.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*orderCategory* :");
    if (orderCategory != null) auditStr.append(orderCategory.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*reportTo* :");
    if (reportTo != null) {
      int i16 = 0;
      for (i16 = 0; i16 < reportTo.size(); i16++) {
        if (i16 > 0) auditStr.append(",");
        ims.ocrr.orderingresults.domain.objects.OcsReportTo obj =
            (ims.ocrr.orderingresults.domain.objects.OcsReportTo) reportTo.get(i16);
        if (obj != null) {
          if (i16 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }
          auditStr.append(obj.toString());
        }
      }
      if (i16 > 0) auditStr.append("] " + i16);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*specimens* :");
    if (specimens != null) {
      java.util.Iterator it17 = specimens.iterator();
      int i17 = 0;
      while (it17.hasNext()) {
        if (i17 > 0) auditStr.append(",");
        ims.ocrr.orderingresults.domain.objects.OrderSpecimen obj =
            (ims.ocrr.orderingresults.domain.objects.OrderSpecimen) it17.next();
        if (obj != null) {
          if (i17 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }

          auditStr.append(obj.getId());
        }
        i17++;
      }
      if (i17 > 0) auditStr.append("] " + i17);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*wasProcessed* :");
    auditStr.append(wasProcessed);
    auditStr.append("; ");
    auditStr.append("\r\n*authorisationOrderStatus* :");
    if (authorisationOrderStatus != null) auditStr.append(authorisationOrderStatus.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*wasDiscarded* :");
    auditStr.append(wasDiscarded);
    auditStr.append("; ");
    auditStr.append("\r\n*careContext* :");
    if (careContext != null) {
      auditStr.append(toShortClassName(careContext));

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

      auditStr.append(orderingHospital.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*hasNewOrUpdatedResults* :");
    auditStr.append(hasNewOrUpdatedResults);
    auditStr.append("; ");
    auditStr.append("\r\n*bedNumber* :");
    auditStr.append(bedNumber);
    auditStr.append("; ");
    auditStr.append("\r\n*sendNumber* :");
    auditStr.append(sendNumber);
    auditStr.append("; ");
    auditStr.append("\r\n*outpatientDept* :");
    if (outpatientDept != null) {
      auditStr.append(toShortClassName(outpatientDept));

      auditStr.append(outpatientDept.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*summaryClinicalInformation* :");
    auditStr.append(summaryClinicalInformation);
    auditStr.append("; ");
    auditStr.append("\r\n*bleepExtNumber* :");
    auditStr.append(bleepExtNumber);
    auditStr.append("; ");
    return auditStr.toString();
  }
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     OcsOrderSession obj,
     java.util.HashMap domMap)
     throws Exception {
   org.dom4j.Element fldEl;
   fldEl = el.element("clinicalContact");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setClinicalContact(
         ims.core.admin.domain.objects.ClinicalContact.getClinicalContactfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("patient");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setPatient(
         ims.core.patient.domain.objects.Patient.getPatientfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("investigations");
   if (fldEl != null) {
     fldEl = fldEl.element("set");
     obj.setInvestigations(
         ims.ocrr.orderingresults.domain.objects.OrderInvestigation.fromSetXMLString(
             fldEl, factory, obj.getInvestigations(), domMap));
   }
   fldEl = el.element("orderedBy");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setOrderedBy(
         ims.core.resource.people.domain.objects.MemberOfStaff.getMemberOfStafffromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("responsibleClinician");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setResponsibleClinician(
         ims.core.resource.people.domain.objects.Hcp.getHcpfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("responsibleGp");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setResponsibleGp(
         ims.core.resource.people.domain.objects.Gp.getGpfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("patientLocation");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setPatientLocation(
         ims.core.resource.place.domain.objects.Location.getLocationfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("patientClinic");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setPatientClinic(
         ims.core.resource.place.domain.objects.Clinic.getClinicfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("hcpAlerts");
   if (fldEl != null) {
     fldEl = fldEl.element("set");
     obj.setHcpAlerts(
         ims.ocrr.orderingresults.domain.objects.OrderHCPAlert.fromSetXMLString(
             fldEl, factory, obj.getHcpAlerts(), domMap));
   }
   fldEl = el.element("clinicalTrial");
   if (fldEl != null) {
     obj.setClinicalTrial(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("clinicalTrialTxt");
   if (fldEl != null) {
     obj.setClinicalTrialTxt(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("clinicalInfo");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setClinicalInfo(
         ims.ocrr.orderingresults.domain.objects.OcsQASession.getOcsQASessionfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("additClinNotes");
   if (fldEl != null) {
     obj.setAdditClinNotes(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("patMobility");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setPatMobility(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("orderCategory");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setOrderCategory(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("reportTo");
   if (fldEl != null) {
     fldEl = fldEl.element("list");
     obj.setReportTo(
         ims.ocrr.orderingresults.domain.objects.OcsReportTo.fromListXMLString(
             fldEl, factory, obj.getReportTo(), domMap));
   }
   fldEl = el.element("specimens");
   if (fldEl != null) {
     fldEl = fldEl.element("set");
     obj.setSpecimens(
         ims.ocrr.orderingresults.domain.objects.OrderSpecimen.fromSetXMLString(
             fldEl, factory, obj.getSpecimens(), domMap));
   }
   fldEl = el.element("wasProcessed");
   if (fldEl != null) {
     obj.setWasProcessed(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("authorisationOrderStatus");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setAuthorisationOrderStatus(
         ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("wasDiscarded");
   if (fldEl != null) {
     obj.setWasDiscarded(new Boolean(fldEl.getTextTrim()));
   }
   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("orderingHospital");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setOrderingHospital(
         ims.core.resource.place.domain.objects.LocSite.getLocSitefromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("hasNewOrUpdatedResults");
   if (fldEl != null) {
     obj.setHasNewOrUpdatedResults(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("bedNumber");
   if (fldEl != null) {
     obj.setBedNumber(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("sendNumber");
   if (fldEl != null) {
     obj.setSendNumber(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("outpatientDept");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setOutpatientDept(
         ims.core.resource.place.domain.objects.Location.getLocationfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("summaryClinicalInformation");
   if (fldEl != null) {
     obj.setSummaryClinicalInformation(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("bleepExtNumber");
   if (fldEl != null) {
     obj.setBleepExtNumber(new String(fldEl.getTextTrim()));
   }
 }
示例#22
0
  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*dischargeLetterStatus* :");
    if (dischargeLetterStatus != null) auditStr.append(dischargeLetterStatus.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*admissionDateTime* :");
    auditStr.append(admissionDateTime);
    auditStr.append("; ");
    auditStr.append("\r\n*tTAStatus* :");
    if (tTAStatus != null) auditStr.append(tTAStatus.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*hasHadAnyProceduresPerformed* :");
    if (hasHadAnyProceduresPerformed != null)
      auditStr.append(hasHadAnyProceduresPerformed.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*additonalClinicalInfo* :");
    if (additonalClinicalInfo != null) auditStr.append(additonalClinicalInfo.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*dischargeSupplementaryLetterStatus* :");
    if (dischargeSupplementaryLetterStatus != null)
      auditStr.append(dischargeSupplementaryLetterStatus.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*summaryDetails* :");
    if (summaryDetails != null) {
      int i8 = 0;
      for (i8 = 0; i8 < summaryDetails.size(); i8++) {
        if (i8 > 0) auditStr.append(",");
        ims.edischarge.domain.objects.SummaryDetail obj =
            (ims.edischarge.domain.objects.SummaryDetail) summaryDetails.get(i8);
        if (obj != null) {
          if (i8 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }
          auditStr.append(obj.getId());
        }
      }
      if (i8 > 0) auditStr.append("] " + i8);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*dischargeDocuments* :");
    if (dischargeDocuments != null) {
      java.util.Iterator it9 = dischargeDocuments.iterator();
      int i9 = 0;
      while (it9.hasNext()) {
        if (i9 > 0) auditStr.append(",");
        ims.core.documents.domain.objects.PatientDocument obj =
            (ims.core.documents.domain.objects.PatientDocument) it9.next();
        if (obj != null) {
          if (i9 == 0) {
            auditStr.append(toShortClassName(obj));
            auditStr.append("[");
          }

          auditStr.append(obj.getId());
        }
        i9++;
      }
      if (i9 > 0) auditStr.append("] " + i9);
    }
    auditStr.append("; ");
    auditStr.append("\r\n*dischargeDetails* :");
    if (dischargeDetails != null) {
      auditStr.append(toShortClassName(dischargeDetails));

      auditStr.append(dischargeDetails.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*wasPatientDischargedThenUndone* :");
    auditStr.append(wasPatientDischargedThenUndone);
    auditStr.append("; ");
    return auditStr.toString();
  }
  public static ims.core.admin.domain.objects.CareContext extractCareContext(
      ims.domain.ILightweightDomainFactory domainFactory,
      ims.core.vo.CareContextMinVo valueObject,
      HashMap domMap) {
    if (null == valueObject) {
      return null;
    }
    Integer id = valueObject.getID_CareContext();
    ims.core.admin.domain.objects.CareContext domainObject = null;
    if (null == id) {
      if (domMap.get(valueObject) != null) {
        return (ims.core.admin.domain.objects.CareContext) domMap.get(valueObject);
      }
      // ims.core.vo.CareContextMinVo ID_CareContext field is unknown
      domainObject = new ims.core.admin.domain.objects.CareContext();
      domMap.put(valueObject, domainObject);
    } else {
      String key = (valueObject.getClass().getName() + "__" + valueObject.getID_CareContext());
      if (domMap.get(key) != null) {
        return (ims.core.admin.domain.objects.CareContext) domMap.get(key);
      }
      domainObject =
          (ims.core.admin.domain.objects.CareContext)
              domainFactory.getDomainObject(ims.core.admin.domain.objects.CareContext.class, id);

      // TODO: Not sure how this should be handled. Effectively it must be a staleobject exception,
      // but maybe should be handled as that further up.
      if (domainObject == null) return null;

      domMap.put(key, domainObject);
    }
    domainObject.setVersion(valueObject.getVersion_CareContext());

    // SaveAsRefVO - treated as a refVo in extract methods
    ims.core.admin.domain.objects.EpisodeOfCare value1 = null;
    if (null != valueObject.getEpisodeOfCare()) {
      if (valueObject.getEpisodeOfCare().getBoId() == null) {
        if (domMap.get(valueObject.getEpisodeOfCare()) != null) {
          value1 =
              (ims.core.admin.domain.objects.EpisodeOfCare)
                  domMap.get(valueObject.getEpisodeOfCare());
        }
      } else {
        value1 =
            (ims.core.admin.domain.objects.EpisodeOfCare)
                domainFactory.getDomainObject(
                    ims.core.admin.domain.objects.EpisodeOfCare.class,
                    valueObject.getEpisodeOfCare().getBoId());
      }
    }
    domainObject.setEpisodeOfCare(value1);
    ims.framework.utils.DateTime dateTime2 = valueObject.getStartDateTime();
    java.util.Date value2 = null;
    if (dateTime2 != null) {
      value2 = dateTime2.getJavaDate();
    }
    domainObject.setStartDateTime(value2);
    ims.core.resource.people.domain.objects.Hcp value3 = null;
    if (null != valueObject.getResponsibleHCP()) {
      if (valueObject.getResponsibleHCP().getBoId() == null) {
        if (domMap.get(valueObject.getResponsibleHCP()) != null) {
          value3 =
              (ims.core.resource.people.domain.objects.Hcp)
                  domMap.get(valueObject.getResponsibleHCP());
        }
      } else if (valueObject.getBoVersion()
          == -1) // RefVo was not modified since obtained from the Assembler, no need to update the
      // BO field
      {
        value3 = domainObject.getResponsibleHCP();
      } else {
        value3 =
            (ims.core.resource.people.domain.objects.Hcp)
                domainFactory.getDomainObject(
                    ims.core.resource.people.domain.objects.Hcp.class,
                    valueObject.getResponsibleHCP().getBoId());
      }
    }
    domainObject.setResponsibleHCP(value3);

    return domainObject;
  }
  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();
  }
 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()));
   }
 }
示例#26
0
 public static void fillFieldsfromXML(
     org.dom4j.Element el, ims.domain.DomainFactory factory, Summary 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("dischargeLetterStatus");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setDischargeLetterStatus(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("admissionDateTime");
   if (fldEl != null) {
     obj.setAdmissionDateTime(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("tTAStatus");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setTTAStatus(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("hasHadAnyProceduresPerformed");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setHasHadAnyProceduresPerformed(
         ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("additonalClinicalInfo");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setAdditonalClinicalInfo(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("dischargeSupplementaryLetterStatus");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setDischargeSupplementaryLetterStatus(
         ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("summaryDetails");
   if (fldEl != null) {
     fldEl = fldEl.element("list");
     obj.setSummaryDetails(
         ims.edischarge.domain.objects.SummaryDetail.fromListXMLString(
             fldEl, factory, obj.getSummaryDetails(), domMap));
   }
   fldEl = el.element("dischargeDocuments");
   if (fldEl != null) {
     fldEl = fldEl.element("set");
     obj.setDischargeDocuments(
         ims.core.documents.domain.objects.PatientDocument.fromSetXMLString(
             fldEl, factory, obj.getDischargeDocuments(), domMap));
   }
   fldEl = el.element("dischargeDetails");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setDischargeDetails(
         ims.edischarge.domain.objects.DischargeDetails.getDischargeDetailsfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("wasPatientDischargedThenUndone");
   if (fldEl != null) {
     obj.setWasPatientDischargedThenUndone(new Boolean(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*intraOperativeCareRecord* :");
    if (intraOperativeCareRecord != null) {
      auditStr.append(toShortClassName(intraOperativeCareRecord));

      auditStr.append(intraOperativeCareRecord.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*preOperativeDiagnosis* :");
    auditStr.append(preOperativeDiagnosis);
    auditStr.append("; ");
    auditStr.append("\r\n*antibiotics* :");
    auditStr.append(antibiotics);
    auditStr.append("; ");
    auditStr.append("\r\n*vTE* :");
    auditStr.append(vTE);
    auditStr.append("; ");
    auditStr.append("\r\n*incision* :");
    auditStr.append(incision);
    auditStr.append("; ");
    auditStr.append("\r\n*findings* :");
    auditStr.append(findings);
    auditStr.append("; ");
    auditStr.append("\r\n*procedure* :");
    auditStr.append(procedure);
    auditStr.append("; ");
    auditStr.append("\r\n*complications* :");
    auditStr.append(complications);
    auditStr.append("; ");
    auditStr.append("\r\n*closure* :");
    auditStr.append(closure);
    auditStr.append("; ");
    auditStr.append("\r\n*lAInfiltration* :");
    auditStr.append(lAInfiltration);
    auditStr.append("; ");
    auditStr.append("\r\n*postOpInstructions* :");
    auditStr.append(postOpInstructions);
    auditStr.append("; ");
    auditStr.append("\r\n*eBI* :");
    auditStr.append(eBI);
    auditStr.append("; ");
    auditStr.append("\r\n*followUpType* :");
    if (followUpType != null) auditStr.append(followUpType.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*followUpTypeIn* :");
    if (followUpTypeIn != null) auditStr.append(followUpTypeIn.getText());
    auditStr.append("; ");
    return auditStr.toString();
  }