protected void onBtnNewClick() throws PresentationLogicException { clearScreen(); form.recbrAddress().clear();//WDEV-14367 form.setMode(FormMode.EDIT); //WDEV-14367 //16179 form.ccAddress().setRequireAdress(true); form.getLocalContext().setpersonAddress(new PersonAddress()); form.getLocalContext().setaddressIndex(-1); form.btnNew().setEnabled(false); form.btnUpdate().setEnabled(false); form.recbrAddress().setEnabled(false); // form.cmbAddressType().setValue(AddressType.CORRESPONDENCE); form.cmbAddressType().setValue(null);//WDEV-14188 form.cmbAddressType().removeRow(AddressType.NOKHOME); form.cmbAddressType().removeRow(AddressType.HISTORICAL);//WDEV-13009 exclude Historical type form.cmbAddressType().setRequired(true); }
private PersonAddressCollection sortByDate(PersonAddressCollection voColl) { PersonAddressCollection voHistoricalColl = new PersonAddressCollection(); for (int i = 0 ; i < voColl.size() ; i++) { if(voColl.get(i).getAddressTypeIsNotNull() && voColl.get(i).getAddressType().equals(AddressType.HISTORICAL)) voHistoricalColl.add(voColl.get(i)); } PersonAddressCollection voSortedHistoricalColl = new PersonAddressCollection(); while(voHistoricalColl!= null && voHistoricalColl.size()>0) { for (int i = 0 ; i < voHistoricalColl.size() ; i++) if(isNext(voHistoricalColl.get(i), voHistoricalColl)){ voSortedHistoricalColl.add(voHistoricalColl.get(i)); voHistoricalColl.remove(voHistoricalColl.get(i)); } } return voSortedHistoricalColl; }
@Override protected void onBtnOkClick() throws ims.framework.exceptions.PresentationLogicException { if(form.getMode().equals(FormMode.EDIT)){ if(form.dteDate().getValue()==null){ engine.showMessage("Date is mandatory."); return; } else if(form.dteDate().getValue().isGreaterThan(new Date())){ engine.showMessage("Date cannot be in the future."); return; } PersonAddress voPersonAddress = (PersonAddress) form.getLocalContext().getPersonAddress().clone(); voPersonAddress.setNotificationDate(form.dteDate().getValue()); voPersonAddress.setAddressType(AddressType.HISTORICAL); form.getGlobalContext().Core.setPersonAddress(voPersonAddress); engine.close(DialogResult.OK); return; } engine.close(DialogResult.CANCEL); }
private PersonAddress populateAddressData(AddressType addrType) { PersonAddress voAddress = new PersonAddress(); if (form.ctnDetails().txtDetailsAddress1().getValue() != null) voAddress.setLine1(form.ctnDetails().txtDetailsAddress1().getValue()); if (form.ctnDetails().txtDetailsAddress2().getValue() != null) voAddress.setLine2(form.ctnDetails().txtDetailsAddress2().getValue()); if (form.ctnDetails().txtDetailsAddress3().getValue() != null) voAddress.setLine3(form.ctnDetails().txtDetailsAddress3().getValue()); if (form.ctnDetails().txtDetailsAddress4().getValue() != null) voAddress.setLine4(form.ctnDetails().txtDetailsAddress4().getValue()); if (form.ctnDetails().txtDetailsAddress5().getValue() != null) voAddress.setLine5(form.ctnDetails().txtDetailsAddress5().getValue()); voAddress.setPostCode(form.ctnDetails().txtDetailsPostCode().getValue()); voAddress.setCounty(form.ctnDetails().cmbCounty().getValue()); voAddress.setAddressType(addrType); // WDEV-15936 Address type should always be set return voAddress; }
private PersonAddressCollection getDTOHistoricAddresses(String hospnum, PersonAddressCollection addresses) { PersonAddressCollection collNonHistoricalAddresses = new PersonAddressCollection(); PersonAddressCollection collAddresses = new PersonAddressCollection(); try { collAddresses = domain.getDTOHistoricAddresses(hospnum); } catch (DomainInterfaceException e) { // TODO Auto-generated catch block e.printStackTrace(); } //Non Historical for (int i = 0 ; i < addresses.size() ; i++) { if(addresses.get(i).getAddressType()==null || !addresses.get(i).getAddressType().equals(AddressType.HISTORICAL)) collNonHistoricalAddresses.add(addresses.get(i)); } //add Non Historical for (int i = 0 ; i < collNonHistoricalAddresses.size() ; i++) collAddresses.add(collNonHistoricalAddresses.get(i)); form.getGlobalContext().Core.setOtherAddresses(collAddresses); return collAddresses; }
private void showHistoricAddressesButton(PersonAddressCollection addresses) { form.ccAddressSearch().setHistoricAddressBtnVisible(false); if(addresses!=null) for (int i = 0 ; i < addresses.size() ; i++) { if(addresses.get(i).getAddressTypeIsNotNull() && addresses.get(i).getAddressType().equals(AddressType.HISTORICAL)) { form.ccAddressSearch().setHistoricAddressBtnVisible(true); return; } } }
protected final void renderAddressVoToXAD(PersonAddress pa, XAD xad,ProviderSystemVo providerSystem) throws Exception { LOG.debug("VoMapper renderAddressVoToXAD: entry"); if (pa == null) return; xad.getStreetAddress().getStreetOrMailingAddress().setValue(pa.getLine1()); xad.getOtherDesignation().setValue(pa.getLine2()); xad.getCity().setValue(pa.getLine3()); xad.getStateOrProvince().setValue(pa.getLine4()); xad.getOtherGeographicDesignation().setValue(pa.getLine5()); xad.getZipOrPostalCode().setValue(pa.getPostCode()); if (pa.getCountyIsNotNull()) xad.getCountyParishCode().setValue(svc.getRemoteLookup(pa.getCounty().getID(), providerSystem.getCodeSystem().getText())); if(pa.getAddressTypeIsNotNull()) { xad.getAddressType().setValue(svc.getRemoteLookup(pa.getAddressType().getID(), providerSystem.getCodeSystem().getText())); } else { xad.getAddressType().setValue(svc.getRemoteLookup(AddressType.PERMANENT.getID(), providerSystem.getCodeSystem().getText())); } LOG.debug("VoMapper renderAddressVoToXAD: exit (" + xad.toString() + ")"); }
private OrganisationVo populatePracticeData(OrganisationVo value) { value.setAddress(populateAddressData(AddressType.PRACTICE)); // WDEV-15936 - specify address type value.setName(form.ctnDetails().txtDetailsName().getValue()); value.setIsActive(new Boolean(form.ctnDetails().chkDetailsActive().getValue())); value.setCodeMappings(getCodeMappings()); value.setComment(form.ctnDetails().txtDetailsComment().getValue()); value.setType(OrganisationType.GPP); value.setCommChannels(populateCommChannelsFromScreen()); value.setPctCode(form.ctnDetails().txtPCT().getValue()); value.setParent(null); return value; }
private LocSiteVo populateSurgeryData(LocSiteVo value) { value.setAddress(populateAddressData(AddressType.SURGERY)); // WDEV-15936 specify address type value.setName(form.ctnDetails().txtDetailsName().getValue()); value.setIsActive(new Boolean(form.ctnDetails().chkDetailsActive().getValue())); value.setCodeMappings(getCodeMappings()); value.setType(LocationType.SURGERY); value.setCommChannels(populateCommChannelsFromScreen()); return value; }
protected final void renderAddressVoToXAD(PersonAddress pa, XAD xad,ProviderSystemVo providerSystem) throws Exception { LOG.debug("VoMapper renderAddressVoToXAD: entry"); if (pa == null) return; xad.getStreetAddress().getStreetOrMailingAddress().setValue(pa.getLine1()); xad.getOtherDesignation().setValue(pa.getLine2()); xad.getCity().setValue(pa.getLine3()); xad.getStateOrProvince().setValue(pa.getLine4()); xad.getOtherGeographicDesignation().setValue(pa.getLine5()); xad.getZipOrPostalCode().setValue(pa.getPostCode()); if (pa.getCountyIsNotNull()) xad.getCountyParishCode().setValue(svc.getRemoteLookup(pa.getCounty().getID(), providerSystem.getCodeSystem().getText())); if(pa.getAddressTypeIsNotNull()) { xad.getAddressType().setValue(svc.getRemoteLookup(pa.getAddressType().getID(), providerSystem.getCodeSystem().getText())); } else { xad.getAddressType().setValue(svc.getRemoteLookup(AddressType.PERMANENT.getID(), providerSystem.getCodeSystem().getText())); } if(pa.getAreaOfResidenceIsNotNull()) //http://jira/browse/WDEV-19177 { xad.getCensusTract().setValue(svc.getRemoteLookup(pa.getAreaOfResidence().getID(), providerSystem.getCodeSystem().getText())); } LOG.debug("VoMapper renderAddressVoToXAD: exit (" + xad.toString() + ")"); }
private void initalize() { //update local context if (form.getGlobalContext().Core.getOtherAddressesIsNotNull()) { PersonAddressCollection coll = (ims.core.vo.PersonAddressCollection)form.getGlobalContext().Core.getOtherAddresses().clone(); PersonAddressCollection collNonHistorical = new PersonAddressCollection(); for(int i=0; i<coll.size(); i++) { if(coll.get(i).getAddressType()!=null && !coll.get(i).getAddressType().equals(AddressType.HISTORICAL)) collNonHistorical.add(coll.get(i)); } form.getLocalContext().setpersonAddressCol(collNonHistorical); } else form.getLocalContext().setpersonAddressCol(null); if (form.getLocalContext().getpersonAddressColIsNotNull() && form.getLocalContext().getpersonAddressCol().size() > 0) { for(PersonAddress pa:form.getLocalContext().getpersonAddressCol()) { if(pa.getAddressType()!=null && !pa.getAddressType().equals(AddressType.HISTORICAL))//WDEV-13009 exclude Historical addresses { form.recbrAddress().newRow(pa, pa.getLine1IsNotNull()?pa.getLine1():""); form.recbrAddress().setValue(pa); form.recbrAddress().setEnabled(true); } else if(pa.getAddressType()==null) { form.recbrAddress().newRow(pa, pa.getLine1IsNotNull()?pa.getLine1():""); form.recbrAddress().setValue(pa); form.recbrAddress().setEnabled(true); } } } form.cmbAddressType().removeRow(AddressType.NOKHOME); form.cmbAddressType().removeRow(AddressType.HISTORICAL);//WDEV-13009 exclude Historical type populateScreenFromData(form.recbrAddress().getValue()); form.btnClear().setVisible(true); form.btnNew().setVisible(true); form.btnUpdate().setVisible(true); form.btnOK().setVisible(true); form.setMode(FormMode.VIEW); }
private void displayOtherAdressesAndTooltip(PersonAddressCollection voCollAddresses) { // update GC form.getGlobalContext().Core.setOtherAddresses(voCollAddresses); PersonAddressCollection voTempColl = (PersonAddressCollection)voCollAddresses.clone(); //dont display Historic addresses in other address control for (int i = 0 ; i < voTempColl.size() ; i++) { if(voTempColl.get(i).getAddressTypeIsNotNull() && voTempColl.get(i).getAddressType().equals(AddressType.HISTORICAL)) voTempColl.remove(i); } if (voTempColl == null || voTempColl == null || voTempColl.size() == 0) { if (form.getMode().equals(FormMode.VIEW)) form.imbAddress().setVisible(false); else { form.imbAddress().setVisible(true); //WDEV-14367 form.txtOtherAddress().setValue(null); form.getGlobalContext().Core.setOtherAddresses(null); //form.getGlobalContext().Core.setOtherAddresses(new PersonAddressCollection()); } return; } voTempColl.sort(); String l_address = voTempColl.toDisplayString(); // display address form.txtOtherAddress().setValue(l_address); // set tooltip String l_addressHeader = Textile.setBold("OTHER ADDRESSES "); l_addressHeader += "\r\n"; l_addressHeader += l_address; l_addressHeader = new Textile().process(l_addressHeader); form.imbAddress().setTooltip(l_addressHeader); form.txtOtherAddress().setTooltip(l_addressHeader); }
protected IfLocParentVo populateLocation(Message msg,ProviderSystemVo providerSystem) throws HL7Exception { MFN_M05_MFELOCLCHLRLLDPLCHLCC mfn_m05 = (MFN_M05_MFELOCLCHLRLLDPLCHLCC) msg.get("MFN_M05_MFELOCLCHLRLLDPLCHLCC"); LOC loc = mfn_m05.getLOC(); String locCode= loc.getPrimaryKeyValueLOC().getComponent(0).toString(); String parentLocCode = loc.getPrimaryKeyValueLOC().getFacility().getNamespaceID().getValue(); if (locCode == null) throw new HL7Exception("PAS code for Location cannot be null. - LOC-1"); if (parentLocCode == null) throw new HL7Exception("Parent code for parent Location cannot be null."); if (locCode.equals(parentLocCode)) throw new HL7Exception("Location code and parent Location code cannot be the same."); // Get the parent location by pas code LocationLiteVo hospitalVo = orgLoc.getLocationLiteByTaxonomyType(parentLocCode, TaxonomyType.PAS); if (hospitalVo == null) throw new HL7Exception("Parent Location not found for Location:" + locCode + " using PAS Code:" + loc.getPrimaryKeyValueLOC().getFacility().getNamespaceID().getValue()); IfLocParentVo locVo = ocsIfInbound.getLocParentByTaxType(locCode, TaxonomyType.PAS); if (locVo == null) { locVo = new IfLocParentVo(); locVo.setIsActive(Boolean.TRUE); locVo.setType(LocationType.WARD); // Add the Code Mappings TaxonomyMapCollection coll = new TaxonomyMapCollection(); TaxonomyMap map = new TaxonomyMap(); map.setTaxonomyCode(locCode); map.setTaxonomyName(TaxonomyType.PAS); coll.add(map); locVo.setCodeMappings(coll); locVo.setIsVirtual(Boolean.FALSE); } locVo.setAddress(populateAddressVoFromXAD(locVo.getAddress(), loc.getLocationAddress(0),providerSystem, AddressType.LOCATION)); locVo.setName(loc.getLocationDescription().getValue()); locVo.setUpperName(locVo.getName().toUpperCase()); locVo.setParentLocation(hospitalVo); LDP ldp = mfn_m05.getMFN_M05_LDPLCHLCC().getLDP(); if (ldp != null && ldp.getActiveInactiveFlag()!=null && ldp.getActiveInactiveFlag().getValue() != null) { if (ldp.getActiveInactiveFlag().getValue().equals("A")) locVo.setIsActive(true); else locVo.setIsActive(false); } else { locVo.setIsActive(true); } return locVo; }
private void populateDataFromScreen(LocSiteVo value) { PersonAddress voAddress = new PersonAddress(); //wdev-16387 voAddress.setLine1(form.ctn1().lyr1().tabLocSite().txtLocSiteAdd1().getValue()); voAddress.setLine2(form.ctn1().lyr1().tabLocSite().txtLocSiteAdd2().getValue()); voAddress.setLine3(form.ctn1().lyr1().tabLocSite().txtLocSiteAdd3().getValue()); voAddress.setLine4(form.ctn1().lyr1().tabLocSite().txtLocSiteAdd4().getValue()); voAddress.setLine5(form.ctn1().lyr1().tabLocSite().txtLocSiteAdd5().getValue()); voAddress.setPhone(form.ctn1().lyr1().tabLocSite().txtLocSitePhone().getValue()); voAddress.setFax(form.ctn1().lyr1().tabLocSite().txtLocSiteFaxNo().getValue()); voAddress.setPostCode(form.ctn1().lyr1().tabLocSite().txtLocSitePostCode().getValue()); voAddress.setCounty(form.ctn1().lyr1().tabLocSite().cmbLocSiteCounty().getValue()); voAddress.setAddressType(AddressType.LOC_SITE); value.setAddress(voAddress.countFieldsWithValue() > 0 ? voAddress : null); value.setIsVirtual(new Boolean(form.ctn1().lyr1().tabLocSite().chkVirtualLocationSite().getValue()));//wdev-2730 if(value.getID_Location() == null) value.setIsActive(Boolean.TRUE); value.setCodeMappings(getCodeMappings(form.ctn1().lyr1().tabLocSite().grdSiteMappings())); value.setName(form.ctn1().lyr1().tabLocSite().txtLocSiteName().getValue()); value.setType(form.ctn1().lyr1().tabLocSite().cmbLocSiteType().getValue()); value.setSecureAccommodation(new Boolean(form.ctn1().lyr1().tabLocSite().chkLocSiteSecure().getValue())); value.setAllSecureAccommodation(new Boolean(form.ctn1().lyr1().tabLocSite().chkLocSiteAllSecure().getValue())); value.setReferringHospital(new Boolean(form.ctn1().lyr1().tabLocSite().chkLocSiteReferringHos().getValue())); value.setTreatingHosp(new Boolean(form.ctn1().lyr1().tabLocSite().chkLocSiteTreatingHos().getValue())); //wdev-17000 if( LocationType.WARD.equals(form.ctn1().lyr1().tabLocSite().cmbLocSiteType().getValue()) ) { value.setDisplayInEDTracking(form.ctn1().lyr1().tabLocSite().chkDisplayInEDTrackingLocSite().getValue()); } else { value.setDisplayInEDTracking(null); } /*WDEV-11885 PrinterVoCollection printers = value.getPrinters(); if(printers == null) { printers = new PrinterVoCollection(); } */ //If Printers were deleted clear printers collection and delete default, newResult and OCS defaults printers if (form.getGlobalContext().getPrintersSelected() == null || (form.getGlobalContext().getPrintersSelectedIsNotNull() && form.getGlobalContext().getPrintersSelected().size() == 0)) { value.setPrinters(null); //WDEV-11885 value.setDefaultPrinter(null); value.setDesignatedPrinterForNewResults(null); value.setDesignatedPrinterForOCSOrder(null); return; } /*WDEV-11885 for (int i = 0; i < form.getGlobalContext().getPrintersSelected().size(); i++) { printers.add(form.getGlobalContext().getPrintersSelected().get(i)); } */ value.setPrinters(form.getGlobalContext().getPrintersSelected()); //WDEV-11885 value.setDefaultPrinter(form.getGlobalContext().getDefaultPrinterIsNotNull() ? domain.getPrinter(form.getGlobalContext().getDefaultPrinter()) : null); value.setDesignatedPrinterForNewResults(form.getGlobalContext().getDesignatedPrinterForNewResultsIsNotNull() ? domain.getPrinter(form.getGlobalContext().getDesignatedPrinterForNewResults()) : null); value.setDesignatedPrinterForOCSOrder(form.getGlobalContext().getDesignatedPrinterForOCSOrderIsNotNull() ? domain.getPrinter(form.getGlobalContext().getDesignatedPrinterForOCSOrder()) : null); }