BSDX24 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ;
;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
;
;
Q
CRCONTXT(RESULT,OPTION) ;EP
;Entry point for debugging XWBSEC
;
;D DEBUG^%Serenji("CRCONTXT^XWBSEC(.RESULT,OPTION)")
;;H .5
;;D CRCONTXT^XWBSEC(.RESULT,OPTION)
;;S BSDX="^BSDXTMP($J,"
;;S ^BSDXTMP($J,0)=RESULT
;;S RESULT=1
Q
TEST0(BSDX) ;EP Delete user from 200
S DIK="^VA(200,"
S DA=BSDX
D ^DIK
;
Q
KILLM ;EP Delete BMXMENU entry
S DIK="^DIC(19,"
S DA=$O(^DIC(19,"B","BMXMENU",0))
Q:'+DA
D ^DIK
Q
;
TEST1 ;EP Adding an entry to 200
;
S BSDXFDA(200,"+1,",.01)="BMXNET,APPLICATION"
K BSDXIEN,BSDXMSG
S DIC(0)=""
D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG")
;
Q
TEST2 ;EP
;How to change the ACCESS CODE, VERIFY CODE, DATE VERIFY CODE LAST CHANGED field
;ACCESS CODE BSDXXX1^1_(a>yr}:3x3ja9\8vbH
;VERIFY CODE BSDXXX2^$;HOSs|:3w25lLD}Be=
N BSDXFDA
S BSDXFDA(200,"36,",2)="1_(a>yr}:3x3ja9\8vbH"
S BSDXFDA(200,"36,",11)="$;HOSs|:3w25lLD}Be="
S BSDXFDA(200,"36,",11.2)="88888,88888"
S BSDXFDA(200,"36,",201)="BMXRPC"
D FILE^DIE("","BSDXFDA","BSDXMSG")
Q
;
;
SEARCHD(BSDXY,BSDXRES,BSDXSTRT,BSDXEND,BSDXTYPES,BSDXAMPM,BSDXWKDY) ;EP
;Entry point for debugging
;
;D DEBUG^%Serenji("SEARCH^BSDX24(.RES,""ROGERS,BUCK|FUNAKOSHI,GICHIN"","""","""","""","""","""")")
;D DEBUG^%Serenji("SEARCH^BSDX24(.BSDXY,BSDXRES,BSDXSTRT,BSDXEND,BSDXTYPES,BSDXAMPM,BSDXWKDY)")
Q
;
SEARCH(BSDXY,BSDXRES,BSDXSTRT,BSDXEND,BSDXTYPES,BSDXAMPM,BSDXWKDY) ;EP
;Searches availability database for availability blocks between
;BSDXSTRT and BSDXEND for each of the resources in BSDXRES.
;The av blocks must be one of the types in BSDXTYPES, must be
;AM or PM depending on value in BSDXAMPM and
;must be on one of the weekdays listed in BSDXWKDY.
;
;Return recordset containing the start times of availability blocks
;meeting the search criteria.
;
;Variables:
;BSDXRES |-Delimited list of resource names
;BSDXSTRT FM-formatted beginning date of search
;BSDXEND FM-Formatted ending date of search
;BSDXTYPES |-Delimited list of access type IENs
;BSDXAMPM "AM" for am-only, "PM" for pm-only, "BOTH" for both
;BSDXWKDY "" if any weekday, else |-delimited list of weekdays
;
;NOTE: If BSDXEND="" Then:
; either ONE record is returned matching the first available block
; -or- NO record is returned indicating no available block exists
;
;Called by BSDX SEARCH AVAILABILITY
;Test Line:
;D SEARCH^BSDX24(.RES,"ROGERS,BUCK|FUNAKOSHI,GICHIN","","","","","") ZW RES
;
;
S X=BSDXSTRT,%DT="X" D ^%DT S BSDXSTRT=$P(Y,".")
S:+BSDXSTRT<0 BSDXSTRT=DT
S X=BSDXEND,%DT="X" D ^%DT S BSDXEND=$P(Y,".")
S:+BSDXEND<0 BSDXEND=9990101
S BSDXEND=BSDXEND_".99"
N BSDXRESN,BSDXRESD,BSDXDATE,BSDXI,BSDXABD,BSDXNOD,BSDXATD,BSDXATN
N BSDXTYPE
;
;Set up access types array
F BSDX=1:1:$L(BSDXTYPES,"|") D
. S BSDXATD=$P(BSDXTYPES,"|",BSDX)
. S:+BSDXATD BSDXTYPE(BSDXTYPD)=""
;
S BSDXI=0
S BSDXY="^BSDXTMP("_$J_")"
S ^BSDXTMP($J,0)="T00030RESOURCENAME^D00030DATE^T00030ACCESSTYPE^T00030COMMENT"_$C(30)
F BSDX=1:1:$L(BSDXRES,"|") S BSDXRESN=$P(BSDXRES,"|",BSDX) D
. Q:'$D(^BSDXRES("B",BSDXRESN))
. S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0))
. Q:'+BSDXRESD
. Q:'$D(^BSDXRES(BSDXRESD,0))
. Q:'$D(^BSDXAB("ARSCT",BSDXRESD))
. S BSDXDATE=$O(^BSDXAB("ARSCT",BSDXRESD,BSDXSTRT))
. Q:BSDXDATE=""
. Q:BSDXDATE>BSDXEND
. ;TODO: Screen for AMPM
. ;TODO: Screen for Weekday
. ;
. S BSDXI=BSDXI+1
. S BSDXABD=$O(^BSDXAB("ARSCT",BSDXRESD,BSDXDATE,0))
. S BSDXNOD=$G(^BSDXAB(BSDXABD,0))
. Q:BSDXNOD=""
. S Y=$P(BSDXDATE,".")
. D DD^%DT
. S BSDXATD=$P(BSDXNOD,U,5) ;ACCESS TYPE POINTER
. S BSDXATD=$G(^BSDXTYPE(+BSDXATD,0))
. S BSDXATN=$P(BSDXATD,U)
. I +BSDXATD,BSDXTYPES]"" Q:'$D(BSDXTYPES(BSDXATD))
. ;TODO: Screen for TYPE ----DONE!
. ;TODO: Comment
. S ^BSDXTMP($J,BSDXI)=BSDXRESN_U_Y_U_BSDXATN_U_$C(30)
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
Q
BSDX24 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ;
+1 ;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
+2 ;
+3 ;
+4 QUIT
CRCONTXT(RESULT,OPTION) ;EP
+1 ;Entry point for debugging XWBSEC
+2 ;
+3 ;D DEBUG^%Serenji("CRCONTXT^XWBSEC(.RESULT,OPTION)")
+4 ;;H .5
+5 ;;D CRCONTXT^XWBSEC(.RESULT,OPTION)
+6 ;;S BSDX="^BSDXTMP($J,"
+7 ;;S ^BSDXTMP($J,0)=RESULT
+8 ;;S RESULT=1
+9 QUIT
TEST0(BSDX) ;EP Delete user from 200
+1 SET DIK="^VA(200,"
+2 SET DA=BSDX
+3 DO ^DIK
+4 ;
+5 QUIT
KILLM ;EP Delete BMXMENU entry
+1 SET DIK="^DIC(19,"
+2 SET DA=$ORDER(^DIC(19,"B","BMXMENU",0))
+3 IF '+DA
QUIT
+4 DO ^DIK
+5 QUIT
+6 ;
TEST1 ;EP Adding an entry to 200
+1 ;
+2 SET BSDXFDA(200,"+1,",.01)="BMXNET,APPLICATION"
+3 KILL BSDXIEN,BSDXMSG
+4 SET DIC(0)=""
+5 DO UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG")
+6 ;
+7 QUIT
TEST2 ;EP
+1 ;How to change the ACCESS CODE, VERIFY CODE, DATE VERIFY CODE LAST CHANGED field
+2 ;ACCESS CODE BSDXXX1^1_(a>yr}:3x3ja9\8vbH
+3 ;VERIFY CODE BSDXXX2^$;HOSs|:3w25lLD}Be=
+4 NEW BSDXFDA
+5 SET BSDXFDA(200,"36,",2)="1_(a>yr}:3x3ja9\8vbH"
+6 SET BSDXFDA(200,"36,",11)="$;HOSs|:3w25lLD}Be="
+7 SET BSDXFDA(200,"36,",11.2)="88888,88888"
+8 SET BSDXFDA(200,"36,",201)="BMXRPC"
+9 DO FILE^DIE("","BSDXFDA","BSDXMSG")
+10 QUIT
+11 ;
+12 ;
SEARCHD(BSDXY,BSDXRES,BSDXSTRT,BSDXEND,BSDXTYPES,BSDXAMPM,BSDXWKDY) ;EP
+1 ;Entry point for debugging
+2 ;
+3 ;D DEBUG^%Serenji("SEARCH^BSDX24(.RES,""ROGERS,BUCK|FUNAKOSHI,GICHIN"","""","""","""","""","""")")
+4 ;D DEBUG^%Serenji("SEARCH^BSDX24(.BSDXY,BSDXRES,BSDXSTRT,BSDXEND,BSDXTYPES,BSDXAMPM,BSDXWKDY)")
+5 QUIT
+6 ;
SEARCH(BSDXY,BSDXRES,BSDXSTRT,BSDXEND,BSDXTYPES,BSDXAMPM,BSDXWKDY) ;EP
+1 ;Searches availability database for availability blocks between
+2 ;BSDXSTRT and BSDXEND for each of the resources in BSDXRES.
+3 ;The av blocks must be one of the types in BSDXTYPES, must be
+4 ;AM or PM depending on value in BSDXAMPM and
+5 ;must be on one of the weekdays listed in BSDXWKDY.
+6 ;
+7 ;Return recordset containing the start times of availability blocks
+8 ;meeting the search criteria.
+9 ;
+10 ;Variables:
+11 ;BSDXRES |-Delimited list of resource names
+12 ;BSDXSTRT FM-formatted beginning date of search
+13 ;BSDXEND FM-Formatted ending date of search
+14 ;BSDXTYPES |-Delimited list of access type IENs
+15 ;BSDXAMPM "AM" for am-only, "PM" for pm-only, "BOTH" for both
+16 ;BSDXWKDY "" if any weekday, else |-delimited list of weekdays
+17 ;
+18 ;NOTE: If BSDXEND="" Then:
+19 ; either ONE record is returned matching the first available block
+20 ; -or- NO record is returned indicating no available block exists
+21 ;
+22 ;Called by BSDX SEARCH AVAILABILITY
+23 ;Test Line:
+24 ;D SEARCH^BSDX24(.RES,"ROGERS,BUCK|FUNAKOSHI,GICHIN","","","","","") ZW RES
+25 ;
+26 ;
+27 SET X=BSDXSTRT
SET %DT="X"
DO ^%DT
SET BSDXSTRT=$PIECE(Y,".")
+28 IF +BSDXSTRT<0
SET BSDXSTRT=DT
+29 SET X=BSDXEND
SET %DT="X"
DO ^%DT
SET BSDXEND=$PIECE(Y,".")
+30 IF +BSDXEND<0
SET BSDXEND=9990101
+31 SET BSDXEND=BSDXEND_".99"
+32 NEW BSDXRESN,BSDXRESD,BSDXDATE,BSDXI,BSDXABD,BSDXNOD,BSDXATD,BSDXATN
+33 NEW BSDXTYPE
+34 ;
+35 ;Set up access types array
+36 FOR BSDX=1:1:$LENGTH(BSDXTYPES,"|")
Begin DoDot:1
+37 SET BSDXATD=$PIECE(BSDXTYPES,"|",BSDX)
+38 IF +BSDXATD
SET BSDXTYPE(BSDXTYPD)=""
End DoDot:1
+39 ;
+40 SET BSDXI=0
+41 SET BSDXY="^BSDXTMP("_$JOB_")"
+42 SET ^BSDXTMP($JOB,0)="T00030RESOURCENAME^D00030DATE^T00030ACCESSTYPE^T00030COMMENT"_$CHAR(30)
+43 FOR BSDX=1:1:$LENGTH(BSDXRES,"|")
SET BSDXRESN=$PIECE(BSDXRES,"|",BSDX)
Begin DoDot:1
+44 IF '$DATA(^BSDXRES("B",BSDXRESN))
QUIT
+45 SET BSDXRESD=$ORDER(^BSDXRES("B",BSDXRESN,0))
+46 IF '+BSDXRESD
QUIT
+47 IF '$DATA(^BSDXRES(BSDXRESD,0))
QUIT
+48 IF '$DATA(^BSDXAB("ARSCT",BSDXRESD))
QUIT
+49 SET BSDXDATE=$ORDER(^BSDXAB("ARSCT",BSDXRESD,BSDXSTRT))
+50 IF BSDXDATE=""
QUIT
+51 IF BSDXDATE>BSDXEND
QUIT
+52 ;TODO: Screen for AMPM
+53 ;TODO: Screen for Weekday
+54 ;
+55 SET BSDXI=BSDXI+1
+56 SET BSDXABD=$ORDER(^BSDXAB("ARSCT",BSDXRESD,BSDXDATE,0))
+57 SET BSDXNOD=$GET(^BSDXAB(BSDXABD,0))
+58 IF BSDXNOD=""
QUIT
+59 SET Y=$PIECE(BSDXDATE,".")
+60 DO DD^%DT
+61 ;ACCESS TYPE POINTER
SET BSDXATD=$PIECE(BSDXNOD,U,5)
+62 SET BSDXATD=$GET(^BSDXTYPE(+BSDXATD,0))
+63 SET BSDXATN=$PIECE(BSDXATD,U)
+64 IF +BSDXATD
IF BSDXTYPES]""
IF '$DATA(BSDXTYPES(BSDXATD))
QUIT
+65 ;TODO: Screen for TYPE ----DONE!
+66 ;TODO: Comment
+67 SET ^BSDXTMP($JOB,BSDXI)=BSDXRESN_U_Y_U_BSDXATN_U_$CHAR(30)
End DoDot:1
+68 SET BSDXI=BSDXI+1
+69 SET ^BSDXTMP($JOB,BSDXI)=$CHAR(31)
+70 QUIT