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

ACHSDNU1.m

Go to the documentation of this file.
ACHSDNU1 ; IHS/ITSC/PMF - DENIAL UNMET NEED LIST (2/3) ; [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;G:$D(ZTQUEUED) ST
 ;S (ACHSZTDT,ZTDTH)=$H,ZTRTN="^ACHSDNU1",ZTDESC="CHS UNMET Need List, "_$E(ACHSBDT,2,7)_" to "_$E(ACHSEDT,2,7) F ACHS="ACHSBDT","ACHSEDT","DUZ(2)" S ZTSAVE(ACHS)=""
 ;K ION D ^%ZTLOAD S X="^%ZTSCH("""_ACHSZTDT_""","_ZTSK_")" K @X,ACHSZTDT
 ;
ST S ACHSISDT=ACHSBDT-1 K ^TMP("ACHSDNU",$J),^TMP("ACHSUN",$J)
 ;
AA S ACHSISDT=$O(^ACHSDEN(DUZ(2),"D","AISSUE",ACHSISDT)) G END:+ACHSISDT=0!(+ACHSISDT>ACHSEDT) S DA=0
 ;
BB ;
 S DA=$O(^ACHSDEN(DUZ(2),"D","AISSUE",ACHSISDT,DA)) G AA:+DA=0,BB:'$D(^ACHSDEN(DUZ(2),0)),BB:'$D(^ACHSDEN(DUZ(2),"D",DA,400)) S ACHSNEED=$P(^(400),U),ACHSCAT=$P(^(400),U,2)
 G BB:ACHSNEED']""!(ACHSNEED="N"),BB:ACHSCAT']""
 G C1:$P($G(^ACHSDEN(DUZ(2),"D",DA,0)),U,6)="N" S ACHSNAME=$P($G(^ACHSDEN(DUZ(2),"D",DA,0)),U,7) G BB:ACHSNAME']"",BB:'$D(^DPT(ACHSNAME,0)) S ACHSNAME=$P(^(0),U) G BB:ACHSNAME']"",DD
 ;
C1 G BB:'$D(^ACHSDEN(DUZ(2),"D",DA,10)) S ACHSNAME=$P(^ACHSDEN(DUZ(2),"D",DA,10),U) G BB:ACHSNAME']""
 ;
DD D DOLLARS(DUZ(2)) S ^TMP("ACHSUN",$J,ACHSCAT,ACHSNEED,ACHSISDT,ACHSNAME,DA)=ACHS("$")
 G BB
 ;
END K A
 G ^ACHSDNU2
 ;
DOLLARS(FACILITY) ;EP - Get Dollar Amount for each Denial.
 S ACHS("$")=$S(+$P(^ACHSDEN(FACILITY,"D",DA,100),U,9):+$P(^(100),U,9),1:+$P(^(100),U,8))
 I $D(^ACHSDEN(FACILITY,"D",DA,200)) F DA(1)=0:0 S DA(1)=$O(^ACHSDEN(FACILITY,"D",DA,200,DA(1))) Q:'DA(1)  I $D(^(DA(1),0)) S ACHS("$")=ACHS("$")+$S(+$P(^(0),U,3):$P(^(0),U,3),1:+$P(^(0),U,2))
 I $D(^ACHSDEN(FACILITY,"D",DA,210)) F DA(1)=0:0 S DA(1)=$O(^ACHSDEN(FACILITY,"D",DA,210,DA(1))) Q:'DA(1)  I $D(^(DA(1),0)) S ACHS("$")=ACHS("$")+$S(+$P(^(0),U,7):+$P(^(0),U,7),1:+$P(^(0),U,6))
 I $D(^ACHSDEN(FACILITY,"D",DA,800)) F DA(1)=0:0 S DA(1)=$O(^ACHSDEN(FACILITY,"D",DA,800,DA(1))) Q:'DA(1)  I $D(^(DA(1),0)) S ACHS("$")=ACHS("$")-(+$P(^(0),U,2))
 Q
AMT ;EP - Write amount of denial on denial letter(s).
 S ACHS("$")=0 D DOLLARS(DUZ(2)) W:$X>9 ! W ?9,"Total amount of services denied : " S X=ACHS("$") D FMT^ACHS W !
 Q