Changeset 1454 for Scheduling/trunk/m/BSDX35.m
- Timestamp:
- Jun 21, 2012, 7:24:56 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX35.m
r1449 r1454 1 BSDX35 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 6/ 18/12 2:27pm1 BSDX35 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 6/21/12 3:57pm 2 2 ;;1.7T1;BSDX;;Aug 31, 2011;Build 18 3 3 ; Licensed under LGPL … … 74 74 S ^BSDXTMP($J,BSDXI)=$C(31) 75 75 Q 76 UTCR(RESNAM) ; $$ - Create Unit Test Clinic and Resource Pair ; Private77 ; Input: Resource Name By Value78 ; Output: -1^Error or HLIEN^RESIEN for Success (file 44 IEN^file 9002018.1 IEN)79 ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY80 N HLIEN S HLIEN=$$UTCR44(RESNAM)81 I +HLIEN=-1 QUIT HLIEN82 ;83 N RESIEN S RESIEN=$$UTCRRES(RESNAM,HLIEN)84 I +RESIEN=-1 QUIT RESIEN85 E QUIT HLIEN_U_RESIEN86 ;87 UTCR44(HLNAME) ; $$ - Create Unit Test Clinic in File 44; Private ; TESTING ONLY CODE88 ; Output: -1^Error or IEN for Success89 ; Input: Hosp Location Name by Value90 ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY91 ;92 I $D(^SC("B",HLNAME)) Q $O(^(HLNAME,""))93 ;94 N SAM95 S SAM(44,"?+1,",.01)=HLNAME ; Name96 S SAM(44,"?+1,",2)="C" ; Type = Clinic97 S SAM(44,"?+1,",2.1)=1 ; Type Extension (not used)98 S SAM(44,"?+1,",3.5)=$O(^DG(40.8,0)) ; Division (not yet used)99 S SAM(44,"?+1,",8)=295 ; Stop Code Number (not used)100 S SAM(44,"?+1,",9)="M" ; Service (not used)101 S SAM(44,"?+1,",1912)=15 ; Length of Appt (not used)102 S SAM(44,"?+1,",1917)=4 ; Display increments per hour (not used)103 S SAM(44,"?+1,",1918)=8 ; Overbooks/day max (not used)104 S SAM(44,"?+1,",2000.5)=0 ; Require Action Profiles: Yes (not used)105 S SAM(44,"?+1,",2001)=999 ; Allowable consecutive no-shows (not used)106 S SAM(44,"?+1,",2002)=999 ; Max # days for Future Booking (not used)107 S SAM(44,"?+1,",2005)=365 ; Max # days for Auto Rebook (not used)108 S SAM(44,"?+1,",2502)="N" ; Non-Count Clinic (not used)109 S SAM(44,"?+1,",2504)="Y" ; Clinic meets at this Facility? (not used)110 S SAM(44,"?+1,",2507)=9 ; Appointment Type (not used)111 ;112 N BSDXERR,BSDXIEN113 D UPDATE^DIE("",$NA(SAM),$NA(BSDXIEN),$NA(BSDXERR))114 Q $S($D(BSDXERR):-1_U_BSDXERR("DIERR",1,"TEXT",1),1:BSDXIEN(1))115 ;116 UTCRRES(NAME,HLIEN) ; $$ - Create Unit Test Resource in 9002018.1 (BSDX RESOURCE); Private117 ; Input: Hospital Location IEN118 ; Output: -1^Error or IEN for Success119 ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY120 I $D(^BSDXRES("B",NAME)) Q $O(^(NAME,""))121 D RSRC^BSDX16(.RES,"|"_NAME_"||"_HLIEN)122 N RTN S RTN=@$Q(^BSDXTMP($J,0)) ; return array next value123 Q $S(RTN=0:-1_U_RTN,1:+RTN) ; 0 means an error has occurred; 1 means IEN returned124 ;125 TIMES() ; $$ - Create a next available appointment time^ending time; Private126 N NOW S NOW=$$NOW^XLFDT() ; Now time127 N LAST S LAST=$O(^BSDXAPPT("B"," "),-1) ; highest time in file128 N TIME2USE S TIME2USE=$S(NOW>LAST:NOW,1:LAST) ; Which time to use?129 S TIME2USE=$E(TIME2USE,1,12) ; Strip away seconds130 N APPTIME S APPTIME=$$FMADD^XLFDT(TIME2USE,0,0,15,0) ; Add 15 min131 N ENDTIME S ENDTIME=$$FMADD^XLFDT(APPTIME,0,0,15,0) ; Add 15 more min132 Q APPTIME_U_ENDTIME ; quit with apptime^endtime
Note:
See TracChangeset
for help on using the changeset viewer.