ABMDECHK ; IHS/ASDST/DMJ - Looping Utility to Check Parms ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
; IHS/SD/SDR - v2.5 p10 - IM13359
; Added check for range of patients
;
CLM ;EP for checking Claim file data parameters
Q:'$D(^ABMDCLM(DUZ(2),ABM,0))
S ABM("V")=$P(^ABMDCLM(DUZ(2),ABM,0),U,7) ;visit type
S ABM("L")=$P(^ABMDCLM(DUZ(2),ABM,0),U,3) ;visit location
S ABM("I")=$P(^ABMDCLM(DUZ(2),ABM,0),U,8) ;active insurer
S ABM("P")=$P(^ABMDCLM(DUZ(2),ABM,0),U) ;patient
S ABM("D")=$P(^ABMDCLM(DUZ(2),ABM,0),U,2) ;encounter date
S ABM("C")=$P(^ABMDCLM(DUZ(2),ABM,0),U,6) ;clinic
Q:ABM("L")=""!(ABM("P")="")!(ABM("D")="")!(ABM("V")="")!(ABM("C")="")
I $D(ABMY("PRV")),'$D(^ABMDCLM(DUZ(2),ABM,41,"B",ABMY("PRV"))) Q
I $D(ABMY("PAT")),ABMY("PAT")'=ABM("P") Q
I $D(ABMY("LOC")),ABMY("LOC")'=ABM("L") Q
I $D(ABMY("CLN")),ABMY("CLN")'=ABM("C") Q
I $D(ABMY("VTYP")),ABMY("VTYP")'=ABM("V") Q
I $D(ABMY("INS")),ABMY("INS")'=ABM("I") Q
I $G(ABMY("PTYP"))=2,$P($G(^AUPNPAT(ABM("P"),11)),U,12)'="I" Q
I $G(ABMY("PTYP"))=1,$P($G(^AUPNPAT(ABM("P"),11)),U,12)="I" Q
I $D(ABMY("TYP")) Q:ABM("I")="" S:ABMY("TYP")="P" ABMY("TYP")="PFHM" Q:ABMY("TYP")'[$P($G(^AUTNINS(+ABM("I"),2)),U)
I $D(ABMY("DT")),ABM("D")<ABMY("DT",1)!(ABM("D")>ABMY("DT",2)) Q
K ABMQFLG
I $D(ABMY("RNG")) D ;range of patients--are you in...or out?
.K ABMPTST,ABMPCE,ABMPTST("TST")
.S ABMPTST=$E($P($G(^DPT(ABM("P"),0)),U),1,3) ;first three letters
.F ABMI=1,2 D
..F ABMJ=1:1:3 D
...S ABMPCE(ABMI)=$G(ABMPCE(ABMI))_$A($E(ABMY("RNG",ABMI),ABMJ))
.F ABMJ=1:1:3 S ABMPTST("TST")=$G(ABMPTST("TST"))_$A($E(ABMPTST,ABMJ))
.I (ABMPTST("TST")<ABMPCE(1))!(ABMPTST("TST")>ABMPCE(2)) S ABMQFLG=1
Q:$G(ABMQFLG)=1
S ABMP("HIT")=1
Q
ABMDECHK ; IHS/ASDST/DMJ - Looping Utility to Check Parms ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
+3 ; IHS/SD/SDR - v2.5 p10 - IM13359
+4 ; Added check for range of patients
+5 ;
CLM ;EP for checking Claim file data parameters
+1 IF '$DATA(^ABMDCLM(DUZ(2),ABM,0))
QUIT
+2 ;visit type
SET ABM("V")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,7)
+3 ;visit location
SET ABM("L")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,3)
+4 ;active insurer
SET ABM("I")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,8)
+5 ;patient
SET ABM("P")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U)
+6 ;encounter date
SET ABM("D")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,2)
+7 ;clinic
SET ABM("C")=$PIECE(^ABMDCLM(DUZ(2),ABM,0),U,6)
+8 IF ABM("L")=""!(ABM("P")="")!(ABM("D")="")!(ABM("V")="")!(ABM("C")="")
QUIT
+9 IF $DATA(ABMY("PRV"))
IF '$DATA(^ABMDCLM(DUZ(2),ABM,41,"B",ABMY("PRV")))
QUIT
+10 IF $DATA(ABMY("PAT"))
IF ABMY("PAT")'=ABM("P")
QUIT
+11 IF $DATA(ABMY("LOC"))
IF ABMY("LOC")'=ABM("L")
QUIT
+12 IF $DATA(ABMY("CLN"))
IF ABMY("CLN")'=ABM("C")
QUIT
+13 IF $DATA(ABMY("VTYP"))
IF ABMY("VTYP")'=ABM("V")
QUIT
+14 IF $DATA(ABMY("INS"))
IF ABMY("INS")'=ABM("I")
QUIT
+15 IF $GET(ABMY("PTYP"))=2
IF $PIECE($GET(^AUPNPAT(ABM("P"),11)),U,12)'="I"
QUIT
+16 IF $GET(ABMY("PTYP"))=1
IF $PIECE($GET(^AUPNPAT(ABM("P"),11)),U,12)="I"
QUIT
+17 IF $DATA(ABMY("TYP"))
IF ABM("I")=""
QUIT
IF ABMY("TYP")="P"
SET ABMY("TYP")="PFHM"
IF ABMY("TYP")'[$PIECE($GET(^AUTNINS(+ABM("I"),2)),U)
QUIT
+18 IF $DATA(ABMY("DT"))
IF ABM("D")<ABMY("DT",1)!(ABM("D")>ABMY("DT",2))
QUIT
+19 KILL ABMQFLG
+20 ;range of patients--are you in...or out?
IF $DATA(ABMY("RNG"))
Begin DoDot:1
+21 KILL ABMPTST,ABMPCE,ABMPTST("TST")
+22 ;first three letters
SET ABMPTST=$EXTRACT($PIECE($GET(^DPT(ABM("P"),0)),U),1,3)
+23 FOR ABMI=1,2
Begin DoDot:2
+24 FOR ABMJ=1:1:3
Begin DoDot:3
+25 SET ABMPCE(ABMI)=$GET(ABMPCE(ABMI))_$ASCII($EXTRACT(ABMY("RNG",ABMI),ABMJ))
End DoDot:3
End DoDot:2
+26 FOR ABMJ=1:1:3
SET ABMPTST("TST")=$GET(ABMPTST("TST"))_$ASCII($EXTRACT(ABMPTST,ABMJ))
+27 IF (ABMPTST("TST")<ABMPCE(1))!(ABMPTST("TST")>ABMPCE(2))
SET ABMQFLG=1
End DoDot:1
+28 IF $GET(ABMQFLG)=1
QUIT
+29 SET ABMP("HIT")=1
+30 QUIT