﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="OpenDentalDocumentation.xsl"?>
<database version="5.5.0">
    <table name="account">
        <summary>Used in the accounting section in chart of accounts.  Not related to patient accounts in any way.</summary>
        <column order="0" name="AccountNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Description" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="2" name="AcctType" type="tinyint">
            <summary>Enum:AccountType Asset, Liability, Equity,Revenue, Expense</summary>
            <Enumeration name="AccountType">
                <summary>Used in accounting for chart of accounts.</summary>
                <EnumValue name="Asset">0</EnumValue>
                <EnumValue name="Liability">1</EnumValue>
                <EnumValue name="Equity">2</EnumValue>
                <EnumValue name="Income">3</EnumValue>
                <EnumValue name="Expense">4</EnumValue>
            </Enumeration>
        </column>
        <column order="3" name="BankNumber" type="varchar(255)">
            <summary>For asset accounts, this would be the bank account number for deposit slips.</summary>
        </column>
        <column order="4" name="Inactive" type="tinyint">
            <summary>Set to true to not normally view this account in the list.</summary>
        </column>
        <column order="5" name="AccountColor" type="int(11)">
            <summary>.</summary>
        </column>
    </table>
    <table name="accountingautopay">
        <summary>In the accounting section, this automates entries into the database when user enters a payment into a patient account.  This table presents the user with a picklist specific to that payment type.  For example, a cash payment would create a picklist of cashboxes for user to put the cash into.</summary>
        <column order="0" name="AccountingAutoPayNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PayType" type="smallint" fk="definition">
            <summary>FK to definition.DefNum.</summary>
        </column>
        <column order="2" name="PickList" type="varchar(255)" fk="account">
            <summary>FK to account.AccountNum.  AccountNums separated by commas.  No spaces.</summary>
        </column>
    </table>
    <table name="adjustment">
        <summary>An adjustment in the patient account.  Usually, adjustments are very simple, just being assigned to one patient and provider.  But they can also be attached to a procedure to represent a discount on that procedure.  Attaching adjustments to procedures is not automated, so it is not very common.</summary>
        <column order="0" name="AdjNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="AdjDate" type="date">
            <summary>The date that the adjustment shows in the patient account.</summary>
        </column>
        <column order="2" name="AdjAmt" type="double">
            <summary>Amount of adjustment.  Can be pos or neg.</summary>
        </column>
        <column order="3" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum.</summary>
        </column>
        <column order="4" name="AdjType" type="smallint" fk="definition">
            <summary>FK to definition.DefNum.</summary>
        </column>
        <column order="5" name="ProvNum" type="int(11)" fk="provider">
            <summary>FK to provider.ProvNum.</summary>
        </column>
        <column order="6" name="AdjNote" type="text">
            <summary>Note for this adjustment.</summary>
        </column>
        <column order="7" name="ProcDate" type="date">
            <summary>Procedure date.  Not when the adjustment was entered.  This is what the aging will be based on in a future version.</summary>
        </column>
        <column order="8" name="ProcNum" type="int(11)" fk="procedurelog">
            <summary>FK to procedurelog.ProcNum.  Only used if attached to a procedure.  Otherwise, 0.</summary>
        </column>
        <column order="9" name="DateEntry" type="date">
            <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
        </column>
    </table>
    <table name="appointment">
        <summary>Appointments can show in the Appointments module, or they can be on the unscheduled list.  An appointment object is also used to store the Planned appointment.  The planned appointment never gets scheduled, but instead gets copied.</summary>
        <column order="0" name="AptNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum.  The patient that the appointment is for.</summary>
        </column>
        <column order="2" name="AptStatus" type="tinyint">
            <summary>Enum:ApptStatus .</summary>
            <Enumeration name="ApptStatus">
                <summary>Appointment status.</summary>
                <EnumValue name="None">0- No appointment should ever have this status.</EnumValue>
                <EnumValue name="Scheduled">1- Shows as a regularly scheduled appointment.</EnumValue>
                <EnumValue name="Complete">2- Shows greyed out.</EnumValue>
                <EnumValue name="UnschedList">3- Only shows on unscheduled list.</EnumValue>
                <EnumValue name="ASAP">4- Functions the same as Scheduled for now.</EnumValue>
                <EnumValue name="Broken">5- Shows with a big X on it.</EnumValue>
                <EnumValue name="Planned">6- Planned appointment.  Only shows in Chart module. User not allowed to change this status, and it does not display as one of the options.</EnumValue>
                <EnumValue name="PtNote">7- Patient "post-it" note on the schedule. Shows light yellow. Shows on day scheduled just like appt, as well as in prog notes, etc.</EnumValue>
                <EnumValue name="PtNoteCompleted">8- Patient "post-it" note completed</EnumValue>
            </Enumeration>
        </column>
        <column order="3" name="Pattern" type="varchar(255)">
            <summary>Time pattern, X for Dr time, / for assist time. Stored in 5 minute increments.  Converted as needed to 10 or 15 minute representations for display.</summary>
        </column>
        <column order="4" name="Confirmed" type="smallint" fk="definition">
            <summary>FK to definition.DefNum.  This field can also be used to show patient arrived, in chair, etc.  The Category column in the definition table is DefCat.ApptConfirmed.</summary>
        </column>
        <column order="5" name="AddTime" type="tinyint(3)">
            <summary>Amount of time to add to appointment.  Example: 2 would represent add 20 minutes.</summary>
        </column>
        <column order="6" name="Op" type="smallint" fk="operatory">
            <summary>FK to operatory.OperatoryNum.</summary>
        </column>
        <column order="7" name="Note" type="text">
            <summary>Note.</summary>
        </column>
        <column order="8" name="ProvNum" type="smallint" fk="provider">
            <summary>FK to provider.ProvNum.</summary>
        </column>
        <column order="9" name="ProvHyg" type="smallint" fk="provider">
            <summary>FK to provider.ProvNum.  Optional.  Only used if a hygienist is assigned to this appt.</summary>
        </column>
        <column order="10" name="AptDateTime" type="datetime">
            <summary>Appointment Date and time.  If you need just the date or time for an SQL query, you can use DATE(AptDateTime) and TIME(AptDateTime) in your query.</summary>
        </column>
        <column order="11" name="NextAptNum" type="int(11)" fk="appointment">
            <summary>FK to appointment.AptNum.  A better description of this field would be PlannedAptNum.  Only used to show that this apt is derived from specified planned apt. Otherwise, 0.</summary>
        </column>
        <column order="12" name="UnschedStatus" type="smallint" fk="definition">
            <summary>FK to definition.DefNum.  The definition.Category in the definition table is DefCat.RecallUnschedStatus.  Only used if this is an Unsched or Planned appt.</summary>
        </column>
        <column order="13" name="Lab" type="tinyint">
            <summary></summary>
        </column>
        <column order="14" name="IsNewPatient" type="tinyint">
            <summary>This is the first appoinment this patient has had at this office.  Somewhat automated.</summary>
        </column>
        <column order="15" name="ProcDescript" type="varchar(255)">
            <summary>A one line summary of all procedures.  Can be used in various reports, Unscheduled list, and Planned appointment tracker.  Not user editable right now, so it doesn't show on the screen.</summary>
        </column>
        <column order="16" name="Assistant" type="smallint" fk="employee">
            <summary>FK to employee.EmployeeNum.  You can assign an assistant to the appointment.</summary>
        </column>
        <column order="17" name="InstructorNum" type="int(11)">
            <summary>Not used.</summary>
        </column>
        <column order="18" name="SchoolClassNum" type="int(11)">
            <summary>Not used</summary>
        </column>
        <column order="19" name="SchoolCourseNum" type="int(11)">
            <summary>Not used.</summary>
        </column>
        <column order="20" name="GradePoint" type="float">
            <summary>Not used.</summary>
        </column>
        <column order="21" name="ClinicNum" type="smallint(6)" fk="clinic">
            <summary>FK to clinic.ClinicNum.  0 if no clinic.</summary>
        </column>
        <column order="22" name="IsHygiene" type="tinyint">
            <summary>Set true if this is a hygiene appt.  The hygiene provider's color will show.</summary>
        </column>
    </table>
    <table name="appointmentrule">
        <summary>For now, the rule is simple. It simply blocks all double booking of the specified code range.  The double booking would have to be for the same provider.  This can later be extended to provide more complex rules, such as partial double booking, time limitations, etc.</summary>
        <column order="0" name="AppointmentRuleNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="RuleDesc" type="varchar(255)">
            <summary>The description of the rule which will be displayed to the user.</summary>
        </column>
        <column order="2" name="CodeStart" type="varchar(15)">
            <summary>The procedure code of the start of the range.</summary>
        </column>
        <column order="3" name="CodeEnd" type="varchar(15)">
            <summary>The procedure code of the end of the range.</summary>
        </column>
        <column order="4" name="IsEnabled" type="tinyint">
            <summary>Usually true.  But this does allow you to turn off a rule temporarily without losing the settings.</summary>
        </column>
    </table>
    <table name="apptview">
        <summary>Enables viewing a variety of operatories or providers.  This table holds the views that the user picks between.  The apptviewitem table holds the items attached to each view.</summary>
        <column order="0" name="ApptViewNum" type="smallint">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Description" type="varchar(255)">
            <summary>Description of this view.  Gets displayed in Appt module.</summary>
        </column>
        <column order="2" name="ItemOrder" type="smallint">
            <summary>Order to display in lists. Every view must have a unique itemorder, but it is acceptable to have some missing itemorders in the sequence.</summary>
        </column>
        <column order="3" name="RowsPerIncr" type="tinyint">
            <summary>Number of rows per time increment.  Usually 1 or 2.  Programming note: Value updated to ContrApptSheet.RowsPerIncr to track current state.</summary>
        </column>
    </table>
    <table name="apptviewitem">
        <summary>Each item is attached to a row in the apptview table.  Each item specifies ONE of: OpNum, ProvNum, or Element.  The other two will be 0 or "".</summary>
        <column order="0" name="ApptViewItemNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="ApptViewNum" type="smallint" fk="apptview">
            <summary>FK to apptview.</summary>
        </column>
        <column order="2" name="OpNum" type="smallint" fk="operatory">
            <summary>FK to operatory.OperatoryNum.</summary>
        </column>
        <column order="3" name="ProvNum" type="smallint" fk="provider">
            <summary>FK to provider.ProvNum.</summary>
        </column>
        <column order="4" name="ElementDesc" type="varchar(255)">
            <summary>Must be one of the hard coded strings picked from the available list.</summary>
        </column>
        <column order="5" name="ElementOrder" type="tinyint">
            <summary>If this is a row Element, then this is the 0-based order.</summary>
        </column>
        <column order="6" name="ElementColor" type="int(11)">
            <summary>If this is an element, then this is the color.</summary>
        </column>
    </table>
    <table name="autocode">
        <summary>An autocode automates entering procedures.  The user only has to pick composite, for instance, and the autocode figures out the code based on the number of surfaces, and posterior vs. anterior.  Autocodes also enforce and suggest changes to a procedure code if the number of surfaces or other properties change.</summary>
        <column order="0" name="AutoCodeNum" type="smallint">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Description" type="varchar(255)">
            <summary>Displays meaningful decription, like "Amalgam".</summary>
        </column>
        <column order="2" name="IsHidden" type="tinyint">
            <summary>User can hide autocodes</summary>
        </column>
        <column order="3" name="LessIntrusive" type="tinyint">
            <summary>This will be true if user no longer wants to see this autocode message when closing a procedure. This makes it less intrusive, but it can still be used in procedure buttons.</summary>
        </column>
    </table>
    <table name="autocodecond">
        <summary>AutoCode condition.  Always attached to an AutoCodeItem, which is then, in turn, attached to an autocode.  There is usually only one or two conditions for a given AutoCodeItem.</summary>
        <column order="0" name="AutoCodeCondNum" type="smallint">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="AutoCodeItemNum" type="smallint" fk="autocodeitem">
            <summary>FK to autocodeitem.AutoCodeItemNum.</summary>
        </column>
        <column order="2" name="Cond" type="tinyint">
            <summary>Enum:AutoCondition </summary>
            <Enumeration name="AutoCondition">
                <summary />
                <EnumValue name="Anterior">0</EnumValue>
                <EnumValue name="Posterior">1</EnumValue>
                <EnumValue name="Premolar">2</EnumValue>
                <EnumValue name="Molar">3</EnumValue>
                <EnumValue name="One_Surf">4</EnumValue>
                <EnumValue name="Two_Surf">5</EnumValue>
                <EnumValue name="Three_Surf">6</EnumValue>
                <EnumValue name="Four_Surf">7</EnumValue>
                <EnumValue name="Five_Surf">8</EnumValue>
                <EnumValue name="First">9</EnumValue>
                <EnumValue name="EachAdditional">10</EnumValue>
                <EnumValue name="Maxillary">11</EnumValue>
                <EnumValue name="Mandibular">12</EnumValue>
                <EnumValue name="Primary">13</EnumValue>
                <EnumValue name="Permanent">14</EnumValue>
                <EnumValue name="Pontic">15</EnumValue>
                <EnumValue name="Retainer">16</EnumValue>
                <EnumValue name="AgeOver18">17</EnumValue>
            </Enumeration>
        </column>
    </table>
    <table name="autocodeitem">
        <summary>Corresponds to the autocodeitem table in the database.  There are multiple AutoCodeItems for a given AutoCode.  Each Item has one ADA code.</summary>
        <column order="0" name="AutoCodeItemNum" type="smallint">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="AutoCodeNum" type="smallint" fk="autocode">
            <summary>FK to autocode.AutoCodeNum</summary>
        </column>
        <column order="2" name="OldCode" type="varchar(15)">
            <summary>Do not use</summary>
        </column>
        <column order="3" name="CodeNum" type="int(11)" fk="procedurecode">
            <summary>FK to procedurecode.CodeNum</summary>
        </column>
    </table>
    <table name="autonote">
        <summary></summary>
        <column order="0" name="AutoNoteNum" type="int(10)">
            <summary>Primary key</summary>
        </column>
        <column order="1" name="AutoNoteName" type="varchar(50)">
            <summary>Name of AutoNote</summary>
        </column>
        <column order="2" name="ControlsToInc" type="text">
            <summary>A list of all the controles to use.  Sequence of numbers separated by commas.  Numbers are foreign keys.</summary>
        </column>
    </table>
    <table name="autonotecontrol">
        <summary></summary>
        <column order="0" name="AutoNoteControlNum" type="int(10)">
            <summary>Primary key</summary>
        </column>
        <column order="1" name="Descript" type="varchar(50)">
            <summary>'Descript' is the name of the custom control</summary>
        </column>
        <column order="2" name="ControlType" type="varchar(50)">
            <summary>The type of control such as 'TextBox' or 'ComboBox'</summary>
        </column>
        <column order="3" name="ControlLabel" type="varchar(50)">
            <summary>Is the text for the label the user wants</summary>
        </column>
        <column order="4" name="PrefaceText" type="text">
            <summary>The preface text</summary>
        </column>
        <column order="5" name="MultiLineText" type="text">
            <summary>If the control is a multi line text box then store the text here</summary>
        </column>
        <column order="6" name="ControlOptions" type="text">
            <summary>If the control is a combo box then the user puts the the selection options for the combo box here</summary>
        </column>
    </table>
    <table name="benefit">
        <summary>Corresponds to the benefit table in the database which replaces the old covpat table.  A benefit is usually a percentage, deductible, limitation, max, or similar. Each row represents a single benefit.  A benefit can have a value in EITHER PlanNum OR PatPlanNum.  If it is for a PlanNum, the most common, then the benefit is attached to an insurance plan.  If it is for a PatPlanNum, then it overrides the plan benefit, usually a percentage, for a single patient.  Benefits we can't handle yet include posterior composites, COB duplication, amounts used, in/out of plan network, authorization required, missing tooth exclusion, and any date related limitations like waiting periods.  We also cannot yet handle family level benefits.  All benefits are at the individual patient level.
            Here are examples of typical usage which parallel X12 usage.
            Example fields shown in this order:
            CovCat, ProcCode(- indicates blank), BenefitType, Percent, MonetaryAmt, TimePeriod, QuantityQualifier, Quantity
            Annual Max $1000: General,-,Limitations,0,1000,CalendarYear,None,0
            Restorative 80%: Restorative,-,Percentage,80,0,CalendarYear,None,0
            $50 deductible: General,-,Deductible,0,50,CalendarYear,None,0
            Deductible waived on preventive: Preventive,-,Deductible,0,0,CalendarYear,None,0
            1 pano every 5 years: General(ignored),D0330,Limitations,0,0,Years,Years,5
            2 exams per year: Preventive(or Diagnostic),-,Limitations,0,0,BenefitYear,NumberOfServices,2
            Fluoride limit 18yo: General(ignored), D1204, Limitations, 0, 0, CalendarYear(or None), AgeLimit, 18 (might require a second identical entry for D1205)
            4BW every 6 months: General(ignored), D0274, Limitations, 0, 0, None, Months, 6.
            The text above might be difficult to read.  We are trying to improve the white spacing.</summary>
        <column order="0" name="BenefitNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PlanNum" type="int(11)" fk="insplan">
            <summary>FK to insplan.PlanNum.  Most benefits should be attached using PlanNum.  The exception would be if each patient has a different percentage.  If PlanNum is used, then PatPlanNum should be 0.</summary>
        </column>
        <column order="2" name="PatPlanNum" type="int(11)" fk="patplan">
            <summary>FK to patplan.PatPlanNum.  It is rare to attach benefits this way.  Usually only used to override percentages for patients.   In this case, PlanNum should be 0.</summary>
        </column>
        <column order="3" name="CovCatNum" type="int(11)" fk="covcat">
            <summary>FK to covcat.CovCatNum.  Corresponds to X12 EB03- Service Type code.  Can never be blank.  There will be very specific categories covered by X12. Users should set their InsCovCats to the defaults we will provide.</summary>
        </column>
        <column order="4" name="OldCode" type="varchar(15)">
            <summary>Do not use</summary>
        </column>
        <column order="5" name="BenefitType" type="tinyint">
            <summary>Enum:InsBenefitType Corresponds to X12 EB01. Examples: 1=Percentage, 2=Deductible, 3=CoPayment, 4=Exclusions, 5=Limitations. There's not really any difference between limitations and exclusions as far as the logic is concerned.</summary>
            <Enumeration name="InsBenefitType">
                <summary>Used in the benefit table.  Corresponds to X12 EB01.</summary>
                <EnumValue name="ActiveCoverage">0- Not usually used.  Would only be used if you are just indicating that the patient is covered, but without any specifics.</EnumValue>
                <EnumValue name="Percentage">1- This corresponds to the X12 Co-Insurance type.  Except it's the opposite because it's the insurance coverage percentage, whereas X12 sends the percentage as the patient's responsibility portion.</EnumValue>
                <EnumValue name="Deductible">2- The deductible amount.  Might be two entries if, for instance, deductible is waived on preventive.</EnumValue>
                <EnumValue name="CoPayment">3- A dollar amount.</EnumValue>
                <EnumValue name="Exclusions">4- Services that are simply not covered at all.</EnumValue>
                <EnumValue name="Limitations">5- Covers a variety of limitations, including Max, frequency, fee reductions, etc.</EnumValue>
            </Enumeration>
        </column>
        <column order="6" name="Percent" type="tinyint">
            <summary>Only used if BenefitType=Percentage.  Valid values are 0 to 100.</summary>
        </column>
        <column order="7" name="MonetaryAmt" type="double">
            <summary>Used for CoPayment, Limitations, and Deductible.</summary>
        </column>
        <column order="8" name="TimePeriod" type="tinyint">
            <summary>Enum:BenefitTimePeriod Corresponds to X12 EB06, Time Period Qualifier.  Examples: 0=None,1=ServiceYear,2=CalendarYear,3=Lifetime,4=Years. Might add Visit and Remaining.</summary>
            <Enumeration name="BenefitTimePeriod">
                <summary>Used in the benefit table.  Corresponds to X12 EB06.</summary>
                <EnumValue name="None">0- A timeperiod is frequenly not needed.  For example, percentages.</EnumValue>
                <EnumValue name="ServiceYear">1- The renewal month is not Jan.  In this case, we need to know the effective date so that we know which month the benefits start over in.</EnumValue>
                <EnumValue name="CalendarYear">2- Renewal month is Jan.</EnumValue>
                <EnumValue name="Lifetime">3- Usually used for ortho max.</EnumValue>
                <EnumValue name="Years">4- Wouldn't be used alone.  Years would again be specified in the quantity field along with a number.</EnumValue>
            </Enumeration>
        </column>
        <column order="9" name="QuantityQualifier" type="tinyint">
            <summary>Enum:BenefitQuantity Corresponds to X12 EB09. Not used very much. Examples: 0=None,1=NumberOfServices,2=AgeLimit,3=Visits,4=Years,5=Months</summary>
            <Enumeration name="BenefitQuantity">
                <summary>Used in the benefit table in conjunction with an integer quantity.</summary>
                <EnumValue name="None">0- This is used a lot. Most benefits do not need any sort of quantity.</EnumValue>
                <EnumValue name="NumberOfServices">1- For example, two exams per year</EnumValue>
                <EnumValue name="AgeLimit">2- For example, 18 when flouride only covered to 18 y.o.</EnumValue>
                <EnumValue name="Visits">3- For example, copay per 1 visit.</EnumValue>
                <EnumValue name="Years">4- For example, pano every 5 years.</EnumValue>
                <EnumValue name="Months">5- For example, BWs every 6 months.</EnumValue>
            </Enumeration>
        </column>
        <column order="10" name="Quantity" type="tinyint">
            <summary>Corresponds to X12 EB10. Qualify the quantity using QuantityQualifier.</summary>
        </column>
        <column order="11" name="CodeNum" type="int(11)" fk="procedurecode">
            <summary>FK to procedurecode.CodeNum.  Typical uses include fluoride, sealants, etc.  If a specific code is used here, then the CovCat is completely ignored.</summary>
        </column>
        <column order="12" name="CoverageLevel" type="int(11)">
            <summary></summary>
        </column>
    </table>
    <table name="canadianclaim">
        <summary>There are so many extra fields required for Canadian claims that we made a new table for them.  Each row in this table will have a 1:1 relationship with a claim.</summary>
        <column order="0" name="ClaimNum" type="int(11)" fk="claim">
            <summary>FK to claim.ClaimNum. Also the primary key.</summary>
        </column>
        <column order="1" name="MaterialsForwarded" type="char(5)">
            <summary>A08.  Any combination of E(email), C(correspondence), M(models), X(x-rays), and I(images).  So up to 5 char.  Gets converted to a single char A-Z for e-claims.</summary>
        </column>
        <column order="2" name="ReferralProviderNum" type="char(10)">
            <summary>B05.  Optional. The 9-digit CDA number of the referring provider, or identifier of referring party up to 10 characters in length.</summary>
        </column>
        <column order="3" name="ReferralReason" type="tinyint">
            <summary>B06.  A number 0(none) through 13.</summary>
        </column>
        <column order="4" name="SecondaryCoverage" type="char(1)">
            <summary>E18.  Y, N, or X(yes, but details unknown).  User must enter without default.</summary>
        </column>
        <column order="5" name="IsInitialLower" type="char(1)">
            <summary>F18.  Y, N, or X(not a lower denture, crown, or bridge).</summary>
        </column>
        <column order="6" name="DateInitialLower" type="date">
            <summary>F19.  Mandatory if F18 is N.</summary>
        </column>
        <column order="7" name="MandProsthMaterial" type="tinyint">
            <summary>F21.  If crown, not required.  If denture or bridge, required if F18 is N.  Single digit number code, 0-6.  We added type 7, which is crown.</summary>
        </column>
        <column order="8" name="IsInitialUpper" type="char(1)">
            <summary>F15.  Y, N, or X(not an upper denture, crown, or bridge).</summary>
        </column>
        <column order="9" name="DateInitialUpper" type="date">
            <summary>F04.  Mandatory if F15 is N.</summary>
        </column>
        <column order="10" name="MaxProsthMaterial" type="tinyint">
            <summary>F20.  If crown, not required.  If denture or bridge, required if F15 is N.  Single digit number code, 0-6.  We added type 7, which is crown.</summary>
        </column>
        <column order="11" name="EligibilityCode" type="tinyint">
            <summary>C09.  A single digit 1-4.  0 is not acceptable for e-claims.</summary>
        </column>
        <column order="12" name="SchoolName" type="varchar(25)">
            <summary>C10.  Can't initially copy from patient.SchoolName because not allowed to default.  Must ask patient each time.</summary>
        </column>
        <column order="13" name="PayeeCode" type="tinyint">
            <summary>F01.  Mandatory. Single digit 1-4.</summary>
        </column>
    </table>
    <table name="canadianextract">
        <summary>Represents one extraction that goes out on a Canadian claim.  This is needed because they have stricter requirements in this area, and they also need date of extraction if prosthesis.  It also provides a permanent record of what was sent.</summary>
        <column order="0" name="CanadianExtractNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="ClaimNum" type="int(11)" fk="claim">
            <summary>FK to claim.ClaimNum.</summary>
        </column>
        <column order="2" name="ToothNum" type="varchar(10)">
            <summary>Always 1-32 or A-T.  1 or 2 char.  Get's converted to international tooth numbers just before display.</summary>
        </column>
        <column order="3" name="DateExtraction" type="date">
            <summary>Will be min val if no date.</summary>
        </column>
    </table>
    <table name="canadiannetwork">
        <summary></summary>
        <column order="0" name="CanadianNetworkNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Abbrev" type="varchar(20)">
            <summary>This will also be the folder name</summary>
        </column>
        <column order="2" name="Descript" type="varchar(255)">
            <summary></summary>
        </column>
    </table>
    <table name="carrier">
        <summary>Every InsPlan has a Carrier.  The carrier stores the name and address.</summary>
        <column order="0" name="CarrierNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="CarrierName" type="varchar(255)">
            <summary>Name of the carrier.</summary>
        </column>
        <column order="2" name="Address" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="3" name="Address2" type="varchar(255)">
            <summary>Second line of address.</summary>
        </column>
        <column order="4" name="City" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="5" name="State" type="varchar(255)">
            <summary>2 char in the US.</summary>
        </column>
        <column order="6" name="Zip" type="varchar(255)">
            <summary>Postal code.</summary>
        </column>
        <column order="7" name="Phone" type="varchar(255)">
            <summary>Includes any punctuation.</summary>
        </column>
        <column order="8" name="ElectID" type="varchar(255)">
            <summary>E-claims electronic payer id.  5 char in USA.  6 digits in Canada.  I've seen an ID this long before: "LA-DHH-MEDICAID".  The user interface currently limits length to 20, although db limits length to 255.  X12 requires length between 2 and 80.</summary>
        </column>
        <column order="9" name="NoSendElect" type="tinyint">
            <summary>Do not send electronically.  It's just a default; you can still send electronically.</summary>
        </column>
        <column order="10" name="IsCDA" type="tinyint">
            <summary>Canada: True if a CDAnet carrier.  This has significant implications:  1. It can be filtered for in the list of carriers.  2. An ElectID is required.  3. The ElectID can never be used by another carrier.  4. If the carrier is attached to any etrans, then the ElectID cannot be changed (and, of course, the carrier cannot be deleted or combined).</summary>
        </column>
        <column order="11" name="IsPMP" type="tinyint">
            <summary>Canada: True if Provincial Medical Plan. We might need to make this a plan field instead.</summary>
        </column>
        <column order="12" name="CDAnetVersion" type="varchar(100)">
            <summary>The version of CDAnet supported.  Either 2, 3, or 4.</summary>
        </column>
        <column order="13" name="CanadianNetworkNum" type="int(11)" fk="canadiannetwork">
            <summary>FK to canadiannetwork.CanadianNetworkNum.  Only used in Canada.</summary>
        </column>
    </table>
    <table name="claim">
        <summary>The claim table holds information about individual claims.  Each row represents one claim.</summary>
        <column order="0" name="ClaimNum" type="int(11)">
            <summary>Primary key</summary>
        </column>
        <column order="1" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum</summary>
        </column>
        <column order="2" name="DateService" type="date">
            <summary>Usually the same date as the procedures, but it can be changed if you wish.</summary>
        </column>
        <column order="3" name="DateSent" type="date">
            <summary>Usually the date it was created.  It might be sent a few days later if you don't send your e-claims every day.</summary>
        </column>
        <column order="4" name="ClaimStatus" type="char(1)">
            <summary>Single char: U,H,W,P,S,or R.  U=Unsent, H=Hold until pri received, W=Waiting in queue, S=Sent, R=Received.  A(adj) is no longer used.  P(prob sent) is no longer used.</summary>
        </column>
        <column order="5" name="DateReceived" type="date">
            <summary>Date the claim was received.</summary>
        </column>
        <column order="6" name="PlanNum" type="int(11)" fk="insplan">
            <summary>FK to insplan.PlanNum.  Every claim is attached to one plan.</summary>
        </column>
        <column order="7" name="ProvTreat" type="smallint" fk="provider">
            <summary>FK to provider.ProvNum.  Treating provider.</summary>
        </column>
        <column order="8" name="ClaimFee" type="double">
            <summary>Total fee of claim.</summary>
        </column>
        <column order="9" name="InsPayEst" type="double">
            <summary>Amount insurance is estimated to pay on this claim.</summary>
        </column>
        <column order="10" name="InsPayAmt" type="double">
            <summary>Amount insurance actually paid.</summary>
        </column>
        <column order="11" name="DedApplied" type="double">
            <summary>Deductible applied to this claim.</summary>
        </column>
        <column order="12" name="PreAuthString" type="varchar(40)">
            <summary>The preauth number received from ins.</summary>
        </column>
        <column order="13" name="IsProsthesis" type="char(1)">
            <summary>Single char for No, Initial, or Replacement.</summary>
        </column>
        <column order="14" name="PriorDate" type="date">
            <summary>Date prior prosthesis was placed.  Note that this is only for paper claims.  E-claims have a date field on each individual procedure.</summary>
        </column>
        <column order="15" name="ReasonUnderPaid" type="varchar(255)">
            <summary>Note for patient for why insurance didn't pay as expected.</summary>
        </column>
        <column order="16" name="ClaimNote" type="varchar(255)">
            <summary>Note to be sent to insurance. Max 255 char.  E-claims also have notes on each procedure.</summary>
        </column>
        <column order="17" name="ClaimType" type="varchar(255)">
            <summary>"P"=primary, "S"=secondary, "PreAuth"=preauth, "Other"=other, "Cap"=capitation.  Not allowed to be blank. Might need to add "Med"=medical claim.</summary>
        </column>
        <column order="18" name="ProvBill" type="smallint" fk="provider">
            <summary>FK to provider.ProvNum.  Billing provider.  Assignment can be automated from the setup section.</summary>
        </column>
        <column order="19" name="ReferringProv" type="smallint" fk="referral">
            <summary>FK to referral.ReferralNum.</summary>
        </column>
        <column order="20" name="RefNumString" type="varchar(40)">
            <summary>Referral number for this claim.</summary>
        </column>
        <column order="21" name="PlaceService" type="tinyint">
            <summary>Enum:PlaceOfService .</summary>
            <Enumeration name="PlaceOfService">
                <summary />
                <EnumValue name="Office">0. CPT code 11</EnumValue>
                <EnumValue name="PatientsHome">1. CPT code 12</EnumValue>
                <EnumValue name="InpatHospital">2. CPT code 21</EnumValue>
                <EnumValue name="OutpatHospital">3. CPT code 22</EnumValue>
                <EnumValue name="SkilledNursFac">4. CPT code 31</EnumValue>
                <EnumValue name="AdultLivCareFac">5. CPT code 33</EnumValue>
                <EnumValue name="OtherLocation">6. CPT code ?</EnumValue>
                <EnumValue name="MobileUnit">7. CPT code 15</EnumValue>
                <EnumValue name="School">8. CPT code 03</EnumValue>
                <EnumValue name="MilitaryTreatFac">9. CPT code 26</EnumValue>
                <EnumValue name="FederalHealthCenter">10. CPT code 50</EnumValue>
                <EnumValue name="PublicHealthClinic">11. CPT code 71</EnumValue>
                <EnumValue name="RuralHealthClinic">12. CPT code 72</EnumValue>
            </Enumeration>
        </column>
        <column order="22" name="AccidentRelated" type="char(1)">
            <summary>blank or A=Auto, E=Employment, O=Other.</summary>
        </column>
        <column order="23" name="AccidentDate" type="date">
            <summary>Date of accident, if applicable.</summary>
        </column>
        <column order="24" name="AccidentST" type="varchar(2)">
            <summary>Accident state.</summary>
        </column>
        <column order="25" name="EmployRelated" type="tinyint">
            <summary>Enum:YN .</summary>
            <Enumeration name="YN">
                <summary>Unknown,Yes, or No.</summary>
                <EnumValue name="Unknown">0</EnumValue>
                <EnumValue name="Yes">1</EnumValue>
                <EnumValue name="No">2</EnumValue>
            </Enumeration>
        </column>
        <column order="26" name="IsOrtho" type="tinyint">
            <summary>True if is ortho.</summary>
        </column>
        <column order="27" name="OrthoRemainM" type="tinyint">
            <summary>Remaining months of ortho. Valid values are 1-36.</summary>
        </column>
        <column order="28" name="OrthoDate" type="date">
            <summary>Date ortho appliance placed.</summary>
        </column>
        <column order="29" name="PatRelat" type="tinyint">
            <summary>Enum:Relat  Relationship to subscriber.  The relationship is copied from InsPlan when the claim is created.  It might need to be changed in both places.</summary>
            <Enumeration name="Relat">
                <summary>Relationship to subscriber for insurance.</summary>
                <EnumValue name="Self">0</EnumValue>
                <EnumValue name="Spouse">1</EnumValue>
                <EnumValue name="Child">2</EnumValue>
                <EnumValue name="Employee">3</EnumValue>
                <EnumValue name="HandicapDep">4</EnumValue>
                <EnumValue name="SignifOther">5</EnumValue>
                <EnumValue name="InjuredPlaintiff">6</EnumValue>
                <EnumValue name="LifePartner">7</EnumValue>
                <EnumValue name="Dependent">8</EnumValue>
            </Enumeration>
        </column>
        <column order="30" name="PlanNum2" type="int(11)" fk="insplan">
            <summary>FK to insplan.PlanNum.  Other coverage plan number.  0 if none.  This provides the user with total control over what other coverage shows. This obviously limits the coverage on a single claim to two insurance companies.</summary>
        </column>
        <column order="31" name="PatRelat2" type="tinyint">
            <summary>Enum:Relat  The relationship to the subscriber for other coverage on this claim.</summary>
            <Enumeration name="Relat">
                <summary>Relationship to subscriber for insurance.</summary>
                <EnumValue name="Self">0</EnumValue>
                <EnumValue name="Spouse">1</EnumValue>
                <EnumValue name="Child">2</EnumValue>
                <EnumValue name="Employee">3</EnumValue>
                <EnumValue name="HandicapDep">4</EnumValue>
                <EnumValue name="SignifOther">5</EnumValue>
                <EnumValue name="InjuredPlaintiff">6</EnumValue>
                <EnumValue name="LifePartner">7</EnumValue>
                <EnumValue name="Dependent">8</EnumValue>
            </Enumeration>
        </column>
        <column order="32" name="WriteOff" type="double">
            <summary>Sum of ClaimProc.Writeoff for this claim.</summary>
        </column>
        <column order="33" name="Radiographs" type="tinyint">
            <summary>The number of x-rays enclosed.</summary>
        </column>
        <column order="34" name="ClinicNum" type="smallint(6)" fk="clinic">
            <summary>FK to clinic.ClinicNum.  0 if no clinic.</summary>
        </column>
        <column order="35" name="ClaimForm" type="int(11)" fk="claimform">
            <summary>FK to claimform.ClaimFormNum.  0 if not assigned to use the claimform for the insplan.</summary>
        </column>
        <column order="36" name="EFormat" type="int(11)">
            <summary>Enum:EtransType to define a specific version of an e-claim.  Only used for medical claims right now.</summary>
            <Enumeration name="EtransType">
                <summary>The _CA of some types should get stripped off when displaying to users.</summary>
                <EnumValue name="ClaimSent">0 X12-837</EnumValue>
                <EnumValue name="ClaimPrinted">1 claim</EnumValue>
                <EnumValue name="Claim_CA">2 Canada. Type 01</EnumValue>
                <EnumValue name="Claim_Ren">3 Renaissance</EnumValue>
                <EnumValue name="ClaimAck_CA">4 Canada. Type 11</EnumValue>
                <EnumValue name="ClaimEOB_CA">5 Canada. Type 21</EnumValue>
                <EnumValue name="Eligibility_CA">6 Canada. Type 08</EnumValue>
                <EnumValue name="EligResponse_CA">7 Canada. Type 18</EnumValue>
                <EnumValue name="ClaimReversal_CA">8 Canada. Type 02</EnumValue>
                <EnumValue name="Predeterm_CA">9 Canada. Type 03</EnumValue>
                <EnumValue name="RequestOutstand_CA">10 Canada. Type 04</EnumValue>
                <EnumValue name="RequestSumm_CA">11 Canada. Type 05</EnumValue>
                <EnumValue name="RequestPay_CA">12 Canada. Type 06</EnumValue>
                <EnumValue name="ClaimCOB_CA">13 Canada. Type 07</EnumValue>
                <EnumValue name="ReverseResponse_CA">14 Canada. Type 12</EnumValue>
                <EnumValue name="PredetermAck_CA">15 Canada. Type 13</EnumValue>
                <EnumValue name="PredetermEOB_CA">16 Canada. Type 23</EnumValue>
                <EnumValue name="OutstandingAck_CA">17 Canada. Type 14</EnumValue>
                <EnumValue name="EmailResponse_CA">18 Canada. Type 24</EnumValue>
                <EnumValue name="PaymentResponse_CA">19 Canada. Type 16</EnumValue>
                <EnumValue name="SummaryResponse_CA">20 Canada. Type 15</EnumValue>
                <EnumValue name="Acknowledge_997">21 Ack from clearinghouse. X12-997.</EnumValue>
                <EnumValue name="StatusNotify_277">22 X12-277. Unsolicited claim status notification.</EnumValue>
                <EnumValue name="TextReport">23 Text report from clearinghouse in human readable format.</EnumValue>
            </Enumeration>
        </column>
    </table>
    <table name="claimattach">
        <summary></summary>
        <column order="0" name="ClaimAttachNum" type="int(11)">
            <summary></summary>
        </column>
        <column order="1" name="ClaimNum" type="int(11)">
            <summary></summary>
        </column>
        <column order="2" name="DisplayedFileName" type="varchar(255)">
            <summary></summary>
        </column>
        <column order="3" name="ActualFileName" type="varchar(255)">
            <summary></summary>
        </column>
    </table>
    <table name="claimcondcodelog">
        <summary></summary>
        <column order="0" name="ClaimCondCodeLogNum" type="int(10)">
            <summary></summary>
        </column>
        <column order="1" name="ClaimNum" type="int(10)">
            <summary></summary>
        </column>
        <column order="2" name="Code0" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="3" name="Code1" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="4" name="Code2" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="5" name="Code3" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="6" name="Code4" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="7" name="Code5" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="8" name="Code6" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="9" name="Code7" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="10" name="Code8" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="11" name="Code9" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="12" name="Code10" type="varchar(2)">
            <summary></summary>
        </column>
    </table>
    <table name="claimform">
        <summary>Stores the information for printing different types of claim forms.  Each claimform has many claimformitems attached to it, one for each field on the claimform.  This table has nothing to do with the actual claims.  It just describes how to print them.</summary>
        <column order="0" name="ClaimFormNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Description" type="varchar(50)">
            <summary>eg. ADA2002 or CA Medicaid</summary>
        </column>
        <column order="2" name="IsHidden" type="tinyint">
            <summary>If true, then it will not be displayed in various claim form lists as a choice.</summary>
        </column>
        <column order="3" name="FontName" type="varchar(255)">
            <summary>Valid font name for all text on the form.</summary>
        </column>
        <column order="4" name="FontSize" type="float">
            <summary>Font size for all text on the form.</summary>
        </column>
        <column order="5" name="UniqueID" type="varchar(255)">
            <summary>For instance OD12 or JoeDeveloper9.  If you are a developer releasing claimforms, then this should be your name or company followed by a unique number.  This will later make it easier for you to maintain your claimforms for your customers.  All claimforms that we release will be of the form OD##.  Forms that the user creates will have this field blank, protecting them from being changed by us.  So far, we have built the following claimforms: ADA2002=OD1, Denti-Cal=OD2, ADA2000=OD3, HCFA1500=OD4, HCFA1500preprinted=OD5, Canadian=OD6, Belgian=OD7, ADA2006=OD8, 1500=OD9</summary>
        </column>
        <column order="6" name="PrintImages" type="tinyint">
            <summary>Set to false to not print images.  This removes the background for printing on premade forms.</summary>
        </column>
        <column order="7" name="OffsetX" type="smallint(5)">
            <summary>Shifts all items by x/100th's of an inch to compensate for printer, typically less than 1/4 inch.</summary>
        </column>
        <column order="8" name="OffsetY" type="smallint(5)">
            <summary>Shifts all items by y/100th's of an inch to compensate for printer, typically less than 1/4 inch.</summary>
        </column>
    </table>
    <table name="claimformitem">
        <summary>One item is needed for each field on a claimform.</summary>
        <column order="0" name="ClaimFormItemNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="ClaimFormNum" type="int(11)" fk="claimform">
            <summary>FK to claimform.ClaimFormNum</summary>
        </column>
        <column order="2" name="ImageFileName" type="varchar(255)">
            <summary>If this item is an image.  Usually only one per claimform.  eg ADA2002.emf.  Otherwise it MUST be left blank, or it will trigger an error that the image cannot be found.</summary>
        </column>
        <column order="3" name="FieldName" type="varchar(255)">
            <summary>Must be one of the hardcoded available fieldnames for claims.</summary>
        </column>
        <column order="4" name="FormatString" type="varchar(255)">
            <summary>For dates, the format string. ie MM/dd/yyyy or M d y among many other possibilities.</summary>
        </column>
        <column order="5" name="XPos" type="float">
            <summary>The x position of the item on the claim form.  In pixels. 100 pixels per inch.</summary>
        </column>
        <column order="6" name="YPos" type="float">
            <summary>The y position of the item.</summary>
        </column>
        <column order="7" name="Width" type="float">
            <summary>Limits the printable area of the item. Set to zero to not limit.</summary>
        </column>
        <column order="8" name="Height" type="float">
            <summary>Limits the printable area of the item. Set to zero to not limit.</summary>
        </column>
    </table>
    <table name="claimpayment">
        <summary>Each row represents a single check from the insurance company.  The amount may be split between patients using claimprocs.  The amount of the check must always exactly equal the sum of all the claimprocs attached to it.  There might be only one claimproc.</summary>
        <column order="0" name="ClaimPaymentNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="CheckDate" type="date">
            <summary>Date the check was entered into this system, not the date on the check.</summary>
        </column>
        <column order="2" name="CheckAmt" type="double">
            <summary>The amount of the check.</summary>
        </column>
        <column order="3" name="CheckNum" type="varchar(25)">
            <summary>The check number.</summary>
        </column>
        <column order="4" name="BankBranch" type="varchar(25)">
            <summary>Bank and branch.</summary>
        </column>
        <column order="5" name="Note" type="varchar(255)">
            <summary>Note for this check if needed.</summary>
        </column>
        <column order="6" name="ClinicNum" type="smallint" fk="clinic">
            <summary>FK to clinic.ClinicNum.  0 if no clinic.</summary>
        </column>
        <column order="7" name="DepositNum" type="int(11)" fk="deposit">
            <summary>FK to deposit.DepositNum.  0 if not attached to any deposits.</summary>
        </column>
        <column order="8" name="CarrierName" type="varchar(255)">
            <summary>Descriptive name of the carrier just for reporting purposes.</summary>
        </column>
    </table>
    <table name="claimproc">
        <summary>Links procedures to claims.  Also links ins payments to procedures or claims.  Also used for estimating procedures even if no claim yet.  Warning: One proc might be linked twice to a given claim if insurance made two payments.  Many of the important fields are actually optional.  For instance, ProcNum is only required if itemizing ins payment, and ClaimNum is blank if Status=adjustment,cap,or estimate.</summary>
        <column order="0" name="ClaimProcNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="ProcNum" type="int(11)" fk="procedurelog">
            <summary>FK to procedurelog.ProcNum.</summary>
        </column>
        <column order="2" name="ClaimNum" type="int(11)" fk="claim">
            <summary>FK to claim.ClaimNum.</summary>
        </column>
        <column order="3" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum.</summary>
        </column>
        <column order="4" name="ProvNum" type="smallint" fk="provider">
            <summary>FK to provider.ProvNum.</summary>
        </column>
        <column order="5" name="FeeBilled" type="double">
            <summary>Fee billed to insurance. Might not be the same as the actual fee.  The fee billed can be different than the actual procedure.  For instance, if you have set the insurance plan to bill insurance using UCR fees, then this field will contain the UCR fee instead of the fee that the patient was charged.</summary>
        </column>
        <column order="6" name="InsPayEst" type="double">
            <summary>Actual amount this carrier is expected to pay, after taking everything else into account. Considers annual max, override, percentAmt, copayAmt, deductible, etc. This estimate is computed automatically in TP module, and gets overwritten when sent to ins.</summary>
        </column>
        <column order="7" name="DedApplied" type="double">
            <summary>Deductible applied to this procedure only. If not sent to ins yet, then this will be set to an estimated amount based on the order in the TP.  Will be overwritten when actually sent to ins.</summary>
        </column>
        <column order="8" name="Status" type="tinyint">
            <summary>Enum:ClaimProcStatus .</summary>
            <Enumeration name="ClaimProcStatus">
                <summary>Claimproc Status.  The status must generally be the same as the claim, although it is sometimes not strictly enforced.</summary>
                <EnumValue name="NotReceived">0: For claims that have been created or sent, but have not been received.</EnumValue>
                <EnumValue name="Received">1: For claims that have been received.</EnumValue>
                <EnumValue name="Preauth">2: For preauthorizations.</EnumValue>
                <EnumValue name="Adjustment">3: The only place that this status is used is to make adjustments to benefits from the coverage window.  It is never attached to a claim.</EnumValue>
                <EnumValue name="Supplemental">4:This differs from Received only slightly.  It's for additional payments on procedures already received.  Most fields are blank.</EnumValue>
                <EnumValue name="CapClaim">5: CapClaim is used when you want to send a claim to a capitation insurance company.  These are similar to Supplemental in that there will always be a duplicate claimproc for a procedure. The first claimproc tracks the copay and writeoff, has a status of CapComplete, and is never attached to a claim. The second claimproc has status of CapClaim.</EnumValue>
                <EnumValue name="Estimate">6: Estimates have replaced the fields that were in the procedure table.  Once a procedure is complete, the claimprocstatus will still be Estimate.  An Estimate can be attached to a claim and status gets changed to NotReceived.</EnumValue>
                <EnumValue name="CapComplete">7: For capitation procedures that are complete.  This replaces the old procedurelog.CapCoPay field. This stores the copay and writeoff amounts.  The copay is only there for reference, while it is the writeoff that actually affects the balance. Never attached to a claim. If procedure is TP, then status will be CapEstimate.  Only set to CapComplete if procedure is Complete.</EnumValue>
                <EnumValue name="CapEstimate">8: For capitation procedures that are still estimates rather than complete.  When procedure is completed, this can be changed to CapComplete, but never to anything else.</EnumValue>
            </Enumeration>
        </column>
        <column order="9" name="InsPayAmt" type="double">
            <summary>Amount insurance actually paid.</summary>
        </column>
        <column order="10" name="Remarks" type="varchar(255)">
            <summary>The remarks that insurance sends in the EOB about procedures.</summary>
        </column>
        <column order="11" name="ClaimPaymentNum" type="int(11)" fk="claimpayment">
            <summary>FK to claimpayment.ClaimPaymentNum(the insurance check).</summary>
        </column>
        <column order="12" name="PlanNum" type="int(11)" fk="insplan">
            <summary>FK to insplan.PlanNum</summary>
        </column>
        <column order="13" name="DateCP" type="date">
            <summary>This is the date that is used for payment reports and tracks the payment date.  Always exactly matches the date of the ClaimPayment it's attached to.  See the note under Ledgers.ComputePayments.  This will eventually not be used for aging. The ProcDate will instead be used. See ProcDate.</summary>
        </column>
        <column order="14" name="WriteOff" type="double">
            <summary>Amount not covered by ins which is written off</summary>
        </column>
        <column order="15" name="CodeSent" type="varchar(15)">
            <summary>The procedure code that was sent to insurance. This is not necessarily the usual procedure code.  It will already have been trimmed to 5 char if it started with "D", or it could be the alternate code.  Not allowed to be blank if it is procedure.</summary>
        </column>
        <column order="16" name="AllowedOverride" type="double">
            <summary>-1 if blank which indicates allowed is same as fee. This is the amount that the percentage is based on. Usually the same as the fee, unless this ins plan has lower UCR. Could also be different for ins substitutions, like posterior composites. It is never changed automatically except to sometimes set it to -1.  During Procedure.ComputeEstimates/ClaimProc.ComputeBaseEst, an allowed amount is calculated on the fly, but is no longer saved here.</summary>
        </column>
        <column order="17" name="Percentage" type="tinyint(4)">
            <summary>-1 if blank.  Otherwise a number between 0 and 100.  The percentage that insurance pays on this procedure, as determined from insurance categories. Not user editable.</summary>
        </column>
        <column order="18" name="PercentOverride" type="tinyint(4)">
            <summary>-1 if blank.  Otherwise a number between 0 and 100.  Can only be changed by user.</summary>
        </column>
        <column order="19" name="CopayAmt" type="double">
            <summary>-1 if blank. Calculated automatically. User can not edit but can use CopayOverride instead.  Opposite of InsEst, because this is the patient portion estimate.  Two different uses: 1. For capitation, this automates calculation of writeoff. 2. For any other insurance, it gets deducted during calculation as shown in the edit window. Neither use directly affects patient balance.</summary>
        </column>
        <column order="20" name="OverrideInsEst" type="double">
            <summary>-1 if blank. Lets user override the percentAmt. This field is not updated when recalculating and is only changed by user.</summary>
        </column>
        <column order="21" name="NoBillIns" type="tinyint">
            <summary>Set to true to not bill to this insurance plan.</summary>
        </column>
        <column order="22" name="DedBeforePerc" type="tinyint">
            <summary>Set true to apply the deductible before the percentage instead of the usual way of applying it after.</summary>
        </column>
        <column order="23" name="OverAnnualMax" type="double">
            <summary>-1 if blank. The amount to subtract during estimating because annual benefits have maxed out.</summary>
        </column>
        <column order="24" name="PaidOtherIns" type="double">
            <summary>-1 if blank. The amount paid by another insurance. This amount is then subtracted from what the current insurance would pay. So, always blank for primary claims.</summary>
        </column>
        <column order="25" name="BaseEst" type="double">
            <summary>Always has a value. Used in TP, etc. The base estimate is the ((fee or allowedOverride)-Copay) x (percentage or percentOverride). Does not include all the extras like ded, annualMax,and paidOtherIns that InsPayEst will hold in future estimating.</summary>
        </column>
        <column order="26" name="CopayOverride" type="double">
            <summary>-1 if blank.  See description of CopayAmt.  This lets the user set a copay that will never be overwritten by automatic calculations.</summary>
        </column>
        <column order="27" name="ProcDate" type="date">
            <summary>Date of the procedure.  Currently only used for tracking annual insurance benefits remaining. Important in Adjustments to benefits.  For total claim payments, MUST be the date of the procedures to correctly figure benefits.  Will eventually transition to use this field to actually calculate aging.  See the note under Ledgers.ComputePayments.</summary>
        </column>
        <column order="28" name="DateEntry" type="date">
            <summary>Date that it was changed to status received or supplemental.  It is usually attached to a claimPayment at that point, but not if user forgets.  This is still the date that it becomes important financial data.  Only applies if Received or Supplemental.  Otherwise, the date is disregarded.  User may never edit. Important in audit trail.</summary>
        </column>
        <column order="29" name="LineNumber" type="tinyint">
            <summary>Assigned when claim is created as a way to order the procs showing on a claim.  Really only used in Canadian claims for now as F07.</summary>
        </column>
    </table>
    <table name="claimvalcodelog">
        <summary></summary>
        <column order="0" name="ClaimValCodeLogNum" type="int(10)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="ClaimNum" type="int(10)" fk="claim">
            <summary>FK to claim.ClaimNum.</summary>
        </column>
        <column order="2" name="ClaimField" type="varchar(5)">
            <summary>Descriptive abbreviation to help place field on form (Ex: "FL55" for field 55).</summary>
        </column>
        <column order="3" name="ValCode" type="char(2)">
            <summary>Value Code.</summary>
        </column>
        <column order="4" name="ValAmount" type="varchar(10)">
            <summary>Value Code Amount.</summary>
        </column>
        <column order="5" name="Ordinal" type="int(10)">
            <summary>Order of Value Code</summary>
        </column>
    </table>
    <table name="clearinghouse">
        <summary>Since we can send e-claims to multiple clearinghouses, this table keeps track of each clearinghouse.  Will eventually be used for individual carriers as well if they accept </summary>
        <column order="0" name="ClearinghouseNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Description" type="varchar(255)">
            <summary>Description of this clearinghouse</summary>
        </column>
        <column order="2" name="ExportPath" type="text">
            <summary>The path to export the X12 file to. \ is now optional.</summary>
        </column>
        <column order="3" name="IsDefault" type="tinyint">
            <summary>Set to true if this is the default clearinghouse to which you want most of your e-claims sent.</summary>
        </column>
        <column order="4" name="Payors" type="text">
            <summary>A list of all payors which should have claims sent to this clearinghouse. Comma delimited with no spaces.  Not necessary if IsDefault.</summary>
        </column>
        <column order="5" name="Eformat" type="tinyint">
            <summary>Enum:ElectronicClaimFormat The format of the file that gets sent electronically.</summary>
            <Enumeration name="ElectronicClaimFormat">
                <summary>For every type of electronic claim format that Open Dental can create, there will be an item in this enumeration.  All e-claim formats are hard coded due to complexity.</summary>
                <EnumValue name="None">0-Not in database, but used in various places in program.</EnumValue>
                <EnumValue name="X12">1-The American standard. HIPAA mandated.</EnumValue>
                <EnumValue name="Renaissance">2-Proprietary format for Renaissance.</EnumValue>
                <EnumValue name="Canadian">3-CDAnet format version 4.</EnumValue>
            </Enumeration>
        </column>
        <column order="6" name="ISA05" type="varchar(255)">
            <summary>Sender ID Qualifier. Usually ZZ, sometimes 30. Seven other values are allowed as specified in X12 document, but probably never used.</summary>
        </column>
        <column order="7" name="SenderTIN" type="varchar(255)">
            <summary>Used in ISA06, GS02, 1000A NM1, and 1000A PER.  If blank, then 810624427 is used to indicate Open Dental.</summary>
        </column>
        <column order="8" name="ISA07" type="varchar(255)">
            <summary>Receiver ID Qualifier.  Usually ZZ, sometimes 30. Seven other values are allowed as specified in X12 document, but probably never used.</summary>
        </column>
        <column order="9" name="ISA08" type="varchar(255)">
            <summary>Receiver ID. Also used in GS03. Provided by clearinghouse. Examples: BCBSGA or 0135WCH00(webMD)</summary>
        </column>
        <column order="10" name="ISA15" type="varchar(255)">
            <summary>"P" for Production or "T" for Test.</summary>
        </column>
        <column order="11" name="Password" type="varchar(255)">
            <summary>Password is usually combined with the login ID for user validation.</summary>
        </column>
        <column order="12" name="ResponsePath" type="varchar(255)">
            <summary>The path that all incoming response files will be saved to. \ is now optional.</summary>
        </column>
        <column order="13" name="CommBridge" type="tinyint">
            <summary>Enum:EclaimsCommBridge  One of the included hard-coded communications briges.  Or none to just create the claim files without uploading.</summary>
            <Enumeration name="EclaimsCommBridge">
                <summary>Each clearinghouse can have a hard-coded comm bridge which handles all the communications of transfering the claim files to the clearinghouse/carrier.  Does not just include X12, but can include any format at all.</summary>
                <EnumValue name="None">0-No comm bridge will be activated. The claim files will be created to the specified path, but they will not be uploaded.</EnumValue>
                <EnumValue name="WebMD">1</EnumValue>
                <EnumValue name="BCBSGA">2</EnumValue>
                <EnumValue name="Renaissance">3</EnumValue>
                <EnumValue name="ClaimConnect">4</EnumValue>
                <EnumValue name="RECS">5</EnumValue>
                <EnumValue name="Inmediata">6</EnumValue>
                <EnumValue name="AOS">7</EnumValue>
                <EnumValue name="PostnTrack">8</EnumValue>
                <EnumValue name="CDAnet">9 Canada</EnumValue>
                <EnumValue name="Tesia">10</EnumValue>
            </Enumeration>
        </column>
        <column order="14" name="ClientProgram" type="varchar(255)">
            <summary>If applicable, this is the name of the client program to launch.  It is even used by the hard-coded comm bridges, because the user may have changed the installation directory or exe name.</summary>
        </column>
        <column order="15" name="LastBatchNumber" type="smallint">
            <summary>Each clearinghouse increments their batch numbers by one each time a claim file is sent.  User never sees this number.  Maxes out at 999, then loops back to 1.  This field is skipped during all update and retreival except if specifically looking for this one field.  Defaults to 0 for brand new clearinghouses, which causes the first batch to go out as #1.</summary>
        </column>
        <column order="16" name="ModemPort" type="tinyint">
            <summary>1,2,3,or 4. The port that the modem is connected to if applicable. Always uses 9600 baud and standard settings. Will crash if port or modem not valid.</summary>
        </column>
        <column order="17" name="LoginID" type="varchar(255)">
            <summary>A clearinghouse usually has a login ID that is used with the password in order to access the remote server.  This value is not usualy used within the actual claim.</summary>
        </column>
        <column order="18" name="SenderName" type="varchar(255)">
            <summary>Used in 1000A NM1 and 1000A PER.  But if SenderTIN is blank, then OPEN DENTAL SOFTWARE is used instead.</summary>
        </column>
        <column order="19" name="SenderTelephone" type="varchar(255)">
            <summary>Used in 1000A PER.  But if SenderTIN is blank, then 8776861248 is used instead.  10 digit phone is required by WebMD and is universally assumed, so for now, this must be either blank or 10 digits.</summary>
        </column>
        <column order="20" name="GS03" type="varchar(255)">
            <summary>Usually the same as ISA08, but at least one clearinghouse uses a different number here.</summary>
        </column>
    </table>
    <table name="clinic">
        <summary>A clinic is usually a separate physical office location.  If multiple clinics are sharing one database, then this is used.  Patients, Operatories, Claims, and many other types of objects can be assigned to a clinic.</summary>
        <column order="0" name="ClinicNum" type="smallint">
            <summary>Primary key.  Used in patient,payment,claimpayment,appointment,procedurelog</summary>
        </column>
        <column order="1" name="Description" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="2" name="Address" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="3" name="Address2" type="varchar(255)">
            <summary>Second line of address.</summary>
        </column>
        <column order="4" name="City" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="5" name="State" type="varchar(255)">
            <summary>2 char in the US.</summary>
        </column>
        <column order="6" name="Zip" type="varchar(255)">
            <summary></summary>
        </column>
        <column order="7" name="Phone" type="varchar(255)">
            <summary>Does not include any punctuation.  Should be exactly 10 digits</summary>
        </column>
        <column order="8" name="BankNumber" type="varchar(255)">
            <summary>The account number for deposits.</summary>
        </column>
        <column order="9" name="DefaultPlaceService" type="tinyint">
            <summary>Enum:PlaceOfService Usually 0 unless a mobile clinic for instance.</summary>
            <Enumeration name="PlaceOfService">
                <summary />
                <EnumValue name="Office">0. CPT code 11</EnumValue>
                <EnumValue name="PatientsHome">1. CPT code 12</EnumValue>
                <EnumValue name="InpatHospital">2. CPT code 21</EnumValue>
                <EnumValue name="OutpatHospital">3. CPT code 22</EnumValue>
                <EnumValue name="SkilledNursFac">4. CPT code 31</EnumValue>
                <EnumValue name="AdultLivCareFac">5. CPT code 33</EnumValue>
                <EnumValue name="OtherLocation">6. CPT code ?</EnumValue>
                <EnumValue name="MobileUnit">7. CPT code 15</EnumValue>
                <EnumValue name="School">8. CPT code 03</EnumValue>
                <EnumValue name="MilitaryTreatFac">9. CPT code 26</EnumValue>
                <EnumValue name="FederalHealthCenter">10. CPT code 50</EnumValue>
                <EnumValue name="PublicHealthClinic">11. CPT code 71</EnumValue>
                <EnumValue name="RuralHealthClinic">12. CPT code 72</EnumValue>
            </Enumeration>
        </column>
    </table>
    <table name="clockevent">
        <summary>Each row is either a clock-in or a clock-out event.  This table will soon be significantly changed so that each row will contain both the clock-in and the clock-out.  As it is right now, it's nearly impossible to do queries that give you summary results.</summary>
        <column order="0" name="ClockEventNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="EmployeeNum" type="smallint" fk="employee">
            <summary>FK to employee.EmployeeNum</summary>
        </column>
        <column order="2" name="TimeEntered" type="datetime">
            <summary>The actual time that this entry was entered.</summary>
        </column>
        <column order="3" name="TimeDisplayed" type="datetime">
            <summary>The time to display and to use in all calculations.</summary>
        </column>
        <column order="4" name="ClockIn" type="tinyint">
            <summary>True for ClockIn, and false for ClockOut.</summary>
        </column>
        <column order="5" name="ClockStatus" type="tinyint">
            <summary>Enum:TimeClockStatus  Home, Lunch, or Break.</summary>
            <Enumeration name="TimeClockStatus">
                <summary />
                <EnumValue name="Home">0</EnumValue>
                <EnumValue name="Lunch">1</EnumValue>
                <EnumValue name="Break">2</EnumValue>
            </Enumeration>
        </column>
        <column order="6" name="Note" type="text">
            <summary>.</summary>
        </column>
    </table>
    <table name="commlog">
        <summary>Tracks all forms of communications with patients, including emails, phonecalls, postcards, etc.</summary>
        <column order="0" name="CommlogNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum.</summary>
        </column>
        <column order="2" name="CommDateTime" type="datetime">
            <summary>Date and time of entry</summary>
        </column>
        <column order="3" name="CommType" type="int(11)" fk="definition">
            <summary>FK to definition.DefNum. This will be 0 if IsStatementSent.  Used to be an enumeration in previous versions.</summary>
        </column>
        <column order="4" name="Note" type="text">
            <summary>Note for this commlog entry.</summary>
        </column>
        <column order="5" name="Mode_" type="tinyint">
            <summary>Enum:CommItemMode Phone, email, etc.</summary>
            <Enumeration name="CommItemMode">
                <summary />
                <EnumValue name="None">0- </EnumValue>
                <EnumValue name="Email">1- </EnumValue>
                <EnumValue name="Mail">2</EnumValue>
                <EnumValue name="Phone">3</EnumValue>
                <EnumValue name="InPerson">4</EnumValue>
                <EnumValue name="AutoItem">5</EnumValue>
            </Enumeration>
        </column>
        <column order="6" name="SentOrReceived" type="tinyint">
            <summary>Enum:CommSentOrReceived Neither=0,Sent=1,Received=2.</summary>
            <Enumeration name="CommSentOrReceived">
                <summary>0=neither, 1=sent, 2=received.</summary>
                <EnumValue name="Neither">0</EnumValue>
                <EnumValue name="Sent">1</EnumValue>
                <EnumValue name="Received">2</EnumValue>
            </Enumeration>
        </column>
        <column order="7" name="IsStatementSent" type="tinyint(1)">
            <summary></summary>
        </column>
        <column order="8" name="UserNum" type="int(11)" fk="user">
            <summary>FK to user.UserNum.</summary>
        </column>
    </table>
    <table name="computer">
        <summary>Keeps track of the computers in an office.  The list will eventually become cluttered with the names of old computers that are no longer in service.  The old rows can be safely deleted.  Although the primary key is used in at least one table, this will probably be changed, and the computername will become the primary key.</summary>
        <column order="0" name="ComputerNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="CompName" type="varchar(100)">
            <summary>Name of the computer.</summary>
        </column>
        <column order="2" name="PrinterName" type="varchar(255)">
            <summary>No longer used. Moved to printer table.  Used to hold default printer for each computer</summary>
        </column>
    </table>
    <table name="computerpref">
        <summary>Enables preference specification for individual computers on a customer network.</summary>
        <column order="0" name="ComputerPrefNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="ComputerName" type="varchar(64)">
            <summary>The human-readable name of the computer on the network (not the IP address).</summary>
        </column>
        <column order="2" name="GraphicsUseHardware" type="tinyint(1)">
            <summary>Set to true if the tooth chart is to use a hardware accelerated OpenGL window when available. Set to false to use software rendering when available. Of course, the final pixel format on the customer machine depends on the list of available formats. Best match pixel format is always used. This option only applies if GraphicsSimple is set to false.</summary>
        </column>
        <column order="3" name="GraphicsSimple" type="tinyint(1)">
            <summary>Set to true to use the low-quality 2D tooth chart in the chart module. Set to false to use an 3D OpenGL based tooth chart in the chart module. This option is a work-around for machines where the OpenGL implementation on the local graphics hardware is buggy or unavailable (i.e. MONO).</summary>
        </column>
        <column order="4" name="SensorType" type="varchar(255)">
            <summary>Indicates the type of Suni sensor connected to the local computer (if any). This can be a value of A, B, C, or D.</summary>
        </column>
        <column order="5" name="SensorBinned" type="varchar(1)">
            <summary>Indicates wether or not the Suni sensor uses binned operation.</summary>
        </column>
        <column order="6" name="SensorPort" type="int(11)">
            <summary>Indicates which Suni box port to connect with. There are 2 ports on a box (ports 0 and 1).</summary>
        </column>
        <column order="7" name="SensorExposure" type="int(11)">
            <summary>Indicates the exposure level to use when capturing from a Suni sensor. Values can be 1 through 7.</summary>
        </column>
        <column order="8" name="GraphicsDoubleBuffering" type="varchar(1)">
            <summary>Indicates if the user prefers double-buffered 3D tooth-chart (where applicable).</summary>
        </column>
        <column order="9" name="PreferredPixelFormatNum" type="int(11)">
            <summary>Indicates the current pixel format by number which the user prefers.</summary>
        </column>
        <column order="10" name="AtoZpath" type="varchar(255)">
            <summary>The path of the A-Z folder for the specified computer.  Overrides the officewide default.  Used when multiple locations are on a single virtual database and they each want to look to the local data folder for images.</summary>
        </column>
    </table>
    <table name="contact">
        <summary>Like a rolodex for businesses that the office interacts with.  Used to store pharmacies, etc.</summary>
        <column order="0" name="ContactNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="LName" type="varchar(255)">
            <summary>Last name or, frequently, the entire name.</summary>
        </column>
        <column order="2" name="FName" type="varchar(255)">
            <summary>First name is optional.</summary>
        </column>
        <column order="3" name="WkPhone" type="varchar(255)">
            <summary>Work phone.</summary>
        </column>
        <column order="4" name="Fax" type="varchar(255)">
            <summary>Fax number.</summary>
        </column>
        <column order="5" name="Category" type="smallint" fk="definition">
            <summary>FK to definition.DefNum</summary>
        </column>
        <column order="6" name="Notes" type="text">
            <summary>Note for this contact.</summary>
        </column>
    </table>
    <table name="county">
        <summary>Used in public health.</summary>
        <column order="0" name="CountyName" type="varchar(255)">
            <summary>Primary key, but allowed to change.  Change is programmatically synchronized.</summary>
        </column>
        <column order="1" name="CountyCode" type="varchar(255)">
            <summary>Optional. Usage varies.</summary>
        </column>
    </table>
    <table name="covcat">
        <summary>Insurance coverage categories.  They need to look like in the manual for the American calculations to work properly.</summary>
        <column order="0" name="CovCatNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Description" type="varchar(50)">
            <summary>Description of this category.</summary>
        </column>
        <column order="2" name="DefaultPercent" type="tinyint(3)">
            <summary>Default percent for this category. -1 to skip this category and not apply a percentage.</summary>
        </column>
        <column order="3" name="CovOrder" type="tinyint">
            <summary>The order in which the categories are displayed.  Includes hidden categories. 0-based.</summary>
        </column>
        <column order="4" name="IsHidden" type="tinyint">
            <summary>If true, this category will be hidden.</summary>
        </column>
        <column order="5" name="EbenefitCat" type="tinyint">
            <summary>Enum:EbenefitCategory  The X12 benefit categories.  Each CovCat can link to one X12 category.  Default is 0 (unlinked).</summary>
            <Enumeration name="EbenefitCategory">
                <summary>The X12 benefit categories.  Used to link the user-defined CovCats to the corresponding X12 category.</summary>
                <EnumValue name="None">0- Default</EnumValue>
                <EnumValue name="General">1- X12: 30 and 35. All ADA codes.</EnumValue>
                <EnumValue name="Diagnostic">2- X12: 23. ADA D0000-D0999</EnumValue>
                <EnumValue name="Periodontics">3- X12: 24. ADA D4000</EnumValue>
                <EnumValue name="Restorative">4- X12: 25. ADA D2000</EnumValue>
                <EnumValue name="Endodontics">5- X12: 26. ADA D3000</EnumValue>
                <EnumValue name="MaxillofacialProsth">6- X12: 27. ADA D5900-D5999</EnumValue>
                <EnumValue name="Crowns">7- X12: 36. Subcategory of restorative.</EnumValue>
                <EnumValue name="Accident">8- X12: 37. ADA range?</EnumValue>
                <EnumValue name="Orthodontics">9- X12: 38. ADA D8000</EnumValue>
                <EnumValue name="Prosthodontics">10- X12: 39. ADA D5000-D5899 (removable), and D6200-D6900 (fixed)</EnumValue>
                <EnumValue name="OralSurgery">11- X12: 40. ADA D7000</EnumValue>
                <EnumValue name="RoutinePreventive">12- X12: 41. ADA D1000</EnumValue>
            </Enumeration>
        </column>
    </table>
    <table name="covspan">
        <summary>Always attached to covcats, this describes the span of procedure codes to which the category applies.</summary>
        <column order="0" name="CovSpanNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="CovCatNum" type="int(11)" fk="covcat">
            <summary>FK to covcat.CovCatNum.</summary>
        </column>
        <column order="2" name="FromCode" type="varchar(15)">
            <summary>Lower range of the span.  Does not need to be a valid code.</summary>
        </column>
        <column order="3" name="ToCode" type="varchar(15)">
            <summary>Upper range of the span.  Does not need to be a valid code.</summary>
        </column>
    </table>
    <table name="definition">
        <summary>The info in the definition table is used by other tables extensively.  Almost every table in the database links to definition.  Almost all links to this table will be to a DefNum.  Using the DefNum, you can find any of the other fields of interest, usually the ItemName.  Make sure to look at the Defs class to see how the definitions are used.  Loaded into memory ahead of time for speed.  Some types of info such as operatories started out life in this table, but then got moved to their own table when more complexity was needed.</summary>
        <column order="0" name="DefNum" type="smallint">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Category" type="tinyint">
            <summary>Enum:DefCat</summary>
            <Enumeration name="DefCat">
                <summary>Definition Category. Go to the definition setup window in the program to see how each of these categories is used.</summary>
                <EnumValue name="AccountColors">0- Colors to display in Account module.</EnumValue>
                <EnumValue name="AdjTypes">1- Adjustment types.</EnumValue>
                <EnumValue name="ApptConfirmed">2- Appointment confirmed types.</EnumValue>
                <EnumValue name="ApptProcsQuickAdd">3- Procedure quick add list for appointments.</EnumValue>
                <EnumValue name="BillingTypes">4- Billing types.</EnumValue>
                <EnumValue name="ClaimFormats">5- Not used.</EnumValue>
                <EnumValue name="DunningMessages">6- Not used.</EnumValue>
                <EnumValue name="FeeSchedNames">7- Fee schedule names.</EnumValue>
                <EnumValue name="MedicalNotes">8- Medical notes for quick paste.</EnumValue>
                <EnumValue name="OperatoriesOld">9- No longer used</EnumValue>
                <EnumValue name="PaymentTypes">10- Payment types.</EnumValue>
                <EnumValue name="ProcCodeCats">11- Procedure code categories.</EnumValue>
                <EnumValue name="ProgNoteColors">12- Progress note colors.</EnumValue>
                <EnumValue name="RecallUnschedStatus">13- Statuses for recall, unscheduled, and next appointments.</EnumValue>
                <EnumValue name="ServiceNotes">14- Service notes for quick paste.</EnumValue>
                <EnumValue name="DiscountTypes">15- Discount types.</EnumValue>
                <EnumValue name="Diagnosis">16- Diagnosis types.</EnumValue>
                <EnumValue name="AppointmentColors">17- Colors to display in the Appointments module.</EnumValue>
                <EnumValue name="ImageCats">18- Image categories.</EnumValue>
                <EnumValue name="ApptPhoneNotes">19- Quick add notes for the ApptPhoneNotes, which is getting phased out.</EnumValue>
                <EnumValue name="TxPriorities">20- Treatment plan priority names.</EnumValue>
                <EnumValue name="MiscColors">21- Miscellaneous color options.</EnumValue>
                <EnumValue name="ChartGraphicColors">22- Colors for the graphical tooth chart.</EnumValue>
                <EnumValue name="ContactCategories">23- Categories for the Contact list.</EnumValue>
                <EnumValue name="LetterMergeCats">24- Categories for Letter Merge.</EnumValue>
                <EnumValue name="BlockoutTypes">25- Types of Schedule Blockouts.</EnumValue>
                <EnumValue name="ProcButtonCats">26- Categories of procedure buttons in Chart module</EnumValue>
                <EnumValue name="CommLogTypes">27- Types of commlog entries.</EnumValue>
                <EnumValue name="SupplyCats">28- Categories of Supplies</EnumValue>
            </Enumeration>
        </column>
        <column order="2" name="ItemOrder" type="smallint">
            <summary>Order that each item shows on various lists.</summary>
        </column>
        <column order="3" name="ItemName" type="varchar(255)">
            <summary>Each category is a little different.  This field is usually the common name of the item.</summary>
        </column>
        <column order="4" name="ItemValue" type="varchar(255)">
            <summary>This field can be used to store extra info about the item.</summary>
        </column>
        <column order="5" name="ItemColor" type="int(11)">
            <summary>Some categories include a color option.</summary>
        </column>
        <column order="6" name="IsHidden" type="tinyint">
            <summary>If hidden, the item will not show on any list, but can still be referenced.</summary>
        </column>
    </table>
    <table name="deposit">
        <summary>A deposit slip.  Contains multiple insurance and patient checks.</summary>
        <column order="0" name="DepositNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="DateDeposit" type="date">
            <summary>The date of the deposit.</summary>
        </column>
        <column order="2" name="BankAccountInfo" type="text">
            <summary>User editable.  Usually includes name on the account and account number.  Possibly the bank name as well.</summary>
        </column>
        <column order="3" name="Amount" type="double">
            <summary>Total amount of the deposit. User not allowed to directly edit.</summary>
        </column>
    </table>
    <table name="disease">
        <summary>Each row is one disease that one patient has.  A disease is a medical condition or allergy.  Diseases are defined in the DiseaseDef table.</summary>
        <column order="0" name="DiseaseNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum</summary>
        </column>
        <column order="2" name="DiseaseDefNum" type="int(11)" fk="diseasedef">
            <summary>FK to diseasedef.DiseaseDefNum.  The disease description is in that table.</summary>
        </column>
        <column order="3" name="PatNote" type="text">
            <summary>Any note about this disease that is specific to this patient.</summary>
        </column>
    </table>
    <table name="diseasedef">
        <summary>A list of diseases that can be assigned to patients.  Cannot be deleted if in use by any patients.</summary>
        <column order="0" name="DiseaseDefNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="DiseaseName" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="2" name="ItemOrder" type="smallint">
            <summary>The order that the diseases will show in various lists.</summary>
        </column>
        <column order="3" name="IsHidden" type="tinyint">
            <summary>If hidden, the disease will still show on any patient that it was previously attached to, but it will not be available for future patients.</summary>
        </column>
    </table>
    <table name="displayfield">
        <summary>Allows customization of which fields display in various lists and grids.  For now, the only grid is ProgressNotes.  Will also eventually let users set column widths and translate titles.  For now, the selections are the same for all computers.</summary>
        <column order="0" name="DisplayFieldNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="InternalName" type="varchar(255)">
            <summary>This is the internal name that OD uses to identify the field within this category.  This will be the default description if the user doesn't specify an alternate.</summary>
        </column>
        <column order="2" name="ItemOrder" type="int(11)">
            <summary>Order to display in the grid or list. Every entry must have a unique itemorder.</summary>
        </column>
        <column order="3" name="Description" type="varchar(255)">
            <summary>Optional alternate description to display for field.  Can be in another language.</summary>
        </column>
        <column order="4" name="ColumnWidth" type="int(11)">
            <summary>For grid columns, this lets user override the column width.  Especially useful for foreign languages.</summary>
        </column>
    </table>
    <table name="docattach">
        <summary>Links documents (images) to patients.  This will allow one document to be shared between multiple patients in a future version.</summary>
        <column order="0" name="DocAttachNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum.</summary>
        </column>
        <column order="2" name="DocNum" type="int(11)" fk="document">
            <summary>FK to document.DocNum.</summary>
        </column>
    </table>
    <table name="document">
        <summary>It should be called image, but the name is for historical reasons.  Represents a single document in the images module.  This table indicates in which patient's folder the image can be found, but the actual attaching of the image to the patient is done by the docattach table.</summary>
        <column order="0" name="DocNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Description" type="varchar(255)">
            <summary>Description of the document.</summary>
        </column>
        <column order="2" name="DateCreated" type="date">
            <summary>Date created.</summary>
        </column>
        <column order="3" name="DocCategory" type="int(11)" fk="definition">
            <summary>FK to definition.DefNum. Categories for documents.</summary>
        </column>
        <column order="4" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum.  Patient folder that document is in.(for sharing situations later)</summary>
        </column>
        <column order="5" name="FileName" type="varchar(255)">
            <summary>The name of the file. Does not include any directory info.</summary>
        </column>
        <column order="6" name="ImgType" type="tinyint">
            <summary>Enum:ImageType eg. document, radiograph, photo, file</summary>
            <Enumeration name="ImageType">
                <summary>The type of image for images module.</summary>
                <EnumValue name="Document">0- Includes scanned documents and screenshots.</EnumValue>
                <EnumValue name="Radiograph">1</EnumValue>
                <EnumValue name="Photo">2</EnumValue>
                <EnumValue name="File">3- For instance a Word document or a spreadsheet. Not an image.</EnumValue>
                <EnumValue name="Mount">4- For xray mount sets.</EnumValue>
            </Enumeration>
        </column>
        <column order="7" name="IsFlipped" type="tinyint">
            <summary>True if flipped horizontally. A vertical flip would be stored as a horizontal flip plus a 180 rotation.</summary>
        </column>
        <column order="8" name="DegreesRotated" type="smallint(6)">
            <summary>Only allowed 0,90,180, and 270.</summary>
        </column>
        <column order="9" name="ToothNumbers" type="varchar(255)">
            <summary>Incomplete.  An optional list of tooth numbers separated by commas.  The tooth numbers will be in American format and must be processed for display.  When displayed, dashes will be used for sequences of 3 or more tooth numbers.</summary>
        </column>
        <column order="10" name="Note" type="text">
            <summary></summary>
        </column>
        <column order="11" name="SigIsTopaz" type="tinyint">
            <summary>True if the signature is in Topaz format rather than OD format.</summary>
        </column>
        <column order="12" name="Signature" type="text">
            <summary>The encrypted and bound signature in base64 format.  The signature is bound to the byte sequence of the original image.</summary>
        </column>
        <column order="13" name="CropX" type="int(11)">
            <summary>Crop rectangle X in original image pixel coordinates.  May be negative.</summary>
        </column>
        <column order="14" name="CropY" type="int(11)">
            <summary>Crop rectangle Y in original image pixel coordinates.  May be negative.</summary>
        </column>
        <column order="15" name="CropW" type="int(11)">
            <summary>Crop rectangle Width in original image pixel coordinates.  May be zero if no cropping.  May be greater than original image width.</summary>
        </column>
        <column order="16" name="CropH" type="int(11)">
            <summary>Crop rectangle Height in original image pixel coordinates.  May be zero if no cropping.  May be greater than original image height.</summary>
        </column>
        <column order="17" name="WindowingMin" type="int(11)">
            <summary>The lower value of the "windowing" (contrast/brightness) for radiographs.  Default is 0.  Max is 255.</summary>
        </column>
        <column order="18" name="WindowingMax" type="int(11)">
            <summary>The upper value of the "windowing" (contrast/brightness) for radiographs.  Default is 0(no windowing).  Max is 255.</summary>
        </column>
        <column order="19" name="MountItemNum" type="int(11)" fk="mountitem">
            <summary>FK to mountitem.MountItemNum. If set to 0, then no mount item is associated with this document.</summary>
        </column>
    </table>
    <table name="dunning">
        <summary>A message that will show on certain patient statements when printing bills.  Criteria must be met in order for the dunning message to show.</summary>
        <column order="0" name="DunningNum" type="smallint">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="DunMessage" type="text">
            <summary>The actual dunning message that will go on the patient bill.</summary>
        </column>
        <column order="2" name="BillingType" type="smallint" fk="definition">
            <summary>FK to definition.DefNum.</summary>
        </column>
        <column order="3" name="AgeAccount" type="tinyint">
            <summary>This is an int field, but program forces only 0,30,60,or 90.</summary>
        </column>
        <column order="4" name="InsIsPending" type="tinyint">
            <summary>Enum:YN Set Y to only show if insurance is pending.</summary>
            <Enumeration name="YN">
                <summary>Unknown,Yes, or No.</summary>
                <EnumValue name="Unknown">0</EnumValue>
                <EnumValue name="Yes">1</EnumValue>
                <EnumValue name="No">2</EnumValue>
            </Enumeration>
        </column>
    </table>
    <table name="electid">
        <summary>Corresponds to the electid table in the database. Never editable by users.  We keep this table updated with new numbers as part of upgrades, so never edit this table as it will mess up our primary keys.  Helps with entering elecronic/payor id's as well as keeping track of the specific carrier requirements. Only used by the X12 format.</summary>
        <column order="0" name="ElectIDNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PayorID" type="varchar(255)">
            <summary>aka Electronic ID.  A simple string.</summary>
        </column>
        <column order="2" name="CarrierName" type="varchar(255)">
            <summary>As published. Not editable. Used when doing a search.</summary>
        </column>
        <column order="3" name="IsMedicaid" type="tinyint">
            <summary>True if medicaid. Then, the billing and treating providers will have their Medicaid ID's attached.</summary>
        </column>
        <column order="4" name="ProviderTypes" type="varchar(255)">
            <summary>Integers separated by commas. Each int represents a ProviderSupplementalID type that is required by this insurance. Usually only used for BCBS or other carriers that require supplemental provider id's.  Even if we don't put the supplemental types in here, the user can still add them.  This just helps by doing an additional check for known required types.</summary>
        </column>
        <column order="5" name="Comments" type="text">
            <summary>Any comments. Usually includes enrollment requirements and descriptions of how to use the provider id's supplied by the carrier because they might call them by different names.</summary>
        </column>
    </table>
    <table name="emailattach">
        <summary>Keeps track of one file attached to an email.  Multiple files can be attached to an email using this method.</summary>
        <column order="0" name="EmailAttachNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="EmailMessageNum" type="int(11)" fk="emailmessage">
            <summary>FK to emailmessage.EmailMessageNum</summary>
        </column>
        <column order="2" name="DisplayedFileName" type="varchar(255)">
            <summary>The name of the file that shows on the email.  For example: tooth2.jpg.</summary>
        </column>
        <column order="3" name="ActualFileName" type="varchar(255)">
            <summary>The actual file is stored in the A-Z folder in EmailAttachments.  This field stores the name of the file.  The files are named automatically based on Date/time along with a random number.  This ensures that they will be sequential as well as unique.</summary>
        </column>
    </table>
    <table name="emailmessage">
        <summary>An outgoing email message is stored here.</summary>
        <column order="0" name="EmailMessageNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum</summary>
        </column>
        <column order="2" name="ToAddress" type="text">
            <summary>Single valid email address. Bcc field might be added later, although it won't be very useful.  We will never allow visible cc for privacy reasons.</summary>
        </column>
        <column order="3" name="FromAddress" type="text">
            <summary>Valid email address.</summary>
        </column>
        <column order="4" name="Subject" type="text">
            <summary>Subject line.</summary>
        </column>
        <column order="5" name="BodyText" type="text">
            <summary>Body of the email</summary>
        </column>
        <column order="6" name="MsgDateTime" type="datetime">
            <summary>Date and time the message was sent. Automated field.</summary>
        </column>
        <column order="7" name="SentOrReceived" type="tinyint">
            <summary>0=neither, 1=sent, 2=received.</summary>
        </column>
    </table>
    <table name="emailtemplate">
        <summary>A template email which can be used as the basis for a new email.</summary>
        <column order="0" name="EmailTemplateNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Subject" type="text">
            <summary>Default subject line.</summary>
        </column>
        <column order="2" name="BodyText" type="text">
            <summary>Body of the email</summary>
        </column>
    </table>
    <table name="employee">
        <summary>An employee at the dental office.</summary>
        <column order="0" name="EmployeeNum" type="smallint">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="LName" type="varchar(255)">
            <summary>Employee's last name.</summary>
        </column>
        <column order="2" name="FName" type="varchar(255)">
            <summary>First name.</summary>
        </column>
        <column order="3" name="MiddleI" type="varchar(255)">
            <summary>Middle initial or name.</summary>
        </column>
        <column order="4" name="IsHidden" type="tinyint">
            <summary>If hidden, the employee will not show on the list.</summary>
        </column>
        <column order="5" name="ClockStatus" type="varchar(255)">
            <summary>This is just text used to quickly display the clockstatus.  eg Working,Break,Lunch,Home, etc.</summary>
        </column>
    </table>
    <table name="employer">
        <summary>Most insurance plans are organized by employer.  This table keeps track of the list of employers.  The address fields were added at one point, but I don't know why they don't show in the program in order to edit.  Nobody has noticed their absence even though it's been a few years, so for now we are just using the EmpName and not the address.</summary>
        <column order="0" name="EmployerNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="EmpName" type="varchar(255)">
            <summary>Name of the employer.</summary>
        </column>
        <column order="2" name="Address" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="3" name="Address2" type="varchar(255)">
            <summary>Second line of address.</summary>
        </column>
        <column order="4" name="City" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="5" name="State" type="varchar(255)">
            <summary>2 char in the US.</summary>
        </column>
        <column order="6" name="Zip" type="varchar(255)">
            <summary>.</summary>
        </column>
        <column order="7" name="Phone" type="varchar(255)">
            <summary>Includes any punctuation.</summary>
        </column>
    </table>
    <table name="etrans">
        <summary>One electronic transaction.  Typically, one claim or response.  Will later be expanded to include many other types of transactions with clearinghouses, such as eligibility, reports, etc.  Also stores printing of paper claims.  Sometimes stores a copy of what was sent.</summary>
        <column order="0" name="EtransNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="DateTimeTrans" type="datetime">
            <summary>The date and time of the transaction.</summary>
        </column>
        <column order="2" name="ClearinghouseNum" type="int(11)" fk="clearinghouse">
            <summary>FK to clearinghouse.ClearinghouseNum .  Can be 0 if no clearinghouse was involved.</summary>
        </column>
        <column order="3" name="Etype" type="tinyint">
            <summary>Enum:EtransType</summary>
            <Enumeration name="EtransType">
                <summary>The _CA of some types should get stripped off when displaying to users.</summary>
                <EnumValue name="ClaimSent">0 X12-837</EnumValue>
                <EnumValue name="ClaimPrinted">1 claim</EnumValue>
                <EnumValue name="Claim_CA">2 Canada. Type 01</EnumValue>
                <EnumValue name="Claim_Ren">3 Renaissance</EnumValue>
                <EnumValue name="ClaimAck_CA">4 Canada. Type 11</EnumValue>
                <EnumValue name="ClaimEOB_CA">5 Canada. Type 21</EnumValue>
                <EnumValue name="Eligibility_CA">6 Canada. Type 08</EnumValue>
                <EnumValue name="EligResponse_CA">7 Canada. Type 18</EnumValue>
                <EnumValue name="ClaimReversal_CA">8 Canada. Type 02</EnumValue>
                <EnumValue name="Predeterm_CA">9 Canada. Type 03</EnumValue>
                <EnumValue name="RequestOutstand_CA">10 Canada. Type 04</EnumValue>
                <EnumValue name="RequestSumm_CA">11 Canada. Type 05</EnumValue>
                <EnumValue name="RequestPay_CA">12 Canada. Type 06</EnumValue>
                <EnumValue name="ClaimCOB_CA">13 Canada. Type 07</EnumValue>
                <EnumValue name="ReverseResponse_CA">14 Canada. Type 12</EnumValue>
                <EnumValue name="PredetermAck_CA">15 Canada. Type 13</EnumValue>
                <EnumValue name="PredetermEOB_CA">16 Canada. Type 23</EnumValue>
                <EnumValue name="OutstandingAck_CA">17 Canada. Type 14</EnumValue>
                <EnumValue name="EmailResponse_CA">18 Canada. Type 24</EnumValue>
                <EnumValue name="PaymentResponse_CA">19 Canada. Type 16</EnumValue>
                <EnumValue name="SummaryResponse_CA">20 Canada. Type 15</EnumValue>
                <EnumValue name="Acknowledge_997">21 Ack from clearinghouse. X12-997.</EnumValue>
                <EnumValue name="StatusNotify_277">22 X12-277. Unsolicited claim status notification.</EnumValue>
                <EnumValue name="TextReport">23 Text report from clearinghouse in human readable format.</EnumValue>
            </Enumeration>
        </column>
        <column order="4" name="ClaimNum" type="int(11)" fk="claim">
            <summary>FK to claim.ClaimNum if a claim. Otherwise 0.  Warning.  Original claim might have been deleted.  But if Canadian claim was successfully sent, then deletion will be blocked.</summary>
        </column>
        <column order="5" name="OfficeSequenceNumber" type="int(11)">
            <summary>For Canada.  Unique for every transaction sent.  Increments by one until 999999, then resets to 1.</summary>
        </column>
        <column order="6" name="CarrierTransCounter" type="int(11)">
            <summary>For Canada.  Separate counter for each carrier.  Increments by one until 99999, then resets to 1.</summary>
        </column>
        <column order="7" name="CarrierTransCounter2" type="int(11)">
            <summary>For Canada.  If this claim includes secondary, then this is the counter for the secondary carrier.</summary>
        </column>
        <column order="8" name="CarrierNum" type="int(11)" fk="carrier">
            <summary>FK to carrier.CarrierNum.</summary>
        </column>
        <column order="9" name="CarrierNum2" type="int(11)" fk="carrier">
            <summary>FK to carrier.CarrierNum Only used if secondary insurance info is provided on a claim.  Necessary for Canada.</summary>
        </column>
        <column order="10" name="PatNum" type="int(11)">
            <summary>This is useful in case the original claim has been deleted.  Now, we can still tell who the patient was.</summary>
        </column>
        <column order="11" name="MessageText" type="text">
            <summary>Whether outgoing or incoming, this field contains the actual text of the message.  When there is a batch, this field will contain the text of the entire batch.  Other claims will be mixed in.  The same text will be duplicated in the MessageText fields on the other claims.</summary>
        </column>
        <column order="12" name="BatchNumber" type="int(11)">
            <summary>Maxes out at 999, then loops back to 1.  This is not a good key, but is a restriction of (canadian?).  So dates must also be used to isolate the correct BatchNumber key.  Specific to one clearinghouse.  Only used with e-claims.  Claim will have BatchNumber, and 997 will have matching BatchNumber. (In X12 lingo, it's a functional group number)</summary>
        </column>
        <column order="13" name="AckCode" type="varchar(255)">
            <summary>A=Accepted, R=Rejected, blank if not able to parse.  More options will be added later.  The incoming 997 sets this flag automatically.  To find the 997, look for a matching BatchNumber with a similar date, since both the claims and the 997 will both have the same batch number.  The 997 does not have this flag set on itself.</summary>
        </column>
        <column order="14" name="TransSetNum" type="int(11)">
            <summary>For sent e-claims, within each batch (functional group), each carrier gets it's own transaction set.  Since 997s acknowledge transaction sets rather than batches, we need to keep track of which transaction set each claim is part of as well as which batch it's part of.  This field can't be set as part of 997, because one 997 refers to multiple trans sets.</summary>
        </column>
        <column order="15" name="Note" type="text">
            <summary>Typical uses include indicating that report was printed, claim was resent, reason for rejection, etc.</summary>
        </column>
    </table>
    <table name="fee">
        <summary>There is one entry in this table for each fee for a single procedurecode.  So if there are 5 different fees stored for one procedurecode, then there will be five entries here.</summary>
        <column order="0" name="FeeNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Amount" type="double">
            <summary>The amount usually charged.  If an amount is unknown, then the entire Fee entry is deleted from the database.  The absence of a fee is sometimes shown in the user interface as a blank entry, and sometimes as 0.00.</summary>
        </column>
        <column order="2" name="OldCode" type="varchar(15)">
            <summary>Do not use.</summary>
        </column>
        <column order="3" name="FeeSched" type="smallint" fk="definition">
            <summary>FK to definition.DefNum.</summary>
        </column>
        <column order="4" name="UseDefaultFee" type="tinyint">
            <summary>Not used.</summary>
        </column>
        <column order="5" name="UseDefaultCov" type="tinyint">
            <summary>Not used.</summary>
        </column>
        <column order="6" name="CodeNum" type="int(11)" fk="procedurecode">
            <summary>FK to procedurecode.CodeNum.</summary>
        </column>
    </table>
    <table name="files">
        <summary>As an alternative to storing files in the os file system, they may be stored here, in the database.</summary>
        <column order="0" name="DocNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Data" type="longblob">
            <summary>longblob</summary>
        </column>
        <column order="2" name="Thumbnail" type="longblob">
            <summary>longblob</summary>
        </column>
    </table>
    <table name="formpat">
        <summary>One form or questionnaire filled out by a patient.  Each patient can have multiple forms.</summary>
        <column order="0" name="FormPatNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="PatNum" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum.</summary>
        </column>
        <column order="2" name="FormDateTime" type="datetime">
            <summary>The date and time that this questionnaire was filled out.</summary>
        </column>
    </table>
    <table name="graphicassembly">
        <summary></summary>
        <column order="0" name="GAssemblyNum" type="smallint">
            <summary></summary>
        </column>
        <column order="1" name="GTypeNum" type="smallint">
            <summary></summary>
        </column>
        <column order="2" name="GElementNum" type="smallint">
            <summary></summary>
        </column>
    </table>
    <table name="graphicelement">
        <summary></summary>
        <column order="0" name="GElementNum" type="smallint">
            <summary></summary>
        </column>
        <column order="1" name="ToothNum" type="varchar(2)">
            <summary></summary>
        </column>
        <column order="2" name="Description" type="varchar(100)">
            <summary></summary>
        </column>
        <column order="3" name="Surface" type="varchar(5)">
            <summary></summary>
        </column>
        <column order="4" name="ZOrder" type="smallint">
            <summary></summary>
        </column>
    </table>
    <table name="graphicpoint">
        <summary></summary>
        <column order="0" name="GPointNum" type="int(11)">
            <summary></summary>
        </column>
        <column order="1" name="GShapeNum" type="smallint">
            <summary></summary>
        </column>
        <column order="2" name="XPos" type="smallint">
            <summary></summary>
        </column>
        <column order="3" name="YPos" type="smallint">
            <summary></summary>
        </column>
        <column order="4" name="ItemOrder" type="smallint">
            <summary></summary>
        </column>
    </table>
    <table name="graphicshape">
        <summary></summary>
        <column order="0" name="GShapeNum" type="smallint">
            <summary></summary>
        </column>
        <column order="1" name="GElementNum" type="smallint">
            <summary></summary>
        </column>
        <column order="2" name="ShapeType" type="char(1)">
            <summary></summary>
        </column>
        <column order="3" name="Description" type="varchar(100)">
            <summary></summary>
        </column>
    </table>
    <table name="graphictype">
        <summary></summary>
        <column order="0" name="GTypeNum" type="smallint">
            <summary></summary>
        </column>
        <column order="1" name="Description" type="varchar(100)">
            <summary></summary>
        </column>
        <column order="2" name="ItemOrder" type="smallint">
            <summary></summary>
        </column>
        <column order="3" name="BrushType" type="varchar(100)">
            <summary></summary>
        </column>
        <column order="4" name="IsSameEachTooth" type="tinyint">
            <summary></summary>
        </column>
        <column order="5" name="IsHidden" type="tinyint">
            <summary></summary>
        </column>
        <column order="6" name="SpecialType" type="varchar(100)">
            <summary></summary>
        </column>
    </table>
    <table name="grouppermission">
        <summary>Every user group has certain permissions.  This defines a permission for a group.  The absense of permission would cause that row to be deleted from this table.</summary>
        <column order="0" name="GroupPermNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="NewerDate" type="date">
            <summary>Only granted permission if newer than this date.  Can be Minimum (01-01-0001) to always grant permission.</summary>
        </column>
        <column order="2" name="NewerDays" type="int(11)">
            <summary>Can be 0 to always grant permission.  Otherwise, only granted permission if item is newer than the given number of days.  1 would mean only if entered today.</summary>
        </column>
        <column order="3" name="UserGroupNum" type="int(11)" fk="usergroup">
            <summary>FK to usergroup.UserGroupNum.  The user group for which this permission is granted.  If not authorized, then this groupPermission will have been deleted.</summary>
        </column>
        <column order="4" name="PermType" type="tinyint">
            <summary>Enum:Permissions</summary>
            <Enumeration name="Permissions">
                <summary>A hard-coded list of permissions which may be granted to usergroups.</summary>
                <EnumValue name="None">0</EnumValue>
                <EnumValue name="AppointmentsModule">1</EnumValue>
                <EnumValue name="FamilyModule">2</EnumValue>
                <EnumValue name="AccountModule">3</EnumValue>
                <EnumValue name="TPModule">4</EnumValue>
                <EnumValue name="ChartModule">5</EnumValue>
                <EnumValue name="ImagesModule">6</EnumValue>
                <EnumValue name="ManageModule">7</EnumValue>
                <EnumValue name="Setup">8. Currently covers a wide variety of setup functions.</EnumValue>
                <EnumValue name="RxCreate">9</EnumValue>
                <EnumValue name="ProcComplEdit">10</EnumValue>
                <EnumValue name="ChooseDatabase">11</EnumValue>
                <EnumValue name="Schedules">12</EnumValue>
                <EnumValue name="Blockouts">13</EnumValue>
                <EnumValue name="ClaimsSentEdit">14</EnumValue>
                <EnumValue name="PaymentCreate">15</EnumValue>
                <EnumValue name="PaymentEdit">16</EnumValue>
                <EnumValue name="AdjustmentCreate">17</EnumValue>
                <EnumValue name="AdjustmentEdit">18</EnumValue>
                <EnumValue name="UserQuery">19</EnumValue>
                <EnumValue name="StartupSingleUserOld">20.  Not used anymore.</EnumValue>
                <EnumValue name="StartupMultiUserOld">21 Not used anymore.</EnumValue>
                <EnumValue name="Reports">22</EnumValue>
                <EnumValue name="ProcComplCreate">23. Includes setting procedures complete.</EnumValue>
                <EnumValue name="SecurityAdmin">24. At least one user must have this permission.</EnumValue>
                <EnumValue name="AppointmentCreate">25</EnumValue>
                <EnumValue name="AppointmentMove">26</EnumValue>
                <EnumValue name="AppointmentEdit">27</EnumValue>
                <EnumValue name="Backup">28</EnumValue>
                <EnumValue name="TimecardsEditAll">29</EnumValue>
                <EnumValue name="DepositSlips">30</EnumValue>
                <EnumValue name="AccountingEdit">31</EnumValue>
                <EnumValue name="AccountingCreate">32</EnumValue>
                <EnumValue name="Accounting">33</EnumValue>
            </Enumeration>
        </column>
    </table>
    <table name="insplan">
        <summary>There is a separate insplan in this table for each subscriber.  Subscribers never share insplans, although multiple patients can have the plan assigned to them (with the one subscriber).  But plans can have identical information in them as other plans.  In this case, they are considered similar or identical, and some synchronization can be done.  For some offices, this synchronization will be extensive, with hundreds of identical insplans.</summary>
        <column order="0" name="PlanNum" type="int(11)">
            <summary>Primary key.</summary>
        </column>
        <column order="1" name="Subscriber" type="int(11)" fk="patient">
            <summary>FK to patient.PatNum.</summary>
        </column>
        <column order="2" name="DateEffective" type="date">
            <summary>Date plan became effective.</summary>
        </column>
        <column order="3" name="DateTerm" type="date">
            <summary>Date plan was terminated</summary>
        </column>
        <column order="4" name="GroupName" type="varchar(50)">
            <summary>Optional</summary>
        </column>
        <column order="5" name="GroupNum" type="varchar(20)">
            <summary>Optional.  In Canada, this is called the Plan Number.</summary>
        </column>
        <column order="6" name="PlanNote" type="text">
            <summary>Note for all plans identical to this one.  Always stays in synch with other identical plans regardless of user actions.  If they change it on one, it gets changed on all.</summary>
        </column>
        <column order="7" name="FeeSched" type="smallint" fk="definition">
            <summary>FK to definition.DefNum.  Name of fee schedule is stored in definition.ItemName.</summary>
        </column>
        <column order="8" name="ReleaseInfo" type="tinyint">
            <summary>Release of information signature is on file.</summary>
        </column>
        <column order="9" name="AssignBen" type="tinyint">
            <summary>Assignment of benefits signature is on file.</summary>
        </column>
        <column order="10" name="PlanType" type="char(1)">
            <summary>""=percentage(the default),"p"=ppo_percentage,"f"=flatCopay,"c"=capitation.</summary>
        </column>
        <column order="11" name="ClaimFormNum" type="smallint" fk="claimform">
            <summary>FK to claimform.ClaimFormNum. eg. "1" for ADA2002.  For ADA2006, it varies by office.</summary>
        </column>
        <column order="12" name="UseAltCode" type="tinyint">
            <summary>0=no,1=yes.  could later be extended if more alternates required</summary>
        </column>
        <column order="13" name="ClaimsUseUCR" type="tinyint">
            <summary>Fee billed on claim should be the UCR fee for the patient's provider.</summary>
        </column>
        <column order="14" name="CopayFeeSched" type="smallint" fk="definition">
            <summary>FK to definition.DefNum. Not usually used. This fee schedule holds only co-pays(patient portions).  Only used for Capitation or for fixed copay plans.</summary>
        </column>
        <column order="15" name="SubscriberID" type="varchar(40)">
            <summary>Usually SSN, but can also be changed by user.  No dashes. Not allowed to be blank.</summary>
        </column>
        <column order="16" name="EmployerNum" type="int(11)" fk="employer">
            <summary>FK to employer.EmployerNum.</summary>
        </column>
        <column order="17" name="CarrierNum" type="int(11)" fk="carrier">
            <summary>FK to carrier.CarrierNum.</summary>
        </column>
        <column order="18" name="AllowedFeeSched" type="smallint" fk="Definition">
            <summary>FK to Definition.DefNum. Not usually used.  This fee schedule holds amounts allowed by carriers.</summary>
        </column>
        <column order="19" name="TrojanID" type="varchar(100)">
            <summary>.</summary>
        </column>
        <column order="20" name="DivisionNo" type="varchar(255)">
            <summary>Only used in Canada. It's a suffix to the plan number (group number).</summary>
        </column>
        <column order="21" name="BenefitNotes" type="text">
            <summary>User doesn't usually put these in.  Only used when automatically requesting benefits, such as with Trojan.  All the benefits get stored here in text form for later reference.  Specific to one plan and not synchronized because might be specific to subscriber.  If blank, we might add a function to try to find any benefitNote for a similar plan.</summary>
        </column>
        <column order="22" name="IsMedical" type="tinyint">
            <summary>True if this is medical insurance rather than dental insurance.</summary>
        </column>
        <column order="23