DVBASRP1 ;GT- CAPRI SURGERY CASE LOOKUP ; 5/13/2002
;;2.7;AMIE;**42**;Apr 10, 1995
STATUS ; print case status
I $P($G(^SRF(VAR,30)),"^")'="" D CAN Q
I $P($G(^SRF(VAR,31)),"^",8)'="" D CAN Q
I $P($G(^SRF(VAR,.2)),"^",12) S DVBSROP=DVBSROP_"^"_"(COMPLETED)" Q
I $D(^SRF(VAR,.2)),$P(^(.2),"^",12)="" S DVBSTAT=0 D SCH I DVBSTATS=0 D REQ Q:DVBSTATS G NO
I '$D(^SRF(VAR,.2)) S DVBSTAT=0 D SCH I DVBSTATS=0 D REQ Q:DVBSTATS=1 G NO
Q
NO ; not requested or scheduled
S DVBSROP=DVBSROP_"^"_"(NOT COMPLETE)"
Q
CAN ; cancelled or aborted
S SR(.2)=$G(^SRF(VAR,.2)) I $P(SR(.2),"^")!($P(SR(.2),"^",10)) S DVBSROP=DVBSROP_"^"_"(ABORTED)" Q
S DVBSROP=DVBSROP_"^"_"(CANCELLED)"
Q
SCH ; check to see if case is scheduled
I '$D(^SRF(VAR,31)) S DVBSTATS=0 Q
I $P($G(^SRF(VAR,31)),"^",4)="" S DVBSTATS=0 Q
I $P($G(^SRF(VAR,31)),"^",4) D:DVBSTAT=0 TIM0 D:DVBSTAT=1 TIM1 S DVBSTATS=1 Q
Q
TIM0 I '$D(^SRF(VAR,.2)) S DVBSROP=DVBSROP_"^"_"(SCHEDULED)" Q
I $P(^SRF(VAR,.2),"^",2) S DVBSROP=DVBSROP_"^"_"(NOT COMPLETE)" Q
I $P(^SRF(VAR,.2),"^",2)="" S DVBSROP=DVBSROP_"^"_"(SCHEDULED)"
Q
TIM1 S DVBSROP=DVBSROP_"^"_"(SCHEDULED)" Q
REQ ; check to see if case has been requested
I $D(^SRF(VAR,"REQ")),$P(^("REQ"),"^")=1,'$D(^SRF(VAR,.2)) S DVBSROP=DVBSROP_"^"_" (REQUESTED)" S DVBSTATS=1 Q
I $D(^SRF(VAR,"REQ")),$P(^("REQ"),"^")=1,$D(^SRF(VAR,.2)),$P(^(.2),"^",2)="" S DVBSROP=DVBSROP_"^"_"(REQUESTED)" S DVBSTATS=1
Q
ABORT ; aborted case
S DVBABORT=0 I $D(^SRF(VAR,.2)),$P(^(.2),"^",10)'="" S DVBABORT=1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBASRP1 1537 printed Oct 16, 2024@17:43:05 Page 2
DVBASRP1 ;GT- CAPRI SURGERY CASE LOOKUP ; 5/13/2002
+1 ;;2.7;AMIE;**42**;Apr 10, 1995
STATUS ; print case status
+1 IF $PIECE($GET(^SRF(VAR,30)),"^")'=""
DO CAN
QUIT
+2 IF $PIECE($GET(^SRF(VAR,31)),"^",8)'=""
DO CAN
QUIT
+3 IF $PIECE($GET(^SRF(VAR,.2)),"^",12)
SET DVBSROP=DVBSROP_"^"_"(COMPLETED)"
QUIT
+4 IF $DATA(^SRF(VAR,.2))
IF $PIECE(^(.2),"^",12)=""
SET DVBSTAT=0
DO SCH
IF DVBSTATS=0
DO REQ
if DVBSTATS
QUIT
GOTO NO
+5 IF '$DATA(^SRF(VAR,.2))
SET DVBSTAT=0
DO SCH
IF DVBSTATS=0
DO REQ
if DVBSTATS=1
QUIT
GOTO NO
+6 QUIT
NO ; not requested or scheduled
+1 SET DVBSROP=DVBSROP_"^"_"(NOT COMPLETE)"
+2 QUIT
CAN ; cancelled or aborted
+1 SET SR(.2)=$GET(^SRF(VAR,.2))
IF $PIECE(SR(.2),"^")!($PIECE(SR(.2),"^",10))
SET DVBSROP=DVBSROP_"^"_"(ABORTED)"
QUIT
+2 SET DVBSROP=DVBSROP_"^"_"(CANCELLED)"
+3 QUIT
SCH ; check to see if case is scheduled
+1 IF '$DATA(^SRF(VAR,31))
SET DVBSTATS=0
QUIT
+2 IF $PIECE($GET(^SRF(VAR,31)),"^",4)=""
SET DVBSTATS=0
QUIT
+3 IF $PIECE($GET(^SRF(VAR,31)),"^",4)
if DVBSTAT=0
DO TIM0
if DVBSTAT=1
DO TIM1
SET DVBSTATS=1
QUIT
+4 QUIT
TIM0 IF '$DATA(^SRF(VAR,.2))
SET DVBSROP=DVBSROP_"^"_"(SCHEDULED)"
QUIT
+1 IF $PIECE(^SRF(VAR,.2),"^",2)
SET DVBSROP=DVBSROP_"^"_"(NOT COMPLETE)"
QUIT
+2 IF $PIECE(^SRF(VAR,.2),"^",2)=""
SET DVBSROP=DVBSROP_"^"_"(SCHEDULED)"
+3 QUIT
TIM1 SET DVBSROP=DVBSROP_"^"_"(SCHEDULED)"
QUIT
REQ ; check to see if case has been requested
+1 IF $DATA(^SRF(VAR,"REQ"))
IF $PIECE(^("REQ"),"^")=1
IF '$DATA(^SRF(VAR,.2))
SET DVBSROP=DVBSROP_"^"_" (REQUESTED)"
SET DVBSTATS=1
QUIT
+2 IF $DATA(^SRF(VAR,"REQ"))
IF $PIECE(^("REQ"),"^")=1
IF $DATA(^SRF(VAR,.2))
IF $PIECE(^(.2),"^",2)=""
SET DVBSROP=DVBSROP_"^"_"(REQUESTED)"
SET DVBSTATS=1
+3 QUIT
ABORT ; aborted case
+1 SET DVBABORT=0
IF $DATA(^SRF(VAR,.2))
IF $PIECE(^(.2),"^",10)'=""
SET DVBABORT=1
+2 QUIT