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

ABMDBCNT.m

Go to the documentation of this file.
  1. ABMDBCNT ; IHS/ASDST/DMJ - Set Array for Bills to Print ;
  1. ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
  1. ;Original;TMD
  1. ;
  1. ;IHS/ASDS/SDH - 03/07/2001 - V2.4 Patch 9 - NOIS XJG-0201-160063
  1. ; Modified to allow the exclusion parameter of Provider to work
  1. ; properly.
  1. ;
  1. ; *********************************************************************
  1. ;
  1. GBILL ;
  1. S ABMP("BDFN")="" ; Initialize IEN to 3P BILL
  1. S ABM("C")=0 ; Initialize counter
  1. W !!,"Establishing Bills to be Exported for the Parameters Specified..."
  1. ; Loop thru claims with approved bill status ("xref")
  1. F S ABMP("BDFN")=$O(^ABMDBILL(DUZ(2),"AC","A",ABMP("BDFN"))) Q:'ABMP("BDFN")!(ABM("C")=250) D
  1. . ; Quit if mode of export does not match
  1. . Q:$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U,6)'=ABM("FORM")
  1. . S ABMLOC=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),0),U,3) ; Visit for bill
  1. . ; Quit if location does not match
  1. . I $D(ABMY("LOC")),ABMLOC'=ABMY("LOC") Q
  1. . S ABMPAT=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),0),U,5) ; Patient IEN
  1. . ; Quit if patient does not match
  1. . I $D(ABMY("PAT")),ABMPAT'=ABMY("PAT") Q
  1. . S ABMTYP=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),2),U,2) ; Insurer Type
  1. . ; Quit if insurer type does not match
  1. . I $D(ABMY("TYP")),ABMY("TYP")'[ABMTYP Q
  1. . S ABMINS=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),0),U,8) ; Active Insurer
  1. . ; Quit if insurer does not match
  1. . I $D(ABMY("INS")),ABMINS'=ABMY("INS") Q
  1. . S ABMAPPR=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),1),U,4) ; Appr. Official
  1. . ; Quit if approving official does not match
  1. . I $D(ABMY("APPR")),ABMAPPR'=ABMY("APPR") Q
  1. . S ABMDT=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),1),U,5) ; Date approved
  1. . I $D(ABMY("PRV")),'$D(^ABMDBILL(DUZ(2),ABMP("BDFN"),41,"B",ABMY("PRV"))) Q
  1. . ; Quit if date approved does not fall within specified range
  1. . I $G(ABMY("DT"))="A",ABMDT<ABMY("DT",1)!(ABMDT>(ABMY("DT",2)+.9)) Q
  1. . S ABMBTYP=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),0),U,7) ; Visit type
  1. . S ABMADM0=$G(^ABMDBILL(DUZ(2),ABMP("BDFN"),6))
  1. . S ABMDT2=$P(ABMADM0,U) ; Admission date
  1. . ; Quit if visit type is 111 and (no admit date or date not w/i range)
  1. . I $G(ABMY("DT"))="V",ABMBTYP=111 Q:'ABMADM0 Q:ABMDT2<ABMY("DT",1)!(ABMDT2>ABMY("DT",2))
  1. . S ABMDT3=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),7),U) ; Service date from
  1. . ; Quit if visit type is 111 and (no date from or date not w/i range)
  1. . I $G(ABMY("DT"))="V",ABMBTYP'=111 Q:ABMDT3<ABMY("DT",1)!(ABMDT3>ABMY("DT",2))
  1. . ; ABMY(active insurer,IEN to 3P BILL)=""
  1. . S ABMY($P(^ABMDBILL(DUZ(2),ABMP("BDFN"),0),U,8),ABMP("BDFN"))=""
  1. . S ABM("C")=ABM("C")+1 ; increment counter
  1. . K ABMLOC,ABMPAT,ABMTYP,ABMINS,ABMAPPR,ABMDT,ABMDT2,ABMDT3,ABMBTYP,ABMADM0
  1. Q