source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSASOL.m@ 1306

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

initial load of WorldVistAEHR

File size: 4.7 KB
Line 
1YSASOL ;ASF/ALB- ASI ON-LINE ENTRY ;3/19/98 14:52
2 ;;5.01;MENTAL HEALTH;**24,30,32,38**;Dec 30, 1994
3MAIN(YSASPIEN,YSASSIEN) ;
4 Q:$G(YSASSIEN)'>0
5 Q:$G(YSASPIEN)'>0
6 D SCREENH^YSASA2
7 S YSASLL="",$P(YSASLL,"_",79)="" ;ASF 5/22
8 S YSIENS=YSASSIEN_","
9 S YSASTYP=$$GET1^DIQ(604,YSIENS,"CLASS")
10 S YSGP=$S(YSASTYP?1"L".E:5,YSASTYP?1"FO".E:6,1:4)
11 S DFN=YSASPIEN D DEM^VADPT S YSHDR1=VADM(1)_" "_$P(VADM(2),U,2) D KVAR^VADPT
12 S YSFILE=604,YSFLAG="EF",YSBACK=1 ;ASF 5/16
13 S YSFDA="^TMP($J,""YSASI"")"
14 K ^TMP($J,"YSASI")
15 S YSDFLAG=$$GET1^DIQ(604.8,"1,",.04)
16 S YSEFLAG=$$GET1^DIQ(604.8,"1,",.07)
17 S YSN=0,YSV=""
18LOOP ;
19 F S YSN=$O(^YSTX(604.66,YSN)) Q:YSN'>0!(YSV="^") S YSENDLP=0 D L3
20 D HEAD
21 D FILE^DIE("K","^TMP($J,""YSASI"")")
22WP ;
23 K DIRUT,DIR F Q:$D(DIRUT) D
24 . W !!?10,"*** Additional Areas ***",!,"1. Spiritual",!,"2. Leisure",!
25 . S DIR("A")="Enter Comment for? ",DIR(0)="SAO^1:Spiritual;2:Leisure" D ^DIR
26 . Q:$D(DIRUT)
27 . S DR=$S(Y=1:188,Y=2:187,1:"")
28 . S DA=YSASSIEN,DIE="^YSTX(604,"
29 . D ^DIE
30 . Q
31 ;
32 D EN^YSASSN(YSASSIEN)
33 Q
34L3 ;
35 S YSG=^YSTX(604.66,YSN,0),YSFIELD=+$P(YSG,U,3),YSQ=$P(YSG,U,2),YSDEF=$P(YSG,U,7),YSASENT=$P(YSG,U,9),YSASID=$P(YSG,U,11)
36 S YSASEX=$G(^YSTX(604.66,YSN,1))
37 Q:$P(YSG,U,YSGP)=""
38 ;
39 Q:YSENDLP ;quit if executable sets flag
40 ;
41L4 ;No form feed
42 D FDAGET S YSP=Y
43 S:YSP=""!(YSP="^") YSP=$$GET1^DIQ(604,YSIENS,YSFIELD)
44 I YSP="",YSDFLAG="YES" S YSP=YSDEF ; SET DEFAULT IF FLAG SET
45 D DISP ;W !,YSQ,$S(YSP="":": ",1:": "_YSP_" // ")
46L5 R YSV:DTIME S:'$T YSV="^"
47 S:YSV="" YSV=YSP
48 Q:YSV=""!(YSV="^")
49 I YSV?1"^"1A1N.E D Q:YSNN1'=0
50 . I YSV?1"^"1L.N S YSV="^"_$C($A(YSV,2)-32)_$E(YSV,3,9)
51 . S (YSNN,YSNN1)=0,YSBACK=YSN-.01 ;ASF 5/16
52 . S YSNN=$O(^YSTX(604.66,"C",$E(YSV,2,9)))
53 . Q:$E(YSNN,1,$L(YSV)-1)'=$E(YSV,2,9)
54 . S:$L(YSNN) YSNN1=$O(^YSTX(604.66,"C",YSNN,-1))
55 . S:YSNN1 YSN=YSNN1-.01
56 ;
57 I YSV="^b"!(YSV="^B") S:$D(YSBACK) YSN=YSBACK Q ;ASF 5/16
58 I YSV="?" D DISPQ G L4
59 I YSV?1"??"."?" D G L5
60 .I YSFIELD'=.09,YSFIELD'=2,YSFIELD'=9.14,YSFIELD'=10.45,YSFIELD'=14.26,YSFIELD'=14.28 W $C(7)," No extended help available " Q
61 . I YSFIELD=2 D HEAD D D ANS
62 .. S DIC="^YSTX(604.26,",DIC(0)="FIS",D="B",DZ="??" D DQ^DICQ K DIC,DIE,DID,D,DIX,DO
63 . I YSFIELD=10.45 D HEAD D D ANS
64 .. S DIC="^YSTX(604.77,",DIC(0)="FIS",D="B",DZ="??" D DQ^DICQ K DIC,DIE,DID,D,DIX,DO
65 . I YSFIELD=14.26!(YSFIELD=14.28) D HEAD D D ANS
66 .. S DIC="^YSTX(604.3,",DIC(0)="FIS",D="B",DZ="??" D DQ^DICQ K DIC,DIE,DID,D,DIX,DO
67 . I YSFIELD=9.14 D HEAD D D ANS
68 .. S Y=0 F S Y=$O(^YSTX(604.68,3,1,Y)) Q:Y'>0 W !,^(Y,0)
69 . I YSFIELD=.09 D HEAD D
70 .. S DIC="^VA(200,",DIC(0)="AEQM",DIC("A")="Select Interviewer: "
71 .. D ^DIC S YSP=$S(+Y>0:$P(Y,U,2),1:"????") K DIC D ANS ;ASF 5/16
72 . Q
73 I YSV?1"^C".E!(YSV?1"^c".E) D G L4
74 . S DIE="^YSTX(604,",DA=YSASSIEN
75 . S DR=$S(YSASID?1"G".E:.6,YSASID?1"M".E:8.5,YSASID?1"E".E:9.5,YSASID?1"D".E:10.5,YSASID?1"L".E:14.5,YSASID?1"H".E:16.5,YSASID?1"F".E:18.5,YSASID?1"P".E:19.5,1:"")
76 . I DR D
77 .. D HEAD
78 . D ^DIE
79 ;
80 S:YSV?1N.N YSV=+YSV ;ASF 5/16/97
81 D VAL
82 I YSA="^" W $C(7),"?? " G L5
83 W ?$X+3,YSA(0)
84 I YSEFLAG="YES" X YSASEX ; branch if parameters allowed
85 Q
86VAL ;
87 D VAL^DIE(YSFILE,YSIENS,YSFIELD,YSFLAG,YSV,.YSA,YSFDA,"^TMP($J,""YSASERR"")")
88 Q
89TEST D MAIN(1,30) Q
90FDAGET ;
91 S Y=$$VALUE1^DILF(YSFILE,YSFIELD,YSFDA)
92 S:Y'=""&(Y'="^") Y=$$EXTERNAL^DILFD(YSFILE,YSFIELD,"",Y)
93 Q
94DISP ;display question
95 D HEAD
96 W ?15,YSASRV1,YSASID,YSASRV0," "
97 W $S(YSASID?1"G".E:"General Information",YSASID?1"M".E:"Medical Status",YSASID?1"E".E:"Employment Status",YSASID?1"D".E:"Drug/Alcohol Status",YSASID?1"L".E:"Legal Status",1:"")
98 W $S(YSASID?1"P".E:"Psychiatric Status",YSASID?1"H".E:"Family History",YSASID?1"F".E:"Family/Social Relationships",1:"")
99HINT ;
100 S DX=0,DY=20 X IOXY W YSASLL ;ASF 5/22
101 W !,$G(^YSTX(604.66,YSN,3,1,0)),!,$G(^YSTX(604.66,YSN,3,2,0))
102 W !,$E($G(^YSTX(604.66,YSN,3,3,0)),1,50),?62,YSASRV1,"Enter ? for help",YSASRV0
103 S DX=0,DY=3 X IOXY
104 W YSASRV1 S J=0 F S J=$O(^YSTX(604.66,YSN,2,J)) Q:J'>0 W !,$S(J=1&($P(^YSTX(604.66,YSN,0),U,10)=1)&(YSASTYP="FOLLOWUP"):"* ",1:""),^YSTX(604.66,YSN,2,J,0)
105 W YSASRV0
106 I YSFIELD>3,YSFIELD'=10.45,YSFIELD'=14.26,YSFIELD'=14.28,$P(^DD(604,YSFIELD,0),U,2)?.E1"P".E D
107 . S YSATRIB=$P(^DD(604,YSFIELD,0),U,3) ;$$GET1^DID(YSFILE,YSFIELD,"","POINTER")
108 . S DIC="^"_YSATRIB,DIC(0)="FIS",D="B",DZ="??" D DQ^DICQ K DIC,DIE,DID,D,DIX,DO
109 E I YSFIELD'=9.14 W ! D HELP^DIE(604,"",YSFIELD,"?"),MSG^DIALOG("HW") W !
110 I YSFIELD=9.14 W !!!,^DD(604,YSFIELD,3),!
111 ;
112ANS W:$Y<10 !
113 W !,YSASID_" Answer",$S(YSP="":": ",1:": "_YSP_" // ")
114 Q
115DISPQ ;????
116 D HEAD
117 D EN^DDIOL("","^YSTX(604.68,21,1)")
118 S DX=0,DY=22 X IOXY K DIR S DIR(0)="E" D ^DIR
119 Q
120HEAD ;
121 W @IOF,IOHOME,IOEDEOP
122 W YSHDR1,?45,"Addiction Severity Index ",YSASRV1,YSASTYP,YSASRV0,!
123 W YSASLL,! ;ASF 5/22
124 Q
Note: See TracBrowser for help on using the repository browser.