Index: Scheduling/trunk/m/BSDXUT.m
===================================================================
--- Scheduling/trunk/m/BSDXUT.m	(revision 1464)
+++ Scheduling/trunk/m/BSDXUT.m	(revision 1472)
@@ -1,4 +1,4 @@
-BSDXUT ; VEN/SMH - Unit Tests for Scheduling GUI ; 6/29/12 12:20pm
-	;;1.7T1;BSDX;;Aug 31, 2011;Build 18
+BSDXUT	; VEN/SMH - Unit Tests for Scheduling GUI ; 6/29/12 12:20pm
+	;;1.7T1;BSDX;;Jul 06, 2012;Build 18
 	; Licensed under LGPL
 	;
@@ -242,68 +242,68 @@
 	QUIT
 	; 
-UTCR(RESNAM) ; $$ - Create Unit Test Clinic and Resource Pair ; Private
- ; Input: Resource Name By Value
- ; Output: -1^Error or HLIEN^RESIEN for Success (file 44 IEN^file 9002018.1 IEN)
- ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
- N HLIEN S HLIEN=$$UTCR44(RESNAM)
- I +HLIEN=-1 QUIT HLIEN
- ;
- N RESIEN S RESIEN=$$UTCRRES(RESNAM,HLIEN)
- I +RESIEN=-1 QUIT RESIEN
- E  QUIT HLIEN_U_RESIEN
- ;
-UTCR44(HLNAME) ; $$ - Create Unit Test Clinic in File 44; Private ; TESTING ONLY CODE
- ; Output: -1^Error or IEN for Success
- ; Input: Hosp Location Name by Value
- ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
- ;
- I $D(^SC("B",HLNAME)) Q $O(^(HLNAME,""))
- ;
- N SAM
- S SAM(44,"?+1,",.01)=HLNAME            ; Name
- S SAM(44,"?+1,",2)="C"                 ; Type = Clinic
- S SAM(44,"?+1,",2.1)=1                 ; Type Extension (not used)
- S SAM(44,"?+1,",3.5)=$O(^DG(40.8,0))   ; Division (not yet used)
- S SAM(44,"?+1,",8)=295                 ; Stop Code Number (not used)
- S SAM(44,"?+1,",9)="M"          ; Service (not used)
- S SAM(44,"?+1,",1912)=15               ; Length of Appt (not used)
- S SAM(44,"?+1,",1917)=4                ; Display increments per hour (not used)
- S SAM(44,"?+1,",1918)=8                ; Overbooks/day max (not used)
- S SAM(44,"?+1,",2000.5)=0              ; Require Action Profiles: Yes (not used)
- S SAM(44,"?+1,",2001)=999              ; Allowable consecutive no-shows (not used)
- S SAM(44,"?+1,",2002)=999              ; Max # days for Future Booking (not used)
- S SAM(44,"?+1,",2005)=365              ; Max # days for Auto Rebook (not used)
- S SAM(44,"?+1,",2502)="N"             ; Non-Count Clinic (not used)
- S SAM(44,"?+1,",2504)="Y"            ; Clinic meets at this Facility? (not used)
- S SAM(44,"?+1,",2507)=9              ; Appointment Type (not used)
- ;
- N BSDXERR,BSDXIEN
- D UPDATE^DIE("",$NA(SAM),$NA(BSDXIEN),$NA(BSDXERR))
- Q $S($D(BSDXERR):-1_U_BSDXERR("DIERR",1,"TEXT",1),1:BSDXIEN(1))
- ;
-UTCRRES(NAME,HLIEN) ; $$ - Create Unit Test Resource in 9002018.1 (BSDX RESOURCE); Private
- ; Input: Hospital Location IEN
- ; Output: -1^Error or IEN for Success
- ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
- I $D(^BSDXRES("B",NAME)) Q $O(^(NAME,""))
- S HLIEN=$G(HLIEN) ; If we don't send one in
- N RES ; garbage variable
- D RSRC^BSDX16(.RES,"|"_NAME_"||"_HLIEN)
- N RTN S RTN=@$Q(^BSDXTMP($J,0)) ; return array next value
- Q $S(RTN=0:-1_U_RTN,1:+RTN) ; 0 means an error has occurred; 1 means IEN returned
- ;
-TIMES() ; $$ - Create a next available appointment time^ending time; Private
- ; Output: appttime^endtime
- N NOW S NOW=$$NOW^XLFDT() ; Now time
- N LAST S LAST=$O(^BSDXAPPT("B"," "),-1) ; highest time in file
- N TIME2USE S TIME2USE=$S(NOW>LAST:NOW,1:LAST) ; Which time to use?
- S TIME2USE=$E(TIME2USE,1,12) ; Strip away seconds
- N APPTIME S APPTIME=$$FMADD^XLFDT(TIME2USE,0,0,15,0) ; Add 15 min
- N ENDTIME S ENDTIME=$$FMADD^XLFDT(APPTIME,0,0,15,0) ; Add 15 more min
- Q APPTIME_U_ENDTIME ; quit with apptime^endtime
- ;
-TIMEHL(HLIEN) ; $$ - Create a next available appointment time^ending time by HL; Private
- ; Input: HLIEN
- ; Output: Next available appointment time for the HLIEN
- N LAST S LAST=$O(^SC(HLIEN,"S",""),-1)
- Q $$FMADD^XLFDT(LAST,1,0,15,0) ; Add 1 day and 15 minutes
+UTCR(RESNAM)	; $$ - Create Unit Test Clinic and Resource Pair ; Private
+	; Input: Resource Name By Value
+	; Output: -1^Error or HLIEN^RESIEN for Success (file 44 IEN^file 9002018.1 IEN)
+	; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
+	N HLIEN S HLIEN=$$UTCR44(RESNAM)
+	I +HLIEN=-1 QUIT HLIEN
+	;
+	N RESIEN S RESIEN=$$UTCRRES(RESNAM,HLIEN)
+	I +RESIEN=-1 QUIT RESIEN
+	E  QUIT HLIEN_U_RESIEN
+	;
+UTCR44(HLNAME)	; $$ - Create Unit Test Clinic in File 44; Private ; TESTING ONLY CODE
+	; Output: -1^Error or IEN for Success
+	; Input: Hosp Location Name by Value
+	; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
+	;
+	I $D(^SC("B",HLNAME)) Q $O(^(HLNAME,""))
+	;
+	N SAM
+	S SAM(44,"?+1,",.01)=HLNAME            ; Name
+	S SAM(44,"?+1,",2)="C"                 ; Type = Clinic
+	S SAM(44,"?+1,",2.1)=1                 ; Type Extension (not used)
+	S SAM(44,"?+1,",3.5)=$O(^DG(40.8,0))   ; Division (not yet used)
+	S SAM(44,"?+1,",8)=295                 ; Stop Code Number (not used)
+	S SAM(44,"?+1,",9)="M"          ; Service (not used)
+	S SAM(44,"?+1,",1912)=15               ; Length of Appt (not used)
+	S SAM(44,"?+1,",1917)=4                ; Display increments per hour (not used)
+	S SAM(44,"?+1,",1918)=8                ; Overbooks/day max (not used)
+	S SAM(44,"?+1,",2000.5)=0              ; Require Action Profiles: Yes (not used)
+	S SAM(44,"?+1,",2001)=999              ; Allowable consecutive no-shows (not used)
+	S SAM(44,"?+1,",2002)=999              ; Max # days for Future Booking (not used)
+	S SAM(44,"?+1,",2005)=365              ; Max # days for Auto Rebook (not used)
+	S SAM(44,"?+1,",2502)="N"             ; Non-Count Clinic (not used)
+	S SAM(44,"?+1,",2504)="Y"            ; Clinic meets at this Facility? (not used)
+	S SAM(44,"?+1,",2507)=9              ; Appointment Type (not used)
+	;
+	N BSDXERR,BSDXIEN
+	D UPDATE^DIE("",$NA(SAM),$NA(BSDXIEN),$NA(BSDXERR))
+	Q $S($D(BSDXERR):-1_U_BSDXERR("DIERR",1,"TEXT",1),1:BSDXIEN(1))
+	;
+UTCRRES(NAME,HLIEN)	; $$ - Create Unit Test Resource in 9002018.1 (BSDX RESOURCE); Private
+	; Input: Hospital Location IEN
+	; Output: -1^Error or IEN for Success
+	; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
+	I $D(^BSDXRES("B",NAME)) Q $O(^(NAME,""))
+	S HLIEN=$G(HLIEN) ; If we don't send one in
+	N RES ; garbage variable
+	D RSRC^BSDX16(.RES,"|"_NAME_"||"_HLIEN)
+	N RTN S RTN=@$Q(^BSDXTMP($J,0)) ; return array next value
+	Q $S(RTN=0:-1_U_RTN,1:+RTN) ; 0 means an error has occurred; 1 means IEN returned
+	;
+TIMES()	; $$ - Create a next available appointment time^ending time; Private
+	; Output: appttime^endtime
+	N NOW S NOW=$$NOW^XLFDT() ; Now time
+	N LAST S LAST=$O(^BSDXAPPT("B"," "),-1) ; highest time in file
+	N TIME2USE S TIME2USE=$S(NOW>LAST:NOW,1:LAST) ; Which time to use?
+	S TIME2USE=$E(TIME2USE,1,12) ; Strip away seconds
+	N APPTIME S APPTIME=$$FMADD^XLFDT(TIME2USE,0,0,15,0) ; Add 15 min
+	N ENDTIME S ENDTIME=$$FMADD^XLFDT(APPTIME,0,0,15,0) ; Add 15 more min
+	Q APPTIME_U_ENDTIME ; quit with apptime^endtime
+	;
+TIMEHL(HLIEN)	; $$ - Create a next available appointment time^ending time by HL; Private
+	; Input: HLIEN
+	; Output: Next available appointment time for the HLIEN
+	N LAST S LAST=$O(^SC(HLIEN,"S",""),-1)
+	Q $$FMADD^XLFDT(LAST,1,0,15,0) ; Add 1 day and 15 minutes
