Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AMHLEFP4

AMHLEFP4.m

Go to the documentation of this file.
AMHLEFP4 ; IHS/CMI/LAB - MENTAL HLTH ROUTINE ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
S(Y,F,C,T) ;set up array
 I '$G(F) S F=0
 I '$G(T) S T=0
 ;blank lines
 F F=1:1:F S X="" D S1
 S X=Y
 I $G(C) S L=$L(Y),T=(80-L)/2 D  D S1 Q
 .F %=1:1:(T-1) S X=" "_X
 F %=1:1:T S X=" "_Y
 D S1
 Q
S1 ;
 S %=$P(^TMP("AMHS",$J,"DCS",0),U)+1,$P(^TMP("AMHS",$J,"DCS",0),U)=%
 S ^TMP("AMHS",$J,"DCS",%)=X
 Q
CDST ;EP
 ;print out cd items
 I $P(^AMHREC(AMHR,0),U,32)]"" S X="",$E(X,3)="A/SA CD TYPE OF CONTACT: ",$E(X,28)=$$VAL^XBDIQ1(9002011,AMHR,.32) D S(X)
 I $P($G(^AMHREC(AMHR,11)),U,1)]"" S X="",$E(X,3)="A/SA CD COMPONENT: ",$E(X,28)=$$VAL^XBDIQ1(9002011,AMHR,1101) D S(X)
 I $P($G(^AMHREC(AMHR,11)),U,5)]"" S X="",$E(X,3)="A/SA CD COMPONENT TYPE: ",$E(X,28)=$$VAL^XBDIQ1(9002011,AMHR,1105) D S(X)
 ;I $P($G(^AMHREC(AMHR,11)),U,6)]"" S X="",$E(X,3)="PREVENTION ACTIVITY TARGET: ",$E(X,28)=$$VAL^XBDIQ1(9002011,AMHR,1106) D S(X)
 I $P($G(^AMHREC(AMHR,11)),U,2)]"" S X="",$E(X,3)="DAYS IN RESIDENTIAL TX: ",$E(X,28)=$$VAL^XBDIQ1(9002011,AMHR,1102) D S(X)
 I $P($G(^AMHREC(AMHR,11)),U,3)]"" S X="",$E(X,3)="DAYS IN AFTERCARE: ",$E(X,28)=$$VAL^XBDIQ1(9002011,AMHR,1103) D S(X)
 I AMHEFT="S" Q
 S AMHCDST=$O(^AMHRCDST("B",AMHR,0))
 I 'AMHCDST S X=$TR($J("",79)," ","_") D S(X) Q
 S X="",$E(X,3)="-------  STAGING TOOL -------" D S(X)
 S AMHCDST0=^AMHRCDST(AMHCDST,0)
 S X="",$E(X,3)="DAYS USED ALCOHOL: ",$E(X,28)=$P(AMHCDST0,U,6),$E(X,40)="DAYS USED DRUGS: ",$E(X,67)=$P(AMHCDST0,U,7) D S(X)
 I $O(^AMHRCDST(AMHCDST,41,0)) D
 .S X="",$E(X,3)="DRUG TYPE:"
 .S Y=0 F  S Y=$O(^AMHRCDST(AMHCDST,41,Y)) Q:Y'=+Y  S D=$P(^AMHRCDST(AMHCDST,41,Y,0),U) I Y S X=X_"  "_$P($G(^AMHTDRUG(D,0)),U)
 .D S(X)
 S X="",$E(X,3)="DAYS HOSPITALIZED: ",$E(X,28)=$P(AMHCDST0,U,8),$E(X,40)="ALC/DRUG RELATED ARRESTS:",$E(X,67)=$P(AMHCDST0,U,9) D S(X)
 S X="",$E(X,3)="ALCOHOL/SUBSTANCE STAGE: ",$E(X,28)=$P(AMHCDST0,U,12),$E(X,40)="PHYSICAL STAGE: ",$E(X,67)=$P(AMHCDST0,U,13) D S(X)
 S X="",$E(X,3)="EMOTIONAL STAGE: ",$E(X,28)=$P(AMHCDST0,U,14),$E(X,40)="SOCIAL STAGE: ",$E(X,67)=$P(AMHCDST0,U,15) D S(X)
 S X="",$E(X,3)="CULTURAL/SPIRIT STAGE: ",$E(X,28)=$P(AMHCDST0,U,16),$E(X,40)="BEHAVIORAL STAGE: ",$E(X,67)=$P(AMHCDST0,U,17) D S(X)
 S X="",$E(X,3)="VOCATIONAL/EDUC: ",$E(X,28)=$P(AMHCDST0,U,18),$E(X,40)="STAGING AVERAGE: ",$E(X,67)=$$VAL^XBDIQ1(9002011.06,AMHCDST,.018) D S(X)
 S X="",$E(X,3)="RECOMMENDED PLACEMENT:",$E(X,28)=$$VAL^XBDIQ1(9002011.06,AMHCDST,.21) D S(X)
 S X="",$E(X,3)="ACTUAL PLACEMENT:",$E(X,28)=$$VAL^XBDIQ1(9002011.06,AMHCDST,.22) D S(X)
 S X="",$E(X,3)="DIFFERENCE REASON:",$E(X,28)=$$VAL^XBDIQ1(9002011.06,AMHCDST,.23) D S(X)
 S X=$TR($J("",79)," ","_") D S(X)
 Q