SDAMEP3 ;ALB/CAW - Extended Display (Appt. Event Log) ;1/5/16 12:24pm
;;5.3;Scheduling;**20,241,645**;Aug 13, 1993;Build 7
;
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("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)
D SET^SDAMEP1(X)
;
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)
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=""
; SD*5.3*645 - replaced Desired date with CID/Preferred date when presented to the user
S X=$$SETSTR^VALM1(" CID/Preferred 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
.;SD*5.3*645 - replaced 'Desired date' with 'CID/Preferred date' when presented to the user
.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 'CID/Preferred 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)
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDAMEP3 4158 printed Sep 15, 2024@22:11:36 Page 2
SDAMEP3 ;ALB/CAW - Extended Display (Appt. Event Log) ;1/5/16 12:24pm
+1 ;;5.3;Scheduling;**20,241,645**;Aug 13, 1993;Build 7
+2 ;
APLOG ;
+1 DO SET^SDAMEP1(" *** Appointment Event Log ***")
+2 DO CNTRL^VALM10(SDLN,24,29,IOINHI,IOINORM)
+3 DO SET^SDAMEP1($$EVENT("Event","Date","User"))
+4 DO SET^SDAMEP1($$EVENT("-----","----","----"))
+5 DO SET^SDAMEP1($$EVENT("Appt Made",$SELECT($GET(SDSC(44.003,SDDA,8))]"":SDSC(44.003,SDDA,8),1:$GET(SDPT(2.98,SDT,20))),$SELECT($GET(SDSC(44.003,SDDA,7))]"":SDSC(44.003,SDDA,7),1:$GET(SDPT(2.98,SDT,19)))))
+6 DO SET^SDAMEP1($$EVENT("Check In",$GET(SDSC(44.003,SDDA,309)),$GET(SDSC(44.003,SDDA,302))))
+7 DO SET^SDAMEP1($$EVENT("Check Out",$GET(SDSC(44.003,SDDA,303)),$GET(SDSC(44.003,SDDA,304))))
+8 DO SET^SDAMEP1($$EVENT("Check Out Entered",$GET(SDSC(44.003,SDDA,306)),""))
+9 DO SET^SDAMEP1($$EVENT("No-Show/Cancel",$GET(SDPT(2.98,SDT,15)),$GET(SDPT(2.98,SDT,14))))
DO SET^SDAMEP1("")
+10 ;
+11 SET X=""
+12 SET X=$$SETSTR^VALM1(" Checked Out:",X,7,SDWIDTH)
+13 SET X=$$SETSTR^VALM1($SELECT($GET(SDOE(409.68,+SDOE,.07))]"":"YES",1:""),X,SDFSTCOL+5,30)
+14 DO SET^SDAMEP1(X)
+15 ;
+16 SET X=""
+17 SET X=$$SETSTR^VALM1(" Cancel Reason:",X,5,SDWIDTH)
+18 SET X=$$SETSTR^VALM1(SDPT(2.98,SDT,16),X,SDFSTCOL+5,30)
+19 DO SET^SDAMEP1(X)
+20 ;
+21 SET X=""
+22 SET X=$$SETSTR^VALM1(" Cancel Remark:",X,5,SDWIDTH)
+23 SET X=$$SETSTR^VALM1(SDPT(2.98,SDT,17),X,SDFSTCOL+5,50)
+24 DO SET^SDAMEP1(X)
+25 ;
+26 SET X=""
+27 SET X=$$SETSTR^VALM1(" Rebooked Date:",X,5,SDWIDTH)
+28 SET X=$$SETSTR^VALM1(SDPT(2.98,SDT,12),X,SDFSTCOL+5,20)
+29 DO SET^SDAMEP1(X)
CWT ;Clinic Wait Time Information
+1 NEW SDCWT,SDCWT1,SDCWT2
+2 ;Get internal data values
+3 FOR SDCWT=3,20,25:1:28
SET SDCWT(SDCWT)=SDPTI(2.98,SDT,SDCWT,"I")
+4 ;Wait time data applicable?
+5 SET SDCWT=1
if $EXTRACT(SDCWT(3))="C"
SET SDCWT=0
+6 SET SDCWT1=SDCWT(20)
SET SDCWT2=SDCWT(27)
+7 ;Calculate Wait Time1
+8 SET SDCWT1=$SELECT(SDCWT1<1:"",SDT<SDCWT1:0,1:$$FMDIFF^XLFDT(SDT,SDCWT1,1))
+9 ;Calculate Wait Time2
+10 if '$$CWT3^SCRPW75(SDT,SDCWT(26),SDCWT(27),SDCWT(28),.SDCWT2)
SET SDCWT2=""
+11 if +SDCWT1=SDCWT1
SET SDCWT1=SDCWT1_" day"_$SELECT(SDCWT1=1:"",1:"s")
+12 if +SDCWT2=SDCWT2
SET SDCWT2=SDCWT2_" day"_$SELECT(SDCWT2=1:"",1:"s")
+13 DO SET^SDAMEP1(" *** Clinic Wait Time Information ***")
+14 DO CNTRL^VALM10(SDLN,20,40,IOINHI,IOINORM)
+15 DO SET^SDAMEP1("")
+16 ;
+17 SET X=""
+18 SET X=$$SETSTR^VALM1(" Request type:",X,7,SDWIDTH+6)
+19 SET X=$$SETSTR^VALM1($SELECT('SDCWT:"N/A",$GET(SDPT(2.98,SDT,25))]"":SDPT(2.98,SDT,25),1:"Unknown"),X,SDFSTCOL+10,50)
+20 DO SET^SDAMEP1(X)
+21 ;
+22 SET X=""
+23 SET X=$$SETSTR^VALM1("'Next Available' Type:",X,5,SDWIDTH+6)
+24 SET X=$$SETSTR^VALM1($SELECT('SDCWT:"N/A",1:SDPT(2.98,SDT,26)),X,SDFSTCOL+10,50)
+25 DO SET^SDAMEP1(X)
+26 ;
+27 SET X=""
+28 ; SD*5.3*645 - replaced Desired date with CID/Preferred date when presented to the user
+29 SET X=$$SETSTR^VALM1(" CID/Preferred date:",X,5,SDWIDTH+6)
+30 SET X=$$SETSTR^VALM1($SELECT('SDCWT:"N/A",1:SDPT(2.98,SDT,27)),X,SDFSTCOL+10,50)
+31 DO SET^SDAMEP1(X)
+32 ;
+33 SET X=""
+34 SET X=$$SETSTR^VALM1(" Follow-up visit:",X,5,SDWIDTH+6)
+35 SET X=$$SETSTR^VALM1($SELECT('SDCWT:"N/A",1:SDPT(2.98,SDT,28)_$SELECT($LENGTH(SDPT(2.98,SDT,28)):" (computed)",1:"")),X,SDFSTCOL+10,50)
+36 DO SET^SDAMEP1(X)
+37 ;
+38 SET X=""
+39 SET X=$$SETSTR^VALM1(" Clinic Wait Time1:",X,5,SDWIDTH+6)
+40 SET X=$$SETSTR^VALM1($SELECT('SDCWT:"N/A",1:SDCWT1),X,SDFSTCOL+10,50)
+41 DO SET^SDAMEP1(X)
+42 ;
+43 SET X=""
+44 SET X=$$SETSTR^VALM1(" Clinic Wait Time2:",X,5,SDWIDTH+6)
+45 SET X=$$SETSTR^VALM1($SELECT('SDCWT:"N/A",1:SDCWT2),X,SDFSTCOL+10,50)
+46 DO SET^SDAMEP1(X)
+47 DO SET^SDAMEP1("")
+48 IF SDCWT
Begin DoDot:1
+49 ;SD*5.3*645 - replaced 'Desired date' with 'CID/Preferred date' when presented to the user
+50 DO SET^SDAMEP1("NOTE: Clinic Wait Time1 represents the difference between the date the")
+51 DO SET^SDAMEP1(" appointment was entered and the date it was performed. Clinic Wait")
+52 DO SET^SDAMEP1(" Time2 represents the difference between the 'CID/Preferred date' and the")
+53 DO SET^SDAMEP1(" date the appointment was performed.")
+54 QUIT
End DoDot:1
QUIT
+55 DO SET^SDAMEP1("")
+56 DO SET^SDAMEP1("NOTE: Clinic Wait Time data is not applicable for appointments that have a")
+57 DO SET^SDAMEP1(" status of 'cancelled by clinic'.")
+58 DO SET^SDAMEP1("")
+59 QUIT
+60 ;
EVENT(TYPE,TIME,USER) ;
+1 QUIT $$SETSTR^VALM1(TYPE,$$SETSTR^VALM1(TIME,$$SETSTR^VALM1(USER,"",50,30),25,21),2,20)
+2 ;