ORY21105 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*211) ;APR 5,2005 at 08:07
;;3.0;ORDER ENTRY/RESULTS REPORTING;**211**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
;
D DOT^ORY211ES
;
;
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 ^ORY21106
;
Q
;
DATA ;
;
;;R^"860.8:",100,5
;;D^ ; N OCXYR,OCXLPYR,OCXMON,OCXDAY,OCXHR,OCXMIN,OCXSEC,OCXCYR
;;R^"860.8:",100,6
;;D^ ; S (OCXYR,OCXLPYR,OCXMON,OCXDAY,OCXHR,OCXMIN,OCXSEC,OCXAP)=""
;;R^"860.8:",100,7
;;D^ ; S OCXSEC=$E(OCXDT#60+100,2,3),OCXDT=OCXDT\60
;;R^"860.8:",100,8
;;D^ ; S OCXMIN=$E(OCXDT#60+100,2,3),OCXDT=OCXDT\60
;;R^"860.8:",100,9
;;D^ ; S OCXHR=$E(OCXDT#24+100,2,3),OCXDT=OCXDT\24
;;R^"860.8:",100,10
;;D^ ; S OCXCYR=($H\1461)*4+1841+(($H#1461)\365)
;;R^"860.8:",100,11
;;D^ ; S OCXYR=(OCXDT\1461)*4+1841,OCXDT=OCXDT#1461
;;R^"860.8:",100,12
;;D^ ; S OCXLPYR=(OCXDT\365),OCXDT=OCXDT-(OCXLPYR*365),OCXYR=OCXYR+OCXLPYR
;;R^"860.8:",100,13
;;D^ ; S OCXCNT="031^059^090^120^151^181^212^243^273^304^334^365"
;;R^"860.8:",100,14
;;D^ ; S:(OCXLPYR=3) OCXCNT="031^060^091^121^152^182^213^244^274^305^335^366"
;;R^"860.8:",100,15
;;D^ ; F OCXMON=1:1:12 Q:(OCXDT<$P(OCXCNT,U,OCXMON))
;;R^"860.8:",100,16
;;D^ ; S OCXDAY=OCXDT-$P(OCXCNT,U,OCXMON-1)+1
;;R^"860.8:",100,17
;;D^ ; I OCXF S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,OCXMON)
;;R^"860.8:",100,18
;;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:^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"
;;D^GENERATE STRING CHECKSUM
;;R^"860.8:",.02,"E"
;;D^CKSUM
;;R^"860.8:",100,1
;;D^ ;CKSUM(STR) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; N CKSUM,PTR,ASC S CKSUM=0
;;R^"860.8:",100,4
;;D^ ; S STR=$TR(STR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
;;R^"860.8:",100,5
;;D^ ; F PTR=$L(STR):-1:1 S ASC=$A(STR,PTR)-42 I (ASC>0),(ASC<51) S CKSUM=CKSUM*2+ASC
;1;
;
ORY21105 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*211) ;APR 5,2005 at 08:07
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**211**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ;
+2 DO DOT^ORY211ES
+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 ^ORY21106
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;R^"860.8:",100,5
+3 ;;D^ ; N OCXYR,OCXLPYR,OCXMON,OCXDAY,OCXHR,OCXMIN,OCXSEC,OCXCYR
+4 ;;R^"860.8:",100,6
+5 ;;D^ ; S (OCXYR,OCXLPYR,OCXMON,OCXDAY,OCXHR,OCXMIN,OCXSEC,OCXAP)=""
+6 ;;R^"860.8:",100,7
+7 ;;D^ ; S OCXSEC=$E(OCXDT#60+100,2,3),OCXDT=OCXDT\60
+8 ;;R^"860.8:",100,8
+9 ;;D^ ; S OCXMIN=$E(OCXDT#60+100,2,3),OCXDT=OCXDT\60
+10 ;;R^"860.8:",100,9
+11 ;;D^ ; S OCXHR=$E(OCXDT#24+100,2,3),OCXDT=OCXDT\24
+12 ;;R^"860.8:",100,10
+13 ;;D^ ; S OCXCYR=($H\1461)*4+1841+(($H#1461)\365)
+14 ;;R^"860.8:",100,11
+15 ;;D^ ; S OCXYR=(OCXDT\1461)*4+1841,OCXDT=OCXDT#1461
+16 ;;R^"860.8:",100,12
+17 ;;D^ ; S OCXLPYR=(OCXDT\365),OCXDT=OCXDT-(OCXLPYR*365),OCXYR=OCXYR+OCXLPYR
+18 ;;R^"860.8:",100,13
+19 ;;D^ ; S OCXCNT="031^059^090^120^151^181^212^243^273^304^334^365"
+20 ;;R^"860.8:",100,14
+21 ;;D^ ; S:(OCXLPYR=3) OCXCNT="031^060^091^121^152^182^213^244^274^305^335^366"
+22 ;;R^"860.8:",100,15
+23 ;;D^ ; F OCXMON=1:1:12 Q:(OCXDT<$P(OCXCNT,U,OCXMON))
+24 ;;R^"860.8:",100,16
+25 ;;D^ ; S OCXDAY=OCXDT-$P(OCXCNT,U,OCXMON-1)+1
+26 ;;R^"860.8:",100,17
+27 ;;D^ ; I OCXF S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,OCXMON)
+28 ;;R^"860.8:",100,18
+29 ;;D^ ; E S OCXMON=$E(OCXMON+100,2,3)
+30 ;;R^"860.8:",100,19
+31 ;;D^ ; S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
+32 ;;R^"860.8:",100,20
+33 ;;D^ ; I OCXF S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
+34 ;;R^"860.8:",100,21
+35 ;;D^ ; Q:'OCXF $E(OCXMON+100,2,3)_"/"_$E(OCXDAY+100,2,3)_$S((OCXCYR=OCXYR):" "_OCXHR_":"_OCXMIN,1:"/"_$E(OCXYR,3,4))
+36 ;;R^"860.8:",100,22
+37 ;;D^ ; Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
+38 ;;R^"860.8:",100,23
+39 ;;D^ ; Q OCXMON_" "_OCXDAY_","_OCXYR
+40 ;;R^"860.8:",100,24
+41 ;;D^ ; ;
+42 ;;EOR^
+43 ;;KEY^860.8:^DETERMINE IF RENAL LAB RESULTS ARE ABNORMAL HIGH OR LOW
+44 ;;R^"860.8:",.01,"E"
+45 ;;D^DETERMINE IF RENAL LAB RESULTS ARE ABNORMAL HIGH OR LOW
+46 ;;R^"860.8:",.02,"E"
+47 ;;D^ABREN
+48 ;;R^"860.8:",100,1
+49 ;;D^ ;ABREN(DFN) ;
+50 ;;R^"860.8:",100,2
+51 ;;D^ ; ;
+52 ;;R^"860.8:",100,3
+53 ;;D^ ; N OCXFLAG,OCXVAL,OCXLIST,OCXTEST,UNAV,OCXTLIST,OCXTERM,OCXSLIST,OCXSPEC
+54 ;;R^"860.8:",100,4
+55 ;;D^ ; S (OCXLIST,OCXTLIST)="",UNAV="0^<Unavailable>"
+56 ;;R^"860.8:",100,5
+57 ;;D^ ; S OCXSLIST="" Q:'$$TERMLKUP("SERUM SPECIMEN",.OCXSLIST) UNAV
+58 ;;R^"860.8:",100,6
+59 ;;D^ ; F OCXTERM="SERUM CREATININE","SERUM UREA NITROGEN" D Q:($L(OCXLIST)>130)
+60 ;;R^"860.8:",100,7
+61 ;;D^ ; .Q:'$$TERMLKUP(OCXTERM,.OCXTLIST)
+62 ;;R^"860.8:",100,8
+63 ;;D^ ; .S OCXTEST=0 F S OCXTEST=$O(OCXTLIST(OCXTEST)) Q:'OCXTEST D Q:($L(OCXLIST)>130)
+64 ;;R^"860.8:",100,9
+65 ;;D^ ; ..S OCXSPEC=0 F S OCXSPEC=$O(OCXSLIST(OCXSPEC)) Q:'OCXSPEC D Q:($L(OCXLIST)>130)
+66 ;;R^"860.8:",100,10
+67 ;;D^ ; ...S OCXVAL=$$LOCL^ORQQLR1(DFN,OCXTEST,OCXSPEC),OCXFLAG=$P(OCXVAL,U,5)
+68 ;;R^"860.8:",100,11
+69 ;;D^ ; ...I $L(OCXVAL),((OCXFLAG["H")!(OCXFLAG["L")) D
+70 ;;R^"860.8:",100,12
+71 ;;D^ ; ....N OCXY S OCXY=""
+72 ;;R^"860.8:",100,13
+73 ;;D^ ; ....S OCXY=$P(OCXVAL,U,2)_": "_$P(OCXVAL,U,3)_" "_$P(OCXVAL,U,4)
+74 ;;R^"860.8:",100,14
+75 ;;D^ ; ....S OCXY=OCXY_" "_$S($L(OCXFLAG):"["_OCXFLAG_"]",1:"")
+76 ;;R^"860.8:",100,15
+77 ;;D^ ; ....S OCXY=OCXY_" "_$$FMTE^XLFDT($P(OCXVAL,U,7),"2P")
+78 ;;R^"860.8:",100,16
+79 ;;D^ ; ....S:$L(OCXLIST) OCXLIST=OCXLIST_" " S OCXLIST=OCXLIST_OCXY
+80 ;;R^"860.8:",100,17
+81 ;;D^ ; Q:'$L(OCXLIST) UNAV Q 1_U_OCXLIST
+82 ;;R^"860.8:",100,18
+83 ;;D^ ; ;
+84 ;;EOR^
+85 ;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
+86 ;;R^"860.8:",.01,"E"
+87 ;;D^ELAPSED ORDER CHECK TIME LOGGER
+88 ;;R^"860.8:",.02,"E"
+89 ;;D^TIMELOG
+90 ;;R^"860.8:",100,1
+91 ;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
+92 ;;R^"860.8:",100,2
+93 ;;D^ ; ;
+94 ;;R^"860.8:",100,3
+95 ;;D^ ; ;
+96 ;;R^"860.8:",100,4
+97 ;;D^ ; Q 0
+98 ;;R^"860.8:",100,5
+99 ;;D^ ; ;
+100 ;;EOR^
+101 ;;KEY^860.8:^EQUALS TERM OPERATOR
+102 ;;R^"860.8:",.01,"E"
+103 ;;D^EQUALS TERM OPERATOR
+104 ;;R^"860.8:",.02,"E"
+105 ;;D^EQTERM
+106 ;;R^"860.8:",100,1
+107 ;;D^ ;EQTERM(DATA,TERM) ;
+108 ;;R^"860.8:",100,2
+109 ;;D^ ; ;
+110 ;;R^"860.8:",100,3
+111 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DATA: ",$G(DATA)," TERM: ",$G(TERM)
+112 ;;R^"860.8:",100,4
+113 ;;D^ ; N OCXF,OCXL
+114 ;;R^"860.8:",100,5
+115 ;;D^ ; ;
+116 ;;R^"860.8:",100,6
+117 ;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
+118 ;;R^"860.8:",100,7
+119 ;;D^T-; Q:'OCXF 0
+120 ;;R^"860.8:",100,8
+121 ;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
+122 ;;R^"860.8:",100,9
+123 ;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
+124 ;;R^"860.8:",100,10
+125 ;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
+126 ;;R^"860.8:",100,11
+127 ;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
+128 ;;R^"860.8:",100,12
+129 ;;D^T-; Q 0
+130 ;;R^"860.8:",100,13
+131 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
+132 ;;R^"860.8:",100,14
+133 ;;D^ ; ;
+134 ;;EOR^
+135 ;;KEY^860.8:^FILE DATA IN PATIENT ACTIVE DATA FILE
+136 ;;R^"860.8:",.01,"E"
+137 ;;D^FILE DATA IN PATIENT ACTIVE DATA FILE
+138 ;;R^"860.8:",.02,"E"
+139 ;;D^FILE
+140 ;;R^"860.8:",1,1
+141 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function files data
+142 ;;R^"860.8:",1,2
+143 ;;D^ ; ; in the Order Check Patient Data File
+144 ;;R^"860.8:",1,3
+145 ;;D^ ; ;
+146 ;;R^"860.8:",100,1
+147 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
+148 ;;R^"860.8:",100,2
+149 ;;D^ ; ;
+150 ;;R^"860.8:",100,3
+151 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DFN: ",DFN," OCXELE: ",+$G(OCXELE)," OCXDFL: ",$G(OCXDFL)
+152 ;;R^"860.8:",100,4
+153 ;;D^ ; N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
+154 ;;R^"860.8:",100,5
+155 ;;D^ ; S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
+156 ;;R^"860.8:",100,6
+157 ;;D^ ; ;
+158 ;;R^"860.8:",100,7
+159 ;;D^ ; Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
+160 ;;R^"860.8:",100,8
+161 ;;D^ ; ;
+162 ;;R^"860.8:",100,9
+163 ;;D^ ; S OCXDATA(DFN,OCXELE)=1
+164 ;;R^"860.8:",100,10
+165 ;;D^ ; F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
+166 ;;R^"860.8:",100,11
+167 ;;D^ ; .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
+168 ;;R^"860.8:",100,12
+169 ;;D^T+; .I $G(OCXTRACE) W !,"%%%%",?20," ",$P($G(^OCXS(860.4,+OCXDFI,0)),U,1)," = """,OCXVAL,""""
+170 ;;R^"860.8:",100,13
+171 ;;D^ ; ;
+172 ;;R^"860.8:",100,14
+173 ;;D^ ; M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
+174 ;;R^"860.8:",100,15
+175 ;;D^ ; ;
+176 ;;R^"860.8:",100,16
+177 ;;D^ ; Q 0
+178 ;;R^"860.8:",100,17
+179 ;;D^ ; ;
+180 ;;EOR^
+181 ;;KEY^860.8:^GENERATE STRING CHECKSUM
+182 ;;R^"860.8:",.01,"E"
+183 ;;D^GENERATE STRING CHECKSUM
+184 ;;R^"860.8:",.02,"E"
+185 ;;D^CKSUM
+186 ;;R^"860.8:",100,1
+187 ;;D^ ;CKSUM(STR) ;
+188 ;;R^"860.8:",100,2
+189 ;;D^ ; ;
+190 ;;R^"860.8:",100,3
+191 ;;D^ ; N CKSUM,PTR,ASC S CKSUM=0
+192 ;;R^"860.8:",100,4
+193 ;;D^ ; S STR=$TR(STR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+194 ;;R^"860.8:",100,5
+195 ;;D^ ; F PTR=$L(STR):-1:1 S ASC=$A(STR,PTR)-42 I (ASC>0),(ASC<51) S CKSUM=CKSUM*2+ASC
+196 ;1;
+197 ;