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

IBCEU7.m

Go to the documentation of this file.
  1. IBCEU7 ;ALB/DEM - EDI UTILITIES ;26-SEP-2010
  1. ;;2.0;INTEGRATED BILLING;**432,592,623**;21-MAR-94;Build 70
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. Q
  1. ;
  1. LNPRVOK(VAL,IBIFN) ; Check bill form & line prov function agree
  1. ; DEM;432 - New routine for Claim Line Provider.
  1. ; VAL = internal value of prov function
  1. ;
  1. ; Allowable line provider functions for UB04 (FORM TYPE = 3)
  1. ; Inpatient and UB04 Outpatient:
  1. ; - Rendering Provider(3).
  1. ; - Referring Provider(1).
  1. ; - Operating Physician(2).
  1. ; - Other Operating Physician(9).
  1. ;
  1. ; Allowable line provider functions for CMS 1500 (FORM TYPE = 2)
  1. ; Inpatient and CMS 1500 Outpatient:
  1. ; - Rendering Provider(3).
  1. ; - Referring Provider(1).
  1. ; - Supervising Provider(5).
  1. ;
  1. ;JWS;IB*2.0*592 US1108
  1. ; Allowable line provider functions for J430D Dental (FORM TYPE = 7)
  1. ; Inpatient and CMS 1500 Outpatient:
  1. ; - Rendering Provider(3).
  1. ; - Referring Provider(1).
  1. ; - Supervising Provider(5).
  1. ; - Assistant Surgeon (6). - Dental J430D only
  1. ;
  1. N OK,IBUB
  1. S VAL=$$UP^XLFSTR(VAL)
  1. S OK=$S(VAL'="":1,1:0)
  1. G:'OK!'$G(IBIFN) PRVQ
  1. ;
  1. ;JWS;IB*2.0*592 US1108 - 2 for form#7 Dental
  1. S IBUB=$S($$FT^IBCEF(IBIFN)=7:2,1:($$FT^IBCEF(IBIFN)=3)) ; 1 if UB-04 ; 0 if CMS-1500 ; 2 if J430D Dental form
  1. ;
  1. S OK=0
  1. I IBUB=1,"1239"[VAL S OK=1 ; UB-04
  1. I 'IBUB,"135"[VAL S OK=1 ; CMS-1500
  1. ;JWS;IB*2.0*592 US1108 J430D Dental
  1. I IBUB=2,"1356"[VAL S OK=1
  1. ;
  1. PRVQ Q OK
  1. ;
  1. LNPRVHLP ;Helptext for line provider function.
  1. ;
  1. N IBZ,IBQUIT,VALUE,FORMAT
  1. F IBZ=1:1 S:$P($T(HLPTXT+IBZ),";;",2)="END" IBQUIT=1 Q:$G(IBQUIT) D
  1. . S VALUE=$P($T(HLPTXT+IBZ),";;",2)
  1. . S FORMAT=$S(VALUE="":"!",1:"")
  1. . D EN^DDIOL(VALUE,"",FORMAT)
  1. . Q
  1. Q
  1. ;
  1. HLPTXT ; Helptext for line provider function.
  1. ;;
  1. ;;Enter the name of the line level provider who provided this service.
  1. ;;Line level providers are optional and should only be entered if
  1. ;;different from the claim level provider.
  1. ;;
  1. ;;
  1. ;;END
  1. ;
  1. HLPTXT2 ; ***Currently, not activated*** - Helptext for line provider function.
  1. ;;
  1. ;;LINE PROVIDER FUNCTION requirements:
  1. ;;
  1. ;;Allowable line provider functions for UB04 Inpatient and Outpatient:
  1. ;;
  1. ;; - Rendering Provider(3).
  1. ;; - Referring Provider(1).
  1. ;; - Operating Physician(2).
  1. ;; - Other Operating Physician(9).
  1. ;;
  1. ;;Allowable line provider functions for CMS 1500 Inpatient and Outpatient:
  1. ;;
  1. ;; - Rendering Provider(3).
  1. ;; - Referring Provider(1).
  1. ;; - Supervising Provider(5).
  1. ;;
  1. ;; Allowable line provider functions for J430D Dental (FORM TYPE = 7)
  1. ;; Inpatient and CMS 1500 Outpatient:
  1. ;; - Rendering Provider(3).
  1. ;; - Referring Provider(1).
  1. ;; - Supervising Provider(5).
  1. ;; - Assistant Surgeon (6).
  1. ;;
  1. ;;END
  1. Q
  1. ;
  1. LNPRVFT(IBFT,IBLNPRV) ; DEM;432 - Field Index "AK" (#301) on FORM TYPE field (399,.19).
  1. ;
  1. ; Description:
  1. ;
  1. ; This function is called by the FORM TYPE (399,.19) "AK" field index.
  1. ; In the case when the FORM TYPE field is changed, then the line
  1. ; provider types are checked to see if any, or all, line providers
  1. ; need to be deleted from the claim.
  1. ;
  1. ; Input:
  1. ;
  1. ; IBFT = FORM TYPE = 2 = (CMS-1500), or FORM TYPE = 3 = (UB-04).
  1. ; Must be either FORM TYPE 2, or FORM TYPE 3 to continue.
  1. ; See allowable line provider functions by FORM TYPE below.
  1. ; IBLNPRV = Array passed by reference.
  1. ;
  1. ; Output:
  1. ;
  1. ; OK = 1 = line providers to delete, OK = 0 = no line providers to delete.
  1. ; IBLNPRV Array = If line providers to delete, then array contains
  1. ; these line providers - IBLNPRV(399.0404,"IENS",.01)="@"
  1. ;
  1. ; Allowable line provider functions for UB04 (FORM TYPE = 3)
  1. ; Inpatient and UB04 Outpatient:
  1. ; - Rendering Provider(VAL=3).
  1. ; - Referring Provider(VAL=1).
  1. ; - Operating Physician(VAL=2).
  1. ; - Other Operating Physician(VAL=9).
  1. ;
  1. ; Allowable line provider functions for CMS 1500 (FORM TYPE = 2)
  1. ; Inpatient and CMS 1500 Outpatient:
  1. ; - Rendering Provider(VAL=3).
  1. ; - Referring Provider(VAL=1).
  1. ; - Supervising Provider(VAL=5).
  1. ;
  1. ; Allowable line provider functions for J430D (FORM TYPE = 7)
  1. ; Dental:
  1. ; - Rendering Provider(VAL=3).
  1. ; - Referring Provider(VAL=1).
  1. ; - Supervising Provider(VAL=5).
  1. ; - Assistant Surgeon(VAL=6).
  1. ;
  1. Q:'$G(IBIFN) 0 ; QUIT 0 if no claim number.
  1. Q:'$G(IBFT) 0 ; QUIT 0 if no FORM TYPE.
  1. ;JWS;IB*2.0*592 US1108
  1. Q:(IBFT'=2)&(IBFT'=3)&(IBFT'=7) 0 ; QUIT 0 - Must be CMS-1500 (2) or UB-04 (3) or J430D (7) FORM TYPE.
  1. ;
  1. N IBPRVFUN,OK
  1. S:IBFT=3 IBPRVFUN("VAL",IBFT)="1239" ; Allowable LINE PROVIDER FUNCTIONs for UB-04.
  1. S:IBFT=2 IBPRVFUN("VAL",IBFT)="135" ; Allowable LINE PROVIDER FUNCTIONs for CMS-1500.
  1. ;JWS;IB*2.0*592 US1108
  1. S:IBFT=7 IBPRVFUN("VAL",IBFT)="1356" ;Allowable LINE PROVIDER FUNCTIONs for J430D.
  1. ;
  1. S OK=0 ; Initialize OK=0.
  1. ;
  1. N IBPROCP,IBLPIEN,IBLNPROV,DA
  1. S IBPROCP=0 F S IBPROCP=$O(^DGCR(399,IBIFN,"CP",IBPROCP)) Q:'IBPROCP D ; Loop on PROCEDURES multiple.
  1. . Q:'($D(^DGCR(399,IBIFN,"CP",IBPROCP,0))#10) ; No zero node for procedure.
  1. . S IBPRVFUN=0 F S IBPRVFUN=$O(^DGCR(399,IBIFN,"CP",IBPROCP,"LNPRV","B",IBPRVFUN)) Q:'IBPRVFUN D:IBPRVFUN("VAL",IBFT)'[IBPRVFUN
  1. . . S IBLPIEN=0 F S IBLPIEN=$O(^DGCR(399,IBIFN,"CP",IBPROCP,"LNPRV","B",IBPRVFUN,IBLPIEN)) Q:'IBLPIEN D
  1. . . . Q:'($D(^DGCR(399,IBIFN,"CP",IBPROCP,"LNPRV",IBLPIEN,0))#10) ; No zero node for line level provider.
  1. . . . S IBLNPROV=$P(^DGCR(399,IBIFN,"CP",IBPROCP,"LNPRV",IBLPIEN,0),U,2)
  1. . . . Q:'IBLNPROV ; No line provider for this line provider function.
  1. . . . S OK=1,IBLNPRV(399.0404,IBLPIEN_","_IBPROCP_","_IBIFN_",",.01)="@" ; We have at leaset one line provider to delete from claim.
  1. . . . Q
  1. . . Q
  1. . Q
  1. ;
  1. Q OK
  1. ;
  1. REMOVE(IBIFN,IBFT) ; This will be used to remove all line level providers and all line level attachments from inpatient UB claims
  1. ;
  1. ; Input IBIFN - Claim Number
  1. ;
  1. Q:IBFT'=3 ; Only worried about UBs
  1. N IBINPAT
  1. S IBINPAT=$$INPAT^IBCEF(IBIFN) Q:'IBINPAT ; Quit if it's not an inpatient
  1. ;
  1. ; If we got here, we have an inpatient UB
  1. ; In which case, we should not have any line level providers or line level attachment control numbers
  1. ; If we do, then let's remove them
  1. ;
  1. N CPIEN,LNPRVIEN,FDA,ERR
  1. S CPIEN=0 F S CPIEN=$O(^DGCR(399,IBIFN,"CP",CPIEN)) Q:'+CPIEN D
  1. . ;
  1. . ; Remove the Line level attachments
  1. . S FDA(399.0304,CPIEN_","_IBIFN_",",70)="@"
  1. . S FDA(399.0304,CPIEN_","_IBIFN_",",71)="@"
  1. . S FDA(399.0304,CPIEN_","_IBIFN_",",72)="@"
  1. . D FILE^DIE("E","FDA")
  1. . ;
  1. . K FDA
  1. . S LNPRVIEN=0 F S LNPRVIEN=$O(^DGCR(399,IBIFN,"CP",CPIEN,"LNPRV",LNPRVIEN)) Q:'+LNPRVIEN D
  1. .. ;
  1. .. ;Remove the line level providers
  1. .. S FDA(399.0404,LNPRVIEN_","_CPIEN_","_IBIFN_",",.01)="@"
  1. . I $D(FDA) D FILE^DIE("E","FDA")
  1. Q
  1. ;
  1. ; vd - IB*2.0*623 (US4995) - Added the following module of code for ROI validation.
  1. ROIDTCK(IBIFN) ; Date validator for ROI checking
  1. ; INPUT:
  1. ; IBIFN is the internal Claim Number.
  1. ; OUTPUT:
  1. ; 0 means the Claim is NOT ROI eligible based upon the Date of Service
  1. ; 1 means the Claim IS ROI eligible based upon the Date of Service.
  1. N IBDOS,IBTBD,ROIELG,X,Y
  1. S ROIELG=0
  1. S IBDOS=$$BDATE^IBACSV(IBIFN)
  1. S X=20190128 D ^%DT S IBTBD=Y
  1. ; DOS prior to 1/28/19 with sensitive diagnosis requires ROI to bill
  1. ; DOS on or after 1/28/19 with sensitive diagnosis does not require ROI to bill
  1. I IBDOS<IBTBD S ROIELG=1
  1. Q ROIELG
  1. ;