YSASO ;692/DCL-ASI OUTPUT LOOKUP;MAY 03, 1996@11:45 ;10/2/96 15:34
;;5.01;MENTAL HEALTH;**24**;Dec 30, 1994
Q
DICI(YSAS) ;Look-up of patient and ASI intake, PASS YSAS BY REFERENCE
N DIC,YSASPIEN
S YSAS=0
S DIC="^DPT(",DIC(0)="AEMQ"
S DIC("W")="W $$PID^YSASLIB(Y)"
D ^DIC
Q:Y'>0
S YSASPIEN=+Y
I '$D(^YSTX(604,"C",YSASPIEN)) D Q
.W $C(7),!,"No ASI Record In Database"
.W !,"Use Intake Option To Add ASI Record",!
.Q
S DIC="^YSTX(604,",DIC(0)="AEQ" ;,DIC("S")="I $P(^(0),U,2)=YSASPIEN"
S DIC("S")="I $P(^(0),U,2)=YSASPIEN,$P(^(0),U,4)=1"
S DIC("A")="SELECT ASI ID NUMBER: "
S D="A02."_+YSASPIEN
D IX^DIC
Q:Y'>0
S YSAS=+Y
Q
;
DICF(YSAS) ;Lookup Patient and Follow-up PASS YSAS BY REFERENCE
N DIC,YSASPIEN
S YSAS=0
S DIC="^DPT(",DIC(0)="AEMQZ"
S DIC("W")="W $$PID^YSASLIB(Y)"
D ^DIC
Q:Y'>0
;patient file ien
S YSASPIEN=+Y
I $$NOASI(YSASPIEN) D Q
.W $C(7),!,"Patient has no ASI Follow-up on file",!
.Q
S DIC="^YSTX(604,",DIC(0)="AEQ"
S DIC("S")="I $P(^(0),U,2)=YSASPIEN,$P(^(0),U,4)=2"
S DIC("A")="SELECT ASI FOLLOW-UP: "
S DIC("W")="W $$FUID^YSASLIB(Y)"
S D="A02."_+YSASPIEN
D IX^DIC
Q:Y'>0
S YSAS=+Y
Q
;
;
NOASI(IEN) ;
;Check if Patient has NO ASI FOLLOW-UP on file return 0 if one if found and 1 if none is found
Q:$G(IEN)'>0
N ASI,FLG
S ASI=0,FLG=1
F S ASI=$O(^YSTX(604,"C",IEN,ASI)) Q:ASI'>0 I $D(^YSTX(604,"D",2,ASI)) S FLG=0 Q
Q FLG
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYSASO 1448 printed Nov 22, 2024@17:23:13 Page 2
YSASO ;692/DCL-ASI OUTPUT LOOKUP;MAY 03, 1996@11:45 ;10/2/96 15:34
+1 ;;5.01;MENTAL HEALTH;**24**;Dec 30, 1994
+2 QUIT
DICI(YSAS) ;Look-up of patient and ASI intake, PASS YSAS BY REFERENCE
+1 NEW DIC,YSASPIEN
+2 SET YSAS=0
+3 SET DIC="^DPT("
SET DIC(0)="AEMQ"
+4 SET DIC("W")="W $$PID^YSASLIB(Y)"
+5 DO ^DIC
+6 if Y'>0
QUIT
+7 SET YSASPIEN=+Y
+8 IF '$DATA(^YSTX(604,"C",YSASPIEN))
Begin DoDot:1
+9 WRITE $CHAR(7),!,"No ASI Record In Database"
+10 WRITE !,"Use Intake Option To Add ASI Record",!
+11 QUIT
End DoDot:1
QUIT
+12 ;,DIC("S")="I $P(^(0),U,2)=YSASPIEN"
SET DIC="^YSTX(604,"
SET DIC(0)="AEQ"
+13 SET DIC("S")="I $P(^(0),U,2)=YSASPIEN,$P(^(0),U,4)=1"
+14 SET DIC("A")="SELECT ASI ID NUMBER: "
+15 SET D="A02."_+YSASPIEN
+16 DO IX^DIC
+17 if Y'>0
QUIT
+18 SET YSAS=+Y
+19 QUIT
+20 ;
DICF(YSAS) ;Lookup Patient and Follow-up PASS YSAS BY REFERENCE
+1 NEW DIC,YSASPIEN
+2 SET YSAS=0
+3 SET DIC="^DPT("
SET DIC(0)="AEMQZ"
+4 SET DIC("W")="W $$PID^YSASLIB(Y)"
+5 DO ^DIC
+6 if Y'>0
QUIT
+7 ;patient file ien
+8 SET YSASPIEN=+Y
+9 IF $$NOASI(YSASPIEN)
Begin DoDot:1
+10 WRITE $CHAR(7),!,"Patient has no ASI Follow-up on file",!
+11 QUIT
End DoDot:1
QUIT
+12 SET DIC="^YSTX(604,"
SET DIC(0)="AEQ"
+13 SET DIC("S")="I $P(^(0),U,2)=YSASPIEN,$P(^(0),U,4)=2"
+14 SET DIC("A")="SELECT ASI FOLLOW-UP: "
+15 SET DIC("W")="W $$FUID^YSASLIB(Y)"
+16 SET D="A02."_+YSASPIEN
+17 DO IX^DIC
+18 if Y'>0
QUIT
+19 SET YSAS=+Y
+20 QUIT
+21 ;
+22 ;
NOASI(IEN) ;
+1 ;Check if Patient has NO ASI FOLLOW-UP on file return 0 if one if found and 1 if none is found
+2 if $GET(IEN)'>0
QUIT
+3 NEW ASI,FLG
+4 SET ASI=0
SET FLG=1
+5 FOR
SET ASI=$ORDER(^YSTX(604,"C",IEN,ASI))
if ASI'>0
QUIT
IF $DATA(^YSTX(604,"D",2,ASI))
SET FLG=0
QUIT
+6 QUIT FLG
+7 ;