示例#1
0
  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);
  }
示例#2
0
  /** 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;
  }
示例#3
0
  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);
  }