Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PXRMEVFI

PXRMEVFI.m

Go to the documentation of this file.
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
 ;