Java 类ims.core.vo.lookups.PreActiveActiveInactiveStatus 实例源码

项目:AvoinApotti    文件:Logic.java   
private void initialiseComponent(Boolean bEditMode)
{
    initialise();
    clearInstanceControls();
    form.setMode(FormMode.VIEW);
    form.getGlobalContext().RefMan.setIsComponentInEditMode(null);

    if (form.getLocalContext().getSelectedRecord() == null && bEditMode)
        newInstance();
    else if (form.getLocalContext().getSelectedRecordIsNotNull() && bEditMode)
        updateInstance();
    else if (form.getLocalContext().getSelectedRecordIsNotNull() && ! bEditMode)
        viewInstance();

    if (form.getLocalContext().getSelectedRecordIsNotNull()
        && form.getLocalContext().getSelectedRecord().getStatusIsNotNull()
        && form.getLocalContext().getSelectedRecord().getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE)
        && form.getLocalContext().getShowRemoveIsNotNull()
        && form.getLocalContext().getShowRemove())
        form.chkRemove().setVisible(Boolean.FALSE);
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onCmbStatusValueChanged() throws PresentationLogicException 
{
    //updateContextMenuState();
    /*if (form.lyrTargets().tabExternalMappings().isVisible())
    {  /* WDEV-7027 - doesn't matter what is visible, should prompt anyway! */
        if (form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().size() > 0)
        {
            if (form.cmbStatus().getValue() != null && form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.INACTIVE))
            {
                engine.showMessage("If you wish to inactivate the Event, All Events Mappingss must be inactivated also\nSet all Events Mappings  to 'Inactive' now","Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION);
            }
        }

    /*}
    if (form.lyrTargets().tabRTT().isVisible())
    {*/
        if (form.lyrTargets().tabRTT().grdRTT().getRows().size() > 0)
        {
            if (form.cmbStatus().getValue() != null && form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.INACTIVE))
            {
                engine.showMessage("If you wish to inactivate the Event, All RTT Events must be inactivated also\nSet all RTT Events  to 'Inactive' now","Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION);
            }
        }
    /*}*/
}
项目:AvoinApotti    文件:Logic.java   
private void populateParentTargetNameCell(DynamicGridCell cellTargetName)
{
    cellTargetName.getItems().clear();
    cellTargetName.setAutoPostBack(true);
    TargetConfigurationShortVoCollection voColl = form.getLocalContext().getTargetConfigurationVoCollection();
    if (voColl == null)
    {
        voColl = domain.listTargetByCriteria(null);
    }

    for(int i = 0; voColl != null && i < voColl.size(); i++)
    {
        if (!voColl.get(i).getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
        {
            cellTargetName.getItems().newItem(voColl.get(i), form.getImages().Blackpool.Target);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
/**
 *  Function used to populate nodes with ICP Action
 */
private boolean populateICPAction(ICPAction_StatusChangeVo action, TreeNode phaseNode)
{
    // Check action parameter
    if (action == null)
        return false;

    // Create node for action
    TreeNode actionNode = phaseNode.getNodes().add((ICPActionRefVo) action, action.getName());

    // Set node attributes
    actionNode.setCollapsedImage(form.getImages().ICP.Action);
    actionNode.setExpandedImage(form.getImages().ICP.Action);
    actionNode.setSelectedImage(form.getImages().ICP.Action);

    actionNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(action.getStatus()) ? Color.Gray : Color.Black);

    actionNode.setCheckBoxVisible(false);

    // Set node value (ICPActionRef) & node identifier
    actionNode.setValue((ICPActionRefVo) action);
    actionNode.setIdentifier(action);

    return PreActiveActiveInactiveStatus.ACTIVE.equals(action.getStatus());
}
项目:AvoinApotti    文件:Logic.java   
private void initialize()
{
    if (form.getGlobalContext().Core.BedFloorLayout.getReadOnly() != null && form.getGlobalContext().Core.BedFloorLayout.getReadOnly().booleanValue())
    {
        form.setMode(FormMode.VIEW);
    }
    else
    {
        form.setMode(FormMode.EDIT);
        form.txtName().setFocus();
        if (form.getGlobalContext().Core.BedFloorLayout.getSelection() == null || (form.getGlobalContext().Core.getBedLayoutActionIsNotNull() && form.getGlobalContext().Core.getBedLayoutAction().equals(BedLayoutAction.CLONE)))
        {
            form.cmbStatus().setValue(PreActiveActiveInactiveStatus.PREACTIVE);
            form.chkIsTemplate().setValue(false);
        }
    }

    loadFloorLayouts();
    form.bedPlanner().addBedImage(Bed.WHITE.getType());
}
项目:AvoinApotti    文件:Logic.java   
private void open()
{
    if (form.getGlobalContext().Core.BedFloorLayout.getSelection() != null)
    {
        FloorBedSpaceLayoutVo value = domain.get(form.getGlobalContext().Core.BedFloorLayout.getSelection());

        if (form.getGlobalContext().Core.getBedLayoutActionIsNotNull() && form.getGlobalContext().Core.getBedLayoutAction().equals(BedLayoutAction.CLONE))
        {
            FloorBedSpaceLayoutVo record = new FloorBedSpaceLayoutVo();
            record.setBedSpaces(value.getBedSpaces());
            record.setFloorLayout(value.getFloorLayout());
            record.setName(null);
            record.setStatus(PreActiveActiveInactiveStatus.PREACTIVE);
            record.setIsTemplate(true);
            populateScreenFromData(record);
        }
        else
        {
            populateScreenFromData(value);
            form.chkIsTemplate().setEnabled(false);
        }
    }
    else
        form.chkIsTemplate().setValue(true);
}
项目:AvoinApotti    文件:Logic.java   
private PatientDocumentVo populatePatientDocumentVo(ServerDocumentVo serverDocumentVo)
{
    PatientDocumentVo vo = new PatientDocumentVo();
    vo.setPatient(form.getGlobalContext().Core.getPatientShort());
    vo.setEpisodeofCare(form.getGlobalContext().Core.getEpisodeofCareShort());
    vo.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    vo.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    vo.setReferral(null);
    vo.setName(form.txtName().getValue());
    vo.setServerDocument(serverDocumentVo);
    vo.setCreationType(form.cmbType().getValue());
    vo.setCategory(form.cmbSource().getValue());
    vo.setDocumentDate(form.getGlobalContext().Core.getCurrentCareContextIsNotNull() ? form.getGlobalContext().Core.getCurrentCareContext().getStartDateTime().getDate() : (form.getGlobalContext().Core.getEpisodeofCareShortIsNotNull() ? form.getGlobalContext().Core.getEpisodeofCareShort().getStartDate() : new Date()));//   WDEV-13638, WDEV-12356
    vo.setRecordingUser((MemberOfStaffRefVo)domain.getMosUser(engine.getLoggedInUser().getUsername()));
    vo.setRecordingDateTime(new DateTime());
    vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE);

    vo.setResponsibleHCP(form.getGlobalContext().Core.getEpisodeofCareShortIsNotNull() ? form.getGlobalContext().Core.getEpisodeofCareShort().getResponsibleHCP() : null);//WDEV-13338
    vo.setSpecialty(form.getGlobalContext().Core.getEpisodeofCareShortIsNotNull() ? form.getGlobalContext().Core.getEpisodeofCareShort().getSpecialty() : null);//WDEV-13338
    return vo;
}
项目:AvoinApotti    文件:Logic.java   
private void removePreactiveOrActiveLookup()
{
    PreActiveActiveInactiveStatus status = form.ctnDetails().cmbStatus().getValue();
    form.ctnDetails().cmbStatus().clear();
    PreActiveActiveInactiveStatusCollection lookupColl = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
    for (int i = 0; lookupColl != null && i < lookupColl.size(); i++)
    {
        if (isStatusActive() && lookupColl.get(i).equals(PreActiveActiveInactiveStatus.PREACTIVE))
            continue;
        if (isStatusInactive() && (lookupColl.get(i).equals(PreActiveActiveInactiveStatus.PREACTIVE) || lookupColl.get(i).equals(PreActiveActiveInactiveStatus.ACTIVE)))
            continue;

        form.ctnDetails().cmbStatus().newRow(lookupColl.get(i), lookupColl.get(i).toString(), lookupColl.get(i).getImage(), lookupColl.get(i).getColor());
    }
    form.ctnDetails().cmbStatus().setValue(status);

}
项目:AvoinApotti    文件:Logic.java   
private void loadCombos()
{
    //Status
    form.cmbStatus().clear();
    PreActiveActiveInactiveStatusCollection statusColl = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
    for(int i=0; statusColl != null && i<statusColl.size(); i++)
    {
        PreActiveActiveInactiveStatus status = statusColl.get(i);
        if(isNewQuestion())
        {
            //When we have a new Question - Remove Inactive entry (cannot create a new Inactive Record)
            if(status.equals(PreActiveActiveInactiveStatus.INACTIVE))
                continue;
        }
        else
        {
            //When record is active don't allow to Preactivate it
            if(isRecordActive() && status.equals(PreActiveActiveInactiveStatus.PREACTIVE))
                continue;
        }

        form.cmbStatus().newRow(status, status.toString());
    }
}
项目:AvoinApotti    文件:DischargeSummaryScheduleSTHKFormImpl.java   
private PatientDocumentVo populatePatientDocumentVo(PatientEdischargeBatchVo patVo, ServerDocumentVo serverDocumentVo, EDischargeSTHKSummaryVo summaryVo, String docName, DocumentCategory category)
{       
    if (summaryVo != null)
    {
        if (summaryVo.getCareContextIsNotNull())
        {
            PatientDocumentVo vo = new PatientDocumentVo();
            vo.setPatient(patVo);                   
            vo.setCareContext(summaryVo.getCareContext());                  

            vo.setName(docName);
            vo.setServerDocument(serverDocumentVo);
            vo.setCreationType(DocumentCreationType.GENERATED);                     
            vo.setCategory(category);

            vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null);
            vo.setRecordingDateTime(new DateTime());
            vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE);
            vo.setResponsibleHCP(getResponsibleHCPForCareContext(summaryVo.getCareContext()));

            return vo;                  
        }           
    }

    return null;    
}
项目:AvoinApotti    文件:WorklistImpl.java   
/**
* listSpecialtiesForActivePathways
*/
public SpecialtyCollection listSpecialtiesForActivePathways()
{
    SpecialtyCollection specialtyInstances = new SpecialtyCollection();

    List specialties = getDomainFactory().find("select distinct pw.specialty from Pathway as pw where pw.status = :active", new String[] {"active"}, new Object[] {getDomLookup(PreActiveActiveInactiveStatus.ACTIVE)});
    if(specialties != null && specialties.size() > 0)
    {
        Iterator it = specialties.iterator();
        while(it.hasNext())
        {
            LookupInstance domInst = (LookupInstance) it.next();
            Specialty lookupInst =  assembleSpecialtyInstance(domInst);
            specialtyInstances.add(lookupInst);
        }
    }

    return specialtyInstances;
}
项目:AvoinApotti    文件:Logic.java   
private boolean isfloorBedSpaceLayoutActive(WardBayConfigVo voWardBayConfig, LocationLiteVo voBay)
{
    if(voWardBayConfig == null)
        throw new CodingRuntimeException("voWardBayConfig cannot be null in method isfloorBedSpaceLayoutActive");
    if (voBay == null)
        throw new CodingRuntimeException("voBay cannot be null in method isfloorBedSpaceLayoutActive");

    if(voWardBayConfig.getBaysIsNotNull())
    {
        for(BayConfigVo voBayConfig : voWardBayConfig.getBays())
        {
            if(voBayConfig.getBay().equals(voBay))
            {
                if(voBayConfig.getFloorBedSpaceLayoutIsNotNull() && voBayConfig.getFloorBedSpaceLayout().getStatusIsNotNull())
                    if(voBayConfig.getFloorBedSpaceLayout().getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
                        return true;
            }
        }
    }

    return false;
}
项目:AvoinApotti    文件:ManchesterTriageProtocolConfigImpl.java   
public ManchesterTriageProtocolConfigLiteVoCollection checkAlreadyActive(ManchesterTriageProtocolConfigLiteVo triageProtocol)
{
    DomainFactory factory = getDomainFactory();

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

    if (triageProtocol == null)
    {
        throw new CodingRuntimeException("Cannot get ManchesterTriageProtocolConfigVo on null Id ");
    }

    StringBuffer hql = new StringBuffer();

    hql.append(" select triageProtocol from ManchesterTriageProtocolConfiguration as triageProtocol left join triageProtocol.problem as problem left join triageProtocol.activeStatus as active where problem.id = :problemID and active.id = :idActive ");

    markers.add("problemID");
    values.add(triageProtocol.getProblem().getID_ClinicalProblem());
    markers.add("idActive");
    values.add(PreActiveActiveInactiveStatus.ACTIVE.getID());

    return ManchesterTriageProtocolConfigLiteVoAssembler.createManchesterTriageProtocolConfigLiteVoCollectionFromManchesterTriageProtocolConfiguration(factory.find(hql.toString(), markers, values));

}
项目:AvoinApotti    文件:EventConfigurationImpl.java   
@SuppressWarnings("unchecked")
public EventRTTEventVoCollection getEventRTTEvent(EventRefVo voRef, PreActiveActiveInactiveStatus status)
{
    DomainFactory factory = getDomainFactory();
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    String query = "select ertt from EventRTTEvent as ertt where ertt.event.id = :idEvent";
    markers.add("idEvent");
    values.add(voRef.getID_Event());

    if (status != null)
    {
        query += " and ertt.event.status = :status";
        markers.add("status");
        values.add(getDomLookup(status));
    }

    List rtts = factory.find(query, markers, values);
    return EventRTTEventVoAssembler.createEventRTTEventVoCollectionFromEventRTTEvent(rtts); 
}
项目:AvoinApotti    文件:EventConfigurationImpl.java   
@SuppressWarnings("unchecked") private EventVoCollection checkForUniqEvent(EventVo record)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer();
    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Serializable> values = new ArrayList<Serializable>();

    hql.append("select event from Event as event left join event.status as status where event.name = :name and status.id = :id_status ");
    names.add("name");
    names.add("id_status");
    values.add(record.getName());
    values.add(PreActiveActiveInactiveStatus.ACTIVE.getID());

    if (record.getID_EventIsNotNull())
    {
        hql.append(" and event.id <> :id  ");
        names.add("id");
        values.add(record.getID_Event());
    }

    List collection = factory.find(hql.toString(), names, values);
    return EventVoAssembler.createEventVoCollectionFromEvent(collection);
}
项目:AvoinApotti    文件:WardViewImpl.java   
public FloorBedSpaceLayoutVo listLayoutForCurrentBay(ILocation location)
{
        if(location == null )
        throw new DomainRuntimeException("Invalid ILocation");

    String hql = "select layout from BayConfig as bc left join bc.bay as bay left join bc.floorBedSpaceLayout as layout where layout.status.id = " + PreActiveActiveInactiveStatus.ACTIVE.getID() +  " and  bay.id = " + location.getID();
    List layout = getDomainFactory().find(hql);

    FloorBedSpaceLayoutVoCollection voColl = FloorBedSpaceLayoutVoAssembler.createFloorBedSpaceLayoutVoCollectionFromFloorBedSpaceLayout(layout);

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

    return null;
}
项目:AvoinApotti    文件:Logic.java   
private void showSelectableStatuses(PathwayVo voPathway)
{
    if (voPathway != null)
    {
        if (voPathway.getID_PathwayIsNotNull())
        {
            if (voPathway.getStatusIsNotNull() && voPathway.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
                form.cmbStatus().removeRow(PreActiveActiveInactiveStatus.PREACTIVE);
            if (voPathway.getStatusIsNotNull() && voPathway.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
            {
                form.cmbStatus().removeRow(PreActiveActiveInactiveStatus.PREACTIVE);
                form.cmbStatus().removeRow(PreActiveActiveInactiveStatus.ACTIVE);
            }
        }
        form.cmbStatus().setValue(voPathway.getStatus());
    }
    else
        form.cmbStatus().removeRow(PreActiveActiveInactiveStatus.INACTIVE);
}
项目:AvoinApotti    文件:EDischargePatientAssessmentImpl.java   
/**
* listAssessments
*/
public ims.assessment.vo.UserAssessmentLiteVoCollection listAssessments(ims.vo.LookupInstVo specialty)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from UserAssessment u left join u.assessmentSpecialties assSpec";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" assSpec.instance = :assessmentSpec" );
    markers.add("assessmentSpec");
    values.add(getDomLookup(specialty));

    hql.append(" and u.activeStatus = :actStat" );
    markers.add("actStat");
    values.add(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE));

    if (markers.size() > 0)
        query += " where ";

    query += hql.toString();

    List list = factory.find(query, markers, values);
    return UserAssessmentLiteVoAssembler.createUserAssessmentLiteVoCollectionFromUserAssessment(list);
}
项目:AvoinApotti    文件:Logic.java   
protected PathwayVo populateDataFromScreen(PathwayVo value)
{
    value = super.populateDataFromScreen(value);
    value.setTaxonomyMaps(form.customControlMappings().getValue());
    //value.setConsultant(form.customControlConsultant().getValue());
    value.setConsultant(form.customControlMos().getValue());

    // isDefaultEntry Processing - dont allow setting of isDefault on a not
    // active pathway
    if (form.cmbStatus().getValue() != null)
    {
        if (!form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.ACTIVE))
        {
            if (form.chkIsDefault().getValue())
                value.setIsDefault(false);
        }
    }

    value.setIsNon18Week(new Boolean(form.chkNonStandard().getValue()));

    form.getLocalContext().setSelectedPathwayTargets(populateInstanceDataFromTargetsGrid(value));
    return value;
}
项目:AvoinApotti    文件:Logic.java   
private void removePreactiveOrActiveLookup()
{
    PreActiveActiveInactiveStatus status = form.cmbStatus().getValue();
    form.cmbStatus().clear();
    PreActiveActiveInactiveStatusCollection lookupColl = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
    for (int i = 0; lookupColl != null && i < lookupColl.size(); i++)
    {
        if (isStatusActive() && lookupColl.get(i).equals(PreActiveActiveInactiveStatus.PREACTIVE))
            continue;
        if (isStatusInactive() && (lookupColl.get(i).equals(PreActiveActiveInactiveStatus.PREACTIVE) || lookupColl.get(i).equals(PreActiveActiveInactiveStatus.ACTIVE)))
            continue;
        //WDEV-17376
        if ((form.getLocalContext().getSelectedTriageProtocol()==null || form.getLocalContext().getSelectedTriageProtocol() != null && form.getLocalContext().getSelectedTriageProtocol().getActiveStatusIsNotNull() && form.getLocalContext().getSelectedTriageProtocol().getActiveStatus().equals(PreActiveActiveInactiveStatus.PREACTIVE)) && lookupColl.get(i).equals(PreActiveActiveInactiveStatus.INACTIVE))
        {
            continue;
        }
        form.cmbStatus().newRow(lookupColl.get(i), lookupColl.get(i).toString(), lookupColl.get(i).getImage(), lookupColl.get(i).getColor());
    }
    form.cmbStatus().setValue(status);
}
项目:AvoinApotti    文件:Logic.java   
private void enableControls()
{
    if (form.getMode().equals(FormMode.EDIT))
    {
        PreActiveActiveInactiveStatus status = form.lyrFindings().tabView().cmbStatus().getValue();
        if (status != null && (status.equals(PreActiveActiveInactiveStatus.ACTIVE) || status.equals(PreActiveActiveInactiveStatus.INACTIVE)))
        {
            form.lyrFindings().tabView().txtFinding().setEnabled(false);
            form.lyrFindings().tabView().txtDescription().setEnabled(false);
            form.lyrFindings().tabView().GroupColourImage().setEnabled(false);
            form.lyrFindings().tabView().cmbColor().setEnabled(false);
            form.lyrFindings().tabView().qmbImage().setEnabled(false);
            form.lyrFindings().tabView().imbImagePicker().setEnabled(false);
            form.lyrFindings().tabView().GroupRenderStyle().setEnabled(false);
        }
        else
        {
            form.lyrFindings().tabView().txtFinding().setEnabled(true);
            form.lyrFindings().tabView().txtDescription().setEnabled(true);
            form.lyrFindings().tabView().GroupColourImage().setEnabled(true);
            enableColourImgControls();
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void removePreactiveOrActiveLookup()
{
    PreActiveActiveInactiveStatus status = form.lyrFindings().tabView().cmbStatus().getValue();
    form.lyrFindings().tabView().cmbStatus().clear();
    PreActiveActiveInactiveStatusCollection lookupColl = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
    for (int i = 0; lookupColl != null && i < lookupColl.size(); i++)
    {
        if(isStatusActive() && lookupColl.get(i).equals(PreActiveActiveInactiveStatus.PREACTIVE))
            continue;
        if(isStatusInactive() && (lookupColl.get(i).equals(PreActiveActiveInactiveStatus.PREACTIVE) || lookupColl.get(i).equals(PreActiveActiveInactiveStatus.ACTIVE)))
            continue;

        form.lyrFindings().tabView().cmbStatus().newRow(lookupColl.get(i), lookupColl.get(i).toString(), lookupColl.get(i).getImage(), lookupColl.get(i).getColor());
    }   
    form.lyrFindings().tabView().cmbStatus().setValue(status);
}
项目:AvoinApotti    文件:Logic.java   
private PatientDocumentVo populatePatientDocumentVo(ServerDocumentVo serverDocumentVo, String patientDocumentName, DocumentCategory patientDocumentCategory)
{
    PatientDocumentVo vo = new PatientDocumentVo();
    vo.setPatient(form.getGlobalContext().Core.getPatientShort());
    vo.setEpisodeofCare(form.getGlobalContext().Core.getEpisodeofCareShort());
    vo.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    vo.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    vo.setReferral(null);

    vo.setName(patientDocumentName);
    vo.setServerDocument(serverDocumentVo);
    vo.setCreationType(DocumentCreationType.GENERATED);
    vo.setCategory(patientDocumentCategory);

    vo.setRecordingUser((MemberOfStaffRefVo) domain.getMosUser(engine.getLoggedInUser().getUsername()));
    vo.setRecordingDateTime(new DateTime());
    vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE);
    return vo;
}
项目:AvoinApotti    文件:NeedsAssessmentImpl.java   
public ims.assessment.vo.UserDefinedObjectListVo getCurrentUserDefinedForm()
{       
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("select id from UserDefinedObject u ");
    hql.append(" where u.activeStatus = :status");
    hql.append(" and u.objectType = :type");        

    List<?> results = factory.find(hql.toString(), new String[] {"status", "type"}, new Object[] { getDomLookup(PreActiveActiveInactiveStatus.ACTIVE), getDomLookup(UserDefinedObjectType.NEEDSASSESSMENT)});       
    if(results == null || results.size() != 1 || results.get(0) == null)
        return null;

    UserDefinedObject activeRecord = (UserDefinedObject)factory.getDomainObject(UserDefinedObject.class, (Integer)results.get(0));
    return UserDefinedObjectListVoAssembler.create(activeRecord);
}
项目:AvoinApotti    文件:Logic.java   
private void initializeCustomControl() 
{
    initializeCodingControl();

    form.getLocalContext().setPreOpPossumUserAssessment(domain.getAssessment(PreActiveActiveInactiveStatus.ACTIVE, UserDefinedAssessmentType.PREOPPOSSUM));
    form.getLocalContext().setOperativePossumUserAssessment(domain.getAssessment(PreActiveActiveInactiveStatus.ACTIVE, UserDefinedAssessmentType.OPERATIVEDETAILSPOSSUM));

    //WDEV-5193
    form.lyrSurgeryDetails().tabGenDet().customControlMosConsultant().initialize(MosType.HCP);
    form.lyrSurgeryDetails().tabProc().customControlMosSurgeon().initialize(MosType.HCP);
    form.lyrSurgeryDetails().tabProc().customControlMosAnaesthetist().initialize(MosType.HCP);
//  UserDefinedAssessmentType.PREOPPOSSUM
//  UserDefinedAssessmentType.OPERATIVEDETAILSPOSSUM
}
项目:AvoinApotti    文件:TheatreSessionImpl.java   
public UserAssessmentVo getAssessment(PreActiveActiveInactiveStatus status, UserDefinedAssessmentType assessmentType) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from UserAssessment u ";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (status != null)
    {
        hql.append(andStr + " u.activeStatus =:status");
        markers.add("status");
        values.add(getDomLookup(status));
        andStr = " and ";
    }

    if (andStr != " ")
        hql.append(andStr);

    hql.append(" u.assessmentType.id =:assessmentType" );
    markers.add("assessmentType");
    values.add(new Integer(assessmentType.getId()));
    andStr = " or ";

    if (markers.size() > 0)
        query += " where ";

    query += hql.toString();

    List list = factory.find(query, markers, values);
    UserAssessmentVoCollection coll = UserAssessmentVoAssembler.createUserAssessmentVoCollectionFromUserAssessment(list);
    if(coll != null && coll.size() > 0)
        return coll.get(0);

    return null;
}
项目:AvoinApotti    文件:TumourDetailsImpl.java   
/**
 * Domain Interface function used to retrieve Tumour Versions records
 */
public TNMStagingClassificationVersionLiteVoCollection getVersions()
{
    String query = "from TNMStagingClassificationVersion as vers where vers.status.id = :STATUS order by vers.systemInformation.creationDateTime desc";

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    paramNames.add("STATUS");
    paramValues.add(PreActiveActiveInactiveStatus.ACTIVE.getID());

    return TNMStagingClassificationVersionLiteVoAssembler.createTNMStagingClassificationVersionLiteVoCollectionFromTNMStagingClassificationVersion(getDomainFactory().find(query, paramNames, paramValues));
}
项目:AvoinApotti    文件:UserAssessmentInstHelper.java   
public void populate(ims.assessment.vo.UserDefinedObjectComponentVo voUserDefinedObjectComponent) throws PresentationLogicException
{
    //Filter the Active ones
    if(voUserDefinedObjectComponent != null && voUserDefinedObjectComponent.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
    {           
        //voPatientAssessmentData.setStatus(PatientAssessmentStatusReason.NOTCOMMENCED);
        //Graphic Assessment
        populate(voUserDefinedObjectComponent.getGraphic());
    }
}
项目:AvoinApotti    文件:ReferralDetailsComponentImpl.java   
public ContractConfigForReferralDetailsComponentVoCollection listActiveContracts(OrganisationRefVo voOrgRef)
{
    String hql = "from ContractConfig as cc where (cc.contractOrganisation.id = :orgID and cc.status.id = :active and cc.isRIE is null) order by upper(cc.contractName) asc";
    List<?> dos = getDomainFactory().find(hql,new String[]{"orgID", "active"},new Object[]{voOrgRef.getID_Organisation(), PreActiveActiveInactiveStatus.ACTIVE.getID()});
    if (dos == null || dos.size() == 0)
        return null;
    return ContractConfigForReferralDetailsComponentVoAssembler.createContractConfigForReferralDetailsComponentVoCollectionFromContractConfig(dos);
}
项目:AvoinApotti    文件:NavigationAdminProtImpl.java   
public ims.assessment.vo.GraphicAssessmentShortVoCollection listGraphicalAssesments(String nameFilter)
{
    DomainFactory factory = (DomainFactory) getDomainFactory();
    String hql = "select ga from GraphicAssessment as ga left join ga.activeStatus as ast where (upper(ga.name) like :name and ast.id = :id and ga.assessmentType.id not in (" + UserDefinedAssessmentType.DPP.getID() + ")) order by upper(ga.name)";
    String[] paramNames = new String[]{"name","id"};
    Object[] paramValues = new Object[]{"%"+(nameFilter == null ? "":nameFilter.toUpperCase())+"%",PreActiveActiveInactiveStatus.ACTIVE.getID()};
    return GraphicAssessmentShortVoAssembler.createGraphicAssessmentShortVoCollectionFromGraphicAssessment(factory.find(hql, paramNames, paramValues));
}
项目:AvoinApotti    文件:Logic.java   
private void populateDataFromScreen()
{
    UserDefinedObjectComponentVoCollection voColl = new UserDefinedObjectComponentVoCollection();
    for (int i = 0; i < form.grdObjects().getRows().size(); i++)
    {
        if (form.grdObjects().getRows().get(i).getcolSelect())
        {
            UserDefinedObjectComponentVo voUserDefinedObjectComponent = new UserDefinedObjectComponentVo();
            voUserDefinedObjectComponent.setActiveStatus(PreActiveActiveInactiveStatus.ACTIVE);

            // Assessment Tool
            Object objVo = form.grdObjects().getRows().get(i).getValue();
            if (objVo instanceof UserAssessmentShortVo)
            {
                ims.assessment.vo.UserAssessmentVo voUserAssessment = domain.getUserAssessment(((UserAssessmentShortVo) objVo).getID_UserAssessment());
                voUserDefinedObjectComponent.setUserAssessment(voUserAssessment);
            }
            // Graphic
            if (objVo instanceof GraphicAssessmentShortVo)
            {
                ims.assessment.vo.GraphicAssessmentVo voGraphicAssessment = domain.getGraphicAssessment(((GraphicAssessmentShortVo) objVo).getID_GraphicAssessment());
                voUserDefinedObjectComponent.setGraphic(voGraphicAssessment);
            }

            voColl.add(voUserDefinedObjectComponent);
        }
    }

    form.getGlobalContext().Core.setUserDefinedObjectComponents(voColl);
}
项目:AvoinApotti    文件:Logic.java   
private void addMedicalNotingAssessment()
{
    GraphicAssessmentShortVo voGraphicAssessment = new GraphicAssessmentShortVo();
    voGraphicAssessment.setName(form.txtName().getValue());
    voGraphicAssessment.setActiveStatus(PreActiveActiveInactiveStatus.PREACTIVE);
    voGraphicAssessment.setAssessmentType(UserDefinedAssessmentType.MEDICALNOTING);

    form.getGlobalContext().Core.setGraphicAssessmentShortVo(voGraphicAssessment);
    form.getGlobalContext().Core.setGraphicAssessmentFormMode(FormMode.EDIT);
    clearGraphicAssessmentSearchFilter();
    engine.open(form.getForms().Assessment.GraphicAssessmentNew);
}
项目:AvoinApotti    文件:Logic.java   
private void setSavedQuestion()
{
    //Add the Question
    QuestionInformationVo voQInfo = form.getLocalContext().getVoQuestionInformation();
    //WDEV-1229 - don't add the inactive question to the grid
    if(voQInfo != null)
    {
        boolean isNotInactive = voQInfo.getStatusIsNotNull() && !voQInfo.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE);
            if(isNewQuestion() && isNotInactive)
        {
            //Set the selected Question
            grdSelectedRow row = getCurrentRow(voQInfo);
            setSelectedQuestion(row, voQInfo);

            //Clear selection on the Available grid
            form.lyrTabs().tabSearchQuestion().grdAvailable().setValue(null);
        }
        else
        {
            //WDEV-1553 - Refresh available record regardless of status
            grdAvailableRow rowAvailable = form.lyrTabs().tabSearchQuestion().grdAvailable().getRowByValue(voQInfo);
            setAvailableQuestion(rowAvailable, voQInfo);
            //Refresh selected Question
            grdSelectedRow selectedRow   = form.lyrTabs().tabSearchQuestion().grdSelected().getRowByValue(voQInfo);
            if(isNotInactive)
            {
                setSelectedQuestion(selectedRow, voQInfo);
            }
            else
            {
                engine.showMessage("Question '" + voQInfo.getShortText() + "' was inactivated and will be removed from the Available for Selection grid");
                removeQuestionSelectedRow(voQInfo);
                removeAvailableForCollectionRow(voQInfo);
            }
            form.lyrTabs().tabSearchQuestion().grdSelected().setValue(null);
        }
    }

    enableContextMenu();
}
项目:AvoinApotti    文件:UserAssessmentInstHelper.java   
private void populateQuestionsHierarchical(UserAssessmentVo data) throws PresentationLogicException
{   
    if(data.getQuestionGroups() == null)
        return;
    checkDataIntegrity(data);
    boolean flatView = data.getIsFlatView().booleanValue();

    for(int x = 0; x < data.getQuestionGroups().size(); x++)
    {
        if(data.getQuestionGroups().get(x) != null 
                && data.getQuestionGroups().get(x).getActiveStatusIsNotNull() 
                && data.getQuestionGroups().get(x).getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
        {
            if(flatView)                
            {
                if(data.getQuestionGroups().get(x).getQuestionsIsNotNull())
                {
                    for(int y = 0; y < data.getQuestionGroups().get(x).getQuestions().size(); y++)
                    {
                        if(data.getQuestionGroups().get(x).getActiveStatusIsNotNull() 
                                && data.getQuestionGroups().get(x).getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE) 
                                && data.getQuestionGroups().get(x).getQuestions().get(y).getActiveStatusIsNotNull() 
                                && data.getQuestionGroups().get(x).getQuestions().get(y).getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
                        {
                            addQuestionRow(data.getQuestionGroups().get(x).getQuestions().get(y), data.getQuestionGroups().get(x), null);
                        }
                    }
                }
            }
            else
            {
                if(countActiveQuestions(data.getQuestionGroups().get(x).getQuestions()) > 0)
                    addGroupRow(data.getQuestionGroups().get(x));
            }
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void loadStatusCombo()
{
    // Status
    PreActiveActiveInactiveStatus prevStatus = form.lyrTabs().tabNewQuestion().cmbStatus().getValue();

    form.lyrTabs().tabNewQuestion().cmbStatus().clear();
    PreActiveActiveInactiveStatusCollection statusColl = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
    for (int i = 0; statusColl != null && i < statusColl.size(); i++)
    {
        PreActiveActiveInactiveStatus status = statusColl.get(i);
        if (isNewQuestion() || isNewScoringAssessmentQuestion())
        {
            // When we have a new Question - Remove Inactive entry (cannot
            // create a new Inactive Record)
            if (status.equals(PreActiveActiveInactiveStatus.INACTIVE))
                continue;
        }
        else
        {
            // When record is active don't allow to Preactivate it
            if (isRecordActive() && status.equals(PreActiveActiveInactiveStatus.PREACTIVE))
                continue;
        }

        form.lyrTabs().tabNewQuestion().cmbStatus().newRow(status, status.toString(), status.getImage(), status.getColor());
    }

    form.lyrTabs().tabNewQuestion().cmbStatus().setValue(prevStatus);
}
项目:AvoinApotti    文件:Logic.java   
private int countActiveQuestions(Assessment_QuestionVoCollection questions)
{
    if (questions == null)
        return 0;

    int count = 0;
    for (int x = 0; x < questions.size(); x++)
    {
        Assessment_QuestionVo question = questions.get(x);
        //WDEV-11366
        if (question.getActiveStatusIsNotNull() && question.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE) && !isQuestionInvalidForPatient(question.getQuestion()))
            count++;
    }
    return count;
}
项目:AvoinApotti    文件:Logic.java   
private void populateQuestionsHierarchical(User_AssessmentVo data) throws PresentationLogicException
{
    if (data.getQuestionGroups() == null)
        return;
    populateGridHeaderAndFooter(data);

    checkDataIntegrity(data);
    boolean flatView = data.getIsFlatView().booleanValue();
    boolean userCanAnswerToAllQuestion = checkUserRole(data);//wdev-3709

    for (int x = 0; x < data.getQuestionGroups().size(); x++)
    {
        if (data.getQuestionGroups().get(x) != null && data.getQuestionGroups().get(x).getActiveStatusIsNotNull() && data.getQuestionGroups().get(x).getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
        {
            if (flatView)
            {
                if (data.getQuestionGroups().get(x).getQuestionsIsNotNull())
                {
                    for (int y = 0; y < data.getQuestionGroups().get(x).getQuestions().size(); y++)
                    {
                        if (data.getQuestionGroups().get(x).getActiveStatusIsNotNull() && data.getQuestionGroups().get(x).getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE) && data.getQuestionGroups().get(x).getQuestions().get(y).getActiveStatusIsNotNull() && data.getQuestionGroups().get(x).getQuestions().get(y).getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
                        {   //WDEV-11366
                            if (isQuestionInvalidForPatient(data.getQuestionGroups().get(x).getQuestions().get(y).getQuestion()))
                                continue;
                            addQuestionRow(data.getQuestionGroups().get(x).getQuestions().get(y), data.getQuestionGroups().get(x), null, userCanAnswerToAllQuestion);//wdev-3709
                        }
                    }
                }
            }
            else
            {
                if (countActiveQuestions(data.getQuestionGroups().get(x).getQuestions()) > 0)
                    addGroupRow(data.getQuestionGroups().get(x), userCanAnswerToAllQuestion);//wdev-3709
            }
        }
    }
}
项目:AvoinApotti    文件:GraphicAssessmentNewImpl.java   
public Integer counActiveAssessmentByType(UserDefinedAssessmentType type, Integer excludedId)
{
    if(type == null)
        throw new CodingRuntimeException("Cannot count GraphicAssessment for null GraphicAssessment");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("select count (g1_1.id) from GraphicAssessment as g1_1 where g1_1.isRIE is null and (g1_1.assessmentType.id = :TYPE and g1_1.activeStatus.id = :STATUS)");
    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("TYPE");
    paramNames.add("STATUS");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(new Integer(type.getID()));
    paramValues.add(new Integer(PreActiveActiveInactiveStatus.ACTIVE.getID()));

    if(excludedId != null)
    {
        hql.append(" and ");
        hql.append("g1_1.id !=:EXCLUDEDID");
        paramNames.add("EXCLUDEDID");
        paramValues.add(excludedId);
    }
    List list = factory.find(hql.toString(), paramNames, paramValues);

    Object objCount = list.get(0);

    if(objCount instanceof Long)
        return new Integer(((Long)objCount).intValue());

    return (Integer) objCount;
}
项目:AvoinApotti    文件:Logic.java   
private void removeStatusLookup(PreActiveActiveInactiveStatus statusRemoved)
{
    PreActiveActiveInactiveStatus status = form.lyrTabs().tabNewQuestion().cmbStatus().getValue();
    form.lyrTabs().tabNewQuestion().cmbStatus().clear();
    PreActiveActiveInactiveStatusCollection  lookupColl = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
    for(int i=0; lookupColl  != null && i<lookupColl.size(); i++)
    {
        if(!lookupColl.get(i).equals(statusRemoved))
            form.lyrTabs().tabNewQuestion().cmbStatus().newRow(lookupColl.get(i), lookupColl.get(i).toString(), lookupColl.get(i).getImage(), lookupColl.get(i).getColor());
    }
    form.lyrTabs().tabNewQuestion().cmbStatus().setValue(status);
}
项目:AvoinApotti    文件:HL7PathwayIfImpl.java   
/**
* Gets the event based on the RTT values passed in
 * @throws DomainInterfaceException 
*/
public ims.pathways.vo.EventVo getEventByTaxonomyMap(TaxonomyType taxType, String value) throws DomainInterfaceException
{
    if (taxType == null || value == null)
        return null;

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer(" select ev from Event ev join ev.taxonomyMaps tx where ev.status.id = :status and tx.taxonomyName = :taxType and tx.taxonomyCode = :taxCode");

    ArrayList<String> labels = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    labels.add("status");
    labels.add("taxType");
    labels.add("taxCode");
    values.add(PreActiveActiveInactiveStatus.ACTIVE.getId());
    values.add(getDomLookup(taxType));
    values.add(value);

    List lst = factory.find(hql.toString(), labels, values);
    if (lst != null && lst.size() > 1)
    {
        throw new DomainInterfaceException("Duplicate data found when searching event by Taxonomy ");
    }
    else if (lst != null && lst.size() == 1)
    {
        // Unique, so only one should be found??
        return EventVoAssembler.create((Event) lst.get(0));
    }

    return null;
}