- Timestamp:
- Dec 6, 2008, 6:13:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CDIC.m
r298 r299 123 123 ; BY NAME 124 124 ; 125 ;N C0CTMP,C0CI,C0CJ,C0CREF,C0CNAME125 N C0CTMP,C0CI,C0CJ,C0CREF,C0CNAME 126 126 I $D(GNN) I GNN="ALL" S C0CNN=0 ; NOT NON-NULL (ALL FIELDS TO BE RETURNED) 127 127 E S C0CNN=1 ; NON-NULL IS TRUE (ONLY POPULATED FIELDS RETURNED) 128 128 S C0CREF=GIEN_"," ; OPEN ROOT REFERENCE INTO FILE 129 D CLEAN^DILF ; MAKE SURE WE ARE CLEANED UP 129 130 D GETS^DIQ(GFILE,C0CREF,"**","","C0CTMP") 130 131 D FIELDS(GRTN,GFILE) ;GET ALL THE FIELD NAMES FOR THE FILE … … 144 145 Q 145 146 ; 147 GETALL(GARFLD,GARVAL,GAFILE,GACNT,GASTRT,GANN) ; RETURN FIELD MAP AND VALUES 148 ; GARFLD, PASSED BY NAME, RETURNS FIELD MAP @GARFLD@("FIELDNAME") 149 ; .. ANY FIELD USED BY ANY RECORD PROCESSED IS IN THE FIELD MAP 150 ; .. GARFLD IS NOT INITIALIZED, SO MULTIPLE CALLS ARE CUMULATIVE 151 ; .. IF GANN="ALL" THEN ALL FIELDS FOR THE FILE ARE IN THE FIELD MAP 152 ; GARVAL, PASSED BY NAME, RETURNS VALUES AS @GARVAL@(IEN,"FIELDNAME")=VALUE 153 ; .. FOR EVERY RECORD PROCESSED. IT IS NOT INITIALEZED SO IT IS CUMMULATIVE 154 ; .. EVEN IF GANN="ALL" ONLY POPULATED FIELDS ARE RETURNED IN GARVAL 155 ; .. NUL FIELDS CAN BE DETERMINED BY CHECKING GARFLD - THIS SAVES SPACE 156 ; GARFILE IS THE FILE NUMBER TO BE PROCESSED. IT IS PASSED BY VALUE 157 ; GARCNT IS THE NUMBER OF RECORDS TO PROCESS. IT IS PASSED BY VALUE 158 ; .. IF GARCNT IS NULL, ALL RECORDS ARE PROCESSED 159 ; GARSTRT IS THE IEN OF THE FIRST RECORD TO PROCESS. IT IS PASSED BY VALUE 160 ; .. IF GARSTART IS NULL, PROCESSING STARTS AT THE FIRST RECORD 161 ; GANN= NOT NULL - IF GANN IS "ALL" THEN EVEN NULL FIELDS WILL BE RETURNED 162 ; OTHERWISE, ONLY POPULATED FIELDS ARE RETURNED IN GARFLD AND GARVAL 163 N GATMP,GAI,GAF 164 S GAF=^DIC(GAFILE,0,"GL") ;OPEN ROOT TO FILE 165 S GAF=$P(GAF,",",1)_")" ; CLOSE THE ROOT 166 W $O(@GAF@(0)) ; 167 S GAI=0 ;ITERATOR 168 ; F S GAI=$O(@GAF@ 169 Q 170 ; 146 171 INIT ; INITIALIZE CCR DICTIONARY BASED ON VARIABLE NAMES 147 172 ; … … 166 191 F S C0CZX=$O(^C0CDIC(170,C0CZX)) Q:+C0CZX=0 D ; FOR EACH DICT ENTRY 167 192 . ;W C0CZX,! 168 . K C0CA ; CLEAR OUT THE LAST ONE 169 . D GET("C0CA",170,C0CZX) ; GET VARIABLE HASH 193 . K C0CA,C0CN ; CLEAR OUT THE LAST ONE 194 . D GET("C0CA",170,C0CZX,"ALL") ; GET VARIABLE HASH 195 . ;ZWR C0CA B ; 170 196 . S C0CN=$$ZVALUE("VARIABLE") ;NAME OF THE VARIABLE 197 . W "VARIABLE: ",C0CN,! 171 198 . I $E(C0CN,1,5)="ACTOR" D SETFDA("SECTION","ACTORS") ; 172 199 . I $E(C0CN,1,6)="SOCIAL" D ; 173 . . D SETFDA("SECTION","SOC IAL HISTORY") ;200 . . D SETFDA("SECTION","SOC") ; 174 201 . . D SETFDA("STATUS","X") ;SOCIAL HISTORY NOT IMPLEMENTED 175 202 . . S C0CSTAT=1 176 203 . I $E(C0CN,1,6)="FAMILY" D ; 177 . . D SETFDA("SECTION","FAM ILY HISTORY") ;204 . . D SETFDA("SECTION","FAM") ; 178 205 . . D SETFDA("STATUS","X") ;FAMILY HISTORY NOT IMPLEMENTED 179 206 . . S C0CSTAT=1 207 . ;D SETFDA("TYPE","") ;CORRECT FOR TYPE ERRORS 180 208 . I $E(C0CN,1,5)="ALERT" D SETFDA("SECTION","ALERTS") 181 . I $E(C0CN,1,5)="VITAL" D SETFDA("SECTION","VIT ")209 . I $E(C0CN,1,5)="VITAL" D SETFDA("SECTION","VITALS") 182 210 . I $E(C0CN,1,7)="PROBLEM" D SETFDA("SECTION","PROBLEMS") 183 211 . I $E(C0CN,1,10)="RESULTTEST" D SETFDA("SECTION","TEST") … … 188 216 . I $$ZVALUE("STATUS")=""!'C0CSTAT D SETFDA("STATUS","N") ;BLANK STATUS TO N 189 217 . I $$ZVALUE("XPATH")["/Medication/Directions/" D ; MEDS DIRECTIONS VAR 190 . . D SETFDA("SECTION","DIR ECTIONS") ; SPECIAL SECTION FOR DIRECTIONS218 . . D SETFDA("SECTION","DIR") ; SPECIAL SECTION FOR DIRECTIONS 191 219 . E I $$ZVALUE("XPATH")["/Medications/Medication/" D ; ALL OTHER MEDS 192 220 . . D SETFDA("SECTION","MEDS") ; A MEDS VAR … … 196 224 . ;ZWR C0CFDA 197 225 . I $D(C0CFDA) D ; WE HAVE CHANGES ON THIS VARIABLE 198 . . ZWR C0CFDA226 . . ;ZWR C0CFDA 199 227 . . D UPDATE^DIE("","C0CFDA(C0CZX)") 200 228 . . I $D(^TMP("DIERR",$J)) U $P BREAK 201 ; ZWR C0CFDA 229 . . D CLEAN^DILF ; CLEAN UP 230 . ;ZWR C0CFDA 202 231 Q 203 232 ;
Note:
See TracChangeset
for help on using the changeset viewer.