source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSASES.m@ 1093

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1YSASES ;ALB/ASF-ASI SIGNER ;3/19/97 16:47
2 ;;5.01;MENTAL HEALTH;**24**;Dec 30, 1994
3MAIN ;
4 N YSASC,YSASCL,YSASDT,YSASFLD,YSASG,YSASNUM,YSASPT,YSASTRN,YSASX,YSL,YSOK
5 I '$D(^YSTX(604,"A.81."_DUZ)) W !,"There are no completed ASIs for you to sign or incomplete ASIs",!,"for you to finish.",*7 H 2 Q
6 K ^TMP($J,"YSASI")
7 D TLD,TLP
8 W !
9 K DIR S DIR(0)="NA^1:"_YSASC_":0",DIR("A")="Select ASI number: (1:"_YSASC_") " D ^DIR K DIR
10 Q:$D(DIRUT)
11 S YSASSIEN=+^TMP($J,"YSASI",Y),YSOK=$P(^(Y),U,6)
12 S YSASPIEN=$$GET1^DIQ(604,YSASSIEN_",",.02,"I")
13 D ACTION
14 G MAIN
15 Q
16ACTION ;
17 K DIR S DIR(0)=$S(YSOK:"SB^V:View;S:Sign;Q:Quit",1:"SB^V:View;E:Edit;Q:Quit"),DIR("A")="Action",DIR("B")="Q"
18 D ^DIR K DIR
19 I Y="V" D EN1^YSASPRT(YSASSIEN) K DIRUT Q
20 I Y="S" D EN^YSASSN(YSASSIEN) Q
21 I Y="E" D MAIN^YSASA2(YSASPIEN,YSASSIEN)
22 Q
23TLD ;load ASI SIGNING list
24 K ^TMP($J,"YSASI")
25 S YSASIEN=0,YSASC=0
26 F S YSASIEN=$O(^YSTX(604,"A.81."_DUZ,YSASIEN)) Q:YSASIEN'>0 D
27 . S YSASC=YSASC+1
28 . S YSASCL=$$GET1^DIQ(604,YSASIEN_",",.04)
29 . S YSASDT=$$GET1^DIQ(604,YSASIEN_",",.05)
30 . S YSASTRN=$$GET1^DIQ(604,YSASIEN_",",.14)
31 . S YSASPT=$$GET1^DIQ(604,YSASIEN_",",.02)
32 . D CHECKALL^YSASO2(+YSASIEN,.YSOK)
33 . S ^TMP($J,"YSASI",YSASC)=YSASIEN_U_YSASDT_U_YSASPT_U_YSASCL_U_YSASTRN_U_YSOK
34 ;
35 Q
36TLP ; print list
37 Q:'$D(^TMP($J,"YSASI"))
38 S YSL="",$P(YSL,"_",75)=""
39 W @IOF
40 W @IOF,"Addiction Severity Index Sign Off Utility",!?7,"*=incomplete x=some questions X or N",!
41 W ?8,"Date",?19,"Patient",?51,"Entered by",!,YSL,!
42 S YSASNUM=0
43 F S YSASNUM=$O(^TMP($J,"YSASI",YSASNUM)) Q:YSASNUM'>0 D Q:$D(DIRUT)
44 . S YSASG=^TMP($J,"YSASI",YSASNUM)
45 . W !,$J(YSASNUM,3),$S($P(YSASG,U,6)=1:" ",$P(YSASG,U,6)=2:"x ",1:"* ")
46 . W $P(YSASG,U,2)
47 . W ?19,$P(YSASG,U,3)
48 . W ?51,$P(YSASG,U,5)
49 . D:$Y+4>IOSL WAIT
50 Q
51 ;
52WAIT ;
53 F I0=1:1:IOSL-$Y-2 W !
54 N DTOUT,DUOUT,DIRUT
55 I IOST?1"C".E W $C(7) K DIR S DIR(0)="E" D ^DIR K DIR
56 Q:$D(DIRUT)
57 W @IOF
58 W ?8,"Date",?19,"Patient",?51,"Entered by",!,YSL,!
59 Q
Note: See TracBrowser for help on using the repository browser.