AMHGSSF ; IHS/CMI/MAW - AMHG Suicide Form Save 9:22:26 AM ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
D DEBUG^%Serenji("METH^AMHGSSF(.RETVAL,.AMHSTR)")
Q
;
SF(RETVAL,AMHSTR) ;-- save suicide data called from clsSuicideFormDataEntry.SaveSuicideData method
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHLC,AMHDOA,AMHPRV,AMHCOA,AMHP,AMHRS,AMHES,AMHEDU,AMHEDUL,AMHSB,AMHPA,AMHDSP,AMHDSPO,AMHLOA,AMHLOAO,AMHSU,AMHER
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHDM=$P(AMHSTR,P)
S AMHREC=$P(AMHSTR,P,2)
S AMHP=$P(AMHSTR,P,3)
S AMHLC=$P(AMHSTR,P,4)
S AMHDOA=$P(AMHSTR,P,5)
S AMHPRV=$P(AMHSTR,P,6)
S AMHCOA=$P(AMHSTR,P,7)
S AMHRS=$$SCI^AMHGT(9002011.65,.08,$P(AMHSTR,P,8))
S AMHES=$$SCI^AMHGT(9002011.65,.05,$P(AMHSTR,P,9))
S AMHEDU=$$SCI^AMHGT(9002011.65,.11,$P(AMHSTR,P,10))
S AMHEDUL=$P(AMHSTR,P,11)
S AMHSB=$$SCI^AMHGT(9002011.65,.13,$P(AMHSTR,P,12))
S AMHPA=$$SCI^AMHGT(9002011.65,.14,$P(AMHSTR,P,13))
S AMHDSP=$P(AMHSTR,P,14)
S AMHDSPO=$P(AMHSTR,P,15)
S AMHLOA=$$SCI^AMHGT(9002011.65,.15,$P(AMHSTR,P,16))
S AMHLOAO=$P(AMHSTR,P,17)
S AMHSU=$P(AMHSTR,P,18)
S AMHCN=$$UPI^AMHSFR(AMHP,DT)
D SF^AMHGESF(.AMHIEN,AMHDM,AMHREC,AMHP,AMHCN,AMHLC,AMHDOA,AMHPRV,AMHCOA,AMHRS,AMHES,AMHEDU,AMHEDUL,AMHSB,AMHPA,AMHDSP,AMHDSPO,AMHLOA,AMHLOAO,AMHSU)
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHIEN)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
METH(RETVAL,AMHSTR) ;- save suicide method, called from clsSuicideFormDataEntry.SaveMethod method
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHMO,AMHMSTR,AMHOSTR,AMHER
K AMHM,AMHO
N AMHM,AMHO
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHDM=$P(AMHSTR,P)
S AMHREC=$P(AMHSTR,P,2)
S AMHMO=$P(AMHSTR,P,3)
S AMHMSTR=$P(AMHSTR,P,4)
S AMHOSTR=$P(AMHSTR,P,5)
D ARRAY^AMHGU(.AMHM,AMHMSTR)
D ARRAY^AMHGU(.AMHO,AMHOSTR)
D METH^AMHGESF(.AMHIEN,AMHDM,AMHREC,AMHMO,.AMHM,.AMHO)
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHIEN)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
SUB(RETVAL,AMHSTR) ;-- save substances involved called from clsSuicideDataEntryForm.SaveSubstancesInvolved
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHSSTR,AMHER
K AMHS
N AMHS
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHDM=$P(AMHSTR,P)
S AMHREC=$P(AMHSTR,P,2)
S AMHSSTR=$P(AMHSTR,P,3)
D ARRAY^AMHGU(.AMHS,AMHSSTR)
D SUB^AMHGESF(.AMHIEN,AMHREC,.AMHS)
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHIEN)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
CF(RETVAL,AMHSTR) ;-- save contributing factors, called from clsSuicideFormDataEntry.SaveContributingFactors method
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHCO,AMHCSTR,AMHER
K AMHC
N AMHC
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHDM=$P(AMHSTR,P)
S AMHREC=$P(AMHSTR,P,2)
S AMHCO=$P(AMHSTR,P,3)
S AMHCSTR=$P(AMHSTR,P,4)
D ARRAY^AMHGU(.AMHC,AMHCSTR)
D CF^AMHGESF(.AMHIEN,AMHDM,AMHREC,AMHCO,.AMHC)
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHIEN)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
NARR(RETVAL,AMHSTR) ;-- save suicide other relevent information, called from clsSuicideFormDataEntry.SaveNarrative method
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHNARR,AMHER
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
S AMHDM=$P(AMHSTR,P)
S AMHREC=$P(AMHSTR,P,2)
S AMHNARR=$P(AMHSTR,P,3)
D NARR^AMHGESF(AMHREC,AMHNARR)
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHIEN)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
DEL(RETVAL,AMHSTR) ;-- mark a record as deleted
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHDM,AMHREC
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
K ^AMHTMP($J)
S AMHREC=$P(AMHSTR,P)
S DIK="^AMHPSUIC(",DA=AMHREC D ^DIK
S @RETVAL@(AMHI)="T00030Result"_$C(30)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHREC)_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
AMHGSSF ; IHS/CMI/MAW - AMHG Suicide Form Save 9:22:26 AM ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
+4 ;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
+1 DO DEBUG^%Serenji("METH^AMHGSSF(.RETVAL,.AMHSTR)")
+2 QUIT
+3 ;
SF(RETVAL,AMHSTR) ;-- save suicide data called from clsSuicideFormDataEntry.SaveSuicideData method
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHLC,AMHDOA,AMHPRV,AMHCOA,AMHP,AMHRS,AMHES,AMHEDU,AMHEDUL,AMHSB,AMHPA,AMHDSP,AMHDSPO,AMHLOA,AMHLOAO,AMHSU,AMHER
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 KILL ^AMHTMP($JOB)
+7 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+8 SET AMHDM=$PIECE(AMHSTR,P)
+9 SET AMHREC=$PIECE(AMHSTR,P,2)
+10 SET AMHP=$PIECE(AMHSTR,P,3)
+11 SET AMHLC=$PIECE(AMHSTR,P,4)
+12 SET AMHDOA=$PIECE(AMHSTR,P,5)
+13 SET AMHPRV=$PIECE(AMHSTR,P,6)
+14 SET AMHCOA=$PIECE(AMHSTR,P,7)
+15 SET AMHRS=$$SCI^AMHGT(9002011.65,.08,$PIECE(AMHSTR,P,8))
+16 SET AMHES=$$SCI^AMHGT(9002011.65,.05,$PIECE(AMHSTR,P,9))
+17 SET AMHEDU=$$SCI^AMHGT(9002011.65,.11,$PIECE(AMHSTR,P,10))
+18 SET AMHEDUL=$PIECE(AMHSTR,P,11)
+19 SET AMHSB=$$SCI^AMHGT(9002011.65,.13,$PIECE(AMHSTR,P,12))
+20 SET AMHPA=$$SCI^AMHGT(9002011.65,.14,$PIECE(AMHSTR,P,13))
+21 SET AMHDSP=$PIECE(AMHSTR,P,14)
+22 SET AMHDSPO=$PIECE(AMHSTR,P,15)
+23 SET AMHLOA=$$SCI^AMHGT(9002011.65,.15,$PIECE(AMHSTR,P,16))
+24 SET AMHLOAO=$PIECE(AMHSTR,P,17)
+25 SET AMHSU=$PIECE(AMHSTR,P,18)
+26 SET AMHCN=$$UPI^AMHSFR(AMHP,DT)
+27 DO SF^AMHGESF(.AMHIEN,AMHDM,AMHREC,AMHP,AMHCN,AMHLC,AMHDOA,AMHPRV,AMHCOA,AMHRS,AMHES,AMHEDU,AMHEDUL,AMHSB,AMHPA,AMHDSP,AMHDSPO,AMHLOA,AMHLOAO,AMHSU)
+28 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+29 SET AMHI=AMHI+1
+30 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHIEN)_$CHAR(30)
+31 SET @RETVAL@(AMHI+1)=$CHAR(31)
+32 QUIT
+33 ;
METH(RETVAL,AMHSTR) ;- save suicide method, called from clsSuicideFormDataEntry.SaveMethod method
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHMO,AMHMSTR,AMHOSTR,AMHER
+3 KILL AMHM,AMHO
+4 NEW AMHM,AMHO
+5 SET P="|"
SET R="~"
+6 SET RETVAL="^AMHTMP("_$JOB_")"
+7 SET AMHI=0
+8 KILL ^AMHTMP($JOB)
+9 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+10 SET AMHDM=$PIECE(AMHSTR,P)
+11 SET AMHREC=$PIECE(AMHSTR,P,2)
+12 SET AMHMO=$PIECE(AMHSTR,P,3)
+13 SET AMHMSTR=$PIECE(AMHSTR,P,4)
+14 SET AMHOSTR=$PIECE(AMHSTR,P,5)
+15 DO ARRAY^AMHGU(.AMHM,AMHMSTR)
+16 DO ARRAY^AMHGU(.AMHO,AMHOSTR)
+17 DO METH^AMHGESF(.AMHIEN,AMHDM,AMHREC,AMHMO,.AMHM,.AMHO)
+18 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+19 SET AMHI=AMHI+1
+20 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHIEN)_$CHAR(30)
+21 SET @RETVAL@(AMHI+1)=$CHAR(31)
+22 QUIT
+23 ;
SUB(RETVAL,AMHSTR) ;-- save substances involved called from clsSuicideDataEntryForm.SaveSubstancesInvolved
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHSSTR,AMHER
+3 KILL AMHS
+4 NEW AMHS
+5 SET P="|"
SET R="~"
+6 SET RETVAL="^AMHTMP("_$JOB_")"
+7 SET AMHI=0
+8 KILL ^AMHTMP($JOB)
+9 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+10 SET AMHDM=$PIECE(AMHSTR,P)
+11 SET AMHREC=$PIECE(AMHSTR,P,2)
+12 SET AMHSSTR=$PIECE(AMHSTR,P,3)
+13 DO ARRAY^AMHGU(.AMHS,AMHSSTR)
+14 DO SUB^AMHGESF(.AMHIEN,AMHREC,.AMHS)
+15 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+16 SET AMHI=AMHI+1
+17 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHIEN)_$CHAR(30)
+18 SET @RETVAL@(AMHI+1)=$CHAR(31)
+19 QUIT
+20 ;
CF(RETVAL,AMHSTR) ;-- save contributing factors, called from clsSuicideFormDataEntry.SaveContributingFactors method
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHCO,AMHCSTR,AMHER
+3 KILL AMHC
+4 NEW AMHC
+5 SET P="|"
SET R="~"
+6 SET RETVAL="^AMHTMP("_$JOB_")"
+7 SET AMHI=0
+8 KILL ^AMHTMP($JOB)
+9 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+10 SET AMHDM=$PIECE(AMHSTR,P)
+11 SET AMHREC=$PIECE(AMHSTR,P,2)
+12 SET AMHCO=$PIECE(AMHSTR,P,3)
+13 SET AMHCSTR=$PIECE(AMHSTR,P,4)
+14 DO ARRAY^AMHGU(.AMHC,AMHCSTR)
+15 DO CF^AMHGESF(.AMHIEN,AMHDM,AMHREC,AMHCO,.AMHC)
+16 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+17 SET AMHI=AMHI+1
+18 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHIEN)_$CHAR(30)
+19 SET @RETVAL@(AMHI+1)=$CHAR(31)
+20 QUIT
+21 ;
NARR(RETVAL,AMHSTR) ;-- save suicide other relevent information, called from clsSuicideFormDataEntry.SaveNarrative method
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHCN,AMHDM,AMHREC,AMHNARR,AMHER
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 KILL ^AMHTMP($JOB)
+7 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+8 SET AMHDM=$PIECE(AMHSTR,P)
+9 SET AMHREC=$PIECE(AMHSTR,P,2)
+10 SET AMHNARR=$PIECE(AMHSTR,P,3)
+11 DO NARR^AMHGESF(AMHREC,AMHNARR)
+12 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+13 SET AMHI=AMHI+1
+14 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHIEN)_$CHAR(30)
+15 SET @RETVAL@(AMHI+1)=$CHAR(31)
+16 QUIT
+17 ;
DEL(RETVAL,AMHSTR) ;-- mark a record as deleted
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHDM,AMHREC
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 IF $GET(AMHSTR)=""
DO CATSTR^AMHGU(.AMHSTR,.AMHSTR)
+7 KILL ^AMHTMP($JOB)
+8 SET AMHREC=$PIECE(AMHSTR,P)
+9 SET DIK="^AMHPSUIC("
SET DA=AMHREC
DO ^DIK
+10 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+11 SET AMHI=AMHI+1
+12 SET @RETVAL@(AMHI)=$SELECT($GET(AMHER)]"":AMHER,1:AMHREC)_$CHAR(30)
+13 SET @RETVAL@(AMHI+1)=$CHAR(31)
+14 QUIT
+15 ;