Java Code Examples for ims.core.vo.ClinicalNotesVo

The following are top voted examples for showing how to use ims.core.vo.ClinicalNotesVo. 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
@Override
protected void onGrdContactsGridHeaderClicked(int column) throws PresentationLogicException
{
	if (DATE_TIME_COL_INDEX == column)
	{
		ClinicalNotesVo selectedValue = form.grdContacts().getValue();
		ClinicalNotesVoCollection data = new ClinicalNotesVoCollection();
		
		for (int i = 0 ; i < form.grdContacts().getRows().size() ; i ++)
		{
			data.add(form.grdContacts().getRows().get(i).getValue());
		}
		form.getLocalContext().setDateTimeSortOrder(getNextOrder(form.getLocalContext().getDateTimeSortOrder()));
		data.sort(new DateTimeClinicalNotesComparator(form.getLocalContext().getDateTimeSortOrder()));
		form.grdContacts().getRows().clear();			
		populateGridFromData(data);
		form.grdContacts().setValue(selectedValue);
		if (form.grdContacts().getValue()!= null)
			onGrdContactsSelectionChanged();
		
	}
	
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void selectClinicalNoteInGlobalContext()
{

	ClinicalNotesVo clinicalNotesVoForContact = null;

	try
	{
		clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.dyngrdList().getSelectedRow().getValue());
	}
	catch (RuntimeException e)
	{
		engine.showMessage(e.getMessage());
	}

	ClinicalNotesShortVo clinicalNotesForContact = null;

	if (clinicalNotesVoForContact != null)
		clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
	form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);

	if (clinicalNotesVoForContact != null)
		form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
	else
		form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenControls(ClinicalNotesVo voNote) throws FormOpenException 
{
	if (voNote.getIsDerivedNoteIsNotNull() 
		&& voNote.getIsDerivedNote().booleanValue())
		throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
	
	form.getLocalContext().setclinicalNotesVo(voNote);
	
	settingCustomAuthoring(voNote);

	form.cmbNoteType().setValue(voNote.getNoteClassification());
	form.richNotes().setValue(voNote.getClinicalNote());
	
	form.txtDiscipline().setValue(voNote.getDisciplineIsNotNull() ? voNote.getDiscipline().getText() : "");//wdev-8976

	if (voNote.getIsCorrectedIsNotNull()
		&& voNote.getIsCorrected())
	{
		form.lblCorrect().setVisible(true);
		form.txtCorrectionReason().setVisible(true);
		form.txtCorrectionReason().setEnabled(form.getMode().equals(FormMode.EDIT));
		
		form.txtCorrectionReason().setValue(voNote.getCurrentStatusIsNotNull() ? voNote.getCurrentStatus().getCorrectionReason() : "");
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public void open() throws ims.framework.exceptions.PresentationLogicException
{
	clearControls();

	setCurrentClinicalNote();
		
	if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
	{
		//WDEV-1037 - Notes created on this form need to have notetype set to SUMMARYATADMISSION( -882) and have discipline set to MEDICAL ( -59) 
		form.getLocalContext().setSelectedRecord(domain.get(null, ClinicalNoteType.SUMMARYATADMISSION, HcpDisType.MEDICAL ,form.getGlobalContext().Core.getCurrentCareContext()));
		if (form.getLocalContext().getSelectedRecordIsNotNull())
		{
			ClinicalNotesVo admissionNotes = form.getLocalContext().getSelectedRecord().getAdmissionNotes();
			if (admissionNotes != null)
			{
				if (admissionNotes.getAuthoringInfoIsNotNull())
					form.customControlAuthoringInfo().setValue(admissionNotes.getAuthoringInfo());

				form.txtSummary().setValue(admissionNotes.getClinicalNote());					
			}
		}
	}
	
	form.setMode(FormMode.VIEW);
}
 
Example 5
Project: AvoinApotti   File: ClinicalNoteDrawingImpl.java   Source Code and License 6 votes vote down vote up
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
	if(careContextRefVo != null)
	{
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + " clinnote.careContext.id = :careContextId");
			markers.add("careContextId");
		values.add(careContextRefVo.getID_CareContext());
		andStr = " and ";	

		List listNotes = factory.find(hql.toString(), markers,values);
		if(listNotes != null && listNotes.size() > 0)
		{ 
			ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
			if(voColl != null && voColl.size() > 0)
				return voColl.get(0);
		}
	}
	return null;
}
 
Example 6
Project: AvoinApotti   File: ExtendedClinicalNotesImpl.java   Source Code and License 6 votes vote down vote up
/**
* getClinicalNotes
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.admin.vo.ClinicalContactRefVo contactVo) 
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
	String andStr = " ";

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

	hql.append(andStr + " clinnote.clinicalContact.id = :ccId");
		markers.add("ccId");
	values.add(contactVo.getID_ClinicalContact());
	andStr = " and ";	

	List<?> listNotes = factory.find(hql.toString(), markers,values);
	if(listNotes != null && listNotes.size() > 0)
	{ 
		ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdContactsGridHeaderClicked(int column) throws PresentationLogicException
{
	if (DATE_TIME_COL_INDEX == column)
	{
		ClinicalNotesVo selectedValue = form.grdContacts().getValue();
		ClinicalNotesVoCollection data = new ClinicalNotesVoCollection();
		
		for (int i = 0 ; i < form.grdContacts().getRows().size() ; i ++)
		{
			data.add(form.grdContacts().getRows().get(i).getValue());
		}
		form.getLocalContext().setDateTimeSortOrder(getNextOrder(form.getLocalContext().getDateTimeSortOrder()));
		data.sort(new DateTimeClinicalNotesComparator(form.getLocalContext().getDateTimeSortOrder()));
		form.grdContacts().getRows().clear();			
		populateGridFromData(data);
		form.grdContacts().setValue(selectedValue);
		if (form.grdContacts().getValue()!= null)
			onGrdContactsSelectionChanged();
		
	}
	
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void displayCreationInfo()
{
	ClinicalNotesVo voClinicalNotes = form.getLocalContext().getClinicalNotes();
	StringBuffer notes = new StringBuffer();
	if (voClinicalNotes != null && voClinicalNotes.getID_ClinicalNotesIsNotNull())
	{
		notes.append("Creation:          ");
		notes.append("Recording User:    ");
		notes.append(voClinicalNotes.getSystemInfoIsNotNull() ? voClinicalNotes.getSystemInfo().getCreationUser() : "");
		notes.append(";    ");
		DateTime recDateTime =  voClinicalNotes.getSystemInfo().getCreationDateTime();
		if(recDateTime != null)
		{
			notes.append("Recording Date:   ");
			notes.append(recDateTime.getDate().toString(DateFormat.STANDARD));
			notes.append(";    ");
			notes.append("Recording Time:   ");
			notes.append(recDateTime.getTime().toString(TimeFormat.DEFAULT));
			notes.append(";    ");
		}
	}
}
 
Example 9
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public void open() throws ims.framework.exceptions.PresentationLogicException
{
	clearControls();

	setCurrentClinicalNote();
		
	if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
	{
		//WDEV-1037 - Notes created on this form need to have notetype set to SUMMARYATADMISSION( -882) and have discipline set to MEDICAL ( -59) 
		form.getLocalContext().setSelectedRecord(domain.get(null, ClinicalNoteType.SUMMARYATADMISSION, HcpDisType.MEDICAL ,form.getGlobalContext().Core.getCurrentCareContext()));
		if (form.getLocalContext().getSelectedRecordIsNotNull())
		{
			ClinicalNotesVo admissionNotes = form.getLocalContext().getSelectedRecord().getAdmissionNotes();
			if (admissionNotes != null)
			{
				if (admissionNotes.getAuthoringInfoIsNotNull())
					form.customControlAuthoringInfo().setValue(admissionNotes.getAuthoringInfo());

				form.txtSummary().setValue(admissionNotes.getClinicalNote());					
			}
		}
	}
	
	form.setMode(FormMode.VIEW);
}
 
Example 10
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdContactsGridHeaderClicked(int column) throws PresentationLogicException
{
	if (DATE_TIME_COL_INDEX == column)
	{
		ClinicalNotesVo selectedValue = form.grdContacts().getValue();
		ClinicalNotesVoCollection data = new ClinicalNotesVoCollection();
		
		for (int i = 0 ; i < form.grdContacts().getRows().size() ; i ++)
		{
			data.add(form.grdContacts().getRows().get(i).getValue());
		}
		form.getLocalContext().setDateTimeSortOrder(getNextOrder(form.getLocalContext().getDateTimeSortOrder()));
		data.sort(new DateTimeClinicalNotesComparator(form.getLocalContext().getDateTimeSortOrder()));
		form.grdContacts().getRows().clear();			
		populateGridFromData(data);
		form.grdContacts().setValue(selectedValue);
		if (form.grdContacts().getValue()!= null)
			onGrdContactsSelectionChanged();
		
	}
	
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void selectClinicalNoteInGlobalContext()
{

	ClinicalNotesVo clinicalNotesVoForContact = null;

	try
	{
		clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.dyngrdList().getSelectedRow().getValue());
	}
	catch (RuntimeException e)
	{
		engine.showMessage(e.getMessage());
	}

	ClinicalNotesShortVo clinicalNotesForContact = null;

	if (clinicalNotesVoForContact != null)
		clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
	form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);

	if (clinicalNotesVoForContact != null)
		form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
	else
		form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void selectClinicalNoteInGlobalContext()
{

	ClinicalNotesVo clinicalNotesVoForContact = null;

	try
	{
		clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.dyngrdList().getSelectedRow().getValue());
	}
	catch (RuntimeException e)
	{
		engine.showMessage(e.getMessage());
	}

	ClinicalNotesShortVo clinicalNotesForContact = null;

	if (clinicalNotesVoForContact != null)
		clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
	form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);

	if (clinicalNotesVoForContact != null)
		form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
	else
		form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
 
Example 13
Project: openmaxims-linux   File: ClinicalNoteDrawingImpl.java   Source Code and License 6 votes vote down vote up
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
	if(careContextRefVo != null)
	{
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + " clinnote.careContext.id = :careContextId");
			markers.add("careContextId");
		values.add(careContextRefVo.getID_CareContext());
		andStr = " and ";	

		List listNotes = factory.find(hql.toString(), markers,values);
		if(listNotes != null && listNotes.size() > 0)
		{ 
			ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
			if(voColl != null && voColl.size() > 0)
				return voColl.get(0);
		}
	}
	return null;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenControls(ClinicalNotesVo voNote) throws FormOpenException 
{
	if (voNote.getIsDerivedNoteIsNotNull() 
		&& voNote.getIsDerivedNote().booleanValue())
		throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
	
	form.getLocalContext().setclinicalNotesVo(voNote);
	
	settingCustomAuthoring(voNote);

	form.cmbNoteType().setValue(voNote.getNoteClassification());
	form.richNotes().setValue(voNote.getClinicalNote());
	
	form.txtDiscipline().setValue(voNote.getDisciplineIsNotNull() ? voNote.getDiscipline().getText() : "");//wdev-8976

	if (voNote.getIsCorrectedIsNotNull()
		&& voNote.getIsCorrected())
	{
		form.lblCorrect().setVisible(true);
		form.txtCorrectionReason().setVisible(true);
		form.txtCorrectionReason().setEnabled(form.getMode().equals(FormMode.EDIT));
		
		form.txtCorrectionReason().setValue(voNote.getCurrentStatusIsNotNull() ? voNote.getCurrentStatus().getCorrectionReason() : "");
	}
}
 
Example 15
Project: openmaxims-linux   File: ExtendedClinicalNotesImpl.java   Source Code and License 6 votes vote down vote up
/**
* getClinicalNotes
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.admin.vo.ClinicalContactRefVo contactVo) 
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
	String andStr = " ";

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

	hql.append(andStr + " clinnote.clinicalContact.id = :ccId");
		markers.add("ccId");
	values.add(contactVo.getID_ClinicalContact());
	andStr = " and ";	

	List<?> listNotes = factory.find(hql.toString(), markers,values);
	if(listNotes != null && listNotes.size() > 0)
	{ 
		ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 16
Project: openMAXIMS   File: ClinicalNoteDrawingImpl.java   Source Code and License 6 votes vote down vote up
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
	if(careContextRefVo != null)
	{
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + " clinnote.careContext.id = :careContextId");
			markers.add("careContextId");
		values.add(careContextRefVo.getID_CareContext());
		andStr = " and ";	

		List listNotes = factory.find(hql.toString(), markers,values);
		if(listNotes != null && listNotes.size() > 0)
		{ 
			ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
			if(voColl != null && voColl.size() > 0)
				return voColl.get(0);
		}
	}
	return null;
}
 
Example 17
Project: openMAXIMS   File: ExtendedClinicalNotesImpl.java   Source Code and License 6 votes vote down vote up
/**
* getClinicalNotes
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.admin.vo.ClinicalContactRefVo contactVo) 
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
	String andStr = " ";

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

	hql.append(andStr + " clinnote.clinicalContact.id = :ccId");
		markers.add("ccId");
	values.add(contactVo.getID_ClinicalContact());
	andStr = " and ";	

	List<?> listNotes = factory.find(hql.toString(), markers,values);
	if(listNotes != null && listNotes.size() > 0)
	{ 
		ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateGridFromData(ClinicalNotesVoCollection voListContacts)
{
	GenForm.grdContactsRow row;			
	ClinicalNotesVo voContactRecord;
	
	for (int i=0; i< voListContacts.size(); i++)
	{
		voContactRecord = voListContacts.get(i);			
		row = form.grdContacts().getRows().newRow();
		
		row.setcolDate(voContactRecord.getRecordingDateTime().toString());
		if (voContactRecord.getAuthoringInfoIsNotNull())
		{
			if (voContactRecord.getAuthoringInfo().getAuthoringHcpIsNotNull())
				row.setcolBy(voContactRecord.getAuthoringInfo().getAuthoringHcp().getName().toString());
		}
		if (voContactRecord.getDiscipline() != null)
			row.setColDiscipline(voContactRecord.getDiscipline().getText());

		if (voContactRecord.getIsCorrectedIsNotNull())
		{
			if (voContactRecord.getIsCorrected().booleanValue() == true)  // Correction has been added
				row.setcolNote(voContactRecord.getClinicalNote() + "\nCorrected By: " + voContactRecord.getCurrentStatus().getCorrectedBy() + " on " + voContactRecord.getCurrentStatus().getDateTime().getDate() + " at " + voContactRecord.getCurrentStatus().getDateTime().getTime() + " for the following reason:\n" + voContactRecord.getCurrentStatus().getCorrectionReason());
			else
				row.setcolNote(voContactRecord.getClinicalNote());
		}
		
		if (voContactRecord.getIsCorrectedIsNotNull())
		{
			if (voContactRecord.getIsCorrected().booleanValue())
				row.setcolIsActive(form.getImages().Core.AnswerBox_No);
			else
				row.setcolIsActive(form.getImages().Core.AnswerBox_Yes);
		}
		
		row.setValue(voContactRecord);
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(ClinicalNotesVo o1, ClinicalNotesVo o2)
{
	if (!o1.getRecordingDateTimeIsNotNull())
		return direction*-1;
	if (!o2.getRecordingDateTimeIsNotNull())
		return direction;
	return direction*o1.getRecordingDateTime().compareTo(o2.getRecordingDateTime());
}
 
Example 20
Project: AvoinApotti   File: ContactInputImpl.java   Source Code and License 5 votes vote down vote up
/**
* Gets the Clinical Notes Details for the given Clinical Note ID
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.vo.ClinicalNotesVo clinicalNote)
{
	DomainFactory factory = getDomainFactory();
	ClinicalNotes notes = (ClinicalNotes)factory.getDomainObject(ClinicalNotes.class, clinicalNote.getID_ClinicalNotes());	
	ClinicalNotesVo voNote = ClinicalNotesVoAssembler.create(notes);
	
	return voNote;
}
 
Example 21
Project: AvoinApotti   File: ClinicalNotesViewImpl.java   Source Code and License 5 votes vote down vote up
public ClinicalNotesVo getClinicalNoteById(Integer idClinicalNote)
{
	if(idClinicalNote == null)
		throw new CodingRuntimeException("idClinicalNote cannot be null in method getClinicalNoteById");
	
	return ClinicalNotesVoAssembler.create((ClinicalNotes) getDomainFactory().getDomainObject(ClinicalNotes.class, idClinicalNote));
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onRIEDialogClosed(DialogResult result) throws PresentationLogicException
{
	if(DialogResult.OK.equals(result) || DialogResult.YES.equals(result))
	{
		if(!form.getLocalContext().getSoapNoteVoIsNotNull())
			return;
		
		ClinicalNotesVo clinicalNotes = form.getLocalContext().getSoapNoteVo().getClinicalNote();
		
		if(clinicalNotes == null)
			return;
		
		clinicalNotes.setIsRIE(true);
		
		clinicalNotes.validate();
		
		Integer patientId=null, contactId=null, careContextId=null;
		
		if (form.getGlobalContext().Core.getPatientShortIsNotNull())
			patientId = form.getGlobalContext().Core.getPatientShort().getID_Patient();
		if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
			contactId = form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact();
		if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
			careContextId = form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext();
		
		try 
		{
			domain.markAsRie(clinicalNotes, engine.getFormName(), patientId, contactId, careContextId, "");
		} 
		catch (StaleObjectException e) 
		{
			engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
			onFormOpen();
			return;
		}
	}
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void fillIPStatusCombo(ClinicalNotesVo voClinicalNote) 
{
	if (voClinicalNote != null)
	{
		//In Correct mode, HCP ok and either Active or Correct
		if (correctModeIP(voClinicalNote.getCurrentStatus())) 
		{
			form.btnUpdate().setText("Correct");
			fillIPStatusCorrect();
		}
		//Requires Validation
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.PREVALIDATION))
		{
			//fillIPStatusValidation();
			if (domain.getHcpLiteUser() != null)
				form.btnUpdate().setText("Validate");
			fillIPStatusPreValidation();
		}
		//Draft, HCP OK
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT)	&&
				domain.getHcpLiteUser() != null	&&
					//domain.getHcpLiteUser().equals(form.customControlAuthoring().getValue().getAuthoringHcp()))
					testDiscipline())
		{
			fillIPStatusNew();
		}
		//Draft, HCP not OK
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull()	&&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT)	&&
				domain.getHcpLiteUser() == null) 
		{
			fillIPStatusPreValidation();
		}				
	}
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAuthoringInfo(ClinicalNotesVo clinicalNotesVo)
{
	AuthoringInformationVo voAuthor = new AuthoringInformationVo();
	voAuthor.setAuthoringDateTime(form.customControlAuthoring().getValue() != null && form.customControlAuthoring().getValue().getAuthoringDateTimeIsNotNull() ? form.customControlAuthoring().getValue().getAuthoringDateTime() : null);
	voAuthor.setAuthoringHcp(form.customControlAuthoring().getValue() != null && form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull() ? form.customControlAuthoring().getValue().getAuthoringHcp() : null);
	clinicalNotesVo.setAuthoringInfo(voAuthor);
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo)fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;
			}
		}
		else
		{
			if (form.customControlAuthoring().getValue()!=null
					&& form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull())
				clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
			else
			{
				engine.showMessage("No Discipline is available. Please choose an authoring user.");
				return null;
			}
		}
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
	return mos;
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCurrentClinicalNote() throws FormOpenException
{
	if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
	{
		
		ClinicalNotesVo clinicalNotesForContact = null;
		if(engine.isDialog() && form.getGlobalContext().Clinical.getCurrentClinicalNoteIsNotNull())
		{		
			
			clinicalNotesForContact = domain.getClinicalNotes( form.getGlobalContext().Clinical.getCurrentClinicalNote().getClinicalContact());
		}
		else
		{
			ClinicalContactShortVo currentClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
			try
			{
				clinicalNotesForContact = domain.getClinicalNotesForContact(currentClinicalContact);
			}
			catch(Exception e)
			{
				throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
			}
		}
		
		if (clinicalNotesForContact != null)
			form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesForContact);
		else
			form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
	}
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void checkForExistingClinicalNotes(ClinicalNotesVo voNote) throws FormOpenException
{
	if ((voNote !=null &&
			voNote.getSourceOfNoteIsNotNull() && 
				! voNote.getSourceOfNote().equals(SourceOfNote.THERAPYSOAPNOTE)) ||
					(voNote != null &&
						voNote.getNoteTypeIsNotNull() &&//wdev-4952
						!(voNote.getNoteType().equals(ClinicalNoteType.DISCHARGENOTE) ||
							voNote.getNoteType().equals(ClinicalNoteType.SUMMARYATADMISSION)) && 
								voNote.getIsDerivedNoteIsNotNull() &&
									!voNote.getIsDerivedNote().booleanValue()))			
										throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean save()
{
	if(checkForUnsavedChild())
		return false;
		
	AreaOfNeedsNotingVo voAreaOfNeedsNoting = populateInstanceData(form.getLocalContext().getSelectedParentInstance());
	
	ClinicalNotesVo voClinicalNotes = populateClinicalNote();
	if(voClinicalNotes == null)
		return false;
	
	if (voClinicalNotes.getCareContext() ==  null)
		voClinicalNotes.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
	
	if(voClinicalNotes.getClinicalContact() == null)
		voClinicalNotes.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
	
	voAreaOfNeedsNoting.setClinicalNote(voClinicalNotes);
	
	String[] errors = voAreaOfNeedsNoting.validate();
	if(errors != null)
	{
		engine.showErrors(errors);
		return false;
	}
	try
	{
		form.getLocalContext().setSelectedParentInstance(domain.save(voAreaOfNeedsNoting));
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return false;
	}
	setUpdatedChild();
	return true;	
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onRIEDialogClosed(DialogResult result) throws PresentationLogicException
{
	if(DialogResult.OK.equals(result) || DialogResult.YES.equals(result))
	{
		if(!form.getLocalContext().getSelectedParentInstanceIsNotNull())
			return;
		
		ClinicalNotesVo clinicalNotes = form.getLocalContext().getSelectedParentInstance().getClinicalNote();
		
		if(clinicalNotes == null)
			return;
		
		clinicalNotes.setIsRIE(true);
		
		clinicalNotes.validate();
		
		Integer patientId=null, contactId=null, careContextId=null;
		
		if (form.getGlobalContext().Core.getPatientShortIsNotNull())
			patientId = form.getGlobalContext().Core.getPatientShort().getID_Patient();
		if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
			contactId = form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact();
		if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
			careContextId = form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext();
		
		try 
		{
			domain.markAsRie(clinicalNotes, engine.getFormName(), patientId, contactId, careContextId, "");
		} 
		catch (StaleObjectException e) 
		{
			engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
			onFormOpen();
			return;
		}
	}
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCurrentClinicalNote()
{
	if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
	{
		ClinicalContactShortVo currentClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
		ClinicalNotesVo clinicalNotesForContact = domain.getClinicalNotesForContact(currentClinicalContact);
		
		if (clinicalNotesForContact != null)
			form.getGlobalContext().Clinical.setCurrentClinicalNote(domain.getClinicalNote(clinicalNotesForContact));
		else
			form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
	}
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo)fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;
			}
		}
		/*else
		{
			if (form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull())
				clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
			else
			{
				engine.showMessage("No Discipline is available. Please choose an authoring user.");
				return null;
			}
		}*/
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
	return mos;
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void selectClinicalNoteInGlobalContext()
{
	
	ClinicalNotesVo clinicalNotesVoForContact = null;
	
	try
	{
		clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.grdList().getSelectedRow().getValue());
		
	}
	catch (RuntimeException e)
	{
		
		engine.showMessage(e.getMessage());
	
	}
	
	ClinicalNotesShortVo clinicalNotesForContact = null;
	
	if(clinicalNotesVoForContact != null)
		clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
	form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);
	
	if (clinicalNotesVoForContact != null)
		form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
	else
		form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkClinicalNoteForCurrentCareContext() throws FormOpenException
{
	if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && domain.getHcpUser()!=null) //WDEV-19027  //temporary
	{
		ClinicalNotesVo voNote = domain.getClinicalNotesForCareContext(form.getGlobalContext().Core.getCurrentCareContext());
		if (voNote != null)
		{
			if (voNote.getSourceOfNote() == null)
				throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
			if (voNote.getSourceOfNote().equals(SourceOfNote.CLINICALNOTEDRAWINGIP))
			{
				openClinicalNotes();
				checkForDiscipline();
			}
				
			else if ( voNote.getSourceOfNote().equals(SourceOfNote.CLINICALNOTEDRAWINGOP))
			{
				checkForDiscipline();
				openOPClinicalNotes();
			}
			else throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
				
			return true;
		}
		return false;
	}
	return false;
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCurrentClinicalNote()
{
	if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull()) //WDEV-19027
	{
		ClinicalNotesVo clinicalNotesForContact;
		if(isDialog() && form.getGlobalContext().Clinical.getCurrentClinicalNoteIsNotNull())
		{
			clinicalNotesForContact = domain.getClinicalNotesForCareContext(form.getGlobalContext().Clinical.getCurrentClinicalNote().getCareContext());  //WDEV-19027
		}
		else
		{
			CareContextShortVo currentCareContext = form.getGlobalContext().Core.getCurrentCareContext(); //WDEV-19027 
			clinicalNotesForContact = domain.getClinicalNotesForCareContext(currentCareContext); //WDEV-19027 
		}

		if (clinicalNotesForContact != null)
		{
			ClinicalNotesShortVo clinicalNotesShort = domain.getClinicalNotesShort(clinicalNotesForContact.getID_ClinicalNotes());

			if (clinicalNotesShort != null)
				form.getGlobalContext().Clinical.setCurrentClinicalNote(domain.getClinicalNotes(clinicalNotesShort.getID_ClinicalNotes()));
			else
				form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
		}
		else
		{
			form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
		}
	}
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo) domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo) fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;
			}
		}
		return mos;
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void fillIPStatusCombo(ClinicalNotesVo voClinicalNote)
{
	if (voClinicalNote != null)
	{
		// In Correct mode, HCP ok and either Active or Correct
		if (correctModeIP(voClinicalNote.getCurrentStatus()))
		{
			form.lyrTabs().tabClinicalNotes().btnUpdateSOAP().setText("Correct");

			fillIPStatusCorrect();
		}
		// Requires Validation
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() && voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.PREVALIDATION))
		{

			if (domain.getHcpLiteUser() != null)
				form.lyrTabs().tabClinicalNotes().btnUpdateSOAP().setText("Validate");
			fillIPStatusValidation();
		}
		// Draft, HCP OK
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() && voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) && domain.getHcpLiteUser() != null && testIpDiscipline())
		// domain.getHcpLiteUser().equals(form.lyrTabs().tabClinicalNotes().customControlClinicalNotesAuthoiring().getValue().getAuthoringHcp()))
		{
			fillIPStatusNew();
		}
		// Draft, HCP not OK
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() && voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) && domain.getHcpLiteUser() == null)
		{
			fillIPStatusPreValidation();
		}
	}
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void enableLinks(ClinicalNotesVo voClinicalNote)
{
	if (form.getMode().equals(FormMode.VIEW))
		return;

	boolean bEnable = true;
	if (voClinicalNote == null)
		bEnable = true;
	else if (voClinicalNote.getIsDerivedNoteIsNotNull() && voClinicalNote.getIsDerivedNote().equals(Boolean.TRUE))
		bEnable = true;
	else
		bEnable = false;

	makeLinksClinicalNoteEnable(bEnable);
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void fillOPStatusCombo(ClinicalNotesVo clinicalNote)
{
	if (clinicalNote != null && clinicalNote.getCurrentStatusIsNotNull())
	{
		if (correctModeOP(clinicalNote.getCurrentStatus())) // In Correct
		// mode, HCP ok
		// and either
		// Active or
		// Correct
		{
			form.lyrTabs().tabOPDNote().btnUpdateOPNotes().setText("Correct");

			fillOPStatusCorrect();
		}
		else if (clinicalNote.getCurrentStatus().getStatusIsNotNull() // Requires
				// Validation
				&& clinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.PREVALIDATION))
		{
			if (domain.getHcpLiteUser() != null)
				form.lyrTabs().tabOPDNote().btnUpdateOPNotes().setText("Validate");
			fillOPStatusValidation();
		}
		else if (clinicalNote.getCurrentStatus().getStatusIsNotNull() // Draft,
				// HCP
				// OK
				&& clinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) && domain.getHcpLiteUser() != null && testOpDiscipline())
		// domain.getHcpLiteUser().equals(form.lyrTabs().tabOPDNote().customControlOPAuthoring().getValue().getAuthoringHcp()))
		{
			fillOPStatusNew();
		}
		else if (clinicalNote.getCurrentStatus().getStatusIsNotNull() // Draft,
				// HCP
				// not
				// OK
				&& clinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) && domain.getHcpLiteUser() == null)
		{
			fillOPStatusPreValidation();
		}
	}
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onRIEDialogClosed(DialogResult result) throws PresentationLogicException  //WDEV-19027
{
	if(DialogResult.OK.equals(result) || DialogResult.YES.equals(result))
	{
		ClinicalNotesVo clinicalNotes = form.getGlobalContext().Clinical.getCurrentClinicalNote();
		clinicalNotes.setIsRIE(true);
		
		clinicalNotes.validate();
		
		Integer patientId=null, contactId=null, careContextId=null;
		
		if (form.getGlobalContext().Core.getPatientShortIsNotNull())
			patientId = form.getGlobalContext().Core.getPatientShort().getID_Patient();
		
		if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
			careContextId = form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext();
		
		try 
		{
			domain.markAsRie(clinicalNotes, engine.getFormName(), patientId, contactId, careContextId, "");
		} 
		catch (StaleObjectException e) 
		{
			engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
			onFormOpen();
			return;
		}
	}
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo)fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;
			}
		}
		else
		{
			if (form.customControlAuthoring().getValue()!=null && form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull()
				&& form.customControlAuthoring().getValue().getAuthoringHcp().getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
			else
			{ 
				if (form.getMode().equals(FormMode.EDIT))//WDEV-14967
				engine.showMessage("No Discipline is available. Please choose an authoring user.");
				return null;
			}
		}
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
	return mos;
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCurrentClinicalNote()
{
	if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
	{
		ClinicalContactShortVo currentClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
		ClinicalNotesVo clinicalNotesForContact = domain.getClinicalNotesForContact(currentClinicalContact);
		if (clinicalNotesForContact != null)
			form.getGlobalContext().Clinical.setCurrentClinicalNote(domain.getClinicalNote(clinicalNotesForContact));
		else
			form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
	}
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCmbStatus(ClinicalNotesVo voNote)
{
	fillIPStatusCombo(voNote);
	
	if (form.cmbStatus().getValues().size() == 0 &&
			voNote.getCurrentStatus().getStatusIsNotNull())
		form.cmbStatus().newRow(voNote.getCurrentStatus().getStatus(), voNote.getCurrentStatus().getStatus().getText());
	
	form.cmbStatus().setValue(voNote.getCurrentStatusIsNotNull() ? voNote.getCurrentStatus().getStatus() : null);
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void settingCustomReviewed(ClinicalNotesVo voNote)
{
	AuthoringInformationVo voReview = new AuthoringInformationVo();
	voReview.setAuthoringDateTime(voNote.getReviewingDateTime());
	voReview.setAuthoringHcp(voNote.getReviewingHCP());
	form.customControlReviewed().setValue(voReview);
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void settingCustomAuthoring(ClinicalNotesVo voNote)
{
	AuthoringInformationVo voAuthor = new AuthoringInformationVo();
	voAuthor.setAuthoringDateTime(voNote.getAuthoringInfoIsNotNull() ? voNote.getAuthoringInfo().getAuthoringDateTime() : null);
	voAuthor.setAuthoringHcp(voNote.getAuthoringInfoIsNotNull() ? voNote.getAuthoringInfo().getAuthoringHcp() : null);
	form.customControlAuthoring().setValue(voAuthor);
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void fillIPStatusCombo(ClinicalNotesVo voClinicalNote) 
{
	if (voClinicalNote != null)
	{
		//In Correct mode, HCP ok and either Active or Correct
		if (correctModeIP(voClinicalNote.getCurrentStatus())) 
		{
			form.btnUpdate().setText("Correct");
			fillIPStatusCorrect(); 
		}
		//Requires Validation
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.PREVALIDATION))
		{
			//fillIPStatusValidation();
			if (domain.getHcpLiteUser() != null)
				form.btnUpdate().setText("Validate");
			fillIPStatusPreValidation();
		}
		//Draft, HCP OK
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT)	&&
				domain.getHcpLiteUser() != null	&&
					//domain.getHcpLiteUser().equals(form.customControlAuthoring().getValue().getAuthoringHcp())
				testDiscipline())
		{
			fillIPStatusNew();
		}
		//Draft, HCP not OK
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull()	&&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT)	&&
				domain.getHcpLiteUser() == null) 
		{
			fillIPStatusPreValidation();
		}				
	}
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo)fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;	
			}
		}
		else
		{
			if (form.ccAuthoredBy().getValue()!=null && form.ccAuthoredBy().getValue().getAuthoringHcpIsNotNull()
				&& form.ccAuthoredBy().getValue().getAuthoringHcp().getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(form.ccAuthoredBy().getValue().getAuthoringHcp().getHcpType());
			else
			{
				engine.showMessage("No Discipline is available. Please choose an authoring user.");
				return null;
			}
		}
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
	return mos;
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCurrentClinicalNote()
{
	if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
	{
		ClinicalContactShortVo currentClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
		ClinicalNotesVo clinicalNotesForContact = domain.getClinicalNotesForContact(currentClinicalContact);
		if (clinicalNotesForContact != null)
			form.getGlobalContext().Clinical.setCurrentClinicalNote(domain.getClinicalNote(clinicalNotesForContact));
		else
			form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
	}
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void settingCustomAuthoring(ClinicalNotesVo voNote)
{
	AuthoringInformationVo voAuthor = new AuthoringInformationVo();
	voAuthor.setAuthoringDateTime(voNote.getAuthoringInfoIsNotNull() ? voNote.getAuthoringInfo().getAuthoringDateTime() : null);
	voAuthor.setAuthoringHcp(voNote.getAuthoringInfoIsNotNull() ? voNote.getAuthoringInfo().getAuthoringHcp() : null);
	form.customControlAuthoring().setValue(voAuthor);
	
	form.dtimRecordingDateTime().setValue(voNote.getRecordingDateTimeIsNotNull() ? voNote.getRecordingDateTime() : null);
	form.ccRecordingUser().setValue(voNote.getRecordingUserIsNotNull() ? voNote.getRecordingUser() : null);
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCurrentClinicalNote()
{
	if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
	{
		ClinicalContactShortVo currentClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
		ClinicalNotesVo clinicalNotesForContact = domain.getClinicalNotesForContact(currentClinicalContact);
		
		if (clinicalNotesForContact != null)
			form.getGlobalContext().Clinical.setCurrentClinicalNote(domain.getClinicalNote(clinicalNotesForContact));
		else
			form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
	}
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void fillIPStatusCombo(ClinicalNotesVo voClinicalNote) 
{
	if (voClinicalNote != null)
	{
		//In Correct mode, HCP ok and either Active or Correct
		if (correctModeIP(voClinicalNote.getCurrentStatus())) 
		{	
			fillIPStatusCorrect();
		}
		//Requires Validation
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.PREVALIDATION))
		{
			//fillIPStatusValidation();
			if (domain.getHcpLiteUser() != null)			
				fillIPStatusPreValidation();
		}
		//Draft, HCP OK
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT)	&&
				domain.getHcpLiteUser() != null	&&
					//domain.getHcpLiteUser().equals(form.customControlAuthoring().getValue().getAuthoringHcp()))
					testDiscipline())
		{
			fillIPStatusNew();
		}
		//Draft, HCP not OK
		else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull()	&&
			voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT)	&&
				domain.getHcpLiteUser() == null) 
		{
			fillIPStatusPreValidation();
		}				
	}
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAuthoringInfo(ClinicalNotesVo clinicalNotesVo)
{
	AuthoringInformationVo voAuthor = new AuthoringInformationVo();
	voAuthor.setAuthoringDateTime(form.customControlAuthoring().getValue() != null && form.customControlAuthoring().getValue().getAuthoringDateTimeIsNotNull() ? form.customControlAuthoring().getValue().getAuthoringDateTime() : null);
	voAuthor.setAuthoringHcp(form.customControlAuthoring().getValue() != null && form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull() ? form.customControlAuthoring().getValue().getAuthoringHcp() : null);
	clinicalNotesVo.setAuthoringInfo(voAuthor);
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
	MemberOfStaffVo fullVo = null;
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
	if (mos != null)
		fullVo = domain.getMemberOfStaff(mos);

	if (fullVo != null)
	{
		if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
		{
			MedicVo voMedic = (MedicVo)fullVo.getHcp();
			if (voMedic.getHcpTypeIsNotNull())
				clinicalNotesVo.setDiscipline(voMedic.getHcpType());
			else
			{
				engine.showMessage("Please select a Discipline type for the logged in user.");
				return null;
			}
		}
		else
		{
			if (form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull())
				clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
			else
			{
				engine.showMessage("No Discipline is available. Please choose an authoring user.");
				return null;
			}
		}
	}
	else
	{
		engine.showMessage("Member of Staff is Null.");
		return null;
	}
	return mos;
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void checkForExistingClinicalNotes(ClinicalNotesVo voNote) throws FormOpenException
{
	if ((voNote !=null &&
			voNote.getSourceOfNoteIsNotNull() && 
				! voNote.getSourceOfNote().equals(SourceOfNote.TLT_NOTE)) ||
					(voNote != null &&
						voNote.getNoteTypeIsNotNull() &&//wdev-4952
						!(voNote.getNoteType().equals(ClinicalNoteType.DISCHARGENOTE) ||
							voNote.getNoteType().equals(ClinicalNoteType.SUMMARYATADMISSION)) && 
								voNote.getIsDerivedNoteIsNotNull() &&
									!voNote.getIsDerivedNote().booleanValue()))			
										throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
}
 
Example 54
Project: AvoinApotti   File: ClinicalNotesListImpl.java   Source Code and License 5 votes vote down vote up
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
	ClinicalNoteDrawing impl = (ClinicalNoteDrawing)getDomainImpl(ClinicalNoteDrawingImpl.class);
	CareContextShortVo voCCShort = new CareContextShortVo();
	voCCShort.setID_CareContext(careContextRefVo.getID_CareContext());
	return impl.getClinicalNotesForCareContext(voCCShort);
}
 
Example 55
Project: AvoinApotti   File: ClinicalNoteDrawingImpl.java   Source Code and License 5 votes vote down vote up
/**
* getClinicalNotes
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(Integer nId)
{
	if(nId != null)
	{
		DomainFactory factory = getDomainFactory();
		ClinicalNotes doClinicalNotes = (ClinicalNotes)factory.getDomainObject(ClinicalNotes.class, nId);
		return ClinicalNotesVoAssembler.create(doClinicalNotes);
	}
	return null;
}
 
Example 56
Project: AvoinApotti   File: ExtendedPatientClinicalNotesImpl.java   Source Code and License 5 votes vote down vote up
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
	ClinicalNoteDrawing impl = (ClinicalNoteDrawing)getDomainImpl(ClinicalNoteDrawingImpl.class);
	CareContextShortVo voCCShort = new CareContextShortVo();
	voCCShort.setID_CareContext(careContextRefVo.getID_CareContext());
	return impl.getClinicalNotesForCareContext(voCCShort);
}
 
Example 57
Project: AvoinApotti   File: TherapiesNoteImpl.java   Source Code and License 5 votes vote down vote up
/**
* getClinicalNotesForCareContext
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotesForCareContext(ims.core.admin.vo.CareContextRefVo careContxetRefVo)
{
	ClinicalNoteDrawing impl = (ClinicalNoteDrawing)getDomainImpl(ClinicalNoteDrawingImpl.class);
	CareContextShortVo voCCShort = new CareContextShortVo();
	voCCShort.setID_CareContext(careContxetRefVo.getID_CareContext());
	return impl.getClinicalNotesForCareContext(voCCShort);
}
 
Example 58
Project: AvoinApotti   File: PatientClinicalNotesImpl.java   Source Code and License 5 votes vote down vote up
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
	ClinicalNoteDrawing impl = (ClinicalNoteDrawing)getDomainImpl(ClinicalNoteDrawingImpl.class);
	CareContextShortVo voCCShort = new CareContextShortVo();
	voCCShort.setID_CareContext(careContextRefVo.getID_CareContext());
	return impl.getClinicalNotesForCareContext(voCCShort);
}
 
Example 59
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(ClinicalNotesVo o1, ClinicalNotesVo o2)
{
	if (!o1.getRecordingDateTimeIsNotNull())
		return direction*-1;
	if (!o2.getRecordingDateTimeIsNotNull())
		return direction;
	return direction*o1.getRecordingDateTime().compareTo(o2.getRecordingDateTime());
}
 
Example 60
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(ClinicalNotesVo o1, ClinicalNotesVo o2)
{
	if (!o1.getRecordingDateTimeIsNotNull())
		return direction*-1;
	if (!o2.getRecordingDateTimeIsNotNull())
		return direction;
	return direction*o1.getRecordingDateTime().compareTo(o2.getRecordingDateTime());
}