source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSCEN39.m@ 724

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

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1YSCEN39 ;ALB/ASF-PASS REPORT ;4/3/90 10:29 ;
2 ;;5.01;MENTAL HEALTH;;Dec 30, 1994
3 ;
4ENPASS ; Called from MENU option YSCENPASS
5 ;
6 R !!,"(L)ast Transfer/Pass or (O)n Pass list? On Pass// ",X:DTIME S YSTOUT='$T,YSUOUT=X["^" I YSTOUT!YSUOUT G END1
7 S X=X_"O",X=$TR($E(X),"lo","LO") I "OL"'[X W !,"Enter 'O' for patients currently on pass, 'L' for list of all pts last transfer type",$C(7) G ENPASS
8 S YSFLG=1 S:"L"[X YSFLG=0
9 D AX^YSCEN3 G:Y<1!POP END1 I $D(IO("Q")) K IO("Q") S ZTRTN="PASQ^YSCEN39",ZTDESC="YS IP PASS" F ZZ="T6","W1","W2","YSFLG" S ZTSAVE(ZZ)=""
10 I D ^%ZTLOAD W !,$S($D(ZTSK):"QUEUED",1:"Not queued"),$C(7) G END1
11PASQ ;
12 K YSOPT1 S (Q3,P,P1)=0,YSOPT2="ENPASS1^YSCEN39" D:T6'="A" L2^YSCEN2 D:T6="A" L1^YSCEN2
13END1 ;
14 K B,D1,YSC,YSFLG,A,YSOPT1,YSOPT2,X,Y,YST,YST1,P,P1,YSPRG,DA,YSDFN,YSPRG3,YSO,T6 G END^YSCEN2
15ENPASS1 ;
16 Q:Q3 D H1 S N3="",YSC=0 F S N3=$O(^UTILITY($J,N3)) Q:N3="" D PASS1 Q:Q3
17 W !!?30,YSC," Patients ",$S(YSFLG:"on Pass",1:"listed") D WAIT^YSCEN1 Q
18PASS1 ;
19 S YSDFN=0 F S YSDFN=$O(^UTILITY($J,N3,YSDFN)) Q:'YSDFN!Q3 S DFN=YSDFN,VAIP("D")="L" D IN5^VADPT,DEM^VADPT S D1=VAIP(1) I (D1]"")&($P(VAIP(2),U)=2) S YST1=$P(VAIP(3),U),YST=$P(VAIP(4),U) D L2A^YSCEN34
20 Q
21H1 ;
22 S YSTLE=$S(YSFLG=0:"LAST TRANSFER/",1:"ON ")_"PASS LIST" W:$Y>1 @IOF W "WARD: ",W2,?$X+(IOM-$X-25-($L(YSTLE))/2),YSTLE D TIME^YSCEN2
23 I $D(YSOPT9L) W !?3,YSOPT9L,$P(^VA(200,YSWHO,0),U)
24 S G2=^YSG("SUB",T6,0)
25 W !,"TEAM: ",$P(G2,U),?20," Beds: ",$P(^YSG("SUB",T6,1),U,3),?35," Patients: ",YSTM S X=$P(G2,U,9) W !,"Team Leader: " D D3 W ?20," Physician: " S X=$P(G2,U,2) D D3 W ?50," Psychologist: " S X=$P(G2,U,3) D D3
26H12 ;
27 W !,"NAME",?22,"DATE",?35,"TYPE",?64,"TO",?68,$S(YSFLG=0:"EXPECT/FROM",1:"RETURNING"),!
28 S C1="",$P(C1,"-",79)="" W C1,! Q
29D3 ;
30 Q:X'?1N.N S X=$P(^VA(200,X,0),U),X(2)=$E($P(X,",",2),1,2) S X(2)=$S(X(2)?1P.E:$E(X(2),2),1:$E(X(2))) W $P(X,","),",",X(2) Q
31 ;
32NM ; Called from MENU option YSCENNAM
33 ;
34 W @IOF,!?IOM-$L("PATIENT NAME SEARCH")\2,"PATIENT NAME SEARCH"
35L ;
36 R !!,"Enter first letters of patient's LAST name: ",S:DTIME S YSTOUT='$T,YSUOUT=S["^" G:YSTOUT!YSUOUT END
37 S YSR1="S",YSR2="",YSR3="?1A.ANP",YSR4="Enter the alphabetic characters of the patients last name only! Do not use more letters than you are sure are correct."
38 D ^YSCEN14 G L:S="?",END:S=-1
39 F ZZ=1:1:$L(S) I $E(S,ZZ)?1L S D=$E(S,ZZ),D=$A(D)-32,S=$E(S,0,ZZ-1)_$C(D)_$E(S,ZZ+1,30)
40L1 ;
41 K ^UTILITY($J) W !?50 S YSFS=0,L=$L(S),V3=0
42 S YSDFN=0 F S YSDFN=$O(^YSG("INP","CP",YSDFN)) Q:'YSDFN S DA=$O(^(YSDFN,0)),YSNM=$P(^DPT(YSDFN,0),U) I $E(YSNM,1,L)=S S ^UTILITY($J,YSNM,YSDFN)=DA
43 D L2,L4:V3 I $D(V3) W !!,"SEARCH COMPLETE",! W:'V3 "**** NO INPATIENTS FOUND WITH LAST NAMES BEGINNING: ",S
44END ;
45 K A,B3,D,DA,I,I0,L,S,S1,T,V3,W1,W2,X,X1,X2,YS,YSFS,YSLFT,YSNM,YSDFN,YSNOFORM,YSCENN Q
46 Q
47L2 ;
48 S (YSNM,I)="",$P(I,"=",79)="" W !?40,"Ward",?57,"Team",!,I F S YSNM=$O(^UTILITY($J,YSNM)) Q:YSNM="" D
49 .S V3=V3+1,YSDFN=$O(^(YSNM,0)),DA=^(YSDFN),W1=$P(^YSG("INP",DA,7),U),YS(V3)=YSDFN_U_W1_U_DA
50 .W !,$J(V3,3)," ",YSNM,?40,$P(^DIC(42,W1,0),U),?55," ",$P(^YSG("SUB",$P(^YSG("INP",DA,0),U,4),0),U)
51 Q
52L4 ;
53 R !!,"Enter above number for patient profile or return to continue: ",B3:DTIME S YSTOUT='$T,YSUOUT=B3["^" Q:YSTOUT
54 S YSR1="B3",YSR2="",YSR3=V3,YSR4="Enter 1 to "_V3_" or just hit return to to continue" D:B3]"" ^YSCEN14 K YSR1,YSR2,YSR3 G L4:B3="?" Q:B3'?1N.N
55 S YSDFN=+YS(B3),DA=$P(YS(B3),U,3),^DISV(DUZ,"^DPT(")=YSDFN,^DISV(DUZ,"^YSG(""INP"",")=DA
56 K ^UTILITY($J),DA,V3,B3,YSNM,S,I,YSNOFORM S YST=0,DA=YSDFN,YSA8="1,2,3,4,5,6,7,8,9,10",YSCENN=1 D ENPT^YSUTL,ENP^YSPPJ Q
Note: See TracBrowser for help on using the repository browser.