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

ICDZCOST.m

Go to the documentation of this file.
ICDZCOST ; IHS/ANMC/MWR - CONTRACT CARE COST ESTIMATOR ; AUGUST 14, 1992
 ;; VERSION 8.0;DRG GROUPER;;AUG 14, 1992
 ; ADAPTED FROM GIS/OHPRD/IHS;CONTRACT CARE COST ESTIMATOR;
 S U="^"
 ;
CHECK ;
 I '$D(ICDDRGN) D  G EXIT
 .W !!,"The variable, ICDDRGN (the DRG number), is not defined."
 I '$D(^ICD(ICDDRGN,0)) D  G EXIT
 .W !!,"No entry for ",ICDDRGN," in the DRG file."
 I '$D(^ICD(ICDDRGN,9999999)) D  G EXIT
 .W !!,"No HCFA/IHS WEIGHT data stored for this entry in the DRG file."
 I '$D(^AMER("2.1",0)) D  G EXIT
 .W !!,"(There is no ER CONTRACT COST ESTIMATOR FILE.)"
 ;
WEIGHT ; GET HCFA/IHS WEIGHT FROM DRG FILE.
 S ICDDRGW=+^ICD(ICDDRGN,9999999)
 ;
COSTS ; BUILD ARRAY OF ESTIMATED COSTS
 K ICDTEMP
 S ICDN=0 F  S ICDN=$O(^AMER(2.1,ICDN)) Q:'ICDN  S ICDOK="" D
 .S ICDX=^AMER(2.1,ICDN,0)
 .S ICDNAME=$P(ICDX,U,4)
 .S ICDCOST=(ICDDRGW*$P(ICDX,U,2))+$P(ICDX,U,3)
 .I ICDCOST>0 S ICDOK1=""
 .S ICDCOST=+$J(ICDCOST,1,2)
 .S ICDTEMP(ICDCOST)=ICDNAME
 ;
 I '$D(ICDOK) D  G EXIT
 .W !!,"(There are no entries in the ER CONTRACT COST ESTIMATOR FILE.)"
 I '$D(ICDOK1) D  G EXIT
 .W !!,"(The entries in the ER CONTRACT COST ESTIMATOR FILE contain"
 .W " no cost data.)"
 ;
OUTPUT ;
 W !!,"ESTIMATED COSTS FOR DRG = ",ICDDRGN
 W !!,"Remember, costs do not include physician fees!",!
 ;
 S ICDCOST=0 F ICDI=1:1 S ICDCOST=$O(ICDTEMP(ICDCOST)) Q:'ICDCOST  D
 .S ICDX=ICDTEMP(ICDCOST)
 .S ICDX=$E(ICDX,1,30)
 .S ICDY=$E("..............................",1,30-$L(ICDX))
 .W !,ICDI,") ",?4,ICDX,ICDY,?37
 .S X=ICDCOST,X2="2$" D COMMA^%DTC W X
 .K ICDX,ICDY,X,X2
 ;
EXIT ;
 K DIR,ICDCOST,ICDDRGN,ICDDRGW,ICDDRG,ICDI,ICDOK,ICDOK1,ICDX,ICDY
 Q