Changeset 1081 for Scheduling


Ignore:
Timestamp:
Jan 26, 2011, 5:38:11 AM (13 years ago)
Author:
Sam Habiel
Message:

Updated BSDXAPI to spit out a user friendly message if Patient has same appointment;BSDX07 has a tiny update in the formatting of the error message so it can be easily parsed by the GUI

Location:
Scheduling/trunk/m
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/m/BSDX07.m

    r1041 r1081  
    1 BSDX07  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS  ; 12/6/10 12:31pm
     1BSDX07  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS  ; 1/26/11 11:29am
    22           ;;1.42;BSDX;;Dec 07, 2010
    33           ;
     
    175175           N BSDXSCD S BSDXSCD=$P(BSDXRNOD,U,4)  ; Hosp Location IEN
    176176           ; Only if we have a valid Hosp Loc can we make an appointment
    177            I +BSDXSCD,$D(^SC(BSDXSCD,0)) D  I +BSDXERR D ERR(BSDXI,"-10~BSDX07 Error: ~MAKE^BSDAPI returned error code: "_BSDXERR) Q
     177           I +BSDXSCD,$D(^SC(BSDXSCD,0)) D  I +BSDXERR D ERR(BSDXI,"-10~BSDX07 Error: MAKE^BSDXAPI returned error code: "_BSDXERR) Q
    178178           . N BSDXC
    179179           . S BSDXC("PAT")=BSDXPATID
  • Scheduling/trunk/m/BSDXAPI.m

    r1080 r1081  
    1 BSDXAPI ; IHS/ANMC/LJF - SCHEDULING APIs ; 1/25/11 1:00pm
     1BSDXAPI ; IHS/ANMC/LJF - SCHEDULING APIs ; 1/26/11 11:47am
    22        ;;1.42;BSDX;;Dec 07, 2010;Build 7
    33        ;Orignal routine is BSDAPI by IHS/LJF, HMW, and MAW
     
    2727        ;  I $G(BSDR("ADT"))'?7N.1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT"))
    2828        ; to allow for date at midnight which does not have a dot at the end.
     29        ; 2011-01-26 (v.1.5)
     30        ; More user friendly message if patient already has appointment in $$MAKE:
     31        ;  Spits out pt name and user friendly date.
    2932        ; 
    3033        ;
     
    5255        ; BSDR("TYP") = 3 for scheduled appts, 4 for walkins
    5356        ; BSDR("ADT") = appointment date and time
    54         ; BSDR("LEN") = appointment length in minutes (5-120)
     57        ; BSDR("LEN") = appointment length in minutes (*1.42 limit removed)
    5558        ; BSDR("OI")  = reason for appt - up to 150 characters
    5659        ; BSDR("USR") = user who made appt
     
    6871        ;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.
    6972        I '$D(^VA(200,+$G(BSDR("USR")),0)) Q 1_U_"User Who Made Appt Error: "_$G(BSDR("USR"))
    70         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")
     73        ;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
     74        ;
     75        ; Following block to give an error message to user if there is already an appointment for patient. More verbose than others.
     76        N BSDXERR ; place to store error message
     77        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
     78        . S BSDXERR=1_U_"Patient "_$P(^DPT(BSDR("PAT"),0),U)_" ("_BSDR("PAT")_") "
     79        . S BSDXERR=BSDXERR_"already has appt at "_$$FMTE^XLFDT(BSDR("ADT"))
     80        . 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)
     81        . N BSDXSCNAM S BSDXSCNAM=$P(^SC(BSDXSCIEN,0),U) ; PIMS Name of Clinic
     82        . S BSDXERR=BSDXERR_$C(13,10)_"PIMS clinic: "_BSDXSCNAM ; tell the user of the PIMS clinic
     83        . 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)
     84        . . N BSDXRESIEN S BSDXRESIEN=$O(^BSDXRES("ALOC",BSDXSCIEN,""))
     85        . . QUIT:'BSDXRESIEN  ; Safeguard if index is corrupt
     86        . . N BSDXRESNAM S BSDXRESNAM=$P(^BSDXRES(BSDXRESIEN,0),U)
     87        . . S BSDXERR=BSDXERR_$C(13,10)_"Scheduling GUI clinic: "_BSDXRESNAM ; tell the user of the BSDX clinic
    7188        ;
    7289        NEW DIC,DA,Y,X,DD,DO,DLAYGO
Note: See TracChangeset for help on using the changeset viewer.