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

SROAOP.m

Go to the documentation of this file.
  1. SROAOP ;BIR/MAM - ENTER OPERATION INFO ;06/25/10
  1. ;;3.0;Surgery;**19,38,47,63,67,81,86,97,100,125,142,153,160,166,171,174,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. S SRSOUT=0,SRSUPCPT=1 D ^SROAUTL
  1. START G:SRSOUT END K SRAOTH,SRACON D ^SROAOP1
  1. ASK W !!,"Select Operative Information to Edit: " R SRASEL:DTIME I '$T!(SRASEL["^") S SRSOUT=1 G END
  1. I SRASEL="" G END
  1. S SRN=14 S:SRASEL="a" SRASEL="A" I '$D(SRAO(SRASEL)),(SRASEL'?.N1":".N),(SRASEL'="A") D HELP G:SRSOUT END G START
  1. I SRASEL="A" S SRASEL="1:"_SRN
  1. I SRASEL?.N1":".N S Y=$E(SRASEL),Z=$P(SRASEL,":",2) I Y<1!(Z>SRN)!(Y>Z) D HELP G:SRSOUT END G START
  1. S MM=$E(SRASEL) I MM'=4,(MM'=5),(MM'=6) S SRHDR(.5)=SRDOC D HDR^SROAUTL
  1. I SRASEL?.N1":".N D RANGE G START
  1. Q:'$D(SRAO(SRASEL))
  1. S EMILY=SRASEL D G START
  1. .I $$LOCK^SROUTL(SRTN) D ONE,UNLOCK^SROUTL(SRTN)
  1. END I $D(SRSOUT),'SRSOUT D ^SROAOP2
  1. I $D(SRTN) S SROERR=SRTN D ^SROERR0
  1. W @IOF D ^SRSKILL
  1. Q
  1. HELP W @IOF,!!!!,"Enter the number or range of numbers you want to edit. Examples of proper"
  1. W !,"responses are listed below.",!!,"1. Enter 'A' to update all information."
  1. W !!,"2. Enter a number (1-"_SRN_") to update the information in that field. (For"
  1. W !," example, enter '2' to update Principal Operation.)"
  1. W !!,"3. Enter a range of numbers (1-"_SRN_") separated by a ':' to enter a range of"
  1. W !," information. (For example, enter '7:9' to update PGY of Primary Surgeon,"
  1. W !," Surgical Priority and Wound Classification.)",!
  1. PRESS K DIR S DIR(0)="E" D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1
  1. Q
  1. RANGE ; range of numbers
  1. I $$LOCK^SROUTL(SRTN) D D UNLOCK^SROUTL(SRTN)
  1. .S SHEMP=$P(SRASEL,":"),CURLEY=$P(SRASEL,":",2) F EMILY=SHEMP:1:CURLEY Q:SRSOUT D ONE
  1. Q
  1. ONE ; edit one item
  1. I EMILY=4 D DISP^SROAUTL0 Q
  1. I EMILY=11 D ANES Q
  1. I EMILY=5 D ^SROTHER Q
  1. I EMILY=6 D CONCUR Q
  1. I EMILY=7,SRASEL[":",($P(SRASEL,":")'=7) S SRPAGE="" S SRHDR(.5)=SRDOC D HDR^SROAUTL
  1. K DR,DIE S DA=SRTN,DR=$P(SRAO(EMILY),"^",2)_"T",DIE=130 D ^DIE K DR I $D(Y) S SRSOUT=1
  1. I EMILY=2 D ^SROAUTL
  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. CONCUR ; concurrent case information
  1. N SRPROC,SRCSTAT S SRLINE="" F I=1:1:80 S SRLINE=SRLINE_"-"
  1. S CON=$P($G(^SRF(SRTN,"CON")),"^") I CON,($P($G(^SRF(CON,30)),"^")!($P($G(^SRF(CON,31)),"^",8))) S CON=""
  1. S SRPAGE="" D HDR^SROAUTL
  1. W !,"Concurrent Procedure: An additional operative procedure performed by a"
  1. W !,"different surgical team (i.e., a different specialty/service) under the"
  1. W !,"same anesthetic which has a CPT code different from that of the Principal"
  1. W !,"Operative Procedure (e.g., fixation of a femur fracture in a patient"
  1. W !,"undergoing a laparotomy for trauma). This field should be verified and,"
  1. W !,"if need be, report discrepancies to the official CPT coder for surgery."
  1. I CON D CC W !!,"Concurrent Procedure: ",?22,SROPS(1) I $D(SROPS(2)) W !,?22,SROPS(2) I $D(SROPS(3)) W !,?22,SROPS(3) I $D(SROPS(4)) W !,?22,SROPS(4)
  1. I $D(SRCSTAT) W !!,?22,SRCSTAT
  1. W !!,"Press ENTER to continue " R X:DTIME
  1. Q
  1. CC ; list concurrent procedure
  1. N SRTN,SRL,SRZ S SRCSTAT=">> Coding "_$S($P($G(^SRO(136,CON,10)),"^"):"",1:"Not ")_"Complete <<"
  1. S SRL=55,SRTN=CON D CPTS^SROAUTL0
  1. I SRPROC(1)="NOT ENTERED"!'$D(SRPROC(1)) S SRPROC(1)="CPT NOT ENTERED" K SRCSTAT
  1. S SROPER=$P(^SRF(CON,"OP"),"^")_" (" F I=1:1 Q:'$D(SRPROC(I)) S SROPER=SROPER_SRPROC(I)
  1. S SROPER=SROPER_")"
  1. K SROPS,MM,MMM S:$L(SROPER)<57 SROPS(1)=SROPER
  1. I $L(SROPER)>56 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
  1. Q
  1. LOOP ; break procedures
  1. S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<57 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
  1. Q
  1. ANES N SRANE,SRNEW
  1. I $P(SRAO(11),"^")="NOT ENTERED",'$O(^SRF(SRTN,6,0)) D Q
  1. .K DIR S DIR("A")="Select ANESTHESIA TECHNIQUE: ",DIR(0)="130.06,.01OA" D ^DIR K DIR S SRANE=Y I $D(DTOUT)!$D(DUOUT)!(Y="") Q
  1. .K DD,DO S DIC="^SRF(SRTN,6,",X=SRANE,DA(1)=SRTN,DIC(0)="L" D FILE^DICN K DIC,DD,DO I '+Y Q
  1. .S SRNEW=+Y
  1. .K DA,DIE,DR S DA=SRNEW,DA(1)=SRTN,DIE="^SRF(SRTN,6,",DR=".05T;42T" D ^DIE
  1. K DR,DIE,DA S DA=SRTN,DR=".37T",DR(2,130.06)=".01T;.05T;42T",DIE=130 D ^DIE K DR
  1. Q