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

项目:openMAXIMS    文件:BedInfoDialogImpl.java   
public BedSpaceStateLiteVo getBedSpaceStateByInpatientEpisode(InpatientEpisodeRefVo inpat)
{
    if (inpat == null || inpat.getID_InpatientEpisode() == null)
        throw new CodingRuntimeException("inpat is null or id not provided in method getBedSpaceStateByInpatientEpisode");

    String hql = "from BedSpaceState as bed where bed.inpatientEpisode.id = " + inpat.getID_InpatientEpisode();
    List lstBeds = getDomainFactory().find(hql);
    if(lstBeds != null && lstBeds.size() == 1)
        return BedSpaceStateLiteVoAssembler.create((BedSpaceState) lstBeds.get(0));

    return null;
}
项目:AvoinApotti    文件:Logic.java   
private void populateConsultantTransferTabFromData()
{
    form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue("");
    BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();
    if(voBedSpaceState != null)
    {
        if(voBedSpaceState.getInpatientEpisodeIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEventIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
            form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());
    }
    else if (form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull())
    {
        InPatientEpisodeADTVo voEpisode = domain.getInpatientEpisode(form.getGlobalContext().Core.getSelectedWaitingAreaPatient());
        if (voEpisode != null && voEpisode.getPasEventIsNotNull() && voEpisode.getPasEvent().getConsultantIsNotNull()) //WDEV-16004
            form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voEpisode.getPasEvent().getConsultant().getIMosName());
    }

    form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().initialize(MosType.MEDIC);
    form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().isRequired(true);
    form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().dtimConsultantTransfer().setValue(new DateTime());
}
项目:AvoinApotti    文件:Logic.java   
private void populateGrid(BedSpaceStateLiteVoCollection availableBeds) 
{   
    if (availableBeds != null)
    {
        for (BedSpaceStateLiteVo item: availableBeds)
        {
            grdAvailableBedsRow row = form.grdAvailableBeds().getRows().newRow();

            row.setColWard(item.getWardIsNotNull() && item.getWard().getNameIsNotNull() ? item.getWard().getName() : "");
            row.setColLocation(item.getBedSpaceIsNotNull() && item.getBedSpace().getWardTypeIsNotNull() ? item.getBedSpace().getWardType().toString() : "");
            //WDEV-18010
            row.setColBedNumber(item.getBedSpaceIsNotNull() && item.getBedSpace().getBedNumberIsNotNull() ? item.getBedSpace().getBedNumber() : "");
            row.setTooltipForColBedNumber(item.getBedSpace().getBedNumberIsNotNull() ? item.getBedSpace().getBedNumber() : "");
            row.setColBedType(item.getBedSpaceIsNotNull() && item.getBedSpace().getBedSpaceTypeIsNotNull() ? item.getBedSpace().getBedSpaceType().toString() : "");
            row.setColBedStatus(item.getBedSpaceIsNotNull() && item.getCurrentBedStatusIsNotNull() && item.getCurrentBedStatus().getBedStatusIsNotNull() ? item.getCurrentBedStatus().getBedStatus().toString() : "");
            row.setColComments(item.getCommentIsNotNull() ? item.getComment().toString() : "");
            //WDEV-8334
            row.setTooltipForColComments(item.getCommentIsNotNull() ? item.getComment().toString() : "");
            row.setValue(item);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void hideTabs()
{
    boolean hasHomeLeaves = false;//    WDEV-14563

    BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();//  WDEV-14563
    if(voBed != null)// WDEV-14563
    {       
        hasHomeLeaves = domain.hasHomeLeavesByWard(voBed.getWard());
    }

    if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue()=="WST" || !hasHomeLeaves)//    WDEV-14563
    {
        form.lyrAdmission().tabHomeLeave().setVisible(false);
        form.lyrAdmission().tabHomeLeave().setHeaderVisible(false);         
    }   
}
项目:AvoinApotti    文件:WardBayConfigDialogImpl.java   
private BedSpaceStateLiteVo getBedSpaceState(BedSpace bed) 
{
    if (bed == null || bed.getId() == null)
        return null;

    String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getId();
    List bedState = getDomainFactory().find(hql);

    BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);

    if (voColl != null &&
            voColl.size() > 0)
        return voColl.get(0);       

    return null;
}
项目: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);
}
项目:openMAXIMS    文件:Logic.java   
private void setBedTypeLabels(BedSpaceStateLiteVo selectedBedSpaceState)
{
    String str = getBedSpaceTypeDescriptor(selectedBedSpaceState);

    form.lblBedNumber().setValue(str + " Number:");
    form.lyrDetail().tabTransfer().lyrTransfer().tabIn().lblAllocateBedTransf().setValue("Allocate Source\n" + str + " for Cleaning:");
    form.lyrDetail().tabTransfer().lyrTransfer().tabOut().lblBedReadyTime().setValue(str + " Available Date:");
    form.lyrDetail().tabDischarge().lblAllocateForCleaning().setValue("Allocate " + str + " For Cleaning:");
    form.lyrDetail().tabHomeLeave().lblRetainBedHL().setValue("Retain Patient's " + str);
    form.lyrDetail().tabHomeLeaveReturn().btnUnretain().setText(" Vacate " + str);
    form.lyrDetail().tabHLeaveReturnCancel().lblCancelHlRetainBed().setValue("Retained Patient's " + str);
    form.lyrDetail().tabCloseBed().lblBedStatusChangeDte().setValue("Date/Time " + str + " Status Last Changed");
    form.lyrDetail().tabCloseBed().lblBedStatusChangeUser().setValue(str + " Status Last Changed by User:");
    form.lyrDetail().tabCloseBed().btnClose().setText(" Close " + str);
    form.lyrDetail().tabBedMove().btnSwitchBeds().setText(" Swap " + str);
    form.lyrDetail().tabBedMove().btnInternalTransfer().setText(" Transfer to " + str);


}
项目:openMAXIMS    文件:Logic.java   
private WardMixedSexBreachVo populateWardMixedSexBreach(DateTime transferDateTime, BedSpaceStateLiteVo bedSpaceStateLiteVo, AdmissionReasonVo admissionReasonVo, Integer maleCount, Integer femaleCount)
{
    WardMixedSexBreachVo vo = new WardMixedSexBreachVo();

    vo.setWard(bedSpaceStateLiteVo.getWard());
    vo.setBay(bedSpaceStateLiteVo.getBay());
    vo.setFemalePatients(femaleCount);
    vo.setMalePatients(maleCount);
    vo.setAdmissionDateTime(transferDateTime);
    Object mosUser = domain.getMosUser();
    if (mosUser != null)
        vo.setMemberOfStaff((MemberOfStaffLiteVo) mosUser);
    vo.setReasonForGenderBreach(admissionReasonVo.getReasonForMixingBayGender());
    vo.setReasonForGenderBreachComment(admissionReasonVo.getReasonForMixingBayGenderComment());

    return vo;
}
项目:openMAXIMS    文件:Logic.java   
private void populateGrid(BedSpaceStateLiteVoCollection availableBeds) 
{   
    if (availableBeds != null)
    {
        for (BedSpaceStateLiteVo item: availableBeds)
        {
            grdAvailableBedsRow row = form.grdAvailableBeds().getRows().newRow();

            row.setColWard(item.getWardIsNotNull() && item.getWard().getNameIsNotNull() ? item.getWard().getName() : "");
            row.setColLocation(item.getBedSpaceIsNotNull() && item.getBedSpace().getWardTypeIsNotNull() ? item.getBedSpace().getWardType().toString() : "");
            //WDEV-18010
            row.setColBedNumber(item.getBedSpaceIsNotNull() && item.getBedSpace().getBedNumberIsNotNull() ? item.getBedSpace().getBedNumber() : "");
            row.setTooltipForColBedNumber(item.getBedSpace().getBedNumberIsNotNull() ? item.getBedSpace().getBedNumber() : "");
            row.setColBedType(item.getBedSpaceIsNotNull() && item.getBedSpace().getBedSpaceTypeIsNotNull() ? item.getBedSpace().getBedSpaceType().toString() : "");
            row.setColBedStatus(item.getBedSpaceIsNotNull() && item.getCurrentBedStatusIsNotNull() && item.getCurrentBedStatus().getBedStatusIsNotNull() ? item.getCurrentBedStatus().getBedStatus().toString() : "");
            row.setColComments(item.getCommentIsNotNull() ? item.getComment().toString() : "");
            //WDEV-8334
            row.setTooltipForColComments(item.getCommentIsNotNull() ? item.getComment().toString() : "");
            row.setValue(item);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdAvailableBedsGridHeaderClicked(int column) throws PresentationLogicException
{       
    if (COL_BED_NO == column)
    {
        BedSpaceStateLiteVoCollection gridValues = form.grdAvailableBeds().getValues();
        if (gridValues.size() < 2)
            return;
        BedSpaceStateLiteVo selVal = form.grdAvailableBeds().getValue();

        form.getLocalContext().setSortOrderBedNo(SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrderBedNo()) ? SortOrder.DESCENDING : SortOrder.ASCENDING);
        gridValues.sort(BedSpaceStateLiteVo.getBedNumberComparator(form.getLocalContext().getSortOrderBedNo()));

        populateGrid(gridValues);
        if (selVal != null)
        {
            form.grdAvailableBeds().setValue(selVal);
        }
    }
    updateContextMenus();
}
项目:openMAXIMS    文件:Logic.java   
private void hideTabs()
{
    boolean hasHomeLeaves = false;//    WDEV-14563

    BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();//  WDEV-14563
    if(voBed != null)// WDEV-14563
    {       
        hasHomeLeaves = domain.hasHomeLeavesByWard(voBed.getWard());
    }

    if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue()=="WST" || !hasHomeLeaves)//    WDEV-14563
    {
        form.lyrAdmission().tabHomeLeave().setVisible(false);
        form.lyrAdmission().tabHomeLeave().setHeaderVisible(false);         
    }   
}
项目:openMAXIMS    文件:Logic.java   
private void populatehomeLeaveTabFromData() 
{
    form.getLocalContext().setRecordSelected(false);

    form.lyrAdmission().tabHomeLeave().grdHomeLeave().getRows().clear();

    BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
    if (voBed == null)
    {
        form.fireCustomControlValueChanged();
        return;
    }

    InpatientEpisodeLiteVoCollection voColl = domain.listHomeLeavesByWard(voBed.getWard());

    if(voColl == null || voColl.size() == 0)
    {
        form.fireCustomControlValueChanged();
        return;
    }

    populateHomeLeavesToGrid(voColl);   

    form.fireCustomControlValueChanged();
}
项目:openMAXIMS    文件:Logic.java   
private WardMixedSexBreachVo populateWardMixedSexBreach(AdmissionDetailVo admission, BedSpaceStateLiteVo bedSpaceStateLiteVo, AdmissionReasonVo admissionReasonVo, Integer maleCount, Integer femaleCount)
{
    WardMixedSexBreachVo vo = new WardMixedSexBreachVo();

    vo.setWard(bedSpaceStateLiteVo.getWard());
    vo.setBay(bedSpaceStateLiteVo.getBay());
    vo.setFemalePatients(femaleCount);
    vo.setMalePatients(maleCount);
    vo.setAdmissionDateTime(admission.getAdmissionDateTime());
    Object mosUser = domain.getMosUser();
    if (mosUser != null)
        vo.setMemberOfStaff((MemberOfStaffLiteVo) mosUser);
    vo.setReasonForGenderBreach(admissionReasonVo.getReasonForMixingBayGender());
    vo.setReasonForGenderBreachComment(admissionReasonVo.getReasonForMixingBayGenderComment());

    return vo;
}
项目:openmaxims-linux    文件: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);
}
项目:openmaxims-linux    文件:Logic.java   
private void populateConsultantTransferTabFromData()
{
    form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue("");
    BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();
    if(voBedSpaceState != null)
    {
        if(voBedSpaceState.getInpatientEpisodeIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEventIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
            form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());
    }
    else if (form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull())
    {
        InPatientEpisodeADTVo voEpisode = domain.getInpatientEpisode(form.getGlobalContext().Core.getSelectedWaitingAreaPatient());
        if (voEpisode != null && voEpisode.getPasEventIsNotNull() && voEpisode.getPasEvent().getConsultantIsNotNull()) //WDEV-16004
            form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voEpisode.getPasEvent().getConsultant().getIMosName());
    }

    form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().initialize(MosType.MEDIC);
    form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().isRequired(true);
    form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().dtimConsultantTransfer().setValue(new DateTime());
}
项目:openMAXIMS    文件:Logic.java   
private void populateWardAttendersTabFromData()
{
    form.getLocalContext().setRecordSelected(false);
    form.lyrAdmission().tabWardAttenders().grdWardAttenders().getRows().clear();

    BedSpaceStateLiteVo bed = form.getGlobalContext().Core.getSelectedBedSpaceState();

    BookAppointmentForWardAttendersVoCollection wardAppts = domain.listWardAttenders(bed != null ? bed.getWard() : null, form.lyrAdmission().tabWardAttenders().dteWard().getValue());

    if (wardAppts == null || wardAppts.size() == 0)
    {
        engine.showMessage("No results found.");
        return;
    }

    populateWardAttendancesGridFromData(wardAppts);
}
项目:openmaxims-linux    文件:Logic.java   
private void populateGrid(BedSpaceStateLiteVoCollection availableBeds) 
{   
    if (availableBeds != null)
    {
        for (BedSpaceStateLiteVo item: availableBeds)
        {
            grdAvailableBedsRow row = form.grdAvailableBeds().getRows().newRow();

            row.setColWard(item.getWardIsNotNull() && item.getWard().getNameIsNotNull() ? item.getWard().getName() : "");
            row.setColLocation(item.getBedSpaceIsNotNull() && item.getBedSpace().getWardTypeIsNotNull() ? item.getBedSpace().getWardType().toString() : "");
            //WDEV-18010
            row.setColBedNumber(item.getBedSpaceIsNotNull() && item.getBedSpace().getBedNumberIsNotNull() ? item.getBedSpace().getBedNumber() : "");
            row.setTooltipForColBedNumber(item.getBedSpace().getBedNumberIsNotNull() ? item.getBedSpace().getBedNumber() : "");
            row.setColBedType(item.getBedSpaceIsNotNull() && item.getBedSpace().getBedSpaceTypeIsNotNull() ? item.getBedSpace().getBedSpaceType().toString() : "");
            row.setColBedStatus(item.getBedSpaceIsNotNull() && item.getCurrentBedStatusIsNotNull() && item.getCurrentBedStatus().getBedStatusIsNotNull() ? item.getCurrentBedStatus().getBedStatus().toString() : "");
            row.setColComments(item.getCommentIsNotNull() ? item.getComment().toString() : "");
            //WDEV-8334
            row.setTooltipForColComments(item.getCommentIsNotNull() ? item.getComment().toString() : "");
            row.setValue(item);
        }
    }
}
项目:openMAXIMS    文件:WardBayConfigDialogImpl.java   
private BedSpaceStateLiteVo getBedSpaceState(BedSpace bed) 
{
    if (bed == null || bed.getId() == null)
        return null;

    String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getId();
    List<?> bedState = getDomainFactory().find(hql);

    BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);

    if (voColl != null &&
            voColl.size() > 0)
        return voColl.get(0);       

    return null;
}
项目:openmaxims-linux    文件:WardBayConfigDialogImpl.java   
private BedSpaceStateLiteVo getBedSpaceState(BedSpace bed) 
{
    if (bed == null || bed.getId() == null)
        return null;

    String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getId();
    List bedState = getDomainFactory().find(hql);

    BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);

    if (voColl != null &&
            voColl.size() > 0)
        return voColl.get(0);       

    return null;
}
项目:openMAXIMS    文件:BedInfoDialogImpl.java   
private BayTimesAdmissionBreachedVo populateBayTimesBreachedRecord(PendingTransfersLiteVo voTransfer, BedSpaceStateLiteVo voBedSpaceStateLite, AdmissionReasonVo admissionReasonVo)
{
    BayTimesAdmissionBreachedVo voBreach = new BayTimesAdmissionBreachedVo();

    voBreach.setAdmissionDateTime(voTransfer.getTransferRequestDateTime());
    voBreach.setWard(voTransfer.getDestinationWard());
    if (voBedSpaceStateLite != null)
        voBreach.setBay(voBedSpaceStateLite.getBay());
    Object mosUser = getHcpLiteUser();
    if (mosUser != null)
        voBreach.setMemberOfStaff(((HcpLiteVo) mosUser).getMos());
    voBreach.setReasonForAdmissionOutOfOpeningHours(admissionReasonVo.getReasonForAdmissionOutOfOpeningHours());
    voBreach.setReasonForAdmissionOutOfOpeningHoursComment(admissionReasonVo.getReasonForAdmissionOohComment());

    return voBreach;
}
项目:openMAXIMS    文件:WardBayConfigDialogImpl.java   
private BedSpaceStateLiteVo getBedSpaceState(BedSpace bed) 
{
    if (bed == null || bed.getId() == null)
        return null;

    String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getId();
    List bedState = getDomainFactory().find(hql);

    BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);

    if (voColl != null &&
            voColl.size() > 0)
        return voColl.get(0);       

    return null;
}
项目:openMAXIMS    文件:BedAdmissionComponentImpl.java   
private BayTimesAdmissionBreachedVo populateBayTimesBreachedRecord(AdmissionDetailVo admissionDetail, BedSpaceStateLiteVo voBedSpaceStateLite, AdmissionReasonVo admissionReasonVo)
{
    BayTimesAdmissionBreachedVo voBreach = new BayTimesAdmissionBreachedVo();

    voBreach.setAdmissionDateTime(admissionDetail.getAdmissionDateTime());
    voBreach.setWard(admissionDetail.getWard());
    if (voBedSpaceStateLite != null)
        voBreach.setBay(voBedSpaceStateLite.getBay());
    //WDEV-22353
    Object mosUser = getMosUser();
    if (mosUser != null)
        voBreach.setMemberOfStaff((MemberOfStaffLiteVo) mosUser);
    voBreach.setReasonForAdmissionOutOfOpeningHours(admissionReasonVo.getReasonForAdmissionOutOfOpeningHours());
    voBreach.setReasonForAdmissionOutOfOpeningHoursComment(admissionReasonVo.getReasonForAdmissionOohComment());

    return voBreach;
}
项目: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 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 cmbOutHospitalValueChanged(boolean bUserCalled)
{
    form.lyrDetail().tabTransfer().lyrTransfer().tabOut().cmbOutTransfer().clear();

    if (form.lyrDetail().tabTransfer().lyrTransfer().tabOut().cmbOutHospital().getValue() == null)
        return;

    LocationLiteVoCollection voCollWards = domain.listActiveWardsForHospitalLite(form.lyrDetail().tabTransfer().lyrTransfer().tabOut().cmbOutHospital().getValue());
    if (voCollWards != null)
    {
        for (LocationLiteVo voWard : voCollWards)
        {
            // exclude current ward
            BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();
            if (voBedSpaceState != null && voBedSpaceState.getWardIsNotNull())
            {
                if (voWard.equals(voBedSpaceState.getWard()))
                    continue;
            }

            form.lyrDetail().tabTransfer().lyrTransfer().tabOut().cmbOutTransfer().newRow(voWard, voWard.getName());
        }

        if (voCollWards.size() == 1)
            form.lyrDetail().tabTransfer().lyrTransfer().tabOut().cmbOutTransfer().setValue(voCollWards.get(0));
        else if (voCollWards.size() > 0)
        {
            if (!bUserCalled)
                form.lyrDetail().tabTransfer().lyrTransfer().tabOut().cmbOutTransfer().showOpened();
        }

    }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onBtnCloseClick() throws PresentationLogicException
{
    BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

    if (voBedSpaceState == null)
        throw new CodingRuntimeException("voBedSpaceState is null in method onBtnCloseClick");

    // move to previous
    if (voBedSpaceState.getCurrentBedStatusIsNotNull())
    {
        voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
        voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
        voBedSpaceState.getCurrentBedStatus().setStatusDateTime(form.lyrDetail().tabCloseBed().dtimClose().getValue());
        voBedSpaceState.getCurrentBedStatus().setBedStatus(BedStatus.CLOSED);
    }

    String[] arrErrors = voBedSpaceState.validate(getUIValidationForCloseBed());
    if (arrErrors != null)
    {
        engine.showErrors(arrErrors);
        return;
    }

    try
    {
        domain.saveCloseBed(voBedSpaceState, form.lyrDetail().tabCloseBed().cmbUser().getValue(), form.lyrDetail().tabCloseBed().cmbCloseReason().getValue(), form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
    }
    catch (StaleObjectException e)
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        initialise();
        engine.close(DialogResult.OK);
        return;
    }

    engine.close(DialogResult.OK);
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onBtnInternalTransferClick() throws PresentationLogicException
{
    if (form.getGlobalContext().Core.getSelectedBedSpaceStateIsNotNull() && form.lyrDetail().tabBedMove().grdPatients().getValue() != null)
    {
        //WDEV-16030
        BedSpaceStateLiteVo domainBedSpaceState = domain.getBedSpaceStateStatusByBedId(form.lyrDetail().tabBedMove().grdPatients().getValue().getBed());

        if (domainBedSpaceState != null && domainBedSpaceState.getCurrentBedStatus() != null && BedStatus.OCCUPIED.equals(domainBedSpaceState.getCurrentBedStatus().getBedStatus()))
        {
            BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();
            voBedSpaceState.setInpatientEpisode(form.lyrDetail().tabBedMove().grdPatients().getValue());

            try
            {
                domain.saveInternalTransfer(form.lyrDetail().tabBedMove().grdPatients().getValue(), voBedSpaceState);
            }
            catch (StaleObjectException e)
            {
                engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
                populateBedMoveTabFromData();
            }
        }
        else
        {
            engine.showMessage("Patient has already been moved to another bed.");
        }

        engine.close(DialogResult.OK);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void addEditComment() 
{
    if (form.grdAvailableBeds().getSelectedRow() != null
        && form.grdAvailableBeds().getSelectedRow().getValue() != null)
    {
        BedSpaceStateLiteVo voBedState = domain.getBedSpaceState(form.grdAvailableBeds().getSelectedRow().getValue());
        form.getGlobalContext().Core.setCommentDialogString(voBedState.getComment());
        form.grdAvailableBeds().getSelectedRow().setValue(voBedState);
        engine.open(form.getForms().Core.CommentDialog);
    }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onBedPlannerBedAdded(Bed bed)
{
    BedSpaceStateLiteVo bedSpaceStatus = new BedSpaceStateLiteVo();
    BedSpaceVo bedSpace = new BedSpaceVo();
    bedSpaceStatus.setBedSpace(bedSpace);
    bed.setIdentifier(bedSpaceStatus);

    form.getGlobalContext().Core.setBedSpaceProperty(bed);
    engine.open(form.getForms().Core.BedSpacePropertyDialog);
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onBedPlannerBedClicked(Bed bed) 
{
    form.getGlobalContext().Core.setSelectedWaitingAreaPatient(null);
    form.getGlobalContext().Core.setBedInfoAction(null);
    form.dyngrdDisplay().setValue(null);

    form.getGlobalContext().Core.setPatientShort(null);
    if (bed != null && bed.getIdentifier() != null)
    {
        BedSpaceStateLiteVo bedSpaceState = domain.getBedSpaceState((BedSpaceVo) bed.getIdentifier());

        form.getGlobalContext().Core.setSelectedBedSpaceState(bedSpaceState);

        if (bedSpaceState != null && bedSpaceState.getInpatientEpisodeIsNotNull() 
                && bedSpaceState.getInpatientEpisode().getPasEventIsNotNull() 
                && bedSpaceState.getInpatientEpisode().getPasEvent().getPatientIsNotNull())
        {
            form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName());
            form.getGlobalContext().Core.setPatientShort(bedSpaceState.getInpatientEpisode().getPasEvent().getPatient());
        }

        if(bedSpaceState.getInpatientEpisode() != null)
            form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent(bedSpaceState.getInpatientEpisode().getPasEvent()));
    }

    resetPIDBarText();//WDEV-14476 

    //WDEV-9790
    engine.open(form.getForms().Core.BedInfoDialog, new Object[]{new Boolean(form.isReadOnly())});
}
项目:AvoinApotti    文件:BedInfoDialogImpl.java   
public ims.core.vo.DischargedEpisodeADTVo saveDischarge(DischargedEpisodeADTVo dischargedEpisode, BedSpaceStateLiteVo voBedSpacState) throws StaleObjectException, DomainInterfaceException, ForeignKeyViolationException
{   
    if(dischargedEpisode.getPasEventIsNotNull() && dischargedEpisode.getPasEvent().getPatientIsNotNull())
        return dischargePatient(dischargedEpisode.getPasEvent().getPatient(), dischargedEpisode, voBedSpacState, false, null);

    return null;
}
项目:AvoinApotti    文件:BedInfoDialogImpl.java   
public BedSpaceStateLiteVo saveCloseBed(BedSpaceStateLiteVo bedSpaceState, String user, ReasonForBedClosure reason, DateTime estReOpen) throws StaleObjectException
{
    if(bedSpaceState == null)
        throw new CodingRuntimeException("bedSpaceState is null in method saveCloseBed");

    BedSpaceState doBedSpace = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
    doBedSpace.getCurrentBedStatus().setEstReopeningDateTime(estReOpen != null ? estReOpen.getJavaDate() : null);
    doBedSpace.getCurrentBedStatus().setReasonForClosure(getDomLookup(reason));
    doBedSpace.getCurrentBedStatus().getSystemInformation().setCreationUser(user);

    getDomainFactory().save(doBedSpace);
    return BedSpaceStateLiteVoAssembler.create(doBedSpace);
}
项目:AvoinApotti    文件:BedInfoDialogImpl.java   
public void saveReOpenOrAssignBed(BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
    if(bedSpaceState == null)
        throw new CodingRuntimeException("bedSpaceState is null in method saveReOpenOrAssignBed");

    //WDEV-8507
    bedSpaceState.setInpatientEpisode(null);

    getDomainFactory().save(BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState));  
}
项目:AvoinApotti    文件:BedInfoDialogImpl.java   
public BedSpaceStateLiteVo getBedSpaceStateByInpatientEpisode(InpatientEpisodeRefVo inpat)
{
    if (inpat == null || inpat.getID_InpatientEpisode() == null)
        throw new CodingRuntimeException("inpat is null or id not provided in method getBedSpaceStateByInpatientEpisode");

    String hql = "from BedSpaceState as bed where bed.inpatientEpisode.id = " + inpat.getID_InpatientEpisode();
    List lstBeds = getDomainFactory().find(hql);
    if(lstBeds != null && lstBeds.size() == 1)
        return BedSpaceStateLiteVoAssembler.create((BedSpaceState) lstBeds.get(0));

    return null;
}
项目:AvoinApotti    文件:BedInfoDialogImpl.java   
public BedSpaceStateLiteVo getBedSpaceStateStatusByBedId(BedSpaceStateRefVo bedSpaceRef)
{
    if(bedSpaceRef == null || bedSpaceRef.getID_BedSpaceState() == null)
        throw new CodingRuntimeException("Cannot get BedSpaceState on null Id.");

    return BedSpaceStateLiteVoAssembler.create( (BedSpaceState)     getDomainFactory().getDomainObject(BedSpaceState.class, bedSpaceRef.getID_BedSpaceState()));
}
项目:AvoinApotti    文件:BedAdmissionComponentImpl.java   
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateRefVo bedRef)
{
    if(bedRef == null || bedRef.getID_BedSpaceState() == null)
        throw new CodingRuntimeException("Cannot get BedSpaceState on null Id.");

    return BedSpaceStateLiteVoAssembler.create( (BedSpaceState) getDomainFactory().getDomainObject(BedSpaceState.class, bedRef.getID_BedSpaceState()));
}
项目:AvoinApotti    文件:AvailableBedsImpl.java   
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceRefVo bed) 
{
    if(bed == null )
        throw new DomainRuntimeException("Invalid BedRefVo");

    DomainFactory factory = getDomainFactory();
    BedSpaceState domBed = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bed.getID_BedSpace());
    return BedSpaceStateLiteVoAssembler.create(domBed);
}
项目:AvoinApotti    文件:AvailableBedsImpl.java   
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateLiteVo bed) 
{
    if(bed == null )
        throw new DomainRuntimeException("Invalid BedRefVo");

    DomainFactory factory = getDomainFactory();
    BedSpaceState domBed = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bed.getID_BedSpaceState());
    return BedSpaceStateLiteVoAssembler.create(domBed);
}
项目:AvoinApotti    文件:AvailableBedsImpl.java   
public BedSpaceStateLiteVo saveBedSpaceState(BedSpaceStateLiteVo voBSS) throws DomainInterfaceException, StaleObjectException 
{
    if (!voBSS.isValidated())
        throw new CodingRuntimeException("BedSpaceStateLiteVo Record has not been validated");
    if(voBSS == null)
        throw new CodingRuntimeException("Cannot save null BedSpaceStateLiteVo");

    DomainFactory factory = getDomainFactory();

    BedSpaceState doBSS = BedSpaceStateLiteVoAssembler.extractBedSpaceState(factory, voBSS);
    factory.save(doBSS);
    return (BedSpaceStateLiteVoAssembler.create(doBSS));        
}