Changeset 1450 for Scheduling
- Timestamp:
- Jun 18, 2012, 8:08:50 PM (13 years ago)
- Location:
- Scheduling/trunk/m
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX07.m
r1449 r1450 1 BSDX07 ; VW/UJO/SMH - WINDOWS SCHEDULING RPCS ; 6/18/12 2:27pm1 BSDX07 ; VW/UJO/SMH - WINDOWS SCHEDULING RPCS ; 6/18/12 5:12pm 2 2 ;;1.7T1;BSDX;;Aug 31, 2011;Build 18 3 3 ; Licensed under LGPL … … 25 25 ; -10: Couldn't add appointment to files 2 and/or 44 26 26 ; -100: Mumps Error 27 27 ; 28 28 APPADDD(BSDXY,BSDXSTART,BSDXEND,BSDXPATID,BSDXRES,BSDXLEN,BSDXNOTE,BSDXATID) ;EP 29 29 ;Entry point for debugging … … 38 38 . N $ET S $ET="D ^%ZTER B" 39 39 . S HLRESIENS=$$UTCR^BSDX35(RESNAM) 40 . I %<0 S $EC=",U1," ; not supposed to happen41 ; 42 N HLIEN,RESIEN 40 . I HLRESIENS<0 S $EC=",U1," ; not supposed to happen 41 ; 42 N HLIEN,RESIEN 43 43 S HLIEN=$P(HLRESIENS,U) 44 44 S RESIEN=$P(HLRESIENS,U,2) … … 58 58 I '$D(^DPT(3,"S",APPTTIME)) W "Error Making Appt-3" 59 59 I '$D(^SC(HLIEN,"S",APPTTIME)) W "Error Making Appt-4" 60 ; 61 ; Do it again for a different patient 62 D APPADD(.ZZZ,APPTTIME,ENDTIME,2,RESNAM,30,"Sam's Note",1) 63 N APPID S APPID=+$P(^BSDXTMP($J,1),U) B 64 I 'APPID W "Error Making Appt-5" QUIT 65 I +^BSDXAPPT(APPID,0)'=APPTTIME W "Error Making Appt-6" 66 I '$D(^DPT(2,"S",APPTTIME)) W "Error Making Appt-7" 67 I '$D(^SC(HLIEN,"S",APPTTIME)) W "Error Making Appt-8" 60 68 ; 61 69 ; Test for bad start date … … 69 77 ; I +$P(^BSDXTMP($J,1),U,2)'=-4 W "Error in -4",! 70 78 ; Test for mumps error 71 S bsdxdie=172 D APPADD(.ZZZ,APPTTIME,ENDTIME, 2,RESNAM,30,"Sam's Note",1)79 S BSDXDIE=1 80 D APPADD(.ZZZ,APPTTIME,ENDTIME,1,RESNAM,30,"Sam's Note",1) 73 81 I +$P(^BSDXTMP($J,1),U,2)'=-100 W "Error in -100: M Error",! 74 K bsdxdie82 K BSDXDIE 75 83 ; Test for TRESTART 76 s bsdxrestart=184 s BSDXRESTART=1 77 85 D APPADD(.ZZZ,APPTTIME,ENDTIME,3,RESNAM,30,"Sam's Note",1) 78 86 I +$P(^BSDXTMP($J,1),U,2)'=0&(+$P(^BSDXTMP($J,1),U,2)'=-10) W "Error in TRESTART",! 79 k bsdxrestart87 k BSDXRESTART 80 88 ; Test for non-numeric patient 81 89 D APPADD(.ZZZ,APPTTIME,ENDTIME,"CAT,DOG",RESNAM,30,"Sam's Note",1) … … 158 166 ; 159 167 ;;;test for error inside transaction. See if %ZTER works 160 I $G( bsdxdie) S X=1/0168 I $G(BSDXDIE) S X=1/0 161 169 ;;;test 162 170 ;;;test for TRESTART 163 I $G( bsdxrestart) K bsdxrestartTRESTART171 I $G(BSDXRESTART) K BSDXRESTART TRESTART 164 172 ;;;test 165 173 ; … … 256 264 S:BSDXATID="WALKIN" BSDXFDA(9002018.4,"+1,",.13)="y" 257 265 S:BSDXATID?.N BSDXFDA(9002018.4,"+1,",.06)=BSDXATID 258 S BSDXFDA(9002018.4,"+1,",.14)= BSDXRADEXAM266 S BSDXFDA(9002018.4,"+1,",.14)=$G(BSDXRADEXAM) 259 267 N BSDXIEN,BSDXMSG 260 268 D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG") -
Scheduling/trunk/m/BSDX26.m
r1187 r1450 1 BSDX26 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 4/28/11 10:24am2 ;;1. 6T2;BSDX;;May 16, 20111 BSDX26 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 6/18/12 5:33pm 2 ;;1.7T1;BSDX;;Aug 31, 2011;Build 18 3 3 ; Licensed under LGPL 4 4 ; Change History: … … 104 104 N BSDXRES S BSDXRES=0 ; Result 105 105 ; Update Note only if we have a linked hospital location. 106 I HLIEN S BSDXRES=$$UPDATEN OTE^BSDXAPI(PTIEN,HLIEN,DATE,BSDXNOTE(.5))106 I HLIEN S BSDXRES=$$UPDATENT^BSDXAPI(PTIEN,HLIEN,DATE,BSDXNOTE(.5)) 107 107 ; If we get an error (denoted by -1 in BSDXRES), return error to client 108 108 I BSDXRES<0 D ERR(BSDXI,"-4~BSDX26: BSDXAPI reports an error: "_BSDXRES) QUIT -
Scheduling/trunk/m/BSDXAPI.m
r1187 r1450 1 BSDXAPI ; IHS/ANMC/LJF & VW/SMH - SCHEDULING APIs ; 4/28/11 10:30am2 ;;1.6 T2;BSDX;;May 16, 2011;Build 71 BSDXAPI ; IHS/ANMC/LJF & VW/SMH - SCHEDULING APIs ; 6/18/12 5:31pm 2 ;;1.6;BSDX;;Aug 31, 2011;Build 18 3 3 ; Licensed under LGPL 4 4 ; … … 32 32 ; More user friendly message if patient already has appointment in $$MAKE: 33 33 ; Spits out pt name and user friendly date. 34 ; 34 ; 2012-06-18 (v 1.7) 35 ; Removing transacions. Means that code SHOULD NOT fail. Took all checks 36 ; out for making an appointment to MAKECK. We call this first to make sure 37 ; that the appointment is okay to make before committing to make it. 35 38 ; 36 39 MAKE1(DFN,CLIN,TYP,DATE,LEN,INFO) ; Simplified PEP w/ parameters for $$MAKE - making appointment … … 65 68 ; = 1^message: error and reason 66 69 ; 67 I '$D(^DPT(+$G(BSDR("PAT")),0)) Q 1_U_"Patient not on file: "_$G(BSDR("PAT")) 68 I '$D(^SC(+$G(BSDR("CLN")),0)) Q 1_U_"Clinic not on file: "_$G(BSDR("CLN")) 69 I ($G(BSDR("TYP"))<3)!($G(BSDR("TYP"))>4) Q 1_U_"Appt Type error: "_$G(BSDR("TYP")) 70 I $G(BSDR("ADT")) S BSDR("ADT")=+$E(BSDR("ADT"),1,12) ;remove seconds 71 I $G(BSDR("ADT"))'?7N.1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT")) 72 ; 73 ;I ($G(BSDR("LEN"))<5)!($G(BSDR("LEN"))>240) Q 1_U_"Appt Length error: "_$G(BSDR("LEN")) ; v 1.42 - no check on length is done anymore. see top comments for details. 74 I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Made Appt Error: "_$G(BSDR("USR")) 75 ;I $D(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0)),$P(^(0),U,2)'["C" Q 1_U_"Patient "_BSDR("PAT")_" already has appt at "_BSDR("ADT") ; v.1.5 more user friendly err msg 76 ; 77 ; Following block to give an error message to user if there is already an appointment for patient. More verbose than others. 78 N BSDXERR ; place to store error message 79 I $D(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0)),$P(^(0),U,2)'["C" DO QUIT BSDXERR ; If there's an appt in the "S" node of file 2 and it's not cancelled 80 . S BSDXERR=1_U_"Patient "_$P(^DPT(BSDR("PAT"),0),U)_" ("_BSDR("PAT")_") " 81 . S BSDXERR=BSDXERR_"already has appt at "_$$FMTE^XLFDT(BSDR("ADT")) 82 . N BSDXSCIEN S BSDXSCIEN=$P(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0),U) ; Clinic IEN in ^SC (0 piece of 0 node of "S" multiple in file 2) 83 . N BSDXSCNAM S BSDXSCNAM=$P(^SC(BSDXSCIEN,0),U) ; PIMS Name of Clinic 84 . S BSDXERR=BSDXERR_$C(13,10)_"PIMS clinic: "_BSDXSCNAM ; tell the user of the PIMS clinic 85 . I $D(^BSDXRES("ALOC",BSDXSCIEN)) DO ; if the Clinic is linked to a BSDX Resource (we find out using the index ALOC in the BSDX RESOURCE file) 86 . . N BSDXRESIEN S BSDXRESIEN=$O(^BSDXRES("ALOC",BSDXSCIEN,"")) 87 . . QUIT:'BSDXRESIEN ; Safeguard if index is corrupt 88 . . N BSDXRESNAM S BSDXRESNAM=$P(^BSDXRES(BSDXRESIEN,0),U) 89 . . S BSDXERR=BSDXERR_$C(13,10)_"Scheduling GUI clinic: "_BSDXRESNAM ; tell the user of the BSDX clinic 70 N BSDXMKCK S BSDXMKCK=$$MAKECK(.BSDR) ; Check if we can make appointment 71 I BSDXMKCK Q BSDXMKCK ; If we can't, quit with the reason why. 72 ; Otherwise, we continue 90 73 ; 91 74 NEW DIC,DA,Y,X,DD,DO,DLAYGO … … 106 89 . D FILE^DIE("","BSDXFDA","BSDXMSG") 107 90 . N BSDXTEMP S BSDXTEMP=$G(BSDXMSG) 108 E D I $G(BSDXERR(1)) Q 1_U_"FileMan add to DPT error: Patient="_BSDR("PAT")_" Appt="_BSDR("ADT")91 E D 109 92 . N BSDXFDA,BSDXIENS,BSDXMSG 110 93 . S BSDXIENS="?+2,"_BSDR("PAT")_"," … … 115 98 . S BSDXFDA(2.98,BSDXIENS,"20")=$$NOW^XLFDT 116 99 . D UPDATE^DIE("","BSDXFDA","BSDXIENS","BSDXERR(1)") 117 ; add appt to file 44 100 I $G(BSDXERR(1)) Q 1_U_"FileMan add to DPT error: Patient="_BSDR("PAT")_" Appt="_BSDR("ADT") 101 ; add appt to file 44 118 102 K DIC,DA,X,Y,DLAYGO,DD,DO 119 103 I '$D(^SC(BSDR("CLN"),"S",0)) S ^SC(BSDR("CLN"),"S",0)="^44.001DA^^" … … 122 106 . S DIC("P")="44.001DA",DIC(0)="L",DLAYGO=44.001 123 107 . S Y=1 I '$D(@(DIC_X_")")) D FILE^DICN 108 124 109 ; 125 110 ; Sep 28 2010: Changed old style API to new style API. Keep for reference //smh … … 150 135 Q 0 151 136 ; 137 MAKECK(BSDR) ; $$ - Is it okay to make an appointment? ; PEP 138 I '$D(^DPT(+$G(BSDR("PAT")),0)) Q 1_U_"Patient not on file: "_$G(BSDR("PAT")) 139 I '$D(^SC(+$G(BSDR("CLN")),0)) Q 1_U_"Clinic not on file: "_$G(BSDR("CLN")) 140 I ($G(BSDR("TYP"))<3)!($G(BSDR("TYP"))>4) Q 1_U_"Appt Type error: "_$G(BSDR("TYP")) 141 I $G(BSDR("ADT")) S BSDR("ADT")=+$E(BSDR("ADT"),1,12) ;remove seconds 142 I $G(BSDR("ADT"))'?7N.1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT")) 143 ; 144 ; Appt Length check removed in v 1.5 145 ; 146 I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Made Appt Error: "_$G(BSDR("USR")) 147 ; More verbose error message in v1.5 148 ; Following block to give an error message to user if there is already an appointment for patient. More verbose than others. 149 N BSDXERR ; place to store error message 150 I $D(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0)),$P(^(0),U,2)'["C" DO QUIT BSDXERR ; If there's an appt in the "S" node of file 2 and it's not cancelled 151 . S BSDXERR=1_U_"Patient "_$P(^DPT(BSDR("PAT"),0),U)_" ("_BSDR("PAT")_") " 152 . S BSDXERR=BSDXERR_"already has appt at "_$$FMTE^XLFDT(BSDR("ADT")) 153 . N BSDXSCIEN S BSDXSCIEN=$P(^DPT(BSDR("PAT"),"S",BSDR("ADT"),0),U) ; Clinic IEN in ^SC (0 piece of 0 node of "S" multiple in file 2) 154 . N BSDXSCNAM S BSDXSCNAM=$P(^SC(BSDXSCIEN,0),U) ; PIMS Name of Clinic 155 . S BSDXERR=BSDXERR_$C(13,10)_"PIMS clinic: "_BSDXSCNAM ; tell the user of the PIMS clinic 156 . I $D(^BSDXRES("ALOC",BSDXSCIEN)) DO ; if the Clinic is linked to a BSDX Resource (we find out using the index ALOC in the BSDX RESOURCE file) 157 . . N BSDXRESIEN S BSDXRESIEN=$O(^BSDXRES("ALOC",BSDXSCIEN,"")) 158 . . QUIT:'BSDXRESIEN ; Safeguard if index is corrupt 159 . . N BSDXRESNAM S BSDXRESNAM=$P(^BSDXRES(BSDXRESIEN,0),U) 160 . . S BSDXERR=BSDXERR_$C(13,10)_"Scheduling GUI clinic: "_BSDXRESNAM ; tell the user of the BSDX clinic 161 Q 0 162 ; 163 UNMAKE(BSDR) ; Reverse Make - Private $$ 164 ; Only used in Emergiencies where Fileman data filing fails. 165 ; If previous data exists, which caused an error, it's destroyed. 166 N BSDXFDA,BSDXIENS 167 S BSDXIENS=BSDR("ADT")_","_BSDR("PAT")_"," 168 S BSDXFDA(2.98,BSDXIENS,".01")="@" 169 ; 170 I '$D(^SC(BSDR("CLN"),"S",BSDR("ADT"),1)) QUIT 0 ; No stuff in HL file 171 N X S X=0 F S X=$O(^SC(BSDR("CLN"),"S",BSDR("ADT"),1,X)) Q:'X Q:+^(X,0)=BSDR("PAT") 172 ; 173 I 'X QUIT 0 ; Patient doesn't have appointment 174 ; 175 S BSDXIENS=X_","_BSDR("ADT")_","_BSDR("CLN")_"," 176 S BSDXFDA(44.003,BSDXIENS,.01)="@" 177 N BSDXMSG 178 D FILE^DIE("","BSDXFDA","BSDXMSG") 179 I $D(BSDXMSG) S $EC=",U1," ; If we get an error here, we are REALLY out of control 180 QUIT 0 152 181 CHECKIN1(DFN,CLIN,APDATE) ; Simplified PEP w/ parameters for $$CHECKIN - Checking in 153 182 ; Call like this for DFN 23435 checking in now at Hospital Location 33 … … 325 354 ; remove check-in using filer. 326 355 N BSDXIENS S BSDXIENS=SDDA_","_DATE_","_CLINIC_"," 327 S BSDXFDA(44.003,BSDXIENS,309)="@" 328 S BSDXFDA(44.003,BSDXIENS,302)="@" 329 S BSDXFDA(44.003,BSDXIENS,305)="@" 356 S BSDXFDA(44.003,BSDXIENS,309)="@" ; CHECKED-IN 357 S BSDXFDA(44.003,BSDXIENS,302)="@" ; CHECK IN USER 358 S BSDXFDA(44.003,BSDXIENS,305)="@" ; CHECK IN ENTERED 330 359 N BSDXERR 331 360 D FILE^DIE("","BSDXFDA","BSDXERR") … … 359 388 Q $S(X:1,1:0) 360 389 ; 361 UPDATEN OTE(PAT,CLINIC,DATE,NOTE) ; PEP; Update Note in ^SC for patient's appointment @ DATE390 UPDATENT(PAT,CLINIC,DATE,NOTE) ; PEP; Update Note in ^SC for patient's appointment @ DATE 362 391 ; PAT = DFN 363 392 ; CLINIC = SC IEN
Note:
See TracChangeset
for help on using the changeset viewer.