source: WorldVistAEHR/trunk/r/SURGERY-SR/SROADOC1.m@ 1351

Last change on this file since 1351 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1SROADOC1 ;B'HAM ISC/MAM - ANESTHESIA PROV REPORT (CONT); [ 09/07/00 11:24 AM ]
2 ;;3.0; Surgery ;**38,39,53,50,95,151,155**;24 Jun 93
3 ;
4 ; Reference to ^PSS50 supported by DBIA #4533
5 ;
6SET ; set and print results
7 S S(0)=^SRF(SRTN,0),S(.3)=^SRF(SRTN,.3)
8 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)
9 S:SRCODE'="" SRCODE=$P(^SRO(132.95,SRCODE,0),"^",2)
10 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
11 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))
12 S:SRASS'="" SRASS=$P(^VA(200,SRASS,0),"^") I $L(SRASS)>15 S SRASS=$P(SRASS,",")_","_$E($P(SRASS,",",2))
13 S SRSDT=$E(SRSDATE,4,5)_"/"_$E(SRSDATE,6,7)
14TECH D TECH^SROPRIN S SRAGNT="" I $D(SRZ) D AGENT
15ASA 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)
16OPS K SROPERS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
17 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=""
18PRINT ; print results
19 Q:SRF I $Y+10>IOSL D CODES^SROADOC,PAGE Q:SRF
20 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
21 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:"")
22 W ! W:$P($G(^SRF(SRTN,"NON")),"^")="Y" "NON-O.R." W:$D(SROPS(3)) ?26,SROPS(3) W ?76,SRASS,?93,SRAGNT,!
23 I $D(SROPS(4)) W ?26,SROPS(4),! W:$D(SROPS(5)) ?26,SROPS(5),! I $D(SROPS(6)) W ?26,SROPS(6),!
24 Q
25HDR I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRF=1 Q
26 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:"
27 W !,?(132-$L(SRFRTO)\2),SRFRTO,?100,"DATE PRINTED: "_SRPRINT
28 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"
29 W ?93,"ANESTHESIA AGENT",! F LINE=1:1:132 W "="
30 S PAGE=PAGE+1 I $D(PRIN) W !!,?2,"***** "_PRIN_" *****",!
31 Q
32PAGE I $E(IOST)'="P" W !!,"Press RETURN to continue, '^' to quit " R ASK:DTIME I '$T!(ASK="^") S SRF=1 Q
33 D HDR Q
34END I $E(IOST)'="P",'SRF W !!,"Press RETURN to continue " R X:DTIME
35 W:$E(IOST)="P" @IOF I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
36 D ^SRSKILL K SRTN D ^%ZISC W @IOF
37 Q
38OTHER ; other operations
39 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>250 S SRLONG=0,OPER=999,SROPERS=" ..."
40 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
41 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
42 Q
43AGENT S SRAGNT=$O(^SRF(SRTN,6,SRT,1,0)) Q:SRAGNT="" S SRAGNT=$P(^SRF(SRTN,6,SRT,1,SRAGNT,0),"^") D
44 .D DATA^PSS50(SRAGNT,,,,,"SRRX") S SRAGNT=$P($G(^TMP($J,"SRRX",SRAGNT,.01)),"^") K ^TMP($J,"SRRX",SRAGNT)
45 Q
46PR S SRSOUT=0 D HDR G END:SRSOUT S PRIN=0
47 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
48 I '$D(^TMP("SR",$J)) W $$NODATA^SROUTL0()
49 F I=$Y:1:(IOSL-8) W !
50 I 'SRF D CODES^SROADOC
51 G END
52LOOP ; break procedure name if greater than 50 characters
53 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
54 Q
Note: See TracBrowser for help on using the repository browser.