source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSASO.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 1.4 KB
Line 
1YSASO ;692/DCL-ASI OUTPUT LOOKUP;MAY 03, 1996@11:45 ;10/2/96 15:34
2 ;;5.01;MENTAL HEALTH;**24**;Dec 30, 1994
3 Q
4DICI(YSAS) ;Look-up of patient and ASI intake, PASS YSAS BY REFERENCE
5 N DIC,YSASPIEN
6 S YSAS=0
7 S DIC="^DPT(",DIC(0)="AEMQ"
8 S DIC("W")="W $$PID^YSASLIB(Y)"
9 D ^DIC
10 Q:Y'>0
11 S YSASPIEN=+Y
12 I '$D(^YSTX(604,"C",YSASPIEN)) D Q
13 .W $C(7),!,"No ASI Record In Database"
14 .W !,"Use Intake Option To Add ASI Record",!
15 .Q
16 S DIC="^YSTX(604,",DIC(0)="AEQ" ;,DIC("S")="I $P(^(0),U,2)=YSASPIEN"
17 S DIC("S")="I $P(^(0),U,2)=YSASPIEN,$P(^(0),U,4)=1"
18 S DIC("A")="SELECT ASI ID NUMBER: "
19 S D="A02."_+YSASPIEN
20 D IX^DIC
21 Q:Y'>0
22 S YSAS=+Y
23 Q
24 ;
25DICF(YSAS) ;Lookup Patient and Follow-up PASS YSAS BY REFERENCE
26 N DIC,YSASPIEN
27 S YSAS=0
28 S DIC="^DPT(",DIC(0)="AEMQZ"
29 S DIC("W")="W $$PID^YSASLIB(Y)"
30 D ^DIC
31 Q:Y'>0
32 ;patient file ien
33 S YSASPIEN=+Y
34 I $$NOASI(YSASPIEN) D Q
35 .W $C(7),!,"Patient has no ASI Follow-up on file",!
36 .Q
37 S DIC="^YSTX(604,",DIC(0)="AEQ"
38 S DIC("S")="I $P(^(0),U,2)=YSASPIEN,$P(^(0),U,4)=2"
39 S DIC("A")="SELECT ASI FOLLOW-UP: "
40 S DIC("W")="W $$FUID^YSASLIB(Y)"
41 S D="A02."_+YSASPIEN
42 D IX^DIC
43 Q:Y'>0
44 S YSAS=+Y
45 Q
46 ;
47 ;
48NOASI(IEN) ;
49 ;Check if Patient has NO ASI FOLLOW-UP on file return 0 if one if found and 1 if none is found
50 Q:$G(IEN)'>0
51 N ASI,FLG
52 S ASI=0,FLG=1
53 F S ASI=$O(^YSTX(604,"C",IEN,ASI)) Q:ASI'>0 I $D(^YSTX(604,"D",2,ASI)) S FLG=0 Q
54 Q FLG
55 ;
Note: See TracBrowser for help on using the repository browser.