public Boolean isProcedureExported(ProcedureVo procVo) { DomainFactory factory = getDomainFactory(); // String hql = "select from ServiceActivity sa where sa.activity = X and sa.id in (select serviceact from ServiceActivityExport)"; String hql = "from ServiceActivity sa where"; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); condStr.append(andStr + " sa.activity.id = :procid"); markers.add("procid"); values.add(procVo.getActivity().getID_Activity()); condStr.append(" and sa.id in (select serviceActivity from ServiceActivityExport)"); hql += condStr.toString(); if (factory.find(hql, markers, values).size() > 0) return true; else return false; }
public Boolean updateServiceActivityExportRecords(ProcedureVo procVo) throws StaleObjectException, ForeignKeyViolationException { DomainFactory factory = getDomainFactory(); ServiceActivityExportVoCollection collSERACT = ServiceActivityExportVoAssembler. createServiceActivityExportVoCollectionFromServiceActivityExport(factory.find("from ServiceActivityExport sax where sax.serviceActivity in (select sa.id from ServiceActivity sa where sa.activity.id = :actID )", new String[]{"actID"}, new Object[]{procVo.getActivity().getID_Activity()})); for (int i = 0 ; i < collSERACT.size() ; i++) { ServiceActivityExport doSerActExport = ServiceActivityExportVoAssembler.extractServiceActivityExport(factory, collSERACT.get(i)); doSerActExport.setReadyForExport(true); // doSerActExport.setDateLastExported(null); factory.save(doSerActExport); } return true; }
public ProcedureVo getProcedureForActivity(ActivityRefVo activityRefVo) { DomainFactory factory = getDomainFactory(); if (activityRefVo.getID_ActivityIsNotNull()) { java.util.List procList = factory.find("from Procedure proc where proc.activity.id = :actid", new String[]{"actid"}, new Object[]{activityRefVo.getID_Activity()}); if (procList.size() > 1) throw new DomainRuntimeException("More then one Procedure is configured for this Activity."); else if (procList.size() == 1) { ProcedureVoCollection coll = ProcedureVoAssembler.createProcedureVoCollectionFromProcedure(procList); return coll.get(0); } else return null; } return null; }
private void admit() { TheatreListBookingDetailVo voAdmit = new TheatreListBookingDetailVo(); voAdmit.setTCITime(form.grdAppts().getSelectedRow().getAppointmentTime()); voAdmit.setTheatreText(form.grdAppts().getValue().getTheatreBooking().getSessionIsNotNull() ? form.grdAppts().getValue().getTheatreBooking().getSession().getName() : ""); voAdmit.setTheatreText(form.grdAppts().getValue().getSessionIsNotNull() ? form.grdAppts().getValue().getSession().getName() : ""); voAdmit.setProcedureText(form.grdAppts().getSelectedRow().getProcedure()); ProcedureVo voProc = domain.getProcedureLOS(form.grdAppts().getValue().getTheatreBooking().getProcedure()); voAdmit.setLOS(voProc.getLOS()); form.getGlobalContext().RefMan.setTheatreAdmitDetails(voAdmit); form.getGlobalContext().Core.setHospitalLoc((form.grdAppts().getValue().getSessionIsNotNull() && form.grdAppts().getValue().getSession().getSchLocationIsNotNull()) ? form.grdAppts().getValue().getSession().getSchLocation() : null); form.getGlobalContext().Scheduling.setBookingAppointmentRef(form.grdAppts().getValue()); form.getGlobalContext().RefMan.setTheatreBookingAppointment(form.grdAppts().getValue()); engine.open(form.getForms().RefMan.TheatreAdmissionDialog); }
private void admit() { TheatreListBookingDetailVo voAdmit = new TheatreListBookingDetailVo(); voAdmit.setTCITime(form.grdAppts().getSelectedRow().getAppointmentTime()); voAdmit.setTheatreText(form.grdAppts().getValue().getTheatreBooking().getSessionIsNotNull() ? form.grdAppts().getValue().getTheatreBooking().getSession().getName() : ""); voAdmit.setTheatreText(form.grdAppts().getValue().getSessionIsNotNull() ? form.grdAppts().getValue().getSession().getName() : ""); voAdmit.setProcedureText(form.grdAppts().getSelectedRow().getProcedure()); ProcedureVo voProc = domain.getProcedureLOS(form.grdAppts().getValue().getTheatreBooking().getProcedure()); voAdmit.setLOS(voProc.getLOS()); form.getGlobalContext().CareUk.setTheatreAdmitDetails(voAdmit); form.getGlobalContext().Core.setHospitalLoc((form.grdAppts().getValue().getSessionIsNotNull() && form.grdAppts().getValue().getSession().getSchLocationIsNotNull()) ? form.grdAppts().getValue().getSession().getSchLocation() : null); form.getGlobalContext().Scheduling.setBookingAppointmentRef(form.grdAppts().getValue()); form.getGlobalContext().CareUk.setTheatreBookingAppointment(form.grdAppts().getValue()); engine.open(form.getForms().CAREUK.TheatreAdmissionDialog); }
public ProcedureVo saveProcedureLite(ProcedureLiteVo procVo) throws StaleObjectException, UniqueKeyViolationException, DomainInterfaceException { ProcedureVo proc = new ProcedureVo(procVo.getID_Procedure(), procVo.getVersion_Procedure()); proc.setIsActive(procVo.getIsActive()); proc.setProcedureName(procVo.getProcedureName().trim());//wdev-1336 proc.setProcedureStatus(procVo.getProcedureStatus()); String[] arrErrors = proc.validate(); if( arrErrors != null) { throw new DomainRuntimeException("Error saving Procedure - Procedure not validated correctly"); } return saveProcedureVo(proc, false); }
private ProcedureVo getNoItemPMHProcedure() { ProcedureVo voProcedure = new ProcedureVo(); voProcedure.setID_Procedure(new Integer(-1)); voProcedure.setProcedureName(NO_CODE_ITEM_SELECTED); return voProcedure; }
private void qmbProcedureEndoscopyValueChanged() { ProcedureVo procEnd = form.lyrWaitingListDetails().tabPageEndoscopy().qmbProcedureEndoscopy().getValue(); form.lyrWaitingListDetails().tabPageEndoscopy().intProcedureLengthEndoscopy().setValue(null); if( procEnd != null && (ProcedureEndoscopyType.BRONCHOSCOPY.equals(procEnd.getEndoscopyType()) || ProcedureEndoscopyType.THORACOSCOPY.equals(procEnd.getEndoscopyType()))) { form.lyrWaitingListDetails().tabPageEndoscopy().intProcedureLengthEndoscopy().setValue(procEnd.getDurationInMins()); } form.lyrWaitingListDetails().tabPageEndoscopy().intPoints().setValue(null); updateControlsState(); }
private void addProcedureToDynGrid(PatientProcedureShortWithCareIntraOperativeVo voProc, String stringOPCS4, String stringICD10, LateralityLRB lateralityLRB, DynamicGridRow newRow, DynamicGridCell cellName, DynamicGridCell cellICD10, DynamicGridCell cellOPCS4, DynamicGridCell cellLaterality) { cellName.setValue(voProc.getProcedureDescription()); cellName.setTooltip(voProc.getProcedureDescription()); if (voProc.getProcedureIsNotNull() && voProc.getProcedure().getID_ProcedureIsNotNull()) { ProcedureVo voProcWithMappings = domain.getProcedureWithTaxonomyMappings(voProc.getProcedure()); cellICD10.setValue(stringICD10 == "" ? findICD10(voProcWithMappings.getCciMappings()) : stringICD10); cellICD10.setTooltip(stringICD10 == "" ? findICD10(voProcWithMappings.getCciMappings()) : stringICD10); cellOPCS4.setValue(stringOPCS4 == "" ? findOPCS4(voProcWithMappings.getCciMappings()) : stringOPCS4); cellOPCS4.setTooltip(stringOPCS4 == "" ? findOPCS4(voProcWithMappings.getCciMappings()) : stringOPCS4); } if (voProc != null && voProc.getProcedure() == null) { cellICD10.setValue(stringICD10); cellICD10.setTooltip(stringICD10); cellOPCS4.setValue(stringOPCS4); cellOPCS4.setTooltip(stringOPCS4); } newRow.setBackColor(Color.LightBlue); cellLaterality.setValue(lateralityLRB!=null ? lateralityLRB.getText() : ""); form.setMode(FormMode.EDIT); }
private void addProcedureToOutpatientCodingGrid(PatientProcedureShortWithCareIntraOperativeVo voProc, String stringOPCS4, String stringICD10, LateralityLRB lateralityLRB, boolean bSavedRecord) { grdOutpatientCodingRow rowCoding = form.lyrTabs().tabOutpatientCoding().grdOutpatientCoding().getRows().newRow(); rowCoding.setColDiagProcInv(voProc.getProcedureDescription()); rowCoding.setTooltipForColDiagProcInv(voProc.getProcedureDescription()); if (voProc.getProcedureIsNotNull() && voProc.getProcedure().getID_ProcedureIsNotNull()) { ProcedureVo voProcWithMappings = domain.getProcedureWithTaxonomyMappings(voProc.getProcedure()); rowCoding.setColProcVo(voProc); rowCoding.setColICD10(stringICD10 == "" ? findICD10(voProcWithMappings.getCciMappings()) : stringICD10); rowCoding.setColOPCS4(stringOPCS4 == "" ? findOPCS4(voProcWithMappings.getCciMappings()) : stringOPCS4); } if (voProc != null && voProc.getProcedure() == null) { rowCoding.setColProcVo(voProc); rowCoding.setColICD10(stringICD10); rowCoding.setColOPCS4(stringOPCS4); } rowCoding.setColEditICDReadOnly(true); rowCoding.setColEditOPCSReadOnly(true); rowCoding.setBackColor(Color.LightBlue); rowCoding.setColLaterality(bSavedRecord ? lateralityLRB : voProc.getProcLaterality()); rowCoding.setValue(null); form.lyrTabs().tabOutpatientCoding().grdProc().setValue(null); if (form.getLocalContext().getCurrentRCVo() == null) { form.lyrTabs().tabOutpatientCoding().chkOutpatientActive().setValue(true); form.lyrTabs().tabOutpatientCoding().dtimRecording().setValue(new DateTime()); if (engine.getLoggedInUser() != null && engine.getLoggedInUser().getUserRealName() != null) form.lyrTabs().tabOutpatientCoding().txtRecUser().setValue(engine.getLoggedInUser().getUserRealName().toString()); } }
public ProcedureVo getProcedureVo(ProcedureRefVo voProcedureVo) { DomainFactory factory = getDomainFactory(); Procedure doProc = (Procedure) factory.getDomainObject(Procedure.class, voProcedureVo.getID_Procedure()); return (ProcedureVoAssembler.create(doProc)); }
/** * Populate the Details panel for a given ICciFull * @param ICciFull * @return void */ private void populateInstanceControls(ICciFull cci) { clearInstanceControls(); if (cci == null) return; form.txtName().setValue(cci.getIGenericItemInfoName()); form.cmbAlgType().setValue(cci.getCciAllergenType()); form.cmbTreatInterventionType().setValue(cci.getCciTreatmentInterventionType()); //WDEV-17125 form.intProcDuration().setValue(cci.getCciProcedureDuration()); form.intTCILag().setValue(cci.getCciTCILagTime()); //WDEV-12918 form.intLOS().setValue(cci.getCciProcedureLOS()); // WDEV-17934 form.cmbSurgeonCat().setValue(cci.getSurgeonCategory()); form.cmbAnaesthetistCat().setValue(cci.getAnaesthetistCategory()); form.cmbHospitalCat().setValue(cci.getHospitalCategory()); form.chkIsActive().setValue(cci.getIGenericItemInfoIsActive() != null? cci.getIGenericItemInfoIsActive().booleanValue() : false); populateTaxonomyMappings(cci.getCciMappings()); populateKeywords(cci.getCciKeywords()); //WDEV-11921 - Start if (cci instanceof MedicationFullVo) { MedicationFullVo med = (MedicationFullVo) cci; form.chkControlledDrug().setValue(med.getIsControlledDrugIsNotNull() && med.getIsControlledDrug()); populateFRU(med.getForms()); form.lyrDetails().tabDefaultValues().cmbFrequency().setValue(med.getFrequencyDefault());// WDEV-13584 form.lyrDetails().tabDefaultValues().intDays().setValue(med.getNoOfDaysSupplyDefault());// WDEV-13584 } //WDEV-11921 - End /*WDEV-11921 //WDEV-11836 - starts here form.chkControlledDrug().setValue(cci.getIIsControlledDrug()); populateUnitsGrid(cci.getUnits()); populateFormsGrid(cci.getForms()); populateRoutesGrid(cci.getRoutes()); //WDEV-11836 - ends here * WDEV-11921 */ // for the moment, hotlists are only available for procedure, problem and diagnosis if ( cci instanceof DiagnosisVo || cci instanceof ProblemConfigVo || cci instanceof ProcedureVo || cci instanceof MedicationFullVo//WDEV-11921 || cci instanceof CancerImagingEventVo || cci instanceof PresentingComplaintVo || cci instanceof TreatmentInterventionVo)//WDEV-17060 populateHotlists(cci.getIGenericItemInfoID()); updateControlsState(); }
private void populateActivityTaxonomyWithPossibleExchequerCode(grdActivityRow row, boolean isReadOnly) { if (row.getValue().getID_Activity() != null) { ActivityRefVo voAct = new ActivityRefVo(); voAct.setID_Activity(row.getValue().getID_Activity()); ProcedureVo voProc = null; try { voProc = domain.getProcedureForActivity(voAct); } catch (DomainRuntimeException e) { engine.showMessage(e.getMessage()); return; } if ((voProc != null) && (voProc.getTaxonomyMapIsNotNull())) { grdActivityTaxonomyRow rowActTaxonomy; // WDEV-2538 form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().clear(); for (int i = 0; i < voProc.getTaxonomyMap().size(); i++) { if (ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue() && voProc.getTaxonomyMap().get(i).getTaxonomyName().equals(TaxonomyType.EXCH)) { rowActTaxonomy = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().newRow(); rowActTaxonomy.setValue(voProc.getTaxonomyMap().get(i)); rowActTaxonomy.setcolCode(voProc.getTaxonomyMap().get(i).getTaxonomyCodeIsNotNull() ? voProc.getTaxonomyMap().get(i).getTaxonomyCode() : null); rowActTaxonomy.setcolExtCodeType(voProc.getTaxonomyMap().get(i).getTaxonomyNameIsNotNull() ? voProc.getTaxonomyMap().get(i).getTaxonomyName() : null); rowActTaxonomy.setReadOnly(false); } else if (!ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue()) { rowActTaxonomy = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().newRow(); rowActTaxonomy.setValue(voProc.getTaxonomyMap().get(i)); rowActTaxonomy.setcolCode(voProc.getTaxonomyMap().get(i).getTaxonomyCodeIsNotNull() ? voProc.getTaxonomyMap().get(i).getTaxonomyCode() : null); rowActTaxonomy.setcolExtCodeType(voProc.getTaxonomyMap().get(i).getTaxonomyNameIsNotNull() ? voProc.getTaxonomyMap().get(i).getTaxonomyName() : null); rowActTaxonomy.setReadOnly(false); } } } } form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setReadOnly(isReadOnly); }
public ProcedureVo getProcedureForActivity(ActivityRefVo activityRefVo) { ims.admin.domain.Service impl = (ims.admin.domain.Service) getDomainImpl(ServiceImpl.class); return impl.getProcedureForActivity(activityRefVo); }
private void returnToTheatre() { Booking_AppointmentVo voBooking = domain.getBookingAppt(form.grdTheatre().getValue()); //Check can still be re_admitted if (!domain.isNotACurrentInpatient(form.getGlobalContext().Core.getPatientShort()) && voBooking.getApptStatusIsNotNull() && voBooking.getApptStatus().equals(Status_Reason.BOOKED)) { form.getGlobalContext().RefMan.setTheatreBookingAppointment(voBooking); TheatreListBookingDetailVo voAdmit = new TheatreListBookingDetailVo(); voAdmit.setTheatreText(form.grdTheatre().getValue().getTheatreBookingIsNotNull() && form.grdTheatre().getValue().getTheatreBooking().getSessionIsNotNull() ? form.grdTheatre().getValue().getTheatreBooking().getSession().getName() : ""); if(form.grdTheatre().getSelectedRow() != null) { voAdmit.setTCITime(form.grdTheatre().getSelectedRow().getcolTime()); voAdmit.setProcedureText(form.grdTheatre().getSelectedRow().getcolProcedure()); } ProcedureVo voProc = domain.getProcedureLOS(form.grdTheatre().getValue().getTheatreBooking().getProcedure()); if(voProc != null) voAdmit.setLOS(voProc.getLOS()); form.getGlobalContext().RefMan.setTheatreAdmitDetails(voAdmit); if (form.cmbHospital().getValue() == null) { if (form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getTypeIsNotNull() && form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getType().equals(LocationType.HOSP)) form.getGlobalContext().Core.setHospitalLoc(form.grdTheatre().getSelectedRow().getValue().getSessionIsNotNull() ? form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation() : null); else if (form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getTypeIsNotNull() && ! form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getType().equals(LocationType.HOSP)) { if (form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getParentLocation().getType().equals(LocationType.HOSP)) form.getGlobalContext().Core.setHospitalLoc(form.grdTheatre().getSelectedRow().getValue().getSessionIsNotNull() ? form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getParentLocation() : null); } } else { form.getGlobalContext().Core.setHospitalLoc(form.cmbHospital().getValue()); } if(form.getGlobalContext().Core.getPatientShort() != null) { InpatientEpisodeVo inpatient = domain.getInpatientEpisode(form.getGlobalContext().Core.getPatientShort()); engine.open(form.getForms().RefMan.TheatreAdmissionDialog, new Object[] {inpatient}); } } else { engine.showMessage("The Patient is no longer an Inpatient or the status of the Booking has changed."); performSearch(); } }
private void admit() { Booking_AppointmentVo voBooking = domain.getBookingAppt(form.grdTheatre().getValue()); //Check can still be admitted if (domain.isNotACurrentInpatient(form.getGlobalContext().Core.getPatientShort()) && voBooking.getApptStatusIsNotNull() && voBooking.getApptStatus().equals(Status_Reason.BOOKED)) { form.getGlobalContext().RefMan.setTheatreBookingAppointment(voBooking); TheatreListBookingDetailVo voAdmit = new TheatreListBookingDetailVo(); voAdmit.setTCITime(form.grdTheatre().getSelectedRow().getcolTime()); voAdmit.setTheatreText(form.grdTheatre().getValue().getTheatreBookingIsNotNull() && form.grdTheatre().getValue().getTheatreBooking().getSessionIsNotNull() ? form.grdTheatre().getValue().getTheatreBooking().getSession().getName() : ""); voAdmit.setProcedureText(form.grdTheatre().getSelectedRow().getcolProcedure()); ProcedureVo voProc = domain.getProcedureLOS(form.grdTheatre().getValue().getTheatreBooking().getProcedure()); voAdmit.setLOS(voProc.getLOS()); form.getGlobalContext().RefMan.setTheatreAdmitDetails(voAdmit); if (form.cmbHospital().getValue() == null) { if (form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getTypeIsNotNull() && form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getType().equals(LocationType.HOSP)) form.getGlobalContext().Core.setHospitalLoc(form.grdTheatre().getSelectedRow().getValue().getSessionIsNotNull() ? form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation() : null); else if (form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getTypeIsNotNull() && ! form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getType().equals(LocationType.HOSP)) { if (form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getParentLocation().getType().equals(LocationType.HOSP)) form.getGlobalContext().Core.setHospitalLoc(form.grdTheatre().getSelectedRow().getValue().getSessionIsNotNull() ? form.grdTheatre().getSelectedRow().getValue().getSession().getSchLocation().getParentLocation() : null); } } else form.getGlobalContext().Core.setHospitalLoc(form.cmbHospital().getValue()); engine.open(form.getForms().RefMan.TheatreAdmissionDialog); } else { engine.showMessage("The Patient is already Admitted or the status of the Booking has changed."); performSearch(); } }
private void addProcedureToCodingGrid(PatientProcedureShortWithCareIntraOperativeVo voProc, String stringOPCS4, String stringICD10, LateralityLRB lateralityLRB, boolean bSavedRecord) { grdCodingRow rowCoding = form.grdCoding().getRows().newRow(); rowCoding.setColDiagProc(voProc.getProcedureDescription()); rowCoding.setTooltipForColDiagProc(voProc.getProcedureDescription()); if (voProc.getProcedureIsNotNull() && voProc.getProcedure().getID_ProcedureIsNotNull()) { ProcedureVo voProcWithMappings = domain.getProcedureWithTaxonomyMappings(voProc.getProcedure()); rowCoding.setColProcVo(voProc); rowCoding.setColICD10(stringICD10 == "" ? findICD10(voProcWithMappings.getCciMappings()) : stringICD10); rowCoding.setColOPCS4(stringOPCS4 == "" ? findOPCS4(voProcWithMappings.getCciMappings()) : stringOPCS4); } if (voProc != null && voProc.getProcedure() == null) { rowCoding.setColProcVo(voProc); rowCoding.setColICD10(stringICD10); rowCoding.setColOPCS4(stringOPCS4); } rowCoding.setColEditICDReadOnly(true); rowCoding.setColEditOPCSReadOnly(true); rowCoding.setBackColor(Color.LightBlue); rowCoding.setColLaterality(bSavedRecord ? lateralityLRB : voProc.getProcLaterality()); rowCoding.setValue(null); form.grdProcedures().setValue(null); form.setMode(FormMode.EDIT); if (form.getLocalContext().getCurrentRCVo() == null) { form.dtimRec().setValue(new DateTime()); if (engine.getLoggedInUser() != null && engine.getLoggedInUser().getUserRealName() != null) form.txtMOS().setValue(engine.getLoggedInUser().getUserRealName().toString()); } updateContextMenus(); }
public ProcedureVo getProcedureWithTaxonomyMappings(ProcedureRefVo procRefVo) { DomainFactory factory = getDomainFactory(); Procedure proc = (Procedure) factory.getDomainObject(Procedure.class, procRefVo.getID_Procedure()); return (ProcedureVoAssembler.create(proc)); }
public ProcedureVo getProcedureLOS(ProcedureRefVo procedureRefVo) { DomainFactory factory = getDomainFactory(); Procedure procBo = (Procedure) factory.getDomainObject(Procedure.class, procedureRefVo.getID_Procedure().intValue()); return ProcedureVoAssembler.create(procBo); }
public ProcedureVo saveProcedure(ProcedureVo voProcedure) throws StaleObjectException, UniqueKeyViolationException, DomainInterfaceException { CCIAdmin impl = (CCIAdmin)getDomainImpl(CCIAdminImpl.class); return (ProcedureVo)impl.saveCci(voProcedure, CciType.PROCEDURE); }
public ProcedureVo saveProcedureVo(ProcedureVo voProcedureVo) throws StaleObjectException, UniqueKeyViolationException { if (!voProcedureVo.isValidated()) { throw new DomainRuntimeException("This ProcedureVo has not been validated"); } DomainFactory factory = getDomainFactory(); // We need to ensure that the taxonomy map is not duplicated - based on Taxonomy and map voProcedureVo.setProcedureName(voProcedureVo.getProcedureName().trim());//wdev-1336 Procedure domProcedure = ProcedureVoAssembler.extractProcedure(factory, voProcedureVo); domProcedure.setKeywords(Keywords.setupKeyWords(domProcedure.getKeywords(), domProcedure.getProcedureName())); try { factory.save(domProcedure); } catch(UnqViolationUncheckedException e) { //check which constraint was violated (name/taxononmy map) ///name Procedure proc = Procedure.getProcedureFromProcedureName(factory, voProcedureVo.getProcedureName()); if (proc != null && proc.getId() != null && !(proc.getId().equals(voProcedureVo.getID_Procedure()))) { throw new UniqueKeyViolationException("Procedure record called \"" + voProcedureVo.getProcedureName() + "\" already exists. Duplicates not allowed.", e); } //taxonomy map String dupMessage = Keywords.checkDuplicateTaxonomy(factory, domProcedure, voProcedureVo.getTaxonomyMap(), "getProcedureName"); if(dupMessage != null) throw new UniqueKeyViolationException(dupMessage); throw (e); } return ProcedureVoAssembler.create(domProcedure); }
public ProcedureVo getProcedureByName(String strName) { DomainFactory factory = getDomainFactory(); Procedure domProcedure = Procedure.getProcedureFromProcedureName(factory, strName); return ProcedureVoAssembler.create(domProcedure); }