示例#1
0
        //[Test]
        //public void testGetRadiologyOrderableItemsFrom101x43()
        static IList <String> getRadioOrderableItemsFrom101x43(VistaConnection cxn)
        {
            IList <String> result = new List <String>();

            String[] allOrderableItems = new VistaCrudDao(cxn).readRange("101.43", ".01;5", "", "IP", "#", "", "", "", "", "").Result as String[];
            foreach (String item in allOrderableItems)
            {
                String[] pieces = StringUtils.split(item, StringUtils.CARET);
                if (pieces.Length < 3)
                {
                    continue;
                }

                String ien  = pieces[0];
                String name = pieces[1];
                String orderableItemType = pieces[2];

                if (String.Equals(orderableItemType, "34"))
                {
                    result.Add(ien);
                    //System.Console.WriteLine("Just added " + name + " to radiology orderable items from file 101.43");
                }
            }

            return(result);
        }
示例#2
0
        static void printEntries(VistaConnection cxn)
        {
            Dictionary <String, String> rec1 = new VistaCrudDao(cxn).read("3134,", "*", "101.43", "IEN").Result as Dictionary <String, String>;
            // String[] rec1SubAmis = new VistaCrudDao(cxn).readRange("71.0135", ".01", ",537,", "IP", "#", "", "", "", "", "").Result as String[];
            // String[] rec1SubModality = new VistaCrudDao(cxn).readRange("71.0731", ".01", ",537,", "IP", "#", "", "", "", "", "").Result as String[];

            Dictionary <String, String> rec2 = new VistaCrudDao(cxn).read("3133,", "*", "101.43", "IEN").Result as Dictionary <String, String>;
            // String[] rec2SubAmis = new VistaCrudDao(cxn).readRange("71.0135", ".01", ",542,", "IP", "#", "", "", "", "", "").Result as String[];
            // String[] rec2SubModality = new VistaCrudDao(cxn).readRange("71.0731", ".01", ",542,", "IP", "#", "", "", "", "", "").Result as String[];

            IList <String> uniqueKeys = new List <String>();

            foreach (String key in rec1.Keys)
            {
                uniqueKeys.Add(key);
            }
            foreach (String key in rec2.Keys)
            {
                if (!uniqueKeys.Contains(key))
                {
                    uniqueKeys.Add(key);
                }
            }

            System.Console.WriteLine("\tRec 1 \t\t Rec 2");
            foreach (String key in uniqueKeys)
            {
                String rec1val = rec1.ContainsKey(key) ? rec1[key] : "<empty>";
                String rec2val = rec2.ContainsKey(key) ? rec2[key] : "<empty>";
                System.Console.WriteLine(String.Format("{0} : \t {1} \t\t {2}", key, rec1val, rec2val));
            }
        }
示例#3
0
        static void setCpt(VistaConnection cxn, string procId, string procedureCode, String cptIenToUse)
        {
            Dictionary <String, String> cptsByCode = new Dictionary <string, string>();

            cptsByCode.Add("MR", "70551");
            cptsByCode.Add("CT", "74150");
            cptsByCode.Add("NM", "74150");
            cptsByCode.Add("US", "74150");
            cptsByCode.Add("MA", "70551");
            cptsByCode.Add("AG", "74150");
            cptsByCode.Add("OT", "74150");

            Dictionary <String, String> fieldsToUpdate = new Dictionary <string, string>();

            // fieldsToUpdate.Add("100", "3491231");
            fieldsToUpdate.Add("9", cptIenToUse);

            VistaCrudDao  dao          = new VistaCrudDao(cxn);
            CrudOperation updateResult = dao.update(fieldsToUpdate, (procId + ","), "71");

            //  Dictionary<String, String> fieldsForModality = new Dictionary<string, string>();
            //   fieldsForModality.Add(".01", "3");
            //  dao.create(fieldsForModality, "71.0731", String.Concat(procId, ","));
        }
示例#4
0
        static Dictionary <String, IList <String> > getRadiologyOrderableItemsByType(VistaConnection cxn)
        {
            Dictionary <String, IList <String> > result = new Dictionary <string, IList <string> >();

            result.Add("MR", new List <String>()); // Magnetic Imaging
            result.Add("CT", new List <String>()); // Computed Tomagraphy
            result.Add("NM", new List <String>()); // Nuc Med
            result.Add("US", new List <String>()); // Ultrasound
            result.Add("MA", new List <String>()); // Mammography
            result.Add("AG", new List <String>()); // Angio
            result.Add("OT", new List <String>()); // Using for general radiology

            CrudOperation range = new VistaCrudDao(cxn).readRange("71", ".01;9;12", "", "IP", "#", "", "", "", "", "");

            String[] records = range.Result as String[];
            foreach (String record in records)
            {
                String[] pieces = StringUtils.split(record, StringUtils.CARET);
                if (pieces.Length < 4)
                {
                    continue;
                }
                String id          = pieces[0];
                String cpt         = pieces[2];
                String imagingType = pieces[3];
                if (String.IsNullOrEmpty(imagingType))
                {
                    continue;
                }
                switch (imagingType)
                {
                case "1":
                    result["OT"].Add(id);
                    break;

                case "2":
                    result["NM"].Add(id);
                    break;

                case "3":
                    result["US"].Add(id);
                    break;

                case "4":
                    result["MR"].Add(id);
                    break;

                case "5":
                    result["CT"].Add(id);
                    break;

                case "6":
                    result["AG"].Add(id);
                    break;

                case "9":
                    result["MA"].Add(id);
                    break;

                default:
                    break;
                }
            }

            return(result);
        }