AMQQUTIL ;IHS/CMI/THL - RETURNS IF USER HOLDER OF PARTICULAR SECURITY KEY ;
;;2.0;IHS PCC SUITE;**6,7**;MAY 14, 2009
;-----
KEYCHECK(AMQQKEY) ; - EP - CHECK FOR KEY HOLDING
Q $S(('$D(DUZ)#2):0,1:$D(^XUSEC(AMQQKEY,DUZ)))
;
DFNINC ; - EP - Gets the next valid DFN when random sampling
Q:$D(^DPT(AMQP(0)))
F S AMQP(0)=AMQP(0)+$R(AMQP("$R")) Q:$D(^DPT(AMQP(0))) S:'$O(^DPT(AMQP(0))) AMQP(0)=0 Q:'AMQP(0)
Q
VFC(V) ;EP
S V=$G(V)
I V=0 Q "Unknown"
I V=1 Q "Not Eligible"
I V=2 Q "Medicaid"
I V=3 Q "Uninsured"
I V=4 Q "Am Indian/AK Native"
I V=5 Q "Federally Qualified"
I V=6 Q "State-specific Elig"
I V=7 Q "Local-specific Elig"
Q ""
ACTIMM(V) ;EP
S V=+V
I '$D(^BIP(V,0)) Q 0
I $P(^BIP(V,0),U,8) Q 0
Q 1
AMQQUTIL ;IHS/CMI/THL - RETURNS IF USER HOLDER OF PARTICULAR SECURITY KEY ;
+1 ;;2.0;IHS PCC SUITE;**6,7**;MAY 14, 2009
+2 ;-----
KEYCHECK(AMQQKEY) ; - EP - CHECK FOR KEY HOLDING
+1 QUIT $SELECT(('$DATA(DUZ)#2):0,1:$DATA(^XUSEC(AMQQKEY,DUZ)))
+2 ;
DFNINC ; - EP - Gets the next valid DFN when random sampling
+1 IF $DATA(^DPT(AMQP(0)))
QUIT
+2 FOR
SET AMQP(0)=AMQP(0)+$RANDOM(AMQP("$R"))
IF $DATA(^DPT(AMQP(0)))
QUIT
IF '$ORDER(^DPT(AMQP(0)))
SET AMQP(0)=0
IF 'AMQP(0)
QUIT
+3 QUIT
VFC(V) ;EP
+1 SET V=$GET(V)
+2 IF V=0
QUIT "Unknown"
+3 IF V=1
QUIT "Not Eligible"
+4 IF V=2
QUIT "Medicaid"
+5 IF V=3
QUIT "Uninsured"
+6 IF V=4
QUIT "Am Indian/AK Native"
+7 IF V=5
QUIT "Federally Qualified"
+8 IF V=6
QUIT "State-specific Elig"
+9 IF V=7
QUIT "Local-specific Elig"
+10 QUIT ""
ACTIMM(V) ;EP
+1 SET V=+V
+2 IF '$DATA(^BIP(V,0))
QUIT 0
+3 IF $PIECE(^BIP(V,0),U,8)
QUIT 0
+4 QUIT 1