Java Code Examples for ims.core.vo.PersonAddress

The following are top voted examples for showing how to use ims.core.vo.PersonAddress. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private String getRefferingGPAddress(PersonAddress voAddress)
{
	if (voAddress == null)
		return "";
	
	StringBuffer address = new StringBuffer();
	
	if (voAddress.getLine1IsNotNull()) 
		address.append(voAddress.getLine1().toString());
	if (voAddress.getLine2IsNotNull()) 
		address.append("\r\n" + voAddress.getLine2().toString());
	if (voAddress.getLine3IsNotNull()) 
		address.append("\r\n" + voAddress.getLine3().toString());
	if (voAddress.getLine4IsNotNull()) 
		address.append("\r\n" + voAddress.getLine4().toString());
	if (voAddress.getLine5IsNotNull()) 
		address.append("\r\n" + voAddress.getLine5().toString());
	
	return address.toString();
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void insertgrdGpAdressee(GpShortVo gpShortVo, LocSiteShortVo locSiteShortVo)
{
	if (gpShortVo == null || locSiteShortVo == null)
		return;
	RecipientVo gpRecipVo = new RecipientVo();

	GenForm.lyrCorrespondenceDetailLayer.tabRecipientsContainer.grdAdresseeRow row = form.lyrCorrespondenceDetail().tabRecipients().grdAdressee().getRows().newRow();
	GpShortVo voGP = (GpShortVo) gpShortVo;

	PersonAddress surgeryAddress = null;

	if (locSiteShortVo.getAddressIsNotNull())
	{
		surgeryAddress = locSiteShortVo.getAddress();
		row.setAddress(surgeryAddress.toDisplayString());
	}

	row.setGP(form.getImages().Admin.StaffBlue);
	gpRecipVo.setName(voGP.getName());
	gpRecipVo.setAddress(surgeryAddress);
	gpRecipVo.setRecipientType(RecipientType.EXTERNAL_GP);

	row.setValue(gpRecipVo);
	row.setAdressee(voGP.getName().toString());

}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateAdmittedFromDetails(ExternalResourceVo selectedExtResForAdmittedFrom)
{
	if (selectedExtResForAdmittedFrom == null)
		return;

	if (selectedExtResForAdmittedFrom.getExternalResourceTypeIsNotNull())
	{
		form.txtAdmittedFromName().setValue(selectedExtResForAdmittedFrom.getResourcename() != null ? selectedExtResForAdmittedFrom.getResourcename() : null);
		if (selectedExtResForAdmittedFrom.getResourceAddressIsNotNull())
		{
			PersonAddress resAddress = selectedExtResForAdmittedFrom.getResourceAddress();

			form.txtAdrAdmittedFromLine1().setValue(resAddress.getLine1());
			form.txtAdrAdmittedFromLine2().setValue(resAddress.getLine2());
			form.txtAdrAdmittedFromLine3().setValue(resAddress.getLine3());
			form.cmbAdmittedCounty().setValue(resAddress.getCounty() != null ? resAddress.getCounty() : null);

			form.txtTelephoneNr().setValue(resAddress.getPhone());
		}

	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateReferrerDetails(ExternalResourceVo selectedExtResForReferredFrom)
{
	if (selectedExtResForReferredFrom == null)
		return;

	if (selectedExtResForReferredFrom.getExternalResourceTypeIsNotNull())
	{
		form.txtReferrerNameOrganisation().setValue(selectedExtResForReferredFrom.getResourcename() != null ? selectedExtResForReferredFrom.getResourcename() : null);
		if (selectedExtResForReferredFrom.getResourceAddressIsNotNull())
		{
			PersonAddress resAddress = selectedExtResForReferredFrom.getResourceAddress();

			form.txtReferrerAdr1().setValue(resAddress.getLine1());
			form.txtReferrerAdr2().setValue(resAddress.getLine2());
			form.txtReferrerAdr3().setValue(resAddress.getLine3());
			form.cmbReferrerCounty().setValue(resAddress.getCounty() != null ? resAddress.getCounty() : null);

			form.txtReferrerContactNr().setValue(resAddress.getPhone());
		}

	}

}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
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);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
public void populateScreenFromData(PersonAddress pa)
{
	if (pa != null)
	{
		pa.setPhone(pa.getPhone());

		if (form.getGlobalContext().Core.getPatientShortIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null)
			pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue());
		
		form.ccAddress().setValue(pa);
		form.txtOtherPhone().setValue(pa.getOtherphone());
		form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null);
		form.getLocalContext().setpersonAddress(pa);
	}
	form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex());
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void doCopy()
{
	clearAddressControls();
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
		
		//start WDEV-14370
		if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
		{
			personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
		}
		//end
		
		form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432
		
		populateScreenFromData(personAddress);
		displayPhoneNumbers();
		
		form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	initialize();
			
	if (args != null && args.length > 0 && args[0] instanceof PersonAddressCollection)
	{
		PersonAddressCollection voColl = (PersonAddressCollection)args[0];
		populateRecordBrowser(voColl);
	}
	else if (args != null && args.length > 0 && args[0] instanceof PersonAddress){
		form.getLocalContext().setPersonAddress((PersonAddress) args[0]);
		form.ccAddress().setValue((PersonAddress) args[0]);
		form.setMode(FormMode.EDIT);
		form.btnOk().setText("Save");
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@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);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PersonAddress getlines(PersonAddress addressResult)
{
	if (addressResult == null)
		return null;
	
	addressResult.setLine1((form.txtAddress1().getValue()));
	addressResult.setLine2((form.txtAddress2().getValue()));
	addressResult.setLine3((form.txtAddress3().getValue()));
	addressResult.setLine4((form.txtAddress4().getValue()));
	if(ConfigFlag.DOM.HEARTS_REPLICATE_PATIENTS.getValue())
		addressResult.setLine5("");
	else
		addressResult.setLine5((form.txtAddress5().getValue()));
	
	return addressResult;
}
 
Example 11
Project: AvoinApotti   File: AddressManagmentProvider.java   View source code 6 votes vote down vote up
public GeoCoOrdVo getGPSCoordinatesForPostCode(String postCode) 
{
	GeoCoOrdVo geoCoOrdvo = new GeoCoOrdVo();
	AddressManagmentProvider amf = new AddressManagmentProvider();
	
	ims.core.vo.PersonAddress lpa = new ims.core.vo.PersonAddress();
	lpa.setPostCode(postCode);
	
	double[] coOrds;
	try 
	{
		coOrds = amf.getLatitudeLogitude(lpa);
	} 
	catch (DomainRuntimeException e) 
	{
		return null;
	}			
	if (coOrds != null && coOrds.length == 2)
	{
		geoCoOrdvo.setLatitude((float)coOrds[0]);
		geoCoOrdvo.setLogitude((float)coOrds[1]);
		return geoCoOrdvo;
	}
	
	return null;
}
 
Example 12
Project: AvoinApotti   File: DemographicsImpl.java   View source code 6 votes vote down vote up
private PersonAddress extractPracticeAddressFromDTOPracticeRecord(Gp_practiceRecord gp_practice_record) 
{
	if (gp_practice_record == null)
		return null;

	PersonAddress voPracticeAddress = new PersonAddress();

	voPracticeAddress.setPhone(gp_practice_record.Practice_phone_no == null ? null : gp_practice_record.Practice_phone_no);
	voPracticeAddress.setFax(gp_practice_record.Practice_fax_no == null ? null: gp_practice_record.Practice_fax_no);
	voPracticeAddress.setLine1(gp_practice_record.Address_line1 == null ? null: gp_practice_record.Address_line1);
	voPracticeAddress.setLine2(gp_practice_record.Address_line2 == null ? null: gp_practice_record.Address_line2);
	voPracticeAddress.setLine3(gp_practice_record.Address_line3 == null ? null: gp_practice_record.Address_line3);
	voPracticeAddress.setLine4(gp_practice_record.Address_line4 == null ? null: gp_practice_record.Address_line4);
	voPracticeAddress.setLine5(gp_practice_record.Address_line5 == null ? null: gp_practice_record.Address_line5);
	// TODO ask leader voPracticeAddress.setCounty()
	return voPracticeAddress;
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnPatientAddressClick() throws ims.framework.exceptions.PresentationLogicException
{
	clearAddress();
	if(	form.getGlobalContext().Core.getPatientShortIsNotNull())
	{
		PersonAddress driverAdress = form.getGlobalContext().Core.getPatientShort().getAddress();
		if(	driverAdress != null)
		{
			form.txtAddress1().setValue(driverAdress.getAddressBuildingName());
			form.txtAddress2().setValue(driverAdress.getAddressBuildingNumber());
			form.txtAddress3().setValue(driverAdress.getAddressLocality());
			form.txtAddress4().setValue(driverAdress.getAddressPostTown());
			form.txtPostCode().setValue(driverAdress.getAddressPostCode());
		}
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateDataFromScreen() 
{
	OrganisationVo voOrganisation = form.getGlobalContext().Admin
			.getOrganisationVoIsNotNull() ? form.getGlobalContext().Admin
			.getOrganisationVo() : new OrganisationVo();
	PersonAddress voAddress = voOrganisation.getAddressIsNotNull() ? voOrganisation
			.getAddress()
			: new PersonAddress();
	voAddress.setLine1(form.txtOrgAdd1().getValue());
	voAddress.setLine2(form.txtOrgAdd2().getValue());
	voAddress.setLine3(form.txtOrgAdd3().getValue());
	voAddress.setLine4(form.txtOrgAdd4().getValue());
	voAddress.setLine5(form.txtOrgAdd5().getValue());
	voAddress.setCounty(form.cmbCounty().getValue());
	voAddress.setPhone(form.txtOrgPhone().getValue());
	voAddress.setFax(form.txtOrgFax().getValue());
	voAddress.setPostCode(form.txtPostCode().getValue());
	
	voOrganisation.setAddress(voAddress);

	voOrganisation.setIsActive(Boolean.TRUE);
	voOrganisation.setName(form.txtOrgName().getValue());
	voOrganisation.setType(OrganisationType.GPP);

	form.getGlobalContext().Admin.setOrganisationVo(voOrganisation);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateAddress(PersonAddress voAddress) 
{
	if (voAddress != null)
	{
		if (voAddress.getLine1IsNotNull())
			form.ctnDetails().txtDetailsAddress1().setValue(voAddress.getLine1());
		if (voAddress.getLine2IsNotNull())
			form.ctnDetails().txtDetailsAddress2().setValue(voAddress.getLine2());
		if (voAddress.getLine3IsNotNull())
			form.ctnDetails().txtDetailsAddress3().setValue(voAddress.getLine3());
		if (voAddress.getLine4IsNotNull())
			form.ctnDetails().txtDetailsAddress4().setValue(voAddress.getLine4());
		if (voAddress.getLine5IsNotNull())
			form.ctnDetails().txtDetailsAddress5().setValue(voAddress.getLine5());

		form.ctnDetails().txtDetailsPostCode().setValue(voAddress.getPostCode());
		form.ctnDetails().cmbCounty().setValue(voAddress.getCounty());
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
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;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected ims.core.vo.OrgShortVo populateDataFromScreen(ims.core.vo.OrgShortVo value)
{
	if(value == null)
		value = new ims.core.vo.OrgShortVo();

	PersonAddress voPersonAdress = new PersonAddress();
	voPersonAdress.setCounty(form.lyr1().tabOrg().cmbOrgCounty().getValue());
	voPersonAdress.setFax(form.lyr1().tabOrg().txtOrgFax().getValue());
	voPersonAdress.setLine1(form.lyr1().tabOrg().txtOrgAdd1().getValue());
	voPersonAdress.setLine2(form.lyr1().tabOrg().txtOrgAdd2().getValue());
	voPersonAdress.setLine3(form.lyr1().tabOrg().txtOrgAdd3().getValue());
	voPersonAdress.setLine4(form.lyr1().tabOrg().txtOrgAdd4().getValue());
	voPersonAdress.setLine5(form.lyr1().tabOrg().txtOrgAdd5().getValue());		
	voPersonAdress.setPhone(form.lyr1().tabOrg().txtOrgPhone().getValue());
	voPersonAdress.setPostCode(form.lyr1().tabOrg().txtOrgPostCode().getValue());

	value.setAddress(voPersonAdress);
	
	value.setCodeMappings(getCodeMappings(form.lyr1().tabOrg().grdMappings()));
	value.setComment(form.lyr1().tabOrg().txtOrgComment().getValue());
	value.setType(ims.core.vo.lookups.OrganisationType.SUPPLIER);
	value.setName(form.lyr1().tabOrg().txtOrgName().getValue());
	return value;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void populateScreenFromData(ims.core.vo.OrgShortVo value)
{
	clearDetailsTab();
	if(value == null)
		return;
	
	PersonAddress voPersonAdress = new PersonAddress();
	voPersonAdress = value.getAddressIsNotNull() ? value.getAddress() : null; 
	if (voPersonAdress != null)
	{
		form.lyr1().tabOrg().txtOrgAdd1().setValue(voPersonAdress.getLine1IsNotNull() ? voPersonAdress.getLine1() : null );
		form.lyr1().tabOrg().txtOrgAdd2().setValue(voPersonAdress.getLine2IsNotNull() ? voPersonAdress.getLine2() : null );
		form.lyr1().tabOrg().txtOrgAdd3().setValue(voPersonAdress.getLine3IsNotNull() ? voPersonAdress.getLine3() : null );
		form.lyr1().tabOrg().txtOrgAdd4().setValue(voPersonAdress.getLine4IsNotNull() ? voPersonAdress.getLine4() : null );
		form.lyr1().tabOrg().txtOrgAdd5().setValue(voPersonAdress.getLine5IsNotNull() ? voPersonAdress.getLine5() : null );			
		form.lyr1().tabOrg().txtOrgFax().setValue(voPersonAdress.getFaxIsNotNull()? voPersonAdress.getFax() : null );
		form.lyr1().tabOrg().txtOrgPhone().setValue(voPersonAdress.getPhoneIsNotNull() ? voPersonAdress.getPhone() : null );
		form.lyr1().tabOrg().txtOrgPostCode().setValue(voPersonAdress.getPostCodeIsNotNull() ? voPersonAdress.getPostCode() : null );
		form.lyr1().tabOrg().cmbOrgCounty().setValue(voPersonAdress.getCountyIsNotNull()? voPersonAdress.getCounty() : null);
	}		
	populateMappingsGrid(value.getCodeMappings());
	form.lyr1().tabOrg().txtOrgComment().setValue(value.getCommentIsNotNull() ? value.getComment(): null);
	form.lyr1().tabOrg().txtOrgName().setValue(value.getNameIsNotNull() ? value.getName(): null);		
	
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
public OrganisationWithSitesVo getNewPracticeBasedOnSearchCriteria()
{
	OrganisationWithSitesVo voOrganisation = new OrganisationWithSitesVo();
	
	voOrganisation.setName(form.txtName().getValue());
	voOrganisation.setIsActive(Boolean.TRUE);
	
	voOrganisation.setAddress(new PersonAddress());
	voOrganisation.getAddress().setLine1(form.txtAddress().getValue());
	
	TaxonomyType taxonomyType = form.cmbType().getValue();
	if(taxonomyType != null)
	{
		TaxonomyMap taxonomyMap = new TaxonomyMap();
		taxonomyMap.setTaxonomyName(taxonomyType);
		taxonomyMap.setTaxonomyCode(form.txtCode().getValue());
		
		voOrganisation.setCodeMappings(new TaxonomyMapCollection());
		voOrganisation.getCodeMappings().add(taxonomyMap);
	}
	
	return voOrganisation;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateScreenFromData(OrganisationVo value)
{
	clearTab(TABORG);
	PersonAddress voAddress = value.getAddress();
	if (voAddress != null)
	{
		form.ctn1().lyr1().tabOrg().txtOrgAdd1().setValue(voAddress.getLine1());
		form.ctn1().lyr1().tabOrg().txtOrgAdd2().setValue(voAddress.getLine2());
		form.ctn1().lyr1().tabOrg().txtOrgAdd3().setValue(voAddress.getLine3());
		form.ctn1().lyr1().tabOrg().txtOrgAdd4().setValue(voAddress.getLine4());
		form.ctn1().lyr1().tabOrg().txtOrgAdd5().setValue(voAddress.getLine5());
		form.ctn1().lyr1().tabOrg().txtOrgPhone().setValue(voAddress.getPhone());
		form.ctn1().lyr1().tabOrg().txtOrgFax().setValue(voAddress.getFax());
		form.ctn1().lyr1().tabOrg().txtOrgPostCode().setValue(voAddress.getPostCode());
		form.ctn1().lyr1().tabOrg().cmbOrgCounty().setValue(voAddress.getCounty());
	}

	populateOrgMappingsGrid(value.getCodeMappings());
	form.ctn1().lyr1().tabOrg().txtOrgComment().setValue(value.getComment());
	form.ctn1().lyr1().tabOrg().txtOrgName().setValue(value.getName());
	form.ctn1().lyr1().tabOrg().cmbOrgType().setValue(value.getType());
}
 
Example 21
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
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);
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateAdmittedFromDetails(ExternalResourceVo selectedExtResForAdmittedFrom)
{
	if (selectedExtResForAdmittedFrom == null)
		return;

	if (selectedExtResForAdmittedFrom.getExternalResourceTypeIsNotNull())
	{
		form.txtAdmittedFromName().setValue(selectedExtResForAdmittedFrom.getResourcename() != null ? selectedExtResForAdmittedFrom.getResourcename() : null);
		if (selectedExtResForAdmittedFrom.getResourceAddressIsNotNull())
		{
			PersonAddress resAddress = selectedExtResForAdmittedFrom.getResourceAddress();

			form.txtAdrAdmittedFromLine1().setValue(resAddress.getLine1());
			form.txtAdrAdmittedFromLine2().setValue(resAddress.getLine2());
			form.txtAdrAdmittedFromLine3().setValue(resAddress.getLine3());
			form.cmbAdmittedCounty().setValue(resAddress.getCounty() != null ? resAddress.getCounty() : null);

			form.txtTelephoneNr().setValue(resAddress.getPhone());
		}

	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateReferrerDetails(ExternalResourceVo selectedExtResForReferredFrom)
{
	if (selectedExtResForReferredFrom == null)
		return;

	if (selectedExtResForReferredFrom.getExternalResourceTypeIsNotNull())
	{
		form.txtReferrerNameOrganisation().setValue(selectedExtResForReferredFrom.getResourcename() != null ? selectedExtResForReferredFrom.getResourcename() : null);
		if (selectedExtResForReferredFrom.getResourceAddressIsNotNull())
		{
			PersonAddress resAddress = selectedExtResForReferredFrom.getResourceAddress();

			form.txtReferrerAdr1().setValue(resAddress.getLine1());
			form.txtReferrerAdr2().setValue(resAddress.getLine2());
			form.txtReferrerAdr3().setValue(resAddress.getLine3());
			form.cmbReferrerCounty().setValue(resAddress.getCounty() != null ? resAddress.getCounty() : null);

			form.txtReferrerContactNr().setValue(resAddress.getPhone());
		}

	}

}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PersonAddress getlines(PersonAddress addressResult)
{
	if (addressResult == null)
		return null;
	
	addressResult.setLine1((form.txtAddress1().getValue()));
	addressResult.setLine2((form.txtAddress2().getValue()));
	addressResult.setLine3((form.txtAddress3().getValue()));
	addressResult.setLine4((form.txtAddress4().getValue()));
	if(ConfigFlag.DOM.HEARTS_REPLICATE_PATIENTS.getValue())
		addressResult.setLine5("");
	else
		addressResult.setLine5((form.txtAddress5().getValue()));
	
	return addressResult;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
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);
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public void populateScreenFromData(PersonAddress pa)
{
	if (pa != null)
	{
		pa.setPhone(pa.getPhone());

		if (form.getGlobalContext().Core.getPatientShortIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null)
			pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue());
		
		form.ccAddress().setValue(pa);
		form.txtOtherPhone().setValue(pa.getOtherphone());
		form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null);
		form.getLocalContext().setpersonAddress(pa);
		
		form.ccEffectiveDates().setEffectiveDates(pa.getBeffdate(), pa.getBetdate());
	}
	form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex());
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public int compare(Object ob1, Object ob2) 
{
	Date d1 = null;
	Date d2 = null;
	
	if(ob1 instanceof PersonAddress)
	{
		d1 = ((PersonAddress)ob1).getBeffdate();
	}

	if(ob2 instanceof PersonAddress)
	{
		d2 = ((PersonAddress)ob2).getBeffdate();
	}
	
	if(d1 != null )
		return  d1.compareTo(d2)*direction;
	
	if(d2 != null)
		return (-1)*direction;
	
	return 0;
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
public void populateScreenFromData(PersonAddress pa)
{
	if (pa != null)
	{
		pa.setPhone(pa.getPhone());

		if (form.getGlobalContext().Core.getPatientShortIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null)
			pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue());
		
		form.ccAddress().setValue(pa);
		form.txtOtherPhone().setValue(pa.getOtherphone());
		form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null);
		form.getLocalContext().setpersonAddress(pa);
	}
	form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex());
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
@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);
}
 
Example 30
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void doCopy()
{
	clearAddressControls();
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
		
		//start WDEV-14370
		//if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
		{
			personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
		}
		//end
		
		form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432
		
		populateScreenFromData(personAddress);
		//displayPhoneNumbers();
		
		form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432
	}
}
 
Example 31
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getRefferingGPAddress(PersonAddress voAddress)
{
	if (voAddress == null)
		return "";
	
	StringBuffer address = new StringBuffer();
	
	if (voAddress.getLine1IsNotNull()) 
		address.append(voAddress.getLine1().toString());
	if (voAddress.getLine2IsNotNull()) 
		address.append("\r\n" + voAddress.getLine2().toString());
	if (voAddress.getLine3IsNotNull()) 
		address.append("\r\n" + voAddress.getLine3().toString());
	if (voAddress.getLine4IsNotNull()) 
		address.append("\r\n" + voAddress.getLine4().toString());
	if (voAddress.getLine5IsNotNull()) 
		address.append("\r\n" + voAddress.getLine5().toString());
	
	return address.toString();
}
 
Example 32
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
@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);
}
 
Example 33
Project: openmaxims-linux   File: DemographicsImpl.java   View source code 6 votes vote down vote up
private PersonAddress extractPracticeAddressFromDTOPracticeRecord(Gp_practiceRecord gp_practice_record) 
{
	if (gp_practice_record == null)
		return null;

	PersonAddress voPracticeAddress = new PersonAddress();

	voPracticeAddress.setPhone(gp_practice_record.Practice_phone_no == null ? null : gp_practice_record.Practice_phone_no);
	voPracticeAddress.setFax(gp_practice_record.Practice_fax_no == null ? null: gp_practice_record.Practice_fax_no);
	voPracticeAddress.setLine1(gp_practice_record.Address_line1 == null ? null: gp_practice_record.Address_line1);
	voPracticeAddress.setLine2(gp_practice_record.Address_line2 == null ? null: gp_practice_record.Address_line2);
	voPracticeAddress.setLine3(gp_practice_record.Address_line3 == null ? null: gp_practice_record.Address_line3);
	voPracticeAddress.setLine4(gp_practice_record.Address_line4 == null ? null: gp_practice_record.Address_line4);
	voPracticeAddress.setLine5(gp_practice_record.Address_line5 == null ? null: gp_practice_record.Address_line5);
	// TODO ask leader voPracticeAddress.setCounty()
	return voPracticeAddress;
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
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;
}
 
Example 35
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PersonAddress getlines(PersonAddress addressResult)
{
	if (addressResult == null)
		return null;
	
	addressResult.setLine1((form.txtAddress1().getValue()));
	addressResult.setLine2((form.txtAddress2().getValue()));
	addressResult.setLine3((form.txtAddress3().getValue()));
	addressResult.setLine4((form.txtAddress4().getValue()));
	if(ConfigFlag.DOM.HEARTS_REPLICATE_PATIENTS.getValue())
		addressResult.setLine5("");
	else
		addressResult.setLine5((form.txtAddress5().getValue()));
	
	addressResult.setAreaOfResidence(form.cmbAreaOfResidence().getValue());		//wdev-19176
	addressResult.setCounty(form.cmbCounty().getValue()); //WDEV-17700
	addressResult.setPostCode(form.txtPost().getValue()); //WDEV-17700
	
	return addressResult;
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private String getRefferingGPAddress(PersonAddress voAddress)
{
	if (voAddress == null)
		return "";
	
	StringBuffer address = new StringBuffer();
	
	if (voAddress.getLine1IsNotNull()) 
		address.append(voAddress.getLine1().toString());
	if (voAddress.getLine2IsNotNull()) 
		address.append("\r\n" + voAddress.getLine2().toString());
	if (voAddress.getLine3IsNotNull()) 
		address.append("\r\n" + voAddress.getLine3().toString());
	if (voAddress.getLine4IsNotNull()) 
		address.append("\r\n" + voAddress.getLine4().toString());
	if (voAddress.getLine5IsNotNull()) 
		address.append("\r\n" + voAddress.getLine5().toString());
	
	return address.toString();
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PersonAddress getlines(PersonAddress addressResult)
{
	if (addressResult == null)
		return null;
	
	addressResult.setLine1((form.txtAddress1().getValue()));
	addressResult.setLine2((form.txtAddress2().getValue()));
	addressResult.setLine3((form.txtAddress3().getValue()));
	addressResult.setLine4((form.txtAddress4().getValue()));
	if(ConfigFlag.DOM.HEARTS_REPLICATE_PATIENTS.getValue())
		addressResult.setLine5("");
	else
		addressResult.setLine5((form.txtAddress5().getValue()));
	
	return addressResult;
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void doCopy()
{
	clearAddressControls();
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
		
		//start WDEV-14370
		if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
		{
			personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
		}
		//end
		
		form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432
		
		populateScreenFromData(personAddress);
		displayPhoneNumbers();
		
		form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432
	}
}
 
Example 39
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void doCopy()
{
	clearAddressControls();
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
		
		//start WDEV-14370
		if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
		{
			personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
		}
		//end
		
		form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432
		
		populateScreenFromData(personAddress);
		displayPhoneNumbers();
		
		form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432
	}
}
 
Example 40
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	initialize();
			
	if (args != null && args.length > 0 && args[0] instanceof PersonAddressCollection)
	{
		PersonAddressCollection voColl = (PersonAddressCollection)args[0];
		populateRecordBrowser(voColl);
	}
	else if (args != null && args.length > 0 && args[0] instanceof PersonAddress){
		form.getLocalContext().setPersonAddress((PersonAddress) args[0]);
		form.ccAddress().setValue((PersonAddress) args[0]);
		form.setMode(FormMode.EDIT);
		form.btnOk().setText("Save");
	}
}