- Timestamp:
- Jan 9, 2010, 11:09:54 PM (15 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CDIC.m
r307 r662 20 20 W "This is the CCR Dictionary Utility Library ",! 21 21 W ! 22 Q 23 ; 24 DIC2CSV ;OUTPUT THE CCR DICTIONARY TO A CSV FILE 25 ; 26 N ZI 27 S ZI="" 28 S G1=$NA(^TMP($J,"C0CCSV",1)) 29 S G1A=$NA(@G1@("V")) 30 S G2=$NA(^TMP($J,"C0CCSV",2)) 31 D GETN2^C0CRNF(G1,170) ; GET THE MATRIX 32 F S ZI=$O(@G1A@(ZI)) Q:ZI="" D ;FOR EACH ROW IN THE MATRIX 33 . I $G(@G1A@(ZI,"MAPPING METHOD",1))'="" D ; 34 . . W @G1A@(ZI,"MAPPING METHOD",1),! 35 . . ;K @G1A@(ZI,"MAPPING METHOD") 36 . ;W !,ZI,$G(@G1A@(ZI,"MAPPING METHOD",1)) 37 D RNF2CSV^C0CRNF(G2,G1,"VN") ; PREPARE THE CVS FILE 38 K @G1 39 D FILEOUT^C0CRNF(G2,"FILE_"_170_".csv") 40 K @G2 22 41 Q 23 42 ; -
ccr/trunk/p/C0CRNF.m
r569 r662 260 260 . S RNX=RNX_RNI_"," ;ADD THE COLUMM ELEMENT AND A COMMA 261 261 S RNX=$E(RNX,1,$L(RNX)-1) ; STRIP OFF THE LAST COMMA 262 D PUSH^ GPLXPATH(RNRTN,RNX) ; FIRST LINE CONTAINS COLUMN HEADINGS262 D PUSH^C0CXPATH(RNRTN,RNX) ; FIRST LINE CONTAINS COLUMN HEADINGS 263 263 S RNI="" 264 264 F S RNI=$O(@RNR@(RNI)) Q:RNI="" D ; FOR EACH ROW … … 270 270 . . E S RNX=RNX_"," ; NUL COLUMN 271 271 . S RNX=$E(RNX,1,$L(RNX)-1) ; STRIP OFF THE LAST COMMA 272 . D PUSH^ GPLXPATH(RNRTN,RNX)272 . D PUSH^C0CXPATH(RNRTN,RNX) 273 273 Q 274 274 ; … … 282 282 . S RNX=RNX_RNI_"," ;ADD THE COLUMM ELEMENT AND A COMMA 283 283 S RNX=$E(RNX,1,$L(RNX)-1) ; STRIP OFF THE LAST COMMA 284 D PUSH^ GPLXPATH(RNRTN,RNX) ; FIRST LINE CONTAINS COLUMN HEADINGS284 D PUSH^C0CXPATH(RNRTN,RNX) ; FIRST LINE CONTAINS COLUMN HEADINGS 285 285 S RNI="" 286 286 F S RNI=$O(@RNR@(RNI)) Q:RNI="" D ; FOR EACH ROW … … 292 292 . . E S RNX=RNX_"," ; NUL COLUMN 293 293 . S RNX=$E(RNX,1,$L(RNX)-1) ; STRIP OFF THE LAST COMMA 294 . D PUSH^ GPLXPATH(RNRTN,RNX)294 . D PUSH^C0CXPATH(RNRTN,RNX) 295 295 Q 296 296 ; … … 314 314 FILEOUT(FOARY,FONAM) ; WRITE OUT A FILE 315 315 ; 316 W $$OUTPUT^ GPLXPATH($NA(@FOARY@(1)),FONAM,^TMP("GPLCCR","ODIR"))316 W $$OUTPUT^C0CXPATH($NA(@FOARY@(1)),FONAM,^TMP("GPLCCR","ODIR")) 317 317 Q 318 318 ; … … 334 334 . W " text"_LN_": "_TXT(LN),! 335 335 . Q 336 Q 337 ; 338 RNF2HNV(ZOUT,ZIN) ;RETURN AN HTML TABLE IN ZOUT, PASSED BY NAME 339 ; OF ZIN, WHICH IS PASSED BY NAME AND IS IN RNF2 FORMAT 340 ; ZOUT IS NOT INITIALIZED, SO THE TABLE WILL GO AT THE END 341 ; THE TABLE WILL BE IN NV FORMAT, ROWS ARE NAMES COLUMNS ARE VALUES 342 D PUSH^C0CXPATH(ZOUT,"<table>") 343 N ZI,ZJ,ZV,ZN S ZI="" S ZJ=0 344 D PUSH^C0CXPATH(ZOUT,"<tr><td></td>") ;begin row and leave a blank col 345 F S ZJ=$O(@ZIN@("V",ZJ)) Q:+ZJ=0 D ; FOR EACH OCCURANCE 346 . S ZV="<td>"_ZJ_"</td>" ; OCCURANCE AS COLUMNS HEADER 347 D PUSH^C0CXPATH(ZOUT,"</tr>") ;end of first row 348 F S ZI=$O(@ZIN@("F",ZI)) Q:ZI="" D ; FOR EACH VARIABLE 349 . S ZN="<tr><td>"_ZI_"</td>" ; VARIABLE NAME IN FIRST COLUMN 350 . S ZJ=0 ;RESET TO DO IT AGAIN 351 . F S ZJ=$O(@ZIN@("V",ZJ)) Q:+ZJ=0 D ; FOR EACH OCCURANCE 352 . . S ZV="<td>"_$G(@ZIN@("V",ZJ,ZI,1))_"</td>" 353 . . D PUSH^C0CXPATH(ZOUT,ZV) 354 . D PUSH^C0CXPATH(ZOUT,"</tr>") ;END OF ROW 355 D PUSH^C0CXPATH(ZOUT,"</table>") ; end of table 356 Q 357 ; 358 RNF2HVN(ZOUT,ZIN) ;RETURN AN HTML TABLE IN ZOUT, PASSED BY NAME 359 ; OF ZIN, WHICH IS PASSED BY NAME AND IS IN RNF2 FORMAT 360 ; ZOUT IS NOT INITIALIZED, SO THE TABLE WILL GO AT THE END 361 ; THE TABLE WILL BE IN VN FORMAT, ROWS ARE VALUES COLUMNS ARE NAMES 362 D PUSH^C0CXPATH(ZOUT,"<table>") 363 N ZI,ZJ S ZI="" S ZJ=0 364 D PUSH^C0CXPATH(ZOUT,"<tr>") ;new row for column headers 365 F S ZI=$O(@ZIN@("F",ZI)) Q:ZI="" D ; FOR EACH VARIABLE 366 . S ZV="<td>"_ZI_"</td>" 367 . D PUSH^C0CXPATH(ZOUT,ZV) ; name 368 D PUSH^C0CXPATH(ZOUT,"</tr>") ; end header row 369 S ZI="" ;RESET TO DO AGAIN 370 F S ZJ=$O(@ZIN@("V",ZJ)) Q:+ZJ=0 D ; FOR EACH ROW OF VARIABLES 371 . D PUSH^C0CXPATH(ZOUT,"<tr>") ;begin row 372 . F S ZI=$O(@ZIN@("F",ZI)) Q:ZI="" D ; FOR EACH VARIABLE 373 . . S ZV="<td>"_$G(@ZIN@("V",ZJ,ZI,1))_"</td>" ; value 374 . . D PUSH^C0CXPATH(ZOUT,ZV) ; value 375 . D PUSH^C0CXPATH(ZOUT,"</tr>") ; end header 376 D PUSH^C0CXPATH(ZOUT,"</table>") ;end of table 336 377 Q 337 378 ;
Note:
See TracChangeset
for help on using the changeset viewer.