Java Code Examples for ims.assessment.vo.PatientAssessmentVo

The following are top voted examples for showing how to use ims.assessment.vo.PatientAssessmentVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromData(PatientAssessmentVo obsPatientAssessment)
{
	clearData();
	
	if (obsPatientAssessment!=null)
	{
		form.ccAssessment().clearComponent();
		form.ccAssessment().setPatientAssessment(obsPatientAssessment, form.getMode().equals(FormMode.VIEW));
		populateCombos(obsPatientAssessment);
		populateAuthoring(obsPatientAssessment);
		populateCompletedHCPCustomControl(obsPatientAssessment);
	}
	else
		initializeCustomControl();
		
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateCombos(PatientAssessmentVo patientAssessment)
{
	if(patientAssessment == null)
		return;
	
	PatientAssessmentStatusReason status = patientAssessment.getStatus();
	boolean isEditMode = form.getMode().equals(FormMode.EDIT);
	if (isEditMode)
	{
		loadStatusCombo(true);
		//if(status != null && status.equals(PatientAssessmentStatusReason.NOTCOMMENCED))
			//status = PatientAssessmentStatusReason.INPROGRESS;
	}
	form.cmbStatus().setValue(status);
	cmbStatusValueChanged();
	form.cmbReason().setValue(patientAssessment.getStatusReason());
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public PatientAssessmentVo updateNotApplicableQuestionStatus(PatientAssessmentVo voPatientAssessment)
{
	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);

		AssessmentQuestionVo question = (AssessmentQuestionVo) row.getIdentifier();
		PatientAssessmentQuestionVo answer = findAnswer(voPatientAssessment.getAssessmentData().getAnswerGroups(), question);
		if (answer == null)
			throw new CodingRuntimeException("Unable to find an answer for '" + question.getQuestion().getText() + "' question.");
		// Change the status from Non Applicable to Answered
		if (isAnswerStatus(answer, AnswerStatus.NOTAPPLICABLE))
		{
			DynamicGridColumn columnNASelect = this.grid.getColumns().getByIdentifier(SELECT_NA_COLUMN);
			if (columnNASelect != null)
			{
				DynamicGridCell cellNASelect = row.getCells().get(columnNASelect);
				if (cellNASelect.getValue() instanceof Boolean && ((Boolean) cellNASelect.getValue()).booleanValue())
					answer.setIsAnswered(AnswerStatus.ANSWERED);
			}
		}
	}

	return voPatientAssessment;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentVo populateTopControlsFromScreen(PatientAssessmentVo vo)
{
	vo = super.populateDataFromScreen(vo);
	
	//WDEV-11721 - starts here
	vo.setPatient(form.getGlobalContext().Core.getPatientShort());
	vo.setEpisodeOfCare(form.getGlobalContext().Core.getEpisodeofCareShort());
	//WDEV-11721 - ends here
	
	vo.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
	vo.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
	vo.setAuthoringInformation(form.lyrTabs().tabCurrent().customControlAuthoring().getValue());
	vo.setStatus(form.lyrTabs().tabCurrent().cmbStatus().getValue());
	vo.setStatusReason(form.lyrTabs().tabCurrent().cmbStatusReason().getValue());
	vo.setStatusReasonText(form.lyrTabs().tabCurrent().txtStatusReasonText().getValue());

	return vo;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void cloneLatestInstance()
{
	// Get a clone of the latest assessment
	PatientAssessmentVo assessmentSource = domain.getLatestVersionAssessment(form.getLocalContext().getPatientAssessment(), form.getGlobalContext().RefMan.getCatsReferral());
	
	// Simulate a SOE if it was returned null from domain - it means that is no longer the latest assessment
	if (assessmentSource == null)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		form.getLocalContext().setPatientAssessment(null);
		open();
		return;
	}
	
	PatientAssessmentVo copyAssessment = createCopyAssessment(assessmentSource);
	
	// Present clone of the assessment to screen
	populateInstanceControlsFromData(copyAssessment);
	form.getLocalContext().setPatientAssessment(copyAssessment);
	
	// Set form to EDIT mode
	form.getLocalContext().setEditingGraphicalAssessment(Boolean.FALSE);
	form.setMode(FormMode.EDIT);		
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPOCData(PlanOfCareVoCollection pocVoColl, PatientAssessmentVo voPatAssessment)
{
	if(voPatAssessment == null)
		return;
	PatientAssessmentDataVo assessmentData = voPatAssessment.getAssessmentData();
	if(assessmentData == null)
		return;
	for (int i = 0; i < assessmentData.getAnswerGroups().size(); i++)
	{
		for (int j = 0; j < assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssQuestionVo = assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().get(j);
			Boolean isPocSaved = getPocValue(voPatAssQuestionVo.getAssessmentQuestion(), pocVoColl);
			voPatAssQuestionVo.setIsPoc(isPocSaved);
			voPatAssQuestionVo.setIsPocSaved(isPocSaved);
			assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().set(j, voPatAssQuestionVo);
		}
	}
}
 
Example 7
Project: AvoinApotti   File: GraphicAssessmentInstantiationImpl.java   Source Code and License 6 votes vote down vote up
public ims.assessment.vo.PatientAssessmentVo savePatientAssessment(ims.assessment.vo.PatientAssessmentVo voPatientAssessment) throws ims.domain.exceptions.StaleObjectException
{
	if(voPatientAssessment == null)
		throw new RuntimeException("Cannot save null value for PatientAssessmentVo");
	if(voPatientAssessment.isValidated() == false)
		throw new CodingRuntimeException("PatientAssessmentVo not validated");
	
	DomainFactory factory = getDomainFactory();
	PatientAssessment doPatientAssessment = PatientAssessmentVoAssembler.extractPatientAssessment(factory, voPatientAssessment);
	
	//save every PatientGraphicAssessment as a rendered MHT - used by reports only
	DrawingControlReportHelper helper = new DrawingControlReportHelper();
	if(voPatientAssessment.getAssessmentDataIsNotNull() && voPatientAssessment.getAssessmentData().getGraphicFindingsIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getGraphicFindings().size(); i++)
		{
			PatientGraphicAssessment pga = (PatientGraphicAssessment) doPatientAssessment.getAssessmentData().getGraphicFindings().get(i);
			pga.setRenderedMHT(helper.CreateDrawingControlSeed(voPatientAssessment.getAssessmentData().getGraphicFindings().get(i), 800, 400));
		}
	}
	
	factory.save(doPatientAssessment);
	return PatientAssessmentVoAssembler.create(doPatientAssessment);
}
 
Example 8
Project: AvoinApotti   File: ClinicalNoteDrawingImpl.java   Source Code and License 6 votes vote down vote up
public PatientAssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContactRefVo) 
{
	if(clinicalContactRefVo == null)
		throw new RuntimeException("Cannot get PatientAssessmentVo for null ClinicalContactRefVo");
	
	//WDEV-2432
	StringBuffer query = new StringBuffer("from PatientAssessment as p1_1 where");
	query.append(" p1_1.clinicalContact.id = :idCC");
	query.append(" and p1_1.assessmentData.graphic.assessmentType = :assessmentType");
	
	ArrayList<String> params = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	params.add("idCC");
	params.add("assessmentType");
	
	values.add(clinicalContactRefVo.getID_ClinicalContact());
	values.add(getDomLookup(UserDefinedAssessmentType.MEDICALNOTING));

	List list = getDomainFactory().find(query.toString(), params, values);
	PatientAssessmentVoCollection voColl = PatientAssessmentVoAssembler.createPatientAssessmentVoCollectionFromPatientAssessment(list);
	if(voColl != null && voColl.size() > 0)
		return voColl.get(0);
		
	return null;	
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateStructuralAssessmentControlsFromData()
{
	int count = populateStructuralAssessmentHistoricControlsFromData();

	if (count == 0)
	{
		UserAssessmentVo assessment = form.getLocalContext().getStructuralAssessment();
		displayBlankStructuralAssessment(assessment);

		form.getLocalContext().setAllowNew(new Boolean(allowNew()));
		form.getLocalContext().setAllowUpdate(new Boolean(allowUpdate()));
	}
	else
	{
		PatientAssessmentVo patientAssessment = domain.getPatientAssessment(form.lyrMain().tabPageDetails().lyrICP().tabAssessment().recbrStructuredAssessment().getValue());
		form.getLocalContext().setCurrentPatientAssessment(patientAssessment);
		populateStructuralAssessmentControlsFromData(patientAssessment);
	}

}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPOCData(PlanOfCareVoCollection pocVoColl, PatientAssessmentVo voPatAssessment)
{
	if(voPatAssessment == null)
		return;
	PatientAssessmentDataVo assessmentData = voPatAssessment.getAssessmentData();
	if(assessmentData == null)
		return;
	for (int i = 0; i < assessmentData.getAnswerGroups().size(); i++)
	{
		for (int j = 0; j < assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssQuestionVo = assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().get(j);
			voPatAssQuestionVo.setIsPoc(getPocValue(voPatAssQuestionVo.getAssessmentQuestion(), pocVoColl));
			assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().set(j, voPatAssQuestionVo);
		}
	}
}
 
Example 11
Project: AvoinApotti   File: NursingSummaryImpl.java   Source Code and License 6 votes vote down vote up
public PatientAssessmentVo getLastDPPAssessment(UserDefinedAssessmentType type, CareContextRefVo careContext)
{
	if(type == null)
		throw new CodingRuntimeException("The 'type' parameter cannot be null !");
	if(careContext == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();
	hql = "select p1_1 from PatientAssessment as p1_1 left join p1_1.assessmentData as p2_1 left join p2_1.userAssessment as u1_1 left join u1_1.assessmentType as l1_1 left join p1_1.careContext as c1_1 left join p1_1.status as l2_1\r\n" + 
			"where\r\n" + 
			"(l2_1 = :STATUS and l1_1.id = :ASSTYPE and c1_1.id = :CONTEXT)\r\n" + 
			"order by p1_1.systemInformation.creationDateTime desc ";

	PatientAssessmentVoCollection coll = PatientAssessmentVoAssembler.createPatientAssessmentVoCollectionFromPatientAssessment(
			factory.find(hql, new String[] {"STATUS","ASSTYPE","CONTEXT"}, 
					new Object[] {getDomLookup(PatientAssessmentStatusReason.COMPLETED), new Integer(type.getId()), careContext.getID_CareContext()}));
	
	return coll.size() > 0 ? coll.get(0) : null;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	if(isNewComponent() && isNursingDischarge() == false)
		returnToParent();
	else
	{
		form.setMode(FormMode.VIEW);
		open();
		
		if(isNursingDischarge())
		{
			PatientAssessmentVo patientAssessment = form.getLocalContext().getCurrentAssessment();
			
			enableNewUpdateButtonsForNursingDischarge(patientAssessment);
		}
	}
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void displayBlankStructuralAssessment(UserAssessmentVo assessment)
{
	UserAssessmentVo userAssessment = form.getLocalContext().getStructuralAssessment();
	PatientAssessmentVo newAssessment = new PatientAssessmentVo();
	PatientAssessmentDataVo assessmentData = new PatientAssessmentDataVo();
	// engine.setCaption(userAssessment.getName());
	form.lyrMain().tabPageDetails().lyrICP().tabAssessment().setCaption(userAssessment.getName());
	assessmentData.setUserAssessment(userAssessment);

	assessmentData.setGroupQuestionWidth(userAssessment.getGroupQuestionWidth());
	newAssessment.setAssessmentData(assessmentData);
	form.lyrMain().tabPageDetails().chkComplete().setValue(false);
	//WDEV-11366
	form.lyrMain().tabPageDetails().lyrICP().tabAssessment().customStructuredAssessment().setPatientAssessment(newAssessment,false,PatientAssessmentInfoVo.getInstance(form.getGlobalContext().Core.getPatientShort()));
	form.lyrMain().tabPageDetails().lyrICP().tabAssessment().authStructuredAssessment().setValue(null);
	form.lyrMain().tabPageDetails().lyrICP().tabAssessment().imbStructuralContextInfo().setTooltip("");
	form.lyrMain().tabPageDetails().lyrICP().tabAssessment().setauthStructuredAssessmentCompletedVisible(false);
}
 
Example 14
Project: AvoinApotti   File: PatientICPActionLinkedDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
public PatientAssessmentVo savePatientGraphicalAssessment(PatientAssessmentVo patientGraphicalAssessment) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
	// Check for a PatientGraphicAssessment and if it is validated
	if (patientGraphicalAssessment == null)
		throw new DomainInterfaceException("PatientAssessment can not be null");
	
	if (!patientGraphicalAssessment.isValidated())
		throw new DomainInterfaceException("PatientAssessment must be validated");
	
	// Extract domain object
	PatientAssessment domPatientAssessment = PatientAssessmentVoAssembler.extractPatientAssessment(getDomainFactory(), patientGraphicalAssessment);
	
	// Attempt save on the domain object
	getDomainFactory().save(domPatientAssessment);
	
	// Return saved PatientAssessment
	return PatientAssessmentVoAssembler.create(domPatientAssessment);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setInitialFormMode()
{
	if(isNursingDischarge())
	{
		form.setMode(FormMode.VIEW);
		
		if(isNursingDischarge())
		{
			PatientAssessmentVo patientAssessment = form.getLocalContext().getCurrentAssessment();
			
			enableNewUpdateButtonsForNursingDischarge(patientAssessment);
		}
		
	}
	else
	{
		if(form.getGlobalContext().Clinical.PatientAssessment.getEditComponentIsNotNull() && form.getGlobalContext().Clinical.PatientAssessment.getEditComponent().booleanValue()) 
			form.setMode(FormMode.EDIT);
		else
			form.setMode(FormMode.VIEW);
	}
}
 
Example 16
Project: AvoinApotti   File: DynamicAssessmentHelper.java   Source Code and License 6 votes vote down vote up
public static PatientAssessmentVo populateHCPDataForAnswers(PatientAssessmentVo initialData, PatientAssessmentVo updatedData, AuthoringInformationVo author)
{
	if(updatedData == null || updatedData.getAssessmentData() == null)
		throw new CodingRuntimeException("Invalid assessment data to update");		
	
	
	// Answer Groups
	if(updatedData.getAssessmentData().getAnswerGroups() != null)
	{
		populateHCPDataForAnswerGroups(initialData, updatedData, author);
	}

	//Associated Graphic Questions
	if(updatedData.getAssessmentData().getGraphicQuestion() != null)
	{
		populateHCPDataForGraphicQuestions(initialData, updatedData, author);
	}
	
	// Findings
	if(updatedData.getAssessmentData().getGraphicFindings() != null)
	{
		populateHCPDataForGraphicFindings(initialData, updatedData, author);
	}
	
	return updatedData;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DrawingGraphicFindingVo getGraphicFinding(int brushId)
{
	PatientAssessmentVo patientAssessmentVo = form.getLocalContext().getPatientAssessment();
	
	if(patientAssessmentVo == null || patientAssessmentVo.getAssessmentData() == null)
		return null;
	
	PatientAssessmentDataVo voPatAssessmentData = patientAssessmentVo.getAssessmentData();
	
	GraphicAssessmentFindingVoCollection findingColl = voPatAssessmentData.getGraphic().getFindingsAndQuestions();

	if (findingColl != null)
	{
		for (int i = 0; i < findingColl.size(); i++)
		{
			if (findingColl.get(i).getFindingIsNotNull() && findingColl.get(i).getFinding().getID_DrawingGraphicFindingIsNotNull() && findingColl.get(i).getFinding().getID_DrawingGraphicFinding().intValue() == brushId)
			{
				return findingColl.get(i).getFinding();
			}
		}
	}

	return null;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * Function used to populate Patient Assessment to screen
 */
protected void populateInstanceControlsFromData(PatientAssessmentVo patientAssessment)
{
	// Clear instance controls
	clearInstanceControls();
	
	// Test parameter
	if (patientAssessment == null || patientAssessment.getAssessmentData() == null)
		return;
	
	// Populate instance controls with data
	if (patientAssessment.getAssessmentData().getGraphic() != null)
	{
		form.ctnGraphical().ccGraphical().setPatientAssessment(patientAssessment, PatientAssessmentInfoVo.getInstance(form.getGlobalContext().Core.getPatientShort()));
		form.getLocalContext().setEditingGraphicalAssessment(Boolean.TRUE);
	}
	else
	{
		form.ctnStructural().ccStructuralAssessment().setPatientAssessment(patientAssessment, true, PatientAssessmentInfoVo.getInstance(form.getGlobalContext().Core.getPatientShort()));
		form.getLocalContext().setEditingGraphicalAssessment(Boolean.FALSE);
	}

	form.chkCompleted().setValue(PatientAssessmentStatusReason.COMPLETED.equals(patientAssessment.getStatus()));
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * getPatientAssessment
 */
public PatientAssessmentVo getPatientAssessment()
{
	PatientAssessmentVo assessment = form.getLocalContext().getPatientAssessment();

	if (assessment != null && hasQuestions(assessment.getAssessmentData()))
	{
		PatientAssessmentDataVo data = assessment.getAssessmentData();
		data.setGraphicQuestion(getHelper().getGraphicAnswers(data.getGraphicQuestion()));

		if (data.getGraphicFindings() == null)
		{
			PatientGraphicAssessmentVoCollection emptyFindings = new PatientGraphicAssessmentVoCollection();
			PatientGraphicAssessmentVo emptyFinding = new PatientGraphicAssessmentVo();
			emptyFinding.setGraphicImage(form.getLocalContext().getCurrentImage());
			emptyFindings.add(emptyFinding);
			emptyFinding.setPatientGraphicFinding(new PatientGraphicAssessmentFindingVoCollection());
			data.setGraphicFindings(emptyFindings);
		}

		assessment.setAssessmentData(data);
		form.getLocalContext().setPatientAssessment(assessment);
	}

	return assessment;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setDrawingIds()
{
	PatientAssessmentVo assessment = form.getLocalContext().getPatientAssessment();
	PatientAssessmentDataVo voPatientAssessmentData = assessment.getAssessmentData();
	if (voPatientAssessmentData != null && voPatientAssessmentData.getGraphicFindingsIsNotNull())
	{
		for (int j = 0; j < voPatientAssessmentData.getGraphicFindings().size(); j++)
		{
			for (int i = 0; voPatientAssessmentData.getGraphicFindings().get(j).getPatientGraphicFinding() != null && i < voPatientAssessmentData.getGraphicFindings().get(j).getPatientGraphicFinding().size(); i++)
			{
				voPatientAssessmentData.getGraphicFindings().get(j).getPatientGraphicFinding().get(i).setDrawingId(voPatientAssessmentData.getGraphicFindings().get(j).getPatientGraphicFinding().get(i).getID_PatientGraphicAssessmentFinding());
			}
		}
	}

	assessment.setAssessmentData(voPatientAssessmentData);
	form.getLocalContext().setPatientAssessment(assessment);
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateCombos(PatientAssessmentVo patientAssessment)
{
	if(patientAssessment == null)
		return;
	
	PatientAssessmentStatusReason status = patientAssessment.getStatus();
	boolean isEditMode = form.getMode().equals(FormMode.EDIT);
	if (isEditMode)
	{
		loadStatusCombo(true);
		if(status != null && status.equals(PatientAssessmentStatusReason.NOTCOMMENCED))
			status = PatientAssessmentStatusReason.INPROGRESS;
	}
	form.cmbStatus().setValue(status);
	cmbStatusValueChanged();
	form.cmbReason().setValue(patientAssessment.getStatusReason());
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open() throws ims.framework.exceptions.PresentationLogicException
{
	PatientAssessmentDataVo data = form.getLocalContext().getCurrentPatientAssessmentData();
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getCurrentPatientAssessment();
	if (data != null)
	{
		//Answer saved
		if (isAnswered(data))
		{
			setDrawingIds();
			populateScreenFromData();
			populateAssociatedQuestionGrid(data, voPatientAssessment);
		}
		else
		{
			if (form.getGlobalContext().Clinical.PatientAssessment.getEditedComponent() == null)
				throw new RuntimeException("User defined object component not found");

			UserDefinedObjectComponentVo voUserDefinedObjectComponent = getEditedComponent();
			getHelper().populate(voUserDefinedObjectComponent);
			populateScreenFromData();
		}
	}
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateControls()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getCurrentPatientAssessment();
	if(voPatientAssessment == null)
		return;

	//Status
	form.cmbStatus().setValue(voPatientAssessment.getStatus());

	//Reason
	cmbStatusValueChanged();
	form.cmbReason().setValue(voPatientAssessment != null?voPatientAssessment.getStatusReason():null);

	//Authoring Informations
	form.customControlAuthoringInfo().setValue(voPatientAssessment.getAuthoringInfo());
	
	//Completing Info
	AuthoringInformationVo voCompleted = new AuthoringInformationVo();
	voCompleted.setAuthoringDateTime(voPatientAssessment.getCompletedDateTime());
	voCompleted.setAuthoringHcp(voPatientAssessment.getCompletedHCP());
	form.customControlCompleted().setValue(voCompleted);
}
 
Example 24
Project: AvoinApotti   File: NeedsAssessmentComponentEditImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentVo getPatientAssessment(PatientAssessmentRefVo ref)
{
	if (ref == null || !ref.getID_PatientAssessmentIsNotNull())
		throw new DomainRuntimeException("Invalid Patient Assessment record to get");
	
	return PatientAssessmentVoAssembler.create((PatientAssessment) getDomainFactory().getDomainObject(PatientAssessment.class, ref.getID_PatientAssessment()));
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if (form.getMode().equals(FormMode.EDIT) && formName.equals(form.getForms().Assessment.AssessmentFavourites) && result.equals(DialogResult.OK))
	{
		if ( form.getGlobalContext().Core.getSelectedUserAssessmentVoIsNotNull())
		{
			form.getLocalContext().setSpecimenQuestionsAssessment(form.getGlobalContext().Core.getSelectedUserAssessmentVo());

			PatientAssessmentVo paVoPre = populatePatientAssessmentFromUserAssessmentShort(form.getLocalContext().getSpecimenQuestionsAssessment());
			form.lyrDetails().tabSpecimenSpecific().customControlSpecimenQuestions().setPatientAssessment(paVoPre,false,PatientAssessmentInfoVo.getInstance(form.getGlobalContext().Core.getPatientShort()));
		}
		else
			form.getLocalContext().setSpecimenQuestionsAssessment(null);
	}
	else if (formName.equals(form.getForms().Oncology.PrimaryTumourSelectDialog))
	{
		if(result.equals(DialogResult.OK))
		{
			if (form.getGlobalContext().Oncology.getSelectedPrimaryTumourDetailIsNotNull())
			{
				form.getLocalContext().setSelectedPrimaryTumour(form.getGlobalContext().Oncology.getSelectedPrimaryTumourDetail());
				
				form.lyrDetails().tabTumDetails().txtDiagnosis().setValue((form.getGlobalContext().Oncology.getSelectedPrimaryTumourDetail().getPatientDiagnosis() != null && form.getGlobalContext().Oncology.getSelectedPrimaryTumourDetail().getPatientDiagnosis().getDiagnosisDescription() != null) ? form.getGlobalContext().Oncology.getSelectedPrimaryTumourDetail().getPatientDiagnosis().getDiagnosisDescription() : null);
				form.lyrDetails().tabTumDetails().txtLaterality().setValue(form.getGlobalContext().Oncology.getSelectedPrimaryTumourDetail().getTumourLateralityIsNotNull() ? form.getGlobalContext().Oncology.getSelectedPrimaryTumourDetail().getTumourLaterality().toString() : "");
				
				loadTNMCombosAndHistology();
			}
			
		}
		else
		{
			//WDEV-16966;WDEV-18105
			if (form.getLocalContext().getSelectedPathologyDetailsVo().getID_PathologyDetails() != null || form.getLocalContext().getSelectedPrimaryTumour() != null)
				return;
			form.setMode(FormMode.VIEW);
			open();
						
		}
	}
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void loadAssessment()
{
	if (form.getLocalContext().getChosenAssessmentIsNotNull())
	{
		PatientAssessmentVo newAssessment = new PatientAssessmentVo();
		PatientAssessmentDataVo assessmentData = new PatientAssessmentDataVo();	
		UserAssessmentVo userAssessment = form.getLocalContext().getChosenAssessment();
		assessmentData.setUserAssessment(userAssessment);
		assessmentData.setGroupQuestionWidth(userAssessment.getGroupQuestionWidth());
		newAssessment.setAssessmentData(assessmentData);	

		form.ccAssessment().setPatientAssessment(newAssessment, form.getMode().equals(FormMode.VIEW),PatientAssessmentInfoVo.getInstance(form.getGlobalContext().Core.getPatientShort()));
	}		
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentVo populatePatientAssessmentFromUserAssessmentShort(UserAssessmentVo voUA) {
	if(voUA == null)
		throw new CodingRuntimeException("No UserAssessmentShortVo provided");
	
	PatientAssessmentVo voPatientAssessment = new PatientAssessmentVo();
	voPatientAssessment.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
	voPatientAssessment.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
	voPatientAssessment.setStatus(PatientAssessmentStatusReason.NOTCOMMENCED);
	AuthoringInformationVo voAuthoringInformation = new AuthoringInformationVo(); 
	voAuthoringInformation.setAuthoringDateTime(new DateTime());
	if (domain.getHcpUser() != null)
	{
		Hcp hcpVo = (Hcp) domain.getHcpUser();
		HcpLiteVo liteVo = domain.getHcpLiteById(hcpVo);
		voAuthoringInformation.setAuthoringHcp(liteVo);
	}
	voPatientAssessment.setAuthoringInformation(voAuthoringInformation);
	//form.lyr().tabReferralDetails().customControlAuthoringInfo().getValue());
		
	//Patient Assessment Data
	PatientAssessmentDataVo voPatientAssessmentData = new PatientAssessmentDataVo();
	voPatientAssessmentData.setGraphic(null);
	voPatientAssessmentData.setUserAssessment(voUA);
	voPatientAssessment.setAssessmentData(voPatientAssessmentData);
		
	return voPatientAssessment;
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newInstance() 
{
	clearScreen();

	form.getLocalContext().setSelectedSurgeryDetails(new SurgeryDetailsVo());//	WDEV-15244
	
	form.setMode(FormMode.EDIT);//	WDEV-15244
	
	// Set the EpisodeOfCare, CareContext and so on
	form.getLocalContext().getSelectedSurgeryDetails().setEpisodeOfCare(form.getGlobalContext().Core.getEpisodeofCareShort());
	form.getLocalContext().getSelectedSurgeryDetails().setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
	
	form.lyrSurgeryDetails().tabGenDet().customControlAuthoringInfo().initializeComponent();
	form.lyrSurgeryDetails().tabGenDet().Group1().setValue(Group1Enumeration.rdoSpecialtyHotlist);
	form.lyrSurgeryDetails().showtabGenDet();
	//WDEV-11682 
	updateContextMenus();
	
	if (form.getLocalContext().getPreOpPossumUserAssessment() != null)
	{
		PatientAssessmentVo paVoPre = populatePatientAssessmentFromUserAssessmentShort(form.getLocalContext().getPreOpPossumUserAssessment());
		//WDEV-11366
		form.lyrSurgeryDetails().tabPreOpPossum().customControlPreOpP().setPatientAssessment(paVoPre, false,PatientAssessmentInfoVo.getInstance(form.getGlobalContext().Core.getPatientShort()));
	}
	
	if (form.getLocalContext().getOperativePossumUserAssessment() != null)
	{
		PatientAssessmentVo paVoPost = populatePatientAssessmentFromUserAssessmentShort(form.getLocalContext().getOperativePossumUserAssessment());
		//WDEV-11366
		form.lyrSurgeryDetails().tabOperativePossum().customControlOperativePossum().setPatientAssessment(paVoPost, false,PatientAssessmentInfoVo.getInstance(form.getGlobalContext().Core.getPatientShort()));
	}
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateAuthoring(PatientAssessmentVo patientAssessment)
{
	AuthoringInformationVo voAuthoringInfo = null;
	if(patientAssessment != null)
		voAuthoringInfo = patientAssessment.getAuthoringInformation();
	
	if(voAuthoringInfo != null)
		form.customControlAuthoring().setValue(voAuthoringInfo);
	else
		form.customControlAuthoring().initializeComponent();
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnSelectNAQuestionsClick() throws PresentationLogicException
{
	PatientAssessmentVo currentAssessment = form.getLocalContext().getPatientAssessmentVo();
	//Get the changes user eventualy made in the questions
	//updatePatientAssessmentWithTheChanges(currentAssessment);
	UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabNonApplicable().dynNonApplic());
	currentAssessment = helper.updateQuestionStatusToAnswered(currentAssessment, AnswerStatus.NOTAPPLICABLE);
	
	form.getLocalContext().setPatientAssessmentVo(currentAssessment);
	populateQuestionsGrid(filterQuestions(currentAssessment, DPP));
	form.lyrTabs().showtabCurrent();
	enableContextMenu();
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private UserDefinedObjectComponentVo getEditedComponent()
{
	PatientUserDefinedObjectVo voPatientUserDefinedObject = form.getGlobalContext().Assessment.getPatientUserDefinedObject();
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getCurrentPatientAssessment();
	
	return getAssessmentConfig().getEditedComponent(voPatientUserDefinedObject, voPatientAssessment);
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void setPatientAssessment(PatientAssessmentVo assessment, Boolean displayAnsweredOnly, PatientAssessmentInfoVo patInfo)
{
	form.getLocalContext().setCurrentAssessment(assessment);
	form.getLocalContext().setPatientInfo(patInfo);

	PatientAssessmentDataVo data = assessment == null ? null : assessment.getAssessmentData();

	if (isAnswered(data))
	{
		UserAssessmentInstHelperInternal helper = getHelper((displayAnsweredOnly == null) ? form.dyngrdAnswers().isReadOnly() : displayAnsweredOnly,patInfo);
		try
		{
			helper.populate(data, assessment != null ? assessment.getStatus() : null);
		}
		catch (PresentationLogicException e)
		{
			clearComponent();
			engine.showMessage("Presentation logic exception: " + e.toString());
			e.printStackTrace();
		}
	}
	else
	{
		createNewPatientAssessment(data.getUserAssessment(),patInfo);
	}
	
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isStructuralAssessment(PatientAssessmentVo patientAssessment)
{
	if (patientAssessment == null || patientAssessment.getAssessmentData() == null)
		return false;
	
	if (patientAssessment.getAssessmentData().getUserAssessment() != null)
		return true;
	
	return false;
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean populateAssessmentDataFromScreen(PatientAssessmentVo vo, boolean createPOCRecords)
{
	if(vo == null)
		return false;
	
	PatientAssessmentVo initialAssessment = vo != null ? (PatientAssessmentVo) vo.clone() : null;
	if (vo.getAssessmentData() == null)
	{
		PatientAssessmentDataVo assessmentData = new PatientAssessmentDataVo();
		assessmentData.setUserAssessment(form.getGlobalContext().Nursing.getUserAssessmentDPP());
		vo.setAssessmentData(assessmentData);
	}
 
	UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabCurrent().dynQuestions());
	PatientAssessmentGroupVoCollection currentAnswer = helper.getAnswers(vo.getAssessmentData().getAnswerGroups());

	/*DynamicAssessmentHelper.populateHCPDataForAnswers(initialAssessment, vo, (HcpLiteVo)domain.getHcpLiteUser(), new DateTime());
	DynamicAssessmentHelper.populateConfirmingHCPDataForAnswers(initialAssessment, vo, (HcpLiteVo)domain.getHcpLiteUser(), new DateTime());*/
	
	/*PatientAssessmentGroupVoCollection notAvailableAnswColl = getNotApplicableAndNotAnswered(vo.getAssessmentData().getAnswerGroups());
	removeNotAnswered(vo.getAssessmentData().getAnswerGroups());
	vo.getAssessmentData().setAnswerGroups(getAnswerGroups(currentAnswer, notAvailableAnswColl));*/
	
	DynamicAssessmentHelper.populateHCPDataForAnswers(initialAssessment, vo, (HcpLiteVo)domain.getHcpLiteUser(), new DateTime());
	DynamicAssessmentHelper.populateConfirmingHCPDataForAnswers(initialAssessment, vo, (HcpLiteVo)domain.getHcpLiteUser(), new DateTime());
	
	if (createPOCRecords)
	{
		return populatePlanOfCareVoCollection(currentAnswer, helper);
	}

	return true;
}
 
Example 35
Project: AvoinApotti   File: ObsPatientAssessmentCcImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentVo getObsPatientAssessment(PatientAssessmentRefVo patientAssessmentRef)
{
	if (patientAssessmentRef == null || patientAssessmentRef.getID_PatientAssessment() == null)
	{
		throw new CodingRuntimeException("Cannot get Patient Assessment on null Id ");
	}

	DomainFactory factory = getDomainFactory();

	PatientAssessment domainPatientAssessment = (PatientAssessment) factory.getDomainObject(PatientAssessment.class, patientAssessmentRef.getID_PatientAssessment());

	return PatientAssessmentVoAssembler.create(domainPatientAssessment);
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addNonApplicableQuestions() throws PresentationLogicException
{
	form.lyrTabs().showtabNonApplicable();
	UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabNonApplicable().dynNonApplic(), true);
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	voPatientAssessment = filterQuestions(voPatientAssessment, NOT_APPLICABLE);
	helper.populate(voPatientAssessment.getAssessmentData(), voPatientAssessment.getStatusReason(), AnswerStatus.NOTAPPLICABLE);
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isStatusCommenced()
{
	PatientAssessmentVo patientAssessment = null;
	if(form.getLocalContext().getDischargeDetails()!=null)
		patientAssessment = form.getLocalContext().getDischargeDetails().getPatientAssessment();
	if(patientAssessment == null)
		return false;
	
	return patientAssessment.getStatusIsNotNull() && patientAssessment.getStatus().equals(PatientAssessmentStatusReason.NOTCOMMENCED);
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addNonStandardQuestion() throws PresentationLogicException
{
	form.lyrTabs().showtabStandardQuestion();
	UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabStandardQuestion().dyngrdNonStandard(), true);
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	voPatientAssessment = filterQuestions(voPatientAssessment, NON_STANDARD);
	helper.populate(voPatientAssessment.getAssessmentData(), voPatientAssessment.getStatusReason(), AnswerStatus.NOTANSWERED);
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void populateGraphicFinding(PatientAssessmentVo data, PatientGraphicAssessmentFindingVo voGraphicAssessmentFinding) throws PresentationLogicException
{
	checkDataIntegrity(voGraphicAssessmentFinding);
	prepareGraphicGrid(isCompleted(data.getStatus()));
	populateGraphicFindingQuestions(voGraphicAssessmentFinding);
	setAnswersGraphicFindings(voGraphicAssessmentFinding.getStage());
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean requiresPrinting(PatientAssessmentVo patientAssessment)
{
	if (Boolean.FALSE.equals(ConfigFlag.UI.SAVE_PATIENTDOCUMENT_ON_ASSESSMENTCOMPLETED.getValue()))
		return false;
	
	if (patientAssessment == null || patientAssessment.getAssessmentData() == null)
		return false;
	
	if (!PatientAssessmentStatusReason.COMPLETED.equals(patientAssessment.getStatus()))
		return false;
	
	
	if (patientAssessment.getAssessmentData().getGraphic() != null)
	{
		if (patientAssessment.getAssessmentData().getGraphic().getAssociatedReportForPrinting() == null
				|| !Boolean.TRUE.equals(patientAssessment.getAssessmentData().getGraphic().getStorePrintedReport()))
			return false;
	}
	
	if (patientAssessment.getAssessmentData().getUserAssessment() != null)
	{
		if (patientAssessment.getAssessmentData().getUserAssessment().getAssociatedReport() == null
				|| !Boolean.TRUE.equals(patientAssessment.getAssessmentData().getUserAssessment().getStorePrintedAssessment()))
			return false;
	}

	return true;
}