private void selectHandRangeOfMovement() { resetContextVariables(); HandRangeOfMovementVo voHandRangeOfMovement = form.recbrHandRangeOfMovements().getValue(); if (voHandRangeOfMovement != null) { instanceControlsPopulateHandRangeOfMovement(voHandRangeOfMovement); populateTree(voHandRangeOfMovement); form.getLocalContext().setSelectedHandRangeOfMovementInstance(voHandRangeOfMovement); } reselectUpdatedNode(); updateControlsState(); }
/** * Methods that populate controls on the form from vo data. From Parent to Child to movement. * * Populate the controls in the header tab from the HandRangeOfMovement tab passed in. */ private void instanceControlsPopulateHandRangeOfMovement(HandRangeOfMovementVo voHandRangeOfMovement) { if (voHandRangeOfMovement != null) { form.ctnDetails().lyrDetails().tabHeader().customControlAuthoringHCP().setValue(getAuthoringInfo(voHandRangeOfMovement)); if (voHandRangeOfMovement.getDominantHand() != null) { form.ctnDetails().lyrDetails().tabHeader().cmbDominantHand().newRow(voHandRangeOfMovement.getDominantHand(), voHandRangeOfMovement.getDominantHand().getText()); form.ctnDetails().lyrDetails().tabHeader().cmbDominantHand().setValue(voHandRangeOfMovement.getDominantHand()); } } }
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); }
/** * Create a new HandRangeOfMovement instance and set the localContext SelectedParent with the newly created instance. * */ private void newHandRangeOfMovementInstance() { form.getLocalContext().setUpdatingParent(Boolean.TRUE); HandRangeOfMovementVo voNewParent = new HandRangeOfMovementVo(); voNewParent.setDetails(new RangeOfMovementDetailVoCollection()); form.getLocalContext().setSelectedHandRangeOfMovementInstance(voNewParent); voNewParent.setAuthoringCP((HcpLiteVo) domain.getHcpLiteUser()); voNewParent.setAuthoringDateTime(new DateTime()); clearHandRangeOfMovementInstanceControls(); instanceControlsPopulateHandRangeOfMovement(voNewParent); form.setMode(FormMode.EDIT); }
private boolean saveWithoutCheck() { HandRangeOfMovementVo voHandRangeOfMovement = instanceDataPopulate(form.getLocalContext().getSelectedHandRangeOfMovementInstance()); if (voHandRangeOfMovement != null && voHandRangeOfMovement.getClinicalContact() == null) { voHandRangeOfMovement.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); } String[] arrErrors = voHandRangeOfMovement.validate(); if (arrErrors != null) { engine.showErrors(arrErrors); return false; } try { form.getLocalContext().setSelectedHandRangeOfMovementInstance(domain.saveHandRangeOfMovement(voHandRangeOfMovement)); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } // WDEV-13423 // Only update child when not updating parent if (!Boolean.TRUE.equals(form.getLocalContext().getUpdatingParent())) { setUpdatedChild(); } return true; }
String buildBrowserLine(HandRangeOfMovementVo record) { if (record == null) return "Unknown Range of Movement"; String result = ""; result += "Author: "; result += record.getAuthoringCP() != null ? record.getAuthoringCP().toString() : "<unknown>"; result += " date: "; result += record.getAuthoringDateTime() != null ? record.getAuthoringDateTime().toString() : "<unknown>"; return result; }
private AuthoringInformationVo getAuthoringInfo(HandRangeOfMovementVo voSelectedInstance) { AuthoringInformationVo voAuthoringInformation = new AuthoringInformationVo(); voAuthoringInformation.setAuthoringDateTime(voSelectedInstance.getAuthoringDateTime()); voAuthoringInformation.setAuthoringHcp(voSelectedInstance.getAuthoringCP()); return voAuthoringInformation; }
public HandRangeOfMovementVo saveHandRangeOfMovement(HandRangeOfMovementVo voHandRangeOfMovement) throws StaleObjectException { if(!voHandRangeOfMovement.isValidated()) throw new DomainRuntimeException("This Hand Range Of Movement has not been validated"); DomainFactory factory = getDomainFactory(); HandRangeOfMovement domHandRangeOfMovement = HandRangeOfMovementVoAssembler.extractHandRangeOfMovement(factory, voHandRangeOfMovement); factory.save(domHandRangeOfMovement); return HandRangeOfMovementVoAssembler.create(domHandRangeOfMovement); }
public HandRangeOfMovementVo getHandRangeOfMovementByClinicalContact(ClinicalContactRefVo voRefClinicalContact) { DomainFactory factory = getDomainFactory(); String hql; hql = " from HandRangeOfMovement m where m.clinicalContact.id = " + voRefClinicalContact.getID_ClinicalContact(); HandRangeOfMovementVoCollection voCollHandRangeOfMovements = HandRangeOfMovementVoAssembler.createHandRangeOfMovementVoCollectionFromHandRangeOfMovement(factory.find(hql)); if (voCollHandRangeOfMovements.size() == 1) return voCollHandRangeOfMovements.get(0); else return null; }
private void instanceDataPopulateHandRangeOfMovement(HandRangeOfMovementVo voHandRangeOfMovement) { voHandRangeOfMovement.setAuthoringCP(form.ctnDetails().lyrDetails().tabHeader().customControlAuthoringHCP().getValue().getAuthoringHcp()); voHandRangeOfMovement.setAuthoringDateTime(form.ctnDetails().lyrDetails().tabHeader().customControlAuthoringHCP().getValue().getAuthoringDateTime()); voHandRangeOfMovement.setDominantHand(form.ctnDetails().lyrDetails().tabHeader().cmbDominantHand().getValue()); }
private void populateTree(HandRangeOfMovementVo voHandRangeOfMovement) { if (voHandRangeOfMovement.getDetails() != null) populateGrid(voHandRangeOfMovement.getDetails()); }