YSASO1 ;692/DCL-ASI OUTPUT SEVERITY- COMPOSITE SCORES ;5/22/97 10:59
;;5.01;MENTAL HEALTH;**24,30**;Dec 30, 1994
Q
OUT1(YSASIEN) ;Entry Point pass IEN from file 604
Q:$G(YSASIEN)'>0
N YSASNA,YSASY,YSASSR,YSASCS,YSASN,YSASAGE,X,Y,C1,C2,C3
S YSASIEN=YSASIEN_",",C1=4,C2=20,C3=35
S YSASSR="^8.12^9.34^11.18^11.185^14.34^18.29^19.33"
S YSASN=$$F("NAME"),YSASAGE=$$F("NAME:AGE"),YSASNA=YSASN_" ("_YSASAGE_")"
W:$D(IOF) @IOF
W !,YSASNA,!,$TR($J("",$L(YSASNA))," ","-"),!
W !," Admission Date: ",$$F(1)
W !," Interview Date: ",$$F(.05)
W !," Time Begun: ",$$F(.051)
W !," Time Ended: ",$$F(.052)
W !," Interviewer: ",$$F(.09)
W !
W !?C2,"Severity",?C3,"Composite"
W !?C2,"Ratings",?C3,"Scores"
W !?C2,"--------",?C3,"---------"
W !?C1," MEDICAL",?C2,$J($$F(8.12),4),?C3,$J($$F(.61),8,4)
W !?C1," EMPLOYMENT",?C2,$J($$F(9.34),4),?C3,$J($$F(.62),8,4)
W !?C1," ALCOHOL",?C2,$J($$F(11.18),4),?C3,$J($$F(.63),8,4)
W !?C1," DRUG",?C2,$J($$F(11.185),4),?C3,$J($$F(.635),8,4)
W !?C1," LEGAL",?C2,$J($$F(14.34),4),?C3,$J($$F(.64),8,4)
W !?C1," FAMILY",?C2,$J($$F(18.29),4),?C3,$J($$F(.65),8,4)
W !?C1,"PSYCHIATRIC",?C2,$J($$F(19.33),4),?C3,$J($$F(.66),8,4)
W !! K DIR S DIR(0)="E" D ^DIR ;,"<press any key to continue>" R X#1:DTIME
Q
;
F(YSASFLD) ;Pass field name - IEN is expected to be in YSASIEN
N DIERR
Q:$G(YSASFLD)=""
Q $$GET1^DIQ(604,YSASIEN,YSASFLD)
;
ENI ;Entry point for INTAKE
N YSASDA
D DICI^YSASO(.YSASDA)
D:$G(YSASDA)>0 OUT1(YSASDA)
Q
;
ENF ;Entry Point for FOLLOW-UP
N YSASDA
D DICF^YSASO(.YSASDA)
D:$G(YSASDA)>0 OUT1(YSASDA)
Q
;
OUT2(YSASIEN,YSASOK) ;Entry Point pass IEN from file 604
;also pass an OK flag by reference - set to 1 all severity ratings and composite scores are > 0. (optional)
Q:$G(YSASIEN)'>0
N YSASY,YSASSR,YSASCS,YSASN,YSASAGE,X,Y,C1,C2,C3,YSASS,YSASC,YSASMSG
S YSASIEN=YSASIEN_",",C1=24,C2=40,C3=55,YSASOK=1,YSASMSG=""
;YSASOK = severity ratings and composite scores are not null.
S YSASSR="^8.12^9.34^11.18^11.185^14.34^18.29^19.33"
S YSASN=$$F("NAME"),YSASAGE=$$F("NAME:AGE"),YSASNA=YSASN_" ("_YSASAGE_")"
W:$D(IOF) @IOF
W !,YSASNA,?C2,"Severity",?C3,"Composite"
W !,$TR($J("",$L(YSASNA))," ","-"),?C2,"Ratings",?C3,"Scores"
W !," Adm: ",$$F(1),?C2,"--------",?C3,"---------"
S YSASS=$$F(8.12),YSASC=$$F(.61)
W !," Int: ",$$F(.05),?C1," MEDICAL",?C2,$J(YSASS,4),?C3,$S(YSASC="":" ----",1:YSASC)
S YSASS=$$F(9.34),YSASC=$$F(.62)
S X=$$F(.09)
W !," By: ",$S(X]"":$P(X,","),1:"<INCOMPLETE>"),?C1," EMPLOYMENT",?C2,$J(YSASS,4),?C3,$S(YSASC="":" ----",1:YSASC)
S YSASS=$$F(11.18),YSASC=$$F(.63)
W !?C1," ALCOHOL",?C2,$J(YSASS,4),?C3,$S(YSASC="":" ----",1:YSASC)
S YSASS=$$F(11.185),YSASC=$$F(.635)
W !?C1," DRUG",?C2,$J(YSASS,4),?C3,$S(YSASC="":" ----",1:YSASC)
S YSASS=$$F(14.34),YSASC=$$F(.64)
W !?C1," LEGAL",?C2,$J(YSASS,4),?C3,$S(YSASC="":" ----",1:YSASC)
S YSASS=$$F(18.29),YSASC=$$F(.65)
W !?C1," FAMILY",?C2,$J(YSASS,4),?C3,$S(YSASC="":" ----",1:YSASC)
S YSASS=$$F(19.33),YSASC=$$F(.66)
W !?C1,"PSYCHIATRIC",?C2,$J(YSASS,4),?C3,$S(YSASC="":" ----",1:YSASC)
Q
;
CS(X) ;Composite Scores
I X=.61 Q $$CSMS^YSASCSA(+YSASIEN) ;MEDICAL
I X=.62 Q $$CSES^YSASCSA(+YSASIEN) ;EMPLOYMENT
I X=.63 Q $$CSA^YSASCSA(+YSASIEN) ;ALCOHOL
I X=.635 Q $$CSD^YSASCSA(+YSASIEN) ;DRUG
I X=.64 Q $$CSLS^YSASCSA(+YSASIEN) ;LEGAL
I X=.65 Q $$CSFSR^YSASCSA(+YSASIEN) ;FAMILY/SOCIAL
I X=.66 Q $$CSPS^YSASCSA(+YSASIEN) ;PSYCHIATRIC
Q ""
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYSASO1 3566 printed Nov 22, 2024@17:23:14 Page 2
YSASO1 ;692/DCL-ASI OUTPUT SEVERITY- COMPOSITE SCORES ;5/22/97 10:59
+1 ;;5.01;MENTAL HEALTH;**24,30**;Dec 30, 1994
+2 QUIT
OUT1(YSASIEN) ;Entry Point pass IEN from file 604
+1 if $GET(YSASIEN)'>0
QUIT
+2 NEW YSASNA,YSASY,YSASSR,YSASCS,YSASN,YSASAGE,X,Y,C1,C2,C3
+3 SET YSASIEN=YSASIEN_","
SET C1=4
SET C2=20
SET C3=35
+4 SET YSASSR="^8.12^9.34^11.18^11.185^14.34^18.29^19.33"
+5 SET YSASN=$$F("NAME")
SET YSASAGE=$$F("NAME:AGE")
SET YSASNA=YSASN_" ("_YSASAGE_")"
+6 if $DATA(IOF)
WRITE @IOF
+7 WRITE !,YSASNA,!,$TRANSLATE($JUSTIFY("",$LENGTH(YSASNA))," ","-"),!
+8 WRITE !," Admission Date: ",$$F(1)
+9 WRITE !," Interview Date: ",$$F(.05)
+10 WRITE !," Time Begun: ",$$F(.051)
+11 WRITE !," Time Ended: ",$$F(.052)
+12 WRITE !," Interviewer: ",$$F(.09)
+13 WRITE !
+14 WRITE !?C2,"Severity",?C3,"Composite"
+15 WRITE !?C2,"Ratings",?C3,"Scores"
+16 WRITE !?C2,"--------",?C3,"---------"
+17 WRITE !?C1," MEDICAL",?C2,$JUSTIFY($$F(8.12),4),?C3,$JUSTIFY($$F(.61),8,4)
+18 WRITE !?C1," EMPLOYMENT",?C2,$JUSTIFY($$F(9.34),4),?C3,$JUSTIFY($$F(.62),8,4)
+19 WRITE !?C1," ALCOHOL",?C2,$JUSTIFY($$F(11.18),4),?C3,$JUSTIFY($$F(.63),8,4)
+20 WRITE !?C1," DRUG",?C2,$JUSTIFY($$F(11.185),4),?C3,$JUSTIFY($$F(.635),8,4)
+21 WRITE !?C1," LEGAL",?C2,$JUSTIFY($$F(14.34),4),?C3,$JUSTIFY($$F(.64),8,4)
+22 WRITE !?C1," FAMILY",?C2,$JUSTIFY($$F(18.29),4),?C3,$JUSTIFY($$F(.65),8,4)
+23 WRITE !?C1,"PSYCHIATRIC",?C2,$JUSTIFY($$F(19.33),4),?C3,$JUSTIFY($$F(.66),8,4)
+24 ;,"<press any key to continue>" R X#1:DTIME
WRITE !!
KILL DIR
SET DIR(0)="E"
DO ^DIR
+25 QUIT
+26 ;
F(YSASFLD) ;Pass field name - IEN is expected to be in YSASIEN
+1 NEW DIERR
+2 if $GET(YSASFLD)=""
QUIT
+3 QUIT $$GET1^DIQ(604,YSASIEN,YSASFLD)
+4 ;
ENI ;Entry point for INTAKE
+1 NEW YSASDA
+2 DO DICI^YSASO(.YSASDA)
+3 if $GET(YSASDA)>0
DO OUT1(YSASDA)
+4 QUIT
+5 ;
ENF ;Entry Point for FOLLOW-UP
+1 NEW YSASDA
+2 DO DICF^YSASO(.YSASDA)
+3 if $GET(YSASDA)>0
DO OUT1(YSASDA)
+4 QUIT
+5 ;
OUT2(YSASIEN,YSASOK) ;Entry Point pass IEN from file 604
+1 ;also pass an OK flag by reference - set to 1 all severity ratings and composite scores are > 0. (optional)
+2 if $GET(YSASIEN)'>0
QUIT
+3 NEW YSASY,YSASSR,YSASCS,YSASN,YSASAGE,X,Y,C1,C2,C3,YSASS,YSASC,YSASMSG
+4 SET YSASIEN=YSASIEN_","
SET C1=24
SET C2=40
SET C3=55
SET YSASOK=1
SET YSASMSG=""
+5 ;YSASOK = severity ratings and composite scores are not null.
+6 SET YSASSR="^8.12^9.34^11.18^11.185^14.34^18.29^19.33"
+7 SET YSASN=$$F("NAME")
SET YSASAGE=$$F("NAME:AGE")
SET YSASNA=YSASN_" ("_YSASAGE_")"
+8 if $DATA(IOF)
WRITE @IOF
+9 WRITE !,YSASNA,?C2,"Severity",?C3,"Composite"
+10 WRITE !,$TRANSLATE($JUSTIFY("",$LENGTH(YSASNA))," ","-"),?C2,"Ratings",?C3,"Scores"
+11 WRITE !," Adm: ",$$F(1),?C2,"--------",?C3,"---------"
+12 SET YSASS=$$F(8.12)
SET YSASC=$$F(.61)
+13 WRITE !," Int: ",$$F(.05),?C1," MEDICAL",?C2,$JUSTIFY(YSASS,4),?C3,$SELECT(YSASC="":" ----",1:YSASC)
+14 SET YSASS=$$F(9.34)
SET YSASC=$$F(.62)
+15 SET X=$$F(.09)
+16 WRITE !," By: ",$SELECT(X]"":$PIECE(X,","),1:"<INCOMPLETE>"),?C1," EMPLOYMENT",?C2,$JUSTIFY(YSASS,4),?C3,$SELECT(YSASC="":" ----",1:YSASC)
+17 SET YSASS=$$F(11.18)
SET YSASC=$$F(.63)
+18 WRITE !?C1," ALCOHOL",?C2,$JUSTIFY(YSASS,4),?C3,$SELECT(YSASC="":" ----",1:YSASC)
+19 SET YSASS=$$F(11.185)
SET YSASC=$$F(.635)
+20 WRITE !?C1," DRUG",?C2,$JUSTIFY(YSASS,4),?C3,$SELECT(YSASC="":" ----",1:YSASC)
+21 SET YSASS=$$F(14.34)
SET YSASC=$$F(.64)
+22 WRITE !?C1," LEGAL",?C2,$JUSTIFY(YSASS,4),?C3,$SELECT(YSASC="":" ----",1:YSASC)
+23 SET YSASS=$$F(18.29)
SET YSASC=$$F(.65)
+24 WRITE !?C1," FAMILY",?C2,$JUSTIFY(YSASS,4),?C3,$SELECT(YSASC="":" ----",1:YSASC)
+25 SET YSASS=$$F(19.33)
SET YSASC=$$F(.66)
+26 WRITE !?C1,"PSYCHIATRIC",?C2,$JUSTIFY(YSASS,4),?C3,$SELECT(YSASC="":" ----",1:YSASC)
+27 QUIT
+28 ;
CS(X) ;Composite Scores
+1 ;MEDICAL
IF X=.61
QUIT $$CSMS^YSASCSA(+YSASIEN)
+2 ;EMPLOYMENT
IF X=.62
QUIT $$CSES^YSASCSA(+YSASIEN)
+3 ;ALCOHOL
IF X=.63
QUIT $$CSA^YSASCSA(+YSASIEN)
+4 ;DRUG
IF X=.635
QUIT $$CSD^YSASCSA(+YSASIEN)
+5 ;LEGAL
IF X=.64
QUIT $$CSLS^YSASCSA(+YSASIEN)
+6 ;FAMILY/SOCIAL
IF X=.65
QUIT $$CSFSR^YSASCSA(+YSASIEN)
+7 ;PSYCHIATRIC
IF X=.66
QUIT $$CSPS^YSASCSA(+YSASIEN)
+8 QUIT ""