private void loadClinicalContactPatientMotorChartRecords(PatientMotorChartShortVoCollection voPatientMotorChartColl) { boolean clinConctactRecordExists = isRecordForCurrentClincontactSaved(voPatientMotorChartColl); if(!clinConctactRecordExists) loadCurrentClinicalContact(); for (int i = 0; voPatientMotorChartColl != null && i < voPatientMotorChartColl.size(); i++) { PatientMotorChartShortVo patientMotorChartShortVo = voPatientMotorChartColl.get(i); loadClinicalContactDetails(patientMotorChartShortVo); } }
private boolean isRecordForCurrentClincontactSaved(PatientMotorChartShortVoCollection collCharts) { ClinicalContactShortVo voClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact(); if(voClinicalContact != null && collCharts != null) { for (int i = 0; i < collCharts.size(); i++) { PatientMotorChartShortVo voMotorChart = collCharts.get(i); if (voMotorChart.getClinicalContact().equals(form.getGlobalContext().Core.getCurrentClinicalContact())) return true; } } return false; }
public PatientMotorChartShortVoCollection listPatientMotorChartShort(CareContextRefVo careContextRefVo) { if(careContextRefVo == null ) throw new RuntimeException("Cannot get PatientMotorChartShortVoCollection for null CareContextRefVo"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientMotorChart mc where mc.clinicalContact.careContext.id = :id_CareContext"); java.util.List list = factory.find(hql.toString(), "id_CareContext", careContextRefVo.getID_CareContext()); return PatientMotorChartShortVoAssembler.createPatientMotorChartShortVoCollectionFromPatientMotorChart(list).sort(SortOrder.DESCENDING); }
private void fillRecordBrowser() { form.recbrPreviousMotorCharts().clear(); PatientMotorChartShortVoCollection collCharts = domain.listPatientMotorChartShort(form.getGlobalContext().Core.getCurrentCareContext()); loadCareContext(); loadClinicalContactPatientMotorChartRecords(collCharts); updateBrowseInformation(); browserRecord(); }