AMHBHDSP ; IHS/CMI/LAB - behavioral health display for GUI ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
TESTREC ;
D RECDISP(.RETVAL,33)
Q
TESTENC ;
D ENCFORM(.RETVAL,33,"S")
Q
TESTSUIC ;
D SUICDSP(.RETVAL,5)
Q
SUICDSP(AMHARRAY,AMHIEN) ;EP CALL FROM REMOTE PROC: AMHBH SUICIDE FORM DSP
;
ENSFDSP ;
S JOB=$J,AMHGUI=1,XWBWRAP=1
S ZTIO="",ZTQUEUED=1
S AMHARRAY="^XTMP(""AMHSF"","_$J_")"
S AMHSF=AMHIEN
K ^XTMP("AMHSF",JOB)
S ^XTMP("AMHSFRUN",JOB)=""
;D ^XBKSET
D GUIR^XBLM("PRINT^AMHLESF1","^XTMP(""AMHSF"",JOB)")
S ^XTMP("AMHSF",JOB,.5)=$O(^XTMP("AMHSF",JOB,""),-1)+1
S ^XTMP("AMHSFRUN",JOB)="DONE"
Q
;
KILL ;
K AMHCTR,AMHGUI,AMHSF,DIC,JOB,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
Q
ENCFORM(AMHARRY,AMHR,AMHEFT) ;EP called to get encounter form in array
;AMHR=ien of BH record
;array is ^TMP("AMHS",$J,"DCS")
;AMHEFT=type of form to print
; S - Suppressed
; F - Full
S AMHARRY=$NA(@"^TMP(""AMHS"",$J,""DCS"")")
K ^TMP("AMHS",$J,"DCS")
I $G(AMHEFT)="" S AMHEFT="F"
I "FSB"'[AMHEFT Q
S AMHGUI=1
D GUIR^XBLM("^AMHLEFP2","^XTMP(""AMHGEF"",$J)")
;D ^AMHLEFP2
;D EP2^AMHLEFP2(AMHR,1)
NEW AMHCTR,X S (X,AMHCTR)=0 F S X=$O(^TMP("AMHS",$J,"DCS",X)) Q:X'=+X S AMHCTR=AMHCTR+1
S ^TMP("AMHS",$J,"DCS",.5)=AMHCTR+1 K ^TMP("AMHS",$J,"DCS",0)
K AMHGUI
Q
RECDISP(AMHARRY,AMHR) ;EP - called to display one BH record
;retval=array containg data, AMHR=ien of behavioral health record
;array returned is ^TMP("AMHVDSG",$J)
NEW X
S AMHARRY=$NA(@"^TMP(""AMHVDSG"",$J)")
K ^TMP("AMHVDSG",$J)
K X D EN^AMHVDSG1(AMHARRY,AMHR)
NEW AMHCTR S (X,AMHCTR)=0 F S X=$O(^TMP("AMHVDSG",$J,X)) Q:X'=+X S AMHCTR=AMHCTR+1,^TMP("AMHVDSG",$J,X)=^TMP("AMHVDSG",$J,X,0) K ^TMP("AMHVDSG",$J,X,0)
S ^TMP("AMHVDSG",$J,.5)=AMHCTR+1
Q
;
NRECDISP(AMHARRY,AMHR) ;EP - called to display one BH record
;retval=array containg data, AMHR=ien of behavioral health record
;array returned is ^TMP("AMHVDSG",$J)
NEW X
S AMHARRY=$NA(@"^TMP(""AMHVDSG"",$J)")
K ^TMP("AMHVDSG",$J)
K X D EN^AMHGBDSP(AMHARRY,AMHR)
NEW AMHCTR S (X,AMHCTR)=0 F S X=$O(^TMP("AMHVDSG",$J,X)) Q:X'=+X S AMHCTR=AMHCTR+1,^TMP("AMHVDSG",$J,X)=^TMP("AMHVDSG",$J,X,0) K ^TMP("AMHVDSG",$J,X,0)
S ^TMP("AMHVDSG",$J,.5)=AMHCTR+1
Q
AMHBHDSP ; IHS/CMI/LAB - behavioral health display for GUI ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
TESTREC ;
+1 DO RECDISP(.RETVAL,33)
+2 QUIT
TESTENC ;
+1 DO ENCFORM(.RETVAL,33,"S")
+2 QUIT
TESTSUIC ;
+1 DO SUICDSP(.RETVAL,5)
+2 QUIT
SUICDSP(AMHARRAY,AMHIEN) ;EP CALL FROM REMOTE PROC: AMHBH SUICIDE FORM DSP
+1 ;
ENSFDSP ;
+1 SET JOB=$JOB
SET AMHGUI=1
SET XWBWRAP=1
+2 SET ZTIO=""
SET ZTQUEUED=1
+3 SET AMHARRAY="^XTMP(""AMHSF"","_$JOB_")"
+4 SET AMHSF=AMHIEN
+5 KILL ^XTMP("AMHSF",JOB)
+6 SET ^XTMP("AMHSFRUN",JOB)=""
+7 ;D ^XBKSET
+8 DO GUIR^XBLM("PRINT^AMHLESF1","^XTMP(""AMHSF"",JOB)")
+9 SET ^XTMP("AMHSF",JOB,.5)=$ORDER(^XTMP("AMHSF",JOB,""),-1)+1
+10 SET ^XTMP("AMHSFRUN",JOB)="DONE"
+11 QUIT
+12 ;
KILL ;
+1 KILL AMHCTR,AMHGUI,AMHSF,DIC,JOB,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
+2 QUIT
ENCFORM(AMHARRY,AMHR,AMHEFT) ;EP called to get encounter form in array
+1 ;AMHR=ien of BH record
+2 ;array is ^TMP("AMHS",$J,"DCS")
+3 ;AMHEFT=type of form to print
+4 ; S - Suppressed
+5 ; F - Full
+6 SET AMHARRY=$NAME(@"^TMP(""AMHS"",$J,""DCS"")")
+7 KILL ^TMP("AMHS",$JOB,"DCS")
+8 IF $GET(AMHEFT)=""
SET AMHEFT="F"
+9 IF "FSB"'[AMHEFT
QUIT
+10 SET AMHGUI=1
+11 DO GUIR^XBLM("^AMHLEFP2","^XTMP(""AMHGEF"",$J)")
+12 ;D ^AMHLEFP2
+13 ;D EP2^AMHLEFP2(AMHR,1)
+14 NEW AMHCTR,X
SET (X,AMHCTR)=0
FOR
SET X=$ORDER(^TMP("AMHS",$JOB,"DCS",X))
IF X'=+X
QUIT
SET AMHCTR=AMHCTR+1
+15 SET ^TMP("AMHS",$JOB,"DCS",.5)=AMHCTR+1
KILL ^TMP("AMHS",$JOB,"DCS",0)
+16 KILL AMHGUI
+17 QUIT
RECDISP(AMHARRY,AMHR) ;EP - called to display one BH record
+1 ;retval=array containg data, AMHR=ien of behavioral health record
+2 ;array returned is ^TMP("AMHVDSG",$J)
+3 NEW X
+4 SET AMHARRY=$NAME(@"^TMP(""AMHVDSG"",$J)")
+5 KILL ^TMP("AMHVDSG",$JOB)
+6 KILL X
DO EN^AMHVDSG1(AMHARRY,AMHR)
+7 NEW AMHCTR
SET (X,AMHCTR)=0
FOR
SET X=$ORDER(^TMP("AMHVDSG",$JOB,X))
IF X'=+X
QUIT
SET AMHCTR=AMHCTR+1
SET ^TMP("AMHVDSG",$JOB,X)=^TMP("AMHVDSG",$JOB,X,0)
KILL ^TMP("AMHVDSG",$JOB,X,0)
+8 SET ^TMP("AMHVDSG",$JOB,.5)=AMHCTR+1
+9 QUIT
+10 ;
NRECDISP(AMHARRY,AMHR) ;EP - called to display one BH record
+1 ;retval=array containg data, AMHR=ien of behavioral health record
+2 ;array returned is ^TMP("AMHVDSG",$J)
+3 NEW X
+4 SET AMHARRY=$NAME(@"^TMP(""AMHVDSG"",$J)")
+5 KILL ^TMP("AMHVDSG",$JOB)
+6 KILL X
DO EN^AMHGBDSP(AMHARRY,AMHR)
+7 NEW AMHCTR
SET (X,AMHCTR)=0
FOR
SET X=$ORDER(^TMP("AMHVDSG",$JOB,X))
IF X'=+X
QUIT
SET AMHCTR=AMHCTR+1
SET ^TMP("AMHVDSG",$JOB,X)=^TMP("AMHVDSG",$JOB,X,0)
KILL ^TMP("AMHVDSG",$JOB,X,0)
+8 SET ^TMP("AMHVDSG",$JOB,.5)=AMHCTR+1
+9 QUIT