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

ACHSLDCR.m

Go to the documentation of this file.
ACHSLDCR ; IHS/ITSC/PMF - LOCATE DCR FROM CHS SERVICE CLASS DICTIONARY ;   [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;
 I +ACHSDCR>0 G END
 S ACHSDCR=-1
 I '$D(ACHSCC) W !,"DCR LOOKUP ERROR :   No Cost Center.",!! W:$$DIR^XBDIR("E") "" G END
 S N=$O(^ACHS(3,DUZ(2),1,ACHSSCC,"CC","B",ACHSCC,"")),ACHSDCR=""
 G END:+N<1
 I $D(^ACHS(3,DUZ(2),1,ACHSSCC,"CC",N,0)) S ACHSDCR=$P($G(^ACHS(3,DUZ(2),1,ACHSSCC,"CC",N,0)),U,2),ACHS("DCRS")=$G(^ACHS(3,DUZ(2),1,ACHSSCC,"CC",N,0))
 S ACHS=0
 F I=2:1 Q:+$P(ACHS("DCRS"),U,I)=0  S ACHS=ACHS+1
 G END:ACHS<2
 F I=1:1:ACHS W !?5,I,?10,$P(^ACHS(9,DUZ(2),"RN"),U,+$P(ACHS("DCRS"),U,I+1))
 S Y=$$DIR^XBDIR("N^1:"_ACHS,"     SELECT DCR ACCOUNT","","","","",2)
 I $D(DUOUT)!$D(DTOUT) S ACHSDCR=-1 G END
 S ACHSDCR=$P(ACHS("DCRS"),U,Y+1)
END ;
 K ACHS("DCRS")
 I +ACHSDCR>0 W "(",$P(^ACHS(9,DUZ(2),"RN"),U,+ACHSDCR),")"
 Q
 ;