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

项目:AvoinApotti    文件:Logic.java   
private void populateEventControlsFromData(InpatientEpisodeLiteVo voInpatientEpisode)
{
    if (voInpatientEpisode.getPasEventIsNotNull())
    {
        form.lblConsultantBanner().setValue(voInpatientEpisode.getPasEvent().getConsultantIsNotNull() ? voInpatientEpisode.getPasEvent().getConsultant().toString() : "");

        //WDEV-14465
        if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
        {
            form.lblSpecialtyBanner().setValue(voInpatientEpisode.getPasEvent().getPASSpecialtyIsNotNull() ? voInpatientEpisode.getPasEvent().getPASSpecialty().getText() : "");
        }
        else
            form.lblSpecialtyBanner().setValue(voInpatientEpisode.getPasEvent().getSpecialtyIsNotNull() ? voInpatientEpisode.getPasEvent().getSpecialty().getText() : "");
    }
    form.lblEstDsichargeBanner().setValue(voInpatientEpisode.getEstDischargeDateIsNotNull() ? voInpatientEpisode.getEstDischargeDate().toString() : "");
}
项目:AvoinApotti    文件:Logic.java   
private SelectItemVoCollection chooseInfantsToDischarge()
{
    SelectItemVoCollection voCollItems = new SelectItemVoCollection();
    InpatientEpisodeLiteVoCollection voCollInfants = form.getLocalContext().getInfants();
    if (voCollInfants != null)
    {
        // go through collection creating discharge records for each infant
        for (InpatientEpisodeLiteVo voInpat : voCollInfants)
        {
            SelectItemVo voSelectItem = new SelectItemVo();
            voSelectItem.setItem(createInfantDischarge(voInpat));
            voSelectItem.setSelected(Boolean.FALSE);
            voCollItems.add(voSelectItem);
        }
    }

    return voCollItems.size() > 0 ? voCollItems : null;
}
项目:AvoinApotti    文件:Logic.java   
private Image calculateInfants(InpatientEpisodeLiteVo inpatientEpisode)
{
    Image imgNumInfants = null;
    //get number of infants for this patient
    int count = domain.countInfants(inpatientEpisode.getPasEvent().getPatient());

    if(count == 1)
        imgNumInfants = form.getImages().Core.Infant1;
    if(count == 2)
        imgNumInfants = form.getImages().Core.Infant2;
    if(count == 3)
        imgNumInfants = form.getImages().Core.Infant3;
    if(count == 4)
        imgNumInfants = form.getImages().Core.Infant4;
    if(count == 5)
        imgNumInfants = form.getImages().Core.Infant5;
    if(count == 6)
        imgNumInfants = form.getImages().Core.Infant6;
    if(count == 7)
        imgNumInfants = form.getImages().Core.Infant7;
    if(count == 8)
        imgNumInfants = form.getImages().Core.Infant8;

    return imgNumInfants;
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onGrdHomeLeaveSelectionChanged() throws PresentationLogicException 
{
    form.getLocalContext().setAdmissionDetail(null);
    clearScreen();
    if(form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue() == null)
        return;

    form.dteHLDateReturn().setEnabled(true);
    form.timHLTimeOfReturn().setEnabled(true);
    form.dteHLDateReturn().setValue(new Date());

    form.getLocalContext().setRecordSelected(true);

    InpatientEpisodeLiteVo voInWaiting = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
    AdmissionDetailVo voAdmission = domain.getAdmissionDetailByPasEvent(voInWaiting.getPasEvent());
    if(voAdmission == null)
        return;

    form.getLocalContext().setAdmissionDetail(voAdmission);
    form.fireCustomControlValueChanged();
}
项目:AvoinApotti    文件:BedInfoDialogImpl.java   
public void saveInternalTransfer(InpatientEpisodeLiteVo inpatEpis, BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
    if (bedSpaceState == null)
        throw new CodingRuntimeException("bedSpaceState is null in method saveInternalTransfer");
    if (inpatEpis == null)
        throw new CodingRuntimeException("inpatEpis is null in method saveInternalTransfer");

    BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
    InpatientEpisode doInpatEpis = InpatientEpisodeLiteVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatEpis);
    doInpatEpis.getBed().getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.AVAILABLE));
    doInpatEpis.getBed().setInpatientEpisode(null);
    getDomainFactory().save(doInpatEpis);

    doBedSpaceState.setInpatientEpisode(doInpatEpis);
    doBedSpaceState.getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.OCCUPIED));
    doInpatEpis.setBed(doBedSpaceState);

    getDomainFactory().save(doInpatEpis);
}
项目:AvoinApotti    文件:ClinicListwithICPActionsImpl.java   
public Boolean isInpatientCareContext(PatientRefVo patientRef, CareContextRefVo careContextRef)
{
    if (patientRef == null || !patientRef.getID_PatientIsNotNull())
        throw new CodingRuntimeException("Logical Error - Patient expected");

    if (careContextRef == null || !careContextRef.getID_CareContextIsNotNull())
        throw new CodingRuntimeException("Logical Error - Care Context expected");

    String hql = "from InpatientEpisode as ip where (ip.pasEvent.id in (select cc.pasEvent.id from CareContext as cc where cc.id = :refID))";
    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(careContextRef.getID_CareContext());

    InpatientEpisodeLiteVo inpatientEpisode = InpatientEpisodeLiteVoAssembler.create((InpatientEpisode) getDomainFactory().findFirst(hql, paramNames, paramValues));

    if (inpatientEpisode == null)
        return Boolean.FALSE;

    return Boolean.TRUE;
}
项目:openMAXIMS    文件:Logic.java   
private SelectItemVoCollection chooseInfantsToDischarge()
{
    SelectItemVoCollection voCollItems = new SelectItemVoCollection();
    InpatientEpisodeLiteVoCollection voCollInfants = form.getLocalContext().getInfants();
    if (voCollInfants != null)
    {
        // go through collection creating discharge records for each infant
        for (InpatientEpisodeLiteVo voInpat : voCollInfants)
        {
            SelectItemVo voSelectItem = new SelectItemVo();
            voSelectItem.setItem(createInfantDischarge(voInpat));
            voSelectItem.setSelected(Boolean.FALSE);
            voCollItems.add(voSelectItem);
        }
    }

    return voCollItems.size() > 0 ? voCollItems : null;
}
项目:openMAXIMS    文件:Logic.java   
private void populateBedMoveTabFromData(boolean bCalledOnInitialise)
{
    if (form.getGlobalContext().Core.getADTWard() == null)
        throw new CodingRuntimeException("Ward not set in populateBedMoveTabFromData");

    InpatientEpisodeLiteVoCollection voCollInpatients = domain.listInpatientEpisodeByWard(form.getGlobalContext().Core.getADTWard(), form.getGlobalContext().Core.getPatientShort());

    if (voCollInpatients != null && voCollInpatients.size() >= 2)
    {
        if (bCalledOnInitialise) //WDEV-21014
        {   
            form.getLocalContext().setSortOrderBedNo(SortOrder.ASCENDING);
        }
        if (form.getLocalContext().getSortOrderBedNoIsNotNull())
        {   
            voCollInpatients.sort(InpatientEpisodeLiteVo.getBedNumberComparator(form.getLocalContext().getSortOrderBedNo()));
        }
    }
    populateBedMoveGridFromData(voCollInpatients);

    form.lyrDetail().tabBedMove().btnInternalTransfer().setEnabled(false);
    form.lyrDetail().tabBedMove().btnSwitchBeds().setEnabled(false);
}
项目:openMAXIMS    文件:Logic.java   
private void refreshContextsOnUpdateAdmission()
{
    form.getLocalContext().setAdmissionDetails(getAdmissionDetail());                   
    if (form.getGlobalContext().Core.getSelectedBedSpaceStateIsNotNull())
    {
        BedSpaceStateLiteVo bedSpaceStateByInpatientEpisode = domain.getBedSpaceStateByInpatientEpisode(form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode());
        String bedStr = getBedSpaceTypeDescriptor(bedSpaceStateByInpatientEpisode);
        form.getGlobalContext().Core.setSelectedBedSpaceState(bedSpaceStateByInpatientEpisode);
        if (bedSpaceStateByInpatientEpisode.getInpatientEpisode() == null)
        {
            engine.showMessage("This patient has been discharged/moved from this " + bedStr.toLowerCase() + " by another user.The screen will be refreshed.");
            engine.close(DialogResult.OK);
        }
    } 
    else if (form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull())
    {
        InpatientEpisodeLiteVo inpatientEpisodeLiteVoById = domain.getInpatientEpisodeLiteVoById(form.getGlobalContext().Core.getSelectedWaitingAreaPatient());
        if (inpatientEpisodeLiteVoById == null)
        {
            engine.showMessage("This patient has been discharged/moved by another user.The screen will refresh");
            engine.close(DialogResult.OK);
        }
        form.getGlobalContext().Core.setSelectedWaitingAreaPatient(inpatientEpisodeLiteVoById);
    }
}
项目:openmaxims-linux    文件:ClinicListwithICPActionsImpl.java   
public Boolean isInpatientCareContext(PatientRefVo patientRef, CareContextRefVo careContextRef)
{
    if (patientRef == null || !patientRef.getID_PatientIsNotNull())
        throw new CodingRuntimeException("Logical Error - Patient expected");

    if (careContextRef == null || !careContextRef.getID_CareContextIsNotNull())
        throw new CodingRuntimeException("Logical Error - Care Context expected");

    String hql = "from InpatientEpisode as ip where (ip.pasEvent.id in (select cc.pasEvent.id from CareContext as cc where cc.id = :refID))";
    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(careContextRef.getID_CareContext());

    InpatientEpisodeLiteVo inpatientEpisode = InpatientEpisodeLiteVoAssembler.create((InpatientEpisode) getDomainFactory().findFirst(hql, paramNames, paramValues));

    if (inpatientEpisode == null)
        return Boolean.FALSE;

    return Boolean.TRUE;
}
项目:openMAXIMS    文件:Logic.java   
private boolean cancelHomeLeave(BedSpaceStateLiteVo voBedSpaceState, InpatientEpisodeLiteVo voEpisode, boolean bCloseDialog)
{       
    try
    {
        domain.cancelHomeLeave(voBedSpaceState, voEpisode);
    }
    catch (DomainInterfaceException e)
    {
        engine.showMessage(e.getMessage());
        if (bCloseDialog)
        {   
            engine.close(DialogResult.OK);
        }
        return false;
    }
    catch (StaleObjectException ex)
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        if (bCloseDialog)
        {   
            engine.close(DialogResult.OK);
        }
        return false;
    }
    return true;            
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdInfantsGridHeaderClicked(int column) throws PresentationLogicException
{
    InpatientEpisodeLiteVoCollection vals = form.lyrDetail().tabInfants().grdInfants().getValues();
    if (vals.size() < 2)
        return;
    form.getLocalContext().setSortOrderInfantsDOB(SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrderInfantsDOB()) ?  SortOrder.DESCENDING : SortOrder.ASCENDING);
    InpatientEpisodeLiteVo selVal = form.lyrDetail().tabInfants().grdInfants().getValue();
    if (COL_INFANT_AGE == column)
    {
        vals.sort(new ims.core.forms.bedadmissioncomponent.Logic.BedAdmissionAgeComparator(form.getLocalContext().getSortOrderBedMoveDOB()));
    }
    populateInfantsToGrid(vals);
    if (selVal != null)
    {
        form.lyrDetail().tabInfants().grdInfants().setValue(selVal);
    }
}
项目:openMAXIMS    文件:ClinicListwithICPActionsImpl.java   
public Boolean isInpatientCareContext(PatientRefVo patientRef, CareContextRefVo careContextRef)
{
    if (patientRef == null || !patientRef.getID_PatientIsNotNull())
        throw new CodingRuntimeException("Logical Error - Patient expected");

    if (careContextRef == null || !careContextRef.getID_CareContextIsNotNull())
        throw new CodingRuntimeException("Logical Error - Care Context expected");

    String hql = "from InpatientEpisode as ip where (ip.pasEvent.id in (select cc.pasEvent.id from CareContext as cc where cc.id = :refID))";
    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(careContextRef.getID_CareContext());

    InpatientEpisodeLiteVo inpatientEpisode = InpatientEpisodeLiteVoAssembler.create((InpatientEpisode) getDomainFactory().findFirst(hql, paramNames, paramValues));

    if (inpatientEpisode == null)
        return Boolean.FALSE;

    return Boolean.TRUE;
}
项目:openmaxims-linux    文件:Logic.java   
private Image calculateInfants(InpatientEpisodeLiteVo inpatientEpisode)
{
    Image imgNumInfants = null;
    //get number of infants for this patient
    int count = domain.countInfants(inpatientEpisode.getPasEvent().getPatient());

    if(count == 1)
        imgNumInfants = form.getImages().Core.Infant1;
    if(count == 2)
        imgNumInfants = form.getImages().Core.Infant2;
    if(count == 3)
        imgNumInfants = form.getImages().Core.Infant3;
    if(count == 4)
        imgNumInfants = form.getImages().Core.Infant4;
    if(count == 5)
        imgNumInfants = form.getImages().Core.Infant5;
    if(count == 6)
        imgNumInfants = form.getImages().Core.Infant6;
    if(count == 7)
        imgNumInfants = form.getImages().Core.Infant7;
    if(count == 8)
        imgNumInfants = form.getImages().Core.Infant8;

    return imgNumInfants;
}
项目:openMAXIMS    文件:Logic.java   
public String[] getErrors()
{
    if (!Boolean.TRUE.equals(form.getLocalContext().getRecordSelected()))
        return null;

    BedSpaceStateLiteVo voBedSpaceStateLite = form.getGlobalContext().Core.getSelectedBedSpaceState();
    if (voBedSpaceStateLite == null)
    {
        return new String[] {"No Bed/Chair Selected"};          
    }
    if (Boolean.TRUE.equals(form.getLocalContext().getIsReturnFromLeaveVisible()))
    {   
        InpatientEpisodeLiteVo voInpatEpis = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
        return getHomeLeaveUIValidation(voBedSpaceStateLite, voInpatEpis);
    }   
    return getValidationErrors();
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdInWaitingGridHeaderClicked(int column)  throws PresentationLogicException 
{
    InpatientEpisodeLiteVoCollection vals = form.lyrAdmission().tabInWaiting().grdInWaiting().getValues();
    if (vals.size() <2)
        return;
    InpatientEpisodeLiteVo selVal = form.lyrAdmission().tabInWaiting().grdInWaiting().getValue();
    toggleSortOrder(form.lyrAdmission().tabInWaiting().grdInWaiting(), column);
    if (COL_AGE == column)
    {
        vals.sort(new BedAdmissionAgeComparator(form.getLocalContext().getSortOrderAwaitingBedAge()));
    }
    else if (COL_DOB == column)
    {
        vals.sort(new BedAdmissionDOBComparator(form.getLocalContext().getSortOrderAwaitingBedDOB()));
    }
    populateInWaitingGridFromData(vals);
    if (selVal != null)
    {
        form.lyrAdmission().tabInWaiting().grdInWaiting().setValue(selVal);
    }   
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdHomeLeaveGridHeaderClicked(int column)  throws PresentationLogicException
{
    InpatientEpisodeLiteVoCollection vals = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValues();
    if (vals.size() < 2)
        return;
    InpatientEpisodeLiteVo selectedHl = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
    toggleSortOrder(form.lyrAdmission().tabHomeLeave().grdHomeLeave(), column);
    if (COL_AGE == column)
    {
        vals.sort(new BedAdmissionAgeComparator(form.getLocalContext().getSortOrderHomeLeaveAge()));
    }
    else if (COL_DOB == column)
    {
        vals.sort(new BedAdmissionDOBComparator(form.getLocalContext().getSortOrderHomeLeaveDOB()));
    }
    populateHomeLeavesToGrid(vals);
    if (selectedHl != null)
    {   
        form.lyrAdmission().tabHomeLeave().grdHomeLeave().setValue(selectedHl);
    }   
}
项目:openMAXIMS    文件:ClinicListwithICPActionsImpl.java   
public Boolean isInpatientCareContext(PatientRefVo patientRef, CareContextRefVo careContextRef)
{
    if (patientRef == null || !patientRef.getID_PatientIsNotNull())
        throw new CodingRuntimeException("Logical Error - Patient expected");

    if (careContextRef == null || !careContextRef.getID_CareContextIsNotNull())
        throw new CodingRuntimeException("Logical Error - Care Context expected");

    String hql = "from InpatientEpisode as ip where (ip.pasEvent.id in (select cc.pasEvent.id from CareContext as cc where cc.id = :refID))";
    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(careContextRef.getID_CareContext());

    InpatientEpisodeLiteVo inpatientEpisode = InpatientEpisodeLiteVoAssembler.create((InpatientEpisode) getDomainFactory().findFirst(hql, paramNames, paramValues));

    if (inpatientEpisode == null)
        return Boolean.FALSE;

    return Boolean.TRUE;
}
项目:openMAXIMS    文件:Logic.java   
private void populateEventControlsFromData(InpatientEpisodeLiteVo voInpatientEpisode)
{
    if (voInpatientEpisode.getPasEventIsNotNull())
    {
        form.lblConsultantBanner().setValue(voInpatientEpisode.getPasEvent().getConsultantIsNotNull() ? voInpatientEpisode.getPasEvent().getConsultant().toString() : "");

        //WDEV-14465
        if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
        {
            form.lblSpecialtyBanner().setValue(voInpatientEpisode.getPasEvent().getPASSpecialtyIsNotNull() ? voInpatientEpisode.getPasEvent().getPASSpecialty().getText() : "");
        }
        else
            form.lblSpecialtyBanner().setValue(voInpatientEpisode.getPasEvent().getSpecialtyIsNotNull() ? voInpatientEpisode.getPasEvent().getSpecialty().getText() : "");
    }
    form.lblEstDsichargeBanner().setValue(voInpatientEpisode.getEstDischargeDateIsNotNull() ? voInpatientEpisode.getEstDischargeDate().toString() : "");
}
项目:openMAXIMS    文件:Logic.java   
private SelectItemVoCollection chooseInfantsToDischarge()
{
    SelectItemVoCollection voCollItems = new SelectItemVoCollection();
    InpatientEpisodeLiteVoCollection voCollInfants = form.getLocalContext().getInfants();
    if (voCollInfants != null)
    {
        // go through collection creating discharge records for each infant
        for (InpatientEpisodeLiteVo voInpat : voCollInfants)
        {
            SelectItemVo voSelectItem = new SelectItemVo();
            voSelectItem.setItem(createInfantDischarge(voInpat));
            voSelectItem.setSelected(Boolean.FALSE);
            voCollItems.add(voSelectItem);
        }
    }

    return voCollItems.size() > 0 ? voCollItems : null;
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onGrdHomeLeaveSelectionChanged() throws PresentationLogicException 
{
    form.getLocalContext().setAdmissionDetail(null);
    clearScreen();
    if(form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue() == null)
        return;

    form.dteHLDateReturn().setEnabled(true);
    form.timHLTimeOfReturn().setEnabled(true);
    form.dteHLDateReturn().setValue(new Date());

    form.getLocalContext().setRecordSelected(true);

    InpatientEpisodeLiteVo voInWaiting = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
    AdmissionDetailVo voAdmission = domain.getAdmissionDetailByPasEvent(voInWaiting.getPasEvent());
    if(voAdmission == null)
        return;

    form.getLocalContext().setAdmissionDetail(voAdmission);
    form.fireCustomControlValueChanged();
}
项目:openMAXIMS    文件:Logic.java   
private Image calculateInfants(InpatientEpisodeLiteVo inpatientEpisode)
{
    Image imgNumInfants = null;
    //get number of infants for this patient
    int count = domain.countInfants(inpatientEpisode.getPasEvent().getPatient());

    if(count == 1)
        imgNumInfants = form.getImages().Core.Infant1;
    if(count == 2)
        imgNumInfants = form.getImages().Core.Infant2;
    if(count == 3)
        imgNumInfants = form.getImages().Core.Infant3;
    if(count == 4)
        imgNumInfants = form.getImages().Core.Infant4;
    if(count == 5)
        imgNumInfants = form.getImages().Core.Infant5;
    if(count == 6)
        imgNumInfants = form.getImages().Core.Infant6;
    if(count == 7)
        imgNumInfants = form.getImages().Core.Infant7;
    if(count == 8)
        imgNumInfants = form.getImages().Core.Infant8;

    return imgNumInfants;
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdHomeLeaveSelectionChanged() throws PresentationLogicException 
{
    form.getLocalContext().setAdmissionDetail(null);
    clearScreen();
    if(form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue() == null)
        return;

    form.dteHLDateReturn().setEnabled(true);
    form.timHLTimeOfReturn().setEnabled(true);
    form.dteHLDateReturn().setValue(new Date());

    form.getLocalContext().setRecordSelected(true);

    InpatientEpisodeLiteVo voInWaiting = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
    AdmissionDetailVo voAdmission = domain.getAdmissionDetailByPasEvent(voInWaiting.getPasEvent());
    if(voAdmission == null)
        return;

    form.getLocalContext().setAdmissionDetail(voAdmission);
    form.fireCustomControlValueChanged();
}
项目:openMAXIMS    文件:BedInfoDialogImpl.java   
public void saveInternalTransfer(InpatientEpisodeLiteVo inpatEpis, BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
    if (bedSpaceState == null)
        throw new CodingRuntimeException("bedSpaceState is null in method saveInternalTransfer");
    if (inpatEpis == null)
        throw new CodingRuntimeException("inpatEpis is null in method saveInternalTransfer");

    BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
    InpatientEpisode doInpatEpis = InpatientEpisodeLiteVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatEpis);
    doInpatEpis.getBed().getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.AVAILABLE));
    doInpatEpis.getBed().setInpatientEpisode(null);
    getDomainFactory().save(doInpatEpis);

    doBedSpaceState.setInpatientEpisode(doInpatEpis);
    doBedSpaceState.getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.OCCUPIED));
    doInpatEpis.setBed(doBedSpaceState);

    getDomainFactory().save(doInpatEpis);
}
项目:AvoinApotti    文件:Logic.java   
private void populateEventControlsFromData(BedSpaceStateLiteVo voBedSpaceState)
{
    if (voBedSpaceState.getInpatientEpisode() == null)
        return;

    InpatientEpisodeLiteVo voInpatientEpisode = voBedSpaceState.getInpatientEpisode();
    populateEventControlsFromData(voInpatientEpisode);
}
项目:AvoinApotti    文件:Logic.java   
private DischargedEpisodeADTVo createInfantDischarge(InpatientEpisodeLiteVo voInpat)
{
    DischargedEpisodeADTVo voDischargedEpisode = new DischargedEpisodeADTVo();

    voDischargedEpisode.setDischargeDateTime(form.lyrDetail().tabDischarge().dtimDischarge().getValue());
    voDischargedEpisode.setDischargeDestination(form.lyrDetail().tabDischarge().cmbDischargeDestination().getValue());
    voDischargedEpisode.setMethodOfDischarge(form.lyrDetail().tabDischarge().cmbMethodDischarge().getValue());

    BedSpaceStateLiteVo voBedSpaceState = domain.getBedSpaceStateByInpatientEpisode(voInpat);
    if (voBedSpaceState != null && voBedSpaceState.getInpatientEpisodeIsNotNull())
    {
        voDischargedEpisode.setPasEvent(voBedSpaceState.getInpatientEpisode().getPasEvent());
        voDischargedEpisode.setConsultantStays(voBedSpaceState.getInpatientEpisode().getConsultantStays());
        voDischargedEpisode.setWardStays(voBedSpaceState.getInpatientEpisode().getWardStays());
    }
    else
        voDischargedEpisode.setPasEvent(voInpat.getPasEvent());

    // move to previous
    if (voBedSpaceState != null && voBedSpaceState.getCurrentBedStatusIsNotNull())
    {
        voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
        voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
        voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
        voBedSpaceState.getCurrentBedStatus().setBedStatus(form.lyrDetail().tabDischarge().chkAllocateForCleaning().getValue() ? BedStatus.FOR_CLEANING : BedStatus.AVAILABLE);
    }

    voDischargedEpisode.setIsActive(true);
    voDischargedEpisode.setBedSpaceForInfant(voBedSpaceState);
    return voDischargedEpisode;
}
项目:AvoinApotti    文件:Logic.java   
private SelectItemVoCollection chooseInfantsToTransfer()
{
    SelectItemVoCollection voCollItems = new SelectItemVoCollection();
    boolean isMaternityInpatient = form.getGlobalContext().Core.getSelectedBedSpaceStateIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisodeIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getIsMaternityInpatientIsNotNull() ? form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getIsMaternityInpatient() : false;
    if (isMaternityInpatient)
    {
        PatientShort voPatient = form.getGlobalContext().Core.getSelectedBedSpaceStateIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisodeIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEventIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEvent().getPatientIsNotNull() ? form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEvent().getPatient() : null;
        if (voPatient != null)
        {
            InpatientEpisodeLiteVoCollection voCollInfants = form.getLocalContext().getInfants();
            if (voCollInfants != null)
            {
                // go through collection creating transfer records for each
                // infant
                for (InpatientEpisodeLiteVo voInpat : voCollInfants)
                {
                    SelectItemVo voSelectItem = new SelectItemVo();
                    voSelectItem.setItem(createInfantTransfer(voInpat));
                    voSelectItem.setSelected(Boolean.FALSE);
                    voCollItems.add(voSelectItem);
                }
            }
        }
    }

    return voCollItems.size() > 0 ? voCollItems : null;
}
项目:AvoinApotti    文件:Logic.java   
private void populateBedMoveTabFromData()
{
    if (form.getGlobalContext().Core.getADTWard() == null)
        throw new CodingRuntimeException("Ward not set in populateBedMoveTabFromData");

    form.lyrDetail().tabBedMove().grdPatients().getRows().clear();

    InpatientEpisodeLiteVoCollection voCollInpatient = domain.listInpatientEpisodeByWard(form.getGlobalContext().Core.getADTWard());
    if (voCollInpatient != null && voCollInpatient.size() > 0)
    {
        for (InpatientEpisodeLiteVo voInpat : voCollInpatient)
        {
            grdPatientsRow row = form.lyrDetail().tabBedMove().grdPatients().getRows().newRow();

            PatientShort voPatient = (voInpat.getPasEventIsNotNull() && voInpat.getPasEvent().getPatientIsNotNull()) ? voInpat.getPasEvent().getPatient() : null;
            if (voPatient != null)
            {
                if (voPatient.getNameIsNotNull())
                {
                    row.setColForename(voPatient.getName().getForename());
                    row.setColSurname(voPatient.getName().getSurname());
                }

                //WDEV-14525
                if(voPatient.getAge() == null)
                    voPatient.calculateAge();

                PatientId patId = voPatient.getDisplayId();
                row.setColDisplayId(patId != null ? patId.getValue() : null);
                row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
                row.setColAge(voPatient.getAgeText());
                row.setColDOB(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
            }
            row.setValue(voInpat);
        }
    }
    form.lyrDetail().tabBedMove().btnInternalTransfer().setEnabled(false);
}
项目:AvoinApotti    文件:Logic.java   
private void populateEstimatedDischargeTabFromData()
{
    InpatientEpisodeLiteVo voInpatEpis = null;
    BedSpaceStateLiteVo voBedSpaceStateLite = form.getGlobalContext().Core.getSelectedBedSpaceState();
    if (voBedSpaceStateLite != null)
        voInpatEpis = voBedSpaceStateLite.getInpatientEpisode();
    else if(form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull())
        voInpatEpis = form.getGlobalContext().Core.getSelectedWaitingAreaPatient();

    if (voInpatEpis == null)
        throw new CodingRuntimeException("voInpatEpis is null in method populateEstimatedDischargeTabFromData");

    form.lyrDetail().tabEstimatedDischarge().dteEstDischarge().setValue(voInpatEpis.getEstDischargeDate());

    //WDEV-13324
    form.lyrDetail().tabEstimatedDischarge().chkConfirm().setVisible(false);
    if ((voInpatEpis.getEstDischargeDate() != null && voInpatEpis.isDischargeDueWithin24Hrs()) || (voInpatEpis.getIsConfirmedDischargeIsNotNull() && voInpatEpis.getIsConfirmedDischarge()))
        form.lyrDetail().tabEstimatedDischarge().chkConfirm().setVisible(true);

    form.lyrDetail().tabEstimatedDischarge().chkConfirm().setValue(voInpatEpis.getIsConfirmedDischarge());

    //WDEV-12957
    if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
    {
        form.lyrDetail().tabEstimatedDischarge().dteDischargeReady().setValue(voInpatEpis.getDischargeReadyDate());
        form.lyrDetail().tabEstimatedDischarge().btnClearEstimate().setVisible(false); //WDEV-13130
    }

    //WDEV-14608
    if (form.lyrDetail().tabEstimatedDischarge().dteEstDischarge().getValue() != null)
    {
        Date newRevisedDate = new Date();
        newRevisedDate.addDay(1);

        if (!form.lyrDetail().tabEstimatedDischarge().dteEstDischarge().getValue().isLessOrEqualThan(newRevisedDate))
        {
            form.lyrDetail().tabEstimatedDischarge().chkConfirm().setVisible(false);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void cmbInfantHospitalValueChanged(boolean bUserCalled)
{
    form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantWard().clear();

    if (form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantHospital().getValue() == null)
        return;

    LocationLiteVoCollection voCollWards = domain.listActiveWardsForHospitalLite(form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantHospital().getValue());
    if (voCollWards != null)
    {
        for (LocationLiteVo voWard : voCollWards)
        {
            // exclude current infant ward
            InpatientEpisodeLiteVo voInpatEpis = form.lyrDetail().tabInfants().grdInfants().getValue();
            if (voInpatEpis != null && voInpatEpis.getPasEventIsNotNull() && voInpatEpis.getPasEvent().getLocationIsNotNull())
            {
                if (voWard.equals(voInpatEpis.getPasEvent().getLocation()))
                    continue;
            }

            form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantWard().newRow(voWard, voWard.getName());
        }

        if (voCollWards.size() == 1)
            form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantWard().setValue(voCollWards.get(0));
        else if (voCollWards.size() > 0)
        {
            if (!bUserCalled)
                form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantWard().showOpened();
        }

    }
}
项目:AvoinApotti    文件:Logic.java   
protected void setCareContextIfApplicable(DynamicGridRow row)
{
    if(row.getIdentifier() instanceof PASEventRefVo)
        form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent((PASEventRefVo) row.getIdentifier())); 
    else if(row.getIdentifier() instanceof PendingTransfersLiteVo)
    {
        if(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisodeIsNotNull())
            form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisode().getPasEvent()));
    }
    else if(row.getIdentifier() instanceof PendingTransfersLiteVo)
    {
        if(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisodeIsNotNull())
            form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisode().getPasEvent()));
    }
    else if(row.getIdentifier() instanceof InpatientEpisodeLiteVo)
    {
        form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((InpatientEpisodeLiteVo)row.getIdentifier()).getPasEvent()));
    }
    else if(row.getIdentifier() instanceof PendingElectiveAdmissionAdmitVo)
    {
        form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingElectiveAdmissionAdmitVo)row.getIdentifier()).getPasEvent()));
    }
    else
        form.getGlobalContext().Core.setCurrentCareContext(null);

    resetPIDBarText();//WDEV-14476 

}
项目:AvoinApotti    文件:TemplateGenerationImpl.java   
public InpatientEpisodeLiteVo getInpatientEpisodes(PatientRefVo patientId) 
{
    DomainFactory factory = getDomainFactory();
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql = " from InpatientEpisode ip "; 
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";
    if (patientId != null)
    {
        condStr.append(andStr + " ip.pasEvent.patient.id = :patient");
        markers.add("patient");
        values.add(patientId.getID_Patient());
        andStr = " and ";
    }


    if (andStr.equals(" and "))
    {
        hql += " where ";
    }

    hql += condStr.toString();
    List ips = factory.find(hql, markers, values);

    if(ips != null && ips.size() > 0)
    {
        InpatientEpisodeLiteVoCollection tempColl = InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(ips);
        if(tempColl != null && tempColl.size() > 0)
            return tempColl.get(0);
        else
            return null;
    }
    else
        return null;
}
项目:AvoinApotti    文件:BedInfoDialogImpl.java   
public InpatientEpisodeLiteVo geInpatientEpisodeLiteVoById( InpatientEpisodeRefVo inparEpRef) 
{
    if( inparEpRef == null || inparEpRef.getID_InpatientEpisode() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    InpatientEpisode doInpatientEpisode = (InpatientEpisode) factory.getDomainObject(InpatientEpisode.class, inparEpRef.getID_InpatientEpisode());

    return InpatientEpisodeLiteVoAssembler.create(doInpatientEpisode);
}
项目:AvoinApotti    文件:BedAdmissionComponentImpl.java   
public InpatientEpisodeLiteVo getInpatientEpisode(InpatientEpisodeRefVo inpatientRef)
{
    if(inpatientRef == null)
    {
        throw new CodingRuntimeException("Cannot get InpatientEpisode on null Id.");
    }

    return InpatientEpisodeLiteVoAssembler.create((InpatientEpisode) getDomainFactory().getDomainObject(InpatientEpisode.class, inpatientRef.getID_InpatientEpisode()));
}
项目:openMAXIMS    文件:Logic.java   
private boolean isPatientOnTrackingMove(InpatientEpisodeLiteVo inpatientEpisode)
{
    if (inpatientEpisode == null || inpatientEpisode.getCurrentTrackingMovement() == null)
        return false;

    if (Boolean.TRUE.equals(inpatientEpisode.getCurrentTrackingMovement().getPatientReturned()))
        return false;

    return true;
}
项目:openMAXIMS    文件:Logic.java   
private void populateEventControlsFromData(BedSpaceStateLiteVo voBedSpaceState)
{
    if (voBedSpaceState.getInpatientEpisode() == null)
        return;

    InpatientEpisodeLiteVo voInpatientEpisode = voBedSpaceState.getInpatientEpisode();
    form.getLocalContext().setAdmissionDetails(getAdmissionDetail());
    populateEventControlsFromData(voInpatientEpisode);
}
项目:openMAXIMS    文件:Logic.java   
private DischargedEpisodeADTVo createInfantDischarge(InpatientEpisodeLiteVo voInpat)
{
    DischargedEpisodeADTVo voDischargedEpisode = new DischargedEpisodeADTVo();

    voDischargedEpisode.setDischargeDateTime(form.lyrDetail().tabDischarge().dtimDischarge().getValue());
    voDischargedEpisode.setDischargeDestination(form.lyrDetail().tabDischarge().cmbDischargeDestination().getValue());
    voDischargedEpisode.setMethodOfDischarge(form.lyrDetail().tabDischarge().cmbMethodDischarge().getValue());

    BedSpaceStateLiteVo voBedSpaceState = domain.getBedSpaceStateByInpatientEpisode(voInpat);
    if (voBedSpaceState != null && voBedSpaceState.getInpatientEpisodeIsNotNull())
    {
        voDischargedEpisode.setPasEvent(voBedSpaceState.getInpatientEpisode().getPasEvent());
        voDischargedEpisode.setConsultantStays(voBedSpaceState.getInpatientEpisode().getConsultantStays());
        voDischargedEpisode.setWardStays(voBedSpaceState.getInpatientEpisode().getWardStays());
    }
    else
        voDischargedEpisode.setPasEvent(voInpat.getPasEvent());

    // move to previous
    if (voBedSpaceState != null && voBedSpaceState.getCurrentBedStatusIsNotNull())
    {
        voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
        voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
        voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
        voBedSpaceState.getCurrentBedStatus().setBedStatus(form.lyrDetail().tabDischarge().chkAllocateForCleaning().getValue() ? BedStatus.FOR_CLEANING : BedStatus.AVAILABLE);
    }

    voDischargedEpisode.setIsActive(true);
    voDischargedEpisode.setBedSpaceForInfant(voBedSpaceState);
    return voDischargedEpisode;
}
项目:openMAXIMS    文件:Logic.java   
private void populateHomeLeaveInstanceControls(boolean isCancelSelected)
{
    clearHomeLeaveReturnControls();

    InpatientEpisodeLiteVo voInpatEpis = form.getGlobalContext().Core.getSelectedBedSpaceStateIsNotNull()  ? form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode() : form.getGlobalContext().Core.getSelectedWaitingAreaPatient();
    populateHomeLeaveReturnControls(voInpatEpis,isCancelSelected);
}
项目:openmaxims-linux    文件:Logic.java   
private void cmbInfantHospitalValueChanged(boolean bUserCalled)
{
    form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantWard().clear();

    if (form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantHospital().getValue() == null)
        return;

    LocationLiteVoCollection voCollWards = domain.listActiveWardsForHospitalLite(form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantHospital().getValue());
    if (voCollWards != null)
    {
        for (LocationLiteVo voWard : voCollWards)
        {
            // exclude current infant ward
            InpatientEpisodeLiteVo voInpatEpis = form.lyrDetail().tabInfants().grdInfants().getValue();
            if (voInpatEpis != null && voInpatEpis.getPasEventIsNotNull() && voInpatEpis.getPasEvent().getLocationIsNotNull())
            {
                if (voWard.equals(voInpatEpis.getPasEvent().getLocation()))
                    continue;
            }

            form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantWard().newRow(voWard, voWard.getName());
        }

        if (voCollWards.size() == 1)
            form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantWard().setValue(voCollWards.get(0));
        else if (voCollWards.size() > 0)
        {
            if (!bUserCalled)
                form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().cmbInfantWard().showOpened();
        }

    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateInfantsToGrid(InpatientEpisodeLiteVoCollection voCollInpatient)
{
    form.lyrDetail().tabInfants().grdInfants().getRows().clear();
    if (voCollInpatient == null)
        return;
    if (voCollInpatient != null && voCollInpatient.size() > 0)
    {
        for (InpatientEpisodeLiteVo voInpat : voCollInpatient)
        {
            grdInfantsRow row = form.lyrDetail().tabInfants().grdInfants().getRows().newRow();

            if(voInpat.getPasEventIsNotNull() && voInpat.getPasEvent().getLocationIsNotNull())
                row.setColLocation(voInpat.getPasEvent().getLocation().getName());

            PatientLite_IdentifiersVo voPatient = (voInpat.getPasEventIsNotNull() && voInpat.getPasEvent().getPatientIsNotNull()) ? voInpat.getPasEvent().getPatient() : null;
            if (voPatient != null)
            {
                if (voPatient.getNameIsNotNull())
                {
                    row.setColForename(voPatient.getName().getForename());
                    row.setColSurname(voPatient.getName().getSurname());
                }

                PatientId patId = voPatient.getDisplayId();
                row.setColDisplayId(patId != null ? patId.getValue() : null);
                row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
                row.setColDOB(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
            }
            row.setValue(voInpat);
        }
    }
}