SROAO ;B'HAM ISC/MAM - OUTCOMES ; [ 01/29/01  9:22 AM ]
 ;;3.0; Surgery ;**100**;24 Jun 93
 I '$D(SRTN) W !!,"A Surgery Risk Assessment must be selected prior to using this option.",!!,"Press <RET> to continue  " R X:DTIME G END
 S SRSOUT=0,DFN=$P(^SRF(SRTN,0),"^") D DEM^VADPT S SRANAME=$P(VADM(1),"^")_"  ("_VA("PID")_")"
START G:SRSOUT END D ^SROAOSET
ASK W !!,"Select Postoperative Outcome: " R X:DTIME I '$T!(X["^") G END
 I X="" G END
 I '$D(SRAO(X)),(X'?1N1":"1N),(X'="A") D HELP G:SRSOUT END G START
 I X?1N1":"1N S Y=$P(X,":"),Z=$P(X,":",2) I Y<1!(Z>3)!(Y>Z) D HELP G:SRSOUT END G START
 W @IOF,!,SRANAME,! F MOE=1:1:80 W "-"
 I X="A" S X="1:3"
 I X?1N1":"1N W !! D RANGE G START
 I $D(SRAO(X)),+X=X S EMILY=X D  G START
 .I $$LOCK^SROUTL(SRTN) W:X<6 !! D ONE,UNLOCK^SROUTL(SRTN)
END W @IOF D ^SRSKILL
 Q
HELP W @IOF,!!!!,"Enter the number, number/letter combination, or range of numbers you want to",!,"edit.  Examples of proper responses are listed below."
 W !!,"1. Enter 'A' to update all outcome information.",!!,"2. Enter a number (1-3) to update an individual outcome element.  (For",!,"   example, enter '1' to update all postoperative diagnosis)"
 W !!,"3. Enter a range of numbers (1-3) separated by a ':' to enter a range of",!,"   outcomes.  (For example, enter '1:3' to enter postoperative diagnosis,",!,"   length of postoperative stay, and 30 day postoperative status)"
 W !!,"Press <RET> to continue, or '^' to quit  " R X:DTIME I '$T!(X["^") S SRSOUT=1
 Q
RANGE ; range of numbers
 I $$LOCK^SROUTL(SRTN) D  D UNLOCK^SROUTL(SRTN)
 .S SHEMP=$P(X,":"),CURLEY=$P(X,":",2) F EMILY=SHEMP:1:CURLEY Q:SRSOUT  D ONE
 Q
ONE ; edit one item
 K DR,DA,DIE S DR=$P(SRAO(EMILY),"^",2)_"T",DA=SRTN,DIE=130 D ^DIE K DR,DA
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROAO   1762     printed  Sep 23, 2025@20:17:44                                                                                                                                                                                                       Page 2
SROAO     ;B'HAM ISC/MAM - OUTCOMES ; [ 01/29/01  9:22 AM ]
 +1       ;;3.0; Surgery ;**100**;24 Jun 93
 +2        IF '$DATA(SRTN)
               WRITE !!,"A Surgery Risk Assessment must be selected prior to using this option.",!!,"Press <RET> to continue  "
               READ X:DTIME
               GOTO END
 +3        SET SRSOUT=0
           SET DFN=$PIECE(^SRF(SRTN,0),"^")
           DO DEM^VADPT
           SET SRANAME=$PIECE(VADM(1),"^")_"  ("_VA("PID")_")"
START      if SRSOUT
               GOTO END
           DO ^SROAOSET
ASK        WRITE !!,"Select Postoperative Outcome: "
           READ X:DTIME
           IF '$TEST!(X["^")
               GOTO END
 +1        IF X=""
               GOTO END
 +2        IF '$DATA(SRAO(X))
               IF (X'?1N1":"1N)
                   IF (X'="A")
                       DO HELP
                       if SRSOUT
                           GOTO END
                       GOTO START
 +3        IF X?1N1":"1N
               SET Y=$PIECE(X,":")
               SET Z=$PIECE(X,":",2)
               IF Y<1!(Z>3)!(Y>Z)
                   DO HELP
                   if SRSOUT
                       GOTO END
                   GOTO START
 +4        WRITE @IOF,!,SRANAME,!
           FOR MOE=1:1:80
               WRITE "-"
 +5        IF X="A"
               SET X="1:3"
 +6        IF X?1N1":"1N
               WRITE !!
               DO RANGE
               GOTO START
 +7        IF $DATA(SRAO(X))
               IF +X=X
                   SET EMILY=X
                   Begin DoDot:1
 +8                    IF $$LOCK^SROUTL(SRTN)
                           if X<6
                               WRITE !!
                           DO ONE
                           DO UNLOCK^SROUTL(SRTN)
                   End DoDot:1
                   GOTO START
END        WRITE @IOF
           DO ^SRSKILL
 +1        QUIT 
HELP       WRITE @IOF,!!!!,"Enter the number, number/letter combination, or range of numbers you want to",!,"edit.  Examples of proper responses are listed below."
 +1        WRITE !!,"1. Enter 'A' to update all outcome information.",!!,"2. Enter a number (1-3) to update an individual outcome element.  (For",!,"   example, enter '1' to update all postoperative diagnosis)"
 +2        WRITE !!,"3. Enter a range of numbers (1-3) separated by a ':' to enter a range of",!,"   outcomes.  (For example, enter '1:3' to enter postoperative diagnosis,",!,"   length of postoperative stay, and 30 day postoperative status)"
 +3        WRITE !!,"Press <RET> to continue, or '^' to quit  "
           READ X:DTIME
           IF '$TEST!(X["^")
               SET SRSOUT=1
 +4        QUIT 
RANGE     ; range of numbers
 +1        IF $$LOCK^SROUTL(SRTN)
               Begin DoDot:1
 +2                SET SHEMP=$PIECE(X,":")
                   SET CURLEY=$PIECE(X,":",2)
                   FOR EMILY=SHEMP:1:CURLEY
                       if SRSOUT
                           QUIT 
                       DO ONE
               End DoDot:1
               DO UNLOCK^SROUTL(SRTN)
 +3        QUIT 
ONE       ; edit one item
 +1        KILL DR,DA,DIE
           SET DR=$PIECE(SRAO(EMILY),"^",2)_"T"
           SET DA=SRTN
           SET DIE=130
           DO ^DIE
           KILL DR,DA
 +2        QUIT