public int compareTo(Object obj, boolean caseInsensitive) {
   if (obj == null) {
     return -1;
   }
   if (caseInsensitive) ; // this is to avoid eclipse warning only.
   if (!(OcsOrderShortVo.class.isAssignableFrom(obj.getClass()))) {
     throw new ClassCastException(
         "A OcsOrderShortVo object cannot be compared an Object of type "
             + obj.getClass().getName());
   }
   OcsOrderShortVo compareObj = (OcsOrderShortVo) obj;
   int retVal = 0;
   if (retVal == 0) {
     if (this.getSysInfo() == null && compareObj.getSysInfo() != null) return -1;
     if (this.getSysInfo() != null && compareObj.getSysInfo() == null) return 1;
     if (this.getSysInfo() != null && compareObj.getSysInfo() != null)
       retVal = this.getSysInfo().compareTo(compareObj.getSysInfo());
   }
   return retVal;
 }
  public Object clone() {
    if (this.isBusy) return this;
    this.isBusy = true;

    OcsOrderShortVo clone = new OcsOrderShortVo(this.id, this.version);

    clone.clinicalcontact = this.clinicalcontact;
    if (this.patient == null) clone.patient = null;
    else clone.patient = (ims.core.vo.PatientShort) this.patient.clone();
    if (this.orderedby == null) clone.orderedby = null;
    else clone.orderedby = (ims.core.vo.MemberOfStaffLiteVo) this.orderedby.clone();
    if (this.responsibleclinician == null) clone.responsibleclinician = null;
    else clone.responsibleclinician = (ims.core.vo.HcpLiteVo) this.responsibleclinician.clone();
    if (this.responsiblegp == null) clone.responsiblegp = null;
    else clone.responsiblegp = (ims.core.vo.GpLiteVo) this.responsiblegp.clone();
    if (this.patientlocation == null) clone.patientlocation = null;
    else clone.patientlocation = (ims.core.vo.LocationLiteVo) this.patientlocation.clone();
    if (this.patientclinic == null) clone.patientclinic = null;
    else clone.patientclinic = (ims.core.vo.ClinicLiteVo) this.patientclinic.clone();
    clone.additclinnotes = this.additclinnotes;
    if (this.sysinfo == null) clone.sysinfo = null;
    else clone.sysinfo = (ims.vo.SystemInformation) this.sysinfo.clone();
    if (this.carecontext == null) clone.carecontext = null;
    else clone.carecontext = (ims.core.vo.CareContextPasVo) this.carecontext.clone();
    clone.orderinghospital = this.orderinghospital;
    if (this.outpatientdept == null) clone.outpatientdept = null;
    else clone.outpatientdept = (ims.core.vo.LocationLiteVo) this.outpatientdept.clone();
    if (this.authorisationorderstatus == null) clone.authorisationorderstatus = null;
    else
      clone.authorisationorderstatus =
          (ims.ocrr.vo.lookups.AuthorisationOrderStatus) this.authorisationorderstatus.clone();
    clone.isValidated = this.isValidated;

    this.isBusy = false;
    return clone;
  }