From 7524c52392c56019424b280ab6422164b13501df Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 27 Feb 2011 11:31:10 +0000 Subject: [PATCH] Updated BSDX04 to support querying availabilities for multiple resources at the same time. Also, due to algorithm changes on the C# side, algo changed here, removing some unnecessary data that was returned --- m/BSDX04.m | 92 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/m/BSDX04.m b/m/BSDX04.m index 7bbba90..305d689 100644 --- a/m/BSDX04.m +++ b/m/BSDX04.m @@ -1,8 +1,13 @@ -BSDX04 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; ; 7/15/10 12:44pm +BSDX04 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; ; 2/27/11 6:32am ;;1.5;BSDX;;Jan 25, 2011 - ; Change Log: - ; July 11 2010: Pass BSDXSTART and END as FM dates rather than US formatted dates - ; for i18n + ; Change Log: + ; July 11 2010: Pass BSDXSTART and END as FM dates rather than US formatted dates + ; for i18n + ; Feb 27 2010 (v. 1.5) SMH + ; - Grab multiple resources instead of a single resource. + ; --> Will be passed from C# as | delimited. + ; - Change in algorithm. Padding part to pad start and end dates to coincide + ; --> with schedule now not performed. C# won't need that anymore. ; ; CASSCHD(BSDXY,BSDXRES,BSDXSTART,BSDXEND,BSDXTYPES,BSDXSRCH) ;EP @@ -19,19 +24,16 @@ CASSET ;EP S ^BSDXTMP($J,BSDXI)=$C(31) Q ; -CASSCH(BSDXY,BSDXRES,BSDXSTART,BSDXEND,BSDXTYPES,BSDXSRCH) ;EP - ;Called by BSDX CREATE ASGND SLOT SCHED - ;Create Assigned Slot Schedule recordset +CASSCH(BSDXY,BSDXRES,BSDXSTART,BSDXEND,BSDXTYPES,BSDXSRCH) ;EP -- RPC: BSDX CREATE ASGND SLOT SCHED + ;Create Assigned Slot Schedule recordset (Access Blocks, Availabilities, etc.) ;This call is used both to create a schedule of availability for the calendar display ;and to search for availability in the Find Appointment function ; - ;BSDXRES is resource name - ; - ;//smh - ; BSDXSTART and BSDXEND both passed in FM Format. - ; BSDXSTART is the Date Portion of FM Date - ; BSDXEND -- pass date and h,m,s as well - ;//smh + ;BSDXRES is resources name, delimited by | + ; + ; BSDXSTART and BSDXEND both passed in FM Format. + ; BSDXSTART is the Date Portion of FM Date + ; BSDXEND -- pass date and h,m,s as well ; ;BSDXTYPES is |-delimited list of Access Type Names ;If BSDXTYPES is "" then the screen passes all types. @@ -47,14 +49,14 @@ CASSCH(BSDXY,BSDXRES,BSDXSTART,BSDXEND,BSDXTYPES,BSDXSRCH) ;EP ;BSDX CREATE ASGND SLOT SCHED^ROGERS,BUCK^^^2 ;S ^HW("BSDX04")=BSDXRES_U_BSDXSTART_U_BSDXEND ; - N BSDXERR,BSDXIEN,BSDXDEP,BSDXTYPED,BSDXTYPE,BSDXALO,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXZ,BSDXTMP,BSDXQ,BSDXNOT,BSDXNOD,BSDXAD + N BSDXERR,BSDXIEN,BSDXDEP,BSDXTYPED,BSDXTYPE,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXZ,BSDXTMP,BSDXQ,BSDXNOT,BSDXNOD,BSDXAD N BSDXSUBCD S X="CASSET^BSDX04",@^%ZOSF("TRAP") K ^BSDXTMP($J) S BSDXERR="" S BSDXY="^BSDXTMP("_$J_")" S ^BSDXTMP($J,0)="D00030START_TIME^D00030END_TIME^I00010SLOTS^T00030RESOURCE^T00010ACCESS_TYPE^T00250NOTE^I00030AVAILABILITYID"_$C(30) - S BSDXALO=0,BSDXI=2 + S BSDXI=2 ; ;Get Access Type IDs N BSDXK,BSDXTYPED,BSDXL @@ -65,41 +67,44 @@ CASSCH(BSDXY,BSDXRES,BSDXSTART,BSDXEND,BSDXTYPES,BSDXSRCH) ;EP . I '$D(^BSDXTYPE("B",BSDXL)) S $P(BSDXTYPED,"|",BSDXK)=0 Q . S $P(BSDXTYPED,"|",BSDXK)=$O(^BSDXTYPE("B",BSDXL,0)) ; - D - . S BSDXBS=0 - . S BSDXRESN=BSDXRES + N BSDXCOUN ; Counter + FOR BSDXCOUN=1:1:$L(BSDXRES,"|") DO ;smh - d in algo to do multiple res + . S BSDXRESN=$P(BSDXRES,"|",BSDXCOUN) . Q:BSDXRESN="" . Q:'$D(^BSDXRES("B",BSDXRESN)) - . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0)) Q:'+BSDXRESD + . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0)) + . Q:'+BSDXRESD . Q:'$D(^BSDXAB("ARSCT",BSDXRESD)) + . S BSDXBS=0 . D STRES(BSDXRESN,BSDXRESD) . Q ; + ; V 1.5 -- All of this commented out; algo changed on C# side. ;start, end, slots, resource, accesstype, note, availabilityid ;I '+BSDXSRCH,BSDXALO D - I BSDXALO D - . ;If first block start time > input start time then pad with new block - . I BSDXBS>BSDXSTART K BSDXTMP D - . . S Y=BSDXSTART X ^DD("DD") S Y=$TR(Y,"@"," ") - . . S BSDXTMP=Y - . . S Y=BSDXBS X ^DD("DD") S Y=$TR(Y,"@"," ") - . . S BSDXTMP=BSDXTMP_"^"_Y_"^0^"_BSDXRESN_"^0^^0"_$C(30) - . . S ^BSDXTMP($J,1)=BSDXTMP - . ; - . ;If first block start time < input start time then trim - . I BSDXBS input start time then pad with new block + ; . I BSDXBS>BSDXSTART K BSDXTMP D + ; . . S Y=BSDXSTART X ^DD("DD") S Y=$TR(Y,"@"," ") + ; . . S BSDXTMP=Y + ; . . S Y=BSDXBS X ^DD("DD") S Y=$TR(Y,"@"," ") + ; . . S BSDXTMP=BSDXTMP_"^"_Y_"^0^"_BSDXRESN_"^0^^0"_$C(30) + ; . . S ^BSDXTMP($J,1)=BSDXTMP + ; . ; + ; . ;If first block start time < input start time then trim + ; . I BSDXBS