private ValueObject getSelectedValue() { if (form.grdGps().getValue() != null) return (GpLiteVo) form.grdGps().getSelectedRow().getValue(); if (form.dynGrdGps().getValue() != null && form.dynGrdGps().isVisible()) { if (form.dynGrdGps().getValue() instanceof GpLiteVo) return (GpLiteVo) form.dynGrdGps().getValue(); if (form.dynGrdGps().getValue() instanceof GpLiteToPracticeLiteVo) return (GpLiteToPracticeLiteVo) form.dynGrdGps().getValue(); if (form.dynGrdGps().getValue() instanceof LocSiteShortVo) return ((LocSiteShortVo) form.dynGrdGps().getValue()); } return null; }
private void populateGpRow(GpLiteVo voLiteVo, GenForm.grdGpsRow row) { if(voLiteVo == null) return; row.setGpName(voLiteVo.getNameIsNotNull()?voLiteVo.getName().toString():""); String strDisplay = ""; if(voLiteVo instanceof GPLiteWithPracticesVo) { GPLiteWithPracticesVo voGpWithPractice = (GPLiteWithPracticesVo)voLiteVo; if(voGpWithPractice.getPracticesIsNotNull() && voGpWithPractice.getPractices().size() > 0) { int count = 0; for(GpLiteToPracticeLiteVo voGpToPractice : voGpWithPractice.getPractices()) { if(voGpToPractice.getPracticeIsNotNull()) { count++; strDisplay += voGpToPractice.getPractice().getName(); strDisplay += count < (voGpWithPractice.getPractices().size()) ? "," : ""; } } } } row.setColPractice(strDisplay); row.setTooltipForColPractice(strDisplay); row.setNatCode(voLiteVo.getNationalCode()); row.setValue(voLiteVo); }
protected void onDynGrdGpsRowSelectionChanged(DynamicGridRow row) throws PresentationLogicException { enableContextMenu(); if (row.getValue() instanceof GpLiteVo) setSelectedRecordType(GPSelectedRecordType.GP); else if (row.getValue() instanceof GpLiteToPracticeLiteVo) setSelectedRecordType(GPSelectedRecordType.PRACTICE); else if (row.getValue() instanceof LocShortVo) setSelectedRecordType(GPSelectedRecordType.SURGERY); else setSelectedRecordType(GPSelectedRecordType.NONE); setActionAndFireEvent(GPAction.SELECT); }
private GPLiteWithPracticesVoCollection filterGpsForGMCNumberAndPasCode(GPLiteWithPracticesVoCollection gpColl) { if (gpColl == null || gpColl.size() == 0) return null; String gMCCode = null; GPLiteWithPracticesVoCollection filteredGps = new GPLiteWithPracticesVoCollection(); for (int i=0;i<gpColl.size();i++) { GPLiteWithPracticesVo voGpWithPractice = gpColl.get(i); if (voGpWithPractice != null) { if(voGpWithPractice.getCodeMappingsIsNotNull()) { gMCCode = voGpWithPractice.getCodeMappings().getMappingValue(TaxonomyType.NAT_GP_CODE); } GpLiteToPracticeLiteVoCollection voPractices = voGpWithPractice.getPractices(); for (int j=0;j<voPractices.size();j++) { GpLiteToPracticeLiteVo practiceWithSurg = voPractices.get(j); if (practiceWithSurg != null && practiceWithSurg.getPracticeIsNotNull() && practiceWithSurg.getPractice().getSurgeries() != null && practiceWithSurg.getPractice().getSurgeries().size() > 0) { LocSiteShortVoCollection heartsSurgeries = getHeartsSurgery(practiceWithSurg.getPractice().getSurgeries(), gMCCode); if (heartsSurgeries != null && heartsSurgeries.size() > 0) filteredGps.add(voGpWithPractice); } } } } return filteredGps; }
public GpLiteToPracticeLiteVo synchronizeGPPracticeDetails(String strGPCode) throws StaleObjectException, UniqueKeyViolationException { Gp_practice gpPracticeRecord = (Gp_practice) getDTOInstance(Gp_practice.class); gpPracticeRecord.Filter.Gp_code = strGPCode; GP voGP = null; Result gpPracticeGetResult = gpPracticeRecord.get(); if (gpPracticeGetResult != null) return null; Gp_practiceRecord gp_practice_record = gpPracticeRecord.DataCollection.get(0); OrganisationVo voSavedPractice = null; if (gpPracticeGetResult == null && gp_practice_record != null) { // Extract the organisation which is in effect the practice and the location site // which is in effect the surgery and synchronise them withthe current date. // If the Practice is in csp, get it and populate from dto, otherwise just populate from dto. try { voSavedPractice = saveOrganisation(populatePracticeFromDTORecord(gp_practice_record)); } catch (UniqueKeyViolationException e) { // DARA TODO Comm Channels } voGP = saveGP(populateGpFromDTORecord(gp_practice_record, voSavedPractice)); GpLiteToPracticeLiteVo voGpLiteToPracticeLite = new GpLiteToPracticeLiteVo(); // Just need a get here to see if you already have a gppracticeslite record. GpPracticeLiteVo voGpPracticeLite = new GpPracticeLiteVo(); voGpPracticeLite.setAddress(voSavedPractice.getAddress()); voGpPracticeLite.setID_Organisation(voSavedPractice.getID_Organisation()); voGpPracticeLite.setIsActive(voSavedPractice.getIsActive()); voGpPracticeLite.setName(voSavedPractice.getName()); voGpPracticeLite.setType(OrganisationType.GPP); LocSiteShortVo voLocSiteShort = getLocSiteShortByTaxonomyType(gp_practice_record.Gp_practice_id, TaxonomyType.PAS); LocSiteShortVoCollection voCollLocations = new LocSiteShortVoCollection(); voCollLocations.add(voLocSiteShort); voGpPracticeLite.setSurgeries(voCollLocations); voGpLiteToPracticeLite.setGp(voGP == null ? null : voGP); voGpLiteToPracticeLite.setPractice(voGpPracticeLite); return voGpLiteToPracticeLite; } return null; }
/** * Populates as many of the PasEvent fields as it can from the PasContact * CareContext,IsVip,ReferringGP,SourceOfReferral are left as null * EventDateTime depends on whether we are listing inpatients or outpatients and * is populated external to this method. */ public PasEventVo createPasEvent(DateTime eventDateTime, PatientRefVo voRefPatient, PasContactVo voPasContact) throws StaleObjectException, UniqueKeyViolationException { PasEventVo voPasEvent = new PasEventVo(); voPasEvent.setEventDateTime(eventDateTime); if (voPasContact.getConsultant() != null) { MedicWithMappingsLiteVo medLite = new MedicWithMappingsLiteVo(voPasContact.getConsultant().getID_Hcp(), voPasContact.getConsultant().getVersion_Hcp()); medLite.setMos(voPasContact.getConsultant().getMos()); voPasEvent.setConsultant(medLite); } voPasEvent.setLocation(voPasContact.getLocation()); voPasEvent.setSpecialty(voPasContact.getSpecialty()); voPasEvent.setPasEventId(voPasContact.getContactNumber()); // voPasEvent.setPatient(voPasContact.getPatient()); GpLiteToPracticeLiteVo voGpLiteToPracList = synchronizeGPPracticeDetails(voPasContact.getGPCode()); if (voGpLiteToPracList != null) { voPasEvent.setReferringGP(voGpLiteToPracList.getGp()); if (voGpLiteToPracList.getPracticeIsNotNull() && voGpLiteToPracList.getPractice().getSurgeriesIsNotNull() && voGpLiteToPracList.getPractice().getSurgeries().size() > 0) voPasEvent.setReferringGpSurgery(voGpLiteToPracList.getPractice().getSurgeries().get(0)); } if (voPasContact.getAppointmentDateTimeIsNotNull()) voPasEvent.setEventType(PasEventType.OUTPATIENT); else if (voPasContact.getDischargeDateTimeIsNotNull()) voPasEvent.setEventType(PasEventType.INPATIENT); DomainFactory factory = getDomainFactory(); PASEvent domPasEvent = PasEventVoAssembler.extractPASEvent(factory, voPasEvent); ims.core.patient.domain.objects.Patient domPatient = (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, voRefPatient.getID_Patient().intValue()); domPasEvent.setPatient(domPatient); try { factory.save(domPasEvent); } catch (UnqViolationUncheckedException e) { throw new UniqueKeyViolationException(e.getMessage()); } return PasEventVoAssembler.create(domPasEvent); }
public GpLiteToPracticeLiteVo synchronizeGPPracticeDetails(String strGPCode) throws StaleObjectException, UniqueKeyViolationException { Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class); return impl.synchronizeGPPracticeDetails(strGPCode); }
public GpLiteToPracticeLiteVo synchronizeGPPracticeDetails(String strGPCode) throws StaleObjectException, UniqueKeyViolationException { return null; }
public GpLiteToPracticeLiteVo synchronizeGPPracticeDetails(String strGPCode) throws StaleObjectException, UniqueKeyViolationException { if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue())) return null; Gp_practice gpPracticeRecord = (Gp_practice) getDTOInstance(Gp_practice.class); gpPracticeRecord.Filter.Gp_code = strGPCode; GP voGP = null; Result gpPracticeGetResult = gpPracticeRecord.get(); if (gpPracticeGetResult != null) return null; Gp_practiceRecord gp_practice_record = gpPracticeRecord.DataCollection.get(0); OrganisationVo voSavedPractice = null; if (gpPracticeGetResult == null && gp_practice_record != null) { // Extract the organisation which is in effect the practice and the location site // which is in effect the surgery and synchronise them withthe current date. // If the Practice is in csp, get it and populate from dto, otherwise just populate from dto. try { voSavedPractice = saveOrganisation(populatePracticeFromDTORecord(gp_practice_record)); } catch (UniqueKeyViolationException e) { // DARA TODO Comm Channels } voGP = saveGP(populateGpFromDTORecord(gp_practice_record, voSavedPractice)); GpLiteToPracticeLiteVo voGpLiteToPracticeLite = new GpLiteToPracticeLiteVo(); // Just need a get here to see if you already have a gppracticeslite record. GpPracticeLiteVo voGpPracticeLite = new GpPracticeLiteVo(); voGpPracticeLite.setAddress(voSavedPractice.getAddress()); voGpPracticeLite.setID_Organisation(voSavedPractice.getID_Organisation()); voGpPracticeLite.setIsActive(voSavedPractice.getIsActive()); voGpPracticeLite.setName(voSavedPractice.getName()); voGpPracticeLite.setType(OrganisationType.GPP); LocSiteShortVo voLocSiteShort = getLocSiteShortByTaxonomyType(gp_practice_record.Gp_practice_id, TaxonomyType.PAS); LocSiteShortVoCollection voCollLocations = new LocSiteShortVoCollection(); voCollLocations.add(voLocSiteShort); voGpPracticeLite.setSurgeries(voCollLocations); voGpLiteToPracticeLite.setGp(voGP == null ? null : voGP); voGpLiteToPracticeLite.setPractice(voGpPracticeLite); return voGpLiteToPracticeLite; } return null; }
private GPLiteWithPracticesVoCollection getFilteredPracticesAndSurgeriesforAddress(GPSearchCriteriaVo filter,GPLiteWithPracticesVoCollection gpWithPractColl) //WDEV-18377 { for (int i=gpWithPractColl.size()-1; i>=0;i--) { if (gpWithPractColl.get(i) == null || gpWithPractColl.get(i).getPractices() == null) continue; if (!ConfigFlag.DOM.GP_USE_SURGERIES.getValue()) { filterPracticesForAddress(filter, gpWithPractColl.get(i)); } else { for (int x=gpWithPractColl.get(i).getPractices().size()-1; x>=0;x--) { if (gpWithPractColl.get(i).getPractices().get(x) ==null || gpWithPractColl.get(i).getPractices().get(x).getPractice() == null) continue; filterSurgeriesForAddress(filter,gpWithPractColl.get(i).getPractices().get(x).getPractice()); } Iterator<GpLiteToPracticeLiteVo> iteratorForPractices = gpWithPractColl.get(i).getPractices().iterator(); while (iteratorForPractices.hasNext()) { if (iteratorForPractices.next().getPractice().getSurgeries().size() == 0) { iteratorForPractices.remove(); } } } } Iterator<GPLiteWithPracticesVo> iteratorForGP = gpWithPractColl.iterator(); while (iteratorForGP.hasNext()) { if (iteratorForGP.next().getPractices().size() == 0) { iteratorForGP.remove(); } } return gpWithPractColl; }