source: WorldVistAEHR/trunk/r/SURGERY-SR/SRSREQUT.m@ 1286

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1SRSREQUT ;B'HAM ISC/MAM - REQUEST UTILITIES ; 29 SEPT 1992 10:35 am
2 ;;3.0; Surgery ;;24 Jun 93
3LFTOVR ; check for outstanding requests
4 K SRCASE S (CNT,SRSRDT,SRTN)=0 F S SRSRDT=$O(^SRF("AR",SRSRDT)) Q:'SRSRDT F S SRTN=$O(^SRF("AR",SRSRDT,SRSDPT,SRTN)) Q:'SRTN D COMP I 'SRDONE S CNT=CNT+1,SRCASE(CNT)=SRTN
5 Q:'$O(SRCASE(0)) S GRAMMER=$S($D(SRCASE(2)):"requests are",1:"request is") W !!,"The following "_GRAMMER_" outstanding for "_SRNM_":",!
6 S CNT=0 F I=0:0 S CNT=$O(SRCASE(CNT)) Q:'CNT S SRTN=SRCASE(CNT),SRSDT=$P(^SRF(SRTN,0),"^",9),SRSDT=$E(SRSDT,4,5)_"-"_$E(SRSDT,6,7)_"-"_$E(SRSDT,2,3) D LIST
7UP W !!,"Do you want to update "_$S(CNT>1:"one of ",1:"")_"the outstanding request"_$S(CNT>1:"s",1:"")_" ? YES// " R SROUTS:DTIME S:'$T SROUTS="^" Q:SROUTS["^" S:SROUTS="" SROUTS="Y"
8 S SROUTS=$E(SROUTS)
9 I "YyNn"'[SROUTS W !!,"Enter a RETURN if you would like to delete, update, or change the date of the",!,"requested cases." G UP
10 I "Yy"[SROUTS S SRDFN=SRSDPT,SRSOUT=0 D OPT^SRSUPRQ S (SRSOTH,SRSOUT)=1
11NEW Q:SRSOTH W !!,"Do you want to make a new request for "_SRNM_" ? NO// " R X:DTIME I '$T!("^"[X) S X="N"
12 S X=$E(X) I "YyNn"'[X W !!,"Enter 'YES' to continue with this option to make a new request, or RETURN to",!,"quit." G NEW
13 I "Nn"[X S SRSOTH=1
14 Q
15COMP S SRDONE=0 I '$D(^SRF(SRTN,.2)) Q
16 I $P(^SRF(SRTN,.2),"^",12)="" Q
17 S SRDONE=1 K DIE,DR,DA S DA=SRTN,DIE=130,DR="36///0;Q;.09///"_$P(^SRF(SRTN,0),"^",9) D ^DIE K DR,DIE,DA
18 Q
19LIST ;
20 S SRSOP=$P(^SRF(SRTN,"OP"),"^") K SROPS,MM,MMM S:$L(SRSOP)<70 SROPS(1)=SRSOP I $L(SRSOP)>69 S SROPER=SRSOP S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
21 W !,CNT_".",?5,SRSDT,!,?5,SROPS(1) I $D(SROPS(2)) W !,?5,SROPS(2) I $D(SROPS(3)) W !,?5,SROPS(3) I $D(SROPS(4)) W !,?5,SROPS(4)
22 Q
23LOOP ; break procedure if greater than 70 characters
24 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<70 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
25 Q
Note: See TracBrowser for help on using the repository browser.