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

项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to create the Consultant Stay record
 * @return
 */
private ConsultantStayVo createConsultantStay()
{
    ConsultantStayVo consultantStay = new ConsultantStayVo();

    consultantStay.setConsultant(domain.getMedicFull(form.qmbConsultant().getValue()));

    consultantStay.setTransferDateTime(form.dtimAdmitDateTime().getValue());
    consultantStay.setEndDateTime(null);

    consultantStay.setService(form.qmbService().getValue());
    consultantStay.setSpecialty(form.cmbSpecialty().getValue());
    consultantStay.setPatientStatus(form.cmbPatientCategory().getValue());

    consultantStay.setCodingStatus(CodingStatus.UNCODED);

    // Return Consultant Stay
    return consultantStay;
}
项目:openMAXIMS    文件:Logic.java   
private ConsultantStayVo getCurrentConsultantStay(ConsultantStayVoCollection consultantStays)
{
    if(consultantStays == null)
        return null;

    for(ConsultantStayVo cs : consultantStays)
    {
        if(cs != null && cs.getEndDateTime() == null)
            return cs;
    }

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void rieConsultantStay() throws PresentationLogicException {
    ConsultantStayVo consultantStay = form.ctn1().grdConsultantTransfersGrid().getValue();
    try {
        domain.rIEConsultantStay(consultantStay, form.grdHistoricalInpatientEpisodes().getValue());
    } catch (StaleObjectException e) {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        open();
        return;
    }
    open();
}
项目:openMAXIMS    文件:Logic.java   
protected void onBtnEditConsultantTransferClick() throws PresentationLogicException
{
    if(form.ctn1().grdConsultantTransfersGrid().getSelectedRow()==null)
    {
        engine.showMessage("Please select a Stay to Edit.");
        return;
    }
    ConsultantStayVo consultantStay = form.ctn1().grdConsultantTransfersGrid().getValue();
    boolean isDischargedEpisodeSelected = form.grdHistoricalInpatientEpisodes().getValue() != null; //WDEV-23203
    engine.open(form.getForms().Core.WardConsultantSpecialtyTransferDlg, new Object[]{WardConsultationSpecialtyTransfer.CONSULTATION,consultantStay,getConsultantStays(), isDischargedEpisodeSelected},"Edit Consultant Stay"); //WDEV-23203

}
项目:openMAXIMS    文件:Logic.java   
@Override
public int compare(ConsultantStayVo a, ConsultantStayVo b) {
    if(a!=null&&b!=null
            &&a.getTransferDateTime()!=null&&b.getTransferDateTime()!=null)
    {
        return a.getTransferDateTime().isGreaterThan( b.getTransferDateTime()) ? -1 : a.getTransferDateTime().equals(b.getTransferDateTime()) ? 0 : 1;
    }
    return 0;
}
项目:openMAXIMS    文件:Logic.java   
@Override
public int compare(ConsultantStayVo a, ConsultantStayVo b) {
    if(a.getTransferDateTimeIsNotNull()&&b.getTransferDateTimeIsNotNull())
    {
        return a.getTransferDateTime().isGreaterThan( b.getTransferDateTime()) ? -1 : a.getTransferDateTime().equals(b.getTransferDateTime()) ? 0 : 1;
    }
    else
    {
        return 0;
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateConsultantRowFromStay(grdConsultantTransfersGridRow row, ConsultantStayVo stay)
{
    if(stay!=null)
    {
        if(stay.getConsultantIsNotNull())
        {
            row.setColumnConsultant(stay.getConsultant().getIMosName());
            row.setCellColumnConsultantTooltip(stay.getConsultant().getIMosName());//WDEV-22948
        }
        if(stay.getTransferDateTimeIsNotNull())
        {
            row.setColumnDateFrom(stay.getTransferDateTime().getDate());
        }
        if(stay.getEndDateTimeIsNotNull())
        {
            row.setColumnDateTo(stay.getEndDateTime().getDate());
        }
        if(stay.getServiceIsNotNull())
        {
            row.setColService(stay.getService().getServiceName());
            row.setCellColServiceTooltip(stay.getService().getServiceName());//WDEV-22948
        }
        if(stay.getSpecialtyIsNotNull())
        {
            row.setColSpeciality(stay.getSpecialty().getText());
            row.setCellColSpecialityTooltip(stay.getSpecialty().getText());//WDEV-22948
        }
        if(stay.getPatientStatusIsNotNull())
        {
            row.setColumnCategory(stay.getPatientStatus().getText());
        }
        row.setValue(stay);
    }
}
项目:openMAXIMS    文件:Logic.java   
private String checkForOverLappingConsultantStay(WardConsultantSpecialtyTransferVo wardConsultantSpecialtyTransferVo,ConsultantStayVoCollection stays)
{
    if(stays!=null)
    {
        for (ConsultantStayVo stayVo : stays) {
            if(stayVo!=null&&stayVo.getID_ConsultantStay()!=null
                    &&form.getLocalContext().getWardStayIsNotNull()&&form.getLocalContext().getWardStay()!=null
                    &&stayVo.getID_ConsultantStay()!=form.getLocalContext().getWardStay().getID_WardStay())
            {
                if(stayVo.getTransferDateTimeIsNotNull()&&stayVo.getEndDateTimeIsNotNull()
                        &&wardConsultantSpecialtyTransferVo.getDateFromIsNotNull()
                        &&wardConsultantSpecialtyTransferVo.getDateFrom().isGreaterThan(stayVo.getTransferDateTime())
                        &&wardConsultantSpecialtyTransferVo.getDateFrom().isLessThan(stayVo.getEndDateTime()))
                {
                    return "From Date overlaps with existing stay";
                }
                if(stayVo.getTransferDateTimeIsNotNull()&&stayVo.getEndDateTimeIsNotNull()
                        &&wardConsultantSpecialtyTransferVo.getDateToIsNotNull()
                        &&wardConsultantSpecialtyTransferVo.getDateTo().isGreaterThan(stayVo.getTransferDateTime())
                        &&wardConsultantSpecialtyTransferVo.getDateTo().isLessThan(stayVo.getEndDateTime()))

                {
                    return "To Date overlaps with existing stay";
                }
            }
        }
    }
    return null;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Function used to create a Consultant Stay record on admission
 * @param consultant
 * @param patientCategory
 * @param transferDateTime
 * @param serviceLiteVo 
 * @param specialty
 * @return
 */
private ConsultantStayVo createConsultantStay(MedicVo consultant, PatientStatus patientCategory, DateTime transferDateTime, ServiceLiteVo serviceLiteVo, Specialty specialty)
{
    ConsultantStayVo consultantStay = new ConsultantStayVo();

    consultantStay.setConsultant(consultant);
    consultantStay.setPatientStatus(patientCategory);
    consultantStay.setTransferDateTime(transferDateTime);
    consultantStay.setService(serviceLiteVo);
    consultantStay.setSpecialty(specialty);

    return consultantStay;
}
项目:openMAXIMS    文件:InpatientEpisodeMaintenanceImpl.java   
@Override
public void rIEConsultantStay(ConsultantStayVo stay, DischargedEpisodeMaintenanceVo dischargedEpisode) throws StaleObjectException{
    DomainFactory factory = getDomainFactory();
    ConsultantStay stayDom = ConsultantStayVoAssembler.extractConsultantStay(factory, stay);
    stayDom.setIsRIE(true);
    factory.save(stayDom);

    if(dischargedEpisode != null)
    {
        DischargedEpisode episodeDom = (DischargedEpisode) factory.getDomainObject(DischargedEpisode.class, dischargedEpisode.getID_DischargedEpisode());
        episodeDom.getAdmissionDetail().setCodingStatus(getDomLookup(CodingStatus.FORREVIEW));
        factory.save(episodeDom);
    }
}
项目:AvoinApotti    文件:BedAdmissionComponentImpl.java   
public AdmissionDetailVo saveEmergencyAdmissionInElectiveCase(AdmissionDetailVo admission, CareSpellVo careSpell, CatsReferralEmergencyAdmissionVo catsReferral, BedSpaceStateLiteVo bedSpaceState, WardStayVo wardStay, ConsultantStayVo consultant) throws DomainInterfaceException, StaleObjectException
{
    if (admission == null)
        throw new CodingRuntimeException("Admission Details parameter is mandatory.");

    if (careSpell == null)
        throw new CodingRuntimeException("Care Spell parameter is mandatory.");

    if (catsReferral == null)
        throw new CodingRuntimeException("Cats Referral parameter is mandatory.");


    PatientPathwayJourneyRefVo journey = createPatientJourney(catsReferral, admission);
    catsReferral.setJourney(journey);

    @SuppressWarnings("rawtypes")
    HashMap domMap = new HashMap();
    AdmissionDetail domAdmissionDetail = AdmissionDetailVoAssembler.extractAdmissionDetail(getDomainFactory(), admission, domMap);
    CareSpell domCareSpell = CareSpellVoAssembler.extractCareSpell(getDomainFactory(), careSpell, domMap);
    CatsReferral domCatsReferral = CatsReferralEmergencyAdmissionVoAssembler.extractCatsReferral(getDomainFactory(), catsReferral, domMap);
    domCatsReferral.getCareContext().setPasEvent(domAdmissionDetail.getPasEvent());

    getDomainFactory().save(domAdmissionDetail);
    getDomainFactory().save(domCareSpell);
    getDomainFactory().save(domCatsReferral);

    InpatientEpisode inpatEpisode = new InpatientEpisode();
    inpatEpisode.setPasEvent(domAdmissionDetail.getPasEvent());
    inpatEpisode.getPasEvent().setConsultant(domAdmissionDetail.getConsultant());
    inpatEpisode.setAdmissionDateTime(domAdmissionDetail.getAdmissionDateTime());
    inpatEpisode.setEstDischargeDate(null);
    inpatEpisode.setWardType(domAdmissionDetail.getWardType());

    if (wardStay != null)
        inpatEpisode.getWardStays().add(WardStayVoAssembler.extractWardStay(getDomainFactory(), wardStay, domMap));
    if (consultant != null)
        inpatEpisode.getConsultantStays().add(ConsultantStayVoAssembler.extractConsultantStay(getDomainFactory(), consultant, domMap));

    BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState, domMap);   
    if(doBedSpaceState != null)
    {
        doBedSpaceState.setInpatientEpisode(inpatEpisode);  
        inpatEpisode.setBed(doBedSpaceState);
        inpatEpisode.setBedNo(doBedSpaceState.getBedSpace().getBedNumber());
    }

    if (wardStay != null && wardStay.getWardIsNotNull() && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true)
    {
        Location doloc = getLocation(wardStay.getWard().getID_Location(), getDomainFactory());
        if (doloc != null && !Boolean.TRUE.equals(doloc.isVTEAsessmentNotRequired()))
        {
            inpatEpisode.setVTEAssessmentStatus(getDomLookup(VTEAsessmentStatus.REQUIRED));
        }
    }

    getDomainFactory().save(inpatEpisode);

    return null;
}
项目:openMAXIMS    文件:AdmitToWardImpl.java   
public Boolean saveAdmissionAndUpdateList(AdmissionDetailVo admissionDetail, WardStayVo wardStay, ConsultantStayVo consultantStay, CareSpellAdmitVo careSpell, CatsReferralEmergencyAdmissionVo referral, Object selectedAdmissionData, PatientCaseNoteTransferVoCollection caseNoteTransfers) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException
    {
//      AdmissionDetail domAdmissionDetail = AdmissionDetailShortVoAssembler.extractAdmissionDetail(getDomainFactory(), admissionDetail);
//      getDomainFactory().save(domAdmissionDetail);

//      AdmissionDetailVo admissionDetails = AdmissionDetailVoAssembler.create(domAdmissionDetail);
//      admissionDetails.validate();


        PendingElectiveAdmissionAdmitVo pendingBookedElectiveAdmission = selectedAdmissionData instanceof PendingElectiveAdmissionAdmitVo ? (PendingElectiveAdmissionAdmitVo) selectedAdmissionData : null;
        PendingEmergencyAdmissionAdmitVo pendingEDEmergency = selectedAdmissionData instanceof PendingEmergencyAdmissionAdmitVo ? (PendingEmergencyAdmissionAdmitVo) selectedAdmissionData : null;
        PendingElectiveAdmissionAdmitVo pendingElectiveAdmission = selectedAdmissionData instanceof PendingElectiveAdmissionAdmitVo ? (PendingElectiveAdmissionAdmitVo) selectedAdmissionData : null;
        CatsReferralPendingEmergencyNonEDAdmissionListVo pendingEmergencyAdmission = selectedAdmissionData instanceof CatsReferralPendingEmergencyNonEDAdmissionListVo ? (CatsReferralPendingEmergencyNonEDAdmissionListVo) selectedAdmissionData : null;


        PatientElectiveListBedAdmissionVo patientTCI_ElectiveList = selectedAdmissionData instanceof PatientElectiveListBedAdmissionVo ? (PatientElectiveListBedAdmissionVo) selectedAdmissionData : null;

        AdmissionType admissionType = AdmissionType.EMERGENCY;


        BedAdmissionComponent impl = (BedAdmissionComponent) getDomainImpl(BedAdmissionComponentImpl.class);

        if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue()) && selectedAdmissionData instanceof PatientElectiveListBedAdmissionVo)
        {
            PatientElectiveListBedAdmissionVo electiveAdmission = impl.saveTCIAdmissionAndUpdateList(patientTCI_ElectiveList, null, wardStay, consultantStay, null, null, null, caseNoteTransfers);

            impl.createCaseNoteRequests(electiveAdmission);
        }
//      else if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue()) && selectedAdmissionData instanceof PatientLite_IdentifiersVo)
//      {
//          CareSpellVo careSpell = createCareSpell((PatientLite_IdentifiersVo) selectedAdmissionData, admissionDetail.getPasEvent(), admissionDetail.getAdmissionDateTime(), admissionDetail.getConsultant(), admissionDetail.getService());
//          CatsReferralEmergencyAdmissionVo catsReferral = createCatsReferral((PatientLite_IdentifiersVo) selectedAdmissionData, admissionDetail, careSpell);
//          
//          impl.saveEmergencyAdmissionInElectiveCase(admissionDetail,              // Admission Detail 
//                                                    careSpell,                    // Care Spell
//                                                    catsReferral,                 // Cats Referral
//                                                    null,                         // Bed Space State - null when Admitting to Ward
//                                                    wardStay,                     // Ward Stay
//                                                    consultantStay,               // Consultant Stay
//                                                    null,                         // Admission Reason 
//                                                    null,                         // Ward Mixed Sex Breach 
//                                                    null,                         // Ward Bay Config
//                                                    caseNoteTransfers);           // Patient Case Note Transfer
//      }
        else
        {
            impl.saveAdmissionAndUpdateList(admissionDetail,                        // Admission Detail
                                            null,                                   // Bed Space State - null when Admitting to Ward
                                            careSpell,
                                            referral,
                                            wardStay,                               // Ward Stay
                                            consultantStay,                         // Consultant Stay
                                            pendingBookedElectiveAdmission,         // Pending Elective Admission - Planned (Booked)
                                            pendingEDEmergency,                     // Pending Emergency Admission - ED
                                            pendingElectiveAdmission,               // Pending Elective Admission - (TCI)
                                            pendingEmergencyAdmission,              // Pending Emergency Admission - Non ED
                                            admissionType,                          // Admission Type
                                            null,                                   // Admission Reason
                                            null,                                   // Ward Mixed Sex Breach
                                            null,                                   // Ward Bay Config
                                            caseNoteTransfers);                     // Patient Case Note Transfer
        }

        //WDEV-21973 make sure patient has a Case Note Folder
        impl.createCaseNoteFolderIfNone(admissionDetail.getPasEvent().getPatient());

        return true;
    }
项目:openMAXIMS    文件:BedAdmissionComponentImpl.java   
public AdmissionDetailVo saveEmergencyAdmissionInElectiveCase(AdmissionDetailVo admission, CareSpellVo careSpell, CatsReferralEmergencyAdmissionVo catsReferral, BedSpaceStateLiteVo bedSpaceState, WardStayVo wardStay, ConsultantStayVo consultant) throws DomainInterfaceException, StaleObjectException
{
    if (admission == null)
        throw new CodingRuntimeException("Admission Details parameter is mandatory.");

    if (careSpell == null)
        throw new CodingRuntimeException("Care Spell parameter is mandatory.");

    if (catsReferral == null)
        throw new CodingRuntimeException("Cats Referral parameter is mandatory.");


    PatientPathwayJourneyRefVo journey = createPatientJourney(catsReferral, admission);
    catsReferral.setJourney(journey);

    @SuppressWarnings("rawtypes")
    HashMap domMap = new HashMap();
    AdmissionDetail domAdmissionDetail = AdmissionDetailVoAssembler.extractAdmissionDetail(getDomainFactory(), admission, domMap);
    CareSpell domCareSpell = CareSpellVoAssembler.extractCareSpell(getDomainFactory(), careSpell, domMap);
    CatsReferral domCatsReferral = CatsReferralEmergencyAdmissionVoAssembler.extractCatsReferral(getDomainFactory(), catsReferral, domMap);
    domCatsReferral.getCareContext().setPasEvent(domAdmissionDetail.getPasEvent());

    getDomainFactory().save(domAdmissionDetail);
    getDomainFactory().save(domCareSpell);
    getDomainFactory().save(domCatsReferral);

    InpatientEpisode inpatEpisode = new InpatientEpisode();
    inpatEpisode.setPasEvent(domAdmissionDetail.getPasEvent());
    inpatEpisode.getPasEvent().setConsultant(domAdmissionDetail.getConsultant());
    inpatEpisode.setAdmissionDateTime(domAdmissionDetail.getAdmissionDateTime());
    inpatEpisode.setEstDischargeDate(null);
    inpatEpisode.setWardType(domAdmissionDetail.getWardType());

    if (wardStay != null)
        inpatEpisode.getWardStays().add(WardStayVoAssembler.extractWardStay(getDomainFactory(), wardStay, domMap));
    if (consultant != null)
        inpatEpisode.getConsultantStays().add(ConsultantStayVoAssembler.extractConsultantStay(getDomainFactory(), consultant, domMap));

    BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState, domMap);   
    if(doBedSpaceState != null)
    {
        doBedSpaceState.setInpatientEpisode(inpatEpisode);  
        inpatEpisode.setBed(doBedSpaceState);
        inpatEpisode.setBedNo(doBedSpaceState.getBedSpace().getBedNumber());
    }

    if (wardStay != null && wardStay.getWardIsNotNull() && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true)
    {
        Location doloc = getLocation(wardStay.getWard().getID_Location(), getDomainFactory());
        if (doloc != null && !Boolean.TRUE.equals(doloc.isVTEAsessmentNotRequired()))
        {
            inpatEpisode.setVTEAssessmentStatus(getDomLookup(VTEAsessmentStatus.REQUIRED));
        }
    }

    getDomainFactory().save(inpatEpisode);

    return null;
}
项目:openmaxims-linux    文件:BedAdmissionComponentImpl.java   
public AdmissionDetailVo saveEmergencyAdmissionInElectiveCase(AdmissionDetailVo admission, CareSpellVo careSpell, CatsReferralEmergencyAdmissionVo catsReferral, BedSpaceStateLiteVo bedSpaceState, WardStayVo wardStay, ConsultantStayVo consultant) throws DomainInterfaceException, StaleObjectException
{
    if (admission == null)
        throw new CodingRuntimeException("Admission Details parameter is mandatory.");

    if (careSpell == null)
        throw new CodingRuntimeException("Care Spell parameter is mandatory.");

    if (catsReferral == null)
        throw new CodingRuntimeException("Cats Referral parameter is mandatory.");


    PatientPathwayJourneyRefVo journey = createPatientJourney(catsReferral, admission);
    catsReferral.setJourney(journey);

    @SuppressWarnings("rawtypes")
    HashMap domMap = new HashMap();
    AdmissionDetail domAdmissionDetail = AdmissionDetailVoAssembler.extractAdmissionDetail(getDomainFactory(), admission, domMap);
    CareSpell domCareSpell = CareSpellVoAssembler.extractCareSpell(getDomainFactory(), careSpell, domMap);
    CatsReferral domCatsReferral = CatsReferralEmergencyAdmissionVoAssembler.extractCatsReferral(getDomainFactory(), catsReferral, domMap);
    domCatsReferral.getCareContext().setPasEvent(domAdmissionDetail.getPasEvent());

    getDomainFactory().save(domAdmissionDetail);
    getDomainFactory().save(domCareSpell);
    getDomainFactory().save(domCatsReferral);

    InpatientEpisode inpatEpisode = new InpatientEpisode();
    inpatEpisode.setPasEvent(domAdmissionDetail.getPasEvent());
    inpatEpisode.getPasEvent().setConsultant(domAdmissionDetail.getConsultant());
    inpatEpisode.setAdmissionDateTime(domAdmissionDetail.getAdmissionDateTime());
    inpatEpisode.setEstDischargeDate(null);
    inpatEpisode.setWardType(domAdmissionDetail.getWardType());

    if (wardStay != null)
        inpatEpisode.getWardStays().add(WardStayVoAssembler.extractWardStay(getDomainFactory(), wardStay, domMap));
    if (consultant != null)
        inpatEpisode.getConsultantStays().add(ConsultantStayVoAssembler.extractConsultantStay(getDomainFactory(), consultant, domMap));

    BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState, domMap);   
    if(doBedSpaceState != null)
    {
        doBedSpaceState.setInpatientEpisode(inpatEpisode);  
        inpatEpisode.setBed(doBedSpaceState);
        inpatEpisode.setBedNo(doBedSpaceState.getBedSpace().getBedNumber());
    }

    if (wardStay != null && wardStay.getWardIsNotNull() && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true)
    {
        Location doloc = getLocation(wardStay.getWard().getID_Location(), getDomainFactory());
        if (doloc != null && !Boolean.TRUE.equals(doloc.isVTEAsessmentNotRequired()))
        {
            inpatEpisode.setVTEAssessmentStatus(getDomLookup(VTEAsessmentStatus.REQUIRED));
        }
    }

    getDomainFactory().save(inpatEpisode);

    return null;
}