public CancerImagingEventVo saveCancerImagingEventVo(CancerImagingEventVo voImagingEvent) throws StaleObjectException, UniqueKeyViolationException { if (!voImagingEvent.isValidated()) { throw new DomainRuntimeException("This CancerImagingEventVo has not been validated"); } DomainFactory factory = getDomainFactory(); CancerImagingEvent domCancerImagingEvent = CancerImagingEventVoAssembler.extractCancerImagingEvent(factory, voImagingEvent); domCancerImagingEvent.setKeywords(Keywords.setupKeyWords(domCancerImagingEvent.getKeywords(), domCancerImagingEvent.getImagingEventName())); try { factory.save(domCancerImagingEvent); } catch(UnqViolationUncheckedException e) { //check which constraint was violated (name/taxononmy map) //name CancerImagingEvent cie = CancerImagingEvent.getCancerImagingEventFromImagingEventName(factory, voImagingEvent.getImagingEventName()); if (cie != null && cie.getId() != null && !(cie.getId().equals(voImagingEvent.getID_CancerImagingEvent()))) { throw new UniqueKeyViolationException("Cancer Imaging Event record called \"" + voImagingEvent.getImagingEventName() + "\" already exists. Duplicates not allowed.", e); } //taxonomy map String dupMessage = Keywords.checkDuplicateTaxonomy(factory, domCancerImagingEvent, voImagingEvent.getTaxonomyMap(), "getCancerImagingEvent"); if(dupMessage != null) throw new UniqueKeyViolationException(dupMessage); throw (e); } return CancerImagingEventVoAssembler.create(domCancerImagingEvent); }
/** * 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(); }
public CancerImagingEventVo getImagingEventByName(String name) { DomainFactory factory = getDomainFactory(); CancerImagingEvent domCIE = CancerImagingEvent.getCancerImagingEventFromImagingEventName(factory, name); return CancerImagingEventVoAssembler.create(domCIE); }