private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission) { if( adtDiscEp != null ) { form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime()); form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null); form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():""); } if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0) { for( int i = 0; i < admission.getTransferHistory().size(); i++ ) { TransferHistoryVo tempVo = admission.getTransferHistory().get(i); grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow(); rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():""); rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():""); rowW.setValue(tempVo); } } }
public int compare(Object ob1, Object ob2) { DateTime pdate1 = null; DateTime pdate2 = null; if(ob1 instanceof TransferHistoryVo ) { TransferHistoryVo ps1 = (TransferHistoryVo)ob1; pdate1 = ps1.getAcceptTransferDateTime(); } if(ob2 instanceof TransferHistoryVo) { TransferHistoryVo ps2 = (TransferHistoryVo)ob2; pdate2 = ps2.getAcceptTransferDateTime(); } if(pdate1 != null ) return pdate1.compareTo(pdate2)*direction; if(pdate2 != null) return (-1)*direction; return 0; }