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

项目:AvoinApotti    文件:Logic.java   
@Override
protected void onGrdContactsGridHeaderClicked(int column) throws PresentationLogicException
{
    if (DATE_TIME_COL_INDEX == column)
    {
        ClinicalNotesVo selectedValue = form.grdContacts().getValue();
        ClinicalNotesVoCollection data = new ClinicalNotesVoCollection();

        for (int i = 0 ; i < form.grdContacts().getRows().size() ; i ++)
        {
            data.add(form.grdContacts().getRows().get(i).getValue());
        }
        form.getLocalContext().setDateTimeSortOrder(getNextOrder(form.getLocalContext().getDateTimeSortOrder()));
        data.sort(new DateTimeClinicalNotesComparator(form.getLocalContext().getDateTimeSortOrder()));
        form.grdContacts().getRows().clear();           
        populateGridFromData(data);
        form.grdContacts().setValue(selectedValue);
        if (form.grdContacts().getValue()!= null)
            onGrdContactsSelectionChanged();

    }

}
项目:AvoinApotti    文件:Logic.java   
private void selectClinicalNoteInGlobalContext()
{

    ClinicalNotesVo clinicalNotesVoForContact = null;

    try
    {
        clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.dyngrdList().getSelectedRow().getValue());
    }
    catch (RuntimeException e)
    {
        engine.showMessage(e.getMessage());
    }

    ClinicalNotesShortVo clinicalNotesForContact = null;

    if (clinicalNotesVoForContact != null)
        clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
    form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);

    if (clinicalNotesVoForContact != null)
        form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
    else
        form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
项目:AvoinApotti    文件:Logic.java   
private void populateScreenControls(ClinicalNotesVo voNote) throws FormOpenException 
{
    if (voNote.getIsDerivedNoteIsNotNull() 
        && voNote.getIsDerivedNote().booleanValue())
        throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");

    form.getLocalContext().setclinicalNotesVo(voNote);

    settingCustomAuthoring(voNote);

    form.cmbNoteType().setValue(voNote.getNoteClassification());
    form.richNotes().setValue(voNote.getClinicalNote());

    form.txtDiscipline().setValue(voNote.getDisciplineIsNotNull() ? voNote.getDiscipline().getText() : "");//wdev-8976

    if (voNote.getIsCorrectedIsNotNull()
        && voNote.getIsCorrected())
    {
        form.lblCorrect().setVisible(true);
        form.txtCorrectionReason().setVisible(true);
        form.txtCorrectionReason().setEnabled(form.getMode().equals(FormMode.EDIT));

        form.txtCorrectionReason().setValue(voNote.getCurrentStatusIsNotNull() ? voNote.getCurrentStatus().getCorrectionReason() : "");
    }
}
项目:AvoinApotti    文件:Logic.java   
public void open() throws ims.framework.exceptions.PresentationLogicException
{
    clearControls();

    setCurrentClinicalNote();

    if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
    {
        //WDEV-1037 - Notes created on this form need to have notetype set to SUMMARYATADMISSION( -882) and have discipline set to MEDICAL ( -59) 
        form.getLocalContext().setSelectedRecord(domain.get(null, ClinicalNoteType.SUMMARYATADMISSION, HcpDisType.MEDICAL ,form.getGlobalContext().Core.getCurrentCareContext()));
        if (form.getLocalContext().getSelectedRecordIsNotNull())
        {
            ClinicalNotesVo admissionNotes = form.getLocalContext().getSelectedRecord().getAdmissionNotes();
            if (admissionNotes != null)
            {
                if (admissionNotes.getAuthoringInfoIsNotNull())
                    form.customControlAuthoringInfo().setValue(admissionNotes.getAuthoringInfo());

                form.txtSummary().setValue(admissionNotes.getClinicalNote());                   
            }
        }
    }

    form.setMode(FormMode.VIEW);
}
项目:AvoinApotti    文件:ClinicalNoteDrawingImpl.java   
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
    if(careContextRefVo != null)
    {
        DomainFactory factory = getDomainFactory();
        StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
        String andStr = " ";

        ArrayList<String> markers = new ArrayList<String>();
        ArrayList<Serializable> values = new ArrayList<Serializable>();

        hql.append(andStr + " clinnote.careContext.id = :careContextId");
            markers.add("careContextId");
        values.add(careContextRefVo.getID_CareContext());
        andStr = " and ";   

        List listNotes = factory.find(hql.toString(), markers,values);
        if(listNotes != null && listNotes.size() > 0)
        { 
            ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
            if(voColl != null && voColl.size() > 0)
                return voColl.get(0);
        }
    }
    return null;
}
项目:AvoinApotti    文件:ExtendedClinicalNotesImpl.java   
/**
* getClinicalNotes
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.admin.vo.ClinicalContactRefVo contactVo) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
    String andStr = " ";

    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Integer> values = new ArrayList<Integer>();

    hql.append(andStr + " clinnote.clinicalContact.id = :ccId");
        markers.add("ccId");
    values.add(contactVo.getID_ClinicalContact());
    andStr = " and ";   

    List<?> listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdContactsGridHeaderClicked(int column) throws PresentationLogicException
{
    if (DATE_TIME_COL_INDEX == column)
    {
        ClinicalNotesVo selectedValue = form.grdContacts().getValue();
        ClinicalNotesVoCollection data = new ClinicalNotesVoCollection();

        for (int i = 0 ; i < form.grdContacts().getRows().size() ; i ++)
        {
            data.add(form.grdContacts().getRows().get(i).getValue());
        }
        form.getLocalContext().setDateTimeSortOrder(getNextOrder(form.getLocalContext().getDateTimeSortOrder()));
        data.sort(new DateTimeClinicalNotesComparator(form.getLocalContext().getDateTimeSortOrder()));
        form.grdContacts().getRows().clear();           
        populateGridFromData(data);
        form.grdContacts().setValue(selectedValue);
        if (form.grdContacts().getValue()!= null)
            onGrdContactsSelectionChanged();

    }

}
项目:openMAXIMS    文件:Logic.java   
private void displayCreationInfo()
{
    ClinicalNotesVo voClinicalNotes = form.getLocalContext().getClinicalNotes();
    StringBuffer notes = new StringBuffer();
    if (voClinicalNotes != null && voClinicalNotes.getID_ClinicalNotesIsNotNull())
    {
        notes.append("Creation:          ");
        notes.append("Recording User:    ");
        notes.append(voClinicalNotes.getSystemInfoIsNotNull() ? voClinicalNotes.getSystemInfo().getCreationUser() : "");
        notes.append(";    ");
        DateTime recDateTime =  voClinicalNotes.getSystemInfo().getCreationDateTime();
        if(recDateTime != null)
        {
            notes.append("Recording Date:   ");
            notes.append(recDateTime.getDate().toString(DateFormat.STANDARD));
            notes.append(";    ");
            notes.append("Recording Time:   ");
            notes.append(recDateTime.getTime().toString(TimeFormat.DEFAULT));
            notes.append(";    ");
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
public void open() throws ims.framework.exceptions.PresentationLogicException
{
    clearControls();

    setCurrentClinicalNote();

    if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
    {
        //WDEV-1037 - Notes created on this form need to have notetype set to SUMMARYATADMISSION( -882) and have discipline set to MEDICAL ( -59) 
        form.getLocalContext().setSelectedRecord(domain.get(null, ClinicalNoteType.SUMMARYATADMISSION, HcpDisType.MEDICAL ,form.getGlobalContext().Core.getCurrentCareContext()));
        if (form.getLocalContext().getSelectedRecordIsNotNull())
        {
            ClinicalNotesVo admissionNotes = form.getLocalContext().getSelectedRecord().getAdmissionNotes();
            if (admissionNotes != null)
            {
                if (admissionNotes.getAuthoringInfoIsNotNull())
                    form.customControlAuthoringInfo().setValue(admissionNotes.getAuthoringInfo());

                form.txtSummary().setValue(admissionNotes.getClinicalNote());                   
            }
        }
    }

    form.setMode(FormMode.VIEW);
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onGrdContactsGridHeaderClicked(int column) throws PresentationLogicException
{
    if (DATE_TIME_COL_INDEX == column)
    {
        ClinicalNotesVo selectedValue = form.grdContacts().getValue();
        ClinicalNotesVoCollection data = new ClinicalNotesVoCollection();

        for (int i = 0 ; i < form.grdContacts().getRows().size() ; i ++)
        {
            data.add(form.grdContacts().getRows().get(i).getValue());
        }
        form.getLocalContext().setDateTimeSortOrder(getNextOrder(form.getLocalContext().getDateTimeSortOrder()));
        data.sort(new DateTimeClinicalNotesComparator(form.getLocalContext().getDateTimeSortOrder()));
        form.grdContacts().getRows().clear();           
        populateGridFromData(data);
        form.grdContacts().setValue(selectedValue);
        if (form.grdContacts().getValue()!= null)
            onGrdContactsSelectionChanged();

    }

}
项目:openMAXIMS    文件:Logic.java   
private void selectClinicalNoteInGlobalContext()
{

    ClinicalNotesVo clinicalNotesVoForContact = null;

    try
    {
        clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.dyngrdList().getSelectedRow().getValue());
    }
    catch (RuntimeException e)
    {
        engine.showMessage(e.getMessage());
    }

    ClinicalNotesShortVo clinicalNotesForContact = null;

    if (clinicalNotesVoForContact != null)
        clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
    form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);

    if (clinicalNotesVoForContact != null)
        form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
    else
        form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
项目:openMAXIMS    文件:Logic.java   
private void selectClinicalNoteInGlobalContext()
{

    ClinicalNotesVo clinicalNotesVoForContact = null;

    try
    {
        clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.dyngrdList().getSelectedRow().getValue());
    }
    catch (RuntimeException e)
    {
        engine.showMessage(e.getMessage());
    }

    ClinicalNotesShortVo clinicalNotesForContact = null;

    if (clinicalNotesVoForContact != null)
        clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
    form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);

    if (clinicalNotesVoForContact != null)
        form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
    else
        form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
项目:openmaxims-linux    文件:ClinicalNoteDrawingImpl.java   
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
    if(careContextRefVo != null)
    {
        DomainFactory factory = getDomainFactory();
        StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
        String andStr = " ";

        ArrayList<String> markers = new ArrayList<String>();
        ArrayList<Serializable> values = new ArrayList<Serializable>();

        hql.append(andStr + " clinnote.careContext.id = :careContextId");
            markers.add("careContextId");
        values.add(careContextRefVo.getID_CareContext());
        andStr = " and ";   

        List listNotes = factory.find(hql.toString(), markers,values);
        if(listNotes != null && listNotes.size() > 0)
        { 
            ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
            if(voColl != null && voColl.size() > 0)
                return voColl.get(0);
        }
    }
    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenControls(ClinicalNotesVo voNote) throws FormOpenException 
{
    if (voNote.getIsDerivedNoteIsNotNull() 
        && voNote.getIsDerivedNote().booleanValue())
        throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");

    form.getLocalContext().setclinicalNotesVo(voNote);

    settingCustomAuthoring(voNote);

    form.cmbNoteType().setValue(voNote.getNoteClassification());
    form.richNotes().setValue(voNote.getClinicalNote());

    form.txtDiscipline().setValue(voNote.getDisciplineIsNotNull() ? voNote.getDiscipline().getText() : "");//wdev-8976

    if (voNote.getIsCorrectedIsNotNull()
        && voNote.getIsCorrected())
    {
        form.lblCorrect().setVisible(true);
        form.txtCorrectionReason().setVisible(true);
        form.txtCorrectionReason().setEnabled(form.getMode().equals(FormMode.EDIT));

        form.txtCorrectionReason().setValue(voNote.getCurrentStatusIsNotNull() ? voNote.getCurrentStatus().getCorrectionReason() : "");
    }
}
项目:openmaxims-linux    文件:ExtendedClinicalNotesImpl.java   
/**
* getClinicalNotes
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.admin.vo.ClinicalContactRefVo contactVo) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
    String andStr = " ";

    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Integer> values = new ArrayList<Integer>();

    hql.append(andStr + " clinnote.clinicalContact.id = :ccId");
        markers.add("ccId");
    values.add(contactVo.getID_ClinicalContact());
    andStr = " and ";   

    List<?> listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:ClinicalNoteDrawingImpl.java   
public ClinicalNotesVo getClinicalNotesForCareContext(CareContextRefVo careContextRefVo) 
{
    if(careContextRefVo != null)
    {
        DomainFactory factory = getDomainFactory();
        StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
        String andStr = " ";

        ArrayList<String> markers = new ArrayList<String>();
        ArrayList<Serializable> values = new ArrayList<Serializable>();

        hql.append(andStr + " clinnote.careContext.id = :careContextId");
            markers.add("careContextId");
        values.add(careContextRefVo.getID_CareContext());
        andStr = " and ";   

        List listNotes = factory.find(hql.toString(), markers,values);
        if(listNotes != null && listNotes.size() > 0)
        { 
            ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
            if(voColl != null && voColl.size() > 0)
                return voColl.get(0);
        }
    }
    return null;
}
项目:openMAXIMS    文件:ExtendedClinicalNotesImpl.java   
/**
* getClinicalNotes
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.admin.vo.ClinicalContactRefVo contactVo) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
    String andStr = " ";

    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Integer> values = new ArrayList<Integer>();

    hql.append(andStr + " clinnote.clinicalContact.id = :ccId");
        markers.add("ccId");
    values.add(contactVo.getID_ClinicalContact());
    andStr = " and ";   

    List<?> listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:AvoinApotti    文件:Logic.java   
private void populateGridFromData(ClinicalNotesVoCollection voListContacts)
{
    GenForm.grdContactsRow row;         
    ClinicalNotesVo voContactRecord;

    for (int i=0; i< voListContacts.size(); i++)
    {
        voContactRecord = voListContacts.get(i);            
        row = form.grdContacts().getRows().newRow();

        row.setcolDate(voContactRecord.getRecordingDateTime().toString());
        if (voContactRecord.getAuthoringInfoIsNotNull())
        {
            if (voContactRecord.getAuthoringInfo().getAuthoringHcpIsNotNull())
                row.setcolBy(voContactRecord.getAuthoringInfo().getAuthoringHcp().getName().toString());
        }
        if (voContactRecord.getDiscipline() != null)
            row.setColDiscipline(voContactRecord.getDiscipline().getText());

        if (voContactRecord.getIsCorrectedIsNotNull())
        {
            if (voContactRecord.getIsCorrected().booleanValue() == true)  // Correction has been added
                row.setcolNote(voContactRecord.getClinicalNote() + "\nCorrected By: " + voContactRecord.getCurrentStatus().getCorrectedBy() + " on " + voContactRecord.getCurrentStatus().getDateTime().getDate() + " at " + voContactRecord.getCurrentStatus().getDateTime().getTime() + " for the following reason:\n" + voContactRecord.getCurrentStatus().getCorrectionReason());
            else
                row.setcolNote(voContactRecord.getClinicalNote());
        }

        if (voContactRecord.getIsCorrectedIsNotNull())
        {
            if (voContactRecord.getIsCorrected().booleanValue())
                row.setcolIsActive(form.getImages().Core.AnswerBox_No);
            else
                row.setcolIsActive(form.getImages().Core.AnswerBox_Yes);
        }

        row.setValue(voContactRecord);
    }
}
项目:AvoinApotti    文件:Logic.java   
public int compare(ClinicalNotesVo o1, ClinicalNotesVo o2)
{
    if (!o1.getRecordingDateTimeIsNotNull())
        return direction*-1;
    if (!o2.getRecordingDateTimeIsNotNull())
        return direction;
    return direction*o1.getRecordingDateTime().compareTo(o2.getRecordingDateTime());
}
项目:AvoinApotti    文件:ContactInputImpl.java   
/**
* Gets the Clinical Notes Details for the given Clinical Note ID
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.vo.ClinicalNotesVo clinicalNote)
{
    DomainFactory factory = getDomainFactory();
    ClinicalNotes notes = (ClinicalNotes)factory.getDomainObject(ClinicalNotes.class, clinicalNote.getID_ClinicalNotes());  
    ClinicalNotesVo voNote = ClinicalNotesVoAssembler.create(notes);

    return voNote;
}
项目:AvoinApotti    文件:ClinicalNotesViewImpl.java   
public ClinicalNotesVo getClinicalNoteById(Integer idClinicalNote)
{
    if(idClinicalNote == null)
        throw new CodingRuntimeException("idClinicalNote cannot be null in method getClinicalNoteById");

    return ClinicalNotesVoAssembler.create((ClinicalNotes) getDomainFactory().getDomainObject(ClinicalNotes.class, idClinicalNote));
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onRIEDialogClosed(DialogResult result) throws PresentationLogicException
{
    if(DialogResult.OK.equals(result) || DialogResult.YES.equals(result))
    {
        if(!form.getLocalContext().getSoapNoteVoIsNotNull())
            return;

        ClinicalNotesVo clinicalNotes = form.getLocalContext().getSoapNoteVo().getClinicalNote();

        if(clinicalNotes == null)
            return;

        clinicalNotes.setIsRIE(true);

        clinicalNotes.validate();

        Integer patientId=null, contactId=null, careContextId=null;

        if (form.getGlobalContext().Core.getPatientShortIsNotNull())
            patientId = form.getGlobalContext().Core.getPatientShort().getID_Patient();
        if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
            contactId = form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact();
        if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
            careContextId = form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext();

        try 
        {
            domain.markAsRie(clinicalNotes, engine.getFormName(), patientId, contactId, careContextId, "");
        } 
        catch (StaleObjectException e) 
        {
            engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
            onFormOpen();
            return;
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void fillIPStatusCombo(ClinicalNotesVo voClinicalNote) 
{
    if (voClinicalNote != null)
    {
        //In Correct mode, HCP ok and either Active or Correct
        if (correctModeIP(voClinicalNote.getCurrentStatus())) 
        {
            form.btnUpdate().setText("Correct");
            fillIPStatusCorrect();
        }
        //Requires Validation
        else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
            voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.PREVALIDATION))
        {
            //fillIPStatusValidation();
            if (domain.getHcpLiteUser() != null)
                form.btnUpdate().setText("Validate");
            fillIPStatusPreValidation();
        }
        //Draft, HCP OK
        else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
            voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) &&
                domain.getHcpLiteUser() != null &&
                    //domain.getHcpLiteUser().equals(form.customControlAuthoring().getValue().getAuthoringHcp()))
                    testDiscipline())
        {
            fillIPStatusNew();
        }
        //Draft, HCP not OK
        else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() &&
            voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) &&
                domain.getHcpLiteUser() == null) 
        {
            fillIPStatusPreValidation();
        }               
    }
}
项目:AvoinApotti    文件:Logic.java   
private void setAuthoringInfo(ClinicalNotesVo clinicalNotesVo)
{
    AuthoringInformationVo voAuthor = new AuthoringInformationVo();
    voAuthor.setAuthoringDateTime(form.customControlAuthoring().getValue() != null && form.customControlAuthoring().getValue().getAuthoringDateTimeIsNotNull() ? form.customControlAuthoring().getValue().getAuthoringDateTime() : null);
    voAuthor.setAuthoringHcp(form.customControlAuthoring().getValue() != null && form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull() ? form.customControlAuthoring().getValue().getAuthoringHcp() : null);
    clinicalNotesVo.setAuthoringInfo(voAuthor);
}
项目:AvoinApotti    文件:Logic.java   
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
    MemberOfStaffVo fullVo = null;
    MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
    if (mos != null)
        fullVo = domain.getMemberOfStaff(mos);

    if (fullVo != null)
    {
        if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
        {
            MedicVo voMedic = (MedicVo)fullVo.getHcp();
            if (voMedic.getHcpTypeIsNotNull())
                clinicalNotesVo.setDiscipline(voMedic.getHcpType());
            else
            {
                engine.showMessage("Please select a Discipline type for the logged in user.");
                return null;
            }
        }
        else
        {
            if (form.customControlAuthoring().getValue()!=null
                    && form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull())
                clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
            else
            {
                engine.showMessage("No Discipline is available. Please choose an authoring user.");
                return null;
            }
        }
    }
    else
    {
        engine.showMessage("Member of Staff is Null.");
        return null;
    }
    return mos;
}
项目:AvoinApotti    文件:Logic.java   
private void setCurrentClinicalNote() throws FormOpenException
{
    if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
    {

        ClinicalNotesVo clinicalNotesForContact = null;
        if(engine.isDialog() && form.getGlobalContext().Clinical.getCurrentClinicalNoteIsNotNull())
        {       

            clinicalNotesForContact = domain.getClinicalNotes( form.getGlobalContext().Clinical.getCurrentClinicalNote().getClinicalContact());
        }
        else
        {
            ClinicalContactShortVo currentClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
            try
            {
                clinicalNotesForContact = domain.getClinicalNotesForContact(currentClinicalContact);
            }
            catch(Exception e)
            {
                throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
            }
        }

        if (clinicalNotesForContact != null)
            form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesForContact);
        else
            form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void checkForExistingClinicalNotes(ClinicalNotesVo voNote) throws FormOpenException
{
    if ((voNote !=null &&
            voNote.getSourceOfNoteIsNotNull() && 
                ! voNote.getSourceOfNote().equals(SourceOfNote.THERAPYSOAPNOTE)) ||
                    (voNote != null &&
                        voNote.getNoteTypeIsNotNull() &&//wdev-4952
                        !(voNote.getNoteType().equals(ClinicalNoteType.DISCHARGENOTE) ||
                            voNote.getNoteType().equals(ClinicalNoteType.SUMMARYATADMISSION)) && 
                                voNote.getIsDerivedNoteIsNotNull() &&
                                    !voNote.getIsDerivedNote().booleanValue()))         
                                        throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
}
项目:AvoinApotti    文件:Logic.java   
private boolean save()
{
    if(checkForUnsavedChild())
        return false;

    AreaOfNeedsNotingVo voAreaOfNeedsNoting = populateInstanceData(form.getLocalContext().getSelectedParentInstance());

    ClinicalNotesVo voClinicalNotes = populateClinicalNote();
    if(voClinicalNotes == null)
        return false;

    if (voClinicalNotes.getCareContext() ==  null)
        voClinicalNotes.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

    if(voClinicalNotes.getClinicalContact() == null)
        voClinicalNotes.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());

    voAreaOfNeedsNoting.setClinicalNote(voClinicalNotes);

    String[] errors = voAreaOfNeedsNoting.validate();
    if(errors != null)
    {
        engine.showErrors(errors);
        return false;
    }
    try
    {
        form.getLocalContext().setSelectedParentInstance(domain.save(voAreaOfNeedsNoting));
    }
    catch (StaleObjectException e)
    {
        engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        open();
        return false;
    }
    setUpdatedChild();
    return true;    
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onRIEDialogClosed(DialogResult result) throws PresentationLogicException
{
    if(DialogResult.OK.equals(result) || DialogResult.YES.equals(result))
    {
        if(!form.getLocalContext().getSelectedParentInstanceIsNotNull())
            return;

        ClinicalNotesVo clinicalNotes = form.getLocalContext().getSelectedParentInstance().getClinicalNote();

        if(clinicalNotes == null)
            return;

        clinicalNotes.setIsRIE(true);

        clinicalNotes.validate();

        Integer patientId=null, contactId=null, careContextId=null;

        if (form.getGlobalContext().Core.getPatientShortIsNotNull())
            patientId = form.getGlobalContext().Core.getPatientShort().getID_Patient();
        if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
            contactId = form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact();
        if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
            careContextId = form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext();

        try 
        {
            domain.markAsRie(clinicalNotes, engine.getFormName(), patientId, contactId, careContextId, "");
        } 
        catch (StaleObjectException e) 
        {
            engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
            onFormOpen();
            return;
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void setCurrentClinicalNote()
{
    if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull())
    {
        ClinicalContactShortVo currentClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
        ClinicalNotesVo clinicalNotesForContact = domain.getClinicalNotesForContact(currentClinicalContact);

        if (clinicalNotesForContact != null)
            form.getGlobalContext().Clinical.setCurrentClinicalNote(domain.getClinicalNote(clinicalNotesForContact));
        else
            form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
    }
}
项目:AvoinApotti    文件:Logic.java   
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
    MemberOfStaffVo fullVo = null;
    MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
    if (mos != null)
        fullVo = domain.getMemberOfStaff(mos);

    if (fullVo != null)
    {
        if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
        {
            MedicVo voMedic = (MedicVo)fullVo.getHcp();
            if (voMedic.getHcpTypeIsNotNull())
                clinicalNotesVo.setDiscipline(voMedic.getHcpType());
            else
            {
                engine.showMessage("Please select a Discipline type for the logged in user.");
                return null;
            }
        }
        /*else
        {
            if (form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull())
                clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
            else
            {
                engine.showMessage("No Discipline is available. Please choose an authoring user.");
                return null;
            }
        }*/
    }
    else
    {
        engine.showMessage("Member of Staff is Null.");
        return null;
    }
    return mos;
}
项目:AvoinApotti    文件:Logic.java   
private void selectClinicalNoteInGlobalContext()
{

    ClinicalNotesVo clinicalNotesVoForContact = null;

    try
    {
        clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.grdList().getSelectedRow().getValue());

    }
    catch (RuntimeException e)
    {

        engine.showMessage(e.getMessage());

    }

    ClinicalNotesShortVo clinicalNotesForContact = null;

    if(clinicalNotesVoForContact != null)
        clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
    form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);

    if (clinicalNotesVoForContact != null)
        form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
    else
        form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
项目:AvoinApotti    文件:Logic.java   
private boolean checkClinicalNoteForCurrentCareContext() throws FormOpenException
{
    if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && domain.getHcpUser()!=null) //WDEV-19027  //temporary
    {
        ClinicalNotesVo voNote = domain.getClinicalNotesForCareContext(form.getGlobalContext().Core.getCurrentCareContext());
        if (voNote != null)
        {
            if (voNote.getSourceOfNote() == null)
                throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");
            if (voNote.getSourceOfNote().equals(SourceOfNote.CLINICALNOTEDRAWINGIP))
            {
                openClinicalNotes();
                checkForDiscipline();
            }

            else if ( voNote.getSourceOfNote().equals(SourceOfNote.CLINICALNOTEDRAWINGOP))
            {
                checkForDiscipline();
                openOPClinicalNotes();
            }
            else throw new FormOpenException("There is a clinical note of a different type already recorded on the system for this clincal contact");

            return true;
        }
        return false;
    }
    return false;
}
项目:AvoinApotti    文件:Logic.java   
private void setCurrentClinicalNote()
{
    if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull()) //WDEV-19027
    {
        ClinicalNotesVo clinicalNotesForContact;
        if(isDialog() && form.getGlobalContext().Clinical.getCurrentClinicalNoteIsNotNull())
        {
            clinicalNotesForContact = domain.getClinicalNotesForCareContext(form.getGlobalContext().Clinical.getCurrentClinicalNote().getCareContext());  //WDEV-19027
        }
        else
        {
            CareContextShortVo currentCareContext = form.getGlobalContext().Core.getCurrentCareContext(); //WDEV-19027 
            clinicalNotesForContact = domain.getClinicalNotesForCareContext(currentCareContext); //WDEV-19027 
        }

        if (clinicalNotesForContact != null)
        {
            ClinicalNotesShortVo clinicalNotesShort = domain.getClinicalNotesShort(clinicalNotesForContact.getID_ClinicalNotes());

            if (clinicalNotesShort != null)
                form.getGlobalContext().Clinical.setCurrentClinicalNote(domain.getClinicalNotes(clinicalNotesShort.getID_ClinicalNotes()));
            else
                form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
        }
        else
        {
            form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
    MemberOfStaffVo fullVo = null;
    MemberOfStaffShortVo mos = (MemberOfStaffShortVo) domain.getMosUser();
    if (mos != null)
        fullVo = domain.getMemberOfStaff(mos);

    if (fullVo != null)
    {
        if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
        {
            MedicVo voMedic = (MedicVo) fullVo.getHcp();
            if (voMedic.getHcpTypeIsNotNull())
                clinicalNotesVo.setDiscipline(voMedic.getHcpType());
            else
            {
                engine.showMessage("Please select a Discipline type for the logged in user.");
                return null;
            }
        }
        return mos;
    }
    else
    {
        engine.showMessage("Member of Staff is Null.");
        return null;
    }
}
项目:AvoinApotti    文件:Logic.java   
private void fillIPStatusCombo(ClinicalNotesVo voClinicalNote)
{
    if (voClinicalNote != null)
    {
        // In Correct mode, HCP ok and either Active or Correct
        if (correctModeIP(voClinicalNote.getCurrentStatus()))
        {
            form.lyrTabs().tabClinicalNotes().btnUpdateSOAP().setText("Correct");

            fillIPStatusCorrect();
        }
        // Requires Validation
        else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() && voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.PREVALIDATION))
        {

            if (domain.getHcpLiteUser() != null)
                form.lyrTabs().tabClinicalNotes().btnUpdateSOAP().setText("Validate");
            fillIPStatusValidation();
        }
        // Draft, HCP OK
        else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() && voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) && domain.getHcpLiteUser() != null && testIpDiscipline())
        // domain.getHcpLiteUser().equals(form.lyrTabs().tabClinicalNotes().customControlClinicalNotesAuthoiring().getValue().getAuthoringHcp()))
        {
            fillIPStatusNew();
        }
        // Draft, HCP not OK
        else if (voClinicalNote.getCurrentStatus().getStatusIsNotNull() && voClinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) && domain.getHcpLiteUser() == null)
        {
            fillIPStatusPreValidation();
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void enableLinks(ClinicalNotesVo voClinicalNote)
{
    if (form.getMode().equals(FormMode.VIEW))
        return;

    boolean bEnable = true;
    if (voClinicalNote == null)
        bEnable = true;
    else if (voClinicalNote.getIsDerivedNoteIsNotNull() && voClinicalNote.getIsDerivedNote().equals(Boolean.TRUE))
        bEnable = true;
    else
        bEnable = false;

    makeLinksClinicalNoteEnable(bEnable);
}
项目:AvoinApotti    文件:Logic.java   
private void fillOPStatusCombo(ClinicalNotesVo clinicalNote)
{
    if (clinicalNote != null && clinicalNote.getCurrentStatusIsNotNull())
    {
        if (correctModeOP(clinicalNote.getCurrentStatus())) // In Correct
        // mode, HCP ok
        // and either
        // Active or
        // Correct
        {
            form.lyrTabs().tabOPDNote().btnUpdateOPNotes().setText("Correct");

            fillOPStatusCorrect();
        }
        else if (clinicalNote.getCurrentStatus().getStatusIsNotNull() // Requires
                // Validation
                && clinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.PREVALIDATION))
        {
            if (domain.getHcpLiteUser() != null)
                form.lyrTabs().tabOPDNote().btnUpdateOPNotes().setText("Validate");
            fillOPStatusValidation();
        }
        else if (clinicalNote.getCurrentStatus().getStatusIsNotNull() // Draft,
                // HCP
                // OK
                && clinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) && domain.getHcpLiteUser() != null && testOpDiscipline())
        // domain.getHcpLiteUser().equals(form.lyrTabs().tabOPDNote().customControlOPAuthoring().getValue().getAuthoringHcp()))
        {
            fillOPStatusNew();
        }
        else if (clinicalNote.getCurrentStatus().getStatusIsNotNull() // Draft,
                // HCP
                // not
                // OK
                && clinicalNote.getCurrentStatus().getStatus().equals(ClinicalNotesStatus.DRAFT) && domain.getHcpLiteUser() == null)
        {
            fillOPStatusPreValidation();
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onRIEDialogClosed(DialogResult result) throws PresentationLogicException  //WDEV-19027
{
    if(DialogResult.OK.equals(result) || DialogResult.YES.equals(result))
    {
        ClinicalNotesVo clinicalNotes = form.getGlobalContext().Clinical.getCurrentClinicalNote();
        clinicalNotes.setIsRIE(true);

        clinicalNotes.validate();

        Integer patientId=null, contactId=null, careContextId=null;

        if (form.getGlobalContext().Core.getPatientShortIsNotNull())
            patientId = form.getGlobalContext().Core.getPatientShort().getID_Patient();

        if (form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
            careContextId = form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext();

        try 
        {
            domain.markAsRie(clinicalNotes, engine.getFormName(), patientId, contactId, careContextId, "");
        } 
        catch (StaleObjectException e) 
        {
            engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
            onFormOpen();
            return;
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private MemberOfStaffShortVo getDisciplineForLoggedInUser(ClinicalNotesVo clinicalNotesVo)
{
    MemberOfStaffVo fullVo = null;
    MemberOfStaffShortVo mos = (MemberOfStaffShortVo)domain.getMosUser();
    if (mos != null)
        fullVo = domain.getMemberOfStaff(mos);

    if (fullVo != null)
    {
        if (fullVo.getHcpIsNotNull() && fullVo.getHcp() instanceof MedicVo)
        {
            MedicVo voMedic = (MedicVo)fullVo.getHcp();
            if (voMedic.getHcpTypeIsNotNull())
                clinicalNotesVo.setDiscipline(voMedic.getHcpType());
            else
            {
                engine.showMessage("Please select a Discipline type for the logged in user.");
                return null;
            }
        }
        else
        {
            if (form.customControlAuthoring().getValue()!=null && form.customControlAuthoring().getValue().getAuthoringHcpIsNotNull()
                && form.customControlAuthoring().getValue().getAuthoringHcp().getHcpTypeIsNotNull())
                clinicalNotesVo.setDiscipline(form.customControlAuthoring().getValue().getAuthoringHcp().getHcpType());
            else
            { 
                if (form.getMode().equals(FormMode.EDIT))//WDEV-14967
                engine.showMessage("No Discipline is available. Please choose an authoring user.");
                return null;
            }
        }
    }
    else
    {
        engine.showMessage("Member of Staff is Null.");
        return null;
    }
    return mos;
}