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

AMHGSAD.m

Go to the documentation of this file.
AMHGSAD ; IHS/CMI/MAW - AMHG Save Administrative Activities 3/3/2009 10:27:18 AM ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;
 ;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
 D DEBUG^%Serenji("ADM^AMHGSAD(.RETVAL,.AMHSTR)")
 Q
 ;
ADM(RETVAL,AMHSTR) ;-- save admin form, called from method SaveAdministrativeData in clsAdministrativeDataEntry
 S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
 N AMHI,P,R,AMHDM,AMHREC,AMHPP,AMHPRO,AMHPOV,AMHNARR,AMHEDT,AMHACT,AMHAT,AMHNS,AMHCMT,AMHER,AMHLOC,AMHCOM,AMHTYP,AMHN
 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 AMHPP=$P(AMHSTR,P,5)
 S AMHPRO=$P(AMHSTR,P,4)
 S AMHPRO=$$SCI^AMHGT(9002011,.02,AMHPRO)
 S AMHPV=$P(AMHSTR,P,6)
 S AMHNARR=$P(AMHSTR,P,7)
 S AMHEDT=$TR($P(AMHSTR,P,3),":")
 S AMHACT=$P(AMHSTR,P,8)
 S AMHAT=$P(AMHSTR,P,9)
 S AMHNS=$P(AMHSTR,P,10)
 S AMHLOC=$P(AMHSTR,P,11)
 S AMHCOM=$P(AMHSTR,P,12)
 S AMHCMT=$P(AMHSTR,P,13)
 S AMHTYP=$O(^AMHTSET("B","ADMINISTRATIVE",0))
 D MODV^AMHGEAD(.AMHIEN,AMHDM,AMHREC,AMHEDT,AMHPRO,AMHPP,AMHACT,AMHAT,AMHNS,AMHTYP,AMHLOC,AMHCOM)
 D CMT^AMHGEAD(AMHDM,AMHIEN,AMHCMT)
 I $G(AMHNARR)]"" D
 . S AMHN=$$FNDNARR^AMHGU(AMHNARR,1)
 I AMHDM="A" D
 . D ADDPOV^AMHGEAD(AMHPV,"",AMHIEN,AMHN)
 I AMHDM="E" D
 . N AMHPREC
 . S AMHPREC=$$FNDPOV^AMHGU(AMHPV,AMHIEN)
 . I 'AMHPREC D ADDPOV^AMHGEVF(AMHPV,"",AMHIEN,AMHN) Q
 . D EDITPOV^AMHGEAD(AMHPREC,AMHN)
 S @RETVAL@(AMHI)="T00030Result"_$C(30)
 S AMHI=AMHI+1
 S @RETVAL@(AMHI)=+$G(AMHIEN)_$C(30)
 S @RETVAL@(AMHI+1)=$C(31)
 Q
 ;