76. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/12/2018 10:18:30 AM Central 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.

76.1 Files compared

# Location File Last Modified
1 MSSRe Build 4.zip\Applications\OncoTrax-E40 ONC_RequestEDITS.cpp.newEditSet Tue Apr 10 19:43:40 2018 UTC
2 MSSRe Build 4.zip\Applications\OncoTrax-E40 ONC_RequestEDITS.cpp.newEditSet Wed Apr 11 17:42:00 2018 UTC

76.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 1058
Changed 1 2
Inserted 0 0
Removed 0 0

76.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

76.4 Active regular expressions

No regular expressions were active.

76.5 Comparison detail

  1   /********* ********** ********** ********** ********** ********** ********** ********** /
  2   /*  Packag e:      ON C – Oncolo gy                                                   * /
  3   /*  Date C reated: Ju l 26,2004                                                       * /
  4   /*  Site N ame:    Hi nes OIFO                                                        * /
  5   /*    Developers    Sergey Gav rilov  PII                                             */
  6   /*  Descri ption:  Im plementati on of EDIT S request  processing  classes f or       * /
  7   /*                 On cology Web -service                                             * /
  8   /********* ********** ********** ********** ********** ********** ********** ********** /
  9  
  10   #include " stdafx.h"
  11   #include " OncologyCG I.h"
  12   #include " ONC_Reques ts.h"
  13  
  14   /********* ********** ********** ********** ********** ********** ********** ********** /
  15   /*                            CO NFIGURATIO N MANAGEME NT                             * /
  16   /*-------- ---------- ---------- ---------- ---------- ---------- ---------- ---------* /
  17   /*          !!! CONFI GURATIONS  MUST BE LI STED IN AL PHABETICAL  ORDER !!!          * /
  18   /********* ********** ********** ********** ********** ********** ********** ********** /
  19  
  20   static con st TONCEDI TSConfig C onfigs[] =  {
  21           {/ /     Name                       Metafile                           Version          La yout                                                                Record L ength
  22                    "DEB UG",                  "METAFILE. RMF",          "12.0" ,          "NAACCR DA TA EXCHANG E VS 12",             6694,
  23                    {//               Edit Set  Name                                                                                           Op tions
  24                             {        "VA Hosp : Beta V12 COC",                                                               2                                  },
  25                             {        NULL     }
  26                    },
  27                    {//               Edit Nam e                                                                                                        Opti ons
  28                             {        "Behavio r Code ICD O3, Seq Nu m--Central  (SEER IF1 14)",   EE _SUPPRESS               },
  29                             {        "Behavio r ICDO3, S ite, Histo logy ICDO3  (NAACCR)" ,                EE_S UPPRESS               },
  30                             {        "Cancer  Status (CO C)",                                                                         EE_SKIPEMP TY    },
  31                             {        "Cause o f Death (S EER COD)",                                                          EE_SKIPE MPTY    },
  32                             {        "Cervix  In Situ IC DO2 (SEER  IF88)",                                                  EE_SUPPR ESS              },
  33                             {        "Cervix  In Situ IC DO3 (SEER  IF88)",                                                  EE_SUPPR ESS              },
  34                             {        "Date of  Last Cont act, Date  of Diag. ( NAACCR IF1 9)",    EE _SKIPEMPTY     },
  35                             {        "Date of  Last Cont act (NAACC R DATEEDIT )",                                  EE_SKI PEMPTY     },
  36                             {        "Diagnos tic Confir m, Seq Num --Central  (SEER IF23 )",              EE_S UPPRESS               },
  37                             {        "Follow- Up Source,  Date of D iagnosis ( COC)",                      EE_S KIPEMPTY     },
  38                             {        "Follow- up source  Central (N AACCR)",                                        EE_SUP PRESS              },
  39                             {        "ICD Rev ision Numb er, Cause  of Death ( SEER IF37) ",               EE_S KIPEMPTY     },
  40                             {        "Next Fo llow-Up So urce, Date  of Diagno sis (COC)" ,                EE_S KIPEMPTY     },
  41                             {        "PIN III  ICDO3, Da te of Diag nosis (SEE R IF110)",                  EE_S UPPRESS               },
  42                             {        "RX Date --Rad Ende d, Date La st Contact  (COC)",                    EE_S KIPEMPTY     },
  43                             {        "RX Date --Surgical  Disch, Da te Last Co ntact (COC )",              EE_S KIPEMPTY     },
  44                             {        "RX Date --Systemic , Date Las t Contact  (COC)",                     EE_S KIPEMPTY     },
  45                             {        "Seq Num --Central,  Prim Site , Morph IC DO3(SEER I F22",   EE _SUPPRESS               },
  46                             {        "Type of  Rep Srce( DC),Seq Nu m--Cent,IC DO2(SEER I F04",   EE _SUPPRESS               },
  47                             {        "Type of  Rep Srce( DC),Seq Nu m--Cent,IC DO3(SEER I F04",   EE _SUPPRESS               },
  48                             {        "Vital S tatus (COC )",                                                                          EE_SKIPEMP TY    },
  49                             {        NULL     }
  50                    },
  51                    {//               Field Na me                                                                                                       Opti ons
  52                             {        "Social  Security N umber",                                                                      EE_SUPPRES S              },
  53                             {        "Follow- Up Source  Central",                                                                    EE_SUPPRES S              },
  54                             {        NULL     }
  55                    }
  56           },
  57           {/ /     Name                       Metafile                           Version          La yout                                                                Record L ength
  58                    "DEF AULT",                "METAFILE. RMF",          "12.0" ,          "NAACCR DA TA EXCHANG E VS 12",             6694,
  59                    {//               Edit Set  Name                                                                                           Op tions
  60                             {        "VA Hosp : Beta V12 COC",                                                               2                                  },
  61                             {        NULL     }
  62                    },
  63                    {//               Edit Nam e                                                                                                        Opti ons
  64                             {        "Behavio r Code ICD O3, Seq Nu m--Central  (SEER IF1 14)",   EE _SUPPRESS               },
  65                             {        "Behavio r ICDO3, S ite, Histo logy ICDO3  (NAACCR)" ,                EE_S UPPRESS               },
  66                             {        "Cancer  Status (CO C)",                                                                         EE_SKIPEMP TY    },
  67                             {        "Cause o f Death (S EER COD)",                                                          EE_SKIPE MPTY    },
  68                             {        "Cervix  In Situ IC DO2 (SEER  IF88)",                                                  EE_SUPPR ESS              },
  69                             {        "Cervix  In Situ IC DO3 (SEER  IF88)",                                                  EE_SUPPR ESS              },
  70                             {        "Date of  Last Cont act, Date  of Diag. ( NAACCR IF1 9)",    EE _SKIPEMPTY     },
  71                             {        "Date of  Last Cont act (NAACC R DATEEDIT )",                                  EE_SKI PEMPTY     },
  72                             {        "Diagnos tic Confir m, Seq Num --Central  (SEER IF23 )",              EE_S UPPRESS               },
  73                             {        "Follow- Up Source,  Date of D iagnosis ( COC)",                      EE_S KIPEMPTY     },
  74                             {        "Follow- up source  Central (N AACCR)",                                        EE_SUP PRESS              },
  75                             {        "ICD Rev ision Numb er, Cause  of Death ( SEER IF37) ",               EE_S KIPEMPTY     },
  76                             {        "Next Fo llow-Up So urce, Date  of Diagno sis (COC)" ,                EE_S KIPEMPTY     },
  77                             {        "PIN III  ICDO3, Da te of Diag nosis (SEE R IF110)",                  EE_S UPPRESS               },
  78                             {        "RX Date --Rad Ende d, Date La st Contact  (COC)",                    EE_S KIPEMPTY     },
  79                             {        "RX Date --Surgical  Disch, Da te Last Co ntact (COC )",              EE_S KIPEMPTY     },
  80                             {        "RX Date --Systemic , Date Las t Contact  (COC)",                     EE_S KIPEMPTY     },
  81                             {        "Seq Num --Central,  Prim Site , Morph IC DO3(SEER I F22",   EE _SUPPRESS               },
  82                             {        "Type of  Rep Srce( DC),Seq Nu m--Cent,IC DO2(SEER I F04",   EE _SUPPRESS               },
  83                             {        "Type of  Rep Srce( DC),Seq Nu m--Cent,IC DO3(SEER I F04",   EE _SUPPRESS               },
  84                             {        "Vital S tatus (COC )",                                                                          EE_SKIPEMP TY    },
  85                             {        NULL     }
  86                    },
  87                    {//               Field Na me                                                                                                       Opti ons
  88                             {        "Follow- Up Source  Central",                                                                    EE_SUPPRES S              },
  89                             {        NULL     }
  90                    }
  91           },
  92           {/ /     Name                       Metafile                           Version          La yout                                                                Record L ength
  93                    "FUL L",                   "METAFILE. RMF",          "12.0" ,          "NAACCR DA TA EXCHANG E VS 12",             6694,
  94                    {//               Edit Set  Name                                                                                           Op tions
  95                             {        "VA Hosp : Beta V12 COC",                                                               2                                  },
  96                             {        NULL     }
  97                    },
  98                    {//               Edit Nam e                                                                                                        Opti ons
  99                             {        NULL     }
  100                    },
  101                    {//               Field Na me                                                                                                       Opti ons
  102                             {        "Follow- Up Source  Central",                                                                    EE_SUPPRES S              },
  103                             {        NULL     }
  104                    }
  105           },
  106           {/ /     Name                       Metafile                           Version          La yout                                                                Record L ength
  107                    "NCD B11B",                "NCD_110B. RMF",          "11.0" ,          "NAACCR DA TA EXCHANG E VS 11",             6694,
  108                    {//               Edit Set  Name                                                                                           Op tion
  109                             {        "*",                                                                                                              2                                  },
  110                             {        NULL     }
  111                    },
  112                    {//               Edit Nam e                                                                                                        Opti ons
  113                             {        NULL     }
  114                    },
  115                    {//               Field Na me                                                                                                       Opti on
  116                             {        NULL     }
  117                    }
  118           }
  119   };
  120  
  121   static int  compare_c onfigs( co nst void * arg1, cons t void *ar g2 )
  122   {
  123           re turn _stri cmp( ((TON CEDITSConf ig*)arg1)- >Name, ((T ONCEDITSCo nfig*)arg2 )->Name );
  124   }
  125  
  126   static TON CEDITSConf ig* findED ITSConfig( const char * ConfigNa me)
  127   {
  128           TO NCEDITSCon fig key =  { ConfigNa me };
  129           re turn (TONC EDITSConfi g*)bsearch (&key, Con figs, size of(Configs )/sizeof(C onfigs[0])
  130                    size of(Configs [0]), comp are_config s);
  131   }
  132  
  133   /********* ********** ********** ********** ********** ********** ********** ********** /
  134   /*                             G ENERIC EDI TS REQUEST                                * /
  135   /********* ********** ********** ********** ********** ********** ********** ********** /
  136  
  137   TONCReqED: :TONCReqED (const TON CTagCode a Code): TON CRequest(a Code)
  138   {
  139           Co nfig = NUL L;
  140           Me tafile = " ";
  141           Me tafileVers ion = "";
  142   }
  143  
  144   TONCReqED: :~TONCReqE D()
  145   {
  146           EE _Exit();
  147           TO NCRequest: :~TONCRequ est();
  148   }
  149  
  150   //***** PR OCESSES TH E OPENING  TAG
  151  
  152   bool TONCR eqED::pars eTagStart( TONCParser * Parser,  const TONC TagCode Ta gCode, con st XML_Cha r **atts)
  153   {
  154           bo ol prc = T ONCRequest ::parseTag Start(Pars er, TagCod e, atts);
  155  
  156           if ( TagCode  == getCode () )
  157           {
  158                    //-- - Get the  name of th e configur ation
  159                    cons t XML_Char * cfgname  = TONCPars er::getAtt rVal(atts,  "edits-co nfig");
  160                    if(  strlen(cfg name) <= 0  )
  161                             cfgnam e = "DEFAU LT";
  162  
  163                    //-- - Find the  configura tion descr iptor
  164                    Conf ig = findE DITSConfig (cfgname);
  165                    if(  Config ==  NULL )
  166                             throw  TONCFault( EC_INVALID _EDITSCFG,  cfgname);
  167  
  168                    //-- - Construc t the name  of the ED ITS metafi le
  169                    Meta file = get AppPath();
  170                    Meta file += Co nfig->Meta file;
  171  
  172                    //-- - Load the  metafile
  173                    char  version[8 0];
  174                    int  rc = EE_In it((char*) getMetafil e(), versi on);
  175                    if(  rc != 0 )
  176                             throw  TONCFault( EC_EDITS_E RROR, rc,  "EE_Init") ;
  177  
  178                    //-- - Get the  version
  179                    if(  (Config->M etaVer !=  NULL) && ( strlen(Con fig->MetaV er) > 0) )
  180                             Metafi leVersion  = Config-> MetaVer;
  181                    else
  182                             Metafi leVersion  = version;
  183  
  184                    retu rn true;
  185           }
  186  
  187           re turn prc;
  188   }
  189  
  190   //***** RE NDERS THE  ROOT TAG O F THE RESP ONSE
  191  
  192   void TONCR eqED::resp onseTag(bo ol open_ta g)
  193   {
  194           if ( open_tag  )
  195                    prin tf("<ED-RE SPONSE xml ns=\"%s\"> \n", getNa mespace()) ;
  196           el se
  197                    puts ("</ED-RES PONSE>");
  198   }
  199  
  200   /********* ********** ********** ********** ********** ********** ********** ********** /
  201   /*                                EDITS INF O REQUEST                                 * /
  202   /********* ********** ********** ********** ********** ********** ********** ********** /
  203  
  204   TONCReqEDG etEditInfo ::TONCReqE DGetEditIn fo(const T ONCTagCode  aCode): T ONCReqED(a Code)
  205   {
  206           Ed itIndex    = 0;
  207           Ed itSetName  = "";
  208           Te xtWidth        = 75;
  209   }
  210  
  211   //***** PR OCESSES TH E REQUEST
  212  
  213   void TONCR eqEDGetEdi tInfo::exe cute()
  214   {
  215           co nst int BU FSIZE = 32 768;
  216           EE t_mh esHan dle = 0;
  217           in t retLen,  status;
  218  
  219           ch ar* buf =  new char[B UFSIZE];
  220           if ( buf == N ULL )
  221                    thro w TONCFaul t(EC_NOT_E NOUGH_MEM) ;
  222           bu f[0] = '\0 ';
  223  
  224           tr y
  225           {
  226                    //-- - Load the  requested  edit set
  227                    int  rc = EE_Lo adEditSet( &esHandle,  (char*)Ed itSetName. c_str(), & status, 1) ;
  228                    if(  rc != 0 )
  229                             throw  TONCFault( EC_EDITS_E RROR_EX, r c, "EE_Loa dEditSet",  "Edit Set  name", Ed itSetName. c_str());
  230  
  231                    //-- - Get the  edit name
  232                    rc =  EE_GetEdi tName(esHa ndle, Edit Index, buf );
  233                    if(  rc != 0 )
  234                             throw  TONCFault( EC_EDITS_E RROR, rc,  "EE_GetEdi tName");
  235                    StrT ag("NAME",  buf);
  236  
  237                    //-- - Get the  edit descr iption tex t
  238                    if(  !EE_GetEdi tDescript( esHandle,  EditIndex,  TextWidth , BUFSIZE,  &retLen,  buf, 1) )
  239                    {
  240                             puts(" <DESCRIPTI ON>");
  241                             writeS tructuredT ext(buf);
  242                             puts(" </DESCRIPT ION>");
  243                    }
  244  
  245                    //-- - Get the  edit help  text
  246                    if(  !EE_GetEdi tHelp(esHa ndle, Edit Index, Tex tWidth, BU FSIZE, &re tLen, buf,  1) )
  247                    {
  248                             puts(" <HELP>");
  249                             writeS tructuredT ext(buf);
  250                             puts(" </HELP>");
  251                    }
  252           }
  253           ca tch(...)
  254           {
  255                    if(  esHandle ! = 0 )
  256                             EE_Fre eEditSet(e sHandle);
  257                    dele te [] buf;
  258                    thro w;
  259           }
  260  
  261           // ---- Free  the edit s et
  262           EE _FreeEditS et(esHandl e);
  263           de lete [] bu f;
  264   }
  265  
  266   //***** PR OCESSES TH E CLOSING  TAG
  267  
  268   bool TONCR eqEDGetEdi tInfo::par seTagEnd(T ONCParser*  Parser, c onst TONCT agCode Tag Code)
  269   {
  270           in t tmp;
  271           if ( !TONCReq ED::parseT agEnd(Pars er, TagCod e) )
  272                    swit ch( TagCod e )
  273                    {
  274                    case  EDEI_EDIT :
  275                             EditIn dex = Pars er->TagTex t.getAsInt ();
  276                             break;
  277                    case  EDEI_EDIT SET:
  278                             EditSe tName = Pa rser->TagT ext.getAsT ext();
  279                             break;
  280                    case  EDEI_TEXT WIDTH:
  281                             tmp =   Parser->T agText.get AsInt();
  282                             if( tm p > 0 )
  283                                      TextWidt h = tmp;
  284                             break;
  285                    defa ult:
  286                             return  false;
  287                    }
  288           re turn true;
  289   }
  290  
  291   /********* ********** ********** ********** ********** ********** ********** ********** /
  292   /*                            ED ITS 'RUN B ATCH' REQU EST                            * /
  293   /********* ********** ********** ********** ********** ********** ********** ********** /
  294  
  295   TONCReqEDR unBatch::T ONCReqEDRu nBatch(con st TONCTag Code aCode ): TONCReq ED(aCode)
  296   {
  297           Re cordHandle  = -1;
  298   }
  299  
  300   //***** PR OCESSES TH E REQUEST
  301  
  302   void TONCR eqEDRunBat ch::execut e()
  303   {
  304           if ( Config-> EditSets[0 ].Name !=  NULL )
  305           {
  306                    char  buf[80];
  307                    int  esi, rc;
  308  
  309                    //-- - If the f irst name  in the lis t is "*",  execute al l edit set s from the  metafile
  310                    if(  !strcmp(Co nfig->Edit Sets[0].Na me, "*") )
  311                    {
  312                             int i,  nes;
  313                             rc = E E_GetEditS etCount(&n es);
  314                             if( rc  != 0 )
  315                                      throw TO NCFault(EC _EDITS_ERR OR, rc, "E E_GetEditS etCount");
  316                             for( i =1; i<=nes ; i++)
  317                             {
  318                                      rc = EE_ GetEditSet Name(i, bu f);
  319                                      if( rc ! = 0 )
  320                                               throw TONC Fault(EC_E DITS_ERROR , rc, "EE_ GetEditSet Name");
  321                                      executeE ditSet(buf );
  322                             }
  323                    }
  324                    //-- - Otherwis e, execute  the edits  sets from  the list
  325                    else
  326                             for(es i=0; Confi g->EditSet s[esi].Nam e != NULL;  esi++ )
  327                                      executeE ditSet(Con fig->EditS ets[esi].N ame, Confi g->EditSet s[esi].Opt ion);
  328  
  329                    StrT ag("VERSIO N", ONCVER SION);
  330                    StrT ag("METAVE R", getMet afileVersi on());
  331           }
  332   }
  333  
  334   //***** EX ECUTES THE  SINGLE ED IT SET FRO M THE LIST
  335  
  336   void TONCR eqEDRunBat ch::execut eEditSet(c onst char*  name, con st int opt ion)
  337   {
  338           in t rc, stat us;
  339           EE t_mh setHa ndle;
  340  
  341           // --- Load t he edit se t
  342           rc  = EE_Load EditSet(&s etHandle,  (char*)nam e, &status , 1);
  343           if ( rc != 0  )
  344                    thro w TONCFaul t(EC_EDITS _ERROR_EX,  rc, "EE_L oadEditSet ", "Edit S et name",  name);
  345           tr y
  346           {
  347                    setF ieldOption s();
  348                    setE ditOptions (setHandle );
  349  
  350                    //-- - Clear th e internal  EDITS fla gs
  351                    rc =  EE_ClearA llFlags();
  352                    if(  rc != 0 )
  353                             throw  TONCFault( EC_EDITS_E RROR, rc,  "EE_ClearA llFlags");
  354  
  355                    //-- - Run all  edits from  the set
  356                    rc =  EE_RunBat ch(setHand le, option , &status) ;
  357                    if(  rc != 0 )
  358                             throw  TONCFault( EC_EDITS_E RROR_EX, r c, "EE_Run Batch", "E dit Set na me", name) ;
  359  
  360                    //-- - If error s are retu rned, add  them to th e response
  361                    if(  status > 0  )
  362                             output Messages(s etHandle,  name);
  363           }
  364           ca tch(...)
  365           {
  366                    EE_F reeEditSet (setHandle );
  367                    thro w;
  368           }
  369           // --- Free t he memory
  370           EE _FreeEditS et(setHand le);
  371   }
  372  
  373   //***** FO RMATS THE  MESSAGES G ENERATED B Y THE EDIT  SET AND W RITES THEM  TO THE ST DOUT
  374  
  375   void TONCR eqEDRunBat ch::output Messages(E Et_mh setH andle, con st char* s etName)
  376   {
  377           in t mc, prev _edit_inde x = -1, rc ;
  378  
  379           // --- Get th e number o f messages
  380           rc  = EE_GetM essageCoun t(&mc);
  381           if ( rc != 0  )
  382                    thro w TONCFaul t(EC_EDITS _ERROR, rc , "EE_GetM essageCoun t");
  383  
  384           // --- Write  the messag es to the  stdout im  XML format
  385           if ( mc > 0 )
  386           {
  387                    //-- - Group th e messages  under the  edit set
  388                    prin tf("<EDIT- SET NAME=\ "%s\" ECNT =\"%d\">\n ", xmlEnco de(setName ).c_str(),  mc);
  389                    try
  390                    {
  391                             const  int BUFSIZ E = 160;
  392                             int po s, edit_in dex, ifld,  imsg, num _fields, t mp;
  393                             char e dit_name[6 0], msg_ty pe[5], msg _text[BUFS IZE], fiel d_name[BUF SIZE], buf [BUFSIZE];
  394                             long e rr_code, n um_err, nu m_warn, nu m_skip;
  395  
  396                             for( i msg=1; ims g<=mc; ims g++ )
  397                             {
  398                                      //--- Ge t the mess age data
  399                                      rc = EE_ GetMessage TextEx(msg _type, ims g, msg_tex t, BUFSIZE , &err_cod e, &tmp, & edit_index , edit_nam e, &tmp);
  400                                      if( rc ! = 0 )
  401                                               throw TONC Fault(EC_E DITS_ERROR , rc, "EE_ GetMessage TextEx");
  402  
  403                                      //--- Gr oup the me ssages by  edits
  404                                      if( edit _index !=  prev_edit_ index )
  405                                      {
  406                                               //--- Edit  info
  407                                               rc = EE_Ge tEditCount s(setHandl e, edit_in dex, &num_ fields, &n um_err, &n um_warn, & num_skip);
  408                                               if( rc !=  0 )
  409                                                       th row TONCFa ult(EC_EDI TS_ERROR,  rc, "EE_Ge tEditCount s");
  410  
  411                                               if( prev_e dit_index  >= 0 )
  412                                                       pu ts("</EDIT >");
  413                                               printf("<E DIT INDEX= \"%d\" NAM E=\"%s\" E CNT=\"%ld\ " WCNT=\"% ld\">\n", 
  414                                                       ed it_index,  xmlEncode( edit_name) .c_str(),  num_err, n um_warn);
  415                                               prev_edit_ index = ed it_index;
  416  
  417                                               //--- Fiel ds validat ed by the  edit
  418                                               for(ifld=1 ; ifld<=nu m_fields;  ifld++)
  419                                               {
  420                                                       // --- Start  position o f the fiel d
  421   //JJB 1001 05 the spr intf's bec ame _s ver sions
  422                                                       sp rintf_s(bu f, sizeof( buf), "%%C %d", ifld) ;
  423                                                       EE _GetEditIn fo(setHand le, edit_i ndex, buf,  buf, BUFS IZE);
  424                                                       po s = atoi(b uf+1);
  425                                                       // --- Field  name
  426   //JJB 1001 05
  427                                                       sp rintf_s(bu f, sizeof( buf), "%%F %d", ifld) ;
  428                                                       EE _GetEditIn fo(setHand le, edit_i ndex, buf,  field_nam e, BUFSIZE );
  429                                                       // --- Value  of the fie ld
  430   //JJB 1001 05
  431                                                       sp rintf_s(bu f, sizeof( buf), "%%V %d", ifld) ;
  432                                                       EE _GetEditIn fo(setHand le, edit_i ndex, buf,  buf, BUFS IZE);
  433                                                       // --- Write  the tags
  434                                                       pr intf("<FLD  NAME=\"%s \" POS=\"% d\">%s</FL D>\n", 
  435                                                                xmlE ncode(fiel d_name).c_ str(), pos , xmlEncod e(buf).c_s tr());
  436                                               }
  437                                      }
  438  
  439                                      //--- Me ssage
  440                                      printf(" <MSG CODE= \"%d\" TYP E=\"%s\">" , err_code , msg_type );
  441                                      writeTex t(msg_text );
  442                                      puts("</ MSG>");
  443                             }
  444                    }
  445                    catc h(...)
  446                    {
  447                             if( pr ev_edit_in dex >= 0 )
  448                                      puts("</ EDIT>");
  449                             puts(" </EDIT-SET >");
  450                             throw;
  451                    }
  452                    if(  prev_edit_ index >= 0  )
  453                             puts(" </EDIT>");
  454                    puts ("</EDIT-S ET>");
  455           }
  456   }
  457  
  458   //***** PR OCESSES TH E CLOSING  TAG
  459  
  460   bool TONCR eqEDRunBat ch::parseT agEnd(TONC Parser* Pa rser, cons t TONCTagC ode TagCod e)
  461   {
  462           in t rc;
  463           if ( !TONCReq ED::parseT agEnd(Pars er, TagCod e) )
  464                    swit ch( TagCod e )
  465                    {
  466                    case  EDRB_NAAC CR_RECORD:
  467                             //---  Allocate i nternal bu ffer for t he NAACCR  record
  468                             rc = E E_AllocRec ord(Config ->RecordLe ngth, &Rec ordHandle) ;
  469                             if( rc  != 0 )
  470                                      throw TO NCFault(EC _EDITS_ERR OR, rc, "E E_AllocRec ord");
  471  
  472                             //---  Load and i nitialize  the record  layout
  473                             rc = E E_InitReco rdLayout(R ecordHandl e, Config- >LayoutNam e);
  474                             if( rc  != 0 )
  475                                      throw TO NCFault(EC _EDITS_ERR OR_EX, rc,  "EE_InitR ecordLayou t", "Layou t name", C onfig->Lay outName);
  476  
  477                             //---  Load the d ata into t he interna l buffer
  478                             rc = E E_UpdateRe cord(Recor dHandle, ( char*)Pars er->TagTex t.getAsTex t());
  479                             if( rc  != 0 )
  480                                      throw TO NCFault(EC _EDITS_ERR OR, rc, "E E_UpdateRe cord");
  481  
  482                             break;
  483                    defa ult:
  484                             return  false;
  485                    }
  486           re turn true;
  487   }
  488  
  489   //***** PA SSES EDIT  OPTIONS FR OM THE CON FIGURATION  TO THE ED ITS ENGINE
  490  
  491   void TONCR eqEDRunBat ch::setEdi tOptions(E Et_mh Edit SetHandle)
  492   {
  493           in t eh, ei,  eopts, rc;
  494           fo r(ei=0; Co nfig->Edit s[ei].Name  != NULL;  ei++)
  495           {
  496                    //-- - Get edit  handle
  497                    rc =  EE_GetEdi tHandle(Ed itSetHandl e, &eh, (c har*)(Conf ig->Edits[ ei].Name)) ;
  498                    if(  rc != 0 )
  499                             throw  TONCFault( EC_EDITS_E RROR_EX, r c, "EE_Get EditHandle ", "Edit n ame", Conf ig->Edits[ ei].Name);
  500  
  501                    //-- - Set edit  options
  502                    if(  eh >= 0 )
  503                    {
  504                             eopts  = Config-> Edits[ei]. Options;
  505                             rc = E E_EditOpti ons(EditSe tHandle, e h, &eopts) ;
  506                             if( rc  != 0 )
  507                                      throw TO NCFault(EC _EDITS_ERR OR_EX, rc,  "EE_EditO ptions", " Edit name" , Config-> Edits[ei]. Name);
  508                    }
  509           }
  510   }
  511  
  512   //***** PA SSES FIELD  OPTIONS F ROM THE CO NFIGURATIO N TO THE E DITS ENGIN E
  513  
  514   void TONCR eqEDRunBat ch::setFie ldOptions( void)
  515   {
  516           in t fh, fi,  fopts, rc;
  517           fo r(fi=0; Co nfig->Fiel ds[fi].Nam e != NULL;  fi++)
  518           {
  519                    //-- - Get fiel d handle
  520                    fh =  EE_FieldH andle((cha r*)(Config ->Fields[f i].Name),  "S", Confi g->LayoutN ame);
  521                    if(  fh < 0 )
  522                             throw  TONCFault( EC_EDITS_E RROR_EX, f h, "EE_Fie ldHandle",  "Field na me", Confi g->Fields[ fi].Name);
  523  
  524                    //-- - Set fiel d options
  525                    fopt s = Config ->Fields[f i].Options ;
  526                    rc =  EE_FieldO ptions(fh,  &fopts);
  527                    if(  rc != 0 )
  528                             throw  TONCFault( EC_EDITS_E RROR_EX, r c, "EE_Fie ldOptions" , "Field n ame", Conf ig->Fields [fi].Name) ;
  529           }
  530   }