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

BUD1RPC3.m

Go to the documentation of this file.
BUD1RPC3 ; IHS/CMI/LAB - UDS TABLE 6 11 Dec 2007 12:15 PM ;
 ;;10.0;IHS/RPMS UNIFORM DATA SYSTEM;;FEB 04, 2016;Build 50
T9D ;EP
 NEW BUDAIEN,BUDDATE,BUD0,BUDREC,BUDBILL,Z,BUDPIEC
 S BUDAIEN=0
 F  S BUDAIEN=$O(^BARTR(DUZ(2),"AF",DFN,BUDAIEN)) Q:BUDAIEN'=+BUDAIEN  D
 .Q:'$D(^BARTR(DUZ(2),BUDAIEN))
 .S BUD0=^BARTR(DUZ(2),BUDAIEN,0)
 .S BUDDATE=$P(BUD0,U,12)
 .Q:$P(BUDDATE,".")<BUDBD  ;ONLY UDS DATE RANGE
 .Q:$P(BUDDATE,".")>BUDED
 .S BUDREC="",BUDPIEC=0
 .;DATE
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$FMTE^XLFDT(BUDDATE)
 .;BILL NUMBER
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,4)
 .;TRANSACTION TYPE
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,101)
 .;CREDIT 2 A/R TRANSACTION FILE
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$P(BUD0,U,2)
 .;DEBIT 3 A/R TRANSACTION FILE
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$P(BUD0,U,3)
 .;PRIME BILL AMOUNT
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,3.2)
 .;PAYMENT
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,3.6)
 .;ADJUSTMENT
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,3.7)
 .;ADJUSTMENT CATEGORY
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,102)
 .;ADJUSTMENT TYPE
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,103)
 .;A/R ACCOUNT
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,6)
 .;PATIENT
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$VAL^XBDIQ1(90050.03,BUDAIEN,5)
 .;VISIT LOCATION
 .S BUDBILL=$$VALI^XBDIQ1(90050.03,BUDAIEN,4)
 .I BUDBILL S Z=$$VAL^XBDIQ1(90050.01,BUDBILL,108)
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=Z
 .;CLINIC TYPE
 .I BUDBILL S Z=$$VAL^XBDIQ1(90050.01,BUDBILL,112)
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=Z
 .;DOS BEGIN
 .I BUDBILL S Z=$$VAL^XBDIQ1(90050.01,BUDBILL,102)
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=Z
 .;BILL TYPE
 .I BUDBILL S Z=$$VAL^XBDIQ1(90050.01,BUDBILL,4)
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=Z
 .;PRIMARY PROVIDER
 .I BUDBILL S Z=$$VAL^XBDIQ1(90050.01,BUDBILL,113)
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=Z
 .;HRN
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$HRN^AUPNPAT(DFN,DUZ(2))
 .;DOB
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$FMTE^XLFDT($$DOB^AUPNPAT(DFN))
 .;COMMUNITY
 .S BUDPIEC=BUDPIEC+1
 .S $P(BUDREC,U,BUDPIEC)=$$COMMRES^AUPNPAT(DFN,"E")
 .D SET
 .Q
 Q
SET ;
 S BUDT9C=BUDT9C+1
 S ^XTMP("BUD1RP9DEL",BUDJ,BUDH,BUDDATE,BUDT9C)=BUDREC
 Q