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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | MSSRe Build 4.zip\Applications\OncoTrax-E40 | ONC_RequestCS.cpp | Tue Apr 10 19:43:38 2018 UTC |
| 2 | MSSRe Build 4.zip\Applications\OncoTrax-E40 | ONC_RequestCS.cpp | Thu Apr 12 08:54:48 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 1164 |
| Changed | 2 | 4 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 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 Coll aborative Staging re quest proc essing * / | |
| 7 | /* cl asses for Oncology W eb-service * / | |
| 8 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 9 | ||
| 10 | #include " stdafx.h" | |
| 11 | #include " OncologyCG I.h" | |
| 12 | #include " ONC_Reques ts.h" | |
| 13 | ||
| 14 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 15 | /* ERR OR DESCRIP TOR FOR TH E CS 'CALC ULATE' REQ UEST * / | |
| 16 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 17 | ||
| 18 | class TONC FaultCSCal culate: pu blic TONCF ault { | |
| 19 | un signed lon g CSErro r; | |
| 20 | ch ar* Msg; | |
| 21 | ||
| 22 | protected: | |
| 23 | vi rtual void output Detail(); | |
| 24 | ||
| 25 | public: | |
| 26 | TO NCFaultCSC alculate(c onst int a nErrorCode , const un signed lon g aCSError , const ch ar* aMsg); | |
| 27 | vi rtual ~TON CFaultCSCa lculate(); | |
| 28 | ||
| 29 | }; | |
| 30 | ||
| 31 | //***** CO NSTRUCTOR | |
| 32 | ||
| 33 | TONCFaultC SCalculate ::TONCFaul tCSCalcula te(const i nt anError Code, cons t unsigned long aCSE rror, cons t char* aM sg): | |
| 34 | TO NCFault(an ErrorCode) | |
| 35 | { | |
| 36 | CS Error = aC SError; | |
| 37 | Ms g = ( aMsg != NULL & & strlen(a Msg) > 0 ) ? _strdup (aMsg) : N ULL; | |
| 38 | } | |
| 39 | ||
| 40 | //***** DE STRUCTOR | |
| 41 | ||
| 42 | TONCFaultC SCalculate ::~TONCFau ltCSCalcul ate() | |
| 43 | { | |
| 44 | fr ee(Msg); | |
| 45 | TO NCFault::~ TONCFault( ); | |
| 46 | } | |
| 47 | ||
| 48 | //***** OU TPUTS DETA ILED ERROR INFO | |
| 49 | ||
| 50 | void TONCF aultCSCalc ulate::out putDetail( ) | |
| 51 | { | |
| 52 | TO NCFault::o utputDetai l(); | |
| 53 | if ( CSError != 0 ) | |
| 54 | prin tf("<ERROR >%lu</ERRO R>\n", CSE rror); | |
| 55 | if ( Msg != N ULL && str len(Msg) > 0 ) | |
| 56 | prin tf("<MSG>\ n%s</MSG>\ n", Msg); | |
| 57 | } | |
| 58 | ||
| 59 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 60 | /* GENERIC C OLLABORATI VE STAGING REQUEST * / | |
| 61 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 62 | ||
| 63 | TONCReqCS: :TONCReqCS (const TON CTagCode a Code): TON CRequest(a Code) | |
| 64 | { | |
| 65 | Hi st[0] = '\ 0'; | |
| 66 | Si te[0] = '\ 0'; | |
| 67 | Sc hemaNumber = 0; | |
| 68 | Ta bleNumber = 0; | |
| 69 | Di scriminato r[0] = '\0 '; | |
| 70 | } | |
| 71 | ||
| 72 | //***** PR OCESSES TH E CLOSING TAG | |
| 73 | ||
| 74 | bool TONCR eqCS::pars eTagEnd(TO NCParser* Parser, co nst TONCTa gCode TagC ode) | |
| 75 | { | |
| 76 | if ( !TONCReq uest::pars eTagEnd(Pa rser, TagC ode) ) | |
| 77 | swit ch( TagCod e ) | |
| 78 | { | |
| 79 | case CSC_SITE: | |
| 80 | case CSGS_SITE : | |
| 81 | //JJB 1001 06 4 becam e 5 | |
| 82 | Parser ->TagText. copyText(S ite, 5, 1) ; | |
| 83 | break; | |
| 84 | case CSC_HIST: | |
| 85 | case CSGS_HIST : | |
| 86 | Parser ->TagText. copyText(H ist, 4, 1) ; | |
| 87 | break; | |
| 88 | //JJB 1001 15 | |
| 89 | case CSGS_DISC RIMINATOR: | |
| 90 | Parser ->TagText. copyText(D iscriminat or, 3, 1); | |
| 91 | break; | |
| 92 | case CSGT_SCHE MA: | |
| 93 | Schema Number = P arser->Tag Text.getAs Int(); | |
| 94 | break; | |
| 95 | case CSGT_TABL E: | |
| 96 | TableN umber = Pa rser->TagT ext.getAsI nt(); | |
| 97 | break; | |
| 98 | defa ult: | |
| 99 | return false; | |
| 100 | } | |
| 101 | ||
| 102 | re turn true; | |
| 103 | } | |
| 104 | ||
| 105 | //***** RE NDERS THE ROOT TAG O F THE RESP ONSE | |
| 106 | ||
| 107 | void TONCR eqCS::resp onseTag(bo ol open_ta g) | |
| 108 | { | |
| 109 | if ( open_tag ) | |
| 110 | prin tf("<CS-RE SPONSE xml ns=\"%s\"> \n", getNa mespace()) ; | |
| 111 | ||
| 112 | el se | |
| 113 | puts ("</CS-RES PONSE>"); | |
| 114 | } | |
| 115 | ||
| 116 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 117 | /* C OLLABORATI VE STAGING 'CALCULAT E' REQUEST * / | |
| 118 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 119 | ||
| 120 | TONCReqCSC alculate:: TONCReqCSC alculate(c onst TONCT agCode aCo de): TONCR eqCS(aCode ) | |
| 121 | { | |
| 122 | me mset((char *)&dc, 0, sizeof(dc )); | |
| 123 | CS tage_clear _datacard( &dc); | |
| 124 | dc .error = 0 ; | |
| 125 | dc .messages[ 0] = '\0'; | |
| 126 | } | |
| 127 | ||
| 128 | //***** PR OCESSES TH E REQUEST | |
| 129 | ||
| 130 | void TONCR eqCSCalcul ate::execu te() | |
| 131 | { | |
| 132 | in t rc = CSt age_calcul ate(&dc); | |
| 133 | if ( strlen(d c.messages ) > 0 || r c < 0 ) | |
| 134 | setF ault(new T ONCFaultCS Calculate( rc < 0 ? E C_CALC_ERR ORS : EC_C ALC_WARNIN GS, dc.err or, dc.mes sages)); | |
| 135 | /* | |
| 136 | ;-- - SOAP RES PONSE FROM THE COLLA BORATIVE S TAGING WEB SERVICE | |
| 137 | ; | |
| 138 | ; <?xml ver sion="1.0" encoding= "utf-8"?> | |
| 139 | ; <soap:Env elope | |
| 140 | ; xmlns:s oap="http: //www.w3.o rg/2001/12 /soap-enve lope" | |
| 141 | ; soap:en codingStyl e="http:// www.w3.org /2001/12/s oap-encodi ng"> | |
| 142 | ; <soap:B ody> | |
| 143 | ; <CS-RESPON SE xmlns=" http:// DNS /oncology" > | |
| 144 | ; <CS -STOR> | |
| 145 | ; < T> ... </T > | |
| 146 | ; < TDESCR> .. . </TDESCR > | |
| 147 | ; < N> ... </N > | |
| 148 | ; < NDESCR> .. . </NDESCR > | |
| 149 | ; < M> ... </M > | |
| 150 | ; < MDESCR> .. . </MDESCR > | |
| 151 | ; < AJCC> ... </AJCC> | |
| 152 | ; < AJCC7-T> . .. </AJCC7 -T> | |
| 153 | ; < AJCC7-TDES CR> ... </ AJCC7-TDES CR> | |
| 154 | ; < AJCC7-N> . .. </AJCC7 -N> | |
| 155 | ; < AJCC7-NDES CR> ... </ AJCC7-NDES CR> | |
| 156 | ; < AJCC7-M> . .. </AJCC7 -M> | |
| 157 | ; < AJCC7-MDES CR> ... </ AJCC7-MDES CR> | |
| 158 | ; < AJCC7-STAG E> ... </A JCC7-STAGE > | |
| 159 | ; < SS1977> .. . </SS1977 > | |
| 160 | ; < SS2000> .. . </SS2000 > | |
| 161 | ; </C S-STOR> | |
| 162 | ; <CS -DISP> | |
| 163 | ; < T> ... </T > | |
| 164 | ; < TDESCR> .. . </TDESCR > | |
| 165 | ; < N> ... </N > | |
| 166 | ; < NDESCR> .. . </NDESCR > | |
| 167 | ; < M> ... </M > | |
| 168 | ; < MDESCR> .. . </MDESCR > | |
| 169 | ; < AJCC> ... </AJCC> | |
| 170 | ; < AJCC7-T> . .. </AJCC7 -T> | |
| 171 | ; < AJCC7-TDES CR> ... </ AJCC7-TDES CR> | |
| 172 | ; < AJCC7-N> . .. </AJCC7 -N> | |
| 173 | ; < AJCC7-NDES CR> ... </ AJCC7-NDES CR> | |
| 174 | ; < AJCC7-M> . .. </AJCC7 -M> | |
| 175 | ; < AJCC7-MDES CR> ... </ AJCC7-MDES CR> | |
| 176 | ; < AJCC7-STAG E> ... </A JCC7-STAGE > | |
| 177 | ; < SS1977> .. . </SS1977 > | |
| 178 | ; < SS2000> .. . </SS2000 > | |
| 179 | ; </C S-DISP> | |
| 180 | ; <AP IVER> ... </APIVER> | |
| 181 | ; <VE RSION> ... </VERSION > | |
| 182 | ; </CS- RESPONSE> | |
| 183 | ; <soap :Fault> | |
| 184 | ; <fa ultcode> . .. </fault code> | |
| 185 | ; <fa ultstring> ... </fau ltstring> | |
| 186 | ; <de tail> | |
| 187 | ; < ERROR> ... </ERROR> | |
| 188 | ; < MSG> | |
| 189 | ; . .. | |
| 190 | ; < /MSG> | |
| 191 | ; < RC> ... </ RC> | |
| 192 | ; </d etail> | |
| 193 | ; </soa p:Fault> | |
| 194 | ; </soap: Body > | |
| 195 | ; </soap:En velope> | |
| 196 | ||
| 197 | */ | |
| 198 | // --- Store Values | |
| 199 | pu ts("<CS-ST OR>"); | |
| 200 | St rTag("T", dc.stor_t) ; | |
| 201 | St rTag("TDES CR", dc.stor_ tdescr); | |
| 202 | St rTag("N", dc.stor_n) ; | |
| 203 | St rTag("NDES CR", dc.stor_ ndescr); | |
| 204 | St rTag("M", dc.stor_m) ; | |
| 205 | St rTag("MDES CR", dc.stor_ mdescr); | |
| 206 | StrTag ("AJCC", dc.stor_aj cc); | |
| 207 | St rTag("AJCC 7-T", dc.stor_aj cc7_t); | |
| 208 | St rTag("AJCC 7-TDESCR", dc.stor_ ajcc7_tdes cr); | |
| 209 | St rTag("AJCC 7-N", dc.stor_aj cc7_n); | |
| 210 | St rTag("AJCC 7-NDESCR", dc.stor_ ajcc7_ndes cr); | |
| 211 | St rTag("AJCC 7-M", dc.stor_aj cc7_m); | |
| 212 | St rTag("AJCC 7-MDESCR", dc.stor_ ajcc7_mdes cr); | |
| 213 | St rTag("AJCC 7-STAGE", dc.stor_ ajcc7_stag e); | |
| 214 | St rTag("SS19 77", dc.stor_ss 77); | |
| 215 | St rTag("SS20 00", dc.stor_ss 2000); | |
| 216 | pu ts("</CS-S TOR>"); | |
| 217 | ||
| 218 | // --- Displa y Values | |
| 219 | pu ts("<CS-DI SP>"); | |
| 220 | St rTag("T", dc.t); | |
| 221 | St rTag("TDES CR", dc.tdesc r); | |
| 222 | St rTag("N", dc.n); | |
| 223 | St rTag("NDES CR", dc.ndesc r); | |
| 224 | St rTag("M", dc.m); | |
| 225 | St rTag("MDES CR", dc.mdesc r); | |
| 226 | St rTag("AJCC ", dc.ajcc); | |
| 227 | St rTag("AJCC 7-T", dc.ajcc7_t ); | |
| 228 | St rTag("AJCC 7-TDESCR", dc.ajcc7 _tdescr); | |
| 229 | St rTag("AJCC 7-N", dc.ajcc7_n ); | |
| 230 | St rTag("AJCC 7-NDESCR", dc.ajcc7 _ndescr); | |
| 231 | St rTag("AJCC 7-M", dc.ajcc7_m ); | |
| 232 | St rTag("AJCC 7-MDESCR", dc.ajcc7 _mdescr); | |
| 233 | St rTag("AJCC 7-STAGE", dc.ajcc7 _stage); | |
| 234 | St rTag("SS19 77", dc.ss77) ; | |
| 235 | St rTag("SS20 00", dc.ss200 0); | |
| 236 | pu ts("</CS-D ISP>"); | |
| 237 | ||
| 238 | // --- Versio ns | |
| 239 | St rTag("APIV ER", CStag e_get_vers ion()); | |
| 240 | St rTag("VERS ION", ONCV ERSION); | |
| 241 | } | |
| 242 | ||
| 243 | //***** PR OCESSES TH E CLOSING TAG | |
| 244 | ||
| 245 | bool TONCR eqCSCalcul ate::parse TagEnd(TON CParser* P arser, con st TONCTag Code TagCo de) | |
| 246 | { | |
| 247 | bo ol rc = TO NCReqCS::p arseTagEnd (Parser, T agCode); | |
| 248 | ||
| 249 | sw itch( TagC ode ) | |
| 250 | { | |
| 251 | //JJB 1001 06 4 becam e 5 | |
| 252 | ca se CSC_SIT E: | |
| 253 | Pars er->TagTex t.copyText (dc.site, 5); | |
| 254 | brea k; | |
| 255 | ca se CSC_HIS T: | |
| 256 | Pars er->TagTex t.copyText (dc.hist, 4); | |
| 257 | brea k; | |
| 258 | ca se CSC_BEH AV: | |
| 259 | dc.b ehav = Par ser->TagTe xt.getAsCh ar(); | |
| 260 | brea k; | |
| 261 | ca se CSC_GRA DE: | |
| 262 | dc.g rade = Par ser->TagTe xt.getAsCh ar(); | |
| 263 | brea k; | |
| 264 | ca se CSC_AGE : | |
| 265 | Pars er->TagTex t.copyText (dc.age, 3 ); | |
| 266 | brea k; | |
| 267 | ca se CSC_SIZ E: | |
| 268 | Pars er->TagTex t.copyText (dc.size, 3); | |
| 269 | brea k; | |
| 270 | ca se CSC_EXT : | |
| 271 | //JJB 1001 05 2 becam e 3 | |
| 272 | Pars er->TagTex t.copyText (dc.ext, 3 ); | |
| 273 | brea k; | |
| 274 | ca se CSC_EXT EVAL: | |
| 275 | dc.e xteval = P arser->Tag Text.getAs Char(); | |
| 276 | brea k; | |
| 277 | ca se CSC_NOD ES: | |
| 278 | //JJB 1001 05 2 becam e 3 | |
| 279 | Pars er->TagTex t.copyText (dc.nodes, 3); | |
| 280 | brea k; | |
| 281 | ca se CSC_NOD ESEVAL: | |
| 282 | dc.n odeseval = Parser->T agText.get AsChar(); | |
| 283 | brea k; | |
| 284 | ca se CSC_LNP OS: | |
| 285 | Pars er->TagTex t.copyText (dc.lnpos, 2); | |
| 286 | brea k; | |
| 287 | ca se CSC_LNE XAM: | |
| 288 | Pars er->TagTex t.copyText (dc.lnexam , 2); | |
| 289 | brea k; | |
| 290 | ca se CSC_MET S: | |
| 291 | Pars er->TagTex t.copyText (dc.mets, 2); | |
| 292 | brea k; | |
| 293 | ca se CSC_MET SEVAL: | |
| 294 | dc.m etseval = Parser->Ta gText.getA sChar(); | |
| 295 | brea k; | |
| 296 | //JJB 1001 05 -> | |
| 297 | ca se CSC_DXY EAR: | |
| 298 | Pars er->TagTex t.copyText (dc.diagno sis_year, 4); | |
| 299 | brea k; | |
| 300 | ca se CSC_VER ORIG: | |
| 301 | Pars er->TagTex t.copyText (dc.csver_ original, 6); | |
| 302 | brea k; | |
| 303 | ca se CSC_LVI : | |
| 304 | dc.l vi = Parse r->TagText .getAsChar (); | |
| 305 | brea k; | |
| 306 | // ca se CSC_SEX : | |
| 307 | // dc.s ex = Parse r->TagText .getAsChar (); | |
| 308 | // brea k; | |
| 309 | //JJB 1001 05 <- | |
| 310 | ca se CSC_SSF 1: | |
| 311 | Pars er->TagTex t.copyText (dc.ssf1, 3); | |
| 312 | brea k; | |
| 313 | ca se CSC_SSF 2: | |
| 314 | Pars er->TagTex t.copyText (dc.ssf2, 3); | |
| 315 | brea k; | |
| 316 | ca se CSC_SSF 3: | |
| 317 | Pars er->TagTex t.copyText (dc.ssf3, 3); | |
| 318 | brea k; | |
| 319 | ca se CSC_SSF 4: | |
| 320 | Pars er->TagTex t.copyText (dc.ssf4, 3); | |
| 321 | brea k; | |
| 322 | ca se CSC_SSF 5: | |
| 323 | Pars er->TagTex t.copyText (dc.ssf5, 3); | |
| 324 | brea k; | |
| 325 | ca se CSC_SSF 6: | |
| 326 | Pars er->TagTex t.copyText (dc.ssf6, 3); | |
| 327 | brea k; | |
| 328 | //JJB 1001 05 -> | |
| 329 | ca se CSC_SSF 7: | |
| 330 | Pars er->TagTex t.copyText (dc.ssf7, 3); | |
| 331 | brea k; | |
| 332 | ca se CSC_SSF 8: | |
| 333 | Pars er->TagTex t.copyText (dc.ssf8, 3); | |
| 334 | brea k; | |
| 335 | ca se CSC_SSF 9: | |
| 336 | Pars er->TagTex t.copyText (dc.ssf9, 3); | |
| 337 | brea k; | |
| 338 | ca se CSC_SSF 10: | |
| 339 | Pars er->TagTex t.copyText (dc.ssf10, 3); | |
| 340 | brea k; | |
| 341 | ca se CSC_SSF 11: | |
| 342 | Pars er->TagTex t.copyText (dc.ssf11, 3); | |
| 343 | brea k; | |
| 344 | ca se CSC_SSF 12: | |
| 345 | Pars er->TagTex t.copyText (dc.ssf12, 3); | |
| 346 | brea k; | |
| 347 | ca se CSC_SSF 13: | |
| 348 | Pars er->TagTex t.copyText (dc.ssf13, 3); | |
| 349 | brea k; | |
| 350 | ca se CSC_SSF 14: | |
| 351 | Pars er->TagTex t.copyText (dc.ssf14, 3); | |
| 352 | brea k; | |
| 353 | ca se CSC_SSF 15: | |
| 354 | Pars er->TagTex t.copyText (dc.ssf15, 3); | |
| 355 | brea k; | |
| 356 | ca se CSC_SSF 16: | |
| 357 | Pars er->TagTex t.copyText (dc.ssf16, 3); | |
| 358 | brea k; | |
| 359 | ca se CSC_SSF 17: | |
| 360 | Pars er->TagTex t.copyText (dc.ssf17, 3); | |
| 361 | brea k; | |
| 362 | ca se CSC_SSF 18: | |
| 363 | Pars er->TagTex t.copyText (dc.ssf18, 3); | |
| 364 | brea k; | |
| 365 | ca se CSC_SSF 19: | |
| 366 | Pars er->TagTex t.copyText (dc.ssf19, 3); | |
| 367 | brea k; | |
| 368 | ca se CSC_SSF 20: | |
| 369 | Pars er->TagTex t.copyText (dc.ssf20, 3); | |
| 370 | brea k; | |
| 371 | ca se CSC_SSF 21: | |
| 372 | Pars er->TagTex t.copyText (dc.ssf21, 3); | |
| 373 | brea k; | |
| 374 | ca se CSC_SSF 22: | |
| 375 | Pars er->TagTex t.copyText (dc.ssf22, 3); | |
| 376 | brea k; | |
| 377 | ca se CSC_SSF 23: | |
| 378 | Pars er->TagTex t.copyText (dc.ssf23, 3); | |
| 379 | brea k; | |
| 380 | ca se CSC_SSF 24: | |
| 381 | Pars er->TagTex t.copyText (dc.ssf24, 3); | |
| 382 | brea k; | |
| 383 | ca se CSC_SSF 25: | |
| 384 | Pars er->TagTex t.copyText (dc.ssf25, 3); | |
| 385 | brea k; | |
| 386 | //JJB 1001 05 <- | |
| 387 | ||
| 388 | de fault: | |
| 389 | retu rn rc; | |
| 390 | } | |
| 391 | ||
| 392 | re turn true; | |
| 393 | } | |
| 394 | ||
| 395 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 396 | /* CO LLABORATIV E STAGING 'GET SCHEM A' REQUEST * / | |
| 397 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 398 | ||
| 399 | void TONCR eqCSGetSch ema::execu te() | |
| 400 | { | |
| 401 | /* | |
| 402 | Si tuations w here a sch ema discri minator is required can be ide ntified | |
| 403 | by calling C Stage_get_ schema_num ber() and examining the return value. | |
| 404 | If a schema discrimina tor is req uired but a valid di scriminato r has not | |
| 405 | be en supplie d, the fun ction will return a positive i nteger who se value | |
| 406 | is greater t han the va lue return ed by CSta ge_get_num ber_of_sch emas(). | |
| 407 | Th e integer’ s high 16 bits will contain a schema nu mber and i ts low | |
| 408 | 16 bits will contain a table num ber. This value is guaranteed to be | |
| 409 | no n-negative and outsi de the ran ge of vali d schema n umbers | |
| 410 | (a s determin ed by CSta ge_get_num ber_of_sch emas()); t hus, any r eturn | |
| 411 | va lue greate r than CSt age_get_nu mber_of_sc hemas() in dicates a schema | |
| 412 | di scriminato r is requi red. | |
| 413 | The sc hema numbe r and tabl e number t aken toget her indica te the loc ation | |
| 414 | of a schema discrimina tor table that lists all valid discrimin ator value s | |
| 415 | fo r the site /histology combinati on. Once a schema d iscriminat or code ha s | |
| 416 | be en selecte d, a secon d call to CStage_get _schema_nu mber() can be made. | |
| 417 | In sit uations wh ere a disc riminator is not req uired, the schema | |
| 418 | di scriminato r will be ignored | |
| 419 | */ | |
| 420 | in t ii; | |
| 421 | // ch ar *discri minator = NULL; | |
| 422 | in t num_of_s chemas = C Stage_get_ number_of_ schemas(); | |
| 423 | /*JJB NEED S WORK */ | |
| 424 | Sc hemaNumber = CStage_ get_schema _number(Si te, Hist, Discrimina tor); | |
| 425 | if ( SchemaNu mber > 0 ) { | |
| 426 | if(S chemaNumbe r <= num_o f_schemas) { | |
| 427 | IntTag ("SCHEMA", SchemaNum ber); | |
| 428 | StrTag ("SCHEMA-N AME", CSta ge_get_sch ema_name(S chemaNumbe r)); | |
| 429 | } | |
| 430 | else { | |
| 431 | int dS chemaNumbe r = Schema Number / 6 5536; | |
| 432 | int dT ableNumber = SchemaN umber % 65 536; | |
| 433 | ||
| 434 | /* Use CSt age_get_nu mber_of_ro ws() to ge t the tabl e length, | |
| 435 | CStage_ge t_table_pa ttern() to determine the table width, | |
| 436 | and CStag e_get_code _string() and | |
| 437 | CStage_ge t_descript ion_string () for eve ry row to build a ch oice list. | |
| 438 | ||
| 439 | Example c all to CSt age_get_co de_string( ), CStage_ get_descri ption_stri ng() | |
| 440 | to pop ulate seco nd row of choice lis t | |
| 441 | CStage_ge t_code_str ing(19, 34 , 2, 1) = “020” | |
| 442 | CStage_ge t_descript ion_string (19, 34, 2 ) = “Adeno id\nPharyn gealtonsil \nNasophar yngeal ton sil” | |
| 443 | */ | |
| 444 | int nu mber_of_ro ws = CStag e_get_numb er_of_rows (dSchemaNu mber, dTab leNumber); | |
| 445 | /* For any table the pattern a ttribute i s a string that show s the colu mn structu re | |
| 446 | of the tab le. Patte rn strings have the form “J-K- L”, in whi ch | |
| 447 | J represen ts the num ber of cod e cells at the begin ning of a row; | |
| 448 | K represen ts the num ber (0 or 1) of desc ription ce lls; and | |
| 449 | L represen ts the num ber of cod e cells fo llowing a descriptio n cell. | |
| 450 | ||
| 451 | “1-0-0” is the minim al table p attern, in dicating a row consi sting of o nly one co de cell. | |
| 452 | “1-1-3”, a common pa ttern, ind icates a r ow consist ing of a s ingle code cell | |
| 453 | followed b y a descri ption cell followed by three c ode cells. | |
| 454 | */ | |
| 455 | const char *tabl e_pattern = CStage_g et_table_p attern(dSc hemaNumber , dTableNu mber); | |
| 456 | setFau lt(new TON CFault(EC_ NEED_DISCR IMINATOR, Site, Hist )); | |
| 457 | for(ii =1; ii<=nu mber_of_ro ws; ii++) { | |
| 458 | const ch ar *codeSt ring = | |
| 459 | CStage_get _code_stri ng(dSchema Number, dT ableNumber , ii, 1); | |
| 460 | const ch ar *descSt ring = | |
| 461 | CStage_get _descripti on_string( dSchemaNum ber, dTabl eNumber, i i); | |
| 462 | printf(" <DISCRIMIN ATOR CODE= \"%s\">", codeString ); | |
| 463 | writeTex t(descStri ng); | |
| 464 | puts("</ DISCRIMINA TOR>"); | |
| 465 | ||
| 466 | } | |
| 467 | } | |
| 468 | } | |
| 469 | el se | |
| 470 | setF ault(new T ONCFault(E C_SITE_HIS T, Site, H ist)); | |
| 471 | } | |
| 472 | ||
| 473 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 474 | /* CO LLABORATIV E STAGING 'GET TABLE S' REQUEST * / | |
| 475 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 476 | ||
| 477 | void TONCR eqCSGetTab les::execu te() | |
| 478 | { | |
| 479 | char *discrimi nator = NU LL; | |
| 480 | ||
| 481 | // --- Schema number | |
| 482 | if ( SchemaNu mber <= 0 ) | |
| 483 | { | |
| 484 | /*JJB NEED S WORK */ | |
| 485 | Sche maNumber = CStage_ge t_schema_n umber(Site , Hist, di scriminato r); | |
| 486 | if( SchemaNumb er <= 0 ) | |
| 487 | { | |
| 488 | setFau lt(new TON CFault(EC_ SITE_HIST, Site, His t)); | |
| 489 | return ; | |
| 490 | } | |
| 491 | } | |
| 492 | ||
| 493 | // --- Table number(s) | |
| 494 | in t NumberOf Tables = C Stage_get_ number_of_ tables(Sch emaNumber) ; | |
| 495 | in t FirstTab le = 1, La stTable = NumberOfTa bles; | |
| 496 | if ( TableNum ber > 0 ) | |
| 497 | { | |
| 498 | if( TableNumbe r > Number OfTables ) | |
| 499 | { | |
| 500 | setFau lt(new TON CFault(EC_ INVALID_TA BNUM)); | |
| 501 | return ; | |
| 502 | } | |
| 503 | Firs tTable = T ableNumber ; | |
| 504 | Last Table = Ta bleNumber; | |
| 505 | } | |
| 506 | ||
| 507 | In tTag("SCHE MA", Schem aNumber); | |
| 508 | ||
| 509 | // --- Tables | |
| 510 | fo r(int tblN um=FirstTa ble; tblNu m<=LastTab le; tblNum ++) | |
| 511 | { | |
| 512 | //-- - Get the table patt ern and ch eck for th e presence of row de scription | |
| 513 | //JJB 1001 05 Added c onst | |
| 514 | cons t char* Ta blePattern = CStage_ get_table_ pattern(Sc hemaNumber , tblNum); | |
| 515 | bool hasDescr = Piece(Ta blePattern , "-", 2) != "0"; | |
| 516 | if( !hasDescr ) continue ; | |
| 517 | ||
| 518 | //-- - Determin e the numb er of code s | |
| 519 | int NumberOfCo des = atoi (Piece(Tab lePattern, "-", 3).c _str()) + 1; | |
| 520 | if( NumberOfCo des == 1 ) | |
| 521 | Number OfCodes = atoi(Piece (TablePatt ern, "-", 1).c_str() ); | |
| 522 | ||
| 523 | //-- - Table he ader | |
| 524 | puts ("<TABLE>" ); | |
| 525 | IntT ag("NUMBER ", tblNum) ; | |
| 526 | StrT ag("PATTER N", TableP attern); | |
| 527 | /*JJB 0912 24 -> | |
| 528 | Function D eprecated StrTag(" ROLE", CSt age_get_ta ble_role(S chemaNumbe r, tblNum) ); | |
| 529 | */ | |
| 530 | StrT ag("SUBTIT LE", CStag e_get_tabl e_subtitle (SchemaNum ber, tblNu m)); | |
| 531 | StrT ag("TITLE" , CStage_g et_table_t itle(Schem aNumber, t blNum)); | |
| 532 | ||
| 533 | //-- - Table ro ws | |
| 534 | puts ("<ROWS>") ; | |
| 535 | int NumberOfRo ws = CStag e_get_numb er_of_rows (SchemaNum ber, tblNu m); | |
| 536 | for( int Row=1; Row<=Numb erOfRows; Row++) | |
| 537 | { | |
| 538 | puts(" <ROW>"); | |
| 539 | StrTag ("CODE", C Stage_get_ code_strin g(SchemaNu mber, tblN um, Row, 1 )); | |
| 540 | puts(" <DESCR>"); | |
| 541 | //JJB 1001 05 Added c onst | |
| 542 | const char* Desc ription = CStage_get _descripti on_string( SchemaNumb er, tblNum , Row); | |
| 543 | if( st rlen(Descr iption) > 0 ) | |
| 544 | writeStr ucturedTex t(Descript ion); | |
| 545 | puts(" </DESCR>") ; | |
| 546 | for(in t i=2; i<= NumberOfCo des; i++) | |
| 547 | StrTag(" AC", CStag e_get_code _string(Sc hemaNumber , tblNum, Row, i)); | |
| 548 | puts(" </ROW>"); | |
| 549 | } | |
| 550 | puts ("</ROWS>" ); | |
| 551 | ||
| 552 | //-- - Notes | |
| 553 | //JJB 1001 05 Added c onst | |
| 554 | cons t char *No te; | |
| 555 | int NumberOfNo tes, NoteN umber; | |
| 556 | puts ("<NOTES>" ); | |
| 557 | Numb erOfNotes = CStage_g et_number_ table_note s(SchemaNu mber, tblN um); | |
| 558 | for( NoteNumbe r=1; NoteN umber<=Num berOfNotes ; NoteNumb er++ ) | |
| 559 | { | |
| 560 | Note = CStage_ge t_table_no te(SchemaN umber, tbl Num, NoteN umber ); | |
| 561 | if( No te != NULL ) | |
| 562 | { | |
| 563 | puts("<T N>"); | |
| 564 | writeStr ucturedTex t(Note); | |
| 565 | puts("</ TN>"); | |
| 566 | } | |
| 567 | } | |
| 568 | Numb erOfNotes = CStage_g et_number_ table_foot notes(Sche maNumber, tblNum); | |
| 569 | for( NoteNumbe r=1; NoteN umber<=Num berOfNotes ; NoteNumb er++ ) | |
| 570 | { | |
| 571 | Note = CStage_ge t_table_fo otnote(Sch emaNumber, tblNum, N oteNumber) ; | |
| 572 | if( No te != NULL ) | |
| 573 | { | |
| 574 | puts("<F N>"); | |
| 575 | writeStr ucturedTex t(Note); | |
| 576 | puts("</ FN>"); | |
| 577 | } | |
| 578 | } | |
| 579 | puts ("</NOTES> "); | |
| 580 | ||
| 581 | //-- - Table tr ailer | |
| 582 | puts ("</TABLE> "); | |
| 583 | } | |
| 584 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.