Java 类ims.core.vo.DischargedEpisodeVo 实例源码

项目:AvoinApotti    文件:Logic.java   
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission)
{
    if( adtDiscEp != null )
    {
        form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime());
        form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null);
        form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():"");
    }

    if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
    {
        for( int i = 0; i < admission.getTransferHistory().size(); i++ )
        {

            TransferHistoryVo tempVo = admission.getTransferHistory().get(i);
            grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow();
            rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():"");
            rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():"");
            rowW.setValue(tempVo);

        }
    }

}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onGrdDischargesGridHeaderClicked(int column) throws PresentationLogicException 
{
    // WDEV-13136
    // Updated the index for column
    if (column == COL_ACTUAL_DISCHARGE_DATETIME)
    {
        if(form.getLocalContext().getSortOrder() == null)
        {
            form.getLocalContext().setSortOrder(SortOrder.ASCENDING);
        }

        DischargedEpisodeVoCollection voColl = form.grdDischarges().getValues();    
        voColl.sort(DischargedEpisodeVo.getDateTimeComparator(form.getLocalContext().getSortOrder()));

        if(form.getLocalContext().getSortOrder().equals(SortOrder.ASCENDING))
            form.getLocalContext().setSortOrder(SortOrder.DESCENDING);
        else if(form.getLocalContext().getSortOrder().equals(SortOrder.DESCENDING))
            form.getLocalContext().setSortOrder(SortOrder.ASCENDING);

        form.grdDischarges().getRows().clear();
        populateGrid(voColl);
    }

}
项目:AvoinApotti    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo getDischargeEpisodeByAdmissionDetail(AdmissionDetailRefVo admDetRef)
{
    if( admDetRef == null )
        throw new CodingRuntimeException("AdmissionDetailRefVo is null");



    DomainFactory factory = getDomainFactory();
    String hql = " select d1_1  from DischargedEpisode as d1_1 left join d1_1.admissionDetail as a1_1 where (d1_1.admissionDetail.id = :idAdmissionDet ) order by d1_1.systemInformation.creationDateTime desc ";
    List<?> lst = factory.find(hql,new String[]{"idAdmissionDet"},new Object[]{admDetRef.getID_AdmissionDetail()});
    if (lst != null && lst.size() > 0)
    {
        DischargedEpisodeVoCollection tempColl = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(lst) ;
        if(tempColl != null && tempColl.size() > 0)
        {
            return tempColl.get(0);
        }

    }
    return null;
}
项目:AvoinApotti    文件:DischargeOutcomeFormImpl.java   
public DischargedEpisodeVo dischargePatient(PatientShort patVo, DischargedEpisodeVo dischEpisVo, Boolean bFollowUp) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException
{
    if(patVo == null)
        throw new DomainRuntimeException("Invalid PatientShort to save");
    if(!patVo.isValidated())
        throw new DomainRuntimeException("PatientShort Record not validated before save");
    if(dischEpisVo == null)
        throw new DomainRuntimeException("Invalid DischargedEpisodeVo to save");
    if(!dischEpisVo.isValidated())
        throw new DomainRuntimeException("DischargedEpisodeVo Record not validated before save");

    ADT implADT = (ADT)getDomainImpl(ADTImpl.class);
    implADT.dischargePatient(patVo, dischEpisVo,null);

    return null;
}
项目:AvoinApotti    文件:Logic.java   
private void loadDischargedEpisode()
{
    DischargedEpisodeVo voDischargedEpisode = domain.getDischargedEpisodeDetails(form.getGlobalContext().Core.getCurrentCareContext(), form.getGlobalContext().Core.getPatientShort());
    if (voDischargedEpisode != null)
    {
        form.cmbDischMethod().setValue(voDischargedEpisode.getMethodOfDischarge());
        form.cmbDischDest().setValue(voDischargedEpisode.getDischargeDestination());
        form.dtimDODisch().setValue(voDischargedEpisode.getDischargeDateTime());
        if (voDischargedEpisode.getPasEventIsNotNull())
        {
            HcpLiteVo completingHcp = domain.getHcp(voDischargedEpisode.getPasEvent().getConsultant());
            form.cmbDischCons().newRow(completingHcp, completingHcp.getName().toString());
            form.cmbDischCons().setValue(completingHcp);
        }
        form.cmbDischSpec().setValue(voDischargedEpisode.getPasEventIsNotNull() ? voDischargedEpisode.getPasEvent().getSpecialty() : null);
        if (voDischargedEpisode.getPasEventIsNotNull()
            && voDischargedEpisode.getPasEvent().getLocationIsNotNull())
        {
            form.cmbDischWard().newRow(voDischargedEpisode.getPasEvent().getLocation(), voDischargedEpisode.getPasEvent().getLocation().getName());
            form.cmbDischWard().setValue(voDischargedEpisode.getPasEvent().getLocation());
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission)
{
    if( adtDiscEp != null )
    {
        form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime());
        form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null);
        form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():"");
    }

    if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
    {
        for( int i = 0; i < admission.getTransferHistory().size(); i++ )
        {

            TransferHistoryVo tempVo = admission.getTransferHistory().get(i);
            grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow();
            rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():"");
            rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():"");
            rowW.setValue(tempVo);

        }
    }

}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdDischargesGridHeaderClicked(int column) throws PresentationLogicException 
{
    // WDEV-13136
    // Updated the index for column
    if (column == COL_ACTUAL_DISCHARGE_DATETIME)
    {
        if(form.getLocalContext().getSortOrder() == null)
        {
            form.getLocalContext().setSortOrder(SortOrder.ASCENDING);
        }

        DischargedEpisodeVoCollection voColl = form.grdDischarges().getValues();    
        voColl.sort(DischargedEpisodeVo.getDateTimeComparator(form.getLocalContext().getSortOrder()));

        if(form.getLocalContext().getSortOrder().equals(SortOrder.ASCENDING))
            form.getLocalContext().setSortOrder(SortOrder.DESCENDING);
        else if(form.getLocalContext().getSortOrder().equals(SortOrder.DESCENDING))
            form.getLocalContext().setSortOrder(SortOrder.ASCENDING);

        form.grdDischarges().getRows().clear();
        populateGrid(voColl);
    }

}
项目:openMAXIMS    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo getDischargeEpisodeByAdmissionDetail(AdmissionDetailRefVo admDetRef)
{
    if( admDetRef == null )
        throw new CodingRuntimeException("AdmissionDetailRefVo is null");



    DomainFactory factory = getDomainFactory();
    String hql = " select d1_1  from DischargedEpisode as d1_1 left join d1_1.admissionDetail as a1_1 where (d1_1.admissionDetail.id = :idAdmissionDet ) order by d1_1.systemInformation.creationDateTime desc ";
    List<?> lst = factory.find(hql,new String[]{"idAdmissionDet"},new Object[]{admDetRef.getID_AdmissionDetail()});
    if (lst != null && lst.size() > 0)
    {
        DischargedEpisodeVoCollection tempColl = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(lst) ;
        if(tempColl != null && tempColl.size() > 0)
        {
            return tempColl.get(0);
        }

    }
    return null;
}
项目:openMAXIMS    文件:DischargeOutcomeFormImpl.java   
public DischargedEpisodeVo dischargePatient(PatientShort patVo, DischargedEpisodeVo dischEpisVo, Boolean bFollowUp) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException
{
    if(patVo == null)
        throw new DomainRuntimeException("Invalid PatientShort to save");
    if(!patVo.isValidated())
        throw new DomainRuntimeException("PatientShort Record not validated before save");
    if(dischEpisVo == null)
        throw new DomainRuntimeException("Invalid DischargedEpisodeVo to save");
    if(!dischEpisVo.isValidated())
        throw new DomainRuntimeException("DischargedEpisodeVo Record not validated before save");

    ADT implADT = (ADT)getDomainImpl(ADTImpl.class);
    implADT.dischargePatient(patVo, dischEpisVo,null);

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void loadDischargedEpisode()
{
    DischargedEpisodeVo voDischargedEpisode = domain.getDischargedEpisodeDetails(form.getGlobalContext().Core.getCurrentCareContext(), form.getGlobalContext().Core.getPatientShort());
    if (voDischargedEpisode != null)
    {
        form.cmbDischMethod().setValue(voDischargedEpisode.getMethodOfDischarge());
        form.cmbDischDest().setValue(voDischargedEpisode.getDischargeDestination());
        form.dtimDODisch().setValue(voDischargedEpisode.getDischargeDateTime());
        if (voDischargedEpisode.getPasEventIsNotNull())
        {
            HcpLiteVo completingHcp = domain.getHcp(voDischargedEpisode.getPasEvent().getConsultant());
            form.cmbDischCons().newRow(completingHcp, completingHcp.getName().toString());
            form.cmbDischCons().setValue(completingHcp);
        }
        form.cmbDischSpec().setValue(voDischargedEpisode.getPasEventIsNotNull() ? voDischargedEpisode.getPasEvent().getSpecialty() : null);
        if (voDischargedEpisode.getPasEventIsNotNull()
            && voDischargedEpisode.getPasEvent().getLocationIsNotNull())
        {
            form.cmbDischWard().newRow(voDischargedEpisode.getPasEvent().getLocation(), voDischargedEpisode.getPasEvent().getLocation().getName());
            form.cmbDischWard().setValue(voDischargedEpisode.getPasEvent().getLocation());
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission)
{
    if( adtDiscEp != null )
    {
        form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime());
        form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null);
        form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():"");
    }

    if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
    {
        for( int i = 0; i < admission.getTransferHistory().size(); i++ )
        {

            TransferHistoryVo tempVo = admission.getTransferHistory().get(i);
            grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow();
            rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():"");
            rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():"");
            rowW.setValue(tempVo);

        }
    }

}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdDischargesGridHeaderClicked(int column) throws PresentationLogicException 
{
    // WDEV-13136
    // Updated the index for column
    if (column == COL_ACTUAL_DISCHARGE_DATETIME)
    {
        if(form.getLocalContext().getSortOrder() == null)
        {
            form.getLocalContext().setSortOrder(SortOrder.ASCENDING);
        }

        DischargedEpisodeVoCollection voColl = form.grdDischarges().getValues();    
        voColl.sort(DischargedEpisodeVo.getDateTimeComparator(form.getLocalContext().getSortOrder()));

        if(form.getLocalContext().getSortOrder().equals(SortOrder.ASCENDING))
            form.getLocalContext().setSortOrder(SortOrder.DESCENDING);
        else if(form.getLocalContext().getSortOrder().equals(SortOrder.DESCENDING))
            form.getLocalContext().setSortOrder(SortOrder.ASCENDING);

        form.grdDischarges().getRows().clear();
        populateGrid(voColl);
    }

}
项目:openMAXIMS    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo getDischargeEpisodeByAdmissionDetail(AdmissionDetailRefVo admDetRef)
{
    if( admDetRef == null )
        throw new CodingRuntimeException("AdmissionDetailRefVo is null");



    DomainFactory factory = getDomainFactory();
    String hql = " select d1_1  from DischargedEpisode as d1_1 left join d1_1.admissionDetail as a1_1 where (d1_1.admissionDetail.id = :idAdmissionDet ) order by d1_1.systemInformation.creationDateTime desc ";
    List<?> lst = factory.find(hql,new String[]{"idAdmissionDet"},new Object[]{admDetRef.getID_AdmissionDetail()});
    if (lst != null && lst.size() > 0)
    {
        DischargedEpisodeVoCollection tempColl = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(lst) ;
        if(tempColl != null && tempColl.size() > 0)
        {
            return tempColl.get(0);
        }

    }
    return null;
}
项目:openMAXIMS    文件:DischargeOutcomeFormImpl.java   
public DischargedEpisodeVo dischargePatient(PatientShort patVo, DischargedEpisodeVo dischEpisVo, Boolean bFollowUp) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException
{
    if(patVo == null)
        throw new DomainRuntimeException("Invalid PatientShort to save");
    if(!patVo.isValidated())
        throw new DomainRuntimeException("PatientShort Record not validated before save");
    if(dischEpisVo == null)
        throw new DomainRuntimeException("Invalid DischargedEpisodeVo to save");
    if(!dischEpisVo.isValidated())
        throw new DomainRuntimeException("DischargedEpisodeVo Record not validated before save");

    ADT implADT = (ADT)getDomainImpl(ADTImpl.class);
    implADT.dischargePatient(patVo, dischEpisVo,null);

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void loadDischargedEpisode()
{
    DischargedEpisodeVo voDischargedEpisode = domain.getDischargedEpisodeDetails(form.getGlobalContext().Core.getCurrentCareContext(), form.getGlobalContext().Core.getPatientShort());
    if (voDischargedEpisode != null)
    {
        form.cmbDischMethod().setValue(voDischargedEpisode.getMethodOfDischarge());
        form.cmbDischDest().setValue(voDischargedEpisode.getDischargeDestination());
        form.dtimDODisch().setValue(voDischargedEpisode.getDischargeDateTime());
        if (voDischargedEpisode.getPasEventIsNotNull())
        {
            HcpLiteVo completingHcp = domain.getHcp(voDischargedEpisode.getPasEvent().getConsultant());
            form.cmbDischCons().newRow(completingHcp, completingHcp.getName().toString());
            form.cmbDischCons().setValue(completingHcp);
        }
        form.cmbDischSpec().setValue(voDischargedEpisode.getPasEventIsNotNull() ? voDischargedEpisode.getPasEvent().getSpecialty() : null);
        if (voDischargedEpisode.getPasEventIsNotNull()
            && voDischargedEpisode.getPasEvent().getLocationIsNotNull())
        {
            form.cmbDischWard().newRow(voDischargedEpisode.getPasEvent().getLocation(), voDischargedEpisode.getPasEvent().getLocation().getName());
            form.cmbDischWard().setValue(voDischargedEpisode.getPasEvent().getLocation());
        }
    }
}
项目:openMAXIMS    文件:EDischargePatientReadyToLeaveSTHKComponentImpl.java   
public DischargedEpisodeVo getDischargedEpisodeDetails(CareContextRefVo ccRefVo, PatientRefVo voPatRefVo)
{
    DomainFactory factory = getDomainFactory();
    CareContextVo voCC = CareContextVoAssembler.create((CareContext)factory.getDomainObject(CareContext.class, ccRefVo.getID_CareContext()));

    if (voCC.getPasEvent() == null)
    {
        return null;
    }

    String hql = "from DischargedEpisode de " + 
    " where de.pasEvent.patient.id = :patId " + 
    " and de.pasEvent.id = :eventId ";

    ArrayList<String> labels = new ArrayList<String>();
    labels.add("patId");
    labels.add("eventId");

    ArrayList<Object> values = new ArrayList<Object>();
    values.add(voPatRefVo.getID_Patient());
    values.add(voCC.getPasEvent().getID_PASEvent());

    List<?> l = factory.find(hql, labels, values);      
    if (l != null && l.size() > 0)
    {
        if (l.size() > 1)
            throw new DomainRuntimeException("Duplicate data found for Patient and PasEvent");

        DischargedEpisodeVoCollection  voColl = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(l);
        return voColl.get(0);
    }
    return null;
}
项目:openmaxims-linux    文件:Logic.java   
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission)
{
    if( adtDiscEp != null )
    {
        form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime());
        form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null);
        form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():"");
    }

    if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
    {
        for( int i = 0; i < admission.getTransferHistory().size(); i++ )
        {

            TransferHistoryVo tempVo = admission.getTransferHistory().get(i);
            grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow();
            rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():"");
            rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():"");
            rowW.setValue(tempVo);

        }
    }

}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onGrdDischargesGridHeaderClicked(int column) throws PresentationLogicException 
{
    // WDEV-13136
    // Updated the index for column
    if (column == COL_ACTUAL_DISCHARGE_DATETIME)
    {
        if(form.getLocalContext().getSortOrder() == null)
        {
            form.getLocalContext().setSortOrder(SortOrder.ASCENDING);
        }

        DischargedEpisodeVoCollection voColl = form.grdDischarges().getValues();    
        voColl.sort(DischargedEpisodeVo.getDateTimeComparator(form.getLocalContext().getSortOrder()));

        if(form.getLocalContext().getSortOrder().equals(SortOrder.ASCENDING))
            form.getLocalContext().setSortOrder(SortOrder.DESCENDING);
        else if(form.getLocalContext().getSortOrder().equals(SortOrder.DESCENDING))
            form.getLocalContext().setSortOrder(SortOrder.ASCENDING);

        form.grdDischarges().getRows().clear();
        populateGrid(voColl);
    }

}
项目:openmaxims-linux    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo getDischargeEpisodeByAdmissionDetail(AdmissionDetailRefVo admDetRef)
{
    if( admDetRef == null )
        throw new CodingRuntimeException("AdmissionDetailRefVo is null");



    DomainFactory factory = getDomainFactory();
    String hql = " select d1_1  from DischargedEpisode as d1_1 left join d1_1.admissionDetail as a1_1 where (d1_1.admissionDetail.id = :idAdmissionDet ) order by d1_1.systemInformation.creationDateTime desc ";
    List<?> lst = factory.find(hql,new String[]{"idAdmissionDet"},new Object[]{admDetRef.getID_AdmissionDetail()});
    if (lst != null && lst.size() > 0)
    {
        DischargedEpisodeVoCollection tempColl = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(lst) ;
        if(tempColl != null && tempColl.size() > 0)
        {
            return tempColl.get(0);
        }

    }
    return null;
}
项目:openmaxims-linux    文件:Logic.java   
private void loadDischargedEpisode()
{
    DischargedEpisodeVo voDischargedEpisode = domain.getDischargedEpisodeDetails(form.getGlobalContext().Core.getCurrentCareContext(), form.getGlobalContext().Core.getPatientShort());
    if (voDischargedEpisode != null)
    {
        form.cmbDischMethod().setValue(voDischargedEpisode.getMethodOfDischarge());
        form.cmbDischDest().setValue(voDischargedEpisode.getDischargeDestination());
        form.dtimDODisch().setValue(voDischargedEpisode.getDischargeDateTime());
        if (voDischargedEpisode.getPasEventIsNotNull())
        {
            HcpLiteVo completingHcp = domain.getHcp(voDischargedEpisode.getPasEvent().getConsultant());
            form.cmbDischCons().newRow(completingHcp, completingHcp.getName().toString());
            form.cmbDischCons().setValue(completingHcp);
        }
        form.cmbDischSpec().setValue(voDischargedEpisode.getPasEventIsNotNull() ? voDischargedEpisode.getPasEvent().getSpecialty() : null);
        if (voDischargedEpisode.getPasEventIsNotNull()
            && voDischargedEpisode.getPasEvent().getLocationIsNotNull())
        {
            form.cmbDischWard().newRow(voDischargedEpisode.getPasEvent().getLocation(), voDischargedEpisode.getPasEvent().getLocation().getName());
            form.cmbDischWard().setValue(voDischargedEpisode.getPasEvent().getLocation());
        }
    }
}
项目:AvoinApotti    文件:ADTImpl.java   
private DischargedEpisode getCurrentDischargeRecord(DomainFactory factory, PatientShort patVo, DischargedEpisodeVo dischEpisVo)
{
    ims.core.patient.domain.objects.Patient domPatient = (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patVo.getID_Patient().intValue());
    DischargedEpisode disEpisBo = DischargedEpisodeVoAssembler.extractDischargedEpisode(factory, dischEpisVo);
    PASEvent peDo = disEpisBo.getPasEvent();        


    String hql = "from DischargedEpisode de " + 
                " where de.pasEvent.patient = :pat " + 
                " and de.pasEvent.pasEventId = :eventId ";

    ArrayList<String> labels = new ArrayList<String>();
    labels.add("pat");
    labels.add("eventId");

    ArrayList<Object> values = new ArrayList<Object>();
    values.add(domPatient);
    values.add(peDo.getPasEventId());
    if (disEpisBo.getDischargeDateTime() != null)
    {
        hql +=" and de.dischargeDateTime = :disDate";
        labels.add("disDate");
        values.add(disEpisBo.getDischargeDateTime());
    }
    List<?> l = factory.find(hql, labels, values);      
    if (l != null && l.size() > 0)
    {
        if (l.size() > 1)
            throw new DomainRuntimeException("Duplicate data found for Patient, PasEvent and DateTime");

        return (DischargedEpisode) l.get(0);
    }

    return null;
}
项目:AvoinApotti    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo saveRecord(DischargedEpisodeVo record, PatientShort patient, CareContextInterfaceVo careContext) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException
{
    ADT Adt = (ADT)getDomainImpl(ADTImpl.class);
    if( patient != null)
        patient.validate();

    return Adt.dischargePatient(patient, record, careContext);
}
项目:AvoinApotti    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo getDischargeEpisodeById(DischargedEpisodeRefVo dischargeEpisodeRef)
{
    if( dischargeEpisodeRef == null)
        throw new CodingRuntimeException("This DischargedEpisodeRefVo is null");

    DomainFactory factory = getDomainFactory();
    DischargedEpisode doDischargedEpisode = (DischargedEpisode) factory.getDomainObject(DischargedEpisode.class, dischargeEpisodeRef.getID_DischargedEpisode());

    return DischargedEpisodeVoAssembler.create(doDischargedEpisode);
}
项目:AvoinApotti    文件:AdtDischargeDialogImpl.java   
public void dischargePatient(PatientShort patient, DischargedEpisodeVo discharge) throws DomainInterfaceException, StaleObjectException
{
    ADT adt = (ADT)getDomainImpl(ADTImpl.class);
    try
    {
        adt.dischargePatient(patient, discharge, null);
    }
    catch (ForeignKeyViolationException e)
    {
        throw new DomainInterfaceException(e);
    }

}
项目:AvoinApotti    文件:ReferralCodingImpl.java   
public DischargeAndPASEventForReferralCodingVoCollection listPASEvents(CatsReferralRefVo voCatsReferralRef) 
    {
        if (ConfigFlag.DOM.REFERRAL_CODING_SOURCE.getValue().equals(REFERRAL_CODING_SOURCE_DISCHARGE))
        {
            DomainFactory factory = getDomainFactory();

            String hql = "SELECT dspw from DischargeSummaryPacuAndWard dspw where dspw.catsReferral.id = :catsId";

            ArrayList<String> markers = new ArrayList<String>();
            ArrayList<Object> values = new ArrayList<Object>();

            markers.add("catsId");
            values.add(voCatsReferralRef.getID_CatsReferral());

            return DischargeAndPASEventForReferralCodingVoAssembler.createDischargeAndPASEventForReferralCodingVoCollectionFromDischargeSummaryPacuAndWard(factory.find(hql,markers,values)).sort();
        }
        else if (ConfigFlag.DOM.REFERRAL_CODING_SOURCE.getValue().equals(REFERRAL_CODING_SOURCE_ADMISSIONS))
        {
            String query = "SELECT de FROM CatsReferral AS ref LEFT JOIN ref.admissions AS adm, DischargedEpisode AS de RIGHT JOIN de.admissionDetail AS addet WHERE addet.id = adm.id AND ref.id = :CATS_ID AND de is not null";
            DischargedEpisodeVoCollection dischargedEpisodes = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(getDomainFactory().find(query, "CATS_ID", voCatsReferralRef.getID_CatsReferral()));

            DischargeAndPASEventForReferralCodingVoCollection results = new DischargeAndPASEventForReferralCodingVoCollection();

            for (DischargedEpisodeVo episode : dischargedEpisodes)
            {
                DischargeAndPASEventForReferralCodingVo result = new DischargeAndPASEventForReferralCodingVo();

                result.setCatsReferral(voCatsReferralRef);
                result.setDischargeEpisode(episode);
//              result.setDischargeDateTime(episode.getDischargeDateTime());

                results.add(result);
            }

            return results;
        }

        return null;
    }
项目:AvoinApotti    文件:DischargeSummaryWardPacuImpl.java   
public DischargedEpisodeVo getDischargedEpisode(DischargedEpisodeRefVo dischargedEpisodeRef)
{
    if (dischargedEpisodeRef == null || !dischargedEpisodeRef.getID_DischargedEpisodeIsNotNull())
        return null;

    return DischargedEpisodeVoAssembler.create((DischargedEpisode) getDomainFactory().getDomainObject(DischargedEpisode.class, dischargedEpisodeRef.getID_DischargedEpisode())); 
}
项目:AvoinApotti    文件:EDischargePatientReadyToLeaveSTHKComponentImpl.java   
public DischargedEpisodeVo getDischargedEpisodeDetails(CareContextRefVo ccRefVo, PatientRefVo voPatRefVo)
{
    DomainFactory factory = getDomainFactory();
    CareContextVo voCC = CareContextVoAssembler.create((CareContext)factory.getDomainObject(CareContext.class, ccRefVo.getID_CareContext()));

    if (voCC.getPasEvent() == null)
    {
        return null;
    }

    String hql = "from DischargedEpisode de " + 
    " where de.pasEvent.patient.id = :patId " + 
    " and de.pasEvent.id = :eventId ";

    ArrayList<String> labels = new ArrayList<String>();
    labels.add("patId");
    labels.add("eventId");

    ArrayList<Object> values = new ArrayList<Object>();
    values.add(voPatRefVo.getID_Patient());
    values.add(voCC.getPasEvent().getID_PASEvent());

    List<?> l = factory.find(hql, labels, values);      
    if (l != null && l.size() > 0)
    {
        if (l.size() > 1)
            throw new DomainRuntimeException("Duplicate data found for Patient and PasEvent");

        DischargedEpisodeVoCollection  voColl = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(l);
        return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:ADTImpl.java   
private DischargedEpisode getCurrentDischargeRecord(DomainFactory factory, PatientShort patVo, DischargedEpisodeVo dischEpisVo)
{
    ims.core.patient.domain.objects.Patient domPatient = (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patVo.getID_Patient().intValue());
    DischargedEpisode disEpisBo = DischargedEpisodeVoAssembler.extractDischargedEpisode(factory, dischEpisVo);
    PASEvent peDo = disEpisBo.getPasEvent();        


    String hql = "from DischargedEpisode de " + 
                " where de.pasEvent.patient = :pat " + 
                " and de.pasEvent.pasEventId = :eventId ";

    ArrayList<String> labels = new ArrayList<String>();
    labels.add("pat");
    labels.add("eventId");

    ArrayList<Object> values = new ArrayList<Object>();
    values.add(domPatient);
    values.add(peDo.getPasEventId());
    if (disEpisBo.getDischargeDateTime() != null)
    {
        hql +=" and de.dischargeDateTime = :disDate";
        labels.add("disDate");
        values.add(disEpisBo.getDischargeDateTime());
    }
    List<?> l = factory.find(hql, labels, values);      
    if (l != null && l.size() > 0)
    {
        if (l.size() > 1)
            throw new DomainRuntimeException("Duplicate data found for Patient, PasEvent and DateTime");

        return (DischargedEpisode) l.get(0);
    }

    return null;
}
项目:openMAXIMS    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo saveRecord(DischargedEpisodeVo record, PatientShort patient, CareContextInterfaceVo careContext) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException
{
    ADT Adt = (ADT)getDomainImpl(ADTImpl.class);
    if( patient != null)
        patient.validate();

    return Adt.dischargePatient(patient, record, careContext);
}
项目:openMAXIMS    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo getDischargeEpisodeById(DischargedEpisodeRefVo dischargeEpisodeRef)
{
    if( dischargeEpisodeRef == null)
        throw new CodingRuntimeException("This DischargedEpisodeRefVo is null");

    DomainFactory factory = getDomainFactory();
    DischargedEpisode doDischargedEpisode = (DischargedEpisode) factory.getDomainObject(DischargedEpisode.class, dischargeEpisodeRef.getID_DischargedEpisode());

    return DischargedEpisodeVoAssembler.create(doDischargedEpisode);
}
项目:openMAXIMS    文件:AdtDischargeDialogImpl.java   
public void dischargePatient(PatientShort patient, DischargedEpisodeVo discharge) throws DomainInterfaceException, StaleObjectException
{
    ADT adt = (ADT)getDomainImpl(ADTImpl.class);
    try
    {
        adt.dischargePatient(patient, discharge, null);
    }
    catch (ForeignKeyViolationException e)
    {
        throw new DomainInterfaceException(e);
    }

}
项目:openMAXIMS    文件:ReferralCodingImpl.java   
public DischargeAndPASEventForReferralCodingVoCollection listPASEvents(CatsReferralRefVo voCatsReferralRef)
{
    if (ConfigFlag.DOM.REFERRAL_CODING_SOURCE.getValue().equals(REFERRAL_CODING_SOURCE_DISCHARGE))
    {
        DomainFactory factory = getDomainFactory();

        String hql = "SELECT dspw from DischargeSummaryPacuAndWard dspw where dspw.catsReferral.id = :catsId";

        ArrayList<String> markers = new ArrayList<String>();
        ArrayList<Object> values = new ArrayList<Object>();

        markers.add("catsId");
        values.add(voCatsReferralRef.getID_CatsReferral());

        return DischargeAndPASEventForReferralCodingVoAssembler.createDischargeAndPASEventForReferralCodingVoCollectionFromDischargeSummaryPacuAndWard(factory.find(hql, markers, values)).sort();
    }
    else if (ConfigFlag.DOM.REFERRAL_CODING_SOURCE.getValue().equals(REFERRAL_CODING_SOURCE_ADMISSIONS))
    {
        String query = "SELECT de FROM CatsReferral AS ref LEFT JOIN ref.admissions AS adm, DischargedEpisode AS de RIGHT JOIN de.admissionDetail AS addet WHERE addet.id = adm.id AND ref.id = :CATS_ID AND de is not null";
        DischargedEpisodeVoCollection dischargedEpisodes = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(getDomainFactory().find(query, "CATS_ID", voCatsReferralRef.getID_CatsReferral()));

        DischargeAndPASEventForReferralCodingVoCollection results = new DischargeAndPASEventForReferralCodingVoCollection();

        for (DischargedEpisodeVo episode : dischargedEpisodes)
        {
            DischargeAndPASEventForReferralCodingVo result = new DischargeAndPASEventForReferralCodingVo();

            result.setCatsReferral(voCatsReferralRef);
            result.setDischargeEpisode(episode);
            result.setDischargeDateTime(episode.getDischargeDateTime());

            results.add(result);
        }

        return results;
    }

    return null;
}
项目:openMAXIMS    文件:DischargeSummaryWardPacuImpl.java   
public DischargedEpisodeVo getDischargedEpisode(DischargedEpisodeRefVo dischargedEpisodeRef)
{
    if (dischargedEpisodeRef == null || !dischargedEpisodeRef.getID_DischargedEpisodeIsNotNull())
        return null;

    return DischargedEpisodeVoAssembler.create((DischargedEpisode) getDomainFactory().getDomainObject(DischargedEpisode.class, dischargedEpisodeRef.getID_DischargedEpisode())); 
}
项目:openMAXIMS    文件:EDischargePatientReadyToLeaveSTHKComponentImpl.java   
public DischargedEpisodeVo getDischargedEpisodeDetails(CareContextRefVo ccRefVo, PatientRefVo voPatRefVo)
{
    DomainFactory factory = getDomainFactory();
    CareContextVo voCC = CareContextVoAssembler.create((CareContext)factory.getDomainObject(CareContext.class, ccRefVo.getID_CareContext()));

    if (voCC.getPasEvent() == null)
    {
        return null;
    }

    String hql = "from DischargedEpisode de " + 
    " where de.pasEvent.patient.id = :patId " + 
    " and de.pasEvent.id = :eventId ";

    ArrayList<String> labels = new ArrayList<String>();
    labels.add("patId");
    labels.add("eventId");

    ArrayList<Object> values = new ArrayList<Object>();
    values.add(voPatRefVo.getID_Patient());
    values.add(voCC.getPasEvent().getID_PASEvent());

    List<?> l = factory.find(hql, labels, values);      
    if (l != null && l.size() > 0)
    {
        if (l.size() > 1)
            throw new DomainRuntimeException("Duplicate data found for Patient and PasEvent");

        DischargedEpisodeVoCollection  voColl = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(l);
        return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:ADTImpl.java   
private DischargedEpisode getCurrentDischargeRecord(DomainFactory factory, PatientShort patVo, DischargedEpisodeVo dischEpisVo)
{
    ims.core.patient.domain.objects.Patient domPatient = (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patVo.getID_Patient().intValue());
    DischargedEpisode disEpisBo = DischargedEpisodeVoAssembler.extractDischargedEpisode(factory, dischEpisVo);
    PASEvent peDo = disEpisBo.getPasEvent();        


    String hql = "from DischargedEpisode de " + 
                " where de.pasEvent.patient = :pat " + 
                " and de.pasEvent.pasEventId = :eventId ";

    ArrayList<String> labels = new ArrayList<String>();
    labels.add("pat");
    labels.add("eventId");

    ArrayList<Object> values = new ArrayList<Object>();
    values.add(domPatient);
    values.add(peDo.getPasEventId());
    if (disEpisBo.getDischargeDateTime() != null)
    {
        hql +=" and de.dischargeDateTime = :disDate";
        labels.add("disDate");
        values.add(disEpisBo.getDischargeDateTime());
    }
    List<?> l = factory.find(hql, labels, values);      
    if (l != null && l.size() > 0)
    {
        if (l.size() > 1)
            throw new DomainRuntimeException("Duplicate data found for Patient, PasEvent and DateTime");

        return (DischargedEpisode) l.get(0);
    }

    return null;
}
项目:openMAXIMS    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo saveRecord(DischargedEpisodeVo record, PatientShort patient, CareContextInterfaceVo careContext) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException
{
    ADT Adt = (ADT)getDomainImpl(ADTImpl.class);
    if( patient != null)
        patient.validate();

    return Adt.dischargePatient(patient, record, careContext);
}
项目:openMAXIMS    文件:ADTDischargeDetailsComponentImpl.java   
public DischargedEpisodeVo getDischargeEpisodeById(DischargedEpisodeRefVo dischargeEpisodeRef)
{
    if( dischargeEpisodeRef == null)
        throw new CodingRuntimeException("This DischargedEpisodeRefVo is null");

    DomainFactory factory = getDomainFactory();
    DischargedEpisode doDischargedEpisode = (DischargedEpisode) factory.getDomainObject(DischargedEpisode.class, dischargeEpisodeRef.getID_DischargedEpisode());

    return DischargedEpisodeVoAssembler.create(doDischargedEpisode);
}
项目:openMAXIMS    文件:AdtDischargeDialogImpl.java   
public void dischargePatient(PatientShort patient, DischargedEpisodeVo discharge) throws DomainInterfaceException, StaleObjectException
{
    ADT adt = (ADT)getDomainImpl(ADTImpl.class);
    try
    {
        adt.dischargePatient(patient, discharge, null);
    }
    catch (ForeignKeyViolationException e)
    {
        throw new DomainInterfaceException(e);
    }

}
项目:openMAXIMS    文件:ReferralCodingImpl.java   
public DischargeAndPASEventForReferralCodingVoCollection listPASEvents(CatsReferralRefVo voCatsReferralRef) 
    {
        if (ConfigFlag.DOM.REFERRAL_CODING_SOURCE.getValue().equals(REFERRAL_CODING_SOURCE_DISCHARGE))
        {
            DomainFactory factory = getDomainFactory();

            String hql = "SELECT dspw from DischargeSummaryPacuAndWard dspw where dspw.catsReferral.id = :catsId";

            ArrayList<String> markers = new ArrayList<String>();
            ArrayList<Object> values = new ArrayList<Object>();

            markers.add("catsId");
            values.add(voCatsReferralRef.getID_CatsReferral());

            return DischargeAndPASEventForReferralCodingVoAssembler.createDischargeAndPASEventForReferralCodingVoCollectionFromDischargeSummaryPacuAndWard(factory.find(hql,markers,values)).sort();
        }
        else if (ConfigFlag.DOM.REFERRAL_CODING_SOURCE.getValue().equals(REFERRAL_CODING_SOURCE_ADMISSIONS))
        {
            String query = "SELECT de FROM CatsReferral AS ref LEFT JOIN ref.admissions AS adm, DischargedEpisode AS de RIGHT JOIN de.admissionDetail AS addet WHERE addet.id = adm.id AND ref.id = :CATS_ID AND de is not null";
            DischargedEpisodeVoCollection dischargedEpisodes = DischargedEpisodeVoAssembler.createDischargedEpisodeVoCollectionFromDischargedEpisode(getDomainFactory().find(query, "CATS_ID", voCatsReferralRef.getID_CatsReferral()));

            DischargeAndPASEventForReferralCodingVoCollection results = new DischargeAndPASEventForReferralCodingVoCollection();

            for (DischargedEpisodeVo episode : dischargedEpisodes)
            {
                DischargeAndPASEventForReferralCodingVo result = new DischargeAndPASEventForReferralCodingVo();

                result.setCatsReferral(voCatsReferralRef);
                result.setDischargeEpisode(episode);
//              result.setDischargeDateTime(episode.getDischargeDateTime());

                results.add(result);
            }

            return results;
        }

        return null;
    }
项目:openMAXIMS    文件:DischargeSummaryWardPacuImpl.java   
public DischargedEpisodeVo getDischargedEpisode(DischargedEpisodeRefVo dischargedEpisodeRef)
{
    if (dischargedEpisodeRef == null || !dischargedEpisodeRef.getID_DischargedEpisodeIsNotNull())
        return null;

    return DischargedEpisodeVoAssembler.create((DischargedEpisode) getDomainFactory().getDomainObject(DischargedEpisode.class, dischargedEpisodeRef.getID_DischargedEpisode())); 
}