7. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 8/8/2017 4:09:17 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

7.1 Files compared

# Location File Last Modified
1 Purch Care Auth Compliance P3.zip\AET4.Server\AETService PRPA1305.cs Thu Jan 5 15:51:00 2017 UTC
2 Purch Care Auth Compliance P3.zip\AET4.Server\AETService PRPA1305.cs Tue Aug 8 14:18:39 2017 UTC

7.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 1532
Changed 2 4
Inserted 0 0
Removed 0 0

7.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

7.4 Active regular expressions

No regular expressions were active.

7.5 Comparison detail

  1   /*
  2    * Program  Name: New  Standards  and Opera ting Rules  - Payer S ide (POR)
  3    * Contrac tor Name:  Harris Cor poration
  4    * Contrac t Number:  VA118-11-D -1009
  5    * Project : POR - CO RE Complia nce - Auto mated Elig ibility To ol (AET)
  6    * 
  7    * Develop er: Zach B ertram
  8    * Date: 0 3.05.2013
  9    * ------- ---------
  10    * Expose  SSN, DOB,  and First  and Last N ame return ed by MVI  for valida tion
  11    */
  12  
  13   using Syst em;
  14   using Syst em.Text;
  15   using Syst em.IO;
  16   using Syst em.Net;
  17   using Syst em.Xml;
  18   using Syst em.Securit y.Cryptogr aphy.X509C ertificate s;
  19   using Syst em.Securit y.Policy;
  20   using AETS hared;
  21  
  22   namespace  AETService
  23   {
  24       class  PRPA1305
  25       {
  26  
  27           pr ivate stri ng m_post_ data = str ing.Empty;
  28  
  29           pr ivate stri ng m_url =  string.Em pty;
  30           pr ivate stri ng m_mviID  = string. Empty;
  31  
  32           pr ivate stri ng m_lname  = string. Empty;
  33           pr ivate stri ng m_fname  = string. Empty;
  34           pr ivate stri ng m_mname  = string. Empty;
  35           pr ivate stri ng m_suffi x = string .Empty;
  36           pr ivate stri ng m_gende r = string .Empty;
  37           pr ivate stri ng m_dob =  string.Em pty;
  38           pr ivate stri ng m_ssn =  string.Em pty;
  39           pr ivate stri ng m_mvipa yload = st ring.Empty ;
  40           pr ivate int  m_logid =  0;
  41  
  42           pr ivate stri ng m_mvipk i = string .Empty;
  43           pr ivate bool  m_WriteLo g = false;
  44  
  45           X5 09Certific ate certif icate;
  46  
  47           pu blic strin g MviPaylo ad
  48           {
  49                get { re turn m_mvi payload; }
  50                set { m_ mvipayload  = value;  }
  51           }
  52  
  53           pu blic strin g MviPki
  54           {
  55                get { re turn m_mvi pki; }
  56                set { m_ mvipki = v alue; }
  57           }
  58  
  59           pu blic bool  WriteLog
  60           {
  61                get { re turn m_Wri teLog; }
  62                set { m_ WriteLog =  value; }
  63           }
  64  
  65           pu blic int L OGID
  66           {
  67                get { re turn m_log id; }
  68                set { m_ logid = va lue; }
  69           }
  70  
  71           pu blic strin g URL
  72           {
  73                get { re turn m_url ; }
  74                set { m_ url = valu e; }
  75           }
  76           pu blic strin g MVI_ID
  77           {
  78                get { re turn m_mvi ID; }
  79                set { m_ mviID = va lue; }
  80           }
  81           pu blic strin g FirstNam e
  82           {
  83                get { re turn m_fna me; }
  84                set { m_ fname = va lue; }
  85           }
  86           pu blic strin g LastName
  87           {
  88                get { re turn m_lna me; }
  89                set { m_ lname = va lue; }
  90           }
  91           pu blic strin g MiddleNa me
  92           {
  93                get { re turn m_mna me; }
  94                set { m_ mname = va lue; }
  95           }
  96           pu blic strin g Suffix
  97           {
  98                get { re turn m_suf fix; }
  99                set { m_ suffix = v alue; }
  100           }
  101           pu blic strin g Gender
  102           {
  103                get { re turn m_gen der; }
  104                set { m_ gender = v alue; }
  105           }
  106           pu blic strin g DOB
  107           {
  108                get { re turn m_dob ; }
  109                set { m_ dob = valu e; }
  110           }
  111           pu blic strin g SSN
  112           {
  113                get { re turn m_ssn ; }
  114                set { m_ ssn = valu e; }
  115           }
  116           // ////////// ////////// ////////// ////////// ////////// ////////// ////////// //
  117           // / <summary >
  118           // / //////// ////////// //
  119           // / Read the  file poin ted to by  fileName
  120           // / </summar y>
  121           // / <param n ame="fileN ame"></par am>
  122           // / <returns ></returns >
  123           pu blic strin g GetFileD ata(string  fileName)
  124           {
  125                string R tnData = " ";
  126                try
  127                {
  128                    usin g (StreamR eader sr =  new Strea mReader(fi leName))
  129                    {
  130                         //This all ows you to  do one Re ad operati on.
  131                         RtnData =  sr.ReadToE nd();
  132                    }
  133                }
  134                catch (E xception e )
  135                {
  136                    Cons ole.WriteL ine("The p rocess fai led: {0}",  e);
  137                    //Lo gging.Writ eLogFile(" Exception  in GetFile Data() for  filename  " + fileNa me + ", ="  + e.Messa ge);
  138                }
  139  
  140                return R tnData;
  141           }
  142           // / <summary >
  143           // / //////// ////////// ////////// ////////// ////////// ////////// ////////// ////
  144           // / </summar y>
  145           // / <returns ></returns >
  146           pu blic strin g GET_VPID (X509Certi ficate Cer tificate)
  147           {
  148                string v pid = stri ng.Empty;
  149                bool MVI Error = fa lse;
  150                bool bLo gMVIPostXM L = m_Writ eLog;
  151  
  152                certific ate = Cert ificate;
  153  
  154                //if (m_ WriteLog ! = "YES")
  155                //bLogMV IPostXML =  false;
  156  
  157                if (m_ur l.Trim().L ength == 0 )
  158                {
  159                    MVIE rror = tru e;
  160                    vpid  = "ERR:"  + "NO URL" ;
  161                    //Lo gging.Writ eLogFile(" Error in G ET_VPID()  = " + vpid );
  162                    retu rn vpid;
  163                }
  164                //////// ////////// ////////// ////////// ////////// ////////// ///
  165                // Get n ext mesage  control n umber
  166  
  167                int nCtl  = m_logid ;
  168                //////// ////////// ////////// ////////// ////////// ////////// ///
  169  
  170  
  171                DateTime  dateTime  = DateTime .Now;
  172                string c reationTim e_value =  dateTime.T oString("y yyyMMdd HH mmss");  / / Creation  Time 
  173                creation Time_value  = creatio nTime_valu e.Replace( " ", "");
  174  
  175                string r eceiver_de vice_class Code = "DE V";
  176                string s ender_devi ce_id_exte nsion = re ceiver_dev ice_classC ode;
  177                string H APE_ID = m _mviID;                                                // Our MVI  Id = "200 HAPE";
  178  
  179                string l ivingSubje ctAdminist rativeGend er_value_c ode = m_ge nder;      // "M";
  180                string l ivingSubje ctBirthTim e_value_va lue1 = m_d ob;                   // "197805 12";
  181                string l ivingSubje ctId_value _extension  = m_ssn;                        // "11111- 111";
  182  
  183                string l ivingSubje ctName_val ue_family  = m_lname;                       // "LOPEZ" ;
  184                string l ivingSubje ctName_val ue_given =  m_fname;                        // "Daniel ";
  185                string l ivingSubje ctName_val ue_middle  = m_mname;                       // "";
  186                string l ivingSubje ctName_val ue_suffix  = m_suffix ;                     // "";
  187  
  188                  string soa pHEADER =  "<?xml ver sion=\"1.0 \" encodin g=\"utf-8\ "?><soap:E nvelope xm lns:soap=\ "http://sc hemas.xmls oap.org/so ap/envelop e/\" xmlns :xsi=\"htt p://www.w3 .org/2001/ XMLSchema- instance\"  xmlns:xsd =\"http:// www.w3.org /2001/XMLS chema\"><s oap:Body>< PRPA_IN201 305UV02 xs i:type=\"x sd:string\ " xmlns=\" http:// URL           . DNS \">";
  189                string s oapTRAILER  = "</PRPA _IN201305U V02></soap :Body></so ap:Envelop e>";
  190  
  191                string o utXML = st ring.Empty ;
  192  
  193                try
  194                {
  195  
  196                    PRPA _IN201305U V02 PRPA_1 305 = new  PRPA_IN201 305UV02();
  197                    PRPA _1305.cont rolActProc ess = new  PRPA_IN201 305UV02Con trolActPro cess();
  198                    PRPA _1305.crea tionTime =  new PRPA_ IN201305UV 02Creation Time();
  199  
  200                    PRPA _1305.id =  new id();
  201                    PRPA _1305.id.r oot = "1.2 .840.11435 0.1.13.0.1 .7.1.1";
  202                    PRPA _1305.id.e xtension =  String.Fo rmat("VIST A-5010-{0} ", nCtl);
  203  
  204                    PRPA _1305.inte ractionId  = new PRPA _IN201305U V02Interac tionId();
  205                    PRPA _1305.inte ractionId. root = "2. 16.840.1.1 13883.1.6" ;
  206                    PRPA _1305.inte ractionId. extension  = "PRPA_IN 201305UV02 ";
  207                    PRPA _1305.ITSV ersion = " XML_1.0";
  208                    PRPA _1305.crea tionTime.v alue = cre ationTime_ value;
  209  
  210                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  211                    PRPA _1305.acce ptAckCode  = new PRPA _IN201305U V02AcceptA ckCode();
  212                    PRPA _1305.cont rolActProc ess = new  PRPA_IN201 305UV02Con trolActPro cess();
  213                    PRPA _1305.cont rolActProc ess.classC ode = "CAC T";
  214                    PRPA _1305.cont rolActProc ess.moodCo de = "EVN" ;
  215                    PRPA _1305.cont rolActProc ess.code =  new PRPA_ IN201305UV 02ControlA ctProcessC ode();
  216                    PRPA _1305.cont rolActProc ess.code.c ode = "PRP A_TE201305 UV02";
  217                    PRPA _1305.cont rolActProc ess.code.c odeSystem  = "2.16.84 0.1.113883 .1.6";
  218                    PRPA _1305.cont rolActProc ess.queryB yParameter  = new PRP A_IN201305 UV02Contro lActProces sQueryByPa rameter();
  219                    PRPA _1305.cont rolActProc ess.queryB yParameter .queryId =  new PRPA_ IN201305UV 02ControlA ctProcessQ ueryByPara meterQuery Id();
  220                    PRPA _1305.cont rolActProc ess.queryB yParameter .queryId.r oot = "1.2 .840.11435 0.1.13.28. 1.18.5.999 ";
  221                    PRPA _1305.cont rolActProc ess.queryB yParameter .queryId.e xtension =  "18204";
  222                    PRPA _1305.cont rolActProc ess.queryB yParameter .initialQu antity = n ew PRPA_IN 201305UV02 ControlAct ProcessQue ryByParame terInitial Quantity() ;
  223                    PRPA _1305.cont rolActProc ess.queryB yParameter .statusCod e = new PR PA_IN20130 5UV02Contr olActProce ssQueryByP arameterSt atusCode() ;
  224                    PRPA _1305.cont rolActProc ess.queryB yParameter .statusCod e.code = " new";
  225                    PRPA _1305.cont rolActProc ess.queryB yParameter .initialQu antity.val ue = "1";
  226                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  227                    PRPA _1305.proc essingCode  = new PRP A_IN201305 UV02Proces singCode() ;
  228                    PRPA _1305.proc essingCode .code = "T ";
  229                    PRPA _1305.proc essingMode Code = new  PRPA_IN20 1305UV02Pr ocessingMo deCode();
  230                    PRPA _1305.proc essingMode Code.code  = "I";
  231                    PRPA _1305.acce ptAckCode  = new PRPA _IN201305U V02AcceptA ckCode();
  232                    PRPA _1305.acce ptAckCode. code = "AL ";
  233                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  234                    PRPA _1305.rece iver = new  PRPA_IN20 1305UV02Re ceiver();
  235                    PRPA _1305.rece iver.devic e = new de vice();
  236                    PRPA _1305.rece iver.devic e.classCod e = receiv er_device_ classCode;
  237                    PRPA _1305.rece iver.devic e.determin erCode = " INSTANCE";
  238                    PRPA _1305.rece iver.devic e.id = new  id();
  239                    PRPA _1305.rece iver.devic e.telecom  = new devi ceTelecom( );
  240                    PRPA _1305.rece iver.devic e.telecom. value = "h ttp://serv icelocatio n/PDQuery" ;
  241                    PRPA _1305.rece iver.devic e.id.root  = "1.2.840 .114350.1. 13.999.234 ";
  242                    PRPA _1305.rece iver.typeC ode = "RCV ";
  243                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  244  
  245                    PRPA _1305.send er = new P RPA_IN2013 05UV02Send er();
  246                    PRPA _1305.send er.device  = new devi ce();
  247                    PRPA _1305.send er.typeCod e = "SND";
  248                    PRPA _1305.send er.device. classCode  = sender_d evice_id_e xtension;
  249                    PRPA _1305.send er.device. determiner Code = "IN STANCE";
  250                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  251                    //                                                 MVI Inte rnal ID
  252                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  253                    PRPA _1305.send er.device. id = new i d();
  254                    PRPA _1305.send er.device. id.extensi on = HAPE_ ID;
  255                    PRPA _1305.send er.device. id.root =  "2.16.840. 1.113883.4 .349";
  256                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  257  
  258                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  259                    // S TART FILL  OF paramet erList (Pa tient Gend er,Patient  Date of B irth,Patie nt SSN,Pat ient Name( Last, Firs t, Middle,  Suffex)
  260                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  261                    PRPA _1305.cont rolActProc ess.queryB yParameter .parameter List = new  PRPA_IN20 1305UV02Co ntrolActPr ocessQuery ByParamete rParameter List();
  262  
  263                    //// ////////// ////////// ////////// ////////// ////[ Gend er ]////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// //
  264                    if ( livingSubj ectAdminis trativeGen der_value_ code.Trim( ).Length >  0)
  265                    {
  266                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctAdminist rativeGend er = new P RPA_IN2013 05UV02Cont rolActProc essQueryBy ParameterP arameterLi stLivingSu bjectAdmin istrativeG ender();
  267                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctAdminist rativeGend er.semanti csText = " LivingSubj ect.admini strativeGe nder";
  268                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctAdminist rativeGend er.value =  new value ();
  269                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctAdminist rativeGend er.value.c ode = livi ngSubjectA dministrat iveGender_ value_code ;
  270                    }
  271                    //// ////////// ////////// ////////// ////////// ////[ Date  of Birth  ]///////// ////////// ////////// ////////// ////////// ////////// ////////// /
  272                    if ( livingSubj ectBirthTi me_value_v alue1.Trim ().Length  > 0)
  273                    {
  274                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctBirthTim e = new PR PA_IN20130 5UV02Contr olActProce ssQueryByP arameterPa rameterLis tLivingSub jectBirthT ime();
  275                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctBirthTim e.semantic sText = "L ivingSubje ct.birthTi me";
  276                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctBirthTim e.value =  new value( );
  277                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctBirthTim e.value.va lue1 = liv ingSubject BirthTime_ value_valu e1;
  278                    }
  279                    //// ////////// ////////// ////////// ////////// ////[ SSN  ]///////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  280                    if ( livingSubj ectId_valu e_extensio n.Trim().L ength > 0)
  281                    {
  282                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctId = new  PRPA_IN20 1305UV02Co ntrolActPr ocessQuery ByParamete rParameter ListLiving SubjectId( );
  283                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctId.value  = new val ue();
  284                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctId.value .root = "2 .16.840.1. 113883.4.1 ";
  285                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctId.value .extension  = livingS ubjectId_v alue_exten sion;
  286                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctId.seman ticsText =  "SSN";
  287                    }
  288                    //// ////////// ////////// ////////// ////////// ////[ Name  ]//////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  289                    PRPA _1305.cont rolActProc ess.queryB yParameter .parameter List.livin gSubjectNa me = new P RPA_IN2013 05UV02Cont rolActProc essQueryBy ParameterP arameterLi stLivingSu bjectName( );
  290                    PRPA _1305.cont rolActProc ess.queryB yParameter .parameter List.livin gSubjectNa me.semanti csText = " LivingSubj ect.name";
  291                    PRPA _1305.cont rolActProc ess.queryB yParameter .parameter List.livin gSubjectNa me.value =  new value ();
  292                    PRPA _1305.cont rolActProc ess.queryB yParameter .parameter List.livin gSubjectNa me.value.u se = "L";
  293  
  294                    if ( livingSubj ectName_va lue_family .Trim().Le ngth > 0)
  295                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctName.val ue.family  = livingSu bjectName_ value_fami ly.Trim();
  296                    if ( livingSubj ectName_va lue_given. Trim().Len gth > 0)
  297                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctName.val ue.given =  livingSub jectName_v alue_given .Trim();
  298                    if ( livingSubj ectName_va lue_suffix .Trim().Le ngth > 0)
  299                         PRPA_1305. controlAct Process.qu eryByParam eter.param eterList.l ivingSubje ctName.val ue.suffix  = livingSu bjectName_ value_suff ix.Trim();
  300  
  301                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  302                    //                                                 END FILL  OF parame terList
  303                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// /
  304  
  305                    Syst em.Xml.Ser ialization .XmlSerial izer prpas er = new S ystem.Xml. Serializat ion.XmlSer ializer(PR PA_1305.Ge tType());
  306                    Syst em.IO.Memo ryStream m s = new Sy stem.IO.Me moryStream ();
  307                    prpa ser.Serial ize(ms, PR PA_1305);
  308                    byte [] bytexml  = ms.GetB uffer();
  309  
  310                    for  (int i = 0 ; i < byte xml.GetLen gth(0); i+ +)
  311                    {
  312                         if ((char) bytexml[i]  != 0)
  313                             outXML  += (char) bytexml[i] ;
  314                    }
  315                    outX ML = outXM L.Replace( "<?xml ver sion=\"1.0 \"?>", "<? xml versio n=\"1.0\"  encoding=\ "UTF-8\"?> ");
  316                    outX ML = outXM L.Replace( "PRPA_IN20 1305UV02 x mlns:xsi=\ "http://ww w.w3.org/2 001/XMLSch ema-instan ce\" xmlns :xsd=\"htt p://www.w3 .org/2001/ XMLSchema\ " ITSVersi on=\"XML_1 .0\" xmlns =\"urn:hl7 -org:v3\"" , "PRPA_IN 201305UV02  xmlns:xsi =\"http:// www.w3.org /2001/XMLS chema-inst ance\" xsi :schemaLoc ation=\"ur n:hl7-org: v3 ../../s chema/hl7V 3/NE2008/m ulticaches chemas/PRP A_IN201305 UV02.xsd\"  xmlns=\"u rn:hl7-org :v3\" ITSV ersion=\"X ML_1.0\"") ;
  317  
  318                    if ( livingSubj ectName_va lue_middle .Trim().Le ngth > 0)
  319                    {
  320                         string tag a = String .Format("< given>{0}< /given>",  livingSubj ectName_va lue_given. Trim());
  321                         string tag b = String .Format("< given>{0}< /given>\r\ n             <given> {1}</given >", living SubjectNam e_value_gi ven.Trim() , livingSu bjectName_ value_midd le.Trim()) ;
  322                         outXML = o utXML.Repl ace(taga,  tagb);
  323                    }
  324  
  325                    //ou tXML=GetFi leData(@"C :\MVI_POST .txt");ES_ POST.txt
  326                    if ( bLogMVIPos tXML)
  327                    {
  328                         string cDr i = Enviro nment.Comm andLine;
  329                         cDri = cDr i.Replace( "AETServic e.exe", "" );
  330                         cDri = cDr i.Replace( "\"", "");
  331                         string MVI PostFile =  String.Fo rmat("{0}{ 1}_1305.xm l", cDri,  m_logid);
  332                         using (Sys tem.IO.Str eamWriter  writer = n ew System. IO.StreamW riter(MVIP ostFile, f alse))
  333                         {
  334                             writer .Write(out XML);
  335                             writer .Close();
  336                         }
  337                    }
  338                    outX ML = outXM L.Replace( "<", "&lt; ");
  339                    outX ML = outXM L.Replace( ">", "&gt; ");
  340                }
  341                catch (E xception e x)
  342                {
  343                    MVIE rror = tru e;
  344                    vpid  = "ERR:"  + ex.Messa ge;
  345                    //Lo gging.Writ eLogFile(" Exception  in GET_VPI D() = " +  ex.Message );
  346                }
  347                finally
  348                {
  349                    if ( !MVIError)
  350                    {
  351                         m_post_dat a = soapHE ADER + out XML + soap TRAILER;
  352                         vpid = Mak eSOAPCall( bLogMVIPos tXML);
  353                    }
  354                }
  355  
  356                return v pid;
  357           }
  358  
  359           // / <summary >
  360           // / //////// ////////// ////////// ////////// ////////// ////////// ////////// //////
  361           // / </summar y>
  362           // / <param n ame="sende r"></param >
  363           // / <param n ame="certi ficate"></ param>
  364           // / <param n ame="chain "></param>
  365           // / <param n ame="sslPo licyErrors "></param>
  366           // / <returns ></returns >
  367           pu blic stati c bool MyC ertValidat ionCb(obje ct sender,  X509Certi ficate cer tificate,  X509Chain  chain, Sys tem.Net.Se curity.Ssl PolicyErro rs sslPoli cyErrors)
  368           {
  369                if (sslP olicyError s == Syste m.Net.Secu rity.SslPo licyErrors .None)
  370                    //Lo gging.Writ eLogFile(" Certificat e Validati on Callbac k: No SSL  policy err ors");
  371                if (sslP olicyError s == Syste m.Net.Secu rity.SslPo licyErrors .RemoteCer tificateNo tAvailable )
  372                    //Lo gging.Writ eLogFile(" Certificat e Validati on Callbac k: Remote  Certificat e Not Avai lable");
  373                if (sslP olicyError s == Syste m.Net.Secu rity.SslPo licyErrors .RemoteCer tificateNa meMismatch )
  374                    //Lo gging.Writ eLogFile(" Certificat e Validati on Callbac k: Remote  Certificat e Name Mis match");
  375                if (sslP olicyError s == Syste m.Net.Secu rity.SslPo licyErrors .RemoteCer tificateCh ainErrors)
  376                    //Lo gging.Writ eLogFile(" Certificat e Validati on Callbac k: Remote  Certificat e Chain Er rors");
  377  
  378                if ((ssl PolicyErro rs & Syste m.Net.Secu rity.SslPo licyErrors .RemoteCer tificateCh ainErrors)
  379                           == Syste m.Net.Secu rity.SslPo licyErrors .RemoteCer tificateCh ainErrors)
  380                {
  381                    retu rn true;
  382                }
  383                else if  ((sslPolic yErrors &  System.Net .Security. SslPolicyE rrors.Remo teCertific ateNameMis match)
  384                                 ==  System.Ne t.Security .SslPolicy Errors.Rem oteCertifi cateNameMi smatch)
  385                {
  386                    Zone  z;
  387                    z =  Zone.Creat eFromUrl(( (HttpWebRe quest)send er).Reques tUri.ToStr ing());
  388                    if ( z.Security Zone == Sy stem.Secur ity.Securi tyZone.Int ranet
  389                      ||  z.Securit yZone == S ystem.Secu rity.Secur ityZone.My Computer)
  390                    {
  391                         return tru e;
  392                    }
  393                    retu rn false;
  394                }
  395                return t rue;
  396           }
  397           // / <summary >
  398           // / //////// ////////// ////////// ////////// ////////// ////////// ////////// //////
  399           // / </summar y>
  400           // / <returns ></returns >
  401  
  402           pr ivate stri ng MakeSOA PCall(bool  bLogMVIPo stXML)
  403           {
  404                bool bSO APError =  false;
  405                bool bFo undCert =  false;
  406                string s RTN = stri ng.Empty;
  407  
  408                string m _sCertName  = m_mvipk i;
  409                int m_ti meOut = 60 ;
  410  
  411                m_lname  = "";  //Z EB VA118-1 1-D-1009 3 /5/13 (+3)  make sure  values se arched for  aren't st ill in out put
  412                m_fname  = "";
  413                m_dob =  "";
  414                m_ssn =  "";
  415                //////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  416                // Make  sure we ha ve some da ta to send .
  417                if (m_po st_data.Le ngth == 0)
  418                {
  419                    bSOA PError = t rue;
  420                    sRTN  = "ERR: P OST data w as empty." ;
  421                    m_mv ipayload =  sRTN;
  422                    //Lo gging.Writ eLogFile(" Error in M akeSOAPCal l() = " +  sRTN);
  423                    retu rn sRTN;
  424                }
  425  
  426                //////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  427                // Insta ll out SSL  CertValid ation call  back func tion
  428                ServiceP ointManage r.ServerCe rtificateV alidationC allback =  MyCertVali dationCb;
  429                //Servic ePointMana ger.Expect 100Continu e = true;
  430                // Enabl e all prot ocols supp orted by . NET Framew ork 4.5.   Let the se rvice deci de which p rotocol to  use
  431                //Servic ePointMana ger.Securi tyProtocol  = Securit yProtocolT ype.Ssl3 |  SecurityP rotocolTyp e.Tls | Se curityProt ocolType.T ls11 | Sec urityProto colType.Tl s12;
  432                ServiceP ointManage r.Security Protocol =  SecurityP rotocolTyp e.Tls11 |  SecurityPr otocolType .Tls12;
  433                byte[] p ostBytes =  Encoding. ASCII.GetB ytes(m_pos t_data);     // turn  our reques t string i nto a byte  stream
  434                //////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  435                // Creat e out http (s) reques t & load t he URL
  436                HttpWebR equest req uest = (Ht tpWebReque st)WebRequ est.Create (m_url);
  437  
  438                //////// ////////// ////////// ////////// ////////// ////////// ////////// //////////
  439                // Open  the x509 S tore and r etreive ou t (LOCAL P KI CERT)
  440                try
  441                {
  442                    if ( certificat e != null)
  443                    {
  444                         request.Cl ientCertif icates.Add (certifica te);
  445                         bFoundCert  = true;
  446                    }
  447                    else
  448                         bFoundCert  = false;
  449  
  450                    //st ring msg =  string.Em pty;
  451                    //st ring[] cer ts = m_sCe rtName.Spl it(';');
  452                    //st ring sCert  = m_sCert Name;
  453  
  454                    //X5 09Store st ore = null ;
  455                    //if  (certs.Le ngth == 2)
  456                    //{
  457                    //     //msg =  String.For mat("Part:  1=[{0}] 2 =[{1}] [{2 }]", certs [0], certs [1], m_sCe rtName);
  458                    //     ////Syst em.Diagnos tics.Event Log.WriteE ntry("AETS ervice", m sg, System .Diagnosti cs.EventLo gEntryType .Informati on);
  459  
  460                    //     store =  new X509St ore(StoreN ame.My, St oreLocatio n.LocalMac hine);
  461  
  462                    //     //store  = new X509 Store(cert s[0], Stor eLocation. LocalMachi ne);
  463                    //     sCert =  certs[1];
  464                    //}
  465                    //el se if (cer ts.Length  == 3)
  466                    //{
  467                    //     //msg =  String.For mat("FULL:  1=[{0}] 2 =[{1}] 3=[ {2}] [{3}] ", certs[0 ], certs[1 ], certs[2 ], m_sCert Name);
  468                    //     ////Syst em.Diagnos tics.Event Log.WriteE ntry("AETS ervice", m sg, System .Diagnosti cs.EventLo gEntryType .Informati on);
  469  
  470                    //     //if (ce rts[2] ==  "lm")
  471                    //     //store  = new X509 Store(cert s[0], Stor eLocation. LocalMachi ne);
  472                    //     //else
  473                    //     //store  = new X509 Store(cert s[0], Stor eLocation. CurrentUse r);
  474  
  475                    //     store =  new X509St ore(StoreN ame.My, St oreLocatio n.LocalMac hine);
  476                    //     sCert =  certs[1];
  477                    //}
  478                    //el se
  479                    //{
  480                    //     //msg =  String.For mat("Defau lt: Truste dPublisher :LocalMach ine: [{0}] ", m_sCert Name);
  481                    //     ////Syst em.Diagnos tics.Event Log.WriteE ntry("AETS ervice", m sg, System .Diagnosti cs.EventLo gEntryType .Informati on);
  482                    //     //store  = new X509 Store(Stor eName.Trus tedPublish er, StoreL ocation.Lo calMachine );
  483                    //     store =  new X509St ore(StoreN ame.My, St oreLocatio n.LocalMac hine);
  484                    //}
  485  
  486                    //st ore.Open(O penFlags.R eadOnly);
  487                    //X5 09Certific ate2Collec tion certi ficates =  store.Cert ificates;
  488  
  489                    //fo reach (X50 9Certifica te2 x509 i n certific ates)
  490                    //{
  491                    //     X500Dist inguishedN ame dname  = new X500 Distinguis hedName(x5 09.Subject Name);
  492                    //     //reques t.ClientCe rtificates .Add(x509) ;   // We  found what  we were l ooking for .
  493                    //     //bFound Cert = tru e;
  494                    //     ////Logg ing.WriteL ogFile("PR PA1305 is  using cert ficate wit h name: "  + dname.Na me);
  495  
  496                    //     if (dnam e.Name.Con tains(sCer t))
  497                    //     {
  498                    //         msg  = String.F ormat("FOU ND {0}", m _sCertName );
  499                    //         //Sy stem.Diagn ostics.Eve ntLog.Writ eEntry("AE TService",  msg, Syst em.Diagnos tics.Event LogEntryTy pe.Informa tion);
  500                    //         requ est.Client Certificat es.Add(x50 9);   // W e found wh at we were  looking f or.
  501                    //         bFou ndCert = t rue;
  502                    //         //Lo gging.Writ eLogFile(" PRPA1305 i s using ce rtficate w ith name:  " + dname. Name);
  503                    //         brea k;
  504                    //     }
  505                    //     //else
  506                    //     //{
  507                    //     //    re quest.Clie ntCertific ates.Add(x 509);   //  We found  what we we re looking  for.
  508                    //     //    x5 09.Reset() ;
  509                    //     //}
  510                    //}
  511                    //st ore.Close( );
  512  
  513                    // S et the fla g that we  loaded our  certifica te
  514                    if ( !bFoundCer t)                                   // Che ck to make  sure we f ound & loa ded the ce rtificate
  515                    {
  516                         bSOAPError  = true;
  517                         sRTN = "ER R:" + Stri ng.Format( "Unable to  locate Ce rt {0}", m _sCertName );
  518                         //Logging. WriteLogFi le("Error  in MakeSOA PCall() =  " + sRTN);
  519                    }
  520                    else
  521                    {
  522                         // The cer tificate w as loaded  so populat e (ONLY TH E ONES NEE DED) the r est of the  Http(s) r equest val ues.
  523                         request.Me thod = "PO ST";
  524                         request.Ke epAlive =  true;
  525                         request.Pr otocolVers ion = Http Version.Ve rsion10;
  526  
  527                         request.Co ntentType  = "text/xm l; charset =utf-8";
  528                         request.Co ntentLengt h = postBy tes.Length ; // this  is importa nt - make  sure you s pecify typ e this way
  529  
  530                         request.Ti meout = 10 00 * m_tim eOut;
  531                         request.Al lowAutoRed irect = tr ue;
  532                    }
  533                }
  534                catch (E xception e x)
  535                {
  536                    bSOA PError = t rue;
  537  
  538                    stri ng errMsg  = String.F ormat("[{0 }]-MVI-3 E xception:  {1}", m_lo gid, ex.Me ssage);
  539                    m_mv ipayload =  errMsg;
  540                    //Sy stem.Diagn ostics.Eve ntLog.Writ eEntry("AE TService",  errMsg, S ystem.Diag nostics.Ev entLogEntr yType.Erro r, 400, 50 0);
  541                    //Lo gging.Writ eLogFile(" Exception  in MakeSOA PCall() =  " + errMsg );
  542                }
  543                //////// ////////// ////////// ////////// ////////// ////////// /////
  544                // All t he pre set up should  be done wh en we get  here
  545                if (bSOA PError)
  546                    retu rn sRTN;
  547  
  548                //Servic ePointMana ger.Expect 100Continu e = true;
  549                //Servic ePointMana ger.Securi tyProtocol  = Securit yProtocolT ype.Tls12;
  550                ServiceP ointManage r.Security Protocol =  SecurityP rotocolTyp e.Tls11 |  SecurityPr otocolType .Tls12;
  551  
  552                // Keith  Baldwin 5 /18/2016 -  MVI call  was blowin g up so I  logged a l ot of info rmation
  553                //Loggin g.WriteLog File("");
  554                //Loggin g.WriteLog File("MVI  m_url: " +  m_url);
  555                //Loggin g.WriteLog File("MVI  m_sCertNam e: " + m_s CertName);
  556                //Loggin g.WriteLog File("MVI  Request.Ur i: " + req uest.Reque stUri.ToSt ring());
  557                //Loggin g.WriteLog File("MVI  Request.Me thod: " +  request.Me thod);
  558                //Loggin g.WriteLog File("MVI  Request.Co ntentType:  " + reque st.Content Type);
  559                //Loggin g.WriteLog File("MVI  Request.Co ntentLengt h: " + req uest.Conte ntLength);
  560                ////Logg ing.WriteL ogFile("Re quest.Meth od: " + re quest.Meth od);
  561                //Servic ePointMana ger.Securi tyProtocol  = Securit yProtocolT ype.Ssl3 |  SecurityP rotocolTyp e.Tls | Se curityProt ocolType.T ls11 | Sec urityProto colType.Tl s12;
  562                if ((Ser vicePointM anager.Sec urityProto col & Secu rityProtoc olType.Ssl 3) == Secu rityProtoc olType.Ssl 3)
  563                    //Lo gging.Writ eLogFile(" MVI: SSL 3  is availa ble for se curity pro tocol");
  564                if ((Ser vicePointM anager.Sec urityProto col & Secu rityProtoc olType.Tls ) == Secur ityProtoco lType.Tls)
  565                    //Lo gging.Writ eLogFile(" MVI: TLS 1 .0 is avai lable for  security p rotocol");
  566                if ((Ser vicePointM anager.Sec urityProto col & Secu rityProtoc olType.Tls 11) == Sec urityProto colType.Tl s11)
  567                    //Lo gging.Writ eLogFile(" MVI: TLS 1 .1 is avai lable for  security p rotocol");
  568                if ((Ser vicePointM anager.Sec urityProto col & Secu rityProtoc olType.Tls 12) == Sec urityProto colType.Tl s12)
  569                    //Lo gging.Writ eLogFile(" MVI: TLS 1 .2 is avai lable for  security p rotocol");
  570                ////Logg ing.WriteL ogFile("MV I m_post_d ata: " + m _post_data );
  571                ////Logg ing.WriteL ogFile("MV I m_mvipay load: " +  m_mvipaylo ad);
  572                ////Logg ing.WriteL ogFile("MV I bLogMVIP ostXML: "  + bLogMVIP ostXML);
  573                //Loggin g.WriteLog File("");
  574  
  575                try
  576                {
  577                    Stre am request Stream = r equest.Get RequestStr eam();   / / Creat a  Request St ream.
  578                    requ estStream. Write(post Bytes, 0,  postBytes. Length); / / Now send  it.
  579                    requ estStream. Close();
  580                }
  581                catch (P rotocolVio lationExce ption ex)
  582                {
  583                    //Lo gging.Writ eLogFile(" Protocol V iolation E xception:  " + ex.Mes sage);
  584                    thro w ex;  //  we rethrow  exception  because t he excepti on handlin g for this  is done a t a higher  level.  T his except ion handle r was adde d to give  us more de tailed inf ormation a bout excep tions.
  585                }
  586                catch (N otSupporte dException  ex)
  587                {
  588                    //Lo gging.Writ eLogFile(" Not Suppor ted Except ion: " + e x.Message) ;
  589                    thro w ex;  //  we rethrow  exception  because t he excepti on handlin g for this  is done a t a higher  level.  T his except ion handle r was adde d to give  us more de tailed inf ormation a bout excep tions.
  590                }
  591                catch (W ebExceptio n ex)
  592                {
  593                    //Lo gging.Writ eLogFile(" Web Except ion: " + e x.Message) ;
  594                    if ( ex.InnerEx ception !=  null)
  595                    {
  596                         //Logging. WriteLogFi le("Inner  Web Except ion: " + e x.InnerExc eption.Mes sage);
  597                         if (ex.Inn erExceptio n.InnerExc eption !=  null)
  598                         {
  599                             //Logg ing.WriteL ogFile("In ner Inner  Web Except ion: " + e x.InnerExc eption.Inn erExceptio n.Message) ;
  600                         }
  601                    }
  602                    if ( ex.Respons e != null)
  603                    {
  604                         //Logging. WriteLogFi le("ex.Res ponse.Resp onseUri: "  + ex.Resp onse.Respo nseUri);
  605                    }
  606                    thro w ex;  //  we rethrow  exception  because t he excepti on handlin g for this  is done a t a higher  level.  T his except ion handle r was adde d to give  us more de tailed inf ormation a bout excep tions.
  607                }
  608                catch (O bjectDispo sedExcepti on ex)
  609                {
  610                    //Lo gging.Writ eLogFile(" Object Dis posed Exce ption: " +  ex.Messag e);
  611                    thro w ex;  //  we rethrow  exception  because t he excepti on handlin g for this  is done a t a higher  level.  T his except ion handle r was adde d to give  us more de tailed inf ormation a bout excep tions.
  612                }
  613                catch (I nvalidOper ationExcep tion ex)
  614                {
  615                    //Lo gging.Writ eLogFile(" Invalid Op eration Ex ception: "  + ex.Mess age);
  616                    thro w ex;  //  we rethrow  exception  because t he excepti on handlin g for this  is done a t a higher  level.  T his except ion handle r was adde d to give  us more de tailed inf ormation a bout excep tions.
  617                }
  618                catch (E xception e x)
  619                {
  620                    //Lo gging.Writ eLogFile(" Exception:  " + ex.Me ssage);
  621                    thro w ex;  //  we rethrow  exception  because t he excepti on handlin g for this  is done a t a higher  level.  T his except ion handle r was adde d to give  us more de tailed inf ormation a bout excep tions.
  622                }
  623  
  624                string s c = string .Empty;
  625                string x mlData = s tring.Empt y;
  626  
  627                try
  628                {
  629                    // G rab te res ponse and  print it o ut to the  console al ong with t he status  code
  630                    Http WebRespons e response  = (HttpWe bResponse) request.Ge tResponse( );
  631                    sc =  response. StatusCode .ToString( );
  632                    usin g (StreamR eader sr =  new Strea mReader(re sponse.Get ResponseSt ream()))
  633                    {
  634                         xmlData =  sr.ReadToE nd();
  635                    }
  636  
  637                    if ( bLogMVIPos tXML)
  638                    {
  639                         string cDr i = Enviro nment.Comm andLine;
  640                         cDri = cDr i.Replace( "AETServic e.exe", "" );
  641                         cDri = cDr i.Replace( "\"", "");
  642                         string MVI PostFile =  String.Fo rmat("{0}{ 1}_1306.xm l", cDri,  m_logid);
  643                         using (Sys tem.IO.Str eamWriter  writer = n ew System. IO.StreamW riter(MVIP ostFile, f alse))
  644                         {
  645                             writer .Write(xml Data);
  646                             writer .Close();
  647                         }
  648                    }
  649                    sRTN  = "OK";
  650  
  651                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ///////
  652                    try
  653                    {
  654                         m_mvipaylo ad = xmlDa ta;
  655                         // Load XM L string i nto an Sys tem.Xml.Xm lDocument
  656                         XmlDocumen t xd = new  XmlDocume nt();
  657                         xd.LoadXml (xmlData);
  658                         // Apply n ecessary X ML namespa ces specif ied in the  XML
  659                         XmlNamespa ceManager  nsMan = ne w XmlNames paceManage r(xd.NameT able);
  660                          nsMan.AddN amespace(" idm", "htt p:// URL           . DNS ");
  661                         nsMan.AddN amespace(" env", "htt p://schema s.xmlsoap. org/soap/e nvelope/") ;
  662                         // Get Cod e
  663                         XmlElement  objectNod e = (XmlEl ement)xd.S electSingl eNode("/en v:Envelope /env:Body/ idm:PRPA_I N201306UV0 2", nsMan) ;
  664                         XmlElement  controlAc tProcess =  (XmlEleme nt)objectN ode.GetEle mentsByTag Name("cont rolActProc ess")[0];
  665                         XmlElement  queryAck  = (XmlElem ent)contro lActProces s.GetEleme ntsByTagNa me("queryA ck")[0];
  666                         XmlNode qu eryRespons eCode = qu eryAck.Get ElementsBy TagName("q ueryRespon seCode")[0 ];
  667                         string cod e = queryR esponseCod e.Attribut es["code"] .Value;
  668                         //string s a = String .Format("C ode: '{0}' ", code);
  669                         if (code ! = "OK")
  670                         {
  671                             sRTN =  code;
  672                         }
  673                         else
  674                         {
  675                             // Get  extension
  676                             XmlEle ment subje ct = (XmlE lement)con trolActPro cess.GetEl ementsByTa gName("sub ject")[0];
  677                             XmlEle ment regis trationEve nt = (XmlE lement)sub ject.GetEl ementsByTa gName("reg istrationE vent")[0];
  678                             XmlEle ment subje ct1 = (Xml Element)re gistration Event.GetE lementsByT agName("su bject1")[0 ];
  679                             XmlEle ment patie nt = (XmlE lement)sub ject1.GetE lementsByT agName("pa tient")[0] ;
  680                             XmlNod eList idNo des = pati ent.GetEle mentsByTag Name("id") ;
  681                             XmlEle ment perso n = (XmlEl ement)pati ent.GetEle mentsByTag Name("pati entPerson" )[0];  //Z EB VA118-1 1-D-1009 3 /5/13 allo w checking  against r eturned in fo
  682  
  683                             foreac h (XmlElem ent name i n person.G etElements ByTagName( "name"))   //ZEB VA11 8-11-D-100 9 3/5/13 ( +foreach)  allow chec king again st returne d info
  684                             {
  685                                 if  (name.Att ributes["u se"].Value  == "L")
  686                                 {
  687                                      m_lname  = name.Get ElementsBy TagName("f amily")[0] .InnerText ;
  688                                      m_fname  = name.Get ElementsBy TagName("g iven")[0]. InnerText;
  689                                 }
  690                             }
  691  
  692                             m_dob  = person.G etElements ByTagName( "birthTime ")[0].Attr ibutes["va lue"].Valu e;  //ZEB  VA118-11-D -1009 3/5/ 13 allow c hecking ag ainst retu rned info
  693  
  694                             foreac h (XmlNode  idNode in  idNodes)
  695                             {
  696                                 st ring root  = idNode.A ttributes[ "root"].Va lue;
  697                                 if  (root ==  "2.16.840. 1.113883.4 .1")  //ZE B VA118-11 -D-1009 3/ 5/13 (+if)  allow che cking agai nst return ed info
  698                                 {
  699                                      m_ssn =  idNode.Att ributes["e xtension"] .Value.Spl it('^')[0] ;
  700                                      continue ;
  701                                 }
  702                                 if  (root ==  null || !r oot.Equals ("2.16.840 .1.113883. 4.349")) c ontinue;
  703                                 st ring exten sion = idN ode.Attrib utes["exte nsion"].Va lue;
  704                                 if  (extensio n == null)  continue;
  705                                 if  (!extensi on.Contain s("NI^200M ^USVHA"))  continue;
  706  
  707                                 st ring[] VPI D = extens ion.Split( '^');
  708                                 sR TN = VPID[ 0];
  709                                 // break;   / /ZEB VA118 -11-D-1009  4/1/13 al low findin g SSN and  ICN
  710                             }
  711                         }
  712                    }
  713                    catc h (Excepti on ex)
  714                    {
  715                         string err Msg = Stri ng.Format( "[{0}]-MVI -1 Excepti on: {1}",  m_logid, e x.Message) ;
  716                         m_mvipaylo ad = errMs g;
  717                         //System.D iagnostics .EventLog. WriteEntry ("AETServi ce", errMs g, System. Diagnostic s.EventLog EntryType. Error, 402 , 500);
  718                         //Logging. WriteLogFi le("Except ion in Mak eSOAPCall( ) = " + er rMsg);
  719                    }
  720                    //// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ///////
  721                }
  722                catch (S ystem.Net. WebExcepti on ex)
  723                {
  724                    // W rite any e xceptions  to a log f ile.
  725                    // W rite any e xceptions  to a log f ile.
  726                    stri ng errMsg  = String.F ormat("[{0 }]-MVI-2 E xception:  {1}", m_lo gid, ex.Me ssage);
  727                    m_mv ipayload =  errMsg;
  728                    //Sy stem.Diagn ostics.Eve ntLog.Writ eEntry("AE TService",  errMsg, S ystem.Diag nostics.Ev entLogEntr yType.Erro r, 404, 50 0);
  729                    //Lo gging.Writ eLogFile(" WebExcepti on in Make SOAPCall()  = " + err Msg);
  730  
  731                    stri ng cDri =  Environmen t.CommandL ine;
  732                    cDri  = cDri.Re place("AET Service.ex e", "");
  733                    cDri  = cDri.Re place("\"" , "");
  734                    stri ng ESPostF ile = Stri ng.Format( "{0}{1}_MV IResponse. xml", cDri , m_logid) ;
  735  
  736                    Http WebRespons e response 1 = (HttpW ebResponse )ex.Respon se;
  737                    usin g (StreamR eader sr1  = new Stre amReader(r esponse1.G etResponse Stream()))
  738                    {
  739                         xmlData =  sr1.ReadTo End();
  740                    }
  741                    if ( response1. StatusCode  == HttpSt atusCode.I nternalSer verError)
  742                    {
  743                         errMsg = S tring.Form at("[{0}]- MVI-3 Exce ption-Data : {1}", m_ logid, xml Data);
  744                         //System.D iagnostics .EventLog. WriteEntry ("AETServi ce", errMs g, System. Diagnostic s.EventLog EntryType. Error, 201 , 500);
  745                         //Logging. WriteLogFi le("Error  in MakeSOA PCall() =  " + errMsg );
  746                         using (Sys tem.IO.Str eamWriter  writer = n ew System. IO.StreamW riter(ESPo stFile, fa lse))
  747                         {
  748                             writer .Write(xml Data);
  749                             writer .Close();
  750                             sRTN =  "NX";
  751                         }
  752                    }
  753                    else
  754                    {
  755                         using (Sys tem.IO.Str eamWriter  writer = n ew System. IO.StreamW riter(ESPo stFile, fa lse))
  756                         {
  757                             //Logg ing.WriteL ogFile("Ex ception in  MakeSOAPC all() = "  + errMsg);
  758                             sRTN =  "ERR:" +  ex.Message ;
  759                             writer .Write(ex. Message);
  760                             writer .Close();
  761                         }
  762                    }
  763                }
  764                return s RTN;
  765           }
  766           // ////////// ////////// ////////// ////////// ////////// ////////// ////////// //
  767       }
  768   }