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

项目:AvoinApotti    文件:Logic.java   
/**
 * Populates the grid withen PatientAllergyCollection
 *
 * @param PatientAllergyCollection
 * @return void
 */
private void populateListControl(PatientAllergyCollection voCollPatientAllergy)
{
    clearScreen();
    clearGrid();

    if (voCollPatientAllergy != null)
    {   
        PatientAllergy voPatientAllergy = null;
        GenForm.grdAllergiesRow row = null;

        for (int i=0; i<voCollPatientAllergy.size(); i++)
        {
            voPatientAllergy = voCollPatientAllergy.get(i);
            row = form.grdAllergies().getRows().newRow();
            populateRow(voPatientAllergy, row);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private String createRowTooltip(PatientAllergy voPatientAllergy)
{
    StringBuffer sb = new StringBuffer();
    sb.append("<b>Comment : </b>");
    sb.append(voPatientAllergy.getCommentsIsNotNull() ? voPatientAllergy.getComments().toString() : "");
    sb.append("<br>");
    sb.append("<b>Date Identified : </b>");
    sb.append(voPatientAllergy.getWhenIdentifiedIsNotNull() ? voPatientAllergy.getWhenIdentified().toString() : "");
    sb.append("<br>");
    sb.append("<b>Authoring Info : </b>");
    sb.append(voPatientAllergy.getAuthoringInformationIsNotNull() ? voPatientAllergy.getAuthoringInformation().toString(" - ") : "");
    sb.append("<br>");
    sb.append("<b>Recording Info : </b>");
    sb.append(voPatientAllergy.getRecordingInformationIsNotNull() ? voPatientAllergy.getRecordingInformation().toString(" - ") : "");
    sb.append("<br>");

    return sb.toString();
}
项目:AvoinApotti    文件:Logic.java   
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
    // Returning from selecting to inactivate a record, update and save. 
    if(formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
    {
        PatientAllergy voPatientAllergy = new PatientAllergy(); 
        voPatientAllergy = form.grdAllergies().getValue();
        voPatientAllergy.setIsCurrentlyActiveAllergy(Boolean.FALSE);

        AuthoringInformationVo voAuthor = new AuthoringInformationVo();
        voAuthor.setAuthoringDateTime(new DateTime());
        voAuthor.setAuthoringHcp((HcpLiteVo)domain.getHcpLiteUser());
        voPatientAllergy.setInactivationAuthoringInfo(voAuthor);

        if (save(voPatientAllergy))
        {
            open();
        }   
    }           
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Populates the grid withen PatientAllergyCollection
 *
 * @param PatientAllergyCollection
 * @return void
 */
private void populateListControl(PatientAllergyCollection voCollPatientAllergy)
{
    clearScreen();
    clearGrid();

    if (voCollPatientAllergy != null)
    {   
        PatientAllergy voPatientAllergy = null;
        GenForm.grdAllergiesRow row = null;

        for (int i=0; i<voCollPatientAllergy.size(); i++)
        {
            voPatientAllergy = voCollPatientAllergy.get(i);
            row = form.grdAllergies().getRows().newRow();
            populateRow(voPatientAllergy, row);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private String createRowTooltip(PatientAllergy voPatientAllergy)
{
    StringBuffer sb = new StringBuffer();
    sb.append("<b>Comment : </b>");
    sb.append(voPatientAllergy.getCommentsIsNotNull() ? voPatientAllergy.getComments().toString() : "");
    sb.append("<br>");
    sb.append("<b>Date Identified : </b>");
    sb.append(voPatientAllergy.getWhenIdentifiedIsNotNull() ? voPatientAllergy.getWhenIdentified().toString() : "");
    sb.append("<br>");
    sb.append("<b>Authoring Info : </b>");
    sb.append(voPatientAllergy.getAuthoringInformationIsNotNull() ? voPatientAllergy.getAuthoringInformation().toString(" - ") : "");
    sb.append("<br>");
    sb.append("<b>Recording Info : </b>");
    sb.append(voPatientAllergy.getRecordingInformationIsNotNull() ? voPatientAllergy.getRecordingInformation().toString(" - ") : "");
    sb.append("<br>");

    return sb.toString();
}
项目:openMAXIMS    文件:Logic.java   
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
    // Returning from selecting to inactivate a record, update and save. 
    if(formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
    {
        PatientAllergy voPatientAllergy = new PatientAllergy(); 
        voPatientAllergy = form.grdAllergies().getValue();
        voPatientAllergy.setIsCurrentlyActiveAllergy(Boolean.FALSE);

        AuthoringInformationVo voAuthor = new AuthoringInformationVo();
        voAuthor.setAuthoringDateTime(new DateTime());
        voAuthor.setAuthoringHcp((HcpLiteVo)domain.getHcpLiteUser());
        voPatientAllergy.setInactivationAuthoringInfo(voAuthor);

        //WDEV-19785
        if (save(voPatientAllergy, false))
        {
            open();
        }
    }           
}
项目:openMAXIMS    文件:Logic.java   
/**
 * Populates the grid withen PatientAllergyCollection
 *
 * @param PatientAllergyCollection
 * @return void
 */
private void populateListControl(PatientAllergyCollection voCollPatientAllergy)
{
    clearScreen();
    clearGrid();

    if (voCollPatientAllergy != null)
    {   
        PatientAllergy voPatientAllergy = null;
        GenForm.grdAllergiesRow row = null;

        for (int i=0; i<voCollPatientAllergy.size(); i++)
        {
            voPatientAllergy = voCollPatientAllergy.get(i);
            row = form.grdAllergies().getRows().newRow();
            populateRow(voPatientAllergy, row);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private String createRowTooltip(PatientAllergy voPatientAllergy)
{
    StringBuffer sb = new StringBuffer();
    sb.append("<b>Comment : </b>");
    sb.append(voPatientAllergy.getCommentsIsNotNull() ? voPatientAllergy.getComments().toString() : "");
    sb.append("<br>");
    sb.append("<b>Date Identified : </b>");
    sb.append(voPatientAllergy.getWhenIdentifiedIsNotNull() ? voPatientAllergy.getWhenIdentified().toString() : "");
    sb.append("<br>");
    sb.append("<b>Authoring Info : </b>");
    sb.append(voPatientAllergy.getAuthoringInformationIsNotNull() ? voPatientAllergy.getAuthoringInformation().toString(" - ") : "");
    sb.append("<br>");
    sb.append("<b>Recording Info : </b>");
    sb.append(voPatientAllergy.getRecordingInformationIsNotNull() ? voPatientAllergy.getRecordingInformation().toString(" - ") : "");
    sb.append("<br>");

    return sb.toString();
}
项目:openMAXIMS    文件:Logic.java   
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
    // Returning from selecting to inactivate a record, update and save. 
    if(formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
    {
        PatientAllergy voPatientAllergy = new PatientAllergy(); 
        voPatientAllergy = form.grdAllergies().getValue();
        voPatientAllergy.setIsCurrentlyActiveAllergy(Boolean.FALSE);

        AuthoringInformationVo voAuthor = new AuthoringInformationVo();
        voAuthor.setAuthoringDateTime(new DateTime());
        voAuthor.setAuthoringHcp((HcpLiteVo)domain.getHcpLiteUser());
        voPatientAllergy.setInactivationAuthoringInfo(voAuthor);

        if (save(voPatientAllergy))
        {
            open();
        }   
    }           
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * Populates the grid withen PatientAllergyCollection
 *
 * @param PatientAllergyCollection
 * @return void
 */
private void populateListControl(PatientAllergyCollection voCollPatientAllergy)
{
    clearScreen();
    clearGrid();

    if (voCollPatientAllergy != null)
    {   
        PatientAllergy voPatientAllergy = null;
        GenForm.grdAllergiesRow row = null;

        for (int i=0; i<voCollPatientAllergy.size(); i++)
        {
            voPatientAllergy = voCollPatientAllergy.get(i);
            row = form.grdAllergies().getRows().newRow();
            populateRow(voPatientAllergy, row);
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
private String createRowTooltip(PatientAllergy voPatientAllergy)
{
    StringBuffer sb = new StringBuffer();
    sb.append("<b>Comment : </b>");
    sb.append(voPatientAllergy.getCommentsIsNotNull() ? voPatientAllergy.getComments().toString() : "");
    sb.append("<br>");
    sb.append("<b>Date Identified : </b>");
    sb.append(voPatientAllergy.getWhenIdentifiedIsNotNull() ? voPatientAllergy.getWhenIdentified().toString() : "");
    sb.append("<br>");
    sb.append("<b>Authoring Info : </b>");
    sb.append(voPatientAllergy.getAuthoringInformationIsNotNull() ? voPatientAllergy.getAuthoringInformation().toString(" - ") : "");
    sb.append("<br>");
    sb.append("<b>Recording Info : </b>");
    sb.append(voPatientAllergy.getRecordingInformationIsNotNull() ? voPatientAllergy.getRecordingInformation().toString(" - ") : "");
    sb.append("<br>");

    return sb.toString();
}
项目:openmaxims-linux    文件:Logic.java   
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
    // Returning from selecting to inactivate a record, update and save. 
    if(formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
    {
        PatientAllergy voPatientAllergy = new PatientAllergy(); 
        voPatientAllergy = form.grdAllergies().getValue();
        voPatientAllergy.setIsCurrentlyActiveAllergy(Boolean.FALSE);

        AuthoringInformationVo voAuthor = new AuthoringInformationVo();
        voAuthor.setAuthoringDateTime(new DateTime());
        voAuthor.setAuthoringHcp((HcpLiteVo)domain.getHcpLiteUser());
        voPatientAllergy.setInactivationAuthoringInfo(voAuthor);

        if (save(voPatientAllergy))
        {
            open();
        }   
    }           
}
项目:AvoinApotti    文件:Logic.java   
private boolean grdAllergiesContainsOnlyEmptyRows() 
{
    for (int i = 0; i < form.grdAlergies().getRows().size(); i++)
    {
        PatientAllergy allergy = form.grdAlergies().getRows().get(i).getValue();

        if (allergy != null)
        {   
            return false;
        }
    }

    return true;
}
项目:AvoinApotti    文件:Logic.java   
@SuppressWarnings("unchecked")
private void populateAllergiesGridFromData(PatientAllergyCollection allergies)
{
    for (Iterator iterator = allergies.iterator(); iterator.hasNext();)
    {
        PatientAllergy name = (PatientAllergy) iterator.next();
        grdAlergiesRow row = form.grdAlergies().getRows().newRow();
        row.setValue(name);
        row.getAllergy().newRow(name.getAllergen(), name.getAllergen().getAllergenName());
        row.getAllergy().setValue(name.getAllergen());
        row.getAllergy().setEditedText(name.getAllergen().getAllergenName());

    }

}
项目:AvoinApotti    文件:Logic.java   
private PatientAllergyCollection getAllergies(PatientAllergyCollection patAlColl)
{
    for(int i=0; i<form.grdAlergies().getRows().size(); i++)
    {
        if(form.grdAlergies().getRows().get(i) != null && form.grdAlergies().getRows().get(i).getValue() instanceof PatientAllergy)
        {
            if(!patAlColl.contains(form.grdAlergies().getRows().get(i).getValue()))
            {
                patAlColl.add(form.grdAlergies().getRows().get(i).getValue());
            }
        }
    }

    for(int i=0; i<patAlColl.size(); i++)
    {
        Boolean isEqual = false;

        for(int j=0; j<form.grdAlergies().getRows().size(); j++)
        {
            if(patAlColl.get(i) != null && form.grdAlergies().getRows().get(j) != null && form.grdAlergies().getRows().get(j).getValue() != null && patAlColl.get(i).equals(form.grdAlergies().getRows().get(j).getValue()))
            {
                isEqual = true;
                break;
            }
        }

        if(!isEqual)
        {
            patAlColl.remove(i);
        }
    }

    return patAlColl.size()==0 ? null : patAlColl;
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onGrdAlergiesMutableComboBoxSelected(int column, grdAlergiesRow row, Object value) throws PresentationLogicException 
{
    if(value instanceof AllergenVo)
    {
        PatientAllergy patAl = new PatientAllergy();
        patAl.setPatient(form.getGlobalContext().Core.getPatientShort().toPatientRefVo());
        patAl.setSourceofInformation(SourceofInformation.CORRESPONDENCE);
        patAl.setAllergen((AllergenVo) value);
        patAl.setAllergenDescription(((AllergenVo) value).getAllergenNameIsNotNull() ? ((AllergenVo) value).getAllergenName() : "");

        row.setValue(patAl);
    }
}
项目:AvoinApotti    文件:Logic.java   
private PatientAllergy populateInstanceData(PatientAllergy voPatientAllergy)
{
    voPatientAllergy.setIsCurrentlyActiveAllergy(Boolean.TRUE);     
    voPatientAllergy.setSourceofInformation(form.cmbSourceOfInformation().getValue());          
    voPatientAllergy.setPatient(form.getGlobalContext().Core.getPatientShort());

    IClinicalCodingValue voResult = form.cc1().getValue();
    if (voResult != null)
    {
        if (voResult.getIClinicalCodingValue() instanceof AllergenVo)
        {
            voPatientAllergy.setAllergen((AllergenVo) voResult.getIClinicalCodingValue());
            voPatientAllergy.setAllergenDescription(voResult.getIClinicalCodingValueDescription());
        }
        else
        {
            throw new CodingRuntimeException("AllergenVo expected from component");
        }
    }
    else 
    {
        voPatientAllergy.setAllergenDescription(null);
    }       

    voPatientAllergy.setReactions(null);

    voPatientAllergy.setAuthoringInformation(form.cc2().getValue());

    return voPatientAllergy;
}
项目:AvoinApotti    文件:Logic.java   
private String createInactivateTooltip(PatientAllergy voPatientAllergy)
    {
        StringBuffer sb = new StringBuffer();
//      sb.append("<b>Inactive Comment : </b>");
//      sb.append(voPatientAllergy.getInactivationCommentsIsNotNull() ? voPatientAllergy.getInactivationComments().toString() : "");
//      sb.append("<br>");
        sb.append("<b>Inactivated Info : </b>");
        sb.append(voPatientAllergy.getInactivationAuthoringInfoIsNotNull() ? voPatientAllergy.getInactivationAuthoringInfo().toString(" - ") : "");
        sb.append("<br>");
        sb.append("<b>Recording Info : </b>");
        sb.append(voPatientAllergy.getRecordingInformationIsNotNull() ? voPatientAllergy.getRecordingInformation().toString(" - ") : "");
        sb.append("<br>");

        return sb.toString();
    }
项目:AvoinApotti    文件:Logic.java   
/**
 * Clears any current icons. If given boolean is true, adds an allergies icon. 
 * 
 * @param boolean
 * @return void
 */
private void setToolBarAllergies(boolean bAlertsExist)
{
    engine.clearAlertsByType(ims.alerts.PatientAllergy.class); 
    if(bAlertsExist)
    {
        engine.addAlert(new ims.alerts.PatientAllergy("The patient has allergies."));
    }
    }
项目:AvoinApotti    文件:Logic.java   
private void populateDetailsPanel(PatientAllergy allergy)
{
    clearDetailsPanel();

    form.ctnDetails().customControlCodingItem().setValue(allergy);
    form.ctnDetails().cmbType().setValue(allergy.getAllergenType());            
    populateReactionCmb();

    //If a reaction that has been saved is now marked as inactive in the Admin section it will still display 
    if (allergy.getReactions() != null)
    {   
        if (allergy.getReactions().size() > 0)
        {
            form.ctnDetails().cmbReaction().newRow(allergy.getReactions().get(0).getReaction(), allergy.getReactions().get(0).getReaction().getText());
            form.ctnDetails().cmbReaction().setValue(allergy.getReactions().get(0).getReaction());
        }
    }

    if(allergy.getAuthoringInformationIsNotNull())
        form.ctnDetails().customControlAuthoringInfo().setValue(allergy.getAuthoringInformation());

    if(allergy.getRecordingInformationIsNotNull()){
        if(allergy.getRecordingInformation().getRecordingUserIsNotNull())
            form.ctnDetails().txtRcordingHCP().setValue(allergy.getRecordingInformation().getRecordingUser().toString());
        form.ctnDetails().dtimRecordingDateTime().setValue(allergy.getRecordingInformation().getRecordingDateTime());
    }


    form.ctnDetails().txtEffect().setValue(allergy.getComments());
    form.ctnDetails().cmbSource().setValue(allergy.getSourceofInformation());
    form.ctnDetails().pdtDateIdentified().setValue(allergy.getWhenIdentified());
}
项目:openMAXIMS    文件:Logic.java   
private boolean grdAllergiesContainsOnlyEmptyRows() 
{
    for (int i = 0; i < form.grdAlergies().getRows().size(); i++)
    {
        PatientAllergy allergy = form.grdAlergies().getRows().get(i).getValue();

        if (allergy != null)
        {   
            return false;
        }
    }

    return true;
}
项目:openMAXIMS    文件:Logic.java   
@SuppressWarnings("unchecked")
private void populateAllergiesGridFromData(PatientAllergyCollection allergies)
{
    for (Iterator iterator = allergies.iterator(); iterator.hasNext();)
    {
        PatientAllergy name = (PatientAllergy) iterator.next();
        grdAlergiesRow row = form.grdAlergies().getRows().newRow();
        row.setValue(name);
        row.getAllergy().newRow(name.getAllergen(), name.getAllergen().getAllergenName());
        row.getAllergy().setValue(name.getAllergen());
        row.getAllergy().setEditedText(name.getAllergen().getAllergenName());

    }

}
项目:openMAXIMS    文件:Logic.java   
private PatientAllergyCollection getAllergies(PatientAllergyCollection patAlColl)
{
    for(int i=0; i<form.grdAlergies().getRows().size(); i++)
    {
        if(form.grdAlergies().getRows().get(i) != null && form.grdAlergies().getRows().get(i).getValue() instanceof PatientAllergy)
        {
            if(!patAlColl.contains(form.grdAlergies().getRows().get(i).getValue()))
            {
                patAlColl.add(form.grdAlergies().getRows().get(i).getValue());
            }
        }
    }

    for(int i=0; i<patAlColl.size(); i++)
    {
        Boolean isEqual = false;

        for(int j=0; j<form.grdAlergies().getRows().size(); j++)
        {
            if(patAlColl.get(i) != null && form.grdAlergies().getRows().get(j) != null && form.grdAlergies().getRows().get(j).getValue() != null && patAlColl.get(i).equals(form.grdAlergies().getRows().get(j).getValue()))
            {
                isEqual = true;
                break;
            }
        }

        if(!isEqual)
        {
            patAlColl.remove(i);
        }
    }

    return patAlColl.size()==0 ? null : patAlColl;
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdAlergiesMutableComboBoxSelected(int column, grdAlergiesRow row, Object value) throws PresentationLogicException 
{
    if(value instanceof AllergenVo)
    {
        PatientAllergy patAl = new PatientAllergy();
        patAl.setPatient(form.getGlobalContext().Core.getPatientShort().toPatientRefVo());
        patAl.setSourceofInformation(SourceofInformation.CORRESPONDENCE);
        patAl.setAllergen((AllergenVo) value);
        patAl.setAllergenDescription(((AllergenVo) value).getAllergenNameIsNotNull() ? ((AllergenVo) value).getAllergenName() : "");

        row.setValue(patAl);
    }
}
项目:openMAXIMS    文件:Logic.java   
private PatientAllergy populateInstanceData(PatientAllergy voPatientAllergy)
{
    voPatientAllergy.setIsCurrentlyActiveAllergy(Boolean.TRUE);     
    voPatientAllergy.setSourceofInformation(form.cmbSourceOfInformation().getValue());          
    voPatientAllergy.setPatient(form.getGlobalContext().Core.getPatientShort());

    IClinicalCodingValue voResult = form.cc1().getValue();
    if (voResult != null)
    {
        if (voResult.getIClinicalCodingValue() instanceof AllergenVo)
        {
            voPatientAllergy.setAllergen((AllergenVo) voResult.getIClinicalCodingValue());
            voPatientAllergy.setAllergenDescription(voResult.getIClinicalCodingValueDescription());
        }
        else
        {
            throw new CodingRuntimeException("AllergenVo expected from component");
        }
    }
    else 
    {
        voPatientAllergy.setAllergenDescription(null);
    }       

    voPatientAllergy.setReactions(null);

    voPatientAllergy.setAuthoringInformation(form.cc2().getValue());

    return voPatientAllergy;
}
项目:openMAXIMS    文件:Logic.java   
private String createInactivateTooltip(PatientAllergy voPatientAllergy)
    {
        StringBuffer sb = new StringBuffer();
//      sb.append("<b>Inactive Comment : </b>");
//      sb.append(voPatientAllergy.getInactivationCommentsIsNotNull() ? voPatientAllergy.getInactivationComments().toString() : "");
//      sb.append("<br>");
        sb.append("<b>Inactivated Info : </b>");
        sb.append(voPatientAllergy.getInactivationAuthoringInfoIsNotNull() ? voPatientAllergy.getInactivationAuthoringInfo().toString(" - ") : "");
        sb.append("<br>");
        sb.append("<b>Recording Info : </b>");
        sb.append(voPatientAllergy.getRecordingInformationIsNotNull() ? voPatientAllergy.getRecordingInformation().toString(" - ") : "");
        sb.append("<br>");

        return sb.toString();
    }
项目:openMAXIMS    文件:Logic.java   
/**
 * Clears any current icons. If given boolean is true, adds an allergies icon. 
 * 
 * @param boolean
 * @return void
 */
private void setToolBarAllergies(boolean bAlertsExist)
{
    engine.clearAlertsByType(ims.alerts.PatientAllergy.class); 
    if(bAlertsExist)
    {
        engine.addAlert(new ims.alerts.PatientAllergy("The patient has allergies."));
    }
    }
项目:openMAXIMS    文件:Logic.java   
private void populateDetailsPanel(PatientAllergy allergy)
{
    clearDetailsPanel();

    form.ctnDetails().customControlCodingItem().setValue(allergy);
    form.ctnDetails().cmbType().setValue(allergy.getAllergenType());            
    populateReactionCmb();

    //If a reaction that has been saved is now marked as inactive in the Admin section it will still display 
    if (allergy.getReactions() != null)
    {   
        if (allergy.getReactions().size() > 0)
        {
            form.ctnDetails().cmbReaction().newRow(allergy.getReactions().get(0).getReaction(), allergy.getReactions().get(0).getReaction().getText());
            form.ctnDetails().cmbReaction().setValue(allergy.getReactions().get(0).getReaction());
        }
    }

    if(allergy.getAuthoringInformationIsNotNull())
        form.ctnDetails().customControlAuthoringInfo().setValue(allergy.getAuthoringInformation());

    if(allergy.getRecordingInformationIsNotNull()){
        if(allergy.getRecordingInformation().getRecordingUserIsNotNull())
            form.ctnDetails().txtRcordingHCP().setValue(allergy.getRecordingInformation().getRecordingUser().toString());
        form.ctnDetails().dtimRecordingDateTime().setValue(allergy.getRecordingInformation().getRecordingDateTime());
    }


    form.ctnDetails().txtEffect().setValue(allergy.getComments());
    form.ctnDetails().cmbSource().setValue(allergy.getSourceofInformation());
    form.ctnDetails().pdtDateIdentified().setValue(allergy.getWhenIdentified());
}
项目:openMAXIMS    文件:Logic.java   
private boolean grdAllergiesContainsOnlyEmptyRows() 
{
    for (int i = 0; i < form.grdAlergies().getRows().size(); i++)
    {
        PatientAllergy allergy = form.grdAlergies().getRows().get(i).getValue();

        if (allergy != null)
        {   
            return false;
        }
    }

    return true;
}
项目:openMAXIMS    文件:Logic.java   
@SuppressWarnings("unchecked")
private void populateAllergiesGridFromData(PatientAllergyCollection allergies)
{
    for (Iterator iterator = allergies.iterator(); iterator.hasNext();)
    {
        PatientAllergy name = (PatientAllergy) iterator.next();
        grdAlergiesRow row = form.grdAlergies().getRows().newRow();
        row.setValue(name);
        row.getAllergy().newRow(name.getAllergen(), name.getAllergen().getAllergenName());
        row.getAllergy().setValue(name.getAllergen());
        row.getAllergy().setEditedText(name.getAllergen().getAllergenName());

    }

}
项目:openMAXIMS    文件:Logic.java   
private PatientAllergyCollection getAllergies(PatientAllergyCollection patAlColl)
{
    for(int i=0; i<form.grdAlergies().getRows().size(); i++)
    {
        if(form.grdAlergies().getRows().get(i) != null && form.grdAlergies().getRows().get(i).getValue() instanceof PatientAllergy)
        {
            if(!patAlColl.contains(form.grdAlergies().getRows().get(i).getValue()))
            {
                patAlColl.add(form.grdAlergies().getRows().get(i).getValue());
            }
        }
    }

    for(int i=0; i<patAlColl.size(); i++)
    {
        Boolean isEqual = false;

        for(int j=0; j<form.grdAlergies().getRows().size(); j++)
        {
            if(patAlColl.get(i) != null && form.grdAlergies().getRows().get(j) != null && form.grdAlergies().getRows().get(j).getValue() != null && patAlColl.get(i).equals(form.grdAlergies().getRows().get(j).getValue()))
            {
                isEqual = true;
                break;
            }
        }

        if(!isEqual)
        {
            patAlColl.remove(i);
        }
    }

    return patAlColl.size()==0 ? null : patAlColl;
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdAlergiesMutableComboBoxSelected(int column, grdAlergiesRow row, Object value) throws PresentationLogicException 
{
    if(value instanceof AllergenVo)
    {
        PatientAllergy patAl = new PatientAllergy();
        patAl.setPatient(form.getGlobalContext().Core.getPatientShort().toPatientRefVo());
        patAl.setSourceofInformation(SourceofInformation.CORRESPONDENCE);
        patAl.setAllergen((AllergenVo) value);
        patAl.setAllergenDescription(((AllergenVo) value).getAllergenNameIsNotNull() ? ((AllergenVo) value).getAllergenName() : "");

        row.setValue(patAl);
    }
}
项目:openMAXIMS    文件:Logic.java   
private PatientAllergy populateInstanceData(PatientAllergy voPatientAllergy)
{
    voPatientAllergy.setIsCurrentlyActiveAllergy(Boolean.TRUE);     
    voPatientAllergy.setSourceofInformation(form.cmbSourceOfInformation().getValue());          
    voPatientAllergy.setPatient(form.getGlobalContext().Core.getPatientShort());

    IClinicalCodingValue voResult = form.cc1().getValue();
    if (voResult != null)
    {
        if (voResult.getIClinicalCodingValue() instanceof AllergenVo)
        {
            voPatientAllergy.setAllergen((AllergenVo) voResult.getIClinicalCodingValue());
            voPatientAllergy.setAllergenDescription(voResult.getIClinicalCodingValueDescription());
        }
        else
        {
            throw new CodingRuntimeException("AllergenVo expected from component");
        }
    }
    else 
    {
        voPatientAllergy.setAllergenDescription(null);
    }       

    voPatientAllergy.setReactions(null);

    voPatientAllergy.setAuthoringInformation(form.cc2().getValue());

    return voPatientAllergy;
}
项目:openMAXIMS    文件:Logic.java   
private String createInactivateTooltip(PatientAllergy voPatientAllergy)
    {
        StringBuffer sb = new StringBuffer();
//      sb.append("<b>Inactive Comment : </b>");
//      sb.append(voPatientAllergy.getInactivationCommentsIsNotNull() ? voPatientAllergy.getInactivationComments().toString() : "");
//      sb.append("<br>");
        sb.append("<b>Inactivated Info : </b>");
        sb.append(voPatientAllergy.getInactivationAuthoringInfoIsNotNull() ? voPatientAllergy.getInactivationAuthoringInfo().toString(" - ") : "");
        sb.append("<br>");
        sb.append("<b>Recording Info : </b>");
        sb.append(voPatientAllergy.getRecordingInformationIsNotNull() ? voPatientAllergy.getRecordingInformation().toString(" - ") : "");
        sb.append("<br>");

        return sb.toString();
    }
项目:openMAXIMS    文件:Logic.java   
/**
 * Clears any current icons. If given boolean is true, adds an allergies icon. 
 * 
 * @param boolean
 * @return void
 */
private void setToolBarAllergies(boolean bAlertsExist)
{
    engine.clearAlertsByType(ims.alerts.PatientAllergy.class); 
    if(bAlertsExist)
    {
        engine.addAlert(new ims.alerts.PatientAllergy("The patient has allergies."));
    }
    }
项目:openMAXIMS    文件:Logic.java   
private void populateDetailsPanel(PatientAllergy allergy)
{
    clearDetailsPanel();

    form.ctnDetails().customControlCodingItem().setValue(allergy);
    form.ctnDetails().cmbType().setValue(allergy.getAllergenType());            
    populateReactionCmb();

    //If a reaction that has been saved is now marked as inactive in the Admin section it will still display 
    if (allergy.getReactions() != null)
    {   
        if (allergy.getReactions().size() > 0)
        {
            form.ctnDetails().cmbReaction().newRow(allergy.getReactions().get(0).getReaction(), allergy.getReactions().get(0).getReaction().getText());
            form.ctnDetails().cmbReaction().setValue(allergy.getReactions().get(0).getReaction());
        }
    }

    if(allergy.getAuthoringInformationIsNotNull())
        form.ctnDetails().customControlAuthoringInfo().setValue(allergy.getAuthoringInformation());

    if(allergy.getRecordingInformationIsNotNull()){
        if(allergy.getRecordingInformation().getRecordingUserIsNotNull())
            form.ctnDetails().txtRcordingHCP().setValue(allergy.getRecordingInformation().getRecordingUser().toString());
        form.ctnDetails().dtimRecordingDateTime().setValue(allergy.getRecordingInformation().getRecordingDateTime());
    }


    form.ctnDetails().txtEffect().setValue(allergy.getComments());
    form.ctnDetails().cmbSource().setValue(allergy.getSourceofInformation());
    form.ctnDetails().pdtDateIdentified().setValue(allergy.getWhenIdentified());
}
项目:openmaxims-linux    文件:Logic.java   
private PatientAllergy populateInstanceData(PatientAllergy voPatientAllergy)
{
    voPatientAllergy.setIsCurrentlyActiveAllergy(Boolean.TRUE);     
    voPatientAllergy.setSourceofInformation(form.cmbSourceOfInformation().getValue());          
    voPatientAllergy.setPatient(form.getGlobalContext().Core.getPatientShort());

    IClinicalCodingValue voResult = form.cc1().getValue();
    if (voResult != null)
    {
        if (voResult.getIClinicalCodingValue() instanceof AllergenVo)
        {
            voPatientAllergy.setAllergen((AllergenVo) voResult.getIClinicalCodingValue());
            voPatientAllergy.setAllergenDescription(voResult.getIClinicalCodingValueDescription());
        }
        else
        {
            throw new CodingRuntimeException("AllergenVo expected from component");
        }
    }
    else 
    {
        voPatientAllergy.setAllergenDescription(null);
    }       

    voPatientAllergy.setReactions(null);

    voPatientAllergy.setAuthoringInformation(form.cc2().getValue());

    return voPatientAllergy;
}
项目:openmaxims-linux    文件:Logic.java   
private String createInactivateTooltip(PatientAllergy voPatientAllergy)
    {
        StringBuffer sb = new StringBuffer();
//      sb.append("<b>Inactive Comment : </b>");
//      sb.append(voPatientAllergy.getInactivationCommentsIsNotNull() ? voPatientAllergy.getInactivationComments().toString() : "");
//      sb.append("<br>");
        sb.append("<b>Inactivated Info : </b>");
        sb.append(voPatientAllergy.getInactivationAuthoringInfoIsNotNull() ? voPatientAllergy.getInactivationAuthoringInfo().toString(" - ") : "");
        sb.append("<br>");
        sb.append("<b>Recording Info : </b>");
        sb.append(voPatientAllergy.getRecordingInformationIsNotNull() ? voPatientAllergy.getRecordingInformation().toString(" - ") : "");
        sb.append("<br>");

        return sb.toString();
    }
项目:openmaxims-linux    文件:Logic.java   
/**
 * Clears any current icons. If given boolean is true, adds an allergies icon. 
 * 
 * @param boolean
 * @return void
 */
private void setToolBarAllergies(boolean bAlertsExist)
{
    engine.clearAlertsByType(ims.alerts.PatientAllergy.class); 
    if(bAlertsExist)
    {
        engine.addAlert(new ims.alerts.PatientAllergy("The patient has allergies."));
    }
    }
项目:openmaxims-linux    文件:Logic.java   
private void populateDetailsPanel(PatientAllergy allergy)
{
    clearDetailsPanel();

    form.ctnDetails().customControlCodingItem().setValue(allergy);
    form.ctnDetails().cmbType().setValue(allergy.getAllergenType());            
    populateReactionCmb();

    //If a reaction that has been saved is now marked as inactive in the Admin section it will still display 
    if (allergy.getReactions() != null)
    {   
        if (allergy.getReactions().size() > 0)
        {
            form.ctnDetails().cmbReaction().newRow(allergy.getReactions().get(0).getReaction(), allergy.getReactions().get(0).getReaction().getText());
            form.ctnDetails().cmbReaction().setValue(allergy.getReactions().get(0).getReaction());
        }
    }

    if(allergy.getAuthoringInformationIsNotNull())
        form.ctnDetails().customControlAuthoringInfo().setValue(allergy.getAuthoringInformation());

    if(allergy.getRecordingInformationIsNotNull()){
        if(allergy.getRecordingInformation().getRecordingUserIsNotNull())
            form.ctnDetails().txtRcordingHCP().setValue(allergy.getRecordingInformation().getRecordingUser().toString());
        form.ctnDetails().dtimRecordingDateTime().setValue(allergy.getRecordingInformation().getRecordingDateTime());
    }


    form.ctnDetails().txtEffect().setValue(allergy.getComments());
    form.ctnDetails().cmbSource().setValue(allergy.getSourceofInformation());
    form.ctnDetails().pdtDateIdentified().setValue(allergy.getWhenIdentified());
}