public LastHeightMetricRecordVo getLastRecordedHeight(PatientRefVo patientRef) { if (!patientRef.getID_PatientIsNotNull()) { throw new DomainRuntimeException("Invalid patient provided"); } String hql = "select metr from Metrics as metr left join metr.patient as pat where (pat.id = :patId"+ " and metr.isRIE is null) order by metr.authoringInformation.authoringDateTime desc"; DomainObject dObj = getDomainFactory().findFirst(hql,new String[]{"patId"},new Object[]{patientRef.getID_Patient()}); if (dObj instanceof Metrics) { Metrics x = (Metrics) dObj; LastHeightMetricRecordVo result = new LastHeightMetricRecordVo(); result.setValue(x.getHeightValue()); result.setMeasured(x.isHeightEstimatedMeasured()); return result; } return null; }
public void newInstance() throws PresentationLogicException { form.getLocalContext().setSelectedInstance(null); clearInstanceControls(); form.ccRecording().initializeComponent(true); LastHeightMetricRecordVo lastHeight = domain.getLastRecordedHeight(form.getGlobalContext().Core.getPatientShort()); if (lastHeight != null) { form.decHeight().setValue(lastHeight.getValue()); form.GroupH().setValue(lastHeight.getMeasuredIsNotNull()?(lastHeight.getMeasured().booleanValue()?GroupHEnumeration.rdoHM:GroupHEnumeration.rdoHE):GroupHEnumeration.None); } form.setMode(FormMode.EDIT); }
public void newInstance() throws PresentationLogicException { form.getLocalContext().setSelectedInstance(null); clearInstanceControls(); form.ccRecording().initializeComponent(true, null); //WDEV-18846 LastHeightMetricRecordVo lastHeight = domain.getLastRecordedHeight(form.getGlobalContext().Core.getPatientShort()); if (lastHeight != null) { form.decHeight().setValue(lastHeight.getValue()); form.GroupH().setValue(lastHeight.getMeasuredIsNotNull()?(lastHeight.getMeasured().booleanValue()?GroupHEnumeration.rdoHM:GroupHEnumeration.rdoHE):GroupHEnumeration.None); } form.setMode(FormMode.EDIT); }