Ignore:
Timestamp:
Jul 3, 2012, 7:45:46 PM (12 years ago)
Author:
Sam Habiel
Message:

Refactoring BSDX25 continued...

File:
1 edited

Legend:

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

    r1464 r1466  
    1 BSDXAPI1 ; VEN/SMH - SCHEDULING APIs - Continued!!! ; 6/29/12 11:52am
     1BSDXAPI1 ; VEN/SMH - SCHEDULING APIs - Continued!!! ; 7/3/12 12:37pm
    22        ;;1.7T1;BSDX;;Aug 31, 2011;Build 18
    33        ; Licensed under LGPL 
     4        ;
     5        ; Change History (BSDXAPI and BSDXAPI1)
     6        ; Pre 1.42:
     7        ; - Simplified entry points (MAKE1, CANCEL1, CHECKIN1)
     8        ; 2010-11-5: (1.42)
     9        ; - Fixed errors having to do uncanceling patient appointments if it was
     10        ;   a patient cancelled appointment.
     11        ; - Use new style Fileman API for storing appointments in file 44 in
     12        ;   $$MAKE due to problems with legacy API.
     13        ; 2010-11-12: (1.42)
     14        ; - Changed ="C" to ["C" in SCIEN. Cancelled appointments can be "PC" as
     15        ;   well.
     16        ; 2010-12-5 (1.42)
     17        ; Added an entry point to update the patient note in file 44.
     18        ; 2010-12-6 (1.42)
     19        ; MAKE1 incorrectly put info field in BSDR("INFO") rather than BSDR("OI")
     20        ; 2010-12-8 (1.42)
     21        ; Removed restriction on max appt length. Even though this restriction
     22        ; exists in fileman (120 minutes), PIMS ignores it. Therefore, I
     23        ; will ignore it here too.
     24        ; 2011-01-25 (v.1.5)
     25        ; Added entry point $$RMCI to remove checked in appointments.
     26        ; In $$CANCEL, if the appointment is checked in, delete check-in rather than
     27        ;  spitting an error message to the user saying 'Delete the check-in'
     28        ; Changed all lines that look like this:
     29        ;  I $G(BSDR("ADT"))'?7N1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT"))
     30        ; to:
     31        ;  I $G(BSDR("ADT"))'?7N.1".".4N Q 1_U_"Appt Date/Time error: "_$G(BSDR("ADT"))
     32        ; to allow for date at midnight which does not have a dot at the end.
     33        ; 2011-01-26 (v.1.5)
     34        ; More user friendly message if patient already has appointment in $$MAKE:
     35        ;  Spits out pt name and user friendly date.
     36        ; 2012-06-18 (v 1.7)
     37        ; Removing transacions. Means that code SHOULD NOT fail. Took all checks
     38        ;  out for making an appointment to MAKECK. We call this first to make sure
     39        ; that the appointment is okay to make before committing to make it. We
     40        ; still have the provision to delete the data though if we fail when we
     41        ; actually make the appointment.
     42        ; CANCELCK exists for the same purpose.
     43        ; CHECKINK ditto
     44        ; New API: $$NOWSHOW^BSDXAPI1 for no-showing patients
     45        ; Moved RMCI from BSDXAPI to BSDXAPI1 because BSDXAPI1 is getting larger
     46        ;  than 20000 characters.
    447        ;
    548NOSHOW(PAT,CLINIC,DATE,NSFLAG) ; $$ PEP; No-show Patient at appt date (new in v1.7)
     
    4184        ;
    4285        ; This M error trigger tests if ^BSDXAPPT rolls back.
    43         ; I won't try to roll back ^DPT(,"S"
    44         ; The M error is caused here, so if I try to rollback, I can cause another
     86        ; I won't try to roll back ^DPT(,"S" because
     87        ; the M error is caused here, so if I try to rollback, I can cause another
    4588        ; error. Infinite Errors then.
    4689        I $D(BSDXSIMERR3) N X S X=1/0
     
    67110        ;
    68111        ; Call like this: $$RMCI(233,33,3110102.1130)
     112        ;
     113        ; Check to see if we can remove the check-in
     114        N BSDXERR S BSDXERR=$$RMCICK(PAT,CLINIC,DATE)
     115        I BSDXERR Q BSDXERR
    69116        ;
    70117        ; Move my variables into the ones used by SDAPIs (just a convenience)
     
    97144        QUIT 0
    98145        ;
     146RMCICK(PAT,CLINIC,DATE) ;PEP; Can you remove a check-in for this patient?
     147        ; PAT - DFN by value
     148        ; CLINIC - ^SC ien by value
     149        ; DATE - Appointment Date
     150        ; Output: 0 if okay or 1 if error
     151        ;
     152        ; Get appointment IEN in ^SC(DA(2),"S",DA(1),1,
     153        N SCIEN S SCIEN=$$SCIEN^BSDXAPI(PAT,CLINIC,DATE)
     154        ;
     155        ; If not there, it has been cancelled.
     156        I 'SCIEN QUIT 0
     157        ;
     158        ; Check if checked out
     159        I $$CO^BSDXAPI(PAT,CLINIC,DATE,SCIEN) Q 1_U_"Appointment Already Checked Out"
     160        ;
     161        QUIT 0
     162        ;
    99163UPDATENT(PAT,CLINIC,DATE,NOTE)  ; PEP; Update Note in ^SC for patient's appointment @ DATE
    100164        ; PAT = DFN
Note: See TracChangeset for help on using the changeset viewer.