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

SROADOC1.m

Go to the documentation of this file.
SROADOC1 ;B'HAM ISC/MAM - ANESTHESIA PROV REPORT (CONT); [ 09/07/00  11:24 AM ]
 ;;3.0; Surgery ;**38,39,53,50,95,151,155**;24 Jun 93
 ;
 ; Reference to ^PSS50 supported by DBIA #4533
 ;
SET ; set and print results
 S S(0)=^SRF(SRTN,0),S(.3)=^SRF(SRTN,.3)
 S DFN=$P(S(0),"^") D DEM^VADPT S SRDPT=VADM(1),SRSSN=VA("PID"),SRSDATE=$P(S(0),"^",9),SRREL=$P(S(.3),"^",2),SRSUP=$P(S(.3),"^",4),SRASS=$P(S(.3),"^",3),SRCODE=$P(S(.3),"^",6)
 S:SRCODE'="" SRCODE=$P(^SRO(132.95,SRCODE,0),"^",2)
 S SRANT="" I $D(^SRF(SRTN,.2)) S SRANE1=$P(^(.2),"^"),SRANE2=$P(^(.2),"^",4) I SRANE1,SRANE2 S X1=SRANE2,X=SRANE1 D MINS^SRSUTL2 S SRANT=X
 S:SRREL'="" SRREL=$P(^VA(200,SRREL,0),"^") S:$L(SRREL)>15 SRREL=$P(SRREL,",")_","_$E($P(SRREL,",",2)) S:SRSUP'="" SRSUP=$P(^VA(200,SRSUP,0),"^") S:$L(SRSUP)>15 SRSUP=$P(SRSUP,",")_","_$E($P(SRSUP,",",2))
 S:SRASS'="" SRASS=$P(^VA(200,SRASS,0),"^") I $L(SRASS)>15 S SRASS=$P(SRASS,",")_","_$E($P(SRASS,",",2))
 S SRSDT=$E(SRSDATE,4,5)_"/"_$E(SRSDATE,6,7)
TECH D TECH^SROPRIN S SRAGNT="" I $D(SRZ) D AGENT
ASA S Y=$P($G(^SRF(SRTN,1.1)),"^",3),C=$P(^DD(130,1.13,0),"^",2) D:Y'="" Y^DIQ S SRASA=$P(Y,"-",2,3)
OPS K SROPERS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F  S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER=""  D OTHER
 K SROPS,MM,MMM S:$L(SROPER)<50 SROPS(1)=SROPER I $L(SROPER)>49 S SROPER=SROPER_"  " F M=1:1 D LOOP Q:MMM=""
PRINT ; print results
 Q:SRF  I $Y+10>IOSL D CODES^SROADOC,PAGE Q:SRF
 W !,$E(SRSDATE,4,5)_"/"_$E(SRSDATE,6,7)_"/"_$E(SRSDATE,2,3),?10,$P(SRDPT,",")_", "_$E($P(SRDPT,",",2)),?26,SROPS(1),?76,SRSUP,?93,SRASA,?124,SRCODE
 W !,SRTN,?10,VA("PID") W:$D(SROPS(2)) ?26,SROPS(2) W ?76,SRREL,?93,$E(SRTECH,1,20),?120,SRANT_$S(SRANT:" MINS.",1:"")
 W ! W:$P($G(^SRF(SRTN,"NON")),"^")="Y" "NON-O.R." W:$D(SROPS(3)) ?26,SROPS(3) W ?76,SRASS,?93,SRAGNT,!
 I $D(SROPS(4)) W ?26,SROPS(4),! W:$D(SROPS(5)) ?26,SROPS(5),! I $D(SROPS(6)) W ?26,SROPS(6),!
 Q
HDR I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRF=1 Q
 W:$Y @IOF W !,?(132-$L(SRINST)\2),SRINST,?120,"PAGE: "_PAGE,!,?58,"SURGICAL SERVICE",?100,"REVIEWED BY:",!,?53,"ANESTHESIA PROVIDER REPORT",?100,"DATE REVIEWED:"
 W !,?(132-$L(SRFRTO)\2),SRFRTO,?100,"DATE PRINTED: "_SRPRINT
 W !!,"DATE",?10,"PATIENT",?26,"PROCEDURE(S)",?77,"SUPERVISOR",?96,"ASA CLASS",?111,"LEVEL OF SUPERVISION",!,"CASE #",?12,"ID#",?76,"RELIEF ANESTH",?92,"PRINCIPAL TECHNIQUE",?113,"ELAPSED ANES TIME",!,?76,"ASST ANESTH"
 W ?93,"ANESTHESIA AGENT",! F LINE=1:1:132 W "="
 S PAGE=PAGE+1 I $D(PRIN) W !!,?2,"***** "_PRIN_" *****",!
 Q
PAGE I $E(IOST)'="P" W !!,"Press RETURN to continue, '^' to quit  " R ASK:DTIME I '$T!(ASK="^") S SRF=1 Q
 D HDR Q
END I $E(IOST)'="P",'SRF W !!,"Press RETURN to continue  " R X:DTIME
 W:$E(IOST)="P" @IOF I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP)  S ZTREQ="@" Q
 D ^SRSKILL K SRTN D ^%ZISC W @IOF
 Q
OTHER ; other operations
 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>250 S SRLONG=0,OPER=999,SROPERS=" ..."
 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
 Q
AGENT S SRAGNT=$O(^SRF(SRTN,6,SRT,1,0)) Q:SRAGNT=""  S SRAGNT=$P(^SRF(SRTN,6,SRT,1,SRAGNT,0),"^") D
 .D DATA^PSS50(SRAGNT,,,,,"SRRX") S SRAGNT=$P($G(^TMP($J,"SRRX",SRAGNT,.01)),"^") K ^TMP($J,"SRRX",SRAGNT)
 Q
PR S SRSOUT=0 D HDR G END:SRSOUT S PRIN=0
 F  S PRIN=$O(^TMP("SR",$J,PRIN)) Q:PRIN=""!(SRF)  W:$Y+10'>IOSL !!,?2,"***** "_PRIN_" *****",! S DATE=0 F  S DATE=$O(^TMP("SR",$J,PRIN,DATE)) Q:'DATE!(SRF)  S SRTN=0 F  S SRTN=$O(^TMP("SR",$J,PRIN,DATE,SRTN)) Q:'SRTN!(SRF)  D SET
 I '$D(^TMP("SR",$J)) W $$NODATA^SROUTL0()
 F I=$Y:1:(IOSL-8) W !
 I 'SRF D CODES^SROADOC
 G END
LOOP ; break procedure name if greater than 50 characters
 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM=""  Q:$L(SROPS(M))+$L(MM)'<50  S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
 Q