コード例 #1
0
        public void TestUpdateNoteData()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 3);

                DsioCreateANoteCommand command = new DsioCreateANoteCommand(broker);

                DsioNoteData noteData = new DsioNoteData();

                noteData.Add("INTRO_1", true.ToString());
                noteData.Add("INTRO_2", false.ToString());
                noteData.Add("COVERAGE_1", true.ToString());
                noteData.Add("COVERAGE_2", false.ToString());

                command.AddCommandArguments(patDfn, "MCC DASHBOARD NOTE", "Testing Discrete Data", "test subject", noteData, "");

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsFalse(string.IsNullOrWhiteSpace(command.Ien));

                //DsioGetNoteElementCommand getCommand = new DsioGetNoteElementCommand(broker);
                DsioDdcsGetControlValue getCommand = new DsioDdcsGetControlValue(broker);

                getCommand.AddCommandArguments(command.Ien);

                response = getCommand.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                DsioUpdateANoteCommand updateCommand = new DsioUpdateANoteCommand(broker);

                noteData.Clear();

                noteData.Add("INTRO_1", false.ToString());

                updateCommand.AddCommandArguments(command.Ien, "Updated note text", "", noteData, "");

                response = updateCommand.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                response = getCommand.Execute();
            }
        }
コード例 #2
0
        public void TestCreateANoteWithData()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioCreateANoteCommand command = new DsioCreateANoteCommand(broker);

                DsioNoteData noteData = new DsioNoteData();

                noteData.Add("INTRO_1", "Patient's");
                noteData.Add("INTRO_2", false.ToString());
                noteData.Add("COVERAGE_1", true.ToString());
                noteData.Add("COVERAGE_2", false.ToString());
                //S^INTRODUCTIONCALL.PATIENTAVAILABLE^INTRODUCTIONCALL.PATIENTAVAILABLE^True

                // Too long...
                //noteData.Add("INT_AVAILXXXXXXXXXXXXXXXXXXXXXX", true.ToString());
                //noteData.Add("INT_AVAIL", true.ToString());

                //string title = "PHONE CALL #4 (28 WEEKS)";
                //string title = "MCC DASHBOARD NOTE";

                //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",
                //     };

                // *** Only these are configured for now ***
                string[] TiuNoteTitleText = new string[] {
                    "MCC DASHBOARD NOTE",
                    "PHONE CALL #1 (FIRST CONTACT)",
                };

                foreach (string title in TiuNoteTitleText)
                {
                    Debug.WriteLine(" - Adding Note - ");
                    Debug.WriteLine(title);

                    command.AddCommandArguments(patDfn, title, "Testing Discrete Data", "test subject", noteData, "");

                    RpcResponse response = command.Execute();

                    Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                    Assert.IsFalse(string.IsNullOrWhiteSpace(command.Ien));

                    Debug.WriteLine(string.Format("IEN RETURNED: {0}", command.Ien));

                    //DsioGetNoteElementCommand getCommand = new DsioGetNoteElementCommand(broker);
                    DsioDdcsGetControlValue getCommand = new DsioDdcsGetControlValue(broker);

                    getCommand.AddCommandArguments(command.Ien);
                    //getCommand.AddCommandArguments("5143");

                    response = getCommand.Execute();

                    Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                    Debug.WriteLine("Return from DSIO GET NOTE ELEMENT...");
                    Debug.WriteLine(response.Data);

                    string val = "";
                    if (getCommand.NoteData != null)
                    {
                        getCommand.NoteData.TryGetValue("COVERAGE_2", out val);
                    }

                    Assert.AreEqual(noteData["COVERAGE_2"], val);

                    Debug.WriteLine(" -- ");
                }

                //DsioGetRecordTextCommand cmd = new DsioGetRecordTextCommand(broker);

                //cmd.AddCommandArgument(command.Ien, DsioGetRecordTextMode.HeaderAndBody);

                //response = cmd.Execute();

                //Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            }
        }