Java Code Examples for ims.core.vo.MemberOfStaffShortVo

The following are top voted examples for showing how to use ims.core.vo.MemberOfStaffShortVo. 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: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo removeLinkedHcp(MemberOfStaffShortVo mosVo) throws StaleObjectException
{
	if (mosVo.getID_MemberOfStaff() == null)
	{
		throw new DomainRuntimeException("Cannot remove a HCP from a MOS with NULL id!");
	}
	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosBo = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, mosVo.getID_MemberOfStaff());
	if (mosBo.getHcp() == null)
	{
		return mosVo;
	}

	mosBo.getHcp().setIsActive(Boolean.FALSE);
	factory.save(mosBo.getHcp());
	mosBo.setHcp(null);
	mosBo.setStaffType(null);
	factory.save(mosBo);
	mosVo.setHcp(null);
	return mosVo;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onQmbReferredToTextSubmited(String value) throws PresentationLogicException 
{
	form.qmbReferredTo().clear();
	
	MemberOfStaffShortVo voMOS = new MemberOfStaffShortVo();
	PersonName personName = new PersonName();
	personName.setSurname(value);
	voMOS.setName(personName);
	voMOS.setIsActive(Boolean.TRUE);
	
	MemberOfStaffShortVoCollection coll = domain.listMembersOfStaff(voMOS);
	if(coll != null)
	{
		for (int i = 0; i < coll.size(); i++)
			form.qmbReferredTo().newRow(coll.get(i), coll.get(i).toString());			

		if (coll.size() == 1)
			form.qmbReferredTo().setValue(coll.get(0));
		else if (coll.size() > 1)
			form.qmbReferredTo().showOpened();		
	}		
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initalize() throws FormOpenException
{
	form.getLocalContext().setsuplementryLetterVisible(new Boolean(ConfigFlag.UI.DISCHARGE_LETTERS_SUPPLEMENTARY_BUTTON.getValue()));
	MemberOfStaffShortVo voMos = (MemberOfStaffShortVo) domain.getMosUser();
	if (null == voMos)
	{
		throw new FormOpenException("Current user not associated with a Member Of Staff");
	}
	else
	{
		form.getLocalContext().setloggedInMos(voMos);
	}

	// get full paseventvo
	form.getLocalContext().setpasEventVo(domain.getPasEvent(form.getGlobalContext().Core.getPasEvent()));

	if (form.getGlobalContext().Correspondence.getGenerateFormModeIsNotNull())
		form.setMode(form.getGlobalContext().Correspondence.getGenerateFormMode());

	// set caption
	// TODO
	// if (form.getGlobalContext().Core.getPasEvent().gettype == inpat)

	// String strTitle()

}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean saveCorrespondence(ims.core.vo.lookups.DocumentStatus docStatus)
{
	CorrespondenceDetailsVo voCorrespondenceDetails = form.getLocalContext().getcorrespondenceDetails();
	if (null == voCorrespondenceDetails)
		return false;

	MemberOfStaffShortVo voMos = (MemberOfStaffShortVo) domain.getMosUser();

	if (null == voMos)
		return false;

	populateDataFromScreen(voCorrespondenceDetails);

	// WDEV-2774
	// update Status History
	voCorrespondenceDetails.setCspStatusHistory(updateHistoryStatus(voCorrespondenceDetails, voCorrespondenceDetails.getCurrentStatus()));

	// update the current status
	voCorrespondenceDetails.setCurrentStatus(docStatus);

	if (!saveDocumentDetails(voCorrespondenceDetails))
		return false;

	return true;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onQmbReferredToTextSubmited(String value) throws PresentationLogicException 
{
	form.lyr().tabReferralDetails().qmbReferredTo().clear();
	
	MemberOfStaffShortVo voMOS = new MemberOfStaffShortVo();
	PersonName personName = new PersonName();
	personName.setSurname(value);
	voMOS.setName(personName);
	voMOS.setIsActive(Boolean.TRUE);
	
	MemberOfStaffShortVoCollection coll = domain.listMembersOfStaff(voMOS);
	if(coll != null)
	{
		for (int i = 0; i < coll.size(); i++)
			form.lyr().tabReferralDetails().qmbReferredTo().newRow(coll.get(i), coll.get(i).toString());			

		if (coll.size() == 1)
			form.lyr().tabReferralDetails().qmbReferredTo().setValue(coll.get(0));
		else if (coll.size() > 1)
			form.lyr().tabReferralDetails().qmbReferredTo().showOpened();		
	}		
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean testDiscipline()
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);
	
	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull())
		{
			if (fullVo.getHcp().getHcpTypeIsNotNull())
			{
				if (form.customControlAuthoring().getValue() != null 
					&& form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull() 
					&& form.customControlAuthoring().getValue().getAuthoringHcp().getHcpTypeIsNotNull())
				{
					if (form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType().equals(fullVo.getHcp().getHcpType()))
						return true;
				}					
			}				
		}
	}
	return false;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnNewClick() throws PresentationLogicException
{

	clearScreen();
	form.setMode(FormMode.EDIT);
	form.txtComments().setFocus();

	TransferNote voTran = new TransferNote();
	form.getLocalContext().setRecord(voTran);

	if (domain.getMosUser() != null)
		form.txtHCP().setValue(((MemberOfStaffShortVo) domain.getMosUser()).toString());

	form.dteRecording().setValue(new Date());
	form.timRecording().setValue(new Time());

	form.dteTransfer().setValue(new Date());
	form.timTransfer().setValue(new Time());

	form.btnUpdate().setEnabled(false);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
void makeHandlingHeaderInfoNew(Boolean bDefaultValues)
{
	if(bDefaultValues.booleanValue() == true)
	{
		form.layerControl1().screening().dateScreening().setValue(new Date());
		form.layerControl1().screening().timeScreening().setValue(new Time());
		if(domain.getMosUser() != null)
			form.layerControl1().screening().txtRecordingHcpScreening().setValue(((MemberOfStaffShortVo)domain.getMosUser()).toString());
	}
	else //null values
	{
		form.layerControl1().screening().dateScreening().setValue(null);
		form.layerControl1().screening().timeScreening().setValue(null);
		form.layerControl1().screening().txtRecordingHcpScreening().setValue(null);
	}	
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
void makeMovementHeaderInfoNew(Boolean bDefaultValues)
{
	if(bDefaultValues.booleanValue() == true)
	{
		form.layerControl1().movement().dateMovement().setValue(new Date());
		form.layerControl1().movement().timeMovement().setValue(new Time());
		if(domain.getMosUser() != null)
			form.layerControl1().movement().txtRecordingHcpMOVE().setValue(((MemberOfStaffShortVo)domain.getMosUser()).toString());				
	}
	else //null values
	{
		form.layerControl1().movement().dateMovement().setValue(null);
		form.layerControl1().movement().timeMovement().setValue(null);
		form.layerControl1().movement().txtRecordingHcpMOVE().setValue(null);
	}	
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private PainAssessmentReview getReviewVOfromFindingVO(PainAssessmentFindings pafVO)
{
	PainAssessmentReview painAssVo = getReviewRecord(pafVO);
	if(painAssVo.getID_PainAssessmentReview() == null)
		painAssVo.setID_PainAssessmentReview(pafVO.getID_PainAssessmentFindings());
	painAssVo.setDepth(pafVO.getDepth());
	painAssVo.setOnset(pafVO.getOnset());
	painAssVo.setProgression(pafVO.getProgression());
	painAssVo.setRecordingDateTime(new DateTime(form.dteRecording().getValue(), form.timRecording().getValue()));
	painAssVo.setAssessmentDateTime(new DateTime(form.dteAssessment().getValue(), form.timAssessment().getValue()));
	
	MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo)domain.getMosUser();
	if(memStaffShortVo != null && memStaffShortVo.getHcp() != null)
		painAssVo.setRecordingHCP(memStaffShortVo.getHcp());
	
	painAssVo.setSeverity(pafVO.getSeverity());
	painAssVo.setSiteDetails(pafVO.getSiteDetails());
	painAssVo.setType(pafVO.getType());
	return painAssVo;
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBNewClick() throws ims.framework.exceptions.PresentationLogicException
{
	//------- Add a new review VO and set it in the Context to be used in the dialog
	PainAssessmentReview reviewVO = new PainAssessmentReview();
	
	MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo)domain.getMosUser();
	if(memStaffShortVo != null && memStaffShortVo.getHcp() != null)
		reviewVO.setRecordingHCP(memStaffShortVo.getHcp());
	
	form.getGlobalContext().COE.PainBodyChart.setPainAssReviewVO(reviewVO);
	//------------------------------------------------------------------------------

	//set the to be used in the Review dialog
	form.getGlobalContext().COE.PainBodyChart.setReviewPage(new Boolean(true));
	//Open the dialog
	engine.open(form.getForms().Nursing.PainReviewDialog);
}
 
Example 12
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo deactivateMos(MemberOfStaffShortVo mosVo) throws StaleObjectException
{
	if (mosVo.getID_MemberOfStaff() == null)
	{
		throw new DomainRuntimeException("Cannot Activate/Deactivate an MOS with NULL id!");
	}
	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosBo = MemberOfStaffShortVoAssembler.extractMemberOfStaff(getDomainFactory(), mosVo);
	mosBo.setIsActive(!(Boolean.TRUE.equals(mosBo.isIsActive())));
	
	if (mosBo.getHcp() != null)
	{
		mosBo.getHcp().setIsActive(mosBo.isIsActive());
	}
	

	factory.save(mosBo);

	return MemberOfStaffShortVoAssembler.create(mosBo);
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onDyngrdCollectCellTextSubmited(DynamicGridCell cell)
{
	if (cell.getColumn().equals(getColumn(QUERY_COL)))
	{
		cell.getItems().clear();
		String value = cell.getTypedText();
		PersonName name = new PersonName();
		MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
		name.setSurname(value);
		filter.setIsActive(Boolean.TRUE);
		filter.setName(name);
		MemberOfStaffShortVoCollection voColl = domain.listMembersOfStaff(filter);
		for (int i = 0; i < voColl.size(); i++)
		{
			cell.getItems().newItem(voColl.get(i));
		}
		int cellItemSize = cell.getItems().size();
		if (cellItemSize > 0)
		{
			if (cellItemSize == 1)
				cell.setValue(cell.getItems().get(0));
			cell.showOpened();
		}
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean testDiscipline()
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);
	
	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull())
		{
			if (fullVo.getHcp().getHcpTypeIsNotNull())
			{
				if (form.customControlAuthoring().getValue() != null &&
						form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull() &&
							form.customControlAuthoring().getValue().getAuthoringHcp().getHcpTypeIsNotNull())
				{
					if (form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType().equals(fullVo.getHcp().getHcpType()))
						return true;
				}					
			}				
		}
	}
	return false;
}
 
Example 15
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public HcpCollection listHcps(HcpFilter filter)
{
	if (filter.getQueryName() == null)
	{			
		MemberOfStaffShortVo voMos = new MemberOfStaffShortVo();
		voMos.setStaffType(StaffType.HCP);
		MemberOfStaffShortVoCollection coll = this.listMembersOfStaff(voMos);			
		HcpCollection voCollHcp = new HcpCollection();
		
		for (int i = 0; i < coll.size(); i++) 
		{
			MemberOfStaffShortVo voLocalMos = coll.get(i);
			voCollHcp.add(voLocalMos.getHcp());				
		}
		return voCollHcp;
	}
	else
	{
		HcpAdmin hcpAdmin = (HcpAdmin) getDomainImpl(HcpAdminImpl.class);
		return hcpAdmin.listHCPs(filter);
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean testOpDiscipline()
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo) domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull())
		{
			if (fullVo.getHcp().getHcpTypeIsNotNull())
			{
				if (form.lyrTabs().tabOPDNote().customControlOPAuthoring().getValue() != null && form.lyrTabs().tabOPDNote().customControlOPAuthoring().getValue().getAuthoringHcpIsNotNull() && form.lyrTabs().tabOPDNote().customControlOPAuthoring().getValue().getAuthoringHcp().getHcpTypeIsNotNull())
				{
					if (form.lyrTabs().tabOPDNote().customControlOPAuthoring().getValue().getAuthoringHcp().getHcpType().equals(fullVo.getHcp().getHcpType()))
						return true;
				}
			}
		}
	}
	return false;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean testDiscipline(ClinicalNotesShortVo voNote)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);
	
	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull())
		{
			if (fullVo.getHcp().getHcpTypeIsNotNull())
			{
				if (voNote.getAuthoringInfoIsNotNull() &&
						voNote.getAuthoringInfo().getAuthoringHcpIsNotNull() &&
							voNote.getAuthoringInfo().getAuthoringHcp().getHcpTypeIsNotNull())
				{
					if (voNote.getAuthoringInfo().getAuthoringHcp().getHcpType().equals(fullVo.getHcp().getHcpType()))
						return true;
				}
			}
		}
	}
	return false;
}
 
Example 18
Project: AvoinApotti   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCNNatCode(MemberOfStaffShortVo mos, XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: entry");

	if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(mos.getName().getForename());
	if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
	if(mos!=null&&mos.getNationalConsCode()!=null)
	{
		xcn.getIDNumber().setValue(mos.getNationalConsCode());
	}
	else if(mos!=null)
	{
		TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
		if (mapping != null)
		{
			xcn.getIDNumber().setValue(mapping.getTaxonomyCode());			
		}
	}
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: exit");

}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addMosToGrid(MemberOfStaffShortVoCollection memberOfStaffShortVoCollection)
{
	for(int i = 0; i < memberOfStaffShortVoCollection.size(); i++)
	{
		MemberOfStaffShortVo mosVo = memberOfStaffShortVoCollection.get(i);
		if(isAddedToGrid(mosVo) == false)
		{
			grdRecipientsRow row = form.lyrDetails().tabRecipents().grdRecipients().getRows().newRow();
			ClinicalCorrespondenceRecipientsVo recipient = new ClinicalCorrespondenceRecipientsVo();
			
			recipient.setMemberOfStaff(mosVo);
			recipient.setPatient(Boolean.FALSE);
			
			row.setValue(recipient);
			row.setcolName(getMosText(mosVo));
			row.setcolPrimary(false);
		}
	}
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onQmbMosValueChanged() throws PresentationLogicException 
{
	if (form.qmbMos().getValue()!=null)
	{
		MemberOfStaffShortVo mos = form.qmbMos().getValue();
		if (mos.getCommChannelsIsNotNull())
			for (int i=0;i<mos.getCommChannels().size();i++)
			{
				if (mos.getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL))
				{
					form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo()));
				}
			}
		form.lnkEmailAccountInfo().setEnabled(true);
	}
	
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean selectMosFromGlobalContext() throws PresentationLogicException
{
	// if there is a MOS id in global context populated in WorkQueue
	// then we select it and display its details
	Integer targetId = form.getGlobalContext().NTPF.getTargetObjectId();
	if (targetId == null)
		return false;

	form.getLocalContext().setShowLinkBack(Boolean.TRUE);
	form.getLocalContext().setPreviousForm(getPreviousForm());
	// MemberOfStaffShortVo filterVo = new MemberOfStaffShortVo();
	// filterVo.setID_MemberOfStaff(targetId);
	populateMosTree();

	if (form.lyrLHS().tabMos().treMemberOfStaff().getNodes().size() == 1)
	{
		TreeNode mosNode = form.lyrLHS().tabMos().treMemberOfStaff().getNodes().get(0);
		MemberOfStaffShortVo voMosShort = (MemberOfStaffShortVo) form.lyrLHS().tabMos().treMemberOfStaff().getNodes().get(0).getValue();

		onTreMemberOfStaffTreeViewSelectionChanged(mosNode);
		form.lyrLHS().tabMos().treMemberOfStaff().setValue(voMosShort);
		onContextMenuItemClick(GenForm.ContextMenus.MosOrganisation.EDIT, form.lyrLHS().tabMos().treMemberOfStaff());
	}

	return false;
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void clearMosNodes(TreeNode node)
{
	TreeNode childNode;
	ArrayList l = new ArrayList();
	for (int i = 0; i < node.getNodes().size(); i++)
	{
		childNode = node.getNodes().get(i);
		if (childNode.getValue() instanceof MemberOfStaffShortVo)
		{
			l.add(childNode);
		}
	}
	for (int i = 0; i < l.size(); i++)
	{
		node.getNodes().remove((TreeNode) l.get(i));
	}
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean testDiscipline()
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);
	
	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull())
		{
			if (fullVo.getHcp().getHcpTypeIsNotNull())
			{
				if (form.customControlAuthoring().getValue() != null &&
						form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull() &&
							form.customControlAuthoring().getValue().getAuthoringHcp().getHcpTypeIsNotNull())
				{
					if (form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType().equals(fullVo.getHcp().getHcpType()))
						return true;
				}					
			}				
		}
	}
	return false;
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onImbSetLocsClick() throws PresentationLogicException
{
	MemberOfStaffShortVo voMos = form.getGlobalContext().Admin.getSelectedMos();

	populateMosVoFromScreen(voMos);// Need to ensure StaffType is set wdev-3971

	if (voMos != null)
	{
		form.getLocalContext().setbAdding(Boolean.FALSE);
		if (voMos.getID_MemberOfStaffIsNotNull())
		{
			MemberOfStaffVo voCouldContainsUnsavedLocationAccreditationMos = form.getGlobalContext().Admin.getSelectedMos();
			//setContextVariables(voMos); WDEV-16222
			mergeSavedAccreditation(voCouldContainsUnsavedLocationAccreditationMos);
		}

		if (ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
			engine.open(form.getForms().Admin.MOSHospitalAccreditationDialog);
		else
			engine.open(form.getForms().Admin.MosOrganisationDlg, new Object[]{Boolean.FALSE});
	}
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onQmbMemberOfStaffTextSubmited(String value) throws PresentationLogicException
{
	if (value != null)
	{
		MemberOfStaffShortVo voMemberOfStaffFilter = new MemberOfStaffShortVo();
		PersonName name = new PersonName();
		name.setSurname(value);
		voMemberOfStaffFilter.setName(name);
		voMemberOfStaffFilter.setIsAppUser(new Boolean(true));

		MemberOfStaffShortVoCollection voCollMemberOfStaff = domain.listStaff(voMemberOfStaffFilter);

		voCollMemberOfStaff.sort();
		form.lyrActivity().tabNtpf().qmbMemberOfStaff().clear();
		for (int i = 0; i < voCollMemberOfStaff.size(); i++)
		{
			form.lyrActivity().tabNtpf().qmbMemberOfStaff().newRow(voCollMemberOfStaff.get(i), voCollMemberOfStaff.get(i).getName().getForename() + " " + voCollMemberOfStaff.get(i).getName().getSurname());
		}
		if (voCollMemberOfStaff.size() == 1)
			form.lyrActivity().tabNtpf().qmbMemberOfStaff().setValue(voCollMemberOfStaff.get(0));
		else if (voCollMemberOfStaff.size() > 1)
			form.lyrActivity().tabNtpf().qmbMemberOfStaff().showOpened();
	}

}
 
Example 26
Project: AvoinApotti   File: MosSearchImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVoCollection listMembersOfStaffWithPrimaryLocations(MemberOfStaffShortVo filter)
{
	List mosList = listDomMos(filter);
	MemberOfStaffVoCollection voCollMos = MemberOfStaffVoAssembler.createMemberOfStaffVoCollectionFromMemberOfStaff(mosList);
	MemberOfStaffShortVoCollection voCollReturn = new MemberOfStaffShortVoCollection();
	if (voCollMos != null)
	{
		for (int i = 0; i < voCollMos.size(); i++)
		{
			MemberOfStaffShortVo voShortMos = new MemberOfStaffShortVo();
			voShortMos = voCollMos.get(i);
			for (int j = 0; j < voCollMos.get(i).getLocations().size(); j++)
			{
				if ( voCollMos.get(i).getLocations().get(j).getIsPrimary() != null &&
					 voCollMos.get(i).getLocations().get(j).getIsPrimary().equals(Boolean.TRUE))
					voShortMos.setPrimaryLocation(voCollMos.get(i).getLocations().get(j).getLocation());
			}
			voCollReturn.add(voShortMos);
		}
	}

	return voCollReturn;
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
	protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException
	{
		form.setMode(FormMode.EDIT);
		form.lyr().tabReferralDetails().qmbReferredBy().setEnabled(true);
		form.lyr().tabReferralDetails().cmbLocations().setEnabled(true);
		
		clearScreen();
		form.lyr().showtabReferralDetails();
		form.getLocalContext().setSelectedReferral(new ReferralsRecordingVo());
//		form.customControlAuthoringInfo().initializeComponent();
		if (engine.getLoggedInUser().getMosId() != null)
		{
			MemberOfStaffRefVo voRef = new MemberOfStaffRefVo();
			voRef.setID_MemberOfStaff(engine.getLoggedInUser().getMosId());
			MemberOfStaffShortVo voMOSShort = domain.getMemberOfStaff(voRef);
			form.lyr().tabReferralDetails().txtRecordingUser().setValue(voMOSShort.getNameIsNotNull() ? (voMOSShort.getName().getTitleIsNotNull() ? voMOSShort.getName().getTitle() : "" )+ " " + voMOSShort.getName().getForename() + " " + voMOSShort.getName().getSurname() : "");
			
			form.getLocalContext().setLoggedInMOS(voMOSShort);
		}
		
		form.lyr().tabReferralDetails().dtimRecordingDate().setValue(new DateTime());//getAuthoringInfo());

		if (form.getLocalContext().getUserAssessmentVo() != null)
		{
			PatientAssessmentVo voPatientAssessmentVo = populatePatientAssessmentFromUserAssessmentShort(form.getLocalContext().getUserAssessmentVo());
			form.lyr().tabAssessment().customControlAssessment().setPatientAssessment(voPatientAssessmentVo);
		}
		
	}
 
Example 28
Project: AvoinApotti   File: CancerreferralDetailsImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffShortVo getMemberOfStaff(MemberOfStaffRefVo mosRefVo) 
{
	MosAdmin mosadm = (MosAdmin) getDomainImpl(MosAdminImpl.class);
	MemberOfStaffShortVo mosVo = new MemberOfStaffShortVo();
	mosVo.setID_MemberOfStaff(mosRefVo.getID_MemberOfStaff());
	return mosadm.getMemberOfStaff(mosVo);
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onQmbDictatedByTextSubmited(String value) throws PresentationLogicException {
	form.qmbDictatedBy().clear();
	
	if (value != null)
	{
		MemberOfStaffShortVo  mos = null;
		MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
		PersonName personName = new PersonName();
		personName.setSurname(value);
		filter.setName(personName);
		filter.setIsActive(Boolean.TRUE);
		MemberOfStaffShortVoCollection voMemberOfStaffShortColl = domain.listMembersOfStaff(filter);
		if (voMemberOfStaffShortColl != null)
		{
			for (int i = 0; i < voMemberOfStaffShortColl.size(); i++)
			{
				mos = voMemberOfStaffShortColl.get(i);
				form.qmbDictatedBy().newRow(mos, mos.toString());			
			}
		}
		if (voMemberOfStaffShortColl != null &&
				voMemberOfStaffShortColl.size() == 1)
						form.qmbDictatedBy().setValue(voMemberOfStaffShortColl.get(0));
		else if (voMemberOfStaffShortColl != null &&
				voMemberOfStaffShortColl.size() > 1)
						form.qmbDictatedBy().showOpened();
		
		Integer id = engine.getLoggedInUser().getMosId();
		if (mos != null && id != null &&id.equals(mos.getID_MemberOfStaff()))
			form.qmbDictatedBy().setValue(mos);
	}
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onQmbChangingUserTextSubmited(String value) throws PresentationLogicException
{
	form.qmbChangingUser().clear();
	MemberOfStaffShortVo voMemberOfStaffFilter = new MemberOfStaffShortVo();
	PersonName name = new PersonName();
	name.setSurname(value);
	voMemberOfStaffFilter.setName(name);
	voMemberOfStaffFilter.setIsAppUser(new Boolean(true));
	voMemberOfStaffFilter.setIsActive(Boolean.TRUE);
	MemberOfStaffShortVoCollection voColl = null;
	try 
	{
		voColl = domain.listMembersOfStaff(voMemberOfStaffFilter);
	} 
	catch (DomainInterfaceException e) 
	{
		engine.showMessage(e.getMessage());
		return;
	}

	for (int i = 0 ; voColl != null && i < voColl.size() ;i++)
		form.qmbChangingUser().newRow(voColl.get(i),  voColl.get(i).getNameIsNotNull() ? voColl.get(i).getName().toString() : "");

	if (voColl == null || voColl.size() == 0)
	{
		engine.showMessage("No Members of Staff found for you search criteria.", "No Data Found", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	
	if (voColl.size() == 1)
		form.qmbChangingUser().setValue(voColl.get(0));
	else if (voColl.size() > 1)
		form.qmbChangingUser().showOpened();
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo)fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;
			}
		}
		else
		{
			if (form.customControlAuthoring().getValue()!=null
					&& form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull())
				clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
			else
			{
				engine.showMessage("No Discipline is available. Please choose an authoring user.");
				return null;
			}
		}
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
	return mos;
}
 
Example 32
Project: AvoinApotti   File: DocumentDetailsInitialiser.java   Source Code and License 5 votes vote down vote up
private void initializeCorrespondenceDetails(MemberOfStaffShortVo voMos)
{		
	if (null == voMos)
	{
		m_strError = "Member of Staff details not supplied.";			
		m_CorrespondenceDetails = null;
	}
	
	//Set PasEventVo
	m_CorrespondenceDetails.setPasEvent(m_PasEvent);

	CorrespondenceStatusHistoryVoCollection voCollStatusHistory = new CorrespondenceStatusHistoryVoCollection();
	CorrespondenceStatusHistoryVo voStatusHistory = new CorrespondenceStatusHistoryVo();
	voStatusHistory.setStatus(DocumentStatus.LETTERREQUIRED);
	voStatusHistory.setTemplateName(StatusHelper.getGenericTemplateName());
	voStatusHistory.setMos(voMos);//wdev-2677
	
	voCollStatusHistory.add(voStatusHistory);			
	m_CorrespondenceDetails.setCspStatusHistory(voCollStatusHistory);
	
	//Initialise the current document
	DocumentVo voCurrentDocument = new DocumentVo();											
	voCurrentDocument.setStatus(DocumentStatus.LETTERREQUIRED);
	voCurrentDocument.setPatient(m_PasEvent.getPatient());	
	
	//TODO Review
	voCurrentDocument.setClinicalContact(null);
	
	m_CorrespondenceDetails.setCurrentDocument(voCurrentDocument);
	
}
 
Example 33
Project: AvoinApotti   File: BatchUpdatePatientListsImpl.java   Source Code and License 5 votes vote down vote up
public void saveInpatientEpisodes(InpatientEpisodeVoCollection collInpatientEpisodeVo, MemberOfStaffShortVo mos) throws DomainInterfaceException, StaleObjectException {
	for(int i=0; i<collInpatientEpisodeVo.size(); i++){
		if (!collInpatientEpisodeVo.get(i).isValidated())
		{
			throw new DomainRuntimeException("Episode VO has not been validated!");
		}
	
		DomainFactory factory = getDomainFactory();		
		InpatientEpisode ipDo = InpatientEpisodeVoAssembler.extractInpatientEpisode(factory, collInpatientEpisodeVo.get(i));
		
		factory.save(ipDo);
		saveDocumentStatus(collInpatientEpisodeVo.get(i).getPasEvent().getCspDocumentStatus(), collInpatientEpisodeVo.get(i).getPasEvent(), mos);
	}
}
 
Example 34
Project: AvoinApotti   File: BatchUpdatePatientListsImpl.java   Source Code and License 5 votes vote down vote up
public void saveDischargeEpisodes(DischargedEpisodeVoCollection collDischargedEpisodeVo, MemberOfStaffShortVo mos) throws DomainInterfaceException, StaleObjectException {
	for(int i=0; i<collDischargedEpisodeVo.size(); i++){
		if (!collDischargedEpisodeVo.get(i).isValidated())
		{
			throw new DomainRuntimeException("Episode VO has not been validated!");
		}
	
		DomainFactory factory = getDomainFactory();		
		DischargedEpisode diDo = DischargedEpisodeVoAssembler.extractDischargedEpisode(factory, collDischargedEpisodeVo.get(i));
		
		factory.save(diDo);
		saveDocumentStatus(collDischargedEpisodeVo.get(i).getPasEvent().getCspDocumentStatus(), collDischargedEpisodeVo.get(i).getPasEvent(), mos);
	}		
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateControls()
{		
	//Prepopulate Controls
	if(domain.getMosUser() != null)
		form.textBoxHCP().setValue(((MemberOfStaffShortVo)domain.getMosUser()).toString());
			
	form.dateAssess().setValue(new Date());
	form.timeAssess().setValue(new Time());
	form.chkSkinIntact().setValue(false);
	
	//Save the previous Assessment
	form.getLocalContext().setPreviousSkinAssessment(form.getGlobalContext().COE.SkinBodyChart.getSkinAssessmentVO());
	
	SkinAssessment skinAssVO = new SkinAssessment();
	DrawingImageVersionVo drawingVO =  new DrawingImageVersionVo();
	//Set the Current Image Name & Version No
	drawingVO.setImageName(getCurrentImageName());
	if(getCurrentVersionNumber() != null)
		drawingVO.setVersionNumber(getCurrentVersionNumber());
	skinAssVO.setImageVersion(drawingVO);
	
	skinAssVO.setSkinAssessmentFindings(new SkinAssessmentFindingsCollection());
	//Copy the previous Findings
	getPreviousFindings(skinAssVO);
	
	//Set back to the context the SkinAssVO
	form.getGlobalContext().COE.SkinBodyChart.setSkinAssessmentVO(skinAssVO);
	form.bNew().setEnabled(false);
	form.setMode(FormMode.EDIT);
	
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setButtonsCorrectMode()
{
	form.setMode(FormMode.EDIT);

	form.labelCorrectionReason().setVisible(true);
	form.textBoxCorrectionReason().setVisible(true);
	form.checkBoxCorrection().setVisible(true);
	form.labelCorrectionConfirmed().setVisible(true);
	form.checkBoxCorrection().setEnabled(true);
	form.labelCorrectionConfirmed().setEnabled(true);
	form.chkHospitalReport().setEnabled(false);
	form.labelCorrectionReason().setVisible(true);
	form.textBoxClinicalNotes().setEnabled(false);
	form.textBoxCorrectionReason().setEnabled(true);
	form.bCorrection().setVisible(false);
	form.bNew().setVisible(false);
	form.bSave().setVisible(true);//WDEV-14976
	form.bSave().setEnabled(true);
	form.bCancel().setEnabled(true);

	form.dateNote().setValue(new ims.framework.utils.Date());

	MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo) domain.getMosUser();
	if (memStaffShortVo != null && memStaffShortVo.getHcp() != null)
	{
		form.getLocalContext().setCurrentHcp(domain.getHcpLite(memStaffShortVo.getHcp().getID_Hcp()));
		form.textBoxHCP().setValue((memStaffShortVo).toString());
	}
	else
		form.getLocalContext().setCurrentHcp(null);

	form.timeNote().setValue(new ims.framework.utils.Time());
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setDefaultMosValue(DynamicGridCell cell)
{
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo) domain.getMosUser();
	if (mos != null && mos.getNameIsNotNull())
	{
		cell.getItems().newItem(mos);
		cell.setValue(mos);
	}
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateScreen()
{
	DateTime now = new DateTime(new Date(), new Time());
	
	//Prepopulate Controls----------------------------------------------------
	if(domain.getMosUser() != null)
		form.txtBoxHCP().setValue(((MemberOfStaffShortVo)domain.getMosUser()).toString());
			
	form.dteAssessment().setValue(new Date());
	form.timAssessment().setValue(new Time());
	form.dteRecording().setValue(new Date());
	form.timRecording().setValue(new Time());
	//-------------------------------------------------------------------------
	
	//Save previous PainAssessment
	form.getLocalContext().setPreviousPainAssessment(form.getGlobalContext().COE.PainBodyChart.getPainAssessmentVO());
	
	PainAssessment painAssessmentVO = new PainAssessment();
	painAssessmentVO.setAssessmentDateTime(now);
	painAssessmentVO.setDateTimeInitiated(now);

	Object hcpLite = domain.getHcpLiteUser();
	painAssessmentVO.setHcpInitiated(hcpLite != null ? ((HcpLiteVo)hcpLite) : null);
	
	painAssessmentVO.setSiteDetails(new PainAssessmentFindingsCollection());
	
	DrawingImageVersionVo versionNoVo = new DrawingImageVersionVo();
	versionNoVo.setImageName(getCurrentImageName());
	if(getCurrentVersionNumber() != null)
		versionNoVo.setVersionNumber(getCurrentVersionNumber());
	painAssessmentVO.setImageVersion(versionNoVo);
	//Copy the previous Active(Not Discontinued) Findings
	copyPreviousFindings(painAssessmentVO);
	
	//Add a new VO
	form.getGlobalContext().COE.PainBodyChart.setPainAssessmentVO(painAssessmentVO);

}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBNewClick() throws ims.framework.exceptions.PresentationLogicException
{
	form.getGlobalContext().COE.SkinBodyChart.setReviewDialog(new Boolean(true));
	SkinAssessmentReview skinAssReviewVO = new SkinAssessmentReview();
	
	MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo)domain.getMosUser();
	if(memStaffShortVo != null && memStaffShortVo.getHcp() != null)
		skinAssReviewVO.setHCPReview(memStaffShortVo.getHcp());

	skinAssReviewVO.setDateTimeReview(new DateTime(new Date(), new Time()));
	form.getGlobalContext().COE.SkinBodyChart.setReviewVO(skinAssReviewVO);
	engine.open(form.getForms().Nursing.SkinReviewDialog);
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listMOS(DynamicGridCell cell)
{
	MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
	PersonName personName = new PersonName();
	personName.setSurname(cell.getTypedText());
	filter.setName(personName);
	filter.setIsActive(Boolean.TRUE);

	populateCellItems(cell, domain.listMembersOfStaff(filter));
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isLoggedInUser()
{
	MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo) domain.getMosUser();
	if (memStaffShortVo != null && memStaffShortVo.getHcp() != null)
		return true;

	return false;
}
 
Example 42
Project: AvoinApotti   File: BaselineObsImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHCP(MemberOfStaffShortVo voMOS) 
{
	DomainFactory factory = getDomainFactory();
	String hql = " from Hcp h " +
	" where h.mos.id = :mosid";

	List hcpList = factory.find(hql,new String[]{"mosid"}, new Object[]{voMOS.getID_MemberOfStaff()});

	if (hcpList == null || hcpList.size() == 0)
		return null;

	return HcpLiteVoAssembler.create((Hcp)hcpList.get(0));
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientDocumentVo getFinalDocument(DocumentStatus status, DocumentAndPatientWrapperVo doc) 
{
	PatientDocumentVo lockedPatientDoc = doc.getDocument();
	
	if (status != null && lockedPatientDoc.getCurrentDocumentStatus() != null && !status.equals(lockedPatientDoc.getCurrentDocumentStatus().getCorrespondenceStatus()) && !DocumentStatus.COMPLETED.equals(lockedPatientDoc.getCurrentDocumentStatus().getCorrespondenceStatus()))
	{
		PatientDocumentStatusVo finalS = new PatientDocumentStatusVo();
		finalS.setCorrespondenceStatus(status);
		finalS.setRecordingDateTime(new DateTime());
		finalS.setRecordingUser((MemberOfStaffShortVo) domain.getMosUser());
		
		if (!lockedPatientDoc.getDocumentStatusHistoryIsNotNull())
		{
			lockedPatientDoc.setDocumentStatusHistory(new PatientDocumentStatusVoCollection());
		}
		
		lockedPatientDoc.getDocumentStatusHistory().add(finalS);
		lockedPatientDoc.setCurrentDocumentStatus(finalS);
		
		String[] errs = lockedPatientDoc.validate();
		if (errs != null && errs.length > 0)
		{
			return null;
		}

		try
		{
			lockedPatientDoc = domain.savePatientDocument(lockedPatientDoc);
		}
		catch (StaleObjectException e)
		{
			e.printStackTrace();
			return null;
		}
			
	}
	
	return lockedPatientDoc;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isLoggedInUser()
{
	MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo) domain.getMosUser();
	if (memStaffShortVo != null && memStaffShortVo.getHcp() != null)
		return true;

	return false;
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listMOS(DynamicGridCell cell)
{
	MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
	PersonName personName = new PersonName();
	personName.setSurname(cell.getTypedText());
	filter.setName(personName);
	filter.setIsActive(Boolean.TRUE);

	populateCellItems(cell, domain.listMembersOfStaff(filter));
}
 
Example 46
Project: AvoinApotti   File: MyOrderImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffShortVoCollection listMos(String text)
{
	if (text == null || text.length() == 0)
		throw new DomainRuntimeException("Filter not supplied");

	MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
	filter.setName(new PersonName());
	filter.getName().setSurname(text);
	filter.setIsActive(true);

	MosAdmin impl = (MosAdmin) getDomainImpl(MosAdminImpl.class);
	return impl.listMembersOfStaffWithPrimaryLocations(filter);
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listMOS(DynamicGridCell cell)
{
	MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
	PersonName personName = new PersonName();
	personName.setSurname(cell.getTypedText());
	filter.setName(personName);
	filter.setIsActive(Boolean.TRUE);

	populateCellItems(cell, domain.listMembersOfStaff(filter));
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isLoggedInUser()
{
	MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo) domain.getMosUser();
	if (memStaffShortVo != null && memStaffShortVo.getHcp() != null)
		return true;

	return false;
}
 
Example 49
Project: AvoinApotti   File: PatientDocumentEditImpl.java   Source Code and License 5 votes vote down vote up
public Boolean isDocumentStillCheckedOut(ims.core.documents.vo.PatientDocumentRefVo documentId)
{
	if(documentId == null || !documentId.getID_PatientDocumentIsNotNull())
		throw new CodingRuntimeException("Can not check if document is still checked out on a null Document Id.");
	
	DomainFactory factory = getDomainFactory();
	
	long isCheckedOut = factory.countWithHQL("select count(pd.id) from PatientDocument as pd where pd.id = :patientDocument and pd.isLockedForEditing = 1 and pd.lockedByUser.id =:currUser", new String[] {"patientDocument","currUser"}, new Object[] {documentId.getID_PatientDocument(),((MemberOfStaffShortVo)getMosUser()).getID_MemberOfStaff()});
	
	if (isCheckedOut==1)
		return true;
	return false;
	
}
 
Example 50
Project: AvoinApotti   File: SupportNetworkProfessionalServicesImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffShortVoCollection listMembersOfStaff(MemberOfStaffShortVo filter, HcpDisType subType)
{
	MosAdmin impl = (MosAdmin) getDomainImpl(MosAdminImpl.class);
	MemberOfStaffShortVo voMos = new MemberOfStaffShortVo();
	Hcp voHcp = new Hcp();
	voHcp.setHcpType(subType);
	voMos.setHcp(voHcp);
	return impl.listMembersOfStaff(filter);
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void loadLocationsForMOS(boolean bUpdate) {
	if (!bUpdate)
		clearProfessionalReadOnlyDetails();

	MemberOfStaffShortVo voMosShort = form.ctnDetails().qmbRefferalTo().getValue();

	if (voMosShort != null)
	{

		LocShortVoCollection voLocShortVoColl = domain.listLocationsForMemberOfStaff(voMosShort);

		if (voLocShortVoColl != null)
		{
			for (int i = 0; i < voLocShortVoColl.size(); i++)
			{
				if ((voMosShort.getPrimaryLocationIsNotNull()) && (voMosShort.getPrimaryLocation().equals(voLocShortVoColl.get(i))))
					form.ctnDetails().cmbLocation().newRow(voLocShortVoColl.get(i), voLocShortVoColl.get(i).getName(), Color.Green);
				else
					form.ctnDetails().cmbLocation().newRow(voLocShortVoColl.get(i), voLocShortVoColl.get(i).getName(), Color.Black);
			}

			if (!bUpdate)
				form.ctnDetails().cmbLocation().showOpened();
			
		}
	}
	
}
 
Example 52
Project: AvoinApotti   File: SupportServicesImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffShortVoCollection listMembersOfStaffWithPrimaryLocations(MemberOfStaffShortVo voMemberOfStaffShortVo, HcpDisType hcpSUbtype) 
{
	List mosList = null;
	if(HcpDisType.MEDICAL.equals(voMemberOfStaffShortVo.getHcp().getHcpType()))
	{
		mosList = listMedic(voMemberOfStaffShortVo,hcpSUbtype);
	}
	else if(HcpDisType.NURSING.equals(voMemberOfStaffShortVo.getHcp().getHcpType()))
	{
		mosList = listNurse(voMemberOfStaffShortVo,hcpSUbtype);
	}
	else if(HcpDisType.THERAPY.equals(voMemberOfStaffShortVo.getHcp().getHcpType()))
	{
		mosList = listTherapist(voMemberOfStaffShortVo,hcpSUbtype);
	}
	else
		mosList = listDomMos(voMemberOfStaffShortVo);
	
	MemberOfStaffVoCollection voCollMos = MemberOfStaffVoAssembler.createMemberOfStaffVoCollectionFromMemberOfStaff(mosList);
	MemberOfStaffShortVoCollection voCollReturn = new MemberOfStaffShortVoCollection();
	if (voCollMos != null)
	{
		for (int i = 0; i < voCollMos.size(); i++)
		{
			MemberOfStaffShortVo voShortMos = new MemberOfStaffShortVo();
			voShortMos = voCollMos.get(i);
			for (int j = 0; j < voCollMos.get(i).getLocations().size(); j++)
			{
				if ( voCollMos.get(i).getLocations().get(j).getIsPrimary() != null &&
					 voCollMos.get(i).getLocations().get(j).getIsPrimary().equals(Boolean.TRUE))
					voShortMos.setPrimaryLocation(voCollMos.get(i).getLocations().get(j).getLocation());
			}
			voCollReturn.add(voShortMos);
		}
	}

	return voCollReturn;
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo) domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo) fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;
			}
		}
		return mos;
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
}
 
Example 54
Project: AvoinApotti   File: DemoreferralDetailsImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffShortVo getMemberOfStaff(MemberOfStaffRefVo mosRefVo) 
{
	MosAdmin mosadm = (MosAdmin) getDomainImpl(MosAdminImpl.class);
	MemberOfStaffShortVo mosVo = new MemberOfStaffShortVo();
	mosVo.setID_MemberOfStaff(mosRefVo.getID_MemberOfStaff());
	return mosadm.getMemberOfStaff(mosVo);
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo)fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;
			}
		}
		else
		{
			if (form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull())
				clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
			else
			{
				engine.showMessage("No Discipline is available. Please choose an authoring user.");
				return null;
			}
		}
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
	return mos;
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateFilterFromScreen(MemberOfStaffShortVo filterVo)
{
	PersonName name = new PersonName();
	filterVo.setName(name);
	name.setSurname(form.txtSName().getValue());
	filterVo.setStaffType(form.cmbStaffType().getValue());
	if (form.cmbHcpTypeFilter().getValue() != null)
	{
		filterVo.setHcp(new Hcp());
		filterVo.getHcp().setHcpType(form.cmbHcpTypeFilter().getValue());
	}
	filterVo.setIsActive(new Boolean(form.chkActiveOnly().getValue()));
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onQmbMosTextSubmited(String value) throws PresentationLogicException
{
	if (value != null)
	{
		MemberOfStaffShortVoCollection mosColl = domain.listMos(value.toString(), form.txtForename().getValue());
		form.qmbMos().setValue(null);
		form.qmbMos().clear();
		form.txtForename().setValue(null);
		String strName = null;
		if (mosColl != null)
		{
			for (int i = 0; i < mosColl.size(); i++)
			{
				strName = "";
				if ((mosColl.get(i).getName() != null) && (mosColl.get(i).getID_MemberOfStaff() != null))
				{
					MemberOfStaffShortVo mos = mosColl.get(i);
					strName = mos.getName().toShortForm();
					if (mos.getPasCode() != null)
					{
						strName += (" (" + mos.getPasCode() + ")");
					}
					form.qmbMos().newRow(mosColl.get(i), strName);
				}
			}
			if (mosColl.size() == 1)
			{
				form.qmbMos().setValue(mosColl.get(0));
			}
			else if (mosColl.size() > 1)
			{
				form.qmbMos().showOpened();
			}
		}
	}
	updateControlsState();
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo setContextVariables(MemberOfStaffShortVo mosVo)
{
	MemberOfStaffVo fullVo = domain.getMemberOfStaff(mosVo);
	form.getGlobalContext().Admin.setSelectedMos(fullVo);
	form.getGlobalContext().setHcp(fullVo.getHcp());
	// WDEV-2577
	if (form.lyrLHS().tabMos().treMemberOfStaff().getSelectedNode() != null)
		form.lyrLHS().tabMos().treMemberOfStaff().getSelectedNode().setValue(fullVo);

	return fullVo;
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateMosForLocation(LocMostVo voLoc, TreeNode node)
{
	clearMosNodes(node);
	MemberOfStaffShortVoCollection voCollMos = domain.listMosForLocation(voLoc);

	TreeNode newNode;
	for (int i = 0; i < voCollMos.size(); i++)
	{
		MemberOfStaffShortVo mosVo = voCollMos.get(i);
		newNode = node.getNodes().add(mosVo, mosVo.getName().toString());

		if (mosVo.getHcpIsNotNull() && mosVo.getHcp().getHcpTypeIsNotNull())
		{
			if (mosVo.getHcp().getHcpType().getParent() == null)
			{
				newNode.setCollapsedImage(mosVo.getHcp().getHcpType().getImage() == null ? form.getImages().Admin.StaffBlack : mosVo.getHcp().getHcpType().getImage());
				newNode.setExpandedImage(mosVo.getHcp().getHcpType().getImage() == null ? form.getImages().Admin.StaffBlack : mosVo.getHcp().getHcpType().getImage());
			}
			else
			{
				newNode.setCollapsedImage(mosVo.getHcp().getHcpType().getParent().getImage() == null ? form.getImages().Admin.StaffBlack : mosVo.getHcp().getHcpType().getParent().getImage());
				newNode.setExpandedImage(mosVo.getHcp().getHcpType().getParent().getImage() == null ? form.getImages().Admin.StaffBlack : mosVo.getHcp().getHcpType().getParent().getImage());
			}
		}
		else
		{
			newNode.setCollapsedImage(form.getImages().Admin.StaffBlack);
			newNode.setExpandedImage(form.getImages().Admin.StaffBlack);
		}
	}
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateMosVoFromScreen(MemberOfStaffShortVo voMos)
{
	if (voMos == null)
		return;

	voMos.setName(getMosNameFromScreen());
	voMos.getName().setUppers();
	voMos.setInitials(form.txtInitials().getValue());
	voMos.setSignatureBlock(form.txtSignatureBlock().getValue());
	voMos.setHcp(form.getGlobalContext().getHcp());
	voMos.setStaffType(form.cmbType().getValue());
	voMos.setSdsRoleId(form.txtSDSRole().getValue());
	String pasCode = voMos.getPasCode();
	voMos.setCodeMappings(getCodeMappings(voMos));
	if (!canUpdatePasId(voMos) && pasCode != null && !pasCode.equals(voMos.getPasCode()))
	{
		voMos.setPasCode(pasCode);
		engine.showMessage("The PAS Identifier for this Consultant cannot be updated as it has been got from the PAS. It will revert to the previous value.");
	}
	voMos.setCommChannels(getCommChannels());
	
	//WDEV-12587
	if(voMos.getID_MemberOfStaff() == null)
		voMos.setCanReferPatient(form.getGlobalContext().Admin.getCanReferPatient());
	else if(form.getGlobalContext().getHcp() != null && form.getGlobalContext().getHcp().getMosIsNotNull())
		voMos.setCanReferPatient(form.getGlobalContext().getHcp().getMos().getCanReferPatient());
}