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

APCDCAFK.m

Go to the documentation of this file.
  1. APCDCAFK ; IHS/CMI/LAB - ; 19 Dec 2014 2:06 PM
  1. ;;2.0;IHS PCC SUITE;**2,5,11,16**;MAY 14, 2009;Build 9
  1. ;
  1. START ;
  1. D XIT
  1. I '$D(IOF) D HOME^%ZIS
  1. D TERM^VALM0
  1. W @(IOF),!!
  1. D INFORM
  1. I $P(^APCCCTRL(DUZ(2),0),U,12)="" W !!,"The EHR/PCC Coding Audit Start Date has not been set",!,"in the PCC Master Control file." D D XIT Q
  1. .W !!,"Please see your Clinical Coordinator or PCC Manager."
  1. .S DIR(0)="E",DIR("A")="Press Enter" KILL DA D ^DIR KILL DIR
  1. .Q
  1. ;
  1. VD ;
  1. S (APCDBD,APCDED)=""
  1. S DIR(0)="S^A:All Visits;S:Visits in a Date Range",DIR("A")="What Visit date range should be included",DIR("B")="A" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G XIT
  1. I Y="A" G FAC
  1. DATES ;K APCDED,APCDBD
  1. K DIR W ! S DIR(0)="DO^::EXP",DIR("A")="Enter Beginning Visit Date"
  1. D ^DIR G:Y<1 VD S APCDBD=Y
  1. K DIR S DIR(0)="DO^:DT:EXP",DIR("A")="Enter Ending Visit Date"
  1. D ^DIR G:Y<1 VD S APCDED=Y
  1. ;
  1. I APCDED<APCDBD D G DATES
  1. . W !!,$C(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
  1. ;
  1. FAC ;
  1. K APCDQ
  1. W !!,$G(IORVON)_"Please enter which FACILITY visits will be included in the list."_$G(IORVOFF),!
  1. S APCDLOCT=""
  1. K APCDLOCS
  1. S DIR(0)="S^A:ALL Locations/Facilities;S:Selected set or Taxonomy of Locations;O:ONE Location/Facility",DIR("A")="Include Visits to Which Location/Facilities",DIR("B")="A"
  1. S DIR("A")="Enter a code indicating what LOCATIONS/FACILITIES are of interest",DIR("B")="A" K DA D ^DIR K DIR,DA
  1. G:$D(DIRUT) XIT
  1. S APCDLOCT=Y
  1. I APCDLOCT="A" G HOSPLOC
  1. D @(APCDLOCT_"LOC")
  1. G:$D(APCDQ) FAC
  1. HOSPLOC ;
  1. K APCDQ
  1. W !!,$G(IORVON)_"Please enter which HOSPITAL LOCATIONS will be included in the list."_$G(IORVOFF),!
  1. S APCDHLT=""
  1. K APCDHLS
  1. S DIR(0)="S^A:ALL Hospital Locations;S:Selected set of Hospital Locations;O:ONE Hospital Location",DIR("A")="Include Visits to Which Hospital Locations",DIR("B")="A"
  1. S DIR("A")="Enter a code indicating what HOSPITAL LOCATIONS are of interest",DIR("B")="A" K DA D ^DIR K DIR,DA
  1. G:$D(DIRUT) FAC
  1. S APCDHLT=Y
  1. I APCDHLT="A" G CLINIC
  1. D @(APCDHLT_"HL")
  1. G:$D(APCDQ) HOSPLOC
  1. CLINIC ;
  1. K APCDQ
  1. W !!,$G(IORVON)_"Please enter which CLINIC (IHS clinic codes) visits will be included",!,"in the list."_$G(IORVOFF),!
  1. S APCDCLNT=""
  1. K APCDCLNS
  1. K DIR S DIR(0)="S^A:ALL Clinics;S:Selected set or Taxonomy of Clinics;O:ONE Clinic",DIR("A")="Include Visits to Which Clinics",DIR("B")="A"
  1. S DIR("A")="Enter a code indicating what CLINICS (IHS clinic code) are of interest",DIR("B")="A" K DA D ^DIR K DIR,DA
  1. G:$D(DIRUT) HOSPLOC
  1. S APCDCLNT=Y
  1. I APCDCLNT="A" G SC
  1. D @(APCDCLNT_"CLN")
  1. G:$D(APCDQ) CLINIC
  1. SC ;
  1. K APCDQ
  1. W !!,$G(IORVON)_"Please enter which SERVICE CATEGORIES will be included",!,"in the list."_$G(IORVOFF),!
  1. S APCDSCT=""
  1. K APCDSCS
  1. K DIR S DIR(0)="S^A:ALL Service Categories;S:Selected set or Taxonomy of Service Categories;O:One Service Category",DIR("A")="Include Visits to Which Service Categories",DIR("B")="A"
  1. S DIR("A")="Enter a code indicating what SERVICE CATEGORIES are of interest",DIR("B")="A" K DA D ^DIR K DIR,DA
  1. G:$D(DIRUT) CLINIC
  1. S APCDSCT=Y
  1. I APCDSCT="A" G PROV
  1. D @(APCDSCT_"SC")
  1. G:$D(APCDQ) SC
  1. PROV ;
  1. K APCDQ
  1. S APCDPRVT=""
  1. K APCDPRVS
  1. S DIR(0)="S^A:ALL Providers;S:Selected set or Taxonomy of Providers;O:ONE Provider",DIR("A")="Include Which Providers",DIR("B")="A"
  1. S DIR("A")="Enter a code indicating which providers are of interest",DIR("B")="A" K DA D ^DIR K DIR,DA
  1. G:$D(DIRUT) SC
  1. S APCDPRVT=Y
  1. I APCDPRVT="A" G PROCESS
  1. D @(APCDPRVT_"PRV")
  1. G:$D(APCDQ) PROV
  1. PROCESS ;
  1. W:$D(IOF) @IOF W !!
  1. W !!,"I will display provider deficiencies that meet the following criteria:"
  1. W !!,"LOCATION OF ENCOUNTER: " D
  1. .I '$D(APCDLOCS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDLOCS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^DIC(4,Y,0),U),1,15)
  1. W !!,"HOSPITAL LOCATIONS: " D
  1. .I '$D(APCDHLS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDHLS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^SC(Y,0),U),1,15)
  1. W !!,"CLINICS: " D
  1. .I '$D(APCDCLNS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDCLNS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^DIC(40.7,Y,0),U),1,15)
  1. W !!,"SERVICE CATEGORIES: " D
  1. .I '$D(APCDSCS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDSCS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$$EXTSET^XBFUNC(9000010,.07,Y)
  1. W !!,"PROVIDERS: " D
  1. .I '$D(APCDPRVS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDPRVS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^VA(200,Y,0),U),1,15)
  1. RTYPE ;how to sort list of visits
  1. S APCDRTYP=""
  1. S DIR(0)="S^1:Individual Provider Listings Only;2:Summary Page Only;3:Both",DIR("A")="Select Report Type",DIR("B")="3" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G PROV
  1. S APCDRTYP=Y
  1. I APCDRTYP=2 G ZIS
  1. PAGE ;
  1. S APCDSPAG=0
  1. S DIR(0)="Y",DIR("A")="Do you want each provider's listing on a separate page",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G RTYPE
  1. S APCDSPAG=Y
  1. ZIS ;call xbdbque
  1. S DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen",DIR("A")="Do you wish to ",DIR("B")="P" K DA D ^DIR K DIR
  1. I $D(DIRUT) G RTYPE
  1. I $G(Y)="B" D BROWSE,XIT Q
  1. S XBRC="DRIVER^APCDCAFK",XBRP="PRINT^APCDCAFK",XBRX="XIT^APCDCAFK",XBNS="APCD"
  1. D ^XBDBQUE
  1. D XIT
  1. Q
  1. BROWSE ;
  1. S XBRP="VIEWR^XBLM(""PRINT^APCDCAFK"")"
  1. S XBNS="APCD",XBRC="DRIVER^APCDCAFK",XBRX="XIT^APCDCAFK",XBIOP=0 D ^XBDBQUE
  1. Q
  1. ;
  1. DRIVER ;EP entry point for taskman
  1. S APCDBT=$H,APCDJOB=$J
  1. K ^XTMP("APCDCAFK",APCDJOB,APCDBT)
  1. S APCDPROV=0
  1. F S APCDPROV=$O(^AUPNCANT("APEND",APCDPROV)) Q:APCDPROV'=+APCDPROV D
  1. .I $D(APCDPRVS),'$D(APCDPRVS(APCDPROV)) Q ;not a PROV we want
  1. .S APCDV=0 F S APCDV=$O(^AUPNCANT("APEND",APCDPROV,APCDV)) Q:APCDV'=+APCDV D
  1. ..S APCDV0=^AUPNVSIT(APCDV,0)
  1. ..Q:'$P(APCDV0,U,9) ;NO DEP ENTRIES
  1. ..Q:$P(APCDV0,U,11) ;DELETED
  1. ..I APCDBD,$$VD^APCLV(APCDV)<APCDBD Q
  1. ..I APCDED,$$VD^APCLV(APCDV)>APCDED Q
  1. ..S APCDVLOC=$P(APCDV0,U,6)
  1. ..Q:APCDVLOC=""
  1. ..I $D(APCDLOCS),'$D(APCDLOCS(APCDVLOC)) Q ;not a location we want
  1. ..S X=$P(APCDV0,U,7)
  1. ..Q:X="" ;no sc
  1. ..I $D(APCDSCS),'$D(APCDSCS(X)) Q ;not a sc we want
  1. ..S APCDVCLN=$P(APCDV0,U,8)
  1. ..I APCDVCLN="",$D(APCDCLNS) Q ;clinic blank and want certain clinics
  1. ..I $D(APCDCLNS),'$D(APCDCLNS(APCDVCLN)) Q ;not a CLINIC we want
  1. ..S APCDVHL=$P(APCDV0,U,22)
  1. ..I APCDVHL="",$D(APCDHLS) Q ;HOSP LOC blank and want certain HOSP LOCS
  1. ..I $D(APCDHLS),'$D(APCDHLS(APCDVHL)) Q ;not a HOSP LOC we want
  1. ..S $P(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","SUMMARY",APCDPROV),U,1)=$P($G(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","SUMMARY",APCDPROV)),U,1)+1
  1. ..S D=$$FMDIFF^XLFDT(DT,$$VD^APCLV(APCDV))
  1. ..S E=$P($G(^APCDSITE(DUZ(2),0)),U,38) S:E="" E=3 I D>E S $P(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","SUMMARY",APCDPROV),U,2)=$P($G(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","SUMMARY",APCDPROV)),U,2)+1
  1. ..;NOW STORE EACH DEFICIENCY
  1. ..S APCDI=0 F S APCDI=$O(^AUPNCANT("APEND",APCDPROV,APCDV,APCDI)) Q:APCDI'=+APCDI D
  1. ...S ^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV",APCDPROV,$$VD^APCLV(APCDV),APCDV,APCDI)=""
  1. ...;SUMMARY INFO
  1. ...S X=$P(^AUPNCANT(APCDV,12,APCDI,0),U,2)
  1. ...S ^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","CDR",APCDPROV,X)=$G(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","CDR",APCDPROV,X))+1
  1. S APCDET=$H
  1. Q
  1. XIT ;
  1. K DIR
  1. D EN^XBVK("APCD")
  1. D ^XBFMK
  1. D KILL^AUPNPAT
  1. D EN^XBVK("AMQQ")
  1. Q
  1. ;
  1. D(D) ;
  1. I $G(D)="" Q ""
  1. Q $E(D,4,5)_"/"_$E(D,6,7)_"/"_$E(D,2,3)
  1. CTR(X,Y) ;EP
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------
  1. EOP ;EP - End of page.
  1. Q:$E(IOST)'="C"
  1. Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
  1. NEW DIR
  1. K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
  1. S DIR("A")="End of report. Press Enter",DIR(0)="E" D ^DIR
  1. Q
  1. ;----------
  1. USR() ;EP
  1. Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
  1. ;----------
  1. LOC() ;EP
  1. Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
  1. ;----------
  1. INFORM ;
  1. W !,$$CTR($$LOC)
  1. W !!,$$CTR("PCC/EHR CODING AUDIT")
  1. W !!,"This report will list all PENDING deficiencies for a selected"
  1. W !,"set of providers."
  1. Q
  1. OLOC ;one location
  1. D OLOC^APCDCAFD
  1. Q
  1. SLOC ;
  1. D SLOC^APCDCAFD
  1. Q
  1. ;
  1. OCLN ;one clinic
  1. D OCLN^APCDCAFD
  1. Q
  1. SCLN ;taxonomy of clinics
  1. D SCLN^APCDCAFD
  1. Q
  1. ;
  1. OHL ;
  1. S DIC="^SC(",DIC(0)="AEMQ",DIC("A")="Which HOSPITAL LOCATION: " D ^DIC K DIC
  1. I Y=-1 S APCDQ="" Q
  1. S APCDHLS(+Y)=""
  1. Q
  1. SHL ;
  1. S DIC="^SC(",DIC(0)="AEMQ",DIC("A")="Which HOSPITAL LOCATION: " D ^DIC K DIC
  1. I X="" Q
  1. I Y=-1 S APCDQ="" Q
  1. S APCDHLS(+Y)=""
  1. G SHL
  1. Q
  1. OPRV ;one clinic
  1. S DIC="^VA(200,",DIC(0)="AEMQ",DIC("A")="Which PROVIDER: " D ^DIC K DIC
  1. I Y=-1 S APCDQ="" Q
  1. S APCDPRVS(+Y)=""
  1. Q
  1. SPRV ;
  1. S X="PRIMARY PROVIDER",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
  1. D PEP^AMQQGTX0(+Y,"APCDPRVS(")
  1. I '$D(APCDPRVS) S APCDQ="" Q
  1. I $D(APCDPRVS("*")) S APCDPRVT="A" K APCDPRVS W !!,"**** all PROVIDERS will be included ****",! Q
  1. Q
  1. ;
  1. SSC ;
  1. S X="SERVICE CATEGORY",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 FAC
  1. D PEP^AMQQGTX0(+Y,"APCDSCS(")
  1. I '$D(APCDSCS) S APCDQ="" Q
  1. I $D(APCDSCS("*")) S APCDSCT="A" K APCDSCS W !!,"**** all Services Categories will be included ****",! Q
  1. Q
  1. OSC ;
  1. K DIR S DIR(0)="9000010,.07",DIR("A")="Enter SERVICE CATEGORY" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) S APCDQ="" Q
  1. S APCDSCS(Y)=""
  1. Q
  1. ;----------
  1. PRINT ;EP - called from xbdbque
  1. S APCD80S="-------------------------------------------------------------------------------"
  1. S APCDPG=0
  1. K APCDQUIT
  1. D COVPAGE
  1. D PRINT1
  1. DONE ;
  1. I $D(APCDQUIT) G XIT1
  1. I $E(IOST)="C",IO=IO(0) S DIR(0)="E" D ^DIR K DIR
  1. W:$D(IOF) @IOF
  1. XIT1 ; Clean up and exit
  1. K ^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV")
  1. D EN^XBVK("APCD")
  1. Q
  1. SH ;
  1. W !!?10,"Incomplete Charts for ",$$GET1^DIQ(200,APCDS,.01)
  1. Q
  1. PRINT1 ;
  1. K APCDQUIT
  1. I APCDRTYP=2 G SUMPAGE
  1. I 'APCDSPAG D HEAD
  1. I '$D(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV")) W !!,"There are no pending deficiencies that meet the report criteria." Q
  1. S APCDS="" F S APCDS=$O(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV",APCDS)) Q:APCDS'=+APCDS!($D(APCDQUIT)) D
  1. .I APCDSPAG D HEAD Q:$D(APCDQUIT)
  1. .D SH
  1. .S APCDDATE=0 F S APCDDATE=$O(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV",APCDS,APCDDATE)) Q:APCDDATE'=+APCDDATE!($D(APCDQUIT)) D
  1. ..S APCDV="" F S APCDV=$O(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV",APCDS,APCDDATE,APCDV)) Q:APCDV=""!($D(APCDQUIT)) D
  1. ...I $Y>(IOSL-5) D HEAD Q:$D(APCDQUIT) D SH
  1. ...W !,$E($$VAL^XBDIQ1(9000010,APCDV,.05),1,21)
  1. ...S APCDVR=^AUPNVSIT(APCDV,0) S:'$P(APCDVR,U,6) $P(APCDVR,U,6)=0
  1. ...S DFN=$P(APCDVR,U,5)
  1. ...S APCDHRN="" S APCDHRN=$$HRN^AUPNPAT(DFN,$P(APCDVR,U,6),2)
  1. ...S APCDHRN="" S APCDHRN=$$HRN^AUPNPAT(DFN,DUZ(2))
  1. ...W ?22,APCDHRN
  1. ...W ?29,$$DATE(APCDDATE),?40,$P(APCDVR,U,7)
  1. ...S APCDC=0 S APCDI=0 F S APCDI=$O(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV",APCDS,APCDDATE,APCDV,APCDI)) Q:APCDI'=+APCDI!($D(APCDQUIT)) D
  1. ....S APCDC=APCDC+1
  1. ....I $Y>(IOSL-3) D HEAD Q:$D(APCDQUIT) D SH
  1. ....I APCDC>1 W !
  1. ....S APCDIENS=APCDI_","_APCDV W ?43,$$GET1^DIQ(9000095.12,APCDIENS,.02)
  1. ....W ?76,$$FMDIFF^XLFDT(DT,$$VD^APCLV(APCDV))
  1. ....I $$GET1^DIQ(9000095.12,APCDIENS,.1)]"" W !?2,"Comment: ",$$GET1^DIQ(9000095.12,APCDIENS,.1)
  1. ...I $O(^AUPNCANT(APCDV,11,0)) D
  1. ....I $Y>(IOSL-3) D HEAD Q:$D(APCDQUIT) D SH
  1. ....W !?2,"Chart Audit Notes:"
  1. ....K ^UTILITY($J,"W")
  1. ....S DIWR=70,DIWL=0 S Y=0 S Y=$O(^AUPNCANT(APCDV,11,Y)) Q:Y'=+Y S X=^AUPNCANT(APCDV,11,Y,0) D ^DIWP
  1. ....S Z=0 F S Z=$O(^UTILITY($J,"W",DIWL,Z)) Q:Z'=+Z D
  1. .....I $Y>(IOSL-2) D HEAD Q:$D(APCDQUIT) D SH
  1. .....W !?2,^UTILITY($J,"W",DIWL,Z,0)
  1. ...K DIWL,DIWR,DIWF,Z
  1. ...K ^UTILITY($J,"W")
  1. I APCDRTYP=1 Q
  1. I $D(APCDQUIT) Q
  1. D SUMPAGE
  1. Q
  1. DATE(D) ;EP
  1. I D="" Q ""
  1. Q $E(D,4,5)_"/"_$E(D,6,7)_"/"_(1700+$E(D,1,3))
  1. I 'APCDPG G HEAD1
  1. HEAD2 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCDQUIT="" Q
  1. HEAD1 ;
  1. W:$D(IOF) @IOF S APCDPG=APCDPG+1
  1. W !,$$FMTE^XLFDT($$NOW^XLFDT),?40,$P(^VA(200,DUZ,0),U,2),?70,"Page: ",APCDPG
  1. W !,$$CTR("Confidential Patient Data Covered by Privacy Act",80)
  1. W !,$$CTR("Incomplete Charts by Provider and Deficiency",80)
  1. I $G(APCDSUM) W !,$$CTR("SUMMARY PAGE",80)
  1. W !,$TR($J(" ",80)," ","-")
  1. I '$G(APCDSUM) W !!,"Patient",?22,"HRCN",?29,"Visit Date",?40,"SC",?43,"Deficiencies",?76,"Days"
  1. I $G(APCDSUM) W !!,"PROVIDER",?26,"INCOMP",?33,"DELINQ",?40,"DEFICIENCIES"
  1. I $G(APCDSUM) W !?26,"CHARTS",?33,"CHARTS"
  1. W !,APCD80S
  1. Q
  1. COVPAGE ;
  1. W !,$$FMTE^XLFDT($$NOW^XLFDT()),?40,$P(^VA(200,DUZ,0),U,2)," Confidential Patient Data Covered by Privacy Act" ;,?70,"Page: ",APCDPG
  1. W !,$$CTR("***********************************",80)
  1. W !,$$CTR("* PROVIDER CHART DEFICIENCIES *",80)
  1. W !,$$CTR("***********************************",80)
  1. W !!,"PROVIDERS: " D
  1. .I '$D(APCDPRV) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDPRVS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^VA(200,Y,0),U),1,15)
  1. W !!,$$CTR("VISIT DEFICIENCY CRITERIA",80)
  1. W !!,"LOCATION OF ENCOUNTER: " D
  1. .I '$D(APCDLOCS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDLOCS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^DIC(4,Y,0),U),1,15)
  1. W !!,"HOSPITAL LOCATIONS: " D
  1. .I '$D(APCDHLS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDHLS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^SC(Y,0),U),1,15)
  1. W !!,"CLINICS: " D
  1. .I '$D(APCDCLNS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDCLNS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^DIC(40.7,Y,0),U),1,15)
  1. W !!,"SERVICE CATEGORIES: " D
  1. .I '$D(APCDSCS) W "All" Q
  1. .S Y=0,C=0 F S Y=$O(APCDSCS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$$EXTSET^XBFUNC(9000010,.07,Y)
  1. Q
  1. SUMPAGE ;
  1. S APCDSUM=1
  1. D HEAD
  1. I '$D(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV")) W !!,"There are no pending deficiencies that meet the report criteria." Q
  1. S APCDS=0 F S APCDS=$O(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","SUMMARY",APCDS)) Q:APCDS'=+APCDS D
  1. .I $Y>(IOSL-4) D HEAD Q:$D(APCDQUIT)
  1. .S S=^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","SUMMARY",APCDS)
  1. .W !,$E($P(^VA(200,APCDS,0),U),1,25),?27,+$P(S,U,1),?33,+$P(S,U,2)
  1. .;deficiencies
  1. .S APCDDEF=""
  1. .S APCDI=0 F S APCDI=$O(^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","CDR",APCDS,APCDI)) Q:APCDI'=+APCDI D
  1. ..S:APCDDEF]"" APCDDEF=APCDDEF_", "
  1. ..S APCDDEF=APCDDEF_$P(^AUTTCDR(APCDI,0),U,1)_" ("_^XTMP("APCDCAFK",APCDJOB,APCDBT,"PROV","CDR",APCDS,APCDI)_")"
  1. .K ^UTILITY($J,"W") S X=APCDDEF,DIWL=0,DIWR=40 D ^DIWP
  1. .W ?40,$G(^UTILITY($J,"W",0,1,0))
  1. .I $O(^UTILITY($J,"W",0,1)) D
  1. ..S X=1 S X=$O(^UTILITY($J,"W",0,X)) Q:X'=+X W !?40,^UTILITY($J,"W",0,X,0)
  1. .W !
  1. .K ^UTILITY($J,"W")
  1. Q