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

项目:AvoinApotti    文件:PatientListsImpl.java   
private PasContactVoCollection populatePasContactFromInPatEpisode(InpatientEpisodeVoCollection voColl) 
{
    PasContactVoCollection voCollPasContact = new PasContactVoCollection();

    for (int i = 0; i < voColl.size(); i++)
    {
        InpatientEpisodeVo vo = voColl.get(i);
        PasContactVo voPasContact = new PasContactVo();

        if (vo.getPasEventIsNotNull())
        {
            voPasContact.setAppointmentDateTime(vo.getPasEvent().getEventDateTime());
            voPasContact.setConsultant(vo.getPasEvent().getConsultant());
            voPasContact.setContactNumber(vo.getPasEvent().getID_PASEvent().toString());
            voPasContact.setContactType("Inpatient");
            voPasContact.setDischargeDateTime(vo.getPasEvent().getEventDateTime());
            voPasContact.setDocumentStatus(vo.getPasEvent().getCspDocumentStatus());
            voPasContact.setGPCode(vo.getPasEvent().getReferringGPIsNotNull()?vo.getPasEvent().getReferringGP().getNationalCode():null);
            voPasContact.setLocation(vo.getPasEvent().getLocation());
            voPasContact.setPatient(vo.getPasEvent().getPatient());
            voPasContact.setSpecialty(vo.getPasEvent().getSpecialty());
            voCollPasContact.add(voPasContact);
        }
    }
    return voCollPasContact;
}
项目:AvoinApotti    文件:Logic.java   
public int compare(InpatientEpisodeVo o1, InpatientEpisodeVo o2)
{
    if (o1.getWardStaysIsNotNull() && o1.getWardStays().size() > 1 && o2.getWardStaysIsNotNull() && o2.getWardStays().size() > 1)
    {
        // Sort ward stays
        o1.getWardStays().sort(WardStayVo.getWardStayVoIdComparator());
        o2.getWardStays().sort(WardStayVo.getWardStayVoIdComparator());

        WardStayVo previousStay1 = o1.getWardStays().get(1);
        WardStayVo previousStay2 = o2.getWardStays().get(1);

        return previousStay1.getTransferDateTime().compareTo(previousStay2.getTransferDateTime()) * direction;
    }

    if (o1.getWardStaysIsNotNull() && o1.getWardStays().size() > 1 && (!o2.getWardStaysIsNotNull() || o2.getWardStays().size() <= 1))
    {
        return direction;
    }

    if ((!o1.getWardStaysIsNotNull() || o1.getWardStays().size() <= 1) && o2.getWardStaysIsNotNull() && o2.getWardStays().size() > 1)
    {
        return -1 * direction;
    }

    return 0;
}
项目:AvoinApotti    文件:Logic.java   
/**
 * WDEV-13136
 * Function used to retrieve records (InpatientEpisodes) from grid
 */
private InpatientEpisodeVoCollection populateInpatientRecordsFromGrid()
{
    // Create collection to return
    InpatientEpisodeVoCollection records = new InpatientEpisodeVoCollection();

    // Add each record from grid to collection
    for (int i = 0; i < form.dyngrdPatients().getRows().size(); i++)
    {
        DynamicGridRow row = form.dyngrdPatients().getRows().get(i);

        if (row.getValue() instanceof InpatientEpisodeVo)
            records.add((InpatientEpisodeVo) row.getValue());
    }

    // Return populated records
    return records;
}
项目:AvoinApotti    文件:Logic.java   
private void addEditComment(DynamicGridCell cell)
{
    if (cell != null)
        form.dyngrdPatients().setSelectedRow(cell.getRow());

    if (form.dyngrdPatients().getSelectedRow() != null && form.dyngrdPatients().getSelectedRow().getValue() != null)
    {
        if (form.dyngrdPatients().getSelectedRow().getValue() instanceof PendingTransfersVo)
        {
            PendingTransfersVo voTrans = domain.getCurrentTransferRecord((PendingTransfersVo) form.dyngrdPatients().getSelectedRow().getValue());

            form.getGlobalContext().Core.setCommentDialogString(voTrans.getInpatientEpisodeIsNotNull() ? voTrans.getInpatientEpisode().getComments() : "");
            form.dyngrdPatients().getSelectedRow().setValue(voTrans);
            updateGlobalContextPatientSelection(voTrans);//WDEV-18065 
            engine.open(form.getForms().Core.CommentDialog);
        }
        else if (form.dyngrdPatients().getSelectedRow().getValue() instanceof InpatientEpisodeVo)
        {
            InpatientEpisodeVo voEpis = (InpatientEpisodeVo) form.dyngrdPatients().getSelectedRow().getValue();

            form.getGlobalContext().Core.setCommentDialogString(voEpis.getComments());
            updateGlobalContextPatientSelection(voEpis);//WDEV-18065 
            engine.open(form.getForms().Core.CommentDialog);
        }   
    }
}
项目:AvoinApotti    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    String pdate1 = null;
    String pdate2 = null;
    if(ob1 instanceof InpatientEpisodeVo )
    {
        InpatientEpisodeVo ps1 = (InpatientEpisodeVo)ob1;
        pdate1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().getName() != null) ? ps1.getPasEvent().getPatient().getName().getSurname():null;
    }
    if(ob2 instanceof InpatientEpisodeVo)
    {
        InpatientEpisodeVo ps2 = (InpatientEpisodeVo)ob2;
        pdate2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().getName() != null) ? ps2.getPasEvent().getPatient().getName().getSurname():null;
    }
    if(pdate1 != null )
        return  pdate1.compareToIgnoreCase(pdate2)*direction;
    if(pdate2 != null)
        return (-1)*direction;

    return 0;
}
项目:AvoinApotti    文件:Logic.java   
private void initialise()
{
    InpatientEpisodeVo epis = form.getLocalContext().getInpatEpis();

    form.txtWard().setValue(epis.getPasEvent().getLocation().getName());
    if (epis.getPasEvent().getConsultant() != null)
        form.txtCons().setValue(epis.getPasEvent().getConsultant().getName().toString());
    if (epis.getPasEvent().getSpecialty() != null)
        form.txtSpec().setValue(epis.getPasEvent().getSpecialty().getText());
    LocationLiteVo parentHosp = domain.getParentHospital(epis.getPasEvent().getLocation());
    if (parentHosp != null)
        form.txtHosp().setValue(parentHosp.getName());

    fillHospitalCombo();        
    form.cmbHosp().setValue(parentHosp);
    fillWardCombo();
    form.cmbWard().setValue(epis.getPasEvent().getLocation());
    form.cmbSpec().setValue(epis.getPasEvent().getSpecialty());
}
项目:AvoinApotti    文件:Logic.java   
private void initialise()
{
    InpatientEpisodeVo epis = form.getLocalContext().getInpatEpis();

    form.txtWard().setValue(epis.getPasEvent().getLocation().getName());

    LocationLiteVo parentHosp = domain.getParentHospital(epis.getPasEvent().getLocation());
    if (parentHosp != null)
        form.txtHosp().setValue(parentHosp.getName());

    fillHospitalCombo();        
    form.cmbHosp().setValue(parentHosp);
    fillWardCombo();
    form.cmbWard().setValue(epis.getPasEvent().getLocation());
    form.dtimAdmission().setValue(epis.getAdmissionDateTime());

    form.dtimTransfer().setValue(new DateTime());
}
项目:AvoinApotti    文件:ADTAdmissionDetailsComponentImpl.java   
public InpatientEpisodeVo getInpatientEpisode(PASEventRefVo pasEventRef)
{
    if(pasEventRef == null || pasEventRef.getID_PASEvent()==null)
        throw new CodingRuntimeException("Cannot get PasEvent value on null pasEventRef.");

    StringBuffer hql = new StringBuffer("select inpEpisode from InpatientEpisode as inpEpisode left join inpEpisode.pasEvent as pasEvent where pasEvent.id= :pasEventID ");

    DomainFactory factory = getDomainFactory();
    List<?> list = factory.find(hql.toString(), new String[] {"pasEventID"}, new Object[] {pasEventRef.getID_PASEvent()});

    if (list!=null && list.size()>0)
    {   
        return InpatientEpisodeVoAssembler.create((InpatientEpisode) list.get(0));
    }

    return null;
}
项目:AvoinApotti    文件:ADTAdmissionDetailsComponentImpl.java   
public CareContextShortVo updateAdmissionDetails(InpatientEpisodeVo episVo, CareContextShortVo careContextVo) throws StaleObjectException
{
    if (episVo == null )
    {
        throw new CodingRuntimeException("episVo is null on Save");
    }

    if (careContextVo == null )
    {
        throw new CodingRuntimeException("careContextVo is null on Save");
    }

    ADT implLoc = (ADT)getDomainImpl(ADTImpl.class);
    DomainFactory factory = getDomainFactory();

    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContextVo);
    factory.save(domCareContext);

    implLoc.updateInpatient(episVo, null);

    return CareContextShortVoAssembler.create(domCareContext);

}
项目:AvoinApotti    文件:ADTImpl.java   
public ims.core.vo.InpatientEpisodeVo transferPatient(PatientRefVo patVo, HcpRefVo hcp, LocationRefVo ward,Integer stay,LocationRefVo fromWard, DateTime transferDateTime, DateTime transactionDT, LookupInstVo specialty) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
    if (patVo == null)
    {
        throw new DomainRuntimeException("Patient cannot be null!");
    }
    InpatientEpisode ipDo = getCurrentAdmission(patVo);
    if (ipDo == null)
    {
        //Patient is not currently an inpatient, so ignore transfer event.
        return null;    
    }   
    performTransfer(ipDo, patVo, hcp, ward,stay,fromWard,transferDateTime,transactionDT,specialty);

    return InpatientEpisodeVoAssembler.create(ipDo);
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
    //WDEV-13307
    if(args != null && args.length > 0)
    {
        if(args[0] instanceof InpatientEpisodeVo)
            form.getLocalContext().setInpatienEpisode((InpatientEpisodeVo) args[0]);
    }

    initialise();
    populateDemographicINfo();
    populateTheatreAndProcDetails();

    if(form.getLocalContext().getInpatienEpisode() == null)//WDEV-13307
        estimateDischargeDate();

    updateControlsState();//WDEV-13307
}
项目:AvoinApotti    文件:DischargeSummaryWardPacuImpl.java   
public InpatientEpisodeVo getInpatientEpisode(CatsReferralRefVo referral)
{
    if (referral == null || referral.getID_CatsReferral() == null)
        throw new CodingRuntimeException("Logical error - provided referral is null or has no id");

    DomainFactory factory = getDomainFactory();

    String hql = "from InpatientEpisode as ip where (ip.isRIE is null and ip.pasEvent.id in (select cr.careContext.pasEvent.id from CatsReferral as cr where cr.id = :refID))";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(referral.getID_CatsReferral());

    return InpatientEpisodeVoAssembler.create((InpatientEpisode) factory.findFirst(hql, paramNames, paramValues));
}
项目:AvoinApotti    文件:DischargeSummaryWardPacuImpl.java   
private Boolean getListDIschargeSummaryWPByPasEvent(InpatientEpisodeVo inpat)
{
    if(inpat == null)
        return false;
    DomainFactory factory = getDomainFactory();
    String hql = "select d1_1 from DischargeSummaryPacuAndWard as d1_1 left join d1_1.dischargeEpisode as d2_1 left join d2_1.pasEvent as p1_1 where (p1_1.id = :pasID) ";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("pasID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(inpat.getPasEvent().getID_PASEvent());
    List list = factory.find(hql.toString(), paramNames,paramValues);
    DischargeSummaryPacuAndWardLiteVoCollection listpw = DischargeSummaryPacuAndWardLiteVoAssembler.createDischargeSummaryPacuAndWardLiteVoCollectionFromDischargeSummaryPacuAndWard(list);
    if(listpw != null && listpw.size() > 0 )
        return true;
    else
        return false;
}
项目:openMAXIMS    文件:PatientListsImpl.java   
private PasContactVoCollection populatePasContactFromInPatEpisode(InpatientEpisodeVoCollection voColl) 
{
    PasContactVoCollection voCollPasContact = new PasContactVoCollection();

    for (int i = 0; i < voColl.size(); i++)
    {
        InpatientEpisodeVo vo = voColl.get(i);
        PasContactVo voPasContact = new PasContactVo();

        if (vo.getPasEventIsNotNull())
        {
            voPasContact.setAppointmentDateTime(vo.getPasEvent().getEventDateTime());
            voPasContact.setConsultant(vo.getPasEvent().getConsultant());
            voPasContact.setContactNumber(vo.getPasEvent().getID_PASEvent().toString());
            voPasContact.setContactType("Inpatient");
            voPasContact.setDischargeDateTime(vo.getPasEvent().getEventDateTime());
            voPasContact.setDocumentStatus(vo.getPasEvent().getCspDocumentStatus());
            voPasContact.setGPCode(vo.getPasEvent().getReferringGPIsNotNull()?vo.getPasEvent().getReferringGP().getNationalCode():null);
            voPasContact.setLocation(vo.getPasEvent().getLocation());
            voPasContact.setPatient(vo.getPasEvent().getPatient());
            voPasContact.setSpecialty(vo.getPasEvent().getSpecialty());
            voCollPasContact.add(voPasContact);
        }
    }
    return voCollPasContact;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * WDEV-13136
 * Function used to retrieve records (InpatientEpisodes) from grid
 */
private InpatientEpisodeVoCollection populateInpatientRecordsFromGrid()
{
    // Create collection to return
    InpatientEpisodeVoCollection records = new InpatientEpisodeVoCollection();

    // Add each record from grid to collection
    for (int i = 0; i < form.dyngrdPatients().getRows().size(); i++)
    {
        DynamicGridRow row = form.dyngrdPatients().getRows().get(i);

        if (row.getValue() instanceof InpatientEpisodeVo)
            records.add((InpatientEpisodeVo) row.getValue());
    }

    // Return populated records
    return records;
}
项目:openMAXIMS    文件:Logic.java   
private void showDemographics() 
{
    /*if (form.grdInpatients().getValue() != null &&
            form.grdInpatients().getValue().getPasEventIsNotNull() &&
                form.grdInpatients().getValue().getPasEvent().getPatientIsNotNull())
    {
        PatientShort ps = form.grdInpatients().getValue().getPasEvent().getPatient();       
        form.getGlobalContext().Core.setPatientToBeDisplayed(ps);
        setPatientFilterDetails();
        setPatientInfoBar(ps);      
        engine.open(ConfigFlag.UI.DEMOGRAPHICS_FORM.getValue());

    }*/
    //wdev-18784
    if( form.dyngrdInpatients().getValue() != null && ((InpatientEpisodeVo)form.dyngrdInpatients().getValue()).getPasEventIsNotNull() && ((InpatientEpisodeVo)form.dyngrdInpatients().getValue()).getPasEvent().getPatientIsNotNull())
    {
        PatientShort ps = ((InpatientEpisodeVo)form.dyngrdInpatients().getValue()).getPasEvent().getPatient();      
        form.getGlobalContext().Core.setPatientToBeDisplayed(ps);
        setPatientFilterDetails();
        setPatientInfoBar(ps);      
        engine.open(ConfigFlag.UI.DEMOGRAPHICS_FORM.getValue());
    }
    //-----------

}
项目:openmaxims-linux    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    String pdate1 = null;
    String pdate2 = null;
    if(ob1 instanceof InpatientEpisodeVo )
    {
        InpatientEpisodeVo ps1 = (InpatientEpisodeVo)ob1;
        pdate1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().getName() != null) ? ps1.getPasEvent().getPatient().getName().getSurname():null;
    }
    if(ob2 instanceof InpatientEpisodeVo)
    {
        InpatientEpisodeVo ps2 = (InpatientEpisodeVo)ob2;
        pdate2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().getName() != null) ? ps2.getPasEvent().getPatient().getName().getSurname():null;
    }
    if(pdate1 != null )
        return  pdate1.compareToIgnoreCase(pdate2)*direction;
    if(pdate2 != null)
        return (-1)*direction;

    return 0;
}
项目:openMAXIMS    文件:Logic.java   
private void transferPatient()
{
    InpatientEpisodeWithICPInfoVo voIp = domain.getInpatientEpisodeWithICPInfo((InpatientEpisodeRefVo)form.dyngrdInpatients().getSelectedRow().getValue());     //wdev-18784
    if (voIp == null
        || 
        (voIp != null
        && voIp.getPasEventIsNotNull()
        && voIp.getPasEvent().getLocationIsNotNull()
        && form.dyngrdInpatients().getSelectedRow().getValue() != null
        && ((InpatientEpisodeVo)form.dyngrdInpatients().getSelectedRow().getValue()).getPasEvent() != null
        &&  ! voIp.getPasEvent().getLocation().equals(((InpatientEpisodeVo)form.dyngrdInpatients().getSelectedRow().getValue()).getPasEvent().getLocation())))    //wdev-18784
    {
        engine.showMessage("This In-Patient record has already been updated by another user. The screen will be refreshed.");
        performSearch();
        return;
    }

    if (voIp != null)
        engine.open(form.getForms().Core.InpatientTransferDialog, new Object[]{ voIp});
}
项目:openmaxims-linux    文件:Logic.java   
public int compare(InpatientEpisodeVo o1, InpatientEpisodeVo o2)
{
    if (o1.getWardStaysIsNotNull() && o1.getWardStays().size() > 1 && o2.getWardStaysIsNotNull() && o2.getWardStays().size() > 1)
    {
        // Sort ward stays
        o1.getWardStays().sort(WardStayVo.getWardStayVoIdComparator());
        o2.getWardStays().sort(WardStayVo.getWardStayVoIdComparator());

        WardStayVo previousStay1 = o1.getWardStays().get(1);
        WardStayVo previousStay2 = o2.getWardStays().get(1);

        return previousStay1.getTransferDateTime().compareTo(previousStay2.getTransferDateTime()) * direction;
    }

    if (o1.getWardStaysIsNotNull() && o1.getWardStays().size() > 1 && (!o2.getWardStaysIsNotNull() || o2.getWardStays().size() <= 1))
    {
        return direction;
    }

    if ((!o1.getWardStaysIsNotNull() || o1.getWardStays().size() <= 1) && o2.getWardStaysIsNotNull() && o2.getWardStays().size() > 1)
    {
        return -1 * direction;
    }

    return 0;
}
项目:openMAXIMS    文件:Logic.java   
private void initialise()
{
    InpatientEpisodeVo epis = form.getLocalContext().getInpatEpis();

    form.txtWard().setValue(epis.getPasEvent().getLocation() != null ? epis.getPasEvent().getLocation().getName() : null); //NPE fix

    LocationLiteVo parentHosp = domain.getParentHospital(epis.getPasEvent().getLocation());
    if (parentHosp != null)
        form.txtHosp().setValue(parentHosp.getName());

    fillHospitalCombo();        
    form.cmbHosp().setValue(parentHosp);
    fillWardCombo();
    form.cmbWard().setValue(epis.getPasEvent().getLocation());
    form.dtimAdmission().setValue(epis.getAdmissionDateTime());

    form.dtimTransfer().setValue(new DateTime());
}
项目:openMAXIMS    文件:ADTAdmissionDetailsComponentImpl.java   
public InpatientEpisodeVo getInpatientEpisode(PASEventRefVo pasEventRef)
{
    if(pasEventRef == null || pasEventRef.getID_PASEvent()==null)
        throw new CodingRuntimeException("Cannot get PasEvent value on null pasEventRef.");

    StringBuffer hql = new StringBuffer("select inpEpisode from InpatientEpisode as inpEpisode left join inpEpisode.pasEvent as pasEvent where pasEvent.id= :pasEventID ");

    DomainFactory factory = getDomainFactory();
    List<?> list = factory.find(hql.toString(), new String[] {"pasEventID"}, new Object[] {pasEventRef.getID_PASEvent()});

    if (list!=null && list.size()>0)
    {   
        return InpatientEpisodeVoAssembler.create((InpatientEpisode) list.get(0));
    }

    return null;
}
项目:openMAXIMS    文件:ADTAdmissionDetailsComponentImpl.java   
public CareContextShortVo updateAdmissionDetails(InpatientEpisodeVo episVo, CareContextShortVo careContextVo) throws StaleObjectException
{
    if (episVo == null )
    {
        throw new CodingRuntimeException("episVo is null on Save");
    }

    if (careContextVo == null )
    {
        throw new CodingRuntimeException("careContextVo is null on Save");
    }

    ADT implLoc = (ADT)getDomainImpl(ADTImpl.class);
    DomainFactory factory = getDomainFactory();

    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContextVo);
    factory.save(domCareContext);

    implLoc.updateInpatient(episVo, null);

    return CareContextShortVoAssembler.create(domCareContext);

}
项目:openMAXIMS    文件:ADTImpl.java   
public ims.core.vo.InpatientEpisodeVo transferPatient(PatientRefVo patVo, HcpRefVo hcp, LocationRefVo ward,Integer stay,LocationRefVo fromWard, DateTime transferDateTime, DateTime transactionDT, LookupInstVo specialty) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
    if (patVo == null)
    {
        throw new DomainRuntimeException("Patient cannot be null!");
    }
    InpatientEpisode ipDo = getCurrentAdmission(patVo);
    if (ipDo == null)
    {
        //Patient is not currently an inpatient, so ignore transfer event.
        return null;    
    }   
    performTransfer(ipDo, patVo, hcp, ward,stay,fromWard,transferDateTime,transactionDT,specialty);

    return InpatientEpisodeVoAssembler.create(ipDo);
}
项目:openmaxims-linux    文件:ADTAdmissionDetailsComponentImpl.java   
public InpatientEpisodeVo getInpatientEpisode(PASEventRefVo pasEventRef)
{
    if(pasEventRef == null || pasEventRef.getID_PASEvent()==null)
        throw new CodingRuntimeException("Cannot get PasEvent value on null pasEventRef.");

    StringBuffer hql = new StringBuffer("select inpEpisode from InpatientEpisode as inpEpisode left join inpEpisode.pasEvent as pasEvent where pasEvent.id= :pasEventID ");

    DomainFactory factory = getDomainFactory();
    List<?> list = factory.find(hql.toString(), new String[] {"pasEventID"}, new Object[] {pasEventRef.getID_PASEvent()});

    if (list!=null && list.size()>0)
    {   
        return InpatientEpisodeVoAssembler.create((InpatientEpisode) list.get(0));
    }

    return null;
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
    //WDEV-13307
    if(args != null && args.length > 0)
    {
        if(args[0] instanceof InpatientEpisodeVo)
            form.getLocalContext().setInpatienEpisode((InpatientEpisodeVo) args[0]);
    }

    initialise();
    populateDemographicINfo();
    populateTheatreAndProcDetails();

    if(form.getLocalContext().getInpatienEpisode() == null)//WDEV-13307
        estimateDischargeDate();

    updateControlsState();//WDEV-13307
}
项目:openMAXIMS    文件:DischargeSummaryWardPacuImpl.java   
public InpatientEpisodeVo getInpatientEpisode(CatsReferralRefVo referral)
{
    if (referral == null || referral.getID_CatsReferral() == null)
        throw new CodingRuntimeException("Logical error - provided referral is null or has no id");

    DomainFactory factory = getDomainFactory();

    String hql = "from InpatientEpisode as ip where (ip.isRIE is null and ip.pasEvent.id in (select cr.careContext.pasEvent.id from CatsReferral as cr where cr.id = :refID))";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(referral.getID_CatsReferral());

    return InpatientEpisodeVoAssembler.create((InpatientEpisode) factory.findFirst(hql, paramNames, paramValues));
}
项目:openMAXIMS    文件:DischargeSummaryWardPacuImpl.java   
private Boolean getListDIschargeSummaryWPByPasEvent(InpatientEpisodeVo inpat)
{
    if(inpat == null)
        return false;
    DomainFactory factory = getDomainFactory();
    String hql = "select d1_1 from DischargeSummaryPacuAndWard as d1_1 left join d1_1.dischargeEpisode as d2_1 left join d2_1.pasEvent as p1_1 where (p1_1.id = :pasID) ";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("pasID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(inpat.getPasEvent().getID_PASEvent());
    List list = factory.find(hql.toString(), paramNames,paramValues);
    DischargeSummaryPacuAndWardLiteVoCollection listpw = DischargeSummaryPacuAndWardLiteVoAssembler.createDischargeSummaryPacuAndWardLiteVoCollectionFromDischargeSummaryPacuAndWard(list);
    if(listpw != null && listpw.size() > 0 )
        return true;
    else
        return false;
}
项目:openmaxims-linux    文件:ADTAdmissionDetailsComponentImpl.java   
public CareContextShortVo updateAdmissionDetails(InpatientEpisodeVo episVo, CareContextShortVo careContextVo) throws StaleObjectException
{
    if (episVo == null )
    {
        throw new CodingRuntimeException("episVo is null on Save");
    }

    if (careContextVo == null )
    {
        throw new CodingRuntimeException("careContextVo is null on Save");
    }

    ADT implLoc = (ADT)getDomainImpl(ADTImpl.class);
    DomainFactory factory = getDomainFactory();

    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContextVo);
    factory.save(domCareContext);

    implLoc.updateInpatient(episVo, null);

    return CareContextShortVoAssembler.create(domCareContext);

}
项目:openMAXIMS    文件:Logic.java   
public int compare(InpatientEpisodeVo o1, InpatientEpisodeVo o2)
{
    if (o1.getWardStaysIsNotNull() && o1.getWardStays().size() > 1 && o2.getWardStaysIsNotNull() && o2.getWardStays().size() > 1)
    {
        // Sort ward stays
        o1.getWardStays().sort(WardStayVo.getWardStayVoIdComparator());
        o2.getWardStays().sort(WardStayVo.getWardStayVoIdComparator());

        WardStayVo previousStay1 = o1.getWardStays().get(1);
        WardStayVo previousStay2 = o2.getWardStays().get(1);

        return previousStay1.getTransferDateTime().compareTo(previousStay2.getTransferDateTime()) * direction;
    }

    if (o1.getWardStaysIsNotNull() && o1.getWardStays().size() > 1 && (!o2.getWardStaysIsNotNull() || o2.getWardStays().size() <= 1))
    {
        return direction;
    }

    if ((!o1.getWardStaysIsNotNull() || o1.getWardStays().size() <= 1) && o2.getWardStaysIsNotNull() && o2.getWardStays().size() > 1)
    {
        return -1 * direction;
    }

    return 0;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * WDEV-13136
 * Function used to retrieve records (InpatientEpisodes) from grid
 */
private InpatientEpisodeVoCollection populateInpatientRecordsFromGrid()
{
    // Create collection to return
    InpatientEpisodeVoCollection records = new InpatientEpisodeVoCollection();

    // Add each record from grid to collection
    for (int i = 0; i < form.dyngrdPatients().getRows().size(); i++)
    {
        DynamicGridRow row = form.dyngrdPatients().getRows().get(i);

        if (row.getValue() instanceof InpatientEpisodeVo)
            records.add((InpatientEpisodeVo) row.getValue());
    }

    // Return populated records
    return records;
}
项目:openMAXIMS    文件:Logic.java   
private void addEditComment(DynamicGridCell cell)
{
    if (cell != null)
        form.dyngrdPatients().setSelectedRow(cell.getRow());

    if (form.dyngrdPatients().getSelectedRow() != null && form.dyngrdPatients().getSelectedRow().getValue() != null)
    {
        if (form.dyngrdPatients().getSelectedRow().getValue() instanceof PendingTransfersVo)
        {
            PendingTransfersVo voTrans = domain.getCurrentTransferRecord((PendingTransfersVo) form.dyngrdPatients().getSelectedRow().getValue());

            form.getGlobalContext().Core.setCommentDialogString(voTrans.getInpatientEpisodeIsNotNull() ? voTrans.getInpatientEpisode().getComments() : "");
            form.dyngrdPatients().getSelectedRow().setValue(voTrans);
            updateGlobalContextPatientSelection(voTrans);//WDEV-18065 
            engine.open(form.getForms().Core.CommentDialog);
        }
        else if (form.dyngrdPatients().getSelectedRow().getValue() instanceof InpatientEpisodeVo)
        {
            InpatientEpisodeVo voEpis = (InpatientEpisodeVo) form.dyngrdPatients().getSelectedRow().getValue();

            form.getGlobalContext().Core.setCommentDialogString(voEpis.getComments());
            updateGlobalContextPatientSelection(voEpis);//WDEV-18065 
            engine.open(form.getForms().Core.CommentDialog);
        }   
    }
}
项目:openmaxims-linux    文件:PatientListsImpl.java   
private PasContactVoCollection populatePasContactFromInPatEpisode(InpatientEpisodeVoCollection voColl) 
{
    PasContactVoCollection voCollPasContact = new PasContactVoCollection();

    for (int i = 0; i < voColl.size(); i++)
    {
        InpatientEpisodeVo vo = voColl.get(i);
        PasContactVo voPasContact = new PasContactVo();

        if (vo.getPasEventIsNotNull())
        {
            voPasContact.setAppointmentDateTime(vo.getPasEvent().getEventDateTime());
            voPasContact.setConsultant(vo.getPasEvent().getConsultant());
            voPasContact.setContactNumber(vo.getPasEvent().getID_PASEvent().toString());
            voPasContact.setContactType("Inpatient");
            voPasContact.setDischargeDateTime(vo.getPasEvent().getEventDateTime());
            voPasContact.setDocumentStatus(vo.getPasEvent().getCspDocumentStatus());
            voPasContact.setGPCode(vo.getPasEvent().getReferringGPIsNotNull()?vo.getPasEvent().getReferringGP().getNationalCode():null);
            voPasContact.setLocation(vo.getPasEvent().getLocation());
            voPasContact.setPatient(vo.getPasEvent().getPatient());
            voPasContact.setSpecialty(vo.getPasEvent().getSpecialty());
            voCollPasContact.add(voPasContact);
        }
    }
    return voCollPasContact;
}
项目:openMAXIMS    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    String pdate1 = null;
    String pdate2 = null;
    if(ob1 instanceof InpatientEpisodeVo )
    {
        InpatientEpisodeVo ps1 = (InpatientEpisodeVo)ob1;
        pdate1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().getName() != null) ? ps1.getPasEvent().getPatient().getName().getSurname():null;
    }
    if(ob2 instanceof InpatientEpisodeVo)
    {
        InpatientEpisodeVo ps2 = (InpatientEpisodeVo)ob2;
        pdate2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().getName() != null) ? ps2.getPasEvent().getPatient().getName().getSurname():null;
    }
    if(pdate1 != null )
        return  pdate1.compareToIgnoreCase(pdate2)*direction;
    if(pdate2 != null)
        return (-1)*direction;

    return 0;
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * WDEV-13136
 * Function used to retrieve records (InpatientEpisodes) from grid
 */
private InpatientEpisodeVoCollection populateInpatientRecordsFromGrid()
{
    // Create collection to return
    InpatientEpisodeVoCollection records = new InpatientEpisodeVoCollection();

    // Add each record from grid to collection
    for (int i = 0; i < form.dyngrdPatients().getRows().size(); i++)
    {
        DynamicGridRow row = form.dyngrdPatients().getRows().get(i);

        if (row.getValue() instanceof InpatientEpisodeVo)
            records.add((InpatientEpisodeVo) row.getValue());
    }

    // Return populated records
    return records;
}
项目:openmaxims-linux    文件:Logic.java   
private void initialise()
{
    InpatientEpisodeVo epis = form.getLocalContext().getInpatEpis();

    form.txtWard().setValue(epis.getPasEvent().getLocation().getName());

    LocationLiteVo parentHosp = domain.getParentHospital(epis.getPasEvent().getLocation());
    if (parentHosp != null)
        form.txtHosp().setValue(parentHosp.getName());

    fillHospitalCombo();        
    form.cmbHosp().setValue(parentHosp);
    fillWardCombo();
    form.cmbWard().setValue(epis.getPasEvent().getLocation());
    form.dtimAdmission().setValue(epis.getAdmissionDateTime());

    form.dtimTransfer().setValue(new DateTime());
}
项目:openMAXIMS    文件:ADTAdmissionDetailsComponentImpl.java   
public CareContextShortVo updateAdmissionDetails(InpatientEpisodeVo episVo, CareContextShortVo careContextVo) throws StaleObjectException
{
    if (episVo == null )
    {
        throw new CodingRuntimeException("episVo is null on Save");
    }

    if (careContextVo == null )
    {
        throw new CodingRuntimeException("careContextVo is null on Save");
    }

    ADT implLoc = (ADT)getDomainImpl(ADTImpl.class);
    DomainFactory factory = getDomainFactory();

    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContextVo);
    factory.save(domCareContext);

    implLoc.updateInpatient(episVo, null);

    return CareContextShortVoAssembler.create(domCareContext);

}
项目:openmaxims-linux    文件:ADTImpl.java   
public ims.core.vo.InpatientEpisodeVo transferPatient(PatientRefVo patVo, HcpRefVo hcp, LocationRefVo ward,Integer stay,LocationRefVo fromWard, DateTime transferDateTime, DateTime transactionDT, LookupInstVo specialty) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
    if (patVo == null)
    {
        throw new DomainRuntimeException("Patient cannot be null!");
    }
    InpatientEpisode ipDo = getCurrentAdmission(patVo);
    if (ipDo == null)
    {
        //Patient is not currently an inpatient, so ignore transfer event.
        return null;    
    }   
    performTransfer(ipDo, patVo, hcp, ward,stay,fromWard,transferDateTime,transactionDT,specialty);

    return InpatientEpisodeVoAssembler.create(ipDo);
}
项目:openMAXIMS    文件:ADTImpl.java   
public ims.core.vo.InpatientEpisodeVo transferPatient(PatientRefVo patVo, HcpRefVo hcp, LocationRefVo ward,Integer stay,LocationRefVo fromWard, DateTime transferDateTime, DateTime transactionDT, LookupInstVo specialty) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
    if (patVo == null)
    {
        throw new DomainRuntimeException("Patient cannot be null!");
    }
    InpatientEpisode ipDo = getCurrentAdmission(patVo);
    if (ipDo == null)
    {
        //Patient is not currently an inpatient, so ignore transfer event.
        return null;    
    }   
    performTransfer(ipDo, patVo, hcp, ward,stay,fromWard,transferDateTime,transactionDT,specialty);

    return InpatientEpisodeVoAssembler.create(ipDo);
}
项目:openmaxims-linux    文件:Logic.java   
private void initialise()
{
    InpatientEpisodeVo epis = form.getLocalContext().getInpatEpis();

    form.txtWard().setValue(epis.getPasEvent().getLocation().getName());
    if (epis.getPasEvent().getConsultant() != null)
        form.txtCons().setValue(epis.getPasEvent().getConsultant().getName().toString());
    if (epis.getPasEvent().getSpecialty() != null)
        form.txtSpec().setValue(epis.getPasEvent().getSpecialty().getText());
    LocationLiteVo parentHosp = domain.getParentHospital(epis.getPasEvent().getLocation());
    if (parentHosp != null)
        form.txtHosp().setValue(parentHosp.getName());

    fillHospitalCombo();        
    form.cmbHosp().setValue(parentHosp);
    fillWardCombo();
    form.cmbWard().setValue(epis.getPasEvent().getLocation());
    form.cmbSpec().setValue(epis.getPasEvent().getSpecialty());
}
项目:openMAXIMS    文件:DischargeSummaryWardPacuImpl.java   
public InpatientEpisodeVo getInpatientEpisode(CatsReferralRefVo referral)
{
    if (referral == null || referral.getID_CatsReferral() == null)
        throw new CodingRuntimeException("Logical error - provided referral is null or has no id");

    DomainFactory factory = getDomainFactory();

    String hql = "from InpatientEpisode as ip where (ip.isRIE is null and ip.pasEvent.id in (select cr.careContext.pasEvent.id from CatsReferral as cr where cr.id = :refID))";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(referral.getID_CatsReferral());

    return InpatientEpisodeVoAssembler.create((InpatientEpisode) factory.findFirst(hql, paramNames, paramValues));
}