Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDAMEP3

SDAMEP3.m

Go to the documentation of this file.
SDAMEP3 ;ALB/CAW - Extended Display (Appt. Event Log) ; 16 May 2001  6:31 PM
 ;;5.3;Scheduling;**20,241,1001,1005,1015,1016**;Aug 13, 1993;Build 20
 ;IHS/ANMC/LJF 12/13/2000 added display of date routing slip printed
 ;IHS/ITSC/WAR 08/19/2004 PATCH 1001 quit added by pass VA wait time display
 ;IHS/OIT/LJF  12/30/2005 PATCH 1005 added code to wrap long cancel remarks
 ;
APLOG ;
 D SET^SDAMEP1("                       *** Appointment Event Log ***")
 D CNTRL^VALM10(SDLN,24,29,IOINHI,IOINORM)
 D SET^SDAMEP1($$EVENT("Event","Date","User"))
 D SET^SDAMEP1($$EVENT("-----","----","----"))
 D SET^SDAMEP1($$EVENT("Appt Made",$S($G(SDSC(44.003,SDDA,8))]"":SDSC(44.003,SDDA,8),1:$G(SDPT(2.98,SDT,20))),$S($G(SDSC(44.003,SDDA,7))]"":SDSC(44.003,SDDA,7),1:$G(SDPT(2.98,SDT,19)))))
 ;
 D SET^SDAMEP1($$EVENT("Routing Slip Printed",$$FMTE^XLFDT($P(^DPT(DFN,"S",SDT,0),U,13)),""))  ;IHS/ANMC/LJF 12/13/2000
 ;
 D SET^SDAMEP1($$EVENT("Check In",$G(SDSC(44.003,SDDA,309)),$G(SDSC(44.003,SDDA,302))))
 D SET^SDAMEP1($$EVENT("Check Out",$G(SDSC(44.003,SDDA,303)),$G(SDSC(44.003,SDDA,304))))
 D SET^SDAMEP1($$EVENT("Check Out Entered",$G(SDSC(44.003,SDDA,306)),""))
 D SET^SDAMEP1($$EVENT("No-Show/Cancel",$G(SDPT(2.98,SDT,15)),$G(SDPT(2.98,SDT,14)))),SET^SDAMEP1("")
 ;
 S X=""
 S X=$$SETSTR^VALM1("  Checked Out:",X,7,SDWIDTH)
 S X=$$SETSTR^VALM1($S($G(SDOE(409.68,+SDOE,.07))]"":"YES",1:""),X,SDFSTCOL+5,30)
 D SET^SDAMEP1(X)
 ;
 S X=""
 S X=$$SETSTR^VALM1("  Cancel Reason:",X,5,SDWIDTH)
 S X=$$SETSTR^VALM1(SDPT(2.98,SDT,16),X,SDFSTCOL+5,30)
 D SET^SDAMEP1(X)
 ;
 S X=""
 S X=$$SETSTR^VALM1("  Cancel Remark:",X,5,SDWIDTH)
 ;S X=$$SETSTR^VALM1(SDPT(2.98,SDT,17),X,SDFSTCOL+5,50)  ;ihs/cmi/maw removed patch 1016
 ;D SET^SDAMEP1(X)
 ;
 ;
 ;IHS/OIT/LJF 12/30/2005 PATCH 1005 wrap to multiple lines if longer than 60 characters
 ;S X=$$SETSTR^VALM1(SDPT(2.98,SDT,17),X,SDFSTCOL+5,50)
 ;D SET^SDAMEP1(X)
 NEW BSDR,I,BSDSAV S BSDSAV=X D WRAP^BDGF(SDPT(2.98,SDT,17),50,.BSDR)
 S X=BSDSAV,X=$$SETSTR^VALM1(BSDR(1),X,SDFSTCOL+5,50) D SET^SDAMEP1(X)   ;first line as before
 F I=2:1 Q:'$D(BSDR(I))  S X=$$REPEAT^XLFSTR(" ",SDWIDTH),X=$$SETSTR^VALM1(BSDR(I),X,SDFSTCOL+5,50) D SET^SDAMEP1(X)
 ;PATCH 1005 end of changes
 ;
 S X=""
 S X=$$SETSTR^VALM1("  Rebooked Date:",X,5,SDWIDTH)
 S X=$$SETSTR^VALM1(SDPT(2.98,SDT,12),X,SDFSTCOL+5,20)
 D SET^SDAMEP1(X)
 Q  ;IHS/ITSC/WAR 8/19/2004 PATCH #1001 quit was needed
CWT ;Clinic Wait Time Information
 N SDCWT,SDCWT1,SDCWT2
 ;Get internal data values
 F SDCWT=3,20,25:1:28 S SDCWT(SDCWT)=SDPTI(2.98,SDT,SDCWT,"I")
 ;Wait time data applicable?
 S SDCWT=1 S:$E(SDCWT(3))="C" SDCWT=0
 S SDCWT1=SDCWT(20),SDCWT2=SDCWT(27)
 ;Calculate Wait Time1
 S SDCWT1=$S(SDCWT1<1:"",SDT<SDCWT1:0,1:$$FMDIFF^XLFDT(SDT,SDCWT1,1))
 ;Calculate Wait Time2
 S:'$$CWT3^SCRPW75(SDT,SDCWT(26),SDCWT(27),SDCWT(28),.SDCWT2) SDCWT2=""
 S:+SDCWT1=SDCWT1 SDCWT1=SDCWT1_" day"_$S(SDCWT1=1:"",1:"s")
 S:+SDCWT2=SDCWT2 SDCWT2=SDCWT2_" day"_$S(SDCWT2=1:"",1:"s")
 D SET^SDAMEP1("                      *** Clinic Wait Time Information ***")
 D CNTRL^VALM10(SDLN,20,40,IOINHI,IOINORM)
 D SET^SDAMEP1("")
 ;
 S X=""
 S X=$$SETSTR^VALM1("       Request type:",X,7,SDWIDTH+6)
 S X=$$SETSTR^VALM1($S('SDCWT:"N/A",$G(SDPT(2.98,SDT,25))]"":SDPT(2.98,SDT,25),1:"Unknown"),X,SDFSTCOL+10,50)
 D SET^SDAMEP1(X)
 ;
 S X=""
 S X=$$SETSTR^VALM1("'Next Available' Type:",X,5,SDWIDTH+6)
 S X=$$SETSTR^VALM1($S('SDCWT:"N/A",1:SDPT(2.98,SDT,26)),X,SDFSTCOL+10,50)
 D SET^SDAMEP1(X)
 ;
 S X=""
 S X=$$SETSTR^VALM1("         Desired date:",X,5,SDWIDTH+6)
 S X=$$SETSTR^VALM1($S('SDCWT:"N/A",1:SDPT(2.98,SDT,27)),X,SDFSTCOL+10,50)
 D SET^SDAMEP1(X)
 ;
 S X=""
 S X=$$SETSTR^VALM1("      Follow-up visit:",X,5,SDWIDTH+6)
 S X=$$SETSTR^VALM1($S('SDCWT:"N/A",1:SDPT(2.98,SDT,28)_$S($L(SDPT(2.98,SDT,28)):"  (computed)",1:"")),X,SDFSTCOL+10,50)
 D SET^SDAMEP1(X)
 ;
 S X=""
 S X=$$SETSTR^VALM1("    Clinic Wait Time1:",X,5,SDWIDTH+6)
 S X=$$SETSTR^VALM1($S('SDCWT:"N/A",1:SDCWT1),X,SDFSTCOL+10,50)
 D SET^SDAMEP1(X)
 ;
 S X=""
 S X=$$SETSTR^VALM1("    Clinic Wait Time2:",X,5,SDWIDTH+6)
 S X=$$SETSTR^VALM1($S('SDCWT:"N/A",1:SDCWT2),X,SDFSTCOL+10,50)
 D SET^SDAMEP1(X)
 D SET^SDAMEP1("")
 I SDCWT D  Q
 .D SET^SDAMEP1("NOTE: Clinic Wait Time1 represents the difference between the date the")
 .D SET^SDAMEP1("      appointment was entered and the date it was performed.  Clinic Wait")
 .D SET^SDAMEP1("      Time2 represents the difference between the 'desired date' and the")
 .D SET^SDAMEP1("      date the appointment was performed.")
 .Q
 D SET^SDAMEP1("")
 D SET^SDAMEP1("NOTE: Clinic Wait Time data is not applicable for appointments that have a")
 D SET^SDAMEP1("      status of 'cancelled by clinic'.")
 D SET^SDAMEP1("")
 Q
 ;
EVENT(TYPE,TIME,USER) ;
 Q $$SETSTR^VALM1(TYPE,$$SETSTR^VALM1(TIME,$$SETSTR^VALM1(USER,"",50,30),25,21),2,20)
 ;