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

AMHGEAD.m

Go to the documentation of this file.
AMHGEAD ; IHS/CMI/MAW - AMHG Administrative Adds/Edits 3/3/2009 10:34:46 AM ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;
 ;
 ;
MODV(AMHIEN,DM,REC,EDT,PRO,PP,ACT,AT,NS,TOC,LOC,COM) ;EP -- add/update MHSS RECORD entry
 N AMHFDA,AMHIENS,AMHERRR
 S AMHIENS=$S(DM="A":"+1,",1:REC_",")
 S AMHFDA(9002011,AMHIENS,.02)=PRO
 S AMHFDA(9002011,AMHIENS,.04)=LOC
 S AMHFDA(9002011,AMHIENS,.05)=COM
 S AMHFDA(9002011,AMHIENS,.06)=ACT
 S AMHFDA(9002011,AMHIENS,.07)=TOC
 S AMHFDA(9002011,AMHIENS,.12)=AT
 S AMHFDA(9002011,AMHIENS,.09)=NS
 S AMHFDA(9002011,AMHIENS,.19)=DUZ
 S AMHFDA(9002011,AMHIENS,.33)="R"
 S AMHFDA(9002011,AMHIENS,1111)=1
 I DM="A" D  Q
 . S AMHFDA(9002011,AMHIENS,.01)=EDT
 . S AMHFDA(9002011,AMHIENS,.03)=DT
 . ;S AMHFDA(9002011,AMHIENS,.17)="A"
 . S AMHFDA(9002011,AMHIENS,.19)=DUZ
 . S AMHFDA(9002011,AMHIENS,.22)="A"
 . S AMHFDA(9002011.5101,"+2,"_AMHIENS,.01)=$$NOW^XLFDT
 . S AMHFDA(9002011.5101,"+2,"_AMHIENS,.02)=DUZ
 . D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
 . I $D(AMHERRR) S AMHER="0~Add Admin Record"
 . S AMHIEN=+$G(AMHIENS(1))
 . D MODPRV(PP,DM,AMHIEN,"","P")
 I DM="E" D  Q
 . S AMHIENS(1)=REC
 . ;S AMHFDA(9002011,AMHIENS,.17)="E"
 . S AMHFDA(9002011,AMHIENS,.21)=DT
 . S AMHFDA(9002011,AMHIENS,.28)=DUZ
 . S AMHFDA(9002011,AMHIENS,.22)="M"
 . D FILE^DIE("K","AMHFDA","AMHERRR(1)")
 . I $D(AMHERRR) S AMHER="0~Edit Admin Record"
 . S AMHIEN=REC
 . D MODPRV(PP,DM,AMHIEN,"","P")
 . D VAUD^AMHGEVF(REC)  ;update the audit log
 Q
 ;
MODPRV(P,D,R,PAT,TYP) ;-- modify the provider based on data mode
 N AMHFDA,AMHIENS,AMERR,AMHPIEN
 Q:$$FNDPRV^AMHGU(R,TYP,P)
 S AMHIENS="+1,"
 S AMHFDA(9002011.02,AMHIENS,.01)=P
 S AMHFDA(9002011.02,AMHIENS,.02)=PAT
 S AMHFDA(9002011.02,AMHIENS,.03)=R
 S AMHFDA(9002011.02,AMHIENS,.04)=TYP
 D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
 I $D(AMHERRR) S AMHER="0~Add "_$G(TYP)_" Provider"
 S AMHPIEN=$G(AMHIENS(1))
 Q
 ;
ADDPOV(PI,P,R,PNARR) ;EP -- add a pov
 N AMHFDA,AMHIENS,AMHERRR,AMHPIEN
 S APCDOVRR=1
 S AMHIENS="+1,"
 S AMHFDA(9002011.01,AMHIENS,.01)=PI
 S AMHFDA(9002011.01,AMHIENS,.02)=P
 S AMHFDA(9002011.01,AMHIENS,.03)=R
 S AMHFDA(9002011.01,AMHIENS,.04)=PNARR
 D UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
 I $D(AMHERRR) S AMHER="0~Add POV"
 S AMHPIEN=$G(AMHIENS(1))
 Q
 ;
EDITPOV(REC,PN) ;EP -- edit a pov
 N AMHFDA,AMHIENS,AMHERRR,AMHIP,AMHPIEN
 S APCDOVRR=1
 S AMHIENS=REC_","
 S AMHFDA(9002011.01,AMHIENS,.04)=PN
 D FILE^DIE("K","AMHFDA","AMHERRR(1)")
 I $D(AMHERRR) S AMHER="0~Edit POV"
 I '$D(AMHERRR(1)) S AMHPIEN=REC
 Q
 ;
CMT(D,RC,CMT) ;EP -- file the comments
 Q:$G(CMT)=""
 N AMHWP
 D ARRAYT^AMHGU(.AMHWP,CMT)  ;parse the text into an array
 N AMHFDA,AMHIENS,AMHERRR
 S AMHIENS=RC_","
 D WP^AMHGU(.AMHERRR,9002011,AMHIENS,8101,.AMHWP)
 Q
 ;