protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { form.grdEpisodeOfCareHistory().getRows().clear(); EpisodeOfCareSmallVo tempVo = form.getGlobalContext().Clinical.getEpisodeOfCareWithHistory(); if(tempVo != null && tempVo.getEpisodeOfCareHistoryIsNotNull() && tempVo.getEpisodeOfCareHistory().size() > 0) { EpisodeOfCareHistVoCollection tempColl = tempVo.getEpisodeOfCareHistory(); tempColl.sort(new CreationDateComparator(SortOrder.ASCENDING)); for(int i = 0;i < tempColl.size();i++) { EpisodeOfCareHistVo voHist = tempColl.get(i); if(voHist != null) populateChildGrid(voHist); } } }
protected void populateChildGrid(EpisodeOfCareHistVo voHist) { if(voHist == null) return; grdEpisodeOfCareHistoryRow careContextRow = form.grdEpisodeOfCareHistory().getRows().newRow(); careContextRow.setColumnSpecialty(voHist.getSpecialtyIsNotNull() ? voHist.getSpecialty().getIItemText():""); careContextRow.setTooltipForColumnSpecialty(voHist.getSpecialtyIsNotNull() ? voHist.getSpecialty().getIItemText():""); careContextRow.setColumnResponsibleHCP(voHist.getResponsibleHCPIsNotNull() ? voHist.getResponsibleHCP().getMos().toString():""); careContextRow.setTooltipForColumnResponsibleHCP(voHist.getResponsibleHCPIsNotNull() ? voHist.getResponsibleHCP().getMos().toString():""); careContextRow.setColumnStartDate(voHist.getStartDateIsNotNull() ? voHist.getStartDate().toString():""); careContextRow.setTooltipForColumnStartDate(voHist.getStartDateIsNotNull() ? voHist.getStartDate().toString():""); careContextRow.setColumnEndDate(voHist.getEndDateIsNotNull() ? voHist.getEndDate().toString():""); careContextRow.setTooltipForColumnEndDate(voHist.getEndDateIsNotNull() ? voHist.getEndDate().toString():""); careContextRow.setColumnChangedDateTime(voHist.getSysInformationIsNotNull() && voHist.getSysInformation().getCreationDateTime() != null ? voHist.getSysInformation().getCreationDateTime().toString():""); careContextRow.setTooltipForColumnChangedDateTime(voHist.getSysInformationIsNotNull() && voHist.getSysInformation().getCreationDateTime() != null ? voHist.getSysInformation().getCreationDateTime().toString():""); }
public int compare(Object ob1, Object ob2) { DateTime pdate1 = null; DateTime pdate2 = null; if(ob1 instanceof EpisodeOfCareHistVo ) { EpisodeOfCareHistVo ps1 = (EpisodeOfCareHistVo)ob1; pdate1 = ps1 != null && ps1.getSysInformationIsNotNull() ? ps1.getSysInformation().getCreationDateTime():null; } if(ob2 instanceof EpisodeOfCareHistVo) { EpisodeOfCareHistVo ps2 = (EpisodeOfCareHistVo)ob2; pdate2 = ps2 != null && ps2.getSysInformationIsNotNull() ? ps2.getSysInformation().getCreationDateTime():null; } if(pdate1 != null ) return pdate1.compareTo(pdate2)*direction; if(pdate2 != null) return (-1)*direction; return 0; }