private void populateInstanceControls(PresentAbsentHistoryProblemsVo voHistoryProblems) { if (voHistoryProblems == null) return; form.getLocalContext().setSelectedInstance(voHistoryProblems); if (voHistoryProblems.getAuthoringInformationIsNotNull()) { form.customControlAuthoringInfo().setValue(voHistoryProblems.getAuthoringInformation()); } if (voHistoryProblems.getPresentProblems() != null) populatePresentPatientProblemsControls(voHistoryProblems.getPresentProblems()); if (voHistoryProblems.getAbsentProblems() != null) populateAbsentPatientProblemsControls(voHistoryProblems.getAbsentProblems()); form.txtHistory().setValue(voHistoryProblems.getHistoryPresentingProblem()); }
protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException { form.getLocalContext().setSelectedInstance(new PresentAbsentHistoryProblemsVo()); form.customControlAuthoringInfo().initializeComponent(); form.customControlAuthoringInfo().setIsRequiredPropertyToControls(Boolean.TRUE); form.setMode(FormMode.EDIT); listConfiguredProblems(); populatePatientProblems(domain.listPatientProblemsByPatient(form.getGlobalContext().Core.getPatientShort())); form.setcustomControlAuthoringInfoEnabled(true); }
private PresentAbsentHistoryProblemsVo populateInstanceData(PresentAbsentHistoryProblemsVo voPresentAbsentHistoryProblems) { voPresentAbsentHistoryProblems.setAuthoringInformation(form.customControlAuthoringInfo().getValue()); voPresentAbsentHistoryProblems.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voPresentAbsentHistoryProblems.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voPresentAbsentHistoryProblems.setHistoryPresentingProblem(form.txtHistory().getValue()); voPresentAbsentHistoryProblems.setPresentProblems(populatePresentPatientProblemsData(voPresentAbsentHistoryProblems.getPresentProblems())); voPresentAbsentHistoryProblems.setAbsentProblems(populateAbsentPatientProblemsData(voPresentAbsentHistoryProblems.getAbsentProblems())); return voPresentAbsentHistoryProblems; }
public PresentAbsentHistoryProblemsVo getHistoryProblems( CareContextRefVo careContextRef) { DomainFactory factory = getDomainFactory(); String strHQL = "from PresentAbsentHistoryProblems p where p.careContext.id = " + careContextRef.getID_CareContext(); List probs = factory.find(strHQL); PresentAbsentHistoryProblemsVoCollection vocollProblems = PresentAbsentHistoryProblemsVoAssembler.createPresentAbsentHistoryProblemsVoCollectionFromPresentAbsentHistoryProblems(probs); if (vocollProblems != null && vocollProblems.size() > 0) return vocollProblems.get(0); else return null; }
public PresentAbsentHistoryProblemsVo save(PresentAbsentHistoryProblemsVo voHistoryProblems) throws StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException { if(!voHistoryProblems.isValidated()) { throw new DomainRuntimeException("History Problems Value Object has not been validated"); } if (voHistoryProblems.getID_PresentAbsentHistoryProblems() == null)//Inserting a record { //WDEV-18556 PresentAbsentHistoryProblemsVo voHP = getHistoryProblems(voHistoryProblems.getCareContext()); if(voHP != null) throw new StaleObjectException(null, "A record exists for this clinical contact, the screen will be refreshed"); } DomainFactory factory = getDomainFactory(); PresentAbsentHistoryProblems domPresentAbsentHistoryProblems = PresentAbsentHistoryProblemsVoAssembler.extractPresentAbsentHistoryProblems(factory,voHistoryProblems); try { factory.save(domPresentAbsentHistoryProblems); } catch(UnqViolationUncheckedException e) { throw new ims.domain.exceptions.UniqueKeyViolationException("A Present Absent history problem already exists for this Clinical Contact.", e); } return PresentAbsentHistoryProblemsVoAssembler.create(domPresentAbsentHistoryProblems); }