- APCDCAFD ; IHS/CMI/LAB - ;
- ;;2.0;IHS PCC SUITE;**2,7,11,15,16,20**;MAY 14, 2009;Build 25
- ;
- START ;
- D XIT
- I '$D(IOF) D HOME^%ZIS
- D TERM^VALM0
- W @(IOF),!!
- D INFORM
- 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
- .W !,"Please see your Clinical Coordinator or PCC Manager."
- .S DIR(0)="E",DIR("A")="Press Enter" KILL DA D ^DIR KILL DIR
- .Q
- DATES ;
- W !!,"You should limit your date range to no more than 7 days. Viewing more"
- W !,"than 7 days worth of visits may take a while to process."
- K APCDED,APCDBD
- K DIR S DIR(0)="DO^::EXP",DIR("A")="Enter Beginning Visit Date"
- D ^DIR G:Y<1 XIT S APCDBD=Y
- I APCDBD<$P($G(^APCCCTRL(DUZ(2),0)),U,12) D G DATES
- .W !!,"That date is before the EHR/PCC Coding Start Date."
- .W !,"Please enter a date on or after "_$$FMTE^XLFDT($P(^APCCCTRL(DUZ(2),0),U,12))
- K DIR S DIR(0)="DO^:DT:EXP",DIR("A")="Enter Ending Visit Date"
- D ^DIR G:Y<1 XIT S APCDED=Y
- ;
- I APCDED<APCDBD D G DATES
- . W !!,$C(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
- I $$FMDIFF^XLFDT(APCDED,APCDBD)>7 S APCDQ=0 D I APCDQ G DATES
- . W !,"You have selected a ",$$FMDIFF^XLFDT(APCDED,APCDBD)," date range. Depending on the number of visits per"
- . W !,"day at your facility it may take a while to gather up and process that many",!,"visits."
- . S DIR(0)="Y",DIR("A")="Do you wish to continue with this date range",DIR("B")="Y" KILL DA D ^DIR KILL DIR
- . I $D(DIRUT) S APCDQ=1
- . I 'Y S APCDQ=1
- . Q
- S APCDSD=$$FMADD^XLFDT(APCDBD,-1)_".9999"
- ;
- FAC ;
- K APCDQ
- W !!,$G(IORVON)_"Please enter which FACILITY visits will be included in the list."_$G(IORVOFF),!
- S APCDLOCT=""
- K APCDLOCS
- 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"
- S DIR("A")="Enter a code indicating what LOCATIONS/FACILITIES are of interest",DIR("B")="A" K DA D ^DIR K DIR,DA
- G:$D(DIRUT) DATES
- S APCDLOCT=Y
- I APCDLOCT="A" G CLINIC
- D @(APCDLOCT_"LOC")
- G:$D(APCDQ) FAC
- CLINIC ;
- K APCDQ
- W !!,$G(IORVON)_"Please enter which CLINIC (IHS clinic codes) visits will be included",!,"in the list."_$G(IORVOFF),!
- S APCDCLNT=""
- K APCDCLNS
- K DIR S DIR(0)="S^A:ALL Clinics;S:Selected set or Taxonomy of Clinics;O:ONE Clinic;X:No Clinic Assigned",DIR("A")="Include Visits to Which Clinics",DIR("B")="A"
- 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
- G:$D(DIRUT) FAC
- S APCDCLNT=Y
- I APCDCLNT="A" G HOSPLOC
- I APCDCLNT="X" G HOSPLOC
- D @(APCDCLNT_"CLN")
- G:$D(APCDQ) CLINIC
- HOSPLOC ;
- K APCDQ
- W !!,$G(IORVON)_"Please enter which HOSPITAL LOCATIONS will be included in the list."_$G(IORVOFF),!
- S APCDHLT=""
- K APCDHLS
- 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"
- S DIR("A")="Enter a code indicating what HOSPITAL LOCATIONS are of interest",DIR("B")="A" K DA D ^DIR K DIR,DA
- G:$D(DIRUT) CLINIC
- S APCDHLT=Y
- I APCDHLT="A" G PRIMPROV
- D @(APCDHLT_"HL")
- G:$D(APCDQ) HOSPLOC
- PRIMPROV ;
- K APCDQ
- W !!,$G(IORVON)_"Please enter the Providers whose visits you want to display",!,"This will screen on the provider on the visit."_$G(IORVOFF),!
- S APCDPRVT=""
- K APCDPRVS
- S DIR(0)="S^A:ALL Primary Providers;S:Selected set or Taxonomy of Primary Providers;O:ONE Primary Provider;X:No Visit Primary Provider Assigned;C:One Secondary Provider",DIR("A")="Include Visits to Which Providers",DIR("B")="A"
- S DIR("A")="Enter a code indicating which providers are of interest",DIR("B")="A" K DA D ^DIR K DIR,DA
- G:$D(DIRUT) HOSPLOC
- S APCDPRVT=Y
- I APCDPRVT="A" G STATUS
- I APCDPRVT="X" G STATUS
- D @(APCDPRVT_"PRV")
- G:$D(APCDQ) PRIMPROV
- STATUS ;
- ;K APCDQ
- ;W !!,"You can choose to display visits with a particular chart audit status: Reviewed",!,"or Incomplete.",!
- ;S APCDCAST=""
- ;K APCDCASS
- STATUS1 ;
- ;S DIR(0)="9000010.45,.04O",DIR("A")="Include Visits with which Chart Audit Status",DIR("B")="I" KILL DA D ^DIR KILL DIR
- ;I $D(DIRUT) G CDR
- ;I Y="" G CDR
- ;S APCDCASS(Y)=""
- CDR ;
- K APCDQ
- W !!,"A chart deficiency reason may have been previously entered for a visit."
- W !,"If you wish to display only visits whose LAST chart deficiency reason matches"
- W !,"one or more that you select, please enter them.",!
- S APCDCDRT=""
- K APCDCDRS
- S DIR(0)="S^D:Do NOT screen on Chart Deficiency Reason;S:Screen on Chart Deficiency Reason",DIR("A")="Include Visits to Which Hospital Locations",DIR("B")="A"
- S DIR("A")="Select visits based on chart deficiency reason",DIR("B")="D" K DA D ^DIR K DIR,DA
- G:$D(DIRUT) STATUS
- S APCDCDRT=Y
- I APCDCDRT="D" G DEMO
- D @(APCDCDRT_"CDR")
- G:$D(APCDQ) CDR
- DEMO ;
- D DEMOCHK^APCLUTL(.APCDDEMO)
- I APCDDEMO=-1 G CDR
- PROCESS ;
- W:$D(IOF) @IOF W !!
- W !!,"I will display visits that meet the following criteria:"
- W !!,"VISIT DATES: ",$$FMTE^XLFDT(APCDBD)," to ",$$FMTE^XLFDT(APCDED)
- ;W !,"SERVICE CATEGORY: A, O, S, C, T, M"
- W !,"SERVICE CATEGORY: "
- S X=$P(^DD(9000010,.07,0),U,3),D=""
- F Y=1:1 S J=$P(X,";",Y) Q:J="" D
- .S C=$P(J,":")
- .Q:'$$SCW^APCDCAF(C)
- .S:D]"" D=D_", "
- .S D=D_C
- W D
- W !,"VISIT TYPE: NOT Contract"
- W !,"Visits with at least one POV."
- W !!,"LOCATION OF ENCOUNTER: " D
- .I '$D(APCDLOCS) W "All" Q
- .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)
- W !!,"CLINICS: " D
- .I APCDCLNT="X" W "Visits with no Clinic Assigned" Q
- .I '$D(APCDCLNS) W "All" Q
- .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)
- W !!,"HOSPITAL LOCATIONS: " D
- .I '$D(APCDHLS) W "All" Q
- .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)
- W !!,"PRIMARY PROVIDER ON VISIT: " D
- .I APCDPRVT="X" W "No Visit Primary Provider Assigned" Q
- .I '$D(APCDPRV) W "All" Q
- .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)
- ;W !!,"CHART AUDIT STATUS: " D
- ;.I '$D(APCDCASS) W "All" Q
- ;.S Y=0,C=0 F S Y=$O(APCDCASS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$$EXTSET^XBFUNC(9000010.45,Y,.04)
- W !!,"CHART DEFICIENCY REASONS: " D
- .I '$D(APCDCDRS) W "All (includes visits with no chart deficiency reason entered)" Q
- .S Y=0,C=0 F S Y=$O(APCDCDRS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$E($P(^AUTTCDR(Y,0),U),1,15)
- CONT ;
- S DIR(0)="Y",DIR("A")="Do you wish to continue",DIR("B")="Y" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G XIT
- I 'Y G XIT
- W !!,"Please note: On the list of visits that will be displayed"
- W !,"there is a column labeled 'INS', in this column M stands for"
- W !,"Medicare, C stands for Medicaid and P stands for Private"
- W !,"Insurance. This does not mean the visit is billable, it just"
- W !,"is an indication of whether or not the patient has a policy on"
- W !,"file that is currently active.",!
- SORT ;how to sort list of visits
- VA S APCDSORT=""
- S DIR(0)="S^N:Patient Name;H:HRN;D:Date of Visit;T:Terminal Digit of HRN;S:Service Category;L:Location of Encounter;C:Clinic;O:Hospital Location;P:Primary Provider"
- S DIR(0)=DIR(0)_";A:Chart Audit Status;I:Has Medicare/Medicaid or PI"
- S DIR("A")="How would you like the list of visits sorted",DIR("B")="H" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G XIT
- S APCDSORT=Y
- PROC1 ; call listmanager
- D EN^APCDCAF
- D XIT
- Q
- XIT ;
- K DIR
- D EN^APCDEKL
- D EN2^APCDEKL
- D EN^XBVK("APCD") ;clean up APCD variables
- D ^XBFMK ;clean up fileman variables
- D KILL^AUPNPAT ;clean up AUPN
- D EN^XBVK("AMQQ") ;clean up after qman
- Q
- ;
- PROC ;EP - called from xbdbque
- Q
- D(D) ;
- I $G(D)="" Q ""
- Q $E(D,4,5)_"/"_$E(D,6,7)_"/"_$E(D,2,3)
- 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:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
- NEW DIR
- K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
- 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")
- ;----------
- INFORM ;inform user what this report is all about
- W $$LOC,$$CTR("PCC/EHR CODING AUDIT")
- W !,"This list can be used to audit visits that are created by EHR users."
- W !,"The visits displayed in the list are those with an INCOMPLETE or blank"
- W !,"chart audit status. This list can be sorted by date, primary provider"
- W !,"clinic code, hospital location (scheduling clinic), and facility."
- W !,"Once the visit has been reviewed, the review status can be set as reviewed/"
- W !,"complete or incomplete. All visits set as reviewed/complete will be passed"
- W !,"to the IHS/RPMS billing package."
- W !,"Contract Health visits are excluded."
- W !,"Visits that do not have a provider (primary or secondary) are ",$S($P(^APCDSITE(DUZ(2),0),U,28):"included in ",1:"excluded from "),!,"the list."
- W !,"Visits with the following service categories are NOT included in the list:"
- W !?10,"- Event (Historical)"
- S X="" F S X=$O(^APCDSITE(DUZ(2),13,"B",X)) Q:X="" W !?10,"- ",$$EXTSET^XBFUNC(9000010,.07,X)
- W !,$G(IORVON)_"PLEASE NOTE:"_$G(IORVOFF)_" A visit will NOT pass to Billing until it is marked"
- W !,"as reviewed/completed."
- Q
- OLOC ;EP - one location
- S DIC="^AUTTLOC(",DIC(0)="AEMQ",DIC("A")="Which LOCATION: " D ^DIC K DIC
- I Y=-1 S APCDQ="" Q
- S APCDLOCS(+Y)=""
- Q
- SLOC ;EP - taxonomy of locations
- S X="LOCATION OF ENCOUNTER",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,"APCDLOCS(")
- I '$D(APCDLOCS) S APCDQ="" Q
- I $D(APCDLOCS("*")) S APCDLOCT="A" K APCDLOCS W !!,"**** all locations will be included ****",! Q
- Q
- ;
- OCLN ;EP - one clinic
- S DIC="^DIC(40.7,",DIC(0)="AEMQ",DIC("A")="Which CLINIC: " D ^DIC K DIC
- I Y=-1 S APCDQ="" Q
- S APCDCLNS(+Y)=""
- Q
- SCLN ;EP - taxonomy of clinics
- 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,"APCDCLNS(")
- I '$D(APCDCLNS) S APCDQ="" Q
- I $D(APCDCLNS("*")) S APCDCLNT="A" K APCDCLNS W !!,"**** all CLINICS will be included ****",! Q
- Q
- ;
- OHL ;one hosp location
- S DIC="^SC(",DIC(0)="AEMQ",DIC("A")="Which HOSPITAL LOCATION: " D ^DIC K DIC
- I Y=-1 S APCDQ="" Q
- S APCDHLS(+Y)=""
- Q
- SHL ;selected hospital locations
- S DIC="^SC(",DIC(0)="AEMQ",DIC("A")="Which HOSPITAL LOCATION: " D ^DIC K DIC
- I X="" Q
- I Y=-1 S APCDQ="" Q
- S APCDHLS(+Y)=""
- G SHL
- OPRV ;one PROV
- S DIC="^VA(200,",DIC(0)="AEMQ",DIC("A")="Which PROVIDER: " D ^DIC K DIC
- I Y=-1 S APCDQ="" Q
- S APCDPRVS(+Y)=""
- Q
- SPRV ;taxonomy of PROVIDERS
- ;I $D(APCDIASE) G S
- 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
- D PEP^AMQQGTX0(+Y,"APCDPRVS(")
- I '$D(APCDPRVS) S APCDQ="" Q
- I $D(APCDPRVS("*")) S APCDPRVT="A" K APCDPRVS W !!,"**** all PROVIDERS will be included ****",! Q
- Q
- ;
- SCDR ;selected CHART DEF REASONS
- S DIC="^AUTTCDR(",DIC(0)="AEMQ",DIC("A")="Which CHART DEFICIENCY REASON: " D ^DIC K DIC
- I X="" Q
- I Y=-1 S APCDQ="" Q
- S APCDCDRS(+Y)=""
- G SCDR
- Q
- CPRV ;one PROV
- S DIC="^VA(200,",DIC(0)="AEMQ",DIC("A")="Which SECONDARY PROVIDER: " D ^DIC K DIC
- I Y=-1 S APCDQ="" Q
- S APCDPRVS(+Y)=""
- Q
- APCDCAFD ; IHS/CMI/LAB - ;
- +1 ;;2.0;IHS PCC SUITE;**2,7,11,15,16,20**;MAY 14, 2009;Build 25
- +2 ;
- START ;
- +1 DO XIT
- +2 IF '$DATA(IOF)
- DO HOME^%ZIS
- +3 DO TERM^VALM0
- +4 WRITE @(IOF),!!
- +5 DO INFORM
- +6 IF $PIECE(^APCCCTRL(DUZ(2),0),U,12)=""
- WRITE !!,"The EHR/PCC Coding Audit Start Date has not been set",!,"in the PCC Master Control file."
- Begin DoDot:1
- +7 WRITE !,"Please see your Clinical Coordinator or PCC Manager."
- +8 SET DIR(0)="E"
- SET DIR("A")="Press Enter"
- KILL DA
- DO ^DIR
- KILL DIR
- +9 QUIT
- End DoDot:1
- DO XIT
- QUIT
- DATES ;
- +1 WRITE !!,"You should limit your date range to no more than 7 days. Viewing more"
- +2 WRITE !,"than 7 days worth of visits may take a while to process."
- +3 KILL APCDED,APCDBD
- +4 KILL DIR
- SET DIR(0)="DO^::EXP"
- SET DIR("A")="Enter Beginning Visit Date"
- +5 DO ^DIR
- IF Y<1
- GOTO XIT
- SET APCDBD=Y
- +6 IF APCDBD<$PIECE($GET(^APCCCTRL(DUZ(2),0)),U,12)
- Begin DoDot:1
- +7 WRITE !!,"That date is before the EHR/PCC Coding Start Date."
- +8 WRITE !,"Please enter a date on or after "_$$FMTE^XLFDT($PIECE(^APCCCTRL(DUZ(2),0),U,12))
- End DoDot:1
- GOTO DATES
- +9 KILL DIR
- SET DIR(0)="DO^:DT:EXP"
- SET DIR("A")="Enter Ending Visit Date"
- +10 DO ^DIR
- IF Y<1
- GOTO XIT
- SET APCDED=Y
- +11 ;
- +12 IF APCDED<APCDBD
- Begin DoDot:1
- +13 WRITE !!,$CHAR(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
- End DoDot:1
- GOTO DATES
- +14 IF $$FMDIFF^XLFDT(APCDED,APCDBD)>7
- SET APCDQ=0
- Begin DoDot:1
- +15 WRITE !,"You have selected a ",$$FMDIFF^XLFDT(APCDED,APCDBD)," date range. Depending on the number of visits per"
- +16 WRITE !,"day at your facility it may take a while to gather up and process that many",!,"visits."
- +17 SET DIR(0)="Y"
- SET DIR("A")="Do you wish to continue with this date range"
- SET DIR("B")="Y"
- KILL DA
- DO ^DIR
- KILL DIR
- +18 IF $DATA(DIRUT)
- SET APCDQ=1
- +19 IF 'Y
- SET APCDQ=1
- +20 QUIT
- End DoDot:1
- IF APCDQ
- GOTO DATES
- +21 SET APCDSD=$$FMADD^XLFDT(APCDBD,-1)_".9999"
- +22 ;
- FAC ;
- +1 KILL APCDQ
- +2 WRITE !!,$GET(IORVON)_"Please enter which FACILITY visits will be included in the list."_$GET(IORVOFF),!
- +3 SET APCDLOCT=""
- +4 KILL APCDLOCS
- +5 SET DIR(0)="S^A:ALL Locations/Facilities;S:Selected set or Taxonomy of Locations;O:ONE Location/Facility"
- SET DIR("A")="Include Visits to Which Location/Facilities"
- SET DIR("B")="A"
- +6 SET DIR("A")="Enter a code indicating what LOCATIONS/FACILITIES are of interest"
- SET DIR("B")="A"
- KILL DA
- DO ^DIR
- KILL DIR,DA
- +7 IF $DATA(DIRUT)
- GOTO DATES
- +8 SET APCDLOCT=Y
- +9 IF APCDLOCT="A"
- GOTO CLINIC
- +10 DO @(APCDLOCT_"LOC")
- +11 IF $DATA(APCDQ)
- GOTO FAC
- CLINIC ;
- +1 KILL APCDQ
- +2 WRITE !!,$GET(IORVON)_"Please enter which CLINIC (IHS clinic codes) visits will be included",!,"in the list."_$GET(IORVOFF),!
- +3 SET APCDCLNT=""
- +4 KILL APCDCLNS
- +5 KILL DIR
- SET DIR(0)="S^A:ALL Clinics;S:Selected set or Taxonomy of Clinics;O:ONE Clinic;X:No Clinic Assigned"
- SET DIR("A")="Include Visits to Which Clinics"
- SET DIR("B")="A"
- +6 SET DIR("A")="Enter a code indicating what CLINICS (IHS clinic code) are of interest"
- SET DIR("B")="A"
- KILL DA
- DO ^DIR
- KILL DIR,DA
- +7 IF $DATA(DIRUT)
- GOTO FAC
- +8 SET APCDCLNT=Y
- +9 IF APCDCLNT="A"
- GOTO HOSPLOC
- +10 IF APCDCLNT="X"
- GOTO HOSPLOC
- +11 DO @(APCDCLNT_"CLN")
- +12 IF $DATA(APCDQ)
- GOTO CLINIC
- HOSPLOC ;
- +1 KILL APCDQ
- +2 WRITE !!,$GET(IORVON)_"Please enter which HOSPITAL LOCATIONS will be included in the list."_$GET(IORVOFF),!
- +3 SET APCDHLT=""
- +4 KILL APCDHLS
- +5 SET DIR(0)="S^A:ALL Hospital Locations;S:Selected set of Hospital Locations;O:ONE Hospital Location"
- SET DIR("A")="Include Visits to Which Hospital Locations"
- SET DIR("B")="A"
- +6 SET DIR("A")="Enter a code indicating what HOSPITAL LOCATIONS are of interest"
- SET DIR("B")="A"
- KILL DA
- DO ^DIR
- KILL DIR,DA
- +7 IF $DATA(DIRUT)
- GOTO CLINIC
- +8 SET APCDHLT=Y
- +9 IF APCDHLT="A"
- GOTO PRIMPROV
- +10 DO @(APCDHLT_"HL")
- +11 IF $DATA(APCDQ)
- GOTO HOSPLOC
- PRIMPROV ;
- +1 KILL APCDQ
- +2 WRITE !!,$GET(IORVON)_"Please enter the Providers whose visits you want to display",!,"This will screen on the provider on the visit."_$GET(IORVOFF),!
- +3 SET APCDPRVT=""
- +4 KILL APCDPRVS
- +5 SET DIR(0)="S^A:ALL Primary Providers;S:Selected set or Taxonomy of Primary Providers;O:ONE Primary Provider;X:No Visit Primary Provider Assigned;C:One Secondary Provider"
- SET DIR("A")="Include Visits to Which Providers"
- SET DIR("B")="A"
- +6 SET DIR("A")="Enter a code indicating which providers are of interest"
- SET DIR("B")="A"
- KILL DA
- DO ^DIR
- KILL DIR,DA
- +7 IF $DATA(DIRUT)
- GOTO HOSPLOC
- +8 SET APCDPRVT=Y
- +9 IF APCDPRVT="A"
- GOTO STATUS
- +10 IF APCDPRVT="X"
- GOTO STATUS
- +11 DO @(APCDPRVT_"PRV")
- +12 IF $DATA(APCDQ)
- GOTO PRIMPROV
- STATUS ;
- +1 ;K APCDQ
- +2 ;W !!,"You can choose to display visits with a particular chart audit status: Reviewed",!,"or Incomplete.",!
- +3 ;S APCDCAST=""
- +4 ;K APCDCASS
- STATUS1 ;
- +1 ;S DIR(0)="9000010.45,.04O",DIR("A")="Include Visits with which Chart Audit Status",DIR("B")="I" KILL DA D ^DIR KILL DIR
- +2 ;I $D(DIRUT) G CDR
- +3 ;I Y="" G CDR
- +4 ;S APCDCASS(Y)=""
- CDR ;
- +1 KILL APCDQ
- +2 WRITE !!,"A chart deficiency reason may have been previously entered for a visit."
- +3 WRITE !,"If you wish to display only visits whose LAST chart deficiency reason matches"
- +4 WRITE !,"one or more that you select, please enter them.",!
- +5 SET APCDCDRT=""
- +6 KILL APCDCDRS
- +7 SET DIR(0)="S^D:Do NOT screen on Chart Deficiency Reason;S:Screen on Chart Deficiency Reason"
- SET DIR("A")="Include Visits to Which Hospital Locations"
- SET DIR("B")="A"
- +8 SET DIR("A")="Select visits based on chart deficiency reason"
- SET DIR("B")="D"
- KILL DA
- DO ^DIR
- KILL DIR,DA
- +9 IF $DATA(DIRUT)
- GOTO STATUS
- +10 SET APCDCDRT=Y
- +11 IF APCDCDRT="D"
- GOTO DEMO
- +12 DO @(APCDCDRT_"CDR")
- +13 IF $DATA(APCDQ)
- GOTO CDR
- DEMO ;
- +1 DO DEMOCHK^APCLUTL(.APCDDEMO)
- +2 IF APCDDEMO=-1
- GOTO CDR
- PROCESS ;
- +1 IF $DATA(IOF)
- WRITE @IOF
- WRITE !!
- +2 WRITE !!,"I will display visits that meet the following criteria:"
- +3 WRITE !!,"VISIT DATES: ",$$FMTE^XLFDT(APCDBD)," to ",$$FMTE^XLFDT(APCDED)
- +4 ;W !,"SERVICE CATEGORY: A, O, S, C, T, M"
- +5 WRITE !,"SERVICE CATEGORY: "
- +6 SET X=$PIECE(^DD(9000010,.07,0),U,3)
- SET D=""
- +7 FOR Y=1:1
- SET J=$PIECE(X,";",Y)
- IF J=""
- QUIT
- Begin DoDot:1
- +8 SET C=$PIECE(J,":")
- +9 IF '$$SCW^APCDCAF(C)
- QUIT
- +10 IF D]""
- SET D=D_", "
- +11 SET D=D_C
- End DoDot:1
- +12 WRITE D
- +13 WRITE !,"VISIT TYPE: NOT Contract"
- +14 WRITE !,"Visits with at least one POV."
- +15 WRITE !!,"LOCATION OF ENCOUNTER: "
- Begin DoDot:1
- +16 IF '$DATA(APCDLOCS)
- WRITE "All"
- QUIT
- +17 SET Y=0
- SET C=0
- FOR
- SET Y=$ORDER(APCDLOCS(Y))
- IF Y'=+Y
- QUIT
- SET C=C+1
- IF C>1
- WRITE ";"
- WRITE ?24,$EXTRACT($PIECE(^DIC(4,Y,0),U),1,15)
- End DoDot:1
- +18 WRITE !!,"CLINICS: "
- Begin DoDot:1
- +19 IF APCDCLNT="X"
- WRITE "Visits with no Clinic Assigned"
- QUIT
- +20 IF '$DATA(APCDCLNS)
- WRITE "All"
- QUIT
- +21 SET Y=0
- SET C=0
- FOR
- SET Y=$ORDER(APCDCLNS(Y))
- IF Y'=+Y
- QUIT
- SET C=C+1
- IF C>1
- WRITE ";"
- WRITE ?24,$EXTRACT($PIECE(^DIC(40.7,Y,0),U),1,15)
- End DoDot:1
- +22 WRITE !!,"HOSPITAL LOCATIONS: "
- Begin DoDot:1
- +23 IF '$DATA(APCDHLS)
- WRITE "All"
- QUIT
- +24 SET Y=0
- SET C=0
- FOR
- SET Y=$ORDER(APCDHLS(Y))
- IF Y'=+Y
- QUIT
- SET C=C+1
- IF C>1
- WRITE ";"
- WRITE ?24,$EXTRACT($PIECE(^SC(Y,0),U),1,15)
- End DoDot:1
- +25 WRITE !!,"PRIMARY PROVIDER ON VISIT: "
- Begin DoDot:1
- +26 IF APCDPRVT="X"
- WRITE "No Visit Primary Provider Assigned"
- QUIT
- +27 IF '$DATA(APCDPRV)
- WRITE "All"
- QUIT
- +28 SET Y=0
- SET C=0
- FOR
- SET Y=$ORDER(APCDPRVS(Y))
- IF Y'=+Y
- QUIT
- SET C=C+1
- IF C>1
- WRITE ";"
- WRITE ?24,$EXTRACT($PIECE(^VA(200,Y,0),U),1,15)
- End DoDot:1
- +29 ;W !!,"CHART AUDIT STATUS: " D
- +30 ;.I '$D(APCDCASS) W "All" Q
- +31 ;.S Y=0,C=0 F S Y=$O(APCDCASS(Y)) Q:Y'=+Y S C=C+1 W:C>1 ";" W ?24,$$EXTSET^XBFUNC(9000010.45,Y,.04)
- +32 WRITE !!,"CHART DEFICIENCY REASONS: "
- Begin DoDot:1
- +33 IF '$DATA(APCDCDRS)
- WRITE "All (includes visits with no chart deficiency reason entered)"
- QUIT
- +34 SET Y=0
- SET C=0
- FOR
- SET Y=$ORDER(APCDCDRS(Y))
- IF Y'=+Y
- QUIT
- SET C=C+1
- IF C>1
- WRITE ";"
- WRITE ?24,$EXTRACT($PIECE(^AUTTCDR(Y,0),U),1,15)
- End DoDot:1
- CONT ;
- +1 SET DIR(0)="Y"
- SET DIR("A")="Do you wish to continue"
- SET DIR("B")="Y"
- KILL DA
- DO ^DIR
- KILL DIR
- +2 IF $DATA(DIRUT)
- GOTO XIT
- +3 IF 'Y
- GOTO XIT
- +4 WRITE !!,"Please note: On the list of visits that will be displayed"
- +5 WRITE !,"there is a column labeled 'INS', in this column M stands for"
- +6 WRITE !,"Medicare, C stands for Medicaid and P stands for Private"
- +7 WRITE !,"Insurance. This does not mean the visit is billable, it just"
- +8 WRITE !,"is an indication of whether or not the patient has a policy on"
- +9 WRITE !,"file that is currently active.",!
- SORT ;how to sort list of visits
- VA SET APCDSORT=""
- +1 SET DIR(0)="S^N:Patient Name;H:HRN;D:Date of Visit;T:Terminal Digit of HRN;S:Service Category;L:Location of Encounter;C:Clinic;O:Hospital Location;P:Primary Provider"
- +2 SET DIR(0)=DIR(0)_";A:Chart Audit Status;I:Has Medicare/Medicaid or PI"
- +3 SET DIR("A")="How would you like the list of visits sorted"
- SET DIR("B")="H"
- KILL DA
- DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- GOTO XIT
- +5 SET APCDSORT=Y
- PROC1 ; call listmanager
- +1 DO EN^APCDCAF
- +2 DO XIT
- +3 QUIT
- XIT ;
- +1 KILL DIR
- +2 DO EN^APCDEKL
- +3 DO EN2^APCDEKL
- +4 ;clean up APCD variables
- DO EN^XBVK("APCD")
- +5 ;clean up fileman variables
- DO ^XBFMK
- +6 ;clean up AUPN
- DO KILL^AUPNPAT
- +7 ;clean up after qman
- DO EN^XBVK("AMQQ")
- +8 QUIT
- +9 ;
- PROC ;EP - called from xbdbque
- +1 QUIT
- D(D) ;
- +1 IF $GET(D)=""
- QUIT ""
- +2 QUIT $EXTRACT(D,4,5)_"/"_$EXTRACT(D,6,7)_"/"_$EXTRACT(D,2,3)
- 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 $DATA(ZTQUEUED)!'(IOT="TRM")!$DATA(IO("S"))
- QUIT
- +3 NEW DIR
- +4 KILL DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
- +5 SET DIR("A")="End of report. Press Enter"
- SET DIR(0)="E"
- DO ^DIR
- +6 QUIT
- +7 ;----------
- 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 ;----------
- INFORM ;inform user what this report is all about
- +1 WRITE $$LOC,$$CTR("PCC/EHR CODING AUDIT")
- +2 WRITE !,"This list can be used to audit visits that are created by EHR users."
- +3 WRITE !,"The visits displayed in the list are those with an INCOMPLETE or blank"
- +4 WRITE !,"chart audit status. This list can be sorted by date, primary provider"
- +5 WRITE !,"clinic code, hospital location (scheduling clinic), and facility."
- +6 WRITE !,"Once the visit has been reviewed, the review status can be set as reviewed/"
- +7 WRITE !,"complete or incomplete. All visits set as reviewed/complete will be passed"
- +8 WRITE !,"to the IHS/RPMS billing package."
- +9 WRITE !,"Contract Health visits are excluded."
- +10 WRITE !,"Visits that do not have a provider (primary or secondary) are ",$SELECT($PIECE(^APCDSITE(DUZ(2),0),U,28):"included in ",1:"excluded from "),!,"the list."
- +11 WRITE !,"Visits with the following service categories are NOT included in the list:"
- +12 WRITE !?10,"- Event (Historical)"
- +13 SET X=""
- FOR
- SET X=$ORDER(^APCDSITE(DUZ(2),13,"B",X))
- IF X=""
- QUIT
- WRITE !?10,"- ",$$EXTSET^XBFUNC(9000010,.07,X)
- +14 WRITE !,$GET(IORVON)_"PLEASE NOTE:"_$GET(IORVOFF)_" A visit will NOT pass to Billing until it is marked"
- +15 WRITE !,"as reviewed/completed."
- +16 QUIT
- OLOC ;EP - one location
- +1 SET DIC="^AUTTLOC("
- SET DIC(0)="AEMQ"
- SET DIC("A")="Which LOCATION: "
- DO ^DIC
- KILL DIC
- +2 IF Y=-1
- SET APCDQ=""
- QUIT
- +3 SET APCDLOCS(+Y)=""
- +4 QUIT
- SLOC ;EP - taxonomy of locations
- +1 SET X="LOCATION OF ENCOUNTER"
- 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,"APCDLOCS(")
- +3 IF '$DATA(APCDLOCS)
- SET APCDQ=""
- QUIT
- +4 IF $DATA(APCDLOCS("*"))
- SET APCDLOCT="A"
- KILL APCDLOCS
- WRITE !!,"**** all locations will be included ****",!
- QUIT
- +5 QUIT
- +6 ;
- OCLN ;EP - one clinic
- +1 SET DIC="^DIC(40.7,"
- SET DIC(0)="AEMQ"
- SET DIC("A")="Which CLINIC: "
- DO ^DIC
- KILL DIC
- +2 IF Y=-1
- SET APCDQ=""
- QUIT
- +3 SET APCDCLNS(+Y)=""
- +4 QUIT
- SCLN ;EP - taxonomy of clinics
- +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,"APCDCLNS(")
- +3 IF '$DATA(APCDCLNS)
- SET APCDQ=""
- QUIT
- +4 IF $DATA(APCDCLNS("*"))
- SET APCDCLNT="A"
- KILL APCDCLNS
- WRITE !!,"**** all CLINICS will be included ****",!
- QUIT
- +5 QUIT
- +6 ;
- OHL ;one hosp location
- +1 SET DIC="^SC("
- SET DIC(0)="AEMQ"
- SET DIC("A")="Which HOSPITAL LOCATION: "
- DO ^DIC
- KILL DIC
- +2 IF Y=-1
- SET APCDQ=""
- QUIT
- +3 SET APCDHLS(+Y)=""
- +4 QUIT
- SHL ;selected hospital locations
- +1 SET DIC="^SC("
- SET DIC(0)="AEMQ"
- SET DIC("A")="Which HOSPITAL LOCATION: "
- DO ^DIC
- KILL DIC
- +2 IF X=""
- QUIT
- +3 IF Y=-1
- SET APCDQ=""
- QUIT
- +4 SET APCDHLS(+Y)=""
- +5 GOTO SHL
- OPRV ;one PROV
- +1 SET DIC="^VA(200,"
- SET DIC(0)="AEMQ"
- SET DIC("A")="Which PROVIDER: "
- DO ^DIC
- KILL DIC
- +2 IF Y=-1
- SET APCDQ=""
- QUIT
- +3 SET APCDPRVS(+Y)=""
- +4 QUIT
- SPRV ;taxonomy of PROVIDERS
- +1 ;I $D(APCDIASE) G S
- +2 SET X="PRIMARY PROVIDER"
- 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
- +3 DO PEP^AMQQGTX0(+Y,"APCDPRVS(")
- +4 IF '$DATA(APCDPRVS)
- SET APCDQ=""
- QUIT
- +5 IF $DATA(APCDPRVS("*"))
- SET APCDPRVT="A"
- KILL APCDPRVS
- WRITE !!,"**** all PROVIDERS will be included ****",!
- QUIT
- +6 QUIT
- +7 ;
- SCDR ;selected CHART DEF REASONS
- +1 SET DIC="^AUTTCDR("
- SET DIC(0)="AEMQ"
- SET DIC("A")="Which CHART DEFICIENCY REASON: "
- DO ^DIC
- KILL DIC
- +2 IF X=""
- QUIT
- +3 IF Y=-1
- SET APCDQ=""
- QUIT
- +4 SET APCDCDRS(+Y)=""
- +5 GOTO SCDR
- +6 QUIT
- CPRV ;one PROV
- +1 SET DIC="^VA(200,"
- SET DIC(0)="AEMQ"
- SET DIC("A")="Which SECONDARY PROVIDER: "
- DO ^DIC
- KILL DIC
- +2 IF Y=-1
- SET APCDQ=""
- QUIT
- +3 SET APCDPRVS(+Y)=""
- +4 QUIT