source: WorldVistAEHR/trunk/r/SURGERY-SR/SROWC2.m@ 619

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

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1SROWC2 ;B'HAM ISC/ADM - WOUND CLASSIFICATION REPORT (CONT.) ; [ 07/27/98 2:33 PM ]
2 ;;3.0; Surgery ;**50**;24 Jun 93
3 S (SRHDR,SRSOUT)=0,PAGE=1 K ^TMP("SR",$J)
4 F S SRSD=$O(^SRF("AC",SRSD)) Q:'SRSD!(SRSD>SRED) S SRCASE=0 F S SRCASE=$O(^SRF("AC",SRSD,SRCASE)) Q:'SRCASE I $D(^SRF(SRCASE,0)),$$MANDIV^SROUTL0(SRINSTP,SRCASE) D UTIL
5 D CLIST
6 S SRWC="" F S SRWC=$O(^TMP("SR",$J,SRWC)) Q:SRWC=""!(SRSOUT) S SRSS="" F S SRSS=$O(^TMP("SR",$J,SRWC,SRSS)) Q:SRSS=""!(SRSOUT) D SPEC
7 I '$D(^TMP("SR",$J)) D HDR W !!,"No data for selected date range."
8 D END
9 Q
10SPEC S SRSPEC=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"NO SPECIALTY ENTERED") D HDR
11 S SRCASE="" F S SRCASE=$O(^TMP("SR",$J,SRWC,SRSS,SRCASE)) Q:'SRCASE!(SRSOUT) D CASE
12 Q
13UTIL ; set ^TMP
14 Q:$P($G(^SRF(SRCASE,30)),"^")'=""
15 Q:$P($G(^SRF(SRCASE,.2)),"^",12)=""
16 S SRSS=$P(^SRF(SRCASE,0),"^",4) S:SRSS="" SRSS="ZZ" I SRSP,'$D(SRSP(SRSS)) Q
17 S SRWC=$P($G(^SRF(SRCASE,"1.0")),"^",8) I SRCLASS'="ALL",SRWC'=SRCLASS Q
18 S:SRWC="" SRWC="ZZ" S ^TMP("SR",$J,SRWC,SRSS,SRCASE)=""
19 Q
20CASE ; print individual cases
21 I $Y+7>IOSL D HDR I SRSOUT Q
22 S S(0)=^SRF(SRCASE,0),DFN=$P(S(0),"^") D DEM^VADPT S SRNM=VADM(1),SRSSN=VA("PID"),Y=$P(S(0),"^",9) D D^DIQ S SRSDATE=$E(Y,1,12)
23 K SROP S SROP(1)=$P(^SRF(SRCASE,"OP"),"^")
24 S CNT=1,OP=0 F S OP=$O(^SRF(SRCASE,13,OP)) Q:'OP S CNT=CNT+1,SROP(CNT)=$P(^SRF(SRCASE,13,OP,0),"^")
25 S SRSUR=$P($G(^SRF(SRCASE,.1)),"^",4) I SRSUR S SRSUR=$P(^VA(200,SRSUR,0),"^")
26 W !,SRSDATE,?18,SRNM,?50,SRSUR,!,SRCASE,?18,VA("PID"),!
27 S CNT=0 F S CNT=$O(SROP(CNT)) Q:'CNT S SROPER="* "_SROP(CNT) D OPS W !
28 F LINE=1:1:80 W "-"
29 Q
30OPS ; print operations
31 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=""
32 W ?18,SROPS(1) I $D(SROPS(2)) W !,?18,SROPS(2) I $D(SROPS(3)) W !,?18,SROPS(3) I $D(SROPS(4)) W !,?18,SROPS(4)
33 Q
34LOOP ; break procedure if greater than 59 characters
35 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
36 Q
37HDR ; print heading
38 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
39 I SRHDR,$E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
40 W:$Y @IOF W !,?17,"List of Surgical Cases by Wound Classification",?75,"Page:"
41 W !,?(80-$L(SRFRTO)\2),SRFRTO,?77,PAGE
42 I SRWC'="" S SRWD="Wound Classification: "_SRCODE(SRWC) W !,?(80-$L(SRWD)\2),SRWD,!,SRPRINT
43 W !!,"Operation Date",?18,"Patient",?50,"Surgeon/Provider",!,"Case #",?18,"ID #",! F LINE=1:1:80 W "="
44 I $D(SRSPEC) W !,?(80-$L(">> "_SRSPEC_" <<")\2),">> "_SRSPEC_" <<",!
45 S SRHDR=1,PAGE=PAGE+1
46 Q
47END W:$E(IOST)="P" @IOF I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
48 I 'SRSOUT,$E(IOST)'="P" W !!,"Press RETURN to continue " R X:DTIME
49 D ^%ZISC,^SRSKILL W @IOF
50 Q
51CLIST ; get list of wound class codes
52 N SRLIST,SRC,SRP,I,J,X,Y D HELP^DIE(130,"",1.09,"S","SRLIST")
53 F I=2:1:SRLIST("DIHELP") S X=SRLIST("DIHELP",I),Y=$F(X," "),SRC=$E(X,1,Y-2) F J=Y:1 I $E(X,J)'=" " S SRP=$E(X,J,99),SRCODE(SRC)=SRP Q
54 S SRCODE("ZZ")="NO CLASS ENTERED"
55 Q
Note: See TracBrowser for help on using the repository browser.