protected MiniNutritionalAssessment populateDataFromScreen() { MiniNutritionalAssessment record = super.populateDataFromScreen(); Object hcpLite = domain.getHcpLiteUser(); record.setHcpInitiated(hcpLite != null ? ((HcpLiteVo) hcpLite) : null); record.setDateTimeInitiated(new DateTime(form.dteDate().getValue(), form.timTime().getValue())); return record; }
protected MiniNutritionalAssessment populateDataFromScreen(MiniNutritionalAssessment value) { MiniNutritionalAssessment record = super.populateDataFromScreen(value); record.setDateTimeInitiated(new DateTime(form.dteDate().getValue(), form.timTime().getValue())); return record; }
/** * get MiniNutritionalAssessment Record */ public ims.nursing.vo.MiniNutritionalAssessment getRecord(Integer recordID) { DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment domAssess = (ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment)factory.getDomainObject(ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment.class, recordID); return(MiniNutritionalAssessmentAssembler.create(domAssess)); }
/** * check if Part of Eating Assessment */ public Boolean isPartOfEatingAssessment(MiniNutritionalAssessment mnaRecord) throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment domMna = MiniNutritionalAssessmentAssembler.extractMiniNutritionalAssessment(factory, mnaRecord); java.util.List mnas = factory.find("from EatingComponent E where E.miniNutritionalAssessment = :mna", "mna", domMna); if(mnas == null || mnas.size() == 0) return Boolean.FALSE; return Boolean.TRUE; }
public MnaEnhancedVo saveAll(MnaEnhancedVo mnaEnhancedRecordVo, CareContextShortVo careContext) throws DomainInterfaceException,StaleObjectException, UniqueKeyViolationException { // Ensure the Value Object was validated if (!mnaEnhancedRecordVo.isValidated()) throw new DomainRuntimeException("This MnaEnhanced VO has not been validated"); VitalSignsVo vs = null; if(mnaEnhancedRecordVo.getVsRecord() != null){ vs = insertMetricsRecord(mnaEnhancedRecordVo.getVsRecord()); if(vs!=null) mnaEnhancedRecordVo.getMnaRecord().setMetrics(vs.getMetrics()); } mnaEnhancedRecordVo.getMnaRecord().validate(); MiniNutritionalAssessment mna = saveRecord(mnaEnhancedRecordVo.getMnaRecord()); AssessmentHeaderInfo headerInfo = null; if(mnaEnhancedRecordVo.getVsRecord() != null) insertMetricsRecord(mnaEnhancedRecordVo.getVsRecord()); if(mnaEnhancedRecordVo.getAedRecord() != null) { mnaEnhancedRecordVo.getAedRecord().setMiniNutritionalAssessment(mna); mnaEnhancedRecordVo.getAedRecord().validate(); headerInfo = saveEatingAssessmentComponent(mnaEnhancedRecordVo.getAshRecord(), mnaEnhancedRecordVo.getAedRecord(), careContext); } mnaEnhancedRecordVo.setMnaRecord(mna); mnaEnhancedRecordVo.setAshRecord(headerInfo); return mnaEnhancedRecordVo; }
protected void populateScreenFromData(MiniNutritionalAssessment value) { super.populateScreenFromData(value); }
@SuppressWarnings("unchecked") private void printReport() { MiniNutritionalAssessment mna = form.cmbRecordToUpdate().getValue(); if (mna == null) return; int nCol = -1; ArrayList ids = form.getLocalContext().getMNAIds(); for (int i = 0; i < ids.size(); i++) { if (mna.getID_Assessment().equals(ids.get(i))) { nCol = i; break; } } if (nCol == -1) { engine.showMessage("Internal error, could not find the MNA record to print !"); return; } String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue(); String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue(); String[] obj = null; try { obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID()); } catch (DomainInterfaceException e) { engine.showMessage("Error retrieving report template !\r\n" + e.getMessage()); return; } if (obj == null || obj.length == 0) { engine.showMessage("I could not get the report and template !"); return; } PatientShort ps = form.getGlobalContext().Core.getPatientShort(); QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId()); client.addSeed(new SeedValue("MNA_ID", mna.getID_Assessment(), Integer.class)); if (ps != null) { ims.core.vo.PatientId id = ps.getDisplayId(); if (id != null) { client.addSeed(new SeedValue("PID", id.getValue(), String.class)); } client.addSeed(new SeedValue("AGE", ps.getAge(), Integer.class)); } addExtraSeeds(nCol, client, mna); String resultUrl = ""; try { resultUrl = client.buildReportAsUrl(obj[0], obj[1], urlReportServer, QueryBuilderClient.PDF, "", 1); } catch (QueryBuilderClientException e1) { engine.showMessage("Error creating report: " + e1.getMessage()); return; } engine.openUrl(resultUrl); }
/** * save MiniNutritionalAssessment Record */ public MiniNutritionalAssessment saveRecord(MiniNutritionalAssessment voMiniNutritionalAssessment) throws DomainInterfaceException, StaleObjectException { // Ensure the Value Object was validated if (!voMiniNutritionalAssessment.isValidated()) throw new DomainRuntimeException("This FallAssessment has not been validated"); DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment domAssessment = MiniNutritionalAssessmentAssembler.extractMiniNutritionalAssessment(factory, voMiniNutritionalAssessment); factory.save(domAssessment); return MiniNutritionalAssessmentAssembler.create(domAssessment); }
public Boolean isPartOfEatingAssessment(MiniNutritionalAssessment mnaRecord) throws DomainInterfaceException { MNAInput impl = (MNAInput) getDomainImpl(MNAInputImpl.class); return impl.isPartOfEatingAssessment(mnaRecord); }