BSDX22 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ;
;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
;
;
DELAGID(BSDXY,BSDXIEN,BSDXIEN1) ;EP
;Entry point for debugging
;
;D DEBUG^%Serenji("DELAGI^BSDX22(.BSDXY,BSDXIEN,BSDXIEN1)")
Q
;
DELAGI(BSDXY,BSDXIEN,BSDXIEN1) ;EP
;Deletes entry having Access Group BSDXIEN and Access Type BSDXIEN1 the ACCESS GROUP TYPE file
;Return recordset containing error message or "" if no error
;Called by BSDX DELETE ACCESS GROUP ITEM
;Test Line:
;D DELAGI^BSDX22(.RES,99)
;
S X="ERROR^BSDX22",@^%ZOSF("TRAP")
N BSDXI,DIK,DA,BSDXIEN2
S BSDXI=0
S BSDXY="^BSDXTMP("_$J_")"
S ^BSDXTMP($J,0)="I00020ACCESSGROUPTYPEID^T00030ERRORTEXT"_$C(30)
I '+BSDXIEN D ERR(0,"BSDX22: Invalid null Access Group ID") Q
I '+BSDXIEN1 D ERR(0,"BSDX22: Invalid null Access Type ID") Q
I '$D(^BSDXAGTP("AC",BSDXIEN,BSDXIEN1)) D Q
. D ERR(0,"BSDX22: Invalid null Access Group Type ID")
. Q
S BSDXIEN2=$O(^BSDXAGTP("AC",BSDXIEN,BSDXIEN1,0))
I '+BSDXIEN2 D ERR(0,"BSDX22: Invalid null Access Group Type ID") Q
;
;Delete entry
S DIK="^BSDXAGTP("
S DA=BSDXIEN2
D ^DIK
;
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXIEN2_"^"_"-1"_$C(30)_$C(31)
Q
;
ADDAGID(BSDXY,BSDXIEN,BSDXIEN1) ;EP
;Entry point for debugging
;
;D DEBUG^%Serenji("ADDAGI^BSDX22(.BSDXY,BSDXIEN,BSDXIEN1)")
Q
;
ADDAGI(BSDXY,BSDXIEN,BSDXIEN1) ;EP
;Adds ACCESS GROUP TYPE file entry having access group BSDXIEN and access type BSDXIEN1
;Return recordset containing added entry number error message or "" if no error
;Called by BSDX ADD ACCESS GROUP ITEM
;Test Line:
;D ADDAGI^BSDX22(.RES,1,1)
;
S X="ERROR^BSDX22",@^%ZOSF("TRAP")
N BSDXI,BSDXIENS,BSDXMSG,BSDXFDA
S BSDXI=0
S BSDXY="^BSDXTMP("_$J_")"
;S ^BSDXTMP($J,0)="I00020ACCESSGROUPTYPEID^I00020ERRORID"_$C(30)
S ^BSDXTMP($J,0)="I00020ACCESSGROUPTYPEID^T00030ERRORTEXT"_$C(30)
I '+BSDXIEN D ERR(0,"BSDX22: Invalid null Access Group ID") Q
I '+BSDXIEN1 D ERR(0,"BSDX22: Invalid null Access Type ID") Q
I '$D(^BSDXAGP(BSDXIEN,0)) D ERR(0,"BSDX22: Invalid Access Group ID") Q
I '$D(^BSDXTYPE(BSDXIEN1,0)) D ERR(0,"BSDX22: Invalid Access Type ID") Q
I $D(^BSDXAGTP("AC",BSDXIEN,BSDXIEN1)) D Q
. S BSDXIENS=$O(^BSDXAGTP("AC",BSDXIEN,BSDXIEN1,0))
. S ^BSDXTMP($J,BSDXI+1)=+BSDXIENS_"^"_$C(30)_$C(31)
. Q
;
S BSDXIENS="+1,"
S BSDXFDA(9002018.39,BSDXIENS,.01)=BSDXIEN ;ACCESS GROUP ID
S BSDXFDA(9002018.39,BSDXIENS,.02)=BSDXIEN1 ;ACCESS TYPE ID
K BSDXIEN
D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG")
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=+$G(BSDXIEN(1))_"^"_$C(30)_$C(31)
Q
;
ERR(BSDXERID,ERRTXT) ;Error processing
S:'+$G(BSDXI) BSDXI=999999
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXERID_"^"_ERRTXT_$C(30)
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
Q
;
ERROR ;
D ^%ZTER
I '+$G(BSDXI) N BSDXI S BSDXI=999999
S BSDXI=BSDXI+1
D ERR(0,"BSDX22 M Error: <"_$G(%ZTERROR)_">")
Q
BSDX22 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ;
+1 ;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
+2 ;
+3 ;
DELAGID(BSDXY,BSDXIEN,BSDXIEN1) ;EP
+1 ;Entry point for debugging
+2 ;
+3 ;D DEBUG^%Serenji("DELAGI^BSDX22(.BSDXY,BSDXIEN,BSDXIEN1)")
+4 QUIT
+5 ;
DELAGI(BSDXY,BSDXIEN,BSDXIEN1) ;EP
+1 ;Deletes entry having Access Group BSDXIEN and Access Type BSDXIEN1 the ACCESS GROUP TYPE file
+2 ;Return recordset containing error message or "" if no error
+3 ;Called by BSDX DELETE ACCESS GROUP ITEM
+4 ;Test Line:
+5 ;D DELAGI^BSDX22(.RES,99)
+6 ;
+7 SET X="ERROR^BSDX22"
SET @^%ZOSF("TRAP")
+8 NEW BSDXI,DIK,DA,BSDXIEN2
+9 SET BSDXI=0
+10 SET BSDXY="^BSDXTMP("_$JOB_")"
+11 SET ^BSDXTMP($JOB,0)="I00020ACCESSGROUPTYPEID^T00030ERRORTEXT"_$CHAR(30)
+12 IF '+BSDXIEN
DO ERR(0,"BSDX22: Invalid null Access Group ID")
QUIT
+13 IF '+BSDXIEN1
DO ERR(0,"BSDX22: Invalid null Access Type ID")
QUIT
+14 IF '$DATA(^BSDXAGTP("AC",BSDXIEN,BSDXIEN1))
Begin DoDot:1
+15 DO ERR(0,"BSDX22: Invalid null Access Group Type ID")
+16 QUIT
End DoDot:1
QUIT
+17 SET BSDXIEN2=$ORDER(^BSDXAGTP("AC",BSDXIEN,BSDXIEN1,0))
+18 IF '+BSDXIEN2
DO ERR(0,"BSDX22: Invalid null Access Group Type ID")
QUIT
+19 ;
+20 ;Delete entry
+21 SET DIK="^BSDXAGTP("
+22 SET DA=BSDXIEN2
+23 DO ^DIK
+24 ;
+25 SET BSDXI=BSDXI+1
+26 SET ^BSDXTMP($JOB,BSDXI)=BSDXIEN2_"^"_"-1"_$CHAR(30)_$CHAR(31)
+27 QUIT
+28 ;
ADDAGID(BSDXY,BSDXIEN,BSDXIEN1) ;EP
+1 ;Entry point for debugging
+2 ;
+3 ;D DEBUG^%Serenji("ADDAGI^BSDX22(.BSDXY,BSDXIEN,BSDXIEN1)")
+4 QUIT
+5 ;
ADDAGI(BSDXY,BSDXIEN,BSDXIEN1) ;EP
+1 ;Adds ACCESS GROUP TYPE file entry having access group BSDXIEN and access type BSDXIEN1
+2 ;Return recordset containing added entry number error message or "" if no error
+3 ;Called by BSDX ADD ACCESS GROUP ITEM
+4 ;Test Line:
+5 ;D ADDAGI^BSDX22(.RES,1,1)
+6 ;
+7 SET X="ERROR^BSDX22"
SET @^%ZOSF("TRAP")
+8 NEW BSDXI,BSDXIENS,BSDXMSG,BSDXFDA
+9 SET BSDXI=0
+10 SET BSDXY="^BSDXTMP("_$JOB_")"
+11 ;S ^BSDXTMP($J,0)="I00020ACCESSGROUPTYPEID^I00020ERRORID"_$C(30)
+12 SET ^BSDXTMP($JOB,0)="I00020ACCESSGROUPTYPEID^T00030ERRORTEXT"_$CHAR(30)
+13 IF '+BSDXIEN
DO ERR(0,"BSDX22: Invalid null Access Group ID")
QUIT
+14 IF '+BSDXIEN1
DO ERR(0,"BSDX22: Invalid null Access Type ID")
QUIT
+15 IF '$DATA(^BSDXAGP(BSDXIEN,0))
DO ERR(0,"BSDX22: Invalid Access Group ID")
QUIT
+16 IF '$DATA(^BSDXTYPE(BSDXIEN1,0))
DO ERR(0,"BSDX22: Invalid Access Type ID")
QUIT
+17 IF $DATA(^BSDXAGTP("AC",BSDXIEN,BSDXIEN1))
Begin DoDot:1
+18 SET BSDXIENS=$ORDER(^BSDXAGTP("AC",BSDXIEN,BSDXIEN1,0))
+19 SET ^BSDXTMP($JOB,BSDXI+1)=+BSDXIENS_"^"_$CHAR(30)_$CHAR(31)
+20 QUIT
End DoDot:1
QUIT
+21 ;
+22 SET BSDXIENS="+1,"
+23 ;ACCESS GROUP ID
SET BSDXFDA(9002018.39,BSDXIENS,.01)=BSDXIEN
+24 ;ACCESS TYPE ID
SET BSDXFDA(9002018.39,BSDXIENS,.02)=BSDXIEN1
+25 KILL BSDXIEN
+26 DO UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG")
+27 SET BSDXI=BSDXI+1
+28 SET ^BSDXTMP($JOB,BSDXI)=+$GET(BSDXIEN(1))_"^"_$CHAR(30)_$CHAR(31)
+29 QUIT
+30 ;
ERR(BSDXERID,ERRTXT) ;Error processing
+1 IF '+$GET(BSDXI)
SET BSDXI=999999
+2 SET BSDXI=BSDXI+1
+3 SET ^BSDXTMP($JOB,BSDXI)=BSDXERID_"^"_ERRTXT_$CHAR(30)
+4 SET BSDXI=BSDXI+1
+5 SET ^BSDXTMP($JOB,BSDXI)=$CHAR(31)
+6 QUIT
+7 ;
ERROR ;
+1 DO ^%ZTER
+2 IF '+$GET(BSDXI)
NEW BSDXI
SET BSDXI=999999
+3 SET BSDXI=BSDXI+1
+4 DO ERR(0,"BSDX22 M Error: <"_$GET(%ZTERROR)_">")
+5 QUIT