private void open() { clearScreen(); updateContextMenus(); form.getLocalContext().setSelectedReferral(null); ReferralsRecordingVo voRR = domain.getPrimaryPreecedingReferralRecording(form.getGlobalContext().Core.getCurrentCareContext().getEpisodeOfCare().getCareSpell()); if (voRR != null) { form.getLocalContext().setSelectedReferral(voRR); populateScreenFromData(voRR); } if(form.getMode().equals(FormMode.VIEW)) { form.btnNew().setEnabled(voRR == null); form.btnNew().setVisible(true); form.btnEdit().setEnabled(voRR != null); form.btnEdit().setVisible(true); } }
@Override protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException { form.setMode(FormMode.EDIT); clearScreen(); form.getLocalContext().setSelectedReferral(new ReferralsRecordingVo()); // form.customControlAuthoringInfo().initializeComponent(); if (engine.getLoggedInUser().getMosId() != null) { MemberOfStaffRefVo voRef = new MemberOfStaffRefVo(); voRef.setID_MemberOfStaff(engine.getLoggedInUser().getMosId()); MemberOfStaffShortVo voMOSShort = domain.getMemberOfStaff(voRef); //wdev-12035 form.txtRecordingUser().setValue(voMOSShort.getNameIsNotNull() ? (voMOSShort.getName().getTitleIsNotNull() ? voMOSShort.getName().getTitle() : "" )+ " " + (voMOSShort.getName().getForenameIsNotNull() ? voMOSShort.getName().getForename() : "") + " " + (voMOSShort.getName().getSurnameIsNotNull() ? voMOSShort.getName().getSurname() : "") : ""); //---- form.getLocalContext().setLoggedInMOS(voMOSShort); } form.dtimRecordingDate().setValue(new DateTime());//getAuthoringInfo()); }
public ReferralsRecordingVo save(ReferralsRecordingVo record) throws StaleObjectException { if(record == null) { throw new DomainRuntimeException("Invalid record"); } if(!record.isValidated()) { throw new CodingRuntimeException("Record not validated"); } DomainFactory factory = getDomainFactory(); ReferralsRecording domainRecord = ReferralsRecordingVoAssembler.extractReferralsRecording(factory, record); factory.save(domainRecord); return ReferralsRecordingVoAssembler.create(domainRecord); }
private void addOrReplaceReferralRow(ReferralsRecordingVo rrVo, grdPreceedingReferralsRow existingRow) { grdPreceedingReferralsRow row = null; if (existingRow == null) row = form.grdPreceedingReferrals().getRows().newRow(); else row = existingRow; row.setColSourceOfReferral(rrVo.getReferralSourceIsNotNull() ? rrVo.getReferralSource().toString() :""); row.setColRefOrga(rrVo.getRefOrgaCodeIsNotNull() ? rrVo.getRefOrgaCode().getName() : ""); row.setColReferredTo(rrVo.getReferralHCPIsNotNull() ? rrVo.getReferralHCP().getName().toString() : ""); row.setColReferralDate(rrVo.getDateReceivedIsNotNull() ? rrVo.getDateReceived().toString() : ""); row.setColDateFirstSeen(rrVo.getDateFirstSeenIsNotNull() ? rrVo.getDateFirstSeen().toString() : ""); row.setValue(rrVo); }
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException { if (form.getMode().equals(FormMode.EDIT) && formName.equals(form.getForms().Clinical.PreceedingReferral) && result.equals(DialogResult.OK)) { //existing row and edited - Update if (form.grdPreceedingReferrals().getSelectedRowIndex() >= 0 && form.getGlobalContext().Clinical.getPreceedingReferralDialogMode().equals(FormMode.EDIT)) { addOrReplaceReferralRow((ims.clinical.vo.ReferralsRecordingVo)form.getGlobalContext().Clinical.getSelectedPreceedingReferralVo(), form.grdPreceedingReferrals().getSelectedRow()); } //No row and edited - New else if (form.grdPreceedingReferrals().getSelectedRowIndex() == -1 && form.getGlobalContext().Clinical.getPreceedingReferralDialogMode().equals(FormMode.EDIT)) { addOrReplaceReferralRow((ims.clinical.vo.ReferralsRecordingVo)form.getGlobalContext().Clinical.getSelectedPreceedingReferralVo(), null); } //existing row and view - View else if (form.grdPreceedingReferrals().getSelectedRowIndex() >= 0 && form.getGlobalContext().Clinical.getPreceedingReferralDialogMode().equals(FormMode.VIEW)) { //do nothing } form.getGlobalContext().Clinical.setPreceedingReferralDialogMode(null); form.getGlobalContext().Clinical.setSelectedPreceedingReferralVo(null); } updateContextMenus(); }
private void fillReferralGrid(ReferralsRecordingVo rrVo) { if (rrVo.getPreceedingReferralsIsNotNull()) { rrVo.getPreceedingReferrals().sort(); for (int i = 0 ; i < rrVo.getPreceedingReferrals().size() ; i++) addOrReplaceReferralRow(rrVo.getPreceedingReferrals().get(i), null); } }
/** * saveReferralsRecording */ public ims.clinical.vo.ReferralsRecordingVo saveReferralsRecording(ims.clinical.vo.ReferralsRecordingVo referVo) throws ims.domain.exceptions.StaleObjectException { DomainFactory factory = getDomainFactory(); ReferralsRecording doRR = ReferralsRecordingVoAssembler.extractReferralsRecording(factory, referVo); factory.save(doRR); return ReferralsRecordingVoAssembler.create(doRR); }
private void open() { clearScreen(); //updateContextMenus(); ReferralsRecordingVo voRR = null; if(form.getGlobalContext().Clinical.getSelectedReferralRecordingVoIsNotNull()) voRR = domain.getReferralRecording(form.getGlobalContext().Clinical.getSelectedReferralRecordingVo());//.getPrimaryPreecedingReferralRecording(form.getGlobalContext().Clinical.getSelectedReferralRecordingVo().getCareSpell()); else if(form.getLocalContext().getSelectedReferralIsNotNull() && form.getLocalContext().getSelectedReferral().getID_ReferralsRecordingIsNotNull()) voRR = domain.getReferralRecording(form.getLocalContext().getSelectedReferral()); if (voRR != null) { form.getLocalContext().setSelectedReferral(voRR); populateScreenFromData(voRR); } if(form.getMode().equals(FormMode.VIEW)) { form.btnNew().setEnabled(voRR == null); form.btnNew().setVisible(true); form.btnEdit().setEnabled(voRR != null); form.btnEdit().setVisible(true); if(engine.getFormName().equals(form.getForms().Clinical.DemoreferralDetailsDialog)) form.btnClose().setVisible(true); else form.btnClose().setVisible(false); } }
@Override protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException { form.setMode(FormMode.EDIT); form.lyr().tabReferralDetails().qmbReferredBy().setEnabled(true); form.lyr().tabReferralDetails().cmbLocations().setEnabled(true); clearScreen(); form.lyr().showtabReferralDetails(); form.getLocalContext().setSelectedReferral(new ReferralsRecordingVo()); // form.customControlAuthoringInfo().initializeComponent(); if (engine.getLoggedInUser().getMosId() != null) { MemberOfStaffRefVo voRef = new MemberOfStaffRefVo(); voRef.setID_MemberOfStaff(engine.getLoggedInUser().getMosId()); MemberOfStaffShortVo voMOSShort = domain.getMemberOfStaff(voRef); form.lyr().tabReferralDetails().txtRecordingUser().setValue(voMOSShort.getNameIsNotNull() ? (voMOSShort.getName().getTitleIsNotNull() ? voMOSShort.getName().getTitle() : "" )+ " " + voMOSShort.getName().getForename() + " " + voMOSShort.getName().getSurname() : ""); form.getLocalContext().setLoggedInMOS(voMOSShort); } form.lyr().tabReferralDetails().dtimRecordingDate().setValue(new DateTime());//getAuthoringInfo()); if (form.getLocalContext().getUserAssessmentVo() != null) { PatientAssessmentVo voPatientAssessmentVo = populatePatientAssessmentFromUserAssessmentShort(form.getLocalContext().getUserAssessmentVo()); form.lyr().tabAssessment().customControlAssessment().setPatientAssessment(voPatientAssessmentVo); } }
private void addRowRecord(ReferralsRecordingShortVo record) { if(record == null) return; ReferralsRecordingVo editedRecord = form.getLocalContext().getEditedRecord(); GenForm.grdListRow row = form.grdList().getRows().newRow(record.equals(editedRecord)); row.setColDate(record.getDateSentIsNotNull() ? record.getDateSent() : null) ; row.setColReferralTypeSource(record.getReferralTypeIsNotNull() ? record.getReferralType().toString() : "" +" / " + (record.getReferralSourceIsNotNull() ? record.getReferralSource().toString() : "")); row.setColDetails(record.getDetailsIsNotNull() ? record.getDetails() : ""); row.setValue(record); }
protected void onFormModeChanged() { ReferralsRecordingVo editedRecord = form.getLocalContext().getEditedRecord(); getAndDisplayRecord(editedRecord); updateControlState(); if (form.getMode().equals(FormMode.VIEW)) { disableSupplyReferrals(); setCollapsableContainer(); form.ctnDetails().txtLocation().setEnabled(false); form.ctnDetails().cmbLocation().setEnabled(false); } }
private void updateRowRecord(ReferralsRecordingVo record) { if (record == null) return; for (int j = 0; j < form.grdList().getRows().size(); j++) { ReferralsRecordingShortVo existingRecord = form.grdList().getRows().get(j).getValue(); if (existingRecord != null && existingRecord.equals(record)) { updateRowRecord(form.grdList().getRows().get(j), record); break; } } if (form.grdList().getSelectedRowIndex() >=0) { if (form.getLocalContext().getEditedRecordIsNotNull()) { if (form.getLocalContext().getEditedRecord().getSuppliedReferralProfessionalIsNotNull()) { form.ctnDetails().chkSupplyHcp().setValue(true); showSupplyHcp(true); } } } }
private void updateRowRecord(grdListRow row, ReferralsRecordingVo record) { if (row == null || record == null) return; row.setColDate(record.getDateSent()) ; row.setColReferralTypeSource(record.getReferralType().toString()+" / " + (record.getReferralSourceIsNotNull() ? record.getReferralSource().toString() : "")); row.setColDetails(record.getDetails()); row.setValue(record); }
private ReferralsRecordingVo getAndDisplayRecord(ReferralsRecordingShortVo refRecord) { clear(); if(refRecord == null) return null; ReferralsRecordingVo record = domain.get(refRecord); form.getLocalContext().setEditedRecord(record); populateScreenFromData(record); return record; }
public ReferralsRecordingVo get(ReferralsRecordingRefVo record) { if(record == null || record.getID_ReferralsRecording() == null) { throw new DomainRuntimeException("Invalid record"); } DomainFactory factory = getDomainFactory(); ReferralsRecording domainRecord = (ReferralsRecording)factory.getDomainObject (ReferralsRecording.class, record.getID_ReferralsRecording().intValue()); return ReferralsRecordingVoAssembler.create(domainRecord); }