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

项目:AvoinApotti    文件:Logic.java   
private ReferralNoteVo populateReferralNote(CatsReferralProviderCancellationVo voCatsReferral) 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    if(voCatsReferral != null && voCatsReferral.getProviderCancellation() != null)
    {
        ProviderCancellationVo voProviderCancellation = voCatsReferral.getProviderCancellation();

        String note = "PROVIDER CANCELLATION \n Reason : " + 
        (voProviderCancellation.getReasonIsNotNull() ? voProviderCancellation.getReason().getText() : "")
            + "\n Comment : " + (voProviderCancellation.getCommentsIsNotNull() ? voProviderCancellation.getComments() : "");

        voNote.setNote(note);
    }

    return voNote;
}
项目:AvoinApotti    文件:Logic.java   
protected onExaminationVo populateDataFromScreen()
{
    onExaminationVo voExam = new onExaminationVo();
    ReferralNoteVo voNote = new ReferralNoteVo();


    if (voNote.getCareContext() == null)
        voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    if (form.getLocalContext().getSelectedRecordIsNotNull())
    {
        voExam = form.getLocalContext().getSelectedRecord();
        voNote = form.getLocalContext().getSelectedRecord().getClinicalNote();
    }
    else
    {

        voNote.setNoteType(ReferralNoteType.CLINICAL);
    }

    voExam.setClinicalNote(voNote);

    return voExam;
}
项目:openMAXIMS    文件:Logic.java   
private ReferralNoteVo populateReferralNote(CatsReferralProviderCancellationVo voCatsReferral) 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    if(voCatsReferral != null && voCatsReferral.getProviderCancellation() != null)
    {
        ProviderCancellationVo voProviderCancellation = voCatsReferral.getProviderCancellation();

        String note = "PROVIDER CANCELLATION \n Reason: " + 
        (voProviderCancellation.getReasonIsNotNull() ? voProviderCancellation.getReason().getText() : "")
            + "\n Comment: " + (voProviderCancellation.getCommentsIsNotNull() ? voProviderCancellation.getComments() : "");

        voNote.setNote(note);
    }

    return voNote;
}
项目:openMAXIMS    文件:Logic.java   
protected onExaminationVo populateDataFromScreen()
{
    onExaminationVo voExam = new onExaminationVo();
    ReferralNoteVo voNote = new ReferralNoteVo();


    if (voNote.getCareContext() == null)
        voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    if (form.getLocalContext().getSelectedRecordIsNotNull())
    {
        voExam = form.getLocalContext().getSelectedRecord();
        voNote = form.getLocalContext().getSelectedRecord().getClinicalNote();
    }
    else
    {

        voNote.setNoteType(ReferralNoteType.CLINICAL);
    }

    voExam.setClinicalNote(voNote);

    return voExam;
}
项目:openMAXIMS    文件:Logic.java   
private ReferralNoteVo populateReferralNote(CatsReferralProviderCancellationVo voCatsReferral) 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    if(voCatsReferral != null && voCatsReferral.getProviderCancellation() != null)
    {
        ProviderCancellationVo voProviderCancellation = voCatsReferral.getProviderCancellation();

        String note = "PROVIDER CANCELLATION \n Reason : " + 
        (voProviderCancellation.getReasonIsNotNull() ? voProviderCancellation.getReason().getText() : "")
            + "\n Comment : " + (voProviderCancellation.getCommentsIsNotNull() ? voProviderCancellation.getComments() : "");

        voNote.setNote(note);
    }

    return voNote;
}
项目:openMAXIMS    文件:Logic.java   
protected onExaminationVo populateDataFromScreen()
{
    onExaminationVo voExam = new onExaminationVo();
    ReferralNoteVo voNote = new ReferralNoteVo();


    if (voNote.getCareContext() == null)
        voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    if (form.getLocalContext().getSelectedRecordIsNotNull())
    {
        voExam = form.getLocalContext().getSelectedRecord();
        voNote = form.getLocalContext().getSelectedRecord().getClinicalNote();
    }
    else
    {

        voNote.setNoteType(ReferralNoteType.CLINICAL);
    }

    voExam.setClinicalNote(voNote);

    return voExam;
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
    if (form.txtNotes().getValue() == null)
    {
        engine.showMessage("Note is mandatory", "Error", MessageButtons.OK, MessageIcon.WARNING);
        return;
    }

    ReferralNoteVo voNote = new ReferralNoteVo();
    if (form.getGlobalContext().RefMan.getReferralNoteIsNotNull())
    {
        voNote = form.getGlobalContext().RefMan.getReferralNote();
        voNote.setNote(form.txtNotes().getValue());
    }
    else
    {
        MemberOfStaffLiteVo voMos = (MemberOfStaffLiteVo) domain.getMosUser();
        if (voMos != null)
            voNote.setRecordingUser(voMos);
        voNote.setRecordingDateTime(new DateTime());

        voNote.setNote(form.txtNotes().getValue());
        voNote.setNoteType(ReferralNoteType.NON_CLINICAL);
    }
    form.getGlobalContext().RefMan.setReferralNote(voNote);

    engine.close(DialogResult.OK);
}
项目:AvoinApotti    文件:Logic.java   
private void addNotesRow(ReferralNoteVo voNote) 
{
    grdNotesRow row = form.grdNotes().getRows().newRow();
    row.setColDateTime(voNote.getRecordingDateTimeIsNotNull() ? voNote.getRecordingDateTime().toString() : "");
    row.setColUser(voNote.getRecordingUserIsNotNull() ? voNote.getRecordingUser().getName().toString() : "");
    row.setColNote(voNote.getNote());

    row.setValue(voNote);
}
项目:AvoinApotti    文件:Logic.java   
public void addNotes(String notes) 
{
    if (notes != null)
    {
        ReferralNoteVo voNote = new ReferralNoteVo();
        MemberOfStaffLiteVo voMos = (MemberOfStaffLiteVo) domain.getMosUser();
        if (voMos != null)
            voNote.setRecordingUser(voMos);
        voNote.setRecordingDateTime(new DateTime());
        //WDEV-8323
        voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  
        voNote.setNote(notes);                  
        saveReferralNote(voNote);
    }
}
项目:AvoinApotti    文件:ReferralDetailsNotesImpl.java   
public ReferralNoteVo saveReferralNote(ReferralNoteVo voReferralNote) throws DomainInterfaceException, StaleObjectException 
{
    if(voReferralNote == null)
        throw new DomainRuntimeException("Invalid referral note to save");
    if(!voReferralNote.isValidated())
        throw new DomainRuntimeException("Record not validated before save");

    DomainFactory factory = getDomainFactory();
    CorrespondenceNote domainObject = ReferralNoteVoAssembler.extractCorrespondenceNote(factory, voReferralNote);       
    factory.save(domainObject);
    return ReferralNoteVoAssembler.create(domainObject);
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
    if (form.txtNotes().getValue() == null)
    {
        engine.showMessage("Note is mandatory", "Error", MessageButtons.OK, MessageIcon.WARNING);
        return;
    }

    ReferralNoteVo voNote = new ReferralNoteVo();
    if (form.getGlobalContext().RefMan.getReferralNoteIsNotNull())
    {
        voNote = form.getGlobalContext().RefMan.getReferralNote();
        voNote.setNote(form.txtNotes().getValue());
    }
    else
    {
        MemberOfStaffLiteVo voMos = (MemberOfStaffLiteVo) domain.getMosUser();
        if (voMos != null)
            voNote.setRecordingUser(voMos);
        voNote.setRecordingDateTime(new DateTime());

        voNote.setNote(form.txtNotes().getValue());
        voNote.setNoteType(ReferralNoteType.NON_CLINICAL);
    }
    form.getGlobalContext().RefMan.setReferralNote(voNote);

    engine.close(DialogResult.OK);
}
项目:openMAXIMS    文件:Logic.java   
private void addNotesRow(ReferralNoteVo voNote) 
{
    grdNotesRow row = form.grdNotes().getRows().newRow();
    row.setColDateTime(voNote.getRecordingDateTimeIsNotNull() ? voNote.getRecordingDateTime().toString() : "");
    row.setColUser(voNote.getRecordingUserIsNotNull() ? voNote.getRecordingUser().getName().toString() : "");
    row.setColNote(voNote.getNote());

    row.setValue(voNote);
}
项目:openMAXIMS    文件:Logic.java   
public void addNotes(String notes) 
{
    if (notes != null)
    {
        ReferralNoteVo voNote = new ReferralNoteVo();
        MemberOfStaffLiteVo voMos = (MemberOfStaffLiteVo) domain.getMosUser();
        if (voMos != null)
            voNote.setRecordingUser(voMos);
        voNote.setRecordingDateTime(new DateTime());
        //WDEV-8323
        voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  
        voNote.setNote(notes);                  
        saveReferralNote(voNote);
    }
}
项目:openMAXIMS    文件:ReferralDetailsNotesImpl.java   
public ReferralNoteVo saveReferralNote(ReferralNoteVo voReferralNote) throws DomainInterfaceException, StaleObjectException 
{
    if(voReferralNote == null)
        throw new DomainRuntimeException("Invalid referral note to save");
    if(!voReferralNote.isValidated())
        throw new DomainRuntimeException("Record not validated before save");

    DomainFactory factory = getDomainFactory();
    CorrespondenceNote domainObject = ReferralNoteVoAssembler.extractCorrespondenceNote(factory, voReferralNote);       
    factory.save(domainObject);
    return ReferralNoteVoAssembler.create(domainObject);
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
    if (form.txtNotes().getValue() == null)
    {
        engine.showMessage("Note is mandatory", "Error", MessageButtons.OK, MessageIcon.WARNING);
        return;
    }

    ReferralNoteVo voNote = new ReferralNoteVo();
    if (form.getGlobalContext().RefMan.getReferralNoteIsNotNull())
    {
        voNote = form.getGlobalContext().RefMan.getReferralNote();
        voNote.setNote(form.txtNotes().getValue());
    }
    else
    {
        MemberOfStaffLiteVo voMos = (MemberOfStaffLiteVo) domain.getMosUser();
        if (voMos != null)
            voNote.setRecordingUser(voMos);
        voNote.setRecordingDateTime(new DateTime());

        voNote.setNote(form.txtNotes().getValue());
        voNote.setNoteType(ReferralNoteType.NON_CLINICAL);
    }
    form.getGlobalContext().RefMan.setReferralNote(voNote);

    engine.close(DialogResult.OK);
}
项目:openMAXIMS    文件:Logic.java   
private void addNotesRow(ReferralNoteVo voNote) 
{
    grdNotesRow row = form.grdNotes().getRows().newRow();
    row.setColDateTime(voNote.getRecordingDateTimeIsNotNull() ? voNote.getRecordingDateTime().toString() : "");
    row.setColUser(voNote.getRecordingUserIsNotNull() ? voNote.getRecordingUser().getName().toString() : "");
    row.setColNote(voNote.getNote());

    row.setValue(voNote);
}
项目:openMAXIMS    文件:Logic.java   
public void addNotes(String notes) 
{
    if (notes != null)
    {
        ReferralNoteVo voNote = new ReferralNoteVo();
        MemberOfStaffLiteVo voMos = (MemberOfStaffLiteVo) domain.getMosUser();
        if (voMos != null)
            voNote.setRecordingUser(voMos);
        voNote.setRecordingDateTime(new DateTime());
        //WDEV-8323
        voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  
        voNote.setNote(notes);                  
        saveReferralNote(voNote);
    }
}
项目:openMAXIMS    文件:ReferralDetailsNotesImpl.java   
public ReferralNoteVo saveReferralNote(ReferralNoteVo voReferralNote) throws DomainInterfaceException, StaleObjectException 
{
    if(voReferralNote == null)
        throw new DomainRuntimeException("Invalid referral note to save");
    if(!voReferralNote.isValidated())
        throw new DomainRuntimeException("Record not validated before save");

    DomainFactory factory = getDomainFactory();
    CorrespondenceNote domainObject = ReferralNoteVoAssembler.extractCorrespondenceNote(factory, voReferralNote);       
    factory.save(domainObject);
    return ReferralNoteVoAssembler.create(domainObject);
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
    if (form.txtNotes().getValue() == null)
    {
        engine.showMessage("Note is mandatory", "Error", MessageButtons.OK, MessageIcon.WARNING);
        return;
    }

    ReferralNoteVo voNote = new ReferralNoteVo();
    if (form.getGlobalContext().CareUk.getReferralNoteIsNotNull())
    {
        voNote = form.getGlobalContext().CareUk.getReferralNote();
        voNote.setNote(form.txtNotes().getValue());
    }
    else
    {
        MemberOfStaffLiteVo voMos = (MemberOfStaffLiteVo) domain.getMosUser();
        if (voMos != null)
            voNote.setRecordingUser(voMos);
        voNote.setRecordingDateTime(new DateTime());

        voNote.setNote(form.txtNotes().getValue());
        voNote.setNoteType(ReferralNoteType.NON_CLINICAL);
    }
    form.getGlobalContext().CareUk.setReferralNote(voNote);

    engine.close(DialogResult.OK);
}
项目:openmaxims-linux    文件:Logic.java   
private void addNotesRow(ReferralNoteVo voNote) 
{
    grdNotesRow row = form.grdNotes().getRows().newRow();
    row.setColDateTime(voNote.getRecordingDateTimeIsNotNull() ? voNote.getRecordingDateTime().toString() : "");
    row.setColUser(voNote.getRecordingUserIsNotNull() ? voNote.getRecordingUser().getName().toString() : "");
    row.setColNote(voNote.getNote());

    row.setValue(voNote);
}
项目:openmaxims-linux    文件:Logic.java   
public void addNotes(String notes) 
{
    if (notes != null)
    {
        ReferralNoteVo voNote = new ReferralNoteVo();
        MemberOfStaffLiteVo voMos = (MemberOfStaffLiteVo) domain.getMosUser();
        if (voMos != null)
            voNote.setRecordingUser(voMos);
        voNote.setRecordingDateTime(new DateTime());
        //WDEV-8323
        voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  
        voNote.setNote(notes);                  
        saveReferralNote(voNote);
    }
}
项目:openmaxims-linux    文件:ReferralDetailsNotesImpl.java   
public ReferralNoteVo saveReferralNote(ReferralNoteVo voReferralNote) throws DomainInterfaceException, StaleObjectException 
{
    if(voReferralNote == null)
        throw new DomainRuntimeException("Invalid referral note to save");
    if(!voReferralNote.isValidated())
        throw new DomainRuntimeException("Record not validated before save");

    DomainFactory factory = getDomainFactory();
    CorrespondenceNote domainObject = ReferralNoteVoAssembler.extractCorrespondenceNote(factory, voReferralNote);       
    factory.save(domainObject);
    return ReferralNoteVoAssembler.create(domainObject);
}
项目:AvoinApotti    文件:Logic.java   
private ReferralNoteVo populateReferralNote() 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    String note = "UNDO PROVIDER CANCELLATION";

    voNote.setNote(note);

    return voNote;
}
项目:AvoinApotti    文件:Logic.java   
private ReferralNoteVo populateReferralNote() 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    String note = "UNDO PROVIDER CANCELLATION";

    voNote.setNote(note);

    return voNote;
}
项目:AvoinApotti    文件:ReferralStatusListImpl.java   
public void undoProviderCancellation(CatsReferralListVo referral, ReferralNoteVo referralNote) throws StaleObjectException, ForeignKeyViolationException
{

    if (!(referral.getCurrentStatusIsNotNull() && 
            ReferralApptStatus.REFERRAL_CANCELLED_BY_PROVIDER.equals(referral.getCurrentStatus().getReferralStatus())))
    {
        throw new DomainRuntimeException("The referral is not cancelled by provided !");
    }

    //referral.get
    DomainFactory factory = getDomainFactory();


    CatsReferralStatusVoCollection statusHistory = referral.getStatusHistory();
    if (statusHistory == null)
    {
        throw new DomainRuntimeException("Cats referral doesn't have any history");
    }

    //Hold the current status so that remove can be done in db
    CatsReferralStatusVo removeStatus = referral.getCurrentStatus();

    //Remove the current status from the history and set the current status to the latest
    statusHistory.remove(removeStatus);

    CatsReferralStatusVo latestStatus = getLatestStatus(statusHistory);

    // Check for a referral letter associated to referral
    PatientDocumentLiteVo referralLetter = getReferralLetter(referral);

    if (ReferralApptStatus.REFERRAL_RECEIVED.equals(latestStatus.getReferralStatus()) && referralLetter != null)
    {
        // Create new status for referral
        CatsReferralStatusVo status = new CatsReferralStatusVo();

        status.setReferralStatus(ReferralApptStatus.AWAITING_TRIAGE);
        status.setAuthoringUser(referralLetter.getRecordingUser());
        status.setComment("");
        status.setStatusDateTime(new DateTime());

        referral.setCurrentStatus(status);
        statusHistory.add(status);
    }
    else
    {
        referral.setCurrentStatus(latestStatus);
    }



    CatsReferral referralBo = CatsReferralListVoAssembler.extractCatsReferral(factory, referral);

    ProviderCancellation pCancellation = referralBo.getProviderCancellation();

    referralBo.setProviderCancellation(null);

    factory.save(referralBo);

    factory.delete(CatsReferralStatusVoAssembler.extractCATSReferralStatus(factory, removeStatus));

    if (pCancellation != null)
        factory.delete(pCancellation);

    //WDEV-12088
    ims.core.domain.objects.CorrespondenceNote domainObject = ReferralNoteVoAssembler.extractCorrespondenceNote(factory, referralNote);     
    factory.save(domainObject);
}
项目:openMAXIMS    文件:Logic.java   
private ReferralNoteVo populateReferralNote() 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    String note = "UNDO PROVIDER CANCELLATION";

    voNote.setNote(note);

    return voNote;
}
项目:openMAXIMS    文件:Logic.java   
private ReferralNoteVo populateReferralNote() 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    String note = "UNDO PROVIDER CANCELLATION";

    voNote.setNote(note);

    return voNote;
}
项目:openMAXIMS    文件:ReferralStatusListImpl.java   
public void undoProviderCancellation(CatsReferralListVo referral, ReferralNoteVo referralNote) throws StaleObjectException, ForeignKeyViolationException
{

    if (!(referral.getCurrentStatusIsNotNull() && 
            ReferralApptStatus.REFERRAL_CANCELLED_BY_PROVIDER.equals(referral.getCurrentStatus().getReferralStatus())))
    {
        throw new DomainRuntimeException("The referral is not cancelled by provided !");
    }

    //referral.get
    DomainFactory factory = getDomainFactory();


    CatsReferralStatusVoCollection statusHistory = referral.getStatusHistory();
    if (statusHistory == null)
    {
        throw new DomainRuntimeException("Cats referral doesn't have any history");
    }

    //Hold the current status so that remove can be done in db
    CatsReferralStatusVo removeStatus = referral.getCurrentStatus();

    //Remove the current status from the history and set the current status to the latest
    statusHistory.remove(removeStatus);

    CatsReferralStatusVo latestStatus = getLatestStatus(statusHistory);

    // Check for a referral letter associated to referral
    PatientDocumentLiteVo referralLetter = getReferralLetter(referral);

    if (ReferralApptStatus.REFERRAL_RECEIVED.equals(latestStatus.getReferralStatus()) && referralLetter != null)
    {
        // Create new status for referral
        CatsReferralStatusVo status = new CatsReferralStatusVo();

        status.setReferralStatus(ReferralApptStatus.AWAITING_TRIAGE);
        status.setAuthoringUser(referralLetter.getRecordingUser());
        status.setComment("");
        status.setStatusDateTime(new DateTime());

        referral.setCurrentStatus(status);
        statusHistory.add(status);
    }
    else
    {
        referral.setCurrentStatus(latestStatus);
    }



    CatsReferral referralBo = CatsReferralListVoAssembler.extractCatsReferral(factory, referral);

    ProviderCancellation pCancellation = referralBo.getProviderCancellation();

    referralBo.setProviderCancellation(null);

    factory.save(referralBo);

    factory.delete(CatsReferralStatusVoAssembler.extractCATSReferralStatus(factory, removeStatus));

    if (pCancellation != null)
        factory.delete(pCancellation);

    //WDEV-12088
    ims.core.domain.objects.CorrespondenceNote domainObject = ReferralNoteVoAssembler.extractCorrespondenceNote(factory, referralNote);     
    factory.save(domainObject);
}
项目:openMAXIMS    文件:Logic.java   
private ReferralNoteVo populateReferralNote() 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    String note = "UNDO PROVIDER CANCELLATION";

    voNote.setNote(note);

    return voNote;
}
项目:openMAXIMS    文件:Logic.java   
private ReferralNoteVo populateReferralNote() 
{
    ReferralNoteVo voNote = new ReferralNoteVo();

    voNote.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());//wdev-17849

    Object voMos = domain.getMosUser();
    if (voMos instanceof MemberOfStaffLiteVo)
        voNote.setRecordingUser((MemberOfStaffLiteVo) voMos);

    voNote.setRecordingDateTime(new DateTime());
    voNote.setNoteType(ReferralNoteType.NON_CLINICAL);  

    String note = "UNDO PROVIDER CANCELLATION";

    voNote.setNote(note);

    return voNote;
}
项目:openMAXIMS    文件:ReferralStatusListImpl.java   
public void undoProviderCancellation(CatsReferralListVo referral, ReferralNoteVo referralNote) throws StaleObjectException, ForeignKeyViolationException
{

    if (!(referral.getCurrentStatusIsNotNull() && 
            ReferralApptStatus.REFERRAL_CANCELLED_BY_PROVIDER.equals(referral.getCurrentStatus().getReferralStatus())))
    {
        throw new DomainRuntimeException("The referral is not cancelled by provided !");
    }

    //referral.get
    DomainFactory factory = getDomainFactory();


    CatsReferralStatusVoCollection statusHistory = referral.getStatusHistory();
    if (statusHistory == null)
    {
        throw new DomainRuntimeException("Cats referral doesn't have any history");
    }

    //Hold the current status so that remove can be done in db
    CatsReferralStatusVo removeStatus = referral.getCurrentStatus();

    //Remove the current status from the history and set the current status to the latest
    statusHistory.remove(removeStatus);

    CatsReferralStatusVo latestStatus = getLatestStatus(statusHistory);

    // Check for a referral letter associated to referral
    PatientDocumentLiteVo referralLetter = getReferralLetter(referral);

    if (ReferralApptStatus.REFERRAL_RECEIVED.equals(latestStatus.getReferralStatus()) && referralLetter != null)
    {
        // Create new status for referral
        CatsReferralStatusVo status = new CatsReferralStatusVo();

        status.setReferralStatus(ReferralApptStatus.AWAITING_TRIAGE);
        status.setAuthoringUser(referralLetter.getRecordingUser());
        status.setComment("");
        status.setStatusDateTime(new DateTime());

        referral.setCurrentStatus(status);
        statusHistory.add(status);
    }
    else
    {
        referral.setCurrentStatus(latestStatus);
    }



    CatsReferral referralBo = CatsReferralListVoAssembler.extractCatsReferral(factory, referral);

    ProviderCancellation pCancellation = referralBo.getProviderCancellation();

    referralBo.setProviderCancellation(null);

    factory.save(referralBo);

    factory.delete(CatsReferralStatusVoAssembler.extractCATSReferralStatus(factory, removeStatus));

    if (pCancellation != null)
        factory.delete(pCancellation);

    //WDEV-12088
    ims.core.domain.objects.CorrespondenceNote domainObject = ReferralNoteVoAssembler.extractCorrespondenceNote(factory, referralNote);     
    factory.save(domainObject);
}