public string execute()
        {
            if (File == "")
            {
                throw new Exception("Must have a file!");
            }
            if (Iens == "")
            {
                throw new Exception("Must have IENS!");
            }
            if (Field == "")
            {
                throw new Exception("Must have a field!");
            }
            if (Value == "")
            {
                throw new Exception("Must have a value!");
            }
            VistaQuery         vq       = new VistaQuery("DDR VALIDATOR");
            DictionaryHashList paramLst = new DictionaryHashList();

            paramLst.Add("\"FILE\"", File);
            paramLst.Add("\"IENS\"", Iens);
            paramLst.Add("\"FIELD\"", Field);
            paramLst.Add("\"VALUE\"", Value);
            vq.addParameter(vq.LIST, paramLst);
            DdrQuery query    = new DdrQuery(cxn);
            string   response = query.execute(vq);

            return(buildResult(response));
        }
Beispiel #2
0
        internal MdoQuery buildRequest()
        {
            if (String.IsNullOrEmpty(File))
            {
                throw new MdoException(MdoExceptionCode.ARGUMENT_NULL, "Must have a file!");
            }
            if (String.IsNullOrEmpty(Iens))
            {
                throw new MdoException(MdoExceptionCode.ARGUMENT_NULL, "Must have an IENS!");
            }
            if (String.IsNullOrEmpty(Fields))
            {
                throw new MdoException(MdoExceptionCode.ARGUMENT_NULL, "Must have a field!");
            }
            VistaQuery         vq       = new VistaQuery("DDR GETS ENTRY DATA");
            DictionaryHashList paramLst = new DictionaryHashList();

            paramLst.Add("\"FILE\"", File);
            paramLst.Add("\"IENS\"", Iens);
            paramLst.Add("\"FIELDS\"", Fields);
            if (!String.IsNullOrEmpty(Flags))
            {
                paramLst.Add("\"FLAGS\"", Flags);
            }
            vq.addParameter(vq.LIST, paramLst);

            return(vq);
        }
        internal MdoQuery buildCancelExamRequest(String examIdentifier, String reasonIen, bool cancelAssociatedOrder, String holdDescription)
        {
            VistaQuery vq = new VistaQuery("RAMAG EXAM CANCEL");

            vq.addParameter(vq.LITERAL, examIdentifier);
            vq.addParameter(vq.LITERAL, reasonIen);

            if (!String.IsNullOrEmpty(holdDescription))
            {
                String[]           holdDescrLines = StringUtils.split(holdDescription, StringUtils.CRLF);
                DictionaryHashList miscOptionDHL  = new DictionaryHashList();
                String             currentLineNo  = "1";
                foreach (String line in holdDescrLines)
                {
                    miscOptionDHL.Add(currentLineNo, String.Format("HOLDESC^{0}^{1}", currentLineNo, line));
                    currentLineNo = Convert.ToString(Convert.ToInt32(currentLineNo) + 1);
                }
                vq.addParameter(vq.LIST, miscOptionDHL);
            }
            else
            {
                vq.addParameter(vq.LIST, new DictionaryHashList());
            }

            if (cancelAssociatedOrder)
            {
                vq.addParameter(vq.LITERAL, "O");
            }
            else
            {
                vq.addParameter(vq.LITERAL, "A");
            }

            return(vq);
        }
        internal MdoQuery buildCancelRadiologyOrderRequest(String orderId, String reasonIen, String holdDescription)
        {
            VistaQuery vq = new VistaQuery("RAMAG ORDER CANCEL");

            vq.addParameter(vq.LITERAL, orderId);
            vq.addParameter(vq.LITERAL, reasonIen);

            if (!String.IsNullOrEmpty(holdDescription))
            {
                String[]           holdDescrLines = StringUtils.split(holdDescription, StringUtils.CRLF);
                DictionaryHashList miscOptionDHL  = new DictionaryHashList();
                String             currentLineNo  = "1";
                foreach (String line in holdDescrLines)
                {
                    miscOptionDHL.Add(currentLineNo, String.Format("HOLDESC^{0}^{1}", currentLineNo, line));
                    currentLineNo = Convert.ToString(Convert.ToInt32(currentLineNo) + 1);
                }
                vq.addParameter(vq.LIST, miscOptionDHL);
            }
            else
            {
                vq.addParameter(vq.LIST, new DictionaryHashList());
            }

            return(vq);
        }
Beispiel #5
0
        internal MdoQuery buildSetSymbolTableRequest(Dictionary <string, object> sessionTable)
        {
            VistaQuery         request = new VistaQuery("XWB DESERIALIZE");
            DictionaryHashList dhl     = new DictionaryHashList();

            string[] allKeys = new string[sessionTable.Count];
            sessionTable.Keys.CopyTo(allKeys, 0);

            for (int i = 0; i < sessionTable.Count; i++)
            {
                dhl.Add((i + 1).ToString(), (object)String.Concat(allKeys[i], '\x1e', sessionTable[allKeys[i]]));
            }

            request.addParameter(request.LIST, dhl);
            return(request);
        }
Beispiel #6
0
 internal MdoQuery buildRequest()
 {
     if (Operation == null || Operation == "")
     {
         throw new ArgumentNullException("Must have an operation");
     }
     VistaQuery vq = new VistaQuery("DDR FILER");
     vq.addParameter(vq.LITERAL, Operation);
     DictionaryHashList lst = new DictionaryHashList();
     for (int i = 0; i < Args.Length; i++)
     {
         lst.Add(Convert.ToString(i+1), Args[i]);
     }
     vq.addParameter(vq.LIST, lst);
     return vq;
 }
Beispiel #7
0
        internal MdoQuery buildRequest()
        {
            if (Operation == null || Operation == "")
            {
                throw new ArgumentNullException("Must have an operation");
            }
            VistaQuery vq = new VistaQuery("DDR FILER");

            vq.addParameter(vq.LITERAL, Operation);
            DictionaryHashList lst = new DictionaryHashList();

            for (int i = 0; i < Args.Length; i++)
            {
                lst.Add(Convert.ToString(i + 1), Args[i]);
            }
            vq.addParameter(vq.LIST, lst);
            return(vq);
        }
Beispiel #8
0
        internal MdoQuery buildRequest()
        {
            if (String.IsNullOrEmpty(this.Operation))
            {
                throw new ArgumentNullException("Must have an operation");
            }
            VistaQuery vq = new VistaQuery("DDR FILER");

            vq.addParameter(vq.LITERAL, Operation);
            DictionaryHashList lst = new DictionaryHashList();

            for (int i = 0; i < Args.Length; i++)
            {
                lst.Add(Convert.ToString(i + 1), Args[i]);
            }
            vq.addParameter(vq.LIST, lst);
            //vq.addParameter(vq.LITERAL, "E"); // this is where we'd put the flags if they seemed to be useful - tried a few combinations but they seemed to only cause issues
            return(vq);
        }
        internal MdoQuery buildRegisterExamRequest(String orderId, String examDateTime, String examCategory, String hospitalLocation,
                                                   String wardLocation, String service, String techComment)
        {
            VistaQuery vq = new VistaQuery("RAMAG EXAM REGISTER");

            vq.addParameter(vq.LITERAL, orderId);
            vq.addParameter(vq.LITERAL, examDateTime);
            DictionaryHashList miscParams = new DictionaryHashList();
            Int32 miscParamCount          = 1;

            miscParams.Add(miscParamCount.ToString(), "FLAGS^^A");
            miscParamCount++;

            miscParams.Add(miscParamCount.ToString(), "EXAMCAT^^" + examCategory);
            miscParamCount++;


            if (!String.IsNullOrEmpty(hospitalLocation))
            {
                miscParams.Add(miscParamCount.ToString(), "PRINCLIN^^" + hospitalLocation);
                miscParamCount++;
            }
            if (!String.IsNullOrEmpty(wardLocation))
            {
                miscParams.Add(miscParamCount.ToString(), "WARD^^" + wardLocation);
                miscParamCount++;
            }
            if (!String.IsNullOrEmpty(service))
            {
                miscParams.Add(miscParamCount.ToString(), "SERVICE^^" + service);
                miscParamCount++;
            }
            if (!String.IsNullOrEmpty(techComment))
            {
                miscParams.Add(miscParamCount.ToString(), "TECHCOMM^^" + techComment);
                miscParamCount++;
            }

            vq.addParameter(vq.LIST, miscParams);

            return(vq);
        }
Beispiel #10
0
        internal ChemHemReport[] toChemHemReports(string response)
        {
            if (response == "")
            {
                return null;
            }
            DictionaryHashList lst = new DictionaryHashList();
            string[] lines = StringUtils.split(response, StringUtils.CRLF);
            lines = StringUtils.trimArray(lines);

            ChemHemReport rpt = null;
            LabResult rslt = null;
            string ts = "";
            string facilityTag = "";
            string facilityName = "";
            for (int i = 0; i < lines.Length; i++)
            {
                string[] flds = StringUtils.split(lines[i], StringUtils.CARET);
                if (!StringUtils.isNumeric(flds[0]))
                {
                    throw new DataMisalignedException("Invalid fldnum: " + flds[0] + " in lines[" + i + "]");
                }
                int fldnum = Convert.ToInt32(flds[0]);
                switch (fldnum)
                {
                    case 1:
                        string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON);
                        if (parts.Length == 2)
                        {
                            facilityTag = parts[1];
                            facilityName = parts[0];
                        }
                        else if (flds[1] != "")
                        {
                            facilityTag = cxn.DataSource.SiteId.Id;
                            facilityName = flds[1];
                        }
                        else
                        {
                            facilityTag = cxn.DataSource.SiteId.Id;
                            facilityName = cxn.DataSource.SiteId.Name;
                        }
                        break;
                    case 2:
                        if (rpt != null)
                        {
                            if (StringUtils.isEmpty(rslt.Test.RefRange))
                            {
                                if (!StringUtils.isEmpty(rslt.Test.LowRef) &&
                                    !StringUtils.isEmpty(rslt.Test.HiRef))
                                {
                                    rslt.Test.RefRange = rslt.Test.LowRef + " - " + rslt.Test.HiRef;
                                }
                            }
                            rpt.AddResult(rslt);
                        }
                        rslt = new LabResult();
                        rslt.Test = new LabTest();
                        ts = VistaTimestamp.toUtcFromRdv(flds[1]);
                        if (lst[ts] == null)
                        {
                            rpt = new ChemHemReport();
                            rpt.Facility = new SiteId(facilityTag, facilityName);
                            rpt.Timestamp = ts;
                            lst.Add(ts, rpt);
                        }
                        break;
                    case 3:
                        if (flds.Length == 2)
                        {
                            rslt.Test.Name = flds[1];
                        }
                        break;
                    case 4:
                        if (flds.Length == 2)
                        {
                            if (null != rslt)
                                rslt.SpecimenType = flds[1];
                        }
                        break;
                    case 5:
                        if (flds.Length == 2)
                        {
                            rslt.Value = flds[1];
                        }
                        break;
                    case 6:
                        if (flds.Length == 2)
                        {
                            rslt.BoundaryStatus = flds[1];
                        }
                        break;
                    case 7:
                        if (flds.Length == 2)
                        {
                            rslt.Test.Units = flds[1];
                        }
                        break;
                    case 8:
                        if (flds.Length == 2)
                        {
                            rslt.Test.LowRef = flds[1];
                        }
                        break;
                    case 9:
                        if (flds.Length == 2)
                        {
                            rslt.Test.HiRef = flds[1];
                        }
                        break;
                    case 10:
                        if (flds.Length == 2)
                        {
                            rslt.Comment += flds[1] + '\n';
                        }
                        break;
                }
            }

            if (rpt != null)
            {
                if (StringUtils.isEmpty(rslt.Test.RefRange))
                {
                    if (!StringUtils.isEmpty(rslt.Test.LowRef) &&
                        !StringUtils.isEmpty(rslt.Test.HiRef))
                    {
                        rslt.Test.RefRange = rslt.Test.LowRef + " - " + rslt.Test.HiRef;
                    }
                }
                rpt.AddResult(rslt);
            }

            ChemHemReport[] result = new ChemHemReport[lst.Count];
            for (int i = 0; i < lst.Count; i++)
            {
                DictionaryEntry de = lst[i];
                result[i] = (ChemHemReport)de.Value;
            }
            return result;
        }
Beispiel #11
0
 public string execute()
 {
     if (File == "")
     {
         throw new Exception("Must have a file!");
     }
     if (Iens == "")
     {
         throw new Exception("Must have IENS!");
     }
     if (Field == "")
     {
         throw new Exception("Must have a field!");
     }
     if (Value == "")
     {
         throw new Exception("Must have a value!");
     }
     VistaQuery vq = new VistaQuery("DDR VALIDATOR");
     DictionaryHashList paramLst = new DictionaryHashList();
     paramLst.Add("\"FILE\"", File);
     paramLst.Add("\"IENS\"", Iens);
     paramLst.Add("\"FIELD\"", Field);
     paramLst.Add("\"VALUE\"", Value);
     vq.addParameter(vq.LIST, paramLst);
     DdrQuery query = new DdrQuery(cxn);
     string response = query.execute(vq);
     return buildResult(response);
 }
Beispiel #12
0
        internal MdoQuery buildRequest()
        {
            if (String.IsNullOrEmpty(File))
            {
                throw new MdoException(MdoExceptionCode.ARGUMENT_NULL, "Must have a file!");
            }
            if (String.IsNullOrEmpty(Iens))
            {
                throw new MdoException(MdoExceptionCode.ARGUMENT_NULL, "Must have an IENS!");
            }
            if (String.IsNullOrEmpty(Fields))
            {
                throw new MdoException(MdoExceptionCode.ARGUMENT_NULL, "Must have a field!");
            }
            VistaQuery vq = new VistaQuery("DDR GETS ENTRY DATA");
            DictionaryHashList paramLst = new DictionaryHashList();
            paramLst.Add("\"FILE\"", File);
            paramLst.Add("\"IENS\"", Iens);
            paramLst.Add("\"FIELDS\"", Fields);
            if (!String.IsNullOrEmpty(Flags))
            {
                paramLst.Add("\"FLAGS\"", Flags);
            }
            vq.addParameter(vq.LIST, paramLst);

            return vq;
        }
Beispiel #13
0
 public Order writeSimpleOrderByPolicy(
     Patient patient,
     String duz,
     String esig,
     String locationIen,
     String orderIen,
     DateTime startDate,
     string reason)
 {
     OrderDialog dlg = bldQRSP(patient, duz, locationIen, orderIen, "0;C;0;0", "", "0", "0");
     dlg.Responses = getOrderResponses(dlg.ResponseId);
     OrderDialogName dlgName = getOrderDialogName(orderIen);
     VistaQuery vq = new VistaQuery("ORWDX SAVE");
     vq.addParameter(vq.LITERAL, patient.LocalPid);
     vq.addParameter(vq.LITERAL, duz);
     vq.addParameter(vq.LITERAL, locationIen);
     vq.addParameter(vq.LITERAL, dlgName.BaseName);
     vq.addParameter(vq.LITERAL, dlg.DisplayGrp);
     vq.addParameter(vq.LITERAL, orderIen);
     vq.addParameter(vq.LITERAL, "");
     DictionaryHashList lst = new DictionaryHashList();
     OrderResponse[] responses = dlg.Responses;
     for (int i = 0; i < responses.Length; i++)
     {
         if (responses[i].PromptId == "6")
         {
             String vistaTS = VistaTimestamp.fromDateTime(startDate);
             lst.Add(responses[i].PromptId + ',' + responses[i].Instance, vistaTS);
         }
         else
         {
             lst.Add(responses[i].PromptId + ',' + responses[i].Instance, responses[i].Ivalue);
         }
     }
     lst.Add("\"ORCHECK\"", "0");
     lst.Add("\"ORTS\"", "0");
     vq.addParameter(vq.LIST, lst);
     vq.addParameter(vq.LITERAL, "");
     vq.addParameter(vq.LITERAL, "");
     vq.addParameter(vq.LITERAL, "");
     vq.addParameter(vq.LITERAL, "0");
     String rtn = (String)cxn.query(vq);
     if (StringUtils.isEmpty(rtn))
     {
         return null;
     }
     String[] flds = StringUtils.split(rtn, StringUtils.CARET);
     Order order = new Order();
     order.Id = flds[0].Substring(1);
     order.Timestamp = VistaTimestamp.toDateTime(flds[2]);
     order.StartDate = VistaTimestamp.toDateTime(flds[3]);
     order.StopDate = VistaTimestamp.toDateTime(flds[4]);
     order.Status = flds[5];
     order.SigStatus = flds[6];
     order.VerifyingNurse = flds[7];
     order.VerifyingClerk = flds[8];
     User provider = new User();
     provider.Uid = flds[9];
     provider.Name = new PersonName(flds[10]);
     order.Provider = provider;
     releaseOrderByPolicy(patient.LocalPid, duz, locationIen, esig, order);
     return order;
 }
Beispiel #14
0
 internal MdoQuery buildRequest()
 {
     if (File == "")
     {
         throw new ArgumentNullException("Must have a file!");
     }
     VistaQuery vq = new VistaQuery("DDR LISTER");
     DictionaryHashList paramLst = new DictionaryHashList();
     paramLst.Add("\"FILE\"", File);
     if (Iens != "")
     {
         paramLst.Add("\"IENS\"", Iens);
     }
     if (requestedFields.Length > 0)
     {
         paramLst.Add("\"FIELDS\"", getFieldsArg());
     }
     if (Flags != "")
     {
         paramLst.Add("\"FLAGS\"", Flags);
     }
     if (Max != "")
     {
         paramLst.Add("\"MAX\"", Max);
     }
     if (From != "")
     {
         paramLst.Add("\"FROM\"", From);
     }
     if (Part != "")
     {
         paramLst.Add("\"PART\"", Part);
     }
     if (Xref != "")
     {
         paramLst.Add("\"XREF\"", Xref);
     }
     if (Screen != "")
     {
         paramLst.Add("\"SCREEN\"", Screen);
     }
     if (Id != "")
     {
         paramLst.Add("\"ID\"", Id);
     }
     if (Options != "")
     {
         paramLst.Add("\"OPTIONS\"", Options);
     }
     if (moreFrom != "")
     {
         paramLst.Add("\"FROM\"", moreFrom);
     }
     if (moreIens != "")
     {
         paramLst.Add("\"IENS\"", moreIens);
     }
     vq.addParameter(vq.LIST, paramLst);
     return vq;
 }
        internal ChemHemReport[] toChemHemReports(string response)
        {
            if (response == "")
            {
                return(null);
            }
            DictionaryHashList lst = new DictionaryHashList();

            string[] lines = StringUtils.split(response, StringUtils.CRLF);
            lines = StringUtils.trimArray(lines);

            ChemHemReport rpt          = null;
            LabResult     rslt         = null;
            string        ts           = "";
            string        facilityTag  = "";
            string        facilityName = "";

            for (int i = 0; i < lines.Length; i++)
            {
                string[] flds = StringUtils.split(lines[i], StringUtils.CARET);
                if (!StringUtils.isNumeric(flds[0]))
                {
                    throw new DataMisalignedException("Invalid fldnum: " + flds[0] + " in lines[" + i + "]");
                }
                int fldnum = Convert.ToInt32(flds[0]);
                switch (fldnum)
                {
                case 1:
                    string[] parts = StringUtils.split(flds[1], StringUtils.SEMICOLON);
                    if (parts.Length == 2)
                    {
                        facilityTag  = parts[1];
                        facilityName = parts[0];
                    }
                    else if (flds[1] != "")
                    {
                        facilityTag  = cxn.DataSource.SiteId.Id;
                        facilityName = flds[1];
                    }
                    else
                    {
                        facilityTag  = cxn.DataSource.SiteId.Id;
                        facilityName = cxn.DataSource.SiteId.Name;
                    }
                    break;

                case 2:
                    if (rpt != null)
                    {
                        if (StringUtils.isEmpty(rslt.Test.RefRange))
                        {
                            if (!StringUtils.isEmpty(rslt.Test.LowRef) &&
                                !StringUtils.isEmpty(rslt.Test.HiRef))
                            {
                                rslt.Test.RefRange = rslt.Test.LowRef + " - " + rslt.Test.HiRef;
                            }
                        }
                        rpt.AddResult(rslt);
                    }
                    rslt      = new LabResult();
                    rslt.Test = new LabTest();
                    ts        = VistaTimestamp.toUtcFromRdv(flds[1]);
                    if (lst[ts] == null)
                    {
                        rpt           = new ChemHemReport();
                        rpt.Facility  = new SiteId(facilityTag, facilityName);
                        rpt.Timestamp = ts;
                        lst.Add(ts, rpt);
                    }
                    break;

                case 3:
                    if (flds.Length == 2)
                    {
                        rslt.Test.Name = flds[1];
                    }
                    break;

                case 4:
                    if (flds.Length == 2)
                    {
                        if (null != rslt)
                        {
                            rslt.SpecimenType = flds[1];
                        }
                    }
                    break;

                case 5:
                    if (flds.Length == 2)
                    {
                        rslt.Value = flds[1];
                    }
                    break;

                case 6:
                    if (flds.Length == 2)
                    {
                        rslt.BoundaryStatus = flds[1];
                    }
                    break;

                case 7:
                    if (flds.Length == 2)
                    {
                        rslt.Test.Units = flds[1];
                    }
                    break;

                case 8:
                    if (flds.Length == 2)
                    {
                        rslt.Test.LowRef = flds[1];
                    }
                    break;

                case 9:
                    if (flds.Length == 2)
                    {
                        rslt.Test.HiRef = flds[1];
                    }
                    break;

                case 10:
                    if (flds.Length == 2)
                    {
                        rslt.Comment += flds[1] + '\n';
                    }
                    break;
                }
            }

            if (rpt != null)
            {
                if (StringUtils.isEmpty(rslt.Test.RefRange))
                {
                    if (!StringUtils.isEmpty(rslt.Test.LowRef) &&
                        !StringUtils.isEmpty(rslt.Test.HiRef))
                    {
                        rslt.Test.RefRange = rslt.Test.LowRef + " - " + rslt.Test.HiRef;
                    }
                }
                rpt.AddResult(rslt);
            }

            ChemHemReport[] result = new ChemHemReport[lst.Count];
            for (int i = 0; i < lst.Count; i++)
            {
                DictionaryEntry de = lst[i];
                result[i] = (ChemHemReport)de.Value;
            }
            return(result);
        }
Beispiel #16
0
 public DictionaryHashList getTeams()
 {
     VistaQuery vq = new VistaQuery("ORQPT TEAMS");
     string response = (string)cxn.query(vq);
     if (response == "")
     {
         return null;
     }
     DictionaryHashList result = new DictionaryHashList();
     string[] lines = StringUtils.split(response, StringUtils.CRLF);
     lines = StringUtils.trimArray(lines);
     for (int i = 0; i < lines.Length; i++)
     {
         string[] flds = StringUtils.split(lines[i], StringUtils.CARET);
         result.Add(flds[0], flds[1]);
     }
     return result;
 }
Beispiel #17
0
        internal void sendOrder(String locIen, String esig, Order order)
        {
            VistaQuery vq = new VistaQuery("ORWDX SEND");
            vq.addParameter(vq.LITERAL, cxn.Pid);
            vq.addParameter(vq.LITERAL, "0");
            vq.addParameter(vq.LITERAL, locIen);
            vq.addEncryptedParameter(vq.LITERAL, ' ' + esig);	//' ' apparently needed to avoid a bug in Vista?  See CPRS.
            DictionaryHashList lst = new DictionaryHashList();
            string value = order.Id + '^' +
                VistaConstants.SS_ESIGNED + '^' +
                VistaConstants.RS_RELEASE + '^' +
                VistaConstants.NO_POLICY;
            lst.Add("1", value);
            vq.addParameter(vq.LIST, lst);
            string rtn = (string)cxn.query(vq);
            string[] flds = StringUtils.split(rtn, StringUtils.CARET);
            flds[1] = flds[1].TrimEnd(null);
            if (flds[1] == "RS")
            {
                order.Status = "Released";
            }
            else
            {
                order.Status = "Error: " + flds[3];
                throw new MdoException(MdoExceptionCode.ARGUMENT_INVALID, "Error: This order has been signed!");

            }
        }
Beispiel #18
0
 internal MdoQuery buildGetOrdersRequest(IndexedHashtable t)
 {
     VistaQuery vq = new VistaQuery("ORWORR GET4LST");
     vq.addParameter(vq.LITERAL, "2");
     vq.addParameter(vq.LITERAL, VistaTimestamp.fromDateTime(DateTime.Now));
     DictionaryHashList lst = new DictionaryHashList();
     for (int i = 0; i < t.Count; i++)
     {
         lst.Add(Convert.ToString(i + 1), ((Order)t.GetValue(i)).Id);
     }
     vq.addParameter(vq.LIST, lst);
     return vq;
 }
Beispiel #19
0
 internal void sendOrders(String providerId, String locIen, String esig, Order[] orders)
 {
     VistaQuery vq = new VistaQuery("ORWDX SEND");
     vq.addParameter(vq.LITERAL, cxn.Pid);
     vq.addParameter(vq.LITERAL, providerId);
     vq.addParameter(vq.LITERAL, locIen);
     vq.addParameter(vq.LITERAL, ' ' + esig);	//' ' apparently needed to avoid a bug in Vista?  See CPRS.
     DictionaryHashList lst = new DictionaryHashList();
     for (int i = 0; i < orders.Length; i++)
     {
         string value = orders[i].Id + '^' +
             VistaConstants.SS_ESIGNED + '^' +
             VistaConstants.RS_RELEASE + '^' +
             VistaConstants.NO_POLICY;
         lst.Add(Convert.ToString(i), value);
     }
     string rtn = (string)cxn.query(vq);
     string[] rex = StringUtils.split(rtn, StringUtils.CRLF);
     for (int i = 0; i < rex.Length; i++)
     {
         string[] flds = StringUtils.split(rex[i], StringUtils.CARET);
         if (orders[i].Id != flds[0])
         {
             orders[i].ErrMsg = "ID mismatch returning from send: expected " + orders[i].Id + ", found " + flds[0];
             continue;
         }
         if (flds[1] == "RS")
         {
             orders[i].Status = "Released";
         }
         else
         {
             orders[i].Status = "Error: " + flds[3];
         }
     }
 }
Beispiel #20
0
 internal MdoQuery buildSendOrderByPolicyRequest(string dfn, string locIen, string esig, Order order)
 {
     VistaQuery vq = new VistaQuery("ORWDX SEND");
     vq.addParameter(vq.LITERAL, dfn);
     vq.addParameter(vq.LITERAL, "0");
     vq.addParameter(vq.LITERAL, locIen);
     vq.addEncryptedParameter(vq.LITERAL, ' ' + esig);	//' ' apparently needed to avoid a bug in Vista?  See CPRS.
     DictionaryHashList lst = new DictionaryHashList();
     String value = order.Id + '^' +
         VistaConstants.SS_ESIGNED + '^' +
         VistaConstants.RS_RELEASE + '^' +
         VistaConstants.NO_POLICY;
     lst.Add("1", value);
     vq.addParameter(vq.LIST, lst);
     return vq;
 }
Beispiel #21
0
 internal MdoQuery buildCheckReleaseOrderRequest(Order order, string dfn)
 {
     VistaQuery vq = new VistaQuery("ORWDXC SESSION");
     vq.addParameter(vq.LITERAL, dfn);
     DictionaryHashList lst = new DictionaryHashList();
     lst.Add("1", order.Id + "^^1");
     vq.addParameter(vq.LIST, lst);
     return vq;
 }
Beispiel #22
0
 internal MdoQuery buildGetAdHocHealthSummaryRequest(string DFN, string IEN, string title)
 {
     VistaQuery vq = new VistaQuery("ORWRP2 HS REPORT TEXT");
     DictionaryHashList lst = new DictionaryHashList();
     lst.Add("1", IEN + "^^^" + title + "^^^");
     vq.addParameter(vq.LIST, lst);
     vq.addParameter(vq.LITERAL, DFN);
     return vq;
 }
Beispiel #23
0
 internal MdoQuery buildSaveOrderRequest(
     string pid,
     string duz,
     string locationIEN,
     string dlgBaseName,
     OrderDialog dlg,
     string orderIEN,
     string startDate)
 {
     VistaQuery vq = new VistaQuery("ORWDX SAVE");
     vq.addParameter(vq.LITERAL, pid);
     vq.addParameter(vq.LITERAL, duz);
     vq.addParameter(vq.LITERAL, locationIEN);
     vq.addParameter(vq.LITERAL, dlgBaseName);
     vq.addParameter(vq.LITERAL, dlg.DisplayGrp);
     vq.addParameter(vq.LITERAL, orderIEN);
     vq.addParameter(vq.LITERAL, "");
     DictionaryHashList lst = new DictionaryHashList();
     OrderResponse[] responses = dlg.Responses;
     for (int i = 0; i < responses.Length; i++)
     {
         lst.Add(responses[i].Index, responses[i].Ivalue);
     }
     vq.addParameter(vq.LIST, lst);
     vq.addParameter(vq.LITERAL, "");
     vq.addParameter(vq.LITERAL, "");
     vq.addParameter(vq.LITERAL, "");
     vq.addParameter(vq.LITERAL, "0");
     return vq;
 }
Beispiel #24
0
        internal MdoQuery buildRequest()
        {
            if (File == "")
            {
                throw new ArgumentNullException("Must have a file!");
            }
            VistaQuery         vq       = new VistaQuery("DDR LISTER");
            DictionaryHashList paramLst = new DictionaryHashList();

            paramLst.Add("\"FILE\"", File);
            if (Iens != "")
            {
                paramLst.Add("\"IENS\"", Iens);
            }
            if (_requestedFields.Length > 0)
            {
                paramLst.Add("\"FIELDS\"", getFieldsArg());
            }
            if (Flags != "")
            {
                paramLst.Add("\"FLAGS\"", Flags);
            }
            if (Max != "")
            {
                paramLst.Add("\"MAX\"", Max);
            }
            if (From != "")
            {
                paramLst.Add("\"FROM\"", From);
            }
            if (Part != "")
            {
                paramLst.Add("\"PART\"", Part);
            }
            if (Xref != "")
            {
                paramLst.Add("\"XREF\"", Xref);
            }
            if (Screen != "")
            {
                paramLst.Add("\"SCREEN\"", Screen);
            }
            if (Id != "")
            {
                paramLst.Add("\"ID\"", Id);
            }
            if (Options != "")
            {
                paramLst.Add("\"OPTIONS\"", Options);
            }
            if (moreFrom != "")
            {
                paramLst.Add("\"FROM\"", moreFrom);
            }
            if (moreIens != "")
            {
                paramLst.Add("\"IENS\"", moreIens);
            }
            vq.addParameter(vq.LIST, paramLst);
            return(vq);
        }
Beispiel #25
0
 internal string checkReleaseOrder(Order order)
 {
     VistaQuery vq = new VistaQuery("ORWDXC SESSION");
     vq.addParameter(vq.LITERAL, cxn.Pid);
     DictionaryHashList lst = new DictionaryHashList();
     lst.Add("1", order.Id + "^^1");
     vq.addParameter(vq.LIST, lst);
     return (string)cxn.query(vq);
 }
Beispiel #26
0
        internal MdoQuery buildSetSymbolTableRequest(Dictionary<string, object> sessionTable)
        {
            VistaQuery request = new VistaQuery("XWB DESERIALIZE");
            DictionaryHashList dhl = new DictionaryHashList();
            string[] allKeys = new string[sessionTable.Count];
            sessionTable.Keys.CopyTo(allKeys, 0);

            for (int i = 0; i < sessionTable.Count; i++)
            {
                dhl.Add((i + 1).ToString(), (object)String.Concat(allKeys[i], '\x1e', sessionTable[allKeys[i]]));
            }

            request.addParameter(request.LIST, dhl);
            return request;
        }