Changeset 100 for ccr


Ignore:
Timestamp:
Aug 24, 2008, 6:36:41 PM (16 years ago)
Author:
George Lilly
Message:

RIM report enhancements

File:
1 edited

Legend:

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

    r98 r100  
    7272    . ; INCREMENT THE COUNT OF PATIENTS WITH THESE ATTRIBUTES IN ATTRTBL
    7373    . ;
    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,!
    7783    . ;
    7884    . S RIMDFN=$O(^DPT(RIMDFN)) ; NEXT PATIENT
     
    9096    I $D(@SBASE@("VITALS",1)) D APOST("SATTR","RIMTBL","VITALS")
    9197    I $D(@SBASE@("MEDS",1)) D APOST("SATTR","RIMTBL","MEDS")
     98    D APOST("SATTR","RIMTBL","NOTEXTRACTED") ; OUTPUT NOT YET PRODUCED
    9299    W "ATTRIBUTES: ",SATTR,!
    93100    Q SATTR
     
    96103    K ^TMP("GPLRIM","RESUME")
    97104    K ^TMP("GPLRIM")
     105    Q
     106    ;
     107CLIST ; 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    ;
     121CPUSH(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    ;
    98155    Q
    99156    ;
     
    116173      I '$D(RIMBASE) S RIMBASE=$NA(^TMP("GPLRIM"))
    117174      I '$D(@RIMBASE) S @RIMBASE=""
    118       I '$D(RIMTBL) S RIMTBL=$NA(^TMP("GPLRIM","RIMTBL")) ;BASE FOR ATTR TABLE
    119       S ^TMP("GPLRIM","TABLES","RIMTBL")=RIMTBL ; FOR COMMAND LINE PROCESSING
     175      I '$D(RIMTBL) S RIMTBL=$NA(^TMP("GPLRIM","RIMTBL","TABLE")) ; ATTR TABLE
     176      S ^TMP("GPLRIM","TABLES","RIMTBL")=RIMTBL ; TABLE OF TABLES
    120177      Q
    121178      ;
     
    123180      I '$D(RIMBASE) D ASETUP ; FOR COMMAND LINE CALLS
    124181      K @RIMTBL
     182      D APUSH(RIMTBL,"EXTRACTED")
     183      D APUSH(RIMTBL,"NOTEXTRACTED")
    125184      D APUSH(RIMTBL,"HEADER")
    126185      D APUSH(RIMTBL,"NOPCP")
Note: See TracChangeset for help on using the changeset viewer.