public DischargeDetailsVo saveDischargeDetails(DischargeDetailsVo voDischargeDetails, SummaryRefVo summaryVo) throws DomainInterfaceException, StaleObjectException { if(voDischargeDetails == null) throw new CodingRuntimeException("DischargeDetailsVo is null"); if(!voDischargeDetails.isValidated()) throw new CodingRuntimeException("DischargeDetailsVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); DischargeDetails doDD = DischargeDetailsVoAssembler.extractDischargeDetails(factory, voDischargeDetails); factory.save(doDD); if (summaryVo != null) { IEDischargeHelper impl = (IEDischargeHelper)getDomainImpl(EDischargeHelper.class); impl.updateSummaryIfRequired(voDischargeDetails, summaryVo, factory); } return DischargeDetailsVoAssembler.create(doDD); }
public DischargeDetailsVo saveDischargeDetails(DischargeDetailsVo discharge) throws StaleObjectException { if(discharge == null) { throw new CodingRuntimeException("DischargeDetailVo is null"); } if (!discharge.isValidated()) { throw new DomainRuntimeException("DischargeDetailVo not validated"); } DomainFactory factory = getDomainFactory(); DischargeDetails doDischargeDetails = DischargeDetailsVoAssembler.extractDischargeDetails(factory, discharge); factory.save(doDischargeDetails); return DischargeDetailsVoAssembler.create(doDischargeDetails); }
public DischargeDetailsVo getDischargeDetailsForCareContext(CareContextRefVo careContext) { if(careContext == null || careContext.getID_CareContext() == null) throw new CodingRuntimeException("CareContext is null or id not provided for getDischargeDetailsForCareContext"); DomainFactory factory = getDomainFactory(); List dischargeDetails = factory.find("select dd from DischargeDetails as dd left join dd.careContext as cc where cc.id = :idCareContext", new String[]{"idCareContext"}, new Object[]{careContext.getID_CareContext()}); DischargeDetailsVoCollection discharge = DischargeDetailsVoAssembler.createDischargeDetailsVoCollectionFromDischargeDetails(dischargeDetails); return discharge != null && discharge.size() > 0 ? (discharge.get(0) != null ? discharge.get(0) : null) : null; }
/** * get Discharge Details */ public ims.clinical.vo.DischargeDetailsVo getDischargeDetails(ims.core.admin.vo.CareContextRefVo careContextRefvo) { if(careContextRefvo == null) throw new CodingRuntimeException("careContextRefVo Filter not provided for list call. "); if(careContextRefvo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from DischargeDetails dd where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " dd.careContext.id = :careContextId"); markers.add("careContextId"); values.add(careContextRefvo.getID_CareContext()); andStr = " and "; List list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { DischargeDetailsVoCollection voColl = DischargeDetailsVoAssembler.createDischargeDetailsVoCollectionFromDischargeDetails(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }
/** * saveDischargeDetails */ public ims.clinical.vo.DischargeDetailsVo saveDischargeDetails(ims.clinical.vo.DischargeDetailsVo voDischargeDetails) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException { if(voDischargeDetails == null) throw new CodingRuntimeException("DischargeDetailsVo is null"); if(!voDischargeDetails.isValidated()) throw new CodingRuntimeException("DischargeDetailsVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); DischargeDetails doDD = DischargeDetailsVoAssembler.extractDischargeDetails(factory, voDischargeDetails); factory.save(doDD); return DischargeDetailsVoAssembler.create(doDD); }
public DischargeDetailsVo getDischargeDetails(CareContextRefVo careContextRefvo) { if(careContextRefvo == null) throw new CodingRuntimeException("careContextRefVo Filter not provided for list call. "); if(careContextRefvo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from DischargeDetails dd where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " dd.careContext.id = :careContextId"); markers.add("careContextId"); values.add(careContextRefvo.getID_CareContext()); andStr = " and "; List list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { DischargeDetailsVoCollection voColl = DischargeDetailsVoAssembler.createDischargeDetailsVoCollectionFromDischargeDetails(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }
public DischargeDetailsVo saveDischargeDetails(DischargeDetailsVo voDischargeDetails) throws DomainInterfaceException, StaleObjectException { if(voDischargeDetails == null) throw new CodingRuntimeException("DischargeDetailsVo is null"); if(!voDischargeDetails.isValidated()) throw new CodingRuntimeException("DischargeDetailsVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); DischargeDetails doDD = DischargeDetailsVoAssembler.extractDischargeDetails(factory, voDischargeDetails); factory.save(doDD); return DischargeDetailsVoAssembler.create(doDD); }
public DischargeSupplementaryNotesVo saveSupplementaryAndDD(DischargeSupplementaryNotesVo voDischSupp, DischargeDetailsVo voDD) throws DomainInterfaceException, StaleObjectException { if(voDischSupp == null) throw new CodingRuntimeException("DischargeSupplementaryNotesVo is null"); if(!voDischSupp.isValidated()) throw new CodingRuntimeException("DischargeSupplementaryNotesVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); DischargeSupplementaryNotes doDSN = DischargeSupplementaryNotesVoAssembler.extractDischargeSupplementaryNotes(factory, voDischSupp); //WDEV-8813 // Workaround for the case when 2 users save in the same time a new DischargeSupplementaryNotesVO //In this case the domain.save call doesn't throw a StaleObjectExeption, even if it is the case if (!voDischSupp.getID_DischargeSupplementaryNotesIsNotNull()) { DischargeSupplementaryNotesVo voDischargeSupp = getSupplementary(voDischSupp.getCareContext()); if (voDischargeSupp!=null) { throw new StaleObjectException(doDSN,"A DischargeSupplementaryNotesVo was already saved by another user"); } } factory.save(doDSN); if (voDD != null) { DischargeDetails doDD = DischargeDetailsVoAssembler.extractDischargeDetails(factory, voDD); factory.save(doDD); } return DischargeSupplementaryNotesVoAssembler.create(doDSN); }
public DischargeDetailsVo saveDischargeDetails(DischargeDetailsVo voDischargeDetails, SummaryRefVo summaryVo, RTLSummaryVo rTLSummary, PatientNoDiagInfoForCCVo patientNoDiagInfo) throws DomainInterfaceException, StaleObjectException { if(voDischargeDetails == null) throw new CodingRuntimeException("DischargeDetailsVo is null"); if(!voDischargeDetails.isValidated()) throw new CodingRuntimeException("DischargeDetailsVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); DischargeDetails doDD = DischargeDetailsVoAssembler.extractDischargeDetails(factory, voDischargeDetails); factory.save(doDD); //WDEV-19685 if (rTLSummary != null) { RTLSummary rTLSummaryDO = RTLSummaryVoAssembler.extractRTLSummary(factory, rTLSummary); factory.save(rTLSummaryDO); } //WDEV-18627 if (patientNoDiagInfo != null) { PatientNoDiagInfoForCC patientNoDiagInfoDo = PatientNoDiagInfoForCCVoAssembler.extractPatientNoDiagInfoForCC(factory, patientNoDiagInfo); factory.save(patientNoDiagInfoDo); } if (summaryVo != null) { IEDischargeHelper impl = (IEDischargeHelper)getDomainImpl(EDischargeHelper.class); impl.updateSummaryIfRequired(voDischargeDetails, summaryVo, factory); } return DischargeDetailsVoAssembler.create(doDD); }
public DischargeDetailsVo saveDischargeDetails(DischargeDetailsVo voDischargeDetails) throws DomainInterfaceException, StaleObjectException { if(voDischargeDetails == null) throw new CodingRuntimeException("DischargeDetailsVo is null"); if(!voDischargeDetails.isValidated()) throw new CodingRuntimeException("DischargeDetailsVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); DischargeDetails doDD = DischargeDetailsVoAssembler.extractDischargeDetails(factory, voDischargeDetails); factory.save(doDD); //WDEV-19871 - create RTLSummary when starting e-Discharge process only if one does not already exist for the care context IEDischargeHelper eDischImpl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class); RTLSummaryVo rtlSummary = eDischImpl.getRTLSummaryForCareContext(voDischargeDetails.getCareContext()); if (voDischargeDetails.getID_DischargeDetails() == null && rtlSummary == null) { rtlSummary = new RTLSummaryVo(); rtlSummary.setCareContext(voDischargeDetails.getCareContext()); RTLSummary rTLSummaryDO = RTLSummaryVoAssembler.extractRTLSummary(factory, rtlSummary); factory.save(rTLSummaryDO); } //WDEV-19871 -- ends here return DischargeDetailsVoAssembler.create(doDD); }