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

项目:AvoinApotti    文件:Logic.java   
private boolean saveDiagnosis() 
{
    PatientDiagnosisAtConsultationVoCollection diagnosisList = form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList();

    String[] errors = diagnosisList.validate();
    if(errors != null && errors.length >0)
    {
        engine.showErrors(errors);
        return false;
    }

    try 
    {
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.saveDiagnosis(diagnosisList));
    } 
    catch (StaleObjectException e) 
    {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.listPatientDiagnosis(form.getLocalContext().getCareContext()));
        populatePatientDiagnosisGrid(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList());
        return false;
    }

    return true;
}
项目:AvoinApotti    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection saveDiagnosis(PatientDiagnosisAtConsultationVoCollection diagnosis)   throws StaleObjectException 
{
    if(diagnosis == null)
        throw new CodingRuntimeException("Cannot save a null PatientDiagnosisAtConsultationVoCollection.");

    if(!diagnosis.isValidated())
        throw new CodingRuntimeException("PatientDiagnosisAtConsultationVoCollection is not validated.");

    DomainFactory factory = getDomainFactory();
    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();

    for(PatientDiagnosisAtConsultationVo diagnose : diagnosis)
    {
        if(diagnose == null)
            continue;

        PatientDiagnosis doDiagnose = PatientDiagnosisAtConsultationVoAssembler.extractPatientDiagnosis(factory, diagnose);

        factory.save(doDiagnose);
        coll.add(PatientDiagnosisAtConsultationVoAssembler.create(doDiagnose));
    }

    return coll;
}
项目:AvoinApotti    文件:Logic.java   
private void addDiagnosis()
{
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("Logged in user is not a HCP.");                     
        return;
    }
    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();
    for (int i = 0; i < form.grdDiagnosis().getRows().size(); i++) 
    {
        coll.add(form.grdDiagnosis().getRows().get(i).getValue());
    }
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(coll);

    //if another Diagnosis is marked as Primary / Main then disable the checkbox in dialog
    boolean bEnable = false;
    for (int i = 0 ; i < form.grdDiagnosis().getRows().size() ; i++)
    {
        if (form.grdDiagnosis().getRows().get(i).getColMain() != null)
                bEnable = true;
    }
    form.getGlobalContext().Clinical.setDisableMainCheckbox(bEnable);
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultation(null);

    engine.open(form.getForms().Clinical.DiagnosisDialog);
}
项目:openMAXIMS    文件:Logic.java   
private boolean saveDiagnosis() 
{
    PatientDiagnosisAtConsultationVoCollection diagnosisList = form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList();

    String[] errors = diagnosisList.validate();
    if(errors != null && errors.length >0)
    {
        engine.showErrors(errors);
        return false;
    }

    try 
    {
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.saveDiagnosis(diagnosisList, !Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()) ? form.getLocalContext().getCareContext() : null));
    } 
    catch (StaleObjectException e) 
    {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.listPatientDiagnosis(form.getLocalContext().getCareContext()));
        populatePatientDiagnosisGrid(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList());
        return false;
    }

    return true;
}
项目:openMAXIMS    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection saveDiagnosisSequence(PatientDiagnosisAtConsultationVoCollection patDiagnosis, CodedDiagnosesForAttendanceVoCollection codedDiagnosis, CareContextRefVo careContextRef) throws StaleObjectException
{
    if (codedDiagnosis!=null && codedDiagnosis.size()>0)
    {
        saveCodedDiagnosis(codedDiagnosis);
    }

    PatientDiagnosisAtConsultationVoCollection collpatDiag = null; 

    if (patDiagnosis!=null && patDiagnosis.size()>0)
    {
        collpatDiag= saveDiagnosis(patDiagnosis, careContextRef);
    }

    return collpatDiag;
}
项目:openMAXIMS    文件:Logic.java   
private void addDiagnosis()
{
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("Logged in user is not a HCP.");                     
        return;
    }
    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();
    for (int i = 0; i < form.grdDiagnosis().getRows().size(); i++) 
    {
        coll.add(form.grdDiagnosis().getRows().get(i).getValue());
    }
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(coll);

    //if another Diagnosis is marked as Primary / Main then disable the checkbox in dialog
    boolean bEnable = false;
    for (int i = 0 ; i < form.grdDiagnosis().getRows().size() ; i++)
    {
        if (form.grdDiagnosis().getRows().get(i).getColMain() != null)
                bEnable = true;
    }
    form.getGlobalContext().Clinical.setDisableMainCheckbox(bEnable);
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultation(null);

    engine.open(form.getForms().Clinical.DiagnosisDialog);
}
项目:openMAXIMS    文件:Logic.java   
private boolean saveDiagnosis() 
{
    PatientDiagnosisAtConsultationVoCollection diagnosisList = form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList();

    String[] errors = diagnosisList.validate();
    if(errors != null && errors.length >0)
    {
        engine.showErrors(errors);
        return false;
    }

    try 
    {
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.saveDiagnosis(diagnosisList));
    } 
    catch (StaleObjectException e) 
    {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.listPatientDiagnosis(form.getLocalContext().getCareContext()));
        populatePatientDiagnosisGrid(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList());
        return false;
    }

    return true;
}
项目:openMAXIMS    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection saveDiagnosis(PatientDiagnosisAtConsultationVoCollection diagnosis)   throws StaleObjectException 
{
    if(diagnosis == null)
        throw new CodingRuntimeException("Cannot save a null PatientDiagnosisAtConsultationVoCollection.");

    if(!diagnosis.isValidated())
        throw new CodingRuntimeException("PatientDiagnosisAtConsultationVoCollection is not validated.");

    DomainFactory factory = getDomainFactory();
    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();

    for(PatientDiagnosisAtConsultationVo diagnose : diagnosis)
    {
        if(diagnose == null)
            continue;

        PatientDiagnosis doDiagnose = PatientDiagnosisAtConsultationVoAssembler.extractPatientDiagnosis(factory, diagnose);

        factory.save(doDiagnose);
        coll.add(PatientDiagnosisAtConsultationVoAssembler.create(doDiagnose));
    }

    return coll;
}
项目:openMAXIMS    文件:Logic.java   
private void addDiagnosis()
{
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("Logged in user is not a HCP.");                     
        return;
    }
    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();
    for (int i = 0; i < form.grdDiagnosis().getRows().size(); i++) 
    {
        coll.add(form.grdDiagnosis().getRows().get(i).getValue());
    }
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(coll);

    //if another Diagnosis is marked as Primary / Main then disable the checkbox in dialog
    boolean bEnable = false;
    for (int i = 0 ; i < form.grdDiagnosis().getRows().size() ; i++)
    {
        if (form.grdDiagnosis().getRows().get(i).getColMain() != null)
                bEnable = true;
    }
    form.getGlobalContext().Clinical.setDisableMainCheckbox(bEnable);
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultation(null);

    engine.open(form.getForms().Clinical.DiagnosisDialog);
}
项目:openmaxims-linux    文件:Logic.java   
private boolean saveDiagnosis() 
{
    PatientDiagnosisAtConsultationVoCollection diagnosisList = form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList();

    String[] errors = diagnosisList.validate();
    if(errors != null && errors.length >0)
    {
        engine.showErrors(errors);
        return false;
    }

    try 
    {
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.saveDiagnosis(diagnosisList));
    } 
    catch (StaleObjectException e) 
    {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.listPatientDiagnosis(form.getLocalContext().getCareContext()));
        populatePatientDiagnosisGrid(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList());
        return false;
    }

    return true;
}
项目:openmaxims-linux    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection saveDiagnosis(PatientDiagnosisAtConsultationVoCollection diagnosis)   throws StaleObjectException 
{
    if(diagnosis == null)
        throw new CodingRuntimeException("Cannot save a null PatientDiagnosisAtConsultationVoCollection.");

    if(!diagnosis.isValidated())
        throw new CodingRuntimeException("PatientDiagnosisAtConsultationVoCollection is not validated.");

    DomainFactory factory = getDomainFactory();
    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();

    for(PatientDiagnosisAtConsultationVo diagnose : diagnosis)
    {
        if(diagnose == null)
            continue;

        PatientDiagnosis doDiagnose = PatientDiagnosisAtConsultationVoAssembler.extractPatientDiagnosis(factory, diagnose);

        factory.save(doDiagnose);
        coll.add(PatientDiagnosisAtConsultationVoAssembler.create(doDiagnose));
    }

    return coll;
}
项目:AvoinApotti    文件:Logic.java   
private void populatePatientDiagnosisGrid(PatientDiagnosisAtConsultationVoCollection patientDiagnosisAtConsultationVoCollection) 
{
    form.grdDiagnosis().getRows().clear();

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

    if(Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()))
        patientDiagnosisAtConsultationVoCollection.sort();

    for(PatientDiagnosisAtConsultationVo diagnose : patientDiagnosisAtConsultationVoCollection)
    {
        if(diagnose == null)
            continue;

        ims.emergency.forms.interventionsdiagnosisinvestigationscc.GenForm.grdDiagnosisRow row = form.grdDiagnosis().getRows().newRow();
        row.setColDiagnose(diagnose.getDiagnosisDescription());

        boolean isPrimary = isPrimary(diagnose);
        row.setBold(isPrimary);

        if(isPrimary)
        {
            row.setColImage(form.getImages().Core.Pin);
            row.setTooltipForColImage("Main Diagnosis");
            form.getLocalContext().setPrimaryDiagnosis(diagnose);//WDEV-17320
        }

        row.setValue(diagnose);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void saveDiagnosisSequence() 
{
    PatientDiagnosisAtConsultationVoCollection diagnosisList = form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList();

    for (int gridIndex = 0 ; gridIndex < form.grdDiagnosis().getRows().size() ; gridIndex++)
    {
        PatientDiagnosisAtConsultationVo diagnosisVo = (PatientDiagnosisAtConsultationVo)form.grdDiagnosis().getRows().get(gridIndex).getValue();

        diagnosisVo.setCodingSequence(gridIndex);

        diagnosisList.set(diagnosisList.indexOf(diagnosisVo), diagnosisVo);
    }

    String[] errors = diagnosisList.validate();
    if(errors != null && errors.length >0)
    {
        engine.showErrors(errors);
        return;
    }

    try 
    {
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.saveDiagnosis(diagnosisList));
    } 
    catch (StaleObjectException e) 
    {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.listPatientDiagnosis(form.getLocalContext().getCareContext()));
        populatePatientDiagnosisGrid(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList());
    }
}
项目:AvoinApotti    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection listPatientDiagnosis(CareContextRefVo attendance) 
{
    if(attendance == null || attendance.getID_CareContext() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    String query = "select pd from PatientDiagnosis as pd left join pd.careContext as cc where cc.id = :AttendenceId order by UPPER(pd.diagnosisDescription) asc";

    List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendance.getID_CareContext()});

    return PatientDiagnosisAtConsultationVoAssembler.createPatientDiagnosisAtConsultationVoCollectionFromPatientDiagnosis(list);
}
项目:AvoinApotti    文件:Logic.java   
private void updateDiagnosis()
{
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("Logged in user is not a HCP.");                     
        return;
    }

    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();
    for (int i = 0; i < form.grdDiagnosis().getRows().size(); i++) 
    {
        coll.add(form.grdDiagnosis().getRows().get(i).getValue());
    }
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(coll);

    //if another Diagnosis is marked as Primary / Main then disable the checkbox in dialog
    boolean bEnable = false;
    for (int i = 0 ; i < form.grdDiagnosis().getRows().size() ; i++)
    {
        if (form.grdDiagnosis().getRows().get(i).getColMain() != null)
        {
            if (i != form.grdDiagnosis().getSelectedRowIndex())
                bEnable = true;
        }
    }

    form.getGlobalContext().Clinical.setDisableMainCheckbox(bEnable);
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultation(form.grdDiagnosis().getSelectedRow().getValue());

    engine.open(form.getForms().Clinical.DiagnosisDialog);
}
项目:AvoinApotti    文件:Logic.java   
private PatientDiagnosisAtConsultationVoCollection orderGridByDate(PatientDiagnosisAtConsultationVoCollection diagnosises) 
{
    Vector<PatientDiagnosisAtConsultationVo> v=new Vector<PatientDiagnosisAtConsultationVo>();
    for (int i=0;i<diagnosises.size();i++)
    {
        if (v.size()==0)
            v.add(diagnosises.get(i));
        else
        {
            PatientDiagnosisAtConsultationVo diagnosis = diagnosises.get(i);
            if (diagnosis.getAuthoringInfoIsNotNull()&&diagnosis.getAuthoringInfo().getAuthoringDateTimeIsNotNull())
            {
                int n=v.size();
                for (int j=0;j<n;j++)
                {
                    if (v.get(j).getAuthoringInfoIsNotNull()&&v.get(j).getAuthoringInfo().getAuthoringDateTimeIsNotNull())
                    {
                        if (diagnosis.getAuthoringInfo().getAuthoringDateTime().compareTo(v.get(j).getAuthoringInfo().getAuthoringDateTime())<0)
                            v.add(j, diagnosis);
                        else
                            v.add(diagnosis);
                    }
                }
            }
        }
    }
    diagnosises.clear();
    for (int x=0;x<v.size();x++)
    {
        diagnosises.add(v.get(x));
    }
    return diagnosises;
}
项目:AvoinApotti    文件:DiagnosisDialogImpl.java   
public PatientDiagnosisAtConsultationVoCollection listPatientDiagnosis(CareContextRefVo attendance) 
{
    if(attendance == null || attendance.getID_CareContext() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    String query = "select pd from PatientDiagnosis as pd left join pd.careContext as cc where cc.id = :AttendenceId order by UPPER(pd.diagnosisDescription) asc";

    List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendance.getID_CareContext()});

    return PatientDiagnosisAtConsultationVoAssembler.createPatientDiagnosisAtConsultationVoCollectionFromPatientDiagnosis(list);
}
项目:openMAXIMS    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection listPatientDiagnosis(CareContextRefVo attendance) 
{
    if(attendance == null || attendance.getID_CareContext() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    String query = "select pd from PatientDiagnosis as pd left join pd.careContext as cc where cc.id = :AttendenceId order by UPPER(pd.diagnosisDescription) asc";

    List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendance.getID_CareContext()});

    return PatientDiagnosisAtConsultationVoAssembler.createPatientDiagnosisAtConsultationVoCollectionFromPatientDiagnosis(list);
}
项目:openMAXIMS    文件:Logic.java   
private void updateDiagnosis()
{
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("Logged in user is not a HCP.");                     
        return;
    }

    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();
    for (int i = 0; i < form.grdDiagnosis().getRows().size(); i++) 
    {
        coll.add(form.grdDiagnosis().getRows().get(i).getValue());
    }
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(coll);

    //if another Diagnosis is marked as Primary / Main then disable the checkbox in dialog
    boolean bEnable = false;
    for (int i = 0 ; i < form.grdDiagnosis().getRows().size() ; i++)
    {
        if (form.grdDiagnosis().getRows().get(i).getColMain() != null)
        {
            if (i != form.grdDiagnosis().getSelectedRowIndex())
                bEnable = true;
        }
    }

    form.getGlobalContext().Clinical.setDisableMainCheckbox(bEnable);
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultation(form.grdDiagnosis().getSelectedRow().getValue());

    engine.open(form.getForms().Clinical.DiagnosisDialog);
}
项目:openMAXIMS    文件:Logic.java   
private PatientDiagnosisAtConsultationVoCollection orderGridByDate(PatientDiagnosisAtConsultationVoCollection diagnosises) 
{
    Vector<PatientDiagnosisAtConsultationVo> v=new Vector<PatientDiagnosisAtConsultationVo>();
    for (int i=0;i<diagnosises.size();i++)
    {
        if (v.size()==0)
            v.add(diagnosises.get(i));
        else
        {
            PatientDiagnosisAtConsultationVo diagnosis = diagnosises.get(i);
            if (diagnosis.getAuthoringInfoIsNotNull()&&diagnosis.getAuthoringInfo().getAuthoringDateTimeIsNotNull())
            {
                int n=v.size();
                for (int j=0;j<n;j++)
                {
                    if (v.get(j).getAuthoringInfoIsNotNull()&&v.get(j).getAuthoringInfo().getAuthoringDateTimeIsNotNull())
                    {
                        if (diagnosis.getAuthoringInfo().getAuthoringDateTime().compareTo(v.get(j).getAuthoringInfo().getAuthoringDateTime())<0)
                            v.add(j, diagnosis);
                        else
                            v.add(diagnosis);
                    }
                }
            }
        }
    }
    diagnosises.clear();
    for (int x=0;x<v.size();x++)
    {
        diagnosises.add(v.get(x));
    }
    return diagnosises;
}
项目:openMAXIMS    文件:DiagnosisDialogImpl.java   
public PatientDiagnosisAtConsultationVoCollection listPatientDiagnosis(CareContextRefVo attendance) 
{
    if(attendance == null || attendance.getID_CareContext() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    String query = "select pd from PatientDiagnosis as pd left join pd.careContext as cc where cc.id = :AttendenceId order by UPPER(pd.diagnosisDescription) asc";

    List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendance.getID_CareContext()});

    return PatientDiagnosisAtConsultationVoAssembler.createPatientDiagnosisAtConsultationVoCollectionFromPatientDiagnosis(list);
}
项目:openMAXIMS    文件:Logic.java   
private void populatePatientDiagnosisGrid(PatientDiagnosisAtConsultationVoCollection patientDiagnosisAtConsultationVoCollection) 
{
    form.grdDiagnosis().getRows().clear();

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

    if(Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()))
        patientDiagnosisAtConsultationVoCollection.sort();

    for(PatientDiagnosisAtConsultationVo diagnose : patientDiagnosisAtConsultationVoCollection)
    {
        if(diagnose == null)
            continue;

        ims.emergency.forms.interventionsdiagnosisinvestigationscc.GenForm.grdDiagnosisRow row = form.grdDiagnosis().getRows().newRow();
        row.setColDiagnose(diagnose.getDiagnosisDescription());

        boolean isPrimary = isPrimary(diagnose);
        row.setBold(isPrimary);

        if(isPrimary)
        {
            row.setColImage(form.getImages().Core.Pin);
            row.setTooltipForColImage("Main Diagnosis");
            form.getLocalContext().setPrimaryDiagnosis(diagnose);//WDEV-17320
        }

        row.setValue(diagnose);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void saveDiagnosisSequence() 
{
    PatientDiagnosisAtConsultationVoCollection diagnosisList = form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList();

    for (int gridIndex = 0 ; gridIndex < form.grdDiagnosis().getRows().size() ; gridIndex++)
    {
        PatientDiagnosisAtConsultationVo diagnosisVo = (PatientDiagnosisAtConsultationVo)form.grdDiagnosis().getRows().get(gridIndex).getValue();

        diagnosisVo.setCodingSequence(gridIndex);

        diagnosisList.set(diagnosisList.indexOf(diagnosisVo), diagnosisVo);
    }

    String[] errors = diagnosisList.validate();
    if(errors != null && errors.length >0)
    {
        engine.showErrors(errors);
        return;
    }

    try 
    {
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.saveDiagnosis(diagnosisList));
    } 
    catch (StaleObjectException e) 
    {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.listPatientDiagnosis(form.getLocalContext().getCareContext()));
        populatePatientDiagnosisGrid(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList());
    }
}
项目:openMAXIMS    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection listPatientDiagnosis(CareContextRefVo attendance) 
{
    if(attendance == null || attendance.getID_CareContext() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    String query = "select pd from PatientDiagnosis as pd left join pd.careContext as cc where cc.id = :AttendenceId order by UPPER(pd.diagnosisDescription) asc";

    List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendance.getID_CareContext()});

    return PatientDiagnosisAtConsultationVoAssembler.createPatientDiagnosisAtConsultationVoCollectionFromPatientDiagnosis(list);
}
项目:openMAXIMS    文件:Logic.java   
private void updateDiagnosis()
{
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("Logged in user is not a HCP.");                     
        return;
    }

    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();
    for (int i = 0; i < form.grdDiagnosis().getRows().size(); i++) 
    {
        coll.add(form.grdDiagnosis().getRows().get(i).getValue());
    }
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(coll);

    //if another Diagnosis is marked as Primary / Main then disable the checkbox in dialog
    boolean bEnable = false;
    for (int i = 0 ; i < form.grdDiagnosis().getRows().size() ; i++)
    {
        if (form.grdDiagnosis().getRows().get(i).getColMain() != null)
        {
            if (i != form.grdDiagnosis().getSelectedRowIndex())
                bEnable = true;
        }
    }

    form.getGlobalContext().Clinical.setDisableMainCheckbox(bEnable);
    form.getGlobalContext().Core.setPatientDiagnosisAtConsultation(form.grdDiagnosis().getSelectedRow().getValue());

    engine.open(form.getForms().Clinical.DiagnosisDialog);
}
项目:openMAXIMS    文件:Logic.java   
private PatientDiagnosisAtConsultationVoCollection orderGridByDate(PatientDiagnosisAtConsultationVoCollection diagnosises) 
{
    Vector<PatientDiagnosisAtConsultationVo> v=new Vector<PatientDiagnosisAtConsultationVo>();
    for (int i=0;i<diagnosises.size();i++)
    {
        if (v.size()==0)
            v.add(diagnosises.get(i));
        else
        {
            PatientDiagnosisAtConsultationVo diagnosis = diagnosises.get(i);
            if (diagnosis.getAuthoringInfoIsNotNull()&&diagnosis.getAuthoringInfo().getAuthoringDateTimeIsNotNull())
            {
                int n=v.size();
                for (int j=0;j<n;j++)
                {
                    if (v.get(j).getAuthoringInfoIsNotNull()&&v.get(j).getAuthoringInfo().getAuthoringDateTimeIsNotNull())
                    {
                        if (diagnosis.getAuthoringInfo().getAuthoringDateTime().compareTo(v.get(j).getAuthoringInfo().getAuthoringDateTime())<0)
                            v.add(j, diagnosis);
                        else
                            v.add(diagnosis);
                    }
                }
            }
        }
    }
    diagnosises.clear();
    for (int x=0;x<v.size();x++)
    {
        diagnosises.add(v.get(x));
    }
    return diagnosises;
}
项目:openMAXIMS    文件:DiagnosisDialogImpl.java   
public PatientDiagnosisAtConsultationVoCollection listPatientDiagnosis(CareContextRefVo attendance) 
{
    if(attendance == null || attendance.getID_CareContext() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    String query = "select pd from PatientDiagnosis as pd left join pd.careContext as cc where cc.id = :AttendenceId order by UPPER(pd.diagnosisDescription) asc";

    List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendance.getID_CareContext()});

    return PatientDiagnosisAtConsultationVoAssembler.createPatientDiagnosisAtConsultationVoCollectionFromPatientDiagnosis(list);
}
项目:openmaxims-linux    文件:Logic.java   
private void populatePatientDiagnosisGrid(PatientDiagnosisAtConsultationVoCollection patientDiagnosisAtConsultationVoCollection) 
{
    form.grdDiagnosis().getRows().clear();

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

    if(Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()))
        patientDiagnosisAtConsultationVoCollection.sort();

    for(PatientDiagnosisAtConsultationVo diagnose : patientDiagnosisAtConsultationVoCollection)
    {
        if(diagnose == null)
            continue;

        ims.emergency.forms.interventionsdiagnosisinvestigationscc.GenForm.grdDiagnosisRow row = form.grdDiagnosis().getRows().newRow();
        row.setColDiagnose(diagnose.getDiagnosisDescription());

        boolean isPrimary = isPrimary(diagnose);
        row.setBold(isPrimary);

        if(isPrimary)
        {
            row.setColImage(form.getImages().Core.Pin);
            row.setTooltipForColImage("Main Diagnosis");
            form.getLocalContext().setPrimaryDiagnosis(diagnose);//WDEV-17320
        }

        row.setValue(diagnose);
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void saveDiagnosisSequence() 
{
    PatientDiagnosisAtConsultationVoCollection diagnosisList = form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList();

    for (int gridIndex = 0 ; gridIndex < form.grdDiagnosis().getRows().size() ; gridIndex++)
    {
        PatientDiagnosisAtConsultationVo diagnosisVo = (PatientDiagnosisAtConsultationVo)form.grdDiagnosis().getRows().get(gridIndex).getValue();

        diagnosisVo.setCodingSequence(gridIndex);

        diagnosisList.set(diagnosisList.indexOf(diagnosisVo), diagnosisVo);
    }

    String[] errors = diagnosisList.validate();
    if(errors != null && errors.length >0)
    {
        engine.showErrors(errors);
        return;
    }

    try 
    {
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.saveDiagnosis(diagnosisList));
    } 
    catch (StaleObjectException e) 
    {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.listPatientDiagnosis(form.getLocalContext().getCareContext()));
        populatePatientDiagnosisGrid(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList());
    }
}
项目:openmaxims-linux    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection listPatientDiagnosis(CareContextRefVo attendance) 
{
    if(attendance == null || attendance.getID_CareContext() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    String query = "select pd from PatientDiagnosis as pd left join pd.careContext as cc where cc.id = :AttendenceId order by UPPER(pd.diagnosisDescription) asc";

    List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendance.getID_CareContext()});

    return PatientDiagnosisAtConsultationVoAssembler.createPatientDiagnosisAtConsultationVoCollectionFromPatientDiagnosis(list);
}
项目:openmaxims-linux    文件:DiagnosisDialogImpl.java   
public PatientDiagnosisAtConsultationVoCollection listPatientDiagnosis(CareContextRefVo attendance) 
{
    if(attendance == null || attendance.getID_CareContext() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    String query = "select pd from PatientDiagnosis as pd left join pd.careContext as cc where cc.id = :AttendenceId order by UPPER(pd.diagnosisDescription) asc";

    List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendance.getID_CareContext()});

    return PatientDiagnosisAtConsultationVoAssembler.createPatientDiagnosisAtConsultationVoCollectionFromPatientDiagnosis(list);
}
项目:AvoinApotti    文件:Logic.java   
private DiagnosisManagementVo populateData(DiagnosisManagementVo voDiagnosisManagement) 
{
    if(voDiagnosisManagement == null)
        voDiagnosisManagement = new ims.RefMan.vo.DiagnosisManagementVo();

    if (form.chkFirstDefinitiveSystem().getValue() &&
            form.dteFirstDefinitiveSystem().getValue() == null) 
    {
        engine.showMessage("If First Definitive Treatment is checked DateTime is mandatory");
        return null;
    }

    voDiagnosisManagement.setID_DiagnosisManagement(null);
    voDiagnosisManagement.setAdviceAndInfoGiven(form.richTextAdviceAndInformationGiven().getValue());
    voDiagnosisManagement.setActionRequiredByGPNotes(form.richTextActionRequiredByGP().getValue());
    voDiagnosisManagement.setInvestigationsAndResults(form.richTextSummaryOfInvestigationsAndResults().getValue());

    if (form.chkFirstDefinitiveSystem().getValue() &&
            form.dteFirstDefinitiveSystem().getValue() != null) 
    {
        voDiagnosisManagement.setFirstDefinitiveTreatmentDate(form.dteFirstDefinitiveSystem().getValue());
    }
    else {
        voDiagnosisManagement.setFirstDefinitiveTreatmentDate(null);
    }

    PatientDiagnosisAtConsultationVoCollection  coll = new PatientDiagnosisAtConsultationVoCollection();
    for(int x = 0; x < this.form.grdDiagnosis().getRows().size(); x++)
    {
        coll.add(form.grdDiagnosis().getRows().get(x).getValue());
    }
    if(coll.size()>0)
        voDiagnosisManagement.setDiagnosis(coll);
    else
        voDiagnosisManagement.setDiagnosis(null);

    PatientProcedureShortVoCollection collProc = new PatientProcedureShortVoCollection();
    for(int x = 0; x < this.form.grdProcedures().getRows().size(); x++)
    {
        collProc.add(form.grdProcedures().getRows().get(x).getValue());
    }
    if(collProc.size()>0)
        voDiagnosisManagement.setProcedures(collProc);
    else
        voDiagnosisManagement.setProcedures(null);


    if(form.GroupAction().getValue().equals(GenForm.GroupActionEnumeration.rdoActionYes))
        voDiagnosisManagement.setActionRequiredByGP(YesNo.YES);
    else
        voDiagnosisManagement.setActionRequiredByGP(YesNo.NO);

    if(form.GroupConsent().getValue().equals(GenForm.GroupConsentEnumeration.rdoConsentYes))
        voDiagnosisManagement.setPatientConsent(YesNo.YES);
    else
        voDiagnosisManagement.setPatientConsent(YesNo.NO);

    voDiagnosisManagement.setCatsReferral(form.getGlobalContext().RefMan.getCatsReferral());
    voDiagnosisManagement.setLastAuthoringHCP(form.ccLastUpdating().getValue());
    voDiagnosisManagement.setRecordingInformation(populateRecordinfInfo());

    return voDiagnosisManagement;
}
项目:AvoinApotti    文件:Logic.java   
private void initialize(Object[] args)
{
    if(args != null && args.length > 0)
    {
        if(args[0] instanceof Boolean)
        {
            form.getLocalContext().setAddedDuringCoding(Boolean.TRUE);
        }
    }

    initializeCustomControl();

    if (form.getGlobalContext().Core.getPatientDiagnosisAtConsultation()!=null)
    {
        populateScreenFromData( form.getGlobalContext().Core.getPatientDiagnosisAtConsultation());
    }
    else
    {
        AuthoringInformationVo voAuthoringInformation=new AuthoringInformationVo();
        voAuthoringInformation.setAuthoringDateTime(new DateTime());
        if (domain.getHcpLiteUser()!=null)
            voAuthoringInformation.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());
        form.ccAuthoringInfo().setValue(voAuthoringInformation);
    }

    if (form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList()==null)
    {
        PatientDiagnosisAtConsultationVoCollection diagnosisCollection=new PatientDiagnosisAtConsultationVoCollection();
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(diagnosisCollection);
    }

    if (domain.getHcpLiteUser() == null)
    {
        form.chkMain().setEnabled(false);
        form.cmbStatus().setEnabled(false);
        form.qmbDiagnosis().setEnabled(false);
        form.setccAuthoringInfoEnabled(false);

        if (engine.hasRight(AppRight.ALLOW_EDIT_CONSULTATION_DIAGNOSIS))
        {
            form.qmbDiagnosis().setEnabled(false);
        }
    }

    if (form.getGlobalContext().Clinical.getDisableMainCheckboxIsNotNull() && form.getGlobalContext().Clinical.getDisableMainCheckbox())
    {
        form.chkMain().setEnabled(false);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populatePatientDiagnosisGrid(PatientDiagnosisAtConsultationVoCollection patientDiagnosisAtConsultationVoCollection) 
{
    form.chkNoDiagnoses().setValue(form.getLocalContext().getAttendDiagInvTreatStatus() != null && Boolean.TRUE.equals(form.getLocalContext().getAttendDiagInvTreatStatus().getNoDiagnoses()));
    form.chkDiagnosesNotRecorded().setValue(form.getLocalContext().getAttendDiagInvTreatStatus() != null && Boolean.TRUE.equals(form.getLocalContext().getAttendDiagInvTreatStatus().getDiagnosesNotRecorded()));

    form.grdDiagnosis().getRows().clear();

    //WDEV-19239

    CodedDiagnosesForAttendanceVoCollection collCoddedDiag = Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()) ? domain.listCodedDiagnosesForAttendance(form.getLocalContext().getCareContext(), false) : null;
    form.getGlobalContext().Core.setCodedDiagnosisForAttendanceList(collCoddedDiag);

    if(patientDiagnosisAtConsultationVoCollection == null && collCoddedDiag ==null)
        return;

    ArrayList<Object> listAllDiag = new ArrayList<Object>();

    for(int i=0;patientDiagnosisAtConsultationVoCollection!=null && i<patientDiagnosisAtConsultationVoCollection.size();i++)
    {
        PatientDiagnosisAtConsultationVo diagnose = patientDiagnosisAtConsultationVoCollection.get(i);
        listAllDiag.add(diagnose);  
    }

    for(int i=0;collCoddedDiag!=null && i<collCoddedDiag.size();i++)
    {
        CodedDiagnosesForAttendanceVo codedDiag = collCoddedDiag.get(i);
        listAllDiag.add(codedDiag);
    }

    Collections.sort(listAllDiag, new CodingSequenceComparator(SortOrder.ASCENDING));

    for (int i=0;i<listAllDiag.size();i++)
    {
        if (listAllDiag.get(i)!=null && listAllDiag.get(i) instanceof PatientDiagnosisAtConsultationVo)
        {
            addPatientDiagRow((PatientDiagnosisAtConsultationVo)listAllDiag.get(i));
        }
        else if (listAllDiag.get(i)!=null && listAllDiag.get(i) instanceof CodedDiagnosesForAttendanceVo)
        {
            addCodedDiagRow((CodedDiagnosesForAttendanceVo)listAllDiag.get(i));
        }
    }

    //if(Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()))
        //patientDiagnosisAtConsultationVoCollection.sort();

    /*
    for(PatientDiagnosisAtConsultationVo diagnose : patientDiagnosisAtConsultationVoCollection)
    {
        addPatientDiagRow(diagnose);
    }

    for(CodedDiagnosesForAttendanceVo codedDiag : collCoddedDiag)
    {
        addCodedDiagRow(codedDiag);
    }   
    */
}
项目:openMAXIMS    文件:Logic.java   
private void saveDiagnosisSequence() 
{
    if (form.grdDiagnosis().getRows().size()==0)
        return;

    PatientDiagnosisAtConsultationVoCollection diagnosisList=new PatientDiagnosisAtConsultationVoCollection();
    CodedDiagnosesForAttendanceVoCollection codedDiagnosisList=new CodedDiagnosesForAttendanceVoCollection();


    for (int gridIndex = 0 ; gridIndex < form.grdDiagnosis().getRows().size() ; gridIndex++)
    {
        ValueObject diag = form.grdDiagnosis().getRows().get(gridIndex).getValue();

        if (diag!=null && diag instanceof PatientDiagnosisAtConsultationVo)
        {
            PatientDiagnosisAtConsultationVo patDiag = (PatientDiagnosisAtConsultationVo) diag;
            patDiag.setCodingSequence(gridIndex);
            diagnosisList.add(patDiag);
        }
        else if (diag!=null && diag instanceof CodedDiagnosesForAttendanceVo)
        {
            CodedDiagnosesForAttendanceVo codedDiag = (CodedDiagnosesForAttendanceVo) diag;
            codedDiag.setCodingSequence(gridIndex);
            codedDiagnosisList.add(codedDiag);
        }
    }

    String[] errors = diagnosisList.validate(codedDiagnosisList.validate());
    if(errors != null && errors.length >0)
    {
        engine.showErrors(errors);
        return;
    }

    try 
    {
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.saveDiagnosisSequence(diagnosisList, codedDiagnosisList,form.getLocalContext().getCareContext()));
    } 
    catch (StaleObjectException e) 
    {
        e.printStackTrace();
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(domain.listPatientDiagnosis(form.getLocalContext().getCareContext()));
        populatePatientDiagnosisGrid(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList());
    }

}
项目:openMAXIMS    文件:InterventionsDiagnosisInvestigationsCcImpl.java   
public PatientDiagnosisAtConsultationVoCollection saveDiagnosis(PatientDiagnosisAtConsultationVoCollection diagnosis, CareContextRefVo careContext) throws StaleObjectException 
{
    if(diagnosis == null)
        throw new CodingRuntimeException("Cannot save a null PatientDiagnosisAtConsultationVoCollection.");

    if(!diagnosis.isValidated())
        throw new CodingRuntimeException("PatientDiagnosisAtConsultationVoCollection is not validated.");

    DomainFactory factory = getDomainFactory();
    PatientDiagnosisAtConsultationVoCollection coll = new PatientDiagnosisAtConsultationVoCollection();

    //WDEV-19239
    boolean isPatientDiagPrimary=false; 
    CareContextRefVo careContextRef = null;
    for(PatientDiagnosisAtConsultationVo diagnose : diagnosis)
    {
        if(diagnose == null)
            continue;

        careContextRef=diagnose.getCareContext();
        if (isPrimary(diagnose))
            isPatientDiagPrimary=true;

        PatientDiagnosis doDiagnose = PatientDiagnosisAtConsultationVoAssembler.extractPatientDiagnosis(factory, diagnose);

        factory.save(doDiagnose);
        coll.add(PatientDiagnosisAtConsultationVoAssembler.create(doDiagnose));
    }

    CodedDiagnosesForAttendanceVoCollection collCodedDiag = listCodedDiagnosesForAttendance(careContextRef, true);

    if (isPatientDiagPrimary && collCodedDiag!=null && collCodedDiag.size()>0)
    {
        for (CodedDiagnosesForAttendanceVo codedDiag : collCodedDiag)
        {
            codedDiag.setIsMain(false);

            CodedDiagForAttendance doCodedDiag = CodedDiagnosesForAttendanceVoAssembler.extractCodedDiagForAttendance(factory, codedDiag);
            factory.save(doCodedDiag);
        }
    }

    if(careContext != null)
    {
        AttendDiagInvTreatStatusVo attendDiagInvTreatStatus = getAttendDiagInvTreatStatus(careContext);

        if(attendDiagInvTreatStatus != null)
        {
            attendDiagInvTreatStatus.setNoDiagnoses(null);
            attendDiagInvTreatStatus.setDiagnosesNotRecorded(null);

            AttendDiagInvTreatStatus doAttendDiagInvTreatStatus = AttendDiagInvTreatStatusVoAssembler.extractAttendDiagInvTreatStatus(factory, attendDiagInvTreatStatus);
            factory.save(doAttendDiagInvTreatStatus);
        }
    }

    return coll;
}
项目:openMAXIMS    文件:Logic.java   
private DiagnosisManagementVo populateData(DiagnosisManagementVo voDiagnosisManagement) 
{
    if(voDiagnosisManagement == null)
        voDiagnosisManagement = new ims.RefMan.vo.DiagnosisManagementVo();

    if (form.chkFirstDefinitiveSystem().getValue() &&
            form.dteFirstDefinitiveSystem().getValue() == null) 
    {
        engine.showMessage("If First Definitive Treatment is checked DateTime is mandatory");
        return null;
    }

    voDiagnosisManagement.setID_DiagnosisManagement(null);
    voDiagnosisManagement.setAdviceAndInfoGiven(form.richTextAdviceAndInformationGiven().getValue());
    voDiagnosisManagement.setActionRequiredByGPNotes(form.richTextActionRequiredByGP().getValue());
    voDiagnosisManagement.setInvestigationsAndResults(form.richTextSummaryOfInvestigationsAndResults().getValue());

    if (form.chkFirstDefinitiveSystem().getValue() &&
            form.dteFirstDefinitiveSystem().getValue() != null) 
    {
        voDiagnosisManagement.setFirstDefinitiveTreatmentDate(form.dteFirstDefinitiveSystem().getValue());
    }
    else {
        voDiagnosisManagement.setFirstDefinitiveTreatmentDate(null);
    }

    PatientDiagnosisAtConsultationVoCollection  coll = new PatientDiagnosisAtConsultationVoCollection();
    for(int x = 0; x < this.form.grdDiagnosis().getRows().size(); x++)
    {
        coll.add(form.grdDiagnosis().getRows().get(x).getValue());
    }
    if(coll.size()>0)
        voDiagnosisManagement.setDiagnosis(coll);
    else
        voDiagnosisManagement.setDiagnosis(null);

    PatientProcedureShortVoCollection collProc = new PatientProcedureShortVoCollection();
    for(int x = 0; x < this.form.grdProcedures().getRows().size(); x++)
    {
        collProc.add(form.grdProcedures().getRows().get(x).getValue());
    }
    if(collProc.size()>0)
        voDiagnosisManagement.setProcedures(collProc);
    else
        voDiagnosisManagement.setProcedures(null);


    if(form.GroupAction().getValue().equals(GenForm.GroupActionEnumeration.rdoActionYes))
        voDiagnosisManagement.setActionRequiredByGP(YesNo.YES);
    else
        voDiagnosisManagement.setActionRequiredByGP(YesNo.NO);

    if(form.GroupConsent().getValue().equals(GenForm.GroupConsentEnumeration.rdoConsentYes))
        voDiagnosisManagement.setPatientConsent(YesNo.YES);
    else
        voDiagnosisManagement.setPatientConsent(YesNo.NO);

    voDiagnosisManagement.setCatsReferral(form.getGlobalContext().RefMan.getCatsReferral());
    voDiagnosisManagement.setLastAuthoringHCP(form.ccLastUpdating().getValue());
    voDiagnosisManagement.setRecordingInformation(populateRecordinfInfo());

    return voDiagnosisManagement;
}
项目:openMAXIMS    文件:Logic.java   
private void initialize(Object[] args)
{
    if(args != null && args.length > 0)
    {
        if(args[0] instanceof Boolean)
        {
            form.getLocalContext().setAddedDuringCoding(Boolean.TRUE);
        }
    }

    if(args != null && args.length > 1 && args[1] instanceof Boolean) //WDEV-21039
    {
        form.getLocalContext().setIncludeExcludedKeywords((Boolean) args[1]);   
    }

    initializeCustomControl();

    if (form.getGlobalContext().Core.getPatientDiagnosisAtConsultation()!=null)
    {
        populateScreenFromData( form.getGlobalContext().Core.getPatientDiagnosisAtConsultation());
    }
    else
    {
        AuthoringInformationVo voAuthoringInformation=new AuthoringInformationVo();
        voAuthoringInformation.setAuthoringDateTime(new DateTime());
        if (domain.getHcpLiteUser()!=null)
            voAuthoringInformation.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());
        form.ccAuthoringInfo().setValue(voAuthoringInformation);
    }

    if (form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList()==null)
    {
        PatientDiagnosisAtConsultationVoCollection diagnosisCollection=new PatientDiagnosisAtConsultationVoCollection();
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(diagnosisCollection);
    }

    if (domain.getHcpLiteUser() == null)
    {
        form.chkMain().setEnabled(false);
        form.cmbStatus().setEnabled(false);
        form.qmbDiagnosis().setEnabled(false);
        form.setccAuthoringInfoEnabled(false);

        if (engine.hasRight(AppRight.ALLOW_EDIT_CONSULTATION_DIAGNOSIS))
        {
            form.qmbDiagnosis().setEnabled(false);
        }
    }

    if (form.getGlobalContext().Clinical.getDisableMainCheckboxIsNotNull() && form.getGlobalContext().Clinical.getDisableMainCheckbox())
    {
        form.chkMain().setEnabled(false);
    }

    //WDEV-19454
    form.chkSpecialtyHotlist().setVisible(!ConfigFlag.UI.SHOW_DIAGNOSES_DATABASE.getValue());
    form.GroupSelection().setVisible(ConfigFlag.UI.SHOW_DIAGNOSES_DATABASE.getValue());
    form.getLocalContext().setSearchBySpecialtyHotlist(true);
    if (ConfigFlag.UI.SHOW_DIAGNOSES_DATABASE.getValue())
    {
        form.GroupSelection().setValue(GroupSelectionEnumeration.rdoDiagSpec);//WDEV-19056
    }
    else
    {
        form.chkSpecialtyHotlist().setValue(true);
    }

    form.qmbDiagnosis().enableLiveSearch(ConfigFlag.UI.DIAGNOSIS_SEARCHING_MECHANISM.getValue().equals("Live")); //WDEV-22287

}
项目:openMAXIMS    文件:Logic.java   
private DiagnosisManagementVo populateData(DiagnosisManagementVo voDiagnosisManagement) 
{
    if(voDiagnosisManagement == null)
        voDiagnosisManagement = new ims.RefMan.vo.DiagnosisManagementVo();

    if (form.chkFirstDefinitiveSystem().getValue() &&
            form.dteFirstDefinitiveSystem().getValue() == null) 
    {
        engine.showMessage("If First Definitive Treatment is checked DateTime is mandatory");
        return null;
    }

    voDiagnosisManagement.setID_DiagnosisManagement(null);
    voDiagnosisManagement.setAdviceAndInfoGiven(form.richTextAdviceAndInformationGiven().getValue());
    voDiagnosisManagement.setActionRequiredByGPNotes(form.richTextActionRequiredByGP().getValue());
    voDiagnosisManagement.setInvestigationsAndResults(form.richTextSummaryOfInvestigationsAndResults().getValue());

    if (form.chkFirstDefinitiveSystem().getValue() &&
            form.dteFirstDefinitiveSystem().getValue() != null) 
    {
        voDiagnosisManagement.setFirstDefinitiveTreatmentDate(form.dteFirstDefinitiveSystem().getValue());
    }
    else {
        voDiagnosisManagement.setFirstDefinitiveTreatmentDate(null);
    }

    PatientDiagnosisAtConsultationVoCollection  coll = new PatientDiagnosisAtConsultationVoCollection();
    for(int x = 0; x < this.form.grdDiagnosis().getRows().size(); x++)
    {
        coll.add(form.grdDiagnosis().getRows().get(x).getValue());
    }
    if(coll.size()>0)
        voDiagnosisManagement.setDiagnosis(coll);
    else
        voDiagnosisManagement.setDiagnosis(null);

    PatientProcedureShortVoCollection collProc = new PatientProcedureShortVoCollection();
    for(int x = 0; x < this.form.grdProcedures().getRows().size(); x++)
    {
        collProc.add(form.grdProcedures().getRows().get(x).getValue());
    }
    if(collProc.size()>0)
        voDiagnosisManagement.setProcedures(collProc);
    else
        voDiagnosisManagement.setProcedures(null);


    if(form.GroupAction().getValue().equals(GenForm.GroupActionEnumeration.rdoActionYes))
        voDiagnosisManagement.setActionRequiredByGP(YesNo.YES);
    else
        voDiagnosisManagement.setActionRequiredByGP(YesNo.NO);

    if(form.GroupConsent().getValue().equals(GenForm.GroupConsentEnumeration.rdoConsentYes))
        voDiagnosisManagement.setPatientConsent(YesNo.YES);
    else
        voDiagnosisManagement.setPatientConsent(YesNo.NO);

    voDiagnosisManagement.setCatsReferral(form.getGlobalContext().RefMan.getCatsReferral());
    voDiagnosisManagement.setLastAuthoringHCP(form.ccLastUpdating().getValue());
    voDiagnosisManagement.setRecordingInformation(populateRecordinfInfo());

    return voDiagnosisManagement;
}
项目:openMAXIMS    文件:Logic.java   
private void initialize(Object[] args)
{
    if(args != null && args.length > 0)
    {
        if(args[0] instanceof Boolean)
        {
            form.getLocalContext().setAddedDuringCoding(Boolean.TRUE);
        }
    }

    initializeCustomControl();

    if (form.getGlobalContext().Core.getPatientDiagnosisAtConsultation()!=null)
    {
        populateScreenFromData( form.getGlobalContext().Core.getPatientDiagnosisAtConsultation());
    }
    else
    {
        AuthoringInformationVo voAuthoringInformation=new AuthoringInformationVo();
        voAuthoringInformation.setAuthoringDateTime(new DateTime());
        if (domain.getHcpLiteUser()!=null)
            voAuthoringInformation.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());
        form.ccAuthoringInfo().setValue(voAuthoringInformation);
    }

    if (form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList()==null)
    {
        PatientDiagnosisAtConsultationVoCollection diagnosisCollection=new PatientDiagnosisAtConsultationVoCollection();
        form.getGlobalContext().Core.setPatientDiagnosisAtConsultationList(diagnosisCollection);
    }

    if (domain.getHcpLiteUser() == null)
    {
        form.chkMain().setEnabled(false);
        form.cmbStatus().setEnabled(false);
        form.qmbDiagnosis().setEnabled(false);
        form.setccAuthoringInfoEnabled(false);

        if (engine.hasRight(AppRight.ALLOW_EDIT_CONSULTATION_DIAGNOSIS))
        {
            form.qmbDiagnosis().setEnabled(false);
        }
    }

    if (form.getGlobalContext().Clinical.getDisableMainCheckboxIsNotNull() && form.getGlobalContext().Clinical.getDisableMainCheckbox())
    {
        form.chkMain().setEnabled(false);
    }
}