new command PATC^GPLRIMA(DFN) to display patient category

This commit is contained in:
george 2008-09-04 16:02:10 +00:00
parent 9cb722d635
commit f6d8d93ffb
1 changed files with 11 additions and 0 deletions

View File

@ -216,6 +216,17 @@ CPAT(CPATCAT) ; SHOW PATIENT DFNS FOR A CATEGORY CPATCAT
. . W !
Q
;
PATC(DFN) ; DISPLAY THE CATEGORY FOR THIS PATIENT
;
N ATTR S ATTR=""
I $D(^TMP("GPLRIM","ATTR",DFN)) S ATTR=^TMP("GPLRIM","ATTR",DFN)
I ATTR="" W "THIS PATIENT NOT ANALYZED.",! Q ;NO ATTRIBUTES FOUND
I $D(^TMP("GPLRIM","RIMTBL","CATS",ATTR)) D ; FOUND A CAT
. N CAT
. S CAT=$P(^TMP("GPLRIM","RIMTBL","CATS",ATTR),U,1) ; LOOK UP THE CAT
. W CAT,": ",ATTR,!
Q
;
APUSH(AMAP,AVAL) ; ADD AVAL TO ATTRIBUTE MAP AMAP (AMAP PASSED BY NAME)
; AMAP IS FORMED FOR ARRAY ACCESS: AMAP(0) IS THE COUNT
; AND AMAP(N)=AVAL IS THE NTH AVAL