OCXDEBUG ;SLC/RJS,CLA - ORDER CHECK COMPILED CODE DEBUGGER (SINGLE/MULTI);10/29/98 12:37
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
SINGLE ;
;
N OCXOLOG,IOP
;
I '$O(^OCXD(861,1)) W !!,"No entries in the raw data log..." Q
;
K ^TMP("OCXDEBUG",$J)
S ^TMP("OCXDEBUG",$J)=($P($H,",",2)+($H*86400)+(4*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
S IOP=0 D ^%ZIS K IOP S X=132 U IO X ^%ZOSF("RM")
;
F W !! S OCXOLOG=+$$LOOKUP("Select Log entry number: ") Q:'OCXOLOG D RUN(OCXOLOG,$$ASKFLAG,$$ASKPURG),REPORT
Q
;
ASKFLAG() Q ('$$READ("Y","Do you want to send any alerts generated ","NO")*10)+1
;
ASKPURG() Q $$READ("Y","Do you want purge rule events ","NO")
;
SMOKE(OCXTRACE) ;
N OCXOLOG,OCXP,OCX1,OCX2,OCX3
;
I '$O(^OCXD(861,1)) W !!,"No entries in the raw data log..." Q
S:'$L($G(OCXTRACE)) OCXTRACE=11
;
W !
W !,"First Entry: ",+$O(^OCXD(861,1))
W !,"Last Entry: ",+$O(^OCXD(861," "),-1)
K ^TMP("OCXDEBUG",$J)
S ^TMP("OCXDEBUG",$J)=($P($H,",",2)+($H*86400)+(4*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
S IOP=0 D ^%ZIS K IOP S X=132 U IO X ^%ZOSF("RM")
;
S OCXP=$$ASKPURG
S OCX1=$$LOOKUP("Start at Log Number: ")
S OCX2=$$LOOKUP(" Stop at Log Number: ")
S:(OCX1>OCX2) OCX3=OCX2,OCX2=OCX1,OCX1=OCX3
S OCXOLOG=OCX1 D F S OCXOLOG=$O(^OCXD(861,OCXOLOG)) Q:'OCXOLOG Q:(OCXOLOG>OCX2) D
.W @IOF D RUN(OCXOLOG,OCXTRACE,OCXP)
D ^%ZIS
U IO D REPORT D ^%ZISC
Q
;
REPORT ;
N OCXD0,OCXD1
I '$O(^TMP("OCXDEBUG",$J,0)) W !!,"No rules triggered.",!! Q
W !!,"************* Rules triggered ****************",!
S OCXD0=0 F S OCXD0=$O(^TMP("OCXDEBUG",$J,OCXD0)) Q:'OCXD0 D
.S OCXD1=0 F S OCXD1=$O(^TMP("OCXDEBUG",$J,OCXD0,OCXD1)) Q:'OCXD1 D
..W !,"Rule: (",(+OCXD0),") ",$P($G(^OCXS(860.2,+OCXD0,0)),U,1)
..W !,"Relation: (",(+OCXD1),") ",$G(^OCXS(860.2,+OCXD0,"R",+OCXD1,"E"))
..W !," Number triggered: ",+$G(^TMP("OCXDEBUG",$J,OCXD0,OCXD1))
..W !
Q
;
RUN(OCXDEBUG,OCXTRACE,OCXPURGE) ;
;
Q:'$D(^OCXD(861,OCXDEBUG)) Q:'$D(^OCXD(861,OCXDEBUG,"SOURCE"))
;
N OCXA,OCXAR,OCXD0
;
M OCXA=^OCXD(861,OCXDEBUG)
;
W !,"RUN: ",OCXDEBUG," ",OCXA("SOURCE")
;
I OCXPURGE D
.N DFN S DFN=+$P($G(OCXA("PATIENT")),"[",2) Q:'DFN
.K ^OCXD(860.7,DFN,1)
.K ^OCXD(860.7,"AT",+$H,DFN)
;
I (OCXA("SOURCE")="HL7") D Q
.S OCXAR=OCXA("ARRAY")
.I '(OCXAR[U) N @OCXAR
.N OCXDBMSG
.S OCXD0=0 F S OCXD0=$O(OCXA("DATA",OCXD0)) Q:'OCXD0 D
..N LAST,TEXT
..S LAST=$O(@OCXAR@(" "),-1)
..S TEXT=OCXA("DATA",OCXD0,0)
..I LAST,($E(TEXT,1,3)=">>>") S TEXT=$E(TEXT,4,$L(TEXT))
..E S LAST=LAST+1
..S @OCXAR@(LAST)=$G(@OCXAR@(LAST))_TEXT
.S OCXDBMSG=""
.W !!
.I '(OCXAR[U) X "D SILENT^OCXOHL7(."_OCXAR_",.OCXDBMSG)" I 1
.E D SILENT^OCXOHL7(.OCXAR,.OCXDBMSG)
.I ($D(OCXDBMSG)>1) D ZW("OCXDBMSG")
.I (OCXAR[U) K @OCXAR
;
I (OCXA("SOURCE")="DGPM") D Q
.N DGPM0,DGPMA,DGPMDA,DFN,OCXDBMSG
.S OCXD0=0 F S OCXD0=$O(OCXA("DATA",OCXD0)) Q:'OCXD0 D
..N TEXT S TEXT=OCXA("DATA",OCXD0,0)
..S @$P(TEXT,"=",1)=$P(TEXT,"=",2,999)
.S DFN=+$P($G(OCXA("PATIENT")),"[",2)
.S OCXDBMSG=""
.W !! D SILENT^OCXODGPM(.OCXDBMSG)
.I ($D(OCXDBMSG)>1) D ZW("OCXDBMSG")
;
I (OCXA("SOURCE")="OEPS") D Q
.N OCXPSD,OCXPSM,DFN,OCXDBMSG
.S OCXD0=0 F S OCXD0=$O(OCXA("DATA",OCXD0)) Q:'OCXD0 D
..N TEXT S TEXT=OCXA("DATA",OCXD0,0)
..S @$P(TEXT,"=",1)=$P(TEXT,"=",2,999)
.S DFN=+$P($G(OCXA("PATIENT")),"[",2)
.S OCXDBMSG=""
.W ! D EN^OCXOEPS(.OCXDBMSG,DFN,OCXPSD,OCXPSM) ;
.I ($D(OCXDBMSG)>1) D ZW("OCXDBMSG")
;
I (OCXA("SOURCE")="OERR") D Q
.N OCXORD,DFN,OCXDBMSG
.S OCXD0=0 F S OCXD0=$O(OCXA("DATA",OCXD0)) Q:'OCXD0 D
..N TEXT S TEXT=OCXA("DATA",OCXD0,0)
..S @$P(TEXT,"=",1)=$P(TEXT,"=",2,999)
.S DFN=+$P($G(OCXA("PATIENT")),"[",2)
.S OCXDBMSG=""
.W ! D SILENT^OCXOERR(OCXORD,.OCXDBMSG) ;
.I ($D(OCXDBMSG)>1) D ZW("OCXDBMSG")
Q
;
LOOKUP(OCXDLG) ;
;
N DIC,X,Y
S:$L($G(OCXDLG)) DIC("A")=OCXDLG
S DIC="^OCXD(861,",DIC(0)="AMNEQ"
S DIC("S")="I (Y>1)"
S DIC("W")="W "" "",$G(^(""SOURCE"")),"" "",$G(^(""PATIENT""))"
S Y=0 D ^DIC
Q:(Y<0) 0 Q +Y
;
ZW(ARRAY) ;
W !,ARRAY
N NODE
I ($D(@ARRAY)#10) W !,ARRAY," = ",@ARRAY
S:($E(ARRAY,$L(ARRAY))=")") ARRAY=$E(ARRAY,1,$L(ARRAY)-1)_","
S NODE=ARRAY F S NODE=$Q(@NODE) Q:'$L(NODE) Q:'($E(NODE,1,$L(ARRAY))=ARRAY) W !,NODE," = ",@NODE
Q
;
LOGAL(OCXR0,OCXR1,OCXN,OCXDFN,OCXNUM,OCXADUZ,OCXPMSG,OCXPDATA) ;
;
; OCXR0: Rule IEN
; OCXR1: Relation IEN
; OCXN: notification identifier (required)
; OCXDFN: patient identifier (required)
; OCXNUM: order number - used to determine ordering provider
; OCXADUZ: array of package-identified recipients
; OCXPMSG: package-defined message
; OCXPDATA: package-defined data for follow-up action
;
I $G(OCXR0),$G(OCXR1) S ^TMP("OCXDEBUG",$J,+OCXR0,+OCXR1)=$G(^TMP("OCXDEBUG",$J,+OCXR0,+OCXR1))+1
;
Q
;
READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
N OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
Q:'$L($G(OCXZ0)) U
S DIR(0)=OCXZ0
S:$L($G(OCXZA)) DIR("A")=OCXZA
S:$L($G(OCXZB)) DIR("B")=OCXZB
F OCXLINE=1:1:($G(OCXZL)-1) W !
D ^DIR
I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) Q U
Q Y
;
TIME ;
;
N OCXD0,OCXT1,OCXT2,OCXT3,OCXTIME,OCXMAX
;
S (OCXMAX,OCXD0)=0 F S OCXD0=$O(^OCXD(861,OCXD0)) Q:'OCXD0 D
.Q:'$D(^OCXD(861,OCXD0,"STATUS"))
.S OCXT1=+$G(^OCXD(861,OCXD0,0))
.S OCXT1=$P(OCXT1,".",2)
.S OCXT1=$E(OCXT1_"000000",1,6)
.S OCXT1=($E(OCXT1,1,2)*3600)+($E(OCXT1,3,4)*60)+($E(OCXT1,5,6))
.S OCXT2=$G(^OCXD(861,OCXD0,"STATUS"))
.S OCXT2=+$P(OCXT2," AT ",2)
.S OCXT2=$P(OCXT2,".",2)
.S OCXT2=$E(OCXT2_"000000",1,6)
.S OCXT2=($E(OCXT2,1,2)*3600)+($E(OCXT2,3,4)*60)+($E(OCXT2,5,6))
.S OCXT3=(OCXT2-OCXT1) Q:(OCXT3<0)
.I (OCXT3>OCXMAX) S OCXMAX=OCXT3_U_OCXD0
.S OCXTIME(OCXT3)=$G(OCXTIME(OCXT3))+1
;
W !!,"Number of seconds",?20,"Number of occurences",!
S OCXT1="" F S OCXT1=$O(OCXTIME(OCXT1)) Q:'$L(OCXT1) D
.I OCXT1 W !,$J(OCXT1,4)
.E W !,"Less than 1 second"
.W ?20,$J(+$G(OCXTIME(OCXT1)),6)
I $P(OCXMAX,U,2) W !!,"Maximum wait: ",+OCXMAX," second(s). Log entry: ",$P(OCXMAX,U,2)
;
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOCXDEBUG 6255 printed Dec 13, 2024@02:22:32 Page 2
OCXDEBUG ;SLC/RJS,CLA - ORDER CHECK COMPILED CODE DEBUGGER (SINGLE/MULTI);10/29/98 12:37
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
SINGLE ;
+1 ;
+2 NEW OCXOLOG,IOP
+3 ;
+4 IF '$ORDER(^OCXD(861,1))
WRITE !!,"No entries in the raw data log..."
QUIT
+5 ;
+6 KILL ^TMP("OCXDEBUG",$JOB)
+7 SET ^TMP("OCXDEBUG",$JOB)=($PIECE($HOROLOG,",",2)+($HOROLOG*86400)+(4*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
+8 SET IOP=0
DO ^%ZIS
KILL IOP
SET X=132
USE IO
XECUTE ^%ZOSF("RM")
+9 ;
+10 FOR
WRITE !!
SET OCXOLOG=+$$LOOKUP("Select Log entry number: ")
if 'OCXOLOG
QUIT
DO RUN(OCXOLOG,$$ASKFLAG,$$ASKPURG)
DO REPORT
+11 QUIT
+12 ;
ASKFLAG() QUIT ('$$READ("Y","Do you want to send any alerts generated ","NO")*10)+1
+1 ;
ASKPURG() QUIT $$READ("Y","Do you want purge rule events ","NO")
+1 ;
SMOKE(OCXTRACE) ;
+1 NEW OCXOLOG,OCXP,OCX1,OCX2,OCX3
+2 ;
+3 IF '$ORDER(^OCXD(861,1))
WRITE !!,"No entries in the raw data log..."
QUIT
+4 if '$LENGTH($GET(OCXTRACE))
SET OCXTRACE=11
+5 ;
+6 WRITE !
+7 WRITE !,"First Entry: ",+$ORDER(^OCXD(861,1))
+8 WRITE !,"Last Entry: ",+$ORDER(^OCXD(861," "),-1)
+9 KILL ^TMP("OCXDEBUG",$JOB)
+10 SET ^TMP("OCXDEBUG",$JOB)=($PIECE($HOROLOG,",",2)+($HOROLOG*86400)+(4*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
+11 SET IOP=0
DO ^%ZIS
KILL IOP
SET X=132
USE IO
XECUTE ^%ZOSF("RM")
+12 ;
+13 SET OCXP=$$ASKPURG
+14 SET OCX1=$$LOOKUP("Start at Log Number: ")
+15 SET OCX2=$$LOOKUP(" Stop at Log Number: ")
+16 if (OCX1>OCX2)
SET OCX3=OCX2
SET OCX2=OCX1
SET OCX1=OCX3
+17 SET OCXOLOG=OCX1
Begin DoDot:1
+18 WRITE @IOF
DO RUN(OCXOLOG,OCXTRACE,OCXP)
End DoDot:1
FOR
SET OCXOLOG=$ORDER(^OCXD(861,OCXOLOG))
if 'OCXOLOG
QUIT
if (OCXOLOG>OCX2)
QUIT
Begin DoDot:1
End DoDot:1
+19 DO ^%ZIS
+20 USE IO
DO REPORT
DO ^%ZISC
+21 QUIT
+22 ;
REPORT ;
+1 NEW OCXD0,OCXD1
+2 IF '$ORDER(^TMP("OCXDEBUG",$JOB,0))
WRITE !!,"No rules triggered.",!!
QUIT
+3 WRITE !!,"************* Rules triggered ****************",!
+4 SET OCXD0=0
FOR
SET OCXD0=$ORDER(^TMP("OCXDEBUG",$JOB,OCXD0))
if 'OCXD0
QUIT
Begin DoDot:1
+5 SET OCXD1=0
FOR
SET OCXD1=$ORDER(^TMP("OCXDEBUG",$JOB,OCXD0,OCXD1))
if 'OCXD1
QUIT
Begin DoDot:2
+6 WRITE !,"Rule: (",(+OCXD0),") ",$PIECE($GET(^OCXS(860.2,+OCXD0,0)),U,1)
+7 WRITE !,"Relation: (",(+OCXD1),") ",$GET(^OCXS(860.2,+OCXD0,"R",+OCXD1,"E"))
+8 WRITE !," Number triggered: ",+$GET(^TMP("OCXDEBUG",$JOB,OCXD0,OCXD1))
+9 WRITE !
End DoDot:2
End DoDot:1
+10 QUIT
+11 ;
RUN(OCXDEBUG,OCXTRACE,OCXPURGE) ;
+1 ;
+2 if '$DATA(^OCXD(861,OCXDEBUG))
QUIT
if '$DATA(^OCXD(861,OCXDEBUG,"SOURCE"))
QUIT
+3 ;
+4 NEW OCXA,OCXAR,OCXD0
+5 ;
+6 MERGE OCXA=^OCXD(861,OCXDEBUG)
+7 ;
+8 WRITE !,"RUN: ",OCXDEBUG," ",OCXA("SOURCE")
+9 ;
+10 IF OCXPURGE
Begin DoDot:1
+11 NEW DFN
SET DFN=+$PIECE($GET(OCXA("PATIENT")),"[",2)
if 'DFN
QUIT
+12 KILL ^OCXD(860.7,DFN,1)
+13 KILL ^OCXD(860.7,"AT",+$HOROLOG,DFN)
End DoDot:1
+14 ;
+15 IF (OCXA("SOURCE")="HL7")
Begin DoDot:1
+16 SET OCXAR=OCXA("ARRAY")
+17 IF '(OCXAR[U)
NEW @OCXAR
+18 NEW OCXDBMSG
+19 SET OCXD0=0
FOR
SET OCXD0=$ORDER(OCXA("DATA",OCXD0))
if 'OCXD0
QUIT
Begin DoDot:2
+20 NEW LAST,TEXT
+21 SET LAST=$ORDER(@OCXAR@(" "),-1)
+22 SET TEXT=OCXA("DATA",OCXD0,0)
+23 IF LAST
IF ($EXTRACT(TEXT,1,3)=">>>")
SET TEXT=$EXTRACT(TEXT,4,$LENGTH(TEXT))
+24 IF '$TEST
SET LAST=LAST+1
+25 SET @OCXAR@(LAST)=$GET(@OCXAR@(LAST))_TEXT
End DoDot:2
+26 SET OCXDBMSG=""
+27 WRITE !!
+28 IF '(OCXAR[U)
XECUTE "D SILENT^OCXOHL7(."_OCXAR_",.OCXDBMSG)"
IF 1
+29 IF '$TEST
DO SILENT^OCXOHL7(.OCXAR,.OCXDBMSG)
+30 IF ($DATA(OCXDBMSG)>1)
DO ZW("OCXDBMSG")
+31 IF (OCXAR[U)
KILL @OCXAR
End DoDot:1
QUIT
+32 ;
+33 IF (OCXA("SOURCE")="DGPM")
Begin DoDot:1
+34 NEW DGPM0,DGPMA,DGPMDA,DFN,OCXDBMSG
+35 SET OCXD0=0
FOR
SET OCXD0=$ORDER(OCXA("DATA",OCXD0))
if 'OCXD0
QUIT
Begin DoDot:2
+36 NEW TEXT
SET TEXT=OCXA("DATA",OCXD0,0)
+37 SET @$PIECE(TEXT,"=",1)=$PIECE(TEXT,"=",2,999)
End DoDot:2
+38 SET DFN=+$PIECE($GET(OCXA("PATIENT")),"[",2)
+39 SET OCXDBMSG=""
+40 WRITE !!
DO SILENT^OCXODGPM(.OCXDBMSG)
+41 IF ($DATA(OCXDBMSG)>1)
DO ZW("OCXDBMSG")
End DoDot:1
QUIT
+42 ;
+43 IF (OCXA("SOURCE")="OEPS")
Begin DoDot:1
+44 NEW OCXPSD,OCXPSM,DFN,OCXDBMSG
+45 SET OCXD0=0
FOR
SET OCXD0=$ORDER(OCXA("DATA",OCXD0))
if 'OCXD0
QUIT
Begin DoDot:2
+46 NEW TEXT
SET TEXT=OCXA("DATA",OCXD0,0)
+47 SET @$PIECE(TEXT,"=",1)=$PIECE(TEXT,"=",2,999)
End DoDot:2
+48 SET DFN=+$PIECE($GET(OCXA("PATIENT")),"[",2)
+49 SET OCXDBMSG=""
+50 ;
WRITE !
DO EN^OCXOEPS(.OCXDBMSG,DFN,OCXPSD,OCXPSM)
+51 IF ($DATA(OCXDBMSG)>1)
DO ZW("OCXDBMSG")
End DoDot:1
QUIT
+52 ;
+53 IF (OCXA("SOURCE")="OERR")
Begin DoDot:1
+54 NEW OCXORD,DFN,OCXDBMSG
+55 SET OCXD0=0
FOR
SET OCXD0=$ORDER(OCXA("DATA",OCXD0))
if 'OCXD0
QUIT
Begin DoDot:2
+56 NEW TEXT
SET TEXT=OCXA("DATA",OCXD0,0)
+57 SET @$PIECE(TEXT,"=",1)=$PIECE(TEXT,"=",2,999)
End DoDot:2
+58 SET DFN=+$PIECE($GET(OCXA("PATIENT")),"[",2)
+59 SET OCXDBMSG=""
+60 ;
WRITE !
DO SILENT^OCXOERR(OCXORD,.OCXDBMSG)
+61 IF ($DATA(OCXDBMSG)>1)
DO ZW("OCXDBMSG")
End DoDot:1
QUIT
+62 QUIT
+63 ;
LOOKUP(OCXDLG) ;
+1 ;
+2 NEW DIC,X,Y
+3 if $LENGTH($GET(OCXDLG))
SET DIC("A")=OCXDLG
+4 SET DIC="^OCXD(861,"
SET DIC(0)="AMNEQ"
+5 SET DIC("S")="I (Y>1)"
+6 SET DIC("W")="W "" "",$G(^(""SOURCE"")),"" "",$G(^(""PATIENT""))"
+7 SET Y=0
DO ^DIC
+8 if (Y<0)
QUIT 0
QUIT +Y
+9 ;
ZW(ARRAY) ;
+1 WRITE !,ARRAY
+2 NEW NODE
+3 IF ($DATA(@ARRAY)#10)
WRITE !,ARRAY," = ",@ARRAY
+4 if ($EXTRACT(ARRAY,$LENGTH(ARRAY))=")")
SET ARRAY=$EXTRACT(ARRAY,1,$LENGTH(ARRAY)-1)_","
+5 SET NODE=ARRAY
FOR
SET NODE=$QUERY(@NODE)
if '$LENGTH(NODE)
QUIT
if '($EXTRACT(NODE,1,$LENGTH(ARRAY))=ARRAY)
QUIT
WRITE !,NODE," = ",@NODE
+6 QUIT
+7 ;
LOGAL(OCXR0,OCXR1,OCXN,OCXDFN,OCXNUM,OCXADUZ,OCXPMSG,OCXPDATA) ;
+1 ;
+2 ; OCXR0: Rule IEN
+3 ; OCXR1: Relation IEN
+4 ; OCXN: notification identifier (required)
+5 ; OCXDFN: patient identifier (required)
+6 ; OCXNUM: order number - used to determine ordering provider
+7 ; OCXADUZ: array of package-identified recipients
+8 ; OCXPMSG: package-defined message
+9 ; OCXPDATA: package-defined data for follow-up action
+10 ;
+11 IF $GET(OCXR0)
IF $GET(OCXR1)
SET ^TMP("OCXDEBUG",$JOB,+OCXR0,+OCXR1)=$GET(^TMP("OCXDEBUG",$JOB,+OCXR0,+OCXR1))+1
+12 ;
+13 QUIT
+14 ;
READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
+1 NEW OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
+2 if '$LENGTH($GET(OCXZ0))
QUIT U
+3 SET DIR(0)=OCXZ0
+4 if $LENGTH($GET(OCXZA))
SET DIR("A")=OCXZA
+5 if $LENGTH($GET(OCXZB))
SET DIR("B")=OCXZB
+6 FOR OCXLINE=1:1:($GET(OCXZL)-1)
WRITE !
+7 DO ^DIR
+8 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT U
+9 QUIT Y
+10 ;
TIME ;
+1 ;
+2 NEW OCXD0,OCXT1,OCXT2,OCXT3,OCXTIME,OCXMAX
+3 ;
+4 SET (OCXMAX,OCXD0)=0
FOR
SET OCXD0=$ORDER(^OCXD(861,OCXD0))
if 'OCXD0
QUIT
Begin DoDot:1
+5 if '$DATA(^OCXD(861,OCXD0,"STATUS"))
QUIT
+6 SET OCXT1=+$GET(^OCXD(861,OCXD0,0))
+7 SET OCXT1=$PIECE(OCXT1,".",2)
+8 SET OCXT1=$EXTRACT(OCXT1_"000000",1,6)
+9 SET OCXT1=($EXTRACT(OCXT1,1,2)*3600)+($EXTRACT(OCXT1,3,4)*60)+($EXTRACT(OCXT1,5,6))
+10 SET OCXT2=$GET(^OCXD(861,OCXD0,"STATUS"))
+11 SET OCXT2=+$PIECE(OCXT2," AT ",2)
+12 SET OCXT2=$PIECE(OCXT2,".",2)
+13 SET OCXT2=$EXTRACT(OCXT2_"000000",1,6)
+14 SET OCXT2=($EXTRACT(OCXT2,1,2)*3600)+($EXTRACT(OCXT2,3,4)*60)+($EXTRACT(OCXT2,5,6))
+15 SET OCXT3=(OCXT2-OCXT1)
if (OCXT3<0)
QUIT
+16 IF (OCXT3>OCXMAX)
SET OCXMAX=OCXT3_U_OCXD0
+17 SET OCXTIME(OCXT3)=$GET(OCXTIME(OCXT3))+1
End DoDot:1
+18 ;
+19 WRITE !!,"Number of seconds",?20,"Number of occurences",!
+20 SET OCXT1=""
FOR
SET OCXT1=$ORDER(OCXTIME(OCXT1))
if '$LENGTH(OCXT1)
QUIT
Begin DoDot:1
+21 IF OCXT1
WRITE !,$JUSTIFY(OCXT1,4)
+22 IF '$TEST
WRITE !,"Less than 1 second"
+23 WRITE ?20,$JUSTIFY(+$GET(OCXTIME(OCXT1)),6)
End DoDot:1
+24 IF $PIECE(OCXMAX,U,2)
WRITE !!,"Maximum wait: ",+OCXMAX," second(s). Log entry: ",$PIECE(OCXMAX,U,2)
+25 ;
+26 QUIT
+27 ;