BEHOOUS ; IHS/MSC/MGH - RPC functions which return user alert ;12-Mar-2013 13:45;DU
;;1.1;BEH COMPONENTS;;****;Build 1
;
;
KILUNSNO(Y,ORVP) ; Delete unsigned order alerts if no unsigned orders remaining
S ORVP=ORVP_";DPT("
D UNOTIF
Q
;
UNOTIF ; -- Undo unsigned SS notification
;Check for the type of unsigned order, We only want surescripts ones
N INVDT,ORD,CNT,RR
S CNT=0
S INVDT="" F S INVDT=$O(^OR(100,"AS",ORVP,INVDT)) Q:'+INVDT D
.S ORD="" F S ORD=$O(^OR(100,"AS",ORVP,INVDT,ORD)) Q:'+ORD D
..S RR=$$VALUE^ORCSAVE2(+ORD,"SSRREQIEN")
..I +RR S CNT=CNT+1
I CNT=0 D DELETE
Q
DELETE ;Delete alert
N XQAKILL,ORNIFN
S ORNIFN=$O(^ORD(100.9,"B","SS REFILL REQUEST SIGNATURE",0))
S XQAKILL=$$XQAKILL^ORB3F1(ORNIFN) ; unsigned orders notif
I $D(XQAID),$P($P(XQAID,";"),",",3)=ORNIFN D DELETE^XQALERT
I '$D(XQAID) S XQAID=$P($G(^ORD(100.9,ORNIFN,0)),U,2)_","_+ORVP_","_ORNIFN D DELETEA^XQALERT K XQAID
Q
BEHOOUS ; IHS/MSC/MGH - RPC functions which return user alert ;12-Mar-2013 13:45;DU
+1 ;;1.1;BEH COMPONENTS;;****;Build 1
+2 ;
+3 ;
KILUNSNO(Y,ORVP) ; Delete unsigned order alerts if no unsigned orders remaining
+1 SET ORVP=ORVP_";DPT("
+2 DO UNOTIF
+3 QUIT
+4 ;
UNOTIF ; -- Undo unsigned SS notification
+1 ;Check for the type of unsigned order, We only want surescripts ones
+2 NEW INVDT,ORD,CNT,RR
+3 SET CNT=0
+4 SET INVDT=""
FOR
SET INVDT=$ORDER(^OR(100,"AS",ORVP,INVDT))
IF '+INVDT
QUIT
Begin DoDot:1
+5 SET ORD=""
FOR
SET ORD=$ORDER(^OR(100,"AS",ORVP,INVDT,ORD))
IF '+ORD
QUIT
Begin DoDot:2
+6 SET RR=$$VALUE^ORCSAVE2(+ORD,"SSRREQIEN")
+7 IF +RR
SET CNT=CNT+1
End DoDot:2
End DoDot:1
+8 IF CNT=0
DO DELETE
+9 QUIT
DELETE ;Delete alert
+1 NEW XQAKILL,ORNIFN
+2 SET ORNIFN=$ORDER(^ORD(100.9,"B","SS REFILL REQUEST SIGNATURE",0))
+3 ; unsigned orders notif
SET XQAKILL=$$XQAKILL^ORB3F1(ORNIFN)
+4 IF $DATA(XQAID)
IF $PIECE($PIECE(XQAID,";"),",",3)=ORNIFN
DO DELETE^XQALERT
+5 IF '$DATA(XQAID)
SET XQAID=$PIECE($GET(^ORD(100.9,ORNIFN,0)),U,2)_","_+ORVP_","_ORNIFN
DO DELETEA^XQALERT
KILL XQAID
+6 QUIT