source: WorldVistAEHR/trunk/r/SURGERY-SR/SROSPSS.m@ 1313

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1SROSPSS ;B'HAM ISC/MAM - CASES W/O SPECIMENS BY SPECIALTY ; [ 07/27/98 2:33 PM ]
2 ;;3.0; Surgery ;**50**;24 Jun 93
3 S (SRHDR,SRSOUT)=0,PAGE=1,SRSDATE=SRSD-.0001,SREDT=SRED+.9999 K ^TMP("SR",$J)
4 F S SRSDATE=$O(^SRF("AC",SRSDATE)) Q:'SRSDATE!(SRSDATE>SREDT)!SRSOUT S SRTN=0 F S SRTN=$O(^SRF("AC",SRSDATE,SRTN)) Q:'SRTN!SRSOUT I $D(^SRF(SRTN,0)),$$MANDIV^SROUTL0(SRINSTP,SRTN) D UTIL
5 S SRSS="" F S SRSS=$O(^TMP("SR",$J,SRSS)) Q:SRSS=""!(SRSOUT) S SRSPEC=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"SPECIALTY NOT ENTERED"),TOTAL=0 D PAGE,DATE
6 I SRSP S SRSS="" F S SRSS=$O(SRSP(SRSS)) Q:'SRSS!SRSOUT I '$D(^TMP("SR",$J,SRSS)) S SRSPEC=$P(^SRO(137.45,SRSS,0),"^") D PAGE W !!,"TOTAL ",SRSPEC,": 0"
7 I 'SRSP,'$D(^TMP("SR",$J)) K SRSPEC D HDR W !!,"TOTAL CASES WITHOUT SPECIMENS: 0"
8 Q
9DATE S SRSDATE="" F S SRSDATE=$O(^TMP("SR",$J,SRSS,SRSDATE)) Q:'SRSDATE!(SRSOUT) S SRTN=0 F S SRTN=$O(^TMP("SR",$J,SRSS,SRSDATE,SRTN)) Q:'SRTN!(SRSOUT) D SET
10 Q:SRSOUT I $Y+5>IOSL D PAGE I SRSOUT Q
11 W !!,"TOTAL ",SRSPEC,": ",TOTAL
12 Q
13UTIL ; case information
14 Q:$P($G(^SRF(SRTN,30)),"^")'=""!($P($G(^SRF(SRTN,.2)),"^",12)="")
15 S SRSS=$P(^SRF(SRTN,0),"^",4) S:SRSS="" SRSS="ZZ" I SRSP,'$D(SRSP(SRSS)) Q
16 I $O(^SRF(SRTN,9,0)) Q
17 S ^TMP("SR",$J,SRSS,SRSDATE,SRTN)=""
18 Q
19SET ; set case variables for printing
20 I $Y+7>IOSL D PAGE I SRSOUT Q
21 S DFN=$P(^SRF(SRTN,0),"^") D DEM^VADPT S SROD=$E(SRSDATE,4,5)_"/"_$E(SRSDATE,6,7)_"/"_$E(SRSDATE,2,3)
22 S SRDIAG=$S($D(^SRF(SRTN,34)):$P(^(34),"^"),1:"DIAGNOSIS NOT ENTERED"),SR(.1)=$S($D(^SRF(SRTN,.1)):^(.1),1:""),SRSUR=$P(SR(.1),"^",4),SRATT=$P(SR(.1),"^",13)
23 I SRSUR S SRSUR=$P(^VA(200,SRSUR,0),"^") I $L(SRSUR)>20 S SRSUR=$P(SRSUR,",")_","_$E($P(SRSUR,",",2))
24 I SRATT S SRATT=$P(^VA(200,SRATT,0),"^") I $L(SRATT)>20 S SRATT=$P(SRATT,",")_","_$E($P(SRATT,",",2))
25OPS S SROPER=$P(^SRF(SRTN,"OP"),"^"),OPER=0 F I=0:0 S OPER=$O(^SRF(SRTN,13,OPER)) Q:OPER="" D OTHER
26 K SROP,MM,MMM S:$L(SROPER)<50 SROP(1)=SROPER I $L(SROPER)>49 S SROPER=SROPER_" " S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
27 W !,SROD,?20,VADM(1),?55,SRDIAG,?110,SRSUR,!,SRTN,?20,VA("PID"),?55,SROP(1),?110,SRATT I $D(SROP(2)) W !,?55,SROP(2) I $D(SROP(3)) W !,?55,SROP(3) I $D(SROP(4)) W !,?55,SROP(4)
28 S TOTAL=TOTAL+1 W !
29 Q
30PAGE I $E(IOST)="P"!('SRHDR) D HDR Q
31 W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X="^") S SRSOUT=1 Q
32 I X["?" W !!,"Press RETURN to continue listing cases, or '^' to exit from this option." G PAGE
33HDR ; print heading
34 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
35 I $Y W @IOF
36 W !,?(132-$L(SRINST)\2),SRINST,?120,"PAGE ",PAGE,!,?58,"SURGICAL SERVICE",?100,"REVIEWED BY: ",!,?55,"CASES WITHOUT SPECIMENS",?100,"DATE REVIEWED: "
37 W:$D(SRSPEC) !,?(132-$L("SURGICAL SPECIALTY: "_SRSPEC)\2),"SURGICAL SPECIALTY: ",SRSPEC
38 W !,?(132-$L(SRFRTO)\2),SRFRTO,?100,SRPRINT
39 W !!,"DATE",?20,"PATIENT",?55,"POSTOPERATIVE DIAGNOSIS",?110,"SURGEON",!,"CASE #",?20,"PATIENT ID",?55,"OPERATIVE PROCEDURE",?110,"ATTENDING SURGEON"
40 W ! F LINE=1:1:132 W "="
41 S PAGE=PAGE+1,SRHDR=1
42 Q
43OTHER ; other operations
44 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,OPER,0),"^"))>240 S SRLONG=0,OPER=999,SROPERS=" ..."
45 I SRLONG S SROPERS=$P(^SRF(SRTN,13,OPER,0),"^")
46 S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
47 Q
48LOOP ; break procedure if greater than 50 characters
49 S SROP(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROP(M))+$L(MM)'<50 S SROP(M)=SROP(M)_MM_" ",SROPER=MMM
50 Q
Note: See TracBrowser for help on using the repository browser.