Ignore:
Timestamp:
Jan 24, 2011, 9:21:52 AM (14 years ago)
Author:
Sam Habiel
Message:

Updates to M routines to support deletion of check-in

File:
1 edited

Legend:

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

    r1041 r1076  
    55        ;Move to BSDX namespace as BSDXAPI from BSDAPI by WV/SMH
    66        ; Change History:
    7            ; 2010-11-5:
     7        ; 2010-11-5:
    88        ; - Fixed errors having to do uncanceling patient appointments if it was a patient cancelled appointment.
    99        ; - Use new style Fileman API for storing appointments in file 44 in $$MAKE due to problems with legacy API.
    10            ; 2010-11-12:
    11            ; - Changed ="C" to ["C" in SCIEN. Cancelled appointments can be "PC" as well.
    12            ; 2010-12-5
    13            ; Added an entry point to update the patient note in file 44.
    14            ; 2010-12-6
    15            ; MAKE1 incorrectly put info field in BSDR("INFO") rather than BSDR("OI")
    16            ; 2010-12-8
    17            ; Removed restriction on max appt length. Even though this restriction
    18            ; exists in fileman (120 minutes), PIMS ignores it. Therefore, I
    19            ; will ignore it here too.
     10        ; 2010-11-12:
     11        ; - Changed ="C" to ["C" in SCIEN. Cancelled appointments can be "PC" as well.
     12        ; 2010-12-5
     13        ; Added an entry point to update the patient note in file 44.
     14        ; 2010-12-6
     15        ; MAKE1 incorrectly put info field in BSDR("INFO") rather than BSDR("OI")
     16        ; 2010-12-8
     17        ; Removed restriction on max appt length. Even though this restriction
     18        ; exists in fileman (120 minutes), PIMS ignores it. Therefore, I
     19        ; will ignore it here too.
    2020        ;
    2121MAKE1(DFN,CLIN,TYP,DATE,LEN,INFO)       ; Simplified PEP w/ parameters for $$MAKE - making appointment
     
    267267        Q $S(X:1,1:0)
    268268        ;
     269RMCI(PAT,CLINIC,DATE)           ;PEP; -- Remove Check-in; $$
     270        ; PAT = DFN
     271        ; CLINIC = SC IEN
     272        ; DATE = FM Date/Time of Appointment
     273        ;
     274        ; Returns:
     275        ; 0 if okay
     276        ; -1 if failure
     277        ;
     278        ; remember before status
     279        NEW SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL
     280        S DFN=PAT,SDT=DATE,SDCL=CLINIC,SDMODE=2,SDDA=$$SCIEN(DFN,SDCL,SDT)
     281        ;
     282        I SDDA<1 QUIT 0    ; Appt cancelled; cancelled appts rm'ed from file 44
     283        ;
     284        S SDCIHDL=$$HANDLE^SDAMEVT(1),SDATA=SDDA_U_DFN_U_SDT_U_SDCL
     285        D BEFORE^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL)
     286        ;
     287        ; remove check-in using filer.
     288        N BSDXIENS S BSDXIENS=SDDA_","_DATE_","_CLINIC_","
     289        S BSDXFDA(44.003,BSDXIENS,309)="@"      ; CHECKED-IN
     290        S BSDXFDA(44.003,BSDXIENS,302)="@"      ; CHECK IN USER
     291        S BSDXFDA(44.003,BSDXIENS,305)="@"      ; CHECK IN ENTERED
     292        N BSDXERR
     293        D FILE^DIE("","BSDXFDA","BSDXERR")
     294        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)
     295        ;
     296        ; set after status
     297        S SDDA=$$SCIEN(DFN,SDCL,SDT)
     298        S SDCIHDL=$$HANDLE^SDAMEVT(1),SDATA=SDDA_U_DFN_U_SDT_U_SDCL
     299        D AFTER^SDAMEVT(.SDATA,DFN,SDT,SDCL,SDDA,SDCIHDL)
     300        ;
     301        ; call event driver
     302        D EVT^SDAMEVT(.SDATA,4,SDMODE,SDCIHDL)
     303        QUIT 0
     304        ;
    269305SCIEN(PAT,CLINIC,DATE)  ;PEP; returns ien for appt in ^SC
    270306        NEW X,IEN
Note: See TracChangeset for help on using the changeset viewer.