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

项目:AvoinApotti    文件:UrinalysisImpl.java   
/**
* lists Urinanalysis records
*/
public UrinalysisCollection listUrinanalysis(ims.core.vo.Urinalysis voUrinalysis)throws DomainInterfaceException
{   
    UrinalysisCollection voCollUrinanalysis = new UrinalysisCollection();
    if(voCollUrinanalysis == null)
        return voCollUrinanalysis;

    DomainFactory factory = getDomainFactory(); 
    StringBuffer hql = new StringBuffer("");
    String query = "from Urinalysis t";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = "";

    if (voUrinalysis.getCareContextIsNotNull())
    {
        hql.append(andStr + " t.careContext.id = :cc");
        markers.add("cc");
        values.add(voUrinalysis.getCareContext().getID_CareContext());
        andStr = " and";

        if(voUrinalysis.getIsActiveIsNotNull()) //the active ones
        {
            hql.append(andStr + " t.isActive = :active");
            markers.add("active");
            values.add(voUrinalysis.getIsActive());
            andStr = " and";
        }
    }

    if(andStr.equals(" and"))
        query += " where";

    query += hql.toString();
    List urs = factory.find(query, markers, values);                            
    return UrinalysisAssembler.createUrinalysisCollectionFromUrinalysis(urs).sort(SortOrder.DESCENDING);

}
项目:AvoinApotti    文件:Logic.java   
private void populateRecordBrowser()
{
    form.recbrAllRecords().clear();

    if (form.getGlobalContext().Core.getCurrentCareContext() == null)
        return;

    UrinalysisCollection collUrinalysis = domain.listUrinalysisByCareContext(form.getGlobalContext().Core.getCurrentCareContext(), form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive) ? true : false);

    if (collUrinalysis == null || collUrinalysis.size()==0)
    {
        form.getLocalContext().setSelectedUrinalysis(null);
        return;
    }

    for (int i = 0; i < collUrinalysis.size(); i++)
    {
        Urinalysis urinalysis = collUrinalysis.get(i);

        form.recbrAllRecords().newRow(urinalysis, (urinalysis.getAuthoringInformationIsNotNull() && urinalysis.getAuthoringInformation().getAuthoringDateTime() != null ? urinalysis.getAuthoringInformation().getAuthoringDateTime().toString() : "") + " - " + (urinalysis.getAuthoringInformationIsNotNull() && urinalysis.getAuthoringInformation().getAuthoringHcp() != null ? urinalysis.getAuthoringInformation().getAuthoringHcp().toString() : ""));
    }

    if (collUrinalysis.size() > 0 && form.getLocalContext().getSelectedUrinalysis() == null)
    {
        form.getLocalContext().setSelectedUrinalysis(collUrinalysis.get(0));
    }
    else if (collUrinalysis.size() > 0 && form.getLocalContext().getSelectedUrinalysisIsNotNull() && Boolean.FALSE.equals(form.getLocalContext().getSelectedUrinalysis().getIsActive()))
    {
        form.getLocalContext().setSelectedUrinalysis(collUrinalysis.get(0));
    }

    form.recbrAllRecords().setValue(form.getLocalContext().getSelectedUrinalysis());
}
项目:openMAXIMS    文件:UrinalysisImpl.java   
/**
* lists Urinanalysis records
*/
public UrinalysisCollection listUrinanalysis(ims.core.vo.Urinalysis voUrinalysis)throws DomainInterfaceException
{   
    UrinalysisCollection voCollUrinanalysis = new UrinalysisCollection();
    if(voCollUrinanalysis == null)
        return voCollUrinanalysis;

    DomainFactory factory = getDomainFactory(); 
    StringBuffer hql = new StringBuffer("");
    String query = "from Urinalysis t";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = "";

    if (voUrinalysis.getCareContextIsNotNull())
    {
        hql.append(andStr + " t.careContext.id = :cc");
        markers.add("cc");
        values.add(voUrinalysis.getCareContext().getID_CareContext());
        andStr = " and";

        if(voUrinalysis.getIsActiveIsNotNull()) //the active ones
        {
            hql.append(andStr + " t.isActive = :active");
            markers.add("active");
            values.add(voUrinalysis.getIsActive());
            andStr = " and";
        }
    }

    if(andStr.equals(" and"))
        query += " where";

    query += hql.toString();
    List urs = factory.find(query, markers, values);                            
    return UrinalysisAssembler.createUrinalysisCollectionFromUrinalysis(urs).sort(SortOrder.DESCENDING);

}
项目:openMAXIMS    文件:Logic.java   
private void populateRecordBrowser()
{
    form.recbrAllRecords().clear();

    if (form.getGlobalContext().Core.getCurrentCareContext() == null)
        return;

    UrinalysisCollection collUrinalysis = domain.listUrinalysisByCareContext(form.getGlobalContext().Core.getCurrentCareContext(), form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive) ? true : false);

    if (collUrinalysis == null || collUrinalysis.size()==0)
    {
        form.getLocalContext().setSelectedUrinalysis(null);
        return;
    }

    for (int i = 0; i < collUrinalysis.size(); i++)
    {
        Urinalysis urinalysis = collUrinalysis.get(i);

        form.recbrAllRecords().newRow(urinalysis, (urinalysis.getAuthoringInformationIsNotNull() && urinalysis.getAuthoringInformation().getAuthoringDateTime() != null ? urinalysis.getAuthoringInformation().getAuthoringDateTime().toString() : "") + " - " + (urinalysis.getAuthoringInformationIsNotNull() && urinalysis.getAuthoringInformation().getAuthoringHcp() != null ? urinalysis.getAuthoringInformation().getAuthoringHcp().toString() : ""));
    }

    if (collUrinalysis.size() > 0 && form.getLocalContext().getSelectedUrinalysis() == null)
    {
        form.getLocalContext().setSelectedUrinalysis(collUrinalysis.get(0));
    }
    else if (collUrinalysis.size() > 0 && form.getLocalContext().getSelectedUrinalysisIsNotNull() && Boolean.FALSE.equals(form.getLocalContext().getSelectedUrinalysis().getIsActive()))
    {
        form.getLocalContext().setSelectedUrinalysis(collUrinalysis.get(0));
    }

    form.recbrAllRecords().setValue(form.getLocalContext().getSelectedUrinalysis());
}
项目:openMAXIMS    文件:UrinalysisImpl.java   
/**
* lists Urinanalysis records
*/
public UrinalysisCollection listUrinanalysis(ims.core.vo.Urinalysis voUrinalysis)throws DomainInterfaceException
{   
    UrinalysisCollection voCollUrinanalysis = new UrinalysisCollection();
    if(voCollUrinanalysis == null)
        return voCollUrinanalysis;

    DomainFactory factory = getDomainFactory(); 
    StringBuffer hql = new StringBuffer("");
    String query = "from Urinalysis t";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = "";

    if (voUrinalysis.getCareContextIsNotNull())
    {
        hql.append(andStr + " t.careContext.id = :cc");
        markers.add("cc");
        values.add(voUrinalysis.getCareContext().getID_CareContext());
        andStr = " and";

        if(voUrinalysis.getIsActiveIsNotNull()) //the active ones
        {
            hql.append(andStr + " t.isActive = :active");
            markers.add("active");
            values.add(voUrinalysis.getIsActive());
            andStr = " and";
        }
    }

    if(andStr.equals(" and"))
        query += " where";

    query += hql.toString();
    List urs = factory.find(query, markers, values);                            
    return UrinalysisAssembler.createUrinalysisCollectionFromUrinalysis(urs).sort(SortOrder.DESCENDING);

}
项目:openMAXIMS    文件:Logic.java   
private void populateRecordBrowser()
{
    form.recbrAllRecords().clear();

    if (form.getGlobalContext().Core.getCurrentCareContext() == null)
        return;

    UrinalysisCollection collUrinalysis = domain.listUrinalysisByCareContext(form.getGlobalContext().Core.getCurrentCareContext(), form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive) ? true : false);

    if (collUrinalysis == null || collUrinalysis.size()==0)
    {
        form.getLocalContext().setSelectedUrinalysis(null);
        return;
    }

    for (int i = 0; i < collUrinalysis.size(); i++)
    {
        Urinalysis urinalysis = collUrinalysis.get(i);

        form.recbrAllRecords().newRow(urinalysis, (urinalysis.getAuthoringInformationIsNotNull() && urinalysis.getAuthoringInformation().getAuthoringDateTime() != null ? urinalysis.getAuthoringInformation().getAuthoringDateTime().toString() : "") + " - " + (urinalysis.getAuthoringInformationIsNotNull() && urinalysis.getAuthoringInformation().getAuthoringHcp() != null ? urinalysis.getAuthoringInformation().getAuthoringHcp().toString() : ""));
    }

    if (collUrinalysis.size() > 0 && form.getLocalContext().getSelectedUrinalysis() == null)
    {
        form.getLocalContext().setSelectedUrinalysis(collUrinalysis.get(0));
    }
    else if (collUrinalysis.size() > 0 && form.getLocalContext().getSelectedUrinalysisIsNotNull() && Boolean.FALSE.equals(form.getLocalContext().getSelectedUrinalysis().getIsActive()))
    {
        form.getLocalContext().setSelectedUrinalysis(collUrinalysis.get(0));
    }

    form.recbrAllRecords().setValue(form.getLocalContext().getSelectedUrinalysis());
}
项目:openmaxims-linux    文件:UrinalysisImpl.java   
/**
* lists Urinanalysis records
*/
public UrinalysisCollection listUrinanalysis(ims.core.vo.Urinalysis voUrinalysis)throws DomainInterfaceException
{   
    UrinalysisCollection voCollUrinanalysis = new UrinalysisCollection();
    if(voCollUrinanalysis == null)
        return voCollUrinanalysis;

    DomainFactory factory = getDomainFactory(); 
    StringBuffer hql = new StringBuffer("");
    String query = "from Urinalysis t";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = "";

    if (voUrinalysis.getCareContextIsNotNull())
    {
        hql.append(andStr + " t.careContext.id = :cc");
        markers.add("cc");
        values.add(voUrinalysis.getCareContext().getID_CareContext());
        andStr = " and";

        if(voUrinalysis.getIsActiveIsNotNull()) //the active ones
        {
            hql.append(andStr + " t.isActive = :active");
            markers.add("active");
            values.add(voUrinalysis.getIsActive());
            andStr = " and";
        }
    }

    if(andStr.equals(" and"))
        query += " where";

    query += hql.toString();
    List urs = factory.find(query, markers, values);                            
    return UrinalysisAssembler.createUrinalysisCollectionFromUrinalysis(urs).sort(SortOrder.DESCENDING);

}
项目:openmaxims-linux    文件:Logic.java   
private void populateRecordBrowser()
{
    form.recbrAllRecords().clear();

    if (form.getGlobalContext().Core.getCurrentCareContext() == null)
        return;

    UrinalysisCollection collUrinalysis = domain.listUrinalysisByCareContext(form.getGlobalContext().Core.getCurrentCareContext(), form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive) ? true : false);

    if (collUrinalysis == null || collUrinalysis.size()==0)
    {
        form.getLocalContext().setSelectedUrinalysis(null);
        return;
    }

    for (int i = 0; i < collUrinalysis.size(); i++)
    {
        Urinalysis urinalysis = collUrinalysis.get(i);

        form.recbrAllRecords().newRow(urinalysis, (urinalysis.getAuthoringInformationIsNotNull() && urinalysis.getAuthoringInformation().getAuthoringDateTime() != null ? urinalysis.getAuthoringInformation().getAuthoringDateTime().toString() : "") + " - " + (urinalysis.getAuthoringInformationIsNotNull() && urinalysis.getAuthoringInformation().getAuthoringHcp() != null ? urinalysis.getAuthoringInformation().getAuthoringHcp().toString() : ""));
    }

    if (collUrinalysis.size() > 0 && form.getLocalContext().getSelectedUrinalysis() == null)
    {
        form.getLocalContext().setSelectedUrinalysis(collUrinalysis.get(0));
    }
    else if (collUrinalysis.size() > 0 && form.getLocalContext().getSelectedUrinalysisIsNotNull() && Boolean.FALSE.equals(form.getLocalContext().getSelectedUrinalysis().getIsActive()))
    {
        form.getLocalContext().setSelectedUrinalysis(collUrinalysis.get(0));
    }

    form.recbrAllRecords().setValue(form.getLocalContext().getSelectedUrinalysis());
}
项目:AvoinApotti    文件:Logic.java   
private void open() 
{
    form.getLocalContext().setVoUrinanalysis(null);
    clearScreen();
    form.chkNoSample().setValue(false);
    setMode(false);

    UrinalysisCollection voCollUrinanalysis = new UrinalysisCollection();

    Urinalysis voUrinalysis = new Urinalysis();
    voUrinalysis.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    voUrinalysis.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

    if (form.grpFilterBy().getValue() != null && form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive))
        voUrinalysis.setIsActive(Boolean.TRUE);

    try 
    {
        voCollUrinanalysis = domain.listUrinanalysis(voUrinalysis); 
    }
    catch (DomainInterfaceException e)
    {
        engine.showMessage("DomainInterfaceException occurred listing Urinanalysis " + e.getMessage());
        return;
    }


    form.btnUpdate().setEnabled(false);

    if (voCollUrinanalysis == null)
        return;

    int nCount = voCollUrinanalysis.size();

    if(form.getLocalContext().getIndex() == null)
        form.getLocalContext().setIndex(new Integer(0));

    if (nCount == 0)
    {
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
        return;
    }

    if (nCount > form.getLocalContext().getIndex().intValue())
    {
        populateScreen(voCollUrinanalysis.get(form.getLocalContext().getIndex().intValue()));   
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
    }
    else
    {
        populateScreen(voCollUrinanalysis.get(nCount - 1));
        setPrevNextBtnStatus(nCount, nCount - 1);
    }


    form.getLocalContext().setVoCollUrinanalysis(voCollUrinanalysis);
    form.btnUpdate().setEnabled(true);
}
项目:AvoinApotti    文件:Logic.java   
private void rdoValueChanged() 
{
    // Keep the selection
    if (GenForm.grpFilterByEnumeration.rdoActive.equals(form.grpFilterBy().getValue()))
    {
        form.getLocalContext().setActiveOnly(Boolean.TRUE);
    }
    else
    {
        form.getLocalContext().setActiveOnly(Boolean.FALSE);
    }

    //List the Urinalysis records based on the filter selected
    UrinalysisCollection voUrinalysisColl;

    try {
        Urinalysis voUrinalysis= new Urinalysis();
        voUrinalysis.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
        voUrinalysis.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
        if (form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive))
            voUrinalysis.setIsActive(Boolean.TRUE);
        else
            voUrinalysis.setIsActive(null);

        voUrinalysisColl = domain.listUrinanalysis(voUrinalysis);
    } catch (DomainInterfaceException e) {
        engine.showMessage("DomainInterfaceException occurred listing referrals " + e.getMessage());
        return;
    }
    form.getLocalContext().setVoUrinanalysis(null);
    clearScreen();
    form.chkNoSample().setValue(false);
    setMode(false);

    int nCount = voUrinalysisColl.size();
    form.getLocalContext().setIndex(new Integer(0));

    if (nCount == 0)
    {
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
        form.btnUpdate().setEnabled(false);
        return;
    }

    populateScreen(voUrinalysisColl.get(0)); 
    setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());

    form.getLocalContext().setVoCollUrinanalysis(voUrinalysisColl);

    form.btnUpdate().setEnabled(true);
    //open();
}
项目:openMAXIMS    文件:Logic.java   
private void open() 
{
    form.getLocalContext().setVoUrinanalysis(null);
    clearScreen();
    form.chkNoSample().setValue(false);
    setMode(false);

    UrinalysisCollection voCollUrinanalysis = new UrinalysisCollection();

    Urinalysis voUrinalysis = new Urinalysis();
    voUrinalysis.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    voUrinalysis.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

    if (form.grpFilterBy().getValue() != null && form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive))
        voUrinalysis.setIsActive(Boolean.TRUE);

    try 
    {
        voCollUrinanalysis = domain.listUrinanalysis(voUrinalysis); 
    }
    catch (DomainInterfaceException e)
    {
        engine.showMessage("DomainInterfaceException occurred listing Urinanalysis " + e.getMessage());
        return;
    }


    form.btnUpdate().setEnabled(false);

    if (voCollUrinanalysis == null)
        return;

    int nCount = voCollUrinanalysis.size();

    if(form.getLocalContext().getIndex() == null)
        form.getLocalContext().setIndex(new Integer(0));

    if (nCount == 0)
    {
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
        return;
    }

    if (nCount > form.getLocalContext().getIndex().intValue())
    {
        populateScreen(voCollUrinanalysis.get(form.getLocalContext().getIndex().intValue()));   
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
    }
    else
    {
        populateScreen(voCollUrinanalysis.get(nCount - 1));
        setPrevNextBtnStatus(nCount, nCount - 1);
    }


    form.getLocalContext().setVoCollUrinanalysis(voCollUrinanalysis);
    form.btnUpdate().setEnabled(true);
}
项目:openMAXIMS    文件:Logic.java   
private void rdoValueChanged() 
{
    // Keep the selection
    if (GenForm.grpFilterByEnumeration.rdoActive.equals(form.grpFilterBy().getValue()))
    {
        form.getLocalContext().setActiveOnly(Boolean.TRUE);
    }
    else
    {
        form.getLocalContext().setActiveOnly(Boolean.FALSE);
    }

    //List the Urinalysis records based on the filter selected
    UrinalysisCollection voUrinalysisColl;

    try {
        Urinalysis voUrinalysis= new Urinalysis();
        voUrinalysis.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
        voUrinalysis.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
        if (form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive))
            voUrinalysis.setIsActive(Boolean.TRUE);
        else
            voUrinalysis.setIsActive(null);

        voUrinalysisColl = domain.listUrinanalysis(voUrinalysis);

        form.getGlobalContext().Core.setUrinalysisSearchCriteria(voUrinalysis); // WDEV-19389 
    } catch (DomainInterfaceException e) {
        engine.showMessage("DomainInterfaceException occurred listing referrals " + e.getMessage());
        return;
    }
    form.getLocalContext().setVoUrinanalysis(null);
    clearScreen();
    form.chkNoSample().setValue(false);
    setMode(false);

    int nCount = voUrinalysisColl.size();
    form.getLocalContext().setIndex(new Integer(0));

    if (nCount == 0)
    {
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
        form.btnUpdate().setEnabled(false);
        return;
    }

    populateScreen(voUrinalysisColl.get(0)); 
    setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());

    form.getLocalContext().setVoCollUrinanalysis(voUrinalysisColl);

    form.btnUpdate().setEnabled(true);
    //open();
}
项目:openMAXIMS    文件:Logic.java   
private void open() 
{
    form.getLocalContext().setVoUrinanalysis(null);
    clearScreen();
    form.chkNoSample().setValue(false);
    setMode(false);

    UrinalysisCollection voCollUrinanalysis = new UrinalysisCollection();

    Urinalysis voUrinalysis = new Urinalysis();
    voUrinalysis.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    voUrinalysis.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

    if (form.grpFilterBy().getValue() != null && form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive))
        voUrinalysis.setIsActive(Boolean.TRUE);

    try 
    {
        voCollUrinanalysis = domain.listUrinanalysis(voUrinalysis); 
    }
    catch (DomainInterfaceException e)
    {
        engine.showMessage("DomainInterfaceException occurred listing Urinanalysis " + e.getMessage());
        return;
    }


    form.btnUpdate().setEnabled(false);

    if (voCollUrinanalysis == null)
        return;

    int nCount = voCollUrinanalysis.size();

    if(form.getLocalContext().getIndex() == null)
        form.getLocalContext().setIndex(new Integer(0));

    if (nCount == 0)
    {
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
        return;
    }

    if (nCount > form.getLocalContext().getIndex().intValue())
    {
        populateScreen(voCollUrinanalysis.get(form.getLocalContext().getIndex().intValue()));   
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
    }
    else
    {
        populateScreen(voCollUrinanalysis.get(nCount - 1));
        setPrevNextBtnStatus(nCount, nCount - 1);
    }


    form.getLocalContext().setVoCollUrinanalysis(voCollUrinanalysis);
    form.btnUpdate().setEnabled(true);
}
项目:openMAXIMS    文件:Logic.java   
private void rdoValueChanged() 
{
    // Keep the selection
    if (GenForm.grpFilterByEnumeration.rdoActive.equals(form.grpFilterBy().getValue()))
    {
        form.getLocalContext().setActiveOnly(Boolean.TRUE);
    }
    else
    {
        form.getLocalContext().setActiveOnly(Boolean.FALSE);
    }

    //List the Urinalysis records based on the filter selected
    UrinalysisCollection voUrinalysisColl;

    try {
        Urinalysis voUrinalysis= new Urinalysis();
        voUrinalysis.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
        voUrinalysis.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
        if (form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive))
            voUrinalysis.setIsActive(Boolean.TRUE);
        else
            voUrinalysis.setIsActive(null);

        voUrinalysisColl = domain.listUrinanalysis(voUrinalysis);
    } catch (DomainInterfaceException e) {
        engine.showMessage("DomainInterfaceException occurred listing referrals " + e.getMessage());
        return;
    }
    form.getLocalContext().setVoUrinanalysis(null);
    clearScreen();
    form.chkNoSample().setValue(false);
    setMode(false);

    int nCount = voUrinalysisColl.size();
    form.getLocalContext().setIndex(new Integer(0));

    if (nCount == 0)
    {
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
        form.btnUpdate().setEnabled(false);
        return;
    }

    populateScreen(voUrinalysisColl.get(0)); 
    setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());

    form.getLocalContext().setVoCollUrinanalysis(voUrinalysisColl);

    form.btnUpdate().setEnabled(true);
    //open();
}
项目:openmaxims-linux    文件:Logic.java   
private void open() 
{
    form.getLocalContext().setVoUrinanalysis(null);
    clearScreen();
    form.chkNoSample().setValue(false);
    setMode(false);

    UrinalysisCollection voCollUrinanalysis = new UrinalysisCollection();

    Urinalysis voUrinalysis = new Urinalysis();
    voUrinalysis.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    voUrinalysis.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

    if (form.grpFilterBy().getValue() != null && form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive))
        voUrinalysis.setIsActive(Boolean.TRUE);

    try 
    {
        voCollUrinanalysis = domain.listUrinanalysis(voUrinalysis); 
    }
    catch (DomainInterfaceException e)
    {
        engine.showMessage("DomainInterfaceException occurred listing Urinanalysis " + e.getMessage());
        return;
    }


    form.btnUpdate().setEnabled(false);

    if (voCollUrinanalysis == null)
        return;

    int nCount = voCollUrinanalysis.size();

    if(form.getLocalContext().getIndex() == null)
        form.getLocalContext().setIndex(new Integer(0));

    if (nCount == 0)
    {
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
        return;
    }

    if (nCount > form.getLocalContext().getIndex().intValue())
    {
        populateScreen(voCollUrinanalysis.get(form.getLocalContext().getIndex().intValue()));   
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
    }
    else
    {
        populateScreen(voCollUrinanalysis.get(nCount - 1));
        setPrevNextBtnStatus(nCount, nCount - 1);
    }


    form.getLocalContext().setVoCollUrinanalysis(voCollUrinanalysis);
    form.btnUpdate().setEnabled(true);
}
项目:openmaxims-linux    文件:Logic.java   
private void rdoValueChanged() 
{
    // Keep the selection
    if (GenForm.grpFilterByEnumeration.rdoActive.equals(form.grpFilterBy().getValue()))
    {
        form.getLocalContext().setActiveOnly(Boolean.TRUE);
    }
    else
    {
        form.getLocalContext().setActiveOnly(Boolean.FALSE);
    }

    //List the Urinalysis records based on the filter selected
    UrinalysisCollection voUrinalysisColl;

    try {
        Urinalysis voUrinalysis= new Urinalysis();
        voUrinalysis.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
        voUrinalysis.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
        if (form.grpFilterBy().getValue().equals(GenForm.grpFilterByEnumeration.rdoActive))
            voUrinalysis.setIsActive(Boolean.TRUE);
        else
            voUrinalysis.setIsActive(null);

        voUrinalysisColl = domain.listUrinanalysis(voUrinalysis);
    } catch (DomainInterfaceException e) {
        engine.showMessage("DomainInterfaceException occurred listing referrals " + e.getMessage());
        return;
    }
    form.getLocalContext().setVoUrinanalysis(null);
    clearScreen();
    form.chkNoSample().setValue(false);
    setMode(false);

    int nCount = voUrinalysisColl.size();
    form.getLocalContext().setIndex(new Integer(0));

    if (nCount == 0)
    {
        setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());
        form.btnUpdate().setEnabled(false);
        return;
    }

    populateScreen(voUrinalysisColl.get(0)); 
    setPrevNextBtnStatus(nCount, form.getLocalContext().getIndex().intValue());

    form.getLocalContext().setVoCollUrinanalysis(voUrinalysisColl);

    form.btnUpdate().setEnabled(true);
    //open();
}