source: FOIAVistA/tag/r/SURGERY-SR/SROREQ4.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1SROREQ4 ;BIR/MAM - OPERATION REQUESTS (SHORT) ; [ 12/09/99 11:54 AM ]
2 ;;3.0; Surgery ;**26,48,92,161**;24 Jun 93;Build 5
3BEG ; entry when queued
4 K ^TMP("SR",$J) U IO S (CNT,DFN,SRSOUT)=0
5 S Y=SRSDATE,SRDT=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3) D D^DIQ S SRSDT=$E(Y,1,12)
6 F S DFN=$O(^SRF("AR",SRSDATE,DFN)) Q:'DFN S SRTN=0 F S SRTN=$O(^SRF("AR",SRSDATE,DFN,SRTN)) Q:'SRTN I $D(^SRF(SRTN,0)),$$DIV^SROUTL0(SRTN) D SET
7 W:$Y @IOF S SRSNM=0 F S SRSNM=$O(^TMP("SR",$J,SRSNM)) Q:SRSNM=""!(SRSOUT) D HDR S (SREQDT,CNT)=0 F S SREQDT=$O(^TMP("SR",$J,SRSNM,SREQDT)) Q:SREQDT=""!(SRSOUT) D MORE
8END W:$E(IOST)="P" @IOF I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
9 S:$E(IOST)="P" SRSOUT=1 I 'SRSOUT W !!,"Press RETURN to continue " R X:DTIME
10 D ^%ZISC K SRTN D ^SRSKILL W @IOF
11 Q
12MORE ; continue looping
13 S SRTN=0 F S SRTN=$O(^TMP("SR",$J,SRSNM,SREQDT,SRTN)) Q:'SRTN!(SRSOUT) D PRINT
14 Q
15SET ; set ^TMP(
16 S SRSS=$P(^SRF(SRTN,0),"^",4),SRSNM=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"ZZ")
17 S SREQDT=$P($G(^SRF(SRTN,"1.0")),"^",11) S:'SREQDT SREQDT="ZZ"
18 S ^TMP("SR",$J,SRSNM,SREQDT,SRTN)=""
19 Q
20PRINT ; print from ^TMP("SR",$J)
21 I $Y+7>IOSL D PAGE I SRSOUT Q
22 S S(0)=$G(^SRF(SRTN,0)) Q:'S(0) ; << RJS *161
23 S DFN=$P(S(0),"^"),CNT=CNT+1
24 D DEM^VADPT S SRNAME=VADM(1),SROPER=$P(^SRF(SRTN,"OP"),"^"),SRSUR=$P($G(^SRF(SRTN,.1)),"^",4),SRSUR=$S(SRSUR:$P(^VA(200,SRSUR,0),"^"),1:"NOT ENTERED")
25 S SRHRS=$P($G(^SRF(SRTN,.4)),"^"),SRD=$E(SRSDATE,4,5)_"/"_$E(SRSDATE,6,7)_"/"_$E(SRSDATE,2,3)
26 S:SRHRS="" SRHRS="NOT ENTERED" S C=$P(^DD(130,.035,0),"^",2),Y=$P(S(0),"^",10) D:Y'="" Y^DIQ S SRTYPE=Y,SRANES=$P($G(^SRF(SRTN,"1.0")),"^"),Y=SRANES,C=$P(^DD(130,1.01,0),"^",2) D:Y'="" Y^DIQ S SRANES=Y
27 S SRSORD=$P(S(0),"^",11),SSN=VA("PID"),SRWARD=$S($D(^DPT(DFN,.1)):^(.1),1:"") I SRTYPE'="" S SRTYPE=" ("_$P(SRTYPE,"(")_")"
28 K SROPS,MM,MMM S SROPER=SROPER_SRTYPE S:$L(SROPER)<63 SROPS(1)=SROPER I $L(SROPER)>62 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
29 W !!,CNT_".",?5,"Case Number: "_SRTN,?40,"Operation Date: "_SRD,!,?5,"Patient: ",?14,SRNAME,?40,"Ward: ",SRWARD,!,?5,"ID#: ",?14,VA("PID"),?40,"Surgeon: "_SRSUR,!,?5,"Procedure: "_SROPS(1)
30 I $D(SROPS(2)) W !,?16,SROPS(2) I $D(SROPS(3)) W !,?16,SROPS(3) I $D(SROPS(4)) W !,?16,SROPS(4)
31 W !,?5,"Estimated Case Length: "_SRHRS W:SRSORD'="" !,?5,"Case Schedule Order: "_SRSORD W:SRANES'="" !,?5,"Requested Anesthesia: "_SRANES
32 K SRSCON I $D(^SRF(SRTN,"CON")),$P(^("CON"),"^") S SRSCON=$P(^("CON"),"^") K A S SROPER=$P(^SRF(SRSCON,"OP"),"^") S:$L(SROPER)<65 SROPS(1)=SROPER I $L(SROPER)>64 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MM=""
33 I $D(SRSCON) W !,"Concurrent Case # "_SRSCON,!,SROPS(1) I $D(SROPS(2)) W !,SROPS(2) I $D(SROPS(3)) W !,SROPS(3)
34 Q
35PAGE I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I X["^" S SRSOUT=1 Q
36 W:$Y @IOF
37HDR ; print heading
38 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
39 I $Y+4>IOSL D PAGE Q
40 W !! F LINE=1:1:80 W "="
41 W !,"REQUESTS FOR "_$S(SRSNM'="ZZ":SRSNM,1:"UNKNOWN"),?70,SRDT,! F LINE=1:1:80 W "-"
42 Q
43LOOP ; break procedure if greater than 63 characters
44 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<63 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
45 Q
Note: See TracBrowser for help on using the repository browser.