Пример #1
0
        public string getFieldAttribute(string file, string fld, string attribute)
        {
            string arg = "$P($$GET1^DID(\"" + file + "\",\"" + fld + "\",\"\",\"" + attribute + "\"),U,1)";
            string rtn = VistaUtils.getVariableValue(cxn, arg);

            return(rtn);
        }
Пример #2
0
        public FileHeader getFileHeader(string globalName)
        {
            string arg      = "$G(" + globalName + "0))";
            string response = VistaUtils.getVariableValue(cxn, arg);

            return(toFileHeader(response));
        }
Пример #3
0
        public string ddiol(string file, string fld, string attribute)
        {
            string arg = "$P(D EN^DDIOL($$GET1^DID(\"9000010.23\",\".02\",\"\",\"LABEL\")),U,1)";
            string rtn = VistaUtils.getVariableValue(cxn, arg);

            return(rtn);
        }
Пример #4
0
        public string getRpcName(string rpcIEN)
        {
            string arg      = "$P($G(^XWB(8994," + rpcIEN + ",0)),U,1)";
            string response = VistaUtils.getVariableValue(cxn, arg);

            return(response);
        }
Пример #5
0
        public void TestAdjustForNumericSearchInt64()
        {
            string longDfn = "5587247575";
            string output  = VistaUtils.adjustForNumericSearch(longDfn);

            Assert.AreEqual("5587247574", output);
        }
Пример #6
0
        public RemoteApplicationRecord getRecord(AbstractConnection cxn, KeyValuePair <string, string> param)
        {
            string ien = "";
            string arg = "";

            if (param.Key == "IEN")
            {
                ien = param.Value;
            }
            else if (param.Key == "NAME")
            {
                arg = "$O(^XWB(8994.5,\"B\",\"" + param.Value + "\",0))";
                ien = VistaUtils.getVariableValue(cxn, arg);
            }
            else if (param.Key == "APPLICATIONCODE")
            {
                arg = "$O(^XWB(8994.5,\"ACODE\",\"" + param.Value + "\",0))";
                ien = VistaUtils.getVariableValue(cxn, arg);
            }
            else
            {
                throw new ArgumentException("Invalid field name");
            }
            if (ien == "")
            {
                return(null);
            }
            arg = "$G(^XWB(8994.5," + ien + ",0))";
            string response = VistaUtils.getVariableValue(cxn, arg);

            return(toRecord(cxn, ien, response));
        }
Пример #7
0
        internal bool hasMoreProstheticClaimData(string claimId)
        {
            string arg      = "$D(^RMPR(660," + claimId + ",0))";
            string response = VistaUtils.getVariableValue(cxn, arg);

            return(response == "1");
        }
Пример #8
0
        public void testRemoveCtlChars()
        {
            string s      = "A\x0009B _~\\1\x000A\x000D2\x0001Cv\x001Aend";
            string result = VistaUtils.removeCtlChars(s);

            Assert.AreEqual("A\tB _~\\1\n\r2Cvend", result);
        }
Пример #9
0
        public void adjustForNameSearch_Emtpy()
        {
            string target = "";
            string result = VistaUtils.adjustForNameSearch(target);

            Assert.AreEqual("", result);
        }
Пример #10
0
        public RadiologyReport[] getRadiologyReports(string dfn, string fromDate, string toDate, int nrpts)
        {
            MdoQuery request  = VistaUtils.buildReportTextRequest(dfn, fromDate, toDate, nrpts, "OR_R18:IMAGING~RIM;ORDV08;0;");
            string   response = (string)cxn.query(request);

            return(toRadiologyReports(response));
        }
Пример #11
0
        public void adjustForNumericSearch()
        {
            string target = "404";
            string result = VistaUtils.adjustForNumericSearch(target);

            Assert.AreEqual("403", result);
        }
Пример #12
0
        public void buildFromToDateScreenParam_EmptyFrom()
        {
            var result = VistaUtils.buildFromToDateScreenParam("", "20081118.140400", 0, 0);

            Assert.IsNotNull(result);
            Assert.AreEqual("", result);
        }
Пример #13
0
        public void adjustForNumericSearch_Empty()
        {
            string target = "";
            string result = VistaUtils.adjustForNumericSearch(target);

            Assert.IsNull(result);
        }
Пример #14
0
        public void adjustForNameSearch_Null()
        {
            string target = null;
            string result = VistaUtils.adjustForNameSearch(target);

            Assert.IsNull(result);
        }
Пример #15
0
        internal MdoQuery buildGetLrDfnRequest(string dfn)
        {
            VistaUtils.CheckRpcParams(dfn);
            string arg = "$G(^DPT(\"" + dfn + "\",\"LR\"))";

            return(VistaUtils.buildGetVariableValueRequest(arg));
        }
Пример #16
0
        public void adjustForNumericSearch_NAN()
        {
            string target = "asdfjk12";
            string result = VistaUtils.adjustForNumericSearch(target);

            Assert.IsNull(result);
        }
Пример #17
0
        public void adjustForNumericSearch_Null()
        {
            string target = null;
            string result = VistaUtils.adjustForNumericSearch(target);

            Assert.AreEqual("-1", result);
        }
Пример #18
0
        internal MdoQuery buildGetLatestVitalSignsRequest(string dfn)
        {
            VistaUtils.CheckRpcParams(dfn);
            VistaQuery vq = new VistaQuery("ORQQVI VITALS");

            vq.addParameter(vq.LITERAL, dfn);
            return(vq);
        }
Пример #19
0
 public void isWellFormedDuz()
 {
     Assert.IsFalse(VistaUtils.isWellFormedDuz(null));
     Assert.IsFalse(VistaUtils.isWellFormedDuz("basdf12"));
     Assert.IsFalse(VistaUtils.isWellFormedDuz(""));
     Assert.IsFalse(VistaUtils.isWellFormedDuz("!@#$%"));
     Assert.IsTrue(VistaUtils.isWellFormedDuz("12354"));
 }
Пример #20
0
 public void toStringDictionary_BadResponse()
 {
     VistaUtils.toStringDictionary(
         new String[] {
         "nokeyvalue"
     }
         );
 }
Пример #21
0
        internal MdoQuery buildGetConsultNoteRequest(string consultIen)
        {
            VistaUtils.CheckRpcParams(consultIen);
            VistaQuery vq = new VistaQuery("ORQQCN DETAIL");

            vq.addParameter(vq.LITERAL, consultIen);
            return(vq);
        }
Пример #22
0
        internal MdoQuery buildGetOrderNumberForConsultRequest(string consultIen)
        {
            VistaUtils.CheckRpcParams(consultIen);
            VistaQuery vq = new VistaQuery("ORQQCN GET ORDER NUMBER");

            vq.addParameter(vq.LITERAL, consultIen);
            return(vq);
        }
Пример #23
0
        internal MdoQuery buildGetConsultsForPatientRequest(string dfn)
        {
            VistaUtils.CheckRpcParams(dfn);
            VistaQuery vq = new VistaQuery("ORQQCN LIST");

            vq.addParameter(vq.LITERAL, dfn);
            return(vq);
        }
Пример #24
0
        internal MdoQuery buildGetExamListRequest(string dfn)
        {
            VistaUtils.CheckRpcParams(dfn);
            VistaQuery vq = new VistaQuery("ORWRA IMAGING EXAMS1");

            vq.addParameter(vq.LITERAL, dfn);
            return(vq);
        }
Пример #25
0
        public override string getServerTimeout()
        {
            string   arg      = "$P($G(^XTV(8989.3,1,\"XWB\")),U)";
            MdoQuery request  = VistaUtils.buildGetVariableValueRequest(arg);
            string   response = (string)query(request);

            return(response);
        }
Пример #26
0
        public void errMsgOr0()
        {
            string response = "1^my error^is^not^your error";

            Assert.AreEqual("my error", VistaUtils.errMsgOrZero(response));

            response = "0^this should be^ok";
            Assert.AreEqual("OK", VistaUtils.errMsgOrZero(response));
        }
Пример #27
0
        public void reverseKeyValue_ReverseCausesDuplicates()
        {
            StringDictionary sd = new StringDictionary();

            sd.Add("1", "one");
            sd.Add("2", "ONE");

            VistaUtils.reverseKeyValue(sd);
        }
Пример #28
0
 public void toStringDictionary_DuplicateKeys()
 {
     VistaUtils.toStringDictionary(
         new String[] {
         "lower1^lower1value",
         "lower2^lower2value",
         "LOWER1^LOWER1value"
     }
         );
 }
 public StringDictionary getLookupTable(string fileNum)
 {
     if (!lookupTables.ContainsKey(fileNum))
     {
         DdrLister query    = buildIenNameQuery(fileNum);
         string[]  response = query.execute();
         lookupTables.Add(fileNum, VistaUtils.toStringDictionary(response));
     }
     return((StringDictionary)lookupTables[fileNum]);
 }
Пример #30
0
        public void getVisitString_BadTS()
        {
            Encounter x = new Encounter();

            x.LocationId = "my location id";
            x.Timestamp  = "hubahub";
            x.Type       = "the third kind";

            VistaUtils.getVisitString(x);
        }