[613] | 1 | OCXDI02I ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC ROUTINES ;SEP 7,1999 at 10:30
|
---|
| 2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
|
---|
| 3 | ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
|
---|
| 4 | ;
|
---|
| 5 | S ;
|
---|
| 6 | ;
|
---|
| 7 | D DOT^OCXDIAG
|
---|
| 8 | ;
|
---|
| 9 | ;
|
---|
| 10 | K REMOTE,LOCAL,OPCODE,REF
|
---|
| 11 | F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
|
---|
| 12 | .S ^TMP("OCXDIAG",$J,$O(^TMP("OCXDIAG",$J,"A"),-1)+1)=TEXT
|
---|
| 13 | ;
|
---|
| 14 | G ^OCXDI02J
|
---|
| 15 | ;
|
---|
| 16 | Q
|
---|
| 17 | ;
|
---|
| 18 | DATA ;
|
---|
| 19 | ;
|
---|
| 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:^CONVERT DATE FROM DIALOG TO INTERNAL FILEMAN FORMAT
|
---|
| 44 | ;;R^"860.8:",.01,"E"
|
---|
| 45 | ;;D^CONVERT DATE FROM DIALOG TO INTERNAL FILEMAN FORMAT
|
---|
| 46 | ;;R^"860.8:",.02,"E"
|
---|
| 47 | ;;D^DG2FMINT
|
---|
| 48 | ;;R^"860.8:",100,1
|
---|
| 49 | ;;D^ ;DG2FMINT(X,OCXTIME) ;
|
---|
| 50 | ;;R^"860.8:",100,2
|
---|
| 51 | ;;D^ ; ;
|
---|
| 52 | ;;R^"860.8:",100,3
|
---|
| 53 | ;;D^ ; N Y,%DT S %DT=$S(OCXTIME:"T",1:"") D ^%DT Q Y
|
---|
| 54 | ;;R^"860.8:",100,4
|
---|
| 55 | ;;D^ ; ;
|
---|
| 56 | ;;EOR^
|
---|
| 57 | ;;KEY^860.8:^ADD DAYS/TIME TO A DATE
|
---|
| 58 | ;;R^"860.8:",.01,"E"
|
---|
| 59 | ;;D^ADD DAYS/TIME TO A DATE
|
---|
| 60 | ;;R^"860.8:",.02,"E"
|
---|
| 61 | ;;D^ADD2DATE
|
---|
| 62 | ;;R^"860.8:",1,1
|
---|
| 63 | ;;D^
|
---|
| 64 | ;;R^"860.8:",1,2
|
---|
| 65 | ;;D^ This function adds or subtracts a number of days or a number
|
---|
| 66 | ;;R^"860.8:",1,3
|
---|
| 67 | ;;D^ of hours to a date
|
---|
| 68 | ;;R^"860.8:",100,1
|
---|
| 69 | ;;D^ ;ADD2DATE(DATE,OPER,OFFSET) ;
|
---|
| 70 | ;;R^"860.8:",100,2
|
---|
| 71 | ;;D^ ; ;
|
---|
| 72 | ;;R^"860.8:",100,3
|
---|
| 73 | ;;D^ ; ;
|
---|
| 74 | ;;R^"860.8:",100,4
|
---|
| 75 | ;;D^ ; N ADDATE,X1,X2,Y,X,%H
|
---|
| 76 | ;;R^"860.8:",100,5
|
---|
| 77 | ;;D^ ; S ADDATE=$$DG2FMINT(DATE,1)
|
---|
| 78 | ;;R^"860.8:",100,6
|
---|
| 79 | ;;D^ ; I (OFFSET["H") D Q ADDATE
|
---|
| 80 | ;;R^"860.8:",100,7
|
---|
| 81 | ;;D^ ; .N DATE,HOURS,MINS
|
---|
| 82 | ;;R^"860.8:",100,8
|
---|
| 83 | ;;D^ ; .S DATE=ADDATE\1,HOURS=0,MINS=0
|
---|
| 84 | ;;R^"860.8:",100,9
|
---|
| 85 | ;;D^ ; .S:(ADDATE[".") HOURS=$E($P(ADDATE,".",2),1,2),MINS=$E($P(ADDATE,".",2),3,4)
|
---|
| 86 | ;;R^"860.8:",100,10
|
---|
| 87 | ;;D^ ; .I (OPER="-") S HOURS=HOURS-OFFSET
|
---|
| 88 | ;;R^"860.8:",100,11
|
---|
| 89 | ;;D^ ; .E S HOURS=HOURS+OFFSET
|
---|
| 90 | ;;R^"860.8:",100,12
|
---|
| 91 | ;;D^ ; .F Q:'(HOURS<0) S X1=DATE,X2=-1 D C^%DTC S DATE=X,HOURS=HOURS+24
|
---|
| 92 | ;;R^"860.8:",100,13
|
---|
| 93 | ;;D^ ; .I (HOURS\24) S X1=DATE,X2=(HOURS\24) D C^%DTC S DATE=X,HOURS=HOURS#24
|
---|
| 94 | ;;R^"860.8:",100,14
|
---|
| 95 | ;;D^ ; .S ADDATE=DATE_"."_$E(HOURS+100,2,3)_$E(MINS+100,2,3)
|
---|
| 96 | ;;R^"860.8:",100,15
|
---|
| 97 | ;;D^ ; S:(OFFSET["D") OFFSET=+OFFSET
|
---|
| 98 | ;;R^"860.8:",100,16
|
---|
| 99 | ;;D^ ; S:(OFFSET["W") OFFSET=OFFSET*7
|
---|
| 100 | ;;R^"860.8:",100,17
|
---|
| 101 | ;;D^ ; S:(OFFSET["M") OFFSET=OFFSET*30
|
---|
| 102 | ;;R^"860.8:",100,18
|
---|
| 103 | ;;D^ ; S:(OFFSET["Y") OFFSET=OFFSET*365
|
---|
| 104 | ;;R^"860.8:",100,19
|
---|
| 105 | ;;D^ ; S:(OPER="-") OFFSET=OFFSET*(-1)
|
---|
| 106 | ;;R^"860.8:",100,20
|
---|
| 107 | ;;D^ ; S X1=ADDATE,X2=OFFSET D C^%DTC S ADDATE=X
|
---|
| 108 | ;;R^"860.8:",100,21
|
---|
| 109 | ;;D^ ; Q ADDATE
|
---|
| 110 | ;;R^"860.8:",100,22
|
---|
| 111 | ;;D^ ; ;
|
---|
| 112 | ;;EOR^
|
---|
| 113 | ;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
|
---|
| 114 | ;;R^"860.8:",.01,"E"
|
---|
| 115 | ;;D^ELAPSED ORDER CHECK TIME LOGGER
|
---|
| 116 | ;;R^"860.8:",.02,"E"
|
---|
| 117 | ;;D^TIMELOG
|
---|
| 118 | ;;R^"860.8:",100,1
|
---|
| 119 | ;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
|
---|
| 120 | ;;R^"860.8:",100,2
|
---|
| 121 | ;;D^ ; ;
|
---|
| 122 | ;;R^"860.8:",100,3
|
---|
| 123 | ;;D^ ; ;
|
---|
| 124 | ;;R^"860.8:",100,4
|
---|
| 125 | ;;D^ ; Q 0
|
---|
| 126 | ;;R^"860.8:",100,5
|
---|
| 127 | ;;D^ ; ;
|
---|
| 128 | ;;EOR^
|
---|
| 129 | ;;KEY^860.8:^NEW RULE MESSAGE
|
---|
| 130 | ;;R^"860.8:",.01,"E"
|
---|
| 131 | ;;D^NEW RULE MESSAGE
|
---|
| 132 | ;;R^"860.8:",.02,"E"
|
---|
| 133 | ;;D^NEWRULE
|
---|
| 134 | ;;R^"860.8:",100,1
|
---|
| 135 | ;;D^ ;NEWRULE(OCXDFN,OCXORD,OCXRUL,OCXREL,OCXNOTF,OCXMESS) ; Has this rule already been triggered for this order number
|
---|
| 136 | ;;R^"860.8:",100,2
|
---|
| 137 | ;;D^ ; ;
|
---|
| 138 | ;;R^"860.8:",100,3
|
---|
| 139 | ;;D^L+; S OCXERR=$$TIMELOG("M","NEWRULE("_(+$G(OCXDFN))_","_(+$G(OCXORD))_","_(+$G(OCXRUL))_","_(+$G(OCXREL))_","_(+$G(OCXNOTF))_","_$G(OCXMESS)_")")
|
---|
| 140 | ;;R^"860.8:",100,4
|
---|
| 141 | ;;D^ ; ;
|
---|
| 142 | ;;R^"860.8:",100,5
|
---|
| 143 | ;;D^ ; Q:'$G(OCXDFN) 0 Q:'$G(OCXRUL) 0
|
---|
| 144 | ;;R^"860.8:",100,6
|
---|
| 145 | ;;D^ ; Q:'$G(OCXREL) 0 Q:'$G(OCXNOTF) 0 Q:'$L($G(OCXMESS)) 0
|
---|
| 146 | ;;R^"860.8:",100,7
|
---|
| 147 | ;;D^ ; S OCXORD=+$G(OCXORD),OCXDFN=+OCXDFN
|
---|
| 148 | ;;R^"860.8:",100,8
|
---|
| 149 | ;;D^ ; ;
|
---|
| 150 | ;;R^"860.8:",100,9
|
---|
| 151 | ;;D^ ; N OCXNDX,OCXDATA,OCXDFI,OCXELE,OCXGR,OCXTIME,OCXCKSUM
|
---|
| 152 | ;;R^"860.8:",100,10
|
---|
| 153 | ;;D^ ; ;
|
---|
| 154 | ;;R^"860.8:",100,11
|
---|
| 155 | ;;D^ ; S OCXTIME=(+$H)
|
---|
| 156 | ;;R^"860.8:",100,12
|
---|
| 157 | ;;D^ ; S OCXCKSUM=$$CKSUM(OCXMESS)
|
---|
| 158 | ;;R^"860.8:",100,13
|
---|
| 159 | ;;D^ ; ;
|
---|
| 160 | ;;R^"860.8:",100,14
|
---|
| 161 | ;;D^ ; Q:$D(^OCXD(860.7,"AT",OCXTIME,OCXDFN,OCXRUL,+OCXORD,OCXCKSUM)) 0
|
---|
| 162 | ;;R^"860.8:",100,15
|
---|
| 163 | ;;D^ ; ;
|
---|
| 164 | ;;R^"860.8:",100,16
|
---|
| 165 | ;;D^ ; K OCXDATA
|
---|
| 166 | ;;R^"860.8:",100,17
|
---|
| 167 | ;;D^ ; S OCXDATA(OCXDFN,0)=OCXDFN
|
---|
| 168 | ;;R^"860.8:",100,18
|
---|
| 169 | ;;D^ ; S OCXDATA("B",OCXDFN,OCXDFN)=""
|
---|
| 170 | ;1;
|
---|
| 171 | ;
|
---|