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

AMHGDAD.m

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