Example #1
0
        public void TestCreateDashboardNote()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 3);

                DsioCreateANoteCommand command = new DsioCreateANoteCommand(broker);

                command.AddCommandArguments("100017", "MCC DASHBOARD NOTE", "Note Text Here", "Some Subject", new DsioNoteData(), "");

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status, "MCC DASHBOARD NOTE could not be created");

                Assert.IsFalse(string.IsNullOrWhiteSpace(command.Ien));

                DsioGetTiuNotesCommand getCommand = new DsioGetTiuNotesCommand(broker);

                getCommand.AddCommandArguments("100017", new string[] { "MCC DASHBOARD NOTE" }, "", "", 0, 0, false, command.Ien, "");

                response = getCommand.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status, "MCC DASHBOARD NOTE could not be retrieved");

                Assert.IsNotNull(getCommand.Notes);
                Assert.IsTrue(getCommand.Notes.Count == 1);
                Assert.AreEqual(getCommand.Notes[0].Ien, command.Ien);
            }
        }
Example #2
0
        public void TestGetContactNotesByDateRange()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioGetTiuNotesCommand command = new DsioGetTiuNotesCommand(broker);

                string[] TiuNoteTitleText = new string[] {
                    "PHONE CALL #1 (FIRST CONTACT)",
                    "PHONE CALL #2 (12 WEEKS)",
                    "PHONE CALL #3 (20 WEEKS)",
                    "PHONE CALL #4 (28 WEEKS)",
                    "PHONE CALL #5 (36 WEEKS)",
                    "PHONE CALL #6A (41 WEEKS",
                    "PHONE CALL #6B (12 WEEKS)",
                    "PHONE CALL #7 (6 WEEKS POSTPARTUM) TOPICS",
                    "MCC Phone Call – Additional"
                };

                command.AddCommandArguments(patDfn, TiuNoteTitleText, "08/11/2014", "08/15/2014", 1, 100, true, "", "");

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                broker.Disconnect();
            }
        }
Example #3
0
        public void TestGetAllNotes()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioGetTiuNotesCommand command = new DsioGetTiuNotesCommand(broker);

                string[] tiuNoteTitleText = new string[] {
                    "MCC DASHBOARD NOTE",
                    "DASHBOARD CDA INCOMING",
                    "PHONE CALL #1 (FIRST CONTACT)",
                    "PHONE CALL #2 (12 WEEKS)",
                    "PHONE CALL #3 (20 WEEKS)",
                    "PHONE CALL #4 (28 WEEKS)",
                    "PHONE CALL #5 (36 WEEKS)",
                    "PHONE CALL #6A (41 WEEKS NOT DELIVERED)",
                    "PHONE CALL #6B (41 WEEKS DELIVERED) TOPICS",
                    "PHONE CALL #7 (6 WEEKS POSTPARTUM) TOPICS",
                };

                //command.AddCommandArguments("100032", tiuNoteTitleText, "", "", 1, 100, true, "", "");
                command.AddCommandArguments("168", tiuNoteTitleText, "", "", 1, 100, true, "", "");

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            }
        }
Example #4
0
        public void TestGetDashboardNotes()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioGetTiuNotesCommand command = new DsioGetTiuNotesCommand(broker);

                command.AddCommandArguments(patDfn, new string[] { "MCC DASHBOARD NOTE" }, "", "", 1, 100, true, "", "");

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            }
        }
        //public BrokerOperationResult CreateCdaNote(string dfn, string noteText)
        //{
        //    // *** Creates a CDA progress note ***

        //    BrokerOperationResult returnResult = new BrokerOperationResult();

        //    if (this.broker != null)
        //    {
        //        // *** Create the command ***
        //        DsioCreateANoteCommand command = new DsioCreateANoteCommand(broker);

        //        // *** Add command arguments ***
        //        string noteTitle = TiuNoteTitleText[(int)TiuNoteTitle.DashboardCdaIncoming];
        //        command.AddCommandArguments(dfn, noteTitle, noteText, "", "");

        //        // *** Execute the command ***
        //        RpcResponse response = command.Execute();

        //        // *** Add results to return ***
        //        returnResult.Success = (response.Status == RpcResponseStatus.Success);
        //        returnResult.Message = response.InformationalMessage;

        //    }

        //    return returnResult;
        //}

        public NoteListResult GetNotesByTitle(List <TiuNoteTitle> noteTitles, string dfn, int page, int itemsPerPage, string pregIen)
        {
            // *** Get a page of dashboard notes for a patient ***

            NoteListResult returnResult = new NoteListResult();

            if (this.broker != null)
            {
                DsioGetTiuNotesCommand command = new DsioGetTiuNotesCommand(broker);

                List <string> titles = new List <string>();
                foreach (TiuNoteTitle noteTitle in noteTitles)
                {
                    titles.Add(TiuNoteTitleInfo.TiuNoteTitleText[(int)noteTitle]);
                }

                command.AddCommandArguments(dfn, titles.ToArray(), "", "", page, itemsPerPage, true, "", pregIen);

                RpcResponse response = command.Execute();

                returnResult.Success = (response.Status == RpcResponseStatus.Success);

                returnResult.Message = response.InformationalMessage;

                if (returnResult.Success)
                {
                    returnResult.TotalResults = command.TotalResults;

                    foreach (TiuDocument doc in command.Notes)
                    {
                        TiuNote note = GetDashboardNote(doc);

                        note.PatientDfn = dfn;

                        returnResult.Notes.Add(note);
                    }
                }
            }

            return(returnResult);
        }
        public TiuNoteResult GetNoteHeader(string dfn, string noteIen)
        {
            TiuNoteResult result = new TiuNoteResult();

            List <string> titles = new List <string>();

            foreach (object val in Enum.GetValues(typeof(TiuNoteTitle)))
            {
                string title = TiuNoteTitleInfo.TiuNoteTitleText[(int)val];

                if (!string.IsNullOrWhiteSpace(title))
                {
                    titles.Add(title);
                }
            }

            DsioGetTiuNotesCommand command = new DsioGetTiuNotesCommand(this.broker);

            command.AddCommandArguments(dfn, titles.ToArray(), "", "", 1, 1000, false, noteIen, "");

            RpcResponse response = command.Execute();

            result.SetResult(response.Status == RpcResponseStatus.Success, response.InformationalMessage);

            if (result.Success)
            {
                if (command.Notes != null)
                {
                    if (command.Notes.Count > 0)
                    {
                        result.Note = this.GetDashboardNote(command.Notes[0]);
                    }
                }
            }

            return(result);
        }