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

项目:AvoinApotti    文件:Logic.java   
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
    // Leave throws so that clinics are not cleared when an invalid search is made
    if (clinicName == null || clinicName.trim().length() < 3)
        throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");


    // Build filtering VO
    ClinicLiteVo filterVo = new ClinicLiteVo();
    filterVo.setClinicName(clinicName);

    // Retrieve the clinics (list from domain)
    try
    {
        return domain.listClinics(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        throw new CodingRuntimeException(exception.getMessage());
    }
}
项目:AvoinApotti    文件:Logic.java   
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
    // Leave throws so that clinics are not cleared when an invalid search is made
    if (clinicName == null || clinicName.trim().length() < 3)
        throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");


    // Build filtering VO
    ClinicLiteVo filterVo = new ClinicLiteVo();
    filterVo.setClinicName(clinicName);

    // Retrieve the clinics (list from domain)
    try
    {
        return domain.listClinics(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        throw new CodingRuntimeException(exception.getMessage());
    }

}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onQmbClinicTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
    if(!(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue() instanceof ILocation))
        return;

    ClinicLiteVoCollection clinics = domain.listClinicsforLocation(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue().getID(), value);

    form.lyrLetterCreate().tabClinicList().qmbClinic().clear();

    if(clinics == null || clinics.size() == 0)
        return;

    for(int i=0; i<clinics.size(); i++)
    {
        ClinicLiteVo clinic = clinics.get(i);

        if(clinic == null)
            continue;

        form.lyrLetterCreate().tabClinicList().qmbClinic().newRow(clinic, clinic.getClinicName());
    }

    if(clinics.size() > 0)
        form.lyrLetterCreate().tabClinicList().qmbClinic().showOpened();
}
项目:AvoinApotti    文件:Logic.java   
/**
 * Event fired when a selection is made on the tree
 * @param TreeNode node
 * @throws PresentationLogicException
 */
protected void onTreClinicsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
    form.TaxonomyMappings().setComponentMode(FormMode.VIEW);
    clearInstanceDetails();
    form.getLocalContext().setSelectedRecord(null);

    if (node.getValue() != null && node.getValue() instanceof ClinicLiteVo)
    {
        ClinicVo clin = domain.getClinic((ClinicLiteVo)node.getValue());
        form.getLocalContext().setSelectedRecord(clin);
        populateInstanceControl(clin);
        form.TaxonomyMappings().setValue(clin.getCodeMappings());
    }
    updateControlsState();
}
项目:AvoinApotti    文件:Logic.java   
private void setDepartmentValue()
{
    if (form.lyrDetails().tabGenDetails().qmbLocation().getValue() instanceof ClinicLiteVo)
    {
        LocationLiteVo department = domain.getOutpatientDepartmentByClinic((ClinicLiteVo) form.lyrDetails().tabGenDetails().qmbLocation().getValue());

        if (department == null)
            return;

        // WDEV-13890
        if (!form.lyrDetails().tabGenDetails().cmbDepartment().getValues().contains(department))
        {
            form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getName());
        }
        form.lyrDetails().tabGenDetails().cmbDepartment().setValue(department);
    }
}
项目:openMAXIMS    文件:Logic.java   
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
    // Leave throws so that clinics are not cleared when an invalid search is made
    if (clinicName == null || clinicName.trim().length() < 3)
        throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");


    // Build filtering VO
    ClinicLiteVo filterVo = new ClinicLiteVo();
    filterVo.setClinicName(clinicName);

    // Retrieve the clinics (list from domain)
    try
    {
        return domain.listClinics(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        throw new CodingRuntimeException(exception.getMessage());
    }
}
项目:openMAXIMS    文件:Logic.java   
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
    // Leave throws so that clinics are not cleared when an invalid search is made
    if (clinicName == null || clinicName.trim().length() < 3)
        throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");


    // Build filtering VO
    ClinicLiteVo filterVo = new ClinicLiteVo();
    filterVo.setClinicName(clinicName);

    // Retrieve the clinics (list from domain)
    try
    {
        return domain.listClinics(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        throw new CodingRuntimeException(exception.getMessage());
    }

}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onQmbClinicTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
    if(!(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue() instanceof ILocation))
        return;

    ClinicLiteVoCollection clinics = domain.listClinicsforLocation(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue().getID(), value);

    form.lyrLetterCreate().tabClinicList().qmbClinic().clear();

    if(clinics == null || clinics.size() == 0)
        return;

    for(int i=0; i<clinics.size(); i++)
    {
        ClinicLiteVo clinic = clinics.get(i);

        if(clinic == null)
            continue;

        form.lyrLetterCreate().tabClinicList().qmbClinic().newRow(clinic, clinic.getClinicName());
    }

    if(clinics.size() > 0)
        form.lyrLetterCreate().tabClinicList().qmbClinic().showOpened();
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Event fired when a selection is made on the tree
 * @param TreeNode node
 * @throws PresentationLogicException
 */
protected void onTreClinicsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
    form.TaxonomyMappings().setComponentMode(FormMode.VIEW);
    clearInstanceDetails();
    form.getLocalContext().setSelectedRecord(null);

    if (node.getValue() != null && node.getValue() instanceof ClinicLiteVo)
    {
        ClinicVo clin = domain.getClinic((ClinicLiteVo)node.getValue());
        form.getLocalContext().setSelectedRecord(clin);
        populateInstanceControl(clin);
        form.TaxonomyMappings().setValue(clin.getCodeMappings());
    }
    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
private OrdersRequiringAuthorisationSearchCriteriaVo getSearchCriteria()
{
    OrdersRequiringAuthorisationSearchCriteriaVo searchCriteria = new OrdersRequiringAuthorisationSearchCriteriaVo();

    searchCriteria.setFromDate(form.dteFrom().getValue());
    searchCriteria.setToDate(form.dteTo().getValue());

    searchCriteria.setHospital(form.cmbHospital().getValue());
    searchCriteria.setLoctype(getLocationType());

    if(form.grpPatientLocation().getValue().equals(grpPatientLocationEnumeration.rdoClinic))
        searchCriteria.setPatientClinic((ClinicLiteVo) form.qmbPatLocation().getValue());
    else
        searchCriteria.setPatientLocation((LocationLiteVo) form.qmbPatLocation().getValue());

    searchCriteria.setRespClinician(form.qmbRespClinician().getValue());

    return searchCriteria;
}
项目:openMAXIMS    文件:Logic.java   
private void setDepartmentValue()
{
    if (form.lyrDetails().tabGenDetails().qmbLocation().getValue() instanceof ClinicLiteVo)
    {
        LocationLiteVo department = domain.getOutpatientDepartmentByClinic((ClinicLiteVo) form.lyrDetails().tabGenDetails().qmbLocation().getValue());

        if (department == null)
            return;

        // WDEV-13890
        if (!form.lyrDetails().tabGenDetails().cmbDepartment().getValues().contains(department))
        {
            form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getName());
        }
        form.lyrDetails().tabGenDetails().cmbDepartment().setValue(department);
    }
}
项目:openMAXIMS    文件:Logic.java   
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
    // Leave throws so that clinics are not cleared when an invalid search is made
    if (clinicName == null || clinicName.trim().length() < 3)
        throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");


    // Build filtering VO
    ClinicLiteVo filterVo = new ClinicLiteVo();
    filterVo.setClinicName(clinicName);

    // Retrieve the clinics (list from domain)
    try
    {
        return domain.listClinics(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        throw new CodingRuntimeException(exception.getMessage());
    }
}
项目:openMAXIMS    文件:Logic.java   
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
    // Leave throws so that clinics are not cleared when an invalid search is made
    if (clinicName == null || clinicName.trim().length() < 3)
        throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");


    // Build filtering VO
    ClinicLiteVo filterVo = new ClinicLiteVo();
    filterVo.setClinicName(clinicName);

    // Retrieve the clinics (list from domain)
    try
    {
        return domain.listClinics(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        throw new CodingRuntimeException(exception.getMessage());
    }

}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onQmbClinicTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
    if(!(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue() instanceof ILocation))
        return;

    ClinicLiteVoCollection clinics = domain.listClinicsforLocation(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue().getID(), value);

    form.lyrLetterCreate().tabClinicList().qmbClinic().clear();

    if(clinics == null || clinics.size() == 0)
        return;

    for(int i=0; i<clinics.size(); i++)
    {
        ClinicLiteVo clinic = clinics.get(i);

        if(clinic == null)
            continue;

        form.lyrLetterCreate().tabClinicList().qmbClinic().newRow(clinic, clinic.getClinicName());
    }

    if(clinics.size() > 0)
        form.lyrLetterCreate().tabClinicList().qmbClinic().showOpened();
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Event fired when a selection is made on the tree
 * @param TreeNode node
 * @throws PresentationLogicException
 */
protected void onTreClinicsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
    form.TaxonomyMappings().setComponentMode(FormMode.VIEW);
    clearInstanceDetails();
    form.getLocalContext().setSelectedRecord(null);

    if (node.getValue() != null && node.getValue() instanceof ClinicLiteVo)
    {
        ClinicVo clin = domain.getClinic((ClinicLiteVo)node.getValue());
        form.getLocalContext().setSelectedRecord(clin);
        populateInstanceControl(clin);
        form.TaxonomyMappings().setValue(clin.getCodeMappings());
    }
    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
private void setDepartmentValue()
{
    if (form.lyrDetails().tabGenDetails().qmbLocation().getValue() instanceof ClinicLiteVo)
    {
        LocationLiteVo department = domain.getOutpatientDepartmentByClinic((ClinicLiteVo) form.lyrDetails().tabGenDetails().qmbLocation().getValue());

        if (department == null)
            return;

        // WDEV-13890
        if (!form.lyrDetails().tabGenDetails().cmbDepartment().getValues().contains(department))
        {
            form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getName());
        }
        form.lyrDetails().tabGenDetails().cmbDepartment().setValue(department);
    }
}
项目:openmaxims-linux    文件:Logic.java   
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
    // Leave throws so that clinics are not cleared when an invalid search is made
    if (clinicName == null || clinicName.trim().length() < 3)
        throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");


    // Build filtering VO
    ClinicLiteVo filterVo = new ClinicLiteVo();
    filterVo.setClinicName(clinicName);

    // Retrieve the clinics (list from domain)
    try
    {
        return domain.listClinics(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        throw new CodingRuntimeException(exception.getMessage());
    }
}
项目:openmaxims-linux    文件:Logic.java   
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
    // Leave throws so that clinics are not cleared when an invalid search is made
    if (clinicName == null || clinicName.trim().length() < 3)
        throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");


    // Build filtering VO
    ClinicLiteVo filterVo = new ClinicLiteVo();
    filterVo.setClinicName(clinicName);

    // Retrieve the clinics (list from domain)
    try
    {
        return domain.listClinics(filterVo);
    }
    catch (DomainInterfaceException exception)
    {
        throw new CodingRuntimeException(exception.getMessage());
    }

}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onQmbClinicTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
    if(!(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue() instanceof ILocation))
        return;

    ClinicLiteVoCollection clinics = domain.listClinicsforLocation(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue().getID(), value);

    form.lyrLetterCreate().tabClinicList().qmbClinic().clear();

    if(clinics == null || clinics.size() == 0)
        return;

    for(int i=0; i<clinics.size(); i++)
    {
        ClinicLiteVo clinic = clinics.get(i);

        if(clinic == null)
            continue;

        form.lyrLetterCreate().tabClinicList().qmbClinic().newRow(clinic, clinic.getClinicName());
    }

    if(clinics.size() > 0)
        form.lyrLetterCreate().tabClinicList().qmbClinic().showOpened();
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * Event fired when a selection is made on the tree
 * @param TreeNode node
 * @throws PresentationLogicException
 */
protected void onTreClinicsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
    form.TaxonomyMappings().setComponentMode(FormMode.VIEW);
    clearInstanceDetails();
    form.getLocalContext().setSelectedRecord(null);

    if (node.getValue() != null && node.getValue() instanceof ClinicLiteVo)
    {
        ClinicVo clin = domain.getClinic((ClinicLiteVo)node.getValue());
        form.getLocalContext().setSelectedRecord(clin);
        populateInstanceControl(clin);
        form.TaxonomyMappings().setValue(clin.getCodeMappings());
    }
    updateControlsState();
}
项目:openmaxims-linux    文件:Logic.java   
private void setDepartmentValue()
{
    if (form.lyrDetails().tabGenDetails().qmbLocation().getValue() instanceof ClinicLiteVo)
    {
        LocationLiteVo department = domain.getOutpatientDepartmentByClinic((ClinicLiteVo) form.lyrDetails().tabGenDetails().qmbLocation().getValue());

        if (department == null)
            return;

        // WDEV-13890
        if (!form.lyrDetails().tabGenDetails().cmbDepartment().getValues().contains(department))
        {
            form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getName());
        }
        form.lyrDetails().tabGenDetails().cmbDepartment().setValue(department);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void newClinicAssociationRow(DynamicGridRow parrentRow, ClinicLiteVo clinic)
{
    if (parrentRow == null)
        throw new CodingRuntimeException("Major Logical Error - Can not add clinical association row to a null parrent row");

    if (clinic == null)
        return;


    DynamicGridCell newCell;
    DynamicGridColumn column;

    // Create a new row
    DynamicGridRow newRow = parrentRow.getRows().newRow();
    newRow.setValue(clinic);

    // Create the first cell in the row (IMAGE)
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
    newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
    newCell.setValue(form.getImages().Admin.Clinic01);

    // Create the second cell in the row (STRING)
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(clinic.getClinicName());
    newCell.setReadOnly(true);
}
项目:AvoinApotti    文件:Logic.java   
private void newClinicAssociation(DynamicGridRow parrentRow)
{
    if (parrentRow == null)
        throw new CodingRuntimeException("Major Logical Error - Can not add a CLINIC association to a null parrent row");

    if (!(parrentRow.getValue() instanceof AssociationCategory) || ((AssociationCategory) parrentRow.getValue()) != AssociationCategory.CLINICS)
        throw new CodingRuntimeException("Logical Error - Function must be called from CLINICS category row only");


    parrentRow.setExpanded(true);

    // Create a new row
    DynamicGridRow newRow = parrentRow.getRows().newRow(true);
    newRow.setValue(new ClinicLiteVo());
    form.dyngrdAssociations().resetScrollPosition();

    // Declare a new cell
    DynamicGridCell newCell;
    // Column identifier
    DynamicGridColumn column;

    // Create the first cell in the row (IMAGE)
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
    newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
    newCell.setValue(form.getImages().Admin.Clinic01);

    // Create the second cell in the row (STRING)
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
    newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
    newCell.setAutoPostBack(true);
}
项目:AvoinApotti    文件:Logic.java   
private void updateClinicAssociationRowValue(DynamicGridRow row)
{
    if (row == null
        || (row.getParent() == null)
        || (!(row.getParent().getValue() instanceof AssociationCategory))
        || (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.CLINICS))
        throw new CodingRuntimeException("Major Logical Failure");

    if (row.getValue() == null)
        row.setValue(new ClinicLiteVo());

    if (!(row.getValue() instanceof ClinicLiteVo))
        throw new CodingRuntimeException("Major Logical Error - Clinic value expected");


    DynamicGridColumn column;
    DynamicGridCell cell;

    // Get the second cell value
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
    cell = row.getCells().get(column);

    if (cell.getType() != DynamicCellType.STRING)
    {
        if (cell.getValue() == null)
        {
            row.setValue(null);
            cell.setTypedText(null);
        }
        else
            row.setValue((ClinicLiteVo) cell.getValue());
    }
}
项目:AvoinApotti    文件:Logic.java   
private void addClinicAssociationsToTemplate(ClinicLiteVoCollection clinics, DynamicGridRowCollection rows)
{
    // NOTE: DO NOT make clinics = new ClinicLiteVoCollection() in this function
    // clinics MUST ALWAYS reference the clinics in the TemplateAssociationVo

    if (rows == null)
        return;

    if (clinics == null)
        throw new CodingRuntimeException("Logical Error - Inserting values into null CLINICS collection");


    // Add the records from the grid
    for (int i = 0; i < rows.size(); i++)
    {
        DynamicGridRow row = rows.get(i);

        if (row.getValue() == null)
            continue;

        if (!(row.getValue() instanceof ClinicLiteVo))
            throw new CodingRuntimeException("Major Logical Error - Non Clinical association added to CLINICS category association");

        updateClinicAssociationRowValue(row);

        ClinicLiteVo clinicAssociation = (ClinicLiteVo) row.getValue();

        if (clinicAssociation != null)
            clinics.add(clinicAssociation);
    }
}
项目:AvoinApotti    文件:Logic.java   
private boolean clinicNotOnScreen(ClinicLiteVo clinicLiteVo, DynamicGridRow parentRow) 
{
    for(int i=0; i<parentRow.getRows().size(); i++)
    {
        if(clinicLiteVo.equals(parentRow.getRows().get(i).getValue()))
                return false;
    }
    return true;
}
项目:AvoinApotti    文件:Logic.java   
private void populateRowClinic(DynamicGridRow childRow, ClinicLiteVo clinicLiteVo, boolean newClinic, boolean reviewClinic, boolean createRow) 
{
    if(createRow)
    {
        DynamicGridColumn column = null;
        DynamicGridCell cell = null;

        childRow.setValue(clinicLiteVo);

        column = form.dyngrdLetter().getColumns().getByIdentifier(COL_IMAGE);
        cell = childRow.getCells().newCell(column, DynamicCellType.IMAGE);
        cell.setValue(form.getImages().Admin.Clinic01);

        column = form.dyngrdLetter().getColumns().getByIdentifier(COL_HEADING);
        cell = childRow.getCells().newCell(column, DynamicCellType.STRING);
        cell.setReadOnly(true);
        cell.setValue(clinicLiteVo.getClinicName());

        column = form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE);
        cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
        engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
        cell.setAutoPostBack(false);

        column = form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE);
        cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
        engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
        cell.setAutoPostBack(false);
    }

    if(newClinic)
    {
        childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
    }
    if(reviewClinic)
    {
        childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
    }

}
项目:AvoinApotti    文件:Logic.java   
public void updateControlsState()
{
    form.getContextMenus().Correspondence.getNoLetterIsRequiredADDItem().setVisible(form.getMode().equals(FormMode.EDIT) && form.dyngrdLetter().getValue() instanceof Correspondence);
    form.getContextMenus().Correspondence.getNoLetterIsRequiredREMOVEItem().setVisible(form.getMode().equals(FormMode.EDIT) 
            && (form.dyngrdLetter().getValue() instanceof ClinicLiteVo 
                    || form.dyngrdLetter().getValue() instanceof Specialty
                        || form.dyngrdLetter().getValue() instanceof MedicLiteVo));
}
项目:AvoinApotti    文件:Logic.java   
private void removeInstance(DynamicGridRow selectedRow) 
{
    if(selectedRow.getValue() instanceof ClinicLiteVo 
            || selectedRow.getValue() instanceof Specialty
                || selectedRow.getValue() instanceof MedicLiteVo)
    {
        form.dyngrdLetter().getRows().remove(selectedRow);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void updateClinicAccessRowValue(DynamicGridRow row)
{
    DynamicGridColumn column;
    DynamicGridCell cell;

    if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.CLINICS))
        throw new CodingRuntimeException("Major Logical Error");

    if (row.getValue() == null)
        row.setValue(new ClinicAccessVo());

    if (!(row.getValue() instanceof ClinicAccessVo))
        throw new CodingRuntimeException("BUG");


    // Get second cell value
    column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
    cell = row.getCells().get(column);
    if (cell.getType() != DynamicCellType.STRING)
    {
        if (cell.getValue() == null)
        {
            ((ClinicAccessVo) row.getValue()).setClinic(null);
            cell.setTypedText(null);
        }
        else
        {
            ((ClinicAccessVo) row.getValue()).setClinic((ClinicLiteVo) cell.getValue());
        }
    }

    // Get third cell value
    column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
    cell = row.getCells().get(column);
    cell.getValue();
    ((ClinicAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
项目:AvoinApotti    文件:Logic.java   
private ClinicLiteVoCollection populateClinicInstanceData()
{
    ClinicLiteVoCollection voCollClinics = new ClinicLiteVoCollection();
    for (int i = 0; i < form.treAssociate().getNodes().size(); i++) 
    {
        if (form.treAssociate().getNodes().get(i).getValue() instanceof ClinicLiteVo
            && form.treAssociate().getNodes().get(i).isChecked())
                voCollClinics.add((ClinicLiteVo) form.treAssociate().getNodes().get(i).getValue());         
    }

    return voCollClinics;
}
项目:AvoinApotti    文件:Logic.java   
/**
 * Update the control state of the form dependant on the FormMode, Config Flag and if a location\Hospital is selected
 */
private void updateControlsState()
{       
    boolean allowEdits = form.getMode().equals(FormMode.VIEW) && ConfigFlag.GEN.ALLOW_CLINIC_EDIT.getValue();
    boolean clinicSelected = (form.treClinics().getSelectedNode() != null && form.treClinics().getSelectedNode().getValue() instanceof ClinicLiteVo);
    boolean locationSelected = (form.treClinics().getSelectedNode() != null && form.treClinics().getSelectedNode().getValue() instanceof LocationLiteVo);

    form.btnUpdate().setVisible(allowEdits && clinicSelected);  
    form.btnNew().setVisible(allowEdits);   
    form.getContextMenus().getClinicNewItem().setVisible(allowEdits);
    form.getContextMenus().getClinicAddItem().setVisible(allowEdits && locationSelected);
    if (form.getContextMenus().getClinicAddItem().isVisible())
    {
        form.getContextMenus().getClinicAddItem().setText("Add New Clinic in " + ((LocationLiteVo)form.treClinics().getSelectedNode().getValue()).getName());
    }
    form.getContextMenus().getClinicUpdateItem().setVisible(allowEdits && clinicSelected);
    form.TaxonomyMappings().setComponentMode(form.getMode());   //WDEV-11914

    //WDEV-11914 - starts here
    if(FormMode.VIEW.equals(form.getMode()))
    {
        form.cmbSearchOutpatient().setEnabled(form.cmbSearchLoc().getValue() instanceof LocationLiteVo);
    }

    if(FormMode.EDIT.equals(form.getMode()))
    {
        form.cmbOutpatient().setEnabled(form.cmbClinicLoc().getValue() instanceof LocationLiteVo);
    }
    //WDEV-11914 - ends here
}
项目:openMAXIMS    文件:Logic.java   
private void newClinicAssociationRow(DynamicGridRow parrentRow, ClinicLiteVo clinic)
{
    if (parrentRow == null)
        throw new CodingRuntimeException("Major Logical Error - Can not add clinical association row to a null parrent row");

    if (clinic == null)
        return;


    DynamicGridCell newCell;
    DynamicGridColumn column;

    // Create a new row
    DynamicGridRow newRow = parrentRow.getRows().newRow();
    newRow.setValue(clinic);

    // Create the first cell in the row (IMAGE)
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
    newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
    newCell.setValue(form.getImages().Admin.Clinic01);

    // Create the second cell in the row (STRING)
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(clinic.getClinicName());
    newCell.setReadOnly(true);
}
项目:openMAXIMS    文件:Logic.java   
private void newClinicAssociation(DynamicGridRow parrentRow)
{
    if (parrentRow == null)
        throw new CodingRuntimeException("Major Logical Error - Can not add a CLINIC association to a null parrent row");

    if (!(parrentRow.getValue() instanceof AssociationCategory) || ((AssociationCategory) parrentRow.getValue()) != AssociationCategory.CLINICS)
        throw new CodingRuntimeException("Logical Error - Function must be called from CLINICS category row only");


    parrentRow.setExpanded(true);

    // Create a new row
    DynamicGridRow newRow = parrentRow.getRows().newRow(true);
    newRow.setValue(new ClinicLiteVo());
    form.dyngrdAssociations().resetScrollPosition();

    // Declare a new cell
    DynamicGridCell newCell;
    // Column identifier
    DynamicGridColumn column;

    // Create the first cell in the row (IMAGE)
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
    newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
    newCell.setValue(form.getImages().Admin.Clinic01);

    // Create the second cell in the row (STRING)
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
    newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
    newCell.setAutoPostBack(true);
}
项目:openMAXIMS    文件:Logic.java   
private void updateClinicAssociationRowValue(DynamicGridRow row)
{
    if (row == null
        || (row.getParent() == null)
        || (!(row.getParent().getValue() instanceof AssociationCategory))
        || (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.CLINICS))
        throw new CodingRuntimeException("Major Logical Failure");

    if (row.getValue() == null)
        row.setValue(new ClinicLiteVo());

    if (!(row.getValue() instanceof ClinicLiteVo))
        throw new CodingRuntimeException("Major Logical Error - Clinic value expected");


    DynamicGridColumn column;
    DynamicGridCell cell;

    // Get the second cell value
    column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
    cell = row.getCells().get(column);

    if (cell.getType() != DynamicCellType.STRING)
    {
        if (cell.getValue() == null)
        {
            row.setValue(null);
            cell.setTypedText(null);
        }
        else
            row.setValue((ClinicLiteVo) cell.getValue());
    }
}
项目:openMAXIMS    文件:Logic.java   
private void addClinicAssociationsToTemplate(ClinicLiteVoCollection clinics, DynamicGridRowCollection rows)
{
    // NOTE: DO NOT make clinics = new ClinicLiteVoCollection() in this function
    // clinics MUST ALWAYS reference the clinics in the TemplateAssociationVo

    if (rows == null)
        return;

    if (clinics == null)
        throw new CodingRuntimeException("Logical Error - Inserting values into null CLINICS collection");


    // Add the records from the grid
    for (int i = 0; i < rows.size(); i++)
    {
        DynamicGridRow row = rows.get(i);

        if (row.getValue() == null)
            continue;

        if (!(row.getValue() instanceof ClinicLiteVo))
            throw new CodingRuntimeException("Major Logical Error - Non Clinical association added to CLINICS category association");

        updateClinicAssociationRowValue(row);

        ClinicLiteVo clinicAssociation = (ClinicLiteVo) row.getValue();

        if (clinicAssociation != null)
            clinics.add(clinicAssociation);
    }
}
项目:openMAXIMS    文件:Logic.java   
private boolean clinicNotOnScreen(ClinicLiteVo clinicLiteVo, DynamicGridRow parentRow) 
{
    for(int i=0; i<parentRow.getRows().size(); i++)
    {
        if(clinicLiteVo.equals(parentRow.getRows().get(i).getValue()))
                return false;
    }
    return true;
}
项目:openMAXIMS    文件:Logic.java   
private void populateRowClinic(DynamicGridRow childRow, ClinicLiteVo clinicLiteVo, boolean newClinic, boolean reviewClinic, boolean createRow) 
{
    if(createRow)
    {
        DynamicGridColumn column = null;
        DynamicGridCell cell = null;

        childRow.setValue(clinicLiteVo);

        column = form.dyngrdLetter().getColumns().getByIdentifier(COL_IMAGE);
        cell = childRow.getCells().newCell(column, DynamicCellType.IMAGE);
        cell.setValue(form.getImages().Admin.Clinic01);

        column = form.dyngrdLetter().getColumns().getByIdentifier(COL_HEADING);
        cell = childRow.getCells().newCell(column, DynamicCellType.STRING);
        cell.setReadOnly(true);
        cell.setValue(clinicLiteVo.getClinicName());

        column = form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE);
        cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
        engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
        cell.setAutoPostBack(false);

        column = form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE);
        cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
        engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
        cell.setAutoPostBack(false);
    }

    if(newClinic)
    {
        childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
    }
    if(reviewClinic)
    {
        childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
    }

}
项目:openMAXIMS    文件:Logic.java   
public void updateControlsState()
{
    form.getContextMenus().Correspondence.getNoLetterIsRequiredADDItem().setVisible(form.getMode().equals(FormMode.EDIT) && form.dyngrdLetter().getValue() instanceof Correspondence);
    form.getContextMenus().Correspondence.getNoLetterIsRequiredREMOVEItem().setVisible(form.getMode().equals(FormMode.EDIT) 
            && (form.dyngrdLetter().getValue() instanceof ClinicLiteVo 
                    || form.dyngrdLetter().getValue() instanceof Specialty
                        || form.dyngrdLetter().getValue() instanceof MedicLiteVo));
}
项目:openMAXIMS    文件:Logic.java   
private void removeInstance(DynamicGridRow selectedRow) 
{
    if(selectedRow.getValue() instanceof ClinicLiteVo 
            || selectedRow.getValue() instanceof Specialty
                || selectedRow.getValue() instanceof MedicLiteVo)
    {
        form.dyngrdLetter().getRows().remove(selectedRow);
    }
}