- Timestamp:
- Dec 8, 2008, 12:59:46 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CDIC.m
r300 r301 122 122 . ;W C0CZX,! 123 123 . K C0CA,C0CN ; CLEAR OUT THE LAST ONE 124 . D GET ^C0CRNF("C0CA",170,C0CZX,"ALL") ; GET VARIABLE HASH124 . D GETN^C0CRNF("C0CA",170,C0CZX,"ALL") ; GET VARIABLE HASH 125 125 . ;ZWR C0CA B ; 126 126 . S C0CN=$$ZVALUE("VARIABLE") ;NAME OF THE VARIABLE -
ccr/trunk/p/C0CRNF.m
r300 r301 43 43 Q 44 44 ; 45 GET (GRTN,GFILE,GIEN,GNN) ; RETURN THE DICTIONARY RECORD GIEN IN ARRAY GRTN, PASSED46 ; BY NAME45 GETN(GRTN,GFILE,GIEN,GNN) ; GET FIELDS FOR ACCESS BY NAME 46 ; GRTN IS PASSED BY NAME 47 47 ; 48 48 N C0CTMP,C0CI,C0CJ,C0CREF,C0CNAME … … 68 68 Q 69 69 ; 70 GET2(GRTN,GFILE,GREF,GNDX,GNN) ; NEW GET ;GPL ;RETURN THE DICTIONARY RECORD GIEN IN ARRAY GRTN, PASSED 71 ; BY NAME 72 ; GET IS AN EXTRINSIC WHICH RETURNS THE NEXT IEN AFTER THE CURRENT GIEN 70 GETN2(GRTN,GFILE,GREF,GNDX,GNN) ; NEW GET ;GPL ; RETURN A FIELD VALUE MAP 71 ; GETN IS AN EXTRINSIC WHICH RETURNS THE NEXT IEN AFTER THE CURRENT GIEN 72 ; GRTN, PASSED BY NAME, RETURNS A FIELD MAP AND A VALUE MAP 73 ; .. FIELD MAP @GRTN@("F","FIELDNAME^FILE^FIELD#")="" 74 ; ... ANY FIELD USED BY ANY RECORD PROCESSED IS IN THE FIELD MAP 75 ; .. VALUE MAP @GRTN@("V","IEN","FIELDNAME")=VALUE 76 ; .. GRTN IS NOT INITIALIZED, SO MULTIPLE CALLS ARE CUMULATIVE 77 ; .. IF GNN="ALL" THEN ALL FIELDS FOR THE FILE ARE IN THE FIELD MAP 78 ; .. EVEN IF GNN="ALL" ONLY POPULATED FIELDS ARE RETURNED IN THE VALUE MAP 79 ; .. NUL FIELDS CAN BE DETERMINED BY CHECKING FIELD MAP - THIS SAVES SPACE 73 80 ; IF GREF IS "" THE FIRST RECORD IS OBTAINED 74 81 ; IF GNDX IS NULL, GREF IS AN IEN FOR THE FILE … … 77 84 ; GANN= NOT NULL - IF GANN IS "ALL" THEN EVEN NULL FIELDS WILL BE RETURNED 78 85 ; OTHERWISE, ONLY POPULATED FIELDS ARE RETURNED IN GRTN 79 ;80 86 ; 81 N GIEN 87 ; 88 N GIEN,GF 89 S GF=$$FILEREF(GFILE) ;CLOSED FILE REFERENCE FOR FILE NUMBER GFILE 82 90 I '$D(GNDX) S GIEN=GREF ; IF NO INDEX USED, GREF IS THE IEN 83 91 E D ; WE ARE USING AN INDEX 84 . 92 . ;N ZG 93 . S ZG=$Q(@GF@(GNDX,GREF)) ;ACCESS INDEX 94 . I $QS(ZG,3)=GREF D ; IS GREF IN INDEX? 95 . . S GIEN=$QS(ZG,4) ; PULL OUT THE IEN 96 . E S GIEN="" ; NOT FOUND IN INDEX 97 W "IEN: ",GIEN,! 85 98 N C0CTMP,C0CI,C0CJ,C0CREF,C0CNAME 86 99 I $D(GNN) I GNN="ALL" S C0CNN=0 ; NOT NON-NULL (ALL FIELDS TO BE RETURNED) … … 105 118 Q 106 119 ; 107 GETALL(GARFLD,GARVAL,GAFILE,GACNT,GASTRT,GANN) ; RETURN FIELD MAP AND VALUES 108 ; GARFLD, PASSED BY NAME, RETURNS FIELD MAP @GARFLD@("FIELDNAME") 109 ; .. ANY FIELD USED BY ANY RECORD PROCESSED IS IN THE FIELD MAP 110 ; .. GARFLD IS NOT INITIALIZED, SO MULTIPLE CALLS ARE CUMULATIVE 120 GETALL(GARTN,GAFILE,GACNT,GASTRT,GANN) ; RETURN FIELD MAP AND VALUES 121 ; GARTN, PASSED BY NAME, RETURNS A FIELD MAP AND A VALUE MAP 122 ; .. FIELD MAP @GARTN@("F","FIELDNAME^FILE^FIELD#")="" 123 ; ... ANY FIELD USED BY ANY RECORD PROCESSED IS IN THE FIELD MAP 124 ; .. VALUE MAP @GARTN@("V","IEN","FIELDNAME")=VALUE 125 ; .. GARTN IS NOT INITIALIZED, SO MULTIPLE CALLS ARE CUMULATIVE 111 126 ; .. IF GANN="ALL" THEN ALL FIELDS FOR THE FILE ARE IN THE FIELD MAP 112 ; GARVAL, PASSED BY NAME, RETURNS VALUES AS @GARVAL@(IEN,"FIELDNAME")=VALUE 113 ; .. FOR EVERY RECORD PROCESSED. IT IS NOT INITIALEZED SO IT IS CUMMULATIVE 114 ; .. EVEN IF GANN="ALL" ONLY POPULATED FIELDS ARE RETURNED IN GARVAL 115 ; .. NUL FIELDS CAN BE DETERMINED BY CHECKING GARFLD - THIS SAVES SPACE 116 ; GARFILE IS THE FILE NUMBER TO BE PROCESSED. IT IS PASSED BY VALUE 117 ; GARCNT IS THE NUMBER OF RECORDS TO PROCESS. IT IS PASSED BY VALUE 127 ; .. EVEN IF GANN="ALL" ONLY POPULATED FIELDS ARE RETURNED IN THE VALUE MAP 128 ; .. NUL FIELDS CAN BE DETERMINED BY CHECKING FIELD MAP - THIS SAVES SPACE 129 ; GAFILE IS THE FILE NUMBER TO BE PROCESSED. IT IS PASSED BY VALUE 130 ; GACNT IS THE NUMBER OF RECORDS TO PROCESS. IT IS PASSED BY VALUE 118 131 ; .. IF GARCNT IS NULL, ALL RECORDS ARE PROCESSED 119 ; GA RSTRT IS THE IEN OF THE FIRST RECORD TO PROCESS. IT IS PASSED BY VALUE132 ; GASTRT IS THE IEN OF THE FIRST RECORD TO PROCESS. IT IS PASSED BY VALUE 120 133 ; .. IF GARSTART IS NULL, PROCESSING STARTS AT THE FIRST RECORD 121 134 ; GANN= NOT NULL - IF GANN IS "ALL" THEN EVEN NULL FIELDS WILL BE RETURNED … … 131 144 FILEREF(FNUM) ; EXTRINSIC THAT RETURNS A CLOSED ROOT FOR FILE NUMBER FNUM 132 145 ; 133 N C0CF 146 N C0CF 134 147 S C0CF=^DIC(FNUM,0,"GL") ;OPEN ROOT TO FILE 135 148 S C0CF=$P(C0CF,",",1)_")" ; CLOSE THE ROOT
Note:
See TracChangeset
for help on using the changeset viewer.