public ims.clinical.vo.DischargeFuturePlanSthkVo getFuturePlan(ims.core.admin.vo.CareContextRefVo careContext) { // Check passed care context if (careContext == null || !careContext.getID_CareContextIsNotNull()) throw new DomainRuntimeException("DOMAIN getFuturePlan() - Selected care context is null"); // Build query and parameter to retrieve the record from database String query = "from FuturePlan as futurePlan where futurePlan.careContext.id = :ID"; ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("ID"); paramValues.add(careContext.getID_CareContext()); // Query database for the record // Create the VO form the record database return DischargeFuturePlanSthkVoAssembler.create((FuturePlan) getDomainFactory().findFirst(query, paramNames, paramValues)); }
public DischargeFuturePlanSthkVo saveFuturePlan(DischargeFuturePlanSthkVo futurePlan, EDischargeSTHKSummaryVo dischargeSummary) throws StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException { // Check for null VO passed to save if (futurePlan == null) throw new DomainRuntimeException("DOMAIN saveFuturePlan() - Can not save a null object"); // Check if the VO is validated if (!futurePlan.isValidated()) throw new DomainRuntimeException("DOMAIN saveFuturePlan() - Value object to save is not validated"); // Extract domain object needed DomainFactory domainFactory = getDomainFactory(); FuturePlan futurePlanDomObj = DischargeFuturePlanSthkVoAssembler.extractFuturePlan(domainFactory, futurePlan); // Save domain object domainFactory.save(futurePlanDomObj); futurePlan = DischargeFuturePlanSthkVoAssembler.create(futurePlanDomObj); IEDischargeHelper impl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class); impl.updateSummaryIfRequired(futurePlan, dischargeSummary, getDomainFactory()); // Return a refreshed version of the VO return futurePlan; }
private void populateScreenFromData(DischargeFuturePlanSthkVo futurePlan) { // Clear the instance controls clearInstanceControls(); // Terminate if the parameter is null if (futurePlan == null) return; // Set follow up details to grid populateFollowUpGridFromData(futurePlan.getFollowUpDetails()); // Set Hospital Plan text form.txtHospitalPlan().setValue(futurePlan.getHospitalPlan()); // Set action for GP Community and Special Services text form.txtActions().setValue(futurePlan.getActionsforGPandCommunity()); // Set Lives Alone radio buttons if (YesNo.YES.equals(futurePlan.getLivesAlone())) form.GroupLivesAlone().setValue(GroupLivesAloneEnumeration.rdoLivesAloneYes); else if (YesNo.NO.equals(futurePlan.getLivesAlone())) form.GroupLivesAlone().setValue(GroupLivesAloneEnumeration.rdoLivesAloneNo); //wdev-11818 //Set Follow-Up Appointment Required radio buttons if (YesNo.YES.equals(futurePlan.getHospitalFollowUp())) form.GroupFollowUpAppRequired().setValue(GroupFollowUpAppRequiredEnumeration.rdoFollowUpAppReqYes); else if (YesNo.NO.equals(futurePlan.getHospitalFollowUp())) form.GroupFollowUpAppRequired().setValue(GroupFollowUpAppRequiredEnumeration.rdoFollowUpAppReqNo); //----- // Set Statement of Fitness to Work radio buttons if (YesNo.YES.equals(futurePlan.getStatementOfFitnessToWorkIssue())) form.GroupStatementOfFitness().setValue(GroupStatementOfFitnessEnumeration.rdoStatFitnessYes); else if (YesNo.NO.equals(futurePlan.getStatementOfFitnessToWorkIssue())) form.GroupStatementOfFitness().setValue(GroupStatementOfFitnessEnumeration.rdoStatFitnessNo); // Set From and To dates form.dteFrom().setValue(futurePlan.getCertificateStartsDate()); form.dteTo().setValue(futurePlan.getCertificateExpiresDate()); // Set Fit to return to work radio buttons if (YesNo.YES.equals(futurePlan.getFitToReturnToWork())) form.GroupFitToReturnToWork().setValue(GroupFitToReturnToWorkEnumeration.rdoFitToReturnWorkYes); else if (YesNo.NO.equals(futurePlan.getFitToReturnToWork())) form.GroupFitToReturnToWork().setValue(GroupFitToReturnToWorkEnumeration.rdoFitToReturnWorkNo); // Set Return to work advice combo-box form.cmbReturnToWorkAdvice().setValue(futurePlan.getReturnToWorkAdvice()); // Set Advice applicable for int box and combo box form.intAdviceApplicable().setValue(futurePlan.getAdviceApplicatiableFor()); form.cmbAdviceapplicable().setValue(futurePlan.getAdviceApplicatiableForUnit()); // Set Comments text box form.txtComments().setValue(futurePlan.getComments()); // Set Instruction for discharging nurse if (Boolean.TRUE.equals(futurePlan.getWasNurseEnabledDischarge())) form.GroupFollowUp().setValue(GroupFollowUpEnumeration.rdoNurseYes); else if (Boolean.FALSE.equals(futurePlan.getWasNurseEnabledDischarge())) form.GroupFollowUp().setValue(GroupFollowUpEnumeration.rdoNurseNo); form.txtNurseEnabled().setValue(futurePlan.getNurseEnabledInstructionsIsNotNull() ? futurePlan.getNurseEnabledInstructions().getNurseEnabledInstructions() : null); // Set isComlete check-box form.chkComplete().setValue(Boolean.TRUE.equals(futurePlan.getIsComplete())); }