1 | BSDX06 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/11/10 5:54pm
|
---|
2 | ;;2.0;IHS WINDOWS SCHEDULING;;NOV 01, 2007
|
---|
3 | ;
|
---|
4 | ;
|
---|
5 | TPBLKOV(BSDXY,BSDXSTART,BSDXEND,BSDXRES) ;EP
|
---|
6 | ;Called by BSDXD TYPE BLOCKS OVERLAP
|
---|
7 | ;(Duplicates old qryTypeBlocksOverlapB)
|
---|
8 | ;BSDXRES is resource name
|
---|
9 | ;
|
---|
10 | ;Test lines:
|
---|
11 | ;D TPBLKOV^BSDX06(.RES,"5-12-2003","5-16-2003","REMILLARD,MIKE") ZW RES
|
---|
12 | ;BSDX TYPE BLOCKS OVERLAP^1-1-2000^12-14-2004^REMILLARD,MIKE
|
---|
13 | ;S ^HW("BSDXD06")=BSDXSTART_U_BSDXEND_U_BSDXRES
|
---|
14 | ;
|
---|
15 | N BSDXERR,BSDXIEN,BSDXDEP,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXTPID,BSDXNOD,BSDXAD
|
---|
16 | K ^BSDXTMP($J)
|
---|
17 | S BSDXERR=""
|
---|
18 | S BSDXY="^BSDXTMP("_$J_")"
|
---|
19 | S ^BSDXTMP($J,0)="D00030StartTime^D00030EndTime^I00010AppointmentTypeID^I00010AvailabilityID^T00030ResourceName"_$C(30)
|
---|
20 | S BSDXI=0
|
---|
21 | D
|
---|
22 | . S BSDXBS=0
|
---|
23 | . ; I $L(BSDXEND,".")=1 S BSDXEND=BSDXEND+.9999 ;Go to end of day
|
---|
24 | . S BSDXEND=BSDXEND+.9999 ;//smh - not sure about this change
|
---|
25 | . S BSDXRESN=BSDXRES
|
---|
26 | . Q:BSDXRESN=""
|
---|
27 | . Q:'$D(^BSDXRES("B",BSDXRESN))
|
---|
28 | . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0))
|
---|
29 | . Q:'+BSDXRESD
|
---|
30 | . D STCOMM(BSDXRESN,BSDXRESD)
|
---|
31 | . Q
|
---|
32 | ;
|
---|
33 | S BSDXI=$G(BSDXI)+1
|
---|
34 | S ^BSDXTMP($J,BSDXI)=$C(31)
|
---|
35 | Q
|
---|
36 | ;
|
---|
37 | STCOMM(BSDXRESN,BSDXRESD) ;EP
|
---|
38 | ;
|
---|
39 | Q:'$D(^BSDXAB("ARSCT",BSDXRESD))
|
---|
40 | Q:'$D(^BSDXRES(BSDXRESD,0))
|
---|
41 | ;$O THRU "ARSCT" XREF OF ^BSDXAB
|
---|
42 | S BSDXNEND=0,BSDXNSTART=0,BSDXPEND=0
|
---|
43 | ;Start at the beginning of the day -- AV Blocks can't overlap days
|
---|
44 | S BSDXS=$P(BSDXSTART,"."),BSDXS=BSDXS-.0001
|
---|
45 | F S BSDXS=$O(^BSDXAB("ARSCT",BSDXRESD,BSDXS)) Q:'+BSDXS Q:BSDXS>BSDXEND D
|
---|
46 | . S BSDXAD=0 F S BSDXAD=$O(^BSDXAB("ARSCT",BSDXRESD,BSDXS,BSDXAD)) Q:'+BSDXAD D
|
---|
47 | . . Q:'$D(^BSDXAB(BSDXAD,0))
|
---|
48 | . . S BSDXNOD=^BSDXAB(BSDXAD,0)
|
---|
49 | . . S BSDXNSTART=$P(BSDXNOD,U,2)
|
---|
50 | . . S BSDXNEND=$P(BSDXNOD,U,3)
|
---|
51 | . . I BSDXNEND'>BSDXSTART Q
|
---|
52 | . . S Y=BSDXNSTART X ^DD("DD") S BSDXNSTART=$TR(Y,"@"," ")
|
---|
53 | . . S Y=BSDXNEND X ^DD("DD") S BSDXNEND=$TR(Y,"@"," ")
|
---|
54 | . . S BSDXTPID=$P(BSDXNOD,U,5)
|
---|
55 | . . S BSDXI=BSDXI+1
|
---|
56 | . . S ^BSDXTMP($J,BSDXI)=BSDXNSTART_U_BSDXNEND_U_BSDXTPID_U_BSDXAD_U_BSDXRESN_$C(30)
|
---|
57 | . . Q
|
---|
58 | . Q
|
---|
59 | Q
|
---|