Changeset 299 for ccr/trunk


Ignore:
Timestamp:
Dec 6, 2008, 6:13:42 PM (16 years ago)
Author:
George Lilly
Message:

fixes to GET

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/C0CDIC.m

    r298 r299  
    123123 ; BY NAME
    124124 ;
    125  ;N C0CTMP,C0CI,C0CJ,C0CREF,C0CNAME
     125 N C0CTMP,C0CI,C0CJ,C0CREF,C0CNAME
    126126 I $D(GNN) I GNN="ALL" S C0CNN=0 ; NOT NON-NULL (ALL FIELDS TO BE RETURNED)
    127127 E  S C0CNN=1 ; NON-NULL IS TRUE (ONLY POPULATED FIELDS RETURNED)
    128128 S C0CREF=GIEN_"," ; OPEN ROOT REFERENCE INTO FILE
     129 D CLEAN^DILF ; MAKE SURE WE ARE CLEANED UP
    129130 D GETS^DIQ(GFILE,C0CREF,"**","","C0CTMP")
    130131 D FIELDS(GRTN,GFILE) ;GET ALL THE FIELD NAMES FOR THE FILE
     
    144145 Q
    145146 ;
     147GETALL(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 ;
    146171INIT ; INITIALIZE CCR DICTIONARY BASED ON VARIABLE NAMES
    147172 ;
     
    166191 F  S C0CZX=$O(^C0CDIC(170,C0CZX)) Q:+C0CZX=0  D  ; FOR EACH DICT ENTRY
    167192 . ;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 ;
    170196 . S C0CN=$$ZVALUE("VARIABLE") ;NAME OF THE VARIABLE
     197 . W "VARIABLE: ",C0CN,!
    171198 . I $E(C0CN,1,5)="ACTOR" D SETFDA("SECTION","ACTORS") ;
    172199 . I $E(C0CN,1,6)="SOCIAL" D  ;
    173  . . D SETFDA("SECTION","SOCIAL HISTORY") ;
     200 . . D SETFDA("SECTION","SOC") ;
    174201 . . D SETFDA("STATUS","X") ;SOCIAL HISTORY NOT IMPLEMENTED
    175202 . . S C0CSTAT=1
    176203 . I $E(C0CN,1,6)="FAMILY" D  ;
    177  . . D SETFDA("SECTION","FAMILY HISTORY") ;
     204 . . D SETFDA("SECTION","FAM") ;
    178205 . . D SETFDA("STATUS","X") ;FAMILY HISTORY NOT IMPLEMENTED
    179206 . . S C0CSTAT=1
     207 . ;D SETFDA("TYPE","") ;CORRECT FOR TYPE ERRORS
    180208 . 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")
    182210 . I $E(C0CN,1,7)="PROBLEM" D SETFDA("SECTION","PROBLEMS")
    183211 . I $E(C0CN,1,10)="RESULTTEST" D SETFDA("SECTION","TEST")
     
    188216 . I $$ZVALUE("STATUS")=""!'C0CSTAT D SETFDA("STATUS","N") ;BLANK STATUS TO N
    189217 . I $$ZVALUE("XPATH")["/Medication/Directions/" D  ; MEDS DIRECTIONS VAR
    190  . . D SETFDA("SECTION","DIRECTIONS") ; SPECIAL SECTION FOR DIRECTIONS
     218 . . D SETFDA("SECTION","DIR") ; SPECIAL SECTION FOR DIRECTIONS
    191219 . E  I $$ZVALUE("XPATH")["/Medications/Medication/" D  ; ALL OTHER MEDS
    192220 . . D SETFDA("SECTION","MEDS") ; A MEDS VAR
     
    196224 . ;ZWR C0CFDA
    197225 . I $D(C0CFDA) D  ; WE HAVE CHANGES ON THIS VARIABLE
    198  . . ZWR C0CFDA
     226 . . ;ZWR C0CFDA
    199227 . . D UPDATE^DIE("","C0CFDA(C0CZX)")
    200228 . . I $D(^TMP("DIERR",$J)) U $P BREAK
    201  ; ZWR C0CFDA
     229 . . D CLEAN^DILF ; CLEAN UP
     230 . ;ZWR C0CFDA
    202231 Q
    203232 ;
Note: See TracChangeset for help on using the changeset viewer.