APCLDV3 ; IHS/CMI/LAB - list IPV/DV screenings ;
;;2.0;IHS PCC SUITE;**8,10**;MAY 14, 2009;Build 88
;
INFORM ;
W !,$$CTR($$USR)
W !,$$LOC()
W !!,$$CTR("LISTING OF PATIENT'S RECEIVING IPV SCREENING,INCLUDING REFUSALS",80)
W !!,"This report will list all patients you select who have had IPV screening "
W !,"(Exam code 34) or a refusal documented in a specified time frame."
W !,"You will select the patients based on age, gender, result, provider,"
W !,"or clinic where the screeing was done."
W !!,"NOTE: All screenings done in the time period for the patient's selected "
W !,"will be displayed on the report."
W !
D XIT
S APCLEXC=$O(^AUTTEXAM("C",34,0))
I 'APCLEXC W !!,"Exam code 34 is missing from the EXAM table. Cannot run report.",! H 3 D XIT Q
;
DATES K APCLED,APCLBD
W !,"Please enter the date range during which the screening was done.",!,"To get all screenings ever put in a long date range like 01/01/1980",!,"to the present date.",!
K DIR W ! S DIR(0)="DO^::EXP",DIR("A")="Enter Beginning Date for Screening"
D ^DIR Q:Y<1 S APCLBD=Y
K DIR S DIR(0)="DO^:DT:EXP",DIR("A")="Enter Ending Date for Screening"
D ^DIR Q:Y<1 S APCLED=Y
;
I APCLED<APCLBD D G DATES
. W !!,$C(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
;
FAC ;
K APCLQ
S APCLLOCT=""
S DIR(0)="S^A:ALL Locations/Facilities;S:One SERVICE UNIT'S Locations/Facilities;O:ONE Location/Facility",DIR("A")="Include Visits to Which Location/Facilities",DIR("B")="A"
S DIR("A")="Include screenings done at which facilities",DIR("B")="O" K DA D ^DIR K DIR,DA
G:$D(DIRUT) DATES
S APCLLOCT=Y
I APCLLOCT="A" G COMM
D @APCLLOCT^APCLDV1
G:$D(APCLQ) FAC
COMM ;
K APCLQ
S APCLCOMT=""
W !!,"You can just include patients living in certain communities",!,"or include all patients regardless of where they live."
S DIR(0)="S^A:ALL Patient Communitiess;S:Selected Set (taxonomy) of Communities;O:ONE Community",DIR("A")="Include Visits to Which Location/Facilities",DIR("B")="A"
S DIR("A")="Include screenings done at which facilities",DIR("B")="O" K DA D ^DIR K DIR,DA
G:$D(DIRUT) FAC
S APCLCOMT=Y
I APCLCOMT="A" G EXCL
D @(APCLCOMT_"C")^APCLDV1
G:$D(APCLQ) COMM
EXCL ;
S APCLEXBH=""
W !!,"Would you like to include screenings done in the behavioral health clinics: "
W !,"Mental Health (14); Alcohol and Substance Abuse (43); Medical"
W !,"Social Services (48); Behavioral Health (C4) "
S DIR(0)="Y",DIR("A")="and Telebehavioral Health (C9)",DIR("B")="N" KILL DA D ^DIR KILL DIR
I $D(DIRUT) G DATES
S APCLEXBH=Y
SEX ;
S APCLSEX=""
S DIR(0)="S^F:FEMALES Only;M:MALES Only;U:UNKNOWN GENDER Only;B:ALL GENDERS",DIR("A")="Include which patients in the list",DIR("B")="F" KILL DA D ^DIR KILL DIR
I $D(DIRUT) G EXCL
S APCLSEX=Y
I APCLSEX="B" S APCLSEX="MFU"
AGE ;Age Screening
K APCLAGE,APCLAGET
W ! S DIR(0)="YO",DIR("A")="Would you like to restrict the report by Patient age range",DIR("B")="YES"
S DIR("?")="If you wish to include visits from ALL age ranges, anwser No. If you wish to list visits for only patients within a particular age range, enter Yes."
D ^DIR K DIR
G:$D(DIRUT) SEX
I 'Y G RESULT
;
AGER ;Age Screening
W !
S DIR(0)="FO^1:7",DIR("A")="Enter an Age Range (e.g. 5-12,1-1)" D ^DIR
I Y="" W !!,"No age range entered." G AGE
I Y'?1.3N1"-"1.3N W !!,$C(7),$C(7),"Enter a numeric range in the format nnn-nnn. e.g. 0-5, 0-99, 5-20." G AGER
S APCLAGET=Y
RESULT ;result screenig
K APCLREST
W !!,"You can limit the list to only patients who have had a screening"
W !,"in the time period on which the result was any combination of the"
W !,"following: (e.g. to get only those patients who have had a result of "
W !,"Present enter 2 to get all patients who have had a screening result of"
W !,"Past or Present, enter 2,3)",!
W !?3,"1) Normal/Negative"
W !?3,"2) Present"
W !?3,"3) Past"
W !?3,"4) Present and Past"
W !?3,"5) Refused"
W !?3,"6) Unable to Screen"
W !?3,"7) Screenings done with no result entered"
W !
W !
K DIR S DIR(0)="L^1:7",DIR("A")="Which result values do you want included on this list",DIR("B")="" KILL DA D ^DIR KILL DIR
I $D(DIRUT) G AGE
I Y="" G AGE
S APCLREST=Y
S A=Y,C="" F I=1:1 S C=$P(A,",",I) Q:C="" S APCLREST(C)=""
CLINIC ;
K APCLCLNT
W ! S DIR(0)="Y",DIR("A")="Include visits to ALL clinics",DIR("B")="Yes" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
G:$D(DIRUT) RESULT
I Y=1 G PRIMPRV
CLINIC1 ;
S X="CLINIC",DIC="^AMQQ(5,",DIC(0)="FM",DIC("S")="I $P(^(0),U,14)" D ^DIC K DIC,DA I Y=-1 W "OOPS - QMAN NOT CURRENT - QUITTING" G XIT
D PEP^AMQQGTX0(+Y,"APCLCLNT(")
I '$D(APCLCLNT) G CLINIC
I $D(APCLCLNT("*")) K APCLCLNT
PRIMPRV ;
S (APCLDISC,APCLPSRT,APCLPPUN)="" K APCLPROV
S DIR(0)="SO^O:One Provider Only;P:Any/All Providers (including unknown);U:Unknown Provider Only"
S DIR("A")="Report should include visits whose PRIMARY PROVIDER on the visit is"
S DIR("?")="If you wish to count only one primary provider of service enter a 'O'. To include ALL providers enter an 'A'. To include all providers of one discipline enter a 'D'." D ^DIR K DIR
G:$D(DIRUT) XIT
S APCLPSRT=Y
I Y="P" K APCLPROV G PRVSCR
I Y="U" S APCLPPUN=1 G PRVSCR
PRV1 ;
I $P(^DD(9000010.06,.01,0),U,2)[200 S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D MIX^DIC1 K DIC,D
I $P(^DD(9000010.06,.01,0),U,2)[6 S DIC="^DIC(6,",DIC(0)="AEMQ",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D ^DIC K DIC
I $D(DTOUT)!(Y=-1) G PRIMPRV
S APCLPROV=+Y
PRVSCR ;
S (APCLSSRT,APCLSPUN)="" K APCLSPRV
S DIR(0)="SO^O:One Provider Only;P:Any/All Providers (including unknown);U:Unknown Provider Only"
S DIR("A")="Select which providers WHO PERFORMED THE SCREENING should be included"
S DIR("?")="If you wish to count only one Provider enter a 'O'. To include ALL providers enter an 'A'. To include all providers of one discipline enter a 'D'." D ^DIR K DIR
G:$D(DIRUT) XIT
S APCLSSRT=Y
I Y="P" K APCLSPRV G DESPRV
I Y="U" S APCLSPUN=1 G DESPRV
SCRPRV1 ;
I $P(^DD(9000010.06,.01,0),U,2)[200 S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D MIX^DIC1 K DIC,D
I $P(^DD(9000010.06,.01,0),U,2)[6 S DIC="^DIC(6,",DIC(0)="AEMQ",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D ^DIC K DIC
I $D(DTOUT)!(Y=-1) G PRVSCR
S APCLSPRV=+Y
DESPRV ;
S APCLDESP=""
W !!,"Would you like to limit the list to just patients who have"
S DIR(0)="Y",DIR("A")="a particular designated primary care provider",DIR("B")="N" KILL DA D ^DIR KILL DIR
I $D(DIRUT) G PRIMPRV
I 'Y S APCLDESP="" G TEMP
DESPRV1 ;
I $P(^DD(9000010.06,.01,0),U,2)[200 S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D MIX^DIC1 K DIC,D
I $P(^DD(9000010.06,.01,0),U,2)[6 S DIC="^DIC(6,",DIC(0)="AEMQ",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D ^DIC K DIC
I $D(DTOUT)!(Y=-1) G DESPRV
S APCLDESP=+Y
TEMP ;TEMPLATE OR LIST
S APCLTMPL="",APCLSTMP=""
S DIR(0)="SO^L:List of Patient Screenings;S:Create a Search Template of Patients",DIR("B")="L",DIR("A")="Select Report Type"
D ^DIR K DIR
I $D(DIRUT) G DESPRV
S APCLTMPL=Y
I APCLTMPL="S" D ^APCLSTMP G:APCLSTMP="" TEMP G ZIS
LIST1 ;
S APCLSORT=""
W !
S DIR(0)="S^H:Health Record Number;N:Patient Name;P:Provider who screened;C:Clinic;R:Result of Exam;D:Date Screened;A:Age of Patient at Screening;G:Gender of Patient;T:Terminal Digit HRN"
S DIR("A")="How would you like the list to be sorted",DIR("B")="H"
KILL DA D ^DIR KILL DIR
I $D(DIRUT) G PRIMPRV
S APCLSORT=Y
DP ;
S APCLDP=""
W !
S DIR(0)="Y",DIR("A")="Display the Patient's Designated Providers on the list",DIR("B")="N" KILL DA D ^DIR KILL DIR
I $D(DIRUT) G LIST1
S APCLDP=Y
ZIS ;
DEMO ;
D DEMOCHK^APCLUTL(.APCLDEMO)
I APCLDEMO=-1 G DP
S XBRP="PRINT^APCLDV3P",XBRC="PROC^APCLDV31",XBRX="XIT^APCLDV3",XBNS="APCL"
D ^XBDBQUE
D XIT
Q
XIT ;
D EN^XBVK("APCL")
D ^XBFMK
Q
CTR(X,Y) ;EP - Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
EOP ;EP - End of page.
Q:$E(IOST)'="C"
Q:IO'=IO(0)
Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
NEW DIR
K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
W !
S DIR("A")="End of Report. Press Enter",DIR(0)="E" D ^DIR
Q
;----------
USR() ;EP - Return name of current user from ^VA(200.
Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
;----------
APCLDV3 ; IHS/CMI/LAB - list IPV/DV screenings ;
+1 ;;2.0;IHS PCC SUITE;**8,10**;MAY 14, 2009;Build 88
+2 ;
INFORM ;
+1 WRITE !,$$CTR($$USR)
+2 WRITE !,$$LOC()
+3 WRITE !!,$$CTR("LISTING OF PATIENT'S RECEIVING IPV SCREENING,INCLUDING REFUSALS",80)
+4 WRITE !!,"This report will list all patients you select who have had IPV screening "
+5 WRITE !,"(Exam code 34) or a refusal documented in a specified time frame."
+6 WRITE !,"You will select the patients based on age, gender, result, provider,"
+7 WRITE !,"or clinic where the screeing was done."
+8 WRITE !!,"NOTE: All screenings done in the time period for the patient's selected "
+9 WRITE !,"will be displayed on the report."
+10 WRITE !
+11 DO XIT
+12 SET APCLEXC=$ORDER(^AUTTEXAM("C",34,0))
+13 IF 'APCLEXC
WRITE !!,"Exam code 34 is missing from the EXAM table. Cannot run report.",!
HANG 3
DO XIT
QUIT
+14 ;
DATES KILL APCLED,APCLBD
+1 WRITE !,"Please enter the date range during which the screening was done.",!,"To get all screenings ever put in a long date range like 01/01/1980",!,"to the present date.",!
+2 KILL DIR
WRITE !
SET DIR(0)="DO^::EXP"
SET DIR("A")="Enter Beginning Date for Screening"
+3 DO ^DIR
IF Y<1
QUIT
SET APCLBD=Y
+4 KILL DIR
SET DIR(0)="DO^:DT:EXP"
SET DIR("A")="Enter Ending Date for Screening"
+5 DO ^DIR
IF Y<1
QUIT
SET APCLED=Y
+6 ;
+7 IF APCLED<APCLBD
Begin DoDot:1
+8 WRITE !!,$CHAR(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
End DoDot:1
GOTO DATES
+9 ;
FAC ;
+1 KILL APCLQ
+2 SET APCLLOCT=""
+3 SET DIR(0)="S^A:ALL Locations/Facilities;S:One SERVICE UNIT'S Locations/Facilities;O:ONE Location/Facility"
SET DIR("A")="Include Visits to Which Location/Facilities"
SET DIR("B")="A"
+4 SET DIR("A")="Include screenings done at which facilities"
SET DIR("B")="O"
KILL DA
DO ^DIR
KILL DIR,DA
+5 IF $DATA(DIRUT)
GOTO DATES
+6 SET APCLLOCT=Y
+7 IF APCLLOCT="A"
GOTO COMM
+8 DO @APCLLOCT^APCLDV1
+9 IF $DATA(APCLQ)
GOTO FAC
COMM ;
+1 KILL APCLQ
+2 SET APCLCOMT=""
+3 WRITE !!,"You can just include patients living in certain communities",!,"or include all patients regardless of where they live."
+4 SET DIR(0)="S^A:ALL Patient Communitiess;S:Selected Set (taxonomy) of Communities;O:ONE Community"
SET DIR("A")="Include Visits to Which Location/Facilities"
SET DIR("B")="A"
+5 SET DIR("A")="Include screenings done at which facilities"
SET DIR("B")="O"
KILL DA
DO ^DIR
KILL DIR,DA
+6 IF $DATA(DIRUT)
GOTO FAC
+7 SET APCLCOMT=Y
+8 IF APCLCOMT="A"
GOTO EXCL
+9 DO @(APCLCOMT_"C")^APCLDV1
+10 IF $DATA(APCLQ)
GOTO COMM
EXCL ;
+1 SET APCLEXBH=""
+2 WRITE !!,"Would you like to include screenings done in the behavioral health clinics: "
+3 WRITE !,"Mental Health (14); Alcohol and Substance Abuse (43); Medical"
+4 WRITE !,"Social Services (48); Behavioral Health (C4) "
+5 SET DIR(0)="Y"
SET DIR("A")="and Telebehavioral Health (C9)"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+6 IF $DATA(DIRUT)
GOTO DATES
+7 SET APCLEXBH=Y
SEX ;
+1 SET APCLSEX=""
+2 SET DIR(0)="S^F:FEMALES Only;M:MALES Only;U:UNKNOWN GENDER Only;B:ALL GENDERS"
SET DIR("A")="Include which patients in the list"
SET DIR("B")="F"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
GOTO EXCL
+4 SET APCLSEX=Y
+5 IF APCLSEX="B"
SET APCLSEX="MFU"
AGE ;Age Screening
+1 KILL APCLAGE,APCLAGET
+2 WRITE !
SET DIR(0)="YO"
SET DIR("A")="Would you like to restrict the report by Patient age range"
SET DIR("B")="YES"
+3 SET DIR("?")="If you wish to include visits from ALL age ranges, anwser No. If you wish to list visits for only patients within a particular age range, enter Yes."
+4 DO ^DIR
KILL DIR
+5 IF $DATA(DIRUT)
GOTO SEX
+6 IF 'Y
GOTO RESULT
+7 ;
AGER ;Age Screening
+1 WRITE !
+2 SET DIR(0)="FO^1:7"
SET DIR("A")="Enter an Age Range (e.g. 5-12,1-1)"
DO ^DIR
+3 IF Y=""
WRITE !!,"No age range entered."
GOTO AGE
+4 IF Y'?1.3N1"-"1.3N
WRITE !!,$CHAR(7),$CHAR(7),"Enter a numeric range in the format nnn-nnn. e.g. 0-5, 0-99, 5-20."
GOTO AGER
+5 SET APCLAGET=Y
RESULT ;result screenig
+1 KILL APCLREST
+2 WRITE !!,"You can limit the list to only patients who have had a screening"
+3 WRITE !,"in the time period on which the result was any combination of the"
+4 WRITE !,"following: (e.g. to get only those patients who have had a result of "
+5 WRITE !,"Present enter 2 to get all patients who have had a screening result of"
+6 WRITE !,"Past or Present, enter 2,3)",!
+7 WRITE !?3,"1) Normal/Negative"
+8 WRITE !?3,"2) Present"
+9 WRITE !?3,"3) Past"
+10 WRITE !?3,"4) Present and Past"
+11 WRITE !?3,"5) Refused"
+12 WRITE !?3,"6) Unable to Screen"
+13 WRITE !?3,"7) Screenings done with no result entered"
+14 WRITE !
+15 WRITE !
+16 KILL DIR
SET DIR(0)="L^1:7"
SET DIR("A")="Which result values do you want included on this list"
SET DIR("B")=""
KILL DA
DO ^DIR
KILL DIR
+17 IF $DATA(DIRUT)
GOTO AGE
+18 IF Y=""
GOTO AGE
+19 SET APCLREST=Y
+20 SET A=Y
SET C=""
FOR I=1:1
SET C=$PIECE(A,",",I)
IF C=""
QUIT
SET APCLREST(C)=""
CLINIC ;
+1 KILL APCLCLNT
+2 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Include visits to ALL clinics"
SET DIR("B")="Yes"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+3 IF $DATA(DIRUT)
GOTO RESULT
+4 IF Y=1
GOTO PRIMPRV
CLINIC1 ;
+1 SET X="CLINIC"
SET DIC="^AMQQ(5,"
SET DIC(0)="FM"
SET DIC("S")="I $P(^(0),U,14)"
DO ^DIC
KILL DIC,DA
IF Y=-1
WRITE "OOPS - QMAN NOT CURRENT - QUITTING"
GOTO XIT
+2 DO PEP^AMQQGTX0(+Y,"APCLCLNT(")
+3 IF '$DATA(APCLCLNT)
GOTO CLINIC
+4 IF $DATA(APCLCLNT("*"))
KILL APCLCLNT
PRIMPRV ;
+1 SET (APCLDISC,APCLPSRT,APCLPPUN)=""
KILL APCLPROV
+2 SET DIR(0)="SO^O:One Provider Only;P:Any/All Providers (including unknown);U:Unknown Provider Only"
+3 SET DIR("A")="Report should include visits whose PRIMARY PROVIDER on the visit is"
+4 SET DIR("?")="If you wish to count only one primary provider of service enter a 'O'. To include ALL providers enter an 'A'. To include all providers of one discipline enter a 'D'."
DO ^DIR
KILL DIR
+5 IF $DATA(DIRUT)
GOTO XIT
+6 SET APCLPSRT=Y
+7 IF Y="P"
KILL APCLPROV
GOTO PRVSCR
+8 IF Y="U"
SET APCLPPUN=1
GOTO PRVSCR
PRV1 ;
+1 IF $PIECE(^DD(9000010.06,.01,0),U,2)[200
SET DIC="^VA(200,"
SET DIC(0)="AEMQ"
SET D="AK.PROVIDER"
SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
DO MIX^DIC1
KILL DIC,D
+2 IF $PIECE(^DD(9000010.06,.01,0),U,2)[6
SET DIC="^DIC(6,"
SET DIC(0)="AEMQ"
SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
DO ^DIC
KILL DIC
+3 IF $DATA(DTOUT)!(Y=-1)
GOTO PRIMPRV
+4 SET APCLPROV=+Y
PRVSCR ;
+1 SET (APCLSSRT,APCLSPUN)=""
KILL APCLSPRV
+2 SET DIR(0)="SO^O:One Provider Only;P:Any/All Providers (including unknown);U:Unknown Provider Only"
+3 SET DIR("A")="Select which providers WHO PERFORMED THE SCREENING should be included"
+4 SET DIR("?")="If you wish to count only one Provider enter a 'O'. To include ALL providers enter an 'A'. To include all providers of one discipline enter a 'D'."
DO ^DIR
KILL DIR
+5 IF $DATA(DIRUT)
GOTO XIT
+6 SET APCLSSRT=Y
+7 IF Y="P"
KILL APCLSPRV
GOTO DESPRV
+8 IF Y="U"
SET APCLSPUN=1
GOTO DESPRV
SCRPRV1 ;
+1 IF $PIECE(^DD(9000010.06,.01,0),U,2)[200
SET DIC="^VA(200,"
SET DIC(0)="AEMQ"
SET D="AK.PROVIDER"
SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
DO MIX^DIC1
KILL DIC,D
+2 IF $PIECE(^DD(9000010.06,.01,0),U,2)[6
SET DIC="^DIC(6,"
SET DIC(0)="AEMQ"
SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
DO ^DIC
KILL DIC
+3 IF $DATA(DTOUT)!(Y=-1)
GOTO PRVSCR
+4 SET APCLSPRV=+Y
DESPRV ;
+1 SET APCLDESP=""
+2 WRITE !!,"Would you like to limit the list to just patients who have"
+3 SET DIR(0)="Y"
SET DIR("A")="a particular designated primary care provider"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+4 IF $DATA(DIRUT)
GOTO PRIMPRV
+5 IF 'Y
SET APCLDESP=""
GOTO TEMP
DESPRV1 ;
+1 IF $PIECE(^DD(9000010.06,.01,0),U,2)[200
SET DIC="^VA(200,"
SET DIC(0)="AEMQ"
SET D="AK.PROVIDER"
SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
DO MIX^DIC1
KILL DIC,D
+2 IF $PIECE(^DD(9000010.06,.01,0),U,2)[6
SET DIC="^DIC(6,"
SET DIC(0)="AEMQ"
SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
DO ^DIC
KILL DIC
+3 IF $DATA(DTOUT)!(Y=-1)
GOTO DESPRV
+4 SET APCLDESP=+Y
TEMP ;TEMPLATE OR LIST
+1 SET APCLTMPL=""
SET APCLSTMP=""
+2 SET DIR(0)="SO^L:List of Patient Screenings;S:Create a Search Template of Patients"
SET DIR("B")="L"
SET DIR("A")="Select Report Type"
+3 DO ^DIR
KILL DIR
+4 IF $DATA(DIRUT)
GOTO DESPRV
+5 SET APCLTMPL=Y
+6 IF APCLTMPL="S"
DO ^APCLSTMP
IF APCLSTMP=""
GOTO TEMP
GOTO ZIS
LIST1 ;
+1 SET APCLSORT=""
+2 WRITE !
+3 SET DIR(0)="S^H:Health Record Number;N:Patient Name;P:Provider who screened;C:Clinic;R:Result of Exam;D:Date Screened;A:Age of Patient at Screening;G:Gender of Patient;T:Terminal Digit HRN"
+4 SET DIR("A")="How would you like the list to be sorted"
SET DIR("B")="H"
+5 KILL DA
DO ^DIR
KILL DIR
+6 IF $DATA(DIRUT)
GOTO PRIMPRV
+7 SET APCLSORT=Y
DP ;
+1 SET APCLDP=""
+2 WRITE !
+3 SET DIR(0)="Y"
SET DIR("A")="Display the Patient's Designated Providers on the list"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+4 IF $DATA(DIRUT)
GOTO LIST1
+5 SET APCLDP=Y
ZIS ;
DEMO ;
+1 DO DEMOCHK^APCLUTL(.APCLDEMO)
+2 IF APCLDEMO=-1
GOTO DP
+3 SET XBRP="PRINT^APCLDV3P"
SET XBRC="PROC^APCLDV31"
SET XBRX="XIT^APCLDV3"
SET XBNS="APCL"
+4 DO ^XBDBQUE
+5 DO XIT
+6 QUIT
XIT ;
+1 DO EN^XBVK("APCL")
+2 DO ^XBFMK
+3 QUIT
CTR(X,Y) ;EP - Center X in a field Y wide.
+1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
+2 ;----------
EOP ;EP - End of page.
+1 IF $EXTRACT(IOST)'="C"
QUIT
+2 IF IO'=IO(0)
QUIT
+3 IF $DATA(ZTQUEUED)!'(IOT="TRM")!$DATA(IO("S"))
QUIT
+4 NEW DIR
+5 KILL DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
+6 WRITE !
+7 SET DIR("A")="End of Report. Press Enter"
SET DIR(0)="E"
DO ^DIR
+8 QUIT
+9 ;----------
USR() ;EP - Return name of current user from ^VA(200.
+1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
+2 ;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
+1 QUIT $SELECT($GET(DUZ(2)):$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
+2 ;----------