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

AMHGSCM.m

Go to the documentation of this file.
AMHGSCM ; IHS/CMI/MAW - AMHG Save Case Management 3/3/2009 4:59:31 PM ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;
 ;
 ;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
 D DEBUG^%Serenji("PH^AMHGSCM(.RETVAL,.AMHSTR)")
 Q
 ;
CM(RETVAL,AMHSTR) ;-- save case management called from the clsCaseManagement.SaveCaseManagement method
 S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
 N AMHI,P,R,AMHDM,AMHREC,AMHPRO,AMHCO,AMHPP,AMHCA,AMHNR,AMHDC,AMHDSP,AMHCMT,AMHP,AMHPV,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 AMHPRO=$P(AMHSTR,P,3)
 S AMHPRO=$$SCI^AMHGT(9002011,.02,AMHPRO)
 S AMHCO=$P(AMHSTR,P,4)
 S AMHPP=$P(AMHSTR,P,5)
 S AMHPV=$P(AMHSTR,P,6)
 S AMHCA=$P(AMHSTR,P,7)
 S AMHNR=$P(AMHSTR,P,8)
 S AMHDC=$P(AMHSTR,P,9)
 S AMHDSP=$P(AMHSTR,P,10)
 S AMHCMT=$P(AMHSTR,P,11)
 S AMHP=$P(AMHSTR,P,12)
 D CM^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHPRO,AMHCO,AMHPP,AMHPV,AMHCA,AMHNR,AMHDC,AMHDSP,AMHP,AMHCMT)
 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
 ;
PI(RETVAL,AMHSTR) ;-- save patient information called from clsCaseManagement.SavePatientInformation method
 S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
 N AMHI,P,R,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN,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 AMHDMP=$P(AMHSTR,P,3)
 S AMHDSP=$P(AMHSTR,P,4)
 S AMHDCP=$P(AMHSTR,P,5)
 S AMHDPO=$P(AMHSTR,P,6)
 S AMHDONA=$P(AMHSTR,P,7)
 S AMHDONB=$P(AMHSTR,P,8)
 S AMHFLG=$P(AMHSTR,P,9)
 S AMHFLGN=$P(AMHSTR,P,10)
 D PI^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN)
 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
 ;
PH(RETVAL,AMHSTR) ;-- file personal history called from clsCaseManagement.SavePersonalHistory method
 S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
 N AMHI,P,R,AMHDM,AMHREC,AMHDMP,AMHDSP,AMHDCP,AMHDPO,AMHDONA,AMHDONB,AMHFLG,AMHFLGN,AMHP,AMHPHSTR,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 AMHPHSTR=$P(AMHSTR,P,3)
 D PH^AMHGECM(.AMHREC,AMHDM,AMHREC,AMHPHSTR)
 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
 ;
DEL(RETVAL,AMHSTR) ;-- delete case data
 S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
 N P,R,AMHCASE,AMHI,AMHER
 S P="|",R="~"
 S RETVAL="^AMHTMP("_$J_")"
 S AMHI=0
 K ^AMHTMP($J)
 I $G(AMHSTR)="" D CATSTR^AMHGU(.AMHSTR,.AMHSTR)
 S AMHCASE=$P(AMHSTR,P)
 S DIK="^AMHPCASE(",DA=AMHCASE D ^DIK
 S @RETVAL@(AMHI)="T00030Result"_$C(30)
 S AMHI=AMHI+1
 S @RETVAL@(AMHI)=$S($G(AMHER)]"":AMHER,1:AMHCASE)_$C(30)
 S @RETVAL@(AMHI+1)=$C(31)
 Q
 ;