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

ABMDMDB2.m

Go to the documentation of this file.
ABMDMDB2 ;IHS/ASDST/DMJ - MEDICARE B CLAIM SPLIT   
 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
 ;
 ; IHS/SD/SDR - v2.5 p9 - IM16055
 ;   Fixed global reference
 ;
START ;set start
 S $P(^ABMDEXP(20,0),"^",8)=$P($G(^ABMDEXP(20,0)),"^",8)_",25,26"
 S ^ABMQUES(25,0)="DATE LAST SEEN^W25^ABMDE30^25^ABMDE3C"
 S ^ABMQUES(26,0)="SUPERVISING PROV UPIN^W26^ABMDE30^26^ABMDE3C"
 S ^ABMQUES("B","DATE LAST SEEN",25)=""
 S ^ABMQUES("B","SUPERVISING PROV UPIN",26)=""
 Q:$G(^ABMCNVRT("MDB2","START"))
 S ^ABMCNVRT("MDB2","START")=$H
ALL ;all sites
 S ABMDUZ2=DUZ(2)
 S DUZ(2)=0
 F  S DUZ(2)=$O(^ABMDCLM(DUZ(2))) Q:'DUZ(2)  Q:DUZ(2)'=+DUZ(2)  D
 .D ONE
 S DUZ(2)=ABMDUZ2
 K ABMDUZ2
 S ^ABMCNVRT("MDB2","STOP")=$H
 Q
ONE ;one site
 Q:$P($G(^ABMDPARM(DUZ(2),1,5)),U)
 W !!,"Site= ",$P($G(^AUTTLOC(DUZ(2),0)),"^",2)
 S ABMDT=3010700
 F  S ABMDT=$O(^ABMDCLM(DUZ(2),"AD",ABMDT)) Q:'ABMDT  D
 .S ABMCLM=0
 .F  S ABMCLM=$O(^ABMDCLM(DUZ(2),"AD",ABMDT,ABMCLM)) Q:'ABMCLM  D
 ..D CLAIM
 Q
CLAIM ;one claim
 S ABMVTYP=+$P(^ABMDCLM(DUZ(2),ABMCLM,0),"^",7)
 S ABMCLIN=+$P(^ABMDCLM(DUZ(2),ABMCLM,0),"^",6)
 Q:ABMVT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