ORY14404 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*144) ;JUN 12,2002 at 12:20
;;3.0;ORDER ENTRY/RESULTS REPORTING;**144**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
;
D DOT^ORY144ES
;
;
K REMOTE,LOCAL,OPCODE,REF
F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
.S ^TMP("OCXRULE",$J,$O(^TMP("OCXRULE",$J,"A"),-1)+1)=TEXT
;
G ^ORY14405
;
Q
;
DATA ;
;
;;D^ ; E S OCXMON=$E(OCXMON+100,2,3)
;;R^"860.8:",100,19
;;D^ ; S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
;;R^"860.8:",100,20
;;D^ ; I OCXF S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
;;R^"860.8:",100,21
;;D^ ; Q:'OCXF $E(OCXMON+100,2,3)_"/"_$E(OCXDAY+100,2,3)_$S((OCXCYR=OCXYR):" "_OCXHR_":"_OCXMIN,1:"/"_$E(OCXYR,3,4))
;;R^"860.8:",100,22
;;D^ ; Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
;;R^"860.8:",100,23
;;D^ ; Q OCXMON_" "_OCXDAY_","_OCXYR
;;R^"860.8:",100,24
;;D^ ; ;
;;EOR^
;;KEY^860.8:^CREATININE CLEARANCE (ESTIMATED/CALCULATED)
;;R^"860.8:",.01,"E"
;;D^CREATININE CLEARANCE (ESTIMATED/CALCULATED)
;;R^"860.8:",.02,"E"
;;D^CRCL
;;R^"860.8:",100,1
;;D^ ;CRCL(DFN) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; N WT,AGE,SEX,SCR,SCRD,CRCL,UNAV,OCXTL,OCXTLS,OCXT,OCXTS,PSCR
;;R^"860.8:",100,4
;;D^ ; S UNAV="0^<Unavailable>"
;;R^"860.8:",100,5
;;D^ ; S PSCR="^^^^^^0"
;;R^"860.8:",100,6
;;D^ ; S WT=$P($$WT^ORQPTQ4(DFN),U,2)*.454 Q:'WT UNAV
;;R^"860.8:",100,7
;;D^ ; S AGE=$$AGE^ORQPTQ4(DFN) Q:'AGE UNAV
;;R^"860.8:",100,8
;;D^ ; S SEX=$P($$SEX^ORQPTQ4(DFN),U,1) Q:'$L(SEX) UNAV
;;R^"860.8:",100,9
;;D^ ; S OCXTL="" Q:'$$TERMLKUP("SERUM CREATININE",.OCXTL) UNAV
;;R^"860.8:",100,10
;;D^ ; S OCXTLS="" Q:'$$TERMLKUP("SERUM SPECIMEN",.OCXTLS) UNAV
;;R^"860.8:",100,11
;;D^ ; S SCR="",OCXT=0 F S OCXT=$O(OCXTL(OCXT)) Q:'OCXT D
;;R^"860.8:",100,12
;;D^ ; .S OCXTS=0 F S OCXTS=$O(OCXTLS(OCXTS)) Q:'OCXTS D
;;R^"860.8:",100,13
;;D^ ; ..S SCR=$$LOCL^ORQQLR1(DFN,OCXT,OCXTS)
;;R^"860.8:",100,14
;;D^ ; ..I $P(SCR,U,7)>$P(PSCR,U,7) S PSCR=SCR
;;R^"860.8:",100,15
;;D^ ; S SCR=PSCR,SCRV=$P(SCR,U,3) Q:+$G(SCRV)<.01 UNAV
;;R^"860.8:",100,16
;;D^ ; S SCRD=$P(SCR,U,7) Q:'$L(SCRD) UNAV
;;R^"860.8:",100,17
;;D^ ; ;
;;R^"860.8:",100,18
;;D^ ; S CRCL=(((140-AGE)*WT)/(SCRV*72))
;;R^"860.8:",100,19
;;D^ ; ;
;;R^"860.8:",100,20
;;D^ ; I (SEX="M") Q SCRD_U_$J(CRCL,1,2)
;;R^"860.8:",100,21
;;D^ ; I (SEX="F") Q SCRD_U_$J((CRCL*.85),1,2)
;;R^"860.8:",100,22
;;D^ ; Q UNAV
;;R^"860.8:",100,23
;;D^ ; ;
;;EOR^
;;KEY^860.8:^DETERMINE IF RENAL LAB RESULTS ARE ABNORMAL HIGH OR LOW
;;R^"860.8:",.01,"E"
;;D^DETERMINE IF RENAL LAB RESULTS ARE ABNORMAL HIGH OR LOW
;;R^"860.8:",.02,"E"
;;D^ABREN
;;R^"860.8:",100,1
;;D^ ;ABREN(DFN) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; N OCXFLAG,OCXVAL,OCXLIST,OCXTEST,UNAV,OCXTLIST,OCXTERM,OCXSLIST,OCXSPEC
;;R^"860.8:",100,4
;;D^ ; S (OCXLIST,OCXTLIST)="",UNAV="0^<Unavailable>"
;;R^"860.8:",100,5
;;D^ ; S OCXSLIST="" Q:'$$TERMLKUP("SERUM SPECIMEN",.OCXSLIST) UNAV
;;R^"860.8:",100,6
;;D^ ; F OCXTERM="SERUM CREATININE","SERUM UREA NITROGEN" D Q:($L(OCXLIST)>130)
;;R^"860.8:",100,7
;;D^ ; .Q:'$$TERMLKUP(OCXTERM,.OCXTLIST)
;;R^"860.8:",100,8
;;D^ ; .S OCXTEST=0 F S OCXTEST=$O(OCXTLIST(OCXTEST)) Q:'OCXTEST D Q:($L(OCXLIST)>130)
;;R^"860.8:",100,9
;;D^ ; ..S OCXSPEC=0 F S OCXSPEC=$O(OCXSLIST(OCXSPEC)) Q:'OCXSPEC D Q:($L(OCXLIST)>130)
;;R^"860.8:",100,10
;;D^ ; ...S OCXVAL=$$LOCL^ORQQLR1(DFN,OCXTEST,OCXSPEC),OCXFLAG=$P(OCXVAL,U,5)
;;R^"860.8:",100,11
;;D^ ; ...I $L(OCXVAL),((OCXFLAG["H")!(OCXFLAG["L")) D
;;R^"860.8:",100,12
;;D^ ; ....N OCXY S OCXY=""
;;R^"860.8:",100,13
;;D^ ; ....S OCXY=$P(OCXVAL,U,2)_": "_$P(OCXVAL,U,3)_" "_$P(OCXVAL,U,4)
;;R^"860.8:",100,14
;;D^ ; ....S OCXY=OCXY_" "_$S($L(OCXFLAG):"["_OCXFLAG_"]",1:"")
;;R^"860.8:",100,15
;;D^ ; ....S OCXY=OCXY_" "_$$FMTE^XLFDT($P(OCXVAL,U,7),"2P")
;;R^"860.8:",100,16
;;D^ ; ....S:$L(OCXLIST) OCXLIST=OCXLIST_" " S OCXLIST=OCXLIST_OCXY
;;R^"860.8:",100,17
;;D^ ; Q:'$L(OCXLIST) UNAV Q 1_U_OCXLIST
;;R^"860.8:",100,18
;;D^ ; ;
;;EOR^
;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
;;R^"860.8:",.01,"E"
;;D^ELAPSED ORDER CHECK TIME LOGGER
;;R^"860.8:",.02,"E"
;;D^TIMELOG
;;R^"860.8:",100,1
;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; ;
;;R^"860.8:",100,4
;;D^ ; Q 0
;;R^"860.8:",100,5
;;D^ ; ;
;;EOR^
;;KEY^860.8:^EQUALS TERM OPERATOR
;;R^"860.8:",.01,"E"
;;D^EQUALS TERM OPERATOR
;;R^"860.8:",.02,"E"
;;D^EQTERM
;;R^"860.8:",100,1
;;D^ ;EQTERM(DATA,TERM) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DATA: ",$G(DATA)," TERM: ",$G(TERM)
;;R^"860.8:",100,4
;;D^ ; N OCXF,OCXL
;;R^"860.8:",100,5
;;D^ ; ;
;;R^"860.8:",100,6
;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
;;R^"860.8:",100,7
;;D^T-; Q:'OCXF 0
;;R^"860.8:",100,8
;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
;;R^"860.8:",100,9
;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
;;R^"860.8:",100,10
;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
;;R^"860.8:",100,11
;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
;;R^"860.8:",100,12
;;D^T-; Q 0
;;R^"860.8:",100,13
;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
;;R^"860.8:",100,14
;;D^ ; ;
;;EOR^
;;KEY^860.8:^FILE DATA IN PATIENT ACTIVE DATA FILE
;;R^"860.8:",.01,"E"
;;D^FILE DATA IN PATIENT ACTIVE DATA FILE
;;R^"860.8:",.02,"E"
;;D^FILE
;;R^"860.8:",1,1
;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function files data
;;R^"860.8:",1,2
;;D^ ; ; in the Order Check Patient Data File
;;R^"860.8:",1,3
;;D^ ; ;
;;R^"860.8:",100,1
;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DFN: ",DFN," OCXELE: ",+$G(OCXELE)," OCXDFL: ",$G(OCXDFL)
;;R^"860.8:",100,4
;;D^ ; N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
;;R^"860.8:",100,5
;;D^ ; S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
;;R^"860.8:",100,6
;;D^ ; ;
;;R^"860.8:",100,7
;;D^ ; Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
;;R^"860.8:",100,8
;;D^ ; ;
;;R^"860.8:",100,9
;;D^ ; S OCXDATA(DFN,OCXELE)=1
;;R^"860.8:",100,10
;;D^ ; F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
;;R^"860.8:",100,11
;;D^ ; .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
;;R^"860.8:",100,12
;;D^T+; .I $G(OCXTRACE) W !,"%%%%",?20," ",$P($G(^OCXS(860.4,+OCXDFI,0)),U,1)," = """,OCXVAL,""""
;;R^"860.8:",100,13
;;D^ ; ;
;;R^"860.8:",100,14
;;D^ ; M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
;;R^"860.8:",100,15
;;D^ ; ;
;;R^"860.8:",100,16
;;D^ ; Q 0
;;R^"860.8:",100,17
;;D^ ; ;
;;EOR^
;;KEY^860.8:^GENERATE STRING CHECKSUM
;;R^"860.8:",.01,"E"
;1;
;
ORY14404 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*144) ;JUN 12,2002 at 12:20
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**144**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ;
+2 DO DOT^ORY144ES
+3 ;
+4 ;
+5 KILL REMOTE,LOCAL,OPCODE,REF
+6 FOR LINE=1:1:500
SET TEXT=$PIECE($TEXT(DATA+LINE),";",2,999)
IF TEXT
QUIT
IF $LENGTH(TEXT)
Begin DoDot:1
+7 SET ^TMP("OCXRULE",$JOB,$ORDER(^TMP("OCXRULE",$JOB,"A"),-1)+1)=TEXT
End DoDot:1
IF QUIT
QUIT
+8 ;
+9 GOTO ^ORY14405
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;D^ ; E S OCXMON=$E(OCXMON+100,2,3)
+3 ;;R^"860.8:",100,19
+4 ;;D^ ; S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
+5 ;;R^"860.8:",100,20
+6 ;;D^ ; I OCXF S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
+7 ;;R^"860.8:",100,21
+8 ;;D^ ; Q:'OCXF $E(OCXMON+100,2,3)_"/"_$E(OCXDAY+100,2,3)_$S((OCXCYR=OCXYR):" "_OCXHR_":"_OCXMIN,1:"/"_$E(OCXYR,3,4))
+9 ;;R^"860.8:",100,22
+10 ;;D^ ; Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
+11 ;;R^"860.8:",100,23
+12 ;;D^ ; Q OCXMON_" "_OCXDAY_","_OCXYR
+13 ;;R^"860.8:",100,24
+14 ;;D^ ; ;
+15 ;;EOR^
+16 ;;KEY^860.8:^CREATININE CLEARANCE (ESTIMATED/CALCULATED)
+17 ;;R^"860.8:",.01,"E"
+18 ;;D^CREATININE CLEARANCE (ESTIMATED/CALCULATED)
+19 ;;R^"860.8:",.02,"E"
+20 ;;D^CRCL
+21 ;;R^"860.8:",100,1
+22 ;;D^ ;CRCL(DFN) ;
+23 ;;R^"860.8:",100,2
+24 ;;D^ ; ;
+25 ;;R^"860.8:",100,3
+26 ;;D^ ; N WT,AGE,SEX,SCR,SCRD,CRCL,UNAV,OCXTL,OCXTLS,OCXT,OCXTS,PSCR
+27 ;;R^"860.8:",100,4
+28 ;;D^ ; S UNAV="0^<Unavailable>"
+29 ;;R^"860.8:",100,5
+30 ;;D^ ; S PSCR="^^^^^^0"
+31 ;;R^"860.8:",100,6
+32 ;;D^ ; S WT=$P($$WT^ORQPTQ4(DFN),U,2)*.454 Q:'WT UNAV
+33 ;;R^"860.8:",100,7
+34 ;;D^ ; S AGE=$$AGE^ORQPTQ4(DFN) Q:'AGE UNAV
+35 ;;R^"860.8:",100,8
+36 ;;D^ ; S SEX=$P($$SEX^ORQPTQ4(DFN),U,1) Q:'$L(SEX) UNAV
+37 ;;R^"860.8:",100,9
+38 ;;D^ ; S OCXTL="" Q:'$$TERMLKUP("SERUM CREATININE",.OCXTL) UNAV
+39 ;;R^"860.8:",100,10
+40 ;;D^ ; S OCXTLS="" Q:'$$TERMLKUP("SERUM SPECIMEN",.OCXTLS) UNAV
+41 ;;R^"860.8:",100,11
+42 ;;D^ ; S SCR="",OCXT=0 F S OCXT=$O(OCXTL(OCXT)) Q:'OCXT D
+43 ;;R^"860.8:",100,12
+44 ;;D^ ; .S OCXTS=0 F S OCXTS=$O(OCXTLS(OCXTS)) Q:'OCXTS D
+45 ;;R^"860.8:",100,13
+46 ;;D^ ; ..S SCR=$$LOCL^ORQQLR1(DFN,OCXT,OCXTS)
+47 ;;R^"860.8:",100,14
+48 ;;D^ ; ..I $P(SCR,U,7)>$P(PSCR,U,7) S PSCR=SCR
+49 ;;R^"860.8:",100,15
+50 ;;D^ ; S SCR=PSCR,SCRV=$P(SCR,U,3) Q:+$G(SCRV)<.01 UNAV
+51 ;;R^"860.8:",100,16
+52 ;;D^ ; S SCRD=$P(SCR,U,7) Q:'$L(SCRD) UNAV
+53 ;;R^"860.8:",100,17
+54 ;;D^ ; ;
+55 ;;R^"860.8:",100,18
+56 ;;D^ ; S CRCL=(((140-AGE)*WT)/(SCRV*72))
+57 ;;R^"860.8:",100,19
+58 ;;D^ ; ;
+59 ;;R^"860.8:",100,20
+60 ;;D^ ; I (SEX="M") Q SCRD_U_$J(CRCL,1,2)
+61 ;;R^"860.8:",100,21
+62 ;;D^ ; I (SEX="F") Q SCRD_U_$J((CRCL*.85),1,2)
+63 ;;R^"860.8:",100,22
+64 ;;D^ ; Q UNAV
+65 ;;R^"860.8:",100,23
+66 ;;D^ ; ;
+67 ;;EOR^
+68 ;;KEY^860.8:^DETERMINE IF RENAL LAB RESULTS ARE ABNORMAL HIGH OR LOW
+69 ;;R^"860.8:",.01,"E"
+70 ;;D^DETERMINE IF RENAL LAB RESULTS ARE ABNORMAL HIGH OR LOW
+71 ;;R^"860.8:",.02,"E"
+72 ;;D^ABREN
+73 ;;R^"860.8:",100,1
+74 ;;D^ ;ABREN(DFN) ;
+75 ;;R^"860.8:",100,2
+76 ;;D^ ; ;
+77 ;;R^"860.8:",100,3
+78 ;;D^ ; N OCXFLAG,OCXVAL,OCXLIST,OCXTEST,UNAV,OCXTLIST,OCXTERM,OCXSLIST,OCXSPEC
+79 ;;R^"860.8:",100,4
+80 ;;D^ ; S (OCXLIST,OCXTLIST)="",UNAV="0^<Unavailable>"
+81 ;;R^"860.8:",100,5
+82 ;;D^ ; S OCXSLIST="" Q:'$$TERMLKUP("SERUM SPECIMEN",.OCXSLIST) UNAV
+83 ;;R^"860.8:",100,6
+84 ;;D^ ; F OCXTERM="SERUM CREATININE","SERUM UREA NITROGEN" D Q:($L(OCXLIST)>130)
+85 ;;R^"860.8:",100,7
+86 ;;D^ ; .Q:'$$TERMLKUP(OCXTERM,.OCXTLIST)
+87 ;;R^"860.8:",100,8
+88 ;;D^ ; .S OCXTEST=0 F S OCXTEST=$O(OCXTLIST(OCXTEST)) Q:'OCXTEST D Q:($L(OCXLIST)>130)
+89 ;;R^"860.8:",100,9
+90 ;;D^ ; ..S OCXSPEC=0 F S OCXSPEC=$O(OCXSLIST(OCXSPEC)) Q:'OCXSPEC D Q:($L(OCXLIST)>130)
+91 ;;R^"860.8:",100,10
+92 ;;D^ ; ...S OCXVAL=$$LOCL^ORQQLR1(DFN,OCXTEST,OCXSPEC),OCXFLAG=$P(OCXVAL,U,5)
+93 ;;R^"860.8:",100,11
+94 ;;D^ ; ...I $L(OCXVAL),((OCXFLAG["H")!(OCXFLAG["L")) D
+95 ;;R^"860.8:",100,12
+96 ;;D^ ; ....N OCXY S OCXY=""
+97 ;;R^"860.8:",100,13
+98 ;;D^ ; ....S OCXY=$P(OCXVAL,U,2)_": "_$P(OCXVAL,U,3)_" "_$P(OCXVAL,U,4)
+99 ;;R^"860.8:",100,14
+100 ;;D^ ; ....S OCXY=OCXY_" "_$S($L(OCXFLAG):"["_OCXFLAG_"]",1:"")
+101 ;;R^"860.8:",100,15
+102 ;;D^ ; ....S OCXY=OCXY_" "_$$FMTE^XLFDT($P(OCXVAL,U,7),"2P")
+103 ;;R^"860.8:",100,16
+104 ;;D^ ; ....S:$L(OCXLIST) OCXLIST=OCXLIST_" " S OCXLIST=OCXLIST_OCXY
+105 ;;R^"860.8:",100,17
+106 ;;D^ ; Q:'$L(OCXLIST) UNAV Q 1_U_OCXLIST
+107 ;;R^"860.8:",100,18
+108 ;;D^ ; ;
+109 ;;EOR^
+110 ;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
+111 ;;R^"860.8:",.01,"E"
+112 ;;D^ELAPSED ORDER CHECK TIME LOGGER
+113 ;;R^"860.8:",.02,"E"
+114 ;;D^TIMELOG
+115 ;;R^"860.8:",100,1
+116 ;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
+117 ;;R^"860.8:",100,2
+118 ;;D^ ; ;
+119 ;;R^"860.8:",100,3
+120 ;;D^ ; ;
+121 ;;R^"860.8:",100,4
+122 ;;D^ ; Q 0
+123 ;;R^"860.8:",100,5
+124 ;;D^ ; ;
+125 ;;EOR^
+126 ;;KEY^860.8:^EQUALS TERM OPERATOR
+127 ;;R^"860.8:",.01,"E"
+128 ;;D^EQUALS TERM OPERATOR
+129 ;;R^"860.8:",.02,"E"
+130 ;;D^EQTERM
+131 ;;R^"860.8:",100,1
+132 ;;D^ ;EQTERM(DATA,TERM) ;
+133 ;;R^"860.8:",100,2
+134 ;;D^ ; ;
+135 ;;R^"860.8:",100,3
+136 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DATA: ",$G(DATA)," TERM: ",$G(TERM)
+137 ;;R^"860.8:",100,4
+138 ;;D^ ; N OCXF,OCXL
+139 ;;R^"860.8:",100,5
+140 ;;D^ ; ;
+141 ;;R^"860.8:",100,6
+142 ;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
+143 ;;R^"860.8:",100,7
+144 ;;D^T-; Q:'OCXF 0
+145 ;;R^"860.8:",100,8
+146 ;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
+147 ;;R^"860.8:",100,9
+148 ;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
+149 ;;R^"860.8:",100,10
+150 ;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
+151 ;;R^"860.8:",100,11
+152 ;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
+153 ;;R^"860.8:",100,12
+154 ;;D^T-; Q 0
+155 ;;R^"860.8:",100,13
+156 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
+157 ;;R^"860.8:",100,14
+158 ;;D^ ; ;
+159 ;;EOR^
+160 ;;KEY^860.8:^FILE DATA IN PATIENT ACTIVE DATA FILE
+161 ;;R^"860.8:",.01,"E"
+162 ;;D^FILE DATA IN PATIENT ACTIVE DATA FILE
+163 ;;R^"860.8:",.02,"E"
+164 ;;D^FILE
+165 ;;R^"860.8:",1,1
+166 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function files data
+167 ;;R^"860.8:",1,2
+168 ;;D^ ; ; in the Order Check Patient Data File
+169 ;;R^"860.8:",1,3
+170 ;;D^ ; ;
+171 ;;R^"860.8:",100,1
+172 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
+173 ;;R^"860.8:",100,2
+174 ;;D^ ; ;
+175 ;;R^"860.8:",100,3
+176 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DFN: ",DFN," OCXELE: ",+$G(OCXELE)," OCXDFL: ",$G(OCXDFL)
+177 ;;R^"860.8:",100,4
+178 ;;D^ ; N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
+179 ;;R^"860.8:",100,5
+180 ;;D^ ; S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
+181 ;;R^"860.8:",100,6
+182 ;;D^ ; ;
+183 ;;R^"860.8:",100,7
+184 ;;D^ ; Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
+185 ;;R^"860.8:",100,8
+186 ;;D^ ; ;
+187 ;;R^"860.8:",100,9
+188 ;;D^ ; S OCXDATA(DFN,OCXELE)=1
+189 ;;R^"860.8:",100,10
+190 ;;D^ ; F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
+191 ;;R^"860.8:",100,11
+192 ;;D^ ; .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
+193 ;;R^"860.8:",100,12
+194 ;;D^T+; .I $G(OCXTRACE) W !,"%%%%",?20," ",$P($G(^OCXS(860.4,+OCXDFI,0)),U,1)," = """,OCXVAL,""""
+195 ;;R^"860.8:",100,13
+196 ;;D^ ; ;
+197 ;;R^"860.8:",100,14
+198 ;;D^ ; M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
+199 ;;R^"860.8:",100,15
+200 ;;D^ ; ;
+201 ;;R^"860.8:",100,16
+202 ;;D^ ; Q 0
+203 ;;R^"860.8:",100,17
+204 ;;D^ ; ;
+205 ;;EOR^
+206 ;;KEY^860.8:^GENERATE STRING CHECKSUM
+207 ;;R^"860.8:",.01,"E"
+208 ;1;
+209 ;