source: WorldVistAEHR/trunk/r/SURGERY-SR/SROUNV1.m@ 1800

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1SROUNV1 ;B'HAM ISC/MAM - UNVERIFIED CASES (1 SPECIALTY) ; [ 07/27/98 2:33 PM ]
2 ;;3.0; Surgery ;**50**;24 Jun 93
3 U IO S SRSOUT=0 K ^TMP("SR",$J) S SRSDT=SDATE-.0001,SRSEDT=EDATE+.9999
4 F S SRSDT=$O(^SRF("AC",SRSDT)) Q:'SRSDT!(SRSDT>SRSEDT) S SRTN=0 F S SRTN=$O(^SRF("AC",SRSDT,SRTN)) Q:'SRTN I $D(^SRF(SRTN,0)),$$MANDIV^SROUTL0(SRINSTP,SRTN) D UTIL
5 S SRHDR=0 D HDR S SRHDR=1,SRSDT=0 F S SRSDT=$O(^TMP("SR",$J,SRSDT)) Q:'SRSDT!(SRSOUT) S SRTN=0 F S SRTN=$O(^TMP("SR",$J,SRSDT,SRTN)) Q:'SRTN!(SRSOUT) K SR,SROP D SET
6 I '$D(^TMP("SR",$J)) W !!,"No data for selected date range."
7 Q
8SET ; set variables & print info
9 I $Y+8>IOSL D HDR I SRSOUT Q
10 S SR(0)=^SRF(SRTN,0),DFN=$P(SR(0),"^") D DEM^VADPT S SRSNM=VADM(1),Y=$P(SR(0),"^",9) D D^DIQ S SRSDATE=$E(Y,1,12)
11 S SRSSN=VA("PID")
12 S SROPER=$P(^SRF(SRTN,"OP"),"^"),SRCPT=$P(^("OP"),"^",2) I SRCPT="" S SROPER=SROPER_" * CPT CODE MISSING *"
13 S SR(.1)=$S($D(^SRF(SRTN,.1)):^(.1),1:"")
14 S SRSUR=$P(SR(.1),"^",4) S:SRSUR="" SRSUR="NOT ENTERED" I SRSUR S SRSUR=$P(^VA(200,SRSUR,0),"^") I $L(SRSUR)>19 S SRSUR=$P(SRSUR,",")_", "_$E($P(SRSUR,",",2))
15 S SRATT=$P(SR(.1),"^",13) S:SRATT="" SRATT="NOT ENTERED" I SRATT S SRATT=$P(^VA(200,SRATT,0),"^") I $L(SRATT)>19 S SRATT=$P(SRATT,",")_", "_$E($P(SRATT,",",2))
16 W !,SRSDATE,?20,SRSNM_" ("_SRTN_")",?60,SRSUR,!,?20,VA("PID"),?60,SRATT,!
17 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=""
18 W !,?20,SROPS(1) I $D(SROPS(2)) W !,?20,SROPS(2) I $D(SROPS(3)) W !,?20,SROPS(3)
19 W ! F LINE=1:1:80 W "-"
20 Q
21UTIL ; set ^TMP("SR",$J)
22 I $P($G(^SRF(SRTN,"VER")),"^")="Y" Q
23 Q:'$D(^SRF(SRTN,.2)) S SR(.2)=^SRF(SRTN,.2) I $P(SR(.2),"^",12)="" Q
24 I $D(^SRF(SRTN,31)),$P(^(31),"^",8)'="" Q
25 I $D(^SRF(SRTN,30)),$P(^(30),"^")'="" Q
26 I $P(^SRF(SRTN,0),"^",4)'=SRSPEC Q
27 S ^TMP("SR",$J,SRSDT,SRTN)=""
28 Q
29HDR ; print heading
30 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
31 I SRHDR,$E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit. " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
32 W:$Y @IOF W !,?5,"List of Unverified Cases for "_SRSPECN,!!,"Operation Date",?20,"Patient (Case #)",?60,"Surgeon",!,?20,"Patient ID #",?60,"Attending Surgeon",! F LINE=1:1:80 W "="
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
Note: See TracBrowser for help on using the repository browser.