Java 类ims.clinical.vo.lookups.ClinicalCorrespondenceType 实例源码

项目:AvoinApotti    文件:Logic.java   
private void displayCorrespondance(ClinicalCorrespondenceLiteVoCollection collection)
{
    formatGrid();

    form.dyngrdCorrespondence().getRows().clear();

    for (int i = 0; collection != null && i < collection.size(); i++)
    {
        ClinicalCorrespondenceLiteVo voCCLite = collection.get(i);

        DynamicGridRow row = form.dyngrdCorrespondence().getRows().newRow();

        DynamicGridCell cellAuthorDate = row.getCells().newCell(getColByIdentifier(COL_AUTH_DATE), DynamicCellType.LABEL);
        cellAuthorDate.setValue(voCCLite.getAuthoringInformation().getAuthoringDateTimeIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringDateTime().toString() : "");
        cellAuthorDate.setIdentifier(COL_AUTH_DATE);
        cellAuthorDate.setWidth(130);

        DynamicGridCell cellAuthorHCP = row.getCells().newCell(getColByIdentifier(COL_AUTH_HCP), DynamicCellType.LABEL);
        cellAuthorHCP.setValue(voCCLite.getAuthoringInformation().getAuthoringHcpIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringHcp().toString() : "");
        cellAuthorHCP.setIdentifier(COL_AUTH_HCP);
        cellAuthorHCP.setWidth(140);

        DynamicGridCell cellPatName = row.getCells().newCell(getColByIdentifier(COL_PAT_NAME), DynamicCellType.LABEL);

        PatientShort patient = null;
        if(voCCLite.getCareContextIsNotNull() && voCCLite.getCareContext().getEpisodeOfCareIsNotNull() && voCCLite.getCareContext().getEpisodeOfCare().getCareSpellIsNotNull())
            patient = voCCLite.getCareContext().getEpisodeOfCare().getCareSpell().getPatient();
        cellPatName.setValue(patient != null? patient.getName().toShortForm() : "");
        cellPatName.setIdentifier(COL_PAT_NAME);
        cellPatName.setWidth(140);

        DynamicGridCell cellPatNumber = row.getCells().newCell(getColByIdentifier(COL_PAT_NUM), DynamicCellType.LABEL);
        cellPatNumber.setValue(patient != null && patient.getDisplayId() != null? patient.getDisplayId().getValue() : "");
        cellPatNumber.setIdentifier(COL_PAT_NUM);
        cellPatNumber.setWidth(70);

        if (form.cmbStatus().getValue() == null)
        {
            DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(COL_STATUS), DynamicCellType.LABEL);
            cellStatus.setValue(voCCLite.getCurrentStatusIsNotNull() ? voCCLite.getCurrentStatus().getCorrespondenceStatus().toString() : "");
            cellStatus.setIdentifier(COL_STATUS);
            cellStatus.setWidth(100);
        }

        DynamicGridCell cellRespHCP = row.getCells().newCell(getColByIdentifier(COL_RESP_HCP), DynamicCellType.LABEL);
        cellRespHCP.setValue(voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCPIsNotNull() ? voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCP().toString() : "");
        cellRespHCP.setIdentifier(COL_RESP_HCP);
        cellRespHCP.setWidth(140);

        DynamicGridCell cellNote = row.getCells().newCell(getColByIdentifier(COL_NOTE), DynamicCellType.HTMLVIEW);

        if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE) )
        {
            if (voCCLite.getInpatientDischargeSummaryIsNotNull())
                cellNote.setValue(voCCLite.getInpatientDischargeSummary().getClinicalNoteIsNotNull() ? voCCLite.getInpatientDischargeSummary().getClinicalNote().getClinicalNote().toString() : "");
        }
        else if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER) )
        {
            if (voCCLite.getOPDNotesIsNotNull())
                cellNote.setValue(voCCLite.getOPDNotes().getClinicalNoteIsNotNull() ? voCCLite.getOPDNotes().getClinicalNote().getClinicalNote().getClinicalNote().toString() : "");
        }

        cellNote.setIdentifier(COL_NOTE);
        cellNote.setWidth(-1);

        row.setValue(voCCLite);
    }
}
项目:AvoinApotti    文件:Logic.java   
private boolean verifyStatusHistory()
{
    if (form.lyrDetails().tabRecipents().cmbStatus().getValue() != null)
    {
        if (form.lyrDetails().tabRecipents().cmbStatus().getValue().equals(CorrespondenceStatus.VERIFIED))
        {

            ClinicalCorrespondenceVo voClinicalCorrespondence = null;

            CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();

            if(ContextType.OUTPATIENT.equals(careContext.getContext()))
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }
            else
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }

            if (voClinicalCorrespondence != null &&
                    voClinicalCorrespondence.getStatusHistoryIsNotNull())
            {
                for (int i = 0; i < voClinicalCorrespondence.getStatusHistory().size(); i++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        if (voClinicalCorrespondence.getVerifyingHCPIsNotNull() &&
                                voClinicalCorrespondence.getVerifyingDateTimeIsNotNull())
                        {
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().newRow(voClinicalCorrespondence.getVerifyingHCP(), voClinicalCorrespondence.getVerifyingHCP().toString());
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().setValue(voClinicalCorrespondence.getVerifyingHCP());
                            form.lyrDetails().tabRecipents().dtimVerifying().setValue(voClinicalCorrespondence.getVerifyingDateTime());
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
项目:AvoinApotti    文件:Logic.java   
private void open()
{
    clearScreen();
    setCurrentClinicalNote();

    ClinicalCorrespondenceVo voClinicalCorrespondence = null;

    /*
    if(form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull() && 
            form.getGlobalContext().Clinical.getReturnToFormName().equals(form.getForms().Clinical.OutPatientsTreatmentPlan))
            */
    CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
    if(ContextType.OUTPATIENT.equals(careContext.getContext()))
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
        (null, 
            ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                form.getGlobalContext().Core.getCurrentClinicalContact());
    }
    else
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
            (form.getGlobalContext().Core.getCurrentCareContext(), 
                ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                    null);
    }

    form.getLocalContext().setSelectedItem(voClinicalCorrespondence);
    //WDEV-2536
    setTooltip(voClinicalCorrespondence);

        verifyStatusHistory();

    form.setMode(FormMode.VIEW);

    if(voClinicalCorrespondence == null)
    {
        form.btnNew().setVisible(true);
        form.btnUpdate().setVisible(false);
        form.getLocalContext().setOutpatientSummaryChanged(Boolean.TRUE);
    }
    else
    {
        form.btnNew().setVisible(false);
        form.btnUpdate().setVisible(true);

        displayRecord(voClinicalCorrespondence);
        form.getLocalContext().setReportChanged(Boolean.TRUE);

    }

    updateContextMenu();
}
项目:AvoinApotti    文件:DocumentGenerationImpl.java   
/**
* getLastClinicalCorrespondence
*/
public ClinicalCorrespondenceVo getLastClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    /*
    if(careContext == null)
        throw new CodingRuntimeException("null careContext passed to getLastClinicalCorrespondence() !");
    */
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return null;

    ClinicalCorrespondenceVo voClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.create((ClinicalCorrespondence)list.get(0));

    if (type.equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER))
    {
        if(voClinicalCorrespondence.getOPDNotes() == null && clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
            voClinicalCorrespondence.setOPDNotes(getOPDSummary(clinicalContact));
    }

    return voClinicalCorrespondence;
}
项目:AvoinApotti    文件:DocumentGenerationImpl.java   
public Integer countClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("select count(*) from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return 0;

    if(list.get(0) instanceof Integer)
        return (Integer) list.get(0);
    else if(list.get(0) instanceof Long)
        return new Integer(((Long) list.get(0)).intValue());

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void displayCorrespondance(ClinicalCorrespondenceLiteVoCollection collection)
{
    formatGrid();

    form.dyngrdCorrespondence().getRows().clear();

    for (int i = 0; collection != null && i < collection.size(); i++)
    {
        ClinicalCorrespondenceLiteVo voCCLite = collection.get(i);

        DynamicGridRow row = form.dyngrdCorrespondence().getRows().newRow();

        DynamicGridCell cellAuthorDate = row.getCells().newCell(getColByIdentifier(COL_AUTH_DATE), DynamicCellType.LABEL);
        cellAuthorDate.setValue(voCCLite.getAuthoringInformation().getAuthoringDateTimeIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringDateTime().toString() : "");
        cellAuthorDate.setIdentifier(COL_AUTH_DATE);
        cellAuthorDate.setWidth(130);

        DynamicGridCell cellAuthorHCP = row.getCells().newCell(getColByIdentifier(COL_AUTH_HCP), DynamicCellType.LABEL);
        cellAuthorHCP.setValue(voCCLite.getAuthoringInformation().getAuthoringHcpIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringHcp().toString() : "");
        cellAuthorHCP.setIdentifier(COL_AUTH_HCP);
        cellAuthorHCP.setWidth(140);

        DynamicGridCell cellPatName = row.getCells().newCell(getColByIdentifier(COL_PAT_NAME), DynamicCellType.LABEL);

        PatientShort patient = null;
        if(voCCLite.getCareContextIsNotNull() && voCCLite.getCareContext().getEpisodeOfCareIsNotNull() && voCCLite.getCareContext().getEpisodeOfCare().getCareSpellIsNotNull())
            patient = voCCLite.getCareContext().getEpisodeOfCare().getCareSpell().getPatient();
        cellPatName.setValue(patient != null? patient.getName().toShortForm() : "");
        cellPatName.setIdentifier(COL_PAT_NAME);
        cellPatName.setWidth(140);

        DynamicGridCell cellPatNumber = row.getCells().newCell(getColByIdentifier(COL_PAT_NUM), DynamicCellType.LABEL);
        cellPatNumber.setValue(patient != null && patient.getDisplayId() != null? patient.getDisplayId().getValue() : "");
        cellPatNumber.setIdentifier(COL_PAT_NUM);
        cellPatNumber.setWidth(70);

        if (form.cmbStatus().getValue() == null)
        {
            DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(COL_STATUS), DynamicCellType.LABEL);
            cellStatus.setValue(voCCLite.getCurrentStatusIsNotNull() ? voCCLite.getCurrentStatus().getCorrespondenceStatus().toString() : "");
            cellStatus.setIdentifier(COL_STATUS);
            cellStatus.setWidth(100);
        }

        DynamicGridCell cellRespHCP = row.getCells().newCell(getColByIdentifier(COL_RESP_HCP), DynamicCellType.LABEL);
        cellRespHCP.setValue(voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCPIsNotNull() ? voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCP().toString() : "");
        cellRespHCP.setIdentifier(COL_RESP_HCP);
        cellRespHCP.setWidth(140);

        DynamicGridCell cellNote = row.getCells().newCell(getColByIdentifier(COL_NOTE), DynamicCellType.HTMLVIEW);

        if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE) )
        {
            if (voCCLite.getInpatientDischargeSummaryIsNotNull())
                cellNote.setValue(voCCLite.getInpatientDischargeSummary().getClinicalNoteIsNotNull() ? voCCLite.getInpatientDischargeSummary().getClinicalNote().getClinicalNote().toString() : "");
        }
        else if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER) )
        {
            if (voCCLite.getOPDNotesIsNotNull())
                cellNote.setValue(voCCLite.getOPDNotes().getClinicalNoteIsNotNull() ? voCCLite.getOPDNotes().getClinicalNote().getClinicalNote().getClinicalNote().toString() : "");
        }

        cellNote.setIdentifier(COL_NOTE);
        cellNote.setWidth(-1);

        row.setValue(voCCLite);
    }
}
项目:openMAXIMS    文件:Logic.java   
private boolean verifyStatusHistory()
{
    if (form.lyrDetails().tabRecipents().cmbStatus().getValue() != null)
    {
        if (form.lyrDetails().tabRecipents().cmbStatus().getValue().equals(CorrespondenceStatus.VERIFIED))
        {

            ClinicalCorrespondenceVo voClinicalCorrespondence = null;

            CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();

            if(ContextType.OUTPATIENT.equals(careContext.getContext()))
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }
            else
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }

            if (voClinicalCorrespondence != null &&
                    voClinicalCorrespondence.getStatusHistoryIsNotNull())
            {
                for (int i = 0; i < voClinicalCorrespondence.getStatusHistory().size(); i++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        if (voClinicalCorrespondence.getVerifyingHCPIsNotNull() &&
                                voClinicalCorrespondence.getVerifyingDateTimeIsNotNull())
                        {
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().newRow(voClinicalCorrespondence.getVerifyingHCP(), voClinicalCorrespondence.getVerifyingHCP().toString());
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().setValue(voClinicalCorrespondence.getVerifyingHCP());
                            form.lyrDetails().tabRecipents().dtimVerifying().setValue(voClinicalCorrespondence.getVerifyingDateTime());
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
项目:openMAXIMS    文件:Logic.java   
private void open()
{
    clearScreen();
    setCurrentClinicalNote();

    ClinicalCorrespondenceVo voClinicalCorrespondence = null;

    /*
    if(form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull() && 
            form.getGlobalContext().Clinical.getReturnToFormName().equals(form.getForms().Clinical.OutPatientsTreatmentPlan))
            */
    CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
    if(ContextType.OUTPATIENT.equals(careContext.getContext()))
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
        (null, 
            ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                form.getGlobalContext().Core.getCurrentClinicalContact());
    }
    else
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
            (form.getGlobalContext().Core.getCurrentCareContext(), 
                ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                    null);
    }

    form.getLocalContext().setSelectedItem(voClinicalCorrespondence);
    //WDEV-2536
    setTooltip(voClinicalCorrespondence);

        verifyStatusHistory();

    form.setMode(FormMode.VIEW);

    if(voClinicalCorrespondence == null)
    {
        form.btnNew().setVisible(true);
        form.btnUpdate().setVisible(false);
        form.getLocalContext().setOutpatientSummaryChanged(Boolean.TRUE);
    }
    else
    {
        form.btnNew().setVisible(false);
        form.btnUpdate().setVisible(true);

        displayRecord(voClinicalCorrespondence);
        form.getLocalContext().setReportChanged(Boolean.TRUE);

    }

    updateContextMenu();
}
项目:openMAXIMS    文件:DocumentGenerationImpl.java   
/**
* getLastClinicalCorrespondence
*/
public ClinicalCorrespondenceVo getLastClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    /*
    if(careContext == null)
        throw new CodingRuntimeException("null careContext passed to getLastClinicalCorrespondence() !");
    */
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return null;

    ClinicalCorrespondenceVo voClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.create((ClinicalCorrespondence)list.get(0));

    if (type.equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER))
    {
        if(voClinicalCorrespondence.getOPDNotes() == null && clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
            voClinicalCorrespondence.setOPDNotes(getOPDSummary(clinicalContact));
    }

    return voClinicalCorrespondence;
}
项目:openMAXIMS    文件:DocumentGenerationImpl.java   
public Integer countClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("select count(*) from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return 0;

    if(list.get(0) instanceof Integer)
        return (Integer) list.get(0);
    else if(list.get(0) instanceof Long)
        return new Integer(((Long) list.get(0)).intValue());

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void displayCorrespondance(ClinicalCorrespondenceLiteVoCollection collection)
{
    formatGrid();

    form.dyngrdCorrespondence().getRows().clear();

    for (int i = 0; collection != null && i < collection.size(); i++)
    {
        ClinicalCorrespondenceLiteVo voCCLite = collection.get(i);

        DynamicGridRow row = form.dyngrdCorrespondence().getRows().newRow();

        DynamicGridCell cellAuthorDate = row.getCells().newCell(getColByIdentifier(COL_AUTH_DATE), DynamicCellType.LABEL);
        cellAuthorDate.setValue(voCCLite.getAuthoringInformation().getAuthoringDateTimeIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringDateTime().toString() : "");
        cellAuthorDate.setIdentifier(COL_AUTH_DATE);
        cellAuthorDate.setWidth(130);

        DynamicGridCell cellAuthorHCP = row.getCells().newCell(getColByIdentifier(COL_AUTH_HCP), DynamicCellType.LABEL);
        cellAuthorHCP.setValue(voCCLite.getAuthoringInformation().getAuthoringHcpIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringHcp().toString() : "");
        cellAuthorHCP.setIdentifier(COL_AUTH_HCP);
        cellAuthorHCP.setWidth(140);

        DynamicGridCell cellPatName = row.getCells().newCell(getColByIdentifier(COL_PAT_NAME), DynamicCellType.LABEL);

        PatientShort patient = null;
        if(voCCLite.getCareContextIsNotNull() && voCCLite.getCareContext().getEpisodeOfCareIsNotNull() && voCCLite.getCareContext().getEpisodeOfCare().getCareSpellIsNotNull())
            patient = voCCLite.getCareContext().getEpisodeOfCare().getCareSpell().getPatient();
        cellPatName.setValue(patient != null? patient.getName().toShortForm() : "");
        cellPatName.setIdentifier(COL_PAT_NAME);
        cellPatName.setWidth(140);

        DynamicGridCell cellPatNumber = row.getCells().newCell(getColByIdentifier(COL_PAT_NUM), DynamicCellType.LABEL);
        cellPatNumber.setValue(patient != null && patient.getDisplayId() != null? patient.getDisplayId().getValue() : "");
        cellPatNumber.setIdentifier(COL_PAT_NUM);
        cellPatNumber.setWidth(70);

        if (form.cmbStatus().getValue() == null)
        {
            DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(COL_STATUS), DynamicCellType.LABEL);
            cellStatus.setValue(voCCLite.getCurrentStatusIsNotNull() ? voCCLite.getCurrentStatus().getCorrespondenceStatus().toString() : "");
            cellStatus.setIdentifier(COL_STATUS);
            cellStatus.setWidth(100);
        }

        DynamicGridCell cellRespHCP = row.getCells().newCell(getColByIdentifier(COL_RESP_HCP), DynamicCellType.LABEL);
        cellRespHCP.setValue(voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCPIsNotNull() ? voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCP().toString() : "");
        cellRespHCP.setIdentifier(COL_RESP_HCP);
        cellRespHCP.setWidth(140);

        DynamicGridCell cellNote = row.getCells().newCell(getColByIdentifier(COL_NOTE), DynamicCellType.HTMLVIEW);

        if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE) )
        {
            if (voCCLite.getInpatientDischargeSummaryIsNotNull())
                cellNote.setValue(voCCLite.getInpatientDischargeSummary().getClinicalNoteIsNotNull() ? voCCLite.getInpatientDischargeSummary().getClinicalNote().getClinicalNote().toString() : "");
        }
        else if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER) )
        {
            if (voCCLite.getOPDNotesIsNotNull())
                cellNote.setValue(voCCLite.getOPDNotes().getClinicalNoteIsNotNull() ? voCCLite.getOPDNotes().getClinicalNote().getClinicalNote().getClinicalNote().toString() : "");
        }

        cellNote.setIdentifier(COL_NOTE);
        cellNote.setWidth(-1);

        row.setValue(voCCLite);
    }
}
项目:openMAXIMS    文件:Logic.java   
private boolean verifyStatusHistory()
{
    if (form.lyrDetails().tabRecipents().cmbStatus().getValue() != null)
    {
        if (form.lyrDetails().tabRecipents().cmbStatus().getValue().equals(CorrespondenceStatus.VERIFIED))
        {

            ClinicalCorrespondenceVo voClinicalCorrespondence = null;

            CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();

            if(ContextType.OUTPATIENT.equals(careContext.getContext()))
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }
            else
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }

            if (voClinicalCorrespondence != null &&
                    voClinicalCorrespondence.getStatusHistoryIsNotNull())
            {
                for (int i = 0; i < voClinicalCorrespondence.getStatusHistory().size(); i++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        if (voClinicalCorrespondence.getVerifyingHCPIsNotNull() &&
                                voClinicalCorrespondence.getVerifyingDateTimeIsNotNull())
                        {
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().newRow(voClinicalCorrespondence.getVerifyingHCP(), voClinicalCorrespondence.getVerifyingHCP().toString());
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().setValue(voClinicalCorrespondence.getVerifyingHCP());
                            form.lyrDetails().tabRecipents().dtimVerifying().setValue(voClinicalCorrespondence.getVerifyingDateTime());
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
项目:openMAXIMS    文件:Logic.java   
private void open()
{
    clearScreen();
    setCurrentClinicalNote();

    ClinicalCorrespondenceVo voClinicalCorrespondence = null;

    /*
    if(form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull() && 
            form.getGlobalContext().Clinical.getReturnToFormName().equals(form.getForms().Clinical.OutPatientsTreatmentPlan))
            */
    CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
    if(ContextType.OUTPATIENT.equals(careContext.getContext()))
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
        (null, 
            ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                form.getGlobalContext().Core.getCurrentClinicalContact());
    }
    else
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
            (form.getGlobalContext().Core.getCurrentCareContext(), 
                ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                    null);
    }

    form.getLocalContext().setSelectedItem(voClinicalCorrespondence);
    //WDEV-2536
    setTooltip(voClinicalCorrespondence);

        verifyStatusHistory();

    form.setMode(FormMode.VIEW);

    if(voClinicalCorrespondence == null)
    {
        form.btnNew().setVisible(true);
        form.btnUpdate().setVisible(false);
        form.getLocalContext().setOutpatientSummaryChanged(Boolean.TRUE);
    }
    else
    {
        form.btnNew().setVisible(false);
        form.btnUpdate().setVisible(true);

        displayRecord(voClinicalCorrespondence);
        form.getLocalContext().setReportChanged(Boolean.TRUE);

    }

    updateContextMenu();
}
项目:openMAXIMS    文件:DocumentGenerationImpl.java   
/**
* getLastClinicalCorrespondence
*/
public ClinicalCorrespondenceVo getLastClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    /*
    if(careContext == null)
        throw new CodingRuntimeException("null careContext passed to getLastClinicalCorrespondence() !");
    */
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return null;

    ClinicalCorrespondenceVo voClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.create((ClinicalCorrespondence)list.get(0));

    if (type.equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER))
    {
        if(voClinicalCorrespondence.getOPDNotes() == null && clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
            voClinicalCorrespondence.setOPDNotes(getOPDSummary(clinicalContact));
    }

    return voClinicalCorrespondence;
}
项目:openMAXIMS    文件:DocumentGenerationImpl.java   
public Integer countClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("select count(*) from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return 0;

    if(list.get(0) instanceof Integer)
        return (Integer) list.get(0);
    else if(list.get(0) instanceof Long)
        return new Integer(((Long) list.get(0)).intValue());

    return null;
}
项目:openmaxims-linux    文件:Logic.java   
private void displayCorrespondance(ClinicalCorrespondenceLiteVoCollection collection)
{
    formatGrid();

    form.dyngrdCorrespondence().getRows().clear();

    for (int i = 0; collection != null && i < collection.size(); i++)
    {
        ClinicalCorrespondenceLiteVo voCCLite = collection.get(i);

        DynamicGridRow row = form.dyngrdCorrespondence().getRows().newRow();

        DynamicGridCell cellAuthorDate = row.getCells().newCell(getColByIdentifier(COL_AUTH_DATE), DynamicCellType.LABEL);
        cellAuthorDate.setValue(voCCLite.getAuthoringInformation().getAuthoringDateTimeIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringDateTime().toString() : "");
        cellAuthorDate.setIdentifier(COL_AUTH_DATE);
        cellAuthorDate.setWidth(130);

        DynamicGridCell cellAuthorHCP = row.getCells().newCell(getColByIdentifier(COL_AUTH_HCP), DynamicCellType.LABEL);
        cellAuthorHCP.setValue(voCCLite.getAuthoringInformation().getAuthoringHcpIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringHcp().toString() : "");
        cellAuthorHCP.setIdentifier(COL_AUTH_HCP);
        cellAuthorHCP.setWidth(140);

        DynamicGridCell cellPatName = row.getCells().newCell(getColByIdentifier(COL_PAT_NAME), DynamicCellType.LABEL);

        PatientShort patient = null;
        if(voCCLite.getCareContextIsNotNull() && voCCLite.getCareContext().getEpisodeOfCareIsNotNull() && voCCLite.getCareContext().getEpisodeOfCare().getCareSpellIsNotNull())
            patient = voCCLite.getCareContext().getEpisodeOfCare().getCareSpell().getPatient();
        cellPatName.setValue(patient != null? patient.getName().toShortForm() : "");
        cellPatName.setIdentifier(COL_PAT_NAME);
        cellPatName.setWidth(140);

        DynamicGridCell cellPatNumber = row.getCells().newCell(getColByIdentifier(COL_PAT_NUM), DynamicCellType.LABEL);
        cellPatNumber.setValue(patient != null && patient.getDisplayId() != null? patient.getDisplayId().getValue() : "");
        cellPatNumber.setIdentifier(COL_PAT_NUM);
        cellPatNumber.setWidth(70);

        if (form.cmbStatus().getValue() == null)
        {
            DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(COL_STATUS), DynamicCellType.LABEL);
            cellStatus.setValue(voCCLite.getCurrentStatusIsNotNull() ? voCCLite.getCurrentStatus().getCorrespondenceStatus().toString() : "");
            cellStatus.setIdentifier(COL_STATUS);
            cellStatus.setWidth(100);
        }

        DynamicGridCell cellRespHCP = row.getCells().newCell(getColByIdentifier(COL_RESP_HCP), DynamicCellType.LABEL);
        cellRespHCP.setValue(voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCPIsNotNull() ? voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCP().toString() : "");
        cellRespHCP.setIdentifier(COL_RESP_HCP);
        cellRespHCP.setWidth(140);

        DynamicGridCell cellNote = row.getCells().newCell(getColByIdentifier(COL_NOTE), DynamicCellType.HTMLVIEW);

        if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE) )
        {
            if (voCCLite.getInpatientDischargeSummaryIsNotNull())
                cellNote.setValue(voCCLite.getInpatientDischargeSummary().getClinicalNoteIsNotNull() ? voCCLite.getInpatientDischargeSummary().getClinicalNote().getClinicalNote().toString() : "");
        }
        else if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER) )
        {
            if (voCCLite.getOPDNotesIsNotNull())
                cellNote.setValue(voCCLite.getOPDNotes().getClinicalNoteIsNotNull() ? voCCLite.getOPDNotes().getClinicalNote().getClinicalNote().getClinicalNote().toString() : "");
        }

        cellNote.setIdentifier(COL_NOTE);
        cellNote.setWidth(-1);

        row.setValue(voCCLite);
    }
}
项目:openmaxims-linux    文件:Logic.java   
private boolean verifyStatusHistory()
{
    if (form.lyrDetails().tabRecipents().cmbStatus().getValue() != null)
    {
        if (form.lyrDetails().tabRecipents().cmbStatus().getValue().equals(CorrespondenceStatus.VERIFIED))
        {

            ClinicalCorrespondenceVo voClinicalCorrespondence = null;

            CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();

            if(ContextType.OUTPATIENT.equals(careContext.getContext()))
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }
            else
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }

            if (voClinicalCorrespondence != null &&
                    voClinicalCorrespondence.getStatusHistoryIsNotNull())
            {
                for (int i = 0; i < voClinicalCorrespondence.getStatusHistory().size(); i++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        if (voClinicalCorrespondence.getVerifyingHCPIsNotNull() &&
                                voClinicalCorrespondence.getVerifyingDateTimeIsNotNull())
                        {
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().newRow(voClinicalCorrespondence.getVerifyingHCP(), voClinicalCorrespondence.getVerifyingHCP().toString());
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().setValue(voClinicalCorrespondence.getVerifyingHCP());
                            form.lyrDetails().tabRecipents().dtimVerifying().setValue(voClinicalCorrespondence.getVerifyingDateTime());
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
项目:openmaxims-linux    文件:Logic.java   
private void open()
{
    clearScreen();
    setCurrentClinicalNote();

    ClinicalCorrespondenceVo voClinicalCorrespondence = null;

    /*
    if(form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull() && 
            form.getGlobalContext().Clinical.getReturnToFormName().equals(form.getForms().Clinical.OutPatientsTreatmentPlan))
            */
    CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
    if(ContextType.OUTPATIENT.equals(careContext.getContext()))
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
        (null, 
            ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                form.getGlobalContext().Core.getCurrentClinicalContact());
    }
    else
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
            (form.getGlobalContext().Core.getCurrentCareContext(), 
                ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                    null);
    }

    form.getLocalContext().setSelectedItem(voClinicalCorrespondence);
    //WDEV-2536
    setTooltip(voClinicalCorrespondence);

        verifyStatusHistory();

    form.setMode(FormMode.VIEW);

    if(voClinicalCorrespondence == null)
    {
        form.btnNew().setVisible(true);
        form.btnUpdate().setVisible(false);
        form.getLocalContext().setOutpatientSummaryChanged(Boolean.TRUE);
    }
    else
    {
        form.btnNew().setVisible(false);
        form.btnUpdate().setVisible(true);

        displayRecord(voClinicalCorrespondence);
        form.getLocalContext().setReportChanged(Boolean.TRUE);

    }

    updateContextMenu();
}
项目:openmaxims-linux    文件:DocumentGenerationImpl.java   
/**
* getLastClinicalCorrespondence
*/
public ClinicalCorrespondenceVo getLastClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    /*
    if(careContext == null)
        throw new CodingRuntimeException("null careContext passed to getLastClinicalCorrespondence() !");
    */
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return null;

    ClinicalCorrespondenceVo voClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.create((ClinicalCorrespondence)list.get(0));

    if (type.equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER))
    {
        if(voClinicalCorrespondence.getOPDNotes() == null && clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
            voClinicalCorrespondence.setOPDNotes(getOPDSummary(clinicalContact));
    }

    return voClinicalCorrespondence;
}
项目:openmaxims-linux    文件:DocumentGenerationImpl.java   
public Integer countClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("select count(*) from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return 0;

    if(list.get(0) instanceof Integer)
        return (Integer) list.get(0);
    else if(list.get(0) instanceof Long)
        return new Integer(((Long) list.get(0)).intValue());

    return null;
}