enhancements to GPLRIMA to locate patients
This commit is contained in:
parent
fb3bbd61e6
commit
588e9ef134
|
@ -50,6 +50,7 @@ EXTRACT(MEDXML,DFN,MEDOUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
|
|||
. . S ZK=$P(ZA(ZI),U,2)+1 ; INCREMENT LINE COUNT FOR CURRENT MED
|
||||
. . S $P(ZA(ZI),U,2)=ZK ; AND STORE IT IN ARRAY
|
||||
;ZWR ZA
|
||||
S @MEDTVMAP@(0)=ZA(0) ; SAVE NUMBER OF MEDS
|
||||
F ZI=1:1:ZA(0) D ; FOR EACH MED
|
||||
. I DEBUG W "ZI IS ",ZI,!
|
||||
. S MEDVMAP=$NA(@MEDTVMAP@(ZI))
|
||||
|
|
|
@ -38,6 +38,7 @@ EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
|
|||
. S @OUTXML@(0)=0
|
||||
. ; Q
|
||||
; I DEBUG ZWR RPCRSLT
|
||||
S @TVMAP@(0)=RPCRSLT(0) ; SAVE NUMBER OF PROBLEMS
|
||||
F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST
|
||||
. S VMAP=$NA(@TVMAP@(J))
|
||||
. K @VMAP
|
||||
|
|
78
p/GPLRIMA.m
78
p/GPLRIMA.m
|
@ -59,6 +59,7 @@ ANALYZE(BEGDFN,DFNCNT) ; RIM COHERANCE ANALYSIS ROUTINE
|
|||
. ;
|
||||
. I $D(^TMP("GPLCCR",$J,"PROBVALS",1)) D ; PROBLEM VARS EXISTS
|
||||
. . M @RIMBASE@("VARS",RIMDFN,"PROBLEMS")=^TMP("GPLCCR",$J,"PROBVALS")
|
||||
. . S @RIMBASE@("VARS",RIMDFN,"PROBLEMS",0)=^TMP("GPLCCR",$J,"PROBVALS",0)
|
||||
. I $D(^TMP("GPLCCR",$J,"VITALS",1)) D ; VITALS VARS EXISTS
|
||||
. . M @RIMBASE@("VARS",RIMDFN,"VITALS")=^TMP("GPLCCR",$J,"VITALS")
|
||||
. I $D(^TMP("GPLCCR",$J,"MEDICATIONS",1)) D ; MEDS VARS EXISTS
|
||||
|
@ -96,7 +97,7 @@ SETATTR(SDFN) ; SET ATTRIBUTES BASED ON VARS
|
|||
D APOST("SATTR","RIMTBL","HEADER")
|
||||
I $D(@SBASE@("PROBLEMS",1)) D ;
|
||||
. D APOST("SATTR","RIMTBL","PROBLEMS")
|
||||
. W "POSTING PROBLEMS",!
|
||||
. ; W "POSTING PROBLEMS",!
|
||||
I $D(@SBASE@("VITALS",1)) D APOST("SATTR","RIMTBL","VITALS")
|
||||
I $D(@SBASE@("MEDS",1)) D APOST("SATTR","RIMTBL","MEDS")
|
||||
D APOST("SATTR","RIMTBL","NOTEXTRACTED") ; OUTPUT NOT YET PRODUCED
|
||||
|
@ -289,4 +290,77 @@ APOST(PRSLT,PTBL,PVAL) ; POST AN ATTRIBUTE PVAL TO PRSLT USING PTBL
|
|||
. W "ERROR NO SUCH TABLE",!
|
||||
S USETBL=@RIMBASE@("TABLES",PTBL)
|
||||
S $P(@PRSLT,U,@USETBL@(PVAL))=PVAL
|
||||
Q
|
||||
Q
|
||||
GETPA(RTN,DFN,ISEC,IVAR) ; RETURNS ARRAY OF RIM VARIABLES FOR PATIENT DFN
|
||||
; EXAMPLE: D GETP(.RT,2,"MEDS","MEDSSTATUSTEXT")
|
||||
; RETURNS AN ARRAY RT OF VALUES OF MEDSTATUSTEXT FOR PATIENT 2 IN P2
|
||||
; IN SECTION "MEDS"
|
||||
; P1 IS THE IEN OF THE MED WITH THE VALUE IE 2^PENDING WOULD BE STATUS
|
||||
; PENDING FOR MED 2 FOR PATIENT 2
|
||||
; RT(0) IS THE COUNT OF HOW MANY IN THE ARRAY. NULL VALUES ARE
|
||||
; RETURNED. RTN IS PASSED BY REFERENCE
|
||||
;
|
||||
S RTN(0)=0 ; SET NULL DEFAULT RETURN VALUE
|
||||
I '$D(RIMBASE) D AINIT ; INITIALIZE GLOBAL NAMES AND TABLES
|
||||
S ZVBASE=$NA(@RIMBASE@("VARS")) ; BASE OF VARIABLES
|
||||
I '$D(@ZVBASE@(DFN,ISEC,0)) D Q ; NO VARIABLES IN SECTION
|
||||
. W "NO VARIABLES IN THIS SECTION FOR PATIENT ",DFN,!
|
||||
N ZZI,ZZS
|
||||
S ZZS=$NA(@ZVBASE@(DFN,ISEC)) ; SECTION VARIABLE ARRAY FOR THIS PATIENT
|
||||
; ZWR @ZZS@(1)
|
||||
S RTN(0)=@ZZS@(0)
|
||||
F ZZI=1:1:RTN(0) D ; FOR ALL PARTS OF THIS SECTION ( IE FOR ALL MEDS)
|
||||
. S $P(RTN(ZZI),"^",1)=ZZI ; INDEX FOR VARIABLE
|
||||
. S $P(RTN(ZZI),"^",2)=@ZZS@(ZZI,IVAR) ; THE VALUE OF THE VARIABLE
|
||||
Q
|
||||
;
|
||||
PATD(DFN,ISEC,IVAR) ; DISPLAY FOR PATIENT DFN THE VARIABLE IVAR
|
||||
;
|
||||
N ZR
|
||||
D GETPA(.ZR,DFN,ISEC,IVAR)
|
||||
I $D(ZR(0)) D PARY^GPLXPATH("ZR")
|
||||
E W "NOTHING RETURNED",!
|
||||
Q
|
||||
;
|
||||
CAGET(RTN,IATTR,ISEC,IVAR) ;
|
||||
; GETPA LOOKS AT RIMTBL TO FIND PATIENTS WITH ATTRIBUTE IATTR
|
||||
; IT DOES NOT SEARCH ALL PATIENTS, ONLY THE ONES WITH THE ATTRIBUTE
|
||||
; IT RETURNS AN ARRAY OF THE VALUES OF VARIABLE IVAR IN SECTION ISEC
|
||||
Q
|
||||
;
|
||||
PCLST(LSTRTN,IATTR) ; RETURNS ARRAY OF PATIENTS WITH ATTRIBUTE IATTR
|
||||
;
|
||||
I '$D(RIMBASE) D AINIT ; INITIALIZE GLOBAL NAMES AND TABLES
|
||||
N ZLST
|
||||
S LSTRTN(0)=0 ; DEFAULT RETURN NONE
|
||||
S ZCBASE=$NA(@RIMBASE@("RIMTBL","CATS")) ; BASE OF CATEGORIES
|
||||
S ZPBASE=$NA(@RIMBASE@("RIMTBL","PATS")) ; BASE OF PATIENTS
|
||||
N ZNC ; ZNC IS NUMBER OF CATEGORIES
|
||||
S ZNC=@ZCBASE@(0)
|
||||
I ZNC=0 Q ; NO CATEGORIES TO SEARCH
|
||||
N ZAP ; ZAP IS THE PIECE INDEX OF THE ATTRIBUTE IN THE RIM ATTR TABLE
|
||||
S ZAP=@RIMBASE@("RIMTBL","TABLE",IATTR)
|
||||
N ZI,ZCATTBL,ZATBL,ZCNT,ZPAT
|
||||
F ZI=1:1:ZNC D ; FOR ALL CATEGORIES
|
||||
. S ZATBL=@ZCBASE@(ZI) ; PULL OUT ATTR TBL FOR CAT
|
||||
. I $P(ZATBL,"^",ZAP)'="" D ; CAT HAS ATTR
|
||||
. . S ZCATTBL=$P(@ZCBASE@(ZATBL),"^",1) ; NAME OF TBL
|
||||
. . M LSTRTN=@ZPBASE@(ZCATTBL) ; MERGE PATS FROM CAT
|
||||
S ZCNT=0 ; INITIALIZE COUNT OF PATIENTS
|
||||
S ZPAT=0 ; START AT FIRST PATIENT IN LIST
|
||||
F S ZPAT=$O(LSTRTN(ZPAT)) Q:ZPAT="" D ;
|
||||
. S ZCNT=ZCNT+1
|
||||
S LSTRTN(0)=ZCNT ; COUNT OF PATIENTS IN ARRAY
|
||||
Q
|
||||
;
|
||||
DCPAT(CATTR) ; DISPLAY LIST OF PATIENTS WITH ATTRIBUTE CATTR
|
||||
;
|
||||
N ZR
|
||||
D PCLST(.ZR,CATTR)
|
||||
I ZR(0)=0 D Q ;
|
||||
. W "NO PATIENTS RETURNED",!
|
||||
E D ;
|
||||
. D PARY^GPLXPATH("ZR") ; PRINT ARRAY
|
||||
. W "COUNT=",ZR(0),!
|
||||
Q
|
||||
;
|
|
@ -41,6 +41,7 @@ EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE
|
|||
; I DEBUG ZWR VDATES ;DEBUG
|
||||
S VCNT=$$SORTDT^CCRUTIL(.VSORT,.VDATES,-1) ; PUT VITALS IN REVERSE
|
||||
; DATE ORDER AND COUNT THEM. VSORT CONTAINS INDIRECT INDEXES ONLY
|
||||
S @VITTVMAP@(0)=VCNT ; SAVE NUMBER OF VITALS
|
||||
F J=1:1:VCNT D ; FOR EACH VITAL IN THE LIST
|
||||
. I $D(VITRSLT(VSORT(J))) D
|
||||
. . S VITVMAP=$NA(@VITTVMAP@(J))
|
||||
|
|
Loading…
Reference in New Issue