Changeset 1479 for Scheduling/trunk/m/BSDX26.m
- Timestamp:
- Jul 9, 2012, 7:43:46 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX26.m
r1472 r1479 1 BSDX26 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 6/25/12 4:29pm1 BSDX26 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/9/12 2:19pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; Licensed under LGPL … … 8 8 ; 9 9 ; Error Reference: 10 ; -1: Appt ID is not a number 11 ; -2: Appt IEN is not in ^BSDXAPPT 12 ; -3: FM Failure to file WP field in ^BSDXAPPT 13 ; -4: BSDXAPI reports failure to change note field in ^SC 10 ; 1: Appt ID is not a number 11 ; 2: Appt IEN is not in ^BSDXAPPT 12 ; 3: FM Failure to file WP field in ^BSDXAPPT 13 ; 4: BSDXAPI reports failure to change note field in ^SC 14 ; 5: Failure to acquire lock on ^BSDXAPPT(APPTID) 15 ; 100: Mumps Error 16 ; 17 ; NB: Normally I use negative numbers for errors; this routine returns 18 ; -1 as a successful result! So I needed to use +ve numbers. 14 19 ; 15 20 EDITAPTD(BSDXY,BSDXAPTID,BSDXNOTE) ;EP … … 48 53 ; 49 54 ; Validate Appointment ID 50 I '+BSDXAPTID D ERR(BSDXI,"-1~BSDX26: Invalid Appointment ID") QUIT 51 I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(BSDXI,"-2~BSDX26: Invalid Appointment ID") QUIT 55 I '+BSDXAPTID D ERR(BSDXI,"1~BSDX26: Invalid Appointment ID") QUIT 56 I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(BSDXI,"2~BSDX26: Invalid Appointment ID") QUIT 57 ; 58 ; Lock BSDX node, only to synchronize access to the globals. 59 ; It's not expected that the error will ever happen as no filing 60 ; is supposed to take 5 seconds. 61 L +^BSDXAPPT(BSDXAPTID):5 E D ERR(BSDXI,"5~BSDX08: Appt record is locked. Please contact technical support.") QUIT 52 62 ; 53 63 ; Put the WP in decendant fields from the root to file as a WP field … … 65 75 ; 66 76 ; Error handling. No need for rollback since nothing else changed. 67 I $D(BSDXMSG) D ERR(BSDXI," -3~BSDX26: Fileman failure to file data into 9002018.4") QUIT77 I $D(BSDXMSG) D ERR(BSDXI,"3~BSDX26: Fileman failure to file data into 9002018.4") QUIT 68 78 ; 69 79 ; Now file in file 44: … … 73 83 N BSDXRES S BSDXRES=0 ; Result 74 84 ; Update Note only if we have a linked hospital location. 75 I HLIEN S BSDXRES=$$UPDATENT^BSDXAPI (PTIEN,HLIEN,DATE,BSDXNOTE(.5))85 I HLIEN S BSDXRES=$$UPDATENT^BSDXAPI1(PTIEN,HLIEN,DATE,BSDXNOTE(.5)) 76 86 ; If we get an error (denoted by -1 in BSDXRES), return error to client 77 87 ; AND restore the original note 78 I BSDXRES<0 D ERR(BSDXI," -4~BSDX26: BSDXAPI reports an error: "_BSDXRES),ROLLBACK(BSDXAPTID) QUIT88 I BSDXRES<0 D ERR(BSDXI,"4~BSDX26: BSDXAPI reports an error: "_BSDXRES),ROLLBACK(BSDXAPTID) QUIT 79 89 ; 80 90 ;Return Recordset indicating success 91 L -^BSDXAPPT(BSDXAPTID) 81 92 S BSDXI=BSDXI+1 82 93 S ^BSDXTMP($J,BSDXI)="-1"_$C(30) … … 93 104 ; 94 105 ERR(BSDXI,BSDXERR) ;Error processing 106 ; Unlock first 107 L:$D(BSDXAPTID) -^BSDXAPPT(BSDXAPTID) 108 ; If last line is $C(31), we are done. No more errors to send to client. 109 I ^BSDXTMP($J,$O(^BSDXTMP($J," "),-1))=$C(31) QUIT 95 110 S BSDXI=BSDXI+1 96 111 S BSDXERR=$TR(BSDXERR,"^","~") … … 103 118 N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap 104 119 D ^%ZTER 105 S $EC=""120 ; 106 121 I '$D(BSDXI) N BSDXI S BSDXI=0 107 D ERR(BSDXI," -100~BSDX26 Error: "_$G(%ZTERZE))122 D ERR(BSDXI,"100~BSDX26 Error: "_$G(%ZTERZE)) 108 123 QUIT
Note:
See TracChangeset
for help on using the changeset viewer.