source: WorldVistAEHR/trunk/r/SURGERY-SR/SRONOP.m@ 824

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1SRONOP ;B;HAM ISC/MAM - NON-O.R. PROCEDURES ; [ 01/30/01 1:07 PM ]
2 ;;3.0; Surgery ;**44,58,64,67,70,100**;24 Jun 93
3 K SROEDIT S:$D(^XUSEC("SROEDIT",DUZ))&'$D(DUZ("SAV")) SROEDIT=1 S (SRNEWOP,SRSOUT)=0 W @IOF,!
4 K DIC S DIC("A")="Select Patient: ",DIC=2,DIC(0)="QEAMZ" D ^DIC K DIC I Y<0 S SRSOUT=1 G END
5 S DFN=+Y D DEM^VADPT S SRNM=VADM(1) D HDR
6ADT S (SRBACK,SRDT,CNT)=0 F S SRDT=$O(^SRF("ADT",DFN,SRDT)) Q:'SRDT!SRSOUT!SRNEWOP!$D(SRTN)!SRBACK S SROP=0 F S SROP=$O(^SRF("ADT",DFN,SRDT,SROP)) Q:'SROP!$D(SRTN)!SRSOUT!SRNEWOP!SRBACK D LIST
7 G:SRBACK ADT G:$D(SRTN) ASK G:SRNEWOP ^SRONOP1 G:SRSOUT END
8 I $D(SROEDIT) S CNT=CNT+1,SRCASE(CNT)="" W !,CNT_".",?4,"NEW PROCEDURE"
9SEL W !!,"Select Procedure: " R X:DTIME I '$T!("^"[X) S SRSOUT=1 G END
10 I $D(SROEDIT),X="NEW"!(X="new")!(X=CNT) G ^SRONOP1
11 I '$D(SRCASE(X)) W !!,"Enter the number corresponding to the procedure you want to edit." W:$D(SROEDIT) !,"Enter '"_CNT_"' or 'NEW' to create a new procedure" G SEL
12 S SRTN=SRCASE(X)
13ASK S SROP=SRTN,SRSDATE=$P(^SRF(SRTN,0),"^",9) I $E(SRSDATE,1,7)>DT D FUTURE G:SRSOUT END I '$D(SRTN) D HDR G ADT
14 Q:'$D(SROEDIT) D HDR W !,?1 D CASE W !!,"Do you want to edit or delete this procedure ? "
15 W !!,"1. Edit",!,"2. Delete",!!,"Select Number: 1// " R X:DTIME I '$T!(X["^") S SRSOUT=1 G END
16 S:X="" X=1 I X<1!(X>2) W !!,"Enter '1' to edit information related to this procedure, or '2' to delete",!,"this procedure from your records.",!!,"Press RETURN to continue " R X:DTIME G ASK
17 I X=1 K SROEDIT Q
18 D DEL^SRONOP1
19END I 'SRSOUT W !!,"Press RETURN to continue " R X:DTIME
20 D ^SRSKILL K SROEDIT,SRTN W @IOF
21 Q
22EDIT ; edit procedure
23 Q:'$D(SRTN) I '$D(SRNM),$D(VADM(1)) S SRNM=VADM(1)
24 I '$D(SRNM) S DFN=$P(^SRF(SRTN,0),"^") D DEM^VADPT S SRNM=VADM(1)
25 D ^SROLOCK I SROLOCK S Q3("VIEW")=""
26 N SRLCK S SRLCK=$$LOCK^SROUTL(SRTN) I 'SRLCK S Q3("VIEW")=""
27 D RT K DR S SRDTIME=DTIME,DTIME=3600,SRSOUT=1,ST="NON-O.R. PROCEDURE"_$S(SROLOCK:" **LOCKED",1:""),DIE=130,DR="[SRNON-OR]",DA=SRTN D EN2^SROVAR,^SRCUSS S DTIME=SRDTIME I 'SROLOCK D ^SROPCE1
28 S SROERR=SRTN D ^SROERR0
29 I $G(SRLCK) D UNLOCK^SROUTL(SRTN)
30 D ^SRSKILL
31 Q
32LIST ; list case
33 Q:$P($G(^SRF(SROP,"NON")),"^")'="Y"
34 I $Y+5>IOSL S SRBACK=0 D CONT Q:$D(SRTN)!SRSOUT!SRNEWOP D HDR Q:SRBACK
35 S CNT=CNT+1,SRSDATE=$P(^SRF(SROP,0),"^",9) W !,CNT_". "
36CASE S SROPER=$P(^SRF(SROP,"OP"),"^"),SRCASE(CNT)=SROP D LOCK
37 K SROPS,MM,MMM S:$L(SROPER)<60 SROPS(1)=SROPER I $L(SROPER)>59 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
38 S Y=SRSDATE D D^DIQ S SRSDATE=$P(Y,"@")_" "_$P(Y,"@",2)
39 W SRSDATE,?20,SROPS(1) I $D(SROPS(2)) W !,?20,SROPS(2) I $D(SROPS(3)) W !,?20,SROPS(3) I $D(SROPS(4)) W !,?20,SROPS(4)
40 W !
41 Q
42LOCK ; case locked?
43 I $D(SRTN),$P($G(^SRF(SRTN,"LOCK")),"^") S SROPER=SROPER_" **LOCKED**"
44 Q
45LOOP ; break procedure if greater than 60 characters
46 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<60 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
47 Q
48RT ; start RT logging
49 I $D(XRTL) S XRTN="SRONOP" D T0^%ZOSV
50 Q
51CONT W ! K DIR S DIR("A")="Select procedure or press RETURN to continue listing procedures: ",DIR(0)="FOA"
52 S DIR("?",1)="Enter the number corresponding to the desired procedures"_$S($D(SROEDIT):", enter 'NEW' to",1:"")
53 S DIR("?")=$S($D(SROEDIT):"create a new procedure, ",1:"")_"or press RETURN to continue listing procedures." D ^DIR Q:Y="" I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 Q
54 I $D(SROEDIT),Y="NEW"!(Y="new") S SRNEWOP=1 Q
55 I Y'?.N!'$D(SRCASE(+Y)) S SRBACK=1 D
56 .W !!,"Enter the number corresponding to the procedure you want to edit.",!,"If the desired procedure does not appear, press RETURN to continue",!,"listing additional procedures"
57 .W:$D(SROEDIT) ", or enter 'NEW' to create a new procedure" W ".",!
58 I SRBACK K DIR S DIR("A")=" Press RETURN to continue. ",DIR("0")="FOA" D ^DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1
59 I 'SRBACK S SRTN=+SRCASE(Y)
60 Q
61FUTURE D HDR W !,?1 D CASE W !,$C(7) K DIR
62 S DIR("A",1)=">>> The procedure you have selected has a future date.",DIR("A")=" Are you sure you have selected the correct procedure ? ",DIR("B")="NO",DIR(0)="YA" D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) S SRSOUT=1 Q
63 I 'Y K SRTN
64 Q
65HDR ; print heading
66 W @IOF,!,?1,VADM(1)_" "_VA("PID") S X=$P($G(VADM(6)),"^") W:X " * Died "_$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3)_" *" W !
67 Q
Note: See TracBrowser for help on using the repository browser.