ACDWCD2 ;IHS/ADC/EDE/KML - CLIENT DET OP FOR T/D/C;
;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
;**********************************************************************
;//^ACDWDRV3
;**********************************************************************
;
START ;
;S ACDP1="" F S ACDP1=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1)) Q:ACDP1="" F ACDP2=0:0 S ACDP2=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2)) Q:'ACDP2 S ACDDA=ACDP2 D ^ACDWTDC S ACDDA=^ACDTDC(ACDP2,"BWP") D ^ACDWVIS D P1
S ACDP1=""
F S ACDP1=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1)) Q:ACDP1="" D Q:$D(DIRUT)
. F ACDP2=0:0 S ACDP2=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2)) Q:'ACDP2 D Q:$D(DIRUT)
.. S ACDDA=ACDP2 D ^ACDWTDC S ACDDA=^ACDTDC(ACDP2,"BWP") D ^ACDWVIS D P1
.. Q
. Q
D ^ACDWK
Q
;
P1 ;Output
D F W !,"CLIENT NAME:",?40,ACDDFN
D F W !," VETERAN STATUS:",?40,ACDVET
D F W !," AGE/SEX:",?40,$S($G(ACDAGE)'="":ACDAGE,1:"UNKNOWN - ")," YEARS OLD / ",ACDSEX
S ACDTRIBN=$O(^AUTTTRI("C",ACDTRIB,0)) I ACDTRIBN S ACDTRIBN=$P(^AUTTTRI(ACDTRIBN,0),U)
S ACDSTATN=$O(^DIC(5,"C",ACDSTATE,0)) I ACDSTATN S ACDSTATN=$P(^DIC(5,ACDSTATN,0),U)
D F W !," STATE/STATE CODE:",?40,$S($G(ACDSTATN)'="":$E(ACDSTATN,1,35),1:"UNKNOWN")," / ",ACDSTATE
D F W !," TRIBE/TRIBE CODE",?40,$S($G(ACDTRIBN)'="":$E(ACDTRIBN,1,35),1:"UNKNOWN")," / ",ACDTRIB
D F W !,"VISIT DATE:",?40,ACDCLIV
D F W !,"COMPONENT CODE:",?40,ACDCOMCL,"/",ACDCOMTL
D F W !!,"PROVIDER:",?40,ACDPROV
D F W !,"PRIMARY PROBLEM:",?40,ACDPROBP
D F W !,"OTHER PROBLEMS:" S ACDLP="" F D F S ACDLP=$O(ACDPTA(ACDLP)) Q:ACDLP="" W ?40,ACDLP,!
D F W !,"DAYS USED ALCOHOL:",?40,ACDDUA
D F W !,"DAYS USED DRUGS:",?40,ACDDUD
D F W !,"DRUG TYPE:" S ACDLP="" F D F S ACDLP=$O(ACDDTA(ACDLP)) Q:ACDLP="" W ?40,ACDLP,!
D F W !,"DAYS HOSPITALIZED:",?40,ACDDH
D F W !,"DRUG/ALCOHOL RELATED ARREST:",?40,ACDAAR
D F W !!,"CLIENT STAGE ALC/SUB:",?40,ACDSUS
D F W !,"CLIENT STAGE PHYSICAL:",?40,ACDPS
D F W !,"CLIENT STAGE EMOTIONAL:",?40,ACDES
D F W !,"CLIENT STAGE SOCIAL:",?40,ACDSS
D F W !,"CLIENT STAGE CULTURAL:",?40,ACDCS
D F W !,"CLIENT STAGE BEHAVIORAL:",?40,ACDBS
D F W !!,"RECOMMENDED PLACEMENT:",?40,ACDPLAR_"/"_ACDPLARL
D F W !,"ACTUAL PLACEMENT:",?40,ACDPLAA_"/"_ACDPLAAL
D F W !,"DIFFERENCE REASON:",?40,ACDDIF
D F W !!,"INPATIENT DAYS:",?40,ACDID
D F W !,"DISCHARGE/AFTERCARE PLAN:",?40,ACDDAP
D F W !,"GOAL STATUS:",?40,ACDGA
D F W !,"T/D/C REASON:",?40,ACDTDCR
W !!,"..........................................",!
Q
F ;Form feed
Q:$D(DIRUT)
I $Y+4>IOSL D F^ACDWUTL
ACDWCD2 ;IHS/ADC/EDE/KML - CLIENT DET OP FOR T/D/C;
+1 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
+2 ;**********************************************************************
+3 ;//^ACDWDRV3
+4 ;**********************************************************************
+5 ;
START ;
+1 ;S ACDP1="" F S ACDP1=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1)) Q:ACDP1="" F ACDP2=0:0 S ACDP2=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2)) Q:'ACDP2 S ACDDA=ACDP2 D ^ACDWTDC S ACDDA=^ACDTDC(ACDP2,"BWP") D ^ACDWVIS D P1
+2 SET ACDP1=""
+3 FOR
SET ACDP1=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1))
IF ACDP1=""
QUIT
Begin DoDot:1
+4 FOR ACDP2=0:0
SET ACDP2=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2))
IF 'ACDP2
QUIT
Begin DoDot:2
+5 SET ACDDA=ACDP2
DO ^ACDWTDC
SET ACDDA=^ACDTDC(ACDP2,"BWP")
DO ^ACDWVIS
DO P1
+6 QUIT
End DoDot:2
IF $DATA(DIRUT)
QUIT
+7 QUIT
End DoDot:1
IF $DATA(DIRUT)
QUIT
+8 DO ^ACDWK
+9 QUIT
+10 ;
P1 ;Output
+1 DO F
WRITE !,"CLIENT NAME:",?40,ACDDFN
+2 DO F
WRITE !," VETERAN STATUS:",?40,ACDVET
+3 DO F
WRITE !," AGE/SEX:",?40,$SELECT($GET(ACDAGE)'="":ACDAGE,1:"UNKNOWN - ")," YEARS OLD / ",ACDSEX
+4 SET ACDTRIBN=$ORDER(^AUTTTRI("C",ACDTRIB,0))
IF ACDTRIBN
SET ACDTRIBN=$PIECE(^AUTTTRI(ACDTRIBN,0),U)
+5 SET ACDSTATN=$ORDER(^DIC(5,"C",ACDSTATE,0))
IF ACDSTATN
SET ACDSTATN=$PIECE(^DIC(5,ACDSTATN,0),U)
+6 DO F
WRITE !," STATE/STATE CODE:",?40,$SELECT($GET(ACDSTATN)'="":$EXTRACT(ACDSTATN,1,35),1:"UNKNOWN")," / ",ACDSTATE
+7 DO F
WRITE !," TRIBE/TRIBE CODE",?40,$SELECT($GET(ACDTRIBN)'="":$EXTRACT(ACDTRIBN,1,35),1:"UNKNOWN")," / ",ACDTRIB
+8 DO F
WRITE !,"VISIT DATE:",?40,ACDCLIV
+9 DO F
WRITE !,"COMPONENT CODE:",?40,ACDCOMCL,"/",ACDCOMTL
+10 DO F
WRITE !!,"PROVIDER:",?40,ACDPROV
+11 DO F
WRITE !,"PRIMARY PROBLEM:",?40,ACDPROBP
+12 DO F
WRITE !,"OTHER PROBLEMS:"
SET ACDLP=""
FOR
DO F
SET ACDLP=$ORDER(ACDPTA(ACDLP))
IF ACDLP=""
QUIT
WRITE ?40,ACDLP,!
+13 DO F
WRITE !,"DAYS USED ALCOHOL:",?40,ACDDUA
+14 DO F
WRITE !,"DAYS USED DRUGS:",?40,ACDDUD
+15 DO F
WRITE !,"DRUG TYPE:"
SET ACDLP=""
FOR
DO F
SET ACDLP=$ORDER(ACDDTA(ACDLP))
IF ACDLP=""
QUIT
WRITE ?40,ACDLP,!
+16 DO F
WRITE !,"DAYS HOSPITALIZED:",?40,ACDDH
+17 DO F
WRITE !,"DRUG/ALCOHOL RELATED ARREST:",?40,ACDAAR
+18 DO F
WRITE !!,"CLIENT STAGE ALC/SUB:",?40,ACDSUS
+19 DO F
WRITE !,"CLIENT STAGE PHYSICAL:",?40,ACDPS
+20 DO F
WRITE !,"CLIENT STAGE EMOTIONAL:",?40,ACDES
+21 DO F
WRITE !,"CLIENT STAGE SOCIAL:",?40,ACDSS
+22 DO F
WRITE !,"CLIENT STAGE CULTURAL:",?40,ACDCS
+23 DO F
WRITE !,"CLIENT STAGE BEHAVIORAL:",?40,ACDBS
+24 DO F
WRITE !!,"RECOMMENDED PLACEMENT:",?40,ACDPLAR_"/"_ACDPLARL
+25 DO F
WRITE !,"ACTUAL PLACEMENT:",?40,ACDPLAA_"/"_ACDPLAAL
+26 DO F
WRITE !,"DIFFERENCE REASON:",?40,ACDDIF
+27 DO F
WRITE !!,"INPATIENT DAYS:",?40,ACDID
+28 DO F
WRITE !,"DISCHARGE/AFTERCARE PLAN:",?40,ACDDAP
+29 DO F
WRITE !,"GOAL STATUS:",?40,ACDGA
+30 DO F
WRITE !,"T/D/C REASON:",?40,ACDTDCR
+31 WRITE !!,"..........................................",!
+32 QUIT
F ;Form feed
+1 IF $DATA(DIRUT)
QUIT
+2 IF $Y+4>IOSL
DO F^ACDWUTL