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

ABMDLCK3.m

Go to the documentation of this file.
  1. ABMDLCK3 ; IHS/ASDST/DMJ - check visit for elig - CONT'D ;
  1. ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
  1. ;;Y2K/OK - IHS/ADC/JLG 12-18-97
  1. ;Original;TMD;
  1. ;
  1. ; IHS/ASDS/LSL - 06/27/2001 - V2.4 Patch 9 - NOIS HQW-0798-100082
  1. ; Expand No Eligibility Found. Working this call caused
  1. ; ABMDLCK1 to be too large. Overflow placed in this routine
  1. ;
  1. ; *********************************************************************
  1. ;
  1. Q
  1. ;
  1. PROVSPEC(COVER,PROVDR,BUB) ;EP;For provider class specific CPT, & ICD ranges
  1. ;Returns 0 if billable, 1 if not billable
  1. N INRANGE,OUTOFRNG,ISUB,CODE,VGLOB,ICDGLOB,ABME,UNBILLAB,RNGEFLG
  1. F ISUB=1:1:3 D Q:$G(UNBILLAB)=0
  1. .K ABME
  1. .I $O(^AUTTPIC(COVER,15,PROVDR,ISUB,0)) D
  1. ..S RNGEFLG=1
  1. ..S N=0,ABME=0
  1. ..F D Q:CODE=""!($G(UNBILLAB)=0)
  1. ...I ISUB=1 D Q ;This sect for CPT codes
  1. ....I '$D(AUPNCPT) S Y=$$CPT^AUPNCPT(ABMVDFN)
  1. ....S CODE=""
  1. ....F S N=$O(AUPNCPT(N)) Q:'N D Q:UNBILLAB=0
  1. .....S CODE=+AUPNCPT(N)
  1. .....D CODECHK
  1. ....S CODE="" ;MRS:10/16/98 set variable to quit condit'n when finished
  1. ...I ISUB=2 D ;This sect and next for ICD codes
  1. ....S VGLOB="^AUPNVPRC"
  1. ....S ICDGLOB="^ICD0"
  1. ...E D
  1. ....S VGLOB="^AUPNVPOV"
  1. ....S ICDGLOB="^ICD9"
  1. ...I $D(ABME)<10 D
  1. ....F S ABME=$O(@VGLOB@("AD",ABMVDFN,ABME)) Q:'ABME D
  1. .....S ABME($P(@ICDGLOB@(+(@VGLOB@(ABME,0)),0),U,1))=""
  1. ...S CODE=""
  1. ...F S CODE=$O(ABME(CODE)) Q:CODE="" D CODECHK Q:$G(UNBILLAB)=0
  1. I $D(RNGEFLG)=0 D Q UNBILLAB ;Means no ranges defined
  1. .S UNBILLAB=$S(BUB="U":1,1:0)
  1. I '$D(INRANGE) D ;MEANS NO CODES IN VISIT
  1. .I BUB="B" S UNBILLAB=1 Q
  1. .I BUB="U" S UNBILLAB=0
  1. .;If there are no codes found in PCC then we mark the provider class
  1. .;as unbillable if it is only billable for a specific range.
  1. .;it is billable if only unbillable for a specific range.
  1. .;This may not work right if PCC does not contain all of the data.
  1. Q UNBILLAB
  1. ;
  1. CODECHK ; Check CPT or ICD code against range
  1. S INRANGE=0,OUTOFRNG=0
  1. S D2=0
  1. F S D2=$O(^AUTTPIC(COVER,15,PROVDR,ISUB,D2)) Q:'D2 D Q:$G(UNBILLAB)=0
  1. .S Y=^AUTTPIC(COVER,15,PROVDR,ISUB,D2,0)
  1. .I '$D(CODE) S UNBILLAB=0 Q
  1. .S CODLO=+Y
  1. .S CODHI=$P(Y,U,2)
  1. .I ISUB>1 D
  1. ..S CODLO=$P((@ICDGLOB@(CODLO,0)),U,1)
  1. ..S CODHI=$P((@ICDGLOB@(CODHI,0)),U,1)
  1. ..I $E(CODLO,1)'?1(1"V",1"E") D
  1. ...S CODLO=+CODLO
  1. ...S CODHI=+CODHI
  1. .I BUB="B" D Q
  1. ..I CODLO']]CODE,CODE']]CODHI S UNBILLAB=0
  1. ..;Check to see if CODE is between CODLO & CODHI
  1. ..E S UNBILLAB=1 ;But continue looking
  1. .I BUB="U",'INRANGE D
  1. ..I (CODLO]]CODE)!(CODE]]CODHI) S OUTOFRNG=1
  1. ..E S INRANGE=1,OUTOFRNG=0
  1. Q:BUB="B"
  1. Q:$G(UNBILLAB)=0
  1. I OUTOFRNG S UNBILLAB=0 Q
  1. I INRANGE S UNBILLAB=1 Q
  1. Q
  1. ;
  1. ;
  1. ;At present this code is only executed if ins has cov type entry
  1. PRVX(PRV) ; EP
  1. ;Check for default unbillable provider disciplines
  1. ;Note that if there is no provider class entry for the provider
  1. ;the provider will be considered unbillable.
  1. S ABM("PRV")=$$DOCLASS^ABMDVST2(PRV)
  1. I ABM("PRV")]"",$D(^ABMDPARM(DUZ(2),1,17,ABM("PRV"))) S ABM("PRV")=""
  1. Q ABM("PRV")