AMHBHRP3 ; IHS/CMI/LAB - behavioral health display for GUI ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
;
TEST ;
D ACTCL(.RETVAL,"01/01/2000","12/31/2005","")
Q
ACTCL(AMHARRAY,AMHBD,AMHED,AMHPROV) ;EP - AMHBH RPT SUICIDE STANDARD
S JOB=$J,AMHGUI=1,XWBWRAP=1
S ZTIO="",ZTQUEUED=1
S AMHARRAY="^XTMP(""AMHRPT"","_$J_")"
I $G(AMHBD)="" S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid beginning date passed" D KILL Q
D DT^DILF("X",AMHBD,.AMHBD)
I $G(AMHBD)=-1 S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid beginning date passed" D KILL Q
I $G(AMHED)="" S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid ending date passed" D KILL Q
D DT^DILF("X",AMHED,.AMHED)
I $G(AMHED)=-1 S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid ending date passed" D KILL Q
I $G(AMHPROV),'$D(^VA(200,AMHPROV,0)) S ^XTMP("AMHRPT",JOB,.5)=2,^XTMP("AMHRPT",JOB,1)="Invalid IEN of provider entry passed" D KILL Q
S AMHPROV=$G(AMHPROV)
K ^XTMP("AMHRPT",JOB)
S ^XTMP("AMHRPTRUN",JOB)=""
D ^XBKSET
D PROC^AMHRP8
;S ZTRTN="TSK^AMHBHRP3",ZTIO="",ZTDESC="AMH ACTIVE CLIENT LIST",ZTSAVE("AMH*")="",ZTSAVE("JOB")="",ZTDTH=$H D ^%ZTLOAD
;F I=1:1:120 Q:$G(^XTMP("AMHRPTRUN",$J))="DONE" H 1
;D KILL
;Q
;
TSK ;
D ^XBKSET
S ^XTMP("AMHRPTRUN",JOB)="START"
D GUIR^XBLM("^AMHRP8P","^XTMP(""AMHRPT"",JOB)")
S ^XTMP("AMHRPT",JOB,.5)=$O(^XTMP("AMHRPT",JOB,""),-1)+1
S ^XTMP("AMHRPTRUN",JOB)="DONE"
D KILL
Q
;
KILL ;
K AMHOA,AMHBT,AMHTOT
K AMHCTR,AMHGUI,AMHSF,DIC,JOB,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
D XIT^AMHRP8
Q
AMHBHRP3 ; IHS/CMI/LAB - behavioral health display for GUI ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
+4 ;
TEST ;
+1 DO ACTCL(.RETVAL,"01/01/2000","12/31/2005","")
+2 QUIT
ACTCL(AMHARRAY,AMHBD,AMHED,AMHPROV) ;EP - AMHBH RPT SUICIDE STANDARD
+1 SET JOB=$JOB
SET AMHGUI=1
SET XWBWRAP=1
+2 SET ZTIO=""
SET ZTQUEUED=1
+3 SET AMHARRAY="^XTMP(""AMHRPT"","_$JOB_")"
+4 IF $GET(AMHBD)=""
SET ^XTMP("AMHRPT",JOB,.5)=2
SET ^XTMP("AMHRPT",JOB,1)="Invalid beginning date passed"
DO KILL
QUIT
+5 DO DT^DILF("X",AMHBD,.AMHBD)
+6 IF $GET(AMHBD)=-1
SET ^XTMP("AMHRPT",JOB,.5)=2
SET ^XTMP("AMHRPT",JOB,1)="Invalid beginning date passed"
DO KILL
QUIT
+7 IF $GET(AMHED)=""
SET ^XTMP("AMHRPT",JOB,.5)=2
SET ^XTMP("AMHRPT",JOB,1)="Invalid ending date passed"
DO KILL
QUIT
+8 DO DT^DILF("X",AMHED,.AMHED)
+9 IF $GET(AMHED)=-1
SET ^XTMP("AMHRPT",JOB,.5)=2
SET ^XTMP("AMHRPT",JOB,1)="Invalid ending date passed"
DO KILL
QUIT
+10 IF $GET(AMHPROV)
IF '$DATA(^VA(200,AMHPROV,0))
SET ^XTMP("AMHRPT",JOB,.5)=2
SET ^XTMP("AMHRPT",JOB,1)="Invalid IEN of provider entry passed"
DO KILL
QUIT
+11 SET AMHPROV=$GET(AMHPROV)
+12 KILL ^XTMP("AMHRPT",JOB)
+13 SET ^XTMP("AMHRPTRUN",JOB)=""
+14 DO ^XBKSET
+15 DO PROC^AMHRP8
+16 ;S ZTRTN="TSK^AMHBHRP3",ZTIO="",ZTDESC="AMH ACTIVE CLIENT LIST",ZTSAVE("AMH*")="",ZTSAVE("JOB")="",ZTDTH=$H D ^%ZTLOAD
+17 ;F I=1:1:120 Q:$G(^XTMP("AMHRPTRUN",$J))="DONE" H 1
+18 ;D KILL
+19 ;Q
+20 ;
TSK ;
+1 DO ^XBKSET
+2 SET ^XTMP("AMHRPTRUN",JOB)="START"
+3 DO GUIR^XBLM("^AMHRP8P","^XTMP(""AMHRPT"",JOB)")
+4 SET ^XTMP("AMHRPT",JOB,.5)=$ORDER(^XTMP("AMHRPT",JOB,""),-1)+1
+5 SET ^XTMP("AMHRPTRUN",JOB)="DONE"
+6 DO KILL
+7 QUIT
+8 ;
KILL ;
+1 KILL AMHOA,AMHBT,AMHTOT
+2 KILL AMHCTR,AMHGUI,AMHSF,DIC,JOB,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
+3 DO XIT^AMHRP8
+4 QUIT