private void expandParentNode(grdTENSRow selectedRow) { if (selectedRow.getValue() instanceof ElectrotherapyTENSShortVo == false ) return; form.getLocalContext().setSelectedParentInstance(getParentFromDomain((ElectrotherapyTENSShortVo) selectedRow.getValue())); if (form.getLocalContext().getSelectedParentInstance() == null ) return; ElectrotherapyTENSVo voParentInstance = form.getLocalContext().getSelectedParentInstance(); if(form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull() && (voParentInstance.getClinicalContact().getID_ClinicalContact().equals (form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact()))) { // If this is the Golden Node then we'll colour it golden (ok then beige). form.getLocalContext().setGoldenInstanceFound(new Boolean(true)); form.getLocalContext().setGoldenInstanceSelected(new Boolean(true)); selectedRow.setBackColor(Color.Beige); } if (voParentInstance.getTensTreatmentsIsNotNull()) { selectedRow.setExpanded(true); populateChildNodes(selectedRow, voParentInstance.getTensTreatments()); } populateParentInstanceControls(voParentInstance); }
private void newParentNode(ElectrotherapyTENSVo voNewParent) { if (voNewParent == null) return; ElectrotherapyTENSShortVo voParentShort = new ElectrotherapyTENSShortVo(); voParentShort.setAuthoringCP(voNewParent.getAuthoringCP()); voParentShort.setAuthoringDateTime(voNewParent.getAuthoringDateTime()); voParentShort.setClinicalContact(voNewParent.getClinicalContact()); GenForm.grdTENSRow parentRow = form.grdTENS().getRows().newRow(); if(voParentShort.getAuthoringCP() != null) parentRow.setcolAreaParent(voParentShort.getAuthoringDateTime().toString()+ " - " + voParentShort.getAuthoringCP().toString()); parentRow.setValue(voParentShort); parentRow.setBackColor(Color.Beige); form.getLocalContext().setGoldenInstanceSelected(new Boolean(true)); parentRow.setExpanded(true); form.grdTENS().setValue(voParentShort); }
private void populateChildCollectionFromGrid(ElectrotherapyTENSVo voTENS) { if (form.grdTENS().getValue() == null) return; if (voTENS.getTensTreatments() == null) voTENS.setTensTreatments(new ElectrotherapyTensTreatmentVoCollection()); GenForm.grdTENSRow parentRow = form.grdTENS().getValue() instanceof ElectrotherapyTENSShortVo ? form.grdTENS().getSelectedRow() : form.grdTENS().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) voTENS.getTensTreatments().clear(); for (int i=0; i < parentRow.getRows().size(); i++) { voTENS.getTensTreatments().add((ElectrotherapyTensTreatmentVo) parentRow.getRows().get(i).getValue()); } }
public ims.therapies.vo.ElectrotherapyTENSVo saveElectrotherapyTens(ims.therapies.vo.ElectrotherapyTENSVo voElectrotherapyTens) throws StaleObjectException, UniqueKeyViolationException { // Ensure the value object has been validated if (!voElectrotherapyTens.isValidated()) throw new DomainRuntimeException("ElectrotherapyTens Record has not been validated"); if (voElectrotherapyTens.getID_ElectrotherapyTENS() == null && getElectrotherapyTens(voElectrotherapyTens.getClinicalContact()) != null) throw new UniqueKeyViolationException("The screen will be refreshed."); DomainFactory factory = getDomainFactory(); ElectrotherapyTENS domElectrotherapyTens = ElectrotherapyTENSVoAssembler.extractElectrotherapyTENS(factory, voElectrotherapyTens); factory.save(domElectrotherapyTens); return ElectrotherapyTENSVoAssembler.create(domElectrotherapyTens); }
public ims.therapies.vo.ElectrotherapyTENSVo getElectrotherapyTens(ims.core.vo.ClinicalContactShortVo voClinicalContactShort) { if(voClinicalContactShort == null || voClinicalContactShort.getID_ClinicalContact() == null) throw new DomainRuntimeException("Contact not provided for get call. "); DomainFactory factory = getDomainFactory(); ElectrotherapyTENSVo voElectrotherapyTENS = new ElectrotherapyTENSVo(); java.util.List electrotherapyTENSList = factory.find("from ElectrotherapyTENS EctTENS where EctTENS.clinicalContact.id = :contactId", new String[]{"contactId"}, new Object[]{voClinicalContactShort.getID_ClinicalContact()}); ElectrotherapyTENSVoCollection coll = ElectrotherapyTENSVoAssembler.createElectrotherapyTENSVoCollectionFromElectrotherapyTENS(electrotherapyTENSList);// WDEV-13592 if (coll != null && coll.size()>0)// WDEV-13592 voElectrotherapyTENS = coll.get(0); // WDEV-13592 else voElectrotherapyTENS = null; return voElectrotherapyTENS; }
private void populateParentInstanceControls(ElectrotherapyTENSVo voTENSParent) { if(voTENSParent != null) { form.ctnDetails().lyrTENS().tabHeader().dtimAuthoring().setValue(voTENSParent.getAuthoringDateTime()); if(voTENSParent.getAuthoringCP() != null) form.ctnDetails().lyrTENS().tabHeader().qmbAuthoringCP().newRow(voTENSParent.getAuthoringCP(), voTENSParent.getAuthoringCP().toString()); form.ctnDetails().lyrTENS().tabHeader().qmbAuthoringCP().setValue(voTENSParent.getAuthoringCP()); form.ansWarning().setValue(voTENSParent.getWarningGiven()); } }
private void newParentInstance() { ElectrotherapyTENSVo voNewParent = new ElectrotherapyTENSVo(); voNewParent.setAuthoringCP((Hcp) domain.getHcpUser()); voNewParent.setAuthoringDateTime(new DateTime()); voNewParent.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voNewParent.setTensTreatments(new ElectrotherapyTensTreatmentVoCollection()); populateParentInstanceControls(voNewParent); form.getLocalContext().setSelectedParentInstance(voNewParent); }
public ElectrotherapyTENSVo getElectrotherapyTensByRef(ElectrotherapyTENSRefVo electroTherapyTENS) { if(electroTherapyTENS == null || electroTherapyTENS.getID_ElectrotherapyTENS() == null) throw new CodingRuntimeException("Cannot get ElectroTherapyTENS on null Id."); return ElectrotherapyTENSVoAssembler.create((ElectrotherapyTENS) getDomainFactory().getDomainObject(ElectrotherapyTENS.class, electroTherapyTENS.getID_ElectrotherapyTENS())); }
private ElectrotherapyTENSVo getParentFromDomain(ElectrotherapyTENSShortVo voTENSShort) { //return domain.getElectrotherapyTens(voTENSShort.getClinicalContact()); return domain.getElectrotherapyTensByRef(voTENSShort);// WDEV-13592 }
private void populateParentInstanceData(ElectrotherapyTENSVo voTENS) { voTENS.setWarningGiven(form.ansWarning().getValue()); voTENS.setAuthoringCP(form.ctnDetails().lyrTENS().tabHeader().qmbAuthoringCP().getValue()); voTENS.setAuthoringDateTime(form.ctnDetails().lyrTENS().tabHeader().dtimAuthoring().getValue()); }