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

项目:AvoinApotti    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    String name1 = null;
    String name2 = null;
    if(ob1 instanceof ActivitySchedVo )
    {
        ActivitySchedVo ps1 = (ActivitySchedVo)ob1;
        name1 = ps1.getName();
    }
    if(ob2 instanceof ActivitySchedVo)
    {
        ActivitySchedVo ps2 = (ActivitySchedVo)ob2;
        name2 = ps2.getName();
    }
    if(name1 != null )
        return  name1.compareToIgnoreCase(name2)*direction;
    if(name2 != null)
        return (-1)*direction;

    return 0;
}
项目:AvoinApotti    文件:Logic.java   
private void addRecord()
{
    form.setMode(FormMode.EDIT);

    if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("NTPF"))
    {
        if (form.treActivity().getSelectedNode() != null)
            form.lyrActivity().tabNtpf().txtActivity().setValue(form.treActivity().getSelectedNode().getText());
        form.lyrActivity().tabNtpf().chkItem().setValue(true);
        form.lyrActivity().tabNtpf().chkActive().setValue(true);
        form.getLocalContext().setActivityVo(new ActivityVo());
        form.getLocalContext().setAlertVo(new CodingAlertConfigurationVo());
        showAlertDetails(enableAlertControls(form.treActivity().getSelectedNode()), (ActivityType) form.treActivity().getSelectedNode().getValue());
    }
    else if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("SCHED"))
    {
        if (form.treActivity().getSelectedNode() != null)
            form.lyrActivity().tabSchedulling().txtActType().setValue(form.treActivity().getSelectedNode().getText());
        form.lyrActivity().tabSchedulling().chkActActive().setValue(true);
        form.getLocalContext().setActivityVo(new ActivitySchedVo());
    }
}
项目:openMAXIMS    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    String name1 = null;
    String name2 = null;
    if(ob1 instanceof ActivitySchedVo )
    {
        ActivitySchedVo ps1 = (ActivitySchedVo)ob1;
        name1 = ps1.getName();
    }
    if(ob2 instanceof ActivitySchedVo)
    {
        ActivitySchedVo ps2 = (ActivitySchedVo)ob2;
        name2 = ps2.getName();
    }
    if(name1 != null )
        return  name1.compareToIgnoreCase(name2)*direction;
    if(name2 != null)
        return (-1)*direction;

    return 0;
}
项目:openMAXIMS    文件:Logic.java   
private void addRecord()
{
    form.setMode(FormMode.EDIT);

    if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("NTPF"))
    {
        if (form.treActivity().getSelectedNode() != null)
            form.lyrActivity().tabNtpf().txtActivity().setValue(form.treActivity().getSelectedNode().getText());
        form.lyrActivity().tabNtpf().chkItem().setValue(true);
        form.lyrActivity().tabNtpf().chkActive().setValue(true);
        form.getLocalContext().setActivityVo(new ActivityVo());
        form.getLocalContext().setAlertVo(new CodingAlertConfigurationVo());
        showAlertDetails(enableAlertControls(form.treActivity().getSelectedNode()), (ActivityType) form.treActivity().getSelectedNode().getValue());
    }
    else if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("SCHED"))
    {
        if (form.treActivity().getSelectedNode() != null)
            form.lyrActivity().tabSchedulling().txtActType().setValue(form.treActivity().getSelectedNode().getText());
        form.lyrActivity().tabSchedulling().chkActActive().setValue(true);
        form.getLocalContext().setActivityVo(new ActivitySchedVo());
    }
}
项目:openMAXIMS    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    String name1 = null;
    String name2 = null;
    if(ob1 instanceof ActivitySchedVo )
    {
        ActivitySchedVo ps1 = (ActivitySchedVo)ob1;
        name1 = ps1.getName();
    }
    if(ob2 instanceof ActivitySchedVo)
    {
        ActivitySchedVo ps2 = (ActivitySchedVo)ob2;
        name2 = ps2.getName();
    }
    if(name1 != null )
        return  name1.compareToIgnoreCase(name2)*direction;
    if(name2 != null)
        return (-1)*direction;

    return 0;
}
项目:openMAXIMS    文件:Logic.java   
private void addRecord()
{
    form.setMode(FormMode.EDIT);

    if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("NTPF"))
    {
        if (form.treActivity().getSelectedNode() != null)
            form.lyrActivity().tabNtpf().txtActivity().setValue(form.treActivity().getSelectedNode().getText());
        form.lyrActivity().tabNtpf().chkItem().setValue(true);
        form.lyrActivity().tabNtpf().chkActive().setValue(true);
        form.getLocalContext().setActivityVo(new ActivityVo());
        form.getLocalContext().setAlertVo(new CodingAlertConfigurationVo());
        showAlertDetails(enableAlertControls(form.treActivity().getSelectedNode()), (ActivityType) form.treActivity().getSelectedNode().getValue());
    }
    else if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("SCHED"))
    {
        if (form.treActivity().getSelectedNode() != null)
            form.lyrActivity().tabSchedulling().txtActType().setValue(form.treActivity().getSelectedNode().getText());
        form.lyrActivity().tabSchedulling().chkActActive().setValue(true);
        form.getLocalContext().setActivityVo(new ActivitySchedVo());
    }
}
项目:openmaxims-linux    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    String name1 = null;
    String name2 = null;
    if(ob1 instanceof ActivitySchedVo )
    {
        ActivitySchedVo ps1 = (ActivitySchedVo)ob1;
        name1 = ps1.getName();
    }
    if(ob2 instanceof ActivitySchedVo)
    {
        ActivitySchedVo ps2 = (ActivitySchedVo)ob2;
        name2 = ps2.getName();
    }
    if(name1 != null )
        return  name1.compareToIgnoreCase(name2)*direction;
    if(name2 != null)
        return (-1)*direction;

    return 0;
}
项目:openmaxims-linux    文件:Logic.java   
private void addRecord()
{
    form.setMode(FormMode.EDIT);

    if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("NTPF"))
    {
        if (form.treActivity().getSelectedNode() != null)
            form.lyrActivity().tabNtpf().txtActivity().setValue(form.treActivity().getSelectedNode().getText());
        form.lyrActivity().tabNtpf().chkItem().setValue(true);
        form.lyrActivity().tabNtpf().chkActive().setValue(true);
        form.getLocalContext().setActivityVo(new ActivityVo());
        form.getLocalContext().setAlertVo(new CodingAlertConfigurationVo());
        showAlertDetails(enableAlertControls(form.treActivity().getSelectedNode()), (ActivityType) form.treActivity().getSelectedNode().getValue());
    }
    else if (ConfigFlag.UI.ACTIVITY_VIEW.getValue().equals("SCHED"))
    {
        if (form.treActivity().getSelectedNode() != null)
            form.lyrActivity().tabSchedulling().txtActType().setValue(form.treActivity().getSelectedNode().getText());
        form.lyrActivity().tabSchedulling().chkActActive().setValue(true);
        form.getLocalContext().setActivityVo(new ActivitySchedVo());
    }
}
项目:AvoinApotti    文件:ActivityImpl.java   
public ActivitySchedVo saveSchedActivity(ActivitySchedVo activityVo) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException
{
    if(!activityVo.isValidated())
        throw new DomainRuntimeException("ActivitySchedVo not validated");

    DomainFactory factory = getDomainFactory();

    //TODO this implementation is not ideal - the recordExistForNameAndIsActiveAndActivityType should really take the record id attemptimg to be saved if applicable(update) as a param
    //instead of calling getActivityFromactivity_unq1 to check that the conflict is not with this record itself(update)
    if(Activity.recordExistForNameAndIsActiveAndActivityType(factory, activityVo.getName(), activityVo.getIsActive(), getDomLookup( activityVo.getActivityType())))
    {
        if(activityVo.getID_ActivityIsNotNull())
        {
            Activity doConflictingActivity = Activity.getActivityFromactivity_unq1(factory, activityVo.getName(), activityVo.getIsActive(), getDomLookup( activityVo.getActivityType()));
            if(!doConflictingActivity.getId().equals(activityVo.getID_Activity()))
                throw new UniqueKeyViolationException("An " + (activityVo.getIsActive() ? "active" : "inactive") + " Activity of this Type and Name already exists");
        }
        else
            throw new UniqueKeyViolationException("An " + (activityVo.getIsActive() ? "active" : "inactive") + " Activity of this Type and Name already exists");
    }

    Activity doActivity = ActivitySchedVoAssembler.extractActivity(factory, activityVo);

    try
    {
        factory.save(doActivity);
    }
    catch (UnqViolationUncheckedException e)
    {
        throw new UniqueKeyViolationException("An activity with the same code mapping exists");
    }

    return ActivitySchedVoAssembler.create(doActivity);
}
项目:openMAXIMS    文件:ActivityImpl.java   
public ActivitySchedVo saveSchedActivity(ActivitySchedVo activityVo) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException
{
    if(!activityVo.isValidated())
        throw new DomainRuntimeException("ActivitySchedVo not validated");

    DomainFactory factory = getDomainFactory();

    //TODO this implementation is not ideal - the recordExistForNameAndIsActiveAndActivityType should really take the record id attemptimg to be saved if applicable(update) as a param
    //instead of calling getActivityFromactivity_unq1 to check that the conflict is not with this record itself(update)
    if(Activity.recordExistForNameAndIsActiveAndActivityType(factory, activityVo.getName(), activityVo.getIsActive(), getDomLookup( activityVo.getActivityType())))
    {
        if(activityVo.getID_ActivityIsNotNull())
        {
            Activity doConflictingActivity = Activity.getActivityFromactivity_unq1(factory, activityVo.getName(), activityVo.getIsActive(), getDomLookup( activityVo.getActivityType()));
            if(!doConflictingActivity.getId().equals(activityVo.getID_Activity()))
                throw new UniqueKeyViolationException("An " + (activityVo.getIsActive() ? "active" : "inactive") + " Activity of this Type and Name already exists");
        }
        else
            throw new UniqueKeyViolationException("An " + (activityVo.getIsActive() ? "active" : "inactive") + " Activity of this Type and Name already exists");
    }

    Activity doActivity = ActivitySchedVoAssembler.extractActivity(factory, activityVo);

    try
    {
        factory.save(doActivity);
    }
    catch (UnqViolationUncheckedException e)
    {
        throw new UniqueKeyViolationException("An activity with the same code mapping exists");
    }

    return ActivitySchedVoAssembler.create(doActivity);
}
项目:openMAXIMS    文件:ActivityImpl.java   
public ActivitySchedVo saveSchedActivity(ActivitySchedVo activityVo) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException
{
    if(!activityVo.isValidated())
        throw new DomainRuntimeException("ActivitySchedVo not validated");

    DomainFactory factory = getDomainFactory();

    //TODO this implementation is not ideal - the recordExistForNameAndIsActiveAndActivityType should really take the record id attemptimg to be saved if applicable(update) as a param
    //instead of calling getActivityFromactivity_unq1 to check that the conflict is not with this record itself(update)
    if(Activity.recordExistForNameAndIsActiveAndActivityType(factory, activityVo.getName(), activityVo.getIsActive(), getDomLookup( activityVo.getActivityType())))
    {
        if(activityVo.getID_ActivityIsNotNull())
        {
            Activity doConflictingActivity = Activity.getActivityFromactivity_unq1(factory, activityVo.getName(), activityVo.getIsActive(), getDomLookup( activityVo.getActivityType()));
            if(!doConflictingActivity.getId().equals(activityVo.getID_Activity()))
                throw new UniqueKeyViolationException("An " + (activityVo.getIsActive() ? "active" : "inactive") + " Activity of this Type and Name already exists");
        }
        else
            throw new UniqueKeyViolationException("An " + (activityVo.getIsActive() ? "active" : "inactive") + " Activity of this Type and Name already exists");
    }

    Activity doActivity = ActivitySchedVoAssembler.extractActivity(factory, activityVo);

    try
    {
        factory.save(doActivity);
    }
    catch (UnqViolationUncheckedException e)
    {
        throw new UniqueKeyViolationException("An activity with the same code mapping exists");
    }

    return ActivitySchedVoAssembler.create(doActivity);
}
项目:openmaxims-linux    文件:ActivityImpl.java   
public ActivitySchedVo saveSchedActivity(ActivitySchedVo activityVo) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException
{
    if(!activityVo.isValidated())
        throw new DomainRuntimeException("ActivitySchedVo not validated");

    DomainFactory factory = getDomainFactory();

    //TODO this implementation is not ideal - the recordExistForNameAndIsActiveAndActivityType should really take the record id attemptimg to be saved if applicable(update) as a param
    //instead of calling getActivityFromactivity_unq1 to check that the conflict is not with this record itself(update)
    if(Activity.recordExistForNameAndIsActiveAndActivityType(factory, activityVo.getName(), activityVo.getIsActive(), getDomLookup( activityVo.getActivityType())))
    {
        if(activityVo.getID_ActivityIsNotNull())
        {
            Activity doConflictingActivity = Activity.getActivityFromactivity_unq1(factory, activityVo.getName(), activityVo.getIsActive(), getDomLookup( activityVo.getActivityType()));
            if(!doConflictingActivity.getId().equals(activityVo.getID_Activity()))
                throw new UniqueKeyViolationException("An " + (activityVo.getIsActive() ? "active" : "inactive") + " Activity of this Type and Name already exists");
        }
        else
            throw new UniqueKeyViolationException("An " + (activityVo.getIsActive() ? "active" : "inactive") + " Activity of this Type and Name already exists");
    }

    Activity doActivity = ActivitySchedVoAssembler.extractActivity(factory, activityVo);

    try
    {
        factory.save(doActivity);
    }
    catch (UnqViolationUncheckedException e)
    {
        throw new UniqueKeyViolationException("An activity with the same code mapping exists");
    }

    return ActivitySchedVoAssembler.create(doActivity);
}
项目:AvoinApotti    文件:Logic.java   
private void repopulateScreen()
{
    if (form.getGlobalContext().Scheduling.getBookingAppointment() == null)
        return;

    // store the same booking record
    Sch_BookingVo voBooking = domain.getSch_BookingByAppt(form.getGlobalContext().Scheduling.getBookingAppointment());
    form.getLocalContext().setSch_Booking(voBooking);
    if (voBooking != null)
        form.txtBookingComments().setValue(voBooking.getBookingComments());

    form.cmbSpecialty().setValue(form.getGlobalContext().Scheduling.getBookingService());
    if (form.cmbSpecialty().getValue() == null && form.getGlobalContext().Scheduling.getBookingService() instanceof ServiceLiteVo)
    {
        form.cmbSpecialty().newRow(form.getGlobalContext().Scheduling.getBookingService(), ((ServiceLiteVo) form.getGlobalContext().Scheduling.getBookingService()).getServiceName());
        form.cmbSpecialty().setValue(form.getGlobalContext().Scheduling.getBookingService());
    }

    if (form.getGlobalContext().Scheduling.getBookingActivityIsNotNull())
    {
        for (int i = 0; i < form.cmbActivity().getValues().size(); i++)
        {
            if (((ActivitySchedVo) form.cmbActivity().getValues().get(i)).getID_Activity().equals(form.getGlobalContext().Scheduling.getBookingActivity().getID_Activity()))
            {
                form.cmbActivity().setValue((ActivitySchedVo) form.cmbActivity().getValues().get(i));
                listClinics();
                break;
            }
        }
    }

    if (form.getGlobalContext().Scheduling.getBookingSessionIsNotNull())
        form.cmbClinic().setValue(domain.getProfileForSession(form.getGlobalContext().Scheduling.getBookingSession()));

    if (validateSearchCriteria() == null)
    {
        loadSessions(false);
        form.getLocalContext().setEnableFirstAvailableApp(true);    //wdev-14867
        // set a flag to say that the appt to be rebooked hasnt yet been selected
        form.getLocalContext().setIsRebookApptSelected(false);
        form.setMode(FormMode.EDIT);
        form.bookingCalendar1().setSelectedDay(new Date());
        bookingCalendar1DateSelected(new Date());
        form.btnCancel().setEnabled(true);

        form.cmbSpecialty().setEnabled(false);
        form.cmbActivity().setEnabled(false);
        form.cmbClinic().setEnabled(false);
        form.imbClear().setEnabled(false);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void populateActivityVoFromScreen(ActivityVo voActivity)
{
    if (voActivity == null)
        return;

    if (voActivity instanceof ActivitySchedVo)
    {
        //scheduling
        if (voActivity.getActivityType() == null)
            voActivity.setActivityType((ActivityType) form.treActivity().getSelectedNode().getValue());

        //if (form.lyrActivity().tabSchedulling().txtActName().getValue() != null)      WDEV-15167
        voActivity.setName(form.lyrActivity().tabSchedulling().txtActName().getValue());

        if (form.lyrActivity().tabSchedulling().intTimeRequired().getValue() != null)
            ((ActivitySchedVo) voActivity).setTmReq(form.lyrActivity().tabSchedulling().intTimeRequired().getValue());

        if (form.lyrActivity().tabSchedulling().intIntervalRequired().getValue() != null)
            ((ActivitySchedVo) voActivity).setIntReq(form.lyrActivity().tabSchedulling().intIntervalRequired().getValue());

        if (form.getGlobalContext().Admin.getSelectedImageIsNotNull())
            ((ActivitySchedVo) voActivity).setActivityImage(form.getGlobalContext().Admin.getSelectedImage());

        ((ActivitySchedVo) voActivity).setIsPatReq(new Boolean(form.lyrActivity().tabSchedulling().chkPatientRequired().getValue()));
        ((ActivitySchedVo) voActivity).setIsScheduled(new Boolean(form.lyrActivity().tabSchedulling().chkScheduled().getValue()));
        voActivity.setIsActive(new Boolean(form.lyrActivity().tabSchedulling().chkActActive().getValue()));

        // Save Activity special requirements.
        ActivitySpecRequirementsCollection asrColl = new ActivitySpecRequirementsCollection();

        GenForm.lyrActivityLayer.tabSchedullingContainer.grdActSpecialRequirementsRow row;
        for (int i = 0; i < form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().size(); i++)
        {
            row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().get(i);
            if (row.getcolSelected())
                asrColl.add(row.getValue());
        }
        ((ActivitySchedVo) voActivity).setSpecialRequirements(asrColl);

        // Save Activity taxonomy mappings (WDEV-6108)
        voActivity.setCodeMappings(form.lyrActivity().tabSchedulling().ccTaxonomyTab2().getValue());
        voActivity.setFirstAppointment(form.lyrActivity().tabSchedulling().chkFirstAppointment().getValue());
        voActivity.setDiagnostic(form.lyrActivity().tabSchedulling().chkDiagnosticActivity().getValue());
    }
    else
    {
        if (voActivity.getActivityType() == null)
            voActivity.setActivityType((ActivityType) form.treActivity().getSelectedNode().getValue());

        if (form.lyrActivity().tabNtpf().txtName().getValue() != null)
            voActivity.setName(form.lyrActivity().tabNtpf().txtName().getValue());

        voActivity.setIsWorkQueue(new Boolean(form.lyrActivity().tabNtpf().chkItem().getValue()));
        voActivity.setIsActive(new Boolean(form.lyrActivity().tabNtpf().chkActive().getValue()));

        // Save Activity taxonomy mappings (WDEV-6108)
        voActivity.setCodeMappings(form.lyrActivity().tabNtpf().ccTaxonomyTab1().getValue());
    }
}
项目:AvoinApotti    文件:Logic.java   
private void populateScreenFromActivityVo(ActivityVo localActivity)
{
    if (localActivity == null)
        return;

    if (localActivity instanceof ActivitySchedVo)
    {
        if (localActivity.getActivityTypeIsNotNull())
            form.lyrActivity().tabSchedulling().txtActType().setValue(localActivity.getActivityType().getText());

        if (localActivity.getName() != null)
            form.lyrActivity().tabSchedulling().txtActName().setValue(localActivity.getName());

        if (((ActivitySchedVo) localActivity).getTmReq() != null)
            form.lyrActivity().tabSchedulling().intTimeRequired().setValue(((ActivitySchedVo) localActivity).getTmReq());

        if (((ActivitySchedVo) localActivity).getIntReq() != null)
            form.lyrActivity().tabSchedulling().intIntervalRequired().setValue(((ActivitySchedVo) localActivity).getIntReq());

        if (((ActivitySchedVo) localActivity).getActivityImage() != null)
            form.lyrActivity().tabSchedulling().txtActImage().setValue(((ActivitySchedVo) localActivity).getActivityImage().getImagePath());

        form.getGlobalContext().Admin.setSelectedImage(((ActivitySchedVo) localActivity).getActivityImage());

        if (((ActivitySchedVo) localActivity).getIsPatReq() != null)
            form.lyrActivity().tabSchedulling().chkPatientRequired().setValue(((ActivitySchedVo) localActivity).getIsPatReq().booleanValue());

        if (((ActivitySchedVo) localActivity).getIsScheduled() != null)
            form.lyrActivity().tabSchedulling().chkScheduled().setValue(((ActivitySchedVo) localActivity).getIsScheduled().booleanValue());

        if (((ActivitySchedVo) localActivity).getIsActive() != null)
            form.lyrActivity().tabSchedulling().chkActActive().setValue(localActivity.getIsActive().booleanValue());

        form.lyrActivity().tabSchedulling().chkFirstAppointment().setValue(((ActivitySchedVo) localActivity).getFirstAppointment());
        form.lyrActivity().tabSchedulling().chkDiagnosticActivity().setValue(((ActivitySchedVo) localActivity).getDiagnostic());

        if(((ActivitySchedVo) localActivity).getSpecialRequirementsIsNotNull())
        {
            GenForm.lyrActivityLayer.tabSchedullingContainer.grdActSpecialRequirementsRow row;
            ActivitySpecRequirementsCollection requirements = ((ActivitySchedVo) localActivity).getSpecialRequirements();
            for (int i=0; i<requirements.size(); i++)
            {
                ActivitySpecRequirements requirement = requirements.get(i);
                row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRowByValue(requirement);
                if (row != null)
                    row.setcolSelected(true);
                else
                {
                    row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().newRow();
                    row.setValue(requirement);
                    row.setcolRequirement(requirement.getText());   
                    row.setcolSelected(true);   
                }
            }
        }

        // Populate the taxonomy mappings (WDEV-6108)
        form.lyrActivity().tabSchedulling().ccTaxonomyTab2().setValue(localActivity.getCodeMappings());
    }
    else
    {
        if (localActivity.getActivityTypeIsNotNull())
            form.lyrActivity().tabNtpf().txtActivity().setValue(localActivity.getActivityType().getText());

        if (localActivity.getName() != null)
            form.lyrActivity().tabNtpf().txtName().setValue(localActivity.getName());

        form.lyrActivity().tabNtpf().chkActive().setValue(localActivity.getIsActive().booleanValue());
        form.lyrActivity().tabNtpf().chkItem().setValue(localActivity.getIsWorkQueue().booleanValue());

        // Populate the taxonomy mappings (WDEV-6108)
        form.lyrActivity().tabNtpf().ccTaxonomyTab1().setValue(localActivity.getCodeMappings());
    }
}
项目:AvoinApotti    文件:Logic.java   
protected void onTreActivityTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
    if (node.getValue() instanceof ActivityVo)
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(false);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(true);
        form.getLocalContext().setActivityVo((ActivityVo) form.treActivity().getSelectedNode().getValue());
        clearActivityDetails();

        ActivityVo voActivity = (ActivityVo) form.treActivity().getSelectedNode().getValue();
        populateScreenFromActivityVo(voActivity);

        if (!(node.getValue() instanceof ActivitySchedVo))
        {
            CodingAlertConfigurationVo alertVo = domain.getAlert(voActivity);
            form.getLocalContext().setAlertVo(alertVo);
            populateScreenFromAlertVo(alertVo);
            showAlertDetails(enableAlertControls(node.getParent()), voActivity.getActivityType());
        }
    }
    else if (node.getValue() instanceof ActivityType)
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(true);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
        clearActivityDetails();

        ActivityType activityType = (ActivityType) node.getValue();
        if (activityType.equals(ActivityType.ADMINFUNCTIONS))
        {
            if (adminInstanceExists())
                form.getContextMenus().getGenericGridAddItem().setVisible(false);
        }

        showAlertDetails(enableAlertControls(node), activityType);

        if (oneChildOnlyAllowed(node))
            form.getContextMenus().getGenericGridAddItem().setVisible(false);
    }
    else
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(false);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void repopulateScreen() {
    if (form.getGlobalContext().Scheduling.getBookingAppointment() == null)
        return;

    // SITE-508
    form.getGlobalContext().Scheduling.setBookingAppointment(domain
            .getBookingAppointment(form.getGlobalContext().Scheduling
                    .getBookingAppointment()));

    // store the same booking record
    Sch_BookingVo voBooking = domain.getSch_BookingByAppt(form
            .getGlobalContext().Scheduling.getBookingAppointment());
    form.getLocalContext().setSch_Booking(voBooking);
    if (voBooking != null)
        form.txtBookingComments().setValue(voBooking.getBookingComments());

    form.cmbService().setValue(
            form.getGlobalContext().Scheduling.getBookingService());
    if (form.cmbService().getValue() == null
            && form.getGlobalContext().Scheduling.getBookingService() instanceof ServiceLiteVo) {
        form.cmbService().newRow(
                form.getGlobalContext().Scheduling.getBookingService(),
                ((ServiceLiteVo) form.getGlobalContext().Scheduling
                        .getBookingService()).getServiceName());
        form.cmbService().setValue(
                form.getGlobalContext().Scheduling.getBookingService());
    }

    if (form.getGlobalContext().Scheduling.getBookingActivityIsNotNull()) {
        for (int i = 0; i < form.cmbActivity().getValues().size(); i++) {
            if (((ActivitySchedVo) form.cmbActivity().getValues().get(i))
                    .getID_Activity().equals(
                            form.getGlobalContext().Scheduling
                                    .getBookingActivity().getID_Activity())) {
                form.cmbActivity().setValue(
                        (ActivitySchedVo) form.cmbActivity().getValues()
                                .get(i));
                break;
            }
        }
    }

    if (validateSearchCriteria() == null) {
        loadSessions();
        // set a flag to say that the appt to be rebooked hasnt yet been
        // selected
        form.getLocalContext().setIsRebookApptSelected(false);
        form.setMode(FormMode.EDIT);
        form.bookingCalendarAppts().setSelectedDay(new Date());
        bookingCalendarDateSelected(new Date());
        form.btnCancel().setEnabled(true);

        form.cmbService().setEnabled(false);
        form.cmbActivity().setEnabled(false);
        form.imbClear().setEnabled(false);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void repopulateScreen()
{
    if (form.getGlobalContext().Scheduling.getBookingAppointment() == null)
        return;

    // store the same booking record
    Sch_BookingVo voBooking = domain.getSch_BookingByAppt(form.getGlobalContext().Scheduling.getBookingAppointment());
    form.getLocalContext().setSch_Booking(voBooking);
    if (voBooking != null)
        form.txtBookingComments().setValue(voBooking.getBookingComments());

    form.cmbSpecialty().setValue(form.getGlobalContext().Scheduling.getBookingService());
    if (form.cmbSpecialty().getValue() == null && form.getGlobalContext().Scheduling.getBookingService() instanceof ServiceLiteVo)
    {
        form.cmbSpecialty().newRow(form.getGlobalContext().Scheduling.getBookingService(), ((ServiceLiteVo) form.getGlobalContext().Scheduling.getBookingService()).getServiceName());
        form.cmbSpecialty().setValue(form.getGlobalContext().Scheduling.getBookingService());
    }

    if (form.getGlobalContext().Scheduling.getBookingActivityIsNotNull())
    {
        for (int i = 0; i < form.cmbActivity().getValues().size(); i++)
        {
            if (((ActivitySchedVo) form.cmbActivity().getValues().get(i)).getID_Activity().equals(form.getGlobalContext().Scheduling.getBookingActivity().getID_Activity()))
            {
                form.cmbActivity().setValue((ActivitySchedVo) form.cmbActivity().getValues().get(i));
                listClinics();
                break;
            }
        }
    }

    if (form.getGlobalContext().Scheduling.getBookingSessionIsNotNull())
        form.cmbClinic().setValue(domain.getProfileForSession(form.getGlobalContext().Scheduling.getBookingSession()));

    if (validateSearchCriteria() == null)
    {
        loadSessions(false);
        form.getLocalContext().setEnableFirstAvailableApp(true);    //wdev-14867
        // set a flag to say that the appt to be rebooked hasnt yet been selected
        form.getLocalContext().setIsRebookApptSelected(false);
        form.setMode(FormMode.EDIT);
        form.bookingCalendar1().setSelectedDay(new Date());
        bookingCalendar1DateSelected(new Date());
        form.btnCancel().setEnabled(true);

        form.imbClear().setEnabled(false);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateActivityVoFromScreen(ActivityVo voActivity)
{
    if (voActivity == null)
        return;

    if (voActivity instanceof ActivitySchedVo)
    {
        //scheduling
        if (voActivity.getActivityType() == null)
            voActivity.setActivityType((ActivityType) form.treActivity().getSelectedNode().getValue());

        //if (form.lyrActivity().tabSchedulling().txtActName().getValue() != null)      WDEV-15167
        voActivity.setName(form.lyrActivity().tabSchedulling().txtActName().getValue());

        if (form.lyrActivity().tabSchedulling().intTimeRequired().getValue() != null)
            ((ActivitySchedVo) voActivity).setTmReq(form.lyrActivity().tabSchedulling().intTimeRequired().getValue());

        if (form.lyrActivity().tabSchedulling().intIntervalRequired().getValue() != null)
            ((ActivitySchedVo) voActivity).setIntReq(form.lyrActivity().tabSchedulling().intIntervalRequired().getValue());

        if (form.getGlobalContext().Admin.getSelectedImageIsNotNull())
            ((ActivitySchedVo) voActivity).setActivityImage(form.getGlobalContext().Admin.getSelectedImage());

        ((ActivitySchedVo) voActivity).setIsPatReq(new Boolean(form.lyrActivity().tabSchedulling().chkPatientRequired().getValue()));
        ((ActivitySchedVo) voActivity).setIsScheduled(new Boolean(form.lyrActivity().tabSchedulling().chkScheduled().getValue()));
        voActivity.setIsActive(new Boolean(form.lyrActivity().tabSchedulling().chkActActive().getValue()));

        // Save Activity special requirements.
        ActivitySpecRequirementsCollection asrColl = new ActivitySpecRequirementsCollection();

        GenForm.lyrActivityLayer.tabSchedullingContainer.grdActSpecialRequirementsRow row;
        for (int i = 0; i < form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().size(); i++)
        {
            row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().get(i);
            if (row.getcolSelected())
                asrColl.add(row.getValue());
        }
        ((ActivitySchedVo) voActivity).setSpecialRequirements(asrColl);

        // Save Activity taxonomy mappings (WDEV-6108)
        voActivity.setCodeMappings(form.lyrActivity().tabSchedulling().ccTaxonomyTab2().getValue());
        voActivity.setFirstAppointment(form.lyrActivity().tabSchedulling().chkFirstAppointment().getValue());
        voActivity.setDiagnostic(form.lyrActivity().tabSchedulling().chkDiagnosticActivity().getValue());
    }
    else
    {
        if (voActivity.getActivityType() == null)
            voActivity.setActivityType((ActivityType) form.treActivity().getSelectedNode().getValue());

        if (form.lyrActivity().tabNtpf().txtName().getValue() != null)
            voActivity.setName(form.lyrActivity().tabNtpf().txtName().getValue());

        voActivity.setIsWorkQueue(new Boolean(form.lyrActivity().tabNtpf().chkItem().getValue()));
        voActivity.setIsActive(new Boolean(form.lyrActivity().tabNtpf().chkActive().getValue()));

        // Save Activity taxonomy mappings (WDEV-6108)
        voActivity.setCodeMappings(form.lyrActivity().tabNtpf().ccTaxonomyTab1().getValue());
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromActivityVo(ActivityVo localActivity)
{
    if (localActivity == null)
        return;

    if (localActivity instanceof ActivitySchedVo)
    {
        if (localActivity.getActivityTypeIsNotNull())
            form.lyrActivity().tabSchedulling().txtActType().setValue(localActivity.getActivityType().getText());

        if (localActivity.getName() != null)
            form.lyrActivity().tabSchedulling().txtActName().setValue(localActivity.getName());

        if (((ActivitySchedVo) localActivity).getTmReq() != null)
            form.lyrActivity().tabSchedulling().intTimeRequired().setValue(((ActivitySchedVo) localActivity).getTmReq());

        if (((ActivitySchedVo) localActivity).getIntReq() != null)
            form.lyrActivity().tabSchedulling().intIntervalRequired().setValue(((ActivitySchedVo) localActivity).getIntReq());

        if (((ActivitySchedVo) localActivity).getActivityImage() != null)
            form.lyrActivity().tabSchedulling().txtActImage().setValue(((ActivitySchedVo) localActivity).getActivityImage().getImagePath());

        form.getGlobalContext().Admin.setSelectedImage(((ActivitySchedVo) localActivity).getActivityImage());

        if (((ActivitySchedVo) localActivity).getIsPatReq() != null)
            form.lyrActivity().tabSchedulling().chkPatientRequired().setValue(((ActivitySchedVo) localActivity).getIsPatReq().booleanValue());

        if (((ActivitySchedVo) localActivity).getIsScheduled() != null)
            form.lyrActivity().tabSchedulling().chkScheduled().setValue(((ActivitySchedVo) localActivity).getIsScheduled().booleanValue());

        if (((ActivitySchedVo) localActivity).getIsActive() != null)
            form.lyrActivity().tabSchedulling().chkActActive().setValue(localActivity.getIsActive().booleanValue());

        form.lyrActivity().tabSchedulling().chkFirstAppointment().setValue(((ActivitySchedVo) localActivity).getFirstAppointment());
        form.lyrActivity().tabSchedulling().chkDiagnosticActivity().setValue(((ActivitySchedVo) localActivity).getDiagnostic());

        if(((ActivitySchedVo) localActivity).getSpecialRequirementsIsNotNull())
        {
            GenForm.lyrActivityLayer.tabSchedullingContainer.grdActSpecialRequirementsRow row;
            ActivitySpecRequirementsCollection requirements = ((ActivitySchedVo) localActivity).getSpecialRequirements();
            for (int i=0; i<requirements.size(); i++)
            {
                ActivitySpecRequirements requirement = requirements.get(i);
                row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRowByValue(requirement);
                if (row != null)
                    row.setcolSelected(true);
                else
                {
                    row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().newRow();
                    row.setValue(requirement);
                    row.setcolRequirement(requirement.getText());   
                    row.setcolSelected(true);   
                }
            }
        }

        // Populate the taxonomy mappings (WDEV-6108)
        form.lyrActivity().tabSchedulling().ccTaxonomyTab2().setValue(localActivity.getCodeMappings());
    }
    else
    {
        if (localActivity.getActivityTypeIsNotNull())
            form.lyrActivity().tabNtpf().txtActivity().setValue(localActivity.getActivityType().getText());

        if (localActivity.getName() != null)
            form.lyrActivity().tabNtpf().txtName().setValue(localActivity.getName());

        form.lyrActivity().tabNtpf().chkActive().setValue(localActivity.getIsActive().booleanValue());
        form.lyrActivity().tabNtpf().chkItem().setValue(localActivity.getIsWorkQueue().booleanValue());

        // Populate the taxonomy mappings (WDEV-6108)
        form.lyrActivity().tabNtpf().ccTaxonomyTab1().setValue(localActivity.getCodeMappings());
    }
}
项目:openMAXIMS    文件:Logic.java   
protected void onTreActivityTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
    if (node.getValue() instanceof ActivityVo)
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(false);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(true);
        form.getLocalContext().setActivityVo((ActivityVo) form.treActivity().getSelectedNode().getValue());
        clearActivityDetails();

        ActivityVo voActivity = (ActivityVo) form.treActivity().getSelectedNode().getValue();
        populateScreenFromActivityVo(voActivity);

        if (!(node.getValue() instanceof ActivitySchedVo))
        {
            CodingAlertConfigurationVo alertVo = domain.getAlert(voActivity);
            form.getLocalContext().setAlertVo(alertVo);
            populateScreenFromAlertVo(alertVo);
            showAlertDetails(enableAlertControls(node.getParent()), voActivity.getActivityType());
        }
    }
    else if (node.getValue() instanceof ActivityType)
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(true);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
        clearActivityDetails();

        ActivityType activityType = (ActivityType) node.getValue();
        if (activityType.equals(ActivityType.ADMINFUNCTIONS))
        {
            if (adminInstanceExists())
                form.getContextMenus().getGenericGridAddItem().setVisible(false);
        }

        showAlertDetails(enableAlertControls(node), activityType);

        if (oneChildOnlyAllowed(node))
            form.getContextMenus().getGenericGridAddItem().setVisible(false);
    }
    else
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(false);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void repopulateScreen()
{
    if (form.getGlobalContext().Scheduling.getBookingAppointment() == null)
        return;

    // store the same booking record
    Sch_BookingVo voBooking = domain.getSch_BookingByAppt(form.getGlobalContext().Scheduling.getBookingAppointment());
    form.getLocalContext().setSch_Booking(voBooking);
    if (voBooking != null)
        form.txtBookingComments().setValue(voBooking.getBookingComments());

    form.cmbSpecialty().setValue(form.getGlobalContext().Scheduling.getBookingService());
    if (form.cmbSpecialty().getValue() == null && form.getGlobalContext().Scheduling.getBookingService() instanceof ServiceLiteVo)
    {
        form.cmbSpecialty().newRow(form.getGlobalContext().Scheduling.getBookingService(), ((ServiceLiteVo) form.getGlobalContext().Scheduling.getBookingService()).getServiceName());
        form.cmbSpecialty().setValue(form.getGlobalContext().Scheduling.getBookingService());
    }

    if (form.getGlobalContext().Scheduling.getBookingActivityIsNotNull())
    {
        for (int i = 0; i < form.cmbActivity().getValues().size(); i++)
        {
            if (((ActivitySchedVo) form.cmbActivity().getValues().get(i)).getID_Activity().equals(form.getGlobalContext().Scheduling.getBookingActivity().getID_Activity()))
            {
                form.cmbActivity().setValue((ActivitySchedVo) form.cmbActivity().getValues().get(i));
                listClinics();
                break;
            }
        }
    }

    if (form.getGlobalContext().Scheduling.getBookingSessionIsNotNull())
        form.cmbClinic().setValue(domain.getProfileForSession(form.getGlobalContext().Scheduling.getBookingSession()));

    if (validateSearchCriteria() == null)
    {
        loadSessions(false);
        form.getLocalContext().setEnableFirstAvailableApp(true);    //wdev-14867
        // set a flag to say that the appt to be rebooked hasnt yet been selected
        form.getLocalContext().setIsRebookApptSelected(false);
        form.setMode(FormMode.EDIT);
        form.bookingCalendar1().setSelectedDay(new Date());
        bookingCalendar1DateSelected(new Date());
        form.btnCancel().setEnabled(true);

        form.cmbSpecialty().setEnabled(false);
        form.cmbActivity().setEnabled(false);
        form.cmbClinic().setEnabled(false);
        form.imbClear().setEnabled(false);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateActivityVoFromScreen(ActivityVo voActivity)
{
    if (voActivity == null)
        return;

    if (voActivity instanceof ActivitySchedVo)
    {
        //scheduling
        if (voActivity.getActivityType() == null)
            voActivity.setActivityType((ActivityType) form.treActivity().getSelectedNode().getValue());

        //if (form.lyrActivity().tabSchedulling().txtActName().getValue() != null)      WDEV-15167
        voActivity.setName(form.lyrActivity().tabSchedulling().txtActName().getValue());

        if (form.lyrActivity().tabSchedulling().intTimeRequired().getValue() != null)
            ((ActivitySchedVo) voActivity).setTmReq(form.lyrActivity().tabSchedulling().intTimeRequired().getValue());

        if (form.lyrActivity().tabSchedulling().intIntervalRequired().getValue() != null)
            ((ActivitySchedVo) voActivity).setIntReq(form.lyrActivity().tabSchedulling().intIntervalRequired().getValue());

        if (form.getGlobalContext().Admin.getSelectedImageIsNotNull())
            ((ActivitySchedVo) voActivity).setActivityImage(form.getGlobalContext().Admin.getSelectedImage());

        ((ActivitySchedVo) voActivity).setIsPatReq(new Boolean(form.lyrActivity().tabSchedulling().chkPatientRequired().getValue()));
        ((ActivitySchedVo) voActivity).setIsScheduled(new Boolean(form.lyrActivity().tabSchedulling().chkScheduled().getValue()));
        voActivity.setIsActive(new Boolean(form.lyrActivity().tabSchedulling().chkActActive().getValue()));

        // Save Activity special requirements.
        ActivitySpecRequirementsCollection asrColl = new ActivitySpecRequirementsCollection();

        GenForm.lyrActivityLayer.tabSchedullingContainer.grdActSpecialRequirementsRow row;
        for (int i = 0; i < form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().size(); i++)
        {
            row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().get(i);
            if (row.getcolSelected())
                asrColl.add(row.getValue());
        }
        ((ActivitySchedVo) voActivity).setSpecialRequirements(asrColl);

        // Save Activity taxonomy mappings (WDEV-6108)
        voActivity.setCodeMappings(form.lyrActivity().tabSchedulling().ccTaxonomyTab2().getValue());
        voActivity.setFirstAppointment(form.lyrActivity().tabSchedulling().chkFirstAppointment().getValue());
        voActivity.setDiagnostic(form.lyrActivity().tabSchedulling().chkDiagnosticActivity().getValue());
    }
    else
    {
        if (voActivity.getActivityType() == null)
            voActivity.setActivityType((ActivityType) form.treActivity().getSelectedNode().getValue());

        if (form.lyrActivity().tabNtpf().txtName().getValue() != null)
            voActivity.setName(form.lyrActivity().tabNtpf().txtName().getValue());

        voActivity.setIsWorkQueue(new Boolean(form.lyrActivity().tabNtpf().chkItem().getValue()));
        voActivity.setIsActive(new Boolean(form.lyrActivity().tabNtpf().chkActive().getValue()));

        // Save Activity taxonomy mappings (WDEV-6108)
        voActivity.setCodeMappings(form.lyrActivity().tabNtpf().ccTaxonomyTab1().getValue());
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromActivityVo(ActivityVo localActivity)
{
    if (localActivity == null)
        return;

    if (localActivity instanceof ActivitySchedVo)
    {
        if (localActivity.getActivityTypeIsNotNull())
            form.lyrActivity().tabSchedulling().txtActType().setValue(localActivity.getActivityType().getText());

        if (localActivity.getName() != null)
            form.lyrActivity().tabSchedulling().txtActName().setValue(localActivity.getName());

        if (((ActivitySchedVo) localActivity).getTmReq() != null)
            form.lyrActivity().tabSchedulling().intTimeRequired().setValue(((ActivitySchedVo) localActivity).getTmReq());

        if (((ActivitySchedVo) localActivity).getIntReq() != null)
            form.lyrActivity().tabSchedulling().intIntervalRequired().setValue(((ActivitySchedVo) localActivity).getIntReq());

        if (((ActivitySchedVo) localActivity).getActivityImage() != null)
            form.lyrActivity().tabSchedulling().txtActImage().setValue(((ActivitySchedVo) localActivity).getActivityImage().getImagePath());

        form.getGlobalContext().Admin.setSelectedImage(((ActivitySchedVo) localActivity).getActivityImage());

        if (((ActivitySchedVo) localActivity).getIsPatReq() != null)
            form.lyrActivity().tabSchedulling().chkPatientRequired().setValue(((ActivitySchedVo) localActivity).getIsPatReq().booleanValue());

        if (((ActivitySchedVo) localActivity).getIsScheduled() != null)
            form.lyrActivity().tabSchedulling().chkScheduled().setValue(((ActivitySchedVo) localActivity).getIsScheduled().booleanValue());

        if (((ActivitySchedVo) localActivity).getIsActive() != null)
            form.lyrActivity().tabSchedulling().chkActActive().setValue(localActivity.getIsActive().booleanValue());

        form.lyrActivity().tabSchedulling().chkFirstAppointment().setValue(((ActivitySchedVo) localActivity).getFirstAppointment());
        form.lyrActivity().tabSchedulling().chkDiagnosticActivity().setValue(((ActivitySchedVo) localActivity).getDiagnostic());

        if(((ActivitySchedVo) localActivity).getSpecialRequirementsIsNotNull())
        {
            GenForm.lyrActivityLayer.tabSchedullingContainer.grdActSpecialRequirementsRow row;
            ActivitySpecRequirementsCollection requirements = ((ActivitySchedVo) localActivity).getSpecialRequirements();
            for (int i=0; i<requirements.size(); i++)
            {
                ActivitySpecRequirements requirement = requirements.get(i);
                row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRowByValue(requirement);
                if (row != null)
                    row.setcolSelected(true);
                else
                {
                    row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().newRow();
                    row.setValue(requirement);
                    row.setcolRequirement(requirement.getText());   
                    row.setcolSelected(true);   
                }
            }
        }

        // Populate the taxonomy mappings (WDEV-6108)
        form.lyrActivity().tabSchedulling().ccTaxonomyTab2().setValue(localActivity.getCodeMappings());
    }
    else
    {
        if (localActivity.getActivityTypeIsNotNull())
            form.lyrActivity().tabNtpf().txtActivity().setValue(localActivity.getActivityType().getText());

        if (localActivity.getName() != null)
            form.lyrActivity().tabNtpf().txtName().setValue(localActivity.getName());

        form.lyrActivity().tabNtpf().chkActive().setValue(localActivity.getIsActive().booleanValue());
        form.lyrActivity().tabNtpf().chkItem().setValue(localActivity.getIsWorkQueue().booleanValue());

        // Populate the taxonomy mappings (WDEV-6108)
        form.lyrActivity().tabNtpf().ccTaxonomyTab1().setValue(localActivity.getCodeMappings());
    }
}
项目:openMAXIMS    文件:Logic.java   
protected void onTreActivityTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
    if (node.getValue() instanceof ActivityVo)
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(false);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(true);
        form.getLocalContext().setActivityVo((ActivityVo) form.treActivity().getSelectedNode().getValue());
        clearActivityDetails();

        ActivityVo voActivity = (ActivityVo) form.treActivity().getSelectedNode().getValue();
        populateScreenFromActivityVo(voActivity);

        if (!(node.getValue() instanceof ActivitySchedVo))
        {
            CodingAlertConfigurationVo alertVo = domain.getAlert(voActivity);
            form.getLocalContext().setAlertVo(alertVo);
            populateScreenFromAlertVo(alertVo);
            showAlertDetails(enableAlertControls(node.getParent()), voActivity.getActivityType());
        }
    }
    else if (node.getValue() instanceof ActivityType)
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(true);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
        clearActivityDetails();

        ActivityType activityType = (ActivityType) node.getValue();
        if (activityType.equals(ActivityType.ADMINFUNCTIONS))
        {
            if (adminInstanceExists())
                form.getContextMenus().getGenericGridAddItem().setVisible(false);
        }

        showAlertDetails(enableAlertControls(node), activityType);

        if (oneChildOnlyAllowed(node))
            form.getContextMenus().getGenericGridAddItem().setVisible(false);
    }
    else
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(false);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void repopulateScreen() {
    if (form.getGlobalContext().Scheduling.getBookingAppointment() == null)
        return;

    // SITE-508
    form.getGlobalContext().Scheduling.setBookingAppointment(domain
            .getBookingAppointment(form.getGlobalContext().Scheduling
                    .getBookingAppointment()));

    // store the same booking record
    Sch_BookingVo voBooking = domain.getSch_BookingByAppt(form
            .getGlobalContext().Scheduling.getBookingAppointment());
    form.getLocalContext().setSch_Booking(voBooking);
    if (voBooking != null)
        form.txtBookingComments().setValue(voBooking.getBookingComments());

    form.cmbService().setValue(
            form.getGlobalContext().Scheduling.getBookingService());
    if (form.cmbService().getValue() == null
            && form.getGlobalContext().Scheduling.getBookingService() instanceof ServiceLiteVo) {
        form.cmbService().newRow(
                form.getGlobalContext().Scheduling.getBookingService(),
                ((ServiceLiteVo) form.getGlobalContext().Scheduling
                        .getBookingService()).getServiceName());
        form.cmbService().setValue(
                form.getGlobalContext().Scheduling.getBookingService());
    }

    if (form.getGlobalContext().Scheduling.getBookingActivityIsNotNull()) {
        for (int i = 0; i < form.cmbActivity().getValues().size(); i++) {
            if (((ActivitySchedVo) form.cmbActivity().getValues().get(i))
                    .getID_Activity().equals(
                            form.getGlobalContext().Scheduling
                                    .getBookingActivity().getID_Activity())) {
                form.cmbActivity().setValue(
                        (ActivitySchedVo) form.cmbActivity().getValues()
                                .get(i));
                break;
            }
        }
    }

    if (validateSearchCriteria() == null) {
        loadSessions();
        // set a flag to say that the appt to be rebooked hasnt yet been
        // selected
        form.getLocalContext().setIsRebookApptSelected(false);
        form.setMode(FormMode.EDIT);
        form.bookingCalendarAppts().setSelectedDay(new Date());
        bookingCalendarDateSelected(new Date());
        form.btnCancel().setEnabled(true);

        form.cmbService().setEnabled(false);
        form.cmbActivity().setEnabled(false);
        form.imbClear().setEnabled(false);
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void repopulateScreen()
{
    if (form.getGlobalContext().Scheduling.getBookingAppointment() == null)
        return;

    // store the same booking record
    Sch_BookingVo voBooking = domain.getSch_BookingByAppt(form.getGlobalContext().Scheduling.getBookingAppointment());
    form.getLocalContext().setSch_Booking(voBooking);
    if (voBooking != null)
        form.txtBookingComments().setValue(voBooking.getBookingComments());

    form.cmbSpecialty().setValue(form.getGlobalContext().Scheduling.getBookingService());
    if (form.cmbSpecialty().getValue() == null && form.getGlobalContext().Scheduling.getBookingService() instanceof ServiceLiteVo)
    {
        form.cmbSpecialty().newRow(form.getGlobalContext().Scheduling.getBookingService(), ((ServiceLiteVo) form.getGlobalContext().Scheduling.getBookingService()).getServiceName());
        form.cmbSpecialty().setValue(form.getGlobalContext().Scheduling.getBookingService());
    }

    if (form.getGlobalContext().Scheduling.getBookingActivityIsNotNull())
    {
        for (int i = 0; i < form.cmbActivity().getValues().size(); i++)
        {
            if (((ActivitySchedVo) form.cmbActivity().getValues().get(i)).getID_Activity().equals(form.getGlobalContext().Scheduling.getBookingActivity().getID_Activity()))
            {
                form.cmbActivity().setValue((ActivitySchedVo) form.cmbActivity().getValues().get(i));
                listClinics();
                break;
            }
        }
    }

    if (form.getGlobalContext().Scheduling.getBookingSessionIsNotNull())
        form.cmbClinic().setValue(domain.getProfileForSession(form.getGlobalContext().Scheduling.getBookingSession()));

    if (validateSearchCriteria() == null)
    {
        loadSessions(false);
        form.getLocalContext().setEnableFirstAvailableApp(true);    //wdev-14867
        // set a flag to say that the appt to be rebooked hasnt yet been selected
        form.getLocalContext().setIsRebookApptSelected(false);
        form.setMode(FormMode.EDIT);
        form.bookingCalendar1().setSelectedDay(new Date());
        bookingCalendar1DateSelected(new Date());
        form.btnCancel().setEnabled(true);

        form.cmbSpecialty().setEnabled(false);
        form.cmbActivity().setEnabled(false);
        form.cmbClinic().setEnabled(false);
        form.imbClear().setEnabled(false);
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void populateActivityVoFromScreen(ActivityVo voActivity)
{
    if (voActivity == null)
        return;

    if (voActivity instanceof ActivitySchedVo)
    {
        //scheduling
        if (voActivity.getActivityType() == null)
            voActivity.setActivityType((ActivityType) form.treActivity().getSelectedNode().getValue());

        //if (form.lyrActivity().tabSchedulling().txtActName().getValue() != null)      WDEV-15167
        voActivity.setName(form.lyrActivity().tabSchedulling().txtActName().getValue());

        if (form.lyrActivity().tabSchedulling().intTimeRequired().getValue() != null)
            ((ActivitySchedVo) voActivity).setTmReq(form.lyrActivity().tabSchedulling().intTimeRequired().getValue());

        if (form.lyrActivity().tabSchedulling().intIntervalRequired().getValue() != null)
            ((ActivitySchedVo) voActivity).setIntReq(form.lyrActivity().tabSchedulling().intIntervalRequired().getValue());

        if (form.getGlobalContext().Admin.getSelectedImageIsNotNull())
            ((ActivitySchedVo) voActivity).setActivityImage(form.getGlobalContext().Admin.getSelectedImage());

        ((ActivitySchedVo) voActivity).setIsPatReq(new Boolean(form.lyrActivity().tabSchedulling().chkPatientRequired().getValue()));
        ((ActivitySchedVo) voActivity).setIsScheduled(new Boolean(form.lyrActivity().tabSchedulling().chkScheduled().getValue()));
        voActivity.setIsActive(new Boolean(form.lyrActivity().tabSchedulling().chkActActive().getValue()));

        // Save Activity special requirements.
        ActivitySpecRequirementsCollection asrColl = new ActivitySpecRequirementsCollection();

        GenForm.lyrActivityLayer.tabSchedullingContainer.grdActSpecialRequirementsRow row;
        for (int i = 0; i < form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().size(); i++)
        {
            row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().get(i);
            if (row.getcolSelected())
                asrColl.add(row.getValue());
        }
        ((ActivitySchedVo) voActivity).setSpecialRequirements(asrColl);

        // Save Activity taxonomy mappings (WDEV-6108)
        voActivity.setCodeMappings(form.lyrActivity().tabSchedulling().ccTaxonomyTab2().getValue());
        voActivity.setFirstAppointment(form.lyrActivity().tabSchedulling().chkFirstAppointment().getValue());
        voActivity.setDiagnostic(form.lyrActivity().tabSchedulling().chkDiagnosticActivity().getValue());
    }
    else
    {
        if (voActivity.getActivityType() == null)
            voActivity.setActivityType((ActivityType) form.treActivity().getSelectedNode().getValue());

        if (form.lyrActivity().tabNtpf().txtName().getValue() != null)
            voActivity.setName(form.lyrActivity().tabNtpf().txtName().getValue());

        voActivity.setIsWorkQueue(new Boolean(form.lyrActivity().tabNtpf().chkItem().getValue()));
        voActivity.setIsActive(new Boolean(form.lyrActivity().tabNtpf().chkActive().getValue()));

        // Save Activity taxonomy mappings (WDEV-6108)
        voActivity.setCodeMappings(form.lyrActivity().tabNtpf().ccTaxonomyTab1().getValue());
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void populateScreenFromActivityVo(ActivityVo localActivity)
{
    if (localActivity == null)
        return;

    if (localActivity instanceof ActivitySchedVo)
    {
        if (localActivity.getActivityTypeIsNotNull())
            form.lyrActivity().tabSchedulling().txtActType().setValue(localActivity.getActivityType().getText());

        if (localActivity.getName() != null)
            form.lyrActivity().tabSchedulling().txtActName().setValue(localActivity.getName());

        if (((ActivitySchedVo) localActivity).getTmReq() != null)
            form.lyrActivity().tabSchedulling().intTimeRequired().setValue(((ActivitySchedVo) localActivity).getTmReq());

        if (((ActivitySchedVo) localActivity).getIntReq() != null)
            form.lyrActivity().tabSchedulling().intIntervalRequired().setValue(((ActivitySchedVo) localActivity).getIntReq());

        if (((ActivitySchedVo) localActivity).getActivityImage() != null)
            form.lyrActivity().tabSchedulling().txtActImage().setValue(((ActivitySchedVo) localActivity).getActivityImage().getImagePath());

        form.getGlobalContext().Admin.setSelectedImage(((ActivitySchedVo) localActivity).getActivityImage());

        if (((ActivitySchedVo) localActivity).getIsPatReq() != null)
            form.lyrActivity().tabSchedulling().chkPatientRequired().setValue(((ActivitySchedVo) localActivity).getIsPatReq().booleanValue());

        if (((ActivitySchedVo) localActivity).getIsScheduled() != null)
            form.lyrActivity().tabSchedulling().chkScheduled().setValue(((ActivitySchedVo) localActivity).getIsScheduled().booleanValue());

        if (((ActivitySchedVo) localActivity).getIsActive() != null)
            form.lyrActivity().tabSchedulling().chkActActive().setValue(localActivity.getIsActive().booleanValue());

        form.lyrActivity().tabSchedulling().chkFirstAppointment().setValue(((ActivitySchedVo) localActivity).getFirstAppointment());
        form.lyrActivity().tabSchedulling().chkDiagnosticActivity().setValue(((ActivitySchedVo) localActivity).getDiagnostic());

        if(((ActivitySchedVo) localActivity).getSpecialRequirementsIsNotNull())
        {
            GenForm.lyrActivityLayer.tabSchedullingContainer.grdActSpecialRequirementsRow row;
            ActivitySpecRequirementsCollection requirements = ((ActivitySchedVo) localActivity).getSpecialRequirements();
            for (int i=0; i<requirements.size(); i++)
            {
                ActivitySpecRequirements requirement = requirements.get(i);
                row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRowByValue(requirement);
                if (row != null)
                    row.setcolSelected(true);
                else
                {
                    row = form.lyrActivity().tabSchedulling().grdActSpecialRequirements().getRows().newRow();
                    row.setValue(requirement);
                    row.setcolRequirement(requirement.getText());   
                    row.setcolSelected(true);   
                }
            }
        }

        // Populate the taxonomy mappings (WDEV-6108)
        form.lyrActivity().tabSchedulling().ccTaxonomyTab2().setValue(localActivity.getCodeMappings());
    }
    else
    {
        if (localActivity.getActivityTypeIsNotNull())
            form.lyrActivity().tabNtpf().txtActivity().setValue(localActivity.getActivityType().getText());

        if (localActivity.getName() != null)
            form.lyrActivity().tabNtpf().txtName().setValue(localActivity.getName());

        form.lyrActivity().tabNtpf().chkActive().setValue(localActivity.getIsActive().booleanValue());
        form.lyrActivity().tabNtpf().chkItem().setValue(localActivity.getIsWorkQueue().booleanValue());

        // Populate the taxonomy mappings (WDEV-6108)
        form.lyrActivity().tabNtpf().ccTaxonomyTab1().setValue(localActivity.getCodeMappings());
    }
}
项目:openmaxims-linux    文件:Logic.java   
protected void onTreActivityTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
    if (node.getValue() instanceof ActivityVo)
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(false);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(true);
        form.getLocalContext().setActivityVo((ActivityVo) form.treActivity().getSelectedNode().getValue());
        clearActivityDetails();

        ActivityVo voActivity = (ActivityVo) form.treActivity().getSelectedNode().getValue();
        populateScreenFromActivityVo(voActivity);

        if (!(node.getValue() instanceof ActivitySchedVo))
        {
            CodingAlertConfigurationVo alertVo = domain.getAlert(voActivity);
            form.getLocalContext().setAlertVo(alertVo);
            populateScreenFromAlertVo(alertVo);
            showAlertDetails(enableAlertControls(node.getParent()), voActivity.getActivityType());
        }
    }
    else if (node.getValue() instanceof ActivityType)
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(true);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
        clearActivityDetails();

        ActivityType activityType = (ActivityType) node.getValue();
        if (activityType.equals(ActivityType.ADMINFUNCTIONS))
        {
            if (adminInstanceExists())
                form.getContextMenus().getGenericGridAddItem().setVisible(false);
        }

        showAlertDetails(enableAlertControls(node), activityType);

        if (oneChildOnlyAllowed(node))
            form.getContextMenus().getGenericGridAddItem().setVisible(false);
    }
    else
    {
        form.getContextMenus().getGenericGridAddItem().setVisible(false);
        form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
    }
}