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
;
AMHGEAD ; IHS/CMI/MAW - AMHG Administrative Adds/Edits 3/3/2009 10:34:46 AM ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
+4 ;
+5 ;
MODV(AMHIEN,DM,REC,EDT,PRO,PP,ACT,AT,NS,TOC,LOC,COM) ;EP -- add/update MHSS RECORD entry
+1 NEW AMHFDA,AMHIENS,AMHERRR
+2 SET AMHIENS=$SELECT(DM="A":"+1,",1:REC_",")
+3 SET AMHFDA(9002011,AMHIENS,.02)=PRO
+4 SET AMHFDA(9002011,AMHIENS,.04)=LOC
+5 SET AMHFDA(9002011,AMHIENS,.05)=COM
+6 SET AMHFDA(9002011,AMHIENS,.06)=ACT
+7 SET AMHFDA(9002011,AMHIENS,.07)=TOC
+8 SET AMHFDA(9002011,AMHIENS,.12)=AT
+9 SET AMHFDA(9002011,AMHIENS,.09)=NS
+10 SET AMHFDA(9002011,AMHIENS,.19)=DUZ
+11 SET AMHFDA(9002011,AMHIENS,.33)="R"
+12 SET AMHFDA(9002011,AMHIENS,1111)=1
+13 IF DM="A"
Begin DoDot:1
+14 SET AMHFDA(9002011,AMHIENS,.01)=EDT
+15 SET AMHFDA(9002011,AMHIENS,.03)=DT
+16 ;S AMHFDA(9002011,AMHIENS,.17)="A"
+17 SET AMHFDA(9002011,AMHIENS,.19)=DUZ
+18 SET AMHFDA(9002011,AMHIENS,.22)="A"
+19 SET AMHFDA(9002011.5101,"+2,"_AMHIENS,.01)=$$NOW^XLFDT
+20 SET AMHFDA(9002011.5101,"+2,"_AMHIENS,.02)=DUZ
+21 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+22 IF $DATA(AMHERRR)
SET AMHER="0~Add Admin Record"
+23 SET AMHIEN=+$GET(AMHIENS(1))
+24 DO MODPRV(PP,DM,AMHIEN,"","P")
End DoDot:1
QUIT
+25 IF DM="E"
Begin DoDot:1
+26 SET AMHIENS(1)=REC
+27 ;S AMHFDA(9002011,AMHIENS,.17)="E"
+28 SET AMHFDA(9002011,AMHIENS,.21)=DT
+29 SET AMHFDA(9002011,AMHIENS,.28)=DUZ
+30 SET AMHFDA(9002011,AMHIENS,.22)="M"
+31 DO FILE^DIE("K","AMHFDA","AMHERRR(1)")
+32 IF $DATA(AMHERRR)
SET AMHER="0~Edit Admin Record"
+33 SET AMHIEN=REC
+34 DO MODPRV(PP,DM,AMHIEN,"","P")
+35 ;update the audit log
DO VAUD^AMHGEVF(REC)
End DoDot:1
QUIT
+36 QUIT
+37 ;
MODPRV(P,D,R,PAT,TYP) ;-- modify the provider based on data mode
+1 NEW AMHFDA,AMHIENS,AMERR,AMHPIEN
+2 IF $$FNDPRV^AMHGU(R,TYP,P)
QUIT
+3 SET AMHIENS="+1,"
+4 SET AMHFDA(9002011.02,AMHIENS,.01)=P
+5 SET AMHFDA(9002011.02,AMHIENS,.02)=PAT
+6 SET AMHFDA(9002011.02,AMHIENS,.03)=R
+7 SET AMHFDA(9002011.02,AMHIENS,.04)=TYP
+8 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+9 IF $DATA(AMHERRR)
SET AMHER="0~Add "_$GET(TYP)_" Provider"
+10 SET AMHPIEN=$GET(AMHIENS(1))
+11 QUIT
+12 ;
ADDPOV(PI,P,R,PNARR) ;EP -- add a pov
+1 NEW AMHFDA,AMHIENS,AMHERRR,AMHPIEN
+2 SET APCDOVRR=1
+3 SET AMHIENS="+1,"
+4 SET AMHFDA(9002011.01,AMHIENS,.01)=PI
+5 SET AMHFDA(9002011.01,AMHIENS,.02)=P
+6 SET AMHFDA(9002011.01,AMHIENS,.03)=R
+7 SET AMHFDA(9002011.01,AMHIENS,.04)=PNARR
+8 DO UPDATE^DIE("","AMHFDA","AMHIENS","AMHERRR(1)")
+9 IF $DATA(AMHERRR)
SET AMHER="0~Add POV"
+10 SET AMHPIEN=$GET(AMHIENS(1))
+11 QUIT
+12 ;
EDITPOV(REC,PN) ;EP -- edit a pov
+1 NEW AMHFDA,AMHIENS,AMHERRR,AMHIP,AMHPIEN
+2 SET APCDOVRR=1
+3 SET AMHIENS=REC_","
+4 SET AMHFDA(9002011.01,AMHIENS,.04)=PN
+5 DO FILE^DIE("K","AMHFDA","AMHERRR(1)")
+6 IF $DATA(AMHERRR)
SET AMHER="0~Edit POV"
+7 IF '$DATA(AMHERRR(1))
SET AMHPIEN=REC
+8 QUIT
+9 ;
CMT(D,RC,CMT) ;EP -- file the comments
+1 IF $GET(CMT)=""
QUIT
+2 NEW AMHWP
+3 ;parse the text into an array
DO ARRAYT^AMHGU(.AMHWP,CMT)
+4 NEW AMHFDA,AMHIENS,AMHERRR
+5 SET AMHIENS=RC_","
+6 DO WP^AMHGU(.AMHERRR,9002011,AMHIENS,8101,.AMHWP)
+7 QUIT
+8 ;