DVBCTOG ;ALB/FSB - TOGGLE RPCS ROUTINE; APR 18, 2022@11:00
;;2.7;AMIE;**238**;Apr 10, 1995;Build 16
;
Q
;
CLNDCURL(DVBURLS) ;
;obtain URL parameters and priority
; DVBURLS(0) node will return the PIV URL
; DVBURLS(1) node will return the proxy URL
; DVBURLS(2) node will return the priority
; DVBURLS(3) node will return the snippet of the PIV resource URL
; DVBURLS(4) node will return the snippet of the proxy resource URL
; if any of these nodes returns null then the parameter does not exist or the value is null
N DVBPVURL,DVBPXURL,DVBPRIO,DVBPVRES,DVBPXRES
S DVBPVURL=$$GET^XPAR("PKG","DVBAB CAPRI PIV URL",1,"Q")
S DVBPXURL=$$GET^XPAR("PKG","DVBAB CAPRI PROXY URL",1,"Q")
S DVBPRIO=$$GET^XPAR("PKG","DVBAB TRANSMISSION PRIORITY",1,"Q")
S DVBPVRES=$$GET^XPAR("PKG","DVBAB PIV RESOURCE",1,"Q")
S DVBPXRES=$$GET^XPAR("PKG","DVBAB PROXY RESOURCE",1,"Q")
S DVBURLS(0)=DVBPVURL,DVBURLS(1)=DVBPXURL,DVBURLS(2)=DVBPRIO,DVBURLS(3)=DVBPVRES,DVBURLS(4)=DVBPXRES
Q
GETTOG(DVBVALUE,DVBTOG) ;
;this returns the internal value of any parameter that meets the following criteria:
; Entity defined is a package
; Instance does not apply
I $G(DVBTOG)="" S DVBVALUE="" Q
S DVBVALUE=$$GET^XPAR("PKG",DVBTOG,1,"Q")
Q
TRDATE ; TRANSMISSION DATE INPUT FROM USER THROUGH VISTA
N DVBSDT,DVBEDT,DIRUT,DTOUT,DUOUT,X,Y
D EN^DDIOL("CAPRI Metrics Data Report","","?25"),EN^DDIOL("","","!!")
K DIR,X,Y
S DIR(0)="DA^:DT:EX",DIR("A")="Enter Start Date (Oldest): "
S DIR("??")="Enter the earliest date from when you want this report to start"
D ^DIR K DIR Q:$D(DIRUT)!($D(DTOUT))
S DVBSDT=Y
;
K DIR,X,Y
S DIR(0)="DAO^:DT:EX",DIR("A")="Enter End Date (Newest) or Press Enter: "
S DIR("??")="Enter the latest date from when you want this report to end"
D ^DIR K DIR Q:$D(DUOUT)!($D(DTOUT))
S DVBEDT=Y
I Y="" S DVBEDT=DVBSDT
I DVBSDT>DVBEDT D EN^DDIOL("Start date cannot be greater than the end date.","","!!"),EN^DDIOL("","","!!"),TRDATE Q
D METRPT(,DVBSDT,DVBEDT)
Q
RPCENTRY(DVBDATA,DVBSDT,DVBEDT) ; ENTRY POINT FOR RPC
S X=$G(DVBSDT) D ^%DT S DVBSDT=Y
I DVBSDT=-1 S DVBDATA(0)="Beginning date was not entered." Q
I $G(DVBEDT)="" S DVBEDT=DVBSDT
E S X=DVBEDT D ^%DT S DVBEDT=Y
D METRPT(.DVBDATA,DVBSDT,DVBEDT,1)
Q
METRPT(DVBDATA,DVBSDT,DVBEDT,DVBFLAG) ; TRANSMISSION METRICS DATA REPORT
N DVBFLD,DVBBRD,DVBREC,DVBAS,DVBPAT,DVBTP,DVBTS,DVBERRC,DVBRPTD,DVBDT,DVBSCS,DVBFAIL,DVBSREC,DVBPG,DVBDTI,DVBHDR
I $G(DVBFLAG)="" S DVBFLAG=0
S DVBSCS=0,DVBFAIL=0,DVBPG=0
S DVBREC=0 F S DVBREC=$O(^DVB(396.21,DVBREC)) Q:'+DVBREC D
.S DVBHDR="Transmission Metrics Data Report"
.S DVBDTI=$P($G(^DVB(396.21,DVBREC,0)),"^",1),DVBDT=$$FMTE^XLFDT(DVBDTI),DVBDTI=$P(DVBDTI,".",1)
.I DVBDTI>=DVBSDT&(DVBDTI<=DVBEDT) D
..S DVBAS=$$GET1^DIQ(200,$P(^DVB(396.21,DVBREC,0),"^",2),.01) ;getting Authorized Sender name
..S DVBPAT=$$GET1^DIQ(2,$P(^DVB(396.21,DVBREC,0),"^",3),.01) ;getting Patient name
..S DVBTP=$$UP^XLFSTR($P($G(^DVB(396.21,DVBREC,0)),"^",4))
..S DVBTS=$P($G(^DVB(396.21,DVBREC,0)),"^",5) D
...I DVBTS=1 S DVBSCS=DVBSCS+1
...I DVBTS=0 S DVBFAIL=DVBFAIL+1
..I DVBTS=1 S DVBTS="Success"
..I DVBTS=0 S DVBTS="Fail"
..S DVBERRC=$P($G(^DVB(396.21,DVBREC,1)),"^",1)
..S DVBSREC=0,DVBRPTD="" F S DVBSREC=$O(^DVB(396.21,DVBREC,2,DVBSREC)) Q:'+DVBSREC D
...I DVBRPTD'="" S DVBRPTD=DVBRPTD_", "_$P($G(^DVB(396.21,DVBREC,2,DVBSREC,0)),"^",1)
...I DVBRPTD="" S DVBRPTD=$P($G(^DVB(396.21,DVBREC,2,DVBSREC,0)),"^",1)
..S DVBFLD(1)="TRANSMISSION DATE/TIME: "_DVBDT,DVBFLD(2)="AUTHORIZED SENDER: "_DVBAS,DVBFLD(3)="PATIENT: "_DVBPAT,DVBFLD(4)="TRANSMISSION PATH: "_DVBTP
..S DVBFLD(5)="TRANSMISSION STATUS: "_DVBTS,DVBFLD(6)="ERROR CODE: "_DVBERRC,DVBFLD(7)="REPORT DETAILS: "_DVBRPTD
..S DVBFLD(1,"F")="!!",DVBFLD(2,"F")="!!",DVBFLD(3,"F")="?40",DVBFLD(4,"F")="!",DVBFLD(5,"F")="!",DVBFLD(6,"F")="?40",DVBFLD(7,"F")="!"
..S DVBPG=DVBPG+1
..S DVBDATA(DVBPG)=DVBDT_"^"_DVBAS_"^"_DVBPAT_"^"_DVBTP_"^"_DVBTS_"^"_DVBERRC_"^"_DVBRPTD
..S DVBBRD=$$REPEAT^XLFSTR("-",80)
..I DVBFLAG=0 D EN^DDIOL(DVBHDR,"","!?25"),EN^DDIOL("Page "_DVBPG,"","?70"),EN^DDIOL(.DVBFLD),EN^DDIOL(DVBBRD)
I DVBPG=0,DVBFLAG=0 S DVBDATA(0)="No metrics found." D EN^DDIOL(DVBDATA(0),"","!!")
S DVBDATA(DVBPG+1)="Success Count: "_DVBSCS,DVBDATA(DVBPG+2)="Fail Count: "_DVBFAIL
I DVBFLAG=0 D EN^DDIOL("Success Count: "_DVBSCS,"","!"),EN^DDIOL("Fail Count: "_DVBFAIL,"","!")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBCTOG 4493 printed Dec 13, 2024@01:48:56 Page 2
DVBCTOG ;ALB/FSB - TOGGLE RPCS ROUTINE; APR 18, 2022@11:00
+1 ;;2.7;AMIE;**238**;Apr 10, 1995;Build 16
+2 ;
+3 QUIT
+4 ;
CLNDCURL(DVBURLS) ;
+1 ;obtain URL parameters and priority
+2 ; DVBURLS(0) node will return the PIV URL
+3 ; DVBURLS(1) node will return the proxy URL
+4 ; DVBURLS(2) node will return the priority
+5 ; DVBURLS(3) node will return the snippet of the PIV resource URL
+6 ; DVBURLS(4) node will return the snippet of the proxy resource URL
+7 ; if any of these nodes returns null then the parameter does not exist or the value is null
+8 NEW DVBPVURL,DVBPXURL,DVBPRIO,DVBPVRES,DVBPXRES
+9 SET DVBPVURL=$$GET^XPAR("PKG","DVBAB CAPRI PIV URL",1,"Q")
+10 SET DVBPXURL=$$GET^XPAR("PKG","DVBAB CAPRI PROXY URL",1,"Q")
+11 SET DVBPRIO=$$GET^XPAR("PKG","DVBAB TRANSMISSION PRIORITY",1,"Q")
+12 SET DVBPVRES=$$GET^XPAR("PKG","DVBAB PIV RESOURCE",1,"Q")
+13 SET DVBPXRES=$$GET^XPAR("PKG","DVBAB PROXY RESOURCE",1,"Q")
+14 SET DVBURLS(0)=DVBPVURL
SET DVBURLS(1)=DVBPXURL
SET DVBURLS(2)=DVBPRIO
SET DVBURLS(3)=DVBPVRES
SET DVBURLS(4)=DVBPXRES
+15 QUIT
GETTOG(DVBVALUE,DVBTOG) ;
+1 ;this returns the internal value of any parameter that meets the following criteria:
+2 ; Entity defined is a package
+3 ; Instance does not apply
+4 IF $GET(DVBTOG)=""
SET DVBVALUE=""
QUIT
+5 SET DVBVALUE=$$GET^XPAR("PKG",DVBTOG,1,"Q")
+6 QUIT
TRDATE ; TRANSMISSION DATE INPUT FROM USER THROUGH VISTA
+1 NEW DVBSDT,DVBEDT,DIRUT,DTOUT,DUOUT,X,Y
+2 DO EN^DDIOL("CAPRI Metrics Data Report","","?25")
DO EN^DDIOL("","","!!")
+3 KILL DIR,X,Y
+4 SET DIR(0)="DA^:DT:EX"
SET DIR("A")="Enter Start Date (Oldest): "
+5 SET DIR("??")="Enter the earliest date from when you want this report to start"
+6 DO ^DIR
KILL DIR
if $DATA(DIRUT)!($DATA(DTOUT))
QUIT
+7 SET DVBSDT=Y
+8 ;
+9 KILL DIR,X,Y
+10 SET DIR(0)="DAO^:DT:EX"
SET DIR("A")="Enter End Date (Newest) or Press Enter: "
+11 SET DIR("??")="Enter the latest date from when you want this report to end"
+12 DO ^DIR
KILL DIR
if $DATA(DUOUT)!($DATA(DTOUT))
QUIT
+13 SET DVBEDT=Y
+14 IF Y=""
SET DVBEDT=DVBSDT
+15 IF DVBSDT>DVBEDT
DO EN^DDIOL("Start date cannot be greater than the end date.","","!!")
DO EN^DDIOL("","","!!")
DO TRDATE
QUIT
+16 DO METRPT(,DVBSDT,DVBEDT)
+17 QUIT
RPCENTRY(DVBDATA,DVBSDT,DVBEDT) ; ENTRY POINT FOR RPC
+1 SET X=$GET(DVBSDT)
DO ^%DT
SET DVBSDT=Y
+2 IF DVBSDT=-1
SET DVBDATA(0)="Beginning date was not entered."
QUIT
+3 IF $GET(DVBEDT)=""
SET DVBEDT=DVBSDT
+4 IF '$TEST
SET X=DVBEDT
DO ^%DT
SET DVBEDT=Y
+5 DO METRPT(.DVBDATA,DVBSDT,DVBEDT,1)
+6 QUIT
METRPT(DVBDATA,DVBSDT,DVBEDT,DVBFLAG) ; TRANSMISSION METRICS DATA REPORT
+1 NEW DVBFLD,DVBBRD,DVBREC,DVBAS,DVBPAT,DVBTP,DVBTS,DVBERRC,DVBRPTD,DVBDT,DVBSCS,DVBFAIL,DVBSREC,DVBPG,DVBDTI,DVBHDR
+2 IF $GET(DVBFLAG)=""
SET DVBFLAG=0
+3 SET DVBSCS=0
SET DVBFAIL=0
SET DVBPG=0
+4 SET DVBREC=0
FOR
SET DVBREC=$ORDER(^DVB(396.21,DVBREC))
if '+DVBREC
QUIT
Begin DoDot:1
+5 SET DVBHDR="Transmission Metrics Data Report"
+6 SET DVBDTI=$PIECE($GET(^DVB(396.21,DVBREC,0)),"^",1)
SET DVBDT=$$FMTE^XLFDT(DVBDTI)
SET DVBDTI=$PIECE(DVBDTI,".",1)
+7 IF DVBDTI>=DVBSDT&(DVBDTI<=DVBEDT)
Begin DoDot:2
+8 ;getting Authorized Sender name
SET DVBAS=$$GET1^DIQ(200,$PIECE(^DVB(396.21,DVBREC,0),"^",2),.01)
+9 ;getting Patient name
SET DVBPAT=$$GET1^DIQ(2,$PIECE(^DVB(396.21,DVBREC,0),"^",3),.01)
+10 SET DVBTP=$$UP^XLFSTR($PIECE($GET(^DVB(396.21,DVBREC,0)),"^",4))
+11 SET DVBTS=$PIECE($GET(^DVB(396.21,DVBREC,0)),"^",5)
Begin DoDot:3
+12 IF DVBTS=1
SET DVBSCS=DVBSCS+1
+13 IF DVBTS=0
SET DVBFAIL=DVBFAIL+1
End DoDot:3
+14 IF DVBTS=1
SET DVBTS="Success"
+15 IF DVBTS=0
SET DVBTS="Fail"
+16 SET DVBERRC=$PIECE($GET(^DVB(396.21,DVBREC,1)),"^",1)
+17 SET DVBSREC=0
SET DVBRPTD=""
FOR
SET DVBSREC=$ORDER(^DVB(396.21,DVBREC,2,DVBSREC))
if '+DVBSREC
QUIT
Begin DoDot:3
+18 IF DVBRPTD'=""
SET DVBRPTD=DVBRPTD_", "_$PIECE($GET(^DVB(396.21,DVBREC,2,DVBSREC,0)),"^",1)
+19 IF DVBRPTD=""
SET DVBRPTD=$PIECE($GET(^DVB(396.21,DVBREC,2,DVBSREC,0)),"^",1)
End DoDot:3
+20 SET DVBFLD(1)="TRANSMISSION DATE/TIME: "_DVBDT
SET DVBFLD(2)="AUTHORIZED SENDER: "_DVBAS
SET DVBFLD(3)="PATIENT: "_DVBPAT
SET DVBFLD(4)="TRANSMISSION PATH: "_DVBTP
+21 SET DVBFLD(5)="TRANSMISSION STATUS: "_DVBTS
SET DVBFLD(6)="ERROR CODE: "_DVBERRC
SET DVBFLD(7)="REPORT DETAILS: "_DVBRPTD
+22 SET DVBFLD(1,"F")="!!"
SET DVBFLD(2,"F")="!!"
SET DVBFLD(3,"F")="?40"
SET DVBFLD(4,"F")="!"
SET DVBFLD(5,"F")="!"
SET DVBFLD(6,"F")="?40"
SET DVBFLD(7,"F")="!"
+23 SET DVBPG=DVBPG+1
+24 SET DVBDATA(DVBPG)=DVBDT_"^"_DVBAS_"^"_DVBPAT_"^"_DVBTP_"^"_DVBTS_"^"_DVBERRC_"^"_DVBRPTD
+25 SET DVBBRD=$$REPEAT^XLFSTR("-",80)
+26 IF DVBFLAG=0
DO EN^DDIOL(DVBHDR,"","!?25")
DO EN^DDIOL("Page "_DVBPG,"","?70")
DO EN^DDIOL(.DVBFLD)
DO EN^DDIOL(DVBBRD)
End DoDot:2
End DoDot:1
+27 IF DVBPG=0
IF DVBFLAG=0
SET DVBDATA(0)="No metrics found."
DO EN^DDIOL(DVBDATA(0),"","!!")
+28 SET DVBDATA(DVBPG+1)="Success Count: "_DVBSCS
SET DVBDATA(DVBPG+2)="Fail Count: "_DVBFAIL
+29 IF DVBFLAG=0
DO EN^DDIOL("Success Count: "_DVBSCS,"","!")
DO EN^DDIOL("Fail Count: "_DVBFAIL,"","!")
+30 QUIT