- SROP1 ;B'HAM ISC/MAM - SELECT OPERATION (CONT); 8 Feb 1989 2:58 PM
- ;;3.0;Surgery;**184,188**;24 Jun 93;Build 2
- STATUS ; print case status
- I $P($G(^SRF(SROP,30)),"^")'="" D CAN Q
- I $P($G(^SRF(SROP,31)),"^",8)'="" D CAN Q
- I $P($G(^SRF(SROP,.2)),"^",12) S SROPER=SROPER_" (COMPLETED)" Q
- I $D(^SRF(SROP,.2)),$P(^(.2),"^",12)="" S SRSTAT=0 D SCH I SRSTATUS=0 D REQ Q:SRSTATUS G NO
- I '$D(^SRF(SROP,.2)) S SRSTAT=0 D SCH I SRSTATUS=0 D REQ Q:SRSTATUS=1 G NO
- Q
- NO ; not requested or scheduled
- S SROPER=SROPER_" (NOT COMPLETE)"
- Q
- CAN ; cancelled or aborted
- S SR(.2)=$G(^SRF(SROP,.2)) I $P(SR(.2),"^")!($P(SR(.2),"^",10))&($P($G(^SRF(SROP,30)),"^",6)>1) S SROPER=SROPER_" (ABORTED)" Q
- I $P($G(^SRF(SROP,30)),"^",6)="",$P(SR(.2),"^")!($P(SR(.2),"^",10)) S SROPER=SROPER_" (ABORTED)" Q
- S SROPER=SROPER_" (CANCELLED)"
- Q
- SCH ; check to see if case is scheduled
- I '$D(^SRF(SROP,31)) S SRSTATUS=0 Q
- I $P($G(^SRF(SROP,31)),"^",4)="" S SRSTATUS=0 Q
- I $P($G(^SRF(SROP,31)),"^",4) D:SRSTAT=0 TIM0 D:SRSTAT=1 TIM1 S SRSTATUS=1 Q
- Q
- TIM0 I '$D(^SRF(SROP,.2)) S SROPER=SROPER_" (SCHEDULED)" Q
- I $P(^SRF(SROP,.2),"^",2) S SROPER=SROPER_" (NOT COMPLETE)" Q
- I $P(^SRF(SROP,.2),"^",2)="" S SROPER=SROPER_" (SCHEDULED)"
- Q
- TIM1 S SROPER=SROPER_" (SCHEDULED)" Q
- REQ ; check to see if case has been requested
- I $D(^SRF(SROP,"REQ")),$P(^("REQ"),"^")=1,'$D(^SRF(SROP,.2)) S SROPER=SROPER_" (REQUESTED)" S SRSTATUS=1 Q
- I $D(^SRF(SROP,"REQ")),$P(^("REQ"),"^")=1,$D(^SRF(SROP,.2)),$P(^(.2),"^",2)="" S SROPER=SROPER_" (REQUESTED)" S SRSTATUS=1
- Q
- RET I 'SRSOUT W !!,"Press RETURN to continue " R Z:DTIME
- Q
- END W !! D ^SRSKILL
- Q
- ABORT ; aborted case
- S SRABORT=0 I $D(^SRF(SROP,.2)),$P(^(.2),"^",10)'="" S SRABORT=1
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROP1 1746 printed Jan 18, 2025@03:45:56 Page 2
- SROP1 ;B'HAM ISC/MAM - SELECT OPERATION (CONT); 8 Feb 1989 2:58 PM
- +1 ;;3.0;Surgery;**184,188**;24 Jun 93;Build 2
- STATUS ; print case status
- +1 IF $PIECE($GET(^SRF(SROP,30)),"^")'=""
- DO CAN
- QUIT
- +2 IF $PIECE($GET(^SRF(SROP,31)),"^",8)'=""
- DO CAN
- QUIT
- +3 IF $PIECE($GET(^SRF(SROP,.2)),"^",12)
- SET SROPER=SROPER_" (COMPLETED)"
- QUIT
- +4 IF $DATA(^SRF(SROP,.2))
- IF $PIECE(^(.2),"^",12)=""
- SET SRSTAT=0
- DO SCH
- IF SRSTATUS=0
- DO REQ
- if SRSTATUS
- QUIT
- GOTO NO
- +5 IF '$DATA(^SRF(SROP,.2))
- SET SRSTAT=0
- DO SCH
- IF SRSTATUS=0
- DO REQ
- if SRSTATUS=1
- QUIT
- GOTO NO
- +6 QUIT
- NO ; not requested or scheduled
- +1 SET SROPER=SROPER_" (NOT COMPLETE)"
- +2 QUIT
- CAN ; cancelled or aborted
- +1 SET SR(.2)=$GET(^SRF(SROP,.2))
- IF $PIECE(SR(.2),"^")!($PIECE(SR(.2),"^",10))&($PIECE($GET(^SRF(SROP,30)),"^",6)>1)
- SET SROPER=SROPER_" (ABORTED)"
- QUIT
- +2 IF $PIECE($GET(^SRF(SROP,30)),"^",6)=""
- IF $PIECE(SR(.2),"^")!($PIECE(SR(.2),"^",10))
- SET SROPER=SROPER_" (ABORTED)"
- QUIT
- +3 SET SROPER=SROPER_" (CANCELLED)"
- +4 QUIT
- SCH ; check to see if case is scheduled
- +1 IF '$DATA(^SRF(SROP,31))
- SET SRSTATUS=0
- QUIT
- +2 IF $PIECE($GET(^SRF(SROP,31)),"^",4)=""
- SET SRSTATUS=0
- QUIT
- +3 IF $PIECE($GET(^SRF(SROP,31)),"^",4)
- if SRSTAT=0
- DO TIM0
- if SRSTAT=1
- DO TIM1
- SET SRSTATUS=1
- QUIT
- +4 QUIT
- TIM0 IF '$DATA(^SRF(SROP,.2))
- SET SROPER=SROPER_" (SCHEDULED)"
- QUIT
- +1 IF $PIECE(^SRF(SROP,.2),"^",2)
- SET SROPER=SROPER_" (NOT COMPLETE)"
- QUIT
- +2 IF $PIECE(^SRF(SROP,.2),"^",2)=""
- SET SROPER=SROPER_" (SCHEDULED)"
- +3 QUIT
- TIM1 SET SROPER=SROPER_" (SCHEDULED)"
- QUIT
- REQ ; check to see if case has been requested
- +1 IF $DATA(^SRF(SROP,"REQ"))
- IF $PIECE(^("REQ"),"^")=1
- IF '$DATA(^SRF(SROP,.2))
- SET SROPER=SROPER_" (REQUESTED)"
- SET SRSTATUS=1
- QUIT
- +2 IF $DATA(^SRF(SROP,"REQ"))
- IF $PIECE(^("REQ"),"^")=1
- IF $DATA(^SRF(SROP,.2))
- IF $PIECE(^(.2),"^",2)=""
- SET SROPER=SROPER_" (REQUESTED)"
- SET SRSTATUS=1
- +3 QUIT
- RET IF 'SRSOUT
- WRITE !!,"Press RETURN to continue "
- READ Z:DTIME
- +1 QUIT
- END WRITE !!
- DO ^SRSKILL
- +1 QUIT
- ABORT ; aborted case
- +1 SET SRABORT=0
- IF $DATA(^SRF(SROP,.2))
- IF $PIECE(^(.2),"^",10)'=""
- SET SRABORT=1
- +2 QUIT