Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SROACOP

SROACOP.m

Go to the documentation of this file.
  1. SROACOP ;BIR/MAM - CARDIAC OPERATIVE RISK SUMMARY ;05/05/10
  1. ;;3.0;Surgery;**38,47,71,88,95,107,100,125,142,153,160,166,174,175,182,184,200**;24 Jun 93;Build 9
  1. 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
  1. N SRCSTAT S SRACLR=0,SRSOUT=0,SRSUPCPT=1 D ^SROAUTL
  1. START D:SRACLR RET G:SRSOUT END S SRACLR=0 K SRA,SRAO
  1. F I=206,206.1,208 S SRA(I)=$G(^SRF(SRTN,I))
  1. S Y=$P($G(^SRF(SRTN,1.1)),"^",3),C=$P(^DD(130,1.13,0),"^",2) D:Y'="" Y^DIQ S SRAO(1)=Y_"^1.13"
  1. S SRAO(2)=$P(SRA(208),"^",12)_"^414"
  1. S Y=$P(SRAO(2),"^") I Y'="" S C=$P(^DD(130,414,0),"^",2) D Y^DIQ S $P(SRAO(2),"^")=Y
  1. S Y=$P(SRA(208),"^",13) D DT S SRAO("2A")=X_"^414.1"
  1. S SRCSTAT=">> Coding "_$S($P($G(^SRO(136,SRTN,10)),"^"):"",1:"Not ")_"Complete <<"
  1. S SRPAGE="PAGE: 1" D HDR^SROAUTL S SRAO(3)=""
  1. W !," 1. ASA Classification:",?31,$P(SRAO(1),"^"),!," 2. Surgical Priority:",?31,$P(SRAO(2),"^")
  1. S X=$P(SRAO("2A"),"^") I X'="" W !,?3," A. Date/Time Collected: "_X
  1. N SRPROC,SRL S SRL=49 D CPTS^SROAUTL0 W !," 3. CPT Codes (view only):"
  1. F I=1:1 Q:'$D(SRPROC(I)) W:I=1 ?31,SRPROC(I) W:I'=1 !,?31,SRPROC(I)
  1. S Y=$P($G(^SRF(SRTN,"1.0")),"^",8),C=$P(^DD(130,1.09,0),"^",2) D:Y'="" Y^DIQ S SRAO(4)=Y_"^1.09"
  1. W !," 4. Wound Classification: ",?31,$P(SRAO(4),"^")
  1. S Y=$$GET1^DIQ(130,SRTN_",",2006,"E") S:$G(Y)']"" Y="NOT ENTERED" S SRAO(5)=Y_"^2006"
  1. W !," 5. Robotic Assistance (Y/N): ",?31,$P(SRAO(5),"^")
  1. W ! D CHCK
  1. W !! F MOE=1:1:80 W "-"
  1. ASK W !,"Select Operative Risk Summary Information to Edit: " R X:DTIME I '$T!("^"[X) G END
  1. S:X="a" X="A" I '$D(SRAO(X)),(X'?.N1":".N),(X'="A") D HELP G:SRSOUT END G START
  1. I X="A" S X="1:5"
  1. I X?.N1":".N S Y=$E(X),Z=$P(X,":",2) I Y<1!(Z>5)!(Y>Z) D HELP G:SRSOUT END G START
  1. I "4,5"'[X D HDR^SROAUTL
  1. I X?.N1":".N D RANGE S SROERR=SRTN D ^SROERR0 G START
  1. I $D(SRAO(X))!(X=4) S EMILY=X D S SROERR=SRTN D ^SROERR0 G START
  1. .I $$LOCK^SROUTL(SRTN) W !! D ONE,UNLOCK^SROUTL(SRTN)
  1. END I '$D(SREQST) W @IOF D ^SRSKILL
  1. Q
  1. DT I 'Y S X="" Q
  1. X ^DD("DD") S X=$P(Y,"@")_" "_$P(Y,"@",2)
  1. Q
  1. HELP W @IOF,!!!!,"Enter the number or range of numbers you want to edit. Examples of proper",!,"responses are listed below."
  1. W !!,"1. Enter 'A' to update all information.",!!,"2. Enter the corresponding number to update the information in a particular",!," field. (For example, enter '2' to update Surgical Priority)"
  1. W !!,"3. Enter two numbers separated by a ':' to enter a range of information.",!," (For example, enter '1:2' to update ASA Classification",!," Surgical Priority.)"
  1. W !!,"Press ENTER to continue, or '^' to quit " R X:DTIME I '$T!(X["^") S SRSOUT=1
  1. Q
  1. RANGE ; range of numbers
  1. I $$LOCK^SROUTL(SRTN) D D UNLOCK^SROUTL(SRTN)
  1. .W !! S SHEMP=$P(X,":"),CURLEY=$P(X,":",2) F EMILY=SHEMP:1:CURLEY Q:SRSOUT D ONE
  1. Q
  1. ONE ; edit one item
  1. I EMILY=3 D DISP^SROAUTL0 Q
  1. K DR,DIE S DA=SRTN,DIE=130,DR=$P(SRAO(EMILY),"^",2)
  1. S DR=DR_"T",DIE=130 S DR=DR_$S(EMILY=2:";414.1T",1:"") D ^DIE K DR I $D(Y) S SRSOUT=1
  1. Q
  1. RET Q:SRSOUT W !!,"Press ENTER to continue, or '^' to quit " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
  1. Q
  1. NOW ; update date/time of estimate of mortality
  1. N X D NOW^%DTC S $P(^SRF(DA,206),"^",32)=$E(%,1,12)
  1. Q
  1. KNOW ; delete date/time of estimate of mortality
  1. S $P(^SRF(DA,206),"^",32)=""
  1. Q
  1. YN ; store answer
  1. S SHEMP=$S(NYUK="NS":"Unknown",NYUK="N":"NO",NYUK="Y":"YES",1:"")
  1. Q
  1. CHCK ;compare dates
  1. N SRINO,SRSP
  1. S SRSP=$P($G(^SRF(SRTN,208)),"^",13),SRINO=$P($G(^SRF(SRTN,.2)),"^",10)
  1. I SRSP'="",SRINO'="",SRSP'<SRINO W !!,"*** NOTE: D/Time of Surgical Priority should be < the D/Time Patient in OR.***"
  1. Q