public VSMetrics getMetricsFromPatient(PatientRefVo voPatientRef) { if (voPatientRef == null || voPatientRef.getID_Patient() == null) throw new CodingRuntimeException("Patient not Provided to retrive Metrics record"); DomainFactory factory = getDomainFactory(); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); String query = "SELECT metric FROM Metrics AS metric WHERE metric.patient.id = :ID_PATIENT ORDER BY metric.systemInformation.creationDateTime DESC"; paramNames.add("ID_PATIENT"); paramValues.add(voPatientRef.getID_Patient()); return VSMetricsAssembler.create((Metrics) factory.findFirst(query, paramNames, paramValues)); }
public VSMetricsCollection listMetricsData(PatientRefVo voRefPatient) { DomainFactory factory = getDomainFactory(); String hql= "select metrics from VitalSigns vs where vs.careContext.episodeOfCare.careSpell.patient.id = " + voRefPatient.getID_Patient(); List lstVitalSigns = factory.find(hql); return VSMetricsAssembler.createVSMetricsCollectionFromMetrics(lstVitalSigns).sort(SortOrder.DESCENDING); }
public ims.core.vo.VSMetricsCollection listPatientMetrics(ims.core.patient.vo.PatientRefVo patRef, ims.framework.utils.DateTime dteFrom, ims.framework.utils.DateTime dteTo) { if (!patRef.getID_PatientIsNotNull()) { throw new DomainRuntimeException("Patient provided doesn't have and id"); } String hql = "select me from Metrics as me left join me.patient as pat where"+ "(me.authoringInformation.authoringDateTime between :dteFrom and :dteTo and pat.id = :patId)"; List<?> domObjs = getDomainFactory().find(hql,new String[]{"dteFrom","dteTo","patId"},new Object[]{dteFrom.getJavaDate(),dteTo.getJavaDate(),patRef.getID_Patient()}); if (domObjs == null || domObjs.size()==0) return null; return VSMetricsAssembler.createVSMetricsCollectionFromMetrics(domObjs); }
public ims.core.vo.VSMetrics save(ims.core.vo.VSMetrics metric) throws ims.domain.exceptions.StaleObjectException { if (!metric.isValidated()) { throw new DomainRuntimeException("Metrics provided are not validate"); } DomainFactory df = getDomainFactory(); Metrics metricsBo = VSMetricsAssembler.extractMetrics(df, metric); df.save(metricsBo); return VSMetricsAssembler.create(metricsBo); }
public VSMetrics saveMetricsToPatient(VSMetrics voMetrics) throws StaleObjectException { if(voMetrics == null || !voMetrics.isValidated()) throw new CodingRuntimeException("Metrics record is null or has not been validated"); DomainFactory factory = getDomainFactory(); Metrics doMetrics = VSMetricsAssembler.extractMetrics(factory, voMetrics); factory.save(doMetrics); return VSMetricsAssembler.create(doMetrics); }
/** * get Metrics From Patient */ public ims.core.vo.VSMetrics getMetricsFromPatient(ims.core.patient.vo.PatientRefVo voPatientRef) { if (voPatientRef == null || voPatientRef.getID_Patient() == null) throw new CodingRuntimeException("Patient not Provided to retrive Metrics record"); DomainFactory factory = getDomainFactory(); List metrics = factory.find("from Metrics metric where metric.patient.id = :idPatient order by metric.systemInformation",new String[] {"idPatient"},new Object[] {voPatientRef.getID_Patient()}); if(metrics != null && metrics.size() > 0) return (VSMetricsAssembler.create((Metrics)metrics.get(0))); return null; }
/** * save Metrics To Core Clinical */ public ims.core.vo.VSMetrics saveMetricsToPatient(ims.core.vo.VSMetrics voMetrics) throws ims.domain.exceptions.StaleObjectException { if(voMetrics == null || !voMetrics.isValidated()) throw new CodingRuntimeException("Metrics record is null or has not been validated"); DomainFactory factory = getDomainFactory(); Metrics doMetrics = VSMetricsAssembler.extractMetrics(factory, voMetrics); factory.save(doMetrics); return VSMetricsAssembler.create(doMetrics); }
public VSMetrics getLatestMetricsForPatient(PatientRefVo patient) throws DomainInterfaceException { if (patient == null || patient.getID_Patient() == null) return null; DomainFactory factory = getDomainFactory(); List metrics = factory.find("from Metrics metric where metric.patient.id = :idPatient " + " and (rie is null or rie = 0) order by metric.systemInformation.creationDateTime desc",new String[] {"idPatient"},new Object[] {patient.getID_Patient()}); if(metrics != null && metrics.size() > 0) return (VSMetricsAssembler.create((Metrics)metrics.get(0))); return null; }