PXRMEVFI ;SLC/PKR - Driver for finding evaluation. ;04/11/2022
;;2.0;CLINICAL REMINDERS;**6,18,42,65**;Feb 04, 2005;Build 438
;
;=====================================================
BRANCH(DFN,DEFARR,ENODE,FIEVAL) ;Branch to appropriate evalution routine.
I ENODE="AUTTHF(" D EVALFI^PXRMHF(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="PXD(811.2," D EVALFI^PXRMTAX(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="PXRMD(810.9," D EVALFI^PXRMLOCF(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="PXRMD(811.4," D EVALFI^PXRMCF(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="PXRMD(811.5," D EVALFI^PXRMTERM(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="PS(50.605," D EVALFI^PXRMDRCL(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="PSDRUG(" D EVALFI^PXRMDRUG(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="PSNDF(50.6," D EVALFI^PXRMDGEN(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="RAMIS(71," D EVALFI^PXRMRAD(DFN,.DEFARR,ENODE,.FIEVAL) Q
I ENODE="YTT(601.71," D EVALFI^PXRMMH(DFN,.DEFARR,ENODE,.FIEVAL) Q
;All others use EVALFI^PXRMINDX directly.
;"AUTTEDT(", "AUTTEXAM(", "AUTTIMM(","AUTTSK(","GMRD(120.51,"
;"LAB(60,", "ORD(101.43,"
D EVALFI^PXRMINDX(DFN,.DEFARR,ENODE,.FIEVAL)
Q
;
;=====================================================
EVAL(DFN,DEFARR,FIEVAL) ;Evaluate findings, first those that don't have any
;date dependencies using the "E"index then those that do have date
;dependencies using the "EDEP" index.
;index.
N CFPARAM,COND,BDT,EDT,IND,ITEM,ENODE,FINDING,NOCC,TDEFARR
I $G(PXRMDEBG) D
. S FINDING=0
. F S FINDING=$O(DEFARR(20,FINDING)) Q:FINDING="" D
.. S FIEVAL(FINDING,"BDT")=$P(DEFARR(20,FINDING,0),U,8)
.. S FIEVAL(FINDING,"EDT")=$P(DEFARR(20,FINDING,0),U,11)
.. S COND=$P($G(DEFARR(20,FINDING,3)),U,1)
.. I COND'="" S FIEVAL(FINDING,"CONDITION TEXT")=COND
.. S CFPARAM=$G(DEFARR(20,FINDING,15))
.. I CFPARAM'="" S FIEVAL(FINDING,"CFP TEXT")=CFPARAM
S ENODE=""
F S ENODE=$O(DEFARR("E",ENODE)) Q:ENODE="" D BRANCH(DFN,.DEFARR,ENODE,.FIEVAL)
I '$D(DEFARR("EDEP")) G FF
M TDEFARR=DEFARR
S IND=0
F S IND=$O(TDEFARR("EDEP",IND)) Q:IND="" D
. S ENODE=$O(TDEFARR("EDEP",IND,""))
. S ITEM=$O(TDEFARR("EDEP",IND,ENODE,""))
. S FINDING=$O(TDEFARR("EDEP",IND,ENODE,ITEM,""))
.;If either dependent finding is false then set this finding false and
.;skip the evaluation.
. S BDT=+$P(TDEFARR("EDEP",IND,ENODE,ITEM,FINDING),U,1)
. I BDT>0,FIEVAL(BDT)=0 S FIEVAL(FINDING)=0 Q
. S EDT=+$P(TDEFARR("EDEP",IND,ENODE,ITEM,FINDING),U,2)
. I EDT>0,FIEVAL(EDT)=0 S FIEVAL(FINDING)=0 Q
.;Convert beginning and ending date/time to internal FM dates.
. D SSPAR^PXRMUTIL(TDEFARR(20,FINDING,0),.NOCC,.BDT,.EDT)
. I (BDT=-1)!(EDT=-1) D Q
.. S FIEVAL(FINDING)=0
.. I $G(PXRMDEBG) S FIEVAL(FINDING,"BDTE")=BDT,FIEVAL(FINDING,"EDTE")=EDT
. S $P(TDEFARR(20,FINDING,0),U,8)=BDT
. S $P(TDEFARR(20,FINDING,0),U,11)=EDT
.;Build an "E" node to evaluate this finding.
. K TDEFARR("E",ENODE)
. S TDEFARR("E",ENODE,ITEM,FINDING)=""
.;At this point branch to appropriate EVALFI
. D BRANCH(DFN,.TDEFARR,ENODE,.FIEVAL)
;Evaluate function findings.
FF D EVAL^PXRMFF(.DEFARR,.FIEVAL)
Q
;
;=====================================================
EVALPL(DEFARR,FINUM,PLIST) ;Create a patient list for a regular
;finding.
N FINDPA,TERMARR
S FINDPA(0)=DEFARR(20,FINUM,0)
S FINDPA(3)=DEFARR(20,FINUM,3)
S FINDPA(10)=DEFARR(20,FINUM,10)
S FINDPA(11)=DEFARR(20,FINUM,11)
D GENTERM^PXRMPLST(FINDPA(0),FINUM,.TERMARR)
D EVALPL^PXRMTERL(.FINDPA,.TERMARR,PLIST)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMEVFI 3515 printed Oct 16, 2024@17:45:38 Page 2
PXRMEVFI ;SLC/PKR - Driver for finding evaluation. ;04/11/2022
+1 ;;2.0;CLINICAL REMINDERS;**6,18,42,65**;Feb 04, 2005;Build 438
+2 ;
+3 ;=====================================================
BRANCH(DFN,DEFARR,ENODE,FIEVAL) ;Branch to appropriate evalution routine.
+1 IF ENODE="AUTTHF("
DO EVALFI^PXRMHF(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+2 IF ENODE="PXD(811.2,"
DO EVALFI^PXRMTAX(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+3 IF ENODE="PXRMD(810.9,"
DO EVALFI^PXRMLOCF(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+4 IF ENODE="PXRMD(811.4,"
DO EVALFI^PXRMCF(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+5 IF ENODE="PXRMD(811.5,"
DO EVALFI^PXRMTERM(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+6 IF ENODE="PS(50.605,"
DO EVALFI^PXRMDRCL(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+7 IF ENODE="PSDRUG("
DO EVALFI^PXRMDRUG(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+8 IF ENODE="PSNDF(50.6,"
DO EVALFI^PXRMDGEN(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+9 IF ENODE="RAMIS(71,"
DO EVALFI^PXRMRAD(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+10 IF ENODE="YTT(601.71,"
DO EVALFI^PXRMMH(DFN,.DEFARR,ENODE,.FIEVAL)
QUIT
+11 ;All others use EVALFI^PXRMINDX directly.
+12 ;"AUTTEDT(", "AUTTEXAM(", "AUTTIMM(","AUTTSK(","GMRD(120.51,"
+13 ;"LAB(60,", "ORD(101.43,"
+14 DO EVALFI^PXRMINDX(DFN,.DEFARR,ENODE,.FIEVAL)
+15 QUIT
+16 ;
+17 ;=====================================================
EVAL(DFN,DEFARR,FIEVAL) ;Evaluate findings, first those that don't have any
+1 ;date dependencies using the "E"index then those that do have date
+2 ;dependencies using the "EDEP" index.
+3 ;index.
+4 NEW CFPARAM,COND,BDT,EDT,IND,ITEM,ENODE,FINDING,NOCC,TDEFARR
+5 IF $GET(PXRMDEBG)
Begin DoDot:1
+6 SET FINDING=0
+7 FOR
SET FINDING=$ORDER(DEFARR(20,FINDING))
if FINDING=""
QUIT
Begin DoDot:2
+8 SET FIEVAL(FINDING,"BDT")=$PIECE(DEFARR(20,FINDING,0),U,8)
+9 SET FIEVAL(FINDING,"EDT")=$PIECE(DEFARR(20,FINDING,0),U,11)
+10 SET COND=$PIECE($GET(DEFARR(20,FINDING,3)),U,1)
+11 IF COND'=""
SET FIEVAL(FINDING,"CONDITION TEXT")=COND
+12 SET CFPARAM=$GET(DEFARR(20,FINDING,15))
+13 IF CFPARAM'=""
SET FIEVAL(FINDING,"CFP TEXT")=CFPARAM
End DoDot:2
End DoDot:1
+14 SET ENODE=""
+15 FOR
SET ENODE=$ORDER(DEFARR("E",ENODE))
if ENODE=""
QUIT
DO BRANCH(DFN,.DEFARR,ENODE,.FIEVAL)
+16 IF '$DATA(DEFARR("EDEP"))
GOTO FF
+17 MERGE TDEFARR=DEFARR
+18 SET IND=0
+19 FOR
SET IND=$ORDER(TDEFARR("EDEP",IND))
if IND=""
QUIT
Begin DoDot:1
+20 SET ENODE=$ORDER(TDEFARR("EDEP",IND,""))
+21 SET ITEM=$ORDER(TDEFARR("EDEP",IND,ENODE,""))
+22 SET FINDING=$ORDER(TDEFARR("EDEP",IND,ENODE,ITEM,""))
+23 ;If either dependent finding is false then set this finding false and
+24 ;skip the evaluation.
+25 SET BDT=+$PIECE(TDEFARR("EDEP",IND,ENODE,ITEM,FINDING),U,1)
+26 IF BDT>0
IF FIEVAL(BDT)=0
SET FIEVAL(FINDING)=0
QUIT
+27 SET EDT=+$PIECE(TDEFARR("EDEP",IND,ENODE,ITEM,FINDING),U,2)
+28 IF EDT>0
IF FIEVAL(EDT)=0
SET FIEVAL(FINDING)=0
QUIT
+29 ;Convert beginning and ending date/time to internal FM dates.
+30 DO SSPAR^PXRMUTIL(TDEFARR(20,FINDING,0),.NOCC,.BDT,.EDT)
+31 IF (BDT=-1)!(EDT=-1)
Begin DoDot:2
+32 SET FIEVAL(FINDING)=0
+33 IF $GET(PXRMDEBG)
SET FIEVAL(FINDING,"BDTE")=BDT
SET FIEVAL(FINDING,"EDTE")=EDT
End DoDot:2
QUIT
+34 SET $PIECE(TDEFARR(20,FINDING,0),U,8)=BDT
+35 SET $PIECE(TDEFARR(20,FINDING,0),U,11)=EDT
+36 ;Build an "E" node to evaluate this finding.
+37 KILL TDEFARR("E",ENODE)
+38 SET TDEFARR("E",ENODE,ITEM,FINDING)=""
+39 ;At this point branch to appropriate EVALFI
+40 DO BRANCH(DFN,.TDEFARR,ENODE,.FIEVAL)
End DoDot:1
+41 ;Evaluate function findings.
FF DO EVAL^PXRMFF(.DEFARR,.FIEVAL)
+1 QUIT
+2 ;
+3 ;=====================================================
EVALPL(DEFARR,FINUM,PLIST) ;Create a patient list for a regular
+1 ;finding.
+2 NEW FINDPA,TERMARR
+3 SET FINDPA(0)=DEFARR(20,FINUM,0)
+4 SET FINDPA(3)=DEFARR(20,FINUM,3)
+5 SET FINDPA(10)=DEFARR(20,FINUM,10)
+6 SET FINDPA(11)=DEFARR(20,FINUM,11)
+7 DO GENTERM^PXRMPLST(FINDPA(0),FINUM,.TERMARR)
+8 DO EVALPL^PXRMTERL(.FINDPA,.TERMARR,PLIST)
+9 QUIT
+10 ;