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

ABMDECK.m

Go to the documentation of this file.
ABMDECK ; IHS/ASDST/DMJ - Check Claim Data for Errors ; 
 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
 ;
 ;IHS/SD/EFG - V2.5 P8 - IM16385
 ;   Modified to display page 8H for visit type 998
 ;
 K ABMC
SEL K DIR S DIR(0)="S^1:DETAILED CLAIM LISTING;2:ERROR LISTING ONLY"_$S($O(^ABMDCLM(DUZ(2),ABMP("CDFN"),11,0)):";3:PCC VISIT DISPLAY;4:HEALTH SUMMARY",$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),15,0)):";3:APC VISIT DISPLAY",1:"")
 S DIR("A")="Enter DESIRED REPORT",DIR("B")=2 D ^DIR
 G:$D(DUOUT)!$D(DTOUT)!$D(DIROUT) XIT
 I Y=1 S ABMP("DDL")="" G START
 I Y=2 S ABMP("ERROR LIST")="" G START
 I Y=3,$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),11,0)) D  G XIT
 .S ABMC=0 F  S ABMC=$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),11,ABMC)) Q:'ABMC  S ABMDVDSP=ABMC D ^ABMDVDSP
 I Y=3,$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),15,0)) D  G XIT
 .S ABMC=0 F  S ABMC=$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),15,ABMC)) Q:'ABMC  S ABMDADSP=ABMC D ^ABMDADSP
 I Y=4 S APCHSTYP=$O(^APCHSCTL("B","ADULT REGULAR",0)),APCHSPAT=ABMP("PDFN") I APCHSTYP D EN^APCHS K DIR S DIR(0)="E" D ^DIR K APCHSTYP,APCHSPAT G XIT
 W *7 G SEL
START S ABMP("PG")=0,ABMP("HEAD2")="CLAIM DATA ERRORS"
ZIS W !! S %ZIS("A")="Output DEVICE: ",%ZIS="NQ" D ^%ZIS
 I IO'=IO(0) D  Q
 .S ZTRTN="ENT^ABMDECK",ZTDESC="3P BILLING CLAIM DATA-CHECK/DISPLAY"
 .S ZTSAVE("ABMP(")=""
 .D ^%ZTLOAD
 .W:$G(ZTSK) "(Job Queued, Task Number: ",ZTSK,")"
 .D HOME^%ZIS
 .K ABMP("DDL"),ABMP("ERROR LIST")
 I $D(IO("S")) S IOP=ION D ^%ZIS
 G BEGIN
 ;
ENT ;EP - TaskMan Entry Point
 S ABMC("QUEON")=""
BEGIN S ABMC("CTR")=0
 S ABMC("ERR")=0
 I '$D(ABMP("DDL")) G ERRIN
 S ABMD("CTR")=0,ABMC("DDL")="",ABMP("SCRN")=1,ABMP("RTN")="^ABMDE1"
 D ^ABMDEVAR,SCRN^ABMDE
 K ABMP("QUIT"),DIROUT,DTOUT,DUOUT,DIR G DONE
 ;
ERRIN ;EP - for Claim Error Listing
 S (ABMC("CTR"),ABMC("ERR"),ABMP("CHK"))=0
 S ABMZ("PG")="E",ABMZ("TITL")="ERROR LISTING" I '$D(ABMC("QUE")),'$G(ABMQUIET) D SUM^ABMDE1
 ;
 S (ABMC("I"),ABMC("J"))=1,ABMC("K")="ERR"
LOOP ;LOOP
 I '$G(ABMQUIET) D
 .Q:'($Y>(IOSL-5))
 .S ABMC("DO")=$S('$D(ABMC("QUE")):"EOP^ABMDERR",1:"EOP") D @ABMC("DO")
 I $D(DUOUT)!$D(DIROUT)!$D(DTOUT) G DONE
 K ABME
 S ABMC=$P(ABMP("PAGE"),",",ABMC("I")) G DONE:ABMC="" I $D(ABMC("E0")),ABMC("CTR")>0 G DONE
 I ABMC=0 D  G LOOP
 .S ABMC("I")=ABMC("I")+1
 .D ^ABMDE0X
 .I +$O(ABME(0)) S ABME("CHK")="",ABMC("DO")=$S($D(ABMC("QUE")):"QUE^ABMDERR",$G(ABMQUIET):"QUE^ABMDERR",1:"^ABMDERR") D @ABMC("DO")
 I ABMC=5 S ABMC("K")=$P("A,B",",",ABMC("J"))
 I ABMC=8 S ABMC("K")=$P("A,B,C,D,E,F,G,H",",",ABMC("J")) G INCR:ABMP("BTYP")=831&$D(ABMP("FLAT"))&(ABMC("K")'="B"),INCR:ABMP("VTYP")=998&("DEFH"'[ABMC("K"))
 I ABMC=9 S ABMC("K")=$P("A,B,C,D,E,F",",",ABMC("J"))
 D @(ABMC("K")_"^ABMDE"_ABMC_"X")
INCR I ABMC=5 S ABMC("J")=$S(ABMC("K")="B":1,1:ABMC("J")+1),ABMC("I")=$S(ABMC("K")="B":ABMC("I")+1,1:ABMC("I")) S:ABMC("J")=1 ABMC("K")="ERR" G CHK
 I ABMC=8 S ABMC("I")=$S(ABMC("K")="H":ABMC("I")+1,1:ABMC("I")),ABMC("J")=$S(ABMC("K")="H":1,1:ABMC("J")+1) G CHK
 I ABMC=9 S ABMC("I")=$S(ABMC("K")="F":0,1:ABMC("I")),ABMC("J")=$S(ABMC("I")=0:0,1:ABMC("J")+1) G CHK
 S ABMC("I")=ABMC("I")+1
CHK I +$O(ABME(0)) S ABME("CHK")="",ABMC("DO")=$S($D(ABMC("QUE")):"QUE^ABMDERR",$G(ABMQUIET):"QUE^ABMDERR",1:"^ABMDERR") D @ABMC("DO")
 I ABMC=0 G DONE
 G LOOP
DONE ;DONE WITH LOOP
 S DIE="^ABMDCLM(DUZ(2),",DA=ABMP("CDFN")
 S DR=".05////"_ABMC("CTR") D ^DIE
 I $G(ABMQUIET) G XIT
 I $D(ABMP("DDL"))!($D(ABMP("ERROR LIST"))) W !!,"(End of Report)"
 I IO'=IO(0)!($E(IOST)'="C")!($D(IO("S"))) W $$EN^ABMVDF("IOF") D ^%ZISC I 1
 E  I $D(ABMP("DDL"))!$D(ABMP("ERROR LIST")) K DIR S DIR(0)="E" D ^DIR K DIR
 I $D(ABMC("E0")) Q
 I $D(ABMC("QUEON")) G XIT
 I $D(ABMP("DDL")) G XIT
 ;
ERR I ABMC("CTR")>0 W !!,*7,"  =========================================================================== "
 I  W !,"    Fatal ERRORS Exist a Bill can not be Generated until they are Resolved!    "
 I  W !,"  =========================================================================== ",! D HLP^ABMDERR
 ;
 ;
XIT K ABM,ABMC,POP,ZTSK,DIRUT,DTOUT,IO("Q"),DIR,DIRUT,DIQ,ABMP("DDL"),ABMP("CHK"),ABMP("ERROR LIST")
 Q
 ;
EOP I $G(ABMC("QUE"))'=2 W $$EN^ABMVDF("IOF")
 Q