source: WorldVistAEHR/trunk/r/SURGERY-SR/SROACCM.m@ 1742

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1SROACCM ;BIR/MAM - TOTAL CPTS ;12/15/98 11:34 AM
2 ;;3.0; Surgery ;**59,50,88,127,142**;24 Jun 93
3EN ; entry when queued
4 U IO S SRSOUT=0,SRINST=SRSITE("SITE") K ^TMP("SR",$J)
5 N SRFRTO S Y=SDATE X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: " S Y=EDATE X ^DD("DD") S SRFRTO=SRFRTO_Y
6 S SRSDT=SDATE1 F S SRSDT=$O(^SRF("AC",SRSDT)) Q:SRSDT>EDATE1!('SRSDT) S SRTN=0 F S SRTN=$O(^SRF("AC",SRSDT,SRTN)) Q:'SRTN I $D(^SRF(SRTN,0)),$$DIV^SROUTL0(SRTN) D UTIL
7 D HDR Q:SRSOUT
8 S CPT=0 F S CPT=$O(^TMP("SR",$J,CPT)) Q:'CPT!(SRSOUT) D PRINT
9 I '$D(^TMP("SR",$J)) W $$NODATA^SROUTL0()
10 Q
11PRINT ; print info
12 I $Y+6>IOSL D PAGE I SRSOUT Q
13 S TOT1=$S($D(^TMP("SR",$J,CPT,1)):^(1),1:0),TOT2=$S($D(^TMP("SR",$J,CPT,2)):^(2),1:0),TOT=TOT1+TOT2
14 S Y=$$CPT^ICPTCOD(CPT,EDATE),CPT1=$P(Y,"^",2)_" "_$P(Y,"^",3)
15 W !,CPT1,?55,TOT,?79,TOT1,?110,TOT2,! F LINE=1:1:132 W "-"
16 Q
17PAGE I $E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
18HDR ; print heading
19 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
20 W:$Y @IOF W !,?(132-$L(SRINST)\2),SRINST,!,?57,"SURGICAL SERVICE",?100,"REVIEWED BY",!,?50,"CUMULATIVE REPORT OF CPT CODES",?100,"DATE REVIEWED:"
21 W !,?(132-$L(SRFRTO)\2),SRFRTO
22 W !,$S(SRFLG=1:"O.R. SURGICAL PROCEDURES",SRFLG=2:"NON-O.R. PROCEDURES",1:"O.R. SURGICAL PROCEDURES AND NON-O.R. PROCEDURES")
23 W !!,"CPT CODE - SHORT DESCRIPTION",?50,"TOTAL PROCEDURES",?72,"TOTAL PRINCIPAL PROCEDURES",?104,"TOTAL OTHER PROCEDURES",! F LINE=1:1:132 W "="
24 Q
25UTIL ; set ^TMP("SR")
26 S SRNON=0 I $P($G(^SRF(SRTN,"NON")),"^")="Y" S SRNON=1
27 I SRFLG=1!(SRFLG=3&('SRNON)) Q:$P($G(^SRF(SRTN,.2)),"^",12)=""
28 I SRFLG=2 Q:'SRNON
29 I $P($G(^SRF(SRTN,30)),"^")'="" Q
30 S CPT=$P($G(^SRO(136,SRTN,0)),"^",2) I CPT S X=$S($D(^TMP("SR",$J,CPT,1)):^(1),1:0),^TMP("SR",$J,CPT,1)=X+1
31 S OP=0 F S OP=$O(^SRO(136,SRTN,3,OP)) Q:'OP I $D(^SRO(136,SRTN,3,OP,0)),$P(^(0),"^") S CPT=$P(^(0),"^") I CPT S X=$S($D(^TMP("SR",$J,CPT,2)):^(2),1:0),^TMP("SR",$J,CPT,2)=X+1
32 Q
Note: See TracBrowser for help on using the repository browser.