Java Code Examples for ims.core.resource.people.vo.HcpRefVo

The following are top voted examples for showing how to use ims.core.resource.people.vo.HcpRefVo. 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 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 2
Project: AvoinApotti   File: RadioTherapyDetailsImpl.java   Source Code and License 6 votes vote down vote up
public MedicVo getMedic(HcpRefVo hcpId) 
{
	if(hcpId == null)
		throw new CodingRuntimeException("HCP id must not be null ");
	
	

	DomainFactory factory = getDomainFactory();
	String hql = "from Medic as m1_1 where m1_1.id = :idHCP";
	List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {hcpId.getID_Hcp()});
	if(list != null && list.size() > 0)
	{
		MedicVoCollection voColl =  MedicVoAssembler.createMedicVoCollectionFromMedic(list);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 3
Project: AvoinApotti   File: ClinicalAdmissionImpl.java   Source Code and License 6 votes vote down vote up
public NurseVo getNurse(HcpRefVo id) 
{	
	if(id == null)
		throw new CodingRuntimeException("HCP id must not be null ");
	
	DomainFactory factory = getDomainFactory();
	String hql = "from Nurse as n1_1 where n1_1.id = :idHCP";
	List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {id.getID_Hcp()});
	if(list != null && list.size() > 0)
	{
		NurseVoCollection voColl =  NurseVoAssembler.createNurseVoCollectionFromNurse(list);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientDocumentSearchListVoCollection listPatientDocumentsAndDisplayNoResultError()
{
	PatientDocumentSearchListVoCollection patDocs = domain.listPatientDocuments(
				form.getGlobalContext().Core.getPatientShort(),form.cmbEpisodes().getValue(), 
				form.cmbSpecialty().getValue(),  form.ccMos().getValue() instanceof HcpRefVo ? (HcpRefVo) form.ccMos().getValue() : null, 
				form.dteFrom().getValue(), form.dteTo().getValue(), 
				form.cmbDocType().getValue(), form.ccResponsibleHcp().getValue() instanceof HcpRefVo ? (HcpRefVo) form.ccResponsibleHcp().getValue() : null,GroupDateEnumeration.rdoGenerated.equals(form.GroupDate().getValue())?true:null);

	if (patDocs == null || patDocs.size() == 0)
	{
		engine.showMessage("No documents matching your search criteria were found !", "No results",MessageButtons.OK, MessageIcon.INFORMATION);
		return null;
	}
	
	return patDocs;
}
 
Example 5
Project: AvoinApotti   File: ADTImpl.java   Source Code and License 6 votes vote down vote up
public ims.core.vo.InpatientEpisodeVo transferPatient(PatientRefVo patVo, HcpRefVo hcp, LocationRefVo ward,Integer stay,LocationRefVo fromWard, DateTime transferDateTime, DateTime transactionDT, LookupInstVo specialty) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
	if (patVo == null)
	{
		throw new DomainRuntimeException("Patient cannot be null!");
	}
	InpatientEpisode ipDo = getCurrentAdmission(patVo);
	if (ipDo == null)
	{
		//Patient is not currently an inpatient, so ignore transfer event.
		return null;	
	}	
	performTransfer(ipDo, patVo, hcp, ward,stay,fromWard,transferDateTime,transactionDT,specialty);
	
	return InpatientEpisodeVoAssembler.create(ipDo);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void searchWaitingForClinicianReview() 
{
	clearScreen();
	
	HcpRefVo hcp = null;
	if(form.getLocalContext().getLoggedHcpIsNotNull() && GroupClinicianReviewEnumeration.rdoMyAllocated.equals(form.GroupClinicianReview().getValue()))
	{
		hcp = form.getLocalContext().getLoggedHcp();
	}
	
	TrackingListForClinicianWorklistVoCollection patients = domain.listPatientsWaiting(engine.getCurrentLocation(), TrackingStatus.WAITING_TO_BE_SEEN_BY_A_MEDIC, hcp);
	
	if(patients == null)
		return;
	
	populatePatientsWaitingForTriage(patients.sort(new TrackingComparator()));
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize() 
{
	if(engine.getCurrentLocation() != null)
	{
		form.getLocalContext().setAttendanceKPIConfig(domain.getAttendanceKPIConfigForClinicianWorklist(engine.getCurrentLocation()));
	}
	
	Object user = domain.getHcpLiteUser();
	if(user instanceof HcpRefVo)
	{
		form.getLocalContext().setLoggedHcp((HcpRefVo) user);
	}
	
	//form.GroupClinicianReview().setValue(GroupClinicianReviewEnumeration.rdoAll);
	createPatientGridColumns();
	
	form.lyrPatientTriage().tabPathway().ccICP().initialize();
		
	if(form.getGlobalContext().Core.getCurrentCareContext() != null)
	{
		form.getLocalContext().setSelectedWaitingPatient(domain.getTrackingForClinicianWorklistByCareContext(form.getGlobalContext().Core.getCurrentCareContext()));
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void searchTriagePatients() 
{
	clearScreen();
	HcpRefVo hcp = null;
	if(form.getLocalContext().getLoggedHcpIsNotNull() && GroupClinicianReviewEnumeration.rdoMyAllocated.equals(form.GroupClinicianReview().getValue()))
	{
		hcp = form.getLocalContext().getLoggedHcp();
	}
	
	TrackingListForTriageVoCollection patients = domain.listPatientsWaiting(engine.getCurrentLocation(), TrackingStatus.WAITING_TO_BE_TRIAGED, hcp);
	
	if(patients == null)
		return;
	
	populatePatientsWaitingForTriage(patients.sort(new TriageLOSComparator(SortOrder.DESCENDING)));
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize(ims.core.patient.vo.PatientRefVo patient, ims.core.admin.vo.EpisodeOfCareRefVo episodeOfCare, ims.core.admin.vo.CareContextRefVo careContext,  ClinicalProblemRefVo presentingProblem)
{
	form.getLocalContext().setIsEnabled(true);
	
	form.getLocalContext().setPatient(patient);
	form.getLocalContext().setEpisodeOfCare(episodeOfCare);
	form.getLocalContext().setCareContext(careContext);
	form.getLocalContext().setClinicalProblem(presentingProblem);
	
	Object hcp = domain.getHcpLiteUser();
	if(hcp instanceof HcpRefVo)
	{
		form.getLocalContext().setLoggedHCP((HcpRefVo) hcp);
	}
	
	open();
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize(ims.core.patient.vo.PatientRefVo patient, ims.core.admin.vo.EpisodeOfCareRefVo episodeOfCare, ims.core.admin.vo.CareContextRefVo careContext, ClinicalProblemRefVo presentingProblem)
{
	form.getLocalContext().setIsEnabled(true);
	
	form.getLocalContext().setPatient(patient);
	form.getLocalContext().setEpisodeOfCare(episodeOfCare);
	form.getLocalContext().setCareContext(careContext);
	form.getLocalContext().setPresentingProblem(presentingProblem);
	
	Object hcp = domain.getHcpLiteUser();
	if(hcp instanceof HcpRefVo)
	{
		form.getLocalContext().setLoggedHCP((HcpRefVo) hcp);
	}
	
	open();
}
 
Example 11
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
{
	//WDEV-17304
	Object hcp = domain.getHcpLiteUser();
	if (hcp !=null && hcp instanceof HcpLiteVo)
	{
		form.getLocalContext().setLoggedHCP((HcpRefVo) hcp);
	}
	
	initializeControls();
	
	form.getLocalContext().setcurrentTracking(domain.getTracking(form.getGlobalContext().Emergency.getTracking()));
	open();
	
	if(form.getLocalContext().getselectedSeenByHCP() == null || form.getLocalContext().getselectedSeenByHCP().getCompletedDateTimeIsNotNull() )
	{
		newInstance();
	}
	
}
 
Example 12
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
{
	//WDEV-17304
	Object hcp = domain.getHcpLiteUser();
	if (hcp !=null && hcp instanceof HcpLiteVo)
	{
		form.getLocalContext().setLoggedHCP((HcpRefVo) hcp);
	}
	
	initializeControls();
	form.getLocalContext().setTrackingForReferral(domain.getTrackingForReferral(form.getGlobalContext().Emergency.getTracking()));
	open();
	
	if(form.getLocalContext().getSelectedReferralToSpecialty() == null || form.getLocalContext().getSelectedReferralToSpecialty().getCompletionDateTimeIsNotNull() || Boolean.TRUE.equals(form.getLocalContext().getSelectedReferralToSpecialty().getNotAccepted()))
	{
		newInstance();
	}
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize()
{
	form.lyrWorklist().tabTriageWorklist().GroupClinicianReview().setValue(ims.emergency.forms.edworklisttoassessmentform.GenForm.lyrWorklistLayer.tabTriageWorklistContainer.GroupClinicianReviewEnumeration.rdoAll);
	//form.lyrWorklist().tabClinicianWorklist().GroupClinicianReviewClin().setValue(GroupClinicianReviewClinEnumeration.rdoAllClin);
	
	Object user = domain.getHcpLiteUser();
	if(user instanceof HcpRefVo)
	{
		form.getLocalContext().setLoggedHcp((HcpRefVo) user);
	}
	
	if(engine.getCurrentLocation() != null)
	{
		form.getLocalContext().setAttendanceKPIConfig(domain.getAttendanceKPIConfigForTriage(engine.getCurrentLocation()));
		
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException
{
	if(form.lyrDetails().tabListOwners().grdListOwner().getRows().size() == 0)
		return;
	
	row.getcolProcedure().clear();
	
	HcpRefVoCollection voCollHcp = new HcpRefVoCollection();
	for(int i=0;i<form.lyrDetails().tabListOwners().grdListOwner().getRows().size();i++)
		voCollHcp.add ((HcpRefVo) form.lyrDetails().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue());

	ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text);
	if(voCollProcedure != null)
	{
		for(ProcedureLiteVo voProc : voCollProcedure)
			row.getcolProcedure().newRow(voProc, voProc.getProcedureName());
		
		if(voCollProcedure.size() > 1)
			row.getcolProcedure().showOpened();
		else if(voCollProcedure.size() == 1)
			row.getcolProcedure().setValue(voCollProcedure.get(0));
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private Boolean checkIfOwnerHasProcedures(HcpRefVo hcpId) 
{
	if(hcpId == null)
		return false;
	
	String proceduresId = "";
	
	for (int i = 0; i < form.lyrSessEdit().tabTheatreProcedures().grdTheatre().getRows().size(); i++)
	{
		grdTheatreRow tRow = form.lyrSessEdit().tabTheatreProcedures().grdTheatre().getRows().get(i);
		
		if(tRow.getcolProcedure().getValue() instanceof ProcedureLiteVo)
		{
			proceduresId += ((proceduresId == null || proceduresId.length() == 0) ? "" : ",") + ((ProcedureLiteVo)tRow.getcolProcedure().getValue()).getID_Procedure();
		}
	}
	
	return domain.hasSelectedOwnerProcedures(hcpId, proceduresId);
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException
{
	if(form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size() == 0)
		return;
	
	row.getcolProcedure().clear();
	
	HcpRefVoCollection voCollHcp = new HcpRefVoCollection();
	for(int i=0;i<form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size();i++)
		voCollHcp.add ((HcpRefVo) form.lyrSessEdit().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue());

	ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text);
	if(voCollProcedure != null)
	{
		for(ProcedureLiteVo voProc : voCollProcedure)
			row.getcolProcedure().newRow(voProc, voProc.getProcedureName());
		
		if(voCollProcedure.size() > 1)
			row.getcolProcedure().showOpened();
		else if(voCollProcedure.size() == 1)
			row.getcolProcedure().setValue(voCollProcedure.get(0));
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 17
Project: AvoinApotti   File: SessionAdminImpl.java   Source Code and License 6 votes vote down vote up
public Boolean hasSelectedOwnerProcedures(HcpRefVo ownerId, String procedureList)
{
	if (ownerId == null || !ownerId.getID_HcpIsNotNull())
		throw new CodingRuntimeException("Cannot count performed procedures on null HCP id.");

	if (procedureList == null || procedureList.length() == 0)
		return true;

	DomainFactory factory = getDomainFactory();
	String query = "select count(pp.id) from ProceduresPerformedByHCP as pp left join pp.procedures as p where (pp.performingHCP.id = :hcpId and p.id in (" + procedureList + "))";

	Object[] count = factory.find(query, new String[]{"hcpId"}, new Object[]{ownerId.getID_Hcp()}).toArray();

	if (count != null && count.length > 0 && ((Long) count[0]).intValue() > 0)
		return true;

	return false;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open()
{
	if (form.getGlobalContext().RefMan.getSecondOpinionReferralStatusIsNotNull()
		&& form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getReferralStatusIsNotNull()
		&& form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getReferralStatus().equals(ReferralApptStatus.PROVISIONAL_REJECTION))
	{
		form.txtComment().setValue(form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getComment());
		AuthoringInformationVo voA = new AuthoringInformationVo();
		voA.setAuthoringDateTime(form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getStatusDateTime());
		if (form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getAuthoringUserIsNotNull())
		{
			MemberOfStaffShortVo voMOS = new MemberOfStaffShortVo();
			voMOS.setID_MemberOfStaff(form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getAuthoringUser().getID_MemberOfStaff());
			HcpRefVo voHCPRef = new HcpRefVo();
			voHCPRef.setID_Hcp(domain.getMemberOfStaff(voMOS).getHcp().getID_Hcp());
			voA.setAuthoringHcp(domain.getHcpLiteById(voHCPRef));
		}
		form.ccAuthoring().setValue(voA);
		form.cmbReason().setValue(form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getSecondOpinionCategory());
		
		form.ccAuthoring().setEnabledAuthoringHCP(false);
		form.ccAuthoring().setEnabledDateTime(false);
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize() throws FormOpenException
{
	// Set the procedure as the clinical coding
	form.ccClinicalProcedure().setCodingItemType(CodingItemType.PROCEDURE);
	form.ccClinicalProcedure().setHotlist(Boolean.FALSE);

	// Remove BOTH value from theatre type lookup
	form.cmbTheatreType().removeRow(TheatreType.BOTH);
	
	// Initialise the Authoring Component
	form.ccAuthoring().setIsRequiredPropertyToControls(true);
			
	form.getLocalContext().setAssessment(null);

	initDynGridComments();
	
	Object hcpLiteUser = domain.getHcpLiteUser();
	
	if (hcpLiteUser instanceof HcpLiteVo)
	{
		form.getLocalContext().setLoggedInHcp((HcpRefVo) hcpLiteUser);
	}
	
	// WDEV-11667 - Initialise MosQuery component to work with HCP of type Medic
	form.ccNamedSurgeon().initialize(MosType.MEDIC);
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize() throws ims.framework.exceptions.FormOpenException
{
	super.initialize();
	// -------------------------------------------
	form.getLocalContext().setCurrentRecord(null);
	// -------------------------------------------
	form.ccAuthInfo().setIsRequiredPropertyToControls(true);

	form.getLocalContext().setisAnaesthetist(false);

	Object medic = domain.getHcpUser();

	if (medic instanceof MedicVo)
	{
		if (((MedicVo) medic).getMedicTypeIsNotNull() && ((MedicVo) medic).getMedicType().equals(HcpDisType.ANAESTHETIST))
		{
			form.getLocalContext().setisAnaesthetist(true);
		}
	}
	form.getLocalContext().setLoggedInHcp(medic instanceof HcpRefVo ? (HcpRefVo) medic : null);

	initGridComments();
}
 
Example 21
Project: AvoinApotti   File: PlannedPerformedProcedureDialogImpl.java   Source Code and License 6 votes vote down vote up
public MedicLiteVo getMedicLiteVo(HcpRefVo hcp)
{
	if( hcp == null )
		return null;
	
	DomainFactory factory = getDomainFactory();
	List medics = factory.find("select m1_1 from Medic as m1_1 left join m1_1.mos as m2_1 left join m2_1.hcp as h1_1 where 	(h1_1.id = :hcpId)", new String[] {"hcpId"}, new Object[] {hcp.getID_Hcp()});
	 
	 
	if( medics != null && medics.size() > 0)
	{
		MedicLiteVoCollection tempColl = MedicLiteVoAssembler.createMedicLiteVoCollectionFromMedic(medics);
		if( tempColl != null && tempColl.size() > 0)
			return tempColl.get(0);
	}
		
	return null;
}
 
Example 22
Project: AvoinApotti   File: OperationDetailsConfigImpl.java   Source Code and License 6 votes vote down vote up
public SurgicalOperationDetailsConfigVo getSUrgicalOperationDetailsConfig(HcpRefVo hcp, ProcedureRefVo procedure) //WDEV-12111
{
	String hql = "select sodc from SurgicalOperationDetailsConfig as sodc left join sodc.procedureReference as proc left join sodc.surgeon as hcp"; 
	String where = "proc.id = :procId";
	ArrayList<String> pN = new ArrayList<String>();
	ArrayList<Object> pV = new ArrayList<Object>();
	pN.add("procId");
	pV.add(procedure.getID_Procedure());
	if (hcp!=null)
	{
		where+=" and hcp.id = :hcpId";
		pN.add("hcpId");
		pV.add(hcp.getID_Hcp());
	}
	else
	{
		where+=" and hcp is null";
	}
		
	hql +=" where ("+where+")";
	List HCPvo =getDomainFactory().find(hql,pN,pV);
	if(HCPvo.size() > 0)
		return SurgicalOperationDetailsConfigVoAssembler.create((SurgicalOperationDetailsConfig) HCPvo.get(0));
	return null;
}
 
Example 23
Project: AvoinApotti   File: EDischargeMedsSthkDialogImpl.java   Source Code and License 6 votes vote down vote up
public MedicationLiteVoCollection listMedicationHotlist(String text, HcpRefVo hcp) throws DomainInterfaceException//WDEV-11888//WDEV-11979
{
	//	WDEV-11979 - Start
	String hql = "select distinct med from MedicationFavourtiesForHCP as medFav left join medFav.hCP as hcp " +
			"left join medFav.medication as med left join med.keywords as kw where " +
			"(hcp.id = :hcpId and med.isActive = 1 and medFav.isRIE is null)";
	ArrayList<String> names = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	names.add("hcpId");
	values.add(hcp.getID_Hcp());
	return MedicationLiteVoAssembler.createMedicationLiteVoCollectionFromMedication(Keywords.searchByKeywords(getDomainFactory(), text, hql, names, values));
	//WDEV-11979 - End
	/*WDEV-11979
	String hql = "select distinct med from MedicationHotlist as medhot left join medhot.user as usr " +
			"left join medhot.hotListItem as hli left join hli.medication as med left join med.keywords as kw where" +
			"(medhot.user.id = :medicId and med.isActive = :active)" ;
	ArrayList<String> names = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	names.add("medicId");
	values.add(hcp.getID_Hcp());
	names.add("active");
	values.add(true);
	return MedicationLiteVoAssembler.createMedicationLiteVoCollectionFromMedication(Keywords.searchByKeywords(getDomainFactory(), text, hql, names, values));
	*/
}
 
Example 24
Project: AvoinApotti   File: EDischargeMedsSthkDialogImpl.java   Source Code and License 6 votes vote down vote up
public MedicationLiteVoCollection listFrequentMedications(Integer count, HcpRefVo hcp)//WDEV-11979
{
	if (hcp == null || !hcp.getID_HcpIsNotNull())
		throw new DomainRuntimeException("Provided Hcp is invalid");
	if (count == null || count < 1)
		throw new DomainRuntimeException("Count must be 1 or greater");
	
	String hql = "select medcation from MedicationFavourtiesForHCP as medFav" +
			" left join medFav.hCP as hcp left join medFav.medication as medcation where " +
			"(hcp.id = :hcpId and medFav.isRIE is null and medcation.isActive = 1) order by medFav.count desc, upper(medcation.medicationName) asc ";
	List dos = getDomainFactory().find(hql,"hcpId",(Object)hcp.getID_Hcp());
	if (dos == null || dos.size() == 0)
		return null;
	int i = 0 ;
	MedicationLiteVoCollection coll = new MedicationLiteVoCollection();
	while (coll.size() < count && i < dos.size())
	{
		coll.add(MedicationLiteVoAssembler.create((Medication) dos.get(i)));
		i++;
	}
		
	return coll;
}
 
Example 25
Project: openMAXIMS   File: RadioTherapyDetailsImpl.java   Source Code and License 6 votes vote down vote up
public MedicVo getMedic(HcpRefVo hcpId) 
{
	if(hcpId == null)
		throw new CodingRuntimeException("HCP id must not be null ");
	
	

	DomainFactory factory = getDomainFactory();
	String hql = "from Medic as m1_1 where m1_1.id = :idHCP";
	List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {hcpId.getID_Hcp()});
	if(list != null && list.size() > 0)
	{
		MedicVoCollection voColl =  MedicVoAssembler.createMedicVoCollectionFromMedic(list);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 26
Project: openmaxims-linux   File: SessionAdminImpl.java   Source Code and License 6 votes vote down vote up
public Boolean hasSelectedOwnerProcedures(HcpRefVo ownerId, String procedureList)
{
	if (ownerId == null || !ownerId.getID_HcpIsNotNull())
		throw new CodingRuntimeException("Cannot count performed procedures on null HCP id.");

	if (procedureList == null || procedureList.length() == 0)
		return true;

	DomainFactory factory = getDomainFactory();
	String query = "select count(pp.id) from ProceduresPerformedByHCP as pp left join pp.procedures as p where (pp.performingHCP.id = :hcpId and p.id in (" + procedureList + "))";

	Object[] count = factory.find(query, new String[]{"hcpId"}, new Object[]{ownerId.getID_Hcp()}).toArray();

	if (count != null && count.length > 0 && ((Long) count[0]).intValue() > 0)
		return true;

	return false;
}
 
Example 27
Project: openmaxims-linux   File: ClinicalAdmissionImpl.java   Source Code and License 6 votes vote down vote up
public NurseVo getNurse(HcpRefVo id) 
{	
	if(id == null)
		throw new CodingRuntimeException("HCP id must not be null ");
	
	DomainFactory factory = getDomainFactory();
	String hql = "from Nurse as n1_1 where n1_1.id = :idHCP";
	List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {id.getID_Hcp()});
	if(list != null && list.size() > 0)
	{
		NurseVoCollection voColl =  NurseVoAssembler.createNurseVoCollectionFromNurse(list);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void searchWaitingForClinicianReview() 
{
	clearScreen();
	
	HcpRefVo hcp = null;
	if(form.getLocalContext().getLoggedHcpIsNotNull() && GroupClinicianReviewEnumeration.rdoMyAllocated.equals(form.GroupClinicianReview().getValue()))
	{
		hcp = form.getLocalContext().getLoggedHcp();
	}
	
	TrackingListForClinicianWorklistVoCollection patients = domain.listPatientsWaiting(engine.getCurrentLocation(), TrackingStatus.WAITING_TO_BE_SEEN_BY_A_MEDIC, hcp);
	
	if(patients == null)
		return;
	
	populatePatientsWaitingForTriage(patients.sort(new TrackingComparator()));
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientDocumentSearchListVoCollection listPatientDocumentsAndDisplayNoResultError()
{
	PatientDocumentSearchListVoCollection patDocs = domain.listPatientDocuments(
				form.getGlobalContext().Core.getPatientShort(),form.cmbEpisodes().getValue(), 
				form.cmbSpecialty().getValue(),  form.ccMos().getValue() instanceof HcpRefVo ? (HcpRefVo) form.ccMos().getValue() : null, 
				form.dteFrom().getValue(), form.dteTo().getValue(), 
				form.cmbDocType().getValue(), form.ccResponsibleHcp().getValue() instanceof HcpRefVo ? (HcpRefVo) form.ccResponsibleHcp().getValue() : null,GroupDateEnumeration.rdoGenerated.equals(form.GroupDate().getValue())?true:null);

	if (patDocs == null || patDocs.size() == 0)
	{
		engine.showMessage("No documents matching your search criteria were found !", "No results",MessageButtons.OK, MessageIcon.INFORMATION);
		return null;
	}
	
	return patDocs;
}
 
Example 30
Project: openMAXIMS   File: EDischargeMedsSthkDialogImpl.java   Source Code and License 6 votes vote down vote up
public MedicationLiteVoCollection listMedicationHotlist(String text, HcpRefVo hcp) throws DomainInterfaceException//WDEV-11888//WDEV-11979
{
	//	WDEV-11979 - Start
	String hql = "select distinct med from MedicationFavourtiesForHCP as medFav left join medFav.hCP as hcp " +
			"left join medFav.medication as med left join med.keywords as kw where " +
			"(hcp.id = :hcpId and med.isActive = 1 and medFav.isRIE is null)";
	ArrayList<String> names = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	names.add("hcpId");
	values.add(hcp.getID_Hcp());
	return MedicationLiteVoAssembler.createMedicationLiteVoCollectionFromMedication(Keywords.searchByKeywords(getDomainFactory(), text, hql, names, values));
	//WDEV-11979 - End
	/*WDEV-11979
	String hql = "select distinct med from MedicationHotlist as medhot left join medhot.user as usr " +
			"left join medhot.hotListItem as hli left join hli.medication as med left join med.keywords as kw where" +
			"(medhot.user.id = :medicId and med.isActive = :active)" ;
	ArrayList<String> names = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	names.add("medicId");
	values.add(hcp.getID_Hcp());
	names.add("active");
	values.add(true);
	return MedicationLiteVoAssembler.createMedicationLiteVoCollectionFromMedication(Keywords.searchByKeywords(getDomainFactory(), text, hql, names, values));
	*/
}
 
Example 31
Project: openmaxims-linux   File: RadioTherapyDetailsImpl.java   Source Code and License 6 votes vote down vote up
public MedicVo getMedic(HcpRefVo hcpId) 
{
	if(hcpId == null)
		throw new CodingRuntimeException("HCP id must not be null ");
	
	

	DomainFactory factory = getDomainFactory();
	String hql = "from Medic as m1_1 where m1_1.id = :idHCP";
	List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {hcpId.getID_Hcp()});
	if(list != null && list.size() > 0)
	{
		MedicVoCollection voColl =  MedicVoAssembler.createMedicVoCollectionFromMedic(list);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void searchWaitingForClinicianReview() 
{
	clearScreen();
	
	HcpRefVo hcp = null;
	if(form.getLocalContext().getLoggedHcpIsNotNull() && GroupClinicianReviewEnumeration.rdoMyAllocated.equals(form.GroupClinicianReview().getValue()))
	{
		hcp = form.getLocalContext().getLoggedHcp();
	}
	
	TrackingListForClinicianWorklistVoCollection patients = domain.listPatientsWaiting(engine.getCurrentLocation(), TrackingStatus.WAITING_TO_BE_SEEN_BY_A_MEDIC, hcp);
	
	if(patients == null)
		return;
	
	populatePatientsWaitingForTriage(patients.sort(new TrackingComparator()));
}
 
Example 33
Project: openMAXIMS   File: OperationDetailsConfigImpl.java   Source Code and License 6 votes vote down vote up
public SurgicalOperationDetailsConfigVo getSUrgicalOperationDetailsConfig(HcpRefVo hcp, ProcedureRefVo procedure) //WDEV-12111
{
	String hql = "select sodc from SurgicalOperationDetailsConfig as sodc left join sodc.procedureReference as proc left join sodc.surgeon as hcp"; 
	String where = "proc.id = :procId";
	ArrayList<String> pN = new ArrayList<String>();
	ArrayList<Object> pV = new ArrayList<Object>();
	pN.add("procId");
	pV.add(procedure.getID_Procedure());
	if (hcp!=null)
	{
		where+=" and hcp.id = :hcpId";
		pN.add("hcpId");
		pV.add(hcp.getID_Hcp());
	}
	else
	{
		where+=" and hcp is null";
	}
		
	hql +=" where ("+where+")";
	List HCPvo =getDomainFactory().find(hql,pN,pV);
	if(HCPvo.size() > 0)
		return SurgicalOperationDetailsConfigVoAssembler.create((SurgicalOperationDetailsConfig) HCPvo.get(0));
	return null;
}
 
Example 34
Project: openMAXIMS   File: RadioTherapyDetailsImpl.java   Source Code and License 6 votes vote down vote up
public MedicVo getMedic(HcpRefVo hcpId) 
{
	if(hcpId == null)
		throw new CodingRuntimeException("HCP id must not be null ");
	
	

	DomainFactory factory = getDomainFactory();
	String hql = "from Medic as m1_1 where m1_1.id = :idHCP";
	List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {hcpId.getID_Hcp()});
	if(list != null && list.size() > 0)
	{
		MedicVoCollection voColl =  MedicVoAssembler.createMedicVoCollectionFromMedic(list);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize(ims.core.patient.vo.PatientRefVo patient, ims.core.admin.vo.EpisodeOfCareRefVo episodeOfCare, ims.core.admin.vo.CareContextRefVo careContext, ClinicalProblemRefVo presentingProblem)
{
	form.getLocalContext().setIsEnabled(true);
	
	form.getLocalContext().setPatient(patient);
	form.getLocalContext().setEpisodeOfCare(episodeOfCare);
	form.getLocalContext().setCareContext(careContext);
	form.getLocalContext().setPresentingProblem(presentingProblem);
	
	Object hcp = domain.getHcpLiteUser();
	if(hcp instanceof HcpRefVo)
	{
		form.getLocalContext().setLoggedHCP((HcpRefVo) hcp);
	}
	
	open();
}
 
Example 36
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	//WDEV-17304
	Object hcp = domain.getHcpLiteUser();
	if (hcp !=null && hcp instanceof HcpLiteVo)
	{
		form.getLocalContext().setLoggedHCP((HcpRefVo) hcp);
	}
	
	initializeControls();
	form.getLocalContext().setTrackingForReferral(domain.getTrackingForReferral(form.getGlobalContext().Emergency.getTracking()));
	form.getLocalContext().setPrimaryIDFromPASProviderSystem(domain.getPrimaryIDFromProviderSystem(Category.PAS));  //WDEV-23527
	open();
	
	if(form.getLocalContext().getSelectedReferralToSpecialty() == null || form.getLocalContext().getSelectedReferralToSpecialty().getCompletionDateTimeIsNotNull() || Boolean.TRUE.equals(form.getLocalContext().getSelectedReferralToSpecialty().getNotAccepted()))
	{
		newInstance();
	}
}
 
Example 37
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onCmbTrackingStatusValueChanged() throws PresentationLogicException 
{
	clearcontrols();
	//WDEV-18293

	HcpRefVo hcp = null;
	if (form.getLocalContext().getLoggedHcp() != null && GroupClinicianWorklistFilterEnumeration.rdoClinicianMyAllocated.equals(form.lyrWorklist().tabClinicianWorklist().GroupClinicianWorklistFilter().getValue()))
	{
		hcp = form.getLocalContext().getLoggedHcp();
	}
	
	TrackingForDisplayClinicianAndTriageWorklistVoCollection patientsWaiting = domain.listTrackingPatients(hcp, form.lyrWorklist().tabClinicianWorklist().cmbAreas().getValue(),form.lyrWorklist().tabClinicianWorklist().cmbTrackingStatus().getValue() , domain.getCurrentLocation()); 
	if( form.lyrWorklist().tabClinicianWorklist().cmbAreas().getValue() != null) //wdev-17326
	{
		getClinicianSearchCriteria();
	}

	
	
	populategrdClinicianWorklist(patientsWaiting);

	
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException
{
	if(form.lyrDetails().tabListOwners().grdListOwner().getRows().size() == 0)
		return;
	
	row.getcolProcedure().clear();
	
	HcpRefVoCollection voCollHcp = new HcpRefVoCollection();
	for(int i=0;i<form.lyrDetails().tabListOwners().grdListOwner().getRows().size();i++)
		voCollHcp.add ((HcpRefVo) form.lyrDetails().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue());

	ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text);
	if(voCollProcedure != null)
	{
		for(ProcedureLiteVo voProc : voCollProcedure)
			row.getcolProcedure().newRow(voProc, voProc.getProcedureName());
		
		if(voCollProcedure.size() > 1)
			row.getcolProcedure().showOpened();
		else if(voCollProcedure.size() == 1)
			row.getcolProcedure().setValue(voCollProcedure.get(0));
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 39
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize() throws FormOpenException
{
	// Set the procedure as the clinical coding
	form.ccClinicalProcedure().setCodingItemType(CodingItemType.PROCEDURE);
	form.ccClinicalProcedure().setHotlist(Boolean.FALSE);

	// Remove BOTH value from theatre type lookup
	form.cmbTheatreType().removeRow(TheatreType.BOTH);
	
	// Initialise the Authoring Component
	form.ccAuthoring().setIsRequiredPropertyToControls(true);
			
	form.getLocalContext().setAssessment(null);

	initDynGridComments();
	
	Object hcpLiteUser = domain.getHcpLiteUser();
	
	if (hcpLiteUser instanceof HcpLiteVo)
	{
		form.getLocalContext().setLoggedInHcp((HcpRefVo) hcpLiteUser);
	}
	
	// WDEV-11667 - Initialise MosQuery component to work with HCP of type Medic
	form.ccNamedSurgeon().initialize(MosType.MEDIC);
}
 
Example 40
Project: openmaxims-linux   File: OperationDetailsConfigImpl.java   Source Code and License 6 votes vote down vote up
public SurgicalOperationDetailsConfigVo getSUrgicalOperationDetailsConfig(HcpRefVo hcp, ProcedureRefVo procedure) //WDEV-12111
{
	String hql = "select sodc from SurgicalOperationDetailsConfig as sodc left join sodc.procedureReference as proc left join sodc.surgeon as hcp"; 
	String where = "proc.id = :procId";
	ArrayList<String> pN = new ArrayList<String>();
	ArrayList<Object> pV = new ArrayList<Object>();
	pN.add("procId");
	pV.add(procedure.getID_Procedure());
	if (hcp!=null)
	{
		where+=" and hcp.id = :hcpId";
		pN.add("hcpId");
		pV.add(hcp.getID_Hcp());
	}
	else
	{
		where+=" and hcp is null";
	}
		
	hql +=" where ("+where+")";
	List HCPvo =getDomainFactory().find(hql,pN,pV);
	if(HCPvo.size() > 0)
		return SurgicalOperationDetailsConfigVoAssembler.create((SurgicalOperationDetailsConfig) HCPvo.get(0));
	return null;
}
 
Example 41
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize(ims.core.patient.vo.PatientRefVo patient, ims.core.admin.vo.EpisodeOfCareRefVo episodeOfCare, ims.core.admin.vo.CareContextRefVo careContext, ClinicalProblemRefVo presentingProblem)
{
	form.getLocalContext().setIsEnabled(true);
	
	form.getLocalContext().setPatient(patient);
	form.getLocalContext().setEpisodeOfCare(episodeOfCare);
	form.getLocalContext().setCareContext(careContext);
	form.getLocalContext().setPresentingProblem(presentingProblem);
	
	Object hcp = domain.getHcpLiteUser();
	if(hcp instanceof HcpRefVo)
	{
		form.getLocalContext().setLoggedHCP((HcpRefVo) hcp);
	}
	
	open();
}
 
Example 42
Project: openMAXIMS   File: SessionAdminImpl.java   Source Code and License 6 votes vote down vote up
public Boolean hasSelectedOwnerProcedures(HcpRefVo ownerId, String procedureList)
{
	if (ownerId == null || !ownerId.getID_HcpIsNotNull())
		throw new CodingRuntimeException("Cannot count performed procedures on null HCP id.");

	if (procedureList == null || procedureList.length() == 0)
		return true;

	DomainFactory factory = getDomainFactory();
	String query = "select count(pp.id) from ProceduresPerformedByHCP as pp left join pp.procedures as p where (pp.performingHCP.id = :hcpId and p.id in (" + procedureList + "))";

	Object[] count = factory.find(query, new String[]{"hcpId"}, new Object[]{ownerId.getID_Hcp()}).toArray();

	if (count != null && count.length > 0 && ((Long) count[0]).intValue() > 0)
		return true;

	return false;
}
 
Example 43
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException
{
	if(form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size() == 0)
		return;
	
	row.getcolProcedure().clear();
	
	HcpRefVoCollection voCollHcp = new HcpRefVoCollection();
	for(int i=0;i<form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size();i++)
		voCollHcp.add ((HcpRefVo) form.lyrSessEdit().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue());

	ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text);
	if(voCollProcedure != null)
	{
		for(ProcedureLiteVo voProc : voCollProcedure)
			row.getcolProcedure().newRow(voProc, voProc.getProcedureName());
		
		if(voCollProcedure.size() > 1)
			row.getcolProcedure().showOpened();
		else if(voCollProcedure.size() == 1)
			row.getcolProcedure().setValue(voCollProcedure.get(0));
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 44
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize() throws FormOpenException
{
	// Set the procedure as the clinical coding
	form.ccClinicalProcedure().setCodingItemType(CodingItemType.PROCEDURE);
	form.ccClinicalProcedure().setHotlist(Boolean.FALSE);

	// Remove BOTH value from theatre type lookup
	//form.cmbTheatreType().removeRow(TheatreType.BOTH);	//wdev-20233
	
	// Initialise the Authoring Component
	form.ccAuthoring().setIsRequiredPropertyToControls(true);
			
	form.getLocalContext().setAssessment(null);

	initDynGridComments();
	
	Object hcpLiteUser = domain.getHcpLiteUser();
	
	if (hcpLiteUser instanceof HcpLiteVo)
	{
		form.getLocalContext().setLoggedInHcp((HcpRefVo) hcpLiteUser);
	}
	
	// WDEV-11667 - Initialise MosQuery component to work with HCP of type Medic
	form.ccNamedSurgeon().initialize(MosType.MEDIC);
}
 
Example 45
Project: openMAXIMS   File: ReferralStatusListImpl.java   Source Code and License 6 votes vote down vote up
public ServiceShortVoCollection listServicesForLoggedHCP(HcpRefVo hcp)
{
	if(hcp == null || hcp.getID_Hcp() == null)
		return null;
	
	//WDEV-20710
	ArrayList<String> paramName= new ArrayList<String>();
	ArrayList<Object> paramValue = new ArrayList<Object>();
	
	String query = "select s from Hcp as h left join h.serviceFunction as hsf left join hsf.service as s, ReferralService as rs left join rs.referralServices as rss where hsf.isActive = :isActive and s.id = rss.id and h.id = :HcpId order by s.upperName asc";
	
	paramName.add("HcpId");		paramValue.add(hcp.getID_Hcp());
	paramName.add("isActive");		paramValue.add(Boolean.TRUE);
	List serviceList = getDomainFactory().find(query, paramName, paramValue);
	//WDEV-20710 ends here
	
	
	return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(serviceList);
}
 
Example 46
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize() throws FormOpenException
{
	// Set the procedure as the clinical coding
	form.ccClinicalProcedure().setCodingItemType(CodingItemType.PROCEDURE);
	form.ccClinicalProcedure().setHotlist(Boolean.FALSE);

	// Remove BOTH value from theatre type lookup
	form.cmbTheatreType().removeRow(TheatreType.BOTH);
	
	// Initialise the Authoring Component
	form.ccAuthoring().setIsRequiredPropertyToControls(true);
			
	form.getLocalContext().setAssessment(null);

	initDynGridComments();
	
	Object hcpLiteUser = domain.getHcpLiteUser();
	
	if (hcpLiteUser instanceof HcpLiteVo)
	{
		form.getLocalContext().setLoggedInHcp((HcpRefVo) hcpLiteUser);
	}
	
	// WDEV-11667 - Initialise MosQuery component to work with HCP of type Medic
	form.ccNamedSurgeon().initialize(MosType.MEDIC);
}
 
Example 47
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private EpisodeOfCareForRequestServiceShortVo createEpisodeOfCare(CareSpellForRequestServiceShortVo careSpell, DateTime startDateTime, HcpRefVo responsibleHCP, Specialty specialty)
{
	EpisodeOfCareForRequestServiceShortVo episodeOfCare = new EpisodeOfCareForRequestServiceShortVo();
	
	episodeOfCare.setStartDate(startDateTime.getDate());

	episodeOfCare.setCareSpell(careSpell);
	episodeOfCare.setRelationship(CareSpelltoEpisodeRelationship.PRIMARY);

	episodeOfCare.setSpecialty(specialty);
	episodeOfCare.setResponsibleHCP(responsibleHCP);		
	
	EpisodeOfCareStatusHistoryVo firstStatus = new EpisodeOfCareStatusHistoryVo();
	firstStatus.setStatus(EpisodeOfCareStatus.OPEN);
	firstStatus.setStatusDateTime(startDateTime);
	
	episodeOfCare.setCurrentStatus(firstStatus);
	episodeOfCare.setStatusHistory(new EpisodeOfCareStatusHistoryRefVoCollection());
	episodeOfCare.getStatusHistory().add(firstStatus);
	
	if (careSpell.getEpisodes() == null) careSpell.setEpisodes(new EpisodeOfCareForRequestServiceShortVoCollection());
	careSpell.getEpisodes().add(episodeOfCare);
	
	return episodeOfCare;
}
 
Example 48
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private CareContextForRequestServiceShortVo createCareContext(EpisodeOfCareForRequestServiceShortVo episodeOfCare, ContextType contextType, DateTime startDateTime, HcpRefVo responsibleHCP)
	{
		CareContextForRequestServiceShortVo careContext = new CareContextForRequestServiceShortVo();
		
		careContext.setContext(contextType);
		
		careContext.setStartDateTime(startDateTime);
		careContext.setEndDateTime(null);
		careContext.setEpisodeOfCare(episodeOfCare);
		
		CareContextStatusHistoryVo firstStatus = new CareContextStatusHistoryVo();
		firstStatus.setStatus(CareContextStatus.OPEN);
		firstStatus.setStatusDateTime(startDateTime);
		
//		careContext.setCurrentStatus(firstStatus);
//		careContext.setStatusHistory(new CareContextStatusHistoryVoCollection());
//		careContext.getStatusHistory().add(firstStatus);
		
		if (episodeOfCare.getCareContexts() == null) episodeOfCare.setCareContexts(new CareContextForRequestServiceShortVoCollection());
		episodeOfCare.getCareContexts().add(careContext);
		
		return careContext;
	}
 
Example 49
Project: openMAXIMS   File: EDischargeMedsSthkDialogImpl.java   Source Code and License 6 votes vote down vote up
public MedicationLiteVoCollection listFrequentMedications(Integer count, HcpRefVo hcp)//WDEV-11979
{
	if (hcp == null || !hcp.getID_HcpIsNotNull())
		throw new DomainRuntimeException("Provided Hcp is invalid");
	if (count == null || count < 1)
		throw new DomainRuntimeException("Count must be 1 or greater");
	
	String hql = "select medcation from MedicationFavourtiesForHCP as medFav" +
			" left join medFav.hCP as hcp left join medFav.medication as medcation where " +
			"(hcp.id = :hcpId and medFav.isRIE is null and medcation.isActive = 1) order by medFav.count desc, upper(medcation.medicationName) asc ";
	List dos = getDomainFactory().find(hql,"hcpId",(Object)hcp.getID_Hcp());
	if (dos == null || dos.size() == 0)
		return null;
	int i = 0 ;
	MedicationLiteVoCollection coll = new MedicationLiteVoCollection();
	while (coll.size() < count && i < dos.size())
	{
		coll.add(MedicationLiteVoAssembler.create((Medication) dos.get(i)));
		i++;
	}
		
	return coll;
}
 
Example 50
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize() 
{
	if(engine.getCurrentLocation() != null)
	{
		form.getLocalContext().setAttendanceKPIConfig(domain.getAttendanceKPIConfigForClinicianWorklist(engine.getCurrentLocation()));
	}
	
	Object user = domain.getHcpLiteUser();
	if(user instanceof HcpRefVo)
	{
		form.getLocalContext().setLoggedHcp((HcpRefVo) user);
	}
	
	//form.GroupClinicianReview().setValue(GroupClinicianReviewEnumeration.rdoAll);
	createPatientGridColumns();
	
	form.lyrPatientTriage().tabPathway().ccICP().initialize();
		
	if(form.getGlobalContext().Core.getCurrentCareContext() != null)
	{
		form.getLocalContext().setSelectedWaitingPatient(domain.getTrackingForClinicianWorklistByCareContext(form.getGlobalContext().Core.getCurrentCareContext()));
	}
}
 
Example 51
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize() 
{
	if(engine.getCurrentLocation() != null)
	{
		form.getLocalContext().setAttendanceKPIConfig(domain.getAttendanceKPIConfigForClinicianWorklist(engine.getCurrentLocation()));
	}
	
	Object user = domain.getHcpLiteUser();
	if(user instanceof HcpRefVo)
	{
		form.getLocalContext().setLoggedHcp((HcpRefVo) user);
	}
	
	//form.GroupClinicianReview().setValue(GroupClinicianReviewEnumeration.rdoAll);
	createPatientGridColumns();
	
	form.lyrPatientTriage().tabPathway().ccICP().initialize();
		
	if(form.getGlobalContext().Core.getCurrentCareContext() != null)
	{
		form.getLocalContext().setSelectedWaitingPatient(domain.getTrackingForClinicianWorklistByCareContext(form.getGlobalContext().Core.getCurrentCareContext()));
	}
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open()
{
	if (form.getGlobalContext().RefMan.getSecondOpinionReferralStatusIsNotNull()
		&& form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getReferralStatusIsNotNull()
		&& form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getReferralStatus().equals(ReferralApptStatus.PROVISIONAL_REJECTION))
	{
		form.txtComment().setValue(form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getComment());
		AuthoringInformationVo voA = new AuthoringInformationVo();
		voA.setAuthoringDateTime(form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getStatusDateTime());
		if (form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getAuthoringUserIsNotNull())
		{
			MemberOfStaffShortVo voMOS = new MemberOfStaffShortVo();
			voMOS.setID_MemberOfStaff(form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getAuthoringUser().getID_MemberOfStaff());
			HcpRefVo voHCPRef = new HcpRefVo();
			voHCPRef.setID_Hcp(domain.getMemberOfStaff(voMOS).getHcp().getID_Hcp());
			voA.setAuthoringHcp(domain.getHcpLiteById(voHCPRef));
		}
		form.ccAuthoring().setValue(voA);
		form.cmbReason().setValue(form.getGlobalContext().RefMan.getSecondOpinionReferralStatus().getSecondOpinionCategory());
		
		form.ccAuthoring().setEnabledAuthoringHCP(false);
		form.ccAuthoring().setEnabledDateTime(false);
	}
}
 
Example 53
Project: AvoinApotti   File: NeedsAssessmentImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcpLite(HcpRefVo hcpRefVo)
{
	if(hcpRefVo == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	return HcpLiteVoAssembler.create((Hcp)factory.getDomainObject(Hcp.class, hcpRefVo.getID_Hcp()));
}
 
Example 54
Project: AvoinApotti   File: CancerContactImpl.java   Source Code and License 5 votes vote down vote up
public Hcp getHCP(HcpRefVo hcpRefVo) 
{
	DomainFactory factory = getDomainFactory();
	ims.core.resource.people.domain.objects.Hcp doHcp = (ims.core.resource.people.domain.objects.Hcp) factory.getDomainObject(ims.core.resource.people.domain.objects.Hcp.class, hcpRefVo.getID_Hcp());

	if (Medic.class.isAssignableFrom(doHcp.getClass()))
		return MedicVoAssembler.create((Medic) doHcp);
	else if (doHcp instanceof Therapist)
		return TherapistVoAssembler.create((Therapist)doHcp);
	else if (doHcp instanceof Nurse)
		return NurseVoAssembler.create((Nurse) doHcp);

	return HcpAssembler.create(doHcp);		
}
 
Example 55
Project: AvoinApotti   File: CareSpellDialogImpl.java   Source Code and License 5 votes vote down vote up
public Specialty getDefaultSpecialtyForHcp(HcpRefVo hcp)
{
	String hql = "select med.specialty.id from Medic as med where med.id = :idMedic ";
	
	List specialtyIds = getDomainFactory().find(hql, new String[] {"idMedic"}, new Object[] {hcp.getID_Hcp()});
	if(specialtyIds != null && specialtyIds.size() == 1)
	{
		if(specialtyIds.get(0) != null)
			return LookupHelper.getSpecialtyInstance(getLookupService(), ((Integer)specialtyIds.get(0)).intValue());
	}
		
	return null;
}
 
Example 56
Project: AvoinApotti   File: HourlyFluidBalanceDetailsImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcpLiteById(HcpRefVo refId) 
{
	if(refId == null)
		throw new CodingRuntimeException("null refId 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, refId.getID_Hcp());
	
	return HcpLiteVoAssembler.create(boHcp);
}
 
Example 57
Project: AvoinApotti   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedic(HcpRefVo hcp)
{
	if (hcp == null || hcp.getID_Hcp() == null)
		return null;
	
	String query = "SELECT medic FROM Medic AS medic WHERE medic.id = :ID";

	return MedicVoAssembler.create((Medic) getDomainFactory().findFirst(query, "ID", hcp.getID_Hcp()));
}
 
Example 58
Project: AvoinApotti   File: InpatientListImpl.java   Source Code and License 5 votes vote down vote up
private InpatientEpisodeVoCollection listInpatients(PatientRefVo patient, LocationRefVo hospital, LocationRefVo ward, HcpRefVo consultant, MedicLiteVo voMedic,Specialty specialty)//m
{
	if(ConfigFlag.DOM.INPATIENT_SEARCH_TYPE.getValue().equals("LOCAL"))   
		return listInpatientsHibernate(patient, hospital, ward, consultant,specialty);
	else if(ConfigFlag.DOM.INPATIENT_SEARCH_TYPE.getValue().equals("DTO"))
		return listInpatientsDTO(patient, hospital, ward, consultant,specialty);
	
	return null;
}
 
Example 59
Project: AvoinApotti   File: InpatientListImpl.java   Source Code and License 5 votes vote down vote up
private MedicWithMappingsLiteVo getMedicWithMappingsLiteVo(HcpRefVo consultant) {
	DomainFactory factory = getDomainFactory();
	if(consultant != null && consultant.getID_HcpIsNotNull()){
		DomainObject medic = factory.getDomainObject(Medic.class, consultant.getID_Hcp());
		if(medic!=null)
			return MedicWithMappingsLiteVoAssembler.create((Medic)medic);
	}

	return null;
}
 
Example 60
Project: AvoinApotti   File: ProceduresPerformedByHCPImpl.java   Source Code and License 5 votes vote down vote up
public ServiceLiteVoCollection getAvailableServices(HcpRefVo hcp) 
{
	DomainFactory factory=getDomainFactory();
	IMSCriteria imsc=new IMSCriteria (ProceduresPerformedByHCP.class,factory);
	imsc.equal("performingHCP.id", hcp.getID_Hcp());
	List procedures=imsc.find();
	Vector<ServiceLiteVo> services=new Vector <ServiceLiteVo>();
	for (int i=0;i<procedures.size();i++)
	{
		ProceduresPerformedByHCP proc = (ProceduresPerformedByHCP) procedures.get(i);
		if (proc.getService()!=null)
			services.add(ServiceLiteVoAssembler.create(proc.getService()));
	}
	ServiceLiteVoCollection servs=this.listActiveServices();
	ServiceLiteVoCollection servs2=new ServiceLiteVoCollection();
	if(servs != null)
	{
		for (int i=0;i<servs.size();i++)
		{
			if (!services.contains(servs.get(i)))
				servs2.add(servs.get(i));
		}
	}
	if (servs2.size()>0)
		return servs2;
	return null;
}