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

ACHSDN4.m

Go to the documentation of this file.
ACHSDN4 ; IHS/ITSC/PMF - DENIAL EDIT - DENIAL REASONS ;  [ 02/12/2002  10:26 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**3,18,19,21**;JUN 11, 2001;Build 43
 ;ACHS*3.1*19 Rewrote routine
 ;
 N ALT,DAT,SS
 ;
TOF ;
 S ACHDOPTR="E"
 W @IOF,$$REPEAT^XLFSTR("=",79),!?30,"DENIAL REASONS EDIT",!,$$REPEAT^XLFSTR("=",79),!!,"PRIMARY DENIAL REASON: ",!
 S X=$$DN^ACHS(250,1),X1=$$DN^ACHS(250,2)
 I X,$D(^ACHSDENS(X,0)) D  G OTHREAS
 .W !?10,"1. ",$P($G(^ACHSDENS(X,0)),U),!
 .W:X1 ?15,$P($G(^ACHSDENS(X,20,X1,0)),U)
 .S ACHDREA(1)=U_X_U_X1
 .I (($P($G(^ACHSDENS(X,20,X1,0)),U)["Eligible")!($P($G(^ACHSDENS(X,20,X1,0)),U)["Failure")),$D(^ACHSDEN(DUZ(2),"D",ACHSA,256)) D
 ..S R1=0 F  S R1=$O(^ACHSDEN(DUZ(2),"D",ACHSA,256,R1)) Q:R1'?1N.N  D
 ...S R2=$P(^ACHSDEN(DUZ(2),"D",ACHSA,256,R1,0),U)
 ...W !,?20,$P($G(^ACHSDENS(X,30,R2,0)),U)
 W !!,*7,*7,"No Primary Denial Reason Has Been Entered, But is required" D PRIM
 K ACHDREA G TOF
 ;
OTHREAS ; --- List other Denial Reasons
 ;I $D(^ACHSDEN(DUZ(2),"D",ACHSA,300,0)),($P($G(^ACHSDEN(DUZ(2),"D",ACHSA,300,0)),U,4))>0 W !!,"OTHER DENIAL REASONS: ",!
 S ACHDREA=0,ACHDCNT=1
 F  S ACHDREA=$O(^ACHSDEN(DUZ(2),"D",ACHSA,300,ACHDREA)) Q:ACHDREA'?1.N  D
 .I ACHDCNT=1 W !!,"OTHER DENIAL REASONS: ",!
 .S ACHDCNT=ACHDCNT+1
 .S ACHDOTR=$P(^ACHSDEN(DUZ(2),"D",ACHSA,300,ACHDREA,0),U),ACHDROPT=$P(^(0),U,2)
 .W !?10,ACHDCNT,". ",$P($G(^ACHSDENS(ACHDOTR,0)),U),!
 .I ACHDROPT W ?15,$P($G(^ACHSDENS(ACHDOTR,20,ACHDROPT,0)),U)
 .I (($P($G(^ACHSDENS(ACHDOTR,20,ACHDROPT,0)),U)["Eligible")!($P($G(^ACHSDENS(ACHDOTR,20,ACHDROPT,0)),U)["Failure")),$D(^ACHSDEN(DUZ(2),"D",ACHSA,300,ACHDREA,4)) D
 ..S R1=0 F  S R1=$O(^ACHSDEN(DUZ(2),"D",ACHSA,300,ACHDREA,4,R1)) Q:R1'?1N.N  D
 ...S R2=$P(^ACHSDEN(DUZ(2),"D",ACHSA,300,ACHDREA,4,R1,0),U)
 ...W !,?20,$P($G(^ACHSDENS(ACHDOTR,30,R2,0)),U)
 .S ACHDREA(ACHDCNT)=ACHDREA_U_ACHDOTR_U_ACHDROPT
 ;
OTHR1 ;
 ;
 S %=$$DIR^ACHS("FO","Enter Number Of Reason To Edit, 'A' To ADD Reason","","","",2)
 I (%="")!$D(DUOUT)!$D(DTOUT) D END Q
 S Y=+%,%=$S(+%=1:"PRIM","Aa"[%:"ADD",1:"OTHER")
 I (Y>ACHDCNT)!((%="OTHER")&('$D(ACHDREA(Y)))) W !,"Please enter a number from 1 to ",ACHDCNT,"." G OTHR1
 S ACHDRED=+Y,ACHDR=$S(%="OTHER":"Other",1:"Primary")
 D @%
 G TOF
 ;
END ;
 K ACHDREA,TMP
 Q
 ;
PRIM ;
 D REA
 I X="@" W !!?5,"Must have a Primary Denial Reason." H 1 Q
 ;I EDITING REASON THEN CHECK TO SEE IF DUPLICATE
 S (X,ACHDOTR,ACHDENR)=+Y
 S ACHDORNM=$P(ACHDREA(ACHDRED),U)
 S ACHDOREO=$P($G(^ACHSDENS(ACHDOTR,0)),U)
 I ACHDOTR'=$P(ACHDREA(ACHDRED),U,2) G PRIM:$$REASCK^ACHSDN2() D PRMSET
 Q:$D(DUOUT)
 D REAOPT^ACHSDN2
 I $D(Y),+Y<0 W !?5,"Denial Option did not change." H 1
 Q
 ;
OTHER ;EDIT OTHER DENIAL REASON
 D REA
 S ACHDORNM=$P(ACHDREA(ACHDRED),U)
 I X="@" D OTHSET Q  ;THEN DELETE ENTRY...
 ;I EDITING REASON THEN CHECK TO SEE IF DUPLICATE
 S (X,ACHDOTR)=+Y
 S ACHDOREO=$P($G(^ACHSDENS(ACHDOTR,0)),U)
 I ACHDOTR'=$P(ACHDREA(ACHDRED),U,2) G OTHER:$$REASCK^ACHSDN2() D OTHSET
 D OPTSET
 D OTHREA1^ACHSDN2
 Q
REA ;
 S X=0,CT=0
 W !!?3,"Denial Reason List:"
 F  S X=$O(^ACHSDENS(X)) Q:X'?1N.N  D
 .I $D(^ACHSDENS(X,10)),$P(^ACHSDENS(X,10),U)>"" Q:$P(^ACHSDENS(X,10),U)<DT
 .S CT=CT+1 W !?5,CT,". ",$P(^ACHSDENS(X,0),U)
 .S ACHDENS(CT)=X_U_$P(^ACHSDENS(X,0),U)
 .I X=$P(ACHDREA(ACHDRED),U,2) S ACHDREDT=CT
 I CT=0 W !,"No active Denial Reasons" S Y=-1 Q
 W !
 S DIR(0)="NO^1:"_CT
 S DIR("A")="Enter "_ACHDR_" Denial Reason: "_$P(^ACHSDENS($P(ACHDREA(ACHDRED),U,2),0),U)
 S DIR("B")=ACHDREDT
 D ^DIR
 ;ACHS*3.1*21 CHANGED NXT LINE
 ;I +Y>0 S Y=ACHDENS(Y)
 S TMP=""
 I +Y>0 S TMP=ACHDENS(Y)
 I ACHDR["Primary",+Y>0,Y'=ACHDREDT D PRMDEL
 I ACHDR["Other",+Y>0,Y'=ACHDREDT,ACHDCNT>1 S X="@",ACHDORNM=$P(ACHDREA(ACHDRED),U) D
 .D OTHSET
 .I $P(^ACHSDEN(DUZ(2),"D",ACHSA,300,0),U,4)<1 S $P(^(0),U,3,4)="1^1"
 S:TMP Y=TMP
 K DIR
 Q
PRMSET ;PRIMARY DENIAL REASON SET
 S ACHDENR=+Y
 ;ACHS*3.1*10 4.22.04 IHS/ITSC/FCJ TEST FOR REF TO SET DENIAL REASON
 I $G(ACHSREF) S ACHSREF(1114)=ACHDENR ;ACHS*3.1*10 4.22.04
 S ACHSDREA=$P($G(^ACHSDENS(ACHDENR,0)),U)  ;ACHS*3.1*18 NEW LINE
 I '$$DIE^ACHSDN("250////"_ACHDENR) Q
 I $D(Y) S DUOUT="" Q
 Q
PRMDEL ;PRIM DEL OTHER TYPE ;ACHS*3.1*21 NEW SECTION
 Q:'$D(^ACHSDEN(DUZ(2),"D",ACHSA,256))
 S DIE="^ACHSDEN("_DUZ(2)_",""D"","_ACHSA_",256,"
 S DR=".01_///@"
 S L=0 F  S L=$O(^ACHSDEN(DUZ(2),"D",ACHSA,256,L)) Q:L'?1N.N  D
 .S DA(2)=DUZ(2)
 .S DA(1)=ACHSA
 .S DA=L
 .D ^DIE
 K DIE,DA,DR
 Q
OTHSET ;SET OTHER DENIAL REASON
 S DIE="^ACHSDEN("_DUZ(2)_",""D"","_ACHSA_",300,"
 S DA(2)=DUZ(2)
 S DA(1)=ACHSA
 S DA=ACHDORNM
 S DR=".01_///"_X
 I '$$LOCK^ACHS("^ACHSDEN(DUZ(2),""D"",ACHSA,300)","+") S DUOUT="" Q
 D ^DIE
 I '$$LOCK^ACHS("^ACHSDEN(DUZ(2),""D"",ACHSA,300)","-") S DUOUT="" Q
 K DIE,DA,DR
 Q
OPTSET ;SET OPTION
 D OTHREAO^ACHSDN2
 Q
 ;
ADD ;ADD OTHER DENIAL REASON
 W !!
 D OTHREAS^ACHSDN2
 Q
 ;