Changeset 1479 for Scheduling/trunk/m/BSDX08.m
- Timestamp:
- Jul 9, 2012, 7:43:46 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX08.m
r1472 r1479 1 BSDX08 ; VW/UJO/SMH - WINDOWS SCHEDULING RPCS ; 7/ 5/12 12:39pm1 BSDX08 ; VW/UJO/SMH - WINDOWS SCHEDULING RPCS ; 7/9/12 4:22pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; … … 37 37 Q 38 38 ; 39 APPDEL(BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT) ; EP39 APPDEL(BSDXY,BSDXAPTID,BSDXTYP,BSDXCR,BSDXNOT) ; Private EP 40 40 ;Called by RPC: BSDX CANCEL APPOINTMENT 41 41 ;Cancels existing appointment in BSDX APPOINTMENT and 44/2 subfiles … … 65 65 S ^BSDXTMP($J,BSDXI)="T00100ERRORID"_$C(30) 66 66 ; 67 ; Turn off SDAM APPT PROTOCOL BSDX Entries 68 N BSDXNOEV 69 S BSDXNOEV=1 ;Don't execute BSDX CANCEL APPOINTMENT protocol 70 ; 71 ;;;test for error inside transaction. See if %ZTER works 72 I $G(BSDXDIE1) N X S X=1/0 73 ; 74 ; Check appointment ID and whether it exists 75 I '+BSDXAPTID D ERR(BSDXI,"-2~BSDX08: Invalid Appointment ID") Q 76 I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(BSDXI,"-3~BSDX08: Invalid Appointment ID") Q 77 ; 67 78 ; Lock BSDX node, only to synchronize access to the globals. 68 79 ; It's not expected that the error will ever happen as no filing 69 80 ; is supposed to take 5 seconds. 70 L +^BSDXAPPT(BSDXAPTID):5 I '$T D ERR(BSDXI,"-1~BSDX08: Appt record is locked. Please contact technical support.") Q 71 ; 72 ; Turn off SDAM APPT PROTOCOL BSDX Entries 73 N BSDXNOEV 74 S BSDXNOEV=1 ;Don't execute BSDX CANCEL APPOINTMENT protocol 75 ; 76 ;;;test for error inside transaction. See if %ZTER works 77 I $G(BSDXDIE1) N X S X=1/0 78 ; 79 ; Check appointment ID and whether it exists 80 I '+BSDXAPTID D ERR(BSDXI,"-2~BSDX08: Invalid Appointment ID") Q 81 I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(BSDXI,"-3~BSDX08: Invalid Appointment ID") Q 82 ; 81 L +^BSDXAPPT(BSDXAPTID):5 E D ERR(BSDXI,"-1~BSDX08: Appt record is locked. Please contact technical support.") Q 82 ; 83 83 ; Start Processing: 84 84 ; First, get data … … 124 124 ; BSDXAPPT First; no need for rollback if error occured. 125 125 N BSDXERR S BSDXERR=$$BSDXCAN(BSDXAPTID) ; Add a cancellation date in BSDX APPOINTMENT 126 I BSDXERR D ERR(BSDXI," $$BSDXCAN failed (Fileman filing error): "_$P(BSDXERR,U,2)) QUIT126 I BSDXERR D ERR(BSDXI,"-10~BSDX08: $$BSDXCAN failed (Fileman filing error): "_$P(BSDXERR,U,2)) QUIT 127 127 ; 128 128 ; Then PIMS: 129 129 ; cancel appt in "S" nodes in file 2 and 44, then update Legacy PIMS Availability 130 130 ; If error happens, must rollback ^BSDXAPPT 131 I BSDXLOC D QUIT:BSDXERR 132 . S BSDXERR=$$CANCEL^BSDXAPI(.BSDXC) ; Cancel through BSDXAPI 133 . ; Rollback BSDXAPPT if error occurs 134 . I BSDXERR D ERR(BSDXI,"-9^BSDX08: BSDXAPI returned an error: "_$P(BSDXERR,U,2)),ROLLBACK(BSDXAPTID) QUIT 131 I BSDXLOC S BSDXERR=$$CANCEL^BSDXAPI(.BSDXC) ; Cancel through BSDXAPI 132 ; Rollback BSDXAPPT if error occurs 133 I BSDXERR D ERR(BSDXI,"-9^BSDX08: BSDXAPI returned an error: "_$P(BSDXERR,U,2)),ROLLBACK(BSDXAPTID) QUIT 135 134 ; 136 135 L -^BSDXAPPT(BSDXAPTID) … … 186 185 . S BSDXNOD=$G(^BSDXAPPT(BSDXAPPT,0)) Q:BSDXNOD="" 187 186 . I $P(BSDXNOD,U,5)=BSDXPAT,$P(BSDXNOD,U,12)="" S BSDXFOUND=1 Q 188 I BSDXFOUND,+$G(BSDXAPPT) D BSDXCAN(BSDXAPPT)187 I BSDXFOUND,+$G(BSDXAPPT) N % S %=$$BSDXCAN(BSDXAPPT) I % D ^%ZTER 189 188 Q BSDXFOUND 190 189 ; … … 201 200 ; 202 201 ERR(BSDXI,BSDXERR) ;Error processing 202 ; Unlock first 203 L:$D(BSDXAPTID) -^BSDXAPPT(BSDXAPTID) 203 204 ; If last line is $C(31), we are done. No more errors to send to client. 204 205 I ^BSDXTMP($J,$O(^BSDXTMP($J," "),-1))=$C(31) QUIT … … 208 209 S BSDXI=BSDXI+1 209 210 S ^BSDXTMP($J,BSDXI)=$C(31) 210 L -^BSDXAPPT(BSDXAPTID)211 211 QUIT 212 212 ; … … 214 214 N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap 215 215 D ^%ZTER 216 ; 216 217 ; Roll back BSDXAPPT; 217 218 ; NB: What if a Mumps error happens inside fileman in BSDXAPI? 218 219 ; I have decided the M errors are out of scope for me to handle. 219 220 D:$G(BSDXAPTID) ROLLBACK(BSDXAPTID) 221 ; 220 222 ; Log error message and send to client 221 223 I '$D(BSDXI) N BSDXI S BSDXI=0
Note:
See TracChangeset
for help on using the changeset viewer.