private void open() { form.getLocalContext().setSelectedClinicalContact(new Boolean(false)); SplintDetailsVoCollection voSplintsDetailsColl = domain.listSplintDetails(form.getGlobalContext().Core.getCurrentCareContext()); disableCombos(); form.grdSummary().getRows().clear(); clearControls(); setGrids(true); if(voSplintsDetailsColl != null) { populateSummaryGrid(voSplintsDetailsColl); populateAllControls(form.grdSummary().getValue()); form.ctnDetails().setCollapsed(false); } else form.ctnDetails().setCollapsed(true); form.grdSummary().setEnabled(true); SplintDetailsVo voSplint = form.grdSummary().getValue(); form.getLocalContext().setupdateVoSplintDetails(voSplint); if (voSplint != null) isRecordEditable(voSplint); updateAllGridMenus(); }
private void populateControls(SplintDetailsVo voSplint) { form.ctnDetails().dtimAuthoring().setValue(voSplint.getAuthoringDateTime()); Hcp med = voSplint.getAuthoringCP(); if(med != null) form.ctnDetails().qmbAuthoringCP().newRow(med, med.toString()); form.ctnDetails().qmbAuthoringCP().setValue(med); form.ctnDetails().dteStart().setValue(voSplint.getStartDate()); form.ctnDetails().cmbArea().setValue(voSplint.getArea()); form.ctnDetails().cmbCategory().setValue(voSplint.getSplintCategory()); form.ctnDetails().cmbMaterial().setValue(voSplint.getMaterial()); form.ctnDetails().cmbProduct().setValue(voSplint.getProduct()); form.ctnDetails().cmbLaterality().setValue(voSplint.getLaterality()); form.ctnDetails().cmbType().setValue(voSplint.getSplintType()); form.ctnDetails().cmbBased().setValue(voSplint.getSplintBase()); form.ctnDetails().cmbSize().setValue(voSplint.getSplintSize()); form.ctnDetails().dteEnd().setValue(voSplint.getEndDate()); form.ctnDetails().dteConsent().setValue(voSplint.getConsentGiven().getDateConsentGiven()); form.ctnDetails().chkConsent().setValue(voSplint.getConsentGiven().getConsentGiven().booleanValue()); }
private void populateSummaryGrid(SplintDetailsVoCollection voSplintsDetailsColl) { GenForm.grdSummaryRow row = null; if(voSplintsDetailsColl != null) { for(int x=0; x<voSplintsDetailsColl.size(); x++) { SplintDetailsVo voSplint = voSplintsDetailsColl.get(x); row = form.grdSummary().getRows().newRow(); row.setColStartDate(voSplint.getStartDate()); if(voSplint.getArea() != null) row.setColArea(voSplint.getArea().toString()); if(voSplint.getSplintCategory() != null) row.setColCategory(voSplint.getSplintCategory().toString()); if(voSplint.getMaterial() != null) row.setColMaterial(voSplint.getMaterial().toString()); if(voSplint.getProduct() != null) row.setColProduct(voSplint.getProduct().toString()); if(voSplint.getLaterality() != null) row.setColLaterality(voSplint.getLaterality().toString()); row.setColEndDate(voSplint.getEndDate()); isGoldenInstanceFound(voSplint, row); row.setValue(voSplint); form.grdSummary().setValue(voSplint); } } if(form.getLocalContext().getupdateVoSplintDetailsIsNotNull()) form.grdSummary().setValue(form.getLocalContext().getupdateVoSplintDetails()); }
private void isGoldenInstanceFound(SplintDetailsVo voSplint, grdSummaryRow row) { ClinicalContactShortVo voClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact(); if(voClinicalContact != null) { if(voClinicalContact.getID_ClinicalContact().equals(voSplint.getClinicalContact().getID_ClinicalContact())) row.setBackColor(Color.Beige); } }
protected void onGrdSummarySelectionChanged() throws PresentationLogicException { SplintDetailsVo voSplint = form.grdSummary().getValue(); isRecordEditable(voSplint); clearControls(); populateAllControls(voSplint); updateSummaryGridMenu(); }
private void isRecordEditable(SplintDetailsVo voSplint) { ClinicalContactShortVo voClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact(); if(voClinicalContact != null) { ClinicalContactShortVo voCurrentClinicalContact = voSplint.getClinicalContact(); if(voClinicalContact.getID_ClinicalContact().equals(voCurrentClinicalContact.getID_ClinicalContact())) form.getLocalContext().setSelectedClinicalContact(new Boolean(true)); else form.getLocalContext().setSelectedClinicalContact(new Boolean(false)); } }
private void populateAllControls(SplintDetailsVo voDetails) { if(voDetails != null) { populateControls(voDetails); if(voDetails.getSplintsWearRegimeIsNotNull()) populateWearGrid(voDetails.getSplintsWearRegime()); if(voDetails.getSplintAdditionalFeaturesIsNotNull()) populateFeaturesGrid(voDetails.getSplintAdditionalFeatures()); if(voDetails.getSplintInstructionsIsNotNull()) populateInstructionsGrid(voDetails.getSplintInstructions()); } }
/** * saves Splint Details */ public SplintDetailsVo saveSplintDetails(ims.therapies.vo.SplintDetailsVo voSplintDetails) throws ims.domain.exceptions.StaleObjectException { if(!voSplintDetails.isValidated()) throw new DomainRuntimeException("These Splint Details have not been validated"); DomainFactory factory = getDomainFactory(); SplintDetails doSplintDetails = SplintDetailsVoAssembler.extractSplintDetails(factory, voSplintDetails); factory.save(doSplintDetails); return SplintDetailsVoAssembler.create(doSplintDetails); }