private void displayRecord(VitalSignsVo voVitalSign) { clearFields(); form.decBloodSugar().setValue(voVitalSign.getBloodSugar().getBloodSugarValue()); form.dteTaken().setValue(voVitalSign.getVitalsTakenDateTime().getDate()); form.timTaken().setValue(voVitalSign.getVitalsTakenDateTime().getTime()); form.txtHCP().setValue(voVitalSign.getAuthoringInformation().getAuthoringHcp().toString()); if(voVitalSign.getBloodSugar().getType().equals(CBGType.RANDOM)) form.BloodGlucoseGroup().setValue(GenForm.BloodGlucoseGroupEnumeration.rdoRandom); else form.BloodGlucoseGroup().setValue(GenForm.BloodGlucoseGroupEnumeration.rdoCBGM); if(voVitalSign.getBloodSugar().getTimePeriodIsNotNull()) form.cmbTimePeriod().setValue(voVitalSign.getBloodSugar().getTimePeriod()); if(voVitalSign.getBloodSugar().getPostBloodSugarValueIsNotNull()) form.decPostValue().setValue(voVitalSign.getBloodSugar().getPostBloodSugarValue()); if(voVitalSign.getBloodSugar().getTimeIntervalIsNotNull()) form.intTimeInterval().setValue(voVitalSign.getBloodSugar().getTimeInterval()); form.btnUpdate().setEnabled(true); showBloodGlucoseControls(voVitalSign.getBloodSugar().getType().equals(CBGType.CBGM)); }
protected void onBtnSaveClick() throws PresentationLogicException { VitalSignsVo voVitalSign = form.getLocalContext().getvitalSign(); VSBloodSugar voBS = new VSBloodSugar(); if(form.BloodGlucoseGroup().getValue().equals(GenForm.BloodGlucoseGroupEnumeration.rdoRandom)) voBS.setType(CBGType.RANDOM); else voBS.setType(CBGType.CBGM); voBS.setBloodSugarValue(form.decBloodSugar().getValue()); voBS.setTimePeriod(form.cmbTimePeriod().getValue()); voBS.setPostBloodSugarValue(form.decPostValue().getValue()); voBS.setTimeInterval(form.intTimeInterval().getValue()); voVitalSign.setBloodSugar(voBS); String[] arrErrors = voVitalSign.validate(); if(arrErrors == null) { try { domain.modifyBloodSugar(voVitalSign); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); refresh(); return; } } else { engine.showErrors("Validation Errors", arrErrors); return; } form.setMode(FormMode.VIEW); listBloodSugar(); form.getLocalContext().setvitalSign(voVitalSign); displayRecord(form.getLocalContext().getvitalSign()); dateIntervalStatus(); enableBloodSugarControls(false); }