public void populateInstanceControls(MskJointVo value) { clearInstanceControls(); form.getLocalContext().setSelectedInstance(value); if(value == null) return; form.ctnInstance().txtJointDescription().setValue(value.getDescription() == null ? null : value.getDescription()); form.ctnInstance().txtJointName().setValue(value.getName() == null ? null : value.getName()); form.ctnInstance().chkJointActive().setValue(value.getIsActive() == null ? false : value.getIsActive().booleanValue()); if (value.getMovements() != null) { for (int i=0; i < value.getMovements().size();i++) { for (int j=0; j < form.ctnInstance().grdJointMovements().getRows().size(); j++) { if (value.getMovements().get(i).getId() == form.ctnInstance().grdJointMovements().getRows().get(j).getValue().getId()) { form.ctnInstance().grdJointMovements().getRows().get(j).setcolSelected(true); } } } } }
/** * save */ public ims.core.vo.MskJointVo save(ims.core.vo.MskJointVo voMskJoint) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException { if(voMskJoint == null) throw new DomainRuntimeException("Invalid MskJoint record to save"); if(!voMskJoint.isValidated()) throw new DomainRuntimeException("MskJoint record not validated"); DomainFactory factory = getDomainFactory(); MskJoints domJoint = MskJointVoAssembler.extractMskJoints(factory, voMskJoint); try { factory.save(domJoint); } catch(UnqViolationUncheckedException e) { String strMsg = "A joint with the name '" + voMskJoint.getName() + "' already exists within the system."; throw new UniqueKeyViolationException(strMsg, e); } return MskJointVoAssembler.create(domJoint); }
private GenForm.grdCentralRow findCentralChildNode(MskJointVo voJointToFind) { GenForm.grdCentralRow row = null; for (int i = 0; i < form.grdCentral().getRows().size(); i++) { // Looking for a match for the joint here MskJointVo voJoint = ((RangeOfMovementDetailVo) form.grdCentral().getRows().get(i).getValue()).getJoint(); if (voJoint.equals(voJointToFind)) { row = form.grdCentral().getRows().get(i); break; } } return row; }
private GenForm.grdPeripheralRow findPeripheralChildNode(MskJointVo voJointToFind, LateralityLRonly lkpLateralityToFind) { GenForm.grdPeripheralRow row = null; for (int i = 0; i < form.grdPeripheral().getRows().size(); i++) { // Looking for a match for the joint and laterality here MskJointVo voJoint = ((RangeOfMovementDetailVo) form.grdPeripheral().getRows().get(i).getValue()).getJoint(); LateralityLRonly lkpLaterality = ((RangeOfMovementDetailVo) form.grdPeripheral().getRows().get(i).getValue()).getLaterality(); if (voJoint != null && voJoint.equals(voJointToFind) && lkpLaterality != null && lkpLaterality.equals(lkpLateralityToFind)) { row = form.grdPeripheral().getRows().get(i); break; } } return row; }
private grdMovementRow checkForJointNode(grdMovementRow digitRow, MskJointVo voMskJoint) { if (digitRow == null || voMskJoint == null) throw new CodingRuntimeException("Digit row check only in the context of a laterality and group"); for (int i = 0; i < digitRow.getRows().size(); i++) { if (digitRow.getRows().get(i).getValue().equals(voMskJoint)) return digitRow.getRows().get(i); } grdMovementRow movementRow = digitRow.getRows().newRow(); if (voMskJoint.getID_MskJoints() == null) movementRow.setTextColor(Color.Red); return movementRow; }
private RangeOfMovementDetailVo getDetailForLateralityDigitJoint(LateralityLRonly lkpLaterality, MskGroupLiteVo voGroup, MskJointVo voJoint) { if (lkpLaterality == null || voGroup == null || voJoint == null) return null; RangeOfMovementDetailVo voRom = null; for (int i = 0; i < form.getLocalContext().getSelectedHandRangeOfMovementInstance().getDetails().size(); i++) { if ((form.getLocalContext().getSelectedHandRangeOfMovementInstance().getDetails().get(i).getLaterality().equals(lkpLaterality) && form.getLocalContext().getSelectedHandRangeOfMovementInstance().getDetails().get(i).getGroup().equals(voGroup) && form.getLocalContext().getSelectedHandRangeOfMovementInstance().getDetails().get(i).getJoint().equals(voJoint))) { voRom = form.getLocalContext().getSelectedHandRangeOfMovementInstance().getDetails().get(i); break; } } if (voRom == null) throw new CodingRuntimeException("getDetailForLateralityDigitJoint failed in to find laterality group joint ."); else return voRom; }
private boolean childInstantiated(MskJointVo voMskJoint, OPDSpasAssLimbsVoCollection limbFinding) { for(int l=0;l<limbFinding.size();l++) { OPDSpasAssLimbsVo voLimb = limbFinding.get(l); if (voLimb.getJoint().equals(voMskJoint)) { return true; } } return false; }
private void loadMovementGrd() { Object jbValue = form.cmbJB().getValue(); form.txtLigSpecTests().setValue(null); form.txtInterpret().setValue(null); form.grdMovements().getRows().clear(); if (jbValue != null) { if (jbValue instanceof MskJointVo) { GenForm.grdMovementsRow row; MskJointVo mskJointVo = (MskJointVo) jbValue; for (int i = 0; mskJointVo.getMovementsIsNotNull() && i < mskJointVo.getMovements().size(); i++) { row = form.grdMovements().getRows().newRow(); row.setMovements(mskJointVo.getMovements().get(i).getText()); row.setcolMovementId(new Integer(mskJointVo.getMovements().get(i).getId())); } form.grdMovements().setVisible(true); if (form.getMode().equals(FormMode.EDIT)) form.grdMovements().setReadOnly(false); } else form.grdMovements().setVisible(false); } }
private boolean jointExists(MskJointsRefVo voMskJoints) { for (int i = 0; i < form.cmbJB().getValues().size(); i++) { Object mskJoint = form.cmbJB().getValues().get(i); if (mskJoint instanceof MskJointVo) { MskJointVo mskJointVo = (MskJointVo) mskJoint; if (mskJointVo.getID_MskJoints().equals(voMskJoints.getID_MskJoints())) return true; } } return false; }
private void populateChildInstanceData(MskExamJointBonesDetailVo voJointBonesDetail) { voJointBonesDetail.setGroup(form.cmbGroup().getValue()); if (form.cmbGroup().getValue() != null) { if (form.cmbGroup().getValue().getIsJointIsNotNull()) { voJointBonesDetail.setIsJoint(form.cmbGroup().getValue().getIsJoint()); Object vo = form.cmbJB().getValue(); if (form.cmbGroup().getValue().getIsJoint().booleanValue()) { // Joint if (vo instanceof MskJointVo) voJointBonesDetail.setJoint((MskJointVo) vo); voJointBonesDetail.setGeneralFindingsJoint(null); voJointBonesDetail.setGeneralFindingsJoint(getJointFindings()); getMovements(voJointBonesDetail); } else { // Bone if (vo instanceof MskBones) voJointBonesDetail.setBone((MskBones) vo); voJointBonesDetail.setGeneralFindingsBone(null); voJointBonesDetail.setGeneralFindingsBone(getBoneFindings()); } } } getPatientProblem(voJointBonesDetail); voJointBonesDetail.setIsProblem(new Boolean(form.chkProblem().getValue())); voJointBonesDetail.setLaterality(form.cmbLaterality().getValue()); voJointBonesDetail.setLigamentsTests(form.txtLigSpecTests().getValue()); voJointBonesDetail.setInterpretation(form.txtInterpret().getValue()); }
private MskJointVoCollection populateJointDataFromScreen() { MskJointVoCollection coll = new MskJointVoCollection(); GenForm.lyrBoneJointLayer.tabJointContainer.grdJointsRow row = null; for(int i=0;i<form.lyrBoneJoint().tabJoint().grdJoints().getRows().size();i++) { row = form.lyrBoneJoint().tabJoint().grdJoints().getRows().get(i); if (row.getColJoints().getValue() != null) coll.add((MskJointVo) row.getColJoints().getValue()); } return coll; }
private void populateJointControls(MskJointVoCollection coll) { if (coll == null) return; MskJointVo item; GenForm.lyrBoneJointLayer.tabJointContainer.grdJointsRow row = null; for(int i = 0 ; i < coll.size() ; i++) { item = coll.get(i); row = form.lyrBoneJoint().tabJoint().grdJoints().getRows().newRow(); row.getColJoints().newRow(item, item.getName()); row.getColJoints().setValue(item); row.setValue(item); } }
private void selectJoint() { MskJointVo voJoint = domain.get(form.grdList().getValue()); form.getLocalContext().setSelectedInstance(voJoint); populateInstanceControls(voJoint); updateControlsState(); }
public MskJointsMovementsCollection listMovementsForJoint(MskJointsRefVo refJoint) { // WDEV-4490 - Check for nulls if (refJoint == null || !refJoint.getID_MskJointsIsNotNull()) return null; DomainFactory factory = getDomainFactory(); MskJoints domJoint = (MskJoints) factory.getDomainObject(MskJoints.class, refJoint.getID_MskJoints()); MskJointVo voJoint = MskJointVoAssembler.create(domJoint); return voJoint.getMovements(); }
/** * @param voJoint * @param bAll * Loads the laterality combo on the forms peripheral tab. If the passed in joint can be found in the peripheral tree then the lateralities present in the tree are NOT loaded into the combo. */ private void loadAvailableLateralities(MskJointVo voJoint, boolean bAll) { form.lyrDetails().tabPeripheral().cmbLaterality().clear(); if (bAll == true) { LateralityLRonlyCollection coll = LookupHelper.getLateralityLRonly(domain.getLookupService()); for (int i = 0; i < coll.size(); i++) form.lyrDetails().tabPeripheral().cmbLaterality().newRow(coll.get(i), coll.get(i).getIItemText()); } else { GenForm.grdPeripheralRow row = null; row = findPeripheralChildNode(voJoint, LateralityLRonly.LEFT); if (row == null) { form.lyrDetails().tabPeripheral().cmbLaterality().newRow(LateralityLRonly.LEFT, LateralityLRonly.LEFT.getIItemText()); } row = findPeripheralChildNode(voJoint, LateralityLRonly.RIGHT); if (row == null) { form.lyrDetails().tabPeripheral().cmbLaterality().newRow(LateralityLRonly.RIGHT, LateralityLRonly.RIGHT.getIItemText()); } } }
private void loadMovementsForCentralJoint(MskJointVo voJoint) { form.lyrDetails().tabCentral().cmbCentralMovement().clear(); MskJointsMovementsCollection lkpCollJointMovements = domain.listMovementsForJoint(voJoint); for (int i = 0; i < lkpCollJointMovements.size(); i++) form.lyrDetails().tabCentral().cmbCentralMovement().newRow(lkpCollJointMovements.get(i), lkpCollJointMovements.get(i).getIItemText()); }
private void loadMovementsForPeripheralJoint(MskJointVo voJoint) { form.lyrDetails().tabPeripheral().cmbPeripheralMovement().clear(); MskJointsMovementsCollection lkpCollJointMovements = domain.listMovementsForJoint(voJoint); for (int i = 0; i < lkpCollJointMovements.size(); i++) form.lyrDetails().tabPeripheral().cmbPeripheralMovement().newRow(lkpCollJointMovements.get(i), lkpCollJointMovements.get(i).getIItemText()); }
protected void onCmbJointValueChanged() throws PresentationLogicException { MskJointVo joint = form.ctnDetails().lyrDetails().tabDetails().cmbJoint().getValue(); if (joint == null) { // Clear movements form.ctnDetails().lyrDetails().tabDetails().cmbMovement().clear(); } else { loadMovementsForJoint(domain.listMovementsForJoint(joint)); } }
private void instanceDataPopulateMovements(HandRangeOfMovementVo voHandRangeOfMovement) { grdMovementRow lateralityRow, digitRow, jointRow; lateralityRow = findLateralityNode(form.ctnDetails().lyrDetails().tabDetails().cmbLaterality().getValue()); digitRow = checkForDigitNode(lateralityRow, form.ctnDetails().lyrDetails().tabDetails().cmbDigit().getValue()); jointRow = checkForJointNode(digitRow, form.ctnDetails().lyrDetails().tabDetails().cmbJoint().getValue()); RangeOfMovementDetailVo voCurrentRangeOfMovementDetail = (RangeOfMovementDetailVo) digitRow.getValue(); voCurrentRangeOfMovementDetail.setJoint((MskJointVo) jointRow.getValue()); // Still have to populate the selected movements voCurrentRangeOfMovementDetail.getSelectedMovements().clear(); MskJointMovementVoCollection voCollSelectedMovements = new MskJointMovementVoCollection(); for (int i = 0; i < jointRow.getRows().size(); i++) voCollSelectedMovements.add((MskJointMovementVo) jointRow.getRows().get(i).getValue()); voCurrentRangeOfMovementDetail.setSelectedMovements(voCollSelectedMovements); // Now just find the detail within the collection and save it.. if (voCurrentRangeOfMovementDetail.getID_MSkExamJointBonesDetail() != null) { for (int x = 0; x < voHandRangeOfMovement.getDetails().size(); x++) if (voHandRangeOfMovement.getDetails().get(x).getID_MSkExamJointBonesDetail().equals(voCurrentRangeOfMovementDetail.getID_MSkExamJointBonesDetail())) { voHandRangeOfMovement.getDetails().set(x, voCurrentRangeOfMovementDetail); break; } } else voHandRangeOfMovement.getDetails().add(voCurrentRangeOfMovementDetail); }
/** * Lists all configured digit joints from the domain and sets the forms joint combo with the joints that have not been configured * */ private boolean listUnUsedJoints() { form.ctnDetails().lyrDetails().tabDetails().cmbJoint().clear(); MskJointVoCollection voCollConfiguredJoints = domain.listDigitJoints(); for (int i = 0; i < voCollConfiguredJoints.size(); i++) { boolean bFound = false; for (int j = 0; j < form.grdMovement().getSelectedRow().getRows().size(); j++) { if (form.grdMovement().getSelectedRow().getRows().get(j).getValue() instanceof MskJointVo && form.grdMovement().getSelectedRow().getRows().get(j).getValue().equals(voCollConfiguredJoints.get(i))) { bFound = true; break; } } if (bFound == false) form.ctnDetails().lyrDetails().tabDetails().cmbJoint().newRow(voCollConfiguredJoints.get(i), voCollConfiguredJoints.get(i).getName()); } if (form.ctnDetails().lyrDetails().tabDetails().cmbJoint() == null) { engine.showMessage("All joints configured for this Digit"); return false; } else return true; }