Changeset 1479 for Scheduling/trunk
- Timestamp:
- Jul 9, 2012, 7:43:46 PM (12 years ago)
- Location:
- Scheduling/trunk/m
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX07.m
r1472 r1479 1 BSDX07 ; VW/UJO/SMH - WINDOWS SCHEDULING RPCS ; 7/ 5/12 12:57pm1 BSDX07 ; VW/UJO/SMH - WINDOWS SCHEDULING RPCS ; 7/9/12 4:02pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; Licensed under LGPL … … 32 32 Q 33 33 ; 34 APPADD(BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID,BSDXRADEXAM) ; EP34 APPADD(BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID,BSDXRADEXAM) ;Private EP 35 35 ; 36 36 ;Called by RPC: BSDX ADD NEW APPOINTMENT … … 58 58 ; AppointmentID and ErrorNumber 59 59 ; 60 ; NB: Specifying BSDXLEN and BSDXEND is redundant. For future programmers60 ; TODO: Specifying BSDXLEN and BSDXEND is redundant. For future programmers 61 61 ; to sort out. Needs changes on client. 62 62 ; … … 66 66 ; Deal with optional arguments 67 67 S BSDXRADEXAM=$G(BSDXRADEXAM) 68 68 ; 69 69 ; Return Array; set Return and clear array 70 70 S BSDXY=$NA(^BSDXTMP($J)) 71 71 K ^BSDXTMP($J) 72 72 ; 73 73 ; $ET 74 74 N $ET S $ET="G ETRAP^BSDX07" … … 80 80 ; It's not expected that the error will ever happen as no filing 81 81 ; is supposed to take 5 seconds. 82 L +^BSDX APPT(BSDXPATID):5 I '$T D ERR(BSDXI,"-1~Patient record is locked. Please contact technical support.") Q82 L +^BSDXPAT(BSDXPATID):5 I '$T D ERR(BSDXI,"-1~Patient record is locked. Please contact technical support.") Q 83 83 ; 84 84 ; Header Node … … 92 92 N BSDXERR S BSDXERR=0 93 93 ; 94 ;;;test for error inside transaction. See if %ZTER works95 I $G(BSDXDIE) S X=1/094 ;;;test for error. See if %ZTER works 95 I $G(BSDXDIE) N X S X=1/0 96 96 ;;;test 97 97 ; … … 132 132 ; Now, check if PIMS has any issues with us making the appt using MAKECK 133 133 N BSDXSCD S BSDXSCD=$P(BSDXRNOD,U,4) ; Hosp Location IEN 134 N BSDXERR ; Variable to hold value of $$MAKE and $$MAKECK134 N BSDXERR S BSDXERR=0 ; Variable to hold value of $$MAKE and $$MAKECK 135 135 N BSDXC ; Array to send to MAKE and MAKECK APIs 136 136 ; Only if we have a valid Hosp Location 137 I +BSDXSCD,$D(^SC(BSDXSCD,0)) D I +BSDXERR D ERR(BSDXI,"-10~BSDX07 Error: MAKECK^BSDXAPI returned error code: "_BSDXERR) Q ; no need for roll back137 I +BSDXSCD,$D(^SC(BSDXSCD,0)) D 138 138 . S BSDXC("PAT")=BSDXPATID 139 139 . S BSDXC("CLN")=BSDXSCD … … 147 147 . S BSDXC("USR")=DUZ 148 148 . S BSDXERR=$$MAKECK^BSDXAPI(.BSDXC) 149 I BSDXERR D ERR(BSDXI,"-10~BSDX07 Error: MAKECK^BSDXAPI returned error code: "_BSDXERR) Q ; no need for roll back 149 150 ; 150 151 ; Done with all checks, let's make appointment in BSDX APPOINTMENT … … 160 161 ; Only if we have a valid Hosp Loc can we make an appointment in 2/44 161 162 ; Use BSDXC array from before. 162 ; NB: $$MAKE itself calls $$MAKECK to check again for being okay. 163 I +BSDXSCD,$D(^SC(BSDXSCD,0)) D I +BSDXERR D ERR(BSDXI,"-10~BSDX07 Error: MAKE^BSDXAPI returned error code: "_BSDXERR),ROLLBACK(BSDXAPPTID,.BSDXC) Q 164 . S BSDXERR=$$MAKE^BSDXAPI(.BSDXC) 163 ; FYI: $$MAKE itself calls $$MAKECK to check again for being okay. 164 ; If an error happens here, we roll back both ^BSDXAPPT and 2/44 by deleting 165 N BSDXERR S BSDXERR=0 ; Variable to hold value of $$MAKE and $$MAKECK 166 I +BSDXSCD,$D(^SC(BSDXSCD,0)) S BSDXERR=$$MAKE^BSDXAPI(.BSDXC) 167 I BSDXERR D ERR(BSDXI,"-10~BSDX07 Error: MAKE^BSDXAPI returned error code: "_BSDXERR),ROLLBACK(BSDXAPPTID,.BSDXC) Q 168 ; 169 ; Unlock 170 L -^BSDXPAT(BSDXPATID) 165 171 ; 166 172 ;Return Recordset 167 L -^BSDXAPPT(BSDXPATID)168 173 S BSDXI=BSDXI+1 169 174 S ^BSDXTMP($J,BSDXI)=BSDXAPPTID_"^"_$C(30) … … 179 184 ;Returns ien in BSDXAPPT or 0 if failed 180 185 ;Create entry in BSDX APPOINTMENT 181 N BSDXAPPTID 186 N BSDXAPPTID,BSDXFDA 182 187 S BSDXFDA(9002018.4,"+1,",.01)=BSDXSTART 183 188 S BSDXFDA(9002018.4,"+1,",.02)=BSDXEND … … 208 213 ;BSDXSCDA=IEN for ^SC(BSDXSC,"S",BSDXSTART,1,BSDXSCDA). Use to get Length & Note 209 214 ; 210 N BSDXNOD,BSDXLEN,BSDXAPPTID,BSDXNODP,BSDXWKIN,BSDXRES 215 N BSDXNOD,BSDXLEN,BSDXAPPTID,BSDXNODP,BSDXWKIN,BSDXRES,BSDXNOTE,BSDXEND 211 216 Q:+$G(BSDXNOEV) 212 217 I $D(^BSDXRES("ALOC",BSDXSC)) S BSDXRES=$O(^BSDXRES("ALOC",BSDXSC,0)) … … 243 248 ; Appointment ID to remove from ^BSDXAPPT 244 249 ; BSDXC array (see array format in $$MAKE^BSDXAPI) 245 ; NB: I am not sure whether I want to do $G to protect against undefs? 246 ; I send the variables to this EP from the Symbol Table in ETRAP 250 N % 247 251 D BSDXDEL^BSDX07(BSDXAPPTID) 248 252 S:$D(BSDXC) %=$$UNMAKE^BSDXAPI(.BSDXC) ; rtn value always 0 … … 257 261 ; 258 262 ERR(BSDXI,BSDXERR) ;Error processing - different from error trap. 263 ; Unlock first 264 L -^BSDXPAT(BSDXPATID) 265 ; If last line is $C(31), we are done. No more errors to send to client. 266 I ^BSDXTMP($J,$O(^BSDXTMP($J," "),-1))=$C(31) QUIT 259 267 S BSDXI=BSDXI+1 260 268 S BSDXERR=$TR(BSDXERR,"^","~") … … 262 270 S BSDXI=BSDXI+1 263 271 S ^BSDXTMP($J,BSDXI)=$C(31) 264 L -^BSDXAPPT(BSDXPATID)265 272 Q 266 273 ; … … 268 275 N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap 269 276 D ^%ZTER 270 S $EC="" ; Clear Error277 ; 271 278 I +$G(BSDXAPPTID) D ROLLBACK(BSDXAPPTID,.BSDXC) ; Rollback if BSDXAPPTID exists 279 ; 272 280 ; Log error message and send to client 273 281 I '$D(BSDXI) N BSDXI S BSDXI=0 -
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 -
Scheduling/trunk/m/BSDX25.m
r1472 r1479 1 BSDX25 ; VEN/SMH - WINDOWS SCHEDULING RPCS ; 7/ 5/12 11:55am1 BSDX25 ; VEN/SMH - WINDOWS SCHEDULING RPCS ; 7/9/12 5:00pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; Licensed under LGPL … … 41 41 ; -2 -> Invalid Check-in Date 42 42 ; -3 -> Cannot check-in due to Fileman Filer failure 43 ; -4 -> Cannot lock ^BSDXAPPT(APPTID) 43 44 ; -10 -> BSDXAPI error 44 45 ; -100 -> Mumps Error … … 66 67 I '+BSDXAPPTID D ERR("-1~Invalid Appointment ID") QUIT 67 68 I '$D(^BSDXAPPT(BSDXAPPTID,0)) D ERR("-1~Invalid Appointment ID") QUIT 69 ; 70 ; Lock BSDX node, only to synchronize access to the globals. 71 ; It's not expected that the error will ever happen as no filing 72 ; is supposed to take 5 seconds. 73 L +^BSDXAPPT(BSDXAPPTID):5 E D ERR("-4~Appt record is locked. Please contact technical support.") QUIT 68 74 ; 69 75 ; Remove Date formatting v.1.5. Client will send date as FM Date. … … 101 107 . D ERR(-10_"~"_$P(BSDXERR,U,2)) ; Send error message to client 102 108 ; 109 L -^BSDXAPPT(BSDXAPPTID) 103 110 S BSDXI=BSDXI+1 104 111 S ^BSDXTMP($J,BSDXI)="0"_$C(30) … … 124 131 Q 0 125 132 ; 126 RMCI(BSDXY,BSDXAPPTID) ; EP - Remove Check-in from BSDX APPT and 2/44133 RMCI(BSDXY,BSDXAPPTID) ; Private EP - Remove Check-in from BSDX APPT and 2/44 127 134 ; Called by RPC BSDX REMOVE CHECK-IN 128 135 ; … … 163 170 I '$D(^BSDXAPPT(BSDXAPPTID,0)) D ERR("-2~Invalid Appointment ID") QUIT 164 171 ; 172 ; Lock 173 ; Timeout not expected to happen except in error conditions. 174 L +^BSDXAPPT(BSDXAPPTID):5 E D ERR("-7~Appt record is locked. Please contact technical support.") QUIT 175 ; 165 176 ; Get appointment Data 166 177 N BSDXNOD S BSDXNOD=^BSDXAPPT(BSDXAPPTID,0) … … 199 210 . N % S %=$$BSDXCHK(BSDXAPPTID,BSDXCDT) ; No error checking here. 200 211 . D ERR("-5~"_$P(BSDXERR,U,2)) ; Send error message to client 201 ; 212 ; 213 ; Unlock 214 L -^BSDXAPPT(BSDXAPPTID) 215 ; 202 216 ; Return ADO recordset 203 217 S BSDXI=BSDXI+1 … … 264 278 ; 265 279 ERR(BSDXERR) ;Error processing 280 ; Unlock first 281 L:$D(BSDXAPPTID) -^BSDXAPPT(BSDXAPPTID) 266 282 ; If last line is $C(31), we are done. No more errors to send to client. 267 283 I ^BSDXTMP($J,$O(^BSDXTMP($J," "),-1))=$C(31) QUIT -
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 -
Scheduling/trunk/m/BSDX29.m
r1472 r1479 1 BSDX29 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 6/22/12 1:46pm1 BSDX29 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/9/12 11:50am 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; Licensed under LGPL … … 102 102 N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap 103 103 D ^%ZTER 104 S $EC="" ; Clear Error105 104 QUIT 106 105 ; … … 153 152 ; 154 153 ERR(BSDXI,BSDXCNT,BSDXERR) ;Error processing 154 ; If last line is $C(31), we are done. No more errors to send to client. 155 I ^BSDXTMP($J,$O(^BSDXTMP($J," "),-1))=$C(31) QUIT 155 156 S BSDXI=BSDXI+1 156 157 S BSDXERR=$TR(BSDXERR,"^","~") -
Scheduling/trunk/m/BSDX31.m
r1472 r1479 1 BSDX31 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 6/27/12 4:57pm1 BSDX31 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/9/12 12:57pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; Licensed under LGPL … … 20 20 ; -5: Filing of No-show in ^DPT failed (BSDXAPI error) 21 21 ; -6: Invalid Resource ID 22 ; -7: Lock not acquired on ^BSDXAPPT(BSDXAPTID) 22 23 ; -100: M Error 23 24 ; … … 70 71 I '$D(^BSDXAPPT(BSDXAPTID,0)) D ERR(-2,"BSDX31: Invalid Appointment ID") Q 71 72 ; 73 ; Lock BSDX node, only to synchronize access to the globals. 74 ; It's not expected that the error will ever happen as no filing 75 ; is supposed to take 5 seconds. 76 L +^BSDXAPPT(BSDXAPTID):5 E D ERR(-7,"BSDX31: Appt record is locked. Please contact technical support.") Q 77 ; 72 78 ; Noshow value check - Must be 1 or 0 73 79 S BSDXNS=+BSDXNS … … 113 119 . D ERR(-5,"BSDX31: "_$P(BSDXERR,U,2)) 114 120 . N % S %=$$BSDXNOS(BSDXAPTID,'BSDXNS) ; no error checking for filer 121 ; 122 ; Unlock 123 L -^BSDXAPPT(BSDXAPTID) 115 124 ; 116 125 ; Return data in ADO.net table … … 177 186 ; 178 187 ERR(BSDXERID,ERRTXT) ;Error processing 188 ; Unlock first 189 L:$D(BSDXAPTID) -^BSDXAPPT(BSDXAPTID) 179 190 ; If last line is $C(31), we are done. No more errors to send to client. 180 191 I ^BSDXTMP($J,$O(^BSDXTMP($J," "),-1))=$C(31) QUIT … … 189 200 N $ET S $ET="D ^%ZTER HALT" ; Emergency Error Trap 190 201 D ^%ZTER 191 S $EC="" ; Clear Error202 ; 192 203 I $G(BSDXAPTID),$D(BSDXNS) N % S %=$$BSDXNOS(BSDXAPTID,'BSDXNS) ; Reverse No-Show status (whatever it was) 193 204 ; Send to client -
Scheduling/trunk/m/BSDXAPI.m
r1472 r1479 1 BSDXAPI ; IHS/LJF,HMW,MAW & VEN/SMH - SCHEDULING APIs ; 7/ 6/12 10:24am1 BSDXAPI ; IHS/LJF,HMW,MAW & VEN/SMH - SCHEDULING APIs ; 7/9/12 4:00pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; Licensed under LGPL … … 155 155 ; If previous data exists, which caused an error, it's destroyed. 156 156 ; NB: ^DIK stops for nobody 157 ; TODO: If Patient Appointment previously existed as cancelled, it's removed. 158 ; How can I tell if one previously existed when data is in an intermediate 159 ; State? Can I restore it if the other file failed? Restoration can cause 160 ; another error. If I restore the global, there will be cross-references 161 ; missing (ASDCN specifically). 162 ; 157 163 ; Input: Same array as $$MAKE 158 164 ; Output: Always 0 … … 422 428 Q $S(X=3:"SCHED",X=4:"WALK-IN",1:"??") 423 429 ; 424 UPDATENT(PAT,CLINIC,DATE,NOTE) ; PEP; Update Note in ^SC for patient's appointment @ DATE425 ; PAT = DFN426 ; CLINIC = SC IEN427 ; DATE = FM Date/Time of Appointment428 ;429 ; Returns:430 ; 0 if okay431 ; -1 if failure432 ;433 ; ERROR SIMULATION434 I $G(BSDXSIMERR1) QUIT "-1~Simulated Error"435 ;436 N SCIEN S SCIEN=$$SCIEN(PAT,CLINIC,DATE) ; ien of appt in ^SC437 I SCIEN<1 QUIT 0 ; Appt cancelled; cancelled appts rm'ed from file 44438 N BSDXIENS S BSDXIENS=SCIEN_","_DATE_","_CLINIC_","439 N BSDXFDA S BSDXFDA(44.003,BSDXIENS,3)=$E(NOTE,1,150)440 N BSDXERR441 D FILE^DIE("","BSDXFDA","BSDXERR")442 I $D(BSDXERR) QUIT "-1~Can't file for Pat "_PAT_" in Clinic "_CLINIC_" at "_DATE_". Fileman reported an error: "_BSDXERR("DIERR",1,"TEXT",1)443 QUIT 0 -
Scheduling/trunk/m/BSDXAPI1.m
r1472 r1479 1 BSDXAPI1 ; VEN/SMH - SCHEDULING APIs - Continued!!! ; 7/ 6/12 10:23am1 BSDXAPI1 ; VEN/SMH - SCHEDULING APIs - Continued!!! ; 7/9/12 2:22pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; Licensed under LGPL … … 49 49 ; belong to PIMS, not to the Scheduling GUI. $$MAKE and $$CANCEL now 50 50 ; call the EPs here. 51 ; Cancel and Remove-Check-in now check to see if the patient is checked-out 52 ; If the patient is checked out, then we fail to cancel/no-show. 53 ; UPDATENOTE was renamed to UPDATENT and moved to BSDXAPI1. 51 54 ; 52 55 NOSHOW(PAT,CLINIC,DATE,NSFLAG) ; $$ PEP; No-show Patient at appt date (new in v1.7) -
Scheduling/trunk/m/BSDXUT1.m
r1472 r1479 1 BSDXUT1 ; VEN/SMH - Unit Tests for Scheduling GUI - cont. ; 7/ 3/12 12:28pm1 BSDXUT1 ; VEN/SMH - Unit Tests for Scheduling GUI - cont. ; 7/9/12 12:31pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; … … 266 266 N NOTE S NOTE="Nothing important" 267 267 D EDITAPT^BSDX26(.ZZZ,"BLAHBLAH",NOTE) 268 I +^BSDXTMP($J,1)'= -1 W "ERROR IN -1",!268 I +^BSDXTMP($J,1)'=1 W "ERROR IN -1",! 269 269 ; 270 270 ; Test 3: Test Error -2 271 271 ; -2 --> ApptID not in ^BSDXAPPT 272 272 D EDITAPT^BSDX26(.ZZZ,298734322,NOTE) 273 I +^BSDXTMP($J,1)'= -2 W "ERROR IN -2",!273 I +^BSDXTMP($J,1)'=2 W "ERROR IN -2",! 274 274 ; 275 275 ; Test 4: M Error 276 276 N BSDXDIE S BSDXDIE=1 277 277 D EDITAPT^BSDX26(.ZZZ,188,NOTE) 278 I +^BSDXTMP($J,1)'= -100 W "ERROR IN -100",!278 I +^BSDXTMP($J,1)'=100 W "ERROR IN -100",! 279 279 K BSDXDIE 280 280 ; Test 5: Trestart -- retired in v1.7 … … 334 334 N NOTE S NOTE="New Note "_%H 335 335 D EDITAPT^BSDX26(.ZZZ,APPID,NOTE) 336 I +^BSDXTMP($J,1)'= -4 W "Simulated error not triggered",!336 I +^BSDXTMP($J,1)'=4 W "Simulated error not triggered",! 337 337 I ^BSDXAPPT(APPID,1,1,0)'=ORIGNOTE W "ERROR 3",! 338 338 I $P(^SC(HLIEN,"S",APPTTIME,1,1,0),U,4)'=ORIGNOTE W "ERROR 4",! -
Scheduling/trunk/m/BSDXUT2.m
r1472 r1479 1 BSDXUT2 ; VEN/SMH - Unit Tests for Scheduling GUI - cont. ; 7/ 5/12 11:39am1 BSDXUT2 ; VEN/SMH - Unit Tests for Scheduling GUI - cont. ; 7/9/12 3:18pm 2 2 ;;1.7T1;BSDX;;Jul 06, 2012;Build 18 3 3 ; 4 4 EN ; Run all unit tests in this routine 5 D UT25 5 D UT25,PIMS 6 6 QUIT 7 7 ; … … 177 177 IF +^BSDXTMP($J,1)'=-100 WRITE "ERROR IN Etest 7",! 178 178 K BSDXDIE 179 ; 180 ; Tests for running PIMS by itself. 179 QUIT 180 ; 181 PIMS ; Tests for running PIMS by itself. 182 N $ET S $ET="W ""An Error Occured. Breaking."",! BREAK" 183 N RESNAM S RESNAM="UTCLINIC" 184 N HLRESIENS ; holds output of UTCR^BSDXUT - HL IEN^Resource IEN 185 D 186 . N $ET S $ET="D ^%ZTER B" 187 . S HLRESIENS=$$UTCR^BSDXUT(RESNAM) 188 . I HLRESIENS<0 S $EC=",U1," ; not supposed to happen - hard crash if so 189 ; 190 N HLIEN,RESIEN 191 S HLIEN=$P(HLRESIENS,U) 192 S RESIEN=$P(HLRESIENS,U,2) 193 ; 194 ; 181 195 N APPTTIME S APPTTIME=$$TIMEHL^BSDXUT(HLIEN) ; appt time 182 196 N DFN S DFN=2 197 ; 198 ; TEST $$MAKE1^BSDXAPI 183 199 N % S %=$$MAKE1^BSDXAPI(DFN,HLIEN,3,APPTTIME,15,"Sam Test Appt"_DFN) 184 200 I % W "Error in $$MAKE1^BSDXAPI for TIME "_APPTTIME_" for DFN "_DFN,!,%,! 185 201 I '$D(^BSDXAPPT("APAT",DFN,APPTTIME)) W "No BSDX Appointment Created",! 186 ;TODO: Index doesn't include resource.187 N APPTID S APPTID=$O(^( APPTTIME,""))202 N RESID S RESID=$O(^(APPTTIME,"")) 203 N APPTID S APPTID=$O(^(RESID,"")) 188 204 I 'APPTID W "Can't get appointment",! 189 205 IF $P(^BSDXAPPT(APPTID,0),U,3) WRITE "ERROR IN CHECKIN 3",! 206 ; 207 ; TEST CHECKIN1 AND RMCI ^BSDXAPI[1] 190 208 N % S %=$$CHECKIN1^BSDXAPI(DFN,HLIEN,APPTTIME) ; Checkin via PIMS 191 209 I % W "Error in Checking in via BSDXAPI",! … … 200 218 IF '+$G(^SC(HLIEN,"S",APPTTIME,1,1,"C")) WRITE "ERROR IN CHECKIN 14",! 201 219 IF '$P(^BSDXAPPT(APPTID,0),U,3) WRITE "ERROR IN CHECKIN 15",! 220 ; 221 ; TEST CANCEL1^BSDXAPI 222 N APPTTIME S APPTTIME=$$TIMEHL^BSDXUT(HLIEN) ; appt time 223 N DFN S DFN=2 224 N % S %=$$MAKE1^BSDXAPI(DFN,HLIEN,3,APPTTIME,15,"Sam Test Appt"_DFN) 225 I % W "Error in $$MAKE1^BSDXAPI for TIME "_APPTTIME_" for DFN "_DFN,!,%,! 226 I '$D(^BSDXAPPT("APAT",DFN,APPTTIME)) W "No BSDX Appointment Created",! 227 N RESID S RESID=$O(^(APPTTIME,"")) 228 N APPTID S APPTID=$O(^(RESID,"")) 229 I 'APPTID W "Can't get appointment",! 230 N % S %=$$CANCEL1^BSDXAPI(DFN,HLIEN,"PC",APPTTIME,1,"Afraid of Baby Foxes") 231 I % W "Error cancelling via $$CANCEL1^BSDXAPI",! 232 I ^BSDXAPPT(APPTID,0) ; Change $R 233 I '$P(^(0),U,12) W "No cancel date found in BSDXAPPT",! 234 ; Make same appointment again! 235 ; NB: Index APAT will have two identical entries, one for the cancelled 236 ; appointment, and one for the new one. I won't check it for that reason. 237 N % S %=$$MAKE1^BSDXAPI(DFN,HLIEN,3,APPTTIME,15,"Sam Test Appt"_DFN) 238 I % W "Error in $$MAKE1^BSDXAPI for TIME "_APPTTIME_" for DFN "_DFN,!,%,! 239 ; 240 ; TEST NOSHOW^BSDXAPI1 241 N APPTTIME S APPTTIME=$$TIMEHL^BSDXUT(HLIEN) ; appt time 242 N DFN S DFN=3 243 N % S %=$$MAKE1^BSDXAPI(DFN,HLIEN,3,APPTTIME,15,"Sam Test Appt"_DFN) 244 I % W "Error in $$MAKE1^BSDXAPI for TIME "_APPTTIME_" for DFN "_DFN,!,%,! 245 I '$D(^BSDXAPPT("APAT",DFN,APPTTIME)) W "No BSDX Appointment Created",! 246 N RESID S RESID=$O(^(APPTTIME,"")) 247 N APPTID S APPTID=$O(^(RESID,"")) 248 I 'APPTID W "Can't get appointment",! 249 ; No show via PIMS 250 N % S %=$$NOSHOW^BSDXAPI1(DFN,HLIEN,APPTTIME,1) 251 I % W "Error no-showing via $$NOSHOW^BSDXAPI1",! 252 I ^BSDXAPPT(APPTID,0) ; Change $R 253 I '$P(^(0),U,10) W "No-show not present in ^BSDXAPPT",! 254 ; un-noshow via PIMS 255 N % S %=$$NOSHOW^BSDXAPI1(DFN,HLIEN,APPTTIME,0) 256 I % W "Error no-showing via $$NOSHOW^BSDXAPI1",! 257 I ^BSDXAPPT(APPTID,0) ; Change $R 258 I $P(^(0),U,10) W "No-show present in ^BSDXAPPT when it shouldn't",! 259 ; 260 ; NB: UPDATENT^BSDXAPI is updates the note. Right now, we don't have any 261 ; way to update the note from BSDXAPI back to ^BSDXAPPT as the protocol 262 ; file is currently not involved. Right now I can't even find the code 263 ; that lets you change an appointment note in PIMS. 264 ; 202 265 QUIT
Note:
See TracChangeset
for help on using the changeset viewer.