Java Code Examples for ims.configuration.gen.ConfigFlag

The following are top voted examples for showing how to use ims.configuration.gen.ConfigFlag. 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   View source code 6 votes vote down vote up
private boolean validateReportConfigFlags() 
{
	String queryServerUrl = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String reportServerUrl = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();
	
	ArrayList<String> errors = new ArrayList<String>();
	
	if(queryServerUrl == null || queryServerUrl.length() == 0 || queryServerUrl.equals(ConfigFlag.GEN.QUERY_SERVER_URL.getDefaultValue()))
	{
		errors.add("The config flag QUERY_SERVER_URL is not set!");
	}
	
	if(reportServerUrl == null || reportServerUrl.length() == 0 || reportServerUrl.equals(ConfigFlag.GEN.REPORT_SERVER_URL.getDefaultValue()))
	{
		errors.add("The config flag REPORT_SERVER_URL is not set !");
	}
	
	if(errors.size() == 0)
		return true;
	
	engine.showMessage(getErrors(errors.toArray(new String[errors.size()])), "Errors", MessageButtons.OK, MessageIcon.ERROR);
	
	return false;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void newInstance() 
{	
	form.getLocalContext().setCurrentPatientAssessment(null);
	
	if(isStructuralAssessment())
	{
		form.lyrAssessments().tabStructuralAssessment().lyrDualView().showtabPageAssessment();
		
		displayBlankStructuralAssessment();
		populateStructuralAssessmentContextInformation();
		form.lyrAssessments().tabStructuralAssessment().authStructuredAssessment().initializeComponent();			
		form.setMode(FormMode.EDIT);
		// WDEV-12644
		form.lyrAssessments().tabStructuralAssessment().setauthStructuredAssessmentEnabled(Boolean.FALSE.equals(ConfigFlag.UI.ASSESSMENTS_SET_AUTHORING_AND_COMPLETING_DETAILS_AS_READ_ONLY.getValue()));
	}
	else if(isGraphicalAssessment())
	{
		displayBlankGraphicalAssessment();
		populateGraphicalAssessmentContextInformation();
		form.lyrAssessments().tabGraphicalAssessment().authGraphicalAssessment().initializeComponent();			
		form.setMode(FormMode.EDIT);
		// WDEV-12644
		form.lyrAssessments().tabGraphicalAssessment().setauthGraphicalAssessmentEnabled(Boolean.FALSE.equals(ConfigFlag.UI.ASSESSMENTS_SET_AUTHORING_AND_COMPLETING_DETAILS_AS_READ_ONLY.getValue()));
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addRecord()
{
	form.setMode(FormMode.EDIT);

	if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("NTPF"))
	{
		if (form.treActivity().getSelectedNode() != null)
			form.lyrActivity().tabNtpf().txtActivity().setValue(form.treActivity().getSelectedNode().getText());
		form.lyrActivity().tabNtpf().chkItem().setValue(true);
		form.lyrActivity().tabNtpf().chkActive().setValue(true);
		form.getLocalContext().setActivityVo(new ActivityVo());
		form.getLocalContext().setAlertVo(new CodingAlertConfigurationVo());
		showAlertDetails(enableAlertControls(form.treActivity().getSelectedNode()), (ActivityType) form.treActivity().getSelectedNode().getValue());
	}
	else if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("SCHED"))
	{
		if (form.treActivity().getSelectedNode() != null)
			form.lyrActivity().tabSchedulling().txtActType().setValue(form.treActivity().getSelectedNode().getText());
		form.lyrActivity().tabSchedulling().chkActActive().setValue(true);
		form.getLocalContext().setActivityVo(new ActivitySchedVo());
	}
}
 
Example 4
Project: AvoinApotti   File: OcsIfInboundImpl.java   View source code 6 votes vote down vote up
private IfOcsOrderVo getOrderBySpecFillerOrdNum(String fillerOrderNumber)
{
	if (fillerOrderNumber == null)
		throw new CodingRuntimeException("FillerOrdNumber cannot be null");
	
	DomainFactory factory = getDomainFactory();
	String hql = " select ord from OcsOrderSession ord join ord.specimens spc where spc.fillerOrdNum = :fillerOrderNum";
	List lst = factory.find(hql, new String[]{"fillerOrderNum"}, new Object[]{fillerOrderNumber});
	if (lst == null || lst.size() == 0)
		return null;
	else if (lst.size() > 1&&!ConfigFlag.HL7.UNSOLICTED_NEW_SPECIMEN_PER_INVESTIGATION.getValue())
		throw new DomainRuntimeException("Duplicate data found for Filler Order Number = " + fillerOrderNumber);
	
	return IfOcsOrderVoAssembler.create((OcsOrderSession) lst.get(0));
	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean save()
{
	InvasiveDeviceConfigVo record = populateDataFromScreen(form.getLocalContext().getEditedRecord());
			
	String[] uiErrors = getUiErrors();	
	String[] errors = record.validate(uiErrors);
	if(errors != null && errors.length > 0)
	{
		engine.showErrors(errors);
		return false;
	}
	try
	{
		record = domain.save(record);
	}
	catch(StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		InvasiveDeviceConfigVo updatedRecord = getAndDisplayRecord(record);
		updateRowRecord(updatedRecord);
		return false;
	}
	form.getLocalContext().setEditedRecord(record);
	return true;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PatientUserDefinedObjectVo savePatientAssessment(PatientUserDefinedObjectVo voPatientUserDefindeObject) throws PresentationLogicException
{
	String[] errors = voPatientUserDefindeObject.validate();
	if (errors != null)
	{
		engine.showErrors(errors);
		return null;
	}

	try
	{
		voPatientUserDefindeObject = domain.savePatientUserDefinedObject(voPatientUserDefindeObject);
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return null;
	}

	return voPatientUserDefindeObject;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateEventControlsFromData(InpatientEpisodeLiteVo voInpatientEpisode)
{
	if (voInpatientEpisode.getPasEventIsNotNull())
	{
		form.lblConsultantBanner().setValue(voInpatientEpisode.getPasEvent().getConsultantIsNotNull() ? voInpatientEpisode.getPasEvent().getConsultant().toString() : "");
		
		//WDEV-14465
		if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
		{
			form.lblSpecialtyBanner().setValue(voInpatientEpisode.getPasEvent().getPASSpecialtyIsNotNull() ? voInpatientEpisode.getPasEvent().getPASSpecialty().getText() : "");
		}
		else
			form.lblSpecialtyBanner().setValue(voInpatientEpisode.getPasEvent().getSpecialtyIsNotNull() ? voInpatientEpisode.getPasEvent().getSpecialty().getText() : "");
	}
	form.lblEstDsichargeBanner().setValue(voInpatientEpisode.getEstDischargeDateIsNotNull() ? voInpatientEpisode.getEstDischargeDate().toString() : "");
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean save()
{
	ReferralClinicalNotesVo referralClinicalNotes = domain.getReferralClinicalNotes(form.getGlobalContext().RefMan.getCatsReferral());
	referralClinicalNotes = populateReferralClinicalNotes(referralClinicalNotes);
	
	String[] errors = referralClinicalNotes.validate(validateUIRules());
	if(errors != null && errors.length > 0)
	{
		engine.showErrors(errors);
		return false;
	}
	
	try
	{
		return domain.saveReferralClinicalNotes(referralClinicalNotes);
	}
	catch (StaleObjectException e)
	{
		e.printStackTrace();
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		engine.close(DialogResult.ABORT);
		return false;
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private String getDisplayString(LookupInstVo inst)
{
	if (inst == null)
		return "";

	StringBuffer strDisplay = new StringBuffer();

	if (ConfigFlag.UI.SHOW_LOOKUP_POS.getValue())
	{
		strDisplay.append(String.valueOf(inst.getOrder()));
		strDisplay.append(". ");
	}

	strDisplay.append(inst.getText());
	return strDisplay.toString();
}
 
Example 10
Project: AvoinApotti   File: ClinicListwithICPActionsImpl.java   View source code 6 votes vote down vote up
public Booking_AppointmentVo saveOPEpisode(Booking_AppointmentVo voOP) throws DomainInterfaceException, StaleObjectException 
{
	if(voOP == null)
		throw new DomainRuntimeException("Invalid Booking to save");
	if(!voOP.isValidated())
		throw new DomainRuntimeException("Record not validated before save");
	
	
	DomainFactory factory = getDomainFactory();
	Booking_Appointment doAppt = Booking_AppointmentVoAssembler.extractBooking_Appointment(factory, voOP);		
	factory.save(doAppt);
	
	//WDEV-9657 DNA for ICAB appts - no dna hl7 messages in uksh
	if(ConfigFlag.GEN.ICAB_ENABLED.getValue())
	{
		if(doAppt.getApptStatus() != null && doAppt.getApptStatus().equals(getDomLookup(Status_Reason.DNA)))
		{
			if(doAppt.isIsCABBooking() != null && doAppt.isIsCABBooking().booleanValue())
				CABRequests.sendRequestandUpdateReferences(factory, getDomLookup(ActionRequestType.NOTIFY_DNA), doAppt, "Appt DNA Requested from ClinicListWithIcpActions");	
		}
	}
	
	return Booking_AppointmentVoAssembler.create(doAppt);
}
 
Example 11
Project: AvoinApotti   File: PatientJourneyImpl.java   View source code 6 votes vote down vote up
public PatientJourneyInterfaceVo getPatientJourney(PatientPathwayJourneyRefVo profile, PathwayRefVo pathway) 
{
	if(profile == null)
		throw new DomainRuntimeException("Invalid profile");
	
	DomainFactory factory = getDomainFactory();
			
		PatientJourneyInterfaceVo vo = PatientJourneyInterfaceVoAssembler.create((PatientPathwayJourney)factory.getDomainObject(profile));
	
		if(vo == null)
			throw new DomainRuntimeException("Profile not found");
		
	vo.setJourneyEvents(PatientJourneyEventInterfaceVoAssembler.createPatientJourneyEventInterfaceVoCollectionFromPatientEvent(factory.find("from PatientEvent pe where pe.journey.id = " + profile.getID_PatientPathwayJourney() + " order by pe.eventDateTime, pe.id",ConfigFlag.UI.MAX_NO_OF_PATIENT_JOURNEY_EVENTS_LISTED.getValue()))); //wdev-12567
		vo.setPathwayTargets(PatientJourneyTargetInterfaceVoAssembler.createPatientJourneyTargetInterfaceVoCollectionFromPatientJourneyTarget( listCurrentPathwayJourneyTargets(factory, profile, pathway != null ? pathway : vo.getPathway())));
	return vo;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	String dsn = "";
	String host = "";
	String userName = "";
	String password = "";

	dsn = ConfigFlag.UI.REPORTS_DSN.getValue();
	host = ConfigFlag.UI.REPORTS_HOST.getValue();
	userName =  ConfigFlag.UI.REPORTS_USER.getValue();
	password = ConfigFlag.UI.REPORTS_PASS.getValue();
	
	String html = "";
	
	if(form.getGlobalContext().COE.getPatientMovementID() != null){
		PatIdType dispIdType = PatIdType.getNegativeInstance(ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue());
		Integer assessment_id = form.getGlobalContext().COE.getPatientMovementID();	
		String server = ConfigFlag.UI.REPORT_SERVER.getValue();
		html = "<IFRAME src='http://" + server + "/patientmovement.asp?assessmentid=" + assessment_id + "&idtype=" + dispIdType.getId() + "&dsn=" + dsn + "&host=" + host + "&userName=" + userName + "&password=" + password + "' style=\"width:100%; height:100%;\">";		
	}
	form.htm1().setHTML(html);
	
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void orderInvestigation()
{
	form.getGlobalContext().Rotherham.setAppointmentToLink(null);
	
	if (ConfigFlag.GEN.ALLOW_LINK_EXISTING_APPOINTMENTS_AND_ORDERS.getValue())
	{
		ReferralAppointmentDetailsBookingAppointmentVo appointment = form.lyrContent().tabDischargeDetails().grdAppointments().getValue();
		
		if (appointment != null && Status_Reason.BOOKED.equals(appointment.getApptStatus()))
		{
			form.getGlobalContext().Rotherham.setAppointmentToLink(appointment);
		}
	}

	engine.open(form.getForms().OCRR.SelectAndOrderDialog);		
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean checkConfigFlags(String queryServerUrl, String reportServerUrl)
{		
	if(queryServerUrl == null || queryServerUrl.length() == 0 || queryServerUrl.equals(ConfigFlag.GEN.QUERY_SERVER_URL.getDefaultValue()))
	{
		engine.showMessage("The config flag QUERY_SERVER_URL was not set !");
		return false;
	}
	
	if(reportServerUrl == null || reportServerUrl.length() == 0 || reportServerUrl.equals(ConfigFlag.GEN.REPORT_SERVER_URL.getDefaultValue()))
	{
		engine.showMessage("The config flag REPORT_SERVER_URL was not set !");
		return false;
	}
	
	return true;
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void loadEpisodes()
{
	//WDEV-13001
	if(ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{
		PatientRefVo voPat = getSelectedPatient();
		if(voPat != null)
		{
			EpisodeOfCareWithPrimaryDiagnosisVoCollection voCollEpisodes = domain.listOpenEpisodesForPatient(getSelectedPatient());
			if(voCollEpisodes != null)
			{
				for(EpisodeOfCareWithPrimaryDiagnosisVo voEpis : voCollEpisodes)
					form.cmbEpisode().newRow(voEpis, voEpis.toString());
				
				// WDEV-16054  If only one episode, set this as the value in the combo
				if (voCollEpisodes.size() == 1)
					form.cmbEpisode().setValue(voCollEpisodes.get(0));
			}
		}
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onfileupldImageFileUploaded(String fileName)
{
	form.getLocalContext().setCurrentImage(null);
	form.getLocalContext().setselectedFilename(fileName);

	String uploadFileName = "";
	if (EnvironmentConfig.getImageServerURL() == "")
	{
		uploadFileName = EnvironmentConfig.getAplicationURL() + ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + getBaseName(getBaseName(fileName));
	}
	else
	{
		uploadFileName = EnvironmentConfig.getImageServerURL() + getBaseName(getBaseName(fileName));
	}
	form.htmPreview().setHTML("<IFRAME id=\"PostFrame\" name=\"PostFrame\" width=\"100%\" height=\"100%\" frameborder=0 src='" + uploadFileName + "'></IFRAME>");
	
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 * Initialize the form by loading in the defaults such as combos
 */	 
private void initialize()
{
	loadLocationCombos();
	//wdev-13445
	String orderingClinicLoc = ConfigFlag.GEN.ORDERING_CLINIC_LOCATION_MANDATORY_FIELDS.getValue();
	if(orderingClinicLoc == "Outpatient Department" || orderingClinicLoc == "Clinic and Outpatient Department")
	{
		form.cmbOutpatient().setRequired(true);
	}
	else
	{
		form.cmbOutpatient().setRequired(false);
	}
		
	//----------
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onBtnRunClick() throws ims.framework.exceptions.PresentationLogicException
{
	if(ConfigFlag.GEN.QUARTZ_SERVER_URL.getValue() == null || ConfigFlag.GEN.QUARTZ_SERVER_URL.getValue().length() == 0)
	{
		engine.showMessage("QUARTZ_SERVER_URL config flag was not set.");
		return;
	}
	
	if(JobType.MONTHLY_ACTIVITY_REPORT.equals(form.cmbType().getValue()) && Boolean.TRUE.equals(ConfigFlag.GEN.PROMPT_FOR_REPORT_PARAMS.getValue()))
	{
		form.getGlobalContext().Core.setImsReportId(new Integer(129));
		
		engine.open(form.getForms().Core.ReportParamsDialog);
		return;
	}		
	
	runJob();
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	form.ccConsultant().initialize(MosType.MEDIC);
	form.ccConsultant().isRequired(true);
	
	//WDEV-12587
	bindCmbSourceOfReferralLookup();
	form.ccReferringConsultant().initialize(MosType.MEDIC);
	
	enableInstanceControls(false);
	
	//WDEV-10696 - hide A&E Tabs 
	if(!ConfigFlag.UI.DISPLAY_ANE_BEDMANAGEMENT.getValue())
	{
		form.lyrAdmission().tabEmergency().setVisible(false);
		form.lyrAdmission().tabEmergency().setHeaderVisible(false);
	}
	
	//WDEV-12968 Default Id Type to config type 
	PatIdType dispIdType = PatIdType.getNegativeInstance(ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue());
	form.lyrAdmission().tabWaiting().cmbIdType().setValue(dispIdType);			
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 * WDEV-13999
 * Function used to update state of controls
 */
private void updateControlsState()
{
	boolean userHasAuthorizeRoles = engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS) && engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS);
	boolean canOrderBeAuthorized = canOrderBeAuthorized();
	
	
	form.btnCancel().setVisible(engine.hasRight(AppRight.ALLOW_CANCEL_ORDERINVESTIGATION));
	
	form.btnAmend().setVisible(canOrderBeAmmended() && ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("CARE_UK") && engine.hasRight(AppRight.ALLOW_ORDERINVESTIGATIONS_CAREUK));
	
	form.btnAuthorise().setVisible(canOrderBeAuthorized);
	form.btnAuthorise().setEnabled(!isCancelled(form.getLocalContext().getOrderSummary()));
	form.btnUpdate().setVisible(canOrderBeAuthorized);
	form.btnUpdate().setEnabled(!isCancelled(form.getLocalContext().getOrderSummary()) && userHasAuthorizeRoles);
}
 
Example 21
Project: AvoinApotti   File: TaxonomySearchCmpImpl.java   View source code 6 votes vote down vote up
private TaxonomyMapCollection searchICD10Codes(TaxonomyMap filter) throws ims.domain.exceptions.DomainRuntimeException
{
	int maxRecords = ConfigFlag.DOM.TAXONOMY_SEARCH_MAX_SIZE.getValue();

	DomainFactory factory = getDomainFactory();
	String hqlList	= " from Icd10AmProc p where (upper(p.ascii_desc) like '%" + filter.getDescription().toUpperCase() + "%') or upper(p.ascii_short_desc) like '%" + filter.getDescription().toUpperCase() + "%')";

	TaxonomyMapCollection coll = new TaxonomyMapCollection();
	List codesList = factory.find(hqlList, maxRecords);			
	for (int i = 0; i < codesList.size(); i++)
	{
		Icd10AmProc proc = (Icd10AmProc)codesList.get(i);
		TaxonomyMap taxMap = new TaxonomyMap();
		taxMap.setTaxonomyName(TaxonomyType.ICD10);
		taxMap.setDescription(proc.getAscii_short_desc() + " - " + proc.getAscii_desc());
		taxMap.setTaxonomyCode(proc.getCode_id());			
		coll.add(taxMap);
	}		
	return coll; 
}
 
Example 22
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initialize()
{
	form.getGlobalContext().Core.setPatientShort(null);
	form.getGlobalContext().RefMan.setCatsReferral(null);
	form.getGlobalContext().RefMan.setReferralContractTypeForPatient(null);//wdev-12682

	loadLocation();
	displayGridFooter();
	enablePrintButton();
	setPatientIdentifierColumnCaption();

	form.chkCompleted().setVisible(ConfigFlag.UI.DISPLAY_COMPLETE_FILTER_RESULTS_STATUS.getValue());//wdev-17322
	form.chkCompleted().setValue(ConfigFlag.UI.DISPLAY_COMPLETE_FILTER_RESULTS_STATUS.getValue());

	//security level WDEV-9780
	RoleDisciplineSecurityLevelLiteGCVo voRoleDisciplineSecurityLevels = form.getGlobalContext().OCRR.getRoleDisciplineSecurityLevels();
	if(voRoleDisciplineSecurityLevels == null || (voRoleDisciplineSecurityLevels != null &&  voRoleDisciplineSecurityLevels.getIsConfigLoadedIsNotNull() && !voRoleDisciplineSecurityLevels.getIsConfigLoaded().equals(false)))
		form.getGlobalContext().OCRR.setRoleDisciplineSecurityLevels(domain.getRoleDisciplineSecurityLevels(engine.getLoggedInRole()));
}
 
Example 23
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private String getQueryServerRoot()
{
	String root = ConfigFlag.GEN.QUERY_SERVER_URL.getValue().trim();

	if (root.endsWith("/"))
		root = root.substring(0, root.length() - 1);

	if (root.endsWith("/ReportBuilder"))
	{
		int index = root.lastIndexOf("/");

		if (index > -1)
		{
			return root.substring(0, index);
		}
	}

	return root;
}
 
Example 24
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
public void initialize()
{
	clear();

	form.ccResponsibleHCP().initializeResponsibleHcp(MosType.HCP, true);
	form.ccOrderingHCP().initialize(MosType.HCP);

	form.chkNew().setValue(true);
	form.chkSeenChecked().setValue(false);
	form.chkChecked().setValue(false);
	form.chkReview().setValue(false);
	form.chkCompleted().setVisible(ConfigFlag.UI.DISPLAY_COMPLETE_FILTER_RESULTS_STATUS.getValue());
	form.chkCompleted().setValue(ConfigFlag.UI.DISPLAY_COMPLETE_FILTER_RESULTS_STATUS.getValue());

	populateDays(ConfigFlag.DOM.OCS_NEWRES_DAYS_MAX.getValue());
	resetDaysToDefault();

	form.ListResultsBy().setValue(ListResultsByEnumeration.rdoNewestFirst);

	updateControlsState();
}
 
Example 25
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initialise()
{
	clearControls();
	//Load the list of active hospitals in order to fill the current hospital combo.
	form.cmbIDType().setValue(PatIdType.getNegativeInstance(ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue()));

	loadHospitals();
	if (form.cmbCurrentHospital().getValue() == null && engine.getCurrentLocation() != null)

	{
		//Try and load the logged in location as a ward
		LocMostVo voLoc = domain.getLocation((LocationRefVo)engine.getCurrentLocation());
		if (voLoc != null && voLoc.getTypeIsNotNull()
			&& voLoc.getType().equals(LocationType.WARD))
		{
			form.cmbCurrentHospital().setValue(voLoc.getParentLocation());

			form.cmbCurrentWard().newRow(voLoc, voLoc.getName());
			form.cmbCurrentWard().setValue(voLoc);
		}
	}


}
 
Example 26
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 *	Function used to change selected instance
 *		- retrieve new instance from domain based on id
 *		- populate local context for selected record
 *		- populate instance controls for selected record
 * @throws PresentationLogicException 
 */
public void changeSelectedInstance(ResultConclusionAndActionCommentRefVo value) throws PresentationLogicException
{
	// Get instance from domain
	form.getLocalContext().setSelectedComment(domain.getComment(value));
	
	// Check for StaleObject
	if (value != null && value.getID_ResultConclusionAndActionCommentIsNotNull() && !form.getLocalContext().getSelectedCommentIsNotNull())
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return;
	}
	
	// Populate instance controls with selected instance
	populateInstanceControls(form.getLocalContext().getSelectedComment());
}
 
Example 27
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void bookTheatreAppointment()
{
	//WDEV-12918
	if(ConfigFlag.DOM.THEATRE_SESSION_TYPE.getValue().equals("TCI"))
		engine.open(form.getForms().RefMan.BookTheatreDialog);
	else
		engine.open(form.getForms().RefMan.BookTheatreSlot);
}
 
Example 28
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
@Override
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException 
{
	if (Boolean.TRUE.equals(form.getLocalContext().getbDNACalled()))
	{
		if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue())
				&& domain.hasTCI(form.grdResults().getValue()))
		{
			form.getLocalContext().setUndoArrivalMessageBoxId(null);

			if (DialogResult.YES.equals(result))
				dnaPatient(true);
			else if (DialogResult.NO.equals(result))
				dnaPatient(false);
		}
		else if (DialogResult.YES.equals(result))
		{
			form.getLocalContext().setUndoArrivalMessageBoxId(null);
			dnaPatient(false);
		}
	}
	else if (form.getLocalContext().getUndoArrivalMessageBoxIdIsNotNull() && form.getLocalContext().getUndoArrivalMessageBoxId().equals(messageBoxId)
			&& DialogResult.YES.equals(result))
	{
		form.getLocalContext().setbDNACalled(false);
		updateBooking(Status_Reason.BOOKED, AppointmentTrackingStatus.UNDO_ARRIVAL, false);
		search();
	}
}
 
Example 29
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String createAndUploadDocument() 
{
	byte[] report = buildRACPCSummaryReport(false);
	
	if(report != null)
	{
		String pdfFileName = generateName() + ".pdf";
		
		try 
		{								
			engine.uploadFile(ConfigFlag.GEN.PDF_UPLOAD_URL.getValue(), report, pdfFileName, ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + "\\");
		}
		catch (Exception e)
		{
			engine.showMessage(e.getMessage());
			return null;
		}
		
		int year  = new DateTime().getDate().getYear();
		int month = new DateTime().getDate().getMonth();
		int day   = new DateTime().getDate().getDay();
		
		if(pdfFileName != null && pdfFileName.length() > 0)
			return year + "\\" + month + "\\" + day + "\\" + pdfFileName;
	}
	
	return null;
}
 
Example 30
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void saveDisplayOptions() 
{
	StringBuffer val = new StringBuffer("");
	if (form.chkFw().getValue()) val.append("FW,");
	if (form.chkDto().getValue()) val.append("DTO,");
	if (form.chkGen().getValue()) val.append("GEN,");
	if (form.chkHl7().getValue()) val.append("HL7,");
	if (form.chkUi().getValue()) val.append("UI,");
	if (form.chkData().getValue()) val.append("DOM,");
	form.chkEnviroment().setValue(false);
	
	String full = val.toString();
	if (full.endsWith(",")) full = full.substring(0,full.length()-1);
	if (full.equals("")) full = "NONE";
	
	try
	{
		domain.saveConfigFlag(ConfigFlag.getConfigFlag(ConfigFlag.DISPLAY_CHOICE.getName()), full);
	}
	catch (DomainInterfaceException e)
	{
		engine.showMessage(e.getMessage());
		return;
	}
	
	setupRootRows();
}
 
Example 31
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String getPDFStorePath()
{
	String storePath = ConfigFlag.GEN.PDF_STORE_PATH.getValue();
	
	if(!(storePath.endsWith("/") || storePath.endsWith("\\")))
		storePath = storePath + "/";
			
	return storePath;
}
 
Example 32
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
@Override
protected void onCmbSourceOfReferralValueChanged() throws PresentationLogicException 
{
	showExtraUIControls();
	
	if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue()) && form.lyrAdmission().tabTCI().isVisible())
		showExtraUIControls_ElectiveList();
	
	enableInstanceControls(true);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateCareSpellRows(CareSpellVoCollection voCollCareSpells)
{
	grdListRow careSpellRow;
	for (int i = 0; i < voCollCareSpells.size(); i++)
	{
		careSpellRow = form.grdList().getRows().newRow();
		CareSpellVo careSpellVo = voCollCareSpells.get(i);
		setStartDateEndDateAndTooltip(careSpellRow, careSpellVo);
		careSpellRow.setCollapsedImage(form.getImages().Core.CareSpell);
		careSpellRow.setExpandedImage(form.getImages().Core.CareSpell);
		careSpellRow.setBackColor(Color.Bisque);
		careSpellRow.setBold(true);
		careSpellRow.setValue(careSpellVo);
		careSpellRow.setColumnHistoryEmpty(true);   //wdev-13896
		//wdev-13977
		if(voCollCareSpells.get(i).getCurrentStatusIsNotNull() && voCollCareSpells.get(i).getCurrentStatus().getStatusIsNotNull() 
				&& voCollCareSpells.get(i).getCurrentStatus().getStatus().equals(ProblemGroupStatus.CANCELLED))
			careSpellRow.setBackColor(ConfigFlag.UI.DISPLAY_COLOUR_FOR_CANCELLED_PROBLEM_GROUPS.getValue());
		//-------

		

		if (careSpellVo.getEndDateIsNotNull())
			form.getLocalContext().setParentEnded(Boolean.TRUE);

		boolean bCollapseAll = populateEpisodeOfCareRows(careSpellVo.getEpisodes().sort(), careSpellRow);
		careSpellRow.setExpanded(!bCollapseAll);
	}
}
 
Example 34
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void gotoMyOrder(boolean switchTabToItems) throws PresentationLogicException
{
	populateMyOrderPreview(switchTabToItems);

	if (engine.getFormName().equals(form.getForms().OCRR.SelectAndOrderDialog))
	{
		if ((ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("Standard") || ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("CARE_UK") || ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("UKSH")) && engine.getPreviousNonDialogFormName().equals(form.getForms().OCRR.MyOrder)) //WDEV-11881
		{
			engine.close(DialogResult.OK);
			return;
		}
	}

	if (form.getForms().OCRR.MyOrder.equals(engine.getPreviosFormName()) || form.getForms().OCRR.MyOrderDialog.equals(engine.getPreviosFormName()))
	{
		engine.close(DialogResult.OK);
		return;
	}
	
	
	form.getGlobalContext().OCRR.setRefusedInvestigation(null);//WDEV-16762
	
	if((ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("Standard") || ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("CARE_UK") || ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("UKSH")) && engine.isDialog()) //WDEV-11881
		engine.open(form.getForms().OCRR.MyOrderDialog);
	else
		engine.open(form.getForms().OCRR.MyOrder);	
}
 
Example 35
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void open() 
{
	PatIdType dispIdType = PatIdType.getNegativeInstance(ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue()); 
	form.imbMerge().setVisible(false);
	form.imbMerge().setEnabled(false);
	form.cmbFromIdType().setValue(dispIdType);
	form.txtFromId().setValue(null);
	form.cmbToIdType().setValue(dispIdType);
	form.txtToId().setValue(null);
	PatIdType disIdType = PatIdType.getNegativeInstance(ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue()); 
	form.getLocalContext().setPatientType(disIdType.getIItemText());
	form.grdFromPatDetails().setcolHospCaption(form.getLocalContext().getPatientType());
	form.grdToPatDetails().setcolHospCaption(form.getLocalContext().getPatientType());
}
 
Example 36
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void removeInstance() 
{

	if (form.treOrgPCTCode().getValue() instanceof OrganisationPCTLinkConfigVo)
	{
		form.getLocalContext().setLocalContextOrgPCTCode((OrganisationPCTLinkConfigVo)form.treOrgPCTCode().getValue());
	}
	else
	{
		form.getLocalContext().setLocalContextOrgPCTCode((OrganisationPCTLinkConfigVo)form.treOrgPCTCode().getSelectedNode().getNodes().get(0).getValue());
	}

	if (domain.isStale(form.getLocalContext().getLocalContextOrgPCTCode()))
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		form.getLocalContext().setLocalContextOrgPCTCode(null);
		return;
	}
		
	try
	{
		domain.removeOrgPCTCode(form.getLocalContext().getLocalContextOrgPCTCode());	
	}
	catch (ForeignKeyViolationException e)
	{
		engine.showMessage("This Configuration is in use!");
		return ;
	}			
	return ;
	
}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void rieDrugToxicologyItem()
{
	if (form.getGlobalContext().Clinical.getSelectedDrugToxicologyItem() == null)
		return;
	
	String comment = form.getGlobalContext().Core.getRieMessage();
	
	boolean isStale = false;
	if(domain.isStale(form.getGlobalContext().Clinical.getSelectedDrugToxicologyItem()))
	{
		isStale = true;
	}
	
	
	if(isStale)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		return;
	}
	
	try
	{
		domain.markAsRie(form.getGlobalContext().Clinical.getSelectedDrugToxicologyItem(), engine.getFormName(), null,  null, form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext(), comment);
	}
	catch (StaleObjectException e)
	{
		e.printStackTrace();
	}
}
 
Example 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void cancelTCI()
{
	//WDEV-18449 -- start
	ReferralAppointmentDetailsBookingAppointmentVo appointmentsDetails = null;
	Boolean tciHasAppointment = false;
	if (form.lyrSelect().tabWaitingList().grdWaitingList().getValue() != null && form.lyrSelect().tabWaitingList().grdWaitingList().getValue().getTCIDetailsIsNotNull() && form.lyrSelect().tabWaitingList().grdWaitingList().getValue().getTCIDetails().getAppointmentIsNotNull() && form.lyrSelect().tabWaitingList().grdWaitingList().getValue().getTCIDetails().getAppointment().getTheatreBookingIsNotNull())
	{
		appointmentsDetails = form.lyrSelect().tabWaitingList().grdWaitingList().getValue().getTCIDetails().getAppointment();
		form.getGlobalContext().Scheduling.setApptCancelStatus(setAppointmentStatus(form.getGlobalContext().RefMan.getTCIOutcomeForPatientElectiveList()));
		tciHasAppointment = true;
	}
	//WDEV-18449 -- end
	
	try
	{
		domain.cancelTCI(form.lyrSelect().tabWaitingList().grdWaitingList().getValue(), form.getGlobalContext().RefMan.getTCIOutcomeForPatientElectiveList());
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		return;
	}
	
	//WDEV-18449 -- start
	if (tciHasAppointment && form.getGlobalContext().RefMan.getTCIOutcomeForPatientElectiveList() != null && Boolean.TRUE.equals(form.getGlobalContext().RefMan.getTCIOutcomeForPatientElectiveList().getCancelTheatreAppointment()))
	{
		form.getLocalContext().setApptToCancel(appointmentsDetails);
		cancelAppt(true);
		setActionedDNAedAndCancelledButtons();
	}
	//WDEV-18449 -- end
}
 
Example 39
Project: AvoinApotti   File: AttendanceListImpl.java   View source code 5 votes vote down vote up
private Integer getPatIdentifierFlag()
{
	PatIdType patIdType = PatIdType.getNegativeInstance(ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue());
	if(patIdType != null)
		return new Integer(patIdType.getID());
		
	return null;
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void showActivityFunctionTabs()
{

	if (ConfigFlag.UI.SERVICE_TABS.getValue().equals("ACT"))
	{
		form.getLocalContext().settreMessage("No " + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(true));
		form.lyr1().Edit().lyrActivityFunction().tabPageFunction().setHeaderVisible(false);
		form.lyr1().Edit().lyrActivityFunction().tabPageActivity().setHeaderVisible(true);
		form.lyr1().Edit().lyrActivityFunction().showtabPageActivity();
		form.lyr1().Edit().lyrActivityFunction().tabPageActivity().cmbActivityType().setValue(ActivityType.PROCEDURE);
	}
	else if (ConfigFlag.UI.SERVICE_TABS.getValue().equals("FUNC"))
	{
		form.getLocalContext().settreMessage("No " + ConfigFlag.UI.DISPLAY_NAME_FUNCTION.getValue(true));
		form.lyr1().Edit().lyrActivityFunction().tabPageFunction().setHeaderVisible(true);
		form.lyr1().Edit().lyrActivityFunction().showtabPageFunction();
		form.lyr1().Edit().lyrActivityFunction().tabPageActivity().setHeaderVisible(false);
	}
	else if (ConfigFlag.UI.SERVICE_TABS.getValue().equals("ALL"))
	{
		form.getLocalContext().settreMessage("No " + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(true) + " / " + ConfigFlag.UI.DISPLAY_NAME_FUNCTION.getValue(true) + " found.");
		form.lyr1().Edit().lyrActivityFunction().tabPageFunction().setHeaderVisible(true);
		form.lyr1().Edit().lyrActivityFunction().tabPageActivity().setHeaderVisible(true);
		form.lyr1().Edit().lyrActivityFunction().showtabPageActivity();
	}
	else if (ConfigFlag.UI.SERVICE_TABS.getValue().equals("NONE"))
	{
		form.getLocalContext().settreMessage("");
		form.lyr1().Edit().lyrActivityFunction().tabPageFunction().setHeaderVisible(false);
		form.lyr1().Edit().lyrActivityFunction().settabPageFunctionEnabled(false);
		form.lyr1().Edit().lyrActivityFunction().tabPageActivity().setHeaderVisible(false);
		form.lyr1().Edit().lyrActivityFunction().settabPageActivityEnabled(false);
		form.lyr1().Edit().lyrActivityFunction().hide();
	}
}