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
;
AMHGSAD ; IHS/CMI/MAW - AMHG Save Administrative Activities 3/3/2009 10:27:18 AM ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
+4 ;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
+1 DO DEBUG^%Serenji("ADM^AMHGSAD(.RETVAL,.AMHSTR)")
+2 QUIT
+3 ;
ADM(RETVAL,AMHSTR) ;-- save admin form, called from method SaveAdministrativeData in clsAdministrativeDataEntry
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHDM,AMHREC,AMHPP,AMHPRO,AMHPOV,AMHNARR,AMHEDT,AMHACT,AMHAT,AMHNS,AMHCMT,AMHER,AMHLOC,AMHCOM,AMHTYP,AMHN
+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 AMHPP=$PIECE(AMHSTR,P,5)
+11 SET AMHPRO=$PIECE(AMHSTR,P,4)
+12 SET AMHPRO=$$SCI^AMHGT(9002011,.02,AMHPRO)
+13 SET AMHPV=$PIECE(AMHSTR,P,6)
+14 SET AMHNARR=$PIECE(AMHSTR,P,7)
+15 SET AMHEDT=$TRANSLATE($PIECE(AMHSTR,P,3),":")
+16 SET AMHACT=$PIECE(AMHSTR,P,8)
+17 SET AMHAT=$PIECE(AMHSTR,P,9)
+18 SET AMHNS=$PIECE(AMHSTR,P,10)
+19 SET AMHLOC=$PIECE(AMHSTR,P,11)
+20 SET AMHCOM=$PIECE(AMHSTR,P,12)
+21 SET AMHCMT=$PIECE(AMHSTR,P,13)
+22 SET AMHTYP=$ORDER(^AMHTSET("B","ADMINISTRATIVE",0))
+23 DO MODV^AMHGEAD(.AMHIEN,AMHDM,AMHREC,AMHEDT,AMHPRO,AMHPP,AMHACT,AMHAT,AMHNS,AMHTYP,AMHLOC,AMHCOM)
+24 DO CMT^AMHGEAD(AMHDM,AMHIEN,AMHCMT)
+25 IF $GET(AMHNARR)]""
Begin DoDot:1
+26 SET AMHN=$$FNDNARR^AMHGU(AMHNARR,1)
End DoDot:1
+27 IF AMHDM="A"
Begin DoDot:1
+28 DO ADDPOV^AMHGEAD(AMHPV,"",AMHIEN,AMHN)
End DoDot:1
+29 IF AMHDM="E"
Begin DoDot:1
+30 NEW AMHPREC
+31 SET AMHPREC=$$FNDPOV^AMHGU(AMHPV,AMHIEN)
+32 IF 'AMHPREC
DO ADDPOV^AMHGEVF(AMHPV,"",AMHIEN,AMHN)
QUIT
+33 DO EDITPOV^AMHGEAD(AMHPREC,AMHN)
End DoDot:1
+34 SET @RETVAL@(AMHI)="T00030Result"_$CHAR(30)
+35 SET AMHI=AMHI+1
+36 SET @RETVAL@(AMHI)=+$GET(AMHIEN)_$CHAR(30)
+37 SET @RETVAL@(AMHI+1)=$CHAR(31)
+38 QUIT
+39 ;