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

AMHGSCOM.m

Go to the documentation of this file.
AMHGSCOM ; IHS/CMI/MAW - AMHG Save Community Activity 3/6/2009 5:56:09 PM ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;
 ;
 ;
DEBUG(RETVAL,AMHSTR) ;-- debug entry point
 D DEBUG^%Serenji("COM^AMHGSCOM(.RETVAL,.AMHSTR)")
 Q
 ;
COM(RETVAL,AMHSTR) ;-- save community activity called from clsCommunityDataEntry.SaveCommunityActivity method
 S X="MERR^AMHGU",@^%ZOSF("TRAP") ; m error trap
 N AMHI,P,R,AMHDM,AMHREC,AMHPP,AMHPRO,AMHTOC,AMHST,AMHAT,AMHNS,AMHTGT,AMHEDT,AMHLOC,AMHCOM,AMHACT,AMHLSS,AMHFLG,AMHPA,AMHSP,AMHPV,AMHN,APA,APV,AMHER,AMHCLN
 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,3)
 S AMHPRO=$P(AMHSTR,P,4)
 S AMHPRO=$$SCI^AMHGT(9002011,.02,AMHPRO)
 S AMHTOC=$P(AMHSTR,P,5)
 S AMHST=$TR($P(AMHSTR,P,6),":")
 S AMHAT=$P(AMHSTR,P,7)
 S AMHNS=$P(AMHSTR,P,8)
 S AMHTGT=$$SCI^AMHGT(9002011,1106,$P(AMHSTR,P,9))
 S AMHEDT=+$P(AMHSTR,P,10)
 S AMHLOC=$P(AMHSTR,P,11)
 S AMHCOM=$P(AMHSTR,P,12)
 S AMHACT=$P(AMHSTR,P,13)
 S AMHLSS=$P(AMHSTR,P,14)
 S AMHFLG=$P(AMHSTR,P,15)
 S AMHPA=$P(AMHSTR,P,16)
 S AMHSP=$P(AMHSTR,P,17)
 S AMHPV=$P(AMHSTR,P,18)
 S AMHN=$P(AMHSTR,P,19)
 S AMHCLN=$P(AMHSTR,P,20)
 ;S AMHEDT=AMHEDT_"."_AMHST
 D ARRAY^AMHGU(.APA,AMHPA)
 D ARRAY^AMHGU(.APV,AMHPV)
 D MODV^AMHGECOM(.AMHREC,AMHDM,AMHREC,AMHPP,AMHPRO,AMHTOC,AMHST,AMHAT,AMHNS,AMHTGT,AMHEDT,AMHLOC,AMHCOM,AMHACT,AMHLSS,AMHFLG,AMHCLN)
 D NOTES(AMHREC,AMHN)
 D PA(AMHDM,AMHREC,.APA)
 D POV^AMHGECOM(AMHDM,AMHREC,"",.APV)
 D SP^AMHGSVF(AMHDM,AMHREC,"",AMHSP)
 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
 ;
NOTES(RC,N) ;-- file community notes
 ;Q:$G(N)=""
 D ARRAYT^AMHGU(.AMHWP,N)  ;parse the text into an array
 N AMHFDA,AMHIENS,AMHERRR
 S AMHIENS=RC_","
 D WP^AMHGU(.AMHERRR,9002011,AMHIENS,8101,.AMHWP)
 Q
 ;
PA(D,RC,PA) ;-- file prevention activities
 N AMHDA
 S AMHDA=0 F  S AMHDA=$O(PA(AMHDA)) Q:'AMHDA  D
 . N AP,OTH
 . S AP=+$G(PA(AMHDA))
 . S OTH=$P($G(PA(AMHDA)),"~",4)
 . D MODPA^AMHGECOM(AP,"",RC,OTH)
 I D="E" D DELPA^AMHGECOM(RC,.PA)
 Q
 ;
CPT(D,RC,P,CPT) ;-- file cpt codes from activity tab
 N ACPT
 D ARRAY^AMHGU(.ACPT,.CPT)
 N AMHDA
 S AMHDA=0 F  S AMHDA=$O(ACPT(AMHDA)) Q:'AMHDA  D
 . N CPT
 . S CPT=+$G(ACPT(AMHDA))
 . D MODCPT^AMHGEVF(CPT,P,RC)
 I D="E" D DELCPT^AMHGEVF(RC,.ACPT)
 Q
 ;
SP(D,RC,P,SP) ;-- file secondary providers from activity tab
 N ASP
 D ARRAY^AMHGU(.ASP,.SP)
 N AMHDA
 S AMHDA=0 F  S AMHDA=$O(ASP(AMHDA)) Q:'AMHDA  D
 . N PRV
 . S PRV=+$G(ASP(AMHDA))
 . D MODPRV^AMHGEVF(PRV,D,RC,P,"S")
 I D="E" D DELPRV^AMHGEVF(RC,.ASP,"S")
 Q
 ;