- Timestamp:
- Sep 9, 2008, 1:30:01 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLMEDS.m
r145 r146 51 51 . . S $P(ZA(ZI),U,2)=ZK ; AND STORE IT IN ARRAY 52 52 ;ZWR ZA 53 S @MEDTVMAP@(0)=ZA(0) ; SAVE NUMBER OF MEDS 53 54 F ZI=1:1:ZA(0) D ; FOR EACH MED 54 55 . I DEBUG W "ZI IS ",ZI,! -
ccr/trunk/p/GPLPROBS.m
r141 r146 39 39 . ; Q 40 40 ; I DEBUG ZWR RPCRSLT 41 S @TVMAP@(0)=RPCRSLT(0) ; SAVE NUMBER OF PROBLEMS 41 42 F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST 42 43 . S VMAP=$NA(@TVMAP@(J)) -
ccr/trunk/p/GPLRIMA.m
r144 r146 60 60 . I $D(^TMP("GPLCCR",$J,"PROBVALS",1)) D ; PROBLEM VARS EXISTS 61 61 . . M @RIMBASE@("VARS",RIMDFN,"PROBLEMS")=^TMP("GPLCCR",$J,"PROBVALS") 62 . . S @RIMBASE@("VARS",RIMDFN,"PROBLEMS",0)=^TMP("GPLCCR",$J,"PROBVALS",0) 62 63 . I $D(^TMP("GPLCCR",$J,"VITALS",1)) D ; VITALS VARS EXISTS 63 64 . . M @RIMBASE@("VARS",RIMDFN,"VITALS")=^TMP("GPLCCR",$J,"VITALS") … … 97 98 I $D(@SBASE@("PROBLEMS",1)) D ; 98 99 . D APOST("SATTR","RIMTBL","PROBLEMS") 99 . W "POSTING PROBLEMS",!100 . ; W "POSTING PROBLEMS",! 100 101 I $D(@SBASE@("VITALS",1)) D APOST("SATTR","RIMTBL","VITALS") 101 102 I $D(@SBASE@("MEDS",1)) D APOST("SATTR","RIMTBL","MEDS") … … 291 292 S $P(@PRSLT,U,@USETBL@(PVAL))=PVAL 292 293 Q 294 GETPA(RTN,DFN,ISEC,IVAR) ; RETURNS ARRAY OF RIM VARIABLES FOR PATIENT DFN 295 ; EXAMPLE: D GETP(.RT,2,"MEDS","MEDSSTATUSTEXT") 296 ; RETURNS AN ARRAY RT OF VALUES OF MEDSTATUSTEXT FOR PATIENT 2 IN P2 297 ; IN SECTION "MEDS" 298 ; P1 IS THE IEN OF THE MED WITH THE VALUE IE 2^PENDING WOULD BE STATUS 299 ; PENDING FOR MED 2 FOR PATIENT 2 300 ; RT(0) IS THE COUNT OF HOW MANY IN THE ARRAY. NULL VALUES ARE 301 ; RETURNED. RTN IS PASSED BY REFERENCE 302 ; 303 S RTN(0)=0 ; SET NULL DEFAULT RETURN VALUE 304 I '$D(RIMBASE) D AINIT ; INITIALIZE GLOBAL NAMES AND TABLES 305 S ZVBASE=$NA(@RIMBASE@("VARS")) ; BASE OF VARIABLES 306 I '$D(@ZVBASE@(DFN,ISEC,0)) D Q ; NO VARIABLES IN SECTION 307 . W "NO VARIABLES IN THIS SECTION FOR PATIENT ",DFN,! 308 N ZZI,ZZS 309 S ZZS=$NA(@ZVBASE@(DFN,ISEC)) ; SECTION VARIABLE ARRAY FOR THIS PATIENT 310 ; ZWR @ZZS@(1) 311 S RTN(0)=@ZZS@(0) 312 F ZZI=1:1:RTN(0) D ; FOR ALL PARTS OF THIS SECTION ( IE FOR ALL MEDS) 313 . S $P(RTN(ZZI),"^",1)=ZZI ; INDEX FOR VARIABLE 314 . S $P(RTN(ZZI),"^",2)=@ZZS@(ZZI,IVAR) ; THE VALUE OF THE VARIABLE 315 Q 316 ; 317 PATD(DFN,ISEC,IVAR) ; DISPLAY FOR PATIENT DFN THE VARIABLE IVAR 318 ; 319 N ZR 320 D GETPA(.ZR,DFN,ISEC,IVAR) 321 I $D(ZR(0)) D PARY^GPLXPATH("ZR") 322 E W "NOTHING RETURNED",! 323 Q 324 ; 325 CAGET(RTN,IATTR,ISEC,IVAR) ; 326 ; GETPA LOOKS AT RIMTBL TO FIND PATIENTS WITH ATTRIBUTE IATTR 327 ; IT DOES NOT SEARCH ALL PATIENTS, ONLY THE ONES WITH THE ATTRIBUTE 328 ; IT RETURNS AN ARRAY OF THE VALUES OF VARIABLE IVAR IN SECTION ISEC 329 Q 330 ; 331 PCLST(LSTRTN,IATTR) ; RETURNS ARRAY OF PATIENTS WITH ATTRIBUTE IATTR 332 ; 333 I '$D(RIMBASE) D AINIT ; INITIALIZE GLOBAL NAMES AND TABLES 334 N ZLST 335 S LSTRTN(0)=0 ; DEFAULT RETURN NONE 336 S ZCBASE=$NA(@RIMBASE@("RIMTBL","CATS")) ; BASE OF CATEGORIES 337 S ZPBASE=$NA(@RIMBASE@("RIMTBL","PATS")) ; BASE OF PATIENTS 338 N ZNC ; ZNC IS NUMBER OF CATEGORIES 339 S ZNC=@ZCBASE@(0) 340 I ZNC=0 Q ; NO CATEGORIES TO SEARCH 341 N ZAP ; ZAP IS THE PIECE INDEX OF THE ATTRIBUTE IN THE RIM ATTR TABLE 342 S ZAP=@RIMBASE@("RIMTBL","TABLE",IATTR) 343 N ZI,ZCATTBL,ZATBL,ZCNT,ZPAT 344 F ZI=1:1:ZNC D ; FOR ALL CATEGORIES 345 . S ZATBL=@ZCBASE@(ZI) ; PULL OUT ATTR TBL FOR CAT 346 . I $P(ZATBL,"^",ZAP)'="" D ; CAT HAS ATTR 347 . . S ZCATTBL=$P(@ZCBASE@(ZATBL),"^",1) ; NAME OF TBL 348 . . M LSTRTN=@ZPBASE@(ZCATTBL) ; MERGE PATS FROM CAT 349 S ZCNT=0 ; INITIALIZE COUNT OF PATIENTS 350 S ZPAT=0 ; START AT FIRST PATIENT IN LIST 351 F S ZPAT=$O(LSTRTN(ZPAT)) Q:ZPAT="" D ; 352 . S ZCNT=ZCNT+1 353 S LSTRTN(0)=ZCNT ; COUNT OF PATIENTS IN ARRAY 354 Q 355 ; 356 DCPAT(CATTR) ; DISPLAY LIST OF PATIENTS WITH ATTRIBUTE CATTR 357 ; 358 N ZR 359 D PCLST(.ZR,CATTR) 360 I ZR(0)=0 D Q ; 361 . W "NO PATIENTS RETURNED",! 362 E D ; 363 . D PARY^GPLXPATH("ZR") ; PRINT ARRAY 364 . W "COUNT=",ZR(0),! 365 Q 366 ; -
ccr/trunk/p/GPLVITAL.m
r141 r146 42 42 S VCNT=$$SORTDT^CCRUTIL(.VSORT,.VDATES,-1) ; PUT VITALS IN REVERSE 43 43 ; DATE ORDER AND COUNT THEM. VSORT CONTAINS INDIRECT INDEXES ONLY 44 S @VITTVMAP@(0)=VCNT ; SAVE NUMBER OF VITALS 44 45 F J=1:1:VCNT D ; FOR EACH VITAL IN THE LIST 45 46 . I $D(VITRSLT(VSORT(J))) D
Note:
See TracChangeset
for help on using the changeset viewer.