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

APCDFQAC.m

Go to the documentation of this file.
  1. APCDFQAC ; IHS/CMI/LAB - QA AUDIT ON ICD CODING ;
  1. ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
  1. ;
  1. START ;
  1. S APCDSITE="" S:$D(DUZ(2)) APCDSITE=DUZ(2)
  1. I '$D(DUZ(2)) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!! K APCDSITE Q
  1. I 'DUZ(2) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER",!! K APCDSITE Q
  1. W:$D(IOF) @IOF
  1. S APCDLHDR="ICD DIAGNOSIS CODING AUDIT FOR SELECTED SET OF VISITS"
  1. W !?((80-$L(APCDLHDR))/2),APCDLHDR
  1. W !!,"This report will list the purpose of visits for visits that you select."
  1. W !,"The ICD code and provider narrative will be displayed so that coding"
  1. W !,"can be reviewed."
  1. W !,"You will be able to select visits by the following items:"
  1. W !?5,"- Visit date or Date Last Modified"
  1. W !?5,"- Service Category"
  1. W !?5,"- Clinic"
  1. W !?5,"- Operator who last marked the visit as reviewed complete"
  1. W !?10,"or last modified the POV"
  1. W !?5,"- Visits marked as Reviewed/Complete or All Visits"
  1. W !?10,"NOTE: since Hospital, Telephone, Chart Review visits don't need"
  1. W !?10,"to be marked as reviewed/complete in the coding queue, select all"
  1. W !?10,"visits if you want those included."
  1. W !?5,"- Visit by ICD diagnosis code"
  1. S APCDJOB=$J,APCDBT=$H
  1. K ^XTMP("APCDFQA",APCDJOB,APCDBT)
  1. DLMVD ;RUN BY DATE LAST MODIFIED OR VISIT DATE?
  1. S APCDSITE="" S:$D(DUZ(2)) APCDSITE=DUZ(2)
  1. I '$D(DUZ(2)) S APCDSITE=+^AUTTSITE(1,0)
  1. S DIR(0)="S^1:Date Visit Last Modified;2:Visit Date",DIR("A")="Run Report by",DIR("B")="1" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G XIT
  1. S Y=$E(Y),APCDPROC=$S(Y=1:"M",Y=2:"V",1:Y),APCDPROD=$S(Y=1:"Last Modified",1:"Visit"),APCDXREF=$S(Y=1:"ADLM",2:"B")
  1. GETDATES ;
  1. BD ;get beginning date
  1. W ! S DIR(0)="D^:DT:EP",DIR("A")="Enter Beginning "_APCDPROD_" Date" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G DLMVD
  1. S APCDBD=Y
  1. ED ;get ending date
  1. W ! S DIR(0)="DA^"_APCDBD_":DT:EP",DIR("A")="Enter Ending "_APCDPROD_" Date: " S Y=APCDBD D DD^%DT S DIR("B")=Y,Y="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G BD
  1. S APCDED=Y
  1. S X1=APCDBD,X2=-1 D C^%DTC S APCDSD=X
  1. SC ;
  1. W !
  1. K APCDSCT
  1. K APCDSC,APCDSCT W ! S DIR(0)="YO",DIR("A")="Include ALL Visit Service Categories",DIR("B")="Yes"
  1. S DIR("?")="If you wish to include all visit service categories (Ambulatory,Hospitalization,etc) answer Yes. If you wish to list visits for only one service category enter NO." D ^DIR K DIR
  1. G:$D(DIRUT) BD
  1. I Y=1 G CLN
  1. SC1 ;enter sc
  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 XIT
  1. D PEP^AMQQGTX0(+Y,"APCDSCT(")
  1. I '$D(APCDSCT) G SC
  1. I $D(APCDSCT("*")) K APCDSCT
  1. CLN ;
  1. W !
  1. S APCDCLN="",DIR("A")="Include which Visits",DIR(0)="S^R:One Clinic;A:All Clinics",DIR("B")="A",DIR("?")="" D ^DIR K DIR
  1. I $D(DIRUT) G SC
  1. I Y="A" G PROV
  1. S DIC="^DIC(40.7,",DIC(0)="AEQM",DIC("A")="Clinic: "
  1. D ^DIC K DIC,DA
  1. G:Y=-1 CLN
  1. S APCDCLN=+Y
  1. ;
  1. ;
  1. PROV ;
  1. W !
  1. S APCDPROV=""
  1. S DIR(0)="S^O:Visits completed by or w/POV last modified by one Operator;A:All visits, don't limit by operator",DIR("A")="Include which Visits",DIR("B")="O" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G CLN
  1. I Y="A" G RV
  1. S DIC="^VA(200,",DIC(0)="AEQM",DIC("A")="Which CODER/OPERATOR: " D ^DIC K DIC
  1. I $D(DTOUT)!(Y=-1) G PROV
  1. S APCDPROV=+Y
  1. ;
  1. RV ;
  1. S APCDRVC=""
  1. S DIR(0)="S^R:Only Visits Marked as Reviewed/Complete;A:All visits regardless of Coding Status",DIR("A")="Include which Visits",DIR("B")="R" KILL DA D ^DIR K DIR
  1. I $D(DIRUT) G PROV
  1. S APCDRVC=Y
  1. ICD ;
  1. W !
  1. K ^XTMP("APCDFQA",APCDJOB,APCDBT,"DEPOV"),DA,DIR,DTOUT,DIRUT,Y,X,DIC
  1. S DIR(0)="Y",DIR("A")="Do you wish to include only a subset of ICD Diagnoses",DIR("B")="NO",DIR("?")="If you wish to limit the search of POV's to a subset of ICD Codes, enter Y" D ^DIR K DIR
  1. G:$D(DIRUT) RAND
  1. I Y=0 S ^XTMP("APCDFQA",APCDJOB,APCDBT,"DEPOV","ALL")="" G RAND
  1. K APCDTABL D ^APCDFQA3
  1. I '$D(APCDTABL) G ICD
  1. RAND ;
  1. W !
  1. S APCDMAX="",DIR("A")="Include which Visits",DIR(0)="S^R:Random Sample of Visits;A:All visits",DIR("B")="A",DIR("?")="If you want ALL Visits in this date range displayed Answer Y, if you want a random sample answer NO." D ^DIR K DIR
  1. I $D(DIRUT) G ICD
  1. I Y="A" S APCDRSM=0 G ZIS
  1. S DIR(0)="N^1:100:",DIR("A")="How many randomized visits do you want" D ^DIR K DIR
  1. I $D(DIRUT) G RAND
  1. S APCDMAX=Y,APCDRSM=1
  1. ZIS W !! S %ZIS="PQM" D ^%ZIS
  1. I POP G XIT
  1. I $D(IO("Q")) G TSKMN
  1. DRIVER ; entry point for taskman
  1. ZTSK ;
  1. D ^APCDFQC1
  1. S APCDDT=$$FMTE^XLFDT(DT)
  1. U IO
  1. D ^APCDFQCP
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. K ^XTMP("APCDFQA",APCDJOB,APCDBT)
  1. D XIT
  1. Q
  1. ERR W $C(7),$C(7),!,"Must be a valid date and be Today or earlier. Time not allowed!" Q
  1. TSKMN ;
  1. S ZTIO=""
  1. S ZTIO=$S($D(ION):ION,1:IO) I $D(IOST)#2,IOST]"" S ZTIO=ZTIO_";"_IOST
  1. I $G(IO("DOC"))]"" S ZTIO=ZTIO_";"_$G(IO("DOC"))
  1. I $D(IOM)#2,IOM S ZTIO=ZTIO_";"_IOM I $D(IOSL)#2,IOSL S ZTIO=ZTIO_";"_IOSL
  1. K ZTSAVE F %="APCD*" S ZTSAVE(%)=""
  1. S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^APCDFQAC",ZTDTH="",ZTDESC="PCC DE QA" D ^%ZTLOAD D XIT Q
  1. ;
  1. ;
  1. XIT ;
  1. D ^%ZISC
  1. I '$D(ZTSK) S IOP="HOME" D ^%ZIS U IO(0)
  1. K DIC,%DT,IO("Q"),X,Y,POP,DIRUT,ZTSK,ZTIO
  1. D EN^XBVK("APCD")
  1. Q
  1. ;
  1. ;