SRTPLIV1 ;BIR/SJA - LIVER-RECIPIENT INFORMATION ;03/04/08
;;3.0; Surgery ;**167**;24 Jun 93;Build 27
I '$D(SRTPP) W !!,"A Transplant Assessment must be selected prior to using this option.",!!,"Press <RET> to continue " R X:DTIME S SRSOUT=1 G END
S SRSOUT=0,$P(SRLINE,"-",80)="" D SRHDR^SRTPUTL
START Q:SRSOUT D DISP
W !!,"Select Transplant Information to Edit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 G END
I X="" D ^SRTPLIV2 G END
S:X="a" X="A" I '$D(SRAO(X)),(X'?.N1":".N),(X'="A") D HELP G:SRSOUT END G START
I X?1.2N1":"1.2N S Y=$P(X,":"),Z=$P(X,":",2) I Y<1!(Z>SRX)!(Y>Z) D HELP G:SRSOUT END G START
I X="A" S X="1:"_SRX
D HDR^SRTPUTL
I X?.N1":".N D RANGE G START
I $D(SRAO(X)) S SREMIL=X W !! D ONE G START
END W @IOF
Q
HELP W @IOF,!!!!,"Enter the number or range of numbers you want to edit. Examples of proper",!,"responses are listed below."
W !!,"1. Enter 'A' to update all information.",!!,"2. Enter a number (1-"_SRX_") to update the information in that field. (For",!," example, enter '3' to update "_$S('SRNOVA:"Recipient ABO Blood Type",1:"Date Placed on Waiting List")_")"
W !!,"3. Enter a range of numbers (1-"_SRX_") separated by a ':' to enter a range",!," of items. (For example, enter '1:4' to update items 1, 2, 3 and 4.)",!
W !!,"Press <RET> to continue, or '^' to quit " R X:DTIME I '$T!(X["^") S SRSOUT=1
Q
RANGE ; range of numbers
W !! S SRNOMORE=0,SRSHEMP=$P(X,":"),SRCURL=$P(X,":",2) F SREMIL=SRSHEMP:1:SRCURL Q:SRNOMORE D ONE
Q
ONE ; edit one item
K DR,DIE S DA=SRTPP,DR=$P(SRAO(SREMIL),"^",2)_"T",DIE=139.5 D ^DIE K DR I $D(Y) S SRNOMORE=1 Q
I $P(SRAO(SREMIL),"^",2)=1!($P(SRAO(SREMIL),"^",2)=3) D SRHDR^SRTPUTL
Q
DISP ; display fields
S SRPAGE="PAGE: 1 OF "_$S(SRNOVA:7,1:5),SRHPG="RECIPIENT INFORMATION" D HDR^SRTPUTL
K SRAO,DR
S SRDR=$S(SRNOVA:"3;1;11;4;5;10;12;52;53;54;55;19",1:"3;11;10;12;52;53;54;55;19")
K DA,DIC,DIQ,SRX,SRY S DIC="^SRT(",DA=SRTPP,DIQ="SRY",DIQ(0)="E",DR=SRDR D EN^DIQ1 K DA,DIC,DIQ,DR
S (SRX,SRZ)=0 F I=1:1 S SRZ=$P(SRDR,";",I) Q:'SRZ S SRX=I,SRAO(I)=SRY(139.5,SRTPP,SRZ,"E")_"^"_SRZ
VA I 'SRNOVA D W !!,SRLINE Q
.W !,"1. VACO ID:",?35,$P(SRAO(1),"^")
.W !,"2. Date Placed on Waiting List:",?35,$P(SRAO(2),"^")
.W !,"3. Recipient ABO Blood Type:",?35,$P(SRAO(3),"^")
.W !,"4. Recipient CMV:",?35,$P(SRAO(4),"^")
.W !,"5. MELD Score at Listing:",?35,$P(SRAO(5),"^")
.W !,"6. Biologic MELD Score at Listing:",?35,$P(SRAO(6),"^")
.W !,"7. Meld Score at Transplant:",?35,$P(SRAO(7),"^")
.W !,"8. Biologic MELD Score at TX:",?35,$P(SRAO(8),"^")
.W !!,"9. Transplant Comments: " S SREXT=$P(SRAO(9),"^") D COMM
NONVA I SRNOVA D
.W !,"1. VACO ID:",?36,$P(SRAO(1),"^")
.S Y=$P(SRAO(2),"^") X ^DD("DD") W !,"2. Date of Transplant:",?36,Y
.W !,"3. Date Placed on Waiting List:",?36,$P(SRAO(3),"^")
.D HW^SRTPUTL
.S SRAO(4)=$$OUT^SRTPLUN1(4,$P(^SRT(SRTPP,0),"^",4))_"^4" W !,"4. Recipient Height:",?36,$P(SRAO(4),"^")
.S SRAO(5)=$$OUT^SRTPLUN1(5,$P(^SRT(SRTPP,0),"^",5))_"^5" W !,"5. Recipient Weight:",?36,$P(SRAO(5),"^")
.W !,"6. Recipient ABO Blood Type:",?36,$P(SRAO(6),"^")
.W !,"7. Recipient CMV:",?36,$P(SRAO(7),"^")
.W !,"8. MELD Score at Listing:",?36,$P(SRAO(8),"^")
.W !,"9. Biologic MELD Score at Listing:",?36,$P(SRAO(9),"^")
.W !,"10. Meld Score at Transplant:",?36,$P(SRAO(10),"^")
.W !,"11. Biologic MELD Score at TX:",?36,$P(SRAO(11),"^")
.W !!,"12. Transplant Comments: " S SREXT=$P(SRAO(12),"^") D COMM
W !!,SRLINE
Q
COMM ; comment field
I $L(SREXT)<52 W ?25,SREXT Q
N I,J,X,Y S X=SREXT F D W:$L(X) ! I $L(X)<52!($L(X)>51&(X'[" ")) W ?25,X Q
.F I=0:1:50 S J=51-I,Y=$E(X,J) I Y=" " W ?25,$E(X,1,J-1) S X=$E(X,J+1,$L(X)) Q
Q
SRTPLIV1 ;BIR/SJA - LIVER-RECIPIENT INFORMATION ;03/04/08
+1 ;;3.0; Surgery ;**167**;24 Jun 93;Build 27
+2 IF '$DATA(SRTPP)
WRITE !!,"A Transplant Assessment must be selected prior to using this option.",!!,"Press <RET> to continue "
READ X:DTIME
SET SRSOUT=1
GOTO END
+3 SET SRSOUT=0
SET $PIECE(SRLINE,"-",80)=""
DO SRHDR^SRTPUTL
START IF SRSOUT
QUIT
DO DISP
+1 WRITE !!,"Select Transplant Information to Edit: "
READ X:DTIME
IF '$TEST!(X["^")
SET SRSOUT=1
GOTO END
+2 IF X=""
DO ^SRTPLIV2
GOTO END
+3 IF X="a"
SET X="A"
IF '$DATA(SRAO(X))
IF (X'?.N1":".N)
IF (X'="A")
DO HELP
IF SRSOUT
GOTO END
GOTO START
+4 IF X?1.2N1":"1.2N
SET Y=$PIECE(X,":")
SET Z=$PIECE(X,":",2)
IF Y<1!(Z>SRX)!(Y>Z)
DO HELP
IF SRSOUT
GOTO END
GOTO START
+5 IF X="A"
SET X="1:"_SRX
+6 DO HDR^SRTPUTL
+7 IF X?.N1":".N
DO RANGE
GOTO START
+8 IF $DATA(SRAO(X))
SET SREMIL=X
WRITE !!
DO ONE
GOTO START
END WRITE @IOF
+1 QUIT
HELP WRITE @IOF,!!!!,"Enter the number or range of numbers you want to edit. Examples of proper",!,"responses are listed below."
+1 WRITE !!,"1. Enter 'A' to update all information.",!!,"2. Enter a number (1-"_SRX_") to update the information in that field. (For",!," example, enter '3' to update "_$SELECT('SRNOVA:"Recipient ABO Blood Type",1:"Date Placed on Waiting List"
)_")"
+2 WRITE !!,"3. Enter a range of numbers (1-"_SRX_") separated by a ':' to enter a range",!," of items. (For example, enter '1:4' to update items 1, 2, 3 and 4.)",!
+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 WRITE !!
SET SRNOMORE=0
SET SRSHEMP=$PIECE(X,":")
SET SRCURL=$PIECE(X,":",2)
FOR SREMIL=SRSHEMP:1:SRCURL
IF SRNOMORE
QUIT
DO ONE
+2 QUIT
ONE ; edit one item
+1 KILL DR,DIE
SET DA=SRTPP
SET DR=$PIECE(SRAO(SREMIL),"^",2)_"T"
SET DIE=139.5
DO ^DIE
KILL DR
IF $DATA(Y)
SET SRNOMORE=1
QUIT
+2 IF $PIECE(SRAO(SREMIL),"^",2)=1!($PIECE(SRAO(SREMIL),"^",2)=3)
DO SRHDR^SRTPUTL
+3 QUIT
DISP ; display fields
+1 SET SRPAGE="PAGE: 1 OF "_$SELECT(SRNOVA:7,1:5)
SET SRHPG="RECIPIENT INFORMATION"
DO HDR^SRTPUTL
+2 KILL SRAO,DR
+3 SET SRDR=$SELECT(SRNOVA:"3;1;11;4;5;10;12;52;53;54;55;19",1:"3;11;10;12;52;53;54;55;19")
+4 KILL DA,DIC,DIQ,SRX,SRY
SET DIC="^SRT("
SET DA=SRTPP
SET DIQ="SRY"
SET DIQ(0)="E"
SET DR=SRDR
DO EN^DIQ1
KILL DA,DIC,DIQ,DR
+5 SET (SRX,SRZ)=0
FOR I=1:1
SET SRZ=$PIECE(SRDR,";",I)
IF 'SRZ
QUIT
SET SRX=I
SET SRAO(I)=SRY(139.5,SRTPP,SRZ,"E")_"^"_SRZ
VA IF 'SRNOVA
Begin DoDot:1
+1 WRITE !,"1. VACO ID:",?35,$PIECE(SRAO(1),"^")
+2 WRITE !,"2. Date Placed on Waiting List:",?35,$PIECE(SRAO(2),"^")
+3 WRITE !,"3. Recipient ABO Blood Type:",?35,$PIECE(SRAO(3),"^")
+4 WRITE !,"4. Recipient CMV:",?35,$PIECE(SRAO(4),"^")
+5 WRITE !,"5. MELD Score at Listing:",?35,$PIECE(SRAO(5),"^")
+6 WRITE !,"6. Biologic MELD Score at Listing:",?35,$PIECE(SRAO(6),"^")
+7 WRITE !,"7. Meld Score at Transplant:",?35,$PIECE(SRAO(7),"^")
+8 WRITE !,"8. Biologic MELD Score at TX:",?35,$PIECE(SRAO(8),"^")
+9 WRITE !!,"9. Transplant Comments: "
SET SREXT=$PIECE(SRAO(9),"^")
DO COMM
End DoDot:1
WRITE !!,SRLINE
QUIT
NONVA IF SRNOVA
Begin DoDot:1
+1 WRITE !,"1. VACO ID:",?36,$PIECE(SRAO(1),"^")
+2 SET Y=$PIECE(SRAO(2),"^")
XECUTE ^DD("DD")
WRITE !,"2. Date of Transplant:",?36,Y
+3 WRITE !,"3. Date Placed on Waiting List:",?36,$PIECE(SRAO(3),"^")
+4 DO HW^SRTPUTL
+5 SET SRAO(4)=$$OUT^SRTPLUN1(4,$PIECE(^SRT(SRTPP,0),"^",4))_"^4"
WRITE !,"4. Recipient Height:",?36,$PIECE(SRAO(4),"^")
+6 SET SRAO(5)=$$OUT^SRTPLUN1(5,$PIECE(^SRT(SRTPP,0),"^",5))_"^5"
WRITE !,"5. Recipient Weight:",?36,$PIECE(SRAO(5),"^")
+7 WRITE !,"6. Recipient ABO Blood Type:",?36,$PIECE(SRAO(6),"^")
+8 WRITE !,"7. Recipient CMV:",?36,$PIECE(SRAO(7),"^")
+9 WRITE !,"8. MELD Score at Listing:",?36,$PIECE(SRAO(8),"^")
+10 WRITE !,"9. Biologic MELD Score at Listing:",?36,$PIECE(SRAO(9),"^")
+11 WRITE !,"10. Meld Score at Transplant:",?36,$PIECE(SRAO(10),"^")
+12 WRITE !,"11. Biologic MELD Score at TX:",?36,$PIECE(SRAO(11),"^")
+13 WRITE !!,"12. Transplant Comments: "
SET SREXT=$PIECE(SRAO(12),"^")
DO COMM
End DoDot:1
+14 WRITE !!,SRLINE
+15 QUIT
COMM ; comment field
+1 IF $LENGTH(SREXT)<52
WRITE ?25,SREXT
QUIT
+2 NEW I,J,X,Y
SET X=SREXT
FOR
Begin DoDot:1
+3 FOR I=0:1:50
SET J=51-I
SET Y=$EXTRACT(X,J)
IF Y=" "
WRITE ?25,$EXTRACT(X,1,J-1)
SET X=$EXTRACT(X,J+1,$LENGTH(X))
QUIT
End DoDot:1
IF $LENGTH(X)
WRITE !
IF $LENGTH(X)<52!($LENGTH(X)>51&(X'[" "))
WRITE ?25,X
QUIT
+4 QUIT