public ims.clinical.vo.RACPPastMedicalHistoryVo saveRACPPastMedicalHistoryVo(ims.clinical.vo.RACPPastMedicalHistoryVo voRACPPastMedicalHistory, VitalSignsVo voVitalSigns, Boolean bUpdateVitalSigns) throws ims.domain.exceptions.StaleObjectException { if (voRACPPastMedicalHistory == null || !voRACPPastMedicalHistory.isValidated()) throw new CodingRuntimeException("Past Medical History is null or has not been validated"); if (voVitalSigns == null || !voVitalSigns.isValidated()) throw new CodingRuntimeException("Vital Signs is null or has not been validated"); DomainFactory factory=getDomainFactory(); if(bUpdateVitalSigns){ VitalSigns doVitalSigns = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns); factory.save(doVitalSigns); } RACPPastMedicalHistory doRACPPastMedicalHistory = RACPPastMedicalHistoryVoAssembler.extractRACPPastMedicalHistory(factory, voRACPPastMedicalHistory); factory.save(doRACPPastMedicalHistory); return RACPPastMedicalHistoryVoAssembler.create(doRACPPastMedicalHistory); }
public VitalSignsVo getVitalSignsForCareContext(CareContextRefVo refVoCareContext) { if (refVoCareContext == null) throw new CodingRuntimeException("Cannot get CareContext for null CareContextRefVo"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from VitalSigns vs where "); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); hql.append(" vs.careContext.id = :ccId"); markers.add("ccId"); values.add(refVoCareContext.getID_CareContext()); hql.append(" order by vs.vitalsTakenDateTime"); List listVitalSigns = factory.find(hql.toString(), markers,values); if(listVitalSigns != null && listVitalSigns.size() > 0) { VitalSignsVoCollection voColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(listVitalSigns); if(voColl != null && voColl.size() > 0) return voColl.get(0); } return null; }
/** * Saves a vital sign */ public ims.core.vo.VitalSignsVo saveVitalSign(ims.core.vo.VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException { if (!vitalSign.isValidated()) { throw new DomainRuntimeException("This Vital Sign has not been validated"); } DomainFactory factory = getDomainFactory(); VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign); try { factory.save(doVitals); return VitalSignsVoAssembler.create(doVitals); } catch (DomainException e) { throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e); } }
public VitalSignsVo saveABGO2Sats(VitalSignsVo voVitalABGO2) throws StaleObjectException { if (!voVitalABGO2.isValidated()) { throw new DomainRuntimeException("This Vital Sign has not been validated"); } DomainFactory factory = getDomainFactory(); VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalABGO2); try { factory.save(doVitals); return VitalSignsVoAssembler.create(doVitals); } catch (DomainException e) { throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e); } }
public VitalSignsVo getVitalSignsById(VitalSignsRefVo vitalSignsRef) { if(vitalSignsRef == null || !vitalSignsRef.getID_VitalSignsIsNotNull()) return null; DomainFactory factory = getDomainFactory(); List vitalSign = factory.find("from VitalSigns as v1_1 where v1_1.id = :idVitalSign", new String[]{"idVitalSign" }, new Object[]{ vitalSignsRef.getID_VitalSigns()}); VitalSignsVoCollection voCollVitalSign = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitalSign); if(voCollVitalSign.size()>0) return voCollVitalSign.get(0); else return null; }
/** * Saves the given ventilationChartRecord */ public VitalSignsVo saveVentilationChartRecord(VitalSignsVo voVitalSigns) throws DomainInterfaceException, StaleObjectException { DomainFactory factory = getDomainFactory(); VitalSigns domVital = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns); domVital.setIsVentilationChartRecord(Boolean.TRUE); factory.save(domVital); return VitalSignsVoAssembler.create(domVital); }
public VitalSignsVo saveVitalSignsForCareContext(VitalSignsVo voVitalSigns) throws StaleObjectException { if (voVitalSigns == null || !voVitalSigns.isValidated()) throw new CodingRuntimeException("Vital Signs is null or has not been validated"); DomainFactory factory=getDomainFactory(); VitalSigns doRACPPastMedicalHistory = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns); factory.save(doRACPPastMedicalHistory); return VitalSignsVoAssembler.create(doRACPPastMedicalHistory); }
public VitalSignsVoCollection listVitalsByCareContext(CareContextLiteVo voCareContext) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = " from VitalSigns vs "; ArrayList markers= new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if(voCareContext.getEpisodeOfCareIsNotNull()) { hql.append(andStr + " vs.careContext.id = :ec"); markers.add("ec"); values.add(voCareContext.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); java.util.List vsList = factory.find(query,markers,values); VitalSignsVoCollection voVitalSignsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vsList); if(voVitalSignsColl.size()>0) return voVitalSignsColl; else return null; }
public VitalSignsVo getVitalSignsByCareContext(CareContextLiteVo voCareContext) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = " from VitalSigns vs "; ArrayList markers= new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if(voCareContext.getEpisodeOfCareIsNotNull()) { hql.append(andStr + " vs.careContext.id = :ec"); markers.add("ec"); values.add(voCareContext.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); java.util.List vsList = factory.find(query,markers,values); VitalSignsVoCollection voVitalSignsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vsList); if(voVitalSignsColl.size()>0) return voVitalSignsColl.get(0); else return null; }
public VitalSignsVo saveVitalSign(VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException { if (!vitalSign.isValidated()) { throw new DomainRuntimeException("This Vital Sign has not been validated"); } DomainFactory factory = getDomainFactory(); VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign); factory.save(doVitals); return VitalSignsVoAssembler.create(doVitals); }
public VitalSignsVoCollection getLastMetrics(Integer idPatient) { if (idPatient == null) return null; DomainFactory factory = getDomainFactory(); StringBuffer filterString = new StringBuffer(); String query = "from VitalSigns vs "; ArrayList markers= new ArrayList(); ArrayList values = new ArrayList(); filterString.append(" vs.careContext.episodeOfCare.careSpell.patient.id = :idPat"); markers.add("idPat"); values.add(idPatient); if (markers.size() > 0) query += " where "; query += filterString.toString(); java.util.List vitals = factory.find(query,markers,values); VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitals); if(voVitalsColl != null && voVitalsColl.size() > 0) { voVitalsColl.sort(SortOrder.DESCENDING); return voVitalsColl; } else return null; }
/** * Generic Save for all Vital Signs */ public VitalSignsVo saveVitalSign(VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException { if (!vitalSign.isValidated()) { throw new DomainRuntimeException("This Vital Sign has not been validated"); } DomainFactory factory = getDomainFactory(); VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign); factory.save(doVitals); return VitalSignsVoAssembler.create(doVitals); }
/** * * Generic List for all Vital Signs By Vital Signs Type * */ public VitalSignsVoCollection listVitalSigns(Date dateFrom, Date dateTo, VSType[] vitalSignsTypes, CareContextRefVo refCareContext) { VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns((List<?>) listVitalSignsDo(dateFrom, dateTo, vitalSignsTypes, refCareContext)); if (vitalSignsTypes == null) // if listing all then sort { voVitalsColl.sort(SortOrder.DESCENDING); } return voVitalsColl; }
/** * Retrieves a list of Metrics, sorts, and returns last record */ public VitalSignsVo getLastMetrics(CareContextRefVo refCareContext) throws DomainInterfaceException { if (refCareContext != null) { DomainFactory factory = getDomainFactory(); String filter = " from VitalSigns vs "; StringBuffer filterString = new StringBuffer(); ArrayList<String> markerNames = new ArrayList<String>(); ArrayList<Object> markerValues = new ArrayList<Object>(); filterString.append(" where vs.careContext.id = :cc"); markerNames.add("cc"); markerValues.add(refCareContext.getID_CareContext()); filter += filterString.toString(); /* Changes made to String below to reflect changes to the VitalSigns Business Object authoringDateTime changes to authoringInformation.authoringDateTime */ filter += " and vs.metrics is not null order by vs.authoringInformation.authoringDateTime desc"; VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(factory.find(filter, markerNames, markerValues)); if (voVitalsColl != null && voVitalsColl.size() > 0) { voVitalsColl.sort(SortOrder.DESCENDING); return voVitalsColl.get(0); } } return null; }
public VitalSignsVo saveABGO2Sats(VitalSignsVo voVitalABGO2) throws StaleObjectException { if (!voVitalABGO2.isValidated()) { throw new DomainRuntimeException("This Vital Sign has not been validated"); } DomainFactory factory = getDomainFactory(); VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalABGO2); factory.save(doVitals); return VitalSignsVoAssembler.create(doVitals); }
/** * * Generic List for all Vital Signs By Vital Signs Type * */ public VitalSignsVoCollection listVitalSigns(Date dateFrom, Date dateTo, VSType[] vitalSignsTypes, CareContextRefVo refCareContext) { java.util.List vitals = listVitalSignsDo(dateFrom, dateTo, vitalSignsTypes, refCareContext); VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitals); if (vitalSignsTypes == null) // if listing all then sort { voVitalsColl.sort(SortOrder.DESCENDING); } return voVitalsColl; }
/** * Retrieves a list of Metrics, sorts, and returns last record */ public VitalSignsVo getLastMetrics(CareContextRefVo refCareContext) throws DomainInterfaceException { if (refCareContext != null) { DomainFactory factory = getDomainFactory(); String filter = " from VitalSigns vs "; StringBuffer filterString = new StringBuffer(); ArrayList markerNames = new ArrayList(); ArrayList markerValues = new ArrayList(); filterString.append(" where vs.careContext.id = :cc"); markerNames.add("cc"); markerValues.add(refCareContext.getID_CareContext()); filter += filterString.toString(); /* Changes made to String below to reflect changes to the VitalSigns Business Object authoringDateTime changes to authoringInformation.authoringDateTime */ filter += " and vs.metrics is not null order by vs.authoringInformation.authoringDateTime desc"; java.util.List vitals = factory.find(filter, markerNames, markerValues); VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitals); if (voVitalsColl != null && voVitalsColl.size() > 0) { voVitalsColl.sort(SortOrder.DESCENDING); return voVitalsColl.get(0); } } return null; }
/** * Lists ventilation chart records for the given episode */ public VitalSignsVoCollection listVentilationCharts(CareContextRefVo refCareContext, ShiftDetailsVo shift) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from VitalSigns vc "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (refCareContext != null) { hql.append(andStr + " vc.careContext.id = :cc"); markers.add("cc"); values.add(refCareContext.getID_CareContext()); andStr = " and "; hql.append(andStr + " vc.isVentilationChartRecord = :record"); markers.add("record"); values.add(Boolean.TRUE); andStr = " and "; } if (shift != null) { hql.append(andStr + " vc.ventilationChart.shiftDetails.id = :shiftId "); markers.add("shiftId"); values.add(shift.getID_ShiftDetails()); andStr = " and "; } if(andStr.equals(" and ")) query += " where"; query += hql.toString(); List lst = factory.find(query, markers, values); VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(lst); return voVitalsColl; }