SROACPM1 ;BIR/SJA - LAB INFO ;01/14/08
;;3.0; Surgery ;**125,153,166**;24 Jun 93;Build 6
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 D ^SROAUTL
START G:SRSOUT END K SRA,SRAO D ^SROACPM2,DISP
ASK W !!,"Select Laboratory Information to Edit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 D CONCC G END
I X="" D CONCC 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="A" S X="1:10"
I X?.N1":".N S Y=$E(X),Z=$P(X,":",2) I Y<1!(Z>10)!(Y>Z) D HELP G:SRSOUT END G START
S SRPAGE="" D HDR^SROAUTL
I X?.N1":".N D RANGE G START
I $D(SRAO(X)) S EMILY=X 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-10) to update the information in that field. (For",!," example, enter '7' to update Serum Creatinine)"
W !!,"3. Enter a range of numbers (1-10) separated by a ':' to enter a range of",!," information. (For example, enter '5:7' to update Serum Potassium,",!," Serum Bilirubin, and Serum Creatinine)"
W !!,"Press <RET> to continue, or '^' to quit " R X:DTIME I '$T!(X["^") S SRSOUT=1
Q
RANGE ; range of numbers
S SRNOMORE=0,SHEMP=$P(X,":"),CURLEY=$P(X,":",2) F EMILY=SHEMP:1:CURLEY Q:SRNOMORE D ONE
Q
ONE ; edit one item
K DR,DIE S DA=SRTN,DR=$P(SRAO(EMILY),"^",3)_"T;"_$P(SRAO(EMILY),"^",4)_"T",DIE=130 D ^DIE S:$D(Y) SRNOMORE=1 K DR
Q
RET Q:SRSOUT W !!,"Press <RET> to continue, or '^' to quit " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
Q
DISP N SRX S SRPAGE="PAGE: 1",SRHDR(.5)="PREOPERATIVE LABORATORY RESULTS" D HDR^SROAUTL
S SRX=$P(SRAO(1),"^") W !," 1. HDL:",?25,$J(SRX,6),?35,$$NORCHK(21,SRX),?38,$P(SRAO(1),"^",2)
S SRX=$P(SRAO(2),"^") W !," 2. LDL:",?25,$J(SRX,6),?35,$$NORCHK(23,SRX),?38,$P(SRAO(2),"^",2)
S SRX=$P(SRAO(3),"^") W !," 3. Total Cholesterol:",?25,$J(SRX,6),?35,$$NORCHK(24,SRX),?38,$P(SRAO(3),"^",2)
S SRX=$P(SRAO(4),"^") W !," 4. Serum Triglyceride:",?25,$J(SRX,6),?35,$$NORCHK(22,SRX),?38,$P(SRAO(4),"^",2)
S SRX=$P(SRAO(5),"^") W !," 5. Serum Potassium:",?25,$J(SRX,6),?35,$$NORCHK(5,SRX),?38,$P(SRAO(5),"^",2)
S SRX=$P(SRAO(6),"^") W !," 6. Serum Bilirubin:",?25,$J(SRX,6),?35,$$NORCHK(14,SRX),?38,$P(SRAO(6),"^",2)
S SRX=$P(SRAO(7),"^") W !," 7. Serum Creatinine:",?25,$J(SRX,6),?35,$$NORCHK(7,SRX),?38,$P(SRAO(7),"^",2)
S SRX=$P(SRAO(8),"^") W !," 8. Serum Albumin:",?25,$J(SRX,6),?35,$$NORCHK(11,SRX),?38,$P(SRAO(8),"^",2)
S SRX=$P(SRAO(9),"^") W !," 9. Hemoglobin:",?25,$J(SRX,6),?35,$$NORCHK(1,SRX),?38,$P(SRAO(9),"^",2)
S SRX=$P(SRAO(10),"^") W !,"10. Hemoglobin A1c:",?25,$J(SRX,6),?35,$$NORCHK(27,SRX),?38,$P(SRAO(10),"^",2)
W !! F MOE=1:1:80 W "-"
Q
CONCC ; check for concurrent case and update if one exists
S SRCON=$P($G(^SRF(SRTN,"CON")),"^") Q:'SRCON
S SRI="" F S SRI=$O(SRAO(SRI)) Q:SRI="" S S1=$P(SRAO(SRI),"^",3),S2=$P(SRAO(SRI),"^",4) K DA,DIC,DIQ,DR,SRY D
.S DA=SRTN,DR=S1_";"_S2,DIC="^SRF(",DIQ="SRY",DIQ(0)="I" D EN^DIQ1 S P1=SRY(130,SRTN,S1,"I") S:P1="" P1="@" S P2=SRY(130,SRTN,S2,"I") S:P2="" P2="@"
.K DA,DIE,DR S DA=SRCON,DIE=130,DR=S1_"////"_P1_";"_S2_"////"_P2 D ^DIE K DR
Q
NORCHK(SRAT,RESULT) ;
I RESULT']""!(RESULT="NS") Q ""
N NODE,LOW,HIGH,SRY
S SRY="" S:"<>"[$E(RESULT) SRY=$E(RESULT),RESULT=$E(RESULT,2,99)
S NODE=$G(^SRO(139.2,SRAT,2)),LOW=$P(NODE,"^",2),HIGH=$P(NODE,"^",3) Q:LOW']""!(HIGH']"")
I SRY'="" Q $S(RESULT<(LOW+.01):"L",((RESULT>(HIGH-.01))&(SRY=">")):"H",1:"")
Q $S(RESULT<LOW:"L",RESULT>HIGH:"H",1:"")
SROACPM1 ;BIR/SJA - LAB INFO ;01/14/08
+1 ;;3.0; Surgery ;**125,153,166**;24 Jun 93;Build 6
+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
DO ^SROAUTL
START IF SRSOUT
GOTO END
KILL SRA,SRAO
DO ^SROACPM2
DO DISP
ASK WRITE !!,"Select Laboratory Information to Edit: "
READ X:DTIME
IF '$TEST!(X["^")
SET SRSOUT=1
DO CONCC
GOTO END
+1 IF X=""
DO CONCC
GOTO END
+2 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
+3 IF X="A"
SET X="1:10"
+4 IF X?.N1":".N
SET Y=$EXTRACT(X)
SET Z=$PIECE(X,":",2)
IF Y<1!(Z>10)!(Y>Z)
DO HELP
IF SRSOUT
GOTO END
GOTO START
+5 SET SRPAGE=""
DO HDR^SROAUTL
+6 IF X?.N1":".N
DO RANGE
GOTO START
+7 IF $DATA(SRAO(X))
SET EMILY=X
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-10) to update the information in that field. (For",!," example, enter '7' to update Serum Creatinine)"
+2 WRITE !!,"3. Enter a range of numbers (1-10) separated by a ':' to enter a range of",!," information. (For example, enter '5:7' to update Serum Potassium,",!," Serum Bilirubin, and Serum Creatinine)"
+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 SET SRNOMORE=0
SET SHEMP=$PIECE(X,":")
SET CURLEY=$PIECE(X,":",2)
FOR EMILY=SHEMP:1:CURLEY
IF SRNOMORE
QUIT
DO ONE
+2 QUIT
ONE ; edit one item
+1 KILL DR,DIE
SET DA=SRTN
SET DR=$PIECE(SRAO(EMILY),"^",3)_"T;"_$PIECE(SRAO(EMILY),"^",4)_"T"
SET DIE=130
DO ^DIE
IF $DATA(Y)
SET SRNOMORE=1
KILL DR
+2 QUIT
RET IF SRSOUT
QUIT
WRITE !!,"Press <RET> to continue, or '^' to quit "
READ X:DTIME
IF '$TEST!(X["^")
SET SRSOUT=1
QUIT
+1 QUIT
DISP NEW SRX
SET SRPAGE="PAGE: 1"
SET SRHDR(.5)="PREOPERATIVE LABORATORY RESULTS"
DO HDR^SROAUTL
+1 SET SRX=$PIECE(SRAO(1),"^")
WRITE !," 1. HDL:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(21,SRX),?38,$PIECE(SRAO(1),"^",2)
+2 SET SRX=$PIECE(SRAO(2),"^")
WRITE !," 2. LDL:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(23,SRX),?38,$PIECE(SRAO(2),"^",2)
+3 SET SRX=$PIECE(SRAO(3),"^")
WRITE !," 3. Total Cholesterol:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(24,SRX),?38,$PIECE(SRAO(3),"^",2)
+4 SET SRX=$PIECE(SRAO(4),"^")
WRITE !," 4. Serum Triglyceride:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(22,SRX),?38,$PIECE(SRAO(4),"^",2)
+5 SET SRX=$PIECE(SRAO(5),"^")
WRITE !," 5. Serum Potassium:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(5,SRX),?38,$PIECE(SRAO(5),"^",2)
+6 SET SRX=$PIECE(SRAO(6),"^")
WRITE !," 6. Serum Bilirubin:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(14,SRX),?38,$PIECE(SRAO(6),"^",2)
+7 SET SRX=$PIECE(SRAO(7),"^")
WRITE !," 7. Serum Creatinine:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(7,SRX),?38,$PIECE(SRAO(7),"^",2)
+8 SET SRX=$PIECE(SRAO(8),"^")
WRITE !," 8. Serum Albumin:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(11,SRX),?38,$PIECE(SRAO(8),"^",2)
+9 SET SRX=$PIECE(SRAO(9),"^")
WRITE !," 9. Hemoglobin:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(1,SRX),?38,$PIECE(SRAO(9),"^",2)
+10 SET SRX=$PIECE(SRAO(10),"^")
WRITE !,"10. Hemoglobin A1c:",?25,$JUSTIFY(SRX,6),?35,$$NORCHK(27,SRX),?38,$PIECE(SRAO(10),"^",2)
+11 WRITE !!
FOR MOE=1:1:80
WRITE "-"
+12 QUIT
CONCC ; check for concurrent case and update if one exists
+1 SET SRCON=$PIECE($GET(^SRF(SRTN,"CON")),"^")
IF 'SRCON
QUIT
+2 SET SRI=""
FOR
SET SRI=$ORDER(SRAO(SRI))
IF SRI=""
QUIT
SET S1=$PIECE(SRAO(SRI),"^",3)
SET S2=$PIECE(SRAO(SRI),"^",4)
KILL DA,DIC,DIQ,DR,SRY
Begin DoDot:1
+3 SET DA=SRTN
SET DR=S1_";"_S2
SET DIC="^SRF("
SET DIQ="SRY"
SET DIQ(0)="I"
DO EN^DIQ1
SET P1=SRY(130,SRTN,S1,"I")
IF P1=""
SET P1="@"
SET P2=SRY(130,SRTN,S2,"I")
IF P2=""
SET P2="@"
+4 KILL DA,DIE,DR
SET DA=SRCON
SET DIE=130
SET DR=S1_"////"_P1_";"_S2_"////"_P2
DO ^DIE
KILL DR
End DoDot:1
+5 QUIT
NORCHK(SRAT,RESULT) ;
+1 IF RESULT']""!(RESULT="NS")
QUIT ""
+2 NEW NODE,LOW,HIGH,SRY
+3 SET SRY=""
IF "<>"[$EXTRACT(RESULT)
SET SRY=$EXTRACT(RESULT)
SET RESULT=$EXTRACT(RESULT,2,99)
+4 SET NODE=$GET(^SRO(139.2,SRAT,2))
SET LOW=$PIECE(NODE,"^",2)
SET HIGH=$PIECE(NODE,"^",3)
IF LOW']""!(HIGH']"")
QUIT
+5 IF SRY'=""
QUIT $SELECT(RESULT<(LOW+.01):"L",((RESULT>(HIGH-.01))&(SRY=">")):"H",1:"")
+6 QUIT $SELECT(RESULT<LOW:"L",RESULT>HIGH:"H",1:"")