AMERBUSA ;GDIT/HS/BEE - BUSA AUDITING ROUTINE FOR AMER ; 07 Oct 2013 11:33 AM
;;3.0;ER VISIT SYSTEM;**5,6**;MAR 03, 2009;Build 30
;
Q
;
LOG(AMCAT,AMACT,AMCALL,AMDESC,AMERVDFN) ;EP - Log the AMER Audit entry
;
NEW AMERDFN,X,RES
;
;See if BUSA has been installed
S X="BUSAAPI" X ^%ZOSF("TEST") I '$T Q "BUSA has not been installed"
;
;Check the input
I ",S,P,D,O,"'[(","_$G(AMCAT)_",") Q "Invalid Audit Category"
I (AMCAT="P"),(",A,D,Q,P,E,C,"'[(","_$G(AMACT)_",")) Q "Invalid Audit Action"
I $G(AMDESC)="" Q "Invalid Audit Log Description"
S:$G(AMCALL)="" AMCALL="AMER Audit API Call"
;
;Handle single patients passed in
I $D(AMERVDFN)=1,$G(AMERVDFN)]"" D
. S AMERDFN(1)=AMERVDFN
;
;Handle multiple patients passed in
I $D(AMERVDFN)>9 D
. NEW II,CNT
. S II="",CNT=0 F S II=$O(AMERVDFN(II)) Q:II="" S CNT=CNT+1,AMERDFN(CNT)=AMERVDFN(II)
;
;Perform the audit call
S RES=$$LOG^BUSAAPI("A",AMCAT,AMACT,AMCALL,AMDESC,"AMERDFN")
Q RES
;
DIR ;EP - Perform logging on ^DIR lookup
Q
AMERBUSA ;GDIT/HS/BEE - BUSA AUDITING ROUTINE FOR AMER ; 07 Oct 2013 11:33 AM
+1 ;;3.0;ER VISIT SYSTEM;**5,6**;MAR 03, 2009;Build 30
+2 ;
+3 QUIT
+4 ;
LOG(AMCAT,AMACT,AMCALL,AMDESC,AMERVDFN) ;EP - Log the AMER Audit entry
+1 ;
+2 NEW AMERDFN,X,RES
+3 ;
+4 ;See if BUSA has been installed
+5 SET X="BUSAAPI"
XECUTE ^%ZOSF("TEST")
IF '$TEST
QUIT "BUSA has not been installed"
+6 ;
+7 ;Check the input
+8 IF ",S,P,D,O,"'[(","_$GET(AMCAT)_",")
QUIT "Invalid Audit Category"
+9 IF (AMCAT="P")
IF (",A,D,Q,P,E,C,"'[(","_$GET(AMACT)_","))
QUIT "Invalid Audit Action"
+10 IF $GET(AMDESC)=""
QUIT "Invalid Audit Log Description"
+11 IF $GET(AMCALL)=""
SET AMCALL="AMER Audit API Call"
+12 ;
+13 ;Handle single patients passed in
+14 IF $DATA(AMERVDFN)=1
IF $GET(AMERVDFN)]""
Begin DoDot:1
+15 SET AMERDFN(1)=AMERVDFN
End DoDot:1
+16 ;
+17 ;Handle multiple patients passed in
+18 IF $DATA(AMERVDFN)>9
Begin DoDot:1
+19 NEW II,CNT
+20 SET II=""
SET CNT=0
FOR
SET II=$ORDER(AMERVDFN(II))
IF II=""
QUIT
SET CNT=CNT+1
SET AMERDFN(CNT)=AMERVDFN(II)
End DoDot:1
+21 ;
+22 ;Perform the audit call
+23 SET RES=$$LOG^BUSAAPI("A",AMCAT,AMACT,AMCALL,AMDESC,"AMERDFN")
+24 QUIT RES
+25 ;
DIR ;EP - Perform logging on ^DIR lookup
+1 QUIT