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

SROAPRE.m

Go to the documentation of this file.
  1. SROAPRE ;BIR/MAM - PREOPERATIVE INFO ;10/04/10
  1. ;;3.0;Surgery;**38,47,55,88,100,125,142,166,174,182,184**;24 Jun 93;Build 35
  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. S (SRSOUT,SRACLR)=0,SRSUPCPT=1 D ^SROAUTL,DUP^SROAUTL G:SRSOUT END
  1. START D:SRACLR RET G:SRSOUT END S SRACLR=0 K SRA,SRAO D ^SROAPS1
  1. ASK W !,"Select Preoperative Information to Edit: " R X:DTIME I '$T!(X["^") D CONCC G END
  1. S:X="" X="+1" S:X="a" X="A" S:X="n" X="N"
  1. I $L(X)=2,'$D(SRAO(X)),X?1N1A S Z=$E(X,2),Z=$TR(Z,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ") I $D(SRAO($E(X)_Z)) S X=$E(X)_Z
  1. I '$D(SRAO(X)),(X'?.N1":".N),(X'="A"),(X'="N"),(X'="+1") D HELP G:SRSOUT END G START
  1. I X="+1" D CONCC,^SROAPR2 G START
  1. I X="A" S X="1:6"
  1. I X?.N1":".N S Y=$E(X),Z=$P(X,":",2) I Y<1!(Z>6)!(Y>Z) D HELP G:SRSOUT END G START
  1. I X="N" D G:SRSOUT END G START
  1. .W ! K DIR S DIR(0)="Y",DIR("B")="NO",DIR("A")="Are you sure you want to set all fields on this page to NO"
  1. .D ^DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 Q
  1. .I Y D NO2ALL^SROAPRE1
  1. S SRPAGE="" D HDR^SROAUTL
  1. I X?.N1":".N D RANGE G START
  1. I $D(SRAO(X)),+X=X S EMILY=X D G START
  1. .I $$LOCK^SROUTL(SRTN) W ! D:EMILY<4 ^SROAPRE1 D:EMILY>3 ^SROAPR1A D UNLOCK^SROUTL(SRTN)
  1. I $D(SRAO(X)),$$LOCK^SROUTL(SRTN) D D UNLOCK^SROUTL(SRTN)
  1. .S SRX=X I $P(SRAO(X),"^",2)=485 D ^SROACL2 S SRAO(SRX)=Y K DR,DIE S DA=SRTN,DR="485///"_$P(SRAO(SRX),"^"),DIE=130 D ^DIE K DR Q
  1. .S SRX=X W ! K DR,DIE S DA=SRTN,DR=$P(SRAO(X),"^",2)_"T",DIE=130 D ^DIE K DR
  1. .I $P(SRAO(SRX),"^",2)=237.1 D F667
  1. G START
  1. END I '$D(SREQST) W @IOF D ^SRSKILL
  1. Q
  1. HELP W @IOF,!!!!,"Enter the number, number/letter combination, 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 'N' to set all fields on this page to NO."
  1. W !!,"3. Enter a number (1-6) to update the information in that group. (For",!," example, enter '5' to update all cardiac information)"
  1. W !!,"4. Enter a number/letter combination to update a specific occurrence. (To ",!," update Current Pneumonia, enter '2C'.)"
  1. W !!,"5. Enter a range of numbers (1-6) separated by a ':' to enter a range of",!," occurrences. (For example, enter '2:4' to enter all pulmonary,",!," hepatobiliary, and gastrointestinal information)"
  1. W !!,"6. Press <RET> to continue to page 2 of this option."
  1. W !!,"Press <RET> 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. .S SHEMP=$P(X,":"),CURLEY=$P(X,":",2) W:SHEMP<9 ! F EMILY=SHEMP:1:CURLEY Q:SRSOUT D:EMILY<4 ^SROAPRE1 D:EMILY>3 ^SROAPR1A
  1. Q
  1. RET Q:SRSOUT W !!,"Press <RET> to continue, or '^' to quit " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
  1. Q
  1. CONCC ; check for concurrent case and update if one exists
  1. S SRCON=$P($G(^SRF(SRTN,"CON")),"^") Q:'SRCON
  1. Q:$P($G(^SRF(SRCON,"RA")),"^",2)="C"
  1. S SRI="" F S SRI=$O(SRAO(SRI)) Q:SRI="" S SRZ=$P(SRAO(SRI),"^",2) K DA,DIC,DIQ,DR,SRY D
  1. .S DA=SRTN,DR=SRZ,DIC="^SRF(",DIQ="SRY",DIQ(0)="I" D EN^DIQ1 S SRX=SRY(130,SRTN,SRZ,"I") S:SRX="" SRX="@"
  1. .I $$LOCK^SROUTL(SRTN) K DA,DIE,DR S DA=SRCON,DIE=130,DR=SRZ_"////"_SRX D ^DIE K DR D UNLOCK^SROUTL(SRTN)
  1. Q
  1. F667 ; editing the Sleep Apnea-Compliance field
  1. I $P(^SRF(SRTN,200.1),"^",8)'=3 S $P(^SRF(SRTN,200.1),"^",15)="" Q
  1. S SRX="1K" W ! K DR,DIE S DA=SRTN,DR=$P(SRAO(SRX),"^",2)_"T",DIE=130 D ^DIE K DR,DIE
  1. Q
  1. CHK667 ;check entries of the Sleep Apnea-Compliance field based on the value of the Preop Sleep Apnea field.
  1. S SRTN=$S($G(SRTN):SRTN,1:DA)
  1. I $P(^SRF(SRTN,200.1),"^",8)'=3 D K X Q
  1. .W !!,"Warning: Sleep Apnea-Compliance field can ONLY be edited if the value of the"
  1. .W !,?9,"'Preop Sleep Apnea' field is set to '3-LEVEL 3'."
  1. Q