SDRRINQ1 ;10N20/MAH - Recall Reminder PATIENT INQUIRY ;01/28/2008 11:32
;;5.3;Scheduling;**536,566,582,648**;Aug 13, 1993;Build 3
; Option: SDRR PATIENT INQUIRY - PRINT
QUE S %ZIS="MQ" D ^%ZIS G:POP QUIT
;G ALL
I $D(IO("Q")) S ZTRTN="ALL^SDRRINQ1",ZTDTH=$H,ZTDESC="RECALL REMINDER INQUIRY",ZTSAVE("DFN")="",ZTSAVE("SDT")="",ZTSAVE("EDT")="",ZTSAVE("RANGE")="" D ^%ZTLOAD W:$D(ZTSK) !,"Your Task has been Queued" G QUIT
ALL ;SHOW ON SCREEN
U IO
D:RANGE=0 ACT,ARC,REPORT,REPORT1 G QUIT
D:RANGE=1 SEL,SEL1,REPORT,REPORT1 G QUIT
Q
SEL I $D(^SD(403.5,"B",DFN)) S (RSENT,SSENT,PRDT,TYPE)="" S IEN=0 F S IEN=$O(^SD(403.5,"B",DFN,IEN)) Q:'IEN S NODE=$G(^SD(403.5,IEN,0)) D
.S CLINIC=$P($G(NODE),"^",2),CLINIC=$$GET1^DIQ(44,CLINIC_",",.01),ACCINFOR=$P($G(NODE),"^",3)
.S TYPE=$P($G(NODE),"^",4) I TYPE'="" S TYPE=$P(^SD(403.51,TYPE,0),"^",1)
.S PROVIDER=$P(NODE,"^",5) I PROVIDER'="" S PROVIDER=$P($G(^SD(403.54,PROVIDER,0)),"^",1) S PROVIDER=$$NAME^XUSER(PROVIDER,"F")
.I PROVIDER="" S PROVIDER="Unknown"
.S RDT=""
.S Y=$P(NODE,"^",6) Q:Y<SDT!(Y>EDT)
.I Y>SDT,(Y<EDT) D DD^%DT S RDT=Y K Y,X
.S COMMENT=$P($G(NODE),"^",7)
.S FAST=$S($P(NODE,"^",8)["n":"NO",$P(NODE,"^",8)["y":"YES",1:"")
.S LOA=$P(NODE,"^",9)
.S RSENT="" ;SD*566
.S Y=$P($G(NODE),"^",10) I Y'="" D DD^%DT S RSENT=Y K Y,X
.I RSENT="" S RSENT="NOTSENT"
.S USER=$P($G(NODE),"^",11),USER=$$NAME^XUSER(USER,"F")
.S Y=$P(NODE,"^",12) I Y'="" D DD^%DT S PRDT=Y K Y,X
.S Y=$P(NODE,"^",13) I Y'="" D DD^%DT S SSENT="*"_Y K Y,X
.S ^TMP("SDRRINQ",$J,"ACT",IEN)=CLINIC_"^"_ACCINFOR_"^"_TYPE_"^"_PROVIDER_"^"_RDT_"^"_COMMENT_"^"_FAST_"^"_LOA_"^"_RSENT_"^"_USER_"^"_PRDT_"^"_SSENT
.S SSENT="" ;SD*582
Q
SEL1 I $D(^SD(403.56,"B",DFN)) S (USER,RSENT,PRDTA,TYPE)="" S IENA=0 F S IENA=$O(^SD(403.56,"B",DFN,IENA)) Q:'IENA S NODEA=$G(^SD(403.56,IENA,0)) D
.S CLINIC=$P($G(NODEA),"^",2),CLINIC=$$GET1^DIQ(44,CLINIC_",",.01),ACCINFOR=$P($G(NODEA),"^",3)
.S TYPE=$P($G(NODEA),"^",4) I TYPE'="" S TYPE=$P(^SD(403.51,TYPE,0),"^",1)
.S PROVIDER=$P(NODEA,"^",5) I PROVIDER'="" S PROVIDER=$P($G(^SD(403.54,PROVIDER,0)),"^",1) S PROVIDER=$$NAME^XUSER(PROVIDER,"F")
.I PROVIDER="" S PROVIDER="Unknown"
.S RDT=""
.S Y=$P(NODEA,"^",6) Q:Y<SDT!(Y>EDT)
.I Y>SDT&(Y<EDT) D DD^%DT S RDT=Y K Y,X
.S COMMENT=$P($G(NODEA),"^",7)
.S FAST=$S($P(NODEA,"^",8)["n":"NO",$P(NODEA,"^",8)["y":"YES",1:"")
.S LOA=$P(NODEA,"^",9)
.S RSENT="" ;SD*566
.S Y=$P($G(NODEA),"^",10) I Y'="" D DD^%DT S RSENT=Y K Y,X
.I RSENT="" S RSENT="NOTSENT"
.S USER=$P($G(NODEA),"^",11),USER=$$NAME^XUSER(USER,"F")
.I $D(^SD(403.56,IENA,2)) S NODEA2=$G(^SD(403.56,IENA,2)) D
..S Y=$P(NODEA2,"^",1) D DD^%DT S PRDTA=Y K Y,X
..S USER2=$P($G(NODEA2),"^",2),USER2=$$NAME^XUSER(USER2,"F")
..S SDRREASN=$S($P(NODEA2,"^",3)=1:"FTR",$P(NODEA2,"^",3)=2:"MOVED",$P(NODEA2,"^",3)=3:"DECEASED",$P(NODEA2,"^",3)=4:"DNWC",$P(NODEA2,"^",3)=5:"RCOVA",$P(NODEA2,"^",3)=6:"OTHER",$P(NODEA2,"^",3)=7:"Scheduled",1:"")
..S ^TMP("SDRRINQ",$J,"ARC",IENA)=CLINIC_"^"_ACCINFOR_"^"_TYPE_"^"_PROVIDER_"^"_RDT_"^"_COMMENT_"^"_FAST_"^"_LOA_"^"_RSENT_"^"_USER2_"^"_USER_"^"_SDRREASN_"^"_PRDTA
Q
HDR ;Review all Recall Reminder on screen for all
D DEM^VADPT S NAME=VADM(1),LAST4=VA("BID"),DOB=$P(VADM(3),"^",2) S HDR="Patient Name: "_NAME_" Date of Birth: "_DOB_" Last4: "_LAST4
W @IOF,HDR
Q
ACT I $D(^SD(403.5,"B",DFN)) S (RSENT,SSENT,IEN,PRDT,TYPE)="" F S IEN=$O(^SD(403.5,"B",DFN,IEN)) Q:'IEN S NODE=$G(^SD(403.5,IEN,0)) D
.S CLINIC=$P($G(NODE),"^",2),CLINIC=$$GET1^DIQ(44,CLINIC_",",.01),ACCINFOR=$P($G(NODE),"^",3)
.S TYPE=$P($G(NODE),"^",4) I TYPE'="" S TYPE=$P(^SD(403.51,TYPE,0),"^",1)
.S PROVIDER=$P(NODE,"^",5) I PROVIDER'="" S PROVIDER=$P($G(^SD(403.54,PROVIDER,0)),"^",1) S PROVIDER=$$NAME^XUSER(PROVIDER,"F")
.I PROVIDER="" S PROVIDER="Unknown"
.S RDT=""
.S Y=$P(NODE,"^",6) D DD^%DT S RDT=Y K Y,X
.S COMMENT=$P($G(NODE),"^",7)
.S FAST=$S($P(NODE,"^",8)["n":"NO",$P(NODE,"^",8)["f":"YES",1:"")
.S LOA=$P(NODE,"^",9)
.S RSENT="" ;SD*566
.S Y=$P($G(NODE),"^",10) I Y'="" D DD^%DT S RSENT=Y K Y,X
.I RSENT="" S RSENT="NOTSENT"
.S USER=$P($G(NODE),"^",11),USER=$$NAME^XUSER(USER,"F")
.S Y=$P(NODE,"^",12) I Y'="" D DD^%DT S PRDT=Y K Y,X
.S Y=$P(NODE,"^",13) I Y'="" D DD^%DT S SSENT="*"_Y K Y,X
.S ^TMP("SDRRINQ",$J,"ACT",IEN)=CLINIC_"^"_ACCINFOR_"^"_TYPE_"^"_PROVIDER_"^"_RDT_"^"_COMMENT_"^"_FAST_"^"_LOA_"^"_RSENT_"^"_USER_"^"_PRDT_"^"_SSENT
.S SSENT="" ;SD*582
Q
ARC I $D(^SD(403.56,"B",DFN)) S (USER,RSENT,PRDTA,TYPE)="" S IENA=0 F S IENA=$O(^SD(403.56,"B",DFN,IENA)) Q:'IENA S NODEA=$G(^SD(403.56,IENA,0)) D
.S CLINIC=$P($G(NODEA),"^",2),CLINIC=$$GET1^DIQ(44,CLINIC_",",.01),ACCINFOR=$P($G(NODEA),"^",3)
.S TYPE=$P($G(NODEA),"^",4) I TYPE'="" S TYPE=$P(^SD(403.51,TYPE,0),"^",1)
.S PROVIDER=$P(NODEA,"^",5) I PROVIDER'="" S PROVIDER=$P($G(^SD(403.54,PROVIDER,0)),"^",1) S PROVIDER=$$NAME^XUSER(PROVIDER,"F")
.I PROVIDER="" S PROVIDER="Unknown"
.S RDT=""
.S Y=$P(NODEA,"^",6) D DD^%DT S RDT=Y K Y,X
.S COMMENT=$P($G(NODEA),"^",7)
.S FAST=$S($P(NODEA,"^",8)["n":"NO",$P(NODEA,"^",8)["f":"YES",1:"")
.S LOA=$P(NODEA,"^",9)
.S RSENT="" ;SD*566
.S Y=$P($G(NODEA),"^",10) I Y'="" D DD^%DT S RSENT=Y K Y,X
.I RSENT="" S RSENT="NOTSENT"
.S USER=$P($G(NODEA),"^",11),USER=$$NAME^XUSER(USER,"F")
.I $D(^SD(403.56,IENA,2)) S NODEA2=$G(^SD(403.56,IENA,2)) D
..S Y=$P(NODEA2,"^",1) D DD^%DT S PRDTA=Y K Y,X
..S USER2=$P($G(NODEA2),"^",2),USER2=$$NAME^XUSER(USER2,"F")
..S SDRREASN=$S($P(NODEA2,"^",3)=1:"FTR",$P(NODEA2,"^",3)=2:"MOVED",$P(NODEA2,"^",3)=3:"DECEASED",$P(NODEA2,"^",3)=4:"DNWC",$P(NODEA2,"^",3)=5:"RCOVA",$P(NODEA2,"^",3)=6:"OTHER",$P(NODEA2,"^",3)=7:"Scheduled",1:"")
..S ^TMP("SDRRINQ",$J,"ARC",IENA)=CLINIC_"^"_ACCINFOR_"^"_TYPE_"^"_PROVIDER_"^"_RDT_"^"_COMMENT_"^"_FAST_"^"_LOA_"^"_RSENT_"^"_USER2_"^"_USER_"^"_SDRREASN_"^"_PRDTA
Q
REPORT D HDR
I '$D(^TMP("SDRRINQ",$J,"ACT")) W !!,?25,"No ACTIVE Recalls Reminders on file"
I $D(^TMP("SDRRINQ",$J,"ACT")) S ITEM=0 F S ITEM=$O(^TMP("SDRRINQ",$J,"ACT",ITEM)) Q:'ITEM D
.S INFOR=$G(^TMP("SDRRINQ",$J,"ACT",ITEM))
.W !!,?5,"Clinic: "_$P($G(INFOR),"^",1),?45,"Recall Date: "_$P($G(INFOR),"^",5)
.W !,?5,"Provider: "_$P($G(INFOR),"^",4),?45,"Appt/Type: "_$P($G(INFOR),"^",3)
.W !,?5,"Fasting/NonFasting: "_$P($G(INFOR),"^",7)
.W !,?5,"Appt Requested Length: "_$P($G(INFOR),"^",8),?45,"Date Reminder Sent: "_$P($G(INFOR),"^",9)
.W !,?5,"User who Entered: "_$P($G(INFOR),"^",10),?45,"Patient Requested Dt: "_$P($G(INFOR),"^",11)
.W !,?5,"Date Second Reminder Sent: "_$P($G(INFOR),"^",12)
.W !,?5,"Comments: "_$P($G(INFOR),"^",6)
.I IOST["C-",($Y>(IOSL-6)) K DIR S DIR(0)="E",DIR("A")="Press Return for more Information.." D ^DIR Q:$D(DUOUT)!($D(DTOUT)) D HDR K DIR
Q
REPORT1 D HDR
I '$D(^TMP("SDRRINQ",$J,"ARC")) W !!,?25,"No INACTIVE Recalls Reminders on file" Q
I $D(^TMP("SDRRINQ",$J,"ARC")) W !!,?25,"INACTIVE RECALL REMINDERS"
S ITEM=0 F S ITEM=$O(^TMP("SDRRINQ",$J,"ARC",ITEM)) Q:'ITEM D
.S INFOR=$G(^TMP("SDRRINQ",$J,"ARC",ITEM))
.W !!,?5,"Clinic: "_$P($G(INFOR),"^",1),?45,"Recall Date: "_$P($G(INFOR),"^",5)
.W !,?5,"Provider: "_$P($G(INFOR),"^",4),?45,"Appt/Type: "_$P($G(INFOR),"^",3)
.W !,?5,"Fasting/NonFasting: "_$P($G(INFOR),"^",7)
.W !,?5,"Appt Requested Length: "_$P($G(INFOR),"^",8),?45,"Date Reminder Sent: "_$P($G(INFOR),"^",9)
.W !,?5,"User who Entered: "_$P($G(INFOR),"^",11) ;SD*566 fix to print correct user, also removed Patient Requested Date for inactive recalls
.W !,?5,"Date Removed from Active File: "_$P($G(INFOR),"^",13)
.W !,?5,"Reason for Removal: "_$P($G(INFOR),"^",12)
.W !,?5,"User who Deleted Entry: "_$P($G(INFOR),"^",10)
.W !,?5,"Comments: "_$P($G(INFOR),"^",6)
.I IOST["C-",($Y>(IOSL-6)) K DIR S DIR(0)="E",DIR("A")="Press Return for more Information.." D ^DIR Q:$D(DUOUT)!($D(DTOUT)) D HDR K DIR
Q
QUIT D ^%ZISC K POP,%ZIS,IOP,ZTDESC,ZTDTH,ZTRTN,ZTSAVE,ZTSK
K DFN,Y,SHOW,SHOW1,ACCINFOR,CLINIC,COMMENT,DOB,DIRUT,DTOUT,DUOUT,EDT,ERR,FAST,HDR,IEN,IENA,INFOR,ITEM,LAST4,LOA,NAME
K NODE,NODEA,PRDT,PRDTA,PROVIDER,RANGE,RDT,RSENT,SDRREASN,SDT,SSENT,TYPE,USER,USER2,NODEA2,YES,DIR
K ^TMP("SDRRINQ",$J),VA,VA,VADM
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDRRINQ1 8253 printed Dec 13, 2024@03:00:43 Page 2
SDRRINQ1 ;10N20/MAH - Recall Reminder PATIENT INQUIRY ;01/28/2008 11:32
+1 ;;5.3;Scheduling;**536,566,582,648**;Aug 13, 1993;Build 3
+2 ; Option: SDRR PATIENT INQUIRY - PRINT
QUE SET %ZIS="MQ"
DO ^%ZIS
if POP
GOTO QUIT
+1 ;G ALL
+2 IF $DATA(IO("Q"))
SET ZTRTN="ALL^SDRRINQ1"
SET ZTDTH=$HOROLOG
SET ZTDESC="RECALL REMINDER INQUIRY"
SET ZTSAVE("DFN")=""
SET ZTSAVE("SDT")=""
SET ZTSAVE("EDT")=""
SET ZTSAVE("RANGE")=""
DO ^%ZTLOAD
if $DATA(ZTSK)
WRITE !,"Your Task has been Queued"
GOTO QUIT
ALL ;SHOW ON SCREEN
+1 USE IO
+2 if RANGE=0
DO ACT
DO ARC
DO REPORT
DO REPORT1
GOTO QUIT
+3 if RANGE=1
DO SEL
DO SEL1
DO REPORT
DO REPORT1
GOTO QUIT
+4 QUIT
SEL IF $DATA(^SD(403.5,"B",DFN))
SET (RSENT,SSENT,PRDT,TYPE)=""
SET IEN=0
FOR
SET IEN=$ORDER(^SD(403.5,"B",DFN,IEN))
if 'IEN
QUIT
SET NODE=$GET(^SD(403.5,IEN,0))
Begin DoDot:1
+1 SET CLINIC=$PIECE($GET(NODE),"^",2)
SET CLINIC=$$GET1^DIQ(44,CLINIC_",",.01)
SET ACCINFOR=$PIECE($GET(NODE),"^",3)
+2 SET TYPE=$PIECE($GET(NODE),"^",4)
IF TYPE'=""
SET TYPE=$PIECE(^SD(403.51,TYPE,0),"^",1)
+3 SET PROVIDER=$PIECE(NODE,"^",5)
IF PROVIDER'=""
SET PROVIDER=$PIECE($GET(^SD(403.54,PROVIDER,0)),"^",1)
SET PROVIDER=$$NAME^XUSER(PROVIDER,"F")
+4 IF PROVIDER=""
SET PROVIDER="Unknown"
+5 SET RDT=""
+6 SET Y=$PIECE(NODE,"^",6)
if Y<SDT!(Y>EDT)
QUIT
+7 IF Y>SDT
IF (Y<EDT)
DO DD^%DT
SET RDT=Y
KILL Y,X
+8 SET COMMENT=$PIECE($GET(NODE),"^",7)
+9 SET FAST=$SELECT($PIECE(NODE,"^",8)["n":"NO",$PIECE(NODE,"^",8)["y":"YES",1:"")
+10 SET LOA=$PIECE(NODE,"^",9)
+11 ;SD*566
SET RSENT=""
+12 SET Y=$PIECE($GET(NODE),"^",10)
IF Y'=""
DO DD^%DT
SET RSENT=Y
KILL Y,X
+13 IF RSENT=""
SET RSENT="NOTSENT"
+14 SET USER=$PIECE($GET(NODE),"^",11)
SET USER=$$NAME^XUSER(USER,"F")
+15 SET Y=$PIECE(NODE,"^",12)
IF Y'=""
DO DD^%DT
SET PRDT=Y
KILL Y,X
+16 SET Y=$PIECE(NODE,"^",13)
IF Y'=""
DO DD^%DT
SET SSENT="*"_Y
KILL Y,X
+17 SET ^TMP("SDRRINQ",$JOB,"ACT",IEN)=CLINIC_"^"_ACCINFOR_"^"_TYPE_"^"_PROVIDER_"^"_RDT_"^"_COMMENT_"^"_FAST_"^"_LOA_"^"_RSENT_"^"_USER_"^"_PRDT_"^"_SSENT
+18 ;SD*582
SET SSENT=""
End DoDot:1
+19 QUIT
SEL1 IF $DATA(^SD(403.56,"B",DFN))
SET (USER,RSENT,PRDTA,TYPE)=""
SET IENA=0
FOR
SET IENA=$ORDER(^SD(403.56,"B",DFN,IENA))
if 'IENA
QUIT
SET NODEA=$GET(^SD(403.56,IENA,0))
Begin DoDot:1
+1 SET CLINIC=$PIECE($GET(NODEA),"^",2)
SET CLINIC=$$GET1^DIQ(44,CLINIC_",",.01)
SET ACCINFOR=$PIECE($GET(NODEA),"^",3)
+2 SET TYPE=$PIECE($GET(NODEA),"^",4)
IF TYPE'=""
SET TYPE=$PIECE(^SD(403.51,TYPE,0),"^",1)
+3 SET PROVIDER=$PIECE(NODEA,"^",5)
IF PROVIDER'=""
SET PROVIDER=$PIECE($GET(^SD(403.54,PROVIDER,0)),"^",1)
SET PROVIDER=$$NAME^XUSER(PROVIDER,"F")
+4 IF PROVIDER=""
SET PROVIDER="Unknown"
+5 SET RDT=""
+6 SET Y=$PIECE(NODEA,"^",6)
if Y<SDT!(Y>EDT)
QUIT
+7 IF Y>SDT&(Y<EDT)
DO DD^%DT
SET RDT=Y
KILL Y,X
+8 SET COMMENT=$PIECE($GET(NODEA),"^",7)
+9 SET FAST=$SELECT($PIECE(NODEA,"^",8)["n":"NO",$PIECE(NODEA,"^",8)["y":"YES",1:"")
+10 SET LOA=$PIECE(NODEA,"^",9)
+11 ;SD*566
SET RSENT=""
+12 SET Y=$PIECE($GET(NODEA),"^",10)
IF Y'=""
DO DD^%DT
SET RSENT=Y
KILL Y,X
+13 IF RSENT=""
SET RSENT="NOTSENT"
+14 SET USER=$PIECE($GET(NODEA),"^",11)
SET USER=$$NAME^XUSER(USER,"F")
+15 IF $DATA(^SD(403.56,IENA,2))
SET NODEA2=$GET(^SD(403.56,IENA,2))
Begin DoDot:2
+16 SET Y=$PIECE(NODEA2,"^",1)
DO DD^%DT
SET PRDTA=Y
KILL Y,X
+17 SET USER2=$PIECE($GET(NODEA2),"^",2)
SET USER2=$$NAME^XUSER(USER2,"F")
+18 SET SDRREASN=$SELECT($PIECE(NODEA2,"^",3)=1:"FTR",$PIECE(NODEA2,"^",3)=2:"MOVED",$PIECE(NODEA2,"^",3)=3:"DECEASED",$PIECE(NODEA2,"^",3)=4:"DNWC",$PIECE(NODEA2,"^",3)=5:"RCOVA",$PIECE(NODEA2,"^",3)=6:"OTHER",$PIECE(NODEA2,"^"
,3)=7:"Scheduled",1:"")
+19 SET ^TMP("SDRRINQ",$JOB,"ARC",IENA)=CLINIC_"^"_ACCINFOR_"^"_TYPE_"^"_PROVIDER_"^"_RDT_"^"_COMMENT_"^"_FAST_"^"_LOA_"^"_RSENT_"^"_USER2_"^"_USER_"^"_SDRREASN_"^"_PRDTA
End DoDot:2
End DoDot:1
+20 QUIT
HDR ;Review all Recall Reminder on screen for all
+1 DO DEM^VADPT
SET NAME=VADM(1)
SET LAST4=VA("BID")
SET DOB=$PIECE(VADM(3),"^",2)
SET HDR="Patient Name: "_NAME_" Date of Birth: "_DOB_" Last4: "_LAST4
+2 WRITE @IOF,HDR
+3 QUIT
ACT IF $DATA(^SD(403.5,"B",DFN))
SET (RSENT,SSENT,IEN,PRDT,TYPE)=""
FOR
SET IEN=$ORDER(^SD(403.5,"B",DFN,IEN))
if 'IEN
QUIT
SET NODE=$GET(^SD(403.5,IEN,0))
Begin DoDot:1
+1 SET CLINIC=$PIECE($GET(NODE),"^",2)
SET CLINIC=$$GET1^DIQ(44,CLINIC_",",.01)
SET ACCINFOR=$PIECE($GET(NODE),"^",3)
+2 SET TYPE=$PIECE($GET(NODE),"^",4)
IF TYPE'=""
SET TYPE=$PIECE(^SD(403.51,TYPE,0),"^",1)
+3 SET PROVIDER=$PIECE(NODE,"^",5)
IF PROVIDER'=""
SET PROVIDER=$PIECE($GET(^SD(403.54,PROVIDER,0)),"^",1)
SET PROVIDER=$$NAME^XUSER(PROVIDER,"F")
+4 IF PROVIDER=""
SET PROVIDER="Unknown"
+5 SET RDT=""
+6 SET Y=$PIECE(NODE,"^",6)
DO DD^%DT
SET RDT=Y
KILL Y,X
+7 SET COMMENT=$PIECE($GET(NODE),"^",7)
+8 SET FAST=$SELECT($PIECE(NODE,"^",8)["n":"NO",$PIECE(NODE,"^",8)["f":"YES",1:"")
+9 SET LOA=$PIECE(NODE,"^",9)
+10 ;SD*566
SET RSENT=""
+11 SET Y=$PIECE($GET(NODE),"^",10)
IF Y'=""
DO DD^%DT
SET RSENT=Y
KILL Y,X
+12 IF RSENT=""
SET RSENT="NOTSENT"
+13 SET USER=$PIECE($GET(NODE),"^",11)
SET USER=$$NAME^XUSER(USER,"F")
+14 SET Y=$PIECE(NODE,"^",12)
IF Y'=""
DO DD^%DT
SET PRDT=Y
KILL Y,X
+15 SET Y=$PIECE(NODE,"^",13)
IF Y'=""
DO DD^%DT
SET SSENT="*"_Y
KILL Y,X
+16 SET ^TMP("SDRRINQ",$JOB,"ACT",IEN)=CLINIC_"^"_ACCINFOR_"^"_TYPE_"^"_PROVIDER_"^"_RDT_"^"_COMMENT_"^"_FAST_"^"_LOA_"^"_RSENT_"^"_USER_"^"_PRDT_"^"_SSENT
+17 ;SD*582
SET SSENT=""
End DoDot:1
+18 QUIT
ARC IF $DATA(^SD(403.56,"B",DFN))
SET (USER,RSENT,PRDTA,TYPE)=""
SET IENA=0
FOR
SET IENA=$ORDER(^SD(403.56,"B",DFN,IENA))
if 'IENA
QUIT
SET NODEA=$GET(^SD(403.56,IENA,0))
Begin DoDot:1
+1 SET CLINIC=$PIECE($GET(NODEA),"^",2)
SET CLINIC=$$GET1^DIQ(44,CLINIC_",",.01)
SET ACCINFOR=$PIECE($GET(NODEA),"^",3)
+2 SET TYPE=$PIECE($GET(NODEA),"^",4)
IF TYPE'=""
SET TYPE=$PIECE(^SD(403.51,TYPE,0),"^",1)
+3 SET PROVIDER=$PIECE(NODEA,"^",5)
IF PROVIDER'=""
SET PROVIDER=$PIECE($GET(^SD(403.54,PROVIDER,0)),"^",1)
SET PROVIDER=$$NAME^XUSER(PROVIDER,"F")
+4 IF PROVIDER=""
SET PROVIDER="Unknown"
+5 SET RDT=""
+6 SET Y=$PIECE(NODEA,"^",6)
DO DD^%DT
SET RDT=Y
KILL Y,X
+7 SET COMMENT=$PIECE($GET(NODEA),"^",7)
+8 SET FAST=$SELECT($PIECE(NODEA,"^",8)["n":"NO",$PIECE(NODEA,"^",8)["f":"YES",1:"")
+9 SET LOA=$PIECE(NODEA,"^",9)
+10 ;SD*566
SET RSENT=""
+11 SET Y=$PIECE($GET(NODEA),"^",10)
IF Y'=""
DO DD^%DT
SET RSENT=Y
KILL Y,X
+12 IF RSENT=""
SET RSENT="NOTSENT"
+13 SET USER=$PIECE($GET(NODEA),"^",11)
SET USER=$$NAME^XUSER(USER,"F")
+14 IF $DATA(^SD(403.56,IENA,2))
SET NODEA2=$GET(^SD(403.56,IENA,2))
Begin DoDot:2
+15 SET Y=$PIECE(NODEA2,"^",1)
DO DD^%DT
SET PRDTA=Y
KILL Y,X
+16 SET USER2=$PIECE($GET(NODEA2),"^",2)
SET USER2=$$NAME^XUSER(USER2,"F")
+17 SET SDRREASN=$SELECT($PIECE(NODEA2,"^",3)=1:"FTR",$PIECE(NODEA2,"^",3)=2:"MOVED",$PIECE(NODEA2,"^",3)=3:"DECEASED",$PIECE(NODEA2,"^",3)=4:"DNWC",$PIECE(NODEA2,"^",3)=5:"RCOVA",$PIECE(NODEA2,"^",3)=6:"OTHER",$PIECE(NODEA2,"^"
,3)=7:"Scheduled",1:"")
+18 SET ^TMP("SDRRINQ",$JOB,"ARC",IENA)=CLINIC_"^"_ACCINFOR_"^"_TYPE_"^"_PROVIDER_"^"_RDT_"^"_COMMENT_"^"_FAST_"^"_LOA_"^"_RSENT_"^"_USER2_"^"_USER_"^"_SDRREASN_"^"_PRDTA
End DoDot:2
End DoDot:1
+19 QUIT
REPORT DO HDR
+1 IF '$DATA(^TMP("SDRRINQ",$JOB,"ACT"))
WRITE !!,?25,"No ACTIVE Recalls Reminders on file"
+2 IF $DATA(^TMP("SDRRINQ",$JOB,"ACT"))
SET ITEM=0
FOR
SET ITEM=$ORDER(^TMP("SDRRINQ",$JOB,"ACT",ITEM))
if 'ITEM
QUIT
Begin DoDot:1
+3 SET INFOR=$GET(^TMP("SDRRINQ",$JOB,"ACT",ITEM))
+4 WRITE !!,?5,"Clinic: "_$PIECE($GET(INFOR),"^",1),?45,"Recall Date: "_$PIECE($GET(INFOR),"^",5)
+5 WRITE !,?5,"Provider: "_$PIECE($GET(INFOR),"^",4),?45,"Appt/Type: "_$PIECE($GET(INFOR),"^",3)
+6 WRITE !,?5,"Fasting/NonFasting: "_$PIECE($GET(INFOR),"^",7)
+7 WRITE !,?5,"Appt Requested Length: "_$PIECE($GET(INFOR),"^",8),?45,"Date Reminder Sent: "_$PIECE($GET(INFOR),"^",9)
+8 WRITE !,?5,"User who Entered: "_$PIECE($GET(INFOR),"^",10),?45,"Patient Requested Dt: "_$PIECE($GET(INFOR),"^",11)
+9 WRITE !,?5,"Date Second Reminder Sent: "_$PIECE($GET(INFOR),"^",12)
+10 WRITE !,?5,"Comments: "_$PIECE($GET(INFOR),"^",6)
+11 IF IOST["C-"
IF ($Y>(IOSL-6))
KILL DIR
SET DIR(0)="E"
SET DIR("A")="Press Return for more Information.."
DO ^DIR
if $DATA(DUOUT)!($DATA(DTOUT))
QUIT
DO HDR
KILL DIR
End DoDot:1
+12 QUIT
REPORT1 DO HDR
+1 IF '$DATA(^TMP("SDRRINQ",$JOB,"ARC"))
WRITE !!,?25,"No INACTIVE Recalls Reminders on file"
QUIT
+2 IF $DATA(^TMP("SDRRINQ",$JOB,"ARC"))
WRITE !!,?25,"INACTIVE RECALL REMINDERS"
+3 SET ITEM=0
FOR
SET ITEM=$ORDER(^TMP("SDRRINQ",$JOB,"ARC",ITEM))
if 'ITEM
QUIT
Begin DoDot:1
+4 SET INFOR=$GET(^TMP("SDRRINQ",$JOB,"ARC",ITEM))
+5 WRITE !!,?5,"Clinic: "_$PIECE($GET(INFOR),"^",1),?45,"Recall Date: "_$PIECE($GET(INFOR),"^",5)
+6 WRITE !,?5,"Provider: "_$PIECE($GET(INFOR),"^",4),?45,"Appt/Type: "_$PIECE($GET(INFOR),"^",3)
+7 WRITE !,?5,"Fasting/NonFasting: "_$PIECE($GET(INFOR),"^",7)
+8 WRITE !,?5,"Appt Requested Length: "_$PIECE($GET(INFOR),"^",8),?45,"Date Reminder Sent: "_$PIECE($GET(INFOR),"^",9)
+9 ;SD*566 fix to print correct user, also removed Patient Requested Date for inactive recalls
WRITE !,?5,"User who Entered: "_$PIECE($GET(INFOR),"^",11)
+10 WRITE !,?5,"Date Removed from Active File: "_$PIECE($GET(INFOR),"^",13)
+11 WRITE !,?5,"Reason for Removal: "_$PIECE($GET(INFOR),"^",12)
+12 WRITE !,?5,"User who Deleted Entry: "_$PIECE($GET(INFOR),"^",10)
+13 WRITE !,?5,"Comments: "_$PIECE($GET(INFOR),"^",6)
+14 IF IOST["C-"
IF ($Y>(IOSL-6))
KILL DIR
SET DIR(0)="E"
SET DIR("A")="Press Return for more Information.."
DO ^DIR
if $DATA(DUOUT)!($DATA(DTOUT))
QUIT
DO HDR
KILL DIR
End DoDot:1
+15 QUIT
QUIT DO ^%ZISC
KILL POP,%ZIS,IOP,ZTDESC,ZTDTH,ZTRTN,ZTSAVE,ZTSK
+1 KILL DFN,Y,SHOW,SHOW1,ACCINFOR,CLINIC,COMMENT,DOB,DIRUT,DTOUT,DUOUT,EDT,ERR,FAST,HDR,IEN,IENA,INFOR,ITEM,LAST4,LOA,NAME
+2 KILL NODE,NODEA,PRDT,PRDTA,PROVIDER,RANGE,RDT,RSENT,SDRREASN,SDT,SSENT,TYPE,USER,USER2,NODEA2,YES,DIR
+3 KILL ^TMP("SDRRINQ",$JOB),VA,VA,VADM
+4 QUIT