Changeset 1114 for Scheduling/trunk/m
- Timestamp:
- Mar 27, 2011, 8:51:38 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX25.m
r1113 r1114 1 BSDX25 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 3/1 5/11 8:15pm1 BSDX25 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 3/16/11 1:07am 2 2 ;;1.5V2;BSDX;;Mar 03, 2011 3 ; 4 ; Change Log: 5 ; 3110106: SMH -> Changed Check-in EP - Removed unused paramters. Will change C# 6 ; 7 ; 3 ; 4 ; Change Log: 5 ; 3110106: SMH -> Changed Check-in EP - Removed unused paramters. Will change C# 6 ; 7 ; 8 UT ; Unit Tests 9 ; Make appointment, checkin, then uncheckin 10 N ZZZ 11 N APPTTIME S APPTTIME=$E($$NOW^XLFDT(),1,12) 12 D APPADD^BSDX07(.ZZZ,APPTTIME,APPTTIME+.0001,3,"Dr Office",30,"Sam's Note",1) 13 N APPTID S APPTID=+^BSDXTMP($J,1) 14 N HL S HL=$$GET1^DIQ(9002018.4,APPTID,".07:.04","I") 15 D CHECKIN^BSDX25(.ZZZ,APPTID,$$NOW^XLFDT()) 16 IF '$P(^BSDXAPPT(APPTID,0),U,3) WRITE "ERROR IN CHECKIN 1",! 17 IF '+$G(^SC(HL,"S",APPTTIME,1,1,"C")) WRITE "ERROR IN CHECKIN 2",! 18 D RMCI^BSDX25(.ZZZ,APPTID) 19 IF $P(^BSDXAPPT(APPTID,0),U,3) WRITE "ERROR IN UNCHECKIN 1",! 20 IF $G(^SC(HL,"S",APPTTIME,1,1,"C")) WRITE "ERROR IN UNCHECKIN 2",! 21 D RMCI^BSDX25(.ZZZ,APPTID) ; again, test sanity in repeat 22 IF $P(^BSDXAPPT(APPTID,0),U,3) WRITE "ERROR IN UNCHECKIN 1",! 23 IF $G(^SC(HL,"S",APPTTIME,1,1,"C")) WRITE "ERROR IN UNCHECKIN 2",! 24 ; now test various error conditions 25 ; Test Error 1 26 D RMCI^BSDX25(.ZZZ,) 27 IF +^BSDXTMP($J,1)'=-1 WRITE "ERROR IN ETest 1",! 28 ; Test Error 2 29 D RMCI^BSDX25(.ZZZ,234987234398) 30 IF +^BSDXTMP($J,1)'=-2 WRITE "ERROR IN Etest 2",! 31 ; Tests for 3 to 5 difficult to produce 32 ; Error tests follow: Mumps error test; Transaction restartability 33 N bsdxdie S bsdxdie=1 34 D RMCI^BSDX25(.ZZZ,APPTID) 35 IF +^BSDXTMP($J,1)'=-20 WRITE "ERROR IN Etest 3",! 36 K bsdxdie 37 N bsdxrestart S bsdxrestart=1 38 D RMCI^BSDX25(.ZZZ,APPTID) 39 IF +^BSDXTMP($J,1)'=0 WRITE "Error in Etest 4",! 40 QUIT 8 41 CHECKIND(BSDXY,BSDXAPTID,BSDXCDT,BSDXCC,BSDXPRV,BSDXROU,BSDXVCL,BSDXVFM,BSDXOG) ;EP 9 42 ;Entry point for debugging … … 14 47 CHECKIN(BSDXY,BSDXAPTID,BSDXCDT) ; ,BSDXCC,BSDXPRV,BSDXROU,BSDXVCL,BSDXVFM,BSDXOG) ;EP Check in appointment 15 48 ; Private to GUI; use BSDXAPI for general API to checkin patients 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 49 ; Parameters: 50 ; BSDXY: Global Out 51 ; BSDXAPTID: Appointment ID in ^BSDXAPPT 52 ; BSDXCDT: Checkin Date --> Changed 53 ; BSDXCC: Clinic Stop IEN (not used) 54 ; BSDXPRV: Provider IEN (not used) 55 ; BSDXROU: Print Routing Slip? (not used) 56 ; BSDXVCL: PCC+ Clinic IEN (not used) 57 ; BSDXVFM: PCC+ Form IEN (not used) 58 ; BSDXOG: PCC+ Outguide (true or false) 59 ; 60 ; Output: 61 ; ADO.net table with 1 column ErrorID, 1 row result 62 ; - 0 if all okay 63 ; - Another number or text if not 31 64 32 65 N BSDXNOD,BSDXPATID,BSDXSTART,DIK,DA,BSDXID,BSDXI,BSDXZ,BSDXIENS,BSDXVEN … … 60 93 ; 61 94 S BSDXI=BSDXI+1 62 ;S ^BSDXTMP($J,BSDXI)="-1"_$C(30)63 95 S ^BSDXTMP($J,BSDXI)="0"_$C(30) 64 96 S BSDXI=BSDXI+1 … … 88 120 ; Record set with Column ERRORID; value of 0 AOK; other value 89 121 ; --> means that something went wrong 90 ; 122 ; 123 ; Error Reference: 124 ; -1~Invalid Appointment ID (not passed) 125 ; -2~Invalid Appointment ID (Doesn't exist in ^BSDXAPPT) 126 ; -3~DB has corruption. Call Tech Support. (Resource ID doesn't exist in BSDXAPPT) 127 ; -4~DB has corruption. Call Tech Support. (Resource ID in BSDXAPPT doesnt exist in BSDXRES) 128 ; -5~BSDXAPI Error. Message depends on error. 129 ; -20~Mumps Error 130 ; 91 131 N BSDXNOEV S BSDXNOEV=1 ;Don't execute protocol 92 132 ; … … 101 141 S ^BSDXTMP($J,BSDXI)="T00020ERRORID"_$C(30) ; Header of ADO recordset 102 142 ; 103 TSTART ():SERIAL ; Perform Autolocking 143 TSTART (BSDXI):SERIAL ; Perform Autolocking 144 ; 145 ;;;test 146 I $g(bsdxdie) S X=8/0 147 ;;; 148 I $g(bsdxrestart) k bsdxrestart TRESTART 149 ;;;test 104 150 ; 105 151 ; Check for Appointment ID (passed and exists in file) 106 I '+ BSDXAPTID D ERR("1~Invalid Appointment ID") QUIT107 I '$D(^BSDXAPPT(BSDXAP TID,0)) D ERR("2~Invalid Appointment ID") QUIT152 I '+$G(BSDXAPPTID) D ERR("-1~Invalid Appointment ID") QUIT 153 I '$D(^BSDXAPPT(BSDXAPPTID,0)) D ERR("-2~Invalid Appointment ID") QUIT 108 154 ; 109 155 ; Remove checkin from BSDX APPOINTMENT entry 110 D BSDXCHK(BSDXAP TID,"@")156 D BSDXCHK(BSDXAPPTID,"@") 111 157 ; 112 158 ; Now, remove checkin from PIMS files 2/44 113 N BSDXNOD S BSDXNOD=^BSDXAPPT(BSDXAP TID,0)159 N BSDXNOD S BSDXNOD=^BSDXAPPT(BSDXAPPTID,0) 114 160 N BSDXPATID S BSDXPATID=$P(BSDXNOD,U,5) ; DFN 115 161 N BSDXSTART S BSDXSTART=$P(BSDXNOD,U) ; Start Date … … 117 163 ; 118 164 ; If the resource doesn't exist, error out. DB is corrupt. 119 I BSDXSC1]"" D ERR("3~DB has corruption. Call Tech Support.") QUIT120 I $D(^BSDXRES(BSDXSC1,0)) D ERR("4~DB has corruption. Call Tech Support.") QUIT165 I 'BSDXSC1 D ERR("-3~DB has corruption. Call Tech Support.") QUIT 166 I '$D(^BSDXRES(BSDXSC1,0)) D ERR("-4~DB has corruption. Call Tech Support.") QUIT 121 167 ; 122 168 N BSDXNOD S BSDXNOD=^BSDXRES(BSDXSC1,0) ; Resource 0 node … … 124 170 ; 125 171 N BSDXZ ; Scratch variable to hold error message 126 I BSDXSC1]"",$D(^SC(BSDXSC1,0)) S BSDXZ=$$RMCI^BSDXAPI(BSDXPAT ,BSDXSC1,BSDXSTART)127 I +$G(BSDXZ) D ERR(" 5~"_$P(BSDXZ,U,2)) QUIT172 I BSDXSC1]"",$D(^SC(BSDXSC1,0)) S BSDXZ=$$RMCI^BSDXAPI(BSDXPATID,BSDXSC1,BSDXSTART) 173 I +$G(BSDXZ) D ERR("-5~"_$P(BSDXZ,U,2)) QUIT 128 174 ; 129 175 TCOMMIT ; Save Data into Globals … … 173 219 Q:BSDXRESN="" 174 220 S BSDXRESN=$P(BSDXRESN,"^") 175 ;D EVENT^BSDX23("SCHEDULE-"_BSDXRESN,"","","")176 221 D EVENT^BMXMEVN("BSDX SCHEDULE",BSDXRESN) 177 222 Q 178 223 ; 179 224 ERROR ; 225 S $ETRAP="D ^%ZTER HALT" ; Emergency Error Trap for the wise 226 ; Rollback, otherwise ^XTER will be empty from future rollback 227 I $TL>0 TROLLBACK 228 D ^%ZTER 229 S $EC="" ; Clear Error 230 ; Log error message and send to client 180 231 D ERR("-20~Mumps Error") 181 232 Q … … 183 234 ERR(BSDXERR) ;Error processing 184 235 I $TLEVEL>0 TROLLBACK 185 S BSDXERR=$TEXT(+0)_":"_$GET(BSDXERR) ; Append Routine Name 186 S BSDXI=BSDXI+1 236 S BSDXERR=$G(BSDXERR) 237 S BSDXERR=$P(BSDXERR,"~")_"~"_$TEXT(+0)_":"_$P(BSDXERR,"~",2) ; Append Routine Name 238 S BSDXI=$G(BSDXI)+1 187 239 S ^BSDXTMP($J,BSDXI)=BSDXERR_$C(30) 188 240 S BSDXI=BSDXI+1
Note:
See TracChangeset
for help on using the changeset viewer.