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

APCDDVW.m

Go to the documentation of this file.
APCDDVW ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
START ;
 S APCDDT=$$FMTE^XLFDT(DT)
 S APCD80S="-------------------------------------------------------------------------------"
 S Y=APCDBD D DD^%DT S APCDBDD=Y S Y=APCDED D DD^%DT S APCDEDD=Y
 S APCDPG=0
 K APCDQUIT
 D @APCDT
DONE I $D(APCDET) S APCDDVTS=(86400*($P(APCDET,",")-$P(APCDBT,",")))+($P(APCDET,",",2)-$P(APCDBT,",",2)),APCDDVH=$P(APCDDVTS/3600,".") S:APCDDVH="" APCDDVH=0
 S APCDDVTS=APCDDVTS-(APCDDVH*3600),APCDDVM=$P(APCDDVTS/60,".") S:APCDDVM="" APCDDVM=0 S APCDDVTS=APCDDVTS-(APCDDVM*60),APCDDVS=APCDDVTS W !!,"RUN TIME (H.M.S): ",APCDDVH,".",APCDDVM,".",APCDDVS
 I $E(IOST)="C",IO=IO(0) S DIR(0)="E" D ^DIR K DIR
 W:$D(IOF) @IOF
XIT ; Clean up and exit
 K APCDDT,APCDLC,APCDV,APCDBS,APCDV2,APCDL,APCDECNT,APCDVR,APCDRD,DFN,APCDH,APCP,APCDFILE,APCDE,APCDPROC,APCD80S,APCDPG,APCDBDD,APCDEDD,APCDET,APCDQUIT,APCDDEM,APCDVFLE,APCDVDG,APCDVIGR,APCDVDFN,APCDDEMM
 K APCDDVS,APCDDVTS,Y,X,APCDDVM,APCDDVH
 Q
ZERO ; Write zero dependent report
 D ZERO^APCDDVW1
 Q
PPPV ; Print report 2
 D HEAD
 W !!,"TOTAL NUMBER OF ERRORS ON THIS PPPV REPORT: ",$G(APCDCNTR("PPPV")),!!
 I '$D(^XTMP("APCDDV",APCDJOB,APCDBT,"PPPV")) W !!,"There are no visits on or after ",$S(APCDPROC="P":"Posting",APCDPROC="V":"Visit",1:"Posting")," date " S Y=APCDBD D DT^DIO2 S Y="" W !,"with no Primary Provider and/or POV." Q
 S APCDCL=0 F  S APCDCL=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"PPPV",APCDCL)) Q:APCDCL'=+APCDCL!($D(APCDQUIT))  S APCDCLIN="" F  S APCDCLIN=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"PPPV",APCDCL,APCDCLIN)) Q:APCDCLIN=""!($D(APCDQUIT))  D
 .S APCDH="" F  S APCDH=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"PPPV",APCDCL,APCDCLIN,APCDH)) Q:APCDH=""!($D(APCDQUIT))  D
 ..S APCDV=0 F  S APCDV=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"PPPV",APCDCL,APCDCLIN,APCDH,APCDV)) Q:APCDV'=+APCDV!($D(APCDQUIT))  D:$Y>(IOSL-10) HEAD^APCDDVW Q:$D(APCDQUIT)  D PRN1,DE,ER
 Q
DE ;EP;FIND DEP ENTRIES
 W !?10,"This visit has:  "
 S APCDVFLE=9000010 F  S APCDVFLE=$O(^DIC(APCDVFLE)) Q:APCDVFLE>9000010.99!(APCDVFLE'=+APCDVFLE)  D DE2
 Q
 ;
DE2 ;
 S APCDVDG=^DIC(APCDVFLE,0,"GL"),APCDVIGR=APCDVDG_"""AD"",APCDV,APCDVDFN)"
 S APCDVDFN="" I $O(@APCDVIGR)]"" W ?27,$P($P(^DIC(APCDVFLE,0),U),"V ",2),"'s",!
 K APCDAPOV,APCDAPRV
 F APCDVI=1:1 S APCDVDFN=$O(@APCDVIGR) Q:APCDVDFN=""  D
 .S APCDK12N=APCDVDG_APCDVDFN_",12)",APCDK12D=""
 .I $D(@(APCDK12N)) S APCDK12D=@(APCDK12N)
 .S APCDK16N="",APCDK16D="" I APCDVFLE=9000010.09 S APCDK16N=APCDVDG_APCDVDFN_",16)" I $D(@(APCDK16N)) S APCDK16D=@(APCDK16N)
 .I $P(APCDK16D,U)]"" S APCDAPOV($P(APCDK16D,U))=""
 .I $P(APCDK12D,U,13)]"" S APCDAPOV($P(APCDK12D,U,13))=""
 .I $P(APCDK12D,U,2)]"" S APCDAPRV($P(^DIC(APCDVFLE,0),U)_" - "_$P($G(^VA(200,$P(APCDK12D,U,2),0)),U))=""
 .I $P(APCDK12D,U,4)]"" S APCDAPRV($P(^DIC(APCDVFLE,0),U)_" - "_$P($G(^VA(200,$P(APCDK12D,U,4),0)),U))=""
 I $G(APCDDOPP) D
 .I $D(APCDAPRV) D
 ..W !,"Ordering Providers:",!
 ..S APCDX="" F  S APCDX=$O(APCDAPRV(APCDX)) Q:APCDX=""!($D(APCDQUIT))  D
 ...D HEAD Q:$D(APCDQUIT)
 ...W ?3,APCDX,!
 I $G(APCDDLPV) D
 .I $D(APCDAPOV) D
 ..W !,"Lab Diagnoses: ",!
 ..S APCDX="" F  S APCDX=$O(APCDAPOV(APCDX)) Q:APCDX=""!($D(APCDQUIT))  D
 ...D HEAD Q:$D(APCDQUIT)
 ...W ?3,APCDX,!
 Q
 ;
MRG ;
 D MRG^APCDDVW1
 Q
TXER ;
 D TXER^APCDDVW2
 Q
ER ;
 S APCDV2=0 F  S APCDV2=$O(^XTMP("APCDDV",APCDJOB,APCDBT,"PPPV",APCDCL,APCDCLIN,APCDH,APCDV,APCDV2)) Q:APCDV2=""!($D(APCDQUIT))  W:APCDV2>1 ! W ?5,^XTMP("APCDDV",APCDJOB,APCDBT,"PPPV",APCDCL,APCDCLIN,APCDH,APCDV,APCDV2)
 Q
PRN1 ;EP
 S APCDVR=^AUPNVSIT(APCDV,0) S:'$P(APCDVR,U,6) $P(APCDVR,U,6)=0
 S DFN=$P(APCDVR,U,5)
 S Y=+APCDVR X ^DD("DD") S APCDRD=Y
 W !!," HRN FAC: [",$P(^AUTTLOC(APCDCL,0),U,7),"] HRN: [",APCDH,"] NAME: [",$P(^DPT(DFN,0),U),"]"
 W !," DATE: [",APCDRD,"]  LOCATION: [",$S($D(^DIC(4,$P(APCDVR,U,6),0)):$P(^(0),U),1:"UNKNOWN"),"]"
 W !," SERVICE CATEGORY: [",$P(APCDVR,U,7),"]  TYPE: [",$P(APCDVR,U,3),"] CLINIC: [",$S($P(APCDVR,U,8)]"":$P(^DIC(40.7,$P(APCDVR,U,8),0),U),1:"NONE"),"]"
 I $P($G(^AUPNVSIT(APCDV,12)),U,11)]"" W !," Ext Acct #: ",$P($G(^AUPNVSIT(APCDV,12)),U,11) ;IHS/CMI/LAB - added acct # display
 I APCDT'="PPPV",$P(APCDVR,U,9) W !," DEPENDENT ENTRIES: [",$P(APCDVR,U,9),"]" D DISPPP^APCDDVW1
 ;
 Q
 ;
INPT ;
 D INPT^APCDDVW1
 Q
ALL ;
 S APCDT="ZERO" D ZERO Q:$D(APCDQUIT)
 S APCDT="PPPV" D PPPV Q:$D(APCDQUIT)
 S APCDT="MRG" D MRG Q:$D(APCDQUIT)
 S APCDT="TXER" D TXER Q:$D(APCDQUIT)
 S APCDT="INPT" D INPT Q:$D(APCDQUIT)
 Q
 ;
PPPVSUB W !,"THE FOLLOWING VISITS DO NOT HAVE EITHER A PRIMARY PROVIDER OR PURPOSE OF VISIT"
 Q
ZEROSUB W !,"VISITS WITH A ZERO DEPENDENT ENTRY COUNT -- POTENTIAL DELETIONS"
 Q
TXERSUB ;
 W !,"LIST OF VISITS WITH TRANSACTION ERRORS"
 I $D(APCDDEMM) W "----MANDATORY DEMOGRAPHIC DATA ITEMS",!,"*******MUST BE CORRECTED IN ORDER FOR DATA TO BE TRANSMITTED*******"
 I $D(APCDDEM) W "----DEMOGRAPHIC ERRORS (PAT REG)"
 Q
MRGSUB ;
 W !,"MULTIPLE VISITS ON ONE DAY;POTENTIAL MERGES"
 Q
INPTSUB ;
 W !,"VISITS WITH INPATIENT EDIT ERRORS"
 Q
 G:$D(APCDDEM)!($D(APCDDEMM)) HEAD2
 I 'APCDPG G HEAD1
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
HEAD1 ;
 W:$D(IOF) @IOF S APCDPG=APCDPG+1
 W !,APCDDT,?70,"Page: ",APCDPG
 W !?29,"PCC Data Entry Module"
 W !?23,"*********************************"
 W !?23,"*   VISIT REVIEW ERROR REPORT   *"
 W !?23,"*********************************"
 W !!,"Report of Errors for ",$S(APCDPROC="P":"Posting",APCDPROC="V":"VISIT",1:"Posting")," Date Range: ",APCDBDD," through ",APCDEDD
 S X=$S(APCDLOCT="A":"ALL Locations Included",APCDLOCT="O":"Location of Encounter: "_$P(^DIC(4,APCDLOCT("ONE"),0),U),APCDLOCT="S":"LOCATIONs Included: ALL Within the "_$P(^AUTTSU(APCDLOCT("SU"),0),U)_" Service Unit",1:"")
 W !?(80-$L(X)/2),X
 W !,APCD80S
 D @(APCDT_"SUB")
 W !,APCD80S
 Q