Changeset 100 for ccr/trunk/p
- Timestamp:
- Aug 24, 2008, 6:36:41 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLRIMA.m
r98 r100 72 72 . ; INCREMENT THE COUNT OF PATIENTS WITH THESE ATTRIBUTES IN ATTRTBL 73 73 . ; 74 . I '$D(@RIMBASE@("ATTRTBL",RATTR)) D ; IF FIRST PAT WITH THESE ATTRS 75 . . S @RIMBASE@("ATTRTBL",RATTR)=0 ; DEFAULT VALUE TO BE INCREMENTED 76 . S @RIMBASE@("ATTRTBL",RATTR)=@RIMBASE@("ATTRTBL",RATTR)+1 ; INCREMENT 74 . ; I '$D(@RIMBASE@("ATTRTBL",RATTR)) D ; IF FIRST PAT WITH THESE ATTRS 75 . ; . S @RIMBASE@("ATTRTBL",RATTR)=0 ; DEFAULT VALUE TO BE INCREMENTED 76 . ; S @RIMBASE@("ATTRTBL",RATTR)=@RIMBASE@("ATTRTBL",RATTR)+1 ; INCREMENT 77 . ; 78 . N CATNAME,CATTBL 79 . ; S CATBASE=$NA(@RIMBASE@("ANALYSIS")) 80 . S CATNAME="" 81 . D CPUSH(.CATNAME,RIMBASE,"RIMTBL",RIMDFN,RATTR) ; ADD TO CATEGORY 82 . W "CATEGORY NAME: ",CATNAME,! 77 83 . ; 78 84 . S RIMDFN=$O(^DPT(RIMDFN)) ; NEXT PATIENT … … 90 96 I $D(@SBASE@("VITALS",1)) D APOST("SATTR","RIMTBL","VITALS") 91 97 I $D(@SBASE@("MEDS",1)) D APOST("SATTR","RIMTBL","MEDS") 98 D APOST("SATTR","RIMTBL","NOTEXTRACTED") ; OUTPUT NOT YET PRODUCED 92 99 W "ATTRIBUTES: ",SATTR,! 93 100 Q SATTR … … 96 103 K ^TMP("GPLRIM","RESUME") 97 104 K ^TMP("GPLRIM") 105 Q 106 ; 107 CLIST ; LIST THE CATEGORIES 108 ; 109 I '$D(RIMBASE) D ASETUP ; FOR COMMAND LINE CALLS 110 N CLBASE,CLNUM,ZI,CLIDX 111 S CLBASE=$NA(@RIMBASE@("RIMTBL","CATS")) 112 S CLNUM=@CLBASE@(0) 113 F ZI=1:1:CLNUM D ; LOOP THROUGH THE CATEGORIES 114 . S CLIDX=@CLBASE@(ZI) 115 . W "(",$P(@CLBASE@(CLIDX),"^",1) 116 . W ":",$P(@CLBASE@(CLIDX),"^",2),") " 117 . W CLIDX,! 118 ; D PARY^GPLXPATH(CLBASE) 119 Q 120 ; 121 CPUSH(CATRTN,CBASE,CTBL,CDFN,CATTR) ; ADD PATIENTS TO CATEGORIES 122 ; AND PASS BACK THE NAME OF THE CATEGORY TO WHICH THE PATIENT 123 ; WAS ADDED IN CATRTN, WHICH IS PASSED BY REFERENCE 124 ; CBASE IS WHERE TO PUT THE CATEGORIES PASSED BY NAME 125 ; CTBL IS THE NAME OF THE TABLE USED TO CREATE THE ATTRIBUTES, 126 ; PASSED BY NAME AND USED TO CREATE CATEGORY NAMES IE "@CTBL_X" 127 ; WHERE X IS THE CATEGORY NUMBER. CTBL(0) IS THE NUMBER OF CATEGORIES 128 ; CATBL(X)=CATTR STORES THE ATTRIBUTE IN THE CATEGORY 129 ; CDFN IS THE PATIENT DFN, CATTR IS THE ATTRIBUTE STRING 130 ; THE LIST OF PATIENTS IN A CATEGORY IS STORED INDEXED BY CATEGORY 131 ; NUMBER IE CTBL_X(CDFN)="" 132 ; 133 ; N CCTBL,CENTRY,CNUM,CCOUNT,CPATLIST 134 S CCTBL=$NA(@CBASE@(CTBL,"CATS")) 135 W "CBASE: ",CCTBL,! 136 ; 137 I '$D(@CCTBL@(CATTR)) D ; FIRST PATIENT IN THIS CATEGORY 138 . D PUSH^GPLXPATH(CCTBL,CATTR) ; ADD THE CATEGORY TO THE ARRAY 139 . S CNUM=@CCTBL@(0) ; ARRAY ENTRY NUMBER FOR THIS CATEGORY 140 . S CENTRY=CTBL_"_"_CNUM_U_0 ; TABLE ENTRY DEFAULT 141 . S @CCTBL@(CATTR)=CENTRY ; DEFAULT NON INCREMENTED TABLE ENTRY 142 . ; NOTE THAT P1 IS THE CATEGORY NAME MADE UP OF THE TABLE NAME 143 . ; AND CATGORY ARRAY NUMBER. P2 IS THE COUNT WHICH IS INITIALLY 0 144 ; 145 S CCOUNT=$P(@CCTBL@(CATTR),U,2) ; COUNT OF PATIENTS IN THIS CATEGORY 146 S CCOUNT=CCOUNT+1 ; INCREMENT THE COUNT 147 S $P(@CCTBL@(CATTR),U,2)=CCOUNT ; PUT IT BACK 148 ; 149 S CATRTN=$P(@CCTBL@(CATTR),U,1) ; THE CATEGORY NAME WHICH IS RETURNED 150 ; 151 S CPATLIST=$NA(@CBASE@(CTBL,"PATS",CATRTN)) ; BASE OF PAT LIST FOR THIS CAT 152 W "PATS BASE: ",CPATLIST,! 153 D PUSH^GPLXPATH(CPATLIST,CDFN) ; ADD THIS PATIENT TO THE CAT PAT LIST 154 ; 98 155 Q 99 156 ; … … 116 173 I '$D(RIMBASE) S RIMBASE=$NA(^TMP("GPLRIM")) 117 174 I '$D(@RIMBASE) S @RIMBASE="" 118 I '$D(RIMTBL) S RIMTBL=$NA(^TMP("GPLRIM","RIMTBL" )) ;BASE FORATTR TABLE119 S ^TMP("GPLRIM","TABLES","RIMTBL")=RIMTBL ; FOR COMMAND LINE PROCESSING175 I '$D(RIMTBL) S RIMTBL=$NA(^TMP("GPLRIM","RIMTBL","TABLE")) ; ATTR TABLE 176 S ^TMP("GPLRIM","TABLES","RIMTBL")=RIMTBL ; TABLE OF TABLES 120 177 Q 121 178 ; … … 123 180 I '$D(RIMBASE) D ASETUP ; FOR COMMAND LINE CALLS 124 181 K @RIMTBL 182 D APUSH(RIMTBL,"EXTRACTED") 183 D APUSH(RIMTBL,"NOTEXTRACTED") 125 184 D APUSH(RIMTBL,"HEADER") 126 185 D APUSH(RIMTBL,"NOPCP")
Note:
See TracChangeset
for help on using the changeset viewer.