source: Scheduling/trunk/m/BSDX05.m@ 1100

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

Updated Version numbers for routines: new version 1.5V2

File size: 2.6 KB
Line 
1BSDX05 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 12/6/10 5:36pm
2 ;;1.5V2;BSDX;;Mar 03, 2011
3 ;
4 ; Change Log:
5 ; UJO/SMH - July 11 2010: pass FM Dates for Start and End rather than US Dates
6 ; UJO/SMH - Dec 8 2010: In STCOMM, the logic was that an appointment
7 ; that was a walk-in didn't count towards slot calculations.
8 ; I checked PIMS, and Walk-ins do indeed count towards slot calculations.
9 ; Therefore, I commented this line out:
10 ; ;Q:$P(BSDXNOD,U,13)="y" ;WALKIN
11 ;
12APBLKOV(BSDXY,BSDXSTART,BSDXEND,BSDXRES) ;EP
13 ;Called by BSDX APPT BLOCKS OVERLAP
14 ; July 11 2010 - pass FM Dates for Start and End rather than US Dates
15 ;(Duplicates old qryAppointmentBlocksOverlapB)
16 ;BSDXRES is resource name
17 ;
18 ;Test lines:
19 ;D APBLKOV^BSDX05(.RES,"11-8-2000","11-8-2004","WHITT") ZW RES
20 ;BSDX APPT BLOCKS OVERLAP^11-8-2000^11-8-2004^WHITT
21 ;S ^HW("BSDXD05")=BSDXSTART_U_BSDXEND_U_BSDXRES
22 ;
23 N BSDXERR,BSDXIEN,BSDXDEP,BSDXBS,BSDXI,BSDXNEND,BSDXNSTART,BSDXPEND,BSDXRESD,BSDXRESN,BSDXS,BSDXAD,BSDXNOD
24 K ^BSDXTMP($J)
25 S BSDXERR=""
26 S BSDXY="^BSDXTMP("_$J_")"
27 S ^BSDXTMP($J,0)="D00030START_TIME^D00030END_TIME"_$C(30)
28 D
29 . S BSDXBS=0
30 . S BSDXEND=BSDXEND+.9999 ;Go to end of day
31 . S BSDXRESN=BSDXRES
32 . Q:BSDXRESN=""
33 . Q:'$D(^BSDXRES("B",BSDXRESN))
34 . S BSDXRESD=$O(^BSDXRES("B",BSDXRESN,0))
35 . Q:'+BSDXRESD
36 . Q:'$D(^BSDXAPPT("ARSRC",BSDXRESD))
37 . D STRES(BSDXRESD,BSDXSTART,BSDXEND)
38 . Q
39 ;
40 S BSDXI=$G(BSDXI)+1
41 S ^BSDXTMP($J,BSDXI)=$C(31)
42 Q
43 ;
44STRES(BSDXRESD,BSDXSTART,BSDXEND) ;
45 ;$O THRU "ARSRC" XREF OF ^BSDXAPPT
46 ;Start at the beginning of the day -- appts can't overlap days
47 S BSDXS=$P(BSDXSTART,"."),BSDXS=BSDXS-.0001
48 S BSDXI=0
49 F S BSDXS=$O(^BSDXAPPT("ARSRC",BSDXRESD,BSDXS)) Q:'+BSDXS Q:BSDXS>BSDXEND D
50 . S BSDXAD=0 F S BSDXAD=$O(^BSDXAPPT("ARSRC",BSDXRESD,BSDXS,BSDXAD)) Q:'+BSDXAD D STCOMM(BSDXAD) ;BSDXAD Is the AppointmentID
51 . Q
52 Q
53 ;
54STCOMM(BSDXAD) ;
55 S BSDXNEND=0,BSDXNSTART=0,BSDXPEND=0
56 Q:'$D(^BSDXAPPT(BSDXAD,0))
57 S BSDXNOD=^BSDXAPPT(BSDXAD,0)
58 Q:$P(BSDXNOD,U,10)=1 ;NO-SHOW Flag
59 Q:$P(BSDXNOD,U,12)]"" ;CANCELLED APPT
60 ; Q:$P(BSDXNOD,U,13)="y" ;WALKIN -- new in V 1.42. See top comments.
61 S BSDXNSTART=$P(BSDXNOD,U)
62 S BSDXNEND=$P(BSDXNOD,U,2)
63 I BSDXNEND'>BSDXSTART Q ;End is less than start
64 S Y=BSDXNSTART X ^DD("DD") S BSDXNSTART=$TR(Y,"@"," ")
65 S Y=BSDXNEND X ^DD("DD") S BSDXNEND=$TR(Y,"@"," ")
66 S BSDXI=BSDXI+1
67 S ^BSDXTMP($J,BSDXI)=BSDXNSTART_U_BSDXNEND_$C(30)
68 Q
Note: See TracBrowser for help on using the repository browser.