SDRRCRRP ;10n20/MAH;Print Clinic Recall List Routine ;Nov 16, 2006
;;5.3;Scheduling;**536**;Aug 13, 1993;Build 53
;
PRT U IO S (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
D HDR
F S DIV=$O(^TMP($J,"ONDIV",DIV)) Q:DIV="" D
.F S CLINIC=$O(^TMP($J,"ONDIV",DIV,CLINIC)) Q:CLINIC="" W !,?1,"Clinic: "_CLINIC D
..F S PROV=$O(^TMP($J,"ONDIV",DIV,CLINIC,PROV)) Q:PROV="" W !,?1,"Provider: "_PROV D
...F S MONTH=$O(^TMP($J,"ONDIV",DIV,CLINIC,PROV,MONTH)) Q:MONTH="" D
....F S RDT=$O(^TMP($J,"ONDIV",DIV,CLINIC,PROV,MONTH,RDT)) Q:RDT="" D
.....S CNT=0 F S PAT=$O(^TMP($J,"ONDIV",DIV,CLINIC,PROV,MONTH,RDT,PAT)) Q:PAT="" S CNT=CNT+1 D
......S DTA=$G(^TMP($J,"ONDIV",DIV,CLINIC,PROV,MONTH,RDT,PAT))
......S DATE=$P($G(DTA),"^",3),CDT=$P($G(DTA),"^",4),PAT=$P($G(DTA),"^",5),PHONE=$P($G(DTA),"^",6)
......S USER1=$P($G(DTA),"^",8),COMMENT=$P($G(DTA),"^",7),LN=$P($G(DTA),"^",9)
......I ($Y+3)>IOSL D HDR
......W !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
.....W !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
K ^TMP($J,"ONDIV"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
Q
PRT1 U IO S (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
D HDR
F S DIV=$O(^TMP($J,"ENDIV",DIV)) Q:DIV="" D
.I $Y>(IOSL-6) D HDR
.F S CLINIC=$O(^TMP($J,"ENDIV",DIV,CLINIC)) Q:CLINIC="" W !,?1,"Clinic: "_CLINIC D
..F S PROV=$O(^TMP($J,"ENDIV",DIV,CLINIC,PROV)) Q:PROV="" W !,?1,"Provider: "_PROV D
...F S MONTH=$O(^TMP($J,"ENDIV",DIV,CLINIC,PROV,MONTH)) Q:MONTH="" D
....F S RDT=$O(^TMP($J,"ENDIV",DIV,CLINIC,PROV,MONTH,RDT)) Q:RDT="" D
.....S CNT=0 F S PAT=$O(^TMP($J,"ENDIV",DIV,CLINIC,PROV,MONTH,RDT,PAT)) Q:PAT="" S CNT=CNT+1 D
......S DTA=$G(^TMP($J,"ENDIV",DIV,CLINIC,PROV,MONTH,RDT,PAT))
......S DATE=$P($G(DTA),"^",3),CDT=$P($G(DTA),"^",4),PAT=$P($G(DTA),"^",5),PHONE=$P($G(DTA),"^",6)
......S USER1=$P($G(DTA),"^",8),COMMENT=$P($G(DTA),"^",7),LN=$P($G(DTA),"^",9)
......I ($Y+3)>IOSL D HDR
......W !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
.....W !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
K ^TMP($J,"ENDIV"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
Q
PRT2 U IO S (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
D HDR
F S DIV=$O(^TMP($J,"ONCLIN",DIV)) Q:DIV="" D
.F S CLINIC=$O(^TMP($J,"ONCLIN",DIV,CLINIC)) Q:CLINIC="" W !,?1,"Clinic: "_CLINIC D
..F S PROV=$O(^TMP($J,"ONCLIN",DIV,CLINIC,PROV)) Q:PROV="" W !,?1,"Provider: "_PROV D
...F S MONTH=$O(^TMP($J,"ONCLIN",DIV,CLINIC,PROV,MONTH)) Q:MONTH="" D
....F S RDT=$O(^TMP($J,"ONCLIN",DIV,CLINIC,PROV,MONTH,RDT)) Q:RDT="" D
.....S CNT=0 F S PAT=$O(^TMP($J,"ONCLIN",DIV,CLINIC,PROV,MONTH,RDT,PAT)) Q:PAT="" S CNT=CNT+1 D
......S DTA=$G(^TMP($J,"ONCLIN",DIV,CLINIC,PROV,MONTH,RDT,PAT))
......S DATE=$P($G(DTA),"^",3),CDT=$P($G(DTA),"^",4),PAT=$P($G(DTA),"^",5),PHONE=$P($G(DTA),"^",6)
......S USER1=$P($G(DTA),"^",8),COMMENT=$P($G(DTA),"^",7),LN=$P($G(DTA),"^",9)
......I ($Y+3)>IOSL D HDR
......W !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
.....W !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
K ^TMP($J,"ONCLIN"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
Q
PRT3 U IO S (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
D HDR
F S DIV=$O(^TMP($J,"ENCLIN",DIV)) Q:DIV="" D
.F S CLINIC=$O(^TMP($J,"ENCLIN",DIV,CLINIC)) Q:CLINIC="" W !,?1,"Clinic: "_CLINIC D
..F S PROV=$O(^TMP($J,"ENCLIN",DIV,CLINIC,PROV)) Q:PROV="" W !,?1,"Provider: "_PROV D
...F S MONTH=$O(^TMP($J,"ENCLIN",DIV,CLINIC,PROV,MONTH)) Q:MONTH="" D
....F S RDT=$O(^TMP($J,"ENCLIN",DIV,CLINIC,PROV,MONTH,RDT)) Q:RDT="" D
.....S CNT=0 F S PAT=$O(^TMP($J,"ENCLIN",DIV,CLINIC,PROV,MONTH,RDT,PAT)) Q:PAT="" S CNT=CNT+1 D
......S DTA=$G(^TMP($J,"ENCLIN",DIV,CLINIC,PROV,MONTH,RDT,PAT))
......S DATE=$P($G(DTA),"^",3),CDT=$P($G(DTA),"^",4),PAT=$P($G(DTA),"^",5),PHONE=$P($G(DTA),"^",6)
......S USER1=$P($G(DTA),"^",8),COMMENT=$P($G(DTA),"^",7),LN=$P($G(DTA),"^",9)
......I ($Y+3)>IOSL D HDR
......W !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
.....W !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
K ^TMP($J,"ENCLIN"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
Q
PRT4 U IO S (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
D HDR
F S DIV=$O(^TMP($J,"ENTEAM",DIV)) Q:DIV="" W !,?1,"Team: "_DIV D
.F S CLINIC=$O(^TMP($J,"ENTEAM",DIV,CLINIC)) Q:CLINIC="" W !,?1,"Clinic: "_CLINIC D
..F S PROV=$O(^TMP($J,"ENTEAM",DIV,CLINIC,PROV)) Q:PROV="" W !,?1,"Provider: "_PROV D
...F S MONTH=$O(^TMP($J,"ENTEAM",DIV,CLINIC,PROV,MONTH)) Q:MONTH="" D
....F S RDT=$O(^TMP($J,"ENTEAM",DIV,CLINIC,PROV,MONTH,RDT)) Q:RDT="" D
.....S CNT=0 F S PAT=$O(^TMP($J,"ENTEAM",DIV,CLINIC,PROV,MONTH,RDT,PAT)) Q:PAT="" S CNT=CNT+1 D
......S DTA=$G(^TMP($J,"ENTEAM",DIV,CLINIC,PROV,MONTH,RDT,PAT))
......S DATE=$P($G(DTA),"^",3),CDT=$P($G(DTA),"^",4),PAT=$P($G(DTA),"^",5),PHONE=$P($G(DTA),"^",6)
......S USER1=$P($G(DTA),"^",8),COMMENT=$P($G(DTA),"^",7),LN=$P($G(DTA),"^",9)
......I ($Y+3)>IOSL D HDR
......W !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
.....W !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
K ^TMP($J,"ENTEAM"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
Q
PRT5 U IO S (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
D HDR
F S DIV=$O(^TMP($J,"ONTEAM",DIV)) Q:DIV="" W !,?1,"Team: "_DIV D
.F S CLINIC=$O(^TMP($J,"ONTEAM",DIV,CLINIC)) Q:CLINIC="" W !,?1,"Clinic: "_CLINIC D
..F S PROV=$O(^TMP($J,"ONTEAM",DIV,CLINIC,PROV)) Q:PROV="" W !,?1,"Provider: "_PROV D
...F S MONTH=$O(^TMP($J,"ONTEAM",DIV,CLINIC,PROV,MONTH)) Q:MONTH="" D
....F S RDT=$O(^TMP($J,"ONTEAM",DIV,CLINIC,PROV,MONTH,RDT)) Q:RDT="" D
.....S CNT=0 F S PAT=$O(^TMP($J,"ONTEAM",DIV,CLINIC,PROV,MONTH,RDT,PAT)) Q:PAT="" S CNT=CNT+1 D
......S DTA=$G(^TMP($J,"ONTEAM",DIV,CLINIC,PROV,MONTH,RDT,PAT))
......S DATE=$P($G(DTA),"^",3),CDT=$P($G(DTA),"^",4),PAT=$P($G(DTA),"^",5),PHONE=$P($G(DTA),"^",6)
......S USER1=$P($G(DTA),"^",8),COMMENT=$P($G(DTA),"^",7),LN=$P($G(DTA),"^",9)
......I ($Y+3)>IOSL D HDR
......W !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
.....W !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
K ^TMP($J,"ONTEAM"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
Q
;
HDR ;
S PAGE=PAGE+1
S Y=DT D DD^%DT S DT1=Y K Y
S Y=SDT D DD^%DT S SDT1=Y K Y
S Y=EDT D DD^%DT S EDT1=Y K Y
W @IOF
W ?30,"OUTPATIENT CLINIC RECALL LIST"
W !,?25,"For date range: "_SDT1_" to "_EDT1
W !,?30,"Date printed: "_DT1_" Page: ",$J(PAGE,3),!
W !,"Provider",?5,"Recall Date",?18,"Date CS",?34,"Patient",?65,"1U4N",?71,"Phone",?88,"Entered by"
W !,?5,"Comments",!
S $P(LINE,"-",IOM)="-"
W LINE,! K LINE
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDRRCRRP 7043 printed Sep 15, 2024@22:24:30 Page 2
SDRRCRRP ;10n20/MAH;Print Clinic Recall List Routine ;Nov 16, 2006
+1 ;;5.3;Scheduling;**536**;Aug 13, 1993;Build 53
+2 ;
PRT USE IO
SET (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
+1 DO HDR
+2 FOR
SET DIV=$ORDER(^TMP($JOB,"ONDIV",DIV))
if DIV=""
QUIT
Begin DoDot:1
+3 FOR
SET CLINIC=$ORDER(^TMP($JOB,"ONDIV",DIV,CLINIC))
if CLINIC=""
QUIT
WRITE !,?1,"Clinic: "_CLINIC
Begin DoDot:2
+4 FOR
SET PROV=$ORDER(^TMP($JOB,"ONDIV",DIV,CLINIC,PROV))
if PROV=""
QUIT
WRITE !,?1,"Provider: "_PROV
Begin DoDot:3
+5 FOR
SET MONTH=$ORDER(^TMP($JOB,"ONDIV",DIV,CLINIC,PROV,MONTH))
if MONTH=""
QUIT
Begin DoDot:4
+6 FOR
SET RDT=$ORDER(^TMP($JOB,"ONDIV",DIV,CLINIC,PROV,MONTH,RDT))
if RDT=""
QUIT
Begin DoDot:5
+7 SET CNT=0
FOR
SET PAT=$ORDER(^TMP($JOB,"ONDIV",DIV,CLINIC,PROV,MONTH,RDT,PAT))
if PAT=""
QUIT
SET CNT=CNT+1
Begin DoDot:6
+8 SET DTA=$GET(^TMP($JOB,"ONDIV",DIV,CLINIC,PROV,MONTH,RDT,PAT))
+9 SET DATE=$PIECE($GET(DTA),"^",3)
SET CDT=$PIECE($GET(DTA),"^",4)
SET PAT=$PIECE($GET(DTA),"^",5)
SET PHONE=$PIECE($GET(DTA),"^",6)
+10 SET USER1=$PIECE($GET(DTA),"^",8)
SET COMMENT=$PIECE($GET(DTA),"^",7)
SET LN=$PIECE($GET(DTA),"^",9)
+11 IF ($Y+3)>IOSL
DO HDR
+12 WRITE !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
End DoDot:6
+13 WRITE !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+14 KILL ^TMP($JOB,"ONDIV"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
+15 QUIT
PRT1 USE IO
SET (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
+1 DO HDR
+2 FOR
SET DIV=$ORDER(^TMP($JOB,"ENDIV",DIV))
if DIV=""
QUIT
Begin DoDot:1
+3 IF $Y>(IOSL-6)
DO HDR
+4 FOR
SET CLINIC=$ORDER(^TMP($JOB,"ENDIV",DIV,CLINIC))
if CLINIC=""
QUIT
WRITE !,?1,"Clinic: "_CLINIC
Begin DoDot:2
+5 FOR
SET PROV=$ORDER(^TMP($JOB,"ENDIV",DIV,CLINIC,PROV))
if PROV=""
QUIT
WRITE !,?1,"Provider: "_PROV
Begin DoDot:3
+6 FOR
SET MONTH=$ORDER(^TMP($JOB,"ENDIV",DIV,CLINIC,PROV,MONTH))
if MONTH=""
QUIT
Begin DoDot:4
+7 FOR
SET RDT=$ORDER(^TMP($JOB,"ENDIV",DIV,CLINIC,PROV,MONTH,RDT))
if RDT=""
QUIT
Begin DoDot:5
+8 SET CNT=0
FOR
SET PAT=$ORDER(^TMP($JOB,"ENDIV",DIV,CLINIC,PROV,MONTH,RDT,PAT))
if PAT=""
QUIT
SET CNT=CNT+1
Begin DoDot:6
+9 SET DTA=$GET(^TMP($JOB,"ENDIV",DIV,CLINIC,PROV,MONTH,RDT,PAT))
+10 SET DATE=$PIECE($GET(DTA),"^",3)
SET CDT=$PIECE($GET(DTA),"^",4)
SET PAT=$PIECE($GET(DTA),"^",5)
SET PHONE=$PIECE($GET(DTA),"^",6)
+11 SET USER1=$PIECE($GET(DTA),"^",8)
SET COMMENT=$PIECE($GET(DTA),"^",7)
SET LN=$PIECE($GET(DTA),"^",9)
+12 IF ($Y+3)>IOSL
DO HDR
+13 WRITE !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
End DoDot:6
+14 WRITE !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+15 KILL ^TMP($JOB,"ENDIV"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
+16 QUIT
PRT2 USE IO
SET (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
+1 DO HDR
+2 FOR
SET DIV=$ORDER(^TMP($JOB,"ONCLIN",DIV))
if DIV=""
QUIT
Begin DoDot:1
+3 FOR
SET CLINIC=$ORDER(^TMP($JOB,"ONCLIN",DIV,CLINIC))
if CLINIC=""
QUIT
WRITE !,?1,"Clinic: "_CLINIC
Begin DoDot:2
+4 FOR
SET PROV=$ORDER(^TMP($JOB,"ONCLIN",DIV,CLINIC,PROV))
if PROV=""
QUIT
WRITE !,?1,"Provider: "_PROV
Begin DoDot:3
+5 FOR
SET MONTH=$ORDER(^TMP($JOB,"ONCLIN",DIV,CLINIC,PROV,MONTH))
if MONTH=""
QUIT
Begin DoDot:4
+6 FOR
SET RDT=$ORDER(^TMP($JOB,"ONCLIN",DIV,CLINIC,PROV,MONTH,RDT))
if RDT=""
QUIT
Begin DoDot:5
+7 SET CNT=0
FOR
SET PAT=$ORDER(^TMP($JOB,"ONCLIN",DIV,CLINIC,PROV,MONTH,RDT,PAT))
if PAT=""
QUIT
SET CNT=CNT+1
Begin DoDot:6
+8 SET DTA=$GET(^TMP($JOB,"ONCLIN",DIV,CLINIC,PROV,MONTH,RDT,PAT))
+9 SET DATE=$PIECE($GET(DTA),"^",3)
SET CDT=$PIECE($GET(DTA),"^",4)
SET PAT=$PIECE($GET(DTA),"^",5)
SET PHONE=$PIECE($GET(DTA),"^",6)
+10 SET USER1=$PIECE($GET(DTA),"^",8)
SET COMMENT=$PIECE($GET(DTA),"^",7)
SET LN=$PIECE($GET(DTA),"^",9)
+11 IF ($Y+3)>IOSL
DO HDR
+12 WRITE !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
End DoDot:6
+13 WRITE !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+14 KILL ^TMP($JOB,"ONCLIN"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
+15 QUIT
PRT3 USE IO
SET (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
+1 DO HDR
+2 FOR
SET DIV=$ORDER(^TMP($JOB,"ENCLIN",DIV))
if DIV=""
QUIT
Begin DoDot:1
+3 FOR
SET CLINIC=$ORDER(^TMP($JOB,"ENCLIN",DIV,CLINIC))
if CLINIC=""
QUIT
WRITE !,?1,"Clinic: "_CLINIC
Begin DoDot:2
+4 FOR
SET PROV=$ORDER(^TMP($JOB,"ENCLIN",DIV,CLINIC,PROV))
if PROV=""
QUIT
WRITE !,?1,"Provider: "_PROV
Begin DoDot:3
+5 FOR
SET MONTH=$ORDER(^TMP($JOB,"ENCLIN",DIV,CLINIC,PROV,MONTH))
if MONTH=""
QUIT
Begin DoDot:4
+6 FOR
SET RDT=$ORDER(^TMP($JOB,"ENCLIN",DIV,CLINIC,PROV,MONTH,RDT))
if RDT=""
QUIT
Begin DoDot:5
+7 SET CNT=0
FOR
SET PAT=$ORDER(^TMP($JOB,"ENCLIN",DIV,CLINIC,PROV,MONTH,RDT,PAT))
if PAT=""
QUIT
SET CNT=CNT+1
Begin DoDot:6
+8 SET DTA=$GET(^TMP($JOB,"ENCLIN",DIV,CLINIC,PROV,MONTH,RDT,PAT))
+9 SET DATE=$PIECE($GET(DTA),"^",3)
SET CDT=$PIECE($GET(DTA),"^",4)
SET PAT=$PIECE($GET(DTA),"^",5)
SET PHONE=$PIECE($GET(DTA),"^",6)
+10 SET USER1=$PIECE($GET(DTA),"^",8)
SET COMMENT=$PIECE($GET(DTA),"^",7)
SET LN=$PIECE($GET(DTA),"^",9)
+11 IF ($Y+3)>IOSL
DO HDR
+12 WRITE !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
End DoDot:6
+13 WRITE !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+14 KILL ^TMP($JOB,"ENCLIN"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
+15 QUIT
PRT4 USE IO
SET (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
+1 DO HDR
+2 FOR
SET DIV=$ORDER(^TMP($JOB,"ENTEAM",DIV))
if DIV=""
QUIT
WRITE !,?1,"Team: "_DIV
Begin DoDot:1
+3 FOR
SET CLINIC=$ORDER(^TMP($JOB,"ENTEAM",DIV,CLINIC))
if CLINIC=""
QUIT
WRITE !,?1,"Clinic: "_CLINIC
Begin DoDot:2
+4 FOR
SET PROV=$ORDER(^TMP($JOB,"ENTEAM",DIV,CLINIC,PROV))
if PROV=""
QUIT
WRITE !,?1,"Provider: "_PROV
Begin DoDot:3
+5 FOR
SET MONTH=$ORDER(^TMP($JOB,"ENTEAM",DIV,CLINIC,PROV,MONTH))
if MONTH=""
QUIT
Begin DoDot:4
+6 FOR
SET RDT=$ORDER(^TMP($JOB,"ENTEAM",DIV,CLINIC,PROV,MONTH,RDT))
if RDT=""
QUIT
Begin DoDot:5
+7 SET CNT=0
FOR
SET PAT=$ORDER(^TMP($JOB,"ENTEAM",DIV,CLINIC,PROV,MONTH,RDT,PAT))
if PAT=""
QUIT
SET CNT=CNT+1
Begin DoDot:6
+8 SET DTA=$GET(^TMP($JOB,"ENTEAM",DIV,CLINIC,PROV,MONTH,RDT,PAT))
+9 SET DATE=$PIECE($GET(DTA),"^",3)
SET CDT=$PIECE($GET(DTA),"^",4)
SET PAT=$PIECE($GET(DTA),"^",5)
SET PHONE=$PIECE($GET(DTA),"^",6)
+10 SET USER1=$PIECE($GET(DTA),"^",8)
SET COMMENT=$PIECE($GET(DTA),"^",7)
SET LN=$PIECE($GET(DTA),"^",9)
+11 IF ($Y+3)>IOSL
DO HDR
+12 WRITE !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
End DoDot:6
+13 WRITE !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+14 KILL ^TMP($JOB,"ENTEAM"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
+15 QUIT
PRT5 USE IO
SET (PAGE,DIV,CLINIC,PROV,MONTH,RDT,PAT)=0
+1 DO HDR
+2 FOR
SET DIV=$ORDER(^TMP($JOB,"ONTEAM",DIV))
if DIV=""
QUIT
WRITE !,?1,"Team: "_DIV
Begin DoDot:1
+3 FOR
SET CLINIC=$ORDER(^TMP($JOB,"ONTEAM",DIV,CLINIC))
if CLINIC=""
QUIT
WRITE !,?1,"Clinic: "_CLINIC
Begin DoDot:2
+4 FOR
SET PROV=$ORDER(^TMP($JOB,"ONTEAM",DIV,CLINIC,PROV))
if PROV=""
QUIT
WRITE !,?1,"Provider: "_PROV
Begin DoDot:3
+5 FOR
SET MONTH=$ORDER(^TMP($JOB,"ONTEAM",DIV,CLINIC,PROV,MONTH))
if MONTH=""
QUIT
Begin DoDot:4
+6 FOR
SET RDT=$ORDER(^TMP($JOB,"ONTEAM",DIV,CLINIC,PROV,MONTH,RDT))
if RDT=""
QUIT
Begin DoDot:5
+7 SET CNT=0
FOR
SET PAT=$ORDER(^TMP($JOB,"ONTEAM",DIV,CLINIC,PROV,MONTH,RDT,PAT))
if PAT=""
QUIT
SET CNT=CNT+1
Begin DoDot:6
+8 SET DTA=$GET(^TMP($JOB,"ONTEAM",DIV,CLINIC,PROV,MONTH,RDT,PAT))
+9 SET DATE=$PIECE($GET(DTA),"^",3)
SET CDT=$PIECE($GET(DTA),"^",4)
SET PAT=$PIECE($GET(DTA),"^",5)
SET PHONE=$PIECE($GET(DTA),"^",6)
+10 SET USER1=$PIECE($GET(DTA),"^",8)
SET COMMENT=$PIECE($GET(DTA),"^",7)
SET LN=$PIECE($GET(DTA),"^",9)
+11 IF ($Y+3)>IOSL
DO HDR
+12 WRITE !,?5,DATE,?18,CDT,?34,PAT,?65,LN,?71,PHONE,?88,USER1,!,?5,COMMENT
End DoDot:6
+13 WRITE !!,"Daily Sub-Total for "_CLINIC_" - ("_CNT_")",!!
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+14 KILL ^TMP($JOB,"ONTEAM"),DIV,CLINIC,PROV,MONTH,RDT,PAT,CNT,CDT,COMMENT,DATE,DT1,DTA,EDT,EDT1,LN,PAGE,SDT,SDT1,PHONE,USER1
+15 QUIT
+16 ;
HDR ;
+1 SET PAGE=PAGE+1
+2 SET Y=DT
DO DD^%DT
SET DT1=Y
KILL Y
+3 SET Y=SDT
DO DD^%DT
SET SDT1=Y
KILL Y
+4 SET Y=EDT
DO DD^%DT
SET EDT1=Y
KILL Y
+5 WRITE @IOF
+6 WRITE ?30,"OUTPATIENT CLINIC RECALL LIST"
+7 WRITE !,?25,"For date range: "_SDT1_" to "_EDT1
+8 WRITE !,?30,"Date printed: "_DT1_" Page: ",$JUSTIFY(PAGE,3),!
+9 WRITE !,"Provider",?5,"Recall Date",?18,"Date CS",?34,"Patient",?65,"1U4N",?71,"Phone",?88,"Entered by"
+10 WRITE !,?5,"Comments",!
+11 SET $PIECE(LINE,"-",IOM)="-"
+12 WRITE LINE,!
KILL LINE
+13 QUIT