private PasContactVoCollection populatePasContactFromInPatEpisode(InpatientEpisodeVoCollection voColl) { PasContactVoCollection voCollPasContact = new PasContactVoCollection(); for (int i = 0; i < voColl.size(); i++) { InpatientEpisodeVo vo = voColl.get(i); PasContactVo voPasContact = new PasContactVo(); if (vo.getPasEventIsNotNull()) { voPasContact.setAppointmentDateTime(vo.getPasEvent().getEventDateTime()); voPasContact.setConsultant(vo.getPasEvent().getConsultant()); voPasContact.setContactNumber(vo.getPasEvent().getID_PASEvent().toString()); voPasContact.setContactType("Inpatient"); voPasContact.setDischargeDateTime(vo.getPasEvent().getEventDateTime()); voPasContact.setDocumentStatus(vo.getPasEvent().getCspDocumentStatus()); voPasContact.setGPCode(vo.getPasEvent().getReferringGPIsNotNull()?vo.getPasEvent().getReferringGP().getNationalCode():null); voPasContact.setLocation(vo.getPasEvent().getLocation()); voPasContact.setPatient(vo.getPasEvent().getPatient()); voPasContact.setSpecialty(vo.getPasEvent().getSpecialty()); voCollPasContact.add(voPasContact); } } return voCollPasContact; }
/** * WDEV-13136 * Function used to sort records (InpatientEpisode) after values on column which header was clicked */ private void sortInpatientEpisodeRecords(Object columnIdentifier) { // Get records from grid InpatientEpisodeVoCollection records = populateInpatientRecordsFromGrid(); // Toggle sort order for column sortOrderToggle(columnIdentifier); // Sort records by column if (COLDATETIME.equals(columnIdentifier)) { records.sort(new InpatientEpisodeRequestDateTimeCompartor(form.getLocalContext().getSortOrderRequestDate())); } // Get current selection Object selectedRecord = form.dyngrdPatients().getValue(); // Populate records to grid populateInpatientEpisodesToGrid(records); // Reselect record form.dyngrdPatients().setValue(selectedRecord); // Call code for new selection updateGlobalContextPatientSelection(form.dyngrdPatients().getValue()); }
/** * WDEV-13136 * Function used to populate inpatient episodes to grid */ private void populateInpatientEpisodesToGrid(InpatientEpisodeVoCollection records) { // Clear grid records form.dyngrdPatients().getRows().clear(); // Test collection if (records == null) return; // Populate records to grid for (int i = 0; i < records.size(); i++) { addNewInpatientEpisodeDynamicGridRow(records.get(i)); } }
/** * WDEV-13136 * Function used to retrieve records (InpatientEpisodes) from grid */ private InpatientEpisodeVoCollection populateInpatientRecordsFromGrid() { // Create collection to return InpatientEpisodeVoCollection records = new InpatientEpisodeVoCollection(); // Add each record from grid to collection for (int i = 0; i < form.dyngrdPatients().getRows().size(); i++) { DynamicGridRow row = form.dyngrdPatients().getRows().get(i); if (row.getValue() instanceof InpatientEpisodeVo) records.add((InpatientEpisodeVo) row.getValue()); } // Return populated records return records; }
private void populatePasEventGridFromData(InpatientEpisodeVoCollection voCollInpatEpis) { if(voCollInpatEpis == null) return; for(int i=0;i<voCollInpatEpis.size();i++) { GenForm.grdCtxPasEpisodesRow row = form.grdCtxPasEpisodes().getRows().newRow(); if(voCollInpatEpis.get(i).getPasEventIsNotNull()) { if (voCollInpatEpis.get(i).getPasEvent().getConsultantIsNotNull()) row.setColConsultant(voCollInpatEpis.get(i).getPasEvent().getConsultant().toString()); if (voCollInpatEpis.get(i).getPasEvent().getEventDateTimeIsNotNull()) row.setColEventDT(voCollInpatEpis.get(i).getPasEvent().getEventDateTime().toString()); } row.setValue(voCollInpatEpis.get(i).getPasEvent()); } }
public InpatientEpisodeVoCollection listInpatientsBySearchCriteria(PatIdType idType, String idValue, String surname, String forename, LocationLiteVo hospital, LocationLiteVo ward, HcpLiteVo hcp, Specialty specialty) { if(ConfigFlag.DOM.INPATIENT_SEARCH_TYPE.getValue().equals("LOCAL")) return listInpatientsHibernateBySearchCriteria(idType,idValue,surname,forename,hospital,ward,hcp,specialty,null); else if(ConfigFlag.DOM.INPATIENT_SEARCH_TYPE.getValue().equals("DTO")) return listInpatientsDTOBySearchCriteria(idType,idValue,surname,forename,hospital,ward,hcp,specialty,null); return null; }
public InpatientEpisodeVoCollection listInPatients(LocationRefVo refVoWard, MedicRefVo refVoMedic) { DomainFactory factory = getDomainFactory(); String hql; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); hql = " from InpatientEpisode ip "; StringBuffer condStr = new StringBuffer(); String andStr = " "; if (refVoWard != null) { condStr.append(andStr + " ip.pasEvent.location.id = :ward"); markers.add("ward"); values.add(refVoWard.getID_Location()); andStr = " and "; } if (refVoMedic != null) { condStr.append(andStr + " ip.pasEvent.consultant.id = :cons"); markers.add("cons"); values.add(refVoMedic.getID_Hcp()); andStr = " and "; } if (andStr.equals(" and ")) { hql += " where "; } hql += condStr.toString(); List ips = factory.find(hql, markers, values); return InpatientEpisodeVoAssembler.createInpatientEpisodeVoCollectionFromInpatientEpisode(ips); }
public void saveInpatientEpisodes(InpatientEpisodeVoCollection collInpatientEpisodeVo, MemberOfStaffShortVo mos) throws DomainInterfaceException, StaleObjectException { for(int i=0; i<collInpatientEpisodeVo.size(); i++){ if (!collInpatientEpisodeVo.get(i).isValidated()) { throw new DomainRuntimeException("Episode VO has not been validated!"); } DomainFactory factory = getDomainFactory(); InpatientEpisode ipDo = InpatientEpisodeVoAssembler.extractInpatientEpisode(factory, collInpatientEpisodeVo.get(i)); factory.save(ipDo); saveDocumentStatus(collInpatientEpisodeVo.get(i).getPasEvent().getCspDocumentStatus(), collInpatientEpisodeVo.get(i).getPasEvent(), mos); } }
private void listPasEvents() { form.grdCtxPasEpisodes().getRows().clear(); ContextType type = form.cmbCtxContextType().getValue(); if(type == null) return; Boolean isCurrent = null; if(type.equals(ContextType.INPATIENT)) isCurrent = new Boolean(form.GroupInpatientStatus().getValue().equals(GenForm.GroupInpatientStatusEnumeration.rdoCurrent)); PasEventVoCollection voCollPasEvents = null; InpatientEpisodeVoCollection voCollInpatEpis = null; if (ConfigFlag.UI.RETRIEVE_PAS_EPISODES_VIA_DTO.getValue() == false) { voCollPasEvents = domain.listPasEventsByTypeAndPatient(type, form.getGlobalContext().Core.getPatientShort(), isCurrent); populatePasEventGridFromData(voCollPasEvents); } else { voCollInpatEpis = domain.listInpatientEpisodes(form.getGlobalContext().Core.getPatientShort()); populatePasEventGridFromData(voCollInpatEpis); } automaticallySelectPasEventLinkedToCareContext(); }
private InpatientEpisodeVoCollection listInpatients(PatientRefVo patient, LocationRefVo hospital, LocationRefVo ward, HcpRefVo consultant, MedicLiteVo voMedic,Specialty specialty)//m { if(ConfigFlag.DOM.INPATIENT_SEARCH_TYPE.getValue().equals("LOCAL")) return listInpatientsHibernate(patient, hospital, ward, consultant,specialty); else if(ConfigFlag.DOM.INPATIENT_SEARCH_TYPE.getValue().equals("DTO")) return listInpatientsDTO(patient, hospital, ward, consultant,specialty); return null; }
/** * WDEV-13136 * Function used to sort records (InpatientEpisode) after values on column which header was clicked */ private void sortInpatientEpisodeRecords(Object columnIdentifier) { // Get records from grid InpatientEpisodeVoCollection records = populateInpatientRecordsFromGrid(); if (records.size() < 2) return; // Toggle sort order for column sortOrderToggle(columnIdentifier); // Sort records by column if (COLDATETIME.equals(columnIdentifier)) { records.sort(new InpatientEpisodeRequestDateTimeCompartor(form.getLocalContext().getSortOrderRequestDate())); } //WDEV-20305 if (COLCOMMENTS.equals(columnIdentifier)) { records.sort(new CommentsComparator(form.getLocalContext().getSortOrderComments())); } // Get current selection Object selectedRecord = form.dyngrdPatients().getValue(); // Populate records to grid populateInpatientEpisodesToGrid(records); // Reselect record form.dyngrdPatients().setValue(selectedRecord); // Call code for new selection updateGlobalContextPatientSelection(form.dyngrdPatients().getValue()); }