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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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();
	}
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String[] validateOrderPrioritiesUI()
{
	boolean isPathologyOrderPriorityMandatory = ConfigFlag.UI.CATEGORIES_MANDATORY_ORDER_PRIORITY.getValue().equals(PATHOLOGY_PRIORITY_REQUIRED)
													|| ConfigFlag.UI.CATEGORIES_MANDATORY_ORDER_PRIORITY.getValue().equals(PATHOLOGY_AND_RADIOLOGY_REQUIRED);
	
	boolean isRadiologyOrderPriorityMandatory = ConfigFlag.UI.CATEGORIES_MANDATORY_ORDER_PRIORITY.getValue().equals(RADIOLOGY_PRIORITY_REQUIRED)
													|| ConfigFlag.UI.CATEGORIES_MANDATORY_ORDER_PRIORITY.getValue().equals(PATHOLOGY_AND_RADIOLOGY_REQUIRED);

	
	ArrayList<String> errors = new ArrayList<String>();
	
	for (int i = 0; i < form.grdOrderInvestigation().getAllRows().length; i++)
	{
		grdOrderInvestigationRow row = form.grdOrderInvestigation().getAllRows()[i];

		if (row.getcolComponent() != null && Category.PATHOLOGY.equals(row.getcolComponent().getCategory()) && isPathologyOrderPriorityMandatory)
		{
			if (row.getParentRow() != null && row.getParentRow().getcolPriority().getValue() == null)
				errors.add("Order Priority for Pathology investigations is mandatory.");
			
			if (row.getParentRow() == null && row.getcolPriority().getValue() == null)
				errors.add("Order Priority for Pathology investigations is mandatory.");
		}
		
		if (row.getcolComponent() != null && Category.CLINICALIMAGING.equals(row.getcolComponent().getCategory()) && isRadiologyOrderPriorityMandatory)
		{
			if (row.getParentRow() != null && row.getParentRow().getcolPriority().getValue() == null)
				errors.add("Order Priority for Radiology investigations is mandatory.");
			
			if (row.getParentRow() == null && row.getcolPriority().getValue() == null)
				errors.add("Order Priority for Radiology investigations is mandatory.");
		}
	}

	return errors.toArray(new String[errors.size()]);
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	
	form.ccPrinters().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT, false);		
	
	if(form.getGlobalContext().Core.getPrepareForPrintingIsNotNull() && form.getGlobalContext().Core.getPrepareForPrinting().equals(Boolean.TRUE))
	{
		form.btnPreview().setEnabled(false);
	}
	
	form.chkStoreCopy().setVisible(ConfigFlag.GEN.CREATE_NEW_PATIENTDOCUMENT_ON_PRINTREPORTDIALOG.getValue() && form.getGlobalContext().Core.getPatientShortIsNotNull());//WDEV-17772
	
	open();
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DocumentViewLevel getDocumentViewLevel()
{
	String value = ConfigFlag.GEN.DOCUMENT_VIEW_LEVEL.getValue();
	if (value == null)
		return null;
	if (value.equals(DocumentViewLevel.CARECONTEXT.getText()))
		return DocumentViewLevel.CARECONTEXT;
	if (value.equals(DocumentViewLevel.PATIENT.getText()))
		return DocumentViewLevel.PATIENT;
	if (value.equals(DocumentViewLevel.REFERRAL.getText()))
		return DocumentViewLevel.REFERRAL;
	return null;
}
 
Example 44
Project: AvoinApotti   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
/**
 * WDEV-16240
 * updateDementiaRecordForInpatient - update Dementia record if specific inpatient details modified
 * @param factory
 * @param doAdmissionDetail
 * @throws StaleObjectException 
 */
private void updateDementiaRecordForInpatient(DomainFactory factory, AdmissionDetail doAdmissionDetail) throws StaleObjectException
{
	if (ConfigFlag.GEN.DEMENTIA_FUNCTIONALITY.getValue() == false)
		return;
	
	// Get the Dementia Record for this Admission record
	ArrayList<Object> values = new ArrayList<Object>();
	ArrayList<String> labels = new ArrayList<String>();
	values.add(doAdmissionDetail);
	labels.add("admission");
	List lst = factory.find(" from Dementia d where d.admissionDetail = :admission and (d.isRIE is null or d.isRIE = false) ", labels, values);
	if (lst == null || lst.size() == 0)
		return;
	
	Dementia domDem = (Dementia) lst.get(0);
	
	// We only want to update the Dementia record if the admission datetime has been modified
	if (domDem.getAdmissionDateTime() != null && domDem.getAdmissionDateTime().equals(doAdmissionDetail.getAdmissionDateTime()))
		return;

	// Get the Dementia Configuration record
	DementiaConfiguration dementiaConfig = getDementiaConfigRecord(factory);
	if (dementiaConfig == null)
		return;
	
	domDem.setAdmissionDateTime(doAdmissionDetail.getAdmissionDateTime());
	domDem.setBreachDateTime(calculateBreachDate(doAdmissionDetail.getAdmissionDateTime(), dementiaConfig.getStepOnePeriod()));
	domDem.setAgeOnAdmission(calculateAge(doAdmissionDetail.getPasEvent().getPatient(), doAdmissionDetail.getAdmissionDateTime()));

	factory.save(domDem);
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String formatServiceFunctionTooltip(ServiceFunctionVo voServiceFunction)
{
	String out = formatServicevoTooltip(voServiceFunction.getService());
	out += makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_FUNCTION.getValue(true) + ": *", "DarkRed", "tahoma", "14");
	out += makeTextile(voServiceFunction.getFunctionIsNotNull() ? voServiceFunction.getFunction().getText() : "", (voServiceFunction.getIsActiveIsNotNull() ? (voServiceFunction.getIsActive().booleanValue() ? "black" : "red") : "black"), "tahoma", "12");
	return new TextileString(out).toString();
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void fillServerDetails()
{
	form.lyr1().tabSess().ctnServerDetails().txtStart().setValue(ConfigFlag.START_TIME.getValue());
	form.lyr1().tabSess().ctnServerDetails().txtHostname().setValue(ConfigFlag.HOST_NAME.getValue());
	form.lyr1().tabSess().ctnServerDetails().txtDeployDir().setValue(EnvironmentConfig.getBaseUri());
	form.lyr1().tabSess().ctnServerDetails().txtDbtype().setValue(ConfigFlag.DBTYPE.getValue());
	form.lyr1().tabSess().ctnServerDetails().txtDatasource().setValue(EnvironmentConfig.getMainDataSourceName());
	form.lyr1().tabSess().ctnServerDetails().txtCfgFile().setValue(ConfigFlag.getConfigFlagFullFilename());
	form.lyr1().tabSess().ctnServerDetails().txtServerType().setValue(EnvironmentConfig.getApplicationServerType());

	form.lyr1().tabSess().ctnServerDetails().txtCount().setValue("" + form.lyr1().tabSess().grdSess().getRows().size());
	form.lyr1().tabSess().ctnServerDetails().txtTimeOut().setValue("" + ConfigFlag.GEN.SESSION_TIMEOUT.getValue());
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * WDEV-13601
 * Method used to access Maxims store path
 * @return
 */
private String getMaximsDocumentStorePath()
{
	String storePath = ConfigFlag.GEN.PDF_STORE_PATH.getValue();	// WDEV-13366
	
	if(!(storePath.endsWith("/") || storePath.endsWith("\\")))
		storePath = storePath + "/";
			
	return storePath;
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open()
{
	if( ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue() == true )	//wdev-18936
	{
   		if( form.getGlobalContext().Core.getPatientElectiveListForWardViewVo() == null)
   			throw new CodingRuntimeException("PatientElectiveList Global Context is null");
	}
	else
	{
		if(form.getGlobalContext().Core.getPendingElectiveAdmission() == null)
   			throw new CodingRuntimeException("PendingElectiveAdmission Global Context is null");
	}

	loadHospitals();
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean apptInThePastValidateNeeded()
{
	boolean isValidationNeeded = false;
	if(ConfigFlag.UI.DISPLAY_WARNING_MESSAGE_IF_BOOKING_IN_PAST.getValue())
	{
		if(isApptInthePast())
		{
			form.getLocalContext().setApptInPastMessageBoxId(engine.showMessage("The selected date of the appointment is in the past. Do you wish to continue to book the appointment", "Booking Historical Appointment?", MessageButtons.YESNO));
			isValidationNeeded = true;
		}
	}
	
	return isValidationNeeded;
}
 
Example 50
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 51
Project: AvoinApotti   File: PatientListsImpl.java   Source Code and License 5 votes vote down vote up
private void populatePasContactFromDtoOutpatient(PasContactVo voPasContact, OutpatientlistRecord dtoOutpatient)
{
	String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();			
	LocShortVo voLoc = new LocShortVo();		
	OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class);
	
	voLoc = locImpl.getLocationByLocalCode(dtoOutpatient.Cliniccode,LocationType.CLINIC);
	voPasContact.setLocation(voLoc);
					
	HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);
	
	MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoOutpatient.Hcpcode);
	voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);
			

	Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoOutpatient.Specialty);			
	
	voPasContact.setSpecialty(specialty);			
	
	//Contact Number
	voPasContact.setContactNumber(dtoOutpatient.Contactno);
	try {
		voPasContact.setAppointmentDateTime(new DateTime (dtoOutpatient.Apptdate, "1000"));
	} catch (ParseException e) {
		voPasContact.setAppointmentDateTime(null);
	}
					
	PatientShort voPatientShort = new PatientShort();
	voPatientShort.setName(dtoOutpatient.Snm, dtoOutpatient.Fnm1, null);	

	voPatientShort.addId(PatIdType.HOSPNUM, dtoOutpatient.Hospnum);						
	voPatientShort.addId(PatIdType.CHARTNUM, dtoOutpatient.Chartnum);						

	if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
		voPatientShort.setDob(new PartialDate(dtoOutpatient.Dob));	
	else
		voPatientShort.setDob(null);
	
	if(dtoOutpatient.Dod != null && dtoOutpatient.Dod != "")
	{
		try {voPatientShort.setDod(new Date(dtoOutpatient.Dod,DateFormat.ISO));
		} catch (ParseException e2) {
			e2.printStackTrace();
		}
	}
	
	if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
		voPatientShort.calculateAge();
	
	voPatientShort.setWard(voPasContact.getLocation());		
	voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoOutpatient.Sex));
	voPasContact.setPatient(voPatientShort);			
	voPasContact.setGPCode(dtoOutpatient.Gpcode);

	if (dtoOutpatient.Documentstatus != ""  && Integer.valueOf(dtoOutpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
	{ 
		voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoOutpatient.Documentstatus).intValue()));
	}
	else				
	{
		if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
			voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
		else
			voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
	}		
}
 
Example 52
Project: AvoinApotti   File: PatientListsImpl.java   Source Code and License 5 votes vote down vote up
public PasContactVoCollection listInPatients(PatientListsFilterVo voSearchCriteria) throws DomainInterfaceException 
{ 								
	if (ConfigFlag.UI.USE_PAS_CONTACT_FOR_CORRESPONDENCE.getValue())
	{			
		return listDTOInPatient(voSearchCriteria);			
	}
	else
	{
		return listPAtientPasEvents(voSearchCriteria);
	}
}
 
Example 53
Project: AvoinApotti   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
/**
 * WDEV-16240
 * updateDementiaRecordForCancelDischarge - As this is a cancel discharge, we have to clear out discharge date and possibly remove excluded status records
 * @param factory
 * @param doAdmissionDetail
 * @throws StaleObjectException 
 * @throws ForeignKeyViolationException 
 */
private void updateDementiaRecordForCancelDischarge(DomainFactory factory, AdmissionDetail doAdmissionDetail) throws StaleObjectException, ForeignKeyViolationException
{
	if (ConfigFlag.GEN.DEMENTIA_FUNCTIONALITY.getValue() == false)
		return;
	
	// Get the Dementia Record for this Admission record
	ArrayList<Object> values = new ArrayList<Object>();
	ArrayList<String> labels = new ArrayList<String>();
	values.add(doAdmissionDetail);
	labels.add("admission");
	List lst = factory.find(" from Dementia d where d.admissionDetail = :admission and (d.isRIE is null or d.isRIE = false) ", labels, values);
	if (lst == null || lst.size() == 0)
		return;
	
	Dementia domDem = (Dementia) lst.get(0);
	
	domDem.setDischargeDateTime(null);
	// If the current status is excluded, we want to remove this
	if (domDem.getCurrentWorklistStatus().getReasonForExclusion() != null && domDem.getCurrentWorklistStatus().getReasonForExclusion().getId() == ims.core.vo.lookups.DementiaReasonForExclusion.EARLY_DISCHARGE.getID())
	{
		DementiaWorklistStatus stat = domDem.getCurrentWorklistStatus();
		domDem.getHistoricalWorklistStatus().remove(domDem.getHistoricalWorklistStatus().size()-1); // Remove the last record
		domDem.setCurrentWorklistStatus((DementiaWorklistStatus) domDem.getHistoricalWorklistStatus().get(domDem.getHistoricalWorklistStatus().size()-1));
		factory.delete(stat);
		domDem.setIsExcludedFromWorklist(false);
	}
	
	factory.save(domDem);

}
 
Example 54
Project: AvoinApotti   File: ClinicListImpl.java   Source Code and License 5 votes vote down vote up
private void  instantiatePatientEvent(CatsReferral doCats) throws StaleObjectException, DomainInterfaceException //WDEV-18325
{	
	if (!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue())
		return;
	
	if(doCats == null || doCats.getJourney() == null || doCats.getJourney().getCurrentClock() == null)
		return;
	
	RTTStatusEventMapVo  rttEventMap = null;

	if (doCats.getJourney().getCurrentClock().getCurrentRTTStatus() != null)
	{
		rttEventMap = getRTTStatusEventMap(doCats.getJourney().getCurrentClock().getCurrentRTTStatus().getRTTStatus());
	}
	
	if (rttEventMap == null || rttEventMap.getEvent() == null)
		return;
	
	PatientEventVo patEvent = new PatientEventVo();
	patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCats.getPatient()));
	patEvent.setEvent(rttEventMap.getEvent());
	patEvent.setEventDateTime(new DateTime());
	patEvent.setEventStatus(EventStatus.ACTIVE);
	patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney()));
	
	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(ims.pathways.domain.impl.HL7PathwayIfImpl.class);
	
	impl.instantiatePatientEvent(patEvent);
	
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateOrderDetails(NewResultOcsOrderVo order)
{
	form.getGlobalContext().OCRR.setQuestionsNotes(order);
	if (order == null)
		return;

	boolean hasQuestions = order.getClinicalInfoIsNotNull() && order.getClinicalInfo().getCategoryQuestionAnswersIsNotNull() && order.getClinicalInfo().getCategoryQuestionAnswers().size() > 0;
	boolean hasNotes = order.getAdditClinNotesIsNotNull() && order.getAdditClinNotes().length() > 0;
	if (hasQuestions || hasNotes)
	{
		form.lnkViewOrderNotes().setEnabled(true);
		form.lnkViewOrderNotes().setTooltip("Click to view Order Notes");
	}
	else
	{
		form.lnkViewOrderNotes().setTooltip("No Order Notes Entered");
		form.lnkViewOrderNotes().setEnabled(true);
	}

	form.txtOrderingLocation().setValue(order.getCorrectLocation());
	form.txtClinician().setValue(order.getCorrectClinician());

	if (order.getOrderedByIsNotNull() && order.getOrderedBy().getNameIsNotNull())
	{
		form.txtRequestedBy().setValue(order.getOrderedBy().getName().toString());
	}
	if (order.getSysInfoIsNotNull())
		form.txtOrderDt().setValue(order.getSysInfo().getCreationDateTime().toString());
	
	//WDEV-4758
	if(ConfigFlag.DOM.CREATE_ORDERS_WITH_CARECONTEXT_ONLY.getValue())
	{
		if(order.getCareContextIsNotNull() && order.getCareContext().getPasEventIsNotNull())
			form.txtPasEpisodeID().setValue(order.getCareContext().getPasEvent().getPasEpisodeId());
	}
	
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String formatServiceActivityTooltip(ServiceActivityVo voServiceActivity)
{
	String out = formatServicevoTooltip(voServiceActivity.getService());
	out += makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(true) + ": *", "DarkRed", "tahoma", "14");
	out += makeTextile(voServiceActivity.getActivityIsNotNull() ? voServiceActivity.getActivity().getName() : "", (voServiceActivity.getIsActive().booleanValue() ? "black" : "red"), "tahoma", "12");

	return new TextileString(out).toString();
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addAllergyRow(PatientAllergyForTriageVo allergy) 
{
	if(allergy == null)
		return;
	
	grdAllergiesRow row = form.grdAllergies().getRows().newRow();
	row.setColAllergy(allergy.getAllergenDescription());
	row.setTextColor(ConfigFlag.UI.ALLERGIES_COMPONENT_TEXT_COLOUR.getValue());		//wdev-16133
	row.setTooltipForColAllergy(allergy.getAllergenDescription());//WDEV-15092
	row.setValue(allergy);
}
 
Example 58
Project: AvoinApotti   File: ConfigFlagsImpl.java   Source Code and License 5 votes vote down vote up
public IFlag[] listFlags(FlagCategoryVo catVo, String filter)
{
	IFlag[] flags = ConfigFlag.getFlags(catVo.getKey());
	ArrayList mf = new ArrayList();
	for (int i = 0; i < flags.length; i++)
	{
		if (flags[i].getName().toUpperCase().indexOf(filter.toUpperCase()) != -1)
				mf.add(flags[i]);
	}
	IFlag[] ret = new IFlag[mf.size()];
	mf.toArray(ret);
	return ret;
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean save() 
{
	PlanOfCareActionsVoCollection recordColl = populateDataFromScreen();
	PlanOfCareNotingVo recordNoting = populateDataFromScreenForNoting(recordColl);
	
	String[] uiErrors = getUiErrors();
	String[] errors = recordNoting.validate(uiErrors);
	if(errors != null && errors.length > 0)
	{
		engine.showErrors(errors);	
		return false;
	}
	
	try
	{	
		domain.saveActionsReview(recordColl, recordNoting);
	}
	
	catch(StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		
		return false;
	}
	
	return true;
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialize() 
{
	int interval = ConfigFlag.GEN.SESSION_TIMEOUT.getValue();
	form.getTimers().gettimerSession().setInterval(interval - 1 > 0 ? (interval - 1) * 60 : 58);
	
	IAppUser user = engine.getLoggedInUser();
	
	if(user != null)
	{
		form.pnlUser().setValue(user.getUserRealName());
	}
	
	if(form.getGlobalContext().Core.getPatientShortIsNotNull())
	{
		form.txtPatient().setValue(form.getGlobalContext().Core.getPatientShort().getNameIsNotNull() ? form.getGlobalContext().Core.getPatientShort().getName().toString() : null);
		form.txtNhsNumber().setValue(form.getGlobalContext().Core.getPatientShort().getNhsn() != null ? form.getGlobalContext().Core.getPatientShort().getNhsn().getIdValue() : null);
	}
	
	if(form.getGlobalContext().Core.getPatientCorrespondenceIsNotNull())
	{
		form.txtDocumentName().setValue(form.getGlobalContext().Core.getPatientCorrespondence().getName());
		form.txtDocumentDate().setValue(form.getGlobalContext().Core.getPatientCorrespondence().getDocumentDate() != null ? form.getGlobalContext().Core.getPatientCorrespondence().getDocumentDate().toString() : null);
		
		//WDEV-11714
		form.intNoOfCopies().setValue(form.getGlobalContext().Core.getPatientCorrespondence().getNoOfCopies());
	}
}