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

ACHSDNU2.m

Go to the documentation of this file.
ACHSDNU2 ; IHS/ITSC/PMF - DENIAL UNMET NEED LIST (3/3) ; [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 S $P(^TMP("ACHSDNU",$J,0),U,1,2)="^ACHSDNU2"
 K ^TMP("ACHSDNU",$J,0,"ACHSQIO")
 G K:'$D(^DD(9002071.01,400,0))!'$D(^DD(9002071.01,420,0))
 S ACHS=$P(^DD(9002071.01,400,0),U,3) F ACHS(1)=1:1 Q:$P(ACHS,";",ACHS(1))=""  S ACHS(2)=$P(ACHS,";",ACHS(1)),ACHS("UN",$P(ACHS(2),":"))=$P(ACHS(2),":",2)
 ;S ACHS=$P(^DD(9002071,420,0),U,3) F ACHS(1)=1:1 Q:$P(ACHS,";",ACHS(1))=""  S ACHS(2)=$P(ACHS,";",ACHS(1)),ACHS("CATG",$P(ACHS(2),":"))=$P(ACHS(2),":",2)
 ;GET MEDICAL CATEGORIES FROM CHS MEDICAL PRIORITIES
 ;
 S MEDPRI=0 F  S MEDPRI=$O(^ACHSMPRI(MEDPRI)) Q:+MEDPRI=0  D
 .S MEDPRI0=$G(^ACHSMPRI(MEDPRI,0))
 .S ACHS("CATG",MEDPRI)=$P(MEDPRI0,U,2)
 ;
 ;
 S ACHSCAT="",(ACHSTOT,ACHSDOL)=0
 S Y=ACHSBDT X ^DD("DD") S ACHS("BDT")=Y,Y=ACHSEDT X ^DD("DD") S ACHS("EDT")=Y,ACHST1=$$C^XBFUNC("For the period "_ACHS("BDT")_" through "_ACHS("EDT"),80)
 D BRPT^ACHSFU
A ;
 ;
 S ACHSCAT=$O(^TMP("ACHSUN",$J,ACHSCAT)) D CTOTAL:ACHSCAT=""&$D(ACHSTYPE) G END1:ACHSCAT="" D CTOTAL:$D(ACHSTOT1) S ACHSTYPE=ACHS("CATG",ACHSCAT),(ACHSTOT1,ACHSTOT1("$"))=0 D HDR S ACHSNEED=""
B S ACHSNEED=$O(^TMP("ACHSUN",$J,ACHSCAT,ACHSNEED)) G A:ACHSNEED="" I $Y>ACHSBM D RTRN^ACHS G K:$D(DUOUT)!$D(DTOUT) D HDR
 S ACHSISDT=0 W !,ACHS("UN",ACHSNEED),! F ACHS=1:1:$L(ACHS("UN",ACHSNEED)) W "-"
 W !
C ;
 S ACHSISDT=$O(^TMP("ACHSUN",$J,ACHSCAT,ACHSNEED,ACHSISDT)) G B:+ACHSISDT=0 S ACHSNAME=""
D ;
 S ACHSNAME=$O(^TMP("ACHSUN",$J,ACHSCAT,ACHSNEED,ACHSISDT,ACHSNAME)) G C:ACHSNAME="" S DA=0
E ;
 S DA=$O(^TMP("ACHSUN",$J,ACHSCAT,ACHSNEED,ACHSISDT,ACHSNAME,DA)) G D:+DA=0 S ACHS("T$")=+^(DA),ACHSDNUM=$P(^ACHSDEN(DUZ(2),"D",DA,0),U)
 S Y=ACHSISDT X ^DD("DD") W "  ",Y,?16,ACHSDNUM,?29,ACHSNAME,?70,$J(ACHS("T$"),6,2),! I $Y>ACHSBM D RTRN^ACHS G K:$D(DUOUT)!$D(DTOUT) D HDR
 S ACHSTOT=ACHSTOT+1,ACHSTOT1=ACHSTOT1+1,ACHSTOT1("$")=ACHSTOT1("$")+ACHS("T$"),ACHSDOL=ACHSDOL+ACHS("T$")
 G E
CTOTAL ;
 S X=ACHSTOT1("$"),X2="2$" D COMMA^%DTC W !,ACHS("="),!!,"TOTALS FOR ",ACHSTYPE,":  ",ACHSTOT1," DENIAL",$S(ACHSTOT1>1:"S",1:""),?65,X
 Q
 ;
END1 ; Print totals. 
 I ACHSPG=0 W "Facility UN-MET NEED list for ",ACHSLOC,!!!,"(No un-met needs were recorded during this time period.)" G END2
 S X=ACHSDOL,X2="2$" D COMMA^%DTC W !,ACHS("="),!!!,"TOTAL DENIALS ON THIS REPORT: ",ACHSTOT," DENIAL",$S(ACHSTOT>1:"S",1:""),?65,X
 ;
END2 ; Ask RTRN, write IOF, kill vars, do ERPT, quit.
 D RTRN^ACHS W @IOF
 ;
K K ACHSCAT,ACHSDNUM,ACHSDOL,ACHSISDT,ACHSNAME,ACHSNEED,ACHSTOT,ACHSTOT1,ACHSTYPE,DA,X2,ZTSK
 D ERPT^ACHS
 Q
 ;
HDR ; Print header.
 S ACHSPG=ACHSPG+1,ACHST2="PRIORITY: "_ACHSTYPE_"   (page "_ACHSPG_")"
 W @IOF,!!,$$C^XBFUNC("***  CONTRACT HEALTH CARE SYSTEM REPORT  ***",80),!!,ACHSLOC,!,$$C^XBFUNC("DENIAL SYSTEM - UNMET NEEDS LIST",80),!,ACHSTIME
 W !!,ACHST1,!!?80-$L(ACHST2)\2,ACHST2,!!,"TYPE OF UNMET NEED",!?2,"ISSUE DATE",?16,"DENIAL #",?29,"PATIENT",?70,"DOLLARS",!,ACHS("="),!
 Q