OCXDI02I ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC ROUTINES ;SEP 7,1999 at 10:30
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
;
D DOT^OCXDIAG
;
;
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("OCXDIAG",$J,$O(^TMP("OCXDIAG",$J,"A"),-1)+1)=TEXT
;
G ^OCXDI02J
;
Q
;
DATA ;
;
;;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:^CONVERT DATE FROM DIALOG TO INTERNAL FILEMAN FORMAT
;;R^"860.8:",.01,"E"
;;D^CONVERT DATE FROM DIALOG TO INTERNAL FILEMAN FORMAT
;;R^"860.8:",.02,"E"
;;D^DG2FMINT
;;R^"860.8:",100,1
;;D^ ;DG2FMINT(X,OCXTIME) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; N Y,%DT S %DT=$S(OCXTIME:"T",1:"") D ^%DT Q Y
;;R^"860.8:",100,4
;;D^ ; ;
;;EOR^
;;KEY^860.8:^ADD DAYS/TIME TO A DATE
;;R^"860.8:",.01,"E"
;;D^ADD DAYS/TIME TO A DATE
;;R^"860.8:",.02,"E"
;;D^ADD2DATE
;;R^"860.8:",1,1
;;D^
;;R^"860.8:",1,2
;;D^ This function adds or subtracts a number of days or a number
;;R^"860.8:",1,3
;;D^ of hours to a date
;;R^"860.8:",100,1
;;D^ ;ADD2DATE(DATE,OPER,OFFSET) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; ;
;;R^"860.8:",100,4
;;D^ ; N ADDATE,X1,X2,Y,X,%H
;;R^"860.8:",100,5
;;D^ ; S ADDATE=$$DG2FMINT(DATE,1)
;;R^"860.8:",100,6
;;D^ ; I (OFFSET["H") D Q ADDATE
;;R^"860.8:",100,7
;;D^ ; .N DATE,HOURS,MINS
;;R^"860.8:",100,8
;;D^ ; .S DATE=ADDATE\1,HOURS=0,MINS=0
;;R^"860.8:",100,9
;;D^ ; .S:(ADDATE[".") HOURS=$E($P(ADDATE,".",2),1,2),MINS=$E($P(ADDATE,".",2),3,4)
;;R^"860.8:",100,10
;;D^ ; .I (OPER="-") S HOURS=HOURS-OFFSET
;;R^"860.8:",100,11
;;D^ ; .E S HOURS=HOURS+OFFSET
;;R^"860.8:",100,12
;;D^ ; .F Q:'(HOURS<0) S X1=DATE,X2=-1 D C^%DTC S DATE=X,HOURS=HOURS+24
;;R^"860.8:",100,13
;;D^ ; .I (HOURS\24) S X1=DATE,X2=(HOURS\24) D C^%DTC S DATE=X,HOURS=HOURS#24
;;R^"860.8:",100,14
;;D^ ; .S ADDATE=DATE_"."_$E(HOURS+100,2,3)_$E(MINS+100,2,3)
;;R^"860.8:",100,15
;;D^ ; S:(OFFSET["D") OFFSET=+OFFSET
;;R^"860.8:",100,16
;;D^ ; S:(OFFSET["W") OFFSET=OFFSET*7
;;R^"860.8:",100,17
;;D^ ; S:(OFFSET["M") OFFSET=OFFSET*30
;;R^"860.8:",100,18
;;D^ ; S:(OFFSET["Y") OFFSET=OFFSET*365
;;R^"860.8:",100,19
;;D^ ; S:(OPER="-") OFFSET=OFFSET*(-1)
;;R^"860.8:",100,20
;;D^ ; S X1=ADDATE,X2=OFFSET D C^%DTC S ADDATE=X
;;R^"860.8:",100,21
;;D^ ; Q ADDATE
;;R^"860.8:",100,22
;;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:^NEW RULE MESSAGE
;;R^"860.8:",.01,"E"
;;D^NEW RULE MESSAGE
;;R^"860.8:",.02,"E"
;;D^NEWRULE
;;R^"860.8:",100,1
;;D^ ;NEWRULE(OCXDFN,OCXORD,OCXRUL,OCXREL,OCXNOTF,OCXMESS) ; Has this rule already been triggered for this order number
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^L+; S OCXERR=$$TIMELOG("M","NEWRULE("_(+$G(OCXDFN))_","_(+$G(OCXORD))_","_(+$G(OCXRUL))_","_(+$G(OCXREL))_","_(+$G(OCXNOTF))_","_$G(OCXMESS)_")")
;;R^"860.8:",100,4
;;D^ ; ;
;;R^"860.8:",100,5
;;D^ ; Q:'$G(OCXDFN) 0 Q:'$G(OCXRUL) 0
;;R^"860.8:",100,6
;;D^ ; Q:'$G(OCXREL) 0 Q:'$G(OCXNOTF) 0 Q:'$L($G(OCXMESS)) 0
;;R^"860.8:",100,7
;;D^ ; S OCXORD=+$G(OCXORD),OCXDFN=+OCXDFN
;;R^"860.8:",100,8
;;D^ ; ;
;;R^"860.8:",100,9
;;D^ ; N OCXNDX,OCXDATA,OCXDFI,OCXELE,OCXGR,OCXTIME,OCXCKSUM
;;R^"860.8:",100,10
;;D^ ; ;
;;R^"860.8:",100,11
;;D^ ; S OCXTIME=(+$H)
;;R^"860.8:",100,12
;;D^ ; S OCXCKSUM=$$CKSUM(OCXMESS)
;;R^"860.8:",100,13
;;D^ ; ;
;;R^"860.8:",100,14
;;D^ ; Q:$D(^OCXD(860.7,"AT",OCXTIME,OCXDFN,OCXRUL,+OCXORD,OCXCKSUM)) 0
;;R^"860.8:",100,15
;;D^ ; ;
;;R^"860.8:",100,16
;;D^ ; K OCXDATA
;;R^"860.8:",100,17
;;D^ ; S OCXDATA(OCXDFN,0)=OCXDFN
;;R^"860.8:",100,18
;;D^ ; S OCXDATA("B",OCXDFN,OCXDFN)=""
;1;
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOCXDI02I 5241 printed Nov 22, 2024@17:33:56 Page 2
OCXDI02I ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC ROUTINES ;SEP 7,1999 at 10:30
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ;
+2 DO DOT^OCXDIAG
+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("OCXDIAG",$JOB,$ORDER(^TMP("OCXDIAG",$JOB,"A"),-1)+1)=TEXT
End DoDot:1
if QUIT
QUIT
+8 ;
+9 GOTO ^OCXDI02J
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;R^"860.8:",100,14
+3 ;;D^ ; S:(OCXLPYR=3) OCXCNT="031^060^091^121^152^182^213^244^274^305^335^366"
+4 ;;R^"860.8:",100,15
+5 ;;D^ ; F OCXMON=1:1:12 Q:(OCXDT<$P(OCXCNT,U,OCXMON))
+6 ;;R^"860.8:",100,16
+7 ;;D^ ; S OCXDAY=OCXDT-$P(OCXCNT,U,OCXMON-1)+1
+8 ;;R^"860.8:",100,17
+9 ;;D^ ; I OCXF S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,OCXMON)
+10 ;;R^"860.8:",100,18
+11 ;;D^ ; E S OCXMON=$E(OCXMON+100,2,3)
+12 ;;R^"860.8:",100,19
+13 ;;D^ ; S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
+14 ;;R^"860.8:",100,20
+15 ;;D^ ; I OCXF S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
+16 ;;R^"860.8:",100,21
+17 ;;D^ ; Q:'OCXF $E(OCXMON+100,2,3)_"/"_$E(OCXDAY+100,2,3)_$S((OCXCYR=OCXYR):" "_OCXHR_":"_OCXMIN,1:"/"_$E(OCXYR,3,4))
+18 ;;R^"860.8:",100,22
+19 ;;D^ ; Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
+20 ;;R^"860.8:",100,23
+21 ;;D^ ; Q OCXMON_" "_OCXDAY_","_OCXYR
+22 ;;R^"860.8:",100,24
+23 ;;D^ ; ;
+24 ;;EOR^
+25 ;;KEY^860.8:^CONVERT DATE FROM DIALOG TO INTERNAL FILEMAN FORMAT
+26 ;;R^"860.8:",.01,"E"
+27 ;;D^CONVERT DATE FROM DIALOG TO INTERNAL FILEMAN FORMAT
+28 ;;R^"860.8:",.02,"E"
+29 ;;D^DG2FMINT
+30 ;;R^"860.8:",100,1
+31 ;;D^ ;DG2FMINT(X,OCXTIME) ;
+32 ;;R^"860.8:",100,2
+33 ;;D^ ; ;
+34 ;;R^"860.8:",100,3
+35 ;;D^ ; N Y,%DT S %DT=$S(OCXTIME:"T",1:"") D ^%DT Q Y
+36 ;;R^"860.8:",100,4
+37 ;;D^ ; ;
+38 ;;EOR^
+39 ;;KEY^860.8:^ADD DAYS/TIME TO A DATE
+40 ;;R^"860.8:",.01,"E"
+41 ;;D^ADD DAYS/TIME TO A DATE
+42 ;;R^"860.8:",.02,"E"
+43 ;;D^ADD2DATE
+44 ;;R^"860.8:",1,1
+45 ;;D^
+46 ;;R^"860.8:",1,2
+47 ;;D^ This function adds or subtracts a number of days or a number
+48 ;;R^"860.8:",1,3
+49 ;;D^ of hours to a date
+50 ;;R^"860.8:",100,1
+51 ;;D^ ;ADD2DATE(DATE,OPER,OFFSET) ;
+52 ;;R^"860.8:",100,2
+53 ;;D^ ; ;
+54 ;;R^"860.8:",100,3
+55 ;;D^ ; ;
+56 ;;R^"860.8:",100,4
+57 ;;D^ ; N ADDATE,X1,X2,Y,X,%H
+58 ;;R^"860.8:",100,5
+59 ;;D^ ; S ADDATE=$$DG2FMINT(DATE,1)
+60 ;;R^"860.8:",100,6
+61 ;;D^ ; I (OFFSET["H") D Q ADDATE
+62 ;;R^"860.8:",100,7
+63 ;;D^ ; .N DATE,HOURS,MINS
+64 ;;R^"860.8:",100,8
+65 ;;D^ ; .S DATE=ADDATE\1,HOURS=0,MINS=0
+66 ;;R^"860.8:",100,9
+67 ;;D^ ; .S:(ADDATE[".") HOURS=$E($P(ADDATE,".",2),1,2),MINS=$E($P(ADDATE,".",2),3,4)
+68 ;;R^"860.8:",100,10
+69 ;;D^ ; .I (OPER="-") S HOURS=HOURS-OFFSET
+70 ;;R^"860.8:",100,11
+71 ;;D^ ; .E S HOURS=HOURS+OFFSET
+72 ;;R^"860.8:",100,12
+73 ;;D^ ; .F Q:'(HOURS<0) S X1=DATE,X2=-1 D C^%DTC S DATE=X,HOURS=HOURS+24
+74 ;;R^"860.8:",100,13
+75 ;;D^ ; .I (HOURS\24) S X1=DATE,X2=(HOURS\24) D C^%DTC S DATE=X,HOURS=HOURS#24
+76 ;;R^"860.8:",100,14
+77 ;;D^ ; .S ADDATE=DATE_"."_$E(HOURS+100,2,3)_$E(MINS+100,2,3)
+78 ;;R^"860.8:",100,15
+79 ;;D^ ; S:(OFFSET["D") OFFSET=+OFFSET
+80 ;;R^"860.8:",100,16
+81 ;;D^ ; S:(OFFSET["W") OFFSET=OFFSET*7
+82 ;;R^"860.8:",100,17
+83 ;;D^ ; S:(OFFSET["M") OFFSET=OFFSET*30
+84 ;;R^"860.8:",100,18
+85 ;;D^ ; S:(OFFSET["Y") OFFSET=OFFSET*365
+86 ;;R^"860.8:",100,19
+87 ;;D^ ; S:(OPER="-") OFFSET=OFFSET*(-1)
+88 ;;R^"860.8:",100,20
+89 ;;D^ ; S X1=ADDATE,X2=OFFSET D C^%DTC S ADDATE=X
+90 ;;R^"860.8:",100,21
+91 ;;D^ ; Q ADDATE
+92 ;;R^"860.8:",100,22
+93 ;;D^ ; ;
+94 ;;EOR^
+95 ;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
+96 ;;R^"860.8:",.01,"E"
+97 ;;D^ELAPSED ORDER CHECK TIME LOGGER
+98 ;;R^"860.8:",.02,"E"
+99 ;;D^TIMELOG
+100 ;;R^"860.8:",100,1
+101 ;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
+102 ;;R^"860.8:",100,2
+103 ;;D^ ; ;
+104 ;;R^"860.8:",100,3
+105 ;;D^ ; ;
+106 ;;R^"860.8:",100,4
+107 ;;D^ ; Q 0
+108 ;;R^"860.8:",100,5
+109 ;;D^ ; ;
+110 ;;EOR^
+111 ;;KEY^860.8:^NEW RULE MESSAGE
+112 ;;R^"860.8:",.01,"E"
+113 ;;D^NEW RULE MESSAGE
+114 ;;R^"860.8:",.02,"E"
+115 ;;D^NEWRULE
+116 ;;R^"860.8:",100,1
+117 ;;D^ ;NEWRULE(OCXDFN,OCXORD,OCXRUL,OCXREL,OCXNOTF,OCXMESS) ; Has this rule already been triggered for this order number
+118 ;;R^"860.8:",100,2
+119 ;;D^ ; ;
+120 ;;R^"860.8:",100,3
+121 ;;D^L+; S OCXERR=$$TIMELOG("M","NEWRULE("_(+$G(OCXDFN))_","_(+$G(OCXORD))_","_(+$G(OCXRUL))_","_(+$G(OCXREL))_","_(+$G(OCXNOTF))_","_$G(OCXMESS)_")")
+122 ;;R^"860.8:",100,4
+123 ;;D^ ; ;
+124 ;;R^"860.8:",100,5
+125 ;;D^ ; Q:'$G(OCXDFN) 0 Q:'$G(OCXRUL) 0
+126 ;;R^"860.8:",100,6
+127 ;;D^ ; Q:'$G(OCXREL) 0 Q:'$G(OCXNOTF) 0 Q:'$L($G(OCXMESS)) 0
+128 ;;R^"860.8:",100,7
+129 ;;D^ ; S OCXORD=+$G(OCXORD),OCXDFN=+OCXDFN
+130 ;;R^"860.8:",100,8
+131 ;;D^ ; ;
+132 ;;R^"860.8:",100,9
+133 ;;D^ ; N OCXNDX,OCXDATA,OCXDFI,OCXELE,OCXGR,OCXTIME,OCXCKSUM
+134 ;;R^"860.8:",100,10
+135 ;;D^ ; ;
+136 ;;R^"860.8:",100,11
+137 ;;D^ ; S OCXTIME=(+$H)
+138 ;;R^"860.8:",100,12
+139 ;;D^ ; S OCXCKSUM=$$CKSUM(OCXMESS)
+140 ;;R^"860.8:",100,13
+141 ;;D^ ; ;
+142 ;;R^"860.8:",100,14
+143 ;;D^ ; Q:$D(^OCXD(860.7,"AT",OCXTIME,OCXDFN,OCXRUL,+OCXORD,OCXCKSUM)) 0
+144 ;;R^"860.8:",100,15
+145 ;;D^ ; ;
+146 ;;R^"860.8:",100,16
+147 ;;D^ ; K OCXDATA
+148 ;;R^"860.8:",100,17
+149 ;;D^ ; S OCXDATA(OCXDFN,0)=OCXDFN
+150 ;;R^"860.8:",100,18
+151 ;;D^ ; S OCXDATA("B",OCXDFN,OCXDFN)=""
+152 ;1;
+153 ;