source: WorldVistAEHR/trunk/r/SURGERY-SR/SRSAVL1.m@ 1154

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1SRSAVL1 ;B'HAM ISC/MAM - LIST REQUEST ON DISPLAY ; [ 07/27/98 2:33 PM ]
2 ;;3.0; Surgery ;**50**;24 Jun 93
3REQUEST ; list requests
4 W !!,"Press RETURN to list Operation Requests, or '^' to quit: " R SRX:DTIME I '$T!(SRX["^") S SRSOUT=1 Q
5 S IOP=IO_";80",%ZIS="" D ^%ZIS I SR10'="" W SR10
6ASK I SRX["?" W !!,"Enter RETURN to list all requests for this date, or '^' to return to the",!,"previous menu.",!!,"Press RETURN to list Operation Requests, or '^' to quit: " R SRX:DTIME S:'$T!(SRX["^") SRSOUT=1 Q:SRSOUT G ASK
7 S SRHDR=0,Y=SRSDATE D D^DIQ S SRDT=Y I '$D(^SRF("AR",SRSDATE)) W @IOF,!,"There are no requests entered for "_SRDT_"." Q
8 K ^TMP("SR",$J) S DFN=0 F S DFN=$O(^SRF("AR",SRSDATE,DFN)) Q:'DFN S SRTN=0 F S SRTN=$O(^SRF("AR",SRSDATE,DFN,SRTN)) Q:'SRTN D:$$DIV^SROUTL0(SRTN) UTIL
9 S SERV=0 F S SERV=$O(^TMP("SR",$J,SERV)) Q:SERV=""!(SRSOUT) D HDR S CNT=0 S SRTN=0 F S SRTN=$O(^TMP("SR",$J,SERV,SRTN)) Q:'SRTN!(SRSOUT) D PRINT
10 Q
11UTIL ; set ^TMP("SR",$J)
12 S SR(0)=^SRF(SRTN,0),SERV=$P(SR(0),"^",4),SERV=$S(SERV:$P(^SRO(137.45,SERV,0),"^"),1:"SPECIALTY NOT ENTERED")
13 S ^TMP("SR",$J,SERV,SRTN)=""
14 Q
15PRINT ; print info
16 I $Y+6>IOSL D HDR I SRSOUT Q
17 S SR(0)=^SRF(SRTN,0),DFN=$P(SR(0),"^") D DEM^VADPT S SRPAT=VADM(1)
18 S SR(.1)=$G(^SRF(SRTN,.1)),SRSUR=$P(SR(.1),"^",4) I SRSUR S SRSUR=$P(^VA(200,SRSUR,0),"^")
19 S SROPER="Procedure(s): "_$P(^SRF(SRTN,"OP"),"^") 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=""
20 S SRORD=$P(SR(0),"^",11),SRHRS=$P($G(^SRF(SRTN,.4)),"^")
21 S CNT=CNT+1 W !,CNT_".",?5,"Patient: "_SRPAT,?40,"Case Number: "_SRTN,!,?5,"Surgeon: "_SRSUR,?40,"Case Order: "_SRORD
22 W !,?5,SROPS(1) I $D(SROPS(2)) W !,?19,SROPS(2)
23 I '$D(^SRF(SRTN,"CON")) W ! Q
24 S CON=$P(^SRF(SRTN,"CON"),"^") I 'CON W ! Q
25 W !!,?8,"Concurrent Case Number: "_CON
26 S SROPER="Procedure: "_$P(^SRF(CON,"OP"),"^") 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=""
27 W !,?8,SROPS(1) I $D(SROPS(2)) W !,?19,SROPS(2)
28 W !
29 Q
30LOOP ; break procedure if greater than 60 characters
31 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
32 Q
33HDR ; print heading
34 I SRHDR W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
35 S SRHDR=1
36 W @IOF,!,?17,"Requested Operative Procedures for "_SRDT,!,?(80-$L("Surgical Specialty: "_SERV)\2),"Surgical Specialty: "_SERV,! F LINE=1:1:80 W "-"
37 Q
Note: See TracBrowser for help on using the repository browser.