Example #1
0
        public static string Benefits270(Clearinghouse clearhouse,string x12message)
        {
            com.dentalxchange.webservices.Credentials cred = new com.dentalxchange.webservices.Credentials();
            if(PrefC.GetBool(PrefName.CustomizedForPracticeWeb)) {//even though they currently use code from a different part of the program.
                cred.client="Practice-Web";
                cred.serviceID="DCI Web Service ID: 001513";
            }
            else {
                cred.client="OpenDental";
                cred.serviceID="DCI Web Service ID: 002778";
            }
            cred.version=Application.ProductVersion;
            cred.username=clearhouse.LoginID;
            cred.password=clearhouse.Password;
            com.dentalxchange.webservices.Request request=new com.dentalxchange.webservices.Request();
            request.content=HttpUtility.HtmlEncode(x12message);//get rid of ampersands, etc.
            com.dentalxchange.webservices.WebServiceService service = new com.dentalxchange.webservices.WebServiceService();
            #if DEBUG
            //service.Url = "https://prelive2.dentalxchange.com/dws/services/dciservice.svl"; // testing
            service.Url = "https://webservices.dentalxchange.com/dws/services/dciservice.svl"; // production
            #else
            service.Url = "https://webservices.dentalxchange.com/dws/services/dciservice.svl"; //always use production. So I don't forget
            #endif
            string strResponse="";
            try {
                com.dentalxchange.webservices.Response response = service.lookupEligibility(cred,request);
                strResponse=response.content;
            }
            catch(SoapException ex) {
                strResponse=ex.Message+"\r\n\r\n"+ex.Detail.InnerText+"\r\n\r\n"+"If this is a new customer, this error might also be due to an invalid Username or Password.  Servers may need a few hours before ready to accept new user information.";
            }
            //cleanup response.  Seems to start with \n and 4 spaces.  Ends with trailing \n.
            strResponse=strResponse.Replace("\n","");
            strResponse=strResponse.TrimStart(' ');
            //CodeBase.MsgBoxCopyPaste msgbox=new CodeBase.MsgBoxCopyPaste(response.content);
            //msgbox.ShowDialog();
            return strResponse;

            /*
            string strRawResponse="";
            string strRawResponseNormal="ISA*00*          *00*          *30*330989922      *29*AA0989922      *030606*0936*U*00401*000013966*0*T*:~GS*HB*330989922*AA0989922*20030606*0936*13966*X*004010X092~ST*271*0001~BHT*0022*11*ASX012145WEB*20030606*0936~HL*1**20*1~NM1*PR*2*ACME INC*****PI*12345~HL*2*1*21*1~NM1*1P*1*PROVLAST*PROVFIRST****SV*5558006~HL*3*2*22*0~TRN*2*100*1330989922~NM1*IL*1*SMITH*JOHN*B***MI*123456789~REF*6P*XYZ123*GROUPNAME~REF*18*2484568*TEST PLAN NAME~N3*29 FREMONT ST*~N4*PEACE*NY*10023~DMG*D8*19570515*M~DTP*307*RD8*19910712-19920525~EB*1*FAM*30~SE*17*0001~GE*1*13966~IEA*1*000013966~";
            string strRawResponseFailureAuth=@"<?xml version=""1.0"" encoding=""UTF-8""?>
            <soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">
            <soapenv:Body>
            <soapenv:Fault>
            <faultcode>soapenv:Server.userException</faultcode>
            <faultstring>Authentication failed.</faultstring>
            <faultactor/>
            <detail>
                <string>Authentication failed.</string>
            </detail>
            </soapenv:Fault>
            </soapenv:Body>
            </soapenv:Envelope>";
            string strRawResponseFailure997=@"<?xml version=""1.0"" encoding=""UTF-8""?>
            <soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">
            <soapenv:Body>
            <soapenv:Fault>
            <faultcode>soapenv:Server.userException</faultcode>
            <faultstring>Malformed document sent. Please insure that the format is correct and all required data is present.</faultstring>
            <faultactor/>
            <detail>
                <string>ISA*00*          *00*          *30*330989922      *30*BB0989922      *030606*1351*U*00401*000014066*0*T*:~GS*FA*330989922**20030606*1351*14066*X*004010~ST*997*0001~AK1*HR*100~AK2*276*0001~AK3*DMG*10**8~AK4*2**8*20041210~AK5*R*5~AK9*R*0*0*0*3~SE*8*0001~GE*1*14066~IEA*1*000014066~</string>
            </detail>
            </soapenv:Fault>
            </soapenv:Body>
            </soapenv:Envelope>";
            return strRawResponseNormal;*/

            /*
            XmlDocument doc=new XmlDocument();
            doc.LoadXml(strRawResponse);
            //StringReader strReader=new StringReader(strRawResponseNormal);
            //XmlReader xmlReader=XmlReader.Create(strReader);
            //xmlReader...MoveToElement(
            XmlNode node=doc.SelectSingleNode("//lookupEligibilityReturn");
            if(node!=null) {
                return node.InnerText;//271
            }
            node=doc.SelectSingleNode("//detail/string");
            if(node==null) {
                throw new ApplicationException("Returned data not in expected format: "+strRawResponse);
            }
            if(node.InnerText=="Authentication failed.") {
                throw new ApplicationException("Authentication failed.");
            }
            return node.InnerText;//997
            */
        }
Example #2
0
        ///<summary>Might be able to use newer Dentalxchange2016 web reference instead of using com.dentalexchange.webservices.</summary>
        public static string Benefits270(Clearinghouse clearinghouseClin, string x12message)
        {
            com.dentalxchange.webservices.Credentials cred = new com.dentalxchange.webservices.Credentials();
            if (PrefC.GetBool(PrefName.CustomizedForPracticeWeb))             //even though they currently use code from a different part of the program.
            {
                cred.client    = "Practice-Web";
                cred.serviceID = "DCI Web Service ID: 001513";
            }
            else
            {
                cred.client    = "OpenDental";
                cred.serviceID = "DCI Web Service ID: 002778";
            }
            cred.version  = Application.ProductVersion;
            cred.username = clearinghouseClin.LoginID;
            cred.password = clearinghouseClin.Password;
            com.dentalxchange.webservices.Request request = new com.dentalxchange.webservices.Request();
            request.content = HttpUtility.HtmlEncode(x12message);          //get rid of ampersands, etc.
            com.dentalxchange.webservices.WebServiceService service = new com.dentalxchange.webservices.WebServiceService();
#if DEBUG
            //service.Url = "https://prelive2.dentalxchange.com/dws/services/dciservice.svl"; // testing
            service.Url = "https://webservices.dentalxchange.com/dws/services/dciservice.svl";             // production
#else
            service.Url = "https://webservices.dentalxchange.com/dws/services/dciservice.svl";             //always use production. So I don't forget
#endif
            string strResponse = "";
            try {
                com.dentalxchange.webservices.Response response = service.lookupEligibility(cred, request);
                strResponse = response.content;
            }
            catch (SoapException ex) {
                strResponse = "If this is a new customer, this error might be due to an invalid Username or Password.  Servers may need a few hours before ready to accept new user information.\r\n"
                              + "Error message received directly from Claim Connect:  " + ex.Message + "\r\n\r\n" + ex.Detail.InnerText;
            }
            //cleanup response.  Seems to start with \n and 4 spaces.  Ends with trailing \n.
            strResponse = strResponse.TrimStart('\n');
            //strResponse.Replace("\n","");
            strResponse = strResponse.TrimStart(' ');
            //CodeBase.MsgBoxCopyPaste msgbox=new CodeBase.MsgBoxCopyPaste(response.content);
            //msgbox.ShowDialog();
            return(strResponse);

            /*
             * string strRawResponse="";
             * string strRawResponseNormal="ISA*00*          *00*          *30*330989922      *29*AA0989922      *030606*0936*U*00401*000013966*0*T*:~GS*HB*330989922*AA0989922*20030606*0936*13966*X*004010X092~ST*271*0001~BHT*0022*11*ASX012145WEB*20030606*0936~HL*1**20*1~NM1*PR*2*ACME INC*****PI*12345~HL*2*1*21*1~NM1*1P*1*PROVLAST*PROVFIRST****SV*5558006~HL*3*2*22*0~TRN*2*100*1330989922~NM1*IL*1*SMITH*JOHN*B***MI*123456789~REF*6P*XYZ123*GROUPNAME~REF*18*2484568*TEST PLAN NAME~N3*29 FREMONT ST*~N4*PEACE*NY*10023~DMG*D8*19570515*M~DTP*307*RD8*19910712-19920525~EB*1*FAM*30~SE*17*0001~GE*1*13966~IEA*1*000013966~";
             * string strRawResponseFailureAuth=@"<?xml version=""1.0"" encoding=""UTF-8""?>
             * <soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">
             * <soapenv:Body>
             * <soapenv:Fault>
             * <faultcode>soapenv:Server.userException</faultcode>
             * <faultstring>Authentication failed.</faultstring>
             * <faultactor/>
             * <detail>
             *      <string>Authentication failed.</string>
             * </detail>
             * </soapenv:Fault>
             * </soapenv:Body>
             * </soapenv:Envelope>";
             * string strRawResponseFailure997=@"<?xml version=""1.0"" encoding=""UTF-8""?>
             * <soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">
             * <soapenv:Body>
             * <soapenv:Fault>
             * <faultcode>soapenv:Server.userException</faultcode>
             * <faultstring>Malformed document sent. Please insure that the format is correct and all required data is present.</faultstring>
             * <faultactor/>
             * <detail>
             *      <string>ISA*00*          *00*          *30*330989922      *30*BB0989922      *030606*1351*U*00401*000014066*0*T*:~GS*FA*330989922**20030606*1351*14066*X*004010~ST*997*0001~AK1*HR*100~AK2*276*0001~AK3*DMG*10**8~AK4*2**8*20041210~AK5*R*5~AK9*R*0*0*0*3~SE*8*0001~GE*1*14066~IEA*1*000014066~</string>
             * </detail>
             * </soapenv:Fault>
             * </soapenv:Body>
             * </soapenv:Envelope>";
             * return strRawResponseNormal;*/

            /*
             * XmlDocument doc=new XmlDocument();
             * doc.LoadXml(strRawResponse);
             * //StringReader strReader=new StringReader(strRawResponseNormal);
             * //XmlReader xmlReader=XmlReader.Create(strReader);
             * //xmlReader...MoveToElement(
             * XmlNode node=doc.SelectSingleNode("//lookupEligibilityReturn");
             * if(node!=null) {
             *      return node.InnerText;//271
             * }
             * node=doc.SelectSingleNode("//detail/string");
             * if(node==null) {
             *      throw new ApplicationException("Returned data not in expected format: "+strRawResponse);
             * }
             * if(node.InnerText=="Authentication failed.") {
             *      throw new ApplicationException("Authentication failed.");
             * }
             * return node.InnerText;//997
             */
        }