48 lines
2.7 KiB
Mathematica
48 lines
2.7 KiB
Mathematica
|
YSWX ;ALB/ASF-WAIT LISTS ;4/4/90 12:48 ;
|
||
|
;;5.01;MENTAL HEALTH;**37**;Dec 30, 1994
|
||
|
;
|
||
|
1 ; Called by routine YSWZ
|
||
|
S DIC="^YSG(""WAIT"",",DIC(0)="AEQ" S:$D(N2) DIC("B")=N2 D ^DIC I Y<1 K N2,N,DIC("B") Q
|
||
|
S N=+Y,N2=$P(Y,U,2) K DIC("B") Q
|
||
|
2 ; Called by routine YSWZ
|
||
|
S DIC="^YSG(""WAIT"","_N_",1,",DA(1)=N D ^DIC Q:Y<1 S N1=+Y,DA=+Y Q:'$D(YSM) I +$P(^YSG("WAIT",N,1,N1,0),U,2) W !,"PATIENT PRESENTLY ON ",N2," LIST." Q
|
||
|
S DIE=DIC,DR="1///NOW;2///^S X=""`""_DUZ;7///"_(+$H_"."_$P($H,",",2))_";3:6;8" L +^YSG("WAIT",N) D ^DIE L -^YSG("WAIT",N) S YSTOUT=$D(DUOUT),YSUOUT=$O(Y(""))]""
|
||
|
I YSTOUT!YSUOUT D ZAP K Y Q
|
||
|
K YSM Q
|
||
|
ZAP ;
|
||
|
S DIK="^YSG(""WAIT"","_N_",1,",DA=N1,V=$P(^YSG("WAIT",N,1,N1,0),U) D ^DIK S V1=^DPT(V,0),V2=$P(V1,U) W !,"< ",V2," DELETED! >" Q
|
||
|
Q
|
||
|
3 ; Called by routine YSWZ
|
||
|
S DIE="^YSG(""WAIT"","_N_",1,",DA=N1,DR="2///^S X=""`""_DUZ;3:6;8" L +^YSG("WAIT",N) D ^DIE L -^YSG("WAIT",N) S YSTOUT=$D(DTOUT),YSUOUT=$O(Y(""))]""
|
||
|
Q
|
||
|
4 ; Called by routine YSWZ
|
||
|
D SHUF^YSWX1 Q:H1'?3N.NP S DIE="^YSG(""WAIT"","_N_",1,",DA=N1,DR="2///^S X=""`""_DUZ;7///"_H1_";8" L +^YSG("WAIT",N) D ^DIE L -^YSG("WAIT",N) K ^UTILITY($J) S YSTOUT=$D(DTOUT),YSUOUT=$O(Y(""))]""
|
||
|
Q
|
||
|
5 ; Called by routine YSWZ
|
||
|
S DIE="^YSG(""WAIT"","_N_",1,",DA(1)=N,DA=N1,DR=".01////@" L +^YSG("WAIT",N) D ^DIE L -^YSG("WAIT",N) S YSTOUT=$D(DTOUT),YSUOUT=$O(Y(""))]""
|
||
|
Q
|
||
|
LP ; Called by routine YSWZ
|
||
|
S YSELIG=$P(^YSG("WAIT",N,0),U,3)
|
||
|
K ^UTILITY($J) S N3=0 F S N3=$O(^YSG("WAIT",N,1,N3)) Q:'N3 S E1=^(N3,0),S1=$P(E1,U,7),S2=$P(E1,U,8) S:YSELIG="N" S1=0 S ^UTILITY($J,S1,S2)=E1
|
||
|
Q
|
||
|
DSP ; Called by routine YSWZ
|
||
|
U IO S YSLFT=0 W @IOF F X9=0,1,2,3 I $D(^UTILITY($J,X9)) D HDR,DSP1 Q:YSLFT
|
||
|
I $P(^YSG("WAIT",N,1,0),U,4)<1 W !!,"NO PATIENTS LISTED" I $D(N2) W " ON ",N2,!
|
||
|
I IOST?1"C-".E D:'YSLFT WAIT^YSUTL
|
||
|
Q
|
||
|
DSP1 ;
|
||
|
S X3=0 F W1=1:1 S X3=$O(^UTILITY($J,X9,X3)) Q:'X3 S (YSCOMM,YSOND,YSBY,YSPROM,YSCONT,YSCAT)="",E1=^(X3),YSDFN=+E1,YSOND=$P(E1,U,2),YSBY=$P(E1,U,3),YSPROM=$P(E1,U,4),YSCONT=$P(E1,U,5),YSCAT=$P(E1,U,6),YSCOMM=$P(E1,U,9) D DSP2 Q:YSLFT
|
||
|
Q
|
||
|
DSP2 ;
|
||
|
D PT W !,W1,?3,$P(YSNM,","),",",$E($P(YSNM,",",2)),?25,$P(YSSSN,"-",3),?31,$$FMTE^XLFDT(YSOND,"5ZD"),?42,$P(^VA(200,YSBY,0),U,2)
|
||
|
S X1=DT,X2=YSOND D ^%DTC W ?46,$J(X,3),?51,$$FMTE^XLFDT(YSPROM,"5ZD"),?62,$$FMTE^XLFDT(YSCONT,"5ZD"),?74,YSCAT,!?7,"COMMENT: ",YSCOMM
|
||
|
I $Y>(IOSL-5) D:IOST?1"C-".E WAIT^YSUTL Q:YSLFT W @IOF,! D HDR
|
||
|
Q
|
||
|
PT ;
|
||
|
S X=^DPT(YSDFN,0),DFN=YSDFN D DEM^VADPT,PID^VADPT
|
||
|
S YSNM=VADM(1),YSSEX=$P(VADM(5),U),YSDOB=$P(VADM(3),U,2),YSAGE=VADM(4),YSSSN=VA("PID") K X,VA,VADM,DFN Q
|
||
|
HDR ;
|
||
|
W !!?5,$P(^YSG("WAIT",N,0),U)," WAIT LIST ",$$FMTE^XLFDT(DT,"5ZD"),?$X+3,$S(X9=1:"SERVICE CONNECTED",X9=2:"CONTRACT/OTHERS",X9=3:"NON-SERVICE CONNECTED",1:"")
|
||
|
HDR1 ;
|
||
|
W !?5,"NAME",?25,"SSN",?31,"LISTED",?42,"BY",?46,"DAYS",?51,"PROMISED",?62,"CONTACT",?74,"CAT",! Q
|