source: Scheduling/trunk/m/BSDX06.m@ 892

Last change on this file since 892 was 888, checked in by Sam Habiel, 14 years ago

Updated version numbers

File size: 2.0 KB
Line 
1BSDX06 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/15/10 4:51pm
2 ;;1.3T1;BSDX;;Jul 18, 2010
3 ; Change Log:
4 ; UJO/SMH: July 15 2010: Change in BSDXSTART and BSDXEND: get
5 ; dates in FM format for i18n
6 ;
7 ;
8TPBLKOV(BSDXY,BSDXSTART,BSDXEND,BSDXRES) ;EP
9 ;Called by BSDXD TYPE BLOCKS OVERLAP
10 ;(Duplicates old qryTypeBlocksOverlapB)
11 ;BSDXRES is resource name
12 ;
13 ;Test lines:
14 ;D TPBLKOV^BSDX06(.RES,"3030513","3030516","REMILLARD,MIKE") ZW RES
15 ;BSDX TYPE BLOCKS OVERLAP^303513^3030516^REMILLARD,MIKE
16 ;S ^HW("BSDXD06")=BSDXSTART_U_BSDXEND_U_BSDXRES
17 ;
18 N BSDXERR,BSDXIEN,BSDXDEP,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXTPID,BSDXNOD,BSDXAD
19 K ^BSDXTMP($J)
20 S BSDXERR=""
21 S BSDXY="^BSDXTMP("_$J_")"
22 S ^BSDXTMP($J,0)="D00030StartTime^D00030EndTime^I00010AppointmentTypeID^I00010AvailabilityID^T00030ResourceName"_$C(30)
23 S BSDXI=0
24 D
25 . S BSDXBS=0
26 . I $L(BSDXEND,".")=1 S BSDXEND=BSDXEND+.9999 ;Go to end of day if only date (not time) is passed
27 . S BSDXRESN=BSDXRES
28 . Q:BSDXRESN=""
29 . Q:'$D(^BSDXRES("B",BSDXRESN))
30 . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0))
31 . Q:'+BSDXRESD
32 . D STCOMM(BSDXRESN,BSDXRESD)
33 . Q
34 ;
35 S BSDXI=$G(BSDXI)+1
36 S ^BSDXTMP($J,BSDXI)=$C(31)
37 Q
38 ;
39STCOMM(BSDXRESN,BSDXRESD) ;EP
40 ;
41 Q:'$D(^BSDXAB("ARSCT",BSDXRESD))
42 Q:'$D(^BSDXRES(BSDXRESD,0))
43 ;$O THRU "ARSCT" XREF OF ^BSDXAB
44 S BSDXNEND=0,BSDXNSTART=0,BSDXPEND=0
45 ;Start at the beginning of the day -- AV Blocks can't overlap days
46 S BSDXS=$P(BSDXSTART,"."),BSDXS=BSDXS-.0001
47 F S BSDXS=$O(^BSDXAB("ARSCT",BSDXRESD,BSDXS)) Q:'+BSDXS Q:BSDXS>BSDXEND D
48 . S BSDXAD=0 F S BSDXAD=$O(^BSDXAB("ARSCT",BSDXRESD,BSDXS,BSDXAD)) Q:'+BSDXAD D
49 . . Q:'$D(^BSDXAB(BSDXAD,0))
50 . . S BSDXNOD=^BSDXAB(BSDXAD,0)
51 . . S BSDXNSTART=$P(BSDXNOD,U,2)
52 . . S BSDXNEND=$P(BSDXNOD,U,3)
53 . . I BSDXNEND'>BSDXSTART Q
54 . . S Y=BSDXNSTART X ^DD("DD") S BSDXNSTART=$TR(Y,"@"," ")
55 . . S Y=BSDXNEND X ^DD("DD") S BSDXNEND=$TR(Y,"@"," ")
56 . . S BSDXTPID=$P(BSDXNOD,U,5)
57 . . S BSDXI=BSDXI+1
58 . . S ^BSDXTMP($J,BSDXI)=BSDXNSTART_U_BSDXNEND_U_BSDXTPID_U_BSDXAD_U_BSDXRESN_$C(30)
59 . . Q
60 . Q
61 Q
Note: See TracBrowser for help on using the repository browser.