Changeset 1096 for Scheduling/trunk/m


Ignore:
Timestamp:
Feb 27, 2011, 6:31:10 AM (14 years ago)
Author:
Sam Habiel
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/m/BSDX04.m

    r1085 r1096  
    1 BSDX04  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ;  ; 7/15/10 12:44pm
     1BSDX04  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ;  ; 2/27/11 6:32am
    22        ;;1.5;BSDX;;Jan 25, 2011
    3            ; Change Log:
    4            ; July 11 2010: Pass BSDXSTART and END as FM dates rather than US formatted dates
    5            ;       for i18n
     3        ; Change Log:
     4        ; July 11 2010: Pass BSDXSTART and END as FM dates rather than US formatted dates
     5        ;       for i18n
     6        ; Feb 27 2010 (v. 1.5) SMH
     7        ; - Grab multiple resources instead of a single resource.
     8        ;   --> Will be passed from C# as | delimited.
     9        ; - Change in algorithm. Padding part to pad start and end dates to coincide
     10        ;   --> with schedule now not performed. C# won't need that anymore.
    611        ;
    712        ;
     
    2025        Q
    2126        ;
    22 CASSCH(BSDXY,BSDXRES,BSDXSTART,BSDXEND,BSDXTYPES,BSDXSRCH)      ;EP
    23         ;Called by BSDX CREATE ASGND SLOT SCHED
    24         ;Create Assigned Slot Schedule recordset
     27CASSCH(BSDXY,BSDXRES,BSDXSTART,BSDXEND,BSDXTYPES,BSDXSRCH)      ;EP  -- RPC: BSDX CREATE ASGND SLOT SCHED
     28        ;Create Assigned Slot Schedule recordset (Access Blocks, Availabilities, etc.)
    2529        ;This call is used both to create a schedule of availability for the calendar display
    2630        ;and to search for availability in the Find Appointment function
    2731        ;
    28         ;BSDXRES is resource name
    29            ;
    30            ;//smh
    31            ; BSDXSTART and BSDXEND both passed in FM Format.
    32            ; BSDXSTART is the Date Portion of FM Date
    33            ; BSDXEND -- pass date and h,m,s as well
    34            ;//smh
     32        ;BSDXRES is resources name, delimited by |
     33        ;
     34        ; BSDXSTART and BSDXEND both passed in FM Format.
     35        ; BSDXSTART is the Date Portion of FM Date
     36        ; BSDXEND -- pass date and h,m,s as well
    3537        ;
    3638        ;BSDXTYPES is |-delimited list of Access Type Names
     
    4850        ;S ^HW("BSDX04")=BSDXRES_U_BSDXSTART_U_BSDXEND
    4951        ;
    50         N BSDXERR,BSDXIEN,BSDXDEP,BSDXTYPED,BSDXTYPE,BSDXALO,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXZ,BSDXTMP,BSDXQ,BSDXNOT,BSDXNOD,BSDXAD
     52        N BSDXERR,BSDXIEN,BSDXDEP,BSDXTYPED,BSDXTYPE,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXZ,BSDXTMP,BSDXQ,BSDXNOT,BSDXNOD,BSDXAD
    5153        N BSDXSUBCD
    5254        S X="CASSET^BSDX04",@^%ZOSF("TRAP")
     
    5557        S BSDXY="^BSDXTMP("_$J_")"
    5658        S ^BSDXTMP($J,0)="D00030START_TIME^D00030END_TIME^I00010SLOTS^T00030RESOURCE^T00010ACCESS_TYPE^T00250NOTE^I00030AVAILABILITYID"_$C(30)
    57         S BSDXALO=0,BSDXI=2
     59        S BSDXI=2
    5860        ;
    5961        ;Get Access Type IDs
     
    6668        . S $P(BSDXTYPED,"|",BSDXK)=$O(^BSDXTYPE("B",BSDXL,0))
    6769        ;
    68         D
    69         . S BSDXBS=0
    70         . S BSDXRESN=BSDXRES
     70        N BSDXCOUN ; Counter
     71        FOR BSDXCOUN=1:1:$L(BSDXRES,"|") DO  ;smh - d in algo to do multiple res
     72        . S BSDXRESN=$P(BSDXRES,"|",BSDXCOUN)
    7173        . Q:BSDXRESN=""
    7274        . Q:'$D(^BSDXRES("B",BSDXRESN))
    73         . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0)) Q:'+BSDXRESD
     75        . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0))
     76        . Q:'+BSDXRESD
    7477        . Q:'$D(^BSDXAB("ARSCT",BSDXRESD))
     78        . S BSDXBS=0
    7579        . D STRES(BSDXRESN,BSDXRESD)
    7680        . Q
    7781        ;
     82        ; V 1.5 -- All of this commented out; algo changed on C# side.
    7883        ;start, end, slots, resource, accesstype, note, availabilityid
    7984        ;I '+BSDXSRCH,BSDXALO D
    80         I BSDXALO D
    81         . ;If first block start time > input start time then pad with new block
    82         . I BSDXBS>BSDXSTART K BSDXTMP D
    83         . . S Y=BSDXSTART X ^DD("DD") S Y=$TR(Y,"@"," ")
    84         . . S BSDXTMP=Y
    85         . . S Y=BSDXBS X ^DD("DD") S Y=$TR(Y,"@"," ")
    86         . . S BSDXTMP=BSDXTMP_"^"_Y_"^0^"_BSDXRESN_"^0^^0"_$C(30)
    87         . . S ^BSDXTMP($J,1)=BSDXTMP
    88         . ;
    89         . ;If first block start time < input start time then trim
    90         . I BSDXBS<BSDXSTART D
    91         . . S Y=BSDXSTART
    92         . . X ^DD("DD") S Y=$TR(Y,"@"," ")
    93         . . S $P(^BSDXTMP($J,2),U,1)=Y
    94         . ;
    95         . ;If last block end time < input end time then pad end with new block
    96         . I BSDXPEND<BSDXEND D
    97         . . S Y=BSDXPEND X ^DD("DD") S Y=$TR(Y,"@"," ")
    98         . . S BSDXTMP=Y
    99         . . S Y=BSDXEND X ^DD("DD") S Y=$TR(Y,"@"," ")
    100         . . S BSDXTMP=BSDXTMP_"^"_Y_"^0^"_BSDXRESN_"^0^^0"_$C(30)
    101         . . S ^BSDXTMP($J,BSDXI-1)=BSDXTMP
    102         . ;
     85        ; I BSDXALO D
     86        ; . ;If first block start time > input start time then pad with new block
     87        ; . I BSDXBS>BSDXSTART K BSDXTMP D
     88        ; . . S Y=BSDXSTART X ^DD("DD") S Y=$TR(Y,"@"," ")
     89        ; . . S BSDXTMP=Y
     90        ; . . S Y=BSDXBS X ^DD("DD") S Y=$TR(Y,"@"," ")
     91        ; . . S BSDXTMP=BSDXTMP_"^"_Y_"^0^"_BSDXRESN_"^0^^0"_$C(30)
     92        ; . . S ^BSDXTMP($J,1)=BSDXTMP
     93        ; . ;
     94        ; . ;If first block start time < input start time then trim
     95        ; . I BSDXBS<BSDXSTART D
     96        ; . . S Y=BSDXSTART
     97        ; . . X ^DD("DD") S Y=$TR(Y,"@"," ")
     98        ; . . S $P(^BSDXTMP($J,2),U,1)=Y
     99        ; . ;
     100        ; . ;If last block end time < input end time then pad end with new block
     101        ; . I BSDXPEND<BSDXEND D
     102        ; . . S Y=BSDXPEND X ^DD("DD") S Y=$TR(Y,"@"," ")
     103        ; . . S BSDXTMP=Y
     104        ; . . S Y=BSDXEND X ^DD("DD") S Y=$TR(Y,"@"," ")
     105        ; . . S BSDXTMP=BSDXTMP_"^"_Y_"^0^"_BSDXRESN_"^0^^0"_$C(30)
     106        ; . . S ^BSDXTMP($J,BSDXI-1)=BSDXTMP
     107        ; . ;
    103108        S ^BSDXTMP($J,BSDXI)=$C(31)
    104109        Q
     
    157162        S ^BSDXTMP($J,BSDXI)=BSDXZ_"^"_BSDXAD_$C(30)
    158163        S BSDXI=BSDXI+2
    159         S BSDXALO=1 ;At Least One record will be returned
    160164        Q
Note: See TracChangeset for help on using the changeset viewer.