source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDF.m@ 1078

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

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1SDF ;SF/GFT - FILE ROOM LIST BY CLINIC ; 12 SEP 84 9:48 am
2 ;;5.3;Scheduling;;Aug 13, 1993
3 S U="^",DIV="" D DIV^SDUTL I $T D FRLST^SDDIV G QUIT:Y<0
4 S %DT="AXE",%DT("A")="LIST APPOINTMENTS FOR WHAT DATE: " D ^%DT K %DT("A") G QUIT:Y<0 S SDDT=Y
5A S Z="^CLINIC^TERMINAL DIGIT" W !,"ENTER 'C'LINIC IF YOU WANT LIST PRINTED BY CLINIC AND TERMINAL DIGIT ORDER" R !,"APPOINTMENT LIST ORDER: TERMINAL DIGIT ONLY// ",X:DTIME D IN^DGHELP G HELP:X["?",QUIT:X["^",A:"CT"'[X S ANS=$S(X']"":"T",1:X)
6 S VAR="DIV^ANS^SDDT",VAL=DIV_"^"_ANS_"^"_SDDT,PGM="START^SDF" D ZIS^DGUTQ G QUIT:POP
7START K ^UTILITY($J) G:ANS="T" ^SDF1
8 S A=0 F AA=0:0 S A=$N(^SC("B",A)) Q:A<0 S C=$N(^SC("B",A,0)) I $D(^SC(C,0)),$S('$D(^SC(C,"I")):1,+^("I")=0:1,+^("I")>SDDT:1,+$P(^("I"),"^",2)'>SDDT&(+$P(^("I"),"^",2)'=0):1,1:0) D AHEAD
9 G LST
10AHEAD I $S(DIV="":1,$P(^SC(C,0),"^",15)=DIV:1,1:0),$P(^(0),"^",3)="C",$P(^(0),"^",17)'="Y"!$P(^(0),"^",21) F SC="S","C" F D=SDDT-.01:0 S D=$N(^SC(C,SC,D)) Q:D\1-SDDT F P=0:0 S P=$N(^SC(C,SC,D,1,P)) Q:P'>0 S X=^(P,0) D C:$D(^DPT(+X,0))
11 Q
12LST U IO S DA=0
13 F SC=0:0 S SC=$N(^UTILITY($J,SC)) Q:SC<0 S SDHED=1 F I=0:0 S DA=$N(^UTILITY($J,SC,DA)) Q:DA<0 F X=0:0 S X=$N(^UTILITY($J,SC,DA,X)) Q:X'>0 S D=^DPT(X,0) D SMORE
14 W ! W:$E(IOST)'="C" @IOF D CLOSE^DGUTQ G QUIT
15 ;
16C S DA=$E($P(^(0),U,9),6,9),DA=$E(DA,3,4)_$E(DA,1,2),X=$P(X_"^^^^^",U,1,5) ; NAKED REFERENCE - ^DPT(DFN,0)
17 I $D(^DPT(+X,"S",D,0)) S SDAPTT=$P(^(0),U,16) I $P(^(0),U,2)["C"!($P(^SC(C,SC,D,1,P,0),U,9)="C") S X=X_"^***CANCELLED!***"
18 S ^UTILITY($J,C," "_DA,+X,D)=C_U_X,$P(^UTILITY($J,C," "_DA,+X,D),U,8)=$S($D(^DPT(+X,.1)):^(.1),1:"")
19 I $D(^DPT(+X,.36)),$D(^DIC(8,+^DPT(+X,.36),0)),$P(^(0),"^",9)=13 S $P(^UTILITY($J,C," "_DA,+X,D),U,9)="** COLLATERAL **" Q
20 I SC="S",$P(^SC(C,SC,D,1,P,0),"^",10)]"" S V=$P(^(0),"^",10),V=$S($D(^DIC(8,+V,0)):$P(^(0),"^",9)=13,1:0) I V S $P(^UTILITY($J,C," "_DA,+X,D),U,9)="** COLLATERAL **"
21 S $P(^UTILITY($J,C," "_DA,+X,D),U,10)=$S('$D(SDAPTT):"",$D(^SD(409.1,+SDAPTT,0)):$P(^(0),"^",4),1:"UNSPECIFIED")
22 K V Q
23 ;
24O D:SDHED!($Y+2>IOSL) WHED S Y=^UTILITY($J,SC,DA,X,C) W !,$E($P(D,U,9),6,9),?6,$E($P(D,U,1),1,23),?30,$E($P(D,U,9),1,9),?40," " S T=$P(C,".",2)_"000" I T W $E(T,1,2),":",$E(T,3,4)
25 W ?64,$P(Y,U,10)," TYPE",!
26 I $P(Y,U,8)]"" W ?48,"** WARD: ",$P(Y,U,8)," **"
27 I $P(Y,U,7)]"" W !,?4,$P(Y,U,7)
28 I $P(Y,U,9)]"" W !,?4,$P(Y,U,9)
29 Q
30SMORE S C=0 F CC=1:1 S C=$N(^UTILITY($J,SC,DA,X,C)) Q:C<0 D O
31 Q
32WHED S SDHED=0,SDSCN=$P(^SC(SC,0),"^",1) W !,@IOF,!?9,"FILE ROOM LIST FOR APPOINTMENTS " S Y=SDDT D DT^DIQ W !,?30-($L(SDSCN)\2),SDSCN,?55,"PRINTED: " S Y=DT D DT^DIQ W !!
33 Q
34HELP W !!,"DEPENDING ON TYPE OF SORT, ENTER:",!?5,"'C' - BY CLINIC NAME",!?5,"'T' - BY TERMINAL DIGIT",! G A
35QUIT K %,%DT,A,AA,ALL,ANS,C,CC,D,DA,DIV,DTOUT,I,P,PGM,POP,SC,SDAPTT,SDDT,SDHED,SDSCN,T,VAL,VAR,X,Y,Z,^UTILITY($J) Q
Note: See TracBrowser for help on using the repository browser.