Java Code Examples for ims.core.vo.GpShortVo

The following are top voted examples for showing how to use ims.core.vo.GpShortVo. 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   Source Code and License 6 votes vote down vote up
private void loadGPsPractice(GpShortVo vo) 
{
	GP gpVo = domain.getGP(vo);
	if (gpVo.getPracticesIsNotNull() && gpVo.getPractices().size() > 0)
	{
		for (int i = 0 ; i < gpVo.getPractices().size() ; i++)
		{
			if (gpVo.getPractices().get(i).getIsPrimaryPracticeIsNotNull() &&
				gpVo.getPractices().get(i).getIsPrimaryPractice().booleanValue() )
			{
				form.qmbReferringOrg().newRow(gpVo.getPractices().get(i).getPractice(), gpVo.getPractices().get(i).getPractice().getName(), null, null);
				form.qmbReferringOrg().setValue(gpVo.getPractices().get(i).getPractice());
			}
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 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   Source Code and License 6 votes vote down vote up
private String getReferalGpTooltip(GpShortVo gp)
{
	if (gp == null)
	{
		if (form.getMode().equals(FormMode.EDIT))
		{
			form.imbReferralGP().setVisible(true);
		}
		else
		{
			form.imbReferralGP().setVisible(false);
		}
		return "No GP Details";
	}

	StringBuffer sbGPDetails = new StringBuffer();
	if (gp.getNameIsNotNull())
	{
		sbGPDetails.append(Textile.setBold("GP DETAILS") + "\r" + Textile.setBold("GP Name: ") + gp.getName().toString());
		form.txtReferralGP().setValue(gp.getName().toString());
	}

	return new Textile().process(sbGPDetails.toString());
}
 
Example 4
Project: AvoinApotti   File: EmergencyAttendanceDetailsCcImpl.java   Source Code and License 6 votes vote down vote up
public GpShortVo getGpPatient(PatientRefVo patient) 
{
	if(patient == null)
		throw new CodingRuntimeException("Patient not provided");
	
	DomainFactory factory = getDomainFactory();
	
	String hsql = "select g1_1 from Patient as p1_1 left join p1_1.gp as g1_1 	where	(p1_1.id = :id)";
	 
	List gps = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()});
	if(gps != null && gps.size() > 0)
	{
		GpShortVoCollection gpColl = GpShortVoAssembler.createGpShortVoCollectionFromGp(gps);
		if(gpColl != null && gpColl.size() > 0)
			return gpColl.get(0);
	}
	return null;
}
 
Example 5
Project: AvoinApotti   File: AttendanceDetailsImpl.java   Source Code and License 6 votes vote down vote up
public GpShortVo getGpPatient(PatientRefVo patient) 
{
	if(patient == null)
		throw new CodingRuntimeException("Patient not provided");
	
	DomainFactory factory = getDomainFactory();
	
	String hsql = "select g1_1 from Patient as p1_1 left join p1_1.gp as g1_1 	where	(p1_1.id = :id)";
	 
	List gps = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()});
	if(gps != null && gps.size() > 0)
	{
		GpShortVoCollection gpColl = GpShortVoAssembler.createGpShortVoCollectionFromGp(gps);
		if(gpColl != null && gpColl.size() > 0)
			return gpColl.get(0);
	}
	return null;
}
 
Example 6
Project: AvoinApotti   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp,XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public GpShortVo getNewGpBasedOnSearchCriteria()
{
	GpShortVo voGpShort = new GpShortVo();
	voGpShort.setName(new PersonName());

	String forname = form.txtSearchForename().getValue();
	String surname = form.txtSearchSurname().getValue();
	TaxonomyType type = form.cmbSearchCodeType().getValue();

	voGpShort.getName().setForename(forname);
	voGpShort.getName().setUpperForename(forname != null ? forname.toUpperCase().substring(0, Math.min(voGpShort.getName().getUpperForenameMaxLength(), forname.length())) : null);
	voGpShort.getName().setSurname(surname);
	voGpShort.getName().setUpperSurname(surname != null ? surname.toUpperCase().substring(0, Math.min(voGpShort.getName().getUpperSurnameMaxLength(), surname.length())) : null);

	if (type != null)
	{
		voGpShort.setCodeMappings(new TaxonomyMapCollection());
		TaxonomyMap taxonomyMap = new TaxonomyMap();
		taxonomyMap.setTaxonomyName(type);
		taxonomyMap.setTaxonomyCode(form.txtSearchCode().getValue());
		voGpShort.getCodeMappings().add(taxonomyMap);
	}

	return voGpShort;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onChkPatientsGpValueChanged() throws PresentationLogicException
{
	GpShortVo patientGp = null;
	form.getLocalContext().setGPInfo(form.getGlobalContext().RefMan.getPatientsGP());
	if (form.chkPatientsGp().getValue())
	{
		form.getLocalContext().setGPInfo(form.getGlobalContext().RefMan.getPatientsGP());
		if (form.getGlobalContext().RefMan.getPatientsGPIsNotNull())
			patientGp = form.getGlobalContext().RefMan.getPatientsGP();
		else if (form.getGlobalContext().Core.getPatientShortIsNotNull())
			patientGp = form.getLocalContext().getpatientsGp();// domain.getPatientGP(form.getGlobalContext().Core.getPatientShort().getID_Patient());

		if (patientGp != null)
			populateGPDetailsPanelFromData(patientGp);
		else
			onReferrerTypeSelectionChanged();

	}
	else if (!form.chkPatientsGp().getValue())
		onReferrerTypeSelectionChanged();
	else
		onReferrerTypeSelectionChanged();

}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addGpToGrid(GpShortVo voGp)
{
	//check if this GP already exists
	for (int i = 0; i < form.lyrDetails().tabRecipents().grdRecipients().getRows().size(); i++)
	{
		if(form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue() != null)
		{
			if(form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue().getGeneralPractitionerIsNotNull() && form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue().getGeneralPractitioner().getID_Gp().equals(voGp.getID_Gp()))
			{
				engine.showMessage("This GP was already added !");
				return;
			}
		}
	}
	
	grdRecipientsRow row = form.lyrDetails().tabRecipents().grdRecipients().getRows().newRow();
	ClinicalCorrespondenceRecipientsVo recipient = new ClinicalCorrespondenceRecipientsVo();
	
	recipient.setGeneralPractitioner(voGp);
	recipient.setPatient(Boolean.FALSE);
	
	row.setValue(recipient);
	row.setcolName((voGp.getName().getForename() != null ? voGp.getName().getForename():"") + " " + (voGp.getName().getSurname()!= null ? voGp.getName().getSurname():"")); //wdev-10872
	row.setcolPrimary(false);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadGPsPractice(GpShortVo vo) 
{
	GP gpVo = domain.getGP(vo);
	if (gpVo.getPracticesIsNotNull() && gpVo.getPractices().size() > 0)
	{
		for (int i = 0 ; i < gpVo.getPractices().size() ; i++)
		{
			if (gpVo.getPractices().get(i).getIsPrimaryPracticeIsNotNull() &&
				gpVo.getPractices().get(i).getIsPrimaryPractice().booleanValue() )
			{
				form.qmbRefOrganisation().newRow(gpVo.getPractices().get(i).getPractice(), gpVo.getPractices().get(i).getPractice().getName(), null, null);
				form.qmbRefOrganisation().setValue(gpVo.getPractices().get(i).getPractice());
			}
		}
	}
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadGPsPractice(GpShortVo vo) 
{
	GP gpVo = domain.getGP(vo);
	if (gpVo.getPracticesIsNotNull() && gpVo.getPractices().size() > 0)
	{
		for (int i = 0 ; i < gpVo.getPractices().size() ; i++)
		{
			if (gpVo.getPractices().get(i).getIsPrimaryPracticeIsNotNull() &&
				gpVo.getPractices().get(i).getIsPrimaryPractice().booleanValue() )
			{
				form.qmbReferringOrg().newRow(gpVo.getPractices().get(i).getPractice(), gpVo.getPractices().get(i).getPractice().getName(), null, null);
				form.qmbReferringOrg().setValue(gpVo.getPractices().get(i).getPractice());
			}
		}
	}
}
 
Example 12
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadGPsPractice(GpShortVo vo) 
{
	GP gpVo = domain.getGP(vo);
	if (gpVo.getPracticesIsNotNull() && gpVo.getPractices().size() > 0)
	{
		for (int i = 0 ; i < gpVo.getPractices().size() ; i++)
		{
			if (gpVo.getPractices().get(i).getIsPrimaryPracticeIsNotNull() &&
				gpVo.getPractices().get(i).getIsPrimaryPractice().booleanValue() )
			{
				form.qmbRefOrganisation().newRow(gpVo.getPractices().get(i).getPractice(), gpVo.getPractices().get(i).getPractice().getName(), null, null);
				form.qmbRefOrganisation().setValue(gpVo.getPractices().get(i).getPractice());
			}
		}
	}
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getReferalGpTooltip(GpShortVo gp)
{
	if (gp == null)
	{
		if (form.getMode().equals(FormMode.EDIT))
		{
			form.imbReferralGP().setVisible(true);
		}
		else
		{
			form.imbReferralGP().setVisible(false);
		}
		return "No GP Details";
	}

	StringBuffer sbGPDetails = new StringBuffer();
	if (gp.getNameIsNotNull())
	{
		sbGPDetails.append(Textile.setBold("GP DETAILS") + "\r" + Textile.setBold("GP Name: ") + gp.getName().toString());
		form.txtReferralGP().setValue(gp.getName().toString());
	}

	return new Textile().process(sbGPDetails.toString());
}
 
Example 14
Project: openMAXIMS   File: EmergencyAttendanceDetailsCcImpl.java   Source Code and License 6 votes vote down vote up
public GpShortVo getGpPatient(PatientRefVo patient) 
{
	if(patient == null)
		throw new CodingRuntimeException("Patient not provided");
	
	DomainFactory factory = getDomainFactory();
	
	String hsql = "select g1_1 from Patient as p1_1 left join p1_1.gp as g1_1 	where	(p1_1.id = :id)";
	 
	List gps = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()});
	if(gps != null && gps.size() > 0)
	{
		GpShortVoCollection gpColl = GpShortVoAssembler.createGpShortVoCollectionFromGp(gps);
		if(gpColl != null && gpColl.size() > 0)
			return gpColl.get(0);
	}
	return null;
}
 
Example 15
Project: openMAXIMS   File: AttendanceDetailsImpl.java   Source Code and License 6 votes vote down vote up
public GpShortVo getGpPatient(PatientRefVo patient) 
{
	if(patient == null)
		throw new CodingRuntimeException("Patient not provided");
	
	DomainFactory factory = getDomainFactory();
	
	String hsql = "select g1_1 from Patient as p1_1 left join p1_1.gp as g1_1 	where	(p1_1.id = :id)";
	 
	List gps = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()});
	if(gps != null && gps.size() > 0)
	{
		GpShortVoCollection gpColl = GpShortVoAssembler.createGpShortVoCollectionFromGp(gps);
		if(gpColl != null && gpColl.size() > 0)
			return gpColl.get(0);
	}
	return null;
}
 
Example 16
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp, XCN xcn, ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));

	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public GpShortVo getNewGpBasedOnSearchCriteria()
{
	GpShortVo voGpShort = new GpShortVo();
	voGpShort.setName(new PersonName());

	String forname = form.txtSearchForename().getValue();
	String surname = form.txtSearchSurname().getValue();
	TaxonomyType type = form.cmbSearchCodeType().getValue();

	voGpShort.getName().setForename(forname);
	voGpShort.getName().setUpperForename(forname != null ? forname.toUpperCase().substring(0, Math.min(voGpShort.getName().getUpperForenameMaxLength(), forname.length())) : null);
	voGpShort.getName().setSurname(surname);
	voGpShort.getName().setUpperSurname(surname != null ? surname.toUpperCase().substring(0, Math.min(voGpShort.getName().getUpperSurnameMaxLength(), surname.length())) : null);

	if (type != null)
	{
		voGpShort.setCodeMappings(new TaxonomyMapCollection());
		TaxonomyMap taxonomyMap = new TaxonomyMap();
		taxonomyMap.setTaxonomyName(type);
		taxonomyMap.setTaxonomyCode(form.txtSearchCode().getValue());
		voGpShort.getCodeMappings().add(taxonomyMap);
	}

	return voGpShort;
}
 
Example 18
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp,XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onChkPatientsGpValueChanged() throws PresentationLogicException
{
	GpShortVo patientGp = null;
	form.getLocalContext().setGPInfo(form.getGlobalContext().RefMan.getPatientsGP());
	if (form.chkPatientsGp().getValue())
	{
		form.getLocalContext().setGPInfo(form.getGlobalContext().RefMan.getPatientsGP());
		if (form.getGlobalContext().RefMan.getPatientsGPIsNotNull())
			patientGp = form.getGlobalContext().RefMan.getPatientsGP();
		else if (form.getGlobalContext().Core.getPatientShortIsNotNull())
			patientGp = form.getLocalContext().getpatientsGp();// domain.getPatientGP(form.getGlobalContext().Core.getPatientShort().getID_Patient());

		if (patientGp != null)
			populateGPDetailsPanelFromData(patientGp);
		else
			onReferrerTypeSelectionChanged();

	}
	else if (!form.chkPatientsGp().getValue())
		onReferrerTypeSelectionChanged();
	else
		onReferrerTypeSelectionChanged();

}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addGpToGrid(GpShortVo voGp)
{
	//check if this GP already exists
	for (int i = 0; i < form.lyrDetails().tabRecipents().grdRecipients().getRows().size(); i++)
	{
		if(form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue() != null)
		{
			if(form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue().getGeneralPractitionerIsNotNull() && form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue().getGeneralPractitioner().getID_Gp().equals(voGp.getID_Gp()))
			{
				engine.showMessage("This GP was already added !");
				return;
			}
		}
	}
	
	grdRecipientsRow row = form.lyrDetails().tabRecipents().grdRecipients().getRows().newRow();
	ClinicalCorrespondenceRecipientsVo recipient = new ClinicalCorrespondenceRecipientsVo();
	
	recipient.setGeneralPractitioner(voGp);
	recipient.setPatient(Boolean.FALSE);
	
	row.setValue(recipient);
	row.setcolName((voGp.getName().getForename() != null ? voGp.getName().getForename():"") + " " + (voGp.getName().getSurname()!= null ? voGp.getName().getSurname():"")); //wdev-10872
	row.setcolPrimary(false);
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadGPsPractice(GpShortVo vo) 
{
	GP gpVo = domain.getGP(vo);
	if (gpVo.getPracticesIsNotNull() && gpVo.getPractices().size() > 0)
	{
		for (int i = 0 ; i < gpVo.getPractices().size() ; i++)
		{
			if (gpVo.getPractices().get(i).getIsPrimaryPracticeIsNotNull() &&
				gpVo.getPractices().get(i).getIsPrimaryPractice().booleanValue() )
			{
				form.qmbRefOrganisation().newRow(gpVo.getPractices().get(i).getPractice(), gpVo.getPractices().get(i).getPractice().getName(), null, null);
				form.qmbRefOrganisation().setValue(gpVo.getPractices().get(i).getPractice());
			}
		}
	}
}
 
Example 22
Project: openmaxims-linux   File: AttendanceDetailsImpl.java   Source Code and License 6 votes vote down vote up
public GpShortVo getGpPatient(PatientRefVo patient) 
{
	if(patient == null)
		throw new CodingRuntimeException("Patient not provided");
	
	DomainFactory factory = getDomainFactory();
	
	String hsql = "select g1_1 from Patient as p1_1 left join p1_1.gp as g1_1 	where	(p1_1.id = :id)";
	 
	List gps = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()});
	if(gps != null && gps.size() > 0)
	{
		GpShortVoCollection gpColl = GpShortVoAssembler.createGpShortVoCollectionFromGp(gps);
		if(gpColl != null && gpColl.size() > 0)
			return gpColl.get(0);
	}
	return null;
}
 
Example 23
Project: openmaxims-linux   File: EmergencyAttendanceDetailsCcImpl.java   Source Code and License 6 votes vote down vote up
public GpShortVo getGpPatient(PatientRefVo patient) 
{
	if(patient == null)
		throw new CodingRuntimeException("Patient not provided");
	
	DomainFactory factory = getDomainFactory();
	
	String hsql = "select g1_1 from Patient as p1_1 left join p1_1.gp as g1_1 	where	(p1_1.id = :id)";
	 
	List gps = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()});
	if(gps != null && gps.size() > 0)
	{
		GpShortVoCollection gpColl = GpShortVoAssembler.createGpShortVoCollectionFromGp(gps);
		if(gpColl != null && gpColl.size() > 0)
			return gpColl.get(0);
	}
	return null;
}
 
Example 24
Project: openMAXIMS   File: AttendanceDetailsImpl.java   Source Code and License 6 votes vote down vote up
public GpShortVo getGpPatient(PatientRefVo patient) 
{
	if(patient == null)
		throw new CodingRuntimeException("Patient not provided");
	
	DomainFactory factory = getDomainFactory();
	
	String hsql = "select g1_1 from Patient as p1_1 left join p1_1.gp as g1_1 	where	(p1_1.id = :id)";
	 
	List gps = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()});
	if(gps != null && gps.size() > 0)
	{
		GpShortVoCollection gpColl = GpShortVoAssembler.createGpShortVoCollectionFromGp(gps);
		if(gpColl != null && gpColl.size() > 0)
			return gpColl.get(0);
	}
	return null;
}
 
Example 25
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp,XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public GpShortVo getNewGpBasedOnSearchCriteria()
{
	GpShortVo voGpShort = new GpShortVo();
	voGpShort.setName(new PersonName());

	String forname = form.txtSearchForename().getValue();
	String surname = form.txtSearchSurname().getValue();
	TaxonomyType type = form.cmbSearchCodeType().getValue();

	voGpShort.getName().setForename(forname);
	voGpShort.getName().setUpperForename(forname != null ? forname.toUpperCase().substring(0, Math.min(voGpShort.getName().getUpperForenameMaxLength(), forname.length())) : null);
	voGpShort.getName().setSurname(surname);
	voGpShort.getName().setUpperSurname(surname != null ? surname.toUpperCase().substring(0, Math.min(voGpShort.getName().getUpperSurnameMaxLength(), surname.length())) : null);

	if (type != null)
	{
		voGpShort.setCodeMappings(new TaxonomyMapCollection());
		TaxonomyMap taxonomyMap = new TaxonomyMap();
		taxonomyMap.setTaxonomyName(type);
		taxonomyMap.setTaxonomyCode(form.txtSearchCode().getValue());
		voGpShort.getCodeMappings().add(taxonomyMap);
	}

	return voGpShort;
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onChkPatientsGpValueChanged() throws PresentationLogicException
{
	GpShortVo patientGp = null;
	form.getLocalContext().setGPInfo(form.getGlobalContext().RefMan.getPatientsGP());
	if (form.chkPatientsGp().getValue())
	{
		form.getLocalContext().setGPInfo(form.getGlobalContext().RefMan.getPatientsGP());
		if (form.getGlobalContext().RefMan.getPatientsGPIsNotNull())
			patientGp = form.getGlobalContext().RefMan.getPatientsGP();
		else if (form.getGlobalContext().Core.getPatientShortIsNotNull())
			patientGp = form.getLocalContext().getpatientsGp();// domain.getPatientGP(form.getGlobalContext().Core.getPatientShort().getID_Patient());

		if (patientGp != null)
			populateGPDetailsPanelFromData(patientGp);
		else
			onReferrerTypeSelectionChanged();

	}
	else if (!form.chkPatientsGp().getValue())
		onReferrerTypeSelectionChanged();
	else
		onReferrerTypeSelectionChanged();

}
 
Example 28
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addGpToGrid(GpShortVo voGp)
{
	//check if this GP already exists
	for (int i = 0; i < form.lyrDetails().tabRecipents().grdRecipients().getRows().size(); i++)
	{
		if(form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue() != null)
		{
			if(form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue().getGeneralPractitionerIsNotNull() && form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue().getGeneralPractitioner().getID_Gp().equals(voGp.getID_Gp()))
			{
				engine.showMessage("This GP was already added !");
				return;
			}
		}
	}
	
	grdRecipientsRow row = form.lyrDetails().tabRecipents().grdRecipients().getRows().newRow();
	ClinicalCorrespondenceRecipientsVo recipient = new ClinicalCorrespondenceRecipientsVo();
	
	recipient.setGeneralPractitioner(voGp);
	recipient.setPatient(Boolean.FALSE);
	
	row.setValue(recipient);
	row.setcolName((voGp.getName().getForename() != null ? voGp.getName().getForename():"") + " " + (voGp.getName().getSurname()!= null ? voGp.getName().getSurname():"")); //wdev-10872
	row.setcolPrimary(false);
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addGpToGrid(GpShortVo voGp)
{
	//check if this GP already exists
	for (int i = 0; i < form.lyrDetails().tabRecipents().grdRecipients().getRows().size(); i++)
	{
		if(form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue() != null)
		{
			if(form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue().getGeneralPractitionerIsNotNull() && form.lyrDetails().tabRecipents().grdRecipients().getRows().get(i).getValue().getGeneralPractitioner().getID_Gp().equals(voGp.getID_Gp()))
			{
				engine.showMessage("This GP was already added !");
				return;
			}
		}
	}
	
	grdRecipientsRow row = form.lyrDetails().tabRecipents().grdRecipients().getRows().newRow();
	ClinicalCorrespondenceRecipientsVo recipient = new ClinicalCorrespondenceRecipientsVo();
	
	recipient.setGeneralPractitioner(voGp);
	recipient.setPatient(Boolean.FALSE);
	
	row.setValue(recipient);
	row.setcolName((voGp.getName().getForename() != null ? voGp.getName().getForename():"") + " " + (voGp.getName().getSurname()!= null ? voGp.getName().getSurname():"")); //wdev-10872
	row.setcolPrimary(false);
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadGPsPractice(GpShortVo vo) 
{
	GP gpVo = domain.getGP(vo);
	if (gpVo.getPracticesIsNotNull() && gpVo.getPractices().size() > 0)
	{
		for (int i = 0 ; i < gpVo.getPractices().size() ; i++)
		{
			if (gpVo.getPractices().get(i).getIsPrimaryPracticeIsNotNull() &&
				gpVo.getPractices().get(i).getIsPrimaryPractice().booleanValue() )
			{
				form.qmbRefOrganisation().newRow(gpVo.getPractices().get(i).getPractice(), gpVo.getPractices().get(i).getPractice().getName(), null, null);
				form.qmbRefOrganisation().setValue(gpVo.getPractices().get(i).getPractice());
			}
		}
	}
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadGPsPractice(GpShortVo vo) 
{
	GP gpVo = domain.getGP(vo);
	if (gpVo.getPracticesIsNotNull() && gpVo.getPractices().size() > 0)
	{
		for (int i = 0 ; i < gpVo.getPractices().size() ; i++)
		{
			if (gpVo.getPractices().get(i).getIsPrimaryPracticeIsNotNull() &&
				gpVo.getPractices().get(i).getIsPrimaryPractice().booleanValue() )
			{
				form.qmbReferringOrg().newRow(gpVo.getPractices().get(i).getPractice(), gpVo.getPractices().get(i).getPractice().getName(), null, null);
				form.qmbReferringOrg().setValue(gpVo.getPractices().get(i).getPractice());
			}
		}
	}
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onQmbReferredByValueChanged() throws PresentationLogicException
{
	if (form.qmbReferredBy().getValue() instanceof GpShortVo)
	{
		loadGPsPractice((GpShortVo)form.qmbReferredBy().getValue());
	}
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateGpGrid(GpShortVoCollection collection) 
{
	form.grdGps().getRows().clear();
	GpShortVo voGpPract = null;
	GenForm.grdGpsRow row = null;
	for(int i=0;i<collection.size();i++)
	{
		voGpPract = collection.get(i);
		row = form.grdGps().getRows().newRow();
		
		row.setName(voGpPract.getName().toString());
		
		if (null != voGpPract &&  voGpPract.getPracticesIsNotNull())
		{
			for (int j=0; j < voGpPract.getPractices().size(); j++)
			{					
				if (voGpPract.getPractices().get(j).getIsPrimaryPracticeIsNotNull() && 
						(voGpPract.getPractices().get(j).getIsPrimaryPractice().equals(Boolean.TRUE)) &&
							//WDEV-2725
							voGpPract.getPractices().get(j).getPracticeIsNotNull() &&
								voGpPract.getPractices().get(j).getPractice().getAddressIsNotNull())
				{
					row.setAddress(voGpPract.getPractices().get(j).getPractice().getAddress().toDisplayString());
					break;					
				}
			}
		}
		if (voGpPract.getStatusIsNotNull())
			row.setStatus(voGpPract.getStatus().toString());
		row.setValue(voGpPract);
	}
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onGrdGPSSelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{
	//populate control details
	GenForm.grdGpsRow row = form.grdGps().getRows().get(form.grdGps().getSelectedRowIndex());
	GpShortVo voGp = row.getValue();
	if (null == voGp)
		return;
	
	if (voGp.getPracticesIsNotNull())
	{
		//WDEV-2725
		if (row.getValue().getPractices().get(0).getPracticeIsNotNull() &&
				row.getValue().getPractices().get(0).getPractice().getAddressIsNotNull())
		{
			form.txtGPAddress1().setValue(row.getValue().getPractices().get(0).getPractice().getAddress().getLine1());
			form.txtGPAddress2().setValue(row.getValue().getPractices().get(0).getPractice().getAddress().getLine2());
			form.txtGPAddress3().setValue(row.getValue().getPractices().get(0).getPractice().getAddress().getLine3());
			form.txtGPAddress4().setValue(row.getValue().getPractices().get(0).getPractice().getAddress().getLine4());
		}
	}
	
	// TODO form.txtGPLocation().setValue(row.getValue().get)
	
	if (voGp.getNameIsNotNull())
		form.txtGPName().setValue(voGp.getName().toString());
	
	form.txtGPPhone().setValue(row.getValue().getMobile());
	
	form.btnSelectGP().setVisible(true);
	form.btnSelectGP().setEnabled(true);
	
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void refreshGpDetails(GpShortVo gp, LocSiteShortVo gpSurgery)
{
	form.getGlobalContext().Core.setGPDetails(gp);
	form.getGlobalContext().Core.setGPSurgery(gpSurgery);
	form.imbGP().setTooltip(getGpTooltip(gp, gpSurgery));
	if (gpSurgery != null)
		form.txtGPPractice().setValue(gpSurgery.getName());
	if (gp != null)
		form.txtGPName().setValue(gp.getName().toString());
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setPracticePhoneAndFax(OrganisationWithSitesVo practice)
{
	if (practice.getCommChannelsIsNotNull()) //WDEV-16051
	{
		GpShortVo gp = form.getGlobalContext().Core.getGPDetails();
		// WORK PHONE
		CommChannelVo gpWorkPhone = gp.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE);
		CommChannelVo practiceWorkPhone = practice.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE);

		if (gpWorkPhone != null && gpWorkPhone.getCommValueIsNotNull())
		{
			form.txtPhone().setValue(gpWorkPhone.toString());
			form.lblPhone().setValue("GP Phone:");
		}
		else if (practiceWorkPhone != null && practiceWorkPhone.getCommValueIsNotNull())
		{
			form.txtPhone().setValue(practiceWorkPhone.toString());
			form.lblPhone().setValue("Practice Phone:");
		}
		else
			form.lblPhone().setValue("Practice Phone:");

		// FAX NUMBER
		CommChannelVo gpFax = gp.getCommChannels().getCommunicationChannel(ChannelType.FAX);
		CommChannelVo practiceFax = practice.getCommChannels().getCommunicationChannel(ChannelType.FAX);

		if (gpFax != null && gpFax.getCommValueIsNotNull())
		{
			form.txtFax().setValue(gpFax.toString());
			form.lblFax().setValue("GP Fax:");
		}
		else if (practiceFax != null && practiceFax.getCommValueIsNotNull())
		{
			form.txtFax().setValue(practiceFax.toString());
			form.lblFax().setValue("Practice Fax:");
		}
		else
			form.lblFax().setValue("Practice Fax:");
	}
}
 
Example 38
Project: AvoinApotti   File: DemographicsImpl.java   Source Code and License 5 votes vote down vote up
private String getMappingForGp(GpShortVo gp)
{
	if(gp != null && gp.getCodeMappingsIsNotNull())
		return gp.getCodeMappings().getMappingValue(TaxonomyType.PAS);

	return "";
}
 
Example 39
Project: AvoinApotti   File: DemographicsImpl.java   Source Code and License 5 votes vote down vote up
private GpToPracticesVoCollection newGpToPracticesCollectionFromDTORecord(Gp_practiceRecord gp_practice_record, GpShortVo voGP )
{
	GpToPracticesVo voGpToPractice = new GpToPracticesVo();
	voGpToPractice.setGp(voGP);
	voGpToPractice.setGpCode(gp_practice_record.Gp_code);
	// TODO voGpToPractice.setPractice(voGPPractice);
	voGpToPractice.setIsPrimaryPractice(Boolean.TRUE);
	GpToPracticesVoCollection voCollGpToPractices = new GpToPracticesVoCollection();
	voCollGpToPractices.add(voGpToPractice);
	return voCollGpToPractices;
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onCmbSourceOfReferralValueChanged() throws PresentationLogicException
{
	form.txtReferralGP().setValue(null);
	form.txtOther().setValue(null);
	
	if (!ReferredBy.GP.equals(form.cmbSourceOfReferral().getValue()))
	{
		form.txtReferralGP().setValue(null);
		form.imbReferralGP().setTooltip("Find and Select GP");//WDEV-17297
	}
	
	if (!ReferredBy.OTHER.equals(form.cmbSourceOfReferral().getValue()))
	{
		form.txtOther().setValue(null);
		form.imbReferralGP().setTooltip("Find and Select GP");//WDEV-17297
	}

	if (ReferredBy.GP.equals(form.cmbSourceOfReferral().getValue()) && form.txtReferralGP().getValue() == null)
	{
		GpShortVo gpShortVo = domain.getGpPatient(form.getGlobalContext().Core.getPatientShort());
		form.getLocalContext().setSelectedGp(gpShortVo);
		if (gpShortVo != null)
		{
			form.txtReferralGP().setValue(gpShortVo.getNameIsNotNull() ? gpShortVo.getName().toString() : "");
			form.imbReferralGP().setTooltip(getReferalGpTooltip(gpShortVo));
		}
	}
	
	updateControlState();
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void setValue(ValueObject rowValue)
{

	form.getLocalContext().setSelectedRow(rowValue);

	if (rowValue instanceof AttendanceDetailsVo)
	{
		getAndDisplayRecord(rowValue);

		form.getLocalContext().setSelectedRecord((AttendanceDetailsVo) rowValue);
		form.getLocalContext().setSelectedEmergencyEpisode(domain.getEmergencyEpisode(form.getLocalContext().getSelectedRecord().getEmergencyEpisode()));

		// form.getLocalContext().setSelectedEmergencyEpisode((EpisodeDetailsVo) selectedRow.getParentRow().getValue());
		// form.getLocalContext().setSelectedRecord((AttendanceDetailsVo) selectedRow.getValue());

		form.getGlobalContext().Core.setCurrentCareContext(form.getLocalContext().getSelectedRecord().getCareContext());
		form.getGlobalContext().Emergency.setCurrentEmergencyAttendance((AttendanceDetailsVo) rowValue);

		if (form.getLocalContext().getSelectedEmergencyEpisodeIsNotNull() && form.getLocalContext().getSelectedEmergencyEpisode().getReferringGPIsNotNull())
		{
			GpShortVo gp = new GpShortVo();
			gp.setID_Gp(form.getLocalContext().getSelectedEmergencyEpisode().getReferringGP().getID_Gp());
			// form.getGlobalContext().Core.setGPDetails(gp);
			form.getLocalContext().setSelectedGp(gp); // wdev-14420
		}
	}
	else if (rowValue instanceof EpisodeDetailsVo)
	{
		getAndDisplayRecord(rowValue);
		form.getLocalContext().setSelectedEmergencyEpisode((EpisodeDetailsVo) rowValue);
	}

	updateControlState();
}
 
Example 42
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected GpShortVo populateGPVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		GpShortVo gp = gpAdmin.getGPByTaxonomyType(pasCode, taxType);
		return gp;
	}
	return null;
}
 
Example 43
Project: AvoinApotti   File: ReferralWizardImpl.java   Source Code and License 5 votes vote down vote up
public GpShortVo getPatientsGp(Integer idPatient)
	{
//		DomainFactory factory = getDomainFactory();
		ims.core.patient.domain.objects.Patient pat=null;
//		IMSCriteria imsc=new IMSCriteria(Patient.class,factory);
//		imsc.equal("this.id", idPatient);
//		List patients=imsc.find();
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" from Patient where "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + "id = :patient");
			markers.add("patient");
		values.add(idPatient);
			

		List patients = factory.find(hql.toString(), markers,values);
		if (patients!=null && patients.size()>0)
		{
			pat=(ims.core.patient.domain.objects.Patient) patients.get(0);
			if (pat.getGp()!=null)
				return GpShortVoAssembler.create(pat.getGp());
			else
				return null;
		}
		return null;
	}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onQmbReferredByValueChanged() throws PresentationLogicException
{
	if (form.qmbReferredBy().getValue() instanceof GpShortVo)
	{
		loadGPsPractice((GpShortVo)form.qmbReferredBy().getValue());
	}
}
 
Example 45
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onQmbReferredByValueChanged() throws PresentationLogicException
{
	if (form.qmbReferredBy().getValue() instanceof GpShortVo)
	{
		loadGPsPractice((GpShortVo)form.qmbReferredBy().getValue());
	}
}
 
Example 46
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateGpGrid(GpShortVoCollection collection) 
{
	form.grdGps().getRows().clear();
	GpShortVo voGpPract = null;
	GenForm.grdGpsRow row = null;
	for(int i=0;i<collection.size();i++)
	{
		voGpPract = collection.get(i);
		row = form.grdGps().getRows().newRow();
		
		row.setName(voGpPract.getName().toString());
		
		if (null != voGpPract &&  voGpPract.getPracticesIsNotNull())
		{
			for (int j=0; j < voGpPract.getPractices().size(); j++)
			{					
				if (voGpPract.getPractices().get(j).getIsPrimaryPracticeIsNotNull() && 
						(voGpPract.getPractices().get(j).getIsPrimaryPractice().equals(Boolean.TRUE)) &&
							//WDEV-2725
							voGpPract.getPractices().get(j).getPracticeIsNotNull() &&
								voGpPract.getPractices().get(j).getPractice().getAddressIsNotNull())
				{
					row.setAddress(voGpPract.getPractices().get(j).getPractice().getAddress().toDisplayString());
					break;					
				}
			}
		}
		if (voGpPract.getStatusIsNotNull())
			row.setStatus(voGpPract.getStatus().toString());
		row.setValue(voGpPract);
	}
}
 
Example 47
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onGrdGPSSelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{
	//populate control details
	GenForm.grdGpsRow row = form.grdGps().getRows().get(form.grdGps().getSelectedRowIndex());
	GpShortVo voGp = row.getValue();
	if (null == voGp)
		return;
	
	if (voGp.getPracticesIsNotNull())
	{
		//WDEV-2725
		if (row.getValue().getPractices().get(0).getPracticeIsNotNull() &&
				row.getValue().getPractices().get(0).getPractice().getAddressIsNotNull())
		{
			form.txtGPAddress1().setValue(row.getValue().getPractices().get(0).getPractice().getAddress().getLine1());
			form.txtGPAddress2().setValue(row.getValue().getPractices().get(0).getPractice().getAddress().getLine2());
			form.txtGPAddress3().setValue(row.getValue().getPractices().get(0).getPractice().getAddress().getLine3());
			form.txtGPAddress4().setValue(row.getValue().getPractices().get(0).getPractice().getAddress().getLine4());
		}
	}
	
	// TODO form.txtGPLocation().setValue(row.getValue().get)
	
	if (voGp.getNameIsNotNull())
		form.txtGPName().setValue(voGp.getName().toString());
	
	form.txtGPPhone().setValue(row.getValue().getMobile());
	
	form.btnSelectGP().setVisible(true);
	form.btnSelectGP().setEnabled(true);
	
}
 
Example 48
Project: openmaxims-linux   File: DemographicsImpl.java   Source Code and License 5 votes vote down vote up
private String getMappingForGp(GpShortVo gp)
{
	if(gp != null && gp.getCodeMappingsIsNotNull())
		return gp.getCodeMappings().getMappingValue(TaxonomyType.PAS);

	return "";
}
 
Example 49
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setPracticePhoneAndFax(OrganisationWithSitesVo practice)
{
	if (practice.getCommChannelsIsNotNull()) //WDEV-16051
	{
		GpShortVo gp = form.getGlobalContext().Core.getGPDetails();
		// WORK PHONE
		CommChannelVo gpWorkPhone = gp.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE);
		CommChannelVo practiceWorkPhone = practice.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE);

		if (gpWorkPhone != null && gpWorkPhone.getCommValueIsNotNull())
		{
			form.txtPhone().setValue(gpWorkPhone.toString());
			form.lblPhone().setValue("GP Phone:");
		}
		else if (practiceWorkPhone != null && practiceWorkPhone.getCommValueIsNotNull())
		{
			form.txtPhone().setValue(practiceWorkPhone.toString());
			form.lblPhone().setValue("Practice Phone:");
		}
		else
			form.lblPhone().setValue("Practice Phone:");

		// FAX NUMBER
		CommChannelVo gpFax = gp.getCommChannels().getCommunicationChannel(ChannelType.FAX);
		CommChannelVo practiceFax = practice.getCommChannels().getCommunicationChannel(ChannelType.FAX);

		if (gpFax != null && gpFax.getCommValueIsNotNull())
		{
			form.txtFax().setValue(gpFax.toString());
			form.lblFax().setValue("GP Fax:");
		}
		else if (practiceFax != null && practiceFax.getCommValueIsNotNull())
		{
			form.txtFax().setValue(practiceFax.toString());
			form.lblFax().setValue("Practice Fax:");
		}
		else
			form.lblFax().setValue("Practice Fax:");
	}
}
 
Example 50
Project: openMAXIMS   File: PdsDomainHelperImpl.java   Source Code and License 5 votes vote down vote up
@Override
public GpShortVo getGp(GpRefVo refVo)
{
	if(refVo == null || refVo.getID_Gp() == null)
		throw new CodingRuntimeException("GpRefVo is null or id not provided for method getGp");
	
	return GpShortVoAssembler.create((Gp) getDomainFactory().getDomainObject(refVo)); 
}
 
Example 51
Project: openMAXIMS   File: DemographicsImpl.java   Source Code and License 5 votes vote down vote up
private String getMappingForGp(GpShortVo gp)
{
	if(gp != null && gp.getCodeMappingsIsNotNull())
		return gp.getCodeMappings().getMappingValue(TaxonomyType.PAS);

	return "";
}
 
Example 52
Project: openMAXIMS   File: DemographicsImpl.java   Source Code and License 5 votes vote down vote up
private GpToPracticesVoCollection newGpToPracticesCollectionFromDTORecord(Gp_practiceRecord gp_practice_record, GpShortVo voGP )
{
	GpToPracticesVo voGpToPractice = new GpToPracticesVo();
	voGpToPractice.setGp(voGP);
	voGpToPractice.setGpCode(gp_practice_record.Gp_code);
	// TODO voGpToPractice.setPractice(voGPPractice);
	voGpToPractice.setIsPrimaryPractice(Boolean.TRUE);
	GpToPracticesVoCollection voCollGpToPractices = new GpToPracticesVoCollection();
	voCollGpToPractices.add(voGpToPractice);
	return voCollGpToPractices;
}
 
Example 53
Project: openMAXIMS   File: PDSDemographicsImpl.java   Source Code and License 5 votes vote down vote up
private GpToPracticesVoCollection newGpToPracticesCollectionFromDTORecord(Gp_practiceRecord gp_practice_record, GpShortVo voGP )
{
	GpToPracticesVo voGpToPractice = new GpToPracticesVo();
	voGpToPractice.setGp(voGP);
	voGpToPractice.setGpCode(gp_practice_record.Gp_code);
	// TODO voGpToPractice.setPractice(voGPPractice);
	voGpToPractice.setIsPrimaryPractice(Boolean.TRUE);
	GpToPracticesVoCollection voCollGpToPractices = new GpToPracticesVoCollection();
	voCollGpToPractices.add(voGpToPractice);
	return voCollGpToPractices;
}
 
Example 54
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onCmbSourceOfReferralValueChanged() throws PresentationLogicException
{
	form.txtReferralGP().setValue(null);
	form.txtOther().setValue(null);
	
	if (!ReferredBy.GP.equals(form.cmbSourceOfReferral().getValue()))
	{
		form.txtReferralGP().setValue(null);
		form.imbReferralGP().setTooltip("Find and Select GP");//WDEV-17297
	}
	
	if (!ReferredBy.OTHER.equals(form.cmbSourceOfReferral().getValue()))
	{
		form.txtOther().setValue(null);
		form.imbReferralGP().setTooltip("Find and Select GP");//WDEV-17297
	}

	if (ReferredBy.GP.equals(form.cmbSourceOfReferral().getValue()) && form.txtReferralGP().getValue() == null)
	{
		GpShortVo gpShortVo = domain.getGpPatient(form.getGlobalContext().Core.getPatientShort());
		form.getLocalContext().setSelectedGp(gpShortVo);
		if (gpShortVo != null)
		{
			form.txtReferralGP().setValue(gpShortVo.getNameIsNotNull() ? gpShortVo.getName().toString() : "");
			form.imbReferralGP().setTooltip(getReferalGpTooltip(gpShortVo));
		}
	}
	
	updateControlState();
}
 
Example 55
Project: openMAXIMS   File: PDSPatientSearchImpl.java   Source Code and License 5 votes vote down vote up
@Override
public GpShortVo getGP(GpRefVo ref) {
	if (ref != null)
	{	
		Gp gp = (Gp) getDomainFactory().getDomainObject(Gp.class,ref.getID_Gp());
		GpShortVo voGp = GpShortVoAssembler.create(gp);
		return voGp;
	}
	return null;
}
 
Example 56
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onCmbSourceOfReferralValueChanged() throws PresentationLogicException
{
	form.txtReferralGP().setValue(null);
	form.txtOther().setValue(null);
	
	if (!ReferredBy.GP.equals(form.cmbSourceOfReferral().getValue()))
	{
		form.txtReferralGP().setValue(null);
		form.imbReferralGP().setTooltip("Find and Select GP");//WDEV-17297
	}
	
	if (!ReferredBy.OTHER.equals(form.cmbSourceOfReferral().getValue()))
	{
		form.txtOther().setValue(null);
		form.imbReferralGP().setTooltip("Find and Select GP");//WDEV-17297
	}

	if (ReferredBy.GP.equals(form.cmbSourceOfReferral().getValue()) && form.txtReferralGP().getValue() == null)
	{
		GpShortVo gpShortVo = domain.getGpPatient(form.getGlobalContext().Core.getPatientShort());
		form.getLocalContext().setSelectedGp(gpShortVo);
		if (gpShortVo != null)
		{
			form.txtReferralGP().setValue(gpShortVo.getNameIsNotNull() ? gpShortVo.getName().toString() : "");
			form.imbReferralGP().setTooltip(getReferalGpTooltip(gpShortVo));
		}
	}
	
	updateControlState();
}
 
Example 57
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public void setValue(ValueObject rowValue)
{

	form.getLocalContext().setSelectedRow(rowValue);

	if (rowValue instanceof AttendanceDetailsVo)
	{
		getAndDisplayRecord(rowValue);

		form.getLocalContext().setSelectedRecord((AttendanceDetailsVo) rowValue);
		form.getLocalContext().setSelectedEmergencyEpisode(domain.getEmergencyEpisode(form.getLocalContext().getSelectedRecord().getEmergencyEpisode()));

		// form.getLocalContext().setSelectedEmergencyEpisode((EpisodeDetailsVo) selectedRow.getParentRow().getValue());
		// form.getLocalContext().setSelectedRecord((AttendanceDetailsVo) selectedRow.getValue());

		form.getGlobalContext().Core.setCurrentCareContext(form.getLocalContext().getSelectedRecord().getCareContext());
		form.getGlobalContext().Emergency.setCurrentEmergencyAttendance((AttendanceDetailsVo) rowValue);

		if (form.getLocalContext().getSelectedEmergencyEpisodeIsNotNull() && form.getLocalContext().getSelectedEmergencyEpisode().getReferringGPIsNotNull())
		{
			GpShortVo gp = new GpShortVo();
			gp.setID_Gp(form.getLocalContext().getSelectedEmergencyEpisode().getReferringGP().getID_Gp());
			// form.getGlobalContext().Core.setGPDetails(gp);
			form.getLocalContext().setSelectedGp(gp); // wdev-14420
		}
	}
	else if (rowValue instanceof EpisodeDetailsVo)
	{
		getAndDisplayRecord(rowValue);
		form.getLocalContext().setSelectedEmergencyEpisode((EpisodeDetailsVo) rowValue);
	}

	updateControlState();
}
 
Example 58
Project: openmaxims-linux   File: DemographicsImpl.java   Source Code and License 5 votes vote down vote up
private GpToPracticesVoCollection newGpToPracticesCollectionFromDTORecord(Gp_practiceRecord gp_practice_record, GpShortVo voGP )
{
	GpToPracticesVo voGpToPractice = new GpToPracticesVo();
	voGpToPractice.setGp(voGP);
	voGpToPractice.setGpCode(gp_practice_record.Gp_code);
	// TODO voGpToPractice.setPractice(voGPPractice);
	voGpToPractice.setIsPrimaryPractice(Boolean.TRUE);
	GpToPracticesVoCollection voCollGpToPractices = new GpToPracticesVoCollection();
	voCollGpToPractices.add(voGpToPractice);
	return voCollGpToPractices;
}
 
Example 59
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected GpShortVo populateGPVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		GpShortVo gp = gpAdmin.getGPByTaxonomyType(pasCode, taxType);
		return gp;
	}
	return null;
}
 
Example 60
Project: openMAXIMS   File: ReferralWizardImpl.java   Source Code and License 5 votes vote down vote up
public GpShortVo getPatientsGp(Integer idPatient)
	{
//		DomainFactory factory = getDomainFactory();
		ims.core.patient.domain.objects.Patient pat=null;
//		IMSCriteria imsc=new IMSCriteria(Patient.class,factory);
//		imsc.equal("this.id", idPatient);
//		List patients=imsc.find();
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" from Patient where "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + "id = :patient");
			markers.add("patient");
		values.add(idPatient);
			

		List patients = factory.find(hql.toString(), markers,values);
		if (patients!=null && patients.size()>0)
		{
			pat=(ims.core.patient.domain.objects.Patient) patients.get(0);
			if (pat.getGp()!=null)
				return GpShortVoAssembler.create(pat.getGp());
			else
				return null;
		}
		return null;
	}