private void populateScreen(HydrotherapyVo voHydroTherapy) { form.qmbAuthoringCP().newRow(voHydroTherapy.getAuthoringCP(), voHydroTherapy.getAuthoringCP().toString()); form.qmbAuthoringCP().setValue(voHydroTherapy.getAuthoringCP()); form.dtimAuthoring().setValue(voHydroTherapy.getAuthoringDateTime()); form.cmbAssistance().setValue(voHydroTherapy.getLevelOfAssistance()); form.cmbTransferIn().setValue(voHydroTherapy.getTransferIn()); form.cmbTransferOut().setValue(voHydroTherapy.getTransferOut()); form.txtComments().setValue(voHydroTherapy.getComment()); if(voHydroTherapy.getEquipment() != null) populateEquipGrid(voHydroTherapy.getEquipment()); if(voHydroTherapy.getModalities() != null) populateModalGrid(voHydroTherapy.getModalities()); }
/** * WDEV-13587 * Retrieve Hydrotherapy record based on ClinicalContact * Depending on RIE parameter will retrieve RIE or non-RIE record */ public HydrotherapyVo getHydroTherapy(ClinicalContactRefVo voClinicalContact, Boolean modeRIE) { if (voClinicalContact == null) throw new RuntimeException("Cannot get Hidrotherapy record for null Clinical Contact"); StringBuffer query = new StringBuffer("from Hydrotherapy as hyd where hyd.clinicalContact.id = :CCID "); if (Boolean.TRUE.equals(modeRIE)) { query.append(" and hyd.isRIE = 1 order by hyd.systemInformation.creationDateTime desc"); } else { query.append(" and hyd.isRIE is null order by hyd.systemInformation.creationDateTime desc"); } return HydrotherapyVoAssembler.create((Hydrotherapy) getDomainFactory().findFirst(query.toString(), "CCID", voClinicalContact.getID_ClinicalContact())); }
public void saveHydroTherapy(HydrotherapyVo voHydrotherapy) throws StaleObjectException, UniqueKeyViolationException { if(!voHydrotherapy.isValidated()) throw new DomainRuntimeException("This HydroTherapy has not been validated"); //if a new Hydrotherapy record is created check if already exists a Hydrotherapy record for selected clinical contact in the database //must exist only one Hydrotherapy record per clinical contact if(voHydrotherapy.getID_Hydrotherapy() == null) { if(voHydrotherapy.getClinicalContactIsNotNull()) { HydrotherapyVo tempvo = getHydroTherapy(voHydrotherapy.getClinicalContact(), false); if(tempvo != null) throw new DomainRuntimeException("A Hydrotherapy record already exists for selected Clinical Contact."); } } DomainFactory factory = getDomainFactory(); Hydrotherapy doHydro = HydrotherapyVoAssembler.extractHydrotherapy(factory, voHydrotherapy); factory.save(doHydro); }
/** * WDEV-13587 * Get Hydrotherapy record */ public HydrotherapyVo getHydrotherapyById(HydrotherapyRefVo hydroRefVo) { if(hydroRefVo == null || hydroRefVo.getID_Hydrotherapy() == null) throw new DomainRuntimeException("Hydrotherapy ID not provided for get call. "); DomainFactory factory = getDomainFactory(); return HydrotherapyVoAssembler.create((Hydrotherapy) factory.getDomainObject(Hydrotherapy.class, hydroRefVo.getID_Hydrotherapy())); }