Changeset 370 for ccr/trunk/p
- Timestamp:
- Feb 16, 2009, 12:34:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CFM2.m
r368 r370 28 28 Q 29 29 ; 30 SHOWBUG ; 31 M C0CFDA=^KBAI("C0CFDA",1) 32 D CLEAN^DILF 33 D UPDATE^DIE("","C0CFDA","","ZERR") 34 ZWR C0CFDA 35 ZWR ZERR 30 RIMTBL(ZWHICH) ; PUT ALL PATIENT IN RIMTBL ZWHICH INTO THE CCR ELEMENTS FILE 31 ; 32 I '$D(RIMBASE) D ASETUP^GPLRIMA ; FOR COMMAND LINE CALLS 33 N ZI,ZJ,ZC,ZPATBASE 34 S ZPATBASE=$NA(@RIMBASE@("RIMTBL","PATS",ZWHICH)) 35 S ZI="" 36 F ZJ=0:0 D Q:$O(@ZPATBASE@(ZI))="" ; TIL END 37 . S ZI=$O(@ZPATBASE@(ZI)) 38 . D PUTRIM(ZI) ; EXPORT THE PATIENT TO A FILE 36 39 Q 37 40 ; … … 56 59 F S C0CX=$O(@ZVARS@(C0CX)) Q:C0CX="" D ; FOR EACH OCCURANCE 57 60 . W "ZOCC=",C0CX,! 61 . K C0CMDO ; MULTIPLE SUBELEMENTS FOR THIS OCCURANCE PASSED BY NAME 58 62 . S C0CV=$NA(@ZVARS@(C0CX)) ; VARIABLES FOR THIS OCCURANCE 59 63 . D PUTELS(DFN,ZZTYP,C0CX,C0CV) ; PUT THEM TO THE CCR ELEMENTS FILE 64 . I $D(C0CMDO) D ; MULTIPLES TO HANDLE (THIS IS INSTEAD OF RECURSION :() 65 . . N ZZCNT,ZZC0CI,ZZVALS,ZT,ZZCNT,ZV 66 . . S ZZCNT=0 67 . . S ZZC0CI=0 68 . . S ZZVALS=$NA(@C0CMDO@("M")) ; LOCATION OF THIS MULTILPE 69 . . S ZT=$O(@ZZVALS@("")) ; ELEMENT TYPE OF MULTIPLE 70 . . S ZZVALS=$NA(@ZZVALS@(ZT)) ; PAST MULTIPLE TYPE INDICATOR 71 . . W "MULTIPLE:",ZZVALS,! 72 . . ;B 73 . . F S ZZC0CI=$O(@ZZVALS@(ZZC0CI)) Q:ZZC0CI="" D ; EACH MULTIPLE 74 . . . S ZZCNT=ZZCNT+1 ;INCREMENT COUNT 75 . . . W "COUNT:",ZZCNT,! 76 . . . S ZV=$NA(@ZZVALS@(ZZC0CI)) 77 . . . D PUTELS(DFN,ZT,C0CX_";"_ZZCNT,ZV) 60 78 Q 61 79 ; … … 68 86 ; AND @ZVALS@("M",SUBOCCUR,"VAR2")="VALUE2" FOR SUB VARIABLES 69 87 ; 70 N ZSRC 88 N ZSRC,PATN,ZTYPN,XD0,ZTYP 71 89 S ZSRC=1 ; CCR SOURCE IS ASSUMED TO BE THIS EHR, WHICH IS ALWAYS SOURCE 1 72 90 ; PUT THIS IN PARAMETERS - SO SOURCE NUMBER FOR PROCESSING IN CONFIGURABLE … … 78 96 ;FILE IS ^C0CE(PAT,1,SCR,1,TYP,1,OCC,1,VAR,1, ... 79 97 ; AND WE HAVE TO ADD THEM LEVEL AT A TIME I THINK 80 KC0CFDA98 N C0CFDA 81 99 S C0CFDA(C0CFPAT,"?+1,",.01)=DFN 82 100 D UPDIE ; ADD THE PATIENT … … 94 112 S ZD0=$O(^C0CE(PATN,1,ZSRC,1,ZTYP,1,"B"," "_ZOCC,"")) 95 113 W "RECORD NUMBER: ",ZD0,! 96 ;B 114 ;I ZD0=32 B 115 ;I ZD0=31 B 97 116 N ZCNT,ZC0CI,ZVARN,C0CZ1 98 117 S ZCNT=0 … … 107 126 . . S C0CFDA(C0CFVAR,"?+"_ZCNT_","_ZD0_","_C0CZ1,1)=@ZVALS@(ZC0CI) 108 127 . E D ; THIS IS A SUBELEMENT 109 . . N ZZCNT,ZZC0CI,ZZVALS,ZZVALS,ZT 110 . . S ZZCNT=0 111 . . S ZZC0CI=0 112 . . S ZZVALS=$NA(@ZVALS@("M")) ; LOCATION OF THIS MULTILPE 113 . . S ZT=$O(@ZZVALS@("")) ; ELEMENT TYPE OF MULTIPLE 114 . . S ZZVALS=$NA(@ZZVALS@(ZT)) ; PAST MULTIPLE TYPE INDICATOR 115 . . W "MULTIPLE:",ZZVALS,! 116 . . ;B 117 . . F S ZZC0CI=$O(@ZZVALS@(ZZC0CI)) Q:ZZC0CI="" D ; EACH MULTIPLE 118 . . . S ZZCNT=ZZCNT+1 ;INCREMENT COUNT 119 . . . W "COUNT:",ZZCNT,! 120 . . . S ZV=$NA(@ZZVALS@(ZZC0CI)) 121 . . . D PUTELS(DFN,ZT,ZOCC_";"_ZZCNT,ZV) 122 D CLEAN^DILF 123 D UPDATE^DIE("","C0CFDA","","ZERR") 124 I $D(ZERR) D ; 125 . W "ERROR",! 126 . ZWR ZERR 127 . B 128 K C0CFDA 128 . . ;PUT THE FOLLOWING BACK TO USE RECURSION 129 . . ;N ZZCNT,ZZC0CI,ZZVALS,ZT,ZZCNT,ZV 130 . . ;S ZZCNT=0 131 . . ;S ZZC0CI=0 132 . . ;S ZZVALS=$NA(@ZVALS@("M")) ; LOCATION OF THIS MULTILPE 133 . . ;S ZT=$O(@ZZVALS@("")) ; ELEMENT TYPE OF MULTIPLE 134 . . ;S ZZVALS=$NA(@ZZVALS@(ZT)) ; PAST MULTIPLE TYPE INDICATOR 135 . . ;W "MULTIPLE:",ZZVALS,! 136 . . ;B 137 . . ;F S ZZC0CI=$O(@ZZVALS@(ZZC0CI)) Q:ZZC0CI="" D ; EACH MULTIPLE 138 . . ;. S ZZCNT=ZZCNT+1 ;INCREMENT COUNT 139 . . ;. W "COUNT:",ZZCNT,! 140 . . ;. S ZV=$NA(@ZZVALS@(ZZC0CI)) 141 . . ;. D PUTELS(DFN,ZT,ZOCC_";"_ZZCNT,ZV) ; PUT THIS BACK TO DEBUG RECURSION 142 . . S C0CMDO=ZVALS ; FLAG TO HANDLE MULTIPLES (INSTEAD OF RECURSION) 143 D UPDIE ; UPDATE 129 144 Q 130 145 ;
Note:
See TracChangeset
for help on using the changeset viewer.