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

AMHGSSF.m

Go to the documentation of this file.
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
 ;