AMHGDAD ; IHS/CMI/MAW - AMHG Administrative Activities 1/15/2009 12:24:13 PM ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
D DEBUG^%Serenji("EP^AMHGD(RETVAL,.AMHSTR)")
Q
;
ADM(RETVAL,AMHSTR) ;-- get administrative data for administrative data entry form (frmAdministrativeDataEntry)
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHIEN
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
S @RETVAL@(AMHI)="T00010BMXIEN^T00030Program^T00030Date^T00050Provider^T00050Problem^T00080ProviderNarrative^T00060ActivityCode^T00010Time^T00010NumberServed"_$C(30)
S AMHIEN=$P(AMHSTR,P)
N AMHDT,AMHPRG,AMHACI,AMHAC,AMHACS,AMHACI,AMHTM,AMHPOVI,AMHPOV,AMHPOVS,AMHPRVN,AMHPRVI,AMHPRV,AMHPRVS,AMHNS,AMHPOVE
S AMHDT=$$GET1^DIQ(9002011,AMHIEN,.01,"I")
S AMHDT=$$VCDT^AMHGU(AMHDT)
S AMHPRG=$$GET1^DIQ(9002011,AMHIEN,.02)
S AMHACI=$$GET1^DIQ(9002011,AMHIEN,.06,"I")
S AMHAC=$S(AMHACI:$$GET1^DIQ(9002012,AMHACI,.02),1:"")
S AMHACS=$S(AMHACI:AMHACI_R_AMHAC,1:"")
S AMHPOVI=$O(^AMHRPRO("AD",AMHIEN,0))
I AMHPOVI S AMHPOVE=$P($G(^AMHRPRO(AMHPOVI,0)),U)
S AMHPOV=$S(AMHPOVE:$$GET1^DIQ(9002012.2,AMHPOVE,.02),1:"")
S AMHPOVS=$S(AMHPOVI:AMHPOVE_R_AMHPOV,1:"")
S AMHPRVN=$S(AMHPOVI:$$GET1^DIQ(9002011.01,AMHPOVI,.04),1:"")
S AMHTM=$$GET1^DIQ(9002011,AMHIEN,.12)
S AMHPRVI=$$GETPRV^AMHGU(AMHIEN,"P")
S AMHPRV=$S($G(AMHPRVI):$$GET1^DIQ(200,AMHPRVI,.01),1:"")
S AMHPRVS=$S(AMHPRVI:AMHPRVI_R_AMHPRV,1:"")
S AMHNS=$$GET1^DIQ(9002011,AMHIEN,.09)
S AMHI=AMHI+1
S @RETVAL@(AMHI)=AMHIEN_U_AMHPRG_U_AMHDT_U_AMHPRVS_U_AMHPOVS_U_AMHPRVN_U_AMHACS_U_AMHTM_U_AMHNS_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
ADMCMT(RETVAL,AMHSTR) ;-- get administrative comment
S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
N AMHI,P,R,AMHIEN
S P="|",R="~"
S RETVAL="^AMHTMP("_$J_")"
S AMHI=0
K ^AMHTMP($J)
S @RETVAL@(AMHI)="T00250Comment"_$C(30)
S AMHIEN=$P(AMHSTR,P)
N AMHDA
S AMHDA=0 F S AMHDA=$O(^AMHREC(AMHIEN,81,AMHDA)) Q:'AMHDA D
. S AMHI=AMHI+1
. S @RETVAL@(AMHI)=$G(^AMHREC(AMHIEN,81,AMHDA,0))_$C(30)
S @RETVAL@(AMHI+1)=$C(31)
Q
;
AMHGDAD ; IHS/CMI/MAW - AMHG Administrative Activities 1/15/2009 12:24:13 PM ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
+1 DO DEBUG^%Serenji("EP^AMHGD(RETVAL,.AMHSTR)")
+2 QUIT
+3 ;
ADM(RETVAL,AMHSTR) ;-- get administrative data for administrative data entry form (frmAdministrativeDataEntry)
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHIEN
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 KILL ^AMHTMP($JOB)
+7 SET @RETVAL@(AMHI)="T00010BMXIEN^T00030Program^T00030Date^T00050Provider^T00050Problem^T00080ProviderNarrative^T00060ActivityCode^T00010Time^T00010NumberServed"_$CHAR(30)
+8 SET AMHIEN=$PIECE(AMHSTR,P)
+9 NEW AMHDT,AMHPRG,AMHACI,AMHAC,AMHACS,AMHACI,AMHTM,AMHPOVI,AMHPOV,AMHPOVS,AMHPRVN,AMHPRVI,AMHPRV,AMHPRVS,AMHNS,AMHPOVE
+10 SET AMHDT=$$GET1^DIQ(9002011,AMHIEN,.01,"I")
+11 SET AMHDT=$$VCDT^AMHGU(AMHDT)
+12 SET AMHPRG=$$GET1^DIQ(9002011,AMHIEN,.02)
+13 SET AMHACI=$$GET1^DIQ(9002011,AMHIEN,.06,"I")
+14 SET AMHAC=$SELECT(AMHACI:$$GET1^DIQ(9002012,AMHACI,.02),1:"")
+15 SET AMHACS=$SELECT(AMHACI:AMHACI_R_AMHAC,1:"")
+16 SET AMHPOVI=$ORDER(^AMHRPRO("AD",AMHIEN,0))
+17 IF AMHPOVI
SET AMHPOVE=$PIECE($GET(^AMHRPRO(AMHPOVI,0)),U)
+18 SET AMHPOV=$SELECT(AMHPOVE:$$GET1^DIQ(9002012.2,AMHPOVE,.02),1:"")
+19 SET AMHPOVS=$SELECT(AMHPOVI:AMHPOVE_R_AMHPOV,1:"")
+20 SET AMHPRVN=$SELECT(AMHPOVI:$$GET1^DIQ(9002011.01,AMHPOVI,.04),1:"")
+21 SET AMHTM=$$GET1^DIQ(9002011,AMHIEN,.12)
+22 SET AMHPRVI=$$GETPRV^AMHGU(AMHIEN,"P")
+23 SET AMHPRV=$SELECT($GET(AMHPRVI):$$GET1^DIQ(200,AMHPRVI,.01),1:"")
+24 SET AMHPRVS=$SELECT(AMHPRVI:AMHPRVI_R_AMHPRV,1:"")
+25 SET AMHNS=$$GET1^DIQ(9002011,AMHIEN,.09)
+26 SET AMHI=AMHI+1
+27 SET @RETVAL@(AMHI)=AMHIEN_U_AMHPRG_U_AMHDT_U_AMHPRVS_U_AMHPOVS_U_AMHPRVN_U_AMHACS_U_AMHTM_U_AMHNS_$CHAR(30)
+28 SET @RETVAL@(AMHI+1)=$CHAR(31)
+29 QUIT
+30 ;
ADMCMT(RETVAL,AMHSTR) ;-- get administrative comment
+1 ; m error trap
SET X="MERR^AMHGU"
SET @^%ZOSF("TRAP")
+2 NEW AMHI,P,R,AMHIEN
+3 SET P="|"
SET R="~"
+4 SET RETVAL="^AMHTMP("_$JOB_")"
+5 SET AMHI=0
+6 KILL ^AMHTMP($JOB)
+7 SET @RETVAL@(AMHI)="T00250Comment"_$CHAR(30)
+8 SET AMHIEN=$PIECE(AMHSTR,P)
+9 NEW AMHDA
+10 SET AMHDA=0
FOR
SET AMHDA=$ORDER(^AMHREC(AMHIEN,81,AMHDA))
IF 'AMHDA
QUIT
Begin DoDot:1
+11 SET AMHI=AMHI+1
+12 SET @RETVAL@(AMHI)=$GET(^AMHREC(AMHIEN,81,AMHDA,0))_$CHAR(30)
End DoDot:1
+13 SET @RETVAL@(AMHI+1)=$CHAR(31)
+14 QUIT
+15 ;