public MDTPatientCustomListVo saveCustomList(CustomListVo customListVo, MDTPatientCustomListVo patientCustomListVo) throws StaleObjectException { if (!patientCustomListVo.isValidated()) { throw new DomainRuntimeException("CustomList has not been validated"); } DomainFactory factory = getDomainFactory(); CustomList doCustomList = CustomListVoAssembler.extractCustomList(factory, customListVo); factory.save(doCustomList); MDTPatientCustomList doPatientCustomList = MDTPatientCustomListVoAssembler.extractMDTPatientCustomList(factory, patientCustomListVo); doPatientCustomList.setCustomListType(doCustomList); factory.save(doPatientCustomList); return MDTPatientCustomListVoAssembler.create(doPatientCustomList); }
private void populatePatientsGrid(MDTPatientCustomListVo voPatientCustomList) { if(voPatientCustomList!=null && voPatientCustomList.getPatientsIsNotNull()){ PatientShortCollection collPatientShort = voPatientCustomList.getPatients(); form.grdPatients().getRows().clear(); for(int i=0;i<collPatientShort.size();i++) { PatientShort voPatient = collPatientShort.get(i); listCareSpells(voPatient); } } }
private void populateDetailsScreen() { CustomListVo voCustomList = form.getLocalContext().getSelectedCustomList(); if(voCustomList==null) return; form.lyrCustomListSearch().tabCustomListDetails().cmbListTypeDetails().setValue(voCustomList.getListType()); form.lyrCustomListSearch().tabCustomListDetails().txtListNameDetails().setValue(voCustomList.getListName()); form.lyrCustomListSearch().tabCustomListDetails().cmbSpecialtyDetails().setValue(voCustomList.getSpecialty()); form.lyrCustomListSearch().tabCustomListDetails().dteDateDetails().setValue(voCustomList.getDate()); form.lyrCustomListSearch().tabCustomListDetails().customControlMosDetails().setValue(voCustomList.getListOwner()); form.lyrCustomListSearch().tabCustomListDetails().chkActiveOnlydetails().setValue(voCustomList.getIsActive()); MDTPatientCustomListVo voPatientCustomList = form.getLocalContext().getPatientCustomListVo(); if(voPatientCustomList!=null && voPatientCustomList.getPatientsIsNotNull()){ PatientShortCollection collPatientShort = voPatientCustomList.getPatients().sort(SortOrder.ASCENDING); form.lyrCustomListSearch().tabCustomListDetails().grdCustomList().getRows().clear(); if(collPatientShort!=null) for (int i = 0; i < collPatientShort.size(); i++) { grdCustomListRow row = form.lyrCustomListSearch().tabCustomListDetails().grdCustomList().getRows().newRow(); PatientShort patientShort = collPatientShort.get(i); if(patientShort.getName().getForenameIsNotNull()) row.setColForename(patientShort.getName().getForename()); row.setColSurname(patientShort.getName().getSurname()); if(patientShort.getDobIsNotNull()) row.setColDOB(patientShort.getDob().toString(DateFormat.STANDARD)); if (patientShort.getDisplayId() != null) row.setColHospNum(patientShort.getDisplayId().getValue()); row.setValue(patientShort); } } }
public MDTPatientCustomListVo getCustomList(CustomListRefVo reVoCustomList) { if(reVoCustomList == null) throw new CodingRuntimeException("null type passed to listCustomListTypes() !"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from MDTPatientCustomList as pcl "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (reVoCustomList.getID_CustomListIsNotNull()) { hql.append(andStr + " pcl.customListType.id = :CustomListTypeId"); markers.add("CustomListTypeId"); values.add(reVoCustomList.getID_CustomList()); andStr = " and "; } if (andStr.equals(" and ")) query += " where "; query += hql.toString(); List list = factory.find(query, markers, values); if(list.size() == 0) return null; MDTPatientCustomListVoCollection coll = MDTPatientCustomListVoAssembler.createMDTPatientCustomListVoCollectionFromMDTPatientCustomList(list); return coll.get(0); }
public MDTPatientCustomListVo getCustomList(CustomListRefVo reVoCustomList) { CustomListMaintenance customListMaintenanceImpl = (CustomListMaintenance)getDomainImpl(CustomListMaintenanceImpl.class); return customListMaintenanceImpl.getCustomList(reVoCustomList); }