AMHGE ; IHS/CMI/MAW - AMHG GUI BH Filing Utilities 12/19/2008 2:59:00 PM ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
;
DEBUG(RETVAL,AMHSTR) ;replace tag below to allow Serenji debug of GUI
D DEBUG^%Serenji("MRUU^AMHGE(.AMHRET,.AMHSTR)")
Q
;
MRUP(RETVAL,AMHSTR) ;-- save most recently selected item in AMHG MOST RECENTLY SELECTED PATIENT file
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,AMHERRR,P,AMHIEN,AMHFL,AMHFIEN,AMHTXT1,AMHTXT2
S P="|"
K ^AMHTMP($J)
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
S @RETVAL@(AMHI)="T00001Result"_$C(30)
S AMHIEN=$P(AMHSTR,P)
S AMHFL=$P(AMHSTR,P,2)
S AMHFIEN=$P(AMHSTR,P,3)
S AMHTXT1=$P(AMHSTR,P,4)
S AMHTXT2=$P(AMHSTR,P,5)
S AMHI=AMHI+1
N AMHE
S AMHE=$O(^AMHGMRUP("B",AMHIEN,0))
I '$G(AMHE) D Q ;lets add the entire entry here
. N AMHFDA,AMHIENS,AMHERRR
. S AMHERRR=""
. S AMHIENS(1)=AMHIEN
. S AMHIENS(2)=AMHFL
. S AMHIENS(3)=AMHFIEN
. S AMHFDA(9002012.96,"+1,",.01)=AMHIEN
. S AMHFDA(9002012.961,"+2,+1,",.01)=AMHFL
. S AMHFDA(9002012.9611,"+3,+2,+1,",.01)=AMHFIEN
. S AMHFDA(9002012.9611,"+3,+2,+1,",.02)=AMHTXT1
. S AMHFDA(9002012.9611,"+3,+2,+1,",.03)=AMHTXT2
. D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
. I '$G(AMHIENS(1)) S @RETVAL@(AMHI)=0_$C(30)
. I $G(AMHIENS(1)) S @RETVAL@(AMHI)=1_$C(30)
. S @RETVAL@(AMHI+1)=$C(31)
N AMHF
S AMHF=$O(^AMHGMRUP(AMHE,1,"B",AMHFL,0))
I '$G(AMHF) D Q ;we have the patient but no file yet
. N AMHFDA,AMHIENS,AMHERRR
. S AMHERRR=""
. S AMHIENS(1)=AMHIEN
. S AMHIENS(2)=AMHFL
. S AMHIENS(3)=AMHFIEN
. S AMHFDA(9002012.96,AMHIEN_",",.01)=AMHIEN
. S AMHFDA(9002012.961,"+2,"_AMHIEN_",",.01)=AMHFL
. S AMHFDA(9002012.9611,"+3,+2,"_AMHIEN_",",.01)=AMHFIEN
. S AMHFDA(9002012.9611,"+3,+2,"_AMHIEN_",",.02)=AMHTXT1
. S AMHFDA(9002012.9611,"+3,+2,"_AMHIEN_",",.03)=AMHTXT2
. D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
. I '$G(AMHIENS(1)) S @RETVAL@(AMHI)=0_$C(30)
. I $G(AMHIENS(1)) S @RETVAL@(AMHI)=1_$C(30)
. S @RETVAL@(AMHI+1)=$C(31)
N AMHIT
S AMHIT=$O(^AMHGMRUP(AMHE,1,AMHFL,1,"B",AMHFIEN,0))
I '$G(AMHIT) D Q
. N AMHFDA,AMHIENS,AMHERRR
. S AMHERRR=""
. S AMHIENS(1)=AMHIEN
. S AMHIENS(2)=AMHFL
. S AMHIENS(3)=AMHFIEN
. S AMHFDA(9002012.96,AMHIEN_",",.01)=AMHIEN
. S AMHFDA(9002012.961,AMHFL_","_AMHIEN_",",.01)=AMHFL
. S AMHFDA(9002012.9611,"+3,"_AMHFL_","_AMHIEN_",",.01)=AMHFIEN
. S AMHFDA(9002012.9611,"+3,"_AMHFL_","_AMHIEN_",",.02)=AMHTXT1
. S AMHFDA(9002012.9611,"+3,"_AMHFL_","_AMHIEN_",",.03)=AMHTXT2
. D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
. I '$G(AMHIENS(1)) S @RETVAL@(AMHI)=0_$C(30)
. I $G(AMHIENS(1)) S @RETVAL@(AMHI)=1_$C(30)
. S @RETVAL@(AMHI+1)=$C(31)
Q
;
MRUU(RETVAL,AMHSTR) ;-- save most recently selected item in AMHG MOST RECENTLY SELECTED USER file
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,AMHERRR,P,AMHIEN,AMHFL,AMHFIEN,AMHTXT1,AMHTXT2
S P="|"
K ^AMHTMP($J)
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
S @RETVAL@(AMHI)="T00001Result"_$C(30)
S AMHIEN=$P(AMHSTR,P)
S AMHFL=$P(AMHSTR,P,2)
S AMHFIEN=$P(AMHSTR,P,3)
S AMHTXT1=$P(AMHSTR,P,4)
S AMHTXT2=$P(AMHSTR,P,5)
S AMHI=AMHI+1
N AMHE
S AMHE=$O(^AMHGMRUU("B",AMHIEN,0))
I '$G(AMHE) D Q ;lets add the entire entry here
. N AMHFDA,AMHIENS,AMHERRR
. S AMHERRR=""
. S AMHIENS(1)=AMHIEN
. S AMHIENS(2)=AMHFL
. S AMHIENS(3)=AMHFIEN
. S AMHFDA(9002012.97,"+1,",.01)=AMHIEN
. S AMHFDA(9002012.971,"+2,+1,",.01)=AMHFL
. S AMHFDA(9002012.9711,"+3,+2,+1,",.01)=AMHFIEN
. S AMHFDA(9002012.9711,"+3,+2,+1,",.02)=AMHTXT1
. S AMHFDA(9002012.9711,"+3,+2,+1,",.03)=AMHTXT2
. D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
. I '$G(AMHIENS(1)) S @RETVAL@(AMHI)=0_$C(30)
. I $G(AMHIENS(1)) S @RETVAL@(AMHI)=1_$C(30)
. S @RETVAL@(AMHI+1)=$C(31)
N AMHF
S AMHF=$O(^AMHGMRUU(AMHE,1,"B",AMHFL,0))
I '$G(AMHF) D Q ;we have the patient but no file yet
. N AMHFDA,AMHIENS,AMHERRR
. S AMHERRR=""
. S AMHIENS(1)=AMHIEN
. S AMHIENS(2)=AMHFL
. S AMHIENS(3)=AMHFIEN
. S AMHFDA(9002012.97,AMHIEN_",",.01)=AMHIEN
. S AMHFDA(9002012.971,"+2,"_AMHIEN_",",.01)=AMHFL
. S AMHFDA(9002012.9711,"+3,+2,"_AMHIEN_",",.01)=AMHFIEN
. S AMHFDA(9002012.9711,"+3,+2,"_AMHIEN_",",.02)=AMHTXT1
. S AMHFDA(9002012.9711,"+3,+2,"_AMHIEN_",",.03)=AMHTXT2
. D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
. I '$G(AMHIENS(1)) S @RETVAL@(AMHI)=0_$C(30)
. I $G(AMHIENS(1)) S @RETVAL@(AMHI)=1_$C(30)
. S @RETVAL@(AMHI+1)=$C(31)
N AMHIT
S AMHIT=$O(^AMHGMRUU(AMHE,1,AMHFL,1,"B",AMHFIEN,0))
I '$G(AMHIT) D Q
. N AMHFDA,AMHIENS,AMHERRR
. S AMHERRR=""
. S AMHIENS(1)=AMHIEN
. S AMHIENS(2)=AMHFL
. S AMHIENS(3)=AMHFIEN
. S AMHFDA(9002012.97,AMHIEN_",",.01)=AMHIEN
. S AMHFDA(9002012.971,AMHFL_","_AMHIEN_",",.01)=AMHFL
. S AMHFDA(9002012.9711,"+3,"_AMHFL_","_AMHIEN_",",.01)=AMHFIEN
. S AMHFDA(9002012.9711,"+3,"_AMHFL_","_AMHIEN_",",.02)=AMHTXT1
. S AMHFDA(9002012.9711,"+3,"_AMHFL_","_AMHIEN_",",.03)=AMHTXT2
. D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
. I '$G(AMHIENS(1)) S @RETVAL@(AMHI)=0_$C(30)
. I $G(AMHIENS(1)) S @RETVAL@(AMHI)=1_$C(30)
. S @RETVAL@(AMHI+1)=$C(31)
Q
;
MRUDP(RETVAL,AMHSTR) ;-- remove an entry from the most recently selected list
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,AMHERRR,P,AMHIEN,AMHFL,AMHFIEN
S P="|"
K ^AMHTMP($J)
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
S @RETVAL@(AMHI)="T00001Result"_$C(30)
S AMHIEN=$P(AMHSTR,P)
S AMHFL=$P(AMHSTR,P,2)
S AMHFIEN=$P(AMHSTR,P,3)
S DA(2)=AMHIEN,DA(1)=AMHFL,DA=AMHFIEN
S DIK="^AMHGMRUP("_DA(2)_",1,"_DA(1)_",1,"
D ^DIK
S @RETVAL@(AMHI+1)=$C(31)
Q
;
MRUDU(RETVAL,AMHSTR) ;-- remove an entry from the most recently selected list
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,AMHERRR,P,AMHIEN,AMHFL,AMHFIEN
S P="|"
K ^AMHTMP($J)
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
S @RETVAL@(AMHI)="T00001Result"_$C(30)
S AMHIEN=$P(AMHSTR,P)
S AMHFL=$P(AMHSTR,P,2)
S AMHFIEN=$P(AMHSTR,P,3)
S DA(2)=AMHIEN,DA(1)=AMHFL,DA=AMHFIEN
S DIK="^AMHGMRUU("_DA(2)_",1,"_DA(1)_",1,"
D ^DIK
S @RETVAL@(AMHI+1)=$C(31)
Q
;
AMHGE ; IHS/CMI/MAW - AMHG GUI BH Filing Utilities 12/19/2008 2:59:00 PM ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
+4 ;
DEBUG(RETVAL,AMHSTR) ;replace tag below to allow Serenji debug of GUI
+1 DO DEBUG^%Serenji("MRUU^AMHGE(.AMHRET,.AMHSTR)")
+2 QUIT
+3 ;
MRUP(RETVAL,AMHSTR) ;-- save most recently selected item in AMHG MOST RECENTLY SELECTED PATIENT file
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,AMHERRR,P,AMHIEN,AMHFL,AMHFIEN,AMHTXT1,AMHTXT2
+3 SET P="|"
+4 KILL ^AMHTMP($JOB)
+5 SET RETVAL="^AMHTMP("_$JOB_")"
+6 SET AMHI=0
+7 SET @RETVAL@(AMHI)="T00001Result"_$CHAR(30)
+8 SET AMHIEN=$PIECE(AMHSTR,P)
+9 SET AMHFL=$PIECE(AMHSTR,P,2)
+10 SET AMHFIEN=$PIECE(AMHSTR,P,3)
+11 SET AMHTXT1=$PIECE(AMHSTR,P,4)
+12 SET AMHTXT2=$PIECE(AMHSTR,P,5)
+13 SET AMHI=AMHI+1
+14 NEW AMHE
+15 SET AMHE=$ORDER(^AMHGMRUP("B",AMHIEN,0))
+16 ;lets add the entire entry here
IF '$GET(AMHE)
Begin DoDot:1
+17 NEW AMHFDA,AMHIENS,AMHERRR
+18 SET AMHERRR=""
+19 SET AMHIENS(1)=AMHIEN
+20 SET AMHIENS(2)=AMHFL
+21 SET AMHIENS(3)=AMHFIEN
+22 SET AMHFDA(9002012.96,"+1,",.01)=AMHIEN
+23 SET AMHFDA(9002012.961,"+2,+1,",.01)=AMHFL
+24 SET AMHFDA(9002012.9611,"+3,+2,+1,",.01)=AMHFIEN
+25 SET AMHFDA(9002012.9611,"+3,+2,+1,",.02)=AMHTXT1
+26 SET AMHFDA(9002012.9611,"+3,+2,+1,",.03)=AMHTXT2
+27 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+28 IF '$GET(AMHIENS(1))
SET @RETVAL@(AMHI)=0_$CHAR(30)
+29 IF $GET(AMHIENS(1))
SET @RETVAL@(AMHI)=1_$CHAR(30)
+30 SET @RETVAL@(AMHI+1)=$CHAR(31)
End DoDot:1
QUIT
+31 NEW AMHF
+32 SET AMHF=$ORDER(^AMHGMRUP(AMHE,1,"B",AMHFL,0))
+33 ;we have the patient but no file yet
IF '$GET(AMHF)
Begin DoDot:1
+34 NEW AMHFDA,AMHIENS,AMHERRR
+35 SET AMHERRR=""
+36 SET AMHIENS(1)=AMHIEN
+37 SET AMHIENS(2)=AMHFL
+38 SET AMHIENS(3)=AMHFIEN
+39 SET AMHFDA(9002012.96,AMHIEN_",",.01)=AMHIEN
+40 SET AMHFDA(9002012.961,"+2,"_AMHIEN_",",.01)=AMHFL
+41 SET AMHFDA(9002012.9611,"+3,+2,"_AMHIEN_",",.01)=AMHFIEN
+42 SET AMHFDA(9002012.9611,"+3,+2,"_AMHIEN_",",.02)=AMHTXT1
+43 SET AMHFDA(9002012.9611,"+3,+2,"_AMHIEN_",",.03)=AMHTXT2
+44 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+45 IF '$GET(AMHIENS(1))
SET @RETVAL@(AMHI)=0_$CHAR(30)
+46 IF $GET(AMHIENS(1))
SET @RETVAL@(AMHI)=1_$CHAR(30)
+47 SET @RETVAL@(AMHI+1)=$CHAR(31)
End DoDot:1
QUIT
+48 NEW AMHIT
+49 SET AMHIT=$ORDER(^AMHGMRUP(AMHE,1,AMHFL,1,"B",AMHFIEN,0))
+50 IF '$GET(AMHIT)
Begin DoDot:1
+51 NEW AMHFDA,AMHIENS,AMHERRR
+52 SET AMHERRR=""
+53 SET AMHIENS(1)=AMHIEN
+54 SET AMHIENS(2)=AMHFL
+55 SET AMHIENS(3)=AMHFIEN
+56 SET AMHFDA(9002012.96,AMHIEN_",",.01)=AMHIEN
+57 SET AMHFDA(9002012.961,AMHFL_","_AMHIEN_",",.01)=AMHFL
+58 SET AMHFDA(9002012.9611,"+3,"_AMHFL_","_AMHIEN_",",.01)=AMHFIEN
+59 SET AMHFDA(9002012.9611,"+3,"_AMHFL_","_AMHIEN_",",.02)=AMHTXT1
+60 SET AMHFDA(9002012.9611,"+3,"_AMHFL_","_AMHIEN_",",.03)=AMHTXT2
+61 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+62 IF '$GET(AMHIENS(1))
SET @RETVAL@(AMHI)=0_$CHAR(30)
+63 IF $GET(AMHIENS(1))
SET @RETVAL@(AMHI)=1_$CHAR(30)
+64 SET @RETVAL@(AMHI+1)=$CHAR(31)
End DoDot:1
QUIT
+65 QUIT
+66 ;
MRUU(RETVAL,AMHSTR) ;-- save most recently selected item in AMHG MOST RECENTLY SELECTED USER file
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,AMHERRR,P,AMHIEN,AMHFL,AMHFIEN,AMHTXT1,AMHTXT2
+3 SET P="|"
+4 KILL ^AMHTMP($JOB)
+5 SET RETVAL="^AMHTMP("_$JOB_")"
+6 SET AMHI=0
+7 SET @RETVAL@(AMHI)="T00001Result"_$CHAR(30)
+8 SET AMHIEN=$PIECE(AMHSTR,P)
+9 SET AMHFL=$PIECE(AMHSTR,P,2)
+10 SET AMHFIEN=$PIECE(AMHSTR,P,3)
+11 SET AMHTXT1=$PIECE(AMHSTR,P,4)
+12 SET AMHTXT2=$PIECE(AMHSTR,P,5)
+13 SET AMHI=AMHI+1
+14 NEW AMHE
+15 SET AMHE=$ORDER(^AMHGMRUU("B",AMHIEN,0))
+16 ;lets add the entire entry here
IF '$GET(AMHE)
Begin DoDot:1
+17 NEW AMHFDA,AMHIENS,AMHERRR
+18 SET AMHERRR=""
+19 SET AMHIENS(1)=AMHIEN
+20 SET AMHIENS(2)=AMHFL
+21 SET AMHIENS(3)=AMHFIEN
+22 SET AMHFDA(9002012.97,"+1,",.01)=AMHIEN
+23 SET AMHFDA(9002012.971,"+2,+1,",.01)=AMHFL
+24 SET AMHFDA(9002012.9711,"+3,+2,+1,",.01)=AMHFIEN
+25 SET AMHFDA(9002012.9711,"+3,+2,+1,",.02)=AMHTXT1
+26 SET AMHFDA(9002012.9711,"+3,+2,+1,",.03)=AMHTXT2
+27 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+28 IF '$GET(AMHIENS(1))
SET @RETVAL@(AMHI)=0_$CHAR(30)
+29 IF $GET(AMHIENS(1))
SET @RETVAL@(AMHI)=1_$CHAR(30)
+30 SET @RETVAL@(AMHI+1)=$CHAR(31)
End DoDot:1
QUIT
+31 NEW AMHF
+32 SET AMHF=$ORDER(^AMHGMRUU(AMHE,1,"B",AMHFL,0))
+33 ;we have the patient but no file yet
IF '$GET(AMHF)
Begin DoDot:1
+34 NEW AMHFDA,AMHIENS,AMHERRR
+35 SET AMHERRR=""
+36 SET AMHIENS(1)=AMHIEN
+37 SET AMHIENS(2)=AMHFL
+38 SET AMHIENS(3)=AMHFIEN
+39 SET AMHFDA(9002012.97,AMHIEN_",",.01)=AMHIEN
+40 SET AMHFDA(9002012.971,"+2,"_AMHIEN_",",.01)=AMHFL
+41 SET AMHFDA(9002012.9711,"+3,+2,"_AMHIEN_",",.01)=AMHFIEN
+42 SET AMHFDA(9002012.9711,"+3,+2,"_AMHIEN_",",.02)=AMHTXT1
+43 SET AMHFDA(9002012.9711,"+3,+2,"_AMHIEN_",",.03)=AMHTXT2
+44 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+45 IF '$GET(AMHIENS(1))
SET @RETVAL@(AMHI)=0_$CHAR(30)
+46 IF $GET(AMHIENS(1))
SET @RETVAL@(AMHI)=1_$CHAR(30)
+47 SET @RETVAL@(AMHI+1)=$CHAR(31)
End DoDot:1
QUIT
+48 NEW AMHIT
+49 SET AMHIT=$ORDER(^AMHGMRUU(AMHE,1,AMHFL,1,"B",AMHFIEN,0))
+50 IF '$GET(AMHIT)
Begin DoDot:1
+51 NEW AMHFDA,AMHIENS,AMHERRR
+52 SET AMHERRR=""
+53 SET AMHIENS(1)=AMHIEN
+54 SET AMHIENS(2)=AMHFL
+55 SET AMHIENS(3)=AMHFIEN
+56 SET AMHFDA(9002012.97,AMHIEN_",",.01)=AMHIEN
+57 SET AMHFDA(9002012.971,AMHFL_","_AMHIEN_",",.01)=AMHFL
+58 SET AMHFDA(9002012.9711,"+3,"_AMHFL_","_AMHIEN_",",.01)=AMHFIEN
+59 SET AMHFDA(9002012.9711,"+3,"_AMHFL_","_AMHIEN_",",.02)=AMHTXT1
+60 SET AMHFDA(9002012.9711,"+3,"_AMHFL_","_AMHIEN_",",.03)=AMHTXT2
+61 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+62 IF '$GET(AMHIENS(1))
SET @RETVAL@(AMHI)=0_$CHAR(30)
+63 IF $GET(AMHIENS(1))
SET @RETVAL@(AMHI)=1_$CHAR(30)
+64 SET @RETVAL@(AMHI+1)=$CHAR(31)
End DoDot:1
QUIT
+65 QUIT
+66 ;
MRUDP(RETVAL,AMHSTR) ;-- remove an entry from the most recently selected list
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,AMHERRR,P,AMHIEN,AMHFL,AMHFIEN
+3 SET P="|"
+4 KILL ^AMHTMP($JOB)
+5 SET RETVAL="^AMHTMP("_$JOB_")"
+6 SET AMHI=0
+7 SET @RETVAL@(AMHI)="T00001Result"_$CHAR(30)
+8 SET AMHIEN=$PIECE(AMHSTR,P)
+9 SET AMHFL=$PIECE(AMHSTR,P,2)
+10 SET AMHFIEN=$PIECE(AMHSTR,P,3)
+11 SET DA(2)=AMHIEN
SET DA(1)=AMHFL
SET DA=AMHFIEN
+12 SET DIK="^AMHGMRUP("_DA(2)_",1,"_DA(1)_",1,"
+13 DO ^DIK
+14 SET @RETVAL@(AMHI+1)=$CHAR(31)
+15 QUIT
+16 ;
MRUDU(RETVAL,AMHSTR) ;-- remove an entry from the most recently selected list
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,AMHERRR,P,AMHIEN,AMHFL,AMHFIEN
+3 SET P="|"
+4 KILL ^AMHTMP($JOB)
+5 SET RETVAL="^AMHTMP("_$JOB_")"
+6 SET AMHI=0
+7 SET @RETVAL@(AMHI)="T00001Result"_$CHAR(30)
+8 SET AMHIEN=$PIECE(AMHSTR,P)
+9 SET AMHFL=$PIECE(AMHSTR,P,2)
+10 SET AMHFIEN=$PIECE(AMHSTR,P,3)
+11 SET DA(2)=AMHIEN
SET DA(1)=AMHFL
SET DA=AMHFIEN
+12 SET DIK="^AMHGMRUU("_DA(2)_",1,"_DA(1)_",1,"
+13 DO ^DIK
+14 SET @RETVAL@(AMHI+1)=$CHAR(31)
+15 QUIT
+16 ;