Changeset 1463 for Scheduling/trunk
- Timestamp:
- Jun 28, 2012, 6:54:30 PM (13 years ago)
- Location:
- Scheduling/trunk/m
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX25.m
r1187 r1463 1 BSDX25 ; VW/UJO/SMH - WINDOWS SCHEDULING RPCS ; 4/28/11 10:24am2 ;;1.6 T2;BSDX;;May 16, 20111 BSDX25 ; VW/UJO/SMH - WINDOWS SCHEDULING RPCS ; 6/28/12 11:45am 2 ;;1.6;BSDX;;Aug 31, 2011;Build 18 3 3 ; Licensed under LGPL 4 4 ; … … 7 7 ; 8 8 ; 9 UT ; Unit Tests10 ; Make appointment, checkin, then uncheckin11 N ZZZ12 N APPTTIME S APPTTIME=$E($$NOW^XLFDT(),1,12)13 D APPADD^BSDX07(.ZZZ,APPTTIME,APPTTIME+.0001,3,"Dr Office",30,"Sam's Note",1)14 N APPTID S APPTID=+^BSDXTMP($J,1)15 N HL S HL=$$GET1^DIQ(9002018.4,APPTID,".07:.04","I")16 D CHECKIN^BSDX25(.ZZZ,APPTID,$$NOW^XLFDT())17 IF '$P(^BSDXAPPT(APPTID,0),U,3) WRITE "ERROR IN CHECKIN 1",!18 IF '+$G(^SC(HL,"S",APPTTIME,1,1,"C")) WRITE "ERROR IN CHECKIN 2",!19 D RMCI^BSDX25(.ZZZ,APPTID)20 IF $P(^BSDXAPPT(APPTID,0),U,3) WRITE "ERROR IN UNCHECKIN 1",!21 IF $G(^SC(HL,"S",APPTTIME,1,1,"C")) WRITE "ERROR IN UNCHECKIN 2",!22 D RMCI^BSDX25(.ZZZ,APPTID) ; again, test sanity in repeat23 IF $P(^BSDXAPPT(APPTID,0),U,3) WRITE "ERROR IN UNCHECKIN 1",!24 IF $G(^SC(HL,"S",APPTTIME,1,1,"C")) WRITE "ERROR IN UNCHECKIN 2",!25 ; now test various error conditions26 ; Test Error 127 D RMCI^BSDX25(.ZZZ,)28 IF +^BSDXTMP($J,1)'=-1 WRITE "ERROR IN ETest 1",!29 ; Test Error 230 D RMCI^BSDX25(.ZZZ,234987234398)31 IF +^BSDXTMP($J,1)'=-2 WRITE "ERROR IN Etest 2",!32 ; Tests for 3 to 5 difficult to produce33 ; Error tests follow: Mumps error test; Transaction restartability34 N bsdxdie S bsdxdie=135 D RMCI^BSDX25(.ZZZ,APPTID)36 IF +^BSDXTMP($J,1)'=-20 WRITE "ERROR IN Etest 3",!37 K bsdxdie38 N bsdxrestart S bsdxrestart=139 D RMCI^BSDX25(.ZZZ,APPTID)40 IF +^BSDXTMP($J,1)'=0 WRITE "Error in Etest 4",!41 QUIT42 9 CHECKIND(BSDXY,BSDXAPTID,BSDXCDT,BSDXCC,BSDXPRV,BSDXROU,BSDXVCL,BSDXVFM,BSDXOG) ;EP 43 10 ;Entry point for debugging … … 46 13 Q 47 14 ; 48 CHECKIN(BSDXY,BSDXAPTID,BSDXCDT) ; ,BSDXCC,BSDXPRV,BSDXROU,BSDXVCL,BSDXVFM,BSDXOG) ;EP Check in appointment 15 CHECKIN(BSDXY,BSDXAPTID,BSDXCDT) ;Private EP Check in appointment 16 ; Old additional vars: ,BSDXCC,BSDXPRV,BSDXROU,BSDXVCL,BSDXVFM,BSDXOG) 49 17 ; Private to GUI; use BSDXAPI for general API to checkin patients 50 18 ; Parameters: … … 63 31 ; - 0 if all okay 64 32 ; - Another number or text if not 65 66 N BSDXNOD,BSDXPATID,BSDXSTART,DIK,DA,BSDXID,BSDXI,BSDXZ,BSDXIENS,BSDXVEN 33 ; 34 N BSDXNOD,BSDXPATID,BSDXSTART,DIK,DA,BSDXID,BSDXZ,BSDXIENS,BSDXVEN 35 ; 36 ; Turn off SDAM Appointment Events BSDX Protocol Processing 67 37 N BSDXNOEV 68 38 S BSDXNOEV=1 ;Don't execute protocol 69 39 ; 70 D ^XBKVAR S X="ERROR^BSDX25",@^%ZOSF("TRAP") 71 S BSDXI=0 40 ; Set min DUZ vars 41 D ^XBKVAR 42 ; 43 ; $ET 44 N $ET S $ET="G ERROR^BSDX25" 45 ; 46 N BSDXI S BSDXI=0 72 47 K ^BSDXTMP($J) 73 48 S BSDXY="^BSDXTMP("_$J_")" … … 78 53 ;S:BSDXCDT["@0000" BSDXCDT=$P(BSDXCDT,"@") 79 54 ;S %DT="T",X=BSDXCDT D ^%DT S BSDXCDT=Y 80 55 S BSDXCDT=+BSDXCDT ; Strip off zeros if C# sends them 81 56 I BSDXCDT=-1 D ERR(70) Q 82 57 I BSDXCDT>$$NOW^XLFDT S BSDXCDT=$$NOW^XLFDT … … 128 103 ; -4~DB has corruption. Call Tech Support. (Resource ID in BSDXAPPT doesnt exist in BSDXRES) 129 104 ; -5~BSDXAPI Error. Message depends on error. 130 ; - 20~Mumps Error105 ; -100~Mumps Error 131 106 ; 132 107 N BSDXNOEV S BSDXNOEV=1 ;Don't execute protocol … … 159 134 ; Now, remove checkin from PIMS files 2/44 160 135 N BSDXNOD S BSDXNOD=^BSDXAPPT(BSDXAPPTID,0) 161 N BSDXPATID S BSDXPATID=$P(BSDXNOD,U,5) 162 N BSDXSTART S BSDXSTART=$P(BSDXNOD,U) 136 N BSDXPATID S BSDXPATID=$P(BSDXNOD,U,5) ; DFN 137 N BSDXSTART S BSDXSTART=$P(BSDXNOD,U) ; Start Date 163 138 N BSDXSC1 S BSDXSC1=$P(BSDXNOD,U,7) ; Resource ID 164 139 ; … … 225 200 ERROR ; 226 201 S $ETRAP="D ^%ZTER HALT" ; Emergency Error Trap for the wise 227 228 229 230 231 232 D ERR("- 20~Mumps Error")202 ; Rollback, otherwise ^XTER will be empty from future rollback 203 I $TL>0 TROLLBACK 204 D ^%ZTER 205 S $EC="" ; Clear Error 206 ; Log error message and send to client 207 D ERR("-100~Mumps Error") 233 208 Q 234 209 ; -
Scheduling/trunk/m/BSDXUT.m
r1462 r1463 1 BSDXUT ; VEN/SMH - Unit Tests for Scheduling GUI ; 6/2 7/12 4:18pm1 BSDXUT ; VEN/SMH - Unit Tests for Scheduling GUI ; 6/28/12 10:14am 2 2 ;;1.7T1;BSDX;;Aug 31, 2011;Build 18 3 3 ; Licensed under LGPL … … 239 239 QUIT 240 240 ; 241 UT08 ; Unit Tests for BSDX08; Must have patients 1,2,3,4,5 defined in system242 N RESNAM S RESNAM="UTCLINIC"243 N HLRESIENS ; holds output of UTCR^BSDXUT - HL IEN^Resource IEN244 D245 . N $ET S $ET="D ^%ZTER B"246 . S HLRESIENS=$$UTCR^BSDXUT(RESNAM)247 . I HLRESIENS<0 S $EC=",U1," ; not supposed to happen - hard crash if so248 ;249 N HLIEN,RESIEN250 S HLIEN=$P(HLRESIENS,U)251 S RESIEN=$P(HLRESIENS,U,2)252 ;253 ; Get start and end times254 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time255 N APPTTIME S APPTTIME=$P(TIMES,U)256 N ENDTIME S ENDTIME=$P(TIMES,U,2)257 ;258 ; Test 1: Make normal appointment and cancel it. See if every thing works259 N ZZZ,DFN260 S DFN=3261 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1)262 S APPID=+$P(^BSDXTMP($J,1),U)263 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Sam's Cancel Note")264 I $P(^BSDXAPPT(APPID,0),U,12)'>0 W "Error in Cancellation-1",!265 I $O(^SC(HLIEN,"S",APPTTIME,1,0))]"" W "Error in Cancellation-2",!266 I $P(^DPT(DFN,"S",APPTTIME,0),U,2)'="PC" W "Error in Cancellation-3",!267 I ^DPT(DFN,"S",APPTTIME,"R")'="Sam's Cancel Note" W "Error in Cancellation-4",!268 ;269 ; Test 2: Check for -1 -- TODO: Fix later... Can't do right now automatically270 ; Make appt271 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1)272 ; Lock the node in another job273 S APPID=+$P(^BSDXTMP($J,1),U)274 ; W "Lock ^BSDXAPPT("_APPID_") in another session. You have 10 seconds." H 10275 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Sam's Cancel Note")276 ;277 ; Test 3: Check for -100278 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time279 N APPTTIME S APPTTIME=$P(TIMES,U)280 N ENDTIME S ENDTIME=$P(TIMES,U,2)281 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1)282 S APPID=+$P(^BSDXTMP($J,1),U)283 N BSDXDIE1 S BSDXDIE1=1284 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Reasons")285 I $P(^BSDXTMP($J,1),"~")'=-100 W "Error in -100",!286 K BSDXDIE1287 ;288 ; Test 3.5: Check for -100 with an appointment to rollback.289 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time290 N APPTTIME S APPTTIME=$P(TIMES,U)291 N ENDTIME S ENDTIME=$P(TIMES,U,2)292 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1)293 S APPID=+$P(^BSDXTMP($J,1),U)294 N BSDXDIE2 S BSDXDIE2=1295 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Reasons")296 I $P(^BSDXTMP($J,1),"~")'=-100 W "Error in -100-1",!297 I $P(^BSDXAPPT(APPID,0),U,12)'="" W "Error in -100-2",!298 K BSDXDIE2299 ; Test 4: Restartable transaction -- retired in V 1.7300 ; Test 5: for invalid Appointment ID (-2 and -3)301 D APPDEL^BSDX08(.ZZZ,0,"PC",1,"Reasons")302 I $P(^BSDXTMP($J,1),"~")'=-2 W "Error in -2",!303 D APPDEL^BSDX08(.ZZZ,999999,"PC",1,"Reasons")304 I $P(^BSDXTMP($J,1),"~")'=-3 W "Error in -3",!305 ; More unit Tests306 ;307 ; Test 6: for Cancelling walkin and checked-in appointments308 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time309 N APPTTIME S APPTTIME=$P(TIMES,U)310 N ENDTIME S ENDTIME=$P(TIMES,U,2)311 S DFN=4312 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,10,"Sam's Note",1) ; Add appt313 S APPID=+$P(^BSDXTMP($J,1),U)314 I APPID=0 W "Error in test 6",!315 D CHECKIN^BSDX25(.ZZZ,APPID,$$NOW^XLFDT) ; check-in316 D APPDEL^BSDX08(.ZZZ,APPID,"PC",10,"Cancel Note") ; Delete appt317 I $P(^BSDXTMP($J,1),$C(30))'="" W "Error in test 6",!318 ;319 ; Test 7: for cancelling walkin and checked-in appointments320 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time321 N APPTTIME S APPTTIME=$P(TIMES,U)322 N ENDTIME S ENDTIME=$P(TIMES,U,2)323 S DFN=4324 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,10,"Sam's Note",1) ; Add appt325 S APPID=+$P(^BSDXTMP($J,1),U)326 I APPID=0 W "Error in test 6",!327 D CHECKIN^BSDX25(.ZZZ,APPID,$$NOW^XLFDT) ; Checkin328 S BSDXRESULT=$$RMCI^BSDXAPI(DFN,HLIEN,APPTTIME) ; remove checkin329 D APPDEL^BSDX08(.ZZZ,APPID,"PC",10,"Cancel Note") ; delete appt330 I $P(^BSDXTMP($J,1),$C(30))'="" W "Error in test 6",!331 ;332 ; Unlinked Clinic Tests333 N RESNAM S RESNAM="UTCLINICUL" ; Unlinked Clinic334 N RESIEN335 D336 . N $ET S $ET="D ^%ZTER B"337 . S RESIEN=$$UTCRRES^BSDXUT(RESNAM)338 . I RESIEN<0 S $EC=",U1," ; not supposed to happen - hard crash if so339 ;340 ; Get start and end times341 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time342 N APPTTIME S APPTTIME=$P(TIMES,U)343 N ENDTIME S ENDTIME=$P(TIMES,U,2)344 ;345 ; Test 1: Make normal appointment and cancel it. See if every thing works346 N ZZZ,DFN347 S DFN=3348 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1)349 S APPID=+$P(^BSDXTMP($J,1),U)350 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Sam's Cancel Note")351 I $P(^BSDXAPPT(APPID,0),U,12)'>0 W "Error in Cancellation-1"352 ;353 ; Test 6: for Cancelling walkin and checked-in appointments354 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time355 N APPTTIME S APPTTIME=$P(TIMES,U)356 N ENDTIME S ENDTIME=$P(TIMES,U,2)357 S DFN=4358 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,10,"Sam's Note",1) ; Add appt359 S APPID=+$P(^BSDXTMP($J,1),U)360 I APPID=0 W "Error in test 6",!361 D CHECKIN^BSDX25(.ZZZ,APPID,$$NOW^XLFDT) ; check-in362 D APPDEL^BSDX08(.ZZZ,APPID,"PC",10,"Cancel Note") ; Delete appt363 I $P(^BSDXTMP($J,1),$C(30))'="" W "Error in test 6",!364 ;365 ; Test 7: for cancelling walkin and checked-in appointments366 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time367 N APPTTIME S APPTTIME=$P(TIMES,U)368 N ENDTIME S ENDTIME=$P(TIMES,U,2)369 S DFN=5370 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,10,"Sam's Note",1) ; Add appt371 S APPID=+$P(^BSDXTMP($J,1),U)372 I APPID=0 W "Error in test 6",!373 D CHECKIN^BSDX25(.ZZZ,APPID,$$NOW^XLFDT) ; Checkin374 S BSDXRESULT=$$RMCI^BSDXAPI(DFN,HLIEN,APPTTIME) ; remove checkin375 D APPDEL^BSDX08(.ZZZ,APPID,"PC",10,"Cancel Note") ; delete appt376 I $P(^BSDXTMP($J,1),$C(30))'="" W "Error in test 6",!377 QUIT378 ;379 241 UTCR(RESNAM) ; $$ - Create Unit Test Clinic and Resource Pair ; Private 380 242 ; Input: Resource Name By Value -
Scheduling/trunk/m/BSDXUT1.m
r1462 r1463 1 BSDXUT1 ; VEN/SMH - Unit Tests for Scheduling GUI - cont. ; 6/2 7/12 4:59pm1 BSDXUT1 ; VEN/SMH - Unit Tests for Scheduling GUI - cont. ; 6/28/12 10:17am 2 2 ;;1.7T1;BSDX;;Aug 31, 2011;Build 18 3 3 ; 4 ; 5 UT08 ; Unit Tests for BSDX08; Must have patients 1,2,3,4,5 defined in system 6 N RESNAM S RESNAM="UTCLINIC" 7 N HLRESIENS ; holds output of UTCR^BSDXUT - HL IEN^Resource IEN 8 D 9 . N $ET S $ET="D ^%ZTER B" 10 . S HLRESIENS=$$UTCR^BSDXUT(RESNAM) 11 . I HLRESIENS<0 S $EC=",U1," ; not supposed to happen - hard crash if so 12 ; 13 N HLIEN,RESIEN 14 S HLIEN=$P(HLRESIENS,U) 15 S RESIEN=$P(HLRESIENS,U,2) 16 ; 17 ; Get start and end times 18 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time 19 N APPTTIME S APPTTIME=$P(TIMES,U) 20 N ENDTIME S ENDTIME=$P(TIMES,U,2) 21 ; 22 ; Test 1: Make normal appointment and cancel it. See if every thing works 23 N ZZZ,DFN 24 S DFN=3 25 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1) 26 S APPID=+$P(^BSDXTMP($J,1),U) 27 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Sam's Cancel Note") 28 I $P(^BSDXAPPT(APPID,0),U,12)'>0 W "Error in Cancellation-1",! 29 I $O(^SC(HLIEN,"S",APPTTIME,1,0))]"" W "Error in Cancellation-2",! 30 I $P(^DPT(DFN,"S",APPTTIME,0),U,2)'="PC" W "Error in Cancellation-3",! 31 I ^DPT(DFN,"S",APPTTIME,"R")'="Sam's Cancel Note" W "Error in Cancellation-4",! 32 ; 33 ; Test 2: Check for -1 -- TODO: Fix later... Can't do right now automatically 34 ; Make appt 35 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1) 36 ; Lock the node in another job 37 S APPID=+$P(^BSDXTMP($J,1),U) 38 ; W "Lock ^BSDXAPPT("_APPID_") in another session. You have 10 seconds." H 10 39 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Sam's Cancel Note") 40 ; 41 ; Test 3: Check for -100 42 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time 43 N APPTTIME S APPTTIME=$P(TIMES,U) 44 N ENDTIME S ENDTIME=$P(TIMES,U,2) 45 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1) 46 S APPID=+$P(^BSDXTMP($J,1),U) 47 N BSDXDIE1 S BSDXDIE1=1 48 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Reasons") 49 I $P(^BSDXTMP($J,1),"~")'=-100 W "Error in -100",! 50 K BSDXDIE1 51 ; 52 ; Test 3.5: Check for -100 with an appointment to rollback. 53 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time 54 N APPTTIME S APPTTIME=$P(TIMES,U) 55 N ENDTIME S ENDTIME=$P(TIMES,U,2) 56 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1) 57 S APPID=+$P(^BSDXTMP($J,1),U) 58 N BSDXDIE2 S BSDXDIE2=1 59 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Reasons") 60 I $P(^BSDXTMP($J,1),"~")'=-100 W "Error in -100-1",! 61 I $P(^BSDXAPPT(APPID,0),U,12)'="" W "Error in -100-2",! 62 K BSDXDIE2 63 ; Test 4: Restartable transaction -- retired in V 1.7 64 ; Test 5: for invalid Appointment ID (-2 and -3) 65 D APPDEL^BSDX08(.ZZZ,0,"PC",1,"Reasons") 66 I $P(^BSDXTMP($J,1),"~")'=-2 W "Error in -2",! 67 D APPDEL^BSDX08(.ZZZ,999999,"PC",1,"Reasons") 68 I $P(^BSDXTMP($J,1),"~")'=-3 W "Error in -3",! 69 ; More unit Tests 70 ; 71 ; Test 6: for Cancelling walkin and checked-in appointments 72 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time 73 N APPTTIME S APPTTIME=$P(TIMES,U) 74 N ENDTIME S ENDTIME=$P(TIMES,U,2) 75 S DFN=4 76 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,10,"Sam's Note",1) ; Add appt 77 S APPID=+$P(^BSDXTMP($J,1),U) 78 I APPID=0 W "Error in test 6",! 79 D CHECKIN^BSDX25(.ZZZ,APPID,$$NOW^XLFDT) ; check-in 80 D APPDEL^BSDX08(.ZZZ,APPID,"PC",10,"Cancel Note") ; Delete appt 81 I $P(^BSDXTMP($J,1),$C(30))'="" W "Error in test 6",! 82 ; 83 ; Test 7: for cancelling walkin and checked-in appointments 84 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time 85 N APPTTIME S APPTTIME=$P(TIMES,U) 86 N ENDTIME S ENDTIME=$P(TIMES,U,2) 87 S DFN=4 88 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,10,"Sam's Note",1) ; Add appt 89 S APPID=+$P(^BSDXTMP($J,1),U) 90 I APPID=0 W "Error in test 6",! 91 D CHECKIN^BSDX25(.ZZZ,APPID,$$NOW^XLFDT) ; Checkin 92 S BSDXRESULT=$$RMCI^BSDXAPI(DFN,HLIEN,APPTTIME) ; remove checkin 93 D APPDEL^BSDX08(.ZZZ,APPID,"PC",10,"Cancel Note") ; delete appt 94 I $P(^BSDXTMP($J,1),$C(30))'="" W "Error in test 6",! 95 ; 96 ; Unlinked Clinic Tests 97 N RESNAM S RESNAM="UTCLINICUL" ; Unlinked Clinic 98 N RESIEN 99 D 100 . N $ET S $ET="D ^%ZTER B" 101 . S RESIEN=$$UTCRRES^BSDXUT(RESNAM) 102 . I RESIEN<0 S $EC=",U1," ; not supposed to happen - hard crash if so 103 ; 104 ; Get start and end times 105 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time 106 N APPTTIME S APPTTIME=$P(TIMES,U) 107 N ENDTIME S ENDTIME=$P(TIMES,U,2) 108 ; 109 ; Test 1: Make normal appointment and cancel it. See if every thing works 110 N ZZZ,DFN 111 S DFN=3 112 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,30,"Sam's Note",1) 113 S APPID=+$P(^BSDXTMP($J,1),U) 114 D APPDEL^BSDX08(.ZZZ,APPID,"PC",1,"Sam's Cancel Note") 115 I $P(^BSDXAPPT(APPID,0),U,12)'>0 W "Error in Cancellation-1" 116 ; 117 ; Test 6: for Cancelling walkin and checked-in appointments 118 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time 119 N APPTTIME S APPTTIME=$P(TIMES,U) 120 N ENDTIME S ENDTIME=$P(TIMES,U,2) 121 S DFN=4 122 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,10,"Sam's Note",1) ; Add appt 123 S APPID=+$P(^BSDXTMP($J,1),U) 124 I APPID=0 W "Error in test 6",! 125 D CHECKIN^BSDX25(.ZZZ,APPID,$$NOW^XLFDT) ; check-in 126 D APPDEL^BSDX08(.ZZZ,APPID,"PC",10,"Cancel Note") ; Delete appt 127 I $P(^BSDXTMP($J,1),$C(30))'="" W "Error in test 6",! 128 ; 129 ; Test 7: for cancelling walkin and checked-in appointments 130 N TIMES S TIMES=$$TIMES^BSDXUT ; appt time^end time 131 N APPTTIME S APPTTIME=$P(TIMES,U) 132 N ENDTIME S ENDTIME=$P(TIMES,U,2) 133 S DFN=5 134 D APPADD^BSDX07(.ZZZ,APPTTIME,ENDTIME,DFN,RESNAM,10,"Sam's Note",1) ; Add appt 135 S APPID=+$P(^BSDXTMP($J,1),U) 136 I APPID=0 W "Error in test 6",! 137 D CHECKIN^BSDX25(.ZZZ,APPID,$$NOW^XLFDT) ; Checkin 138 S BSDXRESULT=$$RMCI^BSDXAPI(DFN,HLIEN,APPTTIME) ; remove checkin 139 D APPDEL^BSDX08(.ZZZ,APPID,"PC",10,"Cancel Note") ; delete appt 140 I $P(^BSDXTMP($J,1),$C(30))'="" W "Error in test 6",! 141 QUIT 4 142 ; 5 143 UT29 ; Unit Test for BSDX29
Note:
See TracChangeset
for help on using the changeset viewer.