Java Code Examples for ims.scheduling.vo.lookups.TheatreType

The following are top voted examples for showing how to use ims.scheduling.vo.lookups.TheatreType. 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: MoveAppointmentDialogImpl.java   Source Code and License 6 votes vote down vote up
private TheatreType getTheatreTypeVoLookup(LookupInstance theatreType)
{
	if ( theatreType != null ) 
	{
		ims.scheduling.vo.lookups.TheatreType voLookup = new ims.scheduling.vo.lookups.TheatreType(theatreType.getId(),theatreType.getText(), theatreType.isActive(), null, null, Color.Default);
		ims.scheduling.vo.lookups.TheatreType parentVoLookup = voLookup;
		ims.domain.lookups.LookupInstance parent = theatreType.getParent();
		while (parent != null)
		{
			parentVoLookup.setParent(new ims.scheduling.vo.lookups.TheatreType(parent.getId(),parent.getText(), parent.isActive(), null, null, Color.Default));
			parentVoLookup = parentVoLookup.getParent();
			parent = parent.getParent();
		}			
		return voLookup;
	}
	return null;
}
 
Example 2
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 3
Project: openMAXIMS   File: MoveAppointmentDialogImpl.java   Source Code and License 6 votes vote down vote up
private TheatreType getTheatreTypeVoLookup(LookupInstance theatreType)
{
	if ( theatreType != null ) 
	{
		ims.scheduling.vo.lookups.TheatreType voLookup = new ims.scheduling.vo.lookups.TheatreType(theatreType.getId(),theatreType.getText(), theatreType.isActive(), null, null, Color.Default);
		ims.scheduling.vo.lookups.TheatreType parentVoLookup = voLookup;
		ims.domain.lookups.LookupInstance parent = theatreType.getParent();
		while (parent != null)
		{
			parentVoLookup.setParent(new ims.scheduling.vo.lookups.TheatreType(parent.getId(),parent.getText(), parent.isActive(), null, null, Color.Default));
			parentVoLookup = parentVoLookup.getParent();
			parent = parent.getParent();
		}			
		return voLookup;
	}
	return null;
}
 
Example 4
Project: openMAXIMS   File: MoveAppointmentDialogImpl.java   Source Code and License 6 votes vote down vote up
private TheatreType getTheatreTypeVoLookup(LookupInstance theatreType)
{
	if ( theatreType != null ) 
	{
		ims.scheduling.vo.lookups.TheatreType voLookup = new ims.scheduling.vo.lookups.TheatreType(theatreType.getId(),theatreType.getText(), theatreType.isActive(), null, null, Color.Default);
		ims.scheduling.vo.lookups.TheatreType parentVoLookup = voLookup;
		ims.domain.lookups.LookupInstance parent = theatreType.getParent();
		while (parent != null)
		{
			parentVoLookup.setParent(new ims.scheduling.vo.lookups.TheatreType(parent.getId(),parent.getText(), parent.isActive(), null, null, Color.Default));
			parentVoLookup = parentVoLookup.getParent();
			parent = parent.getParent();
		}			
		return voLookup;
	}
	return null;
}
 
Example 5
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 6
Project: openmaxims-linux   File: MoveAppointmentDialogImpl.java   Source Code and License 6 votes vote down vote up
private TheatreType getTheatreTypeVoLookup(LookupInstance theatreType)
{
	if ( theatreType != null ) 
	{
		ims.scheduling.vo.lookups.TheatreType voLookup = new ims.scheduling.vo.lookups.TheatreType(theatreType.getId(),theatreType.getText(), theatreType.isActive(), null, null, Color.Default);
		ims.scheduling.vo.lookups.TheatreType parentVoLookup = voLookup;
		ims.domain.lookups.LookupInstance parent = theatreType.getParent();
		while (parent != null)
		{
			parentVoLookup.setParent(new ims.scheduling.vo.lookups.TheatreType(parent.getId(),parent.getText(), parent.isActive(), null, null, Color.Default));
			parentVoLookup = parentVoLookup.getParent();
			parent = parent.getParent();
		}			
		return voLookup;
	}
	return null;
}
 
Example 7
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 8
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onCmbAnaestheticValueChanged() throws PresentationLogicException 
{
	if(form.cmbAnaesthetic().getValue() != null && form.cmbAnaesthetic().getValue().equals(AnaestheticType.LA))
	{
		form.cmbTheatreType().newRow(TheatreType.OP_CASE, TheatreType.OP_CASE.getText());
	}
	else
	{
		form.cmbTheatreType().removeRow(TheatreType.OP_CASE);
	}
	
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onCmbTheatreTypeValueChanged() throws PresentationLogicException
{
	boolean sessionTypeUrgent = TheatreType.EMERGENCY.equals(form.lyrDetails().tabGeneralDetails().cmbTheatreType().getValue()) || TheatreType.EMERGENCY_NON_TO.equals(form.lyrDetails().tabGeneralDetails().cmbTheatreType().getValue());
	
	if (sessionTypeUrgent)
	{
		form.lyrDetails().tabTheatre().grdTheatre().getRows().clear();
		form.lyrDetails().tabTheatre().grdTheatreService().getRows().clear();
	}
		
	updateControlState();
	
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialise()
{
	//WDEV-22760
	CatsReferralCurrentStatusVo catsReferral = domain.getCatsReferral(form.getGlobalContext().RefMan.getCatsReferral());
	boolean isAccepted = catsReferral != null && catsReferral.getCurrentStatus() != null && ReferralApptStatus.REFERRAL_ACCEPTED.equals(catsReferral.getCurrentStatus().getReferralStatus());
	boolean hasPendingEmergencyTheatre_Id = form.getGlobalContext().Scheduling.getPendingEmergencyTheatre()!= null && form.getGlobalContext().Scheduling.getPendingEmergencyTheatre().getID_PendingEmergencyTheatreIsNotNull();
	
	form.getLocalContext().setReferralResposibleHCP(catsReferral.getResponsibleHCP());
	//WDEV-22760 -- ends here
	
	if(hasPendingEmergencyTheatre_Id && !Boolean.TRUE.equals(form.getLocalContext().getDisableEditOption()))//WDEV-22769
		engine.setCaption("View/Edit Pending Emergency Theatre Details");
	else if(hasPendingEmergencyTheatre_Id && Boolean.TRUE.equals(form.getLocalContext().getDisableEditOption()))
		engine.setCaption("View Pending Emergency Theatre Details");
	else 
		engine.setCaption("Add Patient to Pending Emergency Theatre List");
	
	if(!Boolean.TRUE.equals(isAccepted))
	{
		engine.showMessage("Referral is not accepted");
		engine.close(DialogResult.CANCEL);
		return;
	}
	
	form.ccResponsibleHCP().initialize(MosType.HCP, HcpDisType.MEDICAL, Boolean.TRUE);
	form.ccResponsibleHCP().isRequired(Boolean.TRUE);
	
	form.cmbTheatreType().removeRow(TheatreType.OP_CASE);
	
	form.GroupProcedures().setValue(GroupProceduresEnumeration.rdoAllProcedures);
	showSecondProcedureControls(false);
	
	form.getLocalContext().setIsInpatient(form.getGlobalContext().Core.getPatientShort() != null && form.getGlobalContext().Core.getPatientShort().getWard() != null ? Boolean.TRUE : Boolean.FALSE);
	form.getLocalContext().setReferralService(domain.getReferralService(form.getGlobalContext().RefMan.getCatsReferral()));
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialise()
{
	form.dteFrom().setValue(new Date());
	form.dteTo().setValue(new Date());//WDEV-22462
	
	form.cmbTheatreType().removeRow(TheatreType.OP_CASE);

	loadServices();
	loadHospitals();

}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private PreAssessmentWorklistSearchCriteriaVo populateSearchCriteriaDataFromScreen()
{
	PreAssessmentWorklistSearchCriteriaVo criteria = new PreAssessmentWorklistSearchCriteriaVo();
	PatIdType dispIdType = PatIdType.getNegativeInstance(ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue());//WDEV-22781
	
	criteria.setService(form.qmbService().getValue());
	criteria.setServices(form.getGlobalContext().RefMan.getReferralServiceSearchList());
	criteria.setProcedure(form.qmbProcedure().getValue());
	criteria.setAnaestheticType(form.cmbAnaestheticType().getValue());
	criteria.setUrgency(form.cmbUrgency().getValue());
	criteria.setBreachDateFrom(form.dteBreachFrom().getValue());
	criteria.setBreachDateTo(form.dteBreachTo().getValue());
	criteria.setTheatreType(GroupTheatreEnumeration.rdoDaySurgeryTheatre.equals(form.GroupTheatre().getValue()) ? TheatreType.DAYCASE : (GroupTheatreEnumeration.rdoInpatientTheatre.equals(form.GroupTheatre().getValue()) ? TheatreType.INPATIENT : null));
	criteria.setPreAssessmentRequired(form.chkPreAssessmentRequired().getValue());
	criteria.setFitForSurgery(form.chkFitforSurgery().getValue());
	criteria.setNotFitForSurgery(form.chkNotFitforSurgery().getValue());
	criteria.setPreAssessmentOutcomePending(form.chkPreAssessmentOutcomePending().getValue());
	criteria.setWaitingFor(getSelectedWaitingForFromGrid());
	
	//WDEV-21037
	criteria.setWaitingList(form.chkWaitingList().getValue());
	criteria.setSurveillancePlannedList(form.chkSurveillancePlannedList().getValue());
	criteria.setPlannedFrom(form.dtePlannedFrom().getValue());
	criteria.setPlannedTo(form.dtePlannedTo().getValue());
	criteria.setAddedToday(form.chkAddedToday().getValue());
	criteria.setIncludeEndoscopy(form.chkIncludeEndoscopy().getValue()); //WDEV-23462
	criteria.setPastAppointment(form.chkPastAppointments().getValue());
	criteria.setFutureAppointment(form.chkFutureAppointment().getValue());
	//WDEV-22781
	criteria.setPatIdType(dispIdType);
	criteria.setPatientIdentifier(form.txtIdentifier().getValue());
	
	return criteria;
	
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialise()
{
	clearSearchCriteria(false);
	
	form.setMode(FormMode.VIEW);	
	
	loadServices();
	loadLocations();
	
	// Remove EMERGENCY value from theatre type lookup
	form.lyr1().tabSearch().cmbTheatreType().removeRow(TheatreType.EMERGENCY);	
	form.lyr1().tabSearch().cmbTheatreType().removeRow(TheatreType.EMERGENCY_NON_TO);	
	
	form.lyr1().tabSearch().lblAnaesType().setVisible(false);
	form.lyr1().tabSearch().cmbAnaesType().setVisible(false);
	if(!engine.getFormName().equals(form.getForms().RefMan.TheatreAvailability))
	{
		form.lyr1().tabSearch().qmbProcedure().setRequired(true);
		form.lyr1().tabSearch().cmbAnaesType().setVisible(true);
		form.lyr1().tabSearch().lblAnaesType().setVisible(true);
		form.lyr1().tabSearch().intRequiredProcTime().setRequired(true);

		form.lyr1().tabSearch().lblTheatres().setVisible(false);
		form.lyr1().tabSearch().cmbTheatres().setVisible(false);
	}

}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onCmbAnaestheticValueChanged() throws PresentationLogicException 
{
	if(form.cmbAnaesthetic().getValue() != null && form.cmbAnaesthetic().getValue().equals(AnaestheticType.LA))
	{
		form.cmbTheatreType().newRow(TheatreType.OP_CASE, TheatreType.OP_CASE.getText());
	}
	else
	{
		form.cmbTheatreType().removeRow(TheatreType.OP_CASE);
	}
	
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onCmbAnaestheticValueChanged() throws PresentationLogicException 
{
	if(form.cmbAnaesthetic().getValue() != null && form.cmbAnaesthetic().getValue().equals(AnaestheticType.LA))
	{
		form.cmbTheatreType().newRow(TheatreType.OP_CASE, TheatreType.OP_CASE.getText());
	}
	else
	{
		form.cmbTheatreType().removeRow(TheatreType.OP_CASE);
	}
	
}
 
Example 16
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onCmbAnaestheticValueChanged() throws PresentationLogicException 
{
	if(form.cmbAnaesthetic().getValue() != null && form.cmbAnaesthetic().getValue().equals(AnaestheticType.LA))
	{
		form.cmbTheatreType().newRow(TheatreType.OP_CASE, TheatreType.OP_CASE.getText());
	}
	else
	{
		form.cmbTheatreType().removeRow(TheatreType.OP_CASE);
	}
	
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
/**
 * 
 */
private void defaultSearchCriteria()
{
	defaultDates();
	form.lyr1().tabSearch().cmbTheatreType().setValue(TheatreType.DAYCASE);
}
 
Example 18
Project: AvoinApotti   File: TheatreListImpl.java   Source Code and License 4 votes vote down vote up
public SessionShortVoCollection listSession(Date sessionDate, HcpRefVo listOwner, LocationRefVo hospital, TheatreType theatreType)
{
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	String andStr = "";
	StringBuffer sb = new StringBuffer();

	String hql = "from Sch_Session as session left join fetch session.listOwners as lo ";

	andStr = " ";
	if (sessionDate != null)
	{
		sb.append(andStr + " session.sessionDate = :sessionDate");
		markers.add("sessionDate");
		values.add(sessionDate.getDate());
		andStr = " and ";
	}

	if (listOwner != null)
	{
		sb.append(andStr + " lo.hcp.id = :listOwner");
		markers.add("listOwner");
		values.add(listOwner.getID_Hcp());
		andStr = " and ";
	}

	if (hospital != null)
	{	
		sb.append(andStr + " ( session.schLocation.id = :locat or session.schLocation.parentLocation.id = :locat )");
		markers.add("locat");
		values.add(hospital.getID_Location());
		andStr = " and ";
	}

	sb.append(andStr + " session.isTheatreSession = :trueTheatre");
	markers.add("trueTheatre");
	values.add(Boolean.TRUE);
	andStr = " and ";

	
	if (theatreType != null)
	{
		if (theatreType.equals(TheatreType.BOTH))
		{
			sb.append(andStr + " ( session.theatreType = :stat1 or session.theatreType = :stat2 or session.theatreType = :stat3)");
			markers.add("stat3");
			values.add(getDomLookup(TheatreType.BOTH));
			markers.add("stat1");
			values.add(getDomLookup(TheatreType.INPATIENT));
			markers.add("stat2");
			values.add(getDomLookup(TheatreType.DAYCASE));
		}
		else if(theatreType.equals(TheatreType.INPATIENT) || theatreType.equals(TheatreType.DAYCASE))
		{
			sb.append(andStr + " ( session.theatreType = :stat1 or session.theatreType = :stat2)");
			markers.add("stat1");
			if (theatreType.equals(TheatreType.INPATIENT))
				values.add(getDomLookup(TheatreType.INPATIENT));
			if (theatreType.equals(TheatreType.DAYCASE))
				values.add(getDomLookup(TheatreType.DAYCASE));
			markers.add("stat2");
			values.add(getDomLookup(TheatreType.BOTH));
		}
		else
		{
			sb.append(andStr + " ( session.theatreType = :stat1)");
			markers.add("stat1");
			values.add(getDomLookup(theatreType));
		}
	}


	hql += " where " ;
	hql += sb.toString();

	java.util.List list = getDomainFactory().find(hql.toString(), markers, values);
	SessionShortVoCollection voCollSessionShort = new SessionShortVoCollection();
	if (list != null && list.size() > 0)
		voCollSessionShort = SessionShortVoAssembler.createSessionShortVoCollectionFromSch_Session(list);
	return voCollSessionShort;	
}
 
Example 19
Project: AvoinApotti   File: BookTheatreImpl.java   Source Code and License 4 votes vote down vote up
public Date getCurrentMonth(ServiceRefVo service, LocationRefVo location, IMos consultant, IGenericItem procedure, TheatreType theatreType)
{
	if (procedure == null)
		throw new DomainRuntimeException("Not all mandatory search params set in method getCurrentMonth");

	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	String listOwnerJoin = "";
	String listOwnerCriteria = "";
	String serviceCriteria = "";
	String locationCriteria = "";
	String theatreTypeCriteria = "";

	markers.add("procId");
	markers.add("open");
	markers.add("today");

	values.add(procedure.getIGenericItemInfoID());
	values.add(getDomLookup(Session_Status_and_Reason.OPEN));
	values.add(new Date().getDate());

	if (consultant != null)
	{
		listOwnerJoin = " left join session.listOwners as listOwn ";
		listOwnerCriteria = " and (listOwn.hcp.id = :hcpId) ";
		markers.add("hcpId");
		values.add(consultant.getIMosHcpId());
	}
	if (service != null)
	{
		markers.add("idService");
		values.add(service.getID_Service());
		serviceCriteria = " and session.service.id = :idService";
	}
	if (location != null)
	{
		markers.add("idLocation");
		values.add(location.getID_Location());
		locationCriteria = " and session.schLocation.id = :idLocation";
	}
	if (theatreType != null)
	{
		markers.add("theatType");
		values.add(getDomLookup(theatreType));
		theatreTypeCriteria = " and session.theatreType = :theatType";
	}

	DomainFactory factory = getDomainFactory();

	List date = factory.find(" Select min (session.sessionDate) from Sch_Session as session " + " left join session.theatreProceduresRemaining as theatreSlot left join theatreSlot.procedureDetails as proc" + listOwnerJoin + " where ( proc.procedure.id = :procId) " + serviceCriteria + locationCriteria + listOwnerCriteria + theatreTypeCriteria + " and session.sessionStatus = :open and session.sessionDate >= :today  and session.isTheatreSession = TRUE ", markers, values, 1000);// WDEV-11777

	if (date != null && date.get(0) != null)
		return new ims.framework.utils.Date((java.util.Date) date.get(0));

	return null;
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateSessions(SessionEmergencyTheatreVoCollection listSessions)
{
	clearGrids();

	if (listSessions == null || listSessions.size() == 0)
	{
		engine.showMessage("No recods found");
		return;
	}

	for (int i = 0; i < listSessions.size(); i++)
	{
		SessionEmergencyTheatreVo session = listSessions.get(i);

		if (session == null)
			continue;

		grdTheatreSessionsRow row = form.grdTheatreSessions().getRows().newRow();

		row.setColDate(session.getSessionDate());

		String consultantDisplayString = getConsultantsListString(session);

		row.setColConsultant(consultantDisplayString);
		row.setCellColConsultantTooltip(consultantDisplayString);

		row.setColListType(session.getListType() != null ? session.getListType().getText() : "");
		row.setCellColListTypeTooltip(session.getListType() != null ? session.getListType().getText() : "");

		row.setColLocation(session.getSchLocation() != null ? session.getSchLocation().getName() : "");
		row.setCellColLocationTooltip(session.getSchLocation() != null ? session.getSchLocation().getName() : "");

		row.setColNoBooked(session.getNoOfAppointments() != null ? session.getNoOfAppointments().toString() : "");
		row.setColTimeRemaining(session.getTheatreProceduresRemaining() != null && session.getTheatreProceduresRemaining().getRemainingTimeInMins() != null ? session.getTheatreProceduresRemaining().formatTimeRemaining() : "");

		row.setValue(session);
		
		if (TheatreType.EMERGENCY.equals(session.getTheatreType()) || TheatreType.EMERGENCY_NON_TO.equals(session.getTheatreType()))
			row.setBackColor(Color.DarkSalmon);
	}
	
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void updateControlsState()
{
	boolean lateralityForFirstProcedure = form.qmbPrimaryProcedure().getValue() != null && Boolean.TRUE.equals(((ProcedureLiteVo) form.qmbPrimaryProcedure().getValue()).getIsLateralityApplicable());
	boolean lateralityForSecondProcedure = form.qmbAdditionalProcedure().getValue() != null && Boolean.TRUE.equals(((ProcedureLiteVo) form.qmbAdditionalProcedure().getValue()).getIsLateralityApplicable());

	boolean noPETSelected = form.getLocalContext().getPendingEmergencyTheatre() == null;
	boolean petHasSecondProcedure = form.getLocalContext().getPendingEmergencyTheatre() != null && form.getLocalContext().getPendingEmergencyTheatre().getSecondaryProcedure() != null;
	
	boolean enableSearchCriteria = form.getGlobalContext().Scheduling.getTheatreAppointment() == null;

	form.qmbPrimaryProcedure().setEnabled(noPETSelected && enableSearchCriteria);

	form.lblPrimaryLaterality().setVisible(lateralityForFirstProcedure);
	form.cmbPrimaryLaterality().setVisible(lateralityForFirstProcedure);
	form.cmbPrimaryLaterality().setEnabled(noPETSelected && enableSearchCriteria);

	form.lblAdditionalProcedure().setVisible(noPETSelected || petHasSecondProcedure);
	form.qmbAdditionalProcedure().setVisible(noPETSelected || petHasSecondProcedure);
	form.qmbAdditionalProcedure().setEnabled(noPETSelected && enableSearchCriteria);

	form.lblAdditionalLaterality().setVisible(lateralityForSecondProcedure);
	form.cmbAdditionalLaterality().setVisible(lateralityForSecondProcedure);
	form.cmbAdditionalLaterality().setEnabled(noPETSelected && enableSearchCriteria);
	
	//form.cmbTheatreType().setEnabled(enableSearchCriteria);
	//form.intTimeReq().setEnabled(enableSearchCriteria);
	form.imbClear().setEnabled(enableSearchCriteria);

	boolean isNullOrTheatreTypeEmergency = form.cmbTheatreType().getValue() == null || TheatreType.EMERGENCY.equals(form.cmbTheatreType().getValue()) || TheatreType.EMERGENCY_NON_TO.equals(form.cmbTheatreType().getValue());

	form.lblService().setVisible(!isNullOrTheatreTypeEmergency);
	form.cmbService().setVisible(!isNullOrTheatreTypeEmergency);
	//form.cmbService().setEnabled(enableSearchCriteria);

	SessionParentChildSlotVo voSlot = form.grdTheatreSlots().getValue();
	boolean slotAvailable = voSlot != null && voSlot.getAppointment() == null && Status_Reason.SLOTOPENED.equals(voSlot.getStatus());

	form.getContextMenus().Scheduling.getBookTheatreSlotBOOKItem().setVisible(slotAvailable);
	form.getContextMenus().Scheduling.getBookTheatreSlotSUSPENDItem().setVisible(slotAvailable);
	form.getContextMenus().Scheduling.getBookTheatreSlotRELEASEItem().setVisible(voSlot != null && Status_Reason.SUSPENDED.equals(voSlot.getStatus()));
	form.getContextMenus().Scheduling.getBookTheatreSlotADDItem().setVisible(form.grdTheatreSessions().getValue() != null && engine.hasRight(AppRight.CAN_OVERBOOK_THEATRE_APPTS));
	form.getContextMenus().Scheduling.getBookTheatreSlotMOVEItem().setVisible(voSlot != null && voSlot.getAppointment() != null && Status_Reason.BOOKED.equals(voSlot.getAppointment().getApptStatus()));

}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateSearchCriteriaScreenFromData(PreAssessmentWorklistSearchCriteriaVo criteria)
{
	clearScreen();

	if (criteria == null)
		return;
	if (criteria.getService()!=null)
	{
		form.qmbService().newRow(criteria.getService(), criteria.getService().getServiceName());
		form.qmbService().setValue(criteria.getService());
	}
	form.getGlobalContext().RefMan.setReferralServiceSearchList(criteria.getServices());
	setServiceLabelValue(listServices());
	if (criteria.getProcedure()!=null)
	{
		form.qmbProcedure().newRow(criteria.getProcedure(), criteria.getProcedure().getProcedureName());
		form.qmbProcedure().setValue(criteria.getProcedure());
	}
	form.cmbAnaestheticType().setValue(criteria.getAnaestheticType());
	form.cmbUrgency().setValue(criteria.getUrgency());
	form.dteBreachFrom().setValue(criteria.getBreachDateFrom());
	form.dteBreachTo().setValue(criteria.getBreachDateTo());
	form.GroupTheatre().setValue(TheatreType.DAYCASE.equals(criteria.getTheatreType()) ? GroupTheatreEnumeration.rdoDaySurgeryTheatre : (TheatreType.INPATIENT.equals(criteria.getTheatreType()) ? GroupTheatreEnumeration.rdoInpatientTheatre : null));
	
	form.chkPreAssessmentRequired().setValue(criteria.getPreAssessmentRequired());
	form.chkNotFitforSurgery().setValue(criteria.getNotFitForSurgery());
	form.chkFitforSurgery().setValue(criteria.getFitForSurgery());
	form.chkPreAssessmentOutcomePending().setValue(criteria.getPreAssessmentOutcomePending());
	
	//WDEV-21037
	form.chkWaitingList().setValue(criteria.getWaitingList());
	form.chkSurveillancePlannedList().setValue(criteria.getSurveillancePlannedList());
	form.dtePlannedFrom().setValue(criteria.getPlannedFrom());
	form.dtePlannedTo().setValue(criteria.getPlannedTo());
	form.chkAddedToday().setValue(criteria.getAddedToday());
	form.chkIncludeEndoscopy().setValue(criteria.getIncludeEndoscopy()); //WDEV-23462
	form.chkPastAppointments().setValue(criteria.getPastAppointment());
	form.chkFutureAppointment().setValue(criteria.getFutureAppointment());
	
	if (criteria.getPreAssessmentOutcomePending())
	{
		populateWaitingForGridWithLookups();
		if (criteria.getWaitingForIsNotNull() && criteria.getWaitingFor().size()>0)
		{
			for (int i=0;i<form.grdInformationRequired().getRows().size();i++)
			{
				if (criteria.getWaitingFor().contains(form.grdInformationRequired().getRows().get(i).getValue()))
				{
					form.grdInformationRequired().getRows().get(i).setColSelect(true);
				}
			}
		}
	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private PatientElectiveListDetailsVo populateDataFromSurgicalTab(PatientElectiveListDetailsVo patientElectiveList)
{
	if(patientElectiveList == null)
		return null;
	
	patientElectiveList = (PatientElectiveListDetailsVo) patientElectiveList.clone();
	
	patientElectiveList.setWasPossibleDateGiven(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().chkPatientDateGivenToPatient().getValue());
	patientElectiveList.setDateGivenToPatient(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().dteDateGivenToPatient().getValue());
	
	patientElectiveList.setToBePlannedIn(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().intPlanProcedureIn().getValue());
	
	patientElectiveList.setToBePlannedInUnit(null);
   	if(GroupPlanedProceduresSurgicalEnumeration.rdoDays.equals(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().GroupPlanedProceduresSurgical().getValue()))
   		patientElectiveList.setToBePlannedInUnit(TimeUnitsSecondsToMonths.DAYS);
   	else if(GroupPlanedProceduresSurgicalEnumeration.rdoMonth.equals(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().GroupPlanedProceduresSurgical().getValue()))
   		patientElectiveList.setToBePlannedInUnit(TimeUnitsSecondsToMonths.MONTHS);
   	else if(GroupPlanedProceduresSurgicalEnumeration.rdoWeeks.equals(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().GroupPlanedProceduresSurgical().getValue()))
   		patientElectiveList.setToBePlannedInUnit(TimeUnitsSecondsToMonths.WEEKS);
   		
   	patientElectiveList.setPlannedDate(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().dteRequestedPlannedDateSurgical().getValue());
   	
	if (patientElectiveList.getPlannedDate() == null)
	{
		if (patientElectiveList == null || patientElectiveList.getID_PatientElectiveList() == null)
			patientElectiveList.setPlannedDate(calculateDate(new Date(), patientElectiveList.getToBePlannedIn(), patientElectiveList.getToBePlannedInUnit()));
		else
			patientElectiveList.setPlannedDate(calculateDate(patientElectiveList.getSystemInformation().getCreationDateTime().getDate(), patientElectiveList.getToBePlannedIn(), patientElectiveList.getToBePlannedInUnit()));
	}
   	
   	if(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().cmbPriority().getVisible() && form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().cmbPriority().isEnabled())
   	{
   		patientElectiveList.setPriority(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().cmbPriority().getValue());
   	}
	
   	patientElectiveList.setResponsibleHCP(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().ccResponsibleHCPSUrgical().getValue() != null ? domain.getHCPByMedic((HcpRefVo) form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().ccResponsibleHCPSUrgical().getValue()):null);		//wdev-22465
   	
   	if( Boolean.TRUE.equals(form.getLocalContext().getIsVisibleSurgicalTheatreType()))
	{
		if( GroupDaySurgMainTheatreEnumeration.rdoMainTheatre.equals(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().GroupDaySurgMainTheatre().getValue()))
		{
			patientElectiveList.setRequiredTheatreType(TheatreType.INPATIENT);
			patientElectiveList.setHospital(null);
		}
		else if( GroupDaySurgMainTheatreEnumeration.rdoDaySurgery.equals(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().GroupDaySurgMainTheatre().getValue()))
		{
			patientElectiveList.setRequiredTheatreType(TheatreType.DAYCASE);
			patientElectiveList.setHospital(null);
		}
		else if( GroupDaySurgMainTheatreEnumeration.rdoPeripheralLocation.equals(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().GroupDaySurgMainTheatre().getValue()))	
		{
			patientElectiveList.setHospital(form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().cmbPeripheralLocation().getValue());
			patientElectiveList.setRequiredTheatreType(TheatreType.DAYCASE);
		}
		else
			patientElectiveList.setRequiredTheatreType(null);
	}
	else
	{
		if( form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().chkPreoperativeOvernightStay().getValue() || ( !form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().chkPreoperativeOvernightStay().getValue() && form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().intAnticipatedNights().getValue() != null && form.ctnDetails().lyrWaitingListDetails().tabPageSurgical().intAnticipatedNights().getValue().intValue() >= 1))
		{
			patientElectiveList.setRequiredTheatreType(TheatreType.INPATIENT);
		}
		else
			patientElectiveList.setRequiredTheatreType(null);
	}
   	
	return patientElectiveList;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void saveBookingTheatre(BookTheatreSlotDialogVo voData,
								Sch_BookingTheatreVo voSchBooking,
								ReferralERODForBookTheatreVo erod,
								SessionParentChildSlotRefVoCollection voCollChildSlots,
								TheatreType theatreType,
								PatientElectiveListVo patElectiveListToSave,
								PendingEmergencyTheatreVo pendingEmergencyTheatre)
		throws DomainInterfaceException, StaleObjectException 
{
	if(voSchBooking != null && voSchBooking.getAppointments() != null)
	{
		for(int i=0; i<voSchBooking.getAppointments().size(); i++)
		{
			if(voSchBooking.getAppointments().get(i) != null && voSchBooking.getAppointments().get(i).getSession() != null && voSchBooking.getAppointments().get(i).getSession().getTheatreProceduresRemaining() != null)
			{
				SessionTheatreProceduresRemainingVo theatreRemaining = domain.getSessionTheatreProcedureRemaining(voSchBooking.getAppointments().get(i).getSession().getTheatreProceduresRemaining());
				voSchBooking.getAppointments().get(i).getSession().setTheatreProceduresRemaining(theatreRemaining);
			}
		}
	}
	
	voSchBooking = domain.saveTheatreBooking(voSchBooking, form.getGlobalContext().RefMan.getCatsReferral(), voCollChildSlots, voData.getParentChildSlot(),theatreType, erod, patElectiveListToSave, pendingEmergencyTheatre, form.getLocalContext().getPreviousEarliestDateOffered());   //wdev-13765 //WDEV-18084

	//WDEV-20064
	if (patElectiveListToSave!=null && patElectiveListToSave.getTCIDetails() != null && patElectiveListToSave.getTCIDetails().getTCIHospital()!=null) //WDEV-20064 //WDEV-20338
	{
		LocationLiteVo caseNoteLocation=getCaseNoteLocAssociatedWithHospital(patElectiveListToSave.getElectiveList(), getParentHospitalLocation(form.cmbWard().getValue()));

		//WDEV-21951
		if (caseNoteLocation == null && patElectiveListToSave.getTCIDetails().getTCIWard() != null && Boolean.TRUE.equals(patElectiveListToSave.getTCIDetails().getTCIWard().getCaseNoteFolderLocation()))
		{
			caseNoteLocation = patElectiveListToSave.getTCIDetails().getTCIWard();
		}

		domain.createCaseNoteRequests(voSchBooking.getTciId(), caseNoteLocation);
	}
	if(!saveICP(voSchBooking))
		return;

	//WDEV-8295		
	form.getGlobalContext().Scheduling.setAppointmentIds(getApptIds(voSchBooking));	
	form.getGlobalContext().RefMan.setReferralEROD(null); //WDEV-18459
	form.getLocalContext().setRTT28DayKPIReasonConfirmed(null);
	form.getLocalContext().setRTTDialogKPIReasonConfirmed(null);
	engine.open(form.getForms().Scheduling.PrintAppointment);
}
 
Example 25
Project: openMAXIMS   File: BookTheatreImpl.java   Source Code and License 4 votes vote down vote up
public Date getCurrentMonth(ServiceRefVo service, LocationRefVo location, IMos consultant, IGenericItem procedure, TheatreType theatreType)
{
	if (procedure == null)
		throw new DomainRuntimeException("Not all mandatory search params set in method getCurrentMonth");

	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	String listOwnerJoin = "";
	String listOwnerCriteria = "";
	String serviceCriteria = "";
	String locationCriteria = "";
	String theatreTypeCriteria = "";

	markers.add("procId");
	markers.add("open");
	markers.add("today");

	values.add(procedure.getIGenericItemInfoID());
	values.add(getDomLookup(Session_Status_and_Reason.OPEN));
	values.add(new Date().getDate());

	if (consultant != null)
	{
		listOwnerJoin = " left join session.listOwners as listOwn ";
		listOwnerCriteria = " and (listOwn.hcp.id = :hcpId) ";
		markers.add("hcpId");
		values.add(consultant.getIMosHcpId());
	}
	if (service != null)
	{
		markers.add("idService");
		values.add(service.getID_Service());
		serviceCriteria = " and session.service.id = :idService";
	}
	if (location != null)
	{
		markers.add("idLocation");
		values.add(location.getID_Location());
		locationCriteria = " and session.schLocation.id = :idLocation";
	}
	if (theatreType != null)
	{
		markers.add("theatType");
		values.add(getDomLookup(theatreType));
		theatreTypeCriteria = " and session.theatreType = :theatType";
	}

	DomainFactory factory = getDomainFactory();

	markers.add("THEATRE_SESSION");
	values.add(SchProfileType.THEATRE.getID());
	List date = factory.find(" Select min (session.sessionDate) from Sch_Session as session " + " left join session.sch_Profile as profile left join profile.theatreDetails as theatreDet left join theatreDet.procedure as proc" + listOwnerJoin + " where ( proc.id = :procId and proc.isActive = 1) " + serviceCriteria + locationCriteria + listOwnerCriteria + theatreTypeCriteria + " and session.sessionStatus = :open and session.sessionDate >= :today  and session.sessionProfileType.id = :THEATRE_SESSION ", markers, values, 1000);// WDEV-11777

	if (date != null && date.get(0) != null)
		return new ims.framework.utils.Date((java.util.Date) date.get(0));

	return null;
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
/**
 * 
 */
private void defaultSearchCriteria()
{
	defaultDates();
	form.lyr1().tabSearch().cmbTheatreType().setValue(TheatreType.DAYCASE);
}
 
Example 27
Project: openMAXIMS   File: TheatreListImpl.java   Source Code and License 4 votes vote down vote up
public SessionShortVoCollection listSession(Date sessionDate, HcpRefVo listOwner, LocationRefVo hospital, TheatreType theatreType)
{
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	String andStr = "";
	StringBuffer sb = new StringBuffer();

	String hql = "from Sch_Session as session left join fetch session.listOwners as lo ";

	andStr = " ";
	if (sessionDate != null)
	{
		sb.append(andStr + " session.sessionDate = :sessionDate");
		markers.add("sessionDate");
		values.add(sessionDate.getDate());
		andStr = " and ";
	}

	if (listOwner != null)
	{
		sb.append(andStr + " lo.hcp.id = :listOwner");
		markers.add("listOwner");
		values.add(listOwner.getID_Hcp());
		andStr = " and ";
	}

	if (hospital != null)
	{	
		sb.append(andStr + " ( session.schLocation.id = :locat or session.schLocation.parentLocation.id = :locat )");
		markers.add("locat");
		values.add(hospital.getID_Location());
		andStr = " and ";
	}

	sb.append(andStr + " session.isTheatreSession = :trueTheatre");
	markers.add("trueTheatre");
	values.add(Boolean.TRUE);
	andStr = " and ";

	
	if (theatreType != null)
	{
		if (theatreType.equals(TheatreType.BOTH))
		{
			sb.append(andStr + " ( session.theatreType = :stat1 or session.theatreType = :stat2 or session.theatreType = :stat3)");
			markers.add("stat3");
			values.add(getDomLookup(TheatreType.BOTH));
			markers.add("stat1");
			values.add(getDomLookup(TheatreType.INPATIENT));
			markers.add("stat2");
			values.add(getDomLookup(TheatreType.DAYCASE));
		}
		else if(theatreType.equals(TheatreType.INPATIENT) || theatreType.equals(TheatreType.DAYCASE))
		{
			sb.append(andStr + " ( session.theatreType = :stat1 or session.theatreType = :stat2)");
			markers.add("stat1");
			if (theatreType.equals(TheatreType.INPATIENT))
				values.add(getDomLookup(TheatreType.INPATIENT));
			if (theatreType.equals(TheatreType.DAYCASE))
				values.add(getDomLookup(TheatreType.DAYCASE));
			markers.add("stat2");
			values.add(getDomLookup(TheatreType.BOTH));
		}
		else
		{
			sb.append(andStr + " ( session.theatreType = :stat1)");
			markers.add("stat1");
			values.add(getDomLookup(theatreType));
		}
	}


	hql += " where " ;
	hql += sb.toString();

	java.util.List list = getDomainFactory().find(hql.toString(), markers, values);
	SessionShortVoCollection voCollSessionShort = new SessionShortVoCollection();
	if (list != null && list.size() > 0)
		voCollSessionShort = SessionShortVoAssembler.createSessionShortVoCollectionFromSch_Session(list);
	return voCollSessionShort;	
}
 
Example 28
Project: openMAXIMS   File: BookTheatreImpl.java   Source Code and License 4 votes vote down vote up
public Date getCurrentMonth(ServiceRefVo service, LocationRefVo location, IMos consultant, IGenericItem procedure, TheatreType theatreType)
{
	if (procedure == null)
		throw new DomainRuntimeException("Not all mandatory search params set in method getCurrentMonth");

	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	String listOwnerJoin = "";
	String listOwnerCriteria = "";
	String serviceCriteria = "";
	String locationCriteria = "";
	String theatreTypeCriteria = "";

	markers.add("procId");
	markers.add("open");
	markers.add("today");

	values.add(procedure.getIGenericItemInfoID());
	values.add(getDomLookup(Session_Status_and_Reason.OPEN));
	values.add(new Date().getDate());

	if (consultant != null)
	{
		listOwnerJoin = " left join session.listOwners as listOwn ";
		listOwnerCriteria = " and (listOwn.hcp.id = :hcpId) ";
		markers.add("hcpId");
		values.add(consultant.getIMosHcpId());
	}
	if (service != null)
	{
		markers.add("idService");
		values.add(service.getID_Service());
		serviceCriteria = " and session.service.id = :idService";
	}
	if (location != null)
	{
		markers.add("idLocation");
		values.add(location.getID_Location());
		locationCriteria = " and session.schLocation.id = :idLocation";
	}
	if (theatreType != null)
	{
		markers.add("theatType");
		values.add(getDomLookup(theatreType));
		theatreTypeCriteria = " and session.theatreType = :theatType";
	}

	DomainFactory factory = getDomainFactory();

	List date = factory.find(" Select min (session.sessionDate) from Sch_Session as session " + " left join session.theatreProceduresRemaining as theatreSlot left join theatreSlot.procedureDetails as proc" + listOwnerJoin + " where ( proc.procedure.id = :procId) " + serviceCriteria + locationCriteria + listOwnerCriteria + theatreTypeCriteria + " and session.sessionStatus = :open and session.sessionDate >= :today  and session.isTheatreSession = TRUE ", markers, values, 1000);// WDEV-11777

	if (date != null && date.get(0) != null)
		return new ims.framework.utils.Date((java.util.Date) date.get(0));

	return null;
}