/** * Create a new MskJointVo instance hosted by a single instance collection of the same type * * */ private void newMovementConfigurationInstance() { form.getLocalContext().setUpdatingParent(Boolean.FALSE); clearMovementInstanceControls(true); RangeOfMovementDetailVo voNewROmDetail = form.getLocalContext().getSelectedRangeOfMovementDetailInstance(); // This should be at the end of this method. form.setMode(FormMode.EDIT); if (!voNewROmDetail.getSelectedMovementsIsNotNull()) { voNewROmDetail.setSelectedMovements(new MskJointMovementVoCollection()); } instanceControlPopulateRangeOfMovementDetail(voNewROmDetail); loadMovementsForJoint(domain.listMovementsForJoint(form.ctnDetails().lyrDetails().tabDetails().cmbJoint().getValue())); form.ctnDetails().lyrDetails().tabDetails().cmbDigit().setEnabled(false); form.ctnDetails().lyrDetails().tabDetails().cmbLaterality().setEnabled(false); form.ctnDetails().lyrDetails().tabDetails().cmbJoint().setEnabled(false); }
private void populateMovementGrd(MskJointMovementVoCollection voJointMovementVoColl) { if (voJointMovementVoColl != null) { GenForm.grdMovementsRow row; for (int y = 0; y < voJointMovementVoColl.size(); y++) { MskJointMovementVo voJointMovement = voJointMovementVoColl.get(y); int a = 0; for (a = 0; a < form.grdMovements().getRows().size(); a++) { row = form.grdMovements().getRows().get(a); if (row.getMovements() != null) { if (row.getMovements().equals(voJointMovement.getMoveType().getText())) { row.setcolSor(voJointMovement.getMovSOR()); row.setcolEor(voJointMovement.getMovEOR()); row.setcolFinding(voJointMovement.getMoveFinding()); break; } } } if (a == form.grdMovements().getRows().size()) { row = form.grdMovements().getRows().newRow(); row.setValue(voJointMovement); row.setcolSor(voJointMovement.getMovSOR()); row.setcolEor(voJointMovement.getMovEOR()); row.setcolFinding(voJointMovement.getMoveFinding()); } } } }
private boolean populateChildInstanceData(RangeOfMovementDetailVo voRangeOfMovementDetail) { if (form.getLocalContext().getJointTypeSelected().equals(Joint_Type_None) == false) { if (form.getLocalContext().getJointTypeSelected().equals(Joint_Type_Central)) { if (form.lyrDetails().tabCentral().cmbCentralArea().getValue() == null) { engine.showMessage("You must select a joint "); return false; } RangeOfMovementJointVo voROMCentralJoint = form.lyrDetails().tabCentral().cmbCentralArea().getValue(); voRangeOfMovementDetail.setJoint(voROMCentralJoint.getJoint()); voRangeOfMovementDetail.setGroup(voROMCentralJoint.getGroup()); } else { if (form.lyrDetails().tabPeripheral().cmbPeripheralArea().getValue() == null) { engine.showMessage("You must select a joint "); return false; } RangeOfMovementJointVo voRomPeripheralJoint = form.lyrDetails().tabPeripheral().cmbPeripheralArea().getValue(); voRangeOfMovementDetail.setJoint(voRomPeripheralJoint.getJoint()); voRangeOfMovementDetail.setGroup(voRomPeripheralJoint.getGroup()); } voRangeOfMovementDetail.setSelectedMovements(new MskJointMovementVoCollection()); MskJointMovementVo voMskJointMovement = new MskJointMovementVo(); populateMovementInstanceData(voRangeOfMovementDetail, voMskJointMovement); voRangeOfMovementDetail.getSelectedMovements().add(voMskJointMovement); return true; } return false; }
private boolean checkExits(MskJointMovementVoCollection selectedMovements, MskJointMovementVo movement) { if (movement == null) throw new CodingRuntimeException("Logical error - movement to add can not be null"); for (MskJointMovementVo movementInCollection : selectedMovements) { if (movement.getMoveActionIsNotNull() && movement.getMoveAction().equals(movementInCollection.getMoveAction()) && movement.getMoveTypeIsNotNull() && movement.getMoveTypeIsNotNull() && movement.getMoveType().equals(movementInCollection.getMoveType()) && (!movement.getID_MskJointMovementIsNotNull() || (movement.getID_MskJointMovementIsNotNull() && !movement.getID_MskJointMovement().equals(movementInCollection.getID_MskJointMovement())))) return true; } return false; }
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); }
private boolean instanceDataPopulateRangeOfMovementDetail(RangeOfMovementDetailVo voRangeOfMovementDetail) { // if (form.ctnDetails().lyrDetails().tabDetails().cmbJoint().getValue() == null) // { // engine.showMessage("You must select a joint "); // return; // } voRangeOfMovementDetail.setGroup(form.ctnDetails().lyrDetails().tabDetails().cmbDigit().getValue()); voRangeOfMovementDetail.setJoint(form.ctnDetails().lyrDetails().tabDetails().cmbJoint().getValue()); voRangeOfMovementDetail.setLaterality(form.ctnDetails().lyrDetails().tabDetails().cmbLaterality().getValue()); if (!voRangeOfMovementDetail.getSelectedMovementsIsNotNull()) { voRangeOfMovementDetail.setSelectedMovements(new MskJointMovementVoCollection()); } MskJointMovementVo voMskJointMovement = new MskJointMovementVo(); voMskJointMovement.setMoveAction(form.ctnDetails().lyrDetails().tabDetails().cmbAction().getValue()); voMskJointMovement.setMoveType(form.ctnDetails().lyrDetails().tabDetails().cmbMovement().getValue()); // WDEV-11598 voMskJointMovement.setMovEOR(form.ctnDetails().lyrDetails().tabDetails().intEOR().getValue()); voMskJointMovement.setMovSOR(form.ctnDetails().lyrDetails().tabDetails().intSOR().getValue()); // voMskJointMovement.setMovEOR(form.ctnDetails().lyrDetails().tabDetails().intValue().getValue()); String[] errors = validateUIRules(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } if (checkExits(voRangeOfMovementDetail.getSelectedMovements(), voMskJointMovement)) { engine.showMessage("Combination of Action and Movement already exitst for current joint."); return false; } voRangeOfMovementDetail.setIsJoint(new Boolean(true)); voRangeOfMovementDetail.getSelectedMovements().add(voMskJointMovement); return true; }
private void nodeJointPopulate(RangeOfMovementDetailVo voRangeOfMovementDetail, grdMovementRow digitRow) throws PresentationLogicException { if (voRangeOfMovementDetail.getJoint() != null && digitRow != null) { grdMovementRow jointRow; grdMovementRow movementRow = null; // Add the joint first , then the selected movements.. jointRow = checkForJointNode(digitRow, voRangeOfMovementDetail.getJoint()); jointRow.setColLaterality(voRangeOfMovementDetail.getJoint().getName()); jointRow.setCollapsedImage(form.getImages().ICP.Component); jointRow.setExpandedImage(form.getImages().ICP.Component); jointRow.setValue(voRangeOfMovementDetail.getJoint()); if (voRangeOfMovementDetail.getJoint().getID_MskJoints() == null || voRangeOfMovementDetail.getID_MSkExamJointBonesDetail() == null) jointRow.setTextColor(Color.Red); jointRow.getRows().clear(); MskJointMovementVoCollection voCollMovements = voRangeOfMovementDetail.getSelectedMovements() == null ? null : voRangeOfMovementDetail.getSelectedMovements().sort(SortOrder.ASCENDING, true); if (voCollMovements != null) { for (int i = 0; i < voCollMovements.size(); i++) { MskJointMovementVo msjJointMovement = voCollMovements.get(i); movementRow = jointRow.getRows().newRow(); movementRow.setColAction(msjJointMovement.getMoveAction() == null ? null : msjJointMovement.getMoveAction().getText()); movementRow.setColMovement(msjJointMovement.getMoveType() == null ? null : msjJointMovement.getMoveType().getIItemText()); // WDEV-11598 movementRow.setColEOR(msjJointMovement.getMovEOR() == null ? "" : String.valueOf(msjJointMovement.getMovEOR())); movementRow.setColSOR(msjJointMovement.getMovSOR() == null ? "" : String.valueOf(msjJointMovement.getMovSOR())); // movementRow.setColValue(voCollMovements.get(i).getMovEOR() == null ? "" : String.valueOf(voCollMovements.get(i).getMovEOR())); movementRow.setCollapsedImage(form.getImages().ICP.Child); movementRow.setExpandedImage(form.getImages().ICP.Child); movementRow.setValue(msjJointMovement); if (msjJointMovement.getID_MskJointMovement() == null) movementRow.setTextColor(Color.Red); jointRow.setExpanded(true); } } } }