tsunami

log in
history

BAR.PAT.zcus.ep.breuer. ub.ibill.download.M.zget

AvengingDentist
2008-03-11 12:49 UTC

function main
    SETUP()

    if c.xx.initial == "y"
        INITIAL.LOAD()
    else
        foreach TYPE in c.xx.option
            if TYPE == "BILL"
                return ITEMIZED.BILL()
            else if TYPE == "UB92"
                return UB92()
            else if TYPE == "ABS"
                BUILD.PATS()
                return GET.ABS()
            else if TYPE == "OTHER"
                BUILD.PATS()
                BAR.INFO()
                INSURANCE()
                BAR.TXNS()
                CDS.INFO()
                return APC.DATA()
            else if TYPE == 127 // ASCII "DEL"
                ALL.TYPES()
                return 1
end function

function ALL.TYPES
    ITEMIZED.BILL()
    UB92()
    GET.ABS()
    BAR.INFO()
    INSURANCE()
    BAR.TXNS()
    CDS.INFO()
    APC.DATA()
end function

function INITIAL.LOAD
    if getFirstValue(c.number) != 127 // ASCII "DEL"
        foreach number in c.number
            account = findFirst(account,number) // find first account with this number
            CNT2++
            ABSACCT[number] = account // ABSACCT is a temp file
            DO.ACCOUNT.STUFF()
        if b.xx.date == 127
            return ""
        else
            bar.adm.ser = b.xx.date - 1 day
            CNT2 = 0
            CNT = 0
            foreach bar.adm.ser sortby admission
                account = ""
                foreach account sortby admission
                    if CNT2 >= LIMIT
                        break

                    if !number.find(account) // Try to find account in number index
                        continue

                    txn.class = "O"
                    txn.urn = txn.urn.end()-1 // Last transaction URN

                    if(*txn.ser.date > e.xx.date)
                        continue

                    CNT2++
                    ABSACCT[number] = account // ABSACCT is a temp file
                    DO.ACCOUNT.STUFF()

                        
    GET.ABS()
    BAR.INFO()
    INSURANCE()
    BAR.TXNS()
    CDS.INFO()

    APC.DATA()
end function

function DO.ACCOUNT.STUFF
    foreach bill.no
        IB.OUTPUT()
        foreach bills.claim
            foreach bills.claim.ins
                if split(BAR.CLAIM.pgm.name,"-")[0] == "UB04"
                    UB04.OUTPUT()
                else
                    foreach BAR.CLAIM.IMAG.version
                        BAR.CLAIM.IMAG.claim.date = *BAR.CLAIM.IMAG.claim.date // What?
                        UB.OUTPUT()
end function

function ITEMIZED.BILL
    if getFirstValue(c.number) != 127 // ASCII "DEL"
        foreach number in c.number
            account = findFirst(account,number) // find first account with this number
            foreach bill.no
                if cutoff.date >= b.xx.date && cutoff.date <= e.xx.date
                    IB.OUTPUT()
    else
        cutoff.date = b.xx.date - 1 day
        foreach cutoff.date sortby billc
            if cutoff.date > e.xx.date
                break
            foreach bill.rule sortby billc
                if CNT >= LIMIT
                    break
                foreach account sortby billc
                    if CNT >= LIMIT
                        break
                    foreach bill.no sortby billc
                        if CNT >= LIMIT
                            break
                        IB.OUTPUT()
end function

function IB.OUTPUT
    CNT++
    // ...
end function

function UB92
    if getFirstValue(c.number) != 127 // ASCII "DEL"
        foreach number in c.number
            account = BAR.CLAIM.IMAG.account = findFirst(account,number) // find first account with this number
            foreach BAR.CLAIM.IMAG.bill.no
                foreach BAR.CLAIM.IMAG.claim.ins
                    foreach BAR.CLAIM.IMAG.claim
                        if BAR.CLAIM.IMAG.claim.date >= b.xx.date && BAR.CLAIM.IMAG.claim.date <= e.xx.date
                            foreach BAR.CLAIM.IMAG.version
                                UB.OUTPUT()
    else
        BAR.CLAIM.IMAG.claim.date = b.xx.date - 1 day
        foreach BAR.CLAIM.IMAG.claim.date sortby BAR.CLAIM.IMAG.claim.date
            if BAR.CLAIM.IMAG.claim.date > e.xx.date
                break
            foreach BAR.CLAIM.IMAG.account sortby BAR.CLAIM.IMAG.claim.date
                if CNT >= LIMIT
                    break
                foreach BAR.CLAIM.IMAG.bill.no sortby BAR.CLAIM.IMAG.claim.date
                    if CNT >= LIMIT
                        break
                    foreach BAR.CLAIM.IMAG.claim.ins sortby BAR.CLAIM.IMAG.claim.date
                        if CNT >= LIMIT
                            break
                        foreach BAR.CLAIM.IMAG.claim sortby BAR.CLAIM.IMAG.claim.date
                            if CNT >= LIMIT
                                break
                            foreach BAR.CLAIM.IMAG.version
                                if CNT >= LIMIT
                                    break
                                UB.OUTPUT()
end function

function UB04.OUTPUT
end function

function UB.OUTPUT
end function

function BUILD.PATS
end function

function GET.ABS
end function

function BAR.INFO
end function

function INSURANCE
end function

function BAR.TXNS
end function

function CDS.INFO
end function

function APC.DATA
end function

function SETUP
end function