1 | SRONOR4 ;B'HAM ISC/MAM - REPORT OF NON-O.R. PROCEDURES ; [ 07/27/98 2:33 PM ]
|
---|
2 | ;;3.0; Surgery ;**50**;24 Jun 93
|
---|
3 | K ^TMP("SR",$J) 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 $P($G(^SRF(SROP,"NON")),"^")="Y",$D(^SRF(SROP,0)),$$DIV^SROUTL0(SROP) D UTIL
|
---|
4 | S (SRSOUT,SRHDR,SRSUR)=0 F S SRSUR=$O(^TMP("SR",$J,SRSUR)) Q:SRSUR=""!(SRSOUT) D HDR S SRSD=0 F S SRSD=$O(^TMP("SR",$J,SRSUR,SRSD)) Q:'SRSD!(SRSOUT) D SROP
|
---|
5 | I '$D(^TMP("SR",$J)) D HDR W !!,"No procedures for the selected date range.",!
|
---|
6 | Q
|
---|
7 | SROP S SROP=0 F S SROP=$O(^TMP("SR",$J,SRSUR,SRSD,SROP)) Q:'SROP!(SRSOUT) D SET
|
---|
8 | Q
|
---|
9 | SET ; set and print info
|
---|
10 | I $Y+5>IOSL D HDR Q:SRSOUT
|
---|
11 | S SR=^SRF(SROP,0),DFN=$P(SR,"^") D DEM^VADPT S SRNM=VADM(1),SRSSN=VA("PID")
|
---|
12 | S X=$P(SR,"^",12),SRINOUT=$S(X="I":"INPATIENT",X="O":"OUTPATIENT",1:"???")
|
---|
13 | S Y=SRSD D DD^%DT S SRSDATE=$E(SRSD,4,5)_"/"_$E(SRSD,6,7)_"/"_$E(SRSD,2,3)_" "_$P(Y,"@",2)
|
---|
14 | S Y=$P(^SRF(SROP,"NON"),"^",8),SRSS=$S(Y:$P(^ECC(723,Y,0),"^"),1:"SPECIALTY NOT ENTERED")
|
---|
15 | S Y=$P(^SRF(SROP,"NON"),"^",2),SRLOC=$S(Y:$P(^SC(Y,0),"^"),1:"LOCATION NOT ENTERED")
|
---|
16 | S SRST=$P($G(^SRF(SROP,"NON")),"^",4) I SRST S Y=SRST D DD^%DT S SRST=$E(SRST,4,5)_"/"_$E(SRST,6,7)_"/"_$E(SRST,2,3)_" "_$P(Y,"@",2)
|
---|
17 | S SRET=$P($G(^SRF(SROP,"NON")),"^",5) I SRET S Y=SRET D DD^%DT S SRET=$E(SRET,4,5)_"/"_$E(SRET,6,7)_"/"_$E(SRET,2,3)_" "_$P(Y,"@",2)
|
---|
18 | S SROPER=$P(^SRF(SROP,"OP"),"^"),OPER=0 F S OPER=$O(^SRF(SROP,13,OPER)) Q:'OPER D OTHER
|
---|
19 | K SROPS,MM,MMM S:$L(SROPER)<50 SROPS(1)=SROPER I $L(SROPER)>49 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
|
---|
20 | S SRABORT=$S($P($G(^SRF(SROP,30)),"^"):"*ABORTED*",1:"")
|
---|
21 | W !!,SRSDATE,?15,SRNM_" ("_VA("PID")_")",?64,SRSS,?116,SRST,!,SROP,?15,SRLOC_" ("_SRINOUT_")",?64,SROPS(1),?116,SRET
|
---|
22 | W:SRABORT'="" !,SRABORT I $D(SROPS(2)) W:SRABORT="" ! W ?64,SROPS(2) I $D(SROPS(3)) W !,?64,SROPS(3) I $D(SROPS(4)) W !,?64,SROPS(4)
|
---|
23 | Q
|
---|
24 | UTIL ; set ^TMP
|
---|
25 | S Y=$P($G(^SRF(SROP,"NON")),"^",6) S SRSUR=$S(Y:$P(^VA(200,Y,0),"^"),1:"PROVIDER NOT ENTERED")
|
---|
26 | S ^TMP("SR",$J,SRSUR,SRSD,SROP)=""
|
---|
27 | Q
|
---|
28 | HDR I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
|
---|
29 | I SRHDR,$E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
|
---|
30 | W:$Y @IOF W !,?(132-$L(SRINST)\2),SRINST,!,?57,"SURGICAL SERVICE",?100,"REVIEWED BY:",!,?51,"REPORT OF NON-O.R. PROCEDURES",?100,"DATE REVIEWED:",!,?(132-$L(SRFRTO)\2),SRFRTO
|
---|
31 | W !!,"DATE",?15,"PATIENT (ID#)",?64,"SPECIALTY",?116,"START TIME",!,"CASE #",?15,"LOCATION (IN/OUT-PAT STATUS)",?64,"PROCEDURE(S)",?116,"FINISH TIME",! F LINE=1:1:132 W "="
|
---|
32 | W:SRSUR'="" !,?(124-$L("PROVIDER: "_SRSUR)\2),"*** PROVIDER: "_SRSUR_" ***" S SRHDR=1
|
---|
33 | Q
|
---|
34 | OTHER ; other operations
|
---|
35 | S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SROP,13,OPER,0),"^"))>240 S SRLONG=0,OPER=999,SROPERS=" ..."
|
---|
36 | I SRLONG S SROPERS=$P(^SRF(SROP,13,OPER,0),"^")
|
---|
37 | S SROPER=SROPER_$S(SROPERS=" ...":SROPERS,1:", "_SROPERS)
|
---|
38 | Q
|
---|
39 | LOOP ; break procedure if greater than 50 characters
|
---|
40 | S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<50 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
|
---|
41 | Q
|
---|