source: WorldVistAEHR/trunk/r/SURGERY-SR/SROWC1.m@ 1579

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

initial load of WorldVistAEHR

File size: 3.3 KB
RevLine 
[613]1SROWC1 ;B'HAM ISC/ADM - WOUND CLASSIFICATION REPORT (CONT.) ; [ 08/02/00 8:09 AM ]
2 ;;3.0; Surgery ;**50,95**;24 Jun 93
3 U IO N SRFRTO S Y=SRSD X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: ",Y=SRED X ^DD("DD") S SRFRTO=SRFRTO_Y,SRSD=SRSD-.0001,SRED=SRED+.9999,Y=DT X ^DD("DD") S SRPRINT="DATE PRINTED: "_Y
4 I SRFLG=2 G ^SROWC2
5 I SRFLG=3 G ^SROWC3
6 S (SRHDR,SRSOUT,SRSS,SRCT)=0 K ^TMP("SR",$J),^TMP("SRT",$J),^TMP("SRTN",$J)
7 I 'SRSP D ALL G WC
8 I SRSP D SPEC G WC
9 Q
10ALL F S SRSS=$O(^SRO(137.45,SRSS)) Q:'SRSS S ^TMP("SR",$J,SRSS)="0^0^0^0^0"
11 S ^TMP("SR",$J,"ZZ")="0^0^0^0^0"
12 Q
13SPEC F S SRSS=$O(SRSP(SRSS)) Q:'SRSS S ^TMP("SR",$J,SRSS)="0^0^0^0^0"
14 Q
15WC S ^TMP("SRT",$J)="0^0^0^0^0^0",SRCOMP=0
16 F S SRSD=$O(^SRF("AC",SRSD)) Q:'SRSD!(SRSD>SRED) S SROP=0 F S SROP=$O(^SRF("AC",SRSD,SROP)) Q:'SROP I $D(^SRF(SROP,0)),$$MANDIV^SROUTL0(SRINSTP,SROP) D UTIL
17 D HDR S SRSS="" F S SRSS=$O(^TMP("SR",$J,SRSS)) Q:SRSS=""!(SRSOUT) S SRCT=SRCT+1 D PRINT
18 D TOTAL,END
19 Q
20UTIL ; set ^TMP
21 Q:$P($G(^SRF(SROP,30)),"^")'=""
22 Q:$P($G(^SRF(SROP,.2)),"^",12)=""
23 S SRSS=$P(^SRF(SROP,0),"^",4) S:SRSS="" SRSS="ZZ" I SRSP,'$D(SRSP(SRSS)) Q
24 S SRWC=$P($G(^SRF(SROP,"1.0")),"^",8),SRP=$S(SRWC="C":1,SRWC="CC":2,SRWC="D":3,SRWC="I":4,1:5)
25 S $P(^TMP("SR",$J,SRSS),"^",SRP)=$P(^TMP("SR",$J,SRSS),"^",SRP)+1 S:SRP=5 ^TMP("SRTN",$J,SRSS,SRSD,SROP)=""
26 S $P(^TMP("SRT",$J),"^",SRP)=$P(^TMP("SRT",$J),"^",SRP)+1,$P(^TMP("SRT",$J),"^",6)=$P(^TMP("SRT",$J),"^",6)+1
27 I SRP=1 S (SRC,SRIN)=0 F S SRC=$O(^SRF(SROP,16,SRC)) Q:'SRC S SRCAT=$P(^SRF(SROP,16,SRC,0),"^",2) I SRCAT=1!(SRCAT=2) S SRIN=1
28 I SRP=1,SRIN S SRCOMP=SRCOMP+1
29 Q
30PRINT ; print info
31 I $Y+5>IOSL D HDR I SRSOUT Q
32 S SRSPEC=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"NO SPECIALTY ENTERED")
33 S Y=^TMP("SR",$J,SRSS),SRC=$P(Y,"^"),SRCC=$P(Y,"^",2),SRD=$P(Y,"^",3),SRI=$P(Y,"^",4),SRZZ=$P(Y,"^",5)
34 I 'SRSP,'(SRC+SRCC+SRD+SRI+SRZZ) Q
35 W !,$P(SRSPEC,"("),?21,$J(SRC,5),?33,$J(SRCC,5),?47,$J(SRD,5),?61,$J(SRI,5),?73,$J(SRZZ,5)
36 Q
37TOTAL ; print totals
38 Q:SRSOUT I $Y+8>IOSL D HDR I SRSOUT Q
39 S Y=^TMP("SRT",$J),SRC=$P(Y,"^"),SRCC=$P(Y,"^",2),SRD=$P(Y,"^",3),SRI=$P(Y,"^",4),SRZZ=$P(Y,"^",5),SRT=$P(Y,"^",6)
40 I SRCT>1 W !!,"SUB TOTAL:",?21,$J(SRC,5),?33,$J(SRCC,5),?47,$J(SRD,5),?61,$J(SRI,5),?73,$J(SRZZ,5)
41 W !!,"TOTAL: ",SRT S:SRC=0 SRC=1 W !!,"CLEAN WOUND INFECTION RATE: ",$J((SRCOMP/SRC*100),5,1),"%"
42 Q
43HDR ; print heading
44 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
45 I $E(IOST)'="P" D HDR1 Q
46 W:$Y @IOF W !,?(80-$L(SRINST)\2),SRINST,!,?32,"SURGICAL SERVICE",!,?26,"WOUND CLASSIFICATION REPORT",!,?(80-$L(SRFRTO)\2),SRFRTO,!,?(80-$L(SRPRINT)\2),SRPRINT
47 W !,?21,"REVIEWED BY:",?45,"DATE REVIEWED:",!
48 W !,?34,"CLEAN",?72,"NO CLASS",!,"SURGICAL SERVICE",?22,"CLEAN",?31,"CONTAMINATED",?46,"CONTAMINATED",?61,"INFECTED",?73,"ENTERED"
49 W ! F LINE=1:1:80 W "="
50 W ! Q
51HDR1 ; print heading to screen
52 I SRHDR W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
53 W @IOF,!,?26,"WOUND CLASSIFICATION REPORT",!,?(80-$L(SRFRTO)\2),SRFRTO
54 W ! F LINE=1:1:80 W "-"
55 W !!,?34,"CLEAN",?72,"NO CLASS",!,"SURGICAL SERVICE",?22,"CLEAN",?31,"CONTAMINATED",?46,"CONTAMINATED",?61,"INFECTED",?73,"ENTERED"
56 S SRHDR=1 W !
57 Q
58END W:$E(IOST)="P" @IOF K ^TMP("SRT",$J),^TMP("SRTN",$J) I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
59 I 'SRSOUT,$E(IOST)'="P" W !!,"Press RETURN to continue " R X:DTIME
60 D ^%ZISC,^SRSKILL W @IOF
61 Q
Note: See TracBrowser for help on using the repository browser.