- Timestamp:
- Dec 5, 2008, 3:04:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CDIC.m
r297 r298 112 112 . . S C0CFN=$P(^DD(C0CFJ,C0CFI,0),"^",1) ;PULL FIELD NAME FROM ^DD 113 113 . . ;W "N: ",C0CFN,! 114 . . ;I C0CFN="STR" W C0CFN," ",C0CFJ,! 114 115 . . I $D(@C0CFRTN@(C0CFN)) D ; IS THIS A DUPLICATE? 115 116 . . . W "DUPLICATE FOUND! ",C0CFJ," ",C0CFI," ",C0CFN,!,@C0CFRTN@(C0CFN),! 116 . . . S @C0CFRTN@( "M",@C0CFRTN@(C0CFN),C0CFN)=C0CFJ_"^"_C0CFI117 . . . S @C0CFRTN@(C0CFN_"_"_C0CFJ)=C0CFJ_"^"_C0CFI 117 118 . . E S @C0CFRTN@(C0CFN)=C0CFJ_"^"_C0CFI 118 119 . S C0CFJ=$O(^DD(C0CFJ)) ; NEXT SUBFILE 119 120 Q 120 121 ; 121 GET(GRTN,GFILE,GIEN ) ; RETURN THE DICTIONARY RECORD GIEN IN ARRAY GRTN, PASSED122 GET(GRTN,GFILE,GIEN,GNN) ; RETURN THE DICTIONARY RECORD GIEN IN ARRAY GRTN, PASSED 122 123 ; BY NAME 123 124 ; 124 N C0CTMP,C0CI,C0CJ,C0CREF,C0CNAME 125 ;N C0CTMP,C0CI,C0CJ,C0CREF,C0CNAME 126 I $D(GNN) I GNN="ALL" S C0CNN=0 ; NOT NON-NULL (ALL FIELDS TO BE RETURNED) 127 E S C0CNN=1 ; NON-NULL IS TRUE (ONLY POPULATED FIELDS RETURNED) 125 128 S C0CREF=GIEN_"," ; OPEN ROOT REFERENCE INTO FILE 126 129 D GETS^DIQ(GFILE,C0CREF,"**","","C0CTMP") … … 132 135 . . ;W C0CJ," ",C0CI,! 133 136 . . S C0CNAME=$P(^DD(C0CJ,C0CI,0),"^",1) ;PULL THE FIELD NAME 134 . . S $P(@GRTN@(C0CNAME),"^",3)=C0CTMP(C0CJ,C0CREF,C0CI) ;RETURN VALUE IN P3 137 . . S C0CVALUE=C0CTMP(C0CJ,C0CREF,C0CI) ; 138 . . I C0CVALUE["C0CTMP" S C0CVALUE=C0CTMP(C0CJ,C0CREF,C0CI,1) ;1ST LINE OF WP 139 . . S $P(@GRTN@(C0CNAME),"^",3)=C0CVALUE ;RETURN VALUE IN P3 140 I C0CNN D ; IF ONLY NON-NULL VALUES ARE TO BE RETURNED 141 . S C0CI="" 142 . F S C0CI=$O(@GRTN@(C0CI)) Q:C0CI="" D ; GO THROUGH THE WHOLE ARRAY 143 . . I $P(@GRTN@(C0CI),"^",3)="" K @GRTN@(C0CI) ; KILL THE NULL ENTRIES 135 144 Q 136 145 ;
Note:
See TracChangeset
for help on using the changeset viewer.