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

ABMDRRB.m

Go to the documentation of this file.
  1. ABMDRRB ;IHS/ASDST/LSL - MEDICARE B CLAIM SPLIT FOR RAILROAD
  1. ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
  1. ;
  1. ; IHS/ASDS/LSL - 10/01/01 - V2.4 Patch 9 - NOIS HQW-0701-100066
  1. ; This routine will go back to visit date 7/1/01 and split already
  1. ; created RailRoad Retirement claims for Part B
  1. ;
  1. ; IHS/SD/SDR - v2.5 p9 - IM16055
  1. ; Corrected global reference
  1. ;
  1. ; *********************************************************************
  1. ;
  1. START ;
  1. ; set start
  1. Q:$G(^ABMCNVRT("RRB","START"))
  1. S ^ABMCNVRT("RRB","START")=$H
  1. ;
  1. ALL ;
  1. ; all sites
  1. S ABMDUZ2=DUZ(2)
  1. S DUZ(2)=0
  1. F S DUZ(2)=$O(^ABMDCLM(DUZ(2))) Q:'DUZ(2) Q:DUZ(2)'=+DUZ(2) D
  1. . D ONE
  1. S DUZ(2)=ABMDUZ2
  1. K ABMDUZ2
  1. S ^ABMCNVRT("RRB","STOP")=$H
  1. Q
  1. ;
  1. ; *********************************************************************
  1. ONE ;
  1. ; one site
  1. Q:$P($G(^ABMDPARM(DUZ(2),1,5)),U)
  1. W !!,"Site= ",$P(^AUTTLOC(DUZ(2),0),"^",2)
  1. S ABMDT=3010700
  1. F S ABMDT=$O(^ABMDCLM(DUZ(2),"AD",ABMDT)) Q:'ABMDT D
  1. . S ABMCLM=0
  1. . F S ABMCLM=$O(^ABMDCLM(DUZ(2),"AD",ABMDT,ABMCLM)) Q:'ABMCLM D
  1. . . D CLAIM
  1. Q
  1. ;
  1. ; *********************************************************************
  1. CLAIM ;
  1. ; one claim
  1. S ABMINS=+$P(^ABMDCLM(DUZ(2),ABMCLM,0),"^",8)
  1. Q:$P($G(^AUTNINS(ABMINS,2)),U)'="R"
  1. Q:$P(^ABMDCLM(DUZ(2),ABMCLM,0),"^",7)=999
  1. D MAIN(ABMCLM)
  1. W "."
  1. Q
  1. ;
  1. ; *********************************************************************
  1. MAIN(ABMCF) ;
  1. ; Main section
  1. ; x = claim to clone
  1. D CHK
  1. I $G(ABMQUIT) K ABMQUIT Q
  1. D ADD^ABMDSPLB
  1. Q:Y<0
  1. D EDIT^ABMDSPLB
  1. D DEL^ABMDSPLB
  1. D XREF^ABMDSPLB
  1. K ABMCF,ABMC2
  1. Q
  1. ;
  1. ; *********************************************************************
  1. CHK ;
  1. ; checks create claim or quit
  1. S ABMQUIT=1
  1. Q:'$D(^ABMDCLM(DUZ(2),ABMCF,0))
  1. S ABMCLM(0)=$G(^ABMDCLM(DUZ(2),ABMCF,0))
  1. S ABMPAT=$P(ABMCLM(0),U)
  1. S ABMDT=$P(ABMCLM(0),U,2)
  1. S ABMVTYP=$P(ABMCLM(0),U,7)
  1. S ABMINS=$P(ABMCLM(0),U,8)
  1. Q:ABMDT<3010701
  1. I '$$PARTB(ABMPAT,ABMDT) Q
  1. D DUP^ABMDSPLB
  1. I $G(ABMDUP) Q
  1. K ABMQUIT
  1. Q
  1. ;
  1. ; *********************************************************************
  1. PARTB(X,Y) ;
  1. ; Check for part b
  1. ; x = patient dfn
  1. ; y = date
  1. I 'X S Z=0 Q Z
  1. I 'Y S Z=0 Q Z
  1. S Z=0
  1. N I
  1. S I=0 F S I=$O(^AUPNRRE(X,11,I)) Q:'I D
  1. .S ABMZERO=^AUPNRRE(X,11,I,0)
  1. .D BSUB^ABMDSPLB
  1. K ABMZERO
  1. Q Z