source: FOIAVistA/trunk/r/SURGERY-SR/SROUNV2.m@ 711

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

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1SROUNV2 ;B'HAM ISC/MAM - UNVERIFIED CASES (ALL SPECIALTIES) ; [ 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 (SRSPEC,SRHDR)=0 F S SRSPEC=$O(^TMP("SR",$J,SRSPEC)) Q:SRSPEC=""!(SRSOUT) D HDR S SRHDR=1 S SRSDT=0 F S SRSDT=$O(^TMP("SR",$J,SRSPEC,SRSDT)) Q:'SRSDT!(SRSOUT) D CASE
6 I '$D(^TMP("SR",$J)) D HDR W !!,"No data for selected date range."
7 Q
8CASE ; get case number
9 S SRTN=0 F S SRTN=$O(^TMP("SR",$J,SRSPEC,SRSDT,SRTN)) Q:'SRTN!(SRSOUT) K SR,SROP D SET
10 Q
11SET ; set variables & print info
12 I $Y+8>IOSL D HDR I SRSOUT Q
13 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)
14 S SRSSN=VA("PID")
15 S SROPER=$P(^SRF(SRTN,"OP"),"^"),SRCPT=$P(^("OP"),"^",2) I SRCPT="" S SROPER=SROPER_" * CPT CODE MISSING *"
16 S SR(.1)=$S($D(^SRF(SRTN,.1)):^(.1),1:"")
17 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))
18 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))
19 W !,SRSDATE,?20,SRSNM_" ("_SRTN_")",?60,SRSUR,!,?20,VA("PID"),?60,SRATT,!
20 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=""
21 W !,?20,SROPS(1) I $D(SROPS(2)) W !,?20,SROPS(2) I $D(SROPS(3)) W !,?20,SROPS(3)
22 W ! F LINE=1:1:80 W "-"
23 Q
24UTIL ; set ^TMP("SR",$J)
25 I $P($G(^SRF(SRTN,"VER")),"^")="Y" Q
26 Q:'$D(^SRF(SRTN,.2)) S SR(.2)=^SRF(SRTN,.2) I $P(SR(.2),"^",12)="" Q
27 I $D(^SRF(SRTN,31)),$P(^(31),"^",8)'="" Q
28 I $D(^SRF(SRTN,30)),$P(^(30),"^")'="" Q
29 S SR(0)=^SRF(SRTN,0),SRSPEC=$P(SR(0),"^",4),SRSPECN=$S(SRSPEC:$P(^SRO(137.45,SRSPEC,0),"^"),1:"UNKNOWN")
30 S ^TMP("SR",$J,SRSPECN,SRSDT,SRTN)=""
31 Q
32HDR ; print heading
33 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
34 I SRHDR,$E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit. " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
35 W:$Y @IOF W !,?5,"List of Unverified Cases for "_SRSPEC,!!,"Operation Date",?20,"Patient (Case #)",?60,"Surgeon",!,?20,"Patient ID #",?60,"Attending Surgeon",! F LINE=1:1:80 W "="
36 Q
37LOOP ; break procedure if greater than 59 characters
38 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
39 Q
Note: See TracBrowser for help on using the repository browser.