- Timestamp:
- Dec 16, 2008, 2:10:26 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CRNF.m
r307 r308 70 70 ; 71 71 GETN1(GRTN,GFILE,GREF,GNDX,GNN) ; NEW GET ;GPL ; RETURN A FIELD VALUE MAP 72 ; THE FOLLOWING COMMENTS ARE WRONG.. THIS ROUTINE STILL RETURNS AN RNF1 73 ; FORMAT ARRAY @GRTN@("FIELD NAME")="FILE^FIELD#^VALUE" ;GPL 72 74 ; GETN IS AN EXTRINSIC WHICH RETURNS THE NEXT IEN AFTER THE CURRENT GIEN 73 75 ; GRTN, PASSED BY NAME, RETURNS A FIELD MAP AND A VALUE MAP … … 88 90 ; 89 91 N GIEN,GF 90 91 92 S GF=$$FILEREF(GFILE) ;CLOSED FILE REFERENCE FOR FILE NUMBER GFILE 92 93 I ('$D(GNDX))!(GNDX="") S GIEN=GREF ; IF NO INDEX USED, GREF IS THE IEN … … 103 104 S C0CREF=GIEN_"," ; OPEN ROOT REFERENCE INTO FILE 104 105 D CLEAN^DILF ; MAKE SURE WE ARE CLEANED UP 106 K C0CTMP 105 107 D GETS^DIQ(GFILE,C0CREF,"**","","C0CTMP") 106 108 D FIELDS(GRTN,GFILE) ;GET ALL THE FIELD NAMES FOR THE FILE … … 113 115 . . S C0CNAME=$P(^DD(C0CJ,C0CI,0),"^",1) ;PULL THE FIELD NAME 114 116 . . S C0CVALUE=C0CTMP(C0CJ,C0CREF,C0CI) ; 115 . . I C0CVALUE["C0CTMP" S C0CVALUE=C0CTMP(C0CJ,C0CREF,C0CI,1) ;1ST LINE OF WP 117 . . I C0CVALUE["C0CTMP" D ; WP FIELD 118 . . . N ZT,ZWP S ZWP=0 ;ITERATOR 119 . . . S C0CVALUE="" ; INITIALIZE 120 . . . F S ZWP=$O(C0CTMP(C0CJ,C0CREF,C0CI,ZWP)) Q:'ZWP D ; 121 . . . . S ZT=" "_C0CTMP(C0CJ,C0CREF,C0CI,ZWP) ;LINE OF WP 122 . . . . S ZT=$TR(ZT,"^""","|'") ;HACK TO GET RID OF ^ AND " IN TEXT " 123 . . . . S C0CVALUE=C0CVALUE_ZT ; 116 124 . . S $P(@GRTN@(C0CNAME),"^",3)=C0CVALUE ;RETURN VALUE IN P3 117 125 I C0CNN D ; IF ONLY NON-NULL VALUES ARE TO BE RETURNED … … 227 235 D RNF2CSV(G2,G1,FVN) ; PREPARE THE CVS FILE 228 236 K @G1 229 W $$OUTPUT^GPLXPATH(@G2@(1),"FILE_"_FNUM_".csv",^TMP("GPLCCR","ODIR"))237 D FILEOUT(G2,"FILE_"_FNUM_".csv") 230 238 K @G2 239 Q 240 ; 241 FILEOUT(FOARY,FONAM) ; WRITE OUT A FILE 242 ; 243 W $$OUTPUT^GPLXPATH($NA(@FOARY@(1)),FONAM,^TMP("GPLCCR","ODIR")) 231 244 Q 232 245 ; … … 238 251 I C0CF["()" S C0CF=$P(C0CF,"()",1) 239 252 Q C0CF 253 ; 254 SKIP ; 255 N TXT,DIERR 256 S TXT=$$GET1^DIQ(8925,TIUIEN,"2","","TXT") 257 I $D(DIERR) D CLEAN^DILF Q 258 W " report_text:",! ;Progress Note Text 259 N LN S LN=0 260 F S LN=$O(TXT(LN)) Q:'LN D 261 . W " text"_LN_": "_TXT(LN),! 262 . Q 263 Q 240 264 ; 241 265 ZFILE(ZFN,ZTAB) ; EXTRINSIC TO RETURN FILE NUMBER FOR FIELD NAME PASSED -
ccr/trunk/p/GPLCCR.m
r287 r308 39 39 S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCR",1)) 40 40 S ONAM=UFN 41 I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_ 7.xml"41 I UFN="" S ONAM="PAT_"_DFN_"_CCR_V1_0_10.xml" 42 42 S ODIRGLB=$NA(^TMP("GPLCCR","ODIR")) 43 43 I '$D(@ODIRGLB) D ; IF NOT ODIR HAS BEEN SET … … 142 142 ; K @VMAP 143 143 S @VMAP@("DATETIME")=$$FMDTOUTC^CCRUTIL($$NOW^XLFDT,"DT") 144 I IHDR="" D ; HEADER ARRAY IS NOT PROVIDED, USE DEFAULTS 144 ; I IHDR="" D ; HEADER ARRAY IS NOT PROVIDED, USE DEFAULTS 145 D ; ALWAYS MAP THESE VARIABLES 145 146 . S @VMAP@("ACTORPATIENT")="ACTORPATIENT_"_DFN 146 147 . S @VMAP@("ACTORFROM")="ACTORORGANIZATION_"_DUZ ; FROM DUZ - ??? … … 150 151 . S @VMAP@("ACTORTOTEXT")="Patient" ; FOR TEST PURPOSES 151 152 . ; THIS IS THE USE CASE FOR THE PHR WHERE "TO" IS THE PATIENT 152 I IHDR'="" D ; HEADER VALUES ARE PROVIDED153 . D CP^GPLXPATH(IHDR,VMAP) ; COPY HEADER VARIABLES TO MAP ARRAY153 ;I IHDR'="" D ; HEADER VALUES ARE PROVIDED 154 ;. D CP^GPLXPATH(IHDR,VMAP) ; COPY HEADER VARIABLES TO MAP ARRAY 154 155 N CTMP 155 156 D MAP^GPLXPATH(CXML,VMAP,"CTMP") 156 157 D CP^GPLXPATH("CTMP",CXML) 158 N HRIMVARS ; 159 S HRIMVARS=$NA(^TMP("GPLRIM","VARS",DFN,"HEADER")) ; TO PERSIST VARS 160 M @HRIMVARS@(1)=@VMAP ; PERSIST THE HEADER VARIABLES IN RIM TABLE 161 S @HRIMVARS@(0)=1 ; ONLY ONE SET OF HEADERS PER PATIENT 157 162 Q 158 163 ; -
ccr/trunk/p/GPLRIMA.m
r271 r308 52 52 . W "END OF PATIENT LIST, CALL RESET^GPLRIMA",! 53 53 F RIMI=1:1:DFNCNT D Q:+RIMDFN=0 ; FOR DFNCNT NUMBER OF PATIENTS OR END 54 . K @RIMBASE@("VARS",RIMDFN) ; CLEAR OUT OLD VARS 54 55 . D CCRRPC^GPLCCR(.CCRGLO,RIMDFN,"CCR","","","") ;PROCESS THE CCR 55 56 . W RIMDFN,! 56 . K @RIMBASE@("VARS",RIMDFN) ; CLEAR OUT OLD VARS57 57 . ; 58 58 . ; COPY ALL THE VARIABLES TO THE RIM MAP AREA INDEXED BY PATIENT … … 411 411 N ZZGI 412 412 I WHICH="ALL" D ; VARIABLES FROM ALL SECTIONS 413 . F ZZGI=" PROBLEMS","VITALS","MEDS","ALERTS","RESULTS" D ; EACH SECTION413 . F ZZGI="HEADER","PROBLEMS","VITALS","MEDS","ALERTS","RESULTS" D ; 414 414 . . D ZGVWRK(ZZGI) ; DO EACH SECTION 415 415 E D ZGVWRK(WHICH) ; ONLY ONE SECTION ASKED FOR … … 427 427 . . K ZZGN2 N ZZGN2 ; NAME FOR MULTIPLE 428 428 . . S ZZGN2=$NA(@ZZGN@(ZGVI)) 429 . . ;W ZZGN2,!,$O(@ZZGN2@("")),!429 . . W ZZGN2,!,$O(@ZZGN2@("")),! 430 430 . . D H2ARY^GPLXPATH("ZZGA",ZZGN2,ZGVI) ; CONVERT HASH TO ARRAY 431 431 . . ; D PARY^GPLXPATH("ZZGA") … … 435 435 DPATV(DFN,IWHICH) ; DISPLAY VARS FOR PATIENT DFN THAT ARE MAINTAINED IN GPLRIM 436 436 ; ALONG WITH SAMPLE VALUES. 437 ; IWHICH IS "ALL","MEDS","VITALS","PROBLEMS","ALERTS","RESULTS" 437 ; IWHICH IS "ALL","MEDS","VITALS","PROBLEMS","ALERTS","RESULTS","HEADER" 438 438 N GTMP 439 439 I '$D(^TMP("GPLRIM","ATTR",DFN)) D ; RIM VARS NOT PRESENT … … 444 444 Q 445 445 ; 446 RIM2RNF(R2RTN,DFN,RWHICH) ; CONVERTS RIM VARIABLES TO RNF2 FORMAT 447 ; RETURN IN R2RTN, WHICH IS PASSED BY NAME 448 ; RWHICH IS RIM SECTION TO RETURN, DEFAULTS TO "ALL" 449 ; 450 I '$D(RWHICH) S RWHICH="ALL" 451 ;N R2TMP 452 I '$D(^TMP("GPLRIM","ATTR",DFN)) D ; RIM VARS NOT PRESENT 453 . D ANALYZE(DFN,1) ; REFRESH THE RIM VARIABLES 454 D RPCGV(.R2TMP,DFN,RWHICH) ; RETRIEVE ALL THE VARIABLES I AN ARRAY 455 N R2I,R2J,R2X,R2X1,R2X2,R2Y,R2Z 456 F R2I=1:1:R2TMP(0) D ; FOR EVERY LINE OF THE ARRAY 457 . S R2X=$P(R2TMP(R2I),"^",1) ; OCCURANCE 458 . S R2Y=$P(R2TMP(R2I),"^",2) ; VARIABLE NAME 459 . I $L(R2Y)<4 Q ; SKIP SHORT VARIABLES (THEY ARE FOR DEBUGGING) 460 . S R2Z=$P(R2TMP(R2I),"^",3) ; VALUE 461 . I R2X[";" D ; THERES MULTIPLES 462 . . S R2X1=$P(R2X,";",1) ; FIRST INDEX 463 . . S R2X2=$P(R2X,";",2) ; SECOND INDEX 464 . . S R2J=R2Y_"["_R2X2_"]" ; BUILD THE VARIABLE NAME 465 . . S @R2RTN@("F",R2J,1)="" ; PUT VARIABLE NAME IN FIELD MAP 466 . . S @R2RTN@("V",R2X1,R2J,1)=R2Z ; PUT THE VALUE IN THE ARRAY 467 . E D ; NO SUB-MULTIPLES 468 . . S @R2RTN@("F",R2Y,1)="" ; PUT VARIABLE NAME IN FIELD MAP 469 . . S @R2RTN@("V",R2X,R2Y,1)=R2Z ; PUT THE VALUE IN THE ARRAY 470 Q 471 ; 472 RIM2CSV(DFN) ; WRITE THE RIM VARIABLES FOR A PATIENT TO A CSV FILE 473 ; 474 N R2CTMP,R2CARY 475 D RIM2RNF("R2CTMP",DFN) ; CONVERT VARIABLES TO RNF FORMAT 476 D RNF2CSV^C0CRNF("R2CARY","R2CTMP","NV") ; CONVERT RNF TO CSV FORMAT 477 D FILEOUT^C0CRNF("R2CARY","VARS-"_DFN_".csv") 478 Q 479 ;
Note:
See TracChangeset
for help on using the changeset viewer.