Java Code Examples for ims.core.vo.HcpLiteVo

The following are top voted examples for showing how to use ims.core.vo.HcpLiteVo. 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: OperationDetailsConfigImpl.java   Source Code and License 6 votes vote down vote up
public ProcedureLiteVoCollection listProcedures(HcpLiteVo hcp,String text) 
{
	if (hcp == null || !hcp.getID_HcpIsNotNull())
		throw new CodingRuntimeException("Provided hcp is null or doesn't have an id");
	
	String hql = "select distinct proc from ConsultantProcedureCategory as cpc left join cpc.categoryProcedures " +
			"as cp left join cp.procedures as proc where (proc.isActive = 1 and proc.id is not null  and cpc.performingHCP.id = :Hcp_Id ";
	ArrayList<String> pN =new ArrayList<String>();
	ArrayList<Object> pV = new ArrayList<Object>();
	pN.add("Hcp_Id");
	pV.add(hcp.getID_Hcp());
	if (text != null)
	{
		hql+=" and UPPER(proc.procedureName) like :name";
		pN.add("name");
		pV.add("%"+text.toUpperCase()+"%");
	}
	hql+=")";
	List<?> procedures=getDomainFactory().find(hql,pN,pV);
	
	if (procedures != null && procedures.size()>0)
		return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(procedures);
	return null;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onQmbAuthoringTextSubmited(String value) throws PresentationLogicException
{
	form.qmbAuthoring().clear();

	HcpLiteVoCollection coll = domain.listHCPs(value);
	if (coll != null)
	{
		for (int i = 0; i < coll.size(); i++)
		{
			HcpLiteVo med = coll.get(i);
			form.qmbAuthoring().newRow(med, med.toString());
		}

		if (coll.size() == 1)
			form.qmbAuthoring().setValue(coll.get(0));
		else if (coll.size() > 1)
			form.qmbAuthoring().showOpened();
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onQmbPerfByTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
 	  form.qmbPerfBy().clear();
		
	  HcpLiteVoCollection hcpColl = domain.listHcpLiteByName(value);
	
	if(hcpColl != null)
	{
	  for (int i = 0; i < hcpColl.size(); i++)
	  {
		    HcpLiteVo hcp = hcpColl.get(i);
		    form.qmbPerfBy().newRow(hcp, hcp.toString());			
	   }
	
	   if (hcpColl.size() == 1)
	   {
		    form.qmbPerfBy().setValue(hcpColl.get(0));
	    }
	    else if (hcpColl.size() > 1)
	   {
		form.qmbPerfBy().showOpened();		
	   }
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		engine.open(form.getForms().Emergency.EDSeenByAndCompleteDialog);//WDEV-16816
		return;
	}
	else
	{
		//WDEV-16816
		// Attempt to save created SeenByHcp to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void ccHCPValueChanged() 
{
	if (form.lyr1().tabPageDetails().ccHcp().getValue() != null)
	{
		form.lyr1().tabPageDetails().treContactTypes().clear();

		if (form.lyr1().tabPageDetails().ccHcp().getValue() != null
			&& form.lyr1().tabPageDetails().ccHcp().getValue() instanceof HcpLiteVo)
		{
			Hcp voHcp = domain.getHCP((HcpRefVo)form.lyr1().tabPageDetails().ccHcp().getValue());
			if (voHcp instanceof MedicVo)
				form.lyr1().tabPageDetails().cmbDiscipline().setValue(((MedicVo) voHcp).getMedicType());
			else if (voHcp instanceof NurseVo)
				form.lyr1().tabPageDetails().cmbDiscipline().setValue(((NurseVo) voHcp).getNurseType());
			else if (voHcp instanceof TherapistVo)
				form.lyr1().tabPageDetails().cmbDiscipline().setValue(((TherapistVo) voHcp).getTherapistType());
			else 
				form.lyr1().tabPageDetails().cmbDiscipline().setValue(voHcp.getHcpType());
		}
		disciplineChanged();
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateReviweingHCP(HcpLiteVoCollection reviewingHCPs)
{
	form.qmbReviewingHCP().clear();

	if (reviewingHCPs == null)
		return;

	for (HcpLiteVo hcp : reviewingHCPs)
	{
		form.qmbReviewingHCP().newRow(hcp, hcp.getName() != null ? hcp.getName().toString() : "<unknown HCP>");
	}

	if (reviewingHCPs.size() != 1)
	{
		form.qmbReviewingHCP().showOpened();
	}
	else if (reviewingHCPs.size() == 1)
	{
		form.qmbReviewingHCP().setValue(reviewingHCPs.get(0));
		form.chkReview().setValue(true);
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateReviweingHCP(HcpLiteVoCollection reviewingHCPs)
{
	form.qmbReviewingHCP().clear();
	
	if (reviewingHCPs == null)
		return;
	
	for (HcpLiteVo hcp : reviewingHCPs)
	{
		form.qmbReviewingHCP().newRow(hcp, hcp.getName() != null ? hcp.getName().toString() : "<unknown HCP>");
	}
	
	if (reviewingHCPs.size() != 1)
	{
		form.qmbReviewingHCP().showOpened();
	}
	else if (reviewingHCPs.size() == 1)
	{
		form.qmbReviewingHCP().setValue(reviewingHCPs.get(0));
		form.chkReview().setValue(true);
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initializeCustomControls()
{
	// We set the type to Procedure.
	form.ctnDetails().ccProcedure().setCodingItemType(CodingItemType.PROCEDURE);
	// We set the hotlist to be selected by default.
	form.ctnDetails().ccProcedure().setHotlist(new Boolean(true));
	form.ctnDetails().ccProcedure().setSpecialty(getSpecialty());
	// The authoring user will be the current user logged into the system
	MemberOfStaffShortVo user = (MemberOfStaffShortVo) domain.getMosUser();
	if (user != null && user.getHcp() != null)
	{

		HcpLiteVo hcp = new HcpLiteVo();
		hcp.setMos(user);
		hcp.setID_Hcp(user.getHcp().getID_Hcp());
		form.getLocalContext().setHcp(hcp);
	}
	else
	{
		form.getLocalContext().setHcp(null);
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	AuthoringInformationVo temp = new AuthoringInformationVo();
	Date dt = new Date();
	form.pdt2().setValue(dt.toPartialDate());
	
	temp.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());
	form.cc3().setValue(temp);
	/*Object hcp;
	if((hcp = domain.getHcpUser()) != null )
	{
		
		temp.setAuthoringHcp((HcpLiteVo)hcp);
		form.cc3().setValue(temp);
	}*/
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * Function used to prepare form for correcting a comment
 * 		- set form to EDIT mode & CORRECT mode
 */
private void correctInstance()
{
	// Set editing mode CORRECT of comment
	form.getLocalContext().setSelectedEditMode(EDIT_MODE_CORRECT);
	
	// Default the logged in user
	if (form.getLocalContext().getSelectedCommentIsNotNull() && !form.getLocalContext().getSelectedComment().getCorrectingHcpIsNotNull())
	{
		HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
		
		if (hcpUser != null)
		{
			form.ctnDetails().ccCorrectingHCP().setValue(hcpUser);
		}
	}
	
	// Default correcting date time
	if (form.getLocalContext().getSelectedCommentIsNotNull() && !form.getLocalContext().getSelectedComment().getCorrectingDateTimeIsNotNull())
	{
		form.ctnDetails().dtimCorrectedDateTime().setValue(new DateTime());
	}
	
	// Set form mode to EDIT
	form.setMode(FormMode.EDIT);
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DischargeFuturePlanVo populateFollowDetails(DischargeFuturePlanVo voFuture)
{
	DischargeFuturePlanFollowUpVoCollection voColl = new DischargeFuturePlanFollowUpVoCollection();
	for (int i = 0; i < form.grdFollowUp().getRows().size(); i++)
	{
		DischargeFuturePlanFollowUpVo voFutureFOllowup = new DischargeFuturePlanFollowUpVo();
		if (form.grdFollowUp().getRows().get(i).getValue() != null)
			voFutureFOllowup = form.grdFollowUp().getRows().get(i).getValue();

		voFutureFOllowup.setFollowUpType(form.grdFollowUp().getRows().get(i).getColFollowUpType());
		voFutureFOllowup.setHospitalFollowUp(form.grdFollowUp().getRows().get(i).getColHospFollowUp());
		voFutureFOllowup.setFollowUpInValue(form.grdFollowUp().getRows().get(i).getColIN());
		voFutureFOllowup.setFollowUpInUnit(form.grdFollowUp().getRows().get(i).getColPeriod());
		voFutureFOllowup.setFollowUpHCP((HcpLiteVo) form.grdFollowUp().getRows().get(i).getColHCP().getValue());
		voFutureFOllowup.setFollowUpSpecialty(form.grdFollowUp().getRows().get(i).getColSpec());
		voFutureFOllowup.setLocation((LocationLiteVo) form.grdFollowUp().getRows().get(i).getColLoc().getValue());

		voColl.add(voFutureFOllowup);
	}
	voFuture.setFollowUpDetails(voColl);
	return voFuture;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onQmbRemovalByTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
	form.ctnDetail().lyrDetails().tabDevice().qmbRemovalBy().clear();
	
	HcpLiteVoCollection coll = domain.listHcps(value);
	for (int i = 0; i < coll.size(); i++)
	{
		HcpLiteVo med = coll.get(i);
		form.ctnDetail().lyrDetails().tabDevice().qmbRemovalBy().newRow(med, med.toString());			
	}
	if (coll.size() == 1)
	{
		form.ctnDetail().lyrDetails().tabDevice().qmbRemovalBy().setValue(coll.get(0));
	}
	else if (coll.size() > 1)
	{
		form.ctnDetail().lyrDetails().tabDevice().qmbRemovalBy().showOpened();		
	}		
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGridActionsGridCheckBoxClicked(int column, gridActionsRow row, boolean isChecked) throws PresentationLogicException
{
	if (isChecked)
	{
		row.setColActionDate(new Date().toString(DateFormat.STANDARD));

		Object hcpLite = domain.getHcpLiteUser();
		row.setColByValue(hcpLite != null ? (HcpLiteVo) hcpLite : null);
		row.setColBy(hcpLite != null ? (((HcpLiteVo) hcpLite).getName() != null ? ((HcpLiteVo) hcpLite).getName().toString() : null) : null);
	}
	else
	{
		row.setColActionDate(null);
		row.setColBy("");
		row.setColDetails("");
		// row.setReadOnly(true);
	}

}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialise() 
{
	// WDEV-12293 - Get service for CatsReferral (but we need to pass the CareContext id as the CatsReferral is not available in context)
	// and default the speciality combo box to it
	Specialty specialty = domain.getReferralSpecialty(form.getGlobalContext().RefMan.getCatsReferral());
	form.cmbSpecialty().setValue(specialty);
	
	form.dtimAdm().setValue(new DateTime());
	form.getLocalContext().setPasEventLocation(null);
	
	populateHospitalCombo();
	populateWardCombo();
	
	HcpLiteVo hcpLiteVo = (HcpLiteVo) domain.getHcpLiteUser();
	if (hcpLiteVo != null
		&& hcpLiteVo.getHcpTypeIsNotNull() 
		&& hcpLiteVo.getHcpType().equals(HcpDisType.MEDICAL))
	{
		MedicLiteVo vo = new MedicLiteVo(hcpLiteVo.getID_Hcp(), hcpLiteVo.getVersion_Hcp());
		form.qmbConsultant().newRow( vo, hcpLiteVo.getName().toString());
		form.qmbConsultant().setValue(vo);
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize()
{
	AuthoringInformationVo voAuthoringInformation=new AuthoringInformationVo();
	voAuthoringInformation.setAuthoringDateTime(new DateTime());
	if (domain.getHcpLiteUser()!=null)
		voAuthoringInformation.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());
	form.cc2().setValue(voAuthoringInformation);
	form.pdt1().setValue(new PartialDate(new Date()));
	
	form.grpFilter().setValue(grpFilterEnumeration.rdoSpecialty);
	
	if (domain.getHcpLiteUser() == null)
	{			
		form.pdt1().setEnabled(false);
		form.setcc1Enabled(false);
		form.setcc2Enabled(false);
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onQmbResponsibleHCPTextSubmited(String value) throws PresentationLogicException 
{
	form.qmbResponsibleHCP().clear();
	
	HcpLiteVoCollection coll = domain.listHCP(value);
	for (int i = 0; i < coll.size(); i++)
	{
		HcpLiteVo med = coll.get(i);
		form.qmbResponsibleHCP().newRow(med, med.toString());			
	}
	if (coll.size() == 1)
	{
		form.qmbResponsibleHCP().setValue(coll.get(0));
	}
	else if (coll.size() > 1)
	{
		form.qmbResponsibleHCP().showOpened();		
	}				
	
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object ob1, Object ob2) 
{
	PersonName pname1 = null;
	PersonName pname2 = null;
	if(ob1 instanceof HcpLiteVo )
	{
		HcpLiteVo ps1 = (HcpLiteVo)ob1;
		pname1 = ps1.getMosIsNotNull() && ps1.getMos().getNameIsNotNull() ? ps1.getMos().getName():null;
	}
	if(ob2 instanceof HcpLiteVo)
	{
		HcpLiteVo ps2 = (HcpLiteVo)ob2;
		pname2 = ps2.getMosIsNotNull() && ps2.getMos().getNameIsNotNull() ? ps2.getMos().getName():null;
	}
	if(pname1 != null )
		return  pname1.compareTo(pname2)*direction;
	if(pname2 != null)
		return (-1)*direction;
	
	return 0;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DischargeFuturePlanVo populateFollowDetails(DischargeFuturePlanVo voFuture)
{
	DischargeFuturePlanFollowUpVoCollection voColl = new DischargeFuturePlanFollowUpVoCollection();
	for (int i = 0; i < form.grdFuturePlan().getRows().size(); i++)
	{
		DischargeFuturePlanFollowUpVo voFutureFOllowup = new DischargeFuturePlanFollowUpVo();
		if (form.grdFuturePlan().getRows().get(i).getValue() != null)
			voFutureFOllowup = form.grdFuturePlan().getRows().get(i).getValue();

		voFutureFOllowup.setHospitalFollowUp(form.grdFuturePlan().getRows().get(i).getColHospFollowUp());
		voFutureFOllowup.setFollowUpInValue(form.grdFuturePlan().getRows().get(i).getColIN());
		voFutureFOllowup.setFollowUpInUnit(form.grdFuturePlan().getRows().get(i).getColPeriod());
		voFutureFOllowup.setFollowUpHCP((HcpLiteVo) form.grdFuturePlan().getRows().get(i).getColHCP().getValue());
		voFutureFOllowup.setFollowUpSpecialty(form.grdFuturePlan().getRows().get(i).getColSpec());
		voFutureFOllowup.setLocation((LocationLiteVo) form.grdFuturePlan().getRows().get(i).getColLoc().getValue());

		voColl.add(voFutureFOllowup);
	}
	voFuture.setFollowUpDetails(voColl);

	return voFuture;
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setDefaultValuesToControls(boolean ignoreClinicalContact)//WDEV-11523
{
	AuthoringInformationVo voAuthoring = new AuthoringInformationVo();
	
	if(!ignoreClinicalContact && form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())//WDEV-11523
	{
		voAuthoring.setAuthoringDateTime(form.getGlobalContext().Core.getCurrentClinicalContact().getStartDateTime() == null ? new DateTime() : form.getGlobalContext().Core.getCurrentClinicalContact().getStartDateTime());
		voAuthoring.setAuthoringHcp(form.getGlobalContext().Core.getCurrentClinicalContact().getSeenBy());			
	}
	else
	{
		voAuthoring.setAuthoringDateTime(new DateTime());
		voAuthoring.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());
	}
	
	populateControlsFromData(voAuthoring);
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AuthoringInformationVo getAuthoringInfo()
{
	AuthoringInformationVo auth = new AuthoringInformationVo();
	
	if(form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
	{
		auth.setAuthoringDateTime(form.getGlobalContext().Core.getCurrentClinicalContact().getStartDateTime() == null ? new DateTime() : form.getGlobalContext().Core.getCurrentClinicalContact().getStartDateTime());
		auth.setAuthoringHcp(form.getGlobalContext().Core.getCurrentClinicalContact().getSeenBy());			
	}
	else
	{
		auth.setAuthoringDateTime(new DateTime());
		auth.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());
	}
	
	return auth;
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private CorrespondenceNoteVo populateDataFromScreen() 
{	
	CorrespondenceNoteVo editedReportNote = form.getLocalContext().getEditedRecord();
	if (editedReportNote == null) {
		editedReportNote = new CorrespondenceNoteVo();
	}		
	
	editedReportNote.setAuthoringInformation(form.ccAuthoring().getValue());
	editedReportNote.setCatsReferral(form.getGlobalContext().RefMan.getCatsReferral());
	editedReportNote.setNoteType(form.cmbReportNoteType().getValue());
	editedReportNote.setNoteStatus(form.cmbStatus().getValue());
	editedReportNote.setReportNote(form.richTextNote().getValue());
	editedReportNote.setCopyToGP(form.chkCopyToGP().getValue());
	editedReportNote.setCopyToPatient(form.chkCopyToPatient().getValue());
	editedReportNote.setCopyToSecondaryCare(form.chkCopyToSecondaryCare().getValue());
	
	AuthoringInformationVo recording = new AuthoringInformationVo();
	recording.setAuthoringDateTime(new DateTime());
	HcpLiteVo hcp = new HcpLiteVo();
	hcp.setID_Hcp(engine.getLoggedInUser().getHcpId());
	hcp.setMos(domain.getMosUser() != null ? (MemberOfStaffLiteVo) domain.getMosUser() : null);
	recording.setAuthoringHcp(hcp);					
	editedReportNote.setRecordingInformation(recording);		
	
	return editedReportNote;
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private HcpLiteVoCollection getExistentConsultantsFromGrid()
{
	if (form.ctnDetails().grdConsultants().getRows().size()==0)
		return null;
	
	HcpLiteVoCollection collCons = new HcpLiteVoCollection();
	
	for (int i=0;i<form.ctnDetails().grdConsultants().getRows().size();i++)
	{
		if (form.ctnDetails().grdConsultants().getRows().get(i).getColConsultants().getValue()==null)
			continue;
		
		collCons.add((HcpLiteVo) form.ctnDetails().grdConsultants().getRows().get(i).getColConsultants().getValue());
	}
	
	return collCons;
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistAndTriageVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		//engine.open(form.getForms().Emergency.AllocatedMedicDialog);
		return;
	}
	else
	{
		// Attempt to save created AllocatedMedic to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))//WDEV-16816
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateHcpQueryComboBox(grdFuturePlanRow row, HcpLiteVoCollection hcpCollection)
{
	// Clear the QueryCombobox
	row.getColHCP().clear();
	row.getColHCP().setEditedText(null);

	// Terminate function if HCP collection is null
	if (hcpCollection == null || hcpCollection.size() == 0)
		return;

	for (HcpLiteVo value : hcpCollection)
	{
		row.getColHCP().newRow(value, value.getName().toString());
	}

	if (hcpCollection.size() == 1)
	{
		row.getColHCP().setValue(hcpCollection.get(0));
	}
	else
	{
		row.getColHCP().showOpened();
	}
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onQmbAnaesTextSubmited(String value) throws PresentationLogicException 
{
	form.qmbAnaes().clear();
	HcpFilter filter = new HcpFilter();
	PersonName name  = new PersonName();
	name.setSurname(value);
	filter.setQueryName(name);

	HcpLiteVoCollection hcpColl = domain.listHcpLiteByName(value);
	for (int i = 0; i < hcpColl.size(); i++)
	{
		HcpLiteVo hcp = hcpColl.get(i);
		form.qmbAnaes().newRow(hcp, hcp.toString());			
	}
	if (hcpColl.size() == 1)
	{
		form.qmbAnaes().setValue(hcpColl.get(0));
	}
	else if (hcpColl.size() > 1)
	{
		form.qmbAnaes().showOpened();		
	}				
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void listHcpMedical(String value)
{
	HcpLiteVoCollection coll = null;

	coll = domain.listHcpMedic(value);

	form.qmbLeadCons().clear();
	
	if (coll == null || coll.size() == 0)
		return;
		
	for (int i = 0; i < coll.size(); i++)
	{
		HcpLiteVo vo = coll.get(i);
		form.qmbLeadCons().newRow(vo, vo.getIHcpName());
	}

	if(coll.size() == 1)
		form.qmbLeadCons().setValue(coll.get(0));
	
	if (coll.size() > 1)
	{
		form.qmbLeadCons().showOpened();
	}
	
}
 
Example 27
Project: AvoinApotti   File: ProceduresPerformedByHCPImpl.java   Source Code and License 6 votes vote down vote up
private void removeAlreadyUsedHcps(HcpLiteVoCollection hcps)
{
	HcpLiteVoCollection voCollToRemove = new HcpLiteVoCollection();
	if(hcps != null)
	{
		for(HcpLiteVo hcp : hcps)
		{
			List count =getDomainFactory().find("select count(ppbh.id)from ProceduresPerformedByHCP as ppbh where ppbh.performingHCP.id = " + hcp.getID_Hcp());
			if(count != null)
			{
				Long val = (Long) count.get(0);
				if(val.intValue() > 0)
					voCollToRemove.add(hcp);
			}
		}
	}
	
	for(HcpLiteVo removeHcp :voCollToRemove)
		hcps.remove(removeHcp);	
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnAddClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.getLocalContext().getSelectedHCPs() == null)
		return;

	for (int i = 0; i < form.getLocalContext().getSelectedHCPs().size(); i++)
	{
		HcpLiteVo hcp = form.getLocalContext().getSelectedHCPs().get(i);

		if (hcp == null)
			continue;

		if (form.grdSelectedHcps().getValues().contains(hcp))
			continue;
					
		grdSelectedHcpsRow newRow = form.grdSelectedHcps().getRows().newRow();
		
		newRow.setColName(hcp.getName() != null ? hcp.getName().toString() : "");
		newRow.setColSelected(true);

		newRow.setValue(hcp);
		
	}

	removeSelectedRowsFromSearchGrid();
}
 
Example 29
Project: AvoinApotti   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcpById(HcpRefVo hcpRefVo)
{
	if(hcpRefVo == null)
		throw new CodingRuntimeException("null hcpRefVo passed to getHcpById() !");

	DomainFactory factory = getDomainFactory();
	
	ims.core.resource.people.domain.objects.Hcp boHcp = (ims.core.resource.people.domain.objects.Hcp)factory.getDomainObject(ims.core.resource.people.domain.objects.Hcp.class, hcpRefVo.getID_Hcp());
	
	return HcpLiteVoAssembler.create(boHcp);
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private  SkinAssessment copySkinAssessment(SkinAssessment skinAssessment)
{
	if (skinAssessment == null)
		return null;
	skinAssessment.clearIDAndVersion();
	skinAssessment.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
	skinAssessment.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
	skinAssessment.setDateTimeInitiated(new DateTime());
	skinAssessment.setHcpInitiated(domain.getHcpLiteUser() instanceof HcpLiteVo ? (HcpLiteVo) domain.getHcpLiteUser() : null);
	skinAssessment.setSkinAssessmentFindings(copySkinAssessmentFindings(skinAssessment.getSkinAssessmentFindings()));
	return skinAssessment;

}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialize(PatientICPRefVo icp, HcpLiteVo hcp, PatientICPActionRefVo patientICPAction, Boolean readOnly)
{
	form.getLocalContext().setPatientICP(domain.getPatientICP(icp));
	form.getLocalContext().setLoggedInUser(hcp);
	form.getLocalContext().setPatientICPAction(patientICPAction);
	form.getLocalContext().setReadOnly(readOnly);
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * WDEV-13876
 * Default 'Reviewing HCP' to current user only if current user is 'HCP responsible' and is of discipline MEDICAL
 */
private void presetReviewingHCP()
{
	form.qmbReviewingHCP().clear();
	
	HcpLiteVo hcp = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcp != null && Boolean.TRUE.equals(hcp.getIsHCPaResponsibleHCP()) && HcpDisType.MEDICAL.equals(hcp.getHcpType()))
	{
		form.qmbReviewingHCP().newRow(hcp, hcp.getName() != null ? hcp.getName().toString() : "<unknown HCP>");
		form.qmbReviewingHCP().setValue(hcp);
		
		form.chkReview().setValue(true);
	}
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private InternalReferralListFilterVo populateSearchCriteria()
{
	InternalReferralListFilterVo voFilter = new InternalReferralListFilterVo();
	
	voFilter.setActiveOnly(form.GroupStatus().getValue().equals(GroupStatusEnumeration.rdoCurrent) ? Boolean.TRUE : Boolean.FALSE);
	voFilter.setReferralType(form.cmbType().getValue());
	voFilter.setReferredBy((HcpLiteVo)form.ccReferredBy().getValue());
	voFilter.setDateFrom(form.dteFrom().getValue());
	voFilter.setDateTo(form.dteTo().getValue());
	
	return voFilter;
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newInstance() 
{
	clearInstanceControls();
	
	//form.getLocalContext().setSelectedRecord(new InternalReferralVo()); //WDEV-14356
	
	form.setMode(FormMode.EDIT);
	enableMainControls(Boolean.TRUE);
	if (domain.getHcpLiteUser() != null)
		form.ccReferredBy().setValue((HcpLiteVo)domain.getHcpLiteUser());
	
	form.GroupStatus().setValue(GroupStatusEnumeration.rdoActive);
	form.chkRemove().setVisible(Boolean.FALSE);
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onDyngrdInviteesCellTextSubmited(DynamicGridCell cell) 
{
	cell.getItems().clear();
	if (cell.getTypedText() == null || cell.getTypedText().equals(""))
	{
		engine.showMessage("Please enter at least one character to search on.");
		return;
	}

	if (cell.getIdentifier() != null && cell.getIdentifier().equals(HcpLiteVo.class))
	{
		HcpLiteVoCollection collHcps = domain.listHcpLiteVoByName(cell.getTypedText());
		//MemberOfStaffShortVoCollection voCollMos = domain.listMos(cell.getTypedText());
		if (collHcps != null && collHcps.size() > 0)
		{
			for (int i = 0; i < collHcps.size(); i++)
			{
				cell.getItems().newItem(collHcps.get(i));
			}
			if (collHcps.size() == 1)
			{
				cell.setValue(collHcps.get(0));
				onDyngrdInviteesCellValueChanged(cell);
			}
			else if (collHcps.size() > 1)
				cell.showOpened();
		}
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * Function used to populate search criteria with values from screen
 */
private PatientAssessmentListAndSearchCriteriaVo populateSearchCriteriaFromScreen()
{
	// New search criteria
	PatientAssessmentListAndSearchCriteriaVo searchCriteria = new PatientAssessmentListAndSearchCriteriaVo();

	// Get simple values from screen
	searchCriteria.setSpecialty(form.cmbSpecialty().getValue());
	searchCriteria.setAuthoringHCP((HcpLiteVo) form.ccAuthoringHCP().getValue());
	searchCriteria.setResponsibleHCP((HcpLiteVo) form.ccResponsibleHCP().getValue());
	searchCriteria.setAssessmentName(form.txtAssessmentName().getValue());
	searchCriteria.setAssessesmentStatus(form.cmbAssessmentStatus().getValue());
	searchCriteria.setDateFrom(form.dteFrom().getValue());
	searchCriteria.setDateTo(form.dteTo().getValue());
	
	// Determine date search type
	if (GroupDateEnumeration.rdoEventDate.equals(form.GroupDate().getValue()))
	{
		searchCriteria.setDateSearchType(Boolean.TRUE);
	}
	else
	{
		searchCriteria.setDateSearchType(Boolean.FALSE);
	}
	
	// Return search criteria
	return searchCriteria;
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateCOntrolStatus()
{
	if (form.getMode() == FormMode.EDIT)
	{
		form.cmbProcedure().setEnabled(false);
		form.qmbHCP().setEnabled(false);

	}
	else
	{
		form.cmbProcedure().setEnabled(true);
		form.qmbHCP().setEnabled(true);
		boolean extended = ConfigFlag.DTO.EXTENDED_OP_NOTES_TEMPLATE_FIELDS.getValue();
		boolean first = (form.qmbHCP().getValue() instanceof HcpLiteVo 
				&& form.qmbHCP().getValue().getIsActiveIsNotNull() 
				&& form.qmbHCP().getValue().getIsActive() 
				&& form.cmbProcedure().getValue() != null 
				&& !extended);

		boolean second = extended && form.qmbProcedure().getValue() != null ;

		form.btnNew().setVisible((first || second)&& !form.getLocalContext().getCurentSelectedSUrgicalOperationDetailsConfigIsNotNull());

		form.btnEdit().setVisible((first || second) && form.getLocalContext().getCurentSelectedSUrgicalOperationDetailsConfigIsNotNull());

		form.btnSearch().setEnabled((first || second)&&!form.getLocalContext().getCurentSelectedSUrgicalOperationDetailsConfigIsNotNull()&& (form.qmbHCP().getValue()!=null||extended));

	}

	if (ims.configuration.gen.ConfigFlag.DTO.EXTENDED_OP_NOTES_TEMPLATE_FIELDS.getValue())
	{
		boolean editMode = FormMode.EDIT.equals(form.getMode());
		form.ctn1().txtPostOP().setEnabled(editMode);  //wdev-13658
		form.qmbProcedure().setEnabled(!editMode);
	}
}
 
Example 38
Project: AvoinApotti   File: ConsultantProcedureHotlistDialogImpl.java   Source Code and License 5 votes vote down vote up
public ConsultantProcedureCategoryVo getConsultantProcedureCategoryByHcp(HcpLiteVo hcp) throws DomainInterfaceException {
	if(hcp == null)
		throw new CodingRuntimeException("hcp is null");
	
	DomainFactory factory = getDomainFactory();
	List conProcCateList = factory.find("from ConsultantProcedureCategory cpc where cpc.performingHCP.id = :idHcp)", new String[]{"idHcp"}, new Object[]{hcp.getID_Hcp()});
	ConsultantProcedureCategoryVoCollection coll = ConsultantProcedureCategoryVoAssembler.createConsultantProcedureCategoryVoCollectionFromConsultantProcedureCategory(conProcCateList);
	if(coll.size()!= 0)
		return coll.get(0);
	else
		return null;
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AuthoringInformationVo populateRecordinfInfo()
{
	AuthoringInformationVo authoring = new AuthoringInformationVo();
	authoring.setAuthoringDateTime(new DateTime());
	
	HcpLiteVo hcpVo = new HcpLiteVo();
	hcpVo.setID_Hcp(engine.getLoggedInUser().getHcpId());
	hcpVo.setMos(domain.getMosUser() != null ? (MemberOfStaffLiteVo) domain.getMosUser() : null);
	
	authoring.setAuthoringHcp(hcpVo);
	
	return authoring;
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void initialize() 
{
	Object hcp = domain.getHcpLiteUser();//	WDEV-13479
	form.getLocalContext().setIsHcp(hcp instanceof HcpLiteVo);//	WDEV-13479
	
	form.ccOrderingClin().initialize(MosType.HCP);
	form.ccResponsablePharmacist().initialize(MosType.HCP);
	initializeDynamicGridMedication();
	
	clearGlobalContexts();
	clearLocalContexts();
	
	open();		
}