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

YSASCSA.m

Go to the documentation of this file.
  1. YSASCSA ;692/DCL-ASI COMPOSITE SCORES;MAY 09, 1996@11:47 ;6/24/97 09:39
  1. ;;5.01;MENTAL HEALTH;**24,30**;Dec 30, 1994
  1. Q
  1. ;
  1. IF(YSASIEN,YSASFLD,YSASFLG) ;pass ien and field - return content
  1. Q:$G(YSASIEN)'>0 ""
  1. Q:$G(YSASFLD)'>0 ""
  1. N DIERR
  1. Q $$GET1^DIQ(604,YSASIEN_",",YSASFLD,$G(YSASFLG))
  1. ;
  1. CSMS(YSASDA) ;Composit Score for Medical Status
  1. N YSASA,YSASB,YSASC,YSASI
  1. S YSASA=$$IF(YSASDA,8.08)
  1. Q:YSASA'?1N.N ""
  1. S YSASB=$$IF(YSASDA,8.09)
  1. Q:YSASB'?1N.N ""
  1. S YSASC=$$IF(YSASDA,8.11)
  1. Q:YSASC'?1N.N ""
  1. ;S YSASA=YSASA/30,YSASB=YSASB/4,YSASC=YSASC/4
  1. Q (YSASA/90)+(YSASB/12)+(YSASC/12)
  1. ;
  1. CSES(YSASDA) ;Composit Score for Employment Status
  1. N YSASA,YSASB,YSASC,YSASD,YSASI
  1. S YSASA=$$IF(YSASDA,9.06,"I")
  1. Q:YSASA'?1N.N ""
  1. S YSASB=$$IF(YSASDA,9.09,"I")
  1. Q:YSASB'?1N.N ""
  1. S YSASC=$$IF(YSASDA,9.18)
  1. Q:YSASC'?1N.N ""
  1. S YSASD=$$IF(YSASDA,9.19)
  1. Q:YSASD'?1N.N ""
  1. S:YSASD>0 YSASD=$$LN^XLFMTH(YSASD)
  1. S YSASA=YSASA/4,YSASB=YSASB/4,YSASC=YSASC/120,YSASD=YSASD/36
  1. Q 1.000-(YSASA+YSASB+YSASC+YSASD)
  1. ;
  1. CSA(YSASDA) ;Composit Score for Alcohol
  1. N YSASA,YSASB,YSASC,YSASD,YSASE,YSASF
  1. S YSASA=$$IF(YSASDA,10.01)
  1. Q:YSASA'?1N.N ""
  1. S YSASB=$$IF(YSASDA,10.04)
  1. Q:YSASB'?1N.N ""
  1. S YSASC=$$IF(YSASDA,11.14)
  1. Q:YSASC'?1N.N ""
  1. S YSASD=$$IF(YSASDA,11.16)
  1. Q:YSASD'?1N.N ""
  1. S YSASE=$$IF(YSASDA,11.165)
  1. Q:YSASE'?1N.N ""
  1. S YSASF=$$IF(YSASDA,11.09)
  1. Q:YSASF'?1N.N ""
  1. S:YSASF>0 YSASF=$$LN^XLFMTH(YSASF)
  1. S YSASA=YSASA/180,YSASB=YSASB/180,YSASC=YSASC/180,YSASD=YSASD/24
  1. S YSASE=YSASE/24,YSASF=YSASF/44
  1. Q YSASA+YSASB+YSASC+YSASD+YSASE+YSASF
  1. ;
  1. CSD(YSASDA) ;Composit Score for Drug
  1. N YSASA,YSASB,YSASC,YSASD,YSASE,YSASF,YSASG,YSASH,YSASI,YSASJ,YSASK,YSASL,YSASM
  1. S YSASA=$$IF(YSASDA,10.07)
  1. Q:YSASA'?1N.N ""
  1. S YSASB=$$IF(YSASDA,10.11)
  1. Q:YSASB'?1N.N ""
  1. S YSASC=$$IF(YSASDA,10.15)
  1. Q:YSASC'?1N.N ""
  1. S YSASD=$$IF(YSASDA,10.18)
  1. Q:YSASD'?1N.N ""
  1. S YSASE=$$IF(YSASDA,10.22)
  1. Q:YSASE'?1N.N ""
  1. S YSASF=$$IF(YSASDA,10.25)
  1. Q:YSASF'?1N.N ""
  1. S YSASG=$$IF(YSASDA,10.28)
  1. Q:YSASG'?1N.N ""
  1. S YSASH=$$IF(YSASDA,10.32)
  1. Q:YSASH'?1N.N ""
  1. S YSASI=$$IF(YSASDA,10.35)
  1. Q:YSASI'?1N.N ""
  1. S YSASJ=$$IF(YSASDA,10.42)
  1. Q:YSASJ'?1N.N ""
  1. S YSASK=$$IF(YSASDA,11.15)
  1. Q:YSASK'?1N.N ""
  1. S YSASL=$$IF(YSASDA,11.17)
  1. Q:YSASL'?1N.N ""
  1. S YSASM=$$IF(YSASDA,11.175)
  1. Q:YSASM'?1N.N ""
  1. S YSASA=YSASA/390,YSASB=YSASB/390,YSASC=YSASC/390,YSASD=YSASD/390
  1. S YSASE=YSASE/390,YSASF=YSASF/390,YSASG=YSASG/390,YSASH=YSASH/390
  1. S YSASI=YSASI/390,YSASJ=YSASJ/390,YSASK=YSASK/390,YSASL=YSASL/52
  1. S YSASM=YSASM/52
  1. Q YSASA+YSASB+YSASC+YSASD+YSASE+YSASF+YSASG+YSASH+YSASI+YSASJ+YSASK+YSASL+YSASM
  1. ;
  1. CSLS(YSASDA) ;Composite Score for Legal Status
  1. N YSASA,YSASB,YSASC,YSASD,YSASE
  1. S YSASA=$$IF(YSASDA,14.27,"I")
  1. Q:YSASA'?1N.N ""
  1. S YSASB=$$IF(YSASDA,14.31)
  1. Q:YSASB'?1N.N ""
  1. S YSASC=$$IF(YSASDA,14.32)
  1. Q:YSASC'?1N.N ""
  1. S YSASD=$$IF(YSASDA,14.33)
  1. Q:YSASD'?1N.N ""
  1. S YSASE=$$IF(YSASDA,9.25)
  1. Q:YSASE'?1N.N ""
  1. S:YSASE>0 YSASE=$$LN^XLFMTH(YSASE)
  1. S YSASA=YSASA/5,YSASB=YSASB/150,YSASC=YSASC/20,YSASD=YSASD/20
  1. S YSASE=YSASE/46
  1. Q YSASA+YSASB+YSASC+YSASD+YSASE
  1. ;
  1. CSFSR(YSASDA) ;Composite Score for Family/Social Relationships
  1. N YSASA,YSASB,YSASC,YSASD,YSASR,YSASDEMN
  1. S YSASA=$$IF(YSASDA,17.04,"I")
  1. Q:YSASA'?1N.N ""
  1. S YSASB=$$IF(YSASDA,18.23)
  1. Q:YSASB'?1N.N ""
  1. S YSASC=$$IF(YSASDA,18.25)
  1. Q:YSASC'?1N.N ""
  1. S YSASD=$$IF(YSASDA,18.27)
  1. Q:YSASD'?1N.N ""
  1. D
  1. .N YSASI,YSASX
  1. .S YSASR=0,YSASDEMN=0
  1. .F YSASI=.01,.03,.05,.07,.09,.12,.15,.17,.185 D Q:YSASR=""
  1. ..S YSASX=$$IF(YSASDA,18_YSASI,"I")
  1. ..I YSASX="" S YSASR="" Q
  1. ..S YSASR=YSASR+YSASX S:YSASX?1N YSASDEMN=YSASDEMN+1
  1. ..Q
  1. .S:YSASDEMN YSASR=YSASR/YSASDEMN
  1. .Q
  1. Q:YSASR'?1NP.N ""
  1. S YSASA=$S(YSASA=2:0,YSASA=0:2,1:1)
  1. S YSASA=YSASA/10,YSASB=YSASB/150,YSASC=YSASC/20,YSASD=YSASD/20
  1. S YSASR=YSASR/5
  1. Q YSASA+YSASB+YSASC+YSASD+YSASR
  1. ;
  1. CSPS(YSASDA) ;Composite Score for Psychiatric Status
  1. N YSASA,YSASB,YSASC,YSASD,YSASE,YSASF,YSASG,YSASH,YSASI,YSASJ,YSASK
  1. S YSASA=$$IF(YSASDA,19.04,"I")
  1. Q:YSASA'?1N.N ""
  1. S YSASB=$$IF(YSASDA,19.06,"I")
  1. Q:YSASB'?1N.N ""
  1. S YSASC=$$IF(YSASDA,19.08,"I")
  1. Q:YSASC'?1N.N ""
  1. S YSASD=$$IF(YSASDA,19.11,"I")
  1. Q:YSASD'?1N.N ""
  1. S YSASE=$$IF(YSASDA,19.14,"I")
  1. Q:YSASE'?1N.N ""
  1. S YSASF=$$IF(YSASDA,19.16,"I")
  1. Q:YSASF'?1N.N ""
  1. S YSASG=$$IF(YSASDA,19.18,"I")
  1. Q:YSASG'?1N.N ""
  1. S YSASH=$$IF(YSASDA,19.21,"I")
  1. Q:YSASH'?1N.N ""
  1. S YSASI=$$IF(YSASDA,19.23)
  1. Q:YSASI'?1N.N ""
  1. S YSASJ=$$IF(YSASDA,19.24)
  1. Q:YSASJ'?1N.N ""
  1. S YSASK=$$IF(YSASDA,19.25)
  1. Q:YSASK'?1N.N ""
  1. S YSASA=YSASA/11,YSASB=YSASB/11,YSASC=YSASC/11,YSASD=YSASD/11
  1. S YSASE=YSASE/11,YSASF=YSASF/11,YSASG=YSASG/11,YSASH=YSASH/11
  1. S YSASI=YSASI/330,YSASJ=YSASJ/44,YSASK=YSASK/44
  1. Q YSASA+YSASB+YSASC+YSASD+YSASE+YSASF+YSASG+YSASH+YSASI+YSASJ+YSASK
  1. ;