﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type='text/xsl' href='OpenDentalDocumentation.xsl'?>
<database version="26.1.0.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="bigint(20)">
      <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>
    <column order="6" name="IsRetainedEarnings" type="tinyint(4)">
      <summary>This will be set true for exactly one account, and it can't be changed.  On the Balance Sheet report, this special account will also contain the sum of all expenses and income for all previous years.</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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PayType" type="bigint(20)" 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="activeinstance">
    <summary>ActiveInstances are used to track OD sessions.</summary>
    <column order="0" name="ActiveInstanceNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="ComputerNum" type="bigint(20)">
      <summary>FK to Computers.ComputerNum</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to Userod.UserNum</summary>
    </column>
    <column order="3" name="ProcessId" type="bigint(20)">
      <summary>Windows Process ID of the Open Dental instance</summary>
    </column>
    <column order="4" name="DateTimeLastActive" type="datetime">
      <summary>Last datetime that was activity was recorded</summary>
    </column>
    <column order="5" name="DateTRecorded" type="datetime">
      <summary>The time at which we recorded DateTimeLastActive. This is not a TimeStamp column because we need to update it even if nothing else in the row changed.</summary>
    </column>
    <column order="6" name="ConnectionType" type="tinyint(4)">
      <summary>Enum:ConnectionTypes Used to distinguish the connection type.</summary>
      <Enumeration name="ConnectionTypes">
        <summary></summary>
        <EnumValue name="Direct">0 - Direct</EnumValue>
        <EnumValue name="MiddleTier">1 - MiddleTier</EnumValue>
        <EnumValue name="Thinfinity">2 - Thinfinity</EnumValue>
        <EnumValue name="AppStream">3 - AppStream</EnumValue>
      </Enumeration>
    </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="bigint(20)">
      <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="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="4" name="AdjType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.</summary>
    </column>
    <column order="5" name="ProvNum" type="bigint(20)" 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.</summary>
    </column>
    <column order="8" name="ProcNum" type="bigint(20)" 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>
    <column order="10" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="11" name="StatementNum" type="bigint(20)" fk="statement">
      <summary>FK to statement.StatementNum.  Only used when the statement in an invoice.</summary>
    </column>
    <column order="12" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="13" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="14" name="TaxTransID" type="bigint(20)">
      <summary>(Deprecated) Holds the Avalara transaction ID associated with this adjustment so that we can track reported adjustments.
            Not editable in the UI.</summary>
    </column>
  </table>
  <table name="alertcategory">
    <summary>A grouping of alert types that you can subscribe to. The alert types are stored as AlertCategoryLink rows attached to each category. Users can make their own custom categories by copying existing ones.</summary>
    <column order="0" name="AlertCategoryNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="IsHQCategory" type="tinyint(4)">
      <summary>False by default, indicates that this is a category that can not be edited or deleted. When a copy of a category is made, the copy changes this value from true to false.</summary>
    </column>
    <column order="2" name="InternalName" type="varchar(255)">
      <summary>Name used by HQ to identify the type of alert category this started as, allows us to associate new alerts.</summary>
    </column>
    <column order="3" name="Description" type="varchar(255)">
      <summary>Name displayed to user when subscribing to alerts categories.</summary>
    </column>
  </table>
  <table name="alertcategorylink">
    <summary>Each row is an alert type for an alertcategory. Users can change which types are attached to custom categories.</summary>
    <column order="0" name="AlertCategoryLinkNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AlertCategoryNum" type="bigint(20)" fk="alertcategory">
      <summary>FK to AlertCategory.AlertCategoryNum.</summary>
    </column>
    <column order="2" name="AlertType" type="tinyint(4)">
      <summary>Enum:AlertType Identifies what types of alert this row is associated to.</summary>
      <Enumeration name="AlertType">
        <summary>Enum representing different alert types. Any additional entries to this enum will need to be linked to the AlertCategory table. Do so in ConvertDatabases#. There will be one link to this type's specific category and one link to AlertCategory with InternalName 'OdAllTypes'.</summary>
        <EnumValue name="Generic">0 - Generic. Informational, has no action associated with it</EnumValue>
        <EnumValue name="OnlinePaymentsPending">1 - Opens the Online Payments Window when clicked</EnumValue>
        <EnumValue name="VoiceMailMonitor">2 - Only used by Open Dental HQ. The server monitoring incoming voicemails is not working.</EnumValue>
        <EnumValue name="RadiologyProcedures">3 - Opens the Radiology Order List window when clicked.</EnumValue>
        <EnumValue name="CallbackRequested">4 - A patient has clicked "Request Callback" on an e-Confirmation.</EnumValue>
        <EnumValue name="WebSchedNewPat">5 - Alerts related to the Web Sched New Pat eService.</EnumValue>
        <EnumValue name="WebSchedNewPatApptCreated">6 - Alerts related to Web Sched New Patient Appointments.</EnumValue>
        <EnumValue name="NumberBarredFromTexting">7 - A number is not able to receive text messages.</EnumValue>
        <EnumValue name="MaxConnectionsMonitor">8 - The number of MySQL connections to the server has exceeded half the allowed number of connections.</EnumValue>
        <EnumValue name="WebSchedASAPApptCreated">9 - Alerts related to new ASAP appointments via web sched.</EnumValue>
        <EnumValue name="AsteriskServerMonitor">10 - Only used by Open Dental HQ. The Asterisk Server is not processing messages or is getting all blank payloads.</EnumValue>
        <EnumValue name="MultipleEConnectors">11 - Multiple computers are running eConnector services. There should only ever be one.</EnumValue>
        <EnumValue name="EConnectorDown">12 - The eConnector is in a critical state and not currently turned on. There should only ever be one.</EnumValue>
        <EnumValue name="EConnectorError">13 - The eConnector has an error that is not critical but is worth looking into. There should only ever be one.</EnumValue>
        <EnumValue name="DoseSpotProviderRegistered">14 - Alerts related to DoseSpot provider registration.</EnumValue>
        <EnumValue name="DoseSpotClinicRegistered">15 - Alerts related to DoseSpot clinic registration.</EnumValue>
        <EnumValue name="WebSchedRecallApptCreated">16 - An appointment has been created via Web Sched Recall.</EnumValue>
        <EnumValue name="ClinicsChanged">17 - Alerts related to turning clinics on or off for eServices.</EnumValue>
        <EnumValue name="ClinicsChangedInternal">18 - Alerts related to turning clinics on or off for eServices. Internal, not displayed to the customer.
            Will be processed by the eConnector and then deleted.</EnumValue>
        <EnumValue name="MultipleOpenDentalServices">19 - Multiple computers are running OpenDentalServices. There should only ever be one.</EnumValue>
        <EnumValue name="OpenDentalServiceDown">20 - OpenDentalService is down.</EnumValue>
        <EnumValue name="WebMailReceived">21 - Triggered when a new WebMail is received from the patient portal.</EnumValue>
        <EnumValue name="EconnectorEmailTooManySendFails">22 - Triggered when the consecutive count of failed emails for clinic reaches greater than the value set in 
            EmailAlertMaxConsecutiveFails preference.</EnumValue>
        <EnumValue name="SupplementalBackups">23 - Alert the user for things like not making a local supplemental backup within the last month.</EnumValue>
        <EnumValue name="EConnectorMySqlTime">24 - Alert the user that the local time on the eConnector does not closely match the time of the database.  Intended to only have
            one instance max.</EnumValue>
        <EnumValue name="CareCreditBatchError">25 - Alert the user that there are CareCredit batch errors.</EnumValue>
        <EnumValue name="PatientArrival">26 - Alert the user that there are patients who have texted to indicate they have arrived for their appointment.</EnumValue>
        <EnumValue name="EmailSecure">27 - Alert the user that there are new secure emails that have been downloaded.</EnumValue>
        <EnumValue name="WebSchedExistingPatApptCreated">28 - An appointment has been created via Web Sched Exising Pat</EnumValue>
        <EnumValue name="CloudAlertWithinLimit">29 - Alert the user when they're approaching their Cloud Session Limit (determined by CloudAlertWithinLimit pref)</EnumValue>
        <EnumValue name="WebFormsReady">30 - Alert that web forms are ready to be retrieved.</EnumValue>
        <EnumValue name="PushHubDown">31 - Alert HQ that a push hub client has reached its failure threshold or all push hub clients are failing</EnumValue>
        <EnumValue name="Update">32 - Alert that user action is required after an update.</EnumValue>
        <EnumValue name="ReplicationMonitor">33 - Alert.</EnumValue>
        <EnumValue name="WebSchedRecallsNotSending">34 - Alert that no recalls have sent in a period of time.</EnumValue>
        <EnumValue name="TenDlc">35 - Alert if an account using 10DLC goes over their daily max limit or if we've neglected to set up our pref correctly</EnumValue>
        <EnumValue name="AddToCalendar">36 - Alert if a clinic is not signed for eConfirmations but is trying to use the AddToCalendar tag. FKey on this alert type is used to determine
            the type of autocomm that created this alert rather than a FKey to a db row.</EnumValue>
        <EnumValue name="EConnectorRedistributableMissing">37 - Alert that is created when an eClipboard/ODM/ODT device tries to get a tooth chart image, but their eConn server is missing 
            a specific redistributable that allows the creation of the image.</EnumValue>
        <EnumValue name="SMSThread">38 - Alert that is created when the SMSQueuer is turned on but no Broadcaster Servers are configured to send out text messages. Requires Engineers to update BroadcasterThreadSettings.</EnumValue>
        <EnumValue name="SignatureCleared">39 - Alert that is created when a procedure or group note's signature is cleared by another user editing that note.</EnumValue>
        <EnumValue name="Pearl">40 - Alert that is created when an error occurs while uploading an image to Pearl or processing Pearl results.</EnumValue>
        <EnumValue name="BetterDiagnostics">41 - Alert that is created when an error occurs while uploading an image to BetterDiagnostics or processing BetterDiagnostics results.</EnumValue>
        <EnumValue name="MessageToPayTag">42 - Alert that is created when running Billing and both email and SMS templates do not contain [MsgToPayURL] replacement tag.</EnumValue>
        <EnumValue name="MassEmailUpload">43 - Alert that is created while a mass email audience is being uploaded.</EnumValue>
        <EnumValue name="MassEmailReceipt">44 - Alert that commlogs have been created for a sent mass email.</EnumValue>
        <EnumValue name="HQNotification">45 - Alert that is created by HQ to send a notification to specific customers.</EnumValue>
        <EnumValue name="TreatmentPlanImagesFolderInaccesible">46 - Alert that is created when the eConnector is unable to gain access to or cannot find the images folder when saving Signed Treatment Plan PDFs for ODTouch or eClipboard.</EnumValue>
        <EnumValue name="PaymentPlanImagesFolderInaccesible">47 - Alert that is created when the eConnector is unable to gain access to or cannot find the images folder when saving Signed Payment Plan PDFs for ODTouch or eClipboard.</EnumValue>
        <EnumValue name="CannotCreateOrAccessPatientFolder">48 - Alert that is created when unable to create or access a Patient folder in the images folder for ODTouch or eClipboard.</EnumValue>
        <EnumValue name="DefaultEmailNotSet">49 - Alert that is created when there is no default email address set for an office that is subscribed to an eService that uses email.</EnumValue>
        <EnumValue name="PaySuite">50 - Alert that is created when the OpenDentalService processes PaySuitePayments.</EnumValue>
        <EnumValue name="EServiceListenerError">51 - Alert that is created when the EServiceListener has encountered an error. usually when it cannot open inbound firewall ports.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="alertitem">
    <summary>Any row in this table will show up in the main menu of Open Dental to get the attention of the user. The user can click on the alert and take an action.  The actions available to the user are also determined in this row.</summary>
    <column order="0" name="AlertItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. Can be 0 or -1. -1 indicates show the alert in all clinics.</summary>
    </column>
    <column order="2" name="Description" type="varchar(2000)">
      <summary>What is displayed in the menu item.</summary>
    </column>
    <column order="3" name="Type" type="tinyint(4)">
      <summary>Enum:AlertType Identifies what type of alert this row is.</summary>
      <Enumeration name="AlertType">
        <summary>Enum representing different alert types. Any additional entries to this enum will need to be linked to the AlertCategory table. Do so in ConvertDatabases#. There will be one link to this type's specific category and one link to AlertCategory with InternalName 'OdAllTypes'.</summary>
        <EnumValue name="Generic">0 - Generic. Informational, has no action associated with it</EnumValue>
        <EnumValue name="OnlinePaymentsPending">1 - Opens the Online Payments Window when clicked</EnumValue>
        <EnumValue name="VoiceMailMonitor">2 - Only used by Open Dental HQ. The server monitoring incoming voicemails is not working.</EnumValue>
        <EnumValue name="RadiologyProcedures">3 - Opens the Radiology Order List window when clicked.</EnumValue>
        <EnumValue name="CallbackRequested">4 - A patient has clicked "Request Callback" on an e-Confirmation.</EnumValue>
        <EnumValue name="WebSchedNewPat">5 - Alerts related to the Web Sched New Pat eService.</EnumValue>
        <EnumValue name="WebSchedNewPatApptCreated">6 - Alerts related to Web Sched New Patient Appointments.</EnumValue>
        <EnumValue name="NumberBarredFromTexting">7 - A number is not able to receive text messages.</EnumValue>
        <EnumValue name="MaxConnectionsMonitor">8 - The number of MySQL connections to the server has exceeded half the allowed number of connections.</EnumValue>
        <EnumValue name="WebSchedASAPApptCreated">9 - Alerts related to new ASAP appointments via web sched.</EnumValue>
        <EnumValue name="AsteriskServerMonitor">10 - Only used by Open Dental HQ. The Asterisk Server is not processing messages or is getting all blank payloads.</EnumValue>
        <EnumValue name="MultipleEConnectors">11 - Multiple computers are running eConnector services. There should only ever be one.</EnumValue>
        <EnumValue name="EConnectorDown">12 - The eConnector is in a critical state and not currently turned on. There should only ever be one.</EnumValue>
        <EnumValue name="EConnectorError">13 - The eConnector has an error that is not critical but is worth looking into. There should only ever be one.</EnumValue>
        <EnumValue name="DoseSpotProviderRegistered">14 - Alerts related to DoseSpot provider registration.</EnumValue>
        <EnumValue name="DoseSpotClinicRegistered">15 - Alerts related to DoseSpot clinic registration.</EnumValue>
        <EnumValue name="WebSchedRecallApptCreated">16 - An appointment has been created via Web Sched Recall.</EnumValue>
        <EnumValue name="ClinicsChanged">17 - Alerts related to turning clinics on or off for eServices.</EnumValue>
        <EnumValue name="ClinicsChangedInternal">18 - Alerts related to turning clinics on or off for eServices. Internal, not displayed to the customer.
            Will be processed by the eConnector and then deleted.</EnumValue>
        <EnumValue name="MultipleOpenDentalServices">19 - Multiple computers are running OpenDentalServices. There should only ever be one.</EnumValue>
        <EnumValue name="OpenDentalServiceDown">20 - OpenDentalService is down.</EnumValue>
        <EnumValue name="WebMailReceived">21 - Triggered when a new WebMail is received from the patient portal.</EnumValue>
        <EnumValue name="EconnectorEmailTooManySendFails">22 - Triggered when the consecutive count of failed emails for clinic reaches greater than the value set in 
            EmailAlertMaxConsecutiveFails preference.</EnumValue>
        <EnumValue name="SupplementalBackups">23 - Alert the user for things like not making a local supplemental backup within the last month.</EnumValue>
        <EnumValue name="EConnectorMySqlTime">24 - Alert the user that the local time on the eConnector does not closely match the time of the database.  Intended to only have
            one instance max.</EnumValue>
        <EnumValue name="CareCreditBatchError">25 - Alert the user that there are CareCredit batch errors.</EnumValue>
        <EnumValue name="PatientArrival">26 - Alert the user that there are patients who have texted to indicate they have arrived for their appointment.</EnumValue>
        <EnumValue name="EmailSecure">27 - Alert the user that there are new secure emails that have been downloaded.</EnumValue>
        <EnumValue name="WebSchedExistingPatApptCreated">28 - An appointment has been created via Web Sched Exising Pat</EnumValue>
        <EnumValue name="CloudAlertWithinLimit">29 - Alert the user when they're approaching their Cloud Session Limit (determined by CloudAlertWithinLimit pref)</EnumValue>
        <EnumValue name="WebFormsReady">30 - Alert that web forms are ready to be retrieved.</EnumValue>
        <EnumValue name="PushHubDown">31 - Alert HQ that a push hub client has reached its failure threshold or all push hub clients are failing</EnumValue>
        <EnumValue name="Update">32 - Alert that user action is required after an update.</EnumValue>
        <EnumValue name="ReplicationMonitor">33 - Alert.</EnumValue>
        <EnumValue name="WebSchedRecallsNotSending">34 - Alert that no recalls have sent in a period of time.</EnumValue>
        <EnumValue name="TenDlc">35 - Alert if an account using 10DLC goes over their daily max limit or if we've neglected to set up our pref correctly</EnumValue>
        <EnumValue name="AddToCalendar">36 - Alert if a clinic is not signed for eConfirmations but is trying to use the AddToCalendar tag. FKey on this alert type is used to determine
            the type of autocomm that created this alert rather than a FKey to a db row.</EnumValue>
        <EnumValue name="EConnectorRedistributableMissing">37 - Alert that is created when an eClipboard/ODM/ODT device tries to get a tooth chart image, but their eConn server is missing 
            a specific redistributable that allows the creation of the image.</EnumValue>
        <EnumValue name="SMSThread">38 - Alert that is created when the SMSQueuer is turned on but no Broadcaster Servers are configured to send out text messages. Requires Engineers to update BroadcasterThreadSettings.</EnumValue>
        <EnumValue name="SignatureCleared">39 - Alert that is created when a procedure or group note's signature is cleared by another user editing that note.</EnumValue>
        <EnumValue name="Pearl">40 - Alert that is created when an error occurs while uploading an image to Pearl or processing Pearl results.</EnumValue>
        <EnumValue name="BetterDiagnostics">41 - Alert that is created when an error occurs while uploading an image to BetterDiagnostics or processing BetterDiagnostics results.</EnumValue>
        <EnumValue name="MessageToPayTag">42 - Alert that is created when running Billing and both email and SMS templates do not contain [MsgToPayURL] replacement tag.</EnumValue>
        <EnumValue name="MassEmailUpload">43 - Alert that is created while a mass email audience is being uploaded.</EnumValue>
        <EnumValue name="MassEmailReceipt">44 - Alert that commlogs have been created for a sent mass email.</EnumValue>
        <EnumValue name="HQNotification">45 - Alert that is created by HQ to send a notification to specific customers.</EnumValue>
        <EnumValue name="TreatmentPlanImagesFolderInaccesible">46 - Alert that is created when the eConnector is unable to gain access to or cannot find the images folder when saving Signed Treatment Plan PDFs for ODTouch or eClipboard.</EnumValue>
        <EnumValue name="PaymentPlanImagesFolderInaccesible">47 - Alert that is created when the eConnector is unable to gain access to or cannot find the images folder when saving Signed Payment Plan PDFs for ODTouch or eClipboard.</EnumValue>
        <EnumValue name="CannotCreateOrAccessPatientFolder">48 - Alert that is created when unable to create or access a Patient folder in the images folder for ODTouch or eClipboard.</EnumValue>
        <EnumValue name="DefaultEmailNotSet">49 - Alert that is created when there is no default email address set for an office that is subscribed to an eService that uses email.</EnumValue>
        <EnumValue name="PaySuite">50 - Alert that is created when the OpenDentalService processes PaySuitePayments.</EnumValue>
        <EnumValue name="EServiceListenerError">51 - Alert that is created when the EServiceListener has encountered an error. usually when it cannot open inbound firewall ports.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="Severity" type="tinyint(4)">
      <summary>Enum:SeverityType The severity will help determine what color this alert should be in the main menu.</summary>
      <Enumeration name="SeverityType">
        <summary>Represents the urgency of the alert.  Also determines the color for the menu item in the main menu.</summary>
        <EnumValue name="Normal">0 - White</EnumValue>
        <EnumValue name="Low">1 - Yellow</EnumValue>
        <EnumValue name="Medium">2 - Orange</EnumValue>
        <EnumValue name="High">3 - Red</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="Actions" type="tinyint(4)">
      <summary>Enum:ActionType Bitwise flag that represents what actions are available for this alert.</summary>
      <Enumeration name="ActionType">
        <summary>The possible actions that can be taken on this alert.  Multiple actions can be available for one alert.</summary>
        <EnumValue name="None"></EnumValue>
        <EnumValue name="MarkAsRead"></EnumValue>
        <EnumValue name="OpenForm"></EnumValue>
        <EnumValue name="Delete"></EnumValue>
        <EnumValue name="ShowItemValue"></EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="FormToOpen" type="tinyint(4)">
      <summary>Enum:FormType The form to open when the user clicks "Open Form".</summary>
      <Enumeration name="FormType">
        <summary>Add this.</summary>
        <EnumValue name="None">0 - No form.</EnumValue>
        <EnumValue name="FormEServicesWebSchedRecall">1 - FormEServicesWebSchedRecall.</EnumValue>
        <EnumValue name="FormOnlinePayments">2 - FormOnlinePayments.</EnumValue>
        <EnumValue name="FormRadOrderList">3 - FormRadOrderList.</EnumValue>
        <EnumValue name="FormEServicesSignupPortal">4 - FormEServicesSetup.</EnumValue>
        <EnumValue name="FormApptEdit">5 - FormEServicesSetup. FKey will be the AptNum of the appointment to open.</EnumValue>
        <EnumValue name="FormEServicesWebSchedNewPat">6 - FormEServicesSetup Web Sched New Pat.</EnumValue>
        <EnumValue name="FormWebSchedAppts">7 - FormWebSchedAppts.</EnumValue>
        <EnumValue name="FormPatientEdit">8 - FormPatientEdit. FKey will be PatNum.</EnumValue>
        <EnumValue name="FormEServicesEConnector">9 - FormEServicesSetup eConnector Service.</EnumValue>
        <EnumValue name="FormDoseSpotAssignUserId">10 - FormDoseSpotAssignUserId.</EnumValue>
        <EnumValue name="FormDoseSpotAssignClinicId">11 - FormDoseSpotAssignClinicId.</EnumValue>
        <EnumValue name="FormEmailInbox">12 - FormWebMailMessageEdit</EnumValue>
        <EnumValue name="FormEmailAddresses">13 - FormEmailAddresses</EnumValue>
        <EnumValue name="FormCareCreditTransactions">14 - FormCareCreditTransactions</EnumValue>
        <EnumValue name="FormCloudManagement">15 - FormCloudUserManagement</EnumValue>
        <EnumValue name="FormWebForms">16 - FormWebForms</EnumValue>
        <EnumValue name="FormModuleSetup">17 - FormModuleSetup</EnumValue>
        <EnumValue name="FormEServicesAutoMsging">18 - FormEServicesAutoMsging</EnumValue>
        <EnumValue name="FrmStatementSendSetup">19 - FrmStatementSendSetup</EnumValue>
        <EnumValue name="FormAdvertisingMassEmailUpload">20 - FormAdvertisingMassEmailUpload</EnumValue>
        <EnumValue name="FrmPaySuiteReconciliation">21 - FrmPaySuiteReconciliation</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="FKey" type="bigint(20)">
      <summary>A FK to a table associated with the AlertType.  0 indicates not in use.</summary>
    </column>
    <column order="8" name="ItemValue" type="varchar(4000)">
      <summary>Like description, but more specific. When set use ActionType.ShowItemValue to show this variable within a MsgBoxCopyPaste window.</summary>
    </column>
    <column order="9" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to Userod.UserNum.  Will only be shown to that specific user.  0 is all users.</summary>
    </column>
    <column order="10" name="SecDateTEntry" type="datetime">
      <summary>Date this row was added to the database. Not editable by the user</summary>
    </column>
  </table>
  <table name="alertread">
    <summary></summary>
    <column order="0" name="AlertReadNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AlertItemNum" type="bigint(20)" fk="alertitem">
      <summary>FK to alertitem.AlertItemNum.</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
  </table>
  <table name="alertsub">
    <summary>Subscribes a user and optional clinic to specific alert types.  Users will not get alerts unless they have an entry in this table.</summary>
    <column order="0" name="AlertSubNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. Can be 0.</summary>
    </column>
    <column order="3" name="Type" type="tinyint(4)">
      <summary>Deprecated.</summary>
    </column>
    <column order="4" name="AlertCategoryNum" type="bigint(20)" fk="alertcategory">
      <summary>FK to alertcategory.AlertCategoryNum.</summary>
    </column>
  </table>
  <table name="allergy">
    <summary>An allergy attached to a patient and linked to an AllergyDef.</summary>
    <column order="0" name="AllergyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AllergyDefNum" type="bigint(20)" fk="allergydef">
      <summary>FK to allergydef.AllergyDefNum</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="3" name="Reaction" type="varchar(255)">
      <summary>Adverse reaction description.  When importing from eForms, this is where the allergy name goes for "Other" when there's no match.</summary>
    </column>
    <column order="4" name="StatusIsActive" type="tinyint(4)">
      <summary>True if still an active allergy.  False helps hide it from the list of active allergies.</summary>
    </column>
    <column order="5" name="DateTStamp" type="timestamp">
      <summary>To be used for synch with web server for CertTimelyAccess.</summary>
    </column>
    <column order="6" name="DateAdverseReaction" type="date">
      <summary>The historical date that the patient had the adverse reaction to this agent.</summary>
    </column>
    <column order="7" name="SnomedReaction" type="varchar(255)">
      <summary>Snomed code for reaction.  Optional and independent of the Reaction text field.  Not needed for reporting.  Only used for CCD export/import.</summary>
    </column>
  </table>
  <table name="allergydef">
    <summary>An allergy definition.  Gets linked to an allergy and patient.  Allergies will not show in CCD messages unless they have a valid Medication (that has an RxNorm) or UniiCode.</summary>
    <column order="0" name="AllergyDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Name of the drug.  User can change this.  If an RxCui is present, the RxNorm string can be pulled from the in-memory table for UI display in addition to the Description.</summary>
    </column>
    <column order="2" name="IsHidden" type="tinyint(4)">
      <summary>Because user can't delete.</summary>
    </column>
    <column order="3" name="DateTStamp" type="timestamp">
      <summary>The last date and time this row was altered.  Not user editable.</summary>
    </column>
    <column order="4" name="SnomedType" type="tinyint(4)">
      <summary>Enum:SnomedAllergy SNOMED Allergy Type Code.  Only used to create CCD in FormSummaryOfCare.</summary>
      <Enumeration name="SnomedAllergy">
        <summary></summary>
        <EnumValue name="None">0-No SNOMED allergy type code has been assigned.</EnumValue>
        <EnumValue name="AllergyToSubstance">1-Allergy to substance (disorder), code number 418038007.</EnumValue>
        <EnumValue name="DrugAllergy">2-Drug allergy (disorder), code number 416098002.</EnumValue>
        <EnumValue name="DrugIntolerance">3-Drug intolerance (disorder), code number 59037007.</EnumValue>
        <EnumValue name="FoodAllergy">4-Food allergy (disorder), code number 414285001.</EnumValue>
        <EnumValue name="FoodIntolerance">5-Food intolerance (disorder), code number 235719002.</EnumValue>
        <EnumValue name="AdverseReactions">6-Propensity to adverse reactions (disorder), code number 420134006.</EnumValue>
        <EnumValue name="AdverseReactionsToDrug">7-Propensity to adverse reactions to drug (disorder), code number 419511003</EnumValue>
        <EnumValue name="AdverseReactionsToFood">8-Propensity to adverse reactions to food (disorder), code number 418471000.</EnumValue>
        <EnumValue name="AdverseReactionsToSubstance">9-Propensity to adverse reactions to substance (disorder), code number 419199007.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="MedicationNum" type="bigint(20)" fk="medication">
      <summary>FK to medication.MedicationNum.  Optional, only used with CCD messages.</summary>
    </column>
    <column order="6" name="UniiCode" type="varchar(255)">
      <summary>The Unii code for the Allergen.  Optional, but there must be either a MedicationNum or a UniiCode.  Used to create CCD in FormSummaryOfCare, or set during CCD allergy reconcile.</summary>
    </column>
  </table>
  <table name="apikey">
    <summary>Used to keep track of Customer's API Key and Developer's name. Just a copy from OD HQ for convenience.</summary>
    <column order="0" name="APIKeyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CustApiKey" type="varchar(255)">
      <summary>Customer's API key.</summary>
    </column>
    <column order="2" name="DevName" type="varchar(255)">
      <summary>Developer's name, exactly as they entered it in FHIR developer portal.</summary>
    </column>
  </table>
  <table name="apisubscription">
    <summary>A subscription by an API client that requests events to be fired for db changes or ui actions. Events are currently sent blindly. In the future, we could support acking for db events, but not very useful for ui events.</summary>
    <column order="0" name="ApiSubscriptionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EndPointUrl" type="varchar(255)">
      <summary>This is the URL endpoint to which events will be sent. </summary>
    </column>
    <column order="2" name="Workstation" type="varchar(255)">
      <summary>Name of the workstation that will fire events. Blank if you want all workstations to fire events. </summary>
    </column>
    <column order="3" name="CustomerKey" type="varchar(255)">
      <summary>API Key the subscribing developer gave the customer. There can be multiple 3rd parties products for one database, each with their own key.</summary>
    </column>
    <column order="4" name="WatchTable" type="varchar(255)">
      <summary>Enum: EnumWatchTable, stored as string </summary>
    </column>
    <column order="5" name="PollingSeconds" type="int(11)">
      <summary>Frequency of database polling, in seconds. </summary>
    </column>
    <column order="6" name="UiEventType" type="varchar(255)">
      <summary>Enum: EnumApiUiEventType, stored as string.</summary>
    </column>
    <column order="7" name="DateTimeStart" type="datetime">
      <summary>When the subscription started. This gets updated each time db is polled so that it represents the start of the date range for the next polling.</summary>
    </column>
    <column order="8" name="DateTimeStop" type="datetime">
      <summary>When the subscription will expire. MinVal 01-01-0001 if no expiration. </summary>
    </column>
    <column order="9" name="Note" type="varchar(255)">
      <summary>.</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.  Also see histappointment, which keeps a historical record.</summary>
    <column order="0" name="AptNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" 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- Deprecated in 17.4.1. Use Appointment.Priority instead. </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.  There's not a hard limit on this.  When dragging, the max is 6.5 hours.  Within the AptEdit window, it can be set to 9 hours.</summary>
    </column>
    <column order="4" name="Confirmed" type="bigint(20)" 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="TimeLocked" type="tinyint(1)">
      <summary>If true, then the program will not attempt to reset the user's time pattern and length when adding or removing procedures.</summary>
    </column>
    <column order="6" name="Op" type="bigint(20)" 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="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="9" name="ProvHyg" type="bigint(20)" 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. Use a datetime range instad of DATE(AptDateTime) or TIME(AptDateTime) in any query to avoid slowness.</summary>
    </column>
    <column order="11" name="NextAptNum" type="bigint(20)" 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="bigint(20)" 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="IsNewPatient" type="tinyint">
      <summary>This is the first appoinment this patient has had at this office.  Somewhat automated.</summary>
    </column>
    <column order="14" name="ProcDescript" type="text">
      <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="15" name="Assistant" type="bigint(20)" fk="employee">
      <summary>FK to employee.EmployeeNum.  You can assign an assistant to the appointment.</summary>
    </column>
    <column order="16" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0 if no clinic.</summary>
    </column>
    <column order="17" name="IsHygiene" type="tinyint">
      <summary>Set true if this is a hygiene appt. This flag is frequently not set even when it is a hygiene appointment because some offices want the dentist color on the appointments.</summary>
    </column>
    <column order="18" name="DateTStamp" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program updates.  Not user editable.</summary>
    </column>
    <column order="19" name="DateTimeArrived" type="datetime">
      <summary>The date and time that the patient checked in.</summary>
    </column>
    <column order="20" name="DateTimeSeated" type="datetime">
      <summary>The date and time that the patient was seated in the chair in the operatory.</summary>
    </column>
    <column order="21" name="DateTimeDismissed" type="datetime">
      <summary>The date and time that the patient got up out of the chair.  Date is largely ignored since it should be the same as the appt.</summary>
    </column>
    <column order="22" name="InsPlan1" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum for the primary insurance plan at the time the appointment is set complete. May be 0. We can't tell later which subscriber is involved; only the plan.</summary>
    </column>
    <column order="23" name="InsPlan2" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum for the secoondary insurance plan at the time the appointment is set complete. May be 0. We can't tell later which subscriber is involved; only the plan.</summary>
    </column>
    <column order="24" name="DateTimeAskedToArrive" type="datetime">
      <summary>Date and time patient asked to arrive, or minval if patient not asked to arrive at a different time than appt.</summary>
    </column>
    <column order="25" name="ProcsColored" type="text">
      <summary>Stores XML for the procs colors</summary>
    </column>
    <column order="26" name="ColorOverride" type="int(11)">
      <summary>If set to anything but 0, then this will override the graphic color for the appointment.
            Typically set to the color of the corresponding appointment type (if one is set) or a color manually picked by the user.</summary>
    </column>
    <column order="27" name="AppointmentTypeNum" type="bigint(20)" fk="appointmenttype">
      <summary>FK to appointmenttype.AppointmentTypeNum. Make sure to update ColorOverride to the corresponding color associated to this appointment type when changing the appointment type.</summary>
    </column>
    <column order="28" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="29" name="SecDateTEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="30" name="Priority" type="tinyint(4)">
      <summary>Enum:ApptPriority 0 for normal appointments, 1 for ASAP.</summary>
      <Enumeration name="ApptPriority">
        <summary>Scheduling priority used by Appointments.</summary>
        <EnumValue name="Normal">0 - Default priority</EnumValue>
        <EnumValue name="ASAP">1 - Used to identify items for the ASAP list</EnumValue>
      </Enumeration>
    </column>
    <column order="31" name="ProvBarText" type="varchar(60)">
      <summary>Text that is superimposed on the provbar at the left of each appointment.  One character per 10 or 15 minute increment, not per 5 min.</summary>
    </column>
    <column order="32" name="PatternSecondary" type="varchar(255)">
      <summary>Time pattern, X for secondary provider time, / for spacing. Stored in 5 minute increments.  Converted as needed to 10 or 15 minute representations for display.  This could be Dr or Hyg, depending on if the IsHyg box is checked.  Does not have any effect on appointment length.  Probably same length as Pattern, but no guarantee.</summary>
    </column>
    <column order="33" name="SecurityHash" type="varchar(255)">
      <summary>Holds the salted hash of the following appointment fields: AptStatus, Confirmed, AptDateTime. </summary>
    </column>
    <column order="34" name="ItemOrderPlanned" type="int(11)">
      <summary>One-indexed order of patnum specific planned appointments. Column moved from the deprecated table plannedappt.</summary>
    </column>
    <column order="35" name="IsMirrored" type="tinyint(4)">
      <summary>If true, then this appointment will show a duplicate mirrored on the secondary provider's operatory. The length of the mirror will be based on the provider time set for the secondary provider, so it won't be the same size as the original. Default for new appointments is based on ApptMirrorSecondary. The mirrored appointments can be set to show/hide using ApptView.ShowMirroredAppts.</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="bigint(20)">
      <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="appointmenttype">
    <summary>Appointment type is used to override appointment color.  Might control other properties on appointments in the future.</summary>
    <column order="0" name="AppointmentTypeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AppointmentTypeName" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="2" name="AppointmentTypeColor" type="int(11)">
      <summary></summary>
    </column>
    <column order="3" name="ItemOrder" type="int(11)">
      <summary>0 based</summary>
    </column>
    <column order="4" name="IsHidden" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="5" name="Pattern" type="varchar(255)">
      <summary>Time pattern, X for Dr time, / for assist time. Stored in 5 minute increments.
            Convert as needed to 10 or 15 minute representations for display.
            Will be blank if the pattern should be dynamically calculated via the procedures found in CodeStr.</summary>
    </column>
    <column order="6" name="CodeStr" type="varchar(4000)">
      <summary>Comma delimited list of procedure codes.  E.g. T1234,T4321,N3214</summary>
    </column>
    <column order="7" name="CodeStrRequired" type="varchar(4000)">
      <summary>Comma delimited list of procedure codes that are required for this appt type.  E.g. T1234,T4321,N3214.</summary>
    </column>
    <column order="8" name="RequiredProcCodesNeeded" type="tinyint(4)">
      <summary>Enum:EnumRequiredProcCodesNeeded 0=None,1=AtLeastOne,2=All</summary>
      <Enumeration name="EnumRequiredProcCodesNeeded">
        <summary>Governs how many of the ProcCodes on an AppointmentType that are required on an appointment.</summary>
        <EnumValue name="None">No ProcCodes from CodeStrRequired are needed to schedule appointments of this AppointmentType.</EnumValue>
        <EnumValue name="AtLeastOne">At least one ProcCode from CodeStrRequired is needed to schedule appointments of this AppointmentType.</EnumValue>
        <EnumValue name="All">All ProcCodes from CodeStrRequired are needed to schedule appointments of this AppointmentType.</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="BlockoutTypes" type="varchar(255)">
      <summary>Comma delimited list of Blockout Types (definition.DefNums where definition.Category=25) this appointment type can be associated to.</summary>
    </column>
  </table>
  <table name="apptfield">
    <summary>These are custom fields added to appointments and managed by the user.</summary>
    <column order="0" name="ApptFieldNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum</summary>
    </column>
    <column order="2" name="FieldName" type="varchar(255)" fk="apptfielddef">
      <summary>FK to apptfielddef.FieldName.  The full name is shown here for ease of use when running queries.  But the user is only allowed to change fieldNames in the patFieldDef setup window.</summary>
    </column>
    <column order="3" name="FieldValue" type="text">
      <summary>Any text that the user types in.  Will later allow some automation.</summary>
    </column>
  </table>
  <table name="apptfielddef">
    <summary>These are the definitions for the custom patient fields added and managed by the user.</summary>
    <column order="0" name="ApptFieldDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FieldName" type="varchar(255)">
      <summary>The name of the field that the user will be allowed to fill in the appt edit window.  Duplicates are prevented.</summary>
    </column>
    <column order="2" name="FieldType" type="tinyint(4)">
      <summary>Enum:ApptFieldType Text=0,PickList=1</summary>
      <Enumeration name="ApptFieldType">
        <summary></summary>
        <EnumValue name="Text">0</EnumValue>
        <EnumValue name="PickList">1</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="PickList" type="text">
      <summary>The text that contains pick list values, each separated by \r\n.  Length 4000.</summary>
    </column>
    <column order="4" name="ItemOrder" type="int(11)">
      <summary>Zero based ordering for the items.</summary>
    </column>
  </table>
  <table name="apptgeneralmessagesent">
    <summary>When a general message is sent for an appointment a record of that send is stored here. This is used to prevent re-sends of the same message.</summary>
    <column order="0" name="ApptGeneralMessageSentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ApptNum" type="bigint(20)">
      <summary>If true then we need to consider the subject in an autocomm object</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="3" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum for the corresponding appointment.</summary>
    </column>
    <column order="4" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="5" name="TSPrior" type="bigint(20)">
      <summary>This was the TSPrior used to send this reminder. </summary>
    </column>
    <column order="6" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
    <column order="7" name="SendStatus" type="tinyint(4)">
      <summary>Indicates status of message.</summary>
    </column>
    <column order="8" name="ApptDateTime" type="datetime">
      <summary>The Date and time of the original appointment. We need this in case the appointment was moved and needs another reminder sent out.</summary>
    </column>
    <column order="9" name="MessageType" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="10" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="11" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</summary>
    </column>
    <column order="12" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
  </table>
  <table name="apptnewpatthankyousent">
    <summary>When a reminder is sent for an appointment a record of that send is stored here. Only want to send new patient thank yous once per patient.</summary>
    <column order="0" name="ApptNewPatThankYouSentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ApptNum" type="bigint(20)">
      <summary>Foreign key to the appointment represented by this AutoCommAppt.</summary>
    </column>
    <column order="2" name="ApptDateTime" type="datetime">
      <summary>The Date and time of the original appointment. We need this in case the appointment was moved and needs another reminder sent out.</summary>
    </column>
    <column order="3" name="ApptSecDateTEntry" type="datetime">
      <summary>The Date and time of the original appointment.</summary>
    </column>
    <column order="4" name="TSPrior" type="bigint(20)">
      <summary>This was the TSPrior used to send this reminder. </summary>
    </column>
    <column order="5" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
    <column order="6" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum for the corresponding appointment.</summary>
    </column>
    <column order="7" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="8" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
    <column order="9" name="DateTimeNewPatThankYouTransmit" type="datetime">
      <summary>Generated by OD. Timestamp when EConnector sent this ApptNewPatThankYouSent to HQ. Stored in local customer timezone.</summary>
    </column>
    <column order="10" name="ShortGUID" type="varchar(255)">
      <summary>Generated by HQ. Identifies this AutoCommGuid in future transactions between HQ and OD.</summary>
    </column>
    <column order="11" name="SendStatus" type="tinyint(4)">
      <summary>Indicates status of message.</summary>
    </column>
    <column order="12" name="MessageType" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="13" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="14" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="15" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</summary>
    </column>
  </table>
  <table name="apptreminderrule">
    <summary>This is called eServices Automated Messaging Rules in the UI. These are used to track the automated generation and sending of appointment reminders and confirmations. Users are allowed to define up to two reminders and one confirmation (per clinic). These can be sent out any number of Days, Hours, and/or Minutes before a scheduled appointment.
             PRACTICE - Appointment Reminder Rules will be saved and edited with clinicNum=0. This denotes the "Defaults" when using clinics, but for a practice the defaults become the practice rules.CLINICS - When using clinics, each clinic has a bool "IsConfirmEnabled" that determines if a particular clinic has automated reminders/confirmations enabled. If not, no reminders will be sent out for the clinic. If enabled, and no rules are defined for the clinic, then the clinic will attempt to use the defaults that have been defined with clinicNum==0. If a clinic is enabled and has at least one AppointmentReminderRule defined, then NO defaults will be used for that clinic.REMINDERS - reminders are sent out using the ApptComm system implemented by DerekG. These used to be stored as preferences for the practice only. Now users are allowed to define them on a per-clinic basis. Reminders should be considered one way communications and should not be desingned with a customer response in mind.CONFIRMATIONS - confirmations are sent using the new automated-confirmation system implemented by RyanM (proper) and SamO (web backend). Confirmations are intended to allow end patients to respond to OpenDental via text or email and automatically confirm, or set to a desired status, the appointments on the schedule.</summary>
    <column order="0" name="ApptReminderRuleNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TypeCur" type="tinyint(4)">
      <summary>Enum:ApptReminderType </summary>
      <Enumeration name="ApptReminderType">
        <summary>Used in db.</summary>
        <EnumValue name="Undefined">-1 - Used to define an Undefined ApptReminderType.</EnumValue>
        <EnumValue name="Reminder">0 - Used to define the rules for when reminders should be sent out.</EnumValue>
        <EnumValue name="ConfirmationFutureDay">1 - Defines rules for when confirmations should be sent out.</EnumValue>
        <EnumValue name="ReminderFutureDay">2 - DEPRECATED. As of 17.4, all reminders have a status of Reminder.</EnumValue>
        <EnumValue name="PatientPortalInvite">3 - Send emails to patients with their credentials to the Patient Portal.</EnumValue>
        <EnumValue name="ScheduleThankYou">4 - Defines rules for when Schedule Verify ("Thank You"s) should be sent out.</EnumValue>
        <EnumValue name="Arrival">5 - Defines rules for when Arrival instructions should be sent out.</EnumValue>
        <EnumValue name="Birthday">6 - Birthday. Defines rule for sending out automated birthday emails.</EnumValue>
        <EnumValue name="GeneralMessage">7 - General Message. Defines rules for sending out automated messages after an appointment is set complete.
            TSPrior will always be negative (occurs in future) for GeneralMessage. Allowing GM before appointment is prohibited since it would simply be duplicating eReminder behavior.</EnumValue>
        <EnumValue name="WebSchedRecall">8 - WebSchedRecall. (Note, not yet used in db, but could be if we ever want clinic specific templates) Defines rules for sending out automated messages for Recalls.</EnumValue>
        <EnumValue name="NewPatientThankYou">9 - NewPatientThankYou, Thank you for New Patient which is able to send with a new patient web form URL.</EnumValue>
        <EnumValue name="PayPortalMsgToPay">10 - PaymentPortal Msg-To-Pay, used to send msg-to-pay messages to patients. Currently not an AutoComm feature but doing this now so functionality can be easier added in the future.</EnumValue>
        <EnumValue name="EClipboardWeb">11 - EClipboard Web, used to send eClipboard web URLs to existing patients. No automation yet. Sent by right clicking on appt.</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="TSPrior" type="bigint(20)">
      <summary>Positive value indicates time BEFORE appointment that this rule should be sent. Negative value indicates time AFTER appointment that this rule should be sent. GeneralMessage: will always be negative (occurs in future). Allowing GM before appointment is prohibited since it would simply be duplicating eReminder behavior.</summary>
    </column>
    <column order="3" name="SendOrder" type="varchar(255)">
      <summary>Comma Delimited List of comm types. Enum values of ApptComm.CommType. 0=pref,1=sms,2=email; Like the deprecated pref "ApptReminderSendOrder"</summary>
    </column>
    <column order="4" name="IsSendAll" type="tinyint(4)">
      <summary>Set to True if both an email AND a text should be sent.</summary>
    </column>
    <column order="5" name="TemplateSMS" type="text">
      <summary>If using SMS, this template will be used to generate the body of the text message.</summary>
    </column>
    <column order="6" name="TemplateEmailSubject" type="text">
      <summary>If using email, this template will be used to generate the subject of the email.</summary>
    </column>
    <column order="7" name="TemplateEmail" type="text">
      <summary>If using email, this template will be used to generate the body of the email.</summary>
    </column>
    <column order="8" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Allows reminder rules to be configured on a per clinic basis. If ClinicNum==0 then it is the practice/HQ/default settings.</summary>
    </column>
    <column order="9" name="TemplateSMSAggShared" type="text">
      <summary>Used when aggregating multiple appointments together into a single message.</summary>
    </column>
    <column order="10" name="TemplateSMSAggPerAppt" type="text">
      <summary>Used when aggregating multiple appointments together into a single message.</summary>
    </column>
    <column order="11" name="TemplateEmailSubjAggShared" type="text">
      <summary>Used when aggregating multiple appointments together into a single message.</summary>
    </column>
    <column order="12" name="TemplateEmailAggShared" type="text">
      <summary>Used when aggregating multiple appointments together into a single message.</summary>
    </column>
    <column order="13" name="TemplateEmailAggPerAppt" type="text">
      <summary>Used when aggregating multiple appointments together into a single message.</summary>
    </column>
    <column order="14" name="DoNotSendWithin" type="bigint(20)">
      <summary>The time before the appointment in which this reminder should NOT be sent. E.g., if this value is 2 days, and an appt is created one
            day in the future, a reminder will not be sent.</summary>
    </column>
    <column order="15" name="IsEnabled" type="tinyint(4)">
      <summary>Enables/Disables the ApptReminderRule.</summary>
    </column>
    <column order="16" name="TemplateAutoReply" type="text">
      <summary>Used when auto replying single eConfirmations.</summary>
    </column>
    <column order="17" name="TemplateAutoReplyAgg" type="text">
      <summary>Used when auto replying multiple patient eConfirmations.</summary>
    </column>
    <column order="18" name="IsAutoReplyEnabled" type="tinyint(4)">
      <summary>Enables/Disables eConfirmation auto replies. Only for when the patient responds positively via text.</summary>
    </column>
    <column order="19" name="Language" type="varchar(255)">
      <summary>When set, matched by text against the patient's language. Typically eng (English), fra (French), spa (Spanish), or similar.  
             If it's a custom language, then it might look like Tahitian. 
             Empty string implies that this rule uses the default language of the practice.</summary>
    </column>
    <column order="20" name="TemplateComeInMessage" type="text">
      <summary>Used when inviting patient to come into office.</summary>
    </column>
    <column order="21" name="EmailTemplateType" type="varchar(255)">
      <summary>Enum. The Type of email for the template.</summary>
    </column>
    <column order="22" name="AggEmailTemplateType" type="varchar(255)">
      <summary>Enum:EmailType The type of email for the aggregated template. </summary>
      <Enumeration name="EmailType">
        <summary></summary>
        <EnumValue name="Regular">0 - This is a regular email that may contain our special wiki markup. Not converted to html.</EnumValue>
        <EnumValue name="Html">1 - Html. Basic html email which uses the master template supplied by OD. Template includes header, styles, and the opening body tag. The user only needs to provide the body itself, which can inclcude tags that get automatically replaced.</EnumValue>
        <EnumValue name="RawHtml">2 - More advanced html that does not include the master template. User must provide everything.</EnumValue>
      </Enumeration>
    </column>
    <column order="23" name="IsSendForMinorsBirthday" type="tinyint(4)">
      <summary>Boolean false by default. Controls if birthday messages will get sent to a minor for their birthday.</summary>
    </column>
    <column order="24" name="EmailHostingTemplateNum" type="bigint(20)" fk="emailhostingtemplate">
      <summary>FK to emailhostingtemplate.EmailHostingTemplateNum. If used, rules fields will be based from the template.</summary>
    </column>
    <column order="25" name="MinorAge" type="int(11)">
      <summary>When IsSendForMinorsBirthday is true, this is the age that defines what a minor is.</summary>
    </column>
    <column order="26" name="TemplateFailureAutoReply" type="text">
      <summary>Used when auto replying to appointment confirmations that failed.</summary>
    </column>
    <column order="27" name="SendMultipleInvites" type="tinyint(4)">
      <summary>Enum:SendMultipleInvites . Whether we are able to send multiple invites.</summary>
      <Enumeration name="SendMultipleInvites">
        <summary>The different modes in which we will send a patient portal invite for this rule.</summary>
        <EnumValue name="UntilPatientVisitsPortal">0 - Send a patient portal invite if the patient has not visited patient portal before.</EnumValue>
        <EnumValue name="EveryAppointment">1 - Send a patient portal invite every appointment.</EnumValue>
        <EnumValue name="NoVisitInTimespan">2 - Send a patient portal invite if the patient hasn't visited patient portal within TimeSpanMultipleInvites pref.</EnumValue>
      </Enumeration>
    </column>
    <column order="28" name="TimeSpanMultipleInvites" type="bigint(20)">
      <summary>Used in conjunction with CanSendMultipleInvites. We will not send an invite if a patient has visited Patient Portal within this timespan.</summary>
    </column>
  </table>
  <table name="apptremindersent">
    <summary>When a reminder is sent for an appointment a record of that send is stored here. This is used to prevent re-sends of the same reminder.</summary>
    <column order="0" name="ApptReminderSentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ApptNum" type="bigint(20)">
      <summary>Foreign key to the appointment represented by this AutoCommAppt.</summary>
    </column>
    <column order="2" name="ApptDateTime" type="datetime">
      <summary>The Date and time of the original appointment. We need this in case the appointment was moved and needs another reminder sent out.</summary>
    </column>
    <column order="3" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</summary>
    </column>
    <column order="4" name="TSPrior" type="bigint(20)">
      <summary>This was the TSPrior used to send this reminder. </summary>
    </column>
    <column order="5" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
    <column order="6" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="7" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum for the corresponding appointment.</summary>
    </column>
    <column order="8" name="SendStatus" type="tinyint(4)">
      <summary>Indicates status of message.</summary>
    </column>
    <column order="9" name="MessageType" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="10" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="11" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="12" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
  </table>
  <table name="apptthankyousent">
    <summary>When a reminder is sent for an appointment a record of that send is stored here. This is used to prevent re-sends of the same 
            Thank You.</summary>
    <column order="0" name="ApptThankYouSentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ApptNum" type="bigint(20)">
      <summary>Foreign key to the appointment represented by this AutoCommAppt.</summary>
    </column>
    <column order="2" name="ApptDateTime" type="datetime">
      <summary>The Date and time of the original appointment. We need this in case the appointment was moved and needs another reminder sent out.</summary>
    </column>
    <column order="3" name="ApptSecDateTEntry" type="datetime">
      <summary>The Date and time of the original appointment. We need this in case the appointment was moved and needs another reminder sent out.</summary>
    </column>
    <column order="4" name="TSPrior" type="bigint(20)">
      <summary>This was the TSPrior used to send this reminder. </summary>
    </column>
    <column order="5" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
    <column order="6" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum for the corresponding appointment.</summary>
    </column>
    <column order="7" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="8" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
    <column order="9" name="DateTimeThankYouTransmit" type="datetime">
      <summary>Generated by OD. Timestamp when EConnector sent this ApptThankYouSent to HQ. Stored in local customer timezone.</summary>
    </column>
    <column order="10" name="ShortGUID" type="varchar(255)">
      <summary>Generated by HQ. Identifies this AutoCommGuid in future transactions between HQ and OD.</summary>
    </column>
    <column order="11" name="SendStatus" type="tinyint(4)">
      <summary>Indicates status of message.</summary>
    </column>
    <column order="12" name="DoNotResend" type="tinyint(4)">
      <summary>Indicates that the ApptThankYouSent should not be resent if changes were made.</summary>
    </column>
    <column order="13" name="MessageType" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="14" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="15" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="16" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</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="bigint(20)">
      <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>0-based order to display in lists. This is unique per clinic. So this does allow duplicate numbers if they are in different clinics.</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 ApptDrawing.RowsPerIncr to track current state.</summary>
    </column>
    <column order="4" name="OnlyScheduledProvs" type="tinyint">
      <summary>If set to true, then the only operatories that will show will be for providers that have schedules for the day, ops with no provs assigned.</summary>
    </column>
    <column order="5" name="OnlySchedBeforeTime" type="time">
      <summary>If OnlyScheduledProvs is set to true, and this time is not 0:00, then only provider schedules with start or stop time before this time will be included.</summary>
    </column>
    <column order="6" name="OnlySchedAfterTime" type="time">
      <summary>If OnlyScheduledProvs is set to true, and this time is not 0:00, then only provider schedules with start or stop time after this time will be included.</summary>
    </column>
    <column order="7" name="StackBehavUR" type="tinyint(4)">
      <summary>Enum:ApptViewStackBehavior </summary>
      <Enumeration name="ApptViewStackBehavior">
        <summary>Vertical or Horizontal</summary>
        <EnumValue name="Vertical"></EnumValue>
        <EnumValue name="Horizontal"></EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="StackBehavLR" type="tinyint(4)">
      <summary>Enum:ApptViewStackBehavior </summary>
      <Enumeration name="ApptViewStackBehavior">
        <summary>Vertical or Horizontal</summary>
        <EnumValue name="Vertical"></EnumValue>
        <EnumValue name="Horizontal"></EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0=All clinics.  This appointment view will only be visible when the current clinic showing is set to this clinic.  Within the appointment edit window, this setting is used to filter the list of available operatories.  Also used in conjunction with 'OnlyScheduledProvs' (when enabled) in order to filter the visible operatories within the Appt module.</summary>
    </column>
    <column order="10" name="ApptTimeScrollStart" type="time">
      <summary>Time the appointment module's view will scroll to on load.</summary>
    </column>
    <column order="11" name="IsScrollStartDynamic" type="tinyint(4)">
      <summary>If set to true, the appointment view scrolls to the first scheduled operatory start time or the first scheduled appointment.</summary>
    </column>
    <column order="12" name="IsApptBubblesDisabled" type="tinyint(4)">
      <summary>If set to true, the appointment view will not show appointment bubbles.</summary>
    </column>
    <column order="13" name="WidthOpMinimum" type="smallint">
      <summary>Zero is default and old behavior.  For any larger number, appointments won't shrink past that number but they may be wider.  Instead of getting narrower, a horizontal scrollbar shows up.</summary>
    </column>
    <column order="14" name="WaitingRmName" type="tinyint(4)">
      <summary>Enum:EnumWaitingRmName - Shows how patient name is displayed in the waiting room. Defaults to Last, First.</summary>
      <Enumeration name="EnumWaitingRmName">
        <summary>How the patient's name is displayed in the waiting room in the appointment module.</summary>
        <EnumValue name="LastFirst">0</EnumValue>
        <EnumValue name="FirstLastI">1</EnumValue>
        <EnumValue name="First">2</EnumValue>
      </Enumeration>
    </column>
    <column order="15" name="OnlyScheduledProvDays" type="tinyint(4)">
      <summary>If set to true, then the only days that will show in Week view will be days that have providers scheduled or an appointment scheduled.</summary>
    </column>
    <column order="16" name="ShowMirroredAppts" type="tinyint(4)">
      <summary>Default false. See Appointment.IsMirrored and Pref.ApptMirrorSecondary</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, ElementDesc, ApptFieldDefNum, or PatFieldDefNum.  The other 4 will be 0 or "".</summary>
    <column order="0" name="ApptViewItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ApptViewNum" type="bigint(20)" fk="apptview">
      <summary>FK to apptview.</summary>
    </column>
    <column order="2" name="OpNum" type="bigint(20)" fk="operatory">
      <summary>FK to operatory.OperatoryNum.</summary>
    </column>
    <column order="3" name="ProvNum" type="bigint(20)" 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 within its area.  For example, UR starts over with 0 ordering.</summary>
    </column>
    <column order="6" name="ElementColor" type="int(11)">
      <summary>If this is an element, then this is the color.</summary>
    </column>
    <column order="7" name="ElementAlignment" type="tinyint(4)">
      <summary>Enum:ApptViewAlignment If this is an element, then this is the alignment of the element within the appointment.</summary>
      <Enumeration name="ApptViewAlignment">
        <summary>Main, UR, or LR</summary>
        <EnumValue name="Main">0</EnumValue>
        <EnumValue name="UR">1</EnumValue>
        <EnumValue name="LR">2</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="ApptFieldDefNum" type="bigint(20)" fk="apptfielddef">
      <summary>FK to apptfielddef.ApptFieldDefNum.  If this is an element, and the element is an appt field, then this tells us which one.</summary>
    </column>
    <column order="9" name="PatFieldDefNum" type="bigint(20)" fk="patfielddef">
      <summary>FK to patfielddef.PatFieldDefNum.  If this is an element, and the element is an pat field, then this tells us which one.</summary>
    </column>
    <column order="10" name="IsMobile" type="tinyint(4)">
      <summary>Bool indicating if this ApptViewItem is for use in Mobile App appointment view</summary>
    </column>
  </table>
  <table name="asapcomm">
    <summary>Used by the Web Sched ASAP feature to quickly send text messages to patients on the ASAP List about last minute appointment openings. In OD proper, in the ASAP list, a user can send a text message to a patient for either an existing ASAP appointment or a recall ASAP appointment. It contains a link that patient clicks on to schedule via WebSchedASAP. The entry first gets created in this table. Then, separately, the rows are consumed by a listener thread on the eConnector which handles the actual sending.</summary>
    <column order="0" name="AsapCommNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FKey" type="bigint(20)">
      <summary>FK to the object for which this communication was made. Usually AptNum or RecallNum.</summary>
    </column>
    <column order="2" name="FKeyType" type="tinyint(4)">
      <summary>Enum:AsapCommFKeyType The type of object for which this communication was made.</summary>
      <Enumeration name="AsapCommFKeyType">
        <summary></summary>
        <EnumValue name="None">0 - Should not be present in database.</EnumValue>
        <EnumValue name="ScheduledAppt">1 - A scheduled appointment marked ASAP.</EnumValue>
        <EnumValue name="UnscheduledAppt">2 - An unscheduled appointment marked ASAP.</EnumValue>
        <EnumValue name="PlannedAppt">3 - A planned appointment marked ASAP.</EnumValue>
        <EnumValue name="Recall">4 - A recall marked ASAP</EnumValue>
        <EnumValue name="Broken">5 - A broken appointment marked ASAP</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="ScheduleNum" type="bigint(20)" fk="schedule">
      <summary>FK to schedule.ScheduleNum. The block on the schedule for which this communication was made.</summary>
    </column>
    <column order="4" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="5" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. The clinic that is sending this AsapComm.</summary>
    </column>
    <column order="6" name="ShortGUID" type="varchar(255)">
      <summary>An identifier that is used to communicate with OD HQ regarding this communication item.</summary>
    </column>
    <column order="7" name="DateTimeEntry" type="datetime">
      <summary>When this communication item was entered into the database.</summary>
    </column>
    <column order="8" name="DateTimeExpire" type="datetime">
      <summary>When this communication item will expire.</summary>
    </column>
    <column order="9" name="DateTimeSmsScheduled" type="datetime">
      <summary>The date and time when a text message is scheduled to be sent.</summary>
    </column>
    <column order="10" name="SmsSendStatus" type="tinyint(4)">
      <summary>Enum:AutoCommStatus The status of sending the text for this communication.</summary>
      <Enumeration name="AutoCommStatus">
        <summary>Used by both Statement and WebSchedRecall (and probably other places).</summary>
        <EnumValue name="Undefined">0 - Should not be in the database but can be used in the program.</EnumValue>
        <EnumValue name="DoNotSend">1 - Do not send a reminder.</EnumValue>
        <EnumValue name="SendNotAttempted">2 - We will send, but send has not been attempted yet.</EnumValue>
        <EnumValue name="SendSuccessful">3 - Has been sent successfully.</EnumValue>
        <EnumValue name="SendFailed">4 - Attempted to send but not successful.</EnumValue>
        <EnumValue name="SentAwaitingReceipt">5 - Has been sent successfully, awaiting receipt.</EnumValue>
      </Enumeration>
    </column>
    <column order="11" name="EmailSendStatus" type="tinyint(4)">
      <summary>Enum:AutoCommStatus The status of sending the email for this communication.</summary>
      <Enumeration name="AutoCommStatus">
        <summary>Used by both Statement and WebSchedRecall (and probably other places).</summary>
        <EnumValue name="Undefined">0 - Should not be in the database but can be used in the program.</EnumValue>
        <EnumValue name="DoNotSend">1 - Do not send a reminder.</EnumValue>
        <EnumValue name="SendNotAttempted">2 - We will send, but send has not been attempted yet.</EnumValue>
        <EnumValue name="SendSuccessful">3 - Has been sent successfully.</EnumValue>
        <EnumValue name="SendFailed">4 - Attempted to send but not successful.</EnumValue>
        <EnumValue name="SentAwaitingReceipt">5 - Has been sent successfully, awaiting receipt.</EnumValue>
      </Enumeration>
    </column>
    <column order="12" name="DateTimeSmsSent" type="datetime">
      <summary>The date and time a text message was sent.</summary>
    </column>
    <column order="13" name="DateTimeEmailSent" type="datetime">
      <summary>The date and time an email was sent.</summary>
    </column>
    <column order="14" name="EmailMessageNum" type="bigint(20)" fk="emailmessage">
      <summary>FK to emailmessage.EmailMessageNum. The email message that was sent to the patient.</summary>
    </column>
    <column order="15" name="ResponseStatus" type="tinyint(4)">
      <summary>Enum:AsapRSVPStatus How the patient has responded to this communication.</summary>
      <Enumeration name="AsapRSVPStatus">
        <summary></summary>
        <EnumValue name="UnableToSend">0 - Neither text nor email was permitted to be sent.</EnumValue>
        <EnumValue name="AwaitingTransmit">1 - EConnector will pickup and send to HQ and change to pendingRsvp.</EnumValue>
        <EnumValue name="PendingRsvp">2 - EConnector has sent this to HQ and will remain in this status until it is either terminated or receives a response from the 
            patient.</EnumValue>
        <EnumValue name="Viewed">3 - The patient viewed the portal and took no action.</EnumValue>
        <EnumValue name="ViewedNotAvailable">4 - The patient viewed the portal but the slot was no longer available.</EnumValue>
        <EnumValue name="AcceptedAndMoved">5 - The patient accepted the appointment and the appointment was successfully moved.</EnumValue>
        <EnumValue name="AcceptedAndNotAvailable">6 - The patient accepted the appointment but the appointment was not successfully moved.</EnumValue>
        <EnumValue name="Declined">7 - The patient declined any open slots.</EnumValue>
        <EnumValue name="ChoseDifferentSlot">8 - The patient declined this slot but chose a different time slot.</EnumValue>
        <EnumValue name="Expired">9 - Patient took no action by the time DateTimeExpired passed and the message was terminated.</EnumValue>
        <EnumValue name="Failed">10 - HQ or EConnector was unable to send the message so it was terminated prematurely.</EnumValue>
        <EnumValue name="DeclinedStopComm">11 - The patient declined and requested that we do not continue contacting them for this appointment.</EnumValue>
      </Enumeration>
    </column>
    <column order="16" name="DateTimeOrig" type="datetime">
      <summary>The date and time of the appointment when this communication was made or the date and time of the recall date due.</summary>
    </column>
    <column order="17" name="TemplateText" type="text">
      <summary>The template that will be used when sending a text message.</summary>
    </column>
    <column order="18" name="TemplateEmail" type="text">
      <summary>The template that will be used when creating the body of the email message.</summary>
    </column>
    <column order="19" name="TemplateEmailSubj" type="varchar(100)">
      <summary>The template that will be used for the email subject line.</summary>
    </column>
    <column order="20" name="Note" type="text">
      <summary>Any notes regarding this communication item.</summary>
    </column>
    <column order="21" name="GuidMessageToMobile" type="text" fk="smstomobile">
      <summary>FK to smstomobile.GuidMessage. Generated at HQ when the SMS is generated.</summary>
    </column>
    <column order="22" name="EmailTemplateType" type="varchar(255)">
      <summary>Enum:EmailType Type of markup for the template.</summary>
      <Enumeration name="EmailType">
        <summary></summary>
        <EnumValue name="Regular">0 - This is a regular email that may contain our special wiki markup. Not converted to html.</EnumValue>
        <EnumValue name="Html">1 - Html. Basic html email which uses the master template supplied by OD. Template includes header, styles, and the opening body tag. The user only needs to provide the body itself, which can inclcude tags that get automatically replaced.</EnumValue>
        <EnumValue name="RawHtml">2 - More advanced html that does not include the master template. User must provide everything.</EnumValue>
      </Enumeration>
    </column>
    <column order="23" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that is sending this AsapComm. Will be 0 if unknown.</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="bigint(20)">
      <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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AutoCodeItemNum" type="bigint(20)" fk="autocodeitem">
      <summary>FK to autocodeitem.AutoCodeItemNum.</summary>
    </column>
    <column order="2" name="Cond" type="tinyint">
      <summary>Enum:AutoCondition </summary>
      <Enumeration name="AutoCondition">
        <summary></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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AutoCodeNum" type="bigint(20)" 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="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum</summary>
    </column>
  </table>
  <table name="autocommexcludedate">
    <summary>AutoComms are sent a certain number of days in advance. Clinicpref called eConfirmExcludeDays handles excluding weekends, and this table handles excluding holidays. So AutoComms only go out when office is open. (First iteration currently only applies to eConfirmations)</summary>
    <column order="0" name="AutoCommExcludeDateNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)">
      <summary>ClinicNum this row applies to. 0 for HQ</summary>
    </column>
    <column order="2" name="DateExclude" type="datetime">
      <summary></summary>
    </column>
  </table>
  <table name="automation">
    <summary>A trigger event causes one or more actions.</summary>
    <column order="0" name="AutomationNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="text">
      <summary>.</summary>
    </column>
    <column order="2" name="Autotrigger" type="tinyint(4)">
      <summary>Enum:EnumAutomationTrigger What triggers this automation</summary>
      <Enumeration name="EnumAutomationTrigger">
        <summary></summary>
        <EnumValue name="ProcedureComplete">0</EnumValue>
        <EnumValue name="ApptBreak">1</EnumValue>
        <EnumValue name="ApptNewPatCreate">2</EnumValue>
        <EnumValue name="PatientOpen">3. Regardless of module.  Usually only used with conditions.</EnumValue>
        <EnumValue name="ApptCreate">4</EnumValue>
        <EnumValue name="ProcSchedule">5. Attaching a procedure to a scheduled appointment.</EnumValue>
        <EnumValue name="BillingTypeSet">6</EnumValue>
        <EnumValue name="RxCreate">7</EnumValue>
        <EnumValue name="ClaimCreate">8</EnumValue>
        <EnumValue name="ClaimOpen">9</EnumValue>
        <EnumValue name="ApptComplete">10</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="ProcCodes" type="text">
      <summary>If this has a CompleteProcedure trigger, this is a comma-delimited list of codes that will trigger the action.</summary>
    </column>
    <column order="4" name="AutoAction" type="tinyint(4)">
      <summary>Enum:AutomationAction The action taken as a result of the trigger.  To get more than one action, create multiple automation entries.</summary>
      <Enumeration name="AutomationAction">
        <summary></summary>
        <EnumValue name="PrintPatientLetter"></EnumValue>
        <EnumValue name="CreateCommlog"></EnumValue>
        <EnumValue name="PrintReferralLetter">If a referral does not exist for this patient, then notify user instead.</EnumValue>
        <EnumValue name="ShowExamSheet"></EnumValue>
        <EnumValue name="PopUp"></EnumValue>
        <EnumValue name="SetApptASAP"></EnumValue>
        <EnumValue name="ShowConsentForm"></EnumValue>
        <EnumValue name="SetApptType"></EnumValue>
        <EnumValue name="PopUpThenDisable10Min">Similar to PopUp, but will only show once per WS per 10 minutes.</EnumValue>
        <EnumValue name="PatRestrictApptSchedTrue">When triggered, automatically restricts patient from being scheduled. See also PatRestriction.cs</EnumValue>
        <EnumValue name="PatRestrictApptSchedFalse">When triggered, automatically removes patient from scheduling restriction. See also PatRestriction.cs</EnumValue>
        <EnumValue name="PrintRxInstruction">When triggered, it will automatically print a copy of the Patient Rx Instructions</EnumValue>
        <EnumValue name="ChangePatStatus">When triggered, automatically set a patient's status to the status type in the PatStatus column. Delete should never be used.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="SheetDefNum" type="bigint(20)" fk="sheetdef">
      <summary>FK to sheetdef.SheetDefNum.  If the action is to print a sheet, then this tells which sheet to print.  So it must be a custom sheet.  Also, not that this organization does not allow passing parameters to the sheet such as which procedures were completed, or which appt was broken.</summary>
    </column>
    <column order="6" name="CommType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Only used if action is CreateCommlog.</summary>
    </column>
    <column order="7" name="MessageContent" type="text">
      <summary>If a commlog action, then this is the text that goes in the commlog.  If this is a ShowStatementNoteBold action, then this is the NoteBold. Might later be expanded to work with email or to use variables.</summary>
    </column>
    <column order="8" name="AptStatus" type="tinyint(4)">
      <summary>Enum:ApptStatus . This column is not used anymore.</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- Deprecated in 17.4.1. Use Appointment.Priority instead. </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="9" name="AppointmentTypeNum" type="bigint(20)" fk="appointmenttype">
      <summary>FK to appointmenttype.AppointmentTypeNum.</summary>
    </column>
    <column order="10" name="PatStatus" type="tinyint(4)">
      <summary>Enum:PatientStatus - used to determine which status to change to for ChangePatientStatus automation actions. Should never be 'Deleted'</summary>
      <Enumeration name="PatientStatus">
        <summary></summary>
        <EnumValue name="Patient">0</EnumValue>
        <EnumValue name="NonPatient">1</EnumValue>
        <EnumValue name="Inactive">2</EnumValue>
        <EnumValue name="Archived">3 - This status is also used for a merged patient that you're not keeping.</EnumValue>
        <EnumValue name="Deleted">4</EnumValue>
        <EnumValue name="Deceased">5</EnumValue>
        <EnumValue name="Prospective">6- Not an actual patient yet.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="automationcondition">
    <summary>Each condition evaluates to true or false.  A single automation can have multiple conditions.  Mutliple conditions for a single automation is ANDed together.</summary>
    <column order="0" name="AutomationConditionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AutomationNum" type="bigint(20)" fk="automation">
      <summary>FK to automation.AutomationNum. </summary>
    </column>
    <column order="2" name="CompareField" type="tinyint(4)">
      <summary>Enum:AutoCondField </summary>
      <Enumeration name="AutoCondField">
        <summary>Automation Condition Fields that must be met for an automation to trigger.</summary>
        <EnumValue name="NeedsSheet">0- Condition based on if a patient doesn't have a sheet filled.  CompareString stores sheetdef.Description.  Comparison is typically Equals, but Contains can also be used.</EnumValue>
        <EnumValue name="Problem">1- Condition based on if a patient has an active disease.  CompareString stores the diseasedef.DiseaseName.  Contains or Equals is used for Comparison.</EnumValue>
        <EnumValue name="Medication">2- Condition based on if a patient is actively taking a medication.  CompareString stores the medication.MedName.  Contains or Equals is used for Comparison.</EnumValue>
        <EnumValue name="Allergy">3- Condition based on if a patient has an active allergy.  CompareString stores the allergydef.Description.  Contains or Equals is used for Comparison.</EnumValue>
        <EnumValue name="Age">4- Condition based on patient.Age.  Age to compare is stored in CompareString.  Contains, Equals, GreaterThan, and LessThan can be used for Comparison.  This is the only CompareField that can use GreaterThan or LessThan for Comparison.</EnumValue>
        <EnumValue name="Gender">5- Condition based on patient.Gender.  CompareString can store the string values "M" or "F" (not case sensitive).  Comparison can be Contains or Equals, though they both perform the same comparison since the logic only uses the first letter of the patient's gender.  PatientGender.Unknown and PatientGender.Other are not currently supported.</EnumValue>
        <EnumValue name="Labresult">6- Condition based on if a labresult exists for a patient.  CompareString stores labresult.TestName.  Comparison can be Contains or Equals.</EnumValue>
        <EnumValue name="InsuranceNotEffective">7- Condition based on if a patient's lowest ordinal insurance plan is not effective.  CompareString not used.  Comparison=None.</EnumValue>
        <EnumValue name="BillingType">8- Condition based on if a patient has a given billing type.  CompareString stores the definition.ItemName where definition.Category=4.  Comparison can be Contains or Equals.</EnumValue>
        <EnumValue name="IsProcRequired">9- Only used for the RxCreate automation trigger.  Condition based on if RxPat.IsProcRequired=true on creation.  CompareString not used.  Comparison=None.</EnumValue>
        <EnumValue name="IsControlled">10- Only used for the RxCreate automation trigger.  Condition based on if RxPat.IsControlled=true on creation.  CompareString not used.  Comparison=None.</EnumValue>
        <EnumValue name="IsPatientInstructionPresent">11- Only used for the RxCreate automation trigger.  Condition based on if RxPat.PatientInstruction is not null/whitespace on creation.  CompareString not used.  Comparison=None.</EnumValue>
        <EnumValue name="PlanNum">12- Condition based on insplan.PlanNum, all inssubs for a patient are considered.  CompareString stores the value of insplan.PlanNum.  Comparison can be Contains or Equals.</EnumValue>
        <EnumValue name="ClaimContainsProcCode">13- Only used for CreateClaim and OpenClaim automation triggers.  Condition based on if a claim contains a specific procedurecode.  CompareString stores the value of procedurecode.ProcCode.  Comparison=None.</EnumValue>
        <EnumValue name="PatientProcedureClinicMismatch">14- Only used for ProcedureComplete automation trigger.  Condition based on if a procedure is completed at a different clinic from the patient's home clinic.  CompareString not used.  Comparison=None.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="Comparison" type="tinyint(4)">
      <summary>Enum:AutoCondComparison Not all comparisons are allowed with all data types.</summary>
      <Enumeration name="AutoCondComparison">
        <summary></summary>
        <EnumValue name="Equals">0- Not sensitive to capitalization.</EnumValue>
        <EnumValue name="GreaterThan">1- Only used when CompareField is AutoCondField.Age.</EnumValue>
        <EnumValue name="LessThan">2- Only used when CompareField is AutoCondField.Age.</EnumValue>
        <EnumValue name="Contains">3- aka Like</EnumValue>
        <EnumValue name="None">4- Should not be displayed to users to choose from.  Used when the condition has one and only one 'comparison' to trigger it.  E.g. ins not effective.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="CompareString" type="varchar(255)">
      <summary>Used for CompareFields that take user input.</summary>
    </column>
  </table>
  <table name="autonote">
    <summary>A single autonote template.</summary>
    <column order="0" name="AutoNoteNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="AutoNoteName" type="varchar(50)">
      <summary>Name of AutoNote</summary>
    </column>
    <column order="2" name="MainText" type="text">
      <summary>Was 'ControlsToInc' in previous versions.</summary>
    </column>
    <column order="3" name="Category" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  This is the AutoNoteCat definition category (DefCat=41), for categorizing autonotes.
            Uncategorized autonotes will be set to 0.</summary>
    </column>
  </table>
  <table name="autonotecontrol">
    <summary>In the program, this is now called an autonote prompt.</summary>
    <column order="0" name="AutoNoteControlNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="Descript" type="varchar(50)">
      <summary>The description of the prompt as it will be referred to from other windows.</summary>
    </column>
    <column order="2" name="ControlType" type="varchar(50)">
      <summary>'Text', 'OneResponse', or 'MultiResponse'.  More types to be added later.</summary>
    </column>
    <column order="3" name="ControlLabel" type="varchar(255)">
      <summary>The prompt text.</summary>
    </column>
    <column order="4" name="ControlOptions" type="text">
      <summary>For TextBox, this is the default text.  For a ComboBox, this is the list of possible responses, one per line.</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.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, CoverageLevelAnnual Max Indiv $1000: None/General,-,Limitations,-1,1000,CalendarYear,None,0,IndividualRestorative 80%: Restorative,-,CoInsurance,80,-1,CalendarYear,None,0,None$50 deductible: None/General,-,Deductible,-1,50,CalendarYear,None,0,IndividualDeductible waived on preventive: Preventive,-,Deductible,-1,0,CalendarYear,None,0,Individual1 pano every 5 years: None,D0330,Limitations,-1,-1,Years?,Years,5,None2 exams per year: Preventive(or Diagnostic),-,Limitations,-1,-1,BenefitYear,NumberOfServices,2,NoneFluoride limit 18yo: None, D1204, Limitations, -1, -1, CalendarYear/None, AgeLimit, 18,None (might require a second identical entry for D1205)4BW every 6 months: None, D0274, Limitations, -1, -1, None, Months, 6,None.The text above might be difficult to read.  We are trying to improve the white spacing.</summary>
    <column order="0" name="BenefitNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PlanNum" type="bigint(20)" 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="bigint(20)" 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="bigint(20)" fk="covcat">
      <summary>FK to covcat.CovCatNum.  Corresponds to X12 EB03- Service Type code.  Situational, so it can be 0.  Will probably be 0 for general deductible and annual max.  There are very specific categories covered by X12. Users should set their InsCovCats to the defaults we provide.</summary>
    </column>
    <column order="4" name="BenefitType" type="tinyint">
      <summary>Enum:InsBenefitType Corresponds to X12 EB01. Examples: 0=ActiveCoverage, 1=CoInsurance, 2=Deductible, 3=CoPayment, 4=Exclusions, 5=Limitations. ActiveCoverage doesn't really provide meaningful information.</summary>
      <Enumeration name="InsBenefitType">
        <summary>Used in the benefit table.  Corresponds to X12 EB01.</summary>
        <EnumValue name="ActiveCoverage">0- Informational only. Not usually used.  Would only be used if you are just indicating that the patient is covered, but without any specifics.</EnumValue>
        <EnumValue name="CoInsurance">1- Used for percentages to indicate portion that insurance will cover.  When interpreting electronic benefit information, this is the opposite percentage, the percentage that the patient will pay after deductible.</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- Informational only. 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>
        <EnumValue name="WaitingPeriod">6- Sets a period of time after the effective date where a benefit will not be used.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="Percent" type="tinyint(4)">
      <summary>Only used if BenefitType=CoInsurance.  Valid values are 0 to 100.  -1 indicates empty, which is almost always true if not CoInsurance.  The percentage that insurance will pay on the procedure.  Note that benefits coming from carriers are usually backwards, indicating the percentage that the patient is responsible for.</summary>
    </column>
    <column order="6" name="MonetaryAmt" type="double">
      <summary>Used for CoPayment, Limitations, and Deductible.  -1 indicates empty</summary>
    </column>
    <column order="7" 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>
        <EnumValue name="NumberInLast12Months">5- # in last 12 months.  Does not care about when benefit year begins. Looks at previous 12 months.</EnumValue>
      </Enumeration>
    </column>
    <column order="8" 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 fluoride 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="9" name="Quantity" type="tinyint">
      <summary>Corresponds to X12 EB10. Qualify the quantity using QuantityQualifier. Must be a numeric value max 255.</summary>
    </column>
    <column order="10" name="CodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum.  Typical uses include fluoride, sealants, etc.  If a specific code is used here, then the CovCat should be None.</summary>
    </column>
    <column order="11" name="CoverageLevel" type="int(11)">
      <summary>Enum:BenefitCoverageLevel Corresponds to X12 EB02.  None, Individual, or Family.  Individual and Family are commonly used for deductibles and maximums.  None is commonly used for percentages and copays.</summary>
      <Enumeration name="BenefitCoverageLevel">
        <summary>Used in the benefit table.</summary>
        <EnumValue name="None">0- Since this is a situational X12 field, we can also have none.  Typical for percentages and copayments.</EnumValue>
        <EnumValue name="Individual">1- The default for deductibles and maximums.</EnumValue>
        <EnumValue name="Family">2- For example, family deductible or family maximum.</EnumValue>
      </Enumeration>
    </column>
    <column order="12" name="SecDateTEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="13" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="14" name="CodeGroupNum" type="bigint(20)" fk="codegroup">
      <summary>FK to codegroup.CodeGroupNum  The group of procedure codes that apply to this frequency limitation benefit.</summary>
    </column>
    <column order="15" name="TreatArea" type="tinyint(4)">
      <summary>Enum:TreatmentArea . Only for frequency limitations, ignored for all other benefits. Enforced by the UI. Example 3 fillings per year [mouth]. Example: on any particular tooth, one crown every 5 years. Tests: 140 through 147. 0 means default.</summary>
      <Enumeration name="TreatmentArea">
        <summary>Used in procedurecode setup to specify the treatment area for a procedure.  This determines what fields are available when editing an appointment.</summary>
        <EnumValue name="None">0-goes on claims as blank.</EnumValue>
        <EnumValue name="Surf">1</EnumValue>
        <EnumValue name="Tooth">2</EnumValue>
        <EnumValue name="Mouth">3-goes on claims as 00.</EnumValue>
        <EnumValue name="Quad">4</EnumValue>
        <EnumValue name="Sextant">5</EnumValue>
        <EnumValue name="Arch">6</EnumValue>
        <EnumValue name="ToothRange">7</EnumValue>
      </Enumeration>
    </column>
    <column order="16" name="ToothRange" type="varchar(255)">
      <summary>Single tooth numbers separated by commas. When displayed to user, it can contain hyphens and commas. Example: "2,15" or "1" or "23-26,7-10". Used for age limitations. Example: D7140 extraction on "AS,BS,CS,DS" allowed 0 to 7yrs old. Also used for exclusions. Example: D2740 porcelain crown is not covered on #2 and 15.</summary>
    </column>
  </table>
  <table name="branding">
    <summary>Replaces MobileBrandingProfile. Stores clinic level customizations to the way eServices are displayed to users (colors, logos, etc). Colors use the MaterialColorUtilities package which implements Google's Material Color Utilities for C#. Material Color is a system for generating a theme of color variations based on a single source color. Changes made to the primary, secondary, or tertiary colors on the theme will cause the other colors to change slightly as well. This table is stored in the dental office database, not at OD HQ. </summary>
    <column order="0" name="BrandingNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="BrandingType" type="tinyint(4)">
      <summary>Enum:EnumBrandingType</summary>
      <Enumeration name="EnumBrandingType">
        <summary>The types of customization that can be added to change how eServices are displayed to the user.</summary>
        <EnumValue name="None">0: No branding should have this type.</EnumValue>
        <EnumValue name="LogoImage">1: Base64 encoded data for a logo image. Previously stored as file path. Only used for eClipboard. Shows as 90x90 pixels.</EnumValue>
        <EnumValue name="MaterialColorPalette">2: JSON serialized light and dark Schemes for a Material Color palette as well as the source color. Colors will be represented as either their respective RGB values (255,255,255) or simply the name of the color (White). Users are only able to edit the primary, secondary, and tertiary colors of a Scheme.</EnumValue>
        <EnumValue name="OfficeDescription">3: The Clinic Name that will be shown on eClipboard CheckIn</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic. 0 indicates a global default Branding.</summary>
    </column>
    <column order="3" name="ValueString" type="mediumtext">
      <summary>Stores the value for the branding type. MediumText (16MB) to hold logos as base64 encoded strings, although we will recommend smaller for better performance. Colors will be stored as JSON Serialized SchemesAndSource, which will hold both light and dark Schemes as well as the source color. Example serialized Scheme: {"Primary": "109, 94, 15","OnPrimary": "White","PrimaryContainer": "248, 226, 135", etc for the 39 generated colors}</summary>
    </column>
    <column order="4" name="DateTimeUpdated" type="datetime">
      <summary>The last time this row was updated. Some eServices store relevant rows locally, and will only need to update when this exceeds their locally stored values. Saves calls to database.</summary>
    </column>
  </table>
  <table name="canadiannetwork">
    <summary>Not user-editable.</summary>
    <column order="0" name="CanadianNetworkNum" type="bigint(20)">
      <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>
    <column order="3" name="CanadianTransactionPrefix" type="varchar(255)">
      <summary>A01.  Up to 12 char.</summary>
    </column>
    <column order="4" name="CanadianIsRprHandler" type="tinyint(4)">
      <summary>Set to true if this network is in charge of handling all Request for Payment Reconciliation (RPR) transactions for all carriers within this network, as opposed to the individual carriers wihtin the network processing the RPR transactions themselves.</summary>
    </column>
  </table>
  <table name="carecreditwebresponse">
    <summary>This table will never delete records, only upsert. CareCreditResponseWeb rows are records of all CareCredit made.</summary>
    <column order="0" name="CareCreditWebResponseNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="PayNum" type="bigint(20)" fk="payment">
      <summary>FK to payment.PayNum.</summary>
    </column>
    <column order="3" name="RefNumber" type="varchar(255)">
      <summary>The RefNumber associated to this request.</summary>
    </column>
    <column order="4" name="Amount" type="double">
      <summary>The amount of the request. This can be purchases or refund amount.</summary>
    </column>
    <column order="5" name="WebToken" type="varchar(255)">
      <summary>New: The sessionId is returned from the prefill response that we use to send the user to the portal.
            Old: The web token used for pullback request.</summary>
    </column>
    <column order="6" name="ProcessingStatus" type="varchar(255)">
      <summary>Enum:CareCreditWebStatus Used to determine if the request is pending, needs action, or is completed.</summary>
      <Enumeration name="CareCreditWebStatus">
        <summary></summary>
        <EnumValue name="Created">0.</EnumValue>
        <EnumValue name="CreatedError">1.</EnumValue>
        <EnumValue name="Pending">2.</EnumValue>
        <EnumValue name="PendingError">3.</EnumValue>
        <EnumValue name="Expired">4.</EnumValue>
        <EnumValue name="Completed">5.</EnumValue>
        <EnumValue name="PreApproved">6.</EnumValue>
        <EnumValue name="Cancelled">7.</EnumValue>
        <EnumValue name="Declined">8.</EnumValue>
        <EnumValue name="CallForAuth">9.</EnumValue>
        <EnumValue name="DupQS">10.</EnumValue>
        <EnumValue name="AccountFound">11.</EnumValue>
        <EnumValue name="Unknown">12.</EnumValue>
        <EnumValue name="BatchError">13.</EnumValue>
        <EnumValue name="UnknownError">14.</EnumValue>
        <EnumValue name="ErrorAcknowledged">15.</EnumValue>
        <EnumValue name="ExpiredBatch">16.</EnumValue>
        <EnumValue name="AccountNotFoundQS">17.</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="DateTimeEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual datetime of entry.</summary>
    </column>
    <column order="8" name="DateTimePending" type="datetime">
      <summary>DateTime that the request went to a pending status.</summary>
    </column>
    <column order="9" name="DateTimeCompleted" type="datetime">
      <summary>DateTime that the request went to a completed status.</summary>
    </column>
    <column order="10" name="DateTimeExpired" type="datetime">
      <summary>DateTime that the request expired.</summary>
    </column>
    <column order="11" name="DateTimeLastError" type="datetime">
      <summary>DateTime of the last time the request had an error.</summary>
    </column>
    <column order="12" name="LastResponseStr" type="text">
      <summary>Raw JSON response (or error) from CareCredit.</summary>
    </column>
    <column order="13" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="14" name="ServiceType" type="varchar(255)">
      <summary>Enum:CareCreditServiceType Used to determine what service was requested for this web response.</summary>
      <Enumeration name="CareCreditServiceType">
        <summary></summary>
        <EnumValue name="Batch">0.</EnumValue>
        <EnumValue name="Prefill">1.</EnumValue>
        <EnumValue name="IndividualQS">2.</EnumValue>
      </Enumeration>
    </column>
    <column order="15" name="TransType" type="varchar(255)">
      <summary>Enum:CareCreditTransType Used to determine the transaction type.</summary>
      <Enumeration name="CareCreditTransType">
        <summary></summary>
        <EnumValue name="None">0.</EnumValue>
        <EnumValue name="Purchase">1.</EnumValue>
        <EnumValue name="Refund">2.</EnumValue>
      </Enumeration>
    </column>
    <column order="16" name="MerchantNumber" type="varchar(20)">
      <summary>The MerchantNumber associated to this request.</summary>
    </column>
    <column order="17" name="HasLogged" type="tinyint(4)">
      <summary>True if row has been logged at HQ, otherwise false.</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="bigint(20)">
      <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>Enum:NoSendElectType 0 - send electronically, 1 - don't send electronically, 2 - don't send non-primary (secondary,tertiary, etc.) 
            claims electronically.</summary>
      <Enumeration name="NoSendElectType">
        <summary></summary>
        <EnumValue name="SendElect">0 - Sending electronically is allowed for this carrier.</EnumValue>
        <EnumValue name="NoSendElect">1 - Do not send electronically for this carrier.</EnumValue>
        <EnumValue name="NoSendSecondaryElect">2 - Do not send electronically for this carrier if the carrier is not the primary insurance for the patient.</EnumValue>
      </Enumeration>
    </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="CDAnetVersion" type="varchar(100)">
      <summary>The version of CDAnet supported.  Either 02 or 04.</summary>
    </column>
    <column order="12" name="CanadianNetworkNum" type="bigint(20)" fk="canadiannetwork">
      <summary>FK to canadiannetwork.CanadianNetworkNum.  Only used in Canada.  Right now, there is no UI to the canadiannetwork table in our db.</summary>
    </column>
    <column order="13" name="IsHidden" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="14" name="CanadianEncryptionMethod" type="tinyint(4)">
      <summary>1=No Encryption, 2=CDAnet standard #1, 3=CDAnet standard #2.  Field A10.
            Deprecated for all Canadian carriers.  Will always be 1 (No Encryption).</summary>
    </column>
    <column order="15" name="CanadianSupportedTypes" type="int(11)">
      <summary>Bit flags.</summary>
    </column>
    <column order="16" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="17" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="18" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="19" name="TIN" type="varchar(255)">
      <summary>Tax ID Number.  Not user editable.  No UI for this field.
            Used in when importing insurance plans from 834s to uniquely identify carriers.</summary>
    </column>
    <column order="20" name="CarrierGroupName" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Links carriers into groups for queries.</summary>
    </column>
    <column order="21" name="ApptTextBackColor" type="int(11)">
      <summary>Color that the carrier is highlighted within the appointment module appointment and popup bubble. 0 represents empty no color.</summary>
    </column>
    <column order="22" name="IsCoinsuranceInverted" type="tinyint(4)">
      <summary>False by default.  Determines if the carrier supplied EB08 field of 271 transactions should be inverted for coinsurance percentages.
            When true carriers sent us insurance percentage so we do not need to invert it, it is already inverted for us.</summary>
    </column>
    <column order="23" name="TrustedEtransFlags" type="tinyint(4)">
      <summary>Enum:TrustedEtransTypes  Bit flags.  None (0) by default.  Stores trusted user selected X12 transaction types related to this carrier.</summary>
      <Enumeration name="TrustedEtransTypes">
        <summary></summary>
        <EnumValue name="None">0 - Default, no trusted types.</EnumValue>
        <EnumValue name="RealTimeEligibility">1 - When used in bit-wise value enables the automated import of certain fields for 271s, otherwise disabled.</EnumValue>
      </Enumeration>
    </column>
    <column order="24" name="CobInsPaidBehaviorOverride" type="tinyint(4)">
      <summary>Enum:EclaimCobInsPaidBehavior  When sending X12 5010 eclaims, if not set to Default, then this setting overrides the ClaimCobInsPaidBehavior preference.</summary>
      <Enumeration name="EclaimCobInsPaidBehavior">
        <summary></summary>
        <EnumValue name="Default">Use the global preference value instead of the carrier override.</EnumValue>
        <EnumValue name="ClaimLevel">Only send COB eclaim data claim totals.</EnumValue>
        <EnumValue name="ProcedureLevel">Only send COD eclaim data respective procedure amounts.</EnumValue>
        <EnumValue name="Both">Send COB eclaim data claim totals and respective procedure amounts.</EnumValue>
      </Enumeration>
    </column>
    <column order="25" name="EraAutomationOverride" type="tinyint(4)">
      <summary>Enum:EraAutomationMode  UseGlobal (0) by default. Determines the level of ERA processing automation for this carrier. This will override the EraAutomationBehavior preference when not set to UseGlobal.</summary>
      <Enumeration name="EraAutomationMode">
        <summary>The level of automation for ERA processing. This setting can be overriden for individual Carriers.</summary>
        <EnumValue name="UseGlobal">0 - Never used for the EraAutomationBehavior preference. Only used for Carrier.EraAutomationOverride to indicate that the carrier uses the EraAutomationBehavior preference instead of an override.</EnumValue>
        <EnumValue name="ReviewAll">1 - ERAs are manually processed.</EnumValue>
        <EnumValue name="SemiAutomatic">2 - Allows ERAs to be processed with a single button click.</EnumValue>
        <EnumValue name="FullyAutomatic">3 - When ERAs are imported, they are fully processed without any input from a user.</EnumValue>
      </Enumeration>
    </column>
    <column order="26" name="OrthoInsPayConsolidate" type="tinyint(4)">
      <summary>Enum:EnumOrthoInsPayConsolidate  Global (0) by default. Determines how this carrier requires payments made to ortho claims made by the Auto Ortho Tool. This will override the OrthoInsPayConsolidated preference when not set to Global.</summary>
      <Enumeration name="EnumOrthoInsPayConsolidate">
        <summary></summary>
        <EnumValue name="Global">Uses the preference value of OrthoInsPayConsolidated.</EnumValue>
        <EnumValue name="ForceConsolidateOn">Overrides the preference value of OrthoInsPayConsolidated and blocks users from entering payments on claims created by the Auto Ortho Tool.</EnumValue>
        <EnumValue name="ForceConsolidateOff">Overrides the preference value of OrthoInsPayConsolidated and allows users to enter payments on claims created by the Auto Ortho Tool.</EnumValue>
      </Enumeration>
    </column>
    <column order="27" name="PaySuiteTransSup" type="tinyint(4)">
      <summary>Enum:EnumPaySuiteTransTypes  (0) None by default. Indicates which PaySuite transaction types a Canadian carrier supports.</summary>
      <Enumeration name="EnumPaySuiteTransTypes">
        <summary>PaySuite API transaction types that a carrier may support.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="ExtendedReversal">1 - Carrier supports PaySuite Extend Reversals which are reversals made more than 24 hours after sending the claim.</EnumValue>
        <EnumValue name="PlanDetails">2 - Carrier supports PaySuite Plan Details requests which return plan/benefit details.</EnumValue>
        <EnumValue name="Both">3 - Carrier supports both Extended Reversals and Plan Details Requests.</EnumValue>
      </Enumeration>
    </column>
    <column order="28" name="PreAuthCodes" type="text">
      <summary>List of D codes with commas and hyphens. No spaces. Defines the procedure code ranges that require a preauthorization for this carrier. Example: "D0000-D0999,D2140-D2161,D2750" would mean all exams and xrays, some amalgams, and a crown requires a preauthorization. The normal hyphens in the db get converted to non-breaking hyphens (\u2011) for display to prevent wrapping.</summary>
    </column>
  </table>
  <table name="cdcrec">
    <summary>CDC Race and Ethnicity.  About 200 rows.</summary>
    <column order="0" name="CdcrecNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CdcrecCode" type="varchar(255)">
      <summary>CDCREC Code.  Example: 1002-5.  Not allowed to edit this column once saved in the database.</summary>
    </column>
    <column order="2" name="HeirarchicalCode" type="varchar(255)">
      <summary>Heirarchical Code. Example:
            R1       =="American Indian or alaska Native"R1.01    =="American Indian"R1.01.001=="Abenaki"Not allowed to edit this column once saved in the database. </summary>
    </column>
    <column order="3" name="Description" type="varchar(255)">
      <summary>Description.</summary>
    </column>
  </table>
  <table name="cdspermission">
    <summary>User to specify user level permissions used for CDS interventions.  Unlike normal permissions and security, each permission has its own column and each employee has their own row.</summary>
    <column order="0" name="CDSPermissionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  </summary>
    </column>
    <column order="2" name="SetupCDS" type="tinyint(4)">
      <summary>True if allowed to edit EHR Triggers.</summary>
    </column>
    <column order="3" name="ShowCDS" type="tinyint(4)">
      <summary>True if user should see EHR triggers that are enabled.  If false, no CDS interventions will show.</summary>
    </column>
    <column order="4" name="ShowInfobutton" type="tinyint(4)">
      <summary>True if user can see Infobutton.</summary>
    </column>
    <column order="5" name="EditBibliography" type="tinyint(4)">
      <summary>True if user can edit to bibliographic information.</summary>
    </column>
    <column order="6" name="ProblemCDS" type="tinyint(4)">
      <summary>True to enable Problem based CDS interventions for this user.</summary>
    </column>
    <column order="7" name="MedicationCDS" type="tinyint(4)">
      <summary>True to enable Medication based CDS interventions for this user.</summary>
    </column>
    <column order="8" name="AllergyCDS" type="tinyint(4)">
      <summary>True to enable Allergy based CDS interventions for this user.</summary>
    </column>
    <column order="9" name="DemographicCDS" type="tinyint(4)">
      <summary>True to enable Demographic based CDS interventions for this user.</summary>
    </column>
    <column order="10" name="LabTestCDS" type="tinyint(4)">
      <summary>True to enable Lab Test based CDS interventions for this user.</summary>
    </column>
    <column order="11" name="VitalCDS" type="tinyint(4)">
      <summary>True to enable Vital Sign based CDS interventions for this user.</summary>
    </column>
  </table>
  <table name="centralconnection">
    <summary>Used by the Central Manager.  Stores the information needed to establish a connection to a remote database.</summary>
    <column order="0" name="CentralConnectionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ServerName" type="varchar(255)">
      <summary>If direct db connection.  Can be ip address.</summary>
    </column>
    <column order="2" name="DatabaseName" type="varchar(255)">
      <summary>If direct db connection.</summary>
    </column>
    <column order="3" name="MySqlUser" type="varchar(255)">
      <summary>If direct db connection.</summary>
    </column>
    <column order="4" name="MySqlPassword" type="varchar(255)">
      <summary>If direct db connection.  Symmetrically encrypted.</summary>
    </column>
    <column order="5" name="ServiceURI" type="varchar(255)">
      <summary>If connecting to the web service. Can be on VPN, or can be over https.</summary>
    </column>
    <column order="6" name="OdUser" type="varchar(255)">
      <summary>Deprecated.  If connecting to the web service.</summary>
    </column>
    <column order="7" name="OdPassword" type="varchar(255)">
      <summary>Deprecated.  If connecting to the web service.  Symmetrically encrypted.</summary>
    </column>
    <column order="8" name="Note" type="text">
      <summary>When being used by ConnectionStore xml file, must deserialize to a ConnectionNames enum value. Otherwise just used as a generic notes field.</summary>
    </column>
    <column order="9" name="ItemOrder" type="int(11)">
      <summary>0-based.</summary>
    </column>
    <column order="10" name="WebServiceIsEcw" type="tinyint(4)">
      <summary>If set to true, the password hash is calculated differently.</summary>
    </column>
    <column order="11" name="ConnectionStatus" type="varchar(255)">
      <summary>Contains the most recent information about this connection.  OK if no problems, version information if version mismatch, nothing for not checked, and OFFLINE if previously couldn't connect.</summary>
    </column>
    <column order="12" name="HasClinicBreakdownReports" type="tinyint(4)">
      <summary>If set to True, display clinic breakdown in reports, else only show practice totals.</summary>
    </column>
  </table>
  <table name="cert">
    <summary>A single certification that any employee may complete.</summary>
    <column order="0" name="CertNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="WikiPageLink" type="varchar(255)">
      <summary>The exact name of a wiki page.</summary>
    </column>
    <column order="3" name="ItemOrder" type="int(11)">
      <summary>0-indexed.  This is a little tricky because a cert can be in multiple categories.  So users can only reorder when they are looking at the entire list of certs not ordered by category.</summary>
    </column>
    <column order="4" name="IsHidden" type="tinyint(4)">
      <summary>If hidden, then this cert won't normally show in the main list.</summary>
    </column>
    <column order="5" name="CertCategoryNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.</summary>
    </column>
  </table>
  <table name="certemployee">
    <summary>A certification completed by an employee on a specific date.</summary>
    <column order="0" name="CertEmployeeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CertNum" type="bigint(20)" fk="cert">
      <summary>FK to cert.CertNum.</summary>
    </column>
    <column order="2" name="EmployeeNum" type="bigint(20)" fk="employee">
      <summary>FK to employee.EmployeeNum.</summary>
    </column>
    <column order="3" name="DateCompleted" type="date">
      <summary></summary>
    </column>
    <column order="4" name="Note" type="varchar(255)">
      <summary>Rarely, a very short note is required.</summary>
    </column>
    <column order="5" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user who made this entry.  Usually some sort of supervisor.</summary>
    </column>
  </table>
  <table name="chartview">
    <summary>Enables viewing a variety of views in chart module.</summary>
    <column order="0" name="ChartViewNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Description of this view.  Gets displayed at top of Progress Notes grid.</summary>
    </column>
    <column order="2" name="ItemOrder" type="int(11)">
      <summary>0-based order to display in lists.</summary>
    </column>
    <column order="3" name="ProcStatuses" type="tinyint(4)">
      <summary>Enum:ChartViewProcStat None=0,TP=1,Complete=2,Existing Cur Prov=4,Existing Other Prov=8,Referred=16,Deleted=32,Condition=64,All=127.</summary>
      <Enumeration name="ChartViewProcStat">
        <summary></summary>
        <EnumValue name="None">0- None.</EnumValue>
        <EnumValue name="TP">1- Treatment Plan.</EnumValue>
        <EnumValue name="C">2- Complete.</EnumValue>
        <EnumValue name="EC">4- Existing Current Provider.</EnumValue>
        <EnumValue name="EO">8- Existing Other Provider.</EnumValue>
        <EnumValue name="R">16- Referred Out.</EnumValue>
        <EnumValue name="D">32- Deleted.</EnumValue>
        <EnumValue name="Cn">64- Condition.</EnumValue>
        <EnumValue name="All">127- All.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ObjectTypes" type="smallint(6)">
      <summary>Enum:ChartViewObjs None=0,Appointments=1,Comm Log=2,Comm Log Family=4,Tasks=8,Email=16,LabCases=32,Rx=64,Sheets=128,Comm Log Super Family=256,All=511.</summary>
      <Enumeration name="ChartViewObjs">
        <summary></summary>
        <EnumValue name="None">0- None</EnumValue>
        <EnumValue name="Appointments">1- Appointments</EnumValue>
        <EnumValue name="CommLog">2- Comm Log</EnumValue>
        <EnumValue name="CommLogFamily">4- Comm Log Family</EnumValue>
        <EnumValue name="Tasks">8- Tasks</EnumValue>
        <EnumValue name="Email">16- Email</EnumValue>
        <EnumValue name="LabCases">32- Lab Cases</EnumValue>
        <EnumValue name="Rx">64- Rx</EnumValue>
        <EnumValue name="Sheets">128- Sheets</EnumValue>
        <EnumValue name="CommLogSuperFamily">256- Comm Log Super Family</EnumValue>
        <EnumValue name="All">511- All</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="ShowProcNotes" type="tinyint(4)">
      <summary>Set true to show procedure notes.</summary>
    </column>
    <column order="6" name="IsAudit" type="tinyint(4)">
      <summary>Set true to enable audit mode.</summary>
    </column>
    <column order="7" name="SelectedTeethOnly" type="tinyint(4)">
      <summary>Set true to only show information regarding the selected teeth.</summary>
    </column>
    <column order="8" name="OrionStatusFlags" type="int(11)">
      <summary>Enum:OrionStatus Which orion statuses to show. Will be zero if not orion.</summary>
      <Enumeration name="OrionStatus">
        <summary></summary>
        <EnumValue name="None">0- None.  While a normal orion proc would never have this status2, it is still needed for flags in ChartViews.  And it's also possible that a status2 slipped through the cracks and was not assigned, leaving it with this value.</EnumValue>
        <EnumValue name="TP">1– Treatment planned</EnumValue>
        <EnumValue name="C">2– Completed</EnumValue>
        <EnumValue name="E">4– Existing prior to incarceration</EnumValue>
        <EnumValue name="R">8– Refused treatment</EnumValue>
        <EnumValue name="RO">16– Referred out to specialist</EnumValue>
        <EnumValue name="CS">32– Completed by specialist</EnumValue>
        <EnumValue name="CR">64– Completed by registry</EnumValue>
        <EnumValue name="CA_Tx">128- Cancelled, tx plan changed</EnumValue>
        <EnumValue name="CA_EPRD">256- Cancelled, eligible parole</EnumValue>
        <EnumValue name="CA_PD">512- Cancelled, parole/discharge</EnumValue>
        <EnumValue name="S">1024– Suspended, unacceptable plaque</EnumValue>
        <EnumValue name="ST">2048- Stop clock, multi visit</EnumValue>
        <EnumValue name="W">4096– Watch</EnumValue>
        <EnumValue name="A">8192– Alternative</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="DatesShowing" type="tinyint(4)">
      <summary>Enum:ChartViewDates All,Today,Yesterday,ThisYear,LastYear</summary>
      <Enumeration name="ChartViewDates">
        <summary></summary>
        <EnumValue name="All">0- All</EnumValue>
        <EnumValue name="Today">1- Today</EnumValue>
        <EnumValue name="Yesterday">2- Yesterday</EnumValue>
        <EnumValue name="ThisYear">3- This Year</EnumValue>
        <EnumValue name="LastYear">4- Last Year</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="IsTpCharting" type="tinyint(4)">
      <summary>set true to show treatment plan controls in chart module.</summary>
    </column>
  </table>
  <table name="chat">
    <summary>A single chat object can contain any number of users. The users attached to a chat can change over time as users are removed or added. A chat can be named. It can contain any number of chatMessages. Visibility of messages to a user is based on whether they are currently attached. The chat feature works out of the box for all normal OD customers. It runs as a separate .exe so that it can run even when the main OD program has a dialog open or is shut down for update. Every workstation that's using chat will poll the database about every 5 seconds. This might cause slowness in larger offices, so they will want to use one or more of the following advanced features: You can set up a read-only slave database in OD, and the chat will automatically use it for frequent read operations. If you want to use the mobile app, you will need to download and install a windows service to sit between the db and all mobile users. We might install this windows service by default for all users just in case, but at least the exe will be in the normal OD folder. If you want to use a dedicated db for chat, that's a manual process that involves moving those 6 tables to their own db with no other tables in it, and then setting the prefs ChatServer... from in the prefs window.</summary>
    <column order="0" name="ChatNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Name" type="varchar(255)">
      <summary></summary>
    </column>
  </table>
  <table name="chatattach">
    <summary>An image or file attached to a chat message. Always stored entirely in db to avoid file permission issues and to allow mobile use. To support massive scalability, the plan is to eventually support a dedicated db for chat if a larger office desires.</summary>
    <column order="0" name="ChatAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ChatMsgNum" type="bigint(20)" fk="chatmsg">
      <summary>FK to chatmsg.ChatMsgNum.</summary>
    </column>
    <column order="2" name="FileName" type="varchar(255)">
      <summary>Any filename plus extension. It will show to the user in some cases like a pdf. Doesn't need to be unique, so many might just be Image.png.</summary>
    </column>
    <column order="3" name="Thumbnail" type="mediumblob">
      <summary>This is a pretty big thumbnail, but much smaller than the FileData. Max 150 pixels width or height. Same proportions as original image. Stored as png. Not always present. For example a PDF would not have a thumbnail.</summary>
    </column>
    <column order="4" name="FileData" type="mediumblob">
      <summary>mediumblob can hold up to 16,777,215 bytes. Stored as png. User gets an error message if they try to attach bigger. This doesn't get downloaded from db unless user manually clicks to open a file or image.</summary>
    </column>
  </table>
  <table name="chatmsg">
    <summary>An individual message on a chat.</summary>
    <column order="0" name="ChatMsgNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ChatNum" type="bigint(20)" fk="chat">
      <summary>FK to chat.ChatNum.</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The author of this msg</summary>
    </column>
    <column order="3" name="DateTimeSent" type="datetime">
      <summary>The DateTime this message was added to the Db. Uses server time.</summary>
    </column>
    <column order="4" name="Message" type="text">
      <summary>If the EventType is None, this is a standard XAML FlowDocument with bold, etc. Emojis are in runs as plain text tokens like :thumbsup:. For User Added/Removed messages, this is plain text that is displayed without formatting.</summary>
    </column>
    <column order="5" name="SeqCount" type="bigint(20)">
      <summary>See SequenceCounter.cs table for information on how this is used. More accurate than using a datetime cutoff for getting new messages.</summary>
    </column>
    <column order="6" name="Quote" type="bigint(20)" fk="chatmsg">
      <summary>FK to chatmsg.ChatMsgNum. A reference to this quote will show above this message. You can click on it to go to the original.</summary>
    </column>
    <column order="7" name="EventType" type="tinyint(4)">
      <summary>Some messages aren't messages, but are instead event notifications. This tells us which kind of event. This is on the ChatMsg table so that the clients can just pull from this single table every 5 seconds and also simultaneously be notified about other events. Most event types are always deleted when a new row of that type supercedes it, because we only care about the most recent. UsersChanged events are different. They have messages that are shown to the user in the stack of msgs for a chat, so they don't get deleted. Also see ChatUserAttach.DateTimeRemoved which is related but used for completely different purposes.</summary>
    </column>
    <column order="8" name="IsImportant" type="tinyint(4)">
      <summary></summary>
    </column>
  </table>
  <table name="chatreaction">
    <summary>A single reaction to a chat msg.</summary>
    <column order="0" name="ChatReactionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ChatMsgNum" type="bigint(20)" fk="chatmsg">
      <summary>FK to chatmsg.ChatMsgNum.</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The author of this reaction.</summary>
    </column>
    <column order="3" name="EmojiName" type="varchar(255)">
      <summary>One from the list of 192 that we use. Example: "Angry face with horns". Colons are not used here.</summary>
    </column>
  </table>
  <table name="chatuserattach">
    <summary>Attaches a user to a chat. When the user leaves the chat, this object gets deleted. Also keeps track of whether that user has any new messages. </summary>
    <column order="0" name="ChatUserAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. User being attached to the chat.</summary>
    </column>
    <column order="2" name="ChatNum" type="bigint(20)" fk="chat">
      <summary>FK to chat.ChatNum. Chat to attach user to.</summary>
    </column>
    <column order="3" name="IsRead" type="tinyint(4)">
      <summary>True if the user has read the most recent message in the chat. If false, it will show bold in their list. Each time a msg is added, all these flags for the chat get set to false. No need to do anything if adding a user to a chat becaue it's already false.</summary>
    </column>
    <column order="4" name="DateTimeRemoved" type="datetime">
      <summary>Also see chatmsg.EventType UsersChanged which is for displaying to users. This field is closely related but used for a different purpose. This is used when getting a list of chats because we need to not consider msgs after this date for sorting purposes. This chat will still show for the user, but will fall gradually into the past instead of popping to the top again. It's also used to suppress showing any recent msgs in the list of msgs for a chat. It also prevents any new msg notifications and makes the user not show as part of the group.</summary>
    </column>
    <column order="5" name="IsMute" type="tinyint(4)">
      <summary></summary>
    </column>
  </table>
  <table name="chatuserod">
    <summary>Status and options for a user. Name is pulled from Userod table. A new ChatUserod will be created the first time it's needed if it doesn't already exist.</summary>
    <column order="0" name="ChatUserodNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. One one row per user</summary>
    </column>
    <column order="2" name="UserStatus" type="tinyint(4)">
      <summary>Enum:EnumUserStatus Available, Away, DoNotDisturb.  If the user is linked to an Employee in OD, then this status will mirror the clocked in status. If there is no linkage, then it's based on whether PC gets locked from inactivity</summary>
      <Enumeration name="EnumUserStatus">
        <summary></summary>
      </Enumeration>
    </column>
    <column order="3" name="DateTimeStatusReset" type="datetime">
      <summary>User can manually change status for a duration. That duration is translated into this reset time for when the status gets reset automatically.</summary>
    </column>
    <column order="4" name="Photo" type="text">
      <summary>Any photo. The import process resamples it to 100 pixels high with proportional width to the original. The crop is stored separately in PhotoCrop. Text, so max length=65k base64.</summary>
    </column>
    <column order="5" name="PhotoCrop" type="varchar(255)">
      <summary>This is a composite of 3 numbers that determine the size and position of the circle crop. Diameter of the circle is in pixels. X,Y is the position of the center of the circle within the Photo. Format is "D,X,Y". The numbers are all double, rounded to 1/10th of a pixel. Example: 70,60.1,47.3</summary>
    </column>
    <column order="6" name="OpenBackground" type="tinyint(4)">
      <summary>If true, when auto starting, the main window will not open. Instead, just the tray icon will show. This does not apply to manually starting.</summary>
    </column>
    <column order="7" name="CloseKeepRunning" type="tinyint(4)">
      <summary>If true, when closing, the main window will close, but the tray icon will continue to show.</summary>
    </column>
    <column order="8" name="MuteNotifications" type="tinyint(4)">
      <summary>If true, no regular notifications will pop up.</summary>
    </column>
    <column order="9" name="DismissNotifySecs" type="int(11)">
      <summary>The number of seconds for a regular popup to show before it goes away on its own. If 0, it will show a default of 5 seconds. Max 2_147_483 seconds, which is int max divided by 1000.</summary>
    </column>
    <column order="10" name="MuteImportantNotifications" type="tinyint(4)">
      <summary>If true, important notifications will be treated the same as normal notifications. This would be unusual and this would normally be false.</summary>
    </column>
    <column order="11" name="DismissImportantNotifySecs" type="int(11)">
      <summary>The number of seconds for an important popup to show before it goes away on its own. If 0, it will show a default of 99,999, a little over a day. Max 2_147_483 seconds, which is int max divided by 1000.</summary>
    </column>
    <column order="12" name="PlayNotificationSound" type="tinyint(4)">
      <summary> If true, play a sound when a user recieves a chat message.Defaults to false.</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="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Must always match claimProc.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,R, or I.  U=Unsent, H=Hold Until Prior received, W=Waiting in queue, S=Sent, R=Received, I=Hold for In Process.  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="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum.  Every claim is attached to one plan.</summary>
    </column>
    <column order="7" name="ProvTreat" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Treating provider for dental claims.  For institutional claims, this is called the attending 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 predetermination of benefits number received from ins.  In X12, REF G3.</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(400)">
      <summary>Note to be sent to insurance. Max 400 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="bigint(20)" 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="bigint(20)" 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></summary>
        <EnumValue name="Office">0. Code 11</EnumValue>
        <EnumValue name="PatientsHome">1. Code 12</EnumValue>
        <EnumValue name="InpatHospital">2. Code 21</EnumValue>
        <EnumValue name="OutpatHospital">3. Code 22</EnumValue>
        <EnumValue name="SkilledNursFac">4. Code 31</EnumValue>
        <EnumValue name="CustodialCareFacility">5. Code 33.  In X12, a similar code AdultLivCareFac 35 is mentioned.</EnumValue>
        <EnumValue name="OtherLocation">6. Code 99.  We use 11 for office.</EnumValue>
        <EnumValue name="MobileUnit">7. Code 15</EnumValue>
        <EnumValue name="School">8. Code 03</EnumValue>
        <EnumValue name="MilitaryTreatFac">9. Code 26</EnumValue>
        <EnumValue name="FederalHealthCenter">10. Code 50</EnumValue>
        <EnumValue name="PublicHealthClinic">11. Code 71</EnumValue>
        <EnumValue name="RuralHealthClinic">12. Code 72</EnumValue>
        <EnumValue name="EmergencyRoomHospital">13. Code 23</EnumValue>
        <EnumValue name="AmbulatorySurgicalCenter">14. Code 24</EnumValue>
        <EnumValue name="TelehealthOutsideHome">15. Code 02.</EnumValue>
        <EnumValue name="TelehealthInHome">16. Code 10</EnumValue>
        <EnumValue name="OutreachSiteOrStreet">17. Code 27</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.  Canada only.</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>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</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, although we allow greater than or equal to 0.</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="bigint(20)" 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="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0 if no clinic.  Since one claim cannot have procs from multiple clinics, the clinicNum is set when creating the claim and then cannot be changed.  The claim would have to be deleted and recreated.  Otherwise, if changing at the claim level, a feature would have to be added that synched all procs, claimprocs, and probably some other tables.</summary>
    </column>
    <column order="35" name="ClaimForm" type="bigint(20)" fk="claimform">
      <summary>FK to claimform.ClaimFormNum.  0 if not assigned to use the claimform for the insplan.</summary>
    </column>
    <column order="36" name="AttachedImages" type="int(11)">
      <summary>The number of intraoral images attached.  Not the number of files attached.  This is the value that goes on the 2006 claimform.</summary>
    </column>
    <column order="37" name="AttachedModels" type="int(11)">
      <summary>The number of models attached.</summary>
    </column>
    <column order="38" name="AttachedFlags" type="varchar(255)">
      <summary>A comma-delimited set of flag keywords.  Can have one or more of the following: EoB,Note,Perio,Misc,Unsup.  Must also contain one of these: Mail or Elect. Additionally, the Submitted flag is for determining when DentalXChange attachment was submitted.</summary>
    </column>
    <column order="39" name="AttachmentID" type="varchar(255)">
      <summary>Example: NEA#1234567 or dxc123456789.  If present, and if the claim note does not already start with this Id, then it will be prepended to the claim note for both e-claims and mail.  If using e-claims, this same ID will be used for all PWK segements.</summary>
    </column>
    <column order="40" name="CanadianMaterialsForwarded" type="varchar(10)">
      <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="41" name="CanadianReferralProviderNum" type="varchar(20)">
      <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="42" name="CanadianReferralReason" type="tinyint(4)">
      <summary>B06.  A number 0(none) through 13.</summary>
    </column>
    <column order="43" name="CanadianIsInitialLower" type="varchar(5)">
      <summary>F18.  Y, N, or X(not a lower denture, crown, or bridge).</summary>
    </column>
    <column order="44" name="CanadianDateInitialLower" type="date">
      <summary>F19.  Mandatory if F18 is N.</summary>
    </column>
    <column order="45" name="CanadianMandProsthMaterial" type="tinyint(4)">
      <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="46" name="CanadianIsInitialUpper" type="varchar(5)">
      <summary>F15.  Y, N, or X(not an upper denture, crown, or bridge).</summary>
    </column>
    <column order="47" name="CanadianDateInitialUpper" type="date">
      <summary>F04.  Mandatory if F15 is N.</summary>
    </column>
    <column order="48" name="CanadianMaxProsthMaterial" type="tinyint(4)">
      <summary>F20.  If crown, not required.  If denture or bridge, required if F15 is N.  0 indicates empty response.  Single digit number code, 1-6.  We added type 7, which is crown.</summary>
    </column>
    <column order="49" name="InsSubNum" type="bigint(20)" fk="inssub">
      <summary>FK to inssub.InsSubNum.</summary>
    </column>
    <column order="50" name="InsSubNum2" type="bigint(20)" fk="inssub">
      <summary>FK to inssub.InsSubNum.  The fk to the 'Other' insurance subscriber.  For a primary claim, this will be the secondary insurance
            subscriber.  For a secondary claim, this will be primary insurance subscriber.</summary>
    </column>
    <column order="51" name="CanadaTransRefNum" type="varchar(255)">
      <summary>G01 assigned by carrier/network and returned in acks.  Used for claim reversal.  For Claim Acknowledgements, this can sometimes
            be a series of spaces, which means the number is effectively empty.  This happens when the Claim Acknowledgement is forwarded to the carrier
            as part of a batch.</summary>
    </column>
    <column order="52" name="CanadaEstTreatStartDate" type="date">
      <summary>F37 Used for predeterminations.</summary>
    </column>
    <column order="53" name="CanadaInitialPayment" type="double">
      <summary>F28 Used for predeterminations.</summary>
    </column>
    <column order="54" name="CanadaPaymentMode" type="tinyint">
      <summary>F29 Used for predeterminations.</summary>
    </column>
    <column order="55" name="CanadaTreatDuration" type="tinyint">
      <summary>F30 Used for predeterminations.</summary>
    </column>
    <column order="56" name="CanadaNumAnticipatedPayments" type="tinyint">
      <summary>F31 Used for predeterminations.</summary>
    </column>
    <column order="57" name="CanadaAnticipatedPayAmount" type="double">
      <summary>F32 Used for predeterminations.</summary>
    </column>
    <column order="58" name="PriorAuthorizationNumber" type="varchar(255)">
      <summary>This is NOT the predetermination of benefits number.  In X12, this is REF G1.</summary>
    </column>
    <column order="59" name="SpecialProgramCode" type="tinyint(4)">
      <summary>Enum:EnumClaimSpecialProgram  This is used to track EPSDT.</summary>
      <Enumeration name="EnumClaimSpecialProgram">
        <summary>0=none, 1=EPSDT_1, 2=Handicapped_2, 3=SpecialFederal_3, (no 4), 5=Disability_5, 9=SecondOpinion_9</summary>
        <EnumValue name="none"></EnumValue>
        <EnumValue name="EPSDT_1"></EnumValue>
        <EnumValue name="Handicapped_2"></EnumValue>
        <EnumValue name="SpecialFederal_3"></EnumValue>
        <EnumValue name="Disability_5"></EnumValue>
        <EnumValue name="SecondOpinion_9"></EnumValue>
      </Enumeration>
    </column>
    <column order="60" name="UniformBillType" type="varchar(255)">
      <summary>A three digit number used on 837I.  Aka Bill Code.  UBO4 4.  Examples: 321,823,131,652.  The third digit is claim frequency code.  If this is used, then our CorrectionType should be 0=original.</summary>
    </column>
    <column order="61" name="MedType" type="tinyint(4)">
      <summary>Enum:EnumClaimMedType 0=Dental, 1=Medical, 2=Institutional</summary>
      <Enumeration name="EnumClaimMedType">
        <summary></summary>
        <EnumValue name="Dental">0</EnumValue>
        <EnumValue name="Medical">1</EnumValue>
        <EnumValue name="Institutional">2</EnumValue>
      </Enumeration>
    </column>
    <column order="62" name="AdmissionTypeCode" type="varchar(255)">
      <summary>Used for inst claims. Single digit.  X12 2300 CL101.  UB04 14.  Should only be required for IP, but X12 clearly states required for all.</summary>
    </column>
    <column order="63" name="AdmissionSourceCode" type="varchar(255)">
      <summary>Used for inst claims. Single char.  X12 2300 CL102.  UB04 15.  Should only be required for IP, but X12 clearly states required for all.</summary>
    </column>
    <column order="64" name="PatientStatusCode" type="varchar(255)">
      <summary>Used for inst claims. Two digit.  X12 2300 CL103.  UB04 17.  Should only be required for IP, but X12 clearly states required for all.</summary>
    </column>
    <column order="65" name="CustomTracking" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Most users will leave this blank.  Some offices may set up tracking statuses such as 'review', 'hold', 'riskmanage', etc.</summary>
    </column>
    <column order="66" name="DateResent" type="date">
      <summary>Used for historical purposes only, not sent electronically. Automatically set when CorrectionType is original and the claim is resent.</summary>
    </column>
    <column order="67" name="CorrectionType" type="tinyint(4)">
      <summary>Enum:ClaimCorrectionType X12 CLM05-3. Usually set to original, but can be used to resubmit claims.  Also used in 1500 Medical Claim Form field 22.</summary>
      <Enumeration name="ClaimCorrectionType">
        <summary></summary>
        <EnumValue name="Original">0 - X12 1. Use for claims that are not ongoing.</EnumValue>
        <EnumValue name="Replacement">1 - X12 7. Use to entirely replace an original claim. A claim reference number will be required.</EnumValue>
        <EnumValue name="Void">2 - X12 8. Use to undo an original claim. A claim reference number will be required.</EnumValue>
      </Enumeration>
    </column>
    <column order="68" name="ClaimIdentifier" type="varchar(255)">
      <summary>X12 CLM01. Semi-unique identifier for the claim within the current database. Defaults to PatNum/ClaimNum, but can be edited by user, and is often modified by the clearinghouse to ensure uniqueness on their end.
            This also set for PreAuth claims.  The ClaimIdentifier for a PreAuth will probably not match the ClaimIdentifier for a regular claim, which makes ERA claim matching more straight forward for both PreAuths and regular claims.</summary>
    </column>
    <column order="69" name="OrigRefNum" type="varchar(255)">
      <summary>X12 2300 REF (F8). Used when resending claims to refer to the original claim. The user must type this value in after reading it from the original claim response report.</summary>
    </column>
    <column order="70" name="ProvOrderOverride" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Ordering provider override.  Goes hand-in-hand with OrderingReferralNum.  Medical eclaims only.
            Defaults to zero.</summary>
    </column>
    <column order="71" name="OrthoTotalM" type="tinyint">
      <summary>Total estimated months of ortho.  Valid values are 1-36, although we allow greater than or equal to 0.</summary>
    </column>
    <column order="72" name="ShareOfCost" type="double">
      <summary>Sum of all amounts paid specifically to this claim by the patient or family.
            Goes out in X12 4010/5010 loop 2300 AMT segment if greater than zero.  Default value is 0, thus will not go out by default unless the user
            enters a value.  This field was added for Denti-Cal certification, but can go out for any clearinghouse.</summary>
    </column>
    <column order="73" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="74" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="75" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="76" name="OrderingReferralNum" type="bigint(20)" fk="referral">
      <summary>FK to referral.ReferralNum.  Goes hand-in-hand with ProvOrderOverride.  Medical eclaims only.  Defaults to zero.
            If set, and the ProvOrderOverride is not set, then this referral will go out at the ordering provider on medical e-claims.</summary>
    </column>
    <column order="77" name="DateSentOrig" type="date">
      <summary>The original date the claim was sent.</summary>
    </column>
    <column order="78" name="DateIllnessInjuryPreg" type="date">
      <summary>Date of Current Illness, Injury, or Pregnancy (LMP).  (LMP = Last Menstrual Period)  For use in 1500 Medical Claim Form box 14.
            Identifies the first date of onset of illness, the actual date of injury, or the LMP for pregnancy.</summary>
    </column>
    <column order="79" name="DateIllnessInjuryPregQualifier" type="smallint(6)">
      <summary>Enum:DateIllnessInjuryPregQualifier 3 digit code used in 1500 Medical Claim Form, 'Qual' box of field 14.  Valid values are 431 or 484.</summary>
      <Enumeration name="DateIllnessInjuryPregQualifier">
        <summary>Non-standard enum numbering.</summary>
        <EnumValue name="None">0 - None</EnumValue>
        <EnumValue name="OnsetCurSymptoms">431 - Onset of Current Symptoms or Illness</EnumValue>
        <EnumValue name="LastMenstrualPeriod">484 - Last Menstrual Period</EnumValue>
      </Enumeration>
    </column>
    <column order="80" name="DateOther" type="date">
      <summary>Another date related to the patient's condition or treatment.  For use in 1500 Medical Claim Form box 15.</summary>
    </column>
    <column order="81" name="DateOtherQualifier" type="smallint(6)">
      <summary>Enum:DateOtherQualifier 3 digit code used in 1500 Medical Claim Form, 'Qual' box of field 15.  Valid values are 090, 091, 304, 439, 444,
            453,454, 455, and 471.</summary>
      <Enumeration name="DateOtherQualifier">
        <summary>Used for 1500 Medical Claim Form, 'Qual' box portion of fields 14 and 15.  Populate with 3 digit enum value. Non-standard enum numbering.</summary>
        <EnumValue name="None">0 - None</EnumValue>
        <EnumValue name="ReportStart">090 - Report Start</EnumValue>
        <EnumValue name="ReportEnd">091 - Report End</EnumValue>
        <EnumValue name="LatestVisitConsult">304 - Latest Visit or Consultation</EnumValue>
        <EnumValue name="Accident">439 - Accident</EnumValue>
        <EnumValue name="FirstVisitConsult">444 - First Visit or Consultation</EnumValue>
        <EnumValue name="ChronicCondManifest">453 - Acute Manifestation of a Chronic Condition</EnumValue>
        <EnumValue name="InitialTreatment">454 - Initial Treatment</EnumValue>
        <EnumValue name="LastXray">455 - Last X-ray</EnumValue>
        <EnumValue name="Prescription">471 - Prescription</EnumValue>
      </Enumeration>
    </column>
    <column order="82" name="IsOutsideLab" type="tinyint(4)">
      <summary>Used in 1500 Medical Claim Form field 20.  Place an 'X' the 'Yes' if true and the 'No' if false.</summary>
    </column>
    <column order="83" name="SecurityHash" type="varchar(255)">
      <summary>Holds the salted hash of the following claim fields: ClaimFee, ClaimStatus, InsPayEst, InsPayAmt.</summary>
    </column>
    <column order="84" name="Narrative" type="text">
      <summary>A note that pertains to all attachments on the claim. Currently only applies to DentalXChange, but could be expanded. 2000 character limit put in place by DentalXChange.</summary>
    </column>
  </table>
  <table name="claimattach">
    <summary>Keeps track of one image file attached to a claim.  Multiple files can be attached to a claim using this method. DentalXChange uses the term "attachment" differently, referring to a group of images.</summary>
    <column order="0" name="ClaimAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClaimNum" type="bigint(20)" fk="claim">
      <summary>FK to claim.ClaimNum</summary>
    </column>
    <column order="2" name="DisplayedFileName" type="varchar(255)">
      <summary>The name of the file that shows on the claim.  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.  (yes, even though it's not actually an email attachment)  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>
    <column order="4" name="ImageReferenceId" type="int(11)">
      <summary>This is the image Id that DentalXChange gives back after calling addImage(). Storing this will allow users to delete images they sent to DentalXChange.</summary>
    </column>
  </table>
  <table name="claimcondcodelog">
    <summary>There is either one or zero per claim.</summary>
    <column order="0" name="ClaimCondCodeLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClaimNum" type="bigint(20)" fk="claim">
      <summary>FK to claim.ClaimNum.</summary>
    </column>
    <column order="2" name="Code0" type="varchar(2)">
      <summary>Corresponds with condition code 18 on the UB04.</summary>
    </column>
    <column order="3" name="Code1" type="varchar(2)">
      <summary>Corresponds with condition code 19 on the UB04.</summary>
    </column>
    <column order="4" name="Code2" type="varchar(2)">
      <summary>Corresponds with condition code 20 on the UB04.</summary>
    </column>
    <column order="5" name="Code3" type="varchar(2)">
      <summary>Corresponds with condition code 21 on the UB04.</summary>
    </column>
    <column order="6" name="Code4" type="varchar(2)">
      <summary>Corresponds with condition code 22 on the UB04.</summary>
    </column>
    <column order="7" name="Code5" type="varchar(2)">
      <summary>Corresponds with condition code 23 on the UB04.</summary>
    </column>
    <column order="8" name="Code6" type="varchar(2)">
      <summary>Corresponds with condition code 24 on the UB04.</summary>
    </column>
    <column order="9" name="Code7" type="varchar(2)">
      <summary>Corresponds with condition code 25 on the UB04.</summary>
    </column>
    <column order="10" name="Code8" type="varchar(2)">
      <summary>Corresponds with condition code 26 on the UB04.</summary>
    </column>
    <column order="11" name="Code9" type="varchar(2)">
      <summary>Corresponds with condition code 27 on the UB04.</summary>
    </column>
    <column order="12" name="Code10" type="varchar(2)">
      <summary>Corresponds with condition code 28 on the UB04.</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="bigint(20)">
      <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>Deprecated as of version 17.2. Internal claimforms have been moved over to XML files in OpenDentBusiness.Properties.Resources.</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>
    <column order="9" name="Width" type="int(11)">
      <summary>The width of the claim form.</summary>
    </column>
    <column order="10" name="Height" type="int(11)">
      <summary>The height of the claim form.</summary>
    </column>
  </table>
  <table name="claimformitem">
    <summary>One item is needed for each field on a claimform.</summary>
    <column order="0" name="ClaimFormItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClaimFormNum" type="bigint(20)" 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="bigint(20)">
      <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="text">
      <summary>Note for this check if needed. Size limit is 65k because this field is used for automated incoming notes.</summary>
    </column>
    <column order="6" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0 if no clinic (unassigned).</summary>
    </column>
    <column order="7" name="DepositNum" type="bigint(20)" 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.  We use this because the CarrierNums could conceivably be different for the different claimprocs attached.</summary>
    </column>
    <column order="9" name="DateIssued" type="date">
      <summary>Date that the carrier issued the check. Date on the check.</summary>
    </column>
    <column order="10" name="IsPartial" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="11" name="PayType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  0 if not attached to any definitions</summary>
    </column>
    <column order="12" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="13" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="14" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="15" name="PayGroup" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  The payment group for this claim payment.</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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum.  Is 0 for payments by total or for Canadian Carrier Issued Procedures.</summary>
    </column>
    <column order="2" name="ClaimNum" type="bigint(20)" fk="claim">
      <summary>FK to claim.ClaimNum.  Is 0 for estimates, adjustments and capitation (CapClaim and CapComplete).</summary>
    </column>
    <column order="3" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Must always match claim.PatNum</summary>
    </column>
    <column order="4" name="ProvNum" type="bigint(20)" 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 standard provider fees, then this field will contain the standard provider fee instead of the fee that the patient was charged. A zero dollar FeeBilled means this claimproc can represent an insurance under/over payment, total payment, or a proc only really meant to provide information to insurance.</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 when sent to ins.</summary>
    </column>
    <column order="7" name="DedApplied" type="double">
      <summary>0 if blank.  Deductible applied to this procedure only. Only for procedures attached to claims.  Otherwise, the DedEst and DedEstOverride are used.</summary>
    </column>
    <column order="8" name="Status" type="tinyint">
      <summary>Enum:ClaimProcStatus .  When setting recieved\supplemental must set DateEntry.</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>
        <EnumValue name="InsHist">9: For InsHist procedures. Corresponds to Existing Other (EO) procs.</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="bigint(20)" fk="claimpayment">
      <summary>FK to claimpayment.ClaimPaymentNum(the insurance check).</summary>
    </column>
    <column order="12" name="PlanNum" type="bigint(20)" 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. Once a payment has been attached, the DateCP will exactly match 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.  The writeoff estimate goes in a different column.  This is filled with the WriteOffEst value when a claim is created.</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>The allowed fee (not the override) is a complex calculation which is performed on the fly in Procedure.ComputeEstimates/ClaimProc.ComputeBaseEst.  It is the amount that the percentage is based on.  If this carrier has a lower UCR than the standard fee for the office, then the allowed fee is where that is handled.  It can be pulled from an allowed fee schedule.  It is also where substitutions for posterior composites are handled.  The AllowedOverride allows the user to override the calculation.  -1 indicates blank.  A new use of this field is for when entering insurance payments.  On the eob, it will tell you what the allowed/UCR fee is.  The user will now be able to enter this information into the AllowedOverride field.  They will simultaneously pass the info to the allowed fee schedule.  AllowedOverride is never changed automatically by the program except to sometimes set it to -1 if NoBillIns.</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 or uninitialized, but otherwise should be 0 or positive. Calculated automatically. User cannot 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="NoBillIns" type="tinyint">
      <summary>Set to true to not bill to this insurance plan. This gets automatically set only when inserting. It's based on procedurecode.NoBillIns and insplanpreference.ValueString.</summary>
    </column>
    <column order="21" name="PaidOtherIns" type="double">
      <summary>-1 if blank. The amount paid or estimated to be paid by another insurance.  This amount is then subtracted from what the current insurance would pay.  When running the calculation and considering other claimprocs, it will ignore any patPlan with a higher ordinal.  So, always blank for primary claims.  User cannot edit, but can use PaidOtherInsOverride.</summary>
    </column>
    <column order="22" 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 InsEstTotal holds.  BaseEst cannot be overridden by the user.  Instead, the following fields can be manipulated: allowedOverride, CopayOverride, PercentOverride.</summary>
    </column>
    <column order="23" 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="24" name="ProcDate" type="date">
      <summary>Date of the procedure.  Displayed in Edit Claim window procedures grid.  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="25" 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="26" name="LineNumber" type="tinyint">
      <summary>Assigned when claim is created as a way to order the procs showing on a claim.  Indirectly goes out in X12 loop 2400. Used in Canadian eclaims (field F07). One based index. Zero for converted databases.</summary>
    </column>
    <column order="27" name="DedEst" type="double">
      <summary>-1 if blank.  Not sure why we need to allow -1.  Calculated automatically.  User cannot edit, but can use DedEstOverride instead.</summary>
    </column>
    <column order="28" name="DedEstOverride" type="double">
      <summary>-1 if blank.  Overrides the DedEst value.</summary>
    </column>
    <column order="29" name="InsEstTotal" type="double">
      <summary>Always has a value.  BaseEst-(DedEst or DedEstOverride)-PaidOtherIns-OverAnnualMax.  User cannot edit, but can instead use InsEstTotalOverride. Recalculated each time TP is viewed, is saved as the value calculated for the last viewed TP. This variable should probably just be moved to memory and removed as a DB field.</summary>
    </column>
    <column order="30" name="InsEstTotalOverride" type="double">
      <summary>-1 if blank.  Overrides the InsEstTotal value.</summary>
    </column>
    <column order="31" name="PaidOtherInsOverride" type="double">
      <summary>-1 if blank.  Overrides the PaidOtherIns value.</summary>
    </column>
    <column order="32" name="EstimateNote" type="varchar(255)">
      <summary>An automatically generated note that displays information about over max, exclusions, and other limitations for which there are no fields.  Only applies to estimate.  Once it's attached to a claim, similar information can go in the remarks field.</summary>
    </column>
    <column order="33" name="WriteOffEst" type="double">
      <summary>-1 if blank.  The estimated writeoff as calculated by OD.  Usually only used for PPOs. </summary>
    </column>
    <column order="34" name="WriteOffEstOverride" type="double">
      <summary>-1 if blank.  Overrides WriteOffEst.  Usually only used for PPOs.</summary>
    </column>
    <column order="35" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Can be zero.  No user interface for editing.  Forced to always be the same as the procedure, or if no procedure, then the claim.</summary>
    </column>
    <column order="36" name="InsSubNum" type="bigint(20)" fk="inssub">
      <summary>FK to inssub.InsSubNum.</summary>
    </column>
    <column order="37" name="PaymentRow" type="int(11)">
      <summary>1-indexed.  Allows user to sort the order of payments on an EOB.  All claimprocs for a payment will have the same PaymentRow value.</summary>
    </column>
    <column order="38" name="PayPlanNum" type="bigint(20)" fk="payplan">
      <summary>FK to payplan.PayPlanNum.  0 if not attached to a payplan.</summary>
    </column>
    <column order="39" name="ClaimPaymentTracking" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  Connected to the ClaimPaymentTracking DefCat.</summary>
    </column>
    <column order="40" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="41" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="42" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="43" name="DateSuppReceived" type="date">
      <summary>The date the claim proc was first set to received or supplemental. If status is set to something other than received/supplemental,
            this field will be set to DateTime.MinValue if DateSuppReceived is today.  If DateSuppReceived is set to a day in the past and the status is 
            changed from received/supplemental to something else, the field will not be cleared or updated.  Db only field used by one customer and this is
            how they requested it.  PatNum #19191</summary>
    </column>
    <column order="44" name="DateInsFinalized" type="date">
      <summary>Date of the first claimPayment for this claim.</summary>
    </column>
    <column order="45" name="IsTransfer" type="tinyint(4)">
      <summary>Bool, defaults to false. When true, indicates that a claimproc was created automatically by the Income Transfer Manager to reallocate a claim paid "As Total" (which has no direct procedure links) into procedure-level claimprocs on that claim so the payment remains tied to the procedures on that claim. This flag is set on all supplemental claimprocs created as part of the transfer, including both the offsetting supplemental that cancels out the original As Total amounts before they are redistributed to procedures and the supplemental claimprocs attached to matching procedures that distribute those amounts. These rows are stored with Status=Supplemental, but are shown in the UI as "Txfr" to distinguish them from user-created supplementals.</summary>
    </column>
    <column order="46" name="ClaimAdjReasonCodes" type="varchar(255)">
      <summary>Holds a comma delimited list of Claim Adjustment Reason Codes from an ERA. https://x12.org/codes/claim-adjustment-reason-codes </summary>
    </column>
    <column order="47" name="IsOverpay" type="tinyint(4)">
      <summary>Bool, defaults to false. When true, Status is NotReceived and indicates that the claimproc represents an insurance overpayment OR underpayment. Example insurance has partially paid on a claim, this procedure has still been paid 0, so it's an underpayment. The status column in the claim edit window will show PndSup.</summary>
    </column>
    <column order="48" name="SecurityHash" type="varchar(255)">
      <summary>Holds the salted hash of the following claimproc fields: ClaimNum, Status, InsPayEst, InsPayAmt. </summary>
    </column>
  </table>
  <table name="claimsnapshot">
    <summary>Stores the original insurance writeoff, fee, and expected insurance payment information on claims.</summary>
    <column order="0" name="ClaimSnapshotNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum</summary>
    </column>
    <column order="2" name="ClaimType" type="varchar(255)">
      <summary>"P"=primary, "S"=secondary, "Other"=other, "Cap"=capitation. Never "PreAuth" as PreAuths will never be in this table</summary>
    </column>
    <column order="3" name="Writeoff" type="double">
      <summary></summary>
    </column>
    <column order="4" name="InsPayEst" type="double">
      <summary>Expected amount the insurance will pay on the procedure.</summary>
    </column>
    <column order="5" name="Fee" type="double">
      <summary>Procedure's ProcFee</summary>
    </column>
    <column order="6" name="DateTEntry" type="datetime">
      <summary>The date/time that the snapshot was created.  Not user editable.</summary>
    </column>
    <column order="7" name="ClaimProcNum" type="bigint(20)" fk="claimproc">
      <summary>FK to claimproc.ClaimProcNum</summary>
    </column>
    <column order="8" name="SnapshotTrigger" type="tinyint(4)">
      <summary>Enum:ClaimSnapshotTrigger Stores the trigger to which this ClaimSnapshot was created.</summary>
      <Enumeration name="ClaimSnapshotTrigger">
        <summary>The Enumeration value for which Claim Snapshot Trigger that will be stored.</summary>
        <EnumValue name="ClaimCreate">0</EnumValue>
        <EnumValue name="Service">1</EnumValue>
        <EnumValue name="InsPayment">2</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="claimtracking">
    <summary></summary>
    <column order="0" name="ClaimTrackingNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClaimNum" type="bigint(20)" fk="claim">
      <summary>FK to claim.ClaimNum</summary>
    </column>
    <column order="2" name="TrackingType" type="varchar(255)">
      <summary>Enum:ClaimTrackingType Identifies the type of claimtracking row.</summary>
      <Enumeration name="ClaimTrackingType">
        <summary></summary>
        <EnumValue name="StatusHistory"></EnumValue>
        <EnumValue name="ClaimUser"></EnumValue>
        <EnumValue name="ClaimProcReceived"></EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="UserNum" type="bigint(20)">
      <summary>FK to user.UserNum</summary>
    </column>
    <column order="4" name="DateTimeEntry" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is inserted or modified.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>Generic column for additional info.</summary>
    </column>
    <column order="6" name="TrackingDefNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum for custom tracking when TrackingType=StatusHistory</summary>
    </column>
    <column order="7" name="TrackingErrorDefNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum for custom tracking errors when TrackingType=StatusHistory</summary>
    </column>
  </table>
  <table name="claimvalcodelog">
    <summary>Value codes for institutional 'claims'.  Can have up to 12 per claim.</summary>
    <column order="0" name="ClaimValCodeLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClaimNum" type="bigint(20)" 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. 2 char.</summary>
    </column>
    <column order="4" name="ValAmount" type="double">
      <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="bigint(20)">
      <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.  Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="3" 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="4" 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="x837D_4010">1-The American standard through 12/31/11.</EnumValue>
        <EnumValue name="Renaissance">2-Proprietary format for Renaissance.</EnumValue>
        <EnumValue name="Canadian">3-CDAnet format version 4.</EnumValue>
        <EnumValue name="Dutch">4-CSV file adaptable for use in Netherlands.</EnumValue>
        <EnumValue name="x837D_5010_dental">5-The American standard starting on 1/1/12.</EnumValue>
        <EnumValue name="x837_5010_med_inst">6-Either professional or medical.  The distiction is stored at the claim level.</EnumValue>
        <EnumValue name="Ramq">7-A specific Canadian carrier located in Quebec which has their own format.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" 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="6" 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.
            Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="7" 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="8" name="ISA08" type="varchar(255)">
      <summary>Receiver ID. Also used in GS03. Provided by clearinghouse. Examples: BCBSGA or 0135WCH00(webMD)</summary>
    </column>
    <column order="9" name="ISA15" type="varchar(255)">
      <summary>"P" for Production or "T" for Test.</summary>
    </column>
    <column order="10" name="Password" type="varchar(255)">
      <summary>Password is usually combined with the login ID for user validation.  Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="11" name="ResponsePath" type="varchar(255)">
      <summary>The path that all incoming response files will be saved to. \ is now optional.
            Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="12" name="CommBridge" type="tinyint">
      <summary>Enum:EclaimsCommBridge  One of the included hard-coded communications bridges.  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="ITRANS">9 Canadian clearinghouse.</EnumValue>
        <EnumValue name="Tesia">10</EnumValue>
        <EnumValue name="MercuryDE">11</EnumValue>
        <EnumValue name="ClaimX">12</EnumValue>
        <EnumValue name="DentiCal">13</EnumValue>
        <EnumValue name="EmdeonMedical">14</EnumValue>
        <EnumValue name="Claimstream">15 Canadian clearinghouse.</EnumValue>
        <EnumValue name="NHS">16 UK clearinghouse.</EnumValue>
        <EnumValue name="EDS">17</EnumValue>
        <EnumValue name="Ramq">18</EnumValue>
        <EnumValue name="EdsMedical">19</EnumValue>
        <EnumValue name="Lantek">20</EnumValue>
        <EnumValue name="ITRANS2">21 Canadian clearinghouse.  Similar to ITRANS except supports certificate and carrier list web fetching.</EnumValue>
        <EnumValue name="VyneDental">22</EnumValue>
      </Enumeration>
    </column>
    <column order="13" 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.  Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="14" 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 must NOT be cached and must be ignored in the code except where it explicitly retrieves it from the db.  Defaults to 0 for brand new clearinghouses, which causes the first batch to go out as #1.</summary>
    </column>
    <column order="15" name="ModemPort" type="tinyint">
      <summary>Was not used.  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="16" 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.  Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="17" 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.
            Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="18" 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.  Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="19" name="GS03" type="varchar(255)">
      <summary>Usually the same as ISA08, but at least one clearinghouse uses a different number here.</summary>
    </column>
    <column order="20" name="ISA02" type="varchar(10)">
      <summary>Authorization information. Almost always blank. Used for Denti-Cal.</summary>
    </column>
    <column order="21" name="ISA04" type="varchar(10)">
      <summary>Security information. Almost always blank. Used for Denti-Cal.</summary>
    </column>
    <column order="22" name="ISA16" type="varchar(2)">
      <summary>X12 component element separator. Two digit hexadecimal string representing an ASCII character or blank. Usually blank, implying 3A which represents ':'. For Denti-Cal, hexadecimal value 22 must be used, corresponding to '"'.</summary>
    </column>
    <column order="23" name="SeparatorData" type="varchar(2)">
      <summary>X12 data element separator. Two digit hexadecimal string representing an ASCII character or blank. Usually blank, implying 2A which represents '*'. For Denti-Cal, hexadecimal value 1D must be used, corresponding to the "group separator" character which has no visual representation.</summary>
    </column>
    <column order="24" name="SeparatorSegment" type="varchar(2)">
      <summary>X12 segment terminator. Two digit hexadecimal string representing an ASCII character or blank. Usually blank, implying 7E which represents '~'. For Denti-Cal, hexadecimal value 1C must be used, corresponding to the "file separator" character which has no visual representation.</summary>
    </column>
    <column order="25" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  ClinicNum=0 for HQ.</summary>
    </column>
    <column order="26" name="HqClearinghouseNum" type="bigint(20)" fk="clearinghouse">
      <summary>FK to clearinghouse.ClearingHouseNum.  Never 0.  Points to the HQ copy of this clearinghouse.
            If this copy is the HQ copy, then HqClearinghouseNum=ClearinghouseNum.</summary>
    </column>
    <column order="27" name="IsEraDownloadAllowed" type="tinyint(4)">
      <summary>Enum:EraBehaviors EraBehaviors.DownloadAndReceive by default.  This flag is implemented individually within each clearinghouse.  Can be overridden by clinic-level clearinghouses.</summary>
      <Enumeration name="EraBehaviors">
        <summary>Sets behavior for importing and receiving ERA benefits and associated claims and claim procedures.</summary>
        <EnumValue name="None">0 - Do not download ERAs/EOBs</EnumValue>
        <EnumValue name="DownloadDoNotReceive">1 - Download ERAs/EOBs, but do not mark claims and claim procedures as 'Received'.</EnumValue>
        <EnumValue name="DownloadAndReceive">2 - Download ERAs/EOBs, and mark claims and claim procedures as 'Received'.</EnumValue>
      </Enumeration>
    </column>
    <column order="28" name="IsClaimExportAllowed" type="tinyint(4)">
      <summary>True by default.  This flag is implemented individually within each clearinghouse.  Can be overridden by clinic-level clearinghouses.</summary>
    </column>
    <column order="29" name="IsAttachmentSendAllowed" type="tinyint(4)">
      <summary>Currently only used for DentalXChange's attachment service. This indicates that the user has set up the attachment service and would like to use it in Open Dental.</summary>
    </column>
    <column order="30" name="LocationID" type="varchar(255)">
      <summary>A unique identifier provided by the clearinghouse to identify the practice in their system. This is separate from the issue of clinics, where we already enforce only one clinic per clearinghouse.</summary>
    </column>
    <column order="31" name="EnableXConnect" type="tinyint(4)">
      <summary>False by default. This bool is used to control whether a clinic has enabled XConnect for the clearinghouse.</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="bigint(20)">
      <summary>Primary key.  Used in patient,payment,claimpayment,appointment,procedurelog, etc.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Use Abbr for all user-facing forms.  Description is required and should not be blank.</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.  Exactly 10 digits or blank in USA and Canada.</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></summary>
        <EnumValue name="Office">0. Code 11</EnumValue>
        <EnumValue name="PatientsHome">1. Code 12</EnumValue>
        <EnumValue name="InpatHospital">2. Code 21</EnumValue>
        <EnumValue name="OutpatHospital">3. Code 22</EnumValue>
        <EnumValue name="SkilledNursFac">4. Code 31</EnumValue>
        <EnumValue name="CustodialCareFacility">5. Code 33.  In X12, a similar code AdultLivCareFac 35 is mentioned.</EnumValue>
        <EnumValue name="OtherLocation">6. Code 99.  We use 11 for office.</EnumValue>
        <EnumValue name="MobileUnit">7. Code 15</EnumValue>
        <EnumValue name="School">8. Code 03</EnumValue>
        <EnumValue name="MilitaryTreatFac">9. Code 26</EnumValue>
        <EnumValue name="FederalHealthCenter">10. Code 50</EnumValue>
        <EnumValue name="PublicHealthClinic">11. Code 71</EnumValue>
        <EnumValue name="RuralHealthClinic">12. Code 72</EnumValue>
        <EnumValue name="EmergencyRoomHospital">13. Code 23</EnumValue>
        <EnumValue name="AmbulatorySurgicalCenter">14. Code 24</EnumValue>
        <EnumValue name="TelehealthOutsideHome">15. Code 02.</EnumValue>
        <EnumValue name="TelehealthInHome">16. Code 10</EnumValue>
        <EnumValue name="OutreachSiteOrStreet">17. Code 27</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="InsBillingProv" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  0=Default practice provider, -1=Treating provider.</summary>
    </column>
    <column order="11" name="Fax" type="varchar(50)">
      <summary>Does not include any punctuation.  Exactly 10 digits or empty in USA and Canada.</summary>
    </column>
    <column order="12" name="EmailAddressNum" type="bigint(20)" fk="emailaddress">
      <summary>FK to emailaddress.EmailAddressNum.</summary>
    </column>
    <column order="13" name="DefaultProv" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Used in place of the default practice provider when making new patients.</summary>
    </column>
    <column order="14" name="SmsContractDate" type="datetime">
      <summary>DateSMSContract was signed.</summary>
    </column>
    <column order="15" name="SmsMonthlyLimit" type="double">
      <summary>Always stored in USD, this is the desired limit for SMS out for a given month.</summary>
    </column>
    <column order="16" name="IsMedicalOnly" type="tinyint(4)">
      <summary>True if this clinic is a medical clinic.  Used to hide/change certain areas of Open Dental, like hiding the tooth chart and changing
            'dentist' to 'provider'.</summary>
    </column>
    <column order="17" name="BillingAddress" type="varchar(255)">
      <summary>Overrides Address on claims if not blank.</summary>
    </column>
    <column order="18" name="BillingAddress2" type="varchar(255)">
      <summary>Second line of billing address.</summary>
    </column>
    <column order="19" name="BillingCity" type="varchar(255)">
      <summary>Overrides City on claims if BillingAddress is not blank.</summary>
    </column>
    <column order="20" name="BillingState" type="varchar(255)">
      <summary>Overrides State on claims if BillingAddress is not blank.</summary>
    </column>
    <column order="21" name="BillingZip" type="varchar(255)">
      <summary>Overrides Zip on claims if BillingAddress is not blank.</summary>
    </column>
    <column order="22" name="PayToAddress" type="varchar(255)">
      <summary>Overrides practice PayTo address if not blank.</summary>
    </column>
    <column order="23" name="PayToAddress2" type="varchar(255)">
      <summary>Second line of PayTo address.</summary>
    </column>
    <column order="24" name="PayToCity" type="varchar(255)">
      <summary>Overrides practice PayToCity if PayToAddress is not blank.</summary>
    </column>
    <column order="25" name="PayToState" type="varchar(255)">
      <summary>Overrides practice PayToState if PayToAddress is not blank.</summary>
    </column>
    <column order="26" name="PayToZip" type="varchar(255)">
      <summary>Overrides practice PayToZip if PayToAddress is not blank.</summary>
    </column>
    <column order="27" name="UseBillAddrOnClaims" type="tinyint(4)">
      <summary>True if this clinic's billing address should be used on outgoing claims.</summary>
    </column>
    <column order="28" name="Region" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum when definition.DefCat is Regions. A region is a way of grouping multiple clinics. Used in Ins Verification and Tasks.</summary>
    </column>
    <column order="29" name="ItemOrder" type="int(11)">
      <summary>0 based.  Clinics cache is sorted by ItemOrder if the preference ClinicListIsAlphabetical is false.</summary>
    </column>
    <column order="30" name="IsInsVerifyExcluded" type="tinyint(4)">
      <summary>True if this clinic should be excluded from showing up in the Insurance Verification List.</summary>
    </column>
    <column order="31" name="Abbr" type="varchar(255)">
      <summary>Abbreviation for the Clinic's description.  Sorted by Abbr if ClinicListIsAlphabetical is true.  Use this for all user-facing forms.
            Abbr is required and should not be blank.</summary>
    </column>
    <column order="32" name="MedLabAccountNum" type="varchar(16)" fk="medlab">
      <summary>FK to medlab.PatAccountNum.  Used to filter MedLab results by the MedLab Account Number assigned to each clinic.</summary>
    </column>
    <column order="33" name="IsConfirmEnabled" type="tinyint(4)">
      <summary>Clinic level preference. (Better Name is "IsAutomationEnabled" but that conflicts with other definitions of what Automation means. 
            Determines if autocomm should be sent for/from this clinic.</summary>
    </column>
    <column order="34" name="IsConfirmDefault" type="tinyint(4)">
      <summary>Deprecated. Clinic level preference. If true then this clinic is using the default automated reminder/confirmation settings as defined by the user.</summary>
    </column>
    <column order="35" name="IsNewPatApptExcluded" type="tinyint(4)">
      <summary>Deprecated as of 17.1, use signup portal. Indicates whether or not the New Patient Appointment version of Web Sched is excluded for this specifc clinic.</summary>
    </column>
    <column order="36" name="IsHidden" type="tinyint(4)">
      <summary>Indicates whether or not the clinic is hidden.</summary>
    </column>
    <column order="37" name="ExternalID" type="bigint(20)">
      <summary>Not currently used by Open Dental but is used by other software's.</summary>
    </column>
    <column order="38" name="SchedNote" type="varchar(255)">
      <summary>Indicates if the clinic should only be scheduled in a certain way (e.g. ortho only, etc)</summary>
    </column>
    <column order="39" name="HasProcOnRx" type="tinyint(4)">
      <summary>Defaults to false.  If true, will require procedure be attached to controlled prescriptions written from this clinic.</summary>
    </column>
    <column order="40" name="TimeZone" type="varchar(75)">
      <summary>Allows adding timezone info to FHIR datetimes.  This does not actually change the datetime of any field.</summary>
    </column>
    <column order="41" name="EmailAliasOverride" type="varchar(255)">
      <summary>Overrides the SenderAddress (aka Alias) for emails sent from this clinic. Used when multiple clinics share a single EmailAddress table entry, but each clinic wants to show a different email address sender when sending. This is also known as a "send as" alias.</summary>
    </column>
  </table>
  <table name="clinicerx">
    <summary>Tracks which clinics have access to eRx based on ClinicDescr.  Synchronized with HQ.</summary>
    <column order="0" name="ClinicErxNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Holder of registration key only for HQ record, in customer record this will be 0.</summary>
    </column>
    <column order="2" name="ClinicDesc" type="varchar(255)">
      <summary>Description of a clinic from the clinic table.  Only used by OD HQ.  For customer records, use ClinicNum.</summary>
    </column>
    <column order="3" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Is the clinic that is used for accessing eRx.</summary>
    </column>
    <column order="4" name="EnabledStatus" type="tinyint(4)">
      <summary>Enum:ErxStatus Set to true if the clinic with the given ClinicName has access to eRx.</summary>
      <Enumeration name="ErxStatus">
        <summary>Used by Erx to determine if the provider or clinic has been enabled at ODHQ.
            Enum is in this file because it belongs to multiple tables.
            This enum is copied to WebServiceCustomerUpdates/ClinicErx.cs.  See there for detailed comments.</summary>
        <EnumValue name="Disabled">0.</EnumValue>
        <EnumValue name="Enabled">1.</EnumValue>
        <EnumValue name="Undefined">2.</EnumValue>
        <EnumValue name="PendingAccountId">3.</EnumValue>
        <EnumValue name="NeedsManualAccountId">4.</EnumValue>
        <EnumValue name="PendingEmail">5.</EnumValue>
        <EnumValue name="Pending">6.</EnumValue>
        <EnumValue name="PendingEconnTransmit">7.</EnumValue>
        <EnumValue name="InTransitToEconn">8.</EnumValue>
        <EnumValue name="NeedsManualOfficeContact">9.</EnumValue>
        <EnumValue name="NeedsErxId">10.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="ClinicId" type="varchar(255)">
      <summary>Clinic identifier used by the erx option.  Only used by OD HQ.</summary>
    </column>
    <column order="6" name="ClinicKey" type="varchar(255)">
      <summary>Unique key used by the erx option.  Only used by OD HQ.</summary>
    </column>
    <column order="7" name="AccountId" type="varchar(25)">
      <summary>Only used by OD HQ.</summary>
    </column>
    <column order="8" name="RegistrationKeyNum" type="bigint(20)" fk="registrationkey">
      <summary>FK to registrationkey.RegistrationKeyNum.  HQ only, links to the registration key used to make this clinicerx row.</summary>
    </column>
  </table>
  <table name="clinicpref">
    <summary>Used to store preferences specific to clinics. Works in conjunction with the Pref table.</summary>
    <column order="0" name="ClinicPrefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. Never 0 because that would indicate HQ, but all HQ prefs are stored in Pref table instead of here.</summary>
    </column>
    <column order="2" name="PrefName" type="varchar(255)">
      <summary>Enum: PrefName </summary>
    </column>
    <column order="3" name="ValueString" type="text">
      <summary>The stored value.</summary>
    </column>
  </table>
  <table name="clockevent">
    <summary>One clock-in / clock-out pair.  Or, if the pair is a break, then it's an out/in pair. With normal clock in/out pairs, we want to know how long the employee was working.  It's the opposite with breaks. We want to know how long they were not working, so the pair is backwards. This means that a normal clock in is left incomplete when the clock out for break is created. And once both are finished, the regular in/out will surround the break. Breaks cannot be viewed easily on the same grid as regular clock events for this reason. And since breaks do not affect pay, they should not clutter the normal grid.</summary>
    <column order="0" name="ClockEventNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EmployeeNum" type="bigint(20)" fk="employee">
      <summary>FK to employee.EmployeeNum</summary>
    </column>
    <column order="2" name="TimeEntered1" type="datetime">
      <summary>The actual time that this entry was entered.  Cannot be 01-01-0001.</summary>
    </column>
    <column order="3" name="TimeDisplayed1" type="datetime">
      <summary>The time to display and to use in all calculations.  Cannot be 01-01-0001.</summary>
    </column>
    <column order="4" name="ClockStatus" type="tinyint">
      <summary>Enum:TimeClockStatus  Home, Lunch, or Break.  The status really only applies to the clock out.  Except the Break status applies to both out and in.</summary>
      <Enumeration name="TimeClockStatus">
        <summary></summary>
        <EnumValue name="Home">0</EnumValue>
        <EnumValue name="Lunch">1</EnumValue>
        <EnumValue name="Break">2</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="Note" type="text">
      <summary>.</summary>
    </column>
    <column order="6" name="TimeEntered2" type="datetime">
      <summary>The user can never edit this, but the program has to be able to edit this when user clocks out.  Can be 01-01-0001 if not clocked out yet.</summary>
    </column>
    <column order="7" name="TimeDisplayed2" type="datetime">
      <summary>User can edit. Can be 01-01-0001 if not clocked out yet.</summary>
    </column>
    <column order="8" name="OTimeHours" type="time">
      <summary>This is a manual override for OTimeAuto.  Typically -1 hour (-01:00:00) to indicate no override.  When used as override, allowed values are zero or positive.  This is an alternative to using a TimeAdjust row.</summary>
    </column>
    <column order="9" name="OTimeAuto" type="time">
      <summary>Automatically calculated OT.  Will be zero if none.</summary>
    </column>
    <column order="10" name="Adjust" type="time">
      <summary>This is a manual override of AdjustAuto.  Ignored unless AdjustIsOverridden set to true.  When used as override, it's typically negative, although zero and positive are also allowed.</summary>
    </column>
    <column order="11" name="AdjustAuto" type="time">
      <summary>Automatically calculated Adjust.  Will be zero if none.</summary>
    </column>
    <column order="12" name="AdjustIsOverridden" type="tinyint(4)">
      <summary>True if AdjustAuto is overridden by Adjust.</summary>
    </column>
    <column order="13" name="Rate2Hours" type="time">
      <summary>This is a manual override for Rate2Auto.  Typically -1 hour (-01:00:00) to indicate no override.  When used as override, allowed values are zero or positive.  This is the portion of the hours worked which are at Rate2, so it's not in addition to the hours worked.  Also used to calculate the Rate2 OT.</summary>
    </column>
    <column order="14" name="Rate2Auto" type="time">
      <summary>Automatically calculated rate2 pay.  Will be zero if none.</summary>
    </column>
    <column order="15" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  The clinic the ClockEvent was entered at.</summary>
    </column>
    <column order="16" name="Rate3Hours" type="time">
      <summary>This is a manual override for Rate3Auto.  Typically -1 hour (-01:00:00) to indicate no override.  When used as override, allowed values are zero or positive.  This is the portion of the hours worked which are at Rate3, so it's not in addition to the hours worked.  Also used to calculate the Rate3 OT.</summary>
    </column>
    <column order="17" name="Rate3Auto" type="time">
      <summary>Automatically calculated Rate3 pay.  Will be zero if none.</summary>
    </column>
    <column order="18" name="IsWorkingHome" type="tinyint(4)">
      <summary>True if the Clock Event is made by choosing "Available at Home" when clocking in. Will be false if "Available At Office" is selected instead.</summary>
    </column>
  </table>
  <table name="cloudaddress">
    <summary></summary>
    <column order="0" name="CloudAddressNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="IpAddress" type="varchar(50)">
      <summary>The IP address the user is connecting from.</summary>
    </column>
    <column order="2" name="UserNumLastConnect" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="3" name="DateTimeLastConnect" type="datetime">
      <summary>DateTime of the last successful login from the address.</summary>
    </column>
  </table>
  <table name="codegroup">
    <summary>These groups of procedure codes are used in Benefit Frequencies (and Insurance History?). We can't use CovCats because those spans are frequently far too broad.  We often need specific codes. Cached.</summary>
    <column order="0" name="CodeGroupNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="GroupName" type="varchar(50)">
      <summary>.</summary>
    </column>
    <column order="2" name="ProcCodes" type="text">
      <summary>List of D codes with commas and hyphens. No spaces. Example: "D0000-D0999,D2140-D2161,D2750" would mean all exams and xrays, some amalgams, and a crown. The normal hyphens in the db get converted to non-breaking hyphens (\u2011) for display to prevent wrapping.</summary>
    </column>
    <column order="3" name="ItemOrder" type="int(11)">
      <summary>Zero-based. CodeGroups that don't show in either list (IsHidden=true and ShowInAgeLimit=false) get higher ItemOrders so that then are at the bottom of the setup list.</summary>
    </column>
    <column order="4" name="CodeGroupFixed" type="tinyint(4)">
      <summary>Enum:EnumCodeGroupFixed 1=BW, 2=PanoFMX, 3=Exam, 4=Perio, 5=Prophy, 6=SRP. Only used in sheet static text fields (example StaticTextField.dateLastBW) and eClaims. This enum is no longer used in the Ins History Window.</summary>
      <Enumeration name="EnumCodeGroupFixed">
        <summary>This enum replaces the FrequencyType enum at bottom of Benefits.cs.  See description in CodeGroup.CodeGroupFixed.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="BW">1</EnumValue>
        <EnumValue name="PanoFMX">2</EnumValue>
        <EnumValue name="Exam">3</EnumValue>
        <EnumValue name="Perio">4</EnumValue>
        <EnumValue name="Prophy">5</EnumValue>
        <EnumValue name="SRP">6- When used in InsHist window, the quadrant is hard coded for each of the 4 rows.</EnumValue>
        <EnumValue name="FMDebride">7</EnumValue>
        <EnumValue name="Fluoride">8</EnumValue>
        <EnumValue name="Sealant">9</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="IsHidden" type="tinyint(4)">
      <summary>If true, a user will not be able to see this codegroup as an option in the benefit edit form or any grid on FormInsBenefits.</summary>
    </column>
    <column order="6" name="ShowInAgeLimit" type="tinyint(4)">
      <summary> If true, this codegroup will show in Age Limitations grid. Control of showing in Freq Lim is done separately using ShowInFrequency.</summary>
    </column>
    <column order="7" name="ShowInFrequency" type="tinyint(4)">
      <summary> If true, this codegroup will show in the Frequency Limitations Grid.</summary>
    </column>
    <column order="8" name="ShowInOther" type="tinyint(4)">
      <summary> If true, this codegroup will show in the Ins Benefits Window in the Other Benefits grid.</summary>
    </column>
    <column order="9" name="ShowInHistory" type="tinyint(4)">
      <summary>If true, this codegroup will show as a new row in the Ins History window inside of Ins Plan.</summary>
    </column>
    <column order="10" name="HistProcCode" type="varchar(255)">
      <summary>Stores a single procedure code used in InsHist. When determining history, multiple codes are used from the codegroup.ProcCodes field above. But when automation creates history, it must have a single code. This is the D code that it uses. Example D1234. Required whenever ShowInHistory=true.</summary>
    </column>
    <column order="11" name="IsPerioFourQuads" type="tinyint(4)">
      <summary>If true, this codegroup will appear four times in the Ins History Window as, "Perio Scaling UL", "Perio Scaling UR", "Perio Scaling LL", and "Perio Scaling LR".</summary>
    </column>
  </table>
  <table name="codesystem">
    <summary>Used for tracking code systems imported to OD. HL7OID used for sending messages.  This must be a database table in order to keep track of VersionCur between sessions.</summary>
    <column order="0" name="CodeSystemNum" type="bigint(20)">
      <summary>Primary key. Not currently referenced anywhere.</summary>
    </column>
    <column order="1" name="CodeSystemName" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="VersionCur" type="varchar(255)">
      <summary>Only used for display, not actually interpreted. Updated by Code System importer.  Examples: 2013 or 1</summary>
    </column>
    <column order="3" name="VersionAvail" type="varchar(255)">
      <summary>Only used for display, not actually interpreted. Updated by Convert DB script.</summary>
    </column>
    <column order="4" name="HL7OID" type="varchar(255)">
      <summary>Example: 2.16.840.1.113883.6.13</summary>
    </column>
    <column order="5" name="Note" type="varchar(255)">
      <summary>Notes to display to user. Examples: "CDT codes distributed via program updates.", "CPT codes require purchase and download from www.ama.com</summary>
    </column>
  </table>
  <table name="commlog">
    <summary>Tracks all forms of communications with patients, including emails, phonecalls, postcards, etc.  Any changes made to this table need to be added to CommlogHist and CommlogHists.CreateFromCommlog().</summary>
    <column order="0" name="CommlogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. This will be 0 if Referral.</summary>
    </column>
    <column order="2" name="CommDateTime" type="datetime">
      <summary>Date and time of entry</summary>
    </column>
    <column order="3" name="CommType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. This will be 0 if Referral.</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></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="Text">5</EnumValue>
        <EnumValue name="EmailAndText">6</EnumValue>
        <EnumValue name="PhoneAndText">7</EnumValue>
        <EnumValue name="Fax">8</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="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="8" name="Signature" type="text">
      <summary>Signature.  For details, see procnote.Signature.</summary>
    </column>
    <column order="9" name="SigIsTopaz" type="tinyint(4)">
      <summary>True if signed using the Topaz signature pad, false otherwise.</summary>
    </column>
    <column order="10" name="DateTStamp" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="11" name="DateTimeEnd" type="datetime">
      <summary>Date and time when commlog ended.  Mainly for internal use.</summary>
    </column>
    <column order="12" name="CommSource" type="tinyint(4)">
      <summary>Enum:CommItemSource Set to the source of the entity that created this commlog.  E.g. WebSched.</summary>
      <Enumeration name="CommItemSource">
        <summary></summary>
        <EnumValue name="User">0</EnumValue>
        <EnumValue name="WebSched">1</EnumValue>
        <EnumValue name="ProgramLink">2</EnumValue>
        <EnumValue name="ApptReminder">3</EnumValue>
        <EnumValue name="EServices">4 - HQ Only</EnumValue>
        <EnumValue name="SupplementalBackup">5</EnumValue>
        <EnumValue name="ApptThankYou">6</EnumValue>
        <EnumValue name="FHIR">7 - Includes non-FHIR API.</EnumValue>
        <EnumValue name="NewPatThankYou">8</EnumValue>
        <EnumValue name="MsgToPay">9</EnumValue>
        <EnumValue name="MassEmail">10</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="ProgramNum" type="bigint(20)" fk="program">
      <summary>FK to program.ProgramNum.  This will be 0 unless CommSource is set to ProgramLink.</summary>
    </column>
    <column order="14" name="DateTEntry" type="datetime">
      <summary>Track Date Created for commlogs. Value for existing commlogs show as blank in the UI. Not editable by user.</summary>
    </column>
    <column order="15" name="ReferralNum" type="bigint(20)" fk="referral">
      <summary>FK to referral.ReferralNum.</summary>
    </column>
    <column order="16" name="CommReferralBehavior" type="tinyint(4)">
      <summary>Enum:EnumCommReferralBehavior Changes how this referral commlog displays within grids.</summary>
      <Enumeration name="EnumCommReferralBehavior">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="TopAnchored">1</EnumValue>
        <EnumValue name="Hidden">2</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="commoptout">
    <summary>The patient does not want to recieve messages for a particular type of communication.</summary>
    <column order="0" name="CommOptOutNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. The patient who is opting out of this form of communication.</summary>
    </column>
    <column order="2" name="OptOutSms" type="int(11)">
      <summary>Enum:CommOptOutType The type of communication for which this patient does not want to receive automated sms.</summary>
      <Enumeration name="CommOptOutType">
        <summary></summary>
        <EnumValue name="All">1 - All.  Allows adding new entries to this enum without requiring a convert script.</EnumValue>
        <EnumValue name="eConfirm"></EnumValue>
        <EnumValue name="eReminder"></EnumValue>
        <EnumValue name="eThankYou"></EnumValue>
        <EnumValue name="WebSchedRecall"></EnumValue>
        <EnumValue name="WebSchedASAP"></EnumValue>
        <EnumValue name="PatientPortalInvites"></EnumValue>
        <EnumValue name="Verify"></EnumValue>
        <EnumValue name="Statements"></EnumValue>
        <EnumValue name="Arrivals"></EnumValue>
        <EnumValue name="Birthdays"></EnumValue>
        <EnumValue name="GeneralMessages"></EnumValue>
        <EnumValue name="MsgToPay"></EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="OptOutEmail" type="int(11)">
      <summary>Enum:CommOptOutType The type of communication for which this patient does not want to receive automated email.</summary>
      <Enumeration name="CommOptOutType">
        <summary></summary>
        <EnumValue name="All">1 - All.  Allows adding new entries to this enum without requiring a convert script.</EnumValue>
        <EnumValue name="eConfirm"></EnumValue>
        <EnumValue name="eReminder"></EnumValue>
        <EnumValue name="eThankYou"></EnumValue>
        <EnumValue name="WebSchedRecall"></EnumValue>
        <EnumValue name="WebSchedASAP"></EnumValue>
        <EnumValue name="PatientPortalInvites"></EnumValue>
        <EnumValue name="Verify"></EnumValue>
        <EnumValue name="Statements"></EnumValue>
        <EnumValue name="Arrivals"></EnumValue>
        <EnumValue name="Birthdays"></EnumValue>
        <EnumValue name="GeneralMessages"></EnumValue>
        <EnumValue name="MsgToPay"></EnumValue>
      </Enumeration>
    </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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CompName" type="varchar(100)">
      <summary>Name of the computer.</summary>
    </column>
    <column order="2" name="LastHeartBeat" type="datetime">
      <summary>Allows us to tell which computers are running.  All workstations record a heartbeat here at an interval of 3 minutes.  
            So if the heartbeat is fairly fresh, then that's an accurate indicator of whether Open Dental is running on that computer.</summary>
    </column>
  </table>
  <table name="computerpref">
    <summary>Enables preference specific to individual computers on a customer network.</summary>
    <column order="0" name="ComputerPrefNum" type="bigint(20)">
      <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>Enum:DrawingMode Set to 1 to use the low-quality 2D tooth chart in the chart module. Set to 0 to use a 3D DirectX based tooth chart in the chart module. This option helps the program run even when the local graphics hardware is buggy or unavailable.</summary>
      <Enumeration name="DrawingMode">
        <summary></summary>
        <EnumValue name="DirectX">0</EnumValue>
        <EnumValue name="Simple2D">1</EnumValue>
        <EnumValue name="OpenGL">2</EnumValue>
      </Enumeration>
    </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="tinyint(4)">
      <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="tinyint(4)">
      <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 OpenGL pixel format by number which the user prefers (if using OpenGL).</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>
    <column order="11" name="TaskKeepListHidden" type="tinyint(1)">
      <summary>If the global setting for showing the Task List is on, this controls if it should be hidden on this specified computer</summary>
    </column>
    <column order="12" name="TaskDock" type="int(11)">
      <summary>Dock task bar on bottom (0) or right (1).</summary>
    </column>
    <column order="13" name="TaskX" type="int(11)">
      <summary>X pos for right docked task list.</summary>
    </column>
    <column order="14" name="TaskY" type="int(11)">
      <summary>Y pos for bottom docked task list.</summary>
    </column>
    <column order="15" name="DirectXFormat" type="varchar(255)">
      <summary>Holds a semi-colon separated list of enumeration names and values representing a DirectX format. If blank, then
            no format is currently set and the best theoretical format will be chosen at program startup. If this value is set to
            'opengl' then this computer is using OpenGL and a DirectX format will not be picked.</summary>
    </column>
    <column order="16" name="ScanDocSelectSource" type="tinyint(4)">
      <summary>Show the select scanner dialog when scanning documents. This can also be set to prevent a couple of issues that can happen after scanning with some Canon scanners. One issue is when the Imaging Module won't load some PDFs. The other issue is when listbox selections won't visually update in other windows like the commlog.</summary>
    </column>
    <column order="17" name="ScanDocShowOptions" type="tinyint(4)">
      <summary>Show the scanner options dialog when scanning documents.</summary>
    </column>
    <column order="18" name="ScanDocDuplex" type="tinyint(4)">
      <summary>Attempt to scan in duplex mode when scanning multipage documents with an ADF.</summary>
    </column>
    <column order="19" name="ScanDocGrayscale" type="tinyint(4)">
      <summary>Scan in gray scale when scanning documents.</summary>
    </column>
    <column order="20" name="ScanDocResolution" type="int(11)">
      <summary>Scan at the specified resolution when scanning documents.  Example: 150.</summary>
    </column>
    <column order="21" name="ScanDocQuality" type="tinyint">
      <summary>0-100. Quality of jpeg after compression when scanning documents.  100 indicates full quality.  Opposite of compression. Should only be used when scanning.</summary>
    </column>
    <column order="22" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  The most recent clinic for this computer.  Determines which clinic is used when loading Open Dental.</summary>
    </column>
    <column order="23" name="ApptViewNum" type="bigint(20)" fk="apptview">
      <summary>FK to apptview.ApptViewNum.  The most recent appt view num for this computer.  Used when opening with the Appts module in conjunction with ClinicNum if this ApptViewNum is associated to the ClinicNum.</summary>
    </column>
    <column order="24" name="RecentApptView" type="tinyint">
      <summary>Deprecated.  The index of the most recent appt view for this computer.  Uses it when opening.  This column cannot be dropped due to older versions using it upon opening (prior to calling the update file copier code) so they will throw a UE if this column is ever dropped.</summary>
    </column>
    <column order="25" name="PatSelectSearchMode" type="tinyint(4)">
      <summary>Enum:SearchMode The search mode that is used when loading the patient select window, and while typing.
            When 0 the patient select window will use the DB wide pref PatientSelectUsesSearchButton.</summary>
      <Enumeration name="SearchMode">
        <summary>The search mode that is used when loading the patient select window, and while typing</summary>
        <EnumValue name="Default">0</EnumValue>
        <EnumValue name="UseSearchButton">1</EnumValue>
        <EnumValue name="RefreshWhileTyping">2</EnumValue>
      </Enumeration>
    </column>
    <column order="26" name="NoShowLanguage" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="27" name="NoShowDecimal" type="tinyint(4)">
      <summary>If true, don't warn user if the region's decimal setting is not 2.</summary>
    </column>
    <column order="28" name="ComputerOS" type="varchar(255)">
      <summary>Enum:PlatformOD The current operating system platform for the computer.</summary>
      <Enumeration name="PlatformOD">
        <summary>Mimics .NET enum PlatformID.</summary>
        <EnumValue name="Undefined">Only happens when workstation has not ran through convert script yet.</EnumValue>
        <EnumValue name="Win32S">The operating system is Win32s. Win32s is a layer that runs on 16-bit versions of Windows to provide access to 32-bit applications.</EnumValue>
        <EnumValue name="Win32Windows"> The operating system is Windows 95 or Windows 98.</EnumValue>
        <EnumValue name="Win32NT">The operating system is Windows NT or later.</EnumValue>
        <EnumValue name="WinCE">The operating system is Windows CE.</EnumValue>
        <EnumValue name="Unix">The operating system is Unix.</EnumValue>
        <EnumValue name="MacOSX">The operating system is Macintosh.</EnumValue>
      </Enumeration>
    </column>
    <column order="29" name="HelpButtonXAdjustment" type="double">
      <summary>Deprecated.</summary>
    </column>
    <column order="30" name="GraphicsUseDirectX11" type="tinyint(4)">
      <summary>Enum:YN Unknown, Yes, No.</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="31" name="Zoom" type="int(11)">
      <summary>Default 0.  Typically a bit above 100. Example 120. Below 100 is allowed but rare, like 80. In addition to normal monitor scale set in Windows. 0 is treated the same as 100, or no additional zoom.</summary>
    </column>
    <column order="32" name="VideoRectangle" type="varchar(255)">
      <summary>This is x,y,w,h format for the desktop location of the Video window. This is saved each time the Video window closes. If the Video window is maximized, then the form will instead be like this: "100,120,600,800,Max". The rectangle here defines the RestoreBounds when user unmaximizes.</summary>
    </column>
    <column order="33" name="CreditCardTerminalId" type="varchar(255)">
      <summary>Holds the value of the last Terminal used in a transaction. Used for PayConnect2 in FormPayConnect2 to set the default value of the Terminal list loading a new terminal payment. Also used by MeetInTheCloud (UI: Global Payments V2). One user would not be using both services simultaneously.</summary>
    </column>
  </table>
  <table name="confirmationrequest">
    <summary>Requests that have been sent via EConnector to HQ. HQ will process and update status as responses become available.</summary>
    <column order="0" name="ConfirmationRequestNum" type="bigint(20)">
      <summary>PK. Generated by HQ.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum for the corresponding appointment.</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="3" name="ApptNum" type="bigint(20)">
      <summary>Foreign key to the appointment represented by this AutoCommAppt.</summary>
    </column>
    <column order="4" name="DateTimeConfirmExpire" type="datetime">
      <summary>Generated by OD. Typically the time of the appointment. This is the time at which HQ will consider this unconfirmed and auto terminate.</summary>
    </column>
    <column order="5" name="ShortGUID" type="varchar(255)">
      <summary>Generated by HQ. Identifies this AutoCommGuid in future transactions between HQ and OD.</summary>
    </column>
    <column order="6" name="ConfirmCode" type="varchar(255)">
      <summary>Generated by HQ. The code that the patient will text back in order to confirm the appointment. If received then it indicates a positive response.</summary>
    </column>
    <column order="7" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="8" name="DateTimeConfirmTransmit" type="datetime">
      <summary>Generated by OD. Timestamp when EConnector sent this confirm request to HQ. Stored in local customer timezone.</summary>
    </column>
    <column order="9" name="DateTimeRSVP" type="datetime">
      <summary>Generated by OD. Timestamp when HQ updates this request to indicate that it has been terminated. RSVPStatusCode will change to its final state at this time. Stored in local customer timezone.</summary>
    </column>
    <column order="10" name="RSVPStatus" type="tinyint(4)">
      <summary>Enum:RSVPStatusCodes Generated by OD in some cases and HQ in others. Indicates current status in the lifecycle of this ConfirmationRequest.</summary>
      <Enumeration name="RSVPStatusCodes">
        <summary></summary>
        <EnumValue name="AwaitingTransmit">Entered manually by something other than EConnector. EConnector will pickup and send to HQ and change to pendingRsvp.</EnumValue>
        <EnumValue name="PendingRsvp">EConnector has sent this to HQ and will remain in this status until it is either terminated or receives a response from the patient.</EnumValue>
        <EnumValue name="PositiveRsvp">Patient responded with an affirmative confirmation.</EnumValue>
        <EnumValue name="NegativeRsvp">Patient responded and declined the confirmation.</EnumValue>
        <EnumValue name="Callback">Patient responded by requesting a callback.</EnumValue>
        <EnumValue name="Expired">Patient took no action by the time DateTimeExpired passed and the confirmation was terminated.</EnumValue>
        <EnumValue name="Failed">HQ or EConnector was unable to create the confirmation so it was terminated prematurely.</EnumValue>
        <EnumValue name="ApptChanged"> 7 - The appointment date/time was changed before the patient responded to the original confirmation.
            OD proper will simply delete these ConfirmationRequests. HQ will move them to the terminated table and mark them ApptChanged.</EnumValue>
      </Enumeration>
    </column>
    <column order="11" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
    <column order="12" name="GuidMessageFromMobile" type="text" fk="smsfrommobile">
      <summary>FK to smsfrommobile.GuidMessage. Generated at HQ when the confirmation pending is terminated with confirmation text message.
            Also allows SmsFromMobile to be linked to ConfirmationRequest in OD proper.</summary>
    </column>
    <column order="13" name="ApptDateTime" type="datetime">
      <summary>The Date and time of the original appointment. We need this in case the appointment was moved and needs another reminder sent out.</summary>
    </column>
    <column order="14" name="TSPrior" type="bigint(20)">
      <summary>This was the TSPrior used to send this reminder. </summary>
    </column>
    <column order="15" name="DoNotResend" type="tinyint(4)">
      <summary>Indicates whether the user has chosen to not resend the confirmation request when the AptDateTime has changed.</summary>
    </column>
    <column order="16" name="SendStatus" type="tinyint(4)">
      <summary>Indicates status of message.</summary>
    </column>
    <column order="17" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
    <column order="18" name="MessageType" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="19" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="20" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</summary>
    </column>
  </table>
  <table name="connectiongroup">
    <summary>Used in the Central Enterprise Management Tool for creating a group of connections.</summary>
    <column order="0" name="ConnectionGroupNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Description of the connection group</summary>
    </column>
  </table>
  <table name="conngroupattach">
    <summary>Used in the Central Enterprise Management Tool to link CentralConnections and ConnectionGroups.  Each connection can be in multiple groups.</summary>
    <column order="0" name="ConnGroupAttachNum" type="bigint(20)">
      <summary>Primary Key</summary>
    </column>
    <column order="1" name="ConnectionGroupNum" type="bigint(20)" fk="connectiongroup">
      <summary>FK to connectiongroup.ConnectionGroupNum</summary>
    </column>
    <column order="2" name="CentralConnectionNum" type="bigint(20)" fk="centralconnection">
      <summary>FK to centralconnection.CentralConnectionNum</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="bigint(20)">
      <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="bigint(20)" 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="CountyNum" type="bigint(20)">
      <summary>Primary Key.</summary>
    </column>
    <column order="1" name="CountyName" type="varchar(255)">
      <summary>Frequently used as the primary key of this table.  But it's allowed to change.  Change is programmatically synchronized.</summary>
    </column>
    <column order="2" 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="bigint(20)">
      <summary>Primary key.  Only used in Benefit and CovSpan tables.</summary>
    </column>
    <column order="1" name="Description" type="varchar(50)">
      <summary>Description of this category.</summary>
    </column>
    <column order="2" name="DefaultPercent" type="smallint(6)">
      <summary>Default percent for this category. -1 to skip this category and not apply a percentage.</summary>
    </column>
    <column order="3" name="CovOrder" type="int(11)">
      <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.  Applies to all codes.</EnumValue>
        <EnumValue name="General">1- X12: 30 and 35. All ADA codes except ortho.  D0000-D7999 and D9000-D9999</EnumValue>
        <EnumValue name="Diagnostic">2- X12: 23. ADA D0000-D0999.  This includes DiagnosticXray.</EnumValue>
        <EnumValue name="Periodontics">3- X12: 24. ADA D4000</EnumValue>
        <EnumValue name="Restorative">4- X12: 25. ADA D2000-D2699, and D2800-D2999.</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. Exclusive subcategory of restorative.  D2700-D2799</EnumValue>
        <EnumValue name="Accident">8- X12: 37. ADA range?</EnumValue>
        <EnumValue name="Orthodontics">9- X12: 38. ADA D8000-D8999</EnumValue>
        <EnumValue name="Prosthodontics">10- X12: 39. ADA D5000-D5899 (removable), and D6200-D6899 (fixed)</EnumValue>
        <EnumValue name="OralSurgery">11- X12: 40. ADA D7000</EnumValue>
        <EnumValue name="RoutinePreventive">12- X12: 41. ADA D1000</EnumValue>
        <EnumValue name="DiagnosticXRay">13- X12: 4. ADA D0200-D0399.  So this is like an optional category which is otherwise considered to be diagnosic.</EnumValue>
        <EnumValue name="Adjunctive">14- X12: 28. ADA D9000-D9999</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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CovCatNum" type="bigint(20)" 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="cpt">
    <summary>Other tables generally use the CptCode as their foreign key.</summary>
    <column order="0" name="CptNum" type="bigint(20)">
      <summary>Primary key. .</summary>
    </column>
    <column order="1" name="CptCode" type="varchar(255)">
      <summary>Cpt code. Not allowed to edit this column once saved in the database.</summary>
    </column>
    <column order="2" name="Description" type="varchar(4000)">
      <summary>Short Description provided by Cpt documentation.</summary>
    </column>
    <column order="3" name="VersionIDs" type="varchar(255)">
      <summary>Comma delimited list of years the Cpt code existed in that have been imported into this table.</summary>
    </column>
  </table>
  <table name="creditcard">
    <summary>One credit card along with any recurring charge information.</summary>
    <column order="0" name="CreditCardNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="Address" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="3" name="Zip" type="varchar(255)">
      <summary>Postal code.</summary>
    </column>
    <column order="4" name="XChargeToken" type="varchar(255)">
      <summary>Token for X-Charge. Alphanumeric, upper and lower case, about 15 char long.  Passed into Xcharge instead of the actual card number.
            Used for GlobalPayments/EdgeExpress (UI: Global Payments V1) as well.</summary>
    </column>
    <column order="5" name="CCNumberMasked" type="varchar(255)">
      <summary>Credit Card Number.  Will be stored masked: XXXXXXXXXXXX1234.</summary>
    </column>
    <column order="6" name="CCExpiration" type="date">
      <summary>Only month and year are used, the day will usually be 1.</summary>
    </column>
    <column order="7" name="ItemOrder" type="int(11)">
      <summary>The order that multiple cards will show.  Zero-based.  First one will be default.</summary>
    </column>
    <column order="8" name="ChargeAmt" type="double">
      <summary>Amount set for recurring charges.</summary>
    </column>
    <column order="9" name="DateStart" type="date">
      <summary>Start date for recurring charges.</summary>
    </column>
    <column order="10" name="DateStop" type="date">
      <summary>Stop date for recurring charges.</summary>
    </column>
    <column order="11" name="Note" type="varchar(255)">
      <summary>Any notes about the credit card or account goes here.</summary>
    </column>
    <column order="12" name="PayPlanNum" type="bigint(20)" fk="payplan">
      <summary>FK to payplan.PayPlanNum.</summary>
    </column>
    <column order="13" name="PayConnectToken" type="varchar(255)">
      <summary>Token for PayConnect.  PayConnect returns a token and token expiration, when requested by the merchant's system, to be used instead
            of actual credit card number in subsequent transactions.</summary>
    </column>
    <column order="14" name="PayConnectTokenExp" type="date">
      <summary>Expiration for the PayConnect token.  Used with the PayConnect token instead of the actual credit card number and expiration.</summary>
    </column>
    <column order="15" name="Procedures" type="text">
      <summary>Comma delimited list of the ProcCodes authorized to allow a recurring charge to be processed for the credit card. When empty, ProcCodes will not be considered when authorizing recurring charges.</summary>
    </column>
    <column order="16" name="CCSource" type="tinyint(4)">
      <summary>Enum:CreditCardSource Indicates which application made this credit card and token.</summary>
      <Enumeration name="CreditCardSource">
        <summary></summary>
        <EnumValue name="None">0 - This is used when the payment is not a Credit Card. If CC, then this means we are storing the actual credit card number. Not recommended.</EnumValue>
        <EnumValue name="XServer">1 - Local installation of X-Charge</EnumValue>
        <EnumValue name="XWeb">2 - Credit card created via X-Web (an eService)</EnumValue>
        <EnumValue name="PayConnect">3 - PayConnect web service (from within OD).</EnumValue>
        <EnumValue name="XServerPayConnect">4 - Credit card has been added through the local installation of X-Charge and the PayConnect web service.</EnumValue>
        <EnumValue name="XWebPortalLogin">5 - Made from the login screen of the Patient Portal.</EnumValue>
        <EnumValue name="PaySimple">6 - PaySimple web service (from within OD).</EnumValue>
        <EnumValue name="PaySimpleACH">7 - PaySimple ACH web service (from within OD).</EnumValue>
        <EnumValue name="PayConnectPortal">8 - PayConnect credit card (made from Patient Portal)</EnumValue>
        <EnumValue name="PayConnectPortalLogin">9 - PayConnect credit card (made from Patient Portal Login screen).</EnumValue>
        <EnumValue name="CareCredit">10 - CareCredit.</EnumValue>
        <EnumValue name="EdgeExpressRCM">11 - Global Payments V1 Cloud (formerly EdgeExpress/GlobalPayments) when calling the RCM program.</EnumValue>
        <EnumValue name="EdgeExpressCNP">12 - Global Payments V1 Card Not Present API (formerly EdgeExpress/GlobalPayments).</EnumValue>
        <EnumValue name="API">13 - Payment taken through Open Dental API.</EnumValue>
        <EnumValue name="EdgeExpressPaymentPortal">14 - Global Payments V1 (formerly EdgeExpress/GlobalPayments) payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="EdgeExpressPaymentPortalGuest">15 - Global Payments V1 (formerly EdgeExpress/GlobalPayments) payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PayConnectPaymentPortal">16 - PayConnect payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="PayConnectPaymentPortalGuest">17 - PayConnect payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PaySimplePaymentPortal">18 - PaySimple payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="PaySimplePaymentPortalGuest">19 - PaySimple payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PaySimplePaymentPortalACH">20 - PaySimple ACH Payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="XWebPaymentPortal">21 - XWeb payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="XWebPaymentPortalGuest">22 - XWeb payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="MeetInTheCloudTerminal">23 - MeetInTheCloud (UI: Global Payments V2) payment via terminal.</EnumValue>
      </Enumeration>
    </column>
    <column order="17" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. The clinic where this card was added. Each clinic could have a different AuthKey and different
            AuthKeys could generate overlapping tokens.</summary>
    </column>
    <column order="18" name="ExcludeProcSync" type="tinyint(4)">
      <summary>Only used at OD HQ.  Excludes credit card from syncing default procedures.  False by default.</summary>
    </column>
    <column order="19" name="PaySimpleToken" type="varchar(255)">
      <summary>Token for PaySimple.  PaySimple returns a token, when requested by the merchant's system, to be used instead
            of actual credit card number in subsequent transactions.</summary>
    </column>
    <column order="20" name="ChargeFrequency" type="varchar(150)">
      <summary>Stores how often the credit card gets charged for a recurring charge. The card can either be charged fixed days of the month or
            fixed week days of the month. Some examples of the former are "4th day of the month" or "1st and 16th day of the month". Some examples of
            the latter are "Third Monday of the month" or "Every other Friday of the month". If the first character of this column is a 0, then
            the frequency is fixed day of the month. If the first character is 1, the frequency is fixed week days of the month. The next character
            is a pipe for separation. If fixed day of the month, the remaining characters will be a comma-separated list of days of the month. 
            If fixed week days, the next character will represent type of frequency (Every, EveryOther, First, etc.). Then a pipe follows. The last
            character will be the day of the week (0 for Sunday, 1 for Monday, etc.).</summary>
    </column>
    <column order="21" name="CanChargeWhenNoBal" type="tinyint(4)">
      <summary>Set true to indicate the Credit Card in question can be charged when the Patient account balance is $0, which corresponds directly
            to a preference called "RecurringChargesAllowedWhenPatNoBal" (true by default) which must be turned on via Module&gt;Account&gt;Misc to be 
            available.</summary>
    </column>
    <column order="22" name="PaymentType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Payment type override for recurring charges.</summary>
    </column>
    <column order="23" name="IsRecurringActive" type="tinyint(4)">
      <summary>True by default.  Set to false to inactivate this specific credit card from the recurring charges (both manual and via the service).</summary>
    </column>
    <column order="24" name="Nickname" type="varchar(255)">
      <summary>Nickname or alias. Currently only used in Web API for PaySimple.</summary>
    </column>
    <column order="25" name="CardHolderName" type="varchar(255)">
      <summary>The card holder name associated with the credit card. Not used by all merchant services.</summary>
    </column>
  </table>
  <table name="custrefentry">
    <summary>For internal use only.</summary>
    <column order="0" name="CustRefEntryNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNumCust" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The customer seeking a reference.</summary>
    </column>
    <column order="2" name="PatNumRef" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The chosen reference.  This is the customer who was given as a reference to the new customer.</summary>
    </column>
    <column order="3" name="DateEntry" type="date">
      <summary>Date the reference was chosen.</summary>
    </column>
    <column order="4" name="Note" type="varchar(255)">
      <summary>Notes specific to this particular reference entry, mostly for a special reference situation.</summary>
    </column>
  </table>
  <table name="custreference">
    <summary>One to one relation with the patient table representing each customer as a reference.</summary>
    <column order="0" name="CustReferenceNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateMostRecent" type="date">
      <summary>Most recent date the reference was used, loosely kept updated.</summary>
    </column>
    <column order="3" name="Note" type="varchar(255)">
      <summary>Notes specific to this customer as a reference.</summary>
    </column>
    <column order="4" name="IsBadRef" type="tinyint(4)">
      <summary>Set to true if this customer was a bad reference.</summary>
    </column>
  </table>
  <table name="cvx">
    <summary>Vaccines administered.  Other tables generally use the CvxCode as their foreign key.</summary>
    <column order="0" name="CvxNum" type="bigint(20)">
      <summary>Primary key. .</summary>
    </column>
    <column order="1" name="CvxCode" type="varchar(255)">
      <summary>Cvx code. Not allowed to edit this column once saved in the database.</summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>Short Description provided by Cvx documentation.</summary>
    </column>
    <column order="3" name="IsActive" type="varchar(255)">
      <summary>Not currently in use.  Might not need this column.  If we use this in the future, then convert from string to bool.  1 if the code is an active code, 0 if the code is inactive.</summary>
    </column>
  </table>
  <table name="dashboardar">
    <summary>A table just used by the dashboard to store historical AR because it never changes and it takes too long (1 second for each of the 12 dates) to compute on the fly.  One entry per month going back at least 12 months.  This table gets automatically filled the first time that the dashboard is used.  The most recent month also gets added by using the dashboard.</summary>
    <column order="0" name="DashboardARNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateCalc" type="date">
      <summary>This date will always be the last day of a month.</summary>
    </column>
    <column order="2" name="BalTotal" type="double">
      <summary>Bal_0_30+Bal_31_60+Bal_61_90+BalOver90 for all patients.  This should also exactly equal BalTotal for all patients with positive amounts.  Negative BalTotals are credits, not A/R.</summary>
    </column>
    <column order="3" name="InsEst" type="double">
      <summary>Sum of all InsEst for all patients for the month.</summary>
    </column>
  </table>
  <table name="dashboardcell">
    <summary>Each DashboardLayout can include multiple DashboardCell(s). DashboardLayout and DashboardCell work in conjunction to form the dashboard layout.</summary>
    <column order="0" name="DashboardCellNum" type="bigint(20)">
      <summary>PK.</summary>
    </column>
    <column order="1" name="DashboardLayoutNum" type="bigint(20)" fk="dashboardlayout">
      <summary>FK to dashboardlayout.DashboardLayoutNum. This foreign key object will include the 0 based DashboardTabOrder, which is used to place this DashboardCell.</summary>
    </column>
    <column order="2" name="CellRow" type="int(11)">
      <summary>The row to which this DashboardCell belongs. 0 based.</summary>
    </column>
    <column order="3" name="CellColumn" type="int(11)">
      <summary>The column to which this DashboardCell belongs. 0 based.</summary>
    </column>
    <column order="4" name="CellType" type="varchar(255)">
      <summary>Enum:DashboardCellType Determines what type of control will be docked in this cell.</summary>
      <Enumeration name="DashboardCellType">
        <summary>Represents each type of graph which is available in graphic reports. Will be stored as string in DashboardCell unless specified otherwise.</summary>
        <EnumValue name="NotDefined"></EnumValue>
        <EnumValue name="ProductionGraph"></EnumValue>
        <EnumValue name="IncomeGraph"></EnumValue>
        <EnumValue name="AccountsReceivableGraph"></EnumValue>
        <EnumValue name="NewPatientsGraph"></EnumValue>
        <EnumValue name="BrokenApptGraph"></EnumValue>
        <EnumValue name="HQMtMessage">HQ only. Will not be saved to DashboardCell table.</EnumValue>
        <EnumValue name="HQBillingInboundOutbound">HQ only. Will not be saved to DashboardCell table.</EnumValue>
        <EnumValue name="HQBillingUsageAccess">HQ only. Will not be saved to DashboardCell table.</EnumValue>
        <EnumValue name="HQMoMessage">HQ only. Will not be saved to DashboardCell table.</EnumValue>
        <EnumValue name="HQPhone">HQ only. Will not be saved to DashboardCell table.</EnumValue>
        <EnumValue name="HQSignups">HQ only. Will not be saved to DashboardCell table.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="CellSettings" type="text">
      <summary>Typically a serialized string that the control will accept in order to change view attributes.</summary>
    </column>
    <column order="6" name="LastQueryTime" type="datetime">
      <summary>Not used yet. Timestamp at which the cached data behind this cell was last retrieved.</summary>
    </column>
    <column order="7" name="LastQueryData" type="text">
      <summary>Not used yet. Cached data behind this cell.</summary>
    </column>
    <column order="8" name="RefreshRateSeconds" type="int(11)">
      <summary>Not used yet. Frequency at which the cached data behind this cell should be retrieved.</summary>
    </column>
  </table>
  <table name="dashboardlayout">
    <summary>Each tab in the dashboard has a corresponding DashboardLayout. DashboardLayout and DashboardCell work in conjunction to form the dashboard layout.</summary>
    <column order="0" name="DashboardLayoutNum" type="bigint(20)">
      <summary>PK.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="2" name="UserGroupNum" type="bigint(20)" fk="usergroup">
      <summary>FK to usergroup.UserGroupNum.</summary>
    </column>
    <column order="3" name="DashboardTabName" type="varchar(255)">
      <summary>Text shown in the tab header.</summary>
    </column>
    <column order="4" name="DashboardTabOrder" type="int(11)">
      <summary>Orders the tabs in the tab control. 0 based.</summary>
    </column>
    <column order="5" name="DashboardRows" type="int(11)">
      <summary>Number of rows for this DashboardLayout. Min value of 1.</summary>
    </column>
    <column order="6" name="DashboardColumns" type="int(11)">
      <summary>Number of columns for this DashboardLayout. Min value of 1.</summary>
    </column>
    <column order="7" name="DashboardGroupName" type="varchar(255)">
      <summary>Groups multiple DashboardLayout(s) together.</summary>
    </column>
  </table>
  <table name="databasemaintenance">
    <summary>This is a list of DBM actions that can run.</summary>
    <column order="0" name="DatabaseMaintenanceNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MethodName" type="varchar(255)">
      <summary>The name of the databasemaintenance name.</summary>
    </column>
    <column order="2" name="IsHidden" type="tinyint(4)">
      <summary>Set to true to indicate that the method is hidden.</summary>
    </column>
    <column order="3" name="IsOld" type="tinyint(4)">
      <summary>Set to true to indicate that the method is old.</summary>
    </column>
    <column order="4" name="DateLastRun" type="datetime">
      <summary>Updates the date and time they run the method.</summary>
    </column>
  </table>
  <table name="dbmlog">
    <summary></summary>
    <column order="0" name="DbmLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  This is the assigned user dbm log.</summary>
    </column>
    <column order="2" name="FKey" type="bigint(20)">
      <summary>Foreign key to any table defined in the DbmLogType Enumeration.</summary>
    </column>
    <column order="3" name="FKeyType" type="tinyint(4)">
      <summary>Enum:DbmLogFKeyType The type of log.</summary>
      <Enumeration name="DbmLogFKeyType">
        <summary></summary>
        <EnumValue name="None">This means FKey should be 0.</EnumValue>
        <EnumValue name="Appointment">This means FKey will link to AptNum.</EnumValue>
        <EnumValue name="AutoCode">This means FKey will link to AutoCodeNum.</EnumValue>
        <EnumValue name="Automation">This means FKey will link to AutomationNum.</EnumValue>
        <EnumValue name="Benefit">This means FKey will link to BenefitNum.</EnumValue>
        <EnumValue name="Carrier">This means FKey will link to CarrierNum.</EnumValue>
        <EnumValue name="Claim">This means FKey will link to ClaimNum.</EnumValue>
        <EnumValue name="ClaimPayment">This means FKey will link to ClaimPaymentNum.</EnumValue>
        <EnumValue name="ClaimProc">This means FKey will link to ClaimProcNum.</EnumValue>
        <EnumValue name="Clinic">This means FKey will link to ClinicNum.</EnumValue>
        <EnumValue name="CreditCard">This means FKey will link to CreditCardNum.</EnumValue>
        <EnumValue name="DiscountPlanSub">This means FKey will link to DiscountPlanSub.</EnumValue>
        <EnumValue name="Etrans">This means FKey will link to EtransNum.</EnumValue>
        <EnumValue name="Fee">This means FKey will link to FeeNum.</EnumValue>
        <EnumValue name="FeeSched">This means FKey will link to FeeSchedNum.</EnumValue>
        <EnumValue name="InsPlan">This means FKey will link to PlanNum.</EnumValue>
        <EnumValue name="InsSub">This means FKey will link to InsSubNum.</EnumValue>
        <EnumValue name="PatPlan">This means FKey will link to PatPlanNum.</EnumValue>
        <EnumValue name="Patient">This means FKey will link to PatNum.</EnumValue>
        <EnumValue name="Payment">This means FKey will link to PayNum.</EnumValue>
        <EnumValue name="PayPlan">This means FKey will link to PayPlanNum.</EnumValue>
        <EnumValue name="PayPlanCharge">This means FKey will link to PayPlanChargeNum.</EnumValue>
        <EnumValue name="PaySplit">This means FKey will link to PaySpliteNum.</EnumValue>
        <EnumValue name="PlannedAppt">This means FKey will link to PlannedApptNum.</EnumValue>
        <EnumValue name="Procedure">This means FKey will link to ProcNum.</EnumValue>
        <EnumValue name="Securitylog">This means FKey will link to SecurityLogNum.</EnumValue>
        <EnumValue name="HistAppointment">This means FKey will link to HistApptNum.</EnumValue>
        <EnumValue name="ProcedureCode">This means FKey will link to CodeNum.</EnumValue>
        <EnumValue name="ToothInitial">This means FKey will link to ToothInitialNum</EnumValue>
        <EnumValue name="Provider">This means FKey will link to ProvNum</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ActionType" type="tinyint(4)">
      <summary>Enum:DbmLogActionType The type of verification.</summary>
      <Enumeration name="DbmLogActionType">
        <summary></summary>
        <EnumValue name="Insert">0. This means the action done was an Insert.</EnumValue>
        <EnumValue name="Update">1. This means the action done was an Update</EnumValue>
        <EnumValue name="Delete">2. This means the action done was a Delete</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="DateTimeEntry" type="datetime">
      <summary>DateTime the row was added.</summary>
    </column>
    <column order="6" name="MethodName" type="varchar(255)">
      <summary>The name of the DBM that created this row.</summary>
    </column>
    <column order="7" name="LogText" type="text">
      <summary>The description of exactly what was done.</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.</summary>
    <column order="0" name="DefNum" type="bigint(20)">
      <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 (FormDefinitions) in the program to see how each of these categories is used.
             If you add a category, make sure to add it to the switch statement in DefL so the user can edit it.
             Add a "NotUsed" description attribute to defs that shouldn't show up in FormDefinitions.</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. Example: D1023,D1024. Single tooth numbers are allowed, example D1151#8,D0220#15. This is really only useful for PAs. Tooth number is stored in user's nomenclature, not American numbering.</EnumValue>
        <EnumValue name="BillingTypes">4- Billing types.</EnumValue>
        <EnumValue name="ClaimFormats">5- Not used.</EnumValue>
        <EnumValue name="DunningMessages">6- Not used.</EnumValue>
        <EnumValue name="FeeSchedNamesOld">7- Not used.</EnumValue>
        <EnumValue name="MedicalNotes">8- Not used.</EnumValue>
        <EnumValue name="OperatoriesOld">9- Not 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, reactivation, unscheduled, and next appointments.</EnumValue>
        <EnumValue name="ServiceNotes">14- Not used.</EnumValue>
        <EnumValue name="DiscountTypes">15- Not used.</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. ItemValue can be one or more of the following, no delimiters. X = Show in Chart Module, M=Show Thumbnails, F = Show in Patient Forms, L = Show in Patient Portal, P = Show in Patient Pictures, S = Statements, T = Graphical Tooth Charts, R = Treatment Plans, E = Expanded, A = Payment Plans, C = Claim Attachments, B = Lab Cases, U = Autosave Forms, Y = Task Attachments, N = Claim Responses.</EnumValue>
        <EnumValue name="ApptPhoneNotes">19- Not used.</EnumValue>
        <EnumValue name="TxPriorities">20- Treatment plan priority names.</EnumValue>
        <EnumValue name="MiscColors">21- Miscellaneous color options. See enum DefCatMisColors.</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>
        <EnumValue name="PaySplitUnearnedType">29- Types of unearned income used in accrual accounting.</EnumValue>
        <EnumValue name="Prognosis">30- Prognosis types.</EnumValue>
        <EnumValue name="ClaimCustomTracking">31- Custom Tracking, statuses such as 'review', 'hold', 'riskmanage', etc.</EnumValue>
        <EnumValue name="InsurancePaymentType">32- PayType for claims such as 'Check', 'EFT', etc.</EnumValue>
        <EnumValue name="TaskPriorities">33- Categories of priorities for tasks.</EnumValue>
        <EnumValue name="FeeColors">34- Categories for fee override colors.</EnumValue>
        <EnumValue name="ProviderSpecialties">35- Provider specialties.  General, Hygienist, Pediatric, Primary Care Physician, etc.</EnumValue>
        <EnumValue name="ClaimPaymentTracking">36- Reason why a claim proc was rejected. This must be set on each individual claim proc.</EnumValue>
        <EnumValue name="AccountQuickCharge">37- Procedure quick charge list for patient accounts.</EnumValue>
        <EnumValue name="InsuranceVerificationStatus">38- Insurance verification status such as 'Verified', 'Unverified', 'Pending Verification'.</EnumValue>
        <EnumValue name="Regions">39- Regions that clinics can be assigned to.</EnumValue>
        <EnumValue name="ClaimPaymentGroups">40- ClaimPayment Payment Groups.</EnumValue>
        <EnumValue name="AutoNoteCats">41 - Auto Note Categories.  Used to categorize autonotes into custom categories.</EnumValue>
        <EnumValue name="WebSchedNewPatApptTypes">42 - Web Sched New Patient Appointment Types. Displays in Web Sched. Each appointment can be assigned one appointment.AppointmentTypeNum. Multiple AppointmentTypes are linked to this definition through the DefLink table, where deflink.DefNum=definition.DefNum,  deflink.LinkType=2, and deflink.FKey=appointmenttype.AppointmentTypeNum.</EnumValue>
        <EnumValue name="ClaimErrorCode">43 - Custom Claim Status Error Code.</EnumValue>
        <EnumValue name="ClinicSpecialty">44 - Specialties that clinics perform.  Useful for separating patient clones across clinics.</EnumValue>
        <EnumValue name="JobPriorities">45 - HQ Only job priorities.</EnumValue>
        <EnumValue name="CarrierGroupNames">46 - Carrier Group Name.</EnumValue>
        <EnumValue name="PayPlanCategories">47 - PayPlanCategory</EnumValue>
        <EnumValue name="AutoDeposit">48 - Associates an insurance payment to an account number.  Currently only used with "Auto Deposits".</EnumValue>
        <EnumValue name="InsuranceFilingCodeGroup">49 - Code Group used for insurance filing.</EnumValue>
        <EnumValue name="TimeCardAdjTypes">50 - Time card adjustment types.
            Currently for PTO, but in future could be used for other types as well if we implement the Usage def field.</EnumValue>
        <EnumValue name="WebSchedExistingApptTypes">51 - Web Sched Existing Appt Types. Each appointment can be assigned one appointment.AppointmentTypeNum. Multiple AppointmentTypes are linked to this definition through the DefLink table, where deflink.DefNum=definition.DefNum,  deflink.LinkType=2, and deflink.FKey=appointmenttype.AppointmentTypeNum.</EnumValue>
        <EnumValue name="CertificationCategories">52 - Categories for the Certifications feature.</EnumValue>
        <EnumValue name="EClipboardImageCapture">53 - Images the office prompts the patient to submit when checking in via eClipboard</EnumValue>
        <EnumValue name="TaskCategories">54 - Task categories.</EnumValue>
        <EnumValue name="OperatoryTypes">55 - Operatory Types. This field is only informational. The value isn't used for functionality.</EnumValue>
        <EnumValue name="EmployeeTitles">56 - Employee Job Titles. Only used to assign employees job titles for display.</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="ItemOrder" type="smallint">
      <summary>Order that each item shows on various lists. 0-indexed.</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. Used extensively by ImageCategories to store single letter codes.</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>
    <column order="7" name="Supp" type="varchar(255)">
      <summary>Some categories need more columns. We would normally use a dedicated table or rework the schema, but that would break many existing queries. It would also break API, warehousing, etc. We only use this Supp field strategy when expanding existing categories. Jordan will always be very involved. Only used currently for AdjTypes as the default percent setting Adjustments in FormAdjMulti and FormAdjust. Example: "90.50". Allow 0 through 1000. Empty string in the db means no default percentage.</summary>
    </column>
  </table>
  <table name="deflink">
    <summary>This table holds rows for linking a definition object to another object.  Allows for a many-to-many relationship between definitions and other object types.</summary>
    <column order="0" name="DefLinkNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DefNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. The definition that is linked to </summary>
    </column>
    <column order="2" name="FKey" type="bigint(20)">
      <summary>A foreign key to a table associated with the DefLinkType. Uses include:  ClinicNum with DefLinkType ClinicSpecialty, PatNum with DefLinkType Patient.</summary>
    </column>
    <column order="3" name="LinkType" type="tinyint(4)">
      <summary>Enum:DefLinkType The type of link.</summary>
      <Enumeration name="DefLinkType">
        <summary>The manner in which a definition is linked.</summary>
        <EnumValue name="ClinicSpecialty">0. Specialties for a clinic.</EnumValue>
        <EnumValue name="Patient">1. One definition of Category DefCat.ClinicSpecialty is linked to one patient.PatNum. This is how specialties are assigned to patient clones.</EnumValue>
        <EnumValue name="AppointmentType">2. One definition can be linked to multiple appointment types. See definition.Category: DefCat.WebSchedNewPatApptTypes and WebSchedExistingApptTypes</EnumValue>
        <EnumValue name="Operatory">3. One definition can be linked to multiple operatories where definition.Category=(DefCat.WebSchedNewPatApptTypes(42) or WebSchedExistingApptTypes(51)), deflink.DefNum=definition.DefNum,  deflink.LinkType=3, and deflink.FKey=operatory.OperatoryNum.</EnumValue>
        <EnumValue name="BlockoutType">4. The definition is linked to another definition that is in the BlockoutType category.  Used by WebSched for restricting available time slots.</EnumValue>
        <EnumValue name="RecallType">5. The definition is linked to a recall type.  Used by WebSched for identifying available time slots for recalls.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="deletedobj">
    <summary>An archived snapshot of an object. Certain objects will generate these upon being deleted. Not allowed to use random primary keys with this table because PK is used to supplement dateT to get new rows.</summary>
    <column order="0" name="DeletedObjNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateTEntry" type="datetime">
      <summary>The DateTime that this deletedobj was added to the Db. Uses server time.</summary>
    </column>
    <column order="2" name="ObjType" type="tinyint(4)">
      <summary>Enum:EnumDeletedObjType </summary>
      <Enumeration name="EnumDeletedObjType">
        <summary>Order matters. Only add new enum values to the end. </summary>
        <EnumValue name="None">0- Not used</EnumValue>
        <EnumValue name="Schedules">1- includes blockouts.</EnumValue>
        <EnumValue name="LabCases">2- </EnumValue>
        <EnumValue name="MedicationPats">3- </EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="ObjSerialized" type="mediumtext">
      <summary>A serialized snapshot of the original object at time of deletion. mediumtext 16mb max. Serialized using our custom SerializerCompact. Example: 258|2022-07-21|08:00:00|12:00:00|1|2|0|Example Note|0|15|2018-11-15 11:50:15|25|5~ </summary>
    </column>
  </table>
  <table name="deletedobject">
    <summary>When some objects are deleted, we sometimes need a way to track them for synching purposes.  Other objects already have fields for IsHidden or PatStatus which track deletions just fine.  Those types of objects will not use this table.</summary>
    <column order="0" name="DeletedObjectNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ObjectNum" type="bigint(20)">
      <summary>Foreign key to a number of different tables, depending on which type it is.</summary>
    </column>
    <column order="2" name="ObjectType" type="int(11)">
      <summary>Enum:DeletedObjectType </summary>
      <Enumeration name="DeletedObjectType">
        <summary></summary>
        <EnumValue name="Appointment">0</EnumValue>
        <EnumValue name="ScheduleProv">1 - A schedule object.  Only provider schedules are tracked for deletion.</EnumValue>
        <EnumValue name="RecallPatNum">2 - When a recall row is deleted, this records the PatNum for which it was deleted.</EnumValue>
        <EnumValue name="RxPat">Deprecated</EnumValue>
        <EnumValue name="LabPanel">Deprecated</EnumValue>
        <EnumValue name="LabResult">Deprecated</EnumValue>
        <EnumValue name="DrugUnit">Deprecated</EnumValue>
        <EnumValue name="Medication">Deprecated</EnumValue>
        <EnumValue name="MedicationPat">Deprecated</EnumValue>
        <EnumValue name="Allergy">Deprecated</EnumValue>
        <EnumValue name="AllergyDef">Deprecated</EnumValue>
        <EnumValue name="Disease">Deprecated</EnumValue>
        <EnumValue name="DiseaseDef">Deprecated</EnumValue>
        <EnumValue name="ICD9">Deprecated</EnumValue>
        <EnumValue name="Provider">Deprecated</EnumValue>
        <EnumValue name="Pharmacy">Deprecated</EnumValue>
        <EnumValue name="Statement">Deprecated</EnumValue>
        <EnumValue name="Document">Deprecated</EnumValue>
        <EnumValue name="Recall">Deprecated</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="DateTStamp" type="timestamp">
      <summary>Updated any time the row is altered in any way.</summary>
    </column>
  </table>
  <table name="deposit">
    <summary>A deposit slip.  Contains multiple insurance and patient checks.</summary>
    <column order="0" name="DepositNum" type="bigint(20)">
      <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>
    <column order="4" name="Memo" type="varchar(255)">
      <summary>Short description to help identify the deposit.</summary>
    </column>
    <column order="5" name="Batch" type="varchar(25)">
      <summary>Holds the batch number for the deposit. Does not have a default value. 25 character limit.</summary>
    </column>
    <column order="6" name="DepositAccountNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Links this deposit to a definition of type AutoDeposit.  When set to a valid value, it indicates that this deposit is an "auto deposit".</summary>
    </column>
    <column order="7" name="IsSentToQuickBooksOnline" type="tinyint(4)">
      <summary>Bool that indicates of a deposit has already been sent via QuickBooks Online. Defaults to false. Only true when successfully sent from FormDepositEdit.cs</summary>
    </column>
  </table>
  <table name="dictcustom">
    <summary>Spell check custom dictionary, shared by the whole office.</summary>
    <column order="0" name="DictCustomNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="WordText" type="varchar(255)">
      <summary>No space or punctuation allowed.</summary>
    </column>
  </table>
  <table name="discountplan">
    <summary>Discount plans will automatically create adjustments when procedures are completed.
            The fee schedule associated to the discount plan will be used with the UCR fee schedule in order to determine the "discount".
            The associated DefNum will be the adjustment type that is used so that users can quickly query adjustments to see discount plan usage.</summary>
    <column order="0" name="DiscountPlanNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Description of this discount plan</summary>
    </column>
    <column order="2" name="FeeSchedNum" type="bigint(20)" fk="feesched">
      <summary>FK to feesched.FeeSchedNum</summary>
    </column>
    <column order="3" name="DefNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  Represents the adjustment type of the feesched plan.</summary>
    </column>
    <column order="4" name="IsHidden" type="tinyint(4)">
      <summary>Set true to hide in Discount Plan list.</summary>
    </column>
    <column order="5" name="PlanNote" type="text">
      <summary>Note for this plan.</summary>
    </column>
    <column order="6" name="ExamFreqLimit" type="int(11)">
      <summary>Number of Procedures allowed for a discount plans Exam category.</summary>
    </column>
    <column order="7" name="XrayFreqLimit" type="int(11)">
      <summary>Number of Procedures allowed for a discount plans X-Ray category.</summary>
    </column>
    <column order="8" name="ProphyFreqLimit" type="int(11)">
      <summary>Number of Procedures allowed for a discount plans Prophylaxis category.</summary>
    </column>
    <column order="9" name="FluorideFreqLimit" type="int(11)">
      <summary>Number of Procedures allowed for a discount plans Fluoride category.</summary>
    </column>
    <column order="10" name="PerioFreqLimit" type="int(11)">
      <summary>Number of Procedures allowed for a discount plans Periodontal category.</summary>
    </column>
    <column order="11" name="LimitedExamFreqLimit" type="int(11)">
      <summary>Number of Procedures allowed for a discount plans Limited Exam category.</summary>
    </column>
    <column order="12" name="PAFreqLimit" type="int(11)">
      <summary>Number of Procedures allowed for a discount plans Periapical X-Ray category.</summary>
    </column>
    <column order="13" name="AnnualMax" type="double">
      <summary>Annual discount maximum for frequency limitations. -1 indicates blank or no annual max limitation.</summary>
    </column>
  </table>
  <table name="discountplansub">
    <summary>Table used to determine discount plan subscribers, as well as the effective date range of a discount plan.</summary>
    <column order="0" name="DiscountSubNum" type="bigint(20)">
      <summary>PK</summary>
    </column>
    <column order="1" name="DiscountPlanNum" type="bigint(20)" fk="discountplan">
      <summary>FK to discountplan.DiscountPlanNum, represents which plan the patient is subscribed to.</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum which represents the subscriber</summary>
    </column>
    <column order="3" name="DateEffective" type="date">
      <summary>When the discount plan should start to impact procedure fees.</summary>
    </column>
    <column order="4" name="DateTerm" type="date">
      <summary>When the discount plan should no longer impact procedure fees.</summary>
    </column>
    <column order="5" name="SubNote" type="text">
      <summary>Note for this sub.</summary>
    </column>
  </table>
  <table name="disease">
    <summary>Each row is one disease that one patient has.  Now called a problem in the UI.  Must have a DiseaseDefNum.</summary>
    <column order="0" name="DiseaseNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="DiseaseDefNum" type="bigint(20)" 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. When importing from eForms, this is where the disease name goes for "Other" when there's no match.</summary>
    </column>
    <column order="4" name="DateTStamp" type="timestamp">
      <summary>The last date and time this row was altered.  Not user editable.</summary>
    </column>
    <column order="5" name="ProbStatus" type="tinyint(4)">
      <summary>Enum:ProblemStatus Active=0, Resolved=1, Inactive=2.</summary>
      <Enumeration name="ProblemStatus">
        <summary>0=Active, 1=Resolved, 2=Inactive</summary>
        <EnumValue name="Active">0</EnumValue>
        <EnumValue name="Resolved">1</EnumValue>
        <EnumValue name="Inactive">2</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="DateStart" type="date">
      <summary>Date that the disease was diagnosed.  Can be minval if unknown.</summary>
    </column>
    <column order="7" name="DateStop" type="date">
      <summary>Date that the disease was set resolved or inactive.  Will be minval if still active.  ProbStatus should be used to determine if it is active or not.</summary>
    </column>
    <column order="8" name="SnomedProblemType" type="varchar(255)" fk="snomed">
      <summary>FK to snomed.SnomedCode.  Used in EHR CCD export/import only.  Must be one of the following SNOMED codes:
            Problem/Concern (55607006 or blank), Finding (404684003), Complaint (409586006), Dignosis (282291009), Condition (64572001), FunctionalLimitation (248536006), Symptom (418799008).</summary>
    </column>
    <column order="9" name="FunctionStatus" type="tinyint(4)">
      <summary>Enum:FunctionalStatus  Used to export EHR CCD functional status and/or cognitive status information only.</summary>
      <Enumeration name="FunctionalStatus">
        <summary>Used in EHR to export patient functional and cognitive statuses on CCD documents.</summary>
        <EnumValue name="Problem">0 - Default value.  If not using EHR, then each diseasedef will use this value.</EnumValue>
        <EnumValue name="CognitiveResult">1 - This clinical statement contains details of an evaluation or assessment of a patient’s cognitive status. The evaluation may include assessment of a patient's mood, memory, and ability to make decisions. The statement will include, if present, supporting caregivers, non-medical devices, and the time period for which the evaluation and assessment were performed.</EnumValue>
        <EnumValue name="CognitiveProblem">2 - A cognitive status problem observation is a clinical statement that describes a patient's cognitive condition, findings or symptoms. Examples of cognitive problem observations are inability to recall, amnesia, dementia, and aggressive behavior. A cognitive problem observation is a finding or medical condition. This is different from a cognitive result observation, which is a response to a question that provides insight to the patient's cognitive status. It reflects findings that provide information about a medical condition, while a result observation reflects responses to questions in a cognitive test or those that provide information about a person's judgement, comprehension ability, and response speed.</EnumValue>
        <EnumValue name="FunctionalResult">3 - This clinical statement represents details of an evaluation or assessment of a patient’s functional status. The evaluation may include assessment of a patient's  language, vision, hearing, activities of daily living, behavior, general function, mobility and self-care status. The statement will include, if present, supporting caregivers, non-medical devices, and the time period for which the evaluation and assessment were performed.</EnumValue>
        <EnumValue name="FunctionalProblem">4 - A functional status problem observation is a clinical statement that represents a patient’s functional perfomance and ability.</EnumValue>
      </Enumeration>
    </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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DiseaseName" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="ItemOrder" type="smallint">
      <summary>0-based.  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>
    <column order="4" name="DateTStamp" type="timestamp">
      <summary>The last date and time this row was altered.  Not user editable.</summary>
    </column>
    <column order="5" name="ICD9Code" type="varchar(255)" fk="icd9">
      <summary>FK to icd9.Icd9Code.  Example: 250.00 for diabetes.  User not allowed to enter any string anymore, must pick one from the Icd9Code table.  Some may exist in the databases without linking to a valid Icd9Code table entry if the ConvertDatabase could not find the user typed string in the list of valid Icd9Codes.</summary>
    </column>
    <column order="6" name="SnomedCode" type="varchar(255)" fk="snomed">
      <summary>FK to snomed.SnomedCode.  Example: 230572002 for diabetic neuropathy.  User not allowed to enter any string anymore, must pick from the Snomed table.  Some may exist in the databases without linking to a valid Snomed table entry if the ConvertDatabase could find the user typed string in the list of valid SnomedCodes.</summary>
    </column>
    <column order="7" name="Icd10Code" type="varchar(255)" fk="icd10">
      <summary>FK to icd10.Icd10Code.  Example: E10.1 for 'Type 1 diabetes mellitus with ketoacidosis'. User not allowed to enter any string anymore, must pick one from the Icd10Code table.</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="bigint(20)">
      <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 in Description. For Ortho chart, this column will be "Signature", "Provider", or blank. For SuperFamilyGridCols, if this is a patfield column, then this will be blank.</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. For Ortho, this is the 'key', since InternalName is blank sometimes. For SuperFamilyGridCols, if this is a patfield column, then this will be the name of the patfield.FieldName.</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>
    <column order="5" name="Category" type="int(11)">
      <summary>Enum:DisplayFieldCategory If category is 0, then this is attached to a ChartView.</summary>
      <Enumeration name="DisplayFieldCategory">
        <summary></summary>
        <EnumValue name="None">0- Badly named. This should be called Progress Notes.</EnumValue>
        <EnumValue name="PatientSelect">1</EnumValue>
        <EnumValue name="PatientInformation">2- Family module.</EnumValue>
        <EnumValue name="AccountModule">3</EnumValue>
        <EnumValue name="RecallList">4</EnumValue>
        <EnumValue name="ChartPatientInformation">5</EnumValue>
        <EnumValue name="ProcedureGroupNote">6</EnumValue>
        <EnumValue name="TreatmentPlanModule">7</EnumValue>
        <EnumValue name="OrthoChart">8</EnumValue>
        <EnumValue name="AppointmentBubble">9</EnumValue>
        <EnumValue name="AccountPatientInformation">10- Account module patient information</EnumValue>
        <EnumValue name="StatementMainGrid">11</EnumValue>
        <EnumValue name="FamilyRecallGrid">12</EnumValue>
        <EnumValue name="AppointmentEdit">13</EnumValue>
        <EnumValue name="PlannedAppointmentEdit">14</EnumValue>
        <EnumValue name="OutstandingInsReport">15</EnumValue>
        <EnumValue name="CEMTSearchPatients">16</EnumValue>
        <EnumValue name="ArManagerSentGrid">17 - A/R Manager Sent Grid</EnumValue>
        <EnumValue name="ArManagerUnsentGrid">18 - A/R Manager Unsent Grid</EnumValue>
        <EnumValue name="ArManagerExcludedGrid">19 - A/R Manager Excluded Grid</EnumValue>
        <EnumValue name="LimitedCustomStatement">20 - Statement Limited Custom SuperFamily</EnumValue>
        <EnumValue name="SuperFamilyGridCols">21 - SuperFamily Grid</EnumValue>
        <EnumValue name="AccountModuleServiceDateView">22</EnumValue>
        <EnumValue name="ERA">23 - Electronic Remittance Advice (ERA).</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="ChartViewNum" type="bigint(20)" fk="chartview">
      <summary>FK to chartview.ChartViewNum. 0 if attached to a category.</summary>
    </column>
    <column order="7" name="PickList" type="text">
      <summary>Newline delimited string which contains the selectable options in combo box dropdowns.  Specifically for the Ortho chart.</summary>
    </column>
    <column order="8" name="DescriptionOverride" type="varchar(255)">
      <summary>Only used in Ortho and SuperFamilyGridCols (PatField). Ortho chart display fields utilize the InternalName field for Signature and Provider indicators, this field is here to override description. Some users want to use different fields but use the same description for multiple tabs. Example: The display field of WeightWeekly shows as "Weight" and in another tab the field for WeightMonthly can also show as "Weight".</summary>
    </column>
  </table>
  <table name="displayreport">
    <summary>One row per standard report.</summary>
    <column order="0" name="DisplayReportNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="InternalName" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="ItemOrder" type="int(11)">
      <summary>.</summary>
    </column>
    <column order="3" name="Description" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="4" name="Category" type="tinyint(4)">
      <summary>Enum:DisplayReportCategory 0 - ProdInc; 1 - Daily, 2 - Monthly, 3 - Lists, 4 - PublicHealth, 5 - ArizonaPrimaryCare.</summary>
      <Enumeration name="DisplayReportCategory">
        <summary></summary>
        <EnumValue name="ProdInc">0 - Production and Income reports</EnumValue>
        <EnumValue name="Daily">1 - Daily reports</EnumValue>
        <EnumValue name="Monthly">2 - Monthly reports</EnumValue>
        <EnumValue name="Lists">3 - List reports</EnumValue>
        <EnumValue name="PublicHealth">4 - Public Health reports</EnumValue>
        <EnumValue name="ArizonaPrimaryCare">5 - Arizona Primary care reports</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="IsHidden" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="6" name="IsVisibleInSubMenu" type="tinyint(4)">
      <summary>When true and IsHidden is false, will show this report in a pop out sub menu.</summary>
    </column>
  </table>
  <table name="dispsupply">
    <summary>A dental supply or office supply item that has been dispensed.</summary>
    <column order="0" name="DispSupplyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SupplyNum" type="bigint(20)" fk="supply">
      <summary>FK to supply.SupplyNum</summary>
    </column>
    <column order="2" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum</summary>
    </column>
    <column order="3" name="DateDispensed" type="date">
      <summary></summary>
    </column>
    <column order="4" name="DispQuantity" type="float">
      <summary>Quantity given out.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>Notes on the dispensed supply.</summary>
    </column>
  </table>
  <table name="document">
    <summary>Represents a single document in the imaging module.</summary>
    <column order="0" name="DocNum" type="bigint(20)">
      <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="datetime">
      <summary>Date and time. Can be edited by user, but not forward dated without that permission.</summary>
    </column>
    <column order="3" name="DocCategory" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Categories for documents. 0 for ChartLetters.</summary>
    </column>
    <column order="4" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The document will be located in the patient folder of this patient.</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 Document, Radiograph, Photo, File, Attachment.</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="Attachment">4- Used for Claim Attachments. Preserves original resolution.</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="float">
      <summary>Any positive or negative, including decimals.</summary>
    </column>
    <column order="9" name="ToothNumbers" type="varchar(255)">
      <summary>An optional list of tooth numbers. In Db, rigorously formatted as American numbers, and separated by commas.  For display, uses hyphens for sequences.  Very likely supports international tooth numbers, but not tested for that.</summary>
    </column>
    <column order="10" name="Note" type="mediumtext">
      <summary>MediumText, so max length=16M for API upload base64.</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. Signature for ChartLetter is also bound to bytes of Word doc, but it might be a slightly different algorithm than non-ChartLetters.</summary>
    </column>
    <column order="13" name="CropX" type="int(11)">
      <summary>Crop rectangle X. May be negative. First, image is rotated as needed around center. Then, clipped to this crop rectangle.  X-Y is center of the crop rectangle relative to center of the image, and where positive is to the upper right of the center of the image.</summary>
    </column>
    <column order="14" name="CropY" type="int(11)">
      <summary>Crop rectangle Y. May be negative. First, image is rotated as needed around center. Then, clipped to this crop rectangle. X-Y is center of the crop rectangle relative to center of the image, and where positive is to the upper right of the center of the image.</summary>
    </column>
    <column order="15" name="CropW" type="int(11)">
      <summary>Crop rectangle Width in original image pixel scale.  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 scale.  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. For 12 bit images with a max of 4096, the same max of 255 is used here, but it's just scaled proportionally (x16).</summary>
    </column>
    <column order="19" name="MountItemNum" type="bigint(20)" fk="mountitem">
      <summary>FK to mountitem.MountItemNum. If set, then this image will only show on a mount, not in the main tree. If set to 0, then no mount item is associated with this document.</summary>
    </column>
    <column order="20" name="DateTStamp" type="timestamp">
      <summary>Date/time last altered.</summary>
    </column>
    <column order="21" name="RawBase64" type="mediumtext">
      <summary>The raw file data encoded as base64.  Only used if there is no AtoZ folder.</summary>
    </column>
    <column order="22" name="Thumbnail" type="text">
      <summary>Thumbnail encoded as base64.  Only present if not using AtoZ folder. 100x100 pixels, jpg, takes around 5.5k.</summary>
    </column>
    <column order="23" name="ExternalGUID" type="varchar(255)">
      <summary>The primary key associated to a document hosted on an external source.</summary>
    </column>
    <column order="24" name="ExternalSource" type="varchar(255)">
      <summary>Enum:ExternalSourceType None, Dropbox, XVWeb. The source for the corresponding ExternalGUID.</summary>
      <Enumeration name="ExternalSourceType">
        <summary>Supported sources that help identify what the corresponding ExternalGUID column should be used for.</summary>
        <EnumValue name="None">This is a document that is not stored in an external source.  All documents stored by Open Dental will be this type.</EnumValue>
        <EnumValue name="Dropbox">This document can be found in a corresponding Dropbox account.</EnumValue>
        <EnumValue name="XVWeb">This document is saved from a download from XVWeb program link.</EnumValue>
      </Enumeration>
    </column>
    <column order="25" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. Optional. Used for radiographs and ChartLetters.</summary>
    </column>
    <column order="26" name="IsCropOld" type="tinyint">
      <summary>Set to true as part of conversion to 21.4. Set back to false once the crop is converted to the new scheme. It would take too long to do this conversion in the normal script because it involves loading each image to obtain width and height. So this is a lazy conversion.</summary>
    </column>
    <column order="27" name="OcrResponseData" type="text">
      <summary>Stores a JSON serialized OcrInsScanResponse object. The type of this object is defined by the OcrCaptureType.</summary>
    </column>
    <column order="28" name="ImageCaptureType" type="tinyint(4)">
      <summary>Enum:EnumOcrCaptureType 0=Miscellaneous, 1=PrimaryInsFront, 2=PrimaryInsBack, 3=SecondaryInsFront, 4=SecondaryInsBack. Only used when patient scans their insurance card from eClipboard.</summary>
      <Enumeration name="EnumOcrCaptureType">
        <summary> The type of image. Miscelllaneuous is for all images without special behavior. </summary>
        <EnumValue name="Miscellaneous">0- Catch-All type for imageCaptures without unique behavior </EnumValue>
        <EnumValue name="PrimaryInsFront">1</EnumValue>
        <EnumValue name="PrimaryInsBack">2</EnumValue>
        <EnumValue name="SecondaryInsFront">3</EnumValue>
        <EnumValue name="SecondaryInsBack">4</EnumValue>
      </Enumeration>
    </column>
    <column order="29" name="PrintHeading" type="tinyint(4)">
      <summary>Set true by default for radiographs and tooth charts. When set to true, it will print additional heading text including patient name, DOB, and today's date.</summary>
    </column>
    <column order="30" name="ChartLetterStatus" type="tinyint(4)">
      <summary>If not 0, this document is a Chart Letter. It will only show in the Chart Module and not in the Imaging Module. The document will be a Word document based on a template. The intent is for it to be used for very complex chart notes. It could then be sent to the referring dentist, for example. DocCategory will be 0 for these which naturally hides them in Imaging module. Like a procnote, a chart letter cannot actually be edited or deleted. All edits are preserved for audit trail and a copy is made for each edit.</summary>
    </column>
    <column order="31" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. Only used when DocChartLetterStatus &gt; 0. Tracks which user made the change.</summary>
    </column>
    <column order="32" name="ChartLetterHash" type="varchar(255)">
      <summary>Only used for ChartLetter. Every time a Word document is saved, we create a new document row with this hash tied to the byte sequence of that Word document. This proves that it was unaltered. The hash is 16 bytes, but we want a human-readable version. So we convert each byte to a two char hex string. So this field will always be 32 characters without any spaces or punc.</summary>
    </column>
  </table>
  <table name="documentmisc">
    <summary>For storing docs/images in database.  This table is for the various miscellaneous documents that are not in the normal patient subfolders.</summary>
    <column order="0" name="DocMiscNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateCreated" type="date">
      <summary>Date created.</summary>
    </column>
    <column order="2" name="FileName" type="varchar(255)">
      <summary>The name the file would have if it was not in the database. Does not include any directory info.
            DocumentMisc rows that store the contents of the UpdateFiles folder will set this column to an "item order".
            Due to severe limitations with sending large amounts of data all in one query we are going to store the UpdateFiles over several rows.
            The FileName column will store the order of which the UpdateFiles need to go back into when we try to reconstruct it.</summary>
    </column>
    <column order="3" name="DocMiscType" type="tinyint(4)">
      <summary>Enum:DocumentMiscType Corresponds to the same subfolder within AtoZ folder. eg. UpdateFiles</summary>
      <Enumeration name="DocumentMiscType">
        <summary>More types will be added to correspond to most of the subfolders inside the AtoZ folder.  But no point adding them until we implement.</summary>
        <EnumValue name="UpdateFiles">0- There will just be zero or one row of this type.  It will contain a zipped archive.</EnumValue>
        <EnumValue name="UpdateFilesSegment">1- Entries with this doc type hold segments of the UpdateFiles RawBase64 zip contents that will be pieced back together later.
            Storing the entire Update Files contents into one row was exceeding MySQL max_allowed_packet limitations so this new type is required.
            Each row of this type will contain ~1MB of RawBase64 data.</EnumValue>
        <EnumValue name="ShareScreenExeSegment">2- Entires of this doc type are segments of OpenDentalShareScreen.exe from our website.
            File names are formatted like version{guid}segment# (ex 12.11.2022.501{45e744a7-f6dd-4e55-9f9f-11d1f746eefe}13).
            An OpenDentalShareScreen.exe is complete when a record is present without a segment# (ex 12.11.2022.501{45e744a7-f6dd-4e55-9f9f-11d1f746eefe}).</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="RawBase64" type="longtext">
      <summary>The raw file data encoded as base64.</summary>
    </column>
  </table>
  <table name="drugmanufacturer">
    <summary>Manufacturer of a vaccine.</summary>
    <column order="0" name="DrugManufacturerNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ManufacturerName" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="ManufacturerCode" type="varchar(20)">
      <summary>An abbreviation of the manufacturer name.</summary>
    </column>
  </table>
  <table name="drugunit">
    <summary>And other kinds of units.  We will only prefill this list with units needed for the tests.  Users would have to manually add any other units.</summary>
    <column order="0" name="DrugUnitNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UnitIdentifier" type="varchar(20)">
      <summary>Example ml, capitalization not critical. Usually entered as lowercase except for L.</summary>
    </column>
    <column order="2" name="UnitText" type="varchar(255)">
      <summary>Example milliliter.</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="bigint(20)">
      <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="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.</summary>
    </column>
    <column order="3" name="AgeAccount" type="tinyint">
      <summary>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>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="MessageBold" type="text">
      <summary>A message that will be copied to the NoteBold field of the Statement.</summary>
    </column>
    <column order="6" name="EmailSubject" type="varchar(255)">
      <summary>An override for the default email subject.</summary>
    </column>
    <column order="7" name="EmailBody" type="mediumtext">
      <summary>An override for the default email body. Limit in db: 16M char.</summary>
    </column>
    <column order="8" name="DaysInAdvance" type="int(11)">
      <summary>The number of days before an account reaches AgeAccount to include this dunning message on statements.
            Example: If DaysInAdvance=3 and AgeAccount=90, an account that is 87 days old when bills are generated will include this message.</summary>
    </column>
    <column order="9" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="10" name="IsSuperFamily" type="tinyint(4)">
      <summary>Boolean. Is true when the message is specifically created for super families.</summary>
    </column>
  </table>
  <table name="ebill">
    <summary>Keeps track of account details of e-statements per clinic.</summary>
    <column order="0" name="EbillNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. This can be 0 to indicate default/HQ.</summary>
    </column>
    <column order="2" name="ClientAcctNumber" type="varchar(255)">
      <summary>The account number for the e-statement client.</summary>
    </column>
    <column order="3" name="ElectUserName" type="varchar(255)">
      <summary>The user name for this particular account.</summary>
    </column>
    <column order="4" name="ElectPassword" type="varchar(255)">
      <summary>The password for this particular account.</summary>
    </column>
    <column order="5" name="PracticeAddress" type="tinyint(4)">
      <summary>Enum:EbillAddress </summary>
      <Enumeration name="EbillAddress">
        <summary></summary>
        <EnumValue name="PracticePhysical">0</EnumValue>
        <EnumValue name="PracticeBilling">1</EnumValue>
        <EnumValue name="PracticePayTo">2</EnumValue>
        <EnumValue name="ClinicPhysical">3</EnumValue>
        <EnumValue name="ClinicBilling">4</EnumValue>
        <EnumValue name="ClinicPayTo">5</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="RemitAddress" type="tinyint(4)">
      <summary>Enum:EbillAddress </summary>
      <Enumeration name="EbillAddress">
        <summary></summary>
        <EnumValue name="PracticePhysical">0</EnumValue>
        <EnumValue name="PracticeBilling">1</EnumValue>
        <EnumValue name="PracticePayTo">2</EnumValue>
        <EnumValue name="ClinicPhysical">3</EnumValue>
        <EnumValue name="ClinicBilling">4</EnumValue>
        <EnumValue name="ClinicPayTo">5</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="eclipboardimagecapture">
    <summary>Linker table between patients and the images they have submitted to the office via eClipboard. Lets office know when a patient last submitted
            a certain image. Is used in conjuction with EClipboardImageCaptureDef table to allow offices to set frequencies for how often patients should 
            submit certain images, similar to sheets.</summary>
    <column order="0" name="EClipboardImageCaptureNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DefNum" type="bigint(20)">
      <summary>FK to def.DefNum. Should match a DefNum that that is in the in 'EClipboard Images' defcat. Will be zero when IsSelfPortrait.</summary>
    </column>
    <column order="3" name="IsSelfPortrait" type="tinyint(4)">
      <summary>Using DefNum to identify the self portrait is unreliable as the image category that is used to store self portraits may change. Instead, set this field to
            true for any image capture that is a self portrait. Only for self-portraits tied to the pref 'EClipboardAllowSelfPortraitOnCheckIn', not 'eClipboard Images' defcat.</summary>
    </column>
    <column order="4" name="DateTimeUpserted" type="datetime">
      <summary>Records the date and time the patient took the image. If patient has submitted this eclipboard image before, then we simply update the
            DateUpserted field and DocNum field. We do not insert an entirely new record.</summary>
    </column>
    <column order="5" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum. If a document is deleted, need to also delete any record from this table with the same DocNum.</summary>
    </column>
    <column order="6" name="OcrCaptureType" type="tinyint(4)">
      <summary>Enum:EnumOcrCaptureType 0=Miscellaneous, 1=PrimaryInsFront, 2=PrimaryInsBack, 3=SecondaryInsFront, 4=SecondaryInsBack </summary>
      <Enumeration name="EnumOcrCaptureType">
        <summary> The type of image. Miscelllaneuous is for all images without special behavior. </summary>
        <EnumValue name="Miscellaneous">0- Catch-All type for imageCaptures without unique behavior </EnumValue>
        <EnumValue name="PrimaryInsFront">1</EnumValue>
        <EnumValue name="PrimaryInsBack">2</EnumValue>
        <EnumValue name="SecondaryInsFront">3</EnumValue>
        <EnumValue name="SecondaryInsBack">4</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="eclipboardimagecapturedef">
    <summary>Used to set rules for how often a patient should submit an image when checking in for their appointment via eClipboard. Example: insurance card or patient portrait. This is the grid on the right in eClipboard Images window.</summary>
    <column order="0" name="EClipboardImageCaptureDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DefNum" type="bigint(20)">
      <summary>FK to def.DefNum. Should match a DefNum that is in the in 'EClipboard Images' defcat.  Will be zero when IsSelfPortrait.</summary>
    </column>
    <column order="2" name="IsSelfPortrait" type="tinyint(4)">
      <summary>True if the rule pertains to the patient self portrait. False if the rule is for an 'Eclipboard images' defcat definition.</summary>
    </column>
    <column order="3" name="FrequencyDays" type="int(11)">
      <summary>Deprecated.</summary>
    </column>
    <column order="4" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. Clinic the rule pertains to.</summary>
    </column>
    <column order="5" name="OcrCaptureType" type="tinyint(4)">
      <summary>Enum:EnumOcrCaptureType 0=Miscellaneous, 1=PrimaryInsFront, 2=PrimaryInsBack, 3=SecondaryInsFront, 4=SecondaryInsBack </summary>
      <Enumeration name="EnumOcrCaptureType">
        <summary> The type of image. Miscelllaneuous is for all images without special behavior. </summary>
        <EnumValue name="Miscellaneous">0- Catch-All type for imageCaptures without unique behavior </EnumValue>
        <EnumValue name="PrimaryInsFront">1</EnumValue>
        <EnumValue name="PrimaryInsBack">2</EnumValue>
        <EnumValue name="SecondaryInsFront">3</EnumValue>
        <EnumValue name="SecondaryInsBack">4</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="Frequency" type="tinyint(4)">
      <summary>Enum:EnumEClipFreq 0=Once, 1=EachTime, 2=TimeSpan. The frequency that an image capture will be submitted by patients. ResubmitInterval can only be set if Frequency is TimeSpan.</summary>
      <Enumeration name="EnumEClipFreq">
        <summary>Specifies the frequency that an EClipboardSheetDef or an EClipboardImageCaptureDef will be submitted by patients.</summary>
        <EnumValue name="Once">0 - Each patient will submit this form or image capture exactly one time.</EnumValue>
        <EnumValue name="EachTime">1 - Each patient will submit this form or image capture at every visit.</EnumValue>
        <EnumValue name="TimeSpan">2 - Each patient will submit this form or image capture based on a specified time span measured in Years and Months.</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="ResubmitInterval" type="bigint(20)">
      <summary>If Frequency is EnumEClipFreq.TimeSpan, this will indicate the acceptable amount of time (measured in Years and Months) that can pass since the last time the patient has submitted this image capture.</summary>
    </column>
  </table>
  <table name="eclipboardsheetdef">
    <summary>Holds settings for eClipboard. Each row is attached to one SheetDef or EFormDef. This table might typically only have 3 to 4 rows in it. There could be more for different clinics. This information helps the software decide whether or not to display a sheet or eForm for a specific patient based on certain criteria. Examples include MinAge, MaxAge, Frequency, and ResubmitInterval. Forms will also end up on the eClipboard if their sheet.ShowInTerminal is non-zero or eForm.Status=ReadyForPatientFill.</summary>
    <column order="0" name="EClipboardSheetDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SheetDefNum" type="bigint(20)" fk="sheetdef">
      <summary>FK to SheetDef.SheetDefNum. Can be zero if this row is for an eForm.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0 if no clinic or if default clinic.</summary>
    </column>
    <column order="3" name="ResubmitInterval" type="bigint(20)">
      <summary>If Frequency is EnumEClipFreq.TimeSpan, this will indicate the acceptable amount of time (measured in Years, Months, and Days) that can pass since the last time the patient has filled this form out. Once this has elapsed, if the EClipboardCreateMissingFormsOnCheckIn pref is turned on, this form will automatically be added to the patient forms to fill out when the patient is checked in.</summary>
    </column>
    <column order="4" name="ItemOrder" type="int(11)">
      <summary>The order in which the patient will be asked to fill out this form.</summary>
    </column>
    <column order="5" name="PrefillStatus" type="tinyint(4)">
      <summary>Determines how forms will be shown in eClipboard, blank or prefill. eForms are prefilled regardless. This flag just indicates whether to also attempt to fill non-db fields by using info from previous eForms.</summary>
    </column>
    <column order="6" name="MinAge" type="int(11)">
      <summary>Indicates the minimum age of the patient to be given the form to fill out. If their age is below the minimum limit, they will not be given the form to fill out. A value of -1 means ignore any age requirements.</summary>
    </column>
    <column order="7" name="MaxAge" type="int(11)">
      <summary>Indicates the maximum age of the patient to be given the form to fill out. If their age is over or equal to this maximum limit, they will not be given the form to fill out. A value of -1 means ignore any age requirements.</summary>
    </column>
    <column order="8" name="IgnoreSheetDefNums" type="text">
      <summary>Comma delimited list of sheetdef nums to ignore. This can only be set if the preFillStatus is set to Once. These sheetDefs are ignored until this sheet is filled out. For example, an office may have a sheet for new patients that is only filled out once. IgnoreSheetDefNums can be set to include the normal patient forms which will be ignored at first. Once the new patient has filled out this sheet, these other sheetDefs will no longer be ignored when the patient checks in again. Nothing like this for eForms yet.</summary>
    </column>
    <column order="9" name="PrefillStatusOverride" type="bigint(20)">
      <summary>For both Sheets and eForms. 0 by default. When saving a linked Def, the UI gives the user an option to update this field with the new RevID. It explains that this will cause all patients to have to fill out this form again, even though it's marked as Frequency Once. If this value is higher than the RevID of the last form the patient filled out, then the Def must have been updated in this manner and the patient will need to fill out the form again. Otherwise, it will be excluded.</summary>
    </column>
    <column order="10" name="EFormDefNum" type="bigint(20)" fk="eformdef">
      <summary>FK to EFormDef.EFormDefNum. Can be zero if this row is for a sheet.</summary>
    </column>
    <column order="11" name="Frequency" type="tinyint(4)">
      <summary>Enum:EnumEClipFreq 0=Once, 1=EachTime, 2=TimeSpan. The frequency that a form will be submitted by patients. ResubmitInterval can only be set if Frequency is TimeSpan.</summary>
      <Enumeration name="EnumEClipFreq">
        <summary>Specifies the frequency that an EClipboardSheetDef or an EClipboardImageCaptureDef will be submitted by patients.</summary>
        <EnumValue name="Once">0 - Each patient will submit this form or image capture exactly one time.</EnumValue>
        <EnumValue name="EachTime">1 - Each patient will submit this form or image capture at every visit.</EnumValue>
        <EnumValue name="TimeSpan">2 - Each patient will submit this form or image capture based on a specified time span measured in Years and Months.</EnumValue>
      </Enumeration>
    </column>
    <column order="12" name="SheetDefNumsConsidered" type="varchar(255)">
      <summary>Comma-delimited list of sheetDefNums that will also be considered with this eForm when doing frequency calculations. This allows easy transition from sheets to eForms. The reason we allow multiple is because sheets were likely to have one form for new patients and a different form for existing patients. The code must be resilient enough to handle bad SheetNums here.</summary>
    </column>
  </table>
  <table name="eduresource">
    <summary>EHR education resource.  Only one of the 3 FK fields will be used at a time (DiseaseDefNum, MedicationNum, or LabResultID).  The other two will be blank.   Displays a clickable URL if the patient meets certain criteria.  </summary>
    <column order="0" name="EduResourceNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DiseaseDefNum" type="bigint(20)" fk="diseasedef">
      <summary>FK to diseasedef.DiseaseDefNum.  This now also handles ICD9s and Snomeds via the entry in DiseaseDef.</summary>
    </column>
    <column order="2" name="MedicationNum" type="bigint(20)" fk="medication">
      <summary>FK to medication.MedicationNum. </summary>
    </column>
    <column order="3" name="LabResultID" type="varchar(255)" fk="labresult">
      <summary>FK to labresult.TestID. </summary>
    </column>
    <column order="4" name="LabResultName" type="varchar(255)">
      <summary>Used for display in the grid.</summary>
    </column>
    <column order="5" name="LabResultCompare" type="varchar(255)">
      <summary>String, example &lt;43. Must start with &lt; or &gt; followed by int.  Only used if FK LabResultID is used.</summary>
    </column>
    <column order="6" name="ResourceUrl" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="7" name="SmokingSnoMed" type="varchar(255)" fk="ehrmeasureevent">
      <summary>FK to ehrmeasureevent.CodeValueResult when ehrmeasureevent.EventType=EhrMeasureEventType.TobaccoUseAssessed (8).</summary>
    </column>
  </table>
  <table name="eform">
    <summary>EForms is a way for patients to fill out forms. This is similar to sheets, but optimized for dynamic layout instead of fixed layout. The office sets up templates, EFormDefs, which get copied to EForms. Each EForm is linked to one patient.</summary>
    <column order="0" name="EFormNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FormType" type="tinyint(4)">
      <summary>Enum:EnumEFormType 0=PatientForm, 1=MedicalHistory, 2=Consent. This doesn't actually do anything, and all fields are available for all types, but that might eventually change if more types are added.</summary>
      <Enumeration name="EnumEFormType">
        <summary>Different types of EForms that can be used.</summary>
        <EnumValue name="PatientForm">0 - Includes patient information and insurance information.</EnumValue>
        <EnumValue name="MedicalHistory">1 - </EnumValue>
        <EnumValue name="Consent">2 - .</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fkey="patient">
      <summary>FKey to patient.PatNum.</summary>
    </column>
    <column order="3" name="DateTimeShown" type="datetime">
      <summary>The date and time that show in the UI. Updated when the patient fills out and submits the eForm via eClipboard.</summary>
    </column>
    <column order="4" name="Description" type="varchar(255)">
      <summary>The title of the EForm. Copied from EFormDef.Description.</summary>
    </column>
    <column order="5" name="DateTEdited" type="datetime">
      <summary>The date and time when the EForm was lasted edited. Not editable by the user in the UI. Doesn't seem to actually be used for anything.</summary>
    </column>
    <column order="6" name="MaxWidth" type="int(11)">
      <summary>Required. Can be any value between 50 and 1000. On wide screens, this limits the width of the form. This is needed on pretty much anything other than a phone. Makes it look consistent across devices and prevents useless white space. Default 450.</summary>
    </column>
    <column order="7" name="EFormDefNum" type="bigint(20)" fkey="eformdef">
      <summary>FKey to eformdef.EFormDefNum. Don't use this as a FK to an EFormDef normally because the original def is not guaranteed to be intact. Since it was just a template, it can easily have changed since the eForm was copied from the template. Think of it as a lightweight minimal reference just used for a few edge cases. This is only used alongside the eClipboardSheetDef table to determine if the patient has filled out that form yet. It's also used with the RevID to prefill fields that don't use a DbLink by pulling from a previous form. I think this also requires using the ReportableName for those fields.</summary>
    </column>
    <column order="8" name="Status" type="tinyint(4)">
      <summary>Enum:EnumEFormStatus 0-None, 1-ShowInEClipboard, 2-Filled, 3-Imported. In the None status, the office might be filling in the tooth number on a consent form. ShowInEClipboard status makes it show in eClipboard. Sheets use ShowInTerminal for this purpose. Once the patient has filled it, the status is changed to Filled. Sheets uses IsWebForm for this purpose. If a Filled eForm gets imported, then the status is changed to Imported.</summary>
      <Enumeration name="EnumEFormStatus">
        <summary></summary>
        <EnumValue name="None">0 - If a form is added manually in OD proper and then filled out by the patient in OD proper, it will remain this status.</EnumValue>
        <EnumValue name="ShowInEClipboard">1 - Forms with this status will show in eClipboard. Unlike sheets, there is no way to set order.</EnumValue>
        <EnumValue name="Filled">2 - This status gets set from eClipboard after filling.</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="RevID" type="int(11)">
      <summary>Revision ID. Copied from EFormDef. See notes over there.</summary>
    </column>
    <column order="10" name="ShowLabelsBold" type="tinyint(4)">
      <summary>If true, then this form will show labels at 95% and slightly bold. This looks good, but some users might not want it for certain forms, so it's an option. This applies to text, date, radiobuttons, and sigBox. It does not apply to types label, checkbox, or medicationList.</summary>
    </column>
    <column order="11" name="SpaceBelowEachField" type="int(11)">
      <summary>The amount of space below each field. Overrides the global default and can be overridden by field.SpaceBelow. -1 indicates to use default. That way, 0 means 0 space.</summary>
    </column>
    <column order="12" name="SpaceToRightEachField" type="int(11)">
      <summary>The amount of space to the right of each field. Overrides the global default and can be overridden by field.SpaceToRight. -1 indicates to use default. That way, 0 means 0 space.</summary>
    </column>
    <column order="13" name="SaveImageCategory" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. This gets set when an EForm is created from an EFormDef. 0 for none or else it's set to an image category. User can change it. It only saves if user saves manually.</summary>
    </column>
  </table>
  <table name="eformdef">
    <summary>EForms are a way for patients to fill out forms. This is similar to sheets, but optimized for dynamic layout instead of fixed layout. The office sets up templates, EFormDefs, which get copied to EForms. Since this is a template EForm, it does not link to a patient. It can be freely changed without affecting any EForms. We also supply internal EFormDefs, which are hard coded as XML rather than being in any office database.</summary>
    <column order="0" name="EFormDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FormType" type="tinyint(4)">
      <summary>Enum:EnumEFormType 0=PatientForm, 1=MedicalHistory, 2=Consent. This doesn't actually do anything, and all fields are available for all types, but that might eventually change if more types are added.</summary>
      <Enumeration name="EnumEFormType">
        <summary>Different types of EForms that can be used.</summary>
        <EnumValue name="PatientForm">0 - Includes patient information and insurance information.</EnumValue>
        <EnumValue name="MedicalHistory">1 - </EnumValue>
        <EnumValue name="Consent">2 - .</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>The title of the EFormDef. Set by the user.</summary>
    </column>
    <column order="3" name="DateTCreated" type="datetime">
      <summary>The date and time when the EFormDef was created. Not editable by the user in the UI.</summary>
    </column>
    <column order="4" name="IsInternalHidden" type="tinyint(4)">
      <summary>Deprecated.</summary>
    </column>
    <column order="5" name="MaxWidth" type="int(11)">
      <summary>Required. Can be any value between 50 and 1000. On wide screens, this limits the width of the form. This is needed on pretty much anything other than a phone. Makes it look consistent across devices and prevents useless white space. Default 450.</summary>
    </column>
    <column order="6" name="RevID" type="int(11)">
      <summary>Revision ID. Gets updated any time an eForm field is added or deleted from an eFormDef. This includes any time a translation is changed. See eClipboardSheetDef.PrefillStatusOverride for an explanation of how a new RevID can trigger patients needing to fill out a new form. This is also used to pull info from a previous form onto a new form. This can only be done when RevID of both forms is the same, and it's only for non-db fields. 0-based.</summary>
    </column>
    <column order="7" name="ShowLabelsBold" type="tinyint(4)">
      <summary>If true, then this form will show labels at 95% and slightly bold. This looks good, but some users might not want it for certain forms, so it's an option. This applies to text, date, radiobuttons, and sigBox. It does not apply to types label, checkbox, or medicationList.</summary>
    </column>
    <column order="8" name="SpaceBelowEachField" type="int(11)">
      <summary>The amount of space below each field. Overrides the global default and can be overridden by field.SpaceBelow. -1 indicates to use default. That way, 0 means 0 space.</summary>
    </column>
    <column order="9" name="SpaceToRightEachField" type="int(11)">
      <summary>The amount of space to the right of each field. Overrides the global default and can be overridden by field.SpaceToRight. -1 indicates to use default. That way, 0 means 0 space.</summary>
    </column>
    <column order="10" name="SaveImageCategory" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. There is a global setting to save forms to the image category which has ItemVal set to "U". We completely ignore that and it will only work for sheets. If this is 0, it will not save to images. Copied to EForm child.</summary>
    </column>
  </table>
  <table name="eformfield">
    <summary>Individual fields for EForm. Each field generally includes a label and a value. Links to a EForm by FKey to eform.EFormNum.
            NOTE: If any new fields get added to this class and EFormFieldDef, make sure to add them to the methods EFormFields.FromDef and EFormFields.ToDef</summary>
    <column order="0" name="EFormFieldNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EFormNum" type="bigint(20)" fkey="eform">
      <summary>FKey to eform.EFormNum</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fkey="patient">
      <summary>FKey to patient.PatNum to let us quickly grab all for a patient, and then loop later.</summary>
    </column>
    <column order="3" name="FieldType" type="tinyint(4)">
      <summary>Enum:EFormFieldType 0-TextField, 1-Label, 2-DateField, etc.</summary>
      <Enumeration name="EFormFieldType">
        <summary></summary>
      </Enumeration>
    </column>
    <column order="4" name="DbLink" type="varchar(255)">
      <summary>If this field is importable, then this links to a db field. The list of available fields for each type is in EFormFieldsAvailable. Users can pick from that lis which is the same list as in Sheets. In addition to those hardcoded values, this field can also contain custom PatFields. It's string-based instead of enum, just like Sheets, because it's too complex to use an enum, even for our reduced number of items. None is always represented in UI as "None" and in db as empty string. All DbLinks are available on all form types to give users more flexibility. Checkboxes can have DBLinks that look like "allergy:...", "med:...", or "problem:..."</summary>
    </column>
    <column order="5" name="ValueLabel" type="text">
      <summary>Used differently for different types:
            TextField, DateField, CheckBox: The label next to or above the textbox, or checkbox.RadioButtons: This label next to or above the group of radiobuttons. Labels on each radiobutton are in PickListVis.Label: This label is the only thing that shows. A label is always a WPF FlowDocument, which is an XML format. This allows extensive rich text formatting, like bold, color, paragraph formatting, etc. This format can be used directly in OD proper, but it will need to be converted for some other programming languages using external tools. BUT, prior to that, it must be run through a method that adjusts all the font sizes. FlowDocuments only support absolute font sizes instead of relative font sizes. We use 11.5 as the base font size and all other fonts are considered to be relative to this base. So if a font size of 13.8 is present in the FlowDocument, that does not mean to use 13.8; it instead means to use 120%. If your chosen base font size on a mobile device is 16, then the conversion method needs to convert the 13.8 to 19.2 prior to using the FlowDocument.PageBreak: Not used. ""SigBox: Optional label above sig box.MedicationList: This holds an EFormMedListLayout object, serialized as json, including the Title, column headers, column widths, etc.PatientList: This holds an EFormPatListLayout object, serialized as json, including Label.InsPick: This holds the label above the 3 radiobuttons.</summary>
    </column>
    <column order="6" name="ValueString" type="text">
      <summary>The data as entered by patient or pulled from the db. We do not need this in EFormFieldDef because that has no patient or db data. Used differently for different types:
            TextField: value in textBox. For allergiesOther, medsOther, and problemsOther, this is a comma-delimited list. Spaces by commas are ok. Like this: "Aspirin, Iodine, Latex"Label: Not used because no patient input.DateField: date in culture format, like 4/25/2024.Checkbox: "X" or blank "".RadioButton: String value chosen by patient. Pulled from PickListDb, not PickListVis. When importing, empty signifies that patient did not enter any choice, so do not import.ComboBox (not yet added): String value chosen by patient.SigBox: First char is 0 for our sigbox and 1 for Topaz. The remainder is the signature string. See OpenDentBusiness\UI\SignatureBoxWrapper.cs for details. Same format as used for all signatures in OD. Does not get imported.MedicationList: This holds a list of EFormMed objects, serialized as json.PatientList: This holds a PatNum representing the selected patient, if applicable. Example: "143". Can be blank.InsPick: If user picked None, this is empty. If user picked New, the value of this is "New". If user picked Existing, then this is either "InsSubNum:####" or "InsPendingNum:####". A live call to the db using one of those primary keys can derive all the other needed fields for read-only display.</summary>
    </column>
    <column order="7" name="ItemOrder" type="int(11)">
      <summary>0 based.</summary>
    </column>
    <column order="8" name="PickListVis" type="text">
      <summary>Pipe-delimited list of strings, used for radioButtons, InsPick, future comboBoxes, etc. This is the list of items that are visible to the patient. Setup enforces same number of items in PickListDb for 1:1 match. This list allows customization of what the patient sees vs what's in the db. Example: Vis=Hispanic, Db=2135-2. Example: Vis=Do Not Call, Db=DoNotCall. For radiobuttons, the number of items in the lists determines the number of radiobuttons to show to the patient. These editable lists also allow excluding some db options from being visible to patient. Example: Ins Relationship has 9 options, but only 4 of them are really used in dentistry. Just leave the other 5 off and force them to pick one of the 4. But it is also not required for them to pick one. Example: For Marital Status, you might only show Married and Child, excluding Divorced and Single from the pick list. The unselected state then represents no change, so an existing patient could leave both radio buttons unchecked and their status would remain Divorced or Single. However, we currently lack a feature to let them uncheck a radiobutton that is already checked. This is a rare edge case that nearly nobody will care about. You can also have a row with no db value. For example, a visible value of Separated might have no corresponding db value entered. In that case, an import would not cause any change to the existing db value. These lists also allow two radioButtons to represent one db item. Example: Gender Other in db can be expanded to show patient both Nonbinary and Other. When patient picks either of these, it goes into the db as Other. The lists also allow any or all items to be empty with no label. Example: Y/N radiobuttons for a series of allergies. Y/N label at top, but none of the radiobuttons need labels. When translation is added later, it will translate this list, not the PickListDb. PickListVis will, by default, simply be exactly the same as PickListDb. In this state, what the patient sees is the same as what's in the db. Must have at least two items for now.</summary>
    </column>
    <column order="9" name="PickListDb" type="text">
      <summary>Pipe delimited list of strings, used for radioButtons, future comboBoxes, etc. Not used by InsPick. This is the list of items as they would be stored in the database. See PickListVis above for examples of how to use. The value chosen from this list is what will be stored in the ValueString field. Never show this value to the patient.</summary>
    </column>
    <column order="10" name="IsHorizStacking" type="tinyint(4)">
      <summary>Typically false. Set to true to cause this field to get stacked horizontally compared to its previous sibling. Example might be to set State and Zip fields to true. This request will be ignored if screen is too small, like on a phone. The following types are not allowed to stack: SigBox, PageBreak, MedicationList.</summary>
    </column>
    <column order="11" name="IsTextWrap" type="tinyint(4)">
      <summary>Only applies when this is a TextField. Default is false, which creates a single row textbox that scrolls horizontally if text is too long. Set to true to cause text to wrap instead. This will cause the box to grow to fit the text.</summary>
    </column>
    <column order="12" name="Width" type="int(11)">
      <summary>This stores either pixel width or percentage width, depending on IsWidthPercentage. In either case, if this is blank/0, then width will be 100% of what's available. The discussion here is for fixed widths. See IsWidthPercentage for discussion of percentage widths. If fields are stacked horizontally, then they will wrap when they hit screen width. So horizontally stacked fields may end up vertically stacked on a small screen. But if a single field is still set to be wider than the current screen, it will shrink to fit the screen. This width uses WPF DIPs which are 1/96". Android phones define DIPs differently; they use 1/160" per DIP. But if you are using a language like Flutter, they are handling that conversion for you in the background. Regardless, we will be ignoring DIPs and scaling based solely on font size. The reason for this is to make fonts and boxes all look proportionally the same on both OD proper and in eClipboard. So assuming you use 14 flutter logical pixels for 100% font vs 11.5 in WPF, the conversion would look like this: Width/11.5*14. Notice that we are only converting based on font size. This makes our converted width a near perfect fit for the same text as the original. Width is only available on the field types that are h-stackable.</summary>
    </column>
    <column order="13" name="FontScale" type="int(11)">
      <summary>Applies to both the label on the field and the field itself. Never 0. Does not apply to Label types, though, since those are only handled by editing the rich text. Always has a valid value between 50 and 300. Default is 100, indicating normal size. WPF defines a DIP as 1/96". Open Dental uses 11.5 DIPs for nearly all fonts on desktop version. Old Microsoft font sizes were based on 1/72", so 11.5 converts to old 8.6. Android defines a DIP as 1/160". Typical recommended font size on Android seems to be about 16, which translates to 9.6 MS DIPs or 7.2 old Windows font. In other words, recommended phone fonts are physically slightly smaller than desktop fonts. EForms uses font sizes based on 100% being a standard normal size. 100% equates to 11.5 on desktop, probably about 16 on Android phones, and whatever our engineers come up with for tablets. By doing it this way, we do not have to explain anything complicated to users, and they also have very good control over font sizes.</summary>
    </column>
    <column order="14" name="IsRequired" type="tinyint(4)">
      <summary>False by default. If this is set to true, the patient will be required to fill out the field. If conditional logic causes a required field to not show, it will not enforce the requirement. The only checkboxes that allow this field are AllergiesNone and ProblemsNone. For those fields, this makes sure that either an allergy/prob was checked or None was checked.</summary>
    </column>
    <column order="15" name="ConditionalParent" type="varchar(255)">
      <summary>This string is the label of the field that acts as the parent for conditional logic. Empty string by default indicates no parent. Truncated to the first 255 characters. </summary>
    </column>
    <column order="16" name="ConditionalValue" type="text">
      <summary></summary>
    </column>
    <column order="17" name="LabelAlign" type="tinyint(4)">
      <summary>Enum:EnumEFormLabelAlign 0-TopLeft, 1-LeftLeft, 2-Right. Only used in RadioButtons for now.</summary>
      <Enumeration name="EnumEFormLabelAlign">
        <summary>Describes where the label is in relation to the rest of the field.</summary>
        <EnumValue name="TopLeft">0-Default. Above the radiobuttons, aligned left.</EnumValue>
        <EnumValue name="LeftLeft">1-Left of the remainder of the field, and left aligned within that space.</EnumValue>
        <EnumValue name="Right">2-Right of the remainder of the field, and left aligned within that space.</EnumValue>
      </Enumeration>
    </column>
    <column order="18" name="SpaceBelow" type="int(11)">
      <summary>The amount of space below each field. Overrides the form and global defaults. -1 indicates to use default. That way, 0 means 0 space. If multiple fields are stacked horizontally, then only the right-most field can have this field set.</summary>
    </column>
    <column order="19" name="ReportableName" type="varchar(255)">
      <summary>Allows reporting on fields that don't have DbLink.</summary>
    </column>
    <column order="20" name="IsLocked" type="tinyint(4)">
      <summary>If a field is locked, it stops a patient from editing the text when presented to them. Example is a consent form. Only available for TextField and CheckBox. This flag inherits from EFormFieldDef and there's no UI to change it once it's in EFormField. In FrmEFormFillEdit, this field has no effect because offices still need to be able to edit. So the field only has an effect when filling out by a patient on the web or in eClipboard. Patients can still use FrmEFormFillEdit, and in that case, it's assumed that office staff is watching to make sure they don't change the text.</summary>
    </column>
    <column order="21" name="Border" type="tinyint(4)">
      <summary>Enum:EnumEFormBorder 0-none, 1-3D. Shaded borders are optional on each field. They are on by default when most fields are added. But they don't make sense in some cases, like labels and stacks of Y/N radio buttons for allergies. When a border is present, any single row textbox inside it gets shown as a single underline instead of a rectangle. If the textbox has text wrapping turned on, it will always be a rectangle.</summary>
      <Enumeration name="EnumEFormBorder">
        <summary></summary>
        <EnumValue name="None">0-No border</EnumValue>
        <EnumValue name="ThreeD">1-3D border with gradient shadows and rounded corners</EnumValue>
      </Enumeration>
    </column>
    <column order="22" name="IsWidthPercentage" type="tinyint(4)">
      <summary>False=DIPs / pixels at 96 dpi, True=Percentage. There is no mechanisms for "fill remainder" or "auto size to contents". There is no allowed mixing of fixed and percentage on the same row. Wrap won't happen until all columns have hit their MinWidth. If someone specifies percentages that add up to more than 100, that's ok. We will proportionally adapt. So in addition to expected percentages like 30-30-40, the user would get the same behavior by using 150-150-200. Let's use the example of 150-150-200 and assume MinWidths were 110-100-100. If available width was 400, then the widths would be 120-120-160. If available width was 330, then the widths would be 110-94-126, or (minWidth)-3/7-4/7. Below 310, they would start wrapping. If percentages add up to less than 100, then they might stop short of 100%. For example, 25-25-25 would come up short. They would continue to occupy 75% of available space until the space got so small that they started to hit their MinWidths. Let's assume MinWidths in that example were 50-100-100. If available width was 600, then the widths would be 150-150-150 (still 75%). If available width was 300, then the widths would be 75-100-100 (only 92%). Below 250, they would start wrapping.</summary>
    </column>
    <column order="23" name="MinWidth" type="int(11)">
      <summary>Only used with IsWidthPercentage.  If left blank/0, then no minimum width. A number might be present here but will be ignored if IsWidthPercentage is false.</summary>
    </column>
    <column order="24" name="WidthLabel" type="int(11)">
      <summary>If the label is to the left of the field, this is the width of that label. Only used for RadioButtons right now because that's the only type that allows labels to the left. In RadioButtons, this is helpful to allow a stack of radioButtons to line up. Default is 0 to indicate automatic.</summary>
    </column>
    <column order="25" name="SpaceToRight" type="int(11)">
      <summary>The amount of space to the right of each field. Overrides the form and global defaults. -1 indicates to use default. That way, 0 means 0 space. Not used for SigBox or MedicationList which use form level instead.</summary>
    </column>
    <column order="26" name="AutoImport" type="tinyint(4)">
      <summary>The moment the patient completes the form, this field will import to the database. The field should also be required if they want to prevent clearing it out. For example, even a field like last name needs to be able to change if patient got married or divorced, if office misspelled it, if child's last name is different, etc. Patient knows best. Also works great for address. This is important for multiple forms in a family to prevent duplicate entry of address, etc. Implemented for the following DbLinks: "addressSameEntireFamily", "Address", "Address2", "allergy:", "allergiesNone", "allergiesOther", "Birthdate", "City", "Email", "FName", "Gender", "HmPhone", "ICEName", "ICEPhone", "ins1PlanFromList", "ins2PlanFromList", "LName", "MiddleI", "Position", "PreferConfirmMethod", "PreferContactMethod", "PreferRecallMethod", "Preferred", "problem:", "problemsNone", "problemsOther", "referredFrom", "SSN", "State", "StudentStatus", "WirelessPhone", "wirelessPhoneSameEntireFamily", "WkPhone", "Zip".</summary>
    </column>
    <column order="27" name="PrefillFromGuar" type="tinyint(4)">
      <summary>If db value is empty for the patient, then prefill from guarantor. Used for addresses to avoid double entry for children. Implemented for the following DbLinks: "Address", "Address2", "City", "State", "Zip", "WirelessPhone".</summary>
    </column>
    <column order="28" name="ValueLabelEnglish" type="text">
      <summary>This is not needed for translation, but for conditional logic to identify this field in spite of language translations.</summary>
    </column>
    <column order="29" name="PickListVisEnglish" type="text">
      <summary>Pipe-delimited list of English strings, used for radioButtons, InsPick, etc. When the eForm is first created or defined in English, this will match PickListVis. After translation, PickListVis contains translated strings, while PickListVisEnglish remains in English for conditional logic comparisons (child field ConditionalValue vs. parent field selected option) and conditional value pick lists.</summary>
    </column>
  </table>
  <table name="eformfielddef">
    <summary>Individual fields for the EForm. Each field generally includes a label and a value. Links to a EFormDef by FKey to eformdef.EFormDefNum.
            NOTE: If any new fields get added to this class and EFormField, make sure to add them to the methods EFormFields.FromDef and EFormFields.ToDef</summary>
    <column order="0" name="EFormFieldDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EFormDefNum" type="bigint(20)" fkey="eformdef">
      <summary>FKey to eformdef.EFormDefNum</summary>
    </column>
    <column order="2" name="FieldType" type="tinyint(4)">
      <summary>Enum:EnumEFormFieldType 0-TextField, 1-Label, 2-CheckBox, etc.</summary>
      <Enumeration name="EnumEFormFieldType">
        <summary></summary>
        <EnumValue name="TextField">0-A textbox that the user can type into. Frequently tied to a database field. Can frequently be prefilled from database if desired. In Sheets, this was two different field types: InputField and OutputField.</EnumValue>
        <EnumValue name="Label">1-This can be used for a label, heading, title, paragraph, etc. These also support the exact same replacement fields as in sheets StaticText. See the extensive comments on the ValueLabel field.</EnumValue>
        <EnumValue name="DateField">2-Some sort of textbox that's optimized for date input.</EnumValue>
        <EnumValue name="CheckBox">3-Simple checkbox that can be tied to a db field.</EnumValue>
        <EnumValue name="RadioButtons">4-Not a single radiobutton, but a group of them.</EnumValue>
        <EnumValue name="SigBox">5-A signature box, directly on the screen with stylus/mouse. Just the drawing, no encryption to tie it to the data yet.</EnumValue>
        <EnumValue name="PageBreak">6-.</EnumValue>
        <EnumValue name="MedicationList">7-A Medication List is a complex field. It consists of a list of medications with an optional second column for strength and frequency. Each medication has a Delete button to its right. There is also an Add button and a None checkbox at the bottom. The None checkbox only shows when the list is empty and allows satisfying a 'required' flag. There is no way to indicate 'no changes', but the office is free to add a separate No Changes checkbox below this list which doesn't actually do anything but which can serve as a visual indicator.</EnumValue>
        <EnumValue name="PatientList">8-This is a complex field that includes a popup window. On the form, it shows as a read-only textbox with a button beside it that says 'Pick'. The popup window has a list of patients that are pulled from the live office db in real time. In that window, there's also an Add button which actually adds a new patient to the office database. For now, there's no mechanism to edit existing patients in that list. There's also a second popup window to enter the name and BD of a new patient. The only use so far is to pick insurance plan subscriber, but more uses are planned such as guarantor, guardian, adding children to family, etc.</EnumValue>
        <EnumValue name="InsPick">9-Shows as 3 radio buttons: None, New, and Existing. Selecting Existing makes a popup window show to allow selecting an existing insurance in the family.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="DbLink" type="varchar(255)">
      <summary>If this field is importable, then this links to a db field. The list of available fields for each type is in EFormFieldsAvailable. Users can pick from that lis which is the same list as in Sheets. In addition to those hardcoded values, this field can also contain custom PatFields. It's string-based instead of enum, just like Sheets, because it's too complex to use an enum, even for our reduced number of items. None is always represented in UI as "None" and in db as empty string. All DbLinks are available on all form types to give users more flexibility. Checkboxes can have DBLinks that look like "allergy:...", "med:...", or "problem:..."</summary>
    </column>
    <column order="4" name="ValueLabel" type="text">
      <summary>Used differently for different types:
            TextField, DateField, CheckBox: The label next to or above the textbox, or checkbox.RadioButtons: The label above the group of radiobuttons. Labels on each radiobutton are in PickListVis.Label: This label is the only thing that shows. A label is always a WPF FlowDocument, which is an XML format. This allows extensive rich text formatting, like bold, color, paragraph formatting, etc. This format can be used directly in OD proper, but it will need to be converted for some other programming languages using external tools. BUT, prior to that, it must be run through a method that adjusts all the font sizes. FlowDocuments only support absolute font sizes instead of relative font sizes. We use 11.5 as the base font size and all other fonts are considered to be relative to this base. So if a font size of 13.8 is present in the FlowDocument, that does not mean to use 13.8; it instead means to use 120%. If your chosen base font size on a mobile device is 16, then the conversion method needs to convert the 13.8 to 19.2 prior to using the FlowDocument.PageBreak: Not used.SigBox: Optional label above sig box.MedicationList: This holds an EFormMedListLayout object, serialized as json, including the Title, column headers, column widths, etc.PatientList: This holds an EFormPatListLayout object, serialized as json, including Label.InsPick: This holds the label above the 3 radiobuttons.</summary>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary>0 based.</summary>
    </column>
    <column order="6" name="PickListVis" type="text">
      <summary>Pipe-delimited list of strings, used for radioButtons, InsPick, future comboBoxes, etc. This is the list of items that are visible to the patient. Setup enforces same number of items in PickListDb for 1:1 match. This list allows customization of what the patient sees vs what's in the db. Example: Vis=Hispanic, Db=2135-2. Example: Vis=Do Not Call, Db=DoNotCall. For radiobuttons, the number of items in the lists determines the number of radiobuttons to show to the patient. These editable lists also allow excluding some db options from being visible to patient. Example: Ins Relationship has 9 options, but only 4 of them are really used in dentistry. Just leave the other 5 off and force them to pick one of the 4. But it is also not required for them to pick one. Example: For Marital Status, you might only show Married and Child, excluding Divorced and Single from the pick list. The unselected state then represents no change, so an existing patient could leave both radio buttons unchecked and their status would remain Divorced or Single. However, we currently lack a feature to let them uncheck a radiobutton that is already checked. This is a rare edge case that nearly nobody will care about. You can also have a row with no db value. For example, a visible value of Separated might have no corresponding db value entered. In that case, an import would not cause any change to the existing db value. These lists also allow two radioButtons to represent one db item. Example: Gender Other in db can be expanded to show patient both Nonbinary and Other. When patient picks either of these, it goes into the db as Other. The lists also allow any or all items to be empty with no label. Example: Y/N radiobuttons for a series of allergies. Y/N label at top, but none of the radiobuttons need labels. When translation is added later, it will translate this list, not the PickListDb. PickListVis will, by default, simply be exactly the same as PickListDb. In this state, what the patient sees is the same as what's in the db. Must have at least two items for now. </summary>
    </column>
    <column order="7" name="PickListDb" type="text">
      <summary>Pipe delimited list of strings, used for radioButtons, future comboBoxes, etc. Not used by InsPick. This is the list of items as they would be stored in the database. See PickListVis above for examples of how to use. The value chosen from this list is what will be stored in the ValueString field. Never show this value to the patient.</summary>
    </column>
    <column order="8" name="IsHorizStacking" type="tinyint(4)">
      <summary>Typically false. Set to true to cause this field to get stacked horizontally compared to its previous sibling. Example might be to set State and Zip fields to true. This request will be ignored if screen is too small, like on a phone. We don't allow this option for RadioButtons because they already stack horizontally, and that would be confusing. The following types are not allowed to stack: SigBox, PageBreak, MedicationList.</summary>
    </column>
    <column order="9" name="IsTextWrap" type="tinyint(4)">
      <summary>Only applies when this is a TextField. Default is false, which creates a single row textbox that scrolls horizontally if text is too long. Set to true to cause text to wrap instead. This will cause the box to grow to fit the text.</summary>
    </column>
    <column order="10" name="Width" type="int(11)">
      <summary>This stores either pixel width or percentage width, depending on IsWidthPercentage. In either case, if this is blank/0, then width will be 100% of what's available. The discussion here is for fixed widths. See IsWidthPercentage for discussion of percentage widths. If fields are stacked horizontally, then they will wrap when they hit screen width. So horizontally stacked fields may end up vertically stacked on a small screen. But if a single field is still set to be wider than the current screen, it will shrink to fit the screen. This width uses WPF DIPs which are 1/96". Android phones define DIPs differently; they use 1/160" per DIP. But if you are using a language like Flutter, they are handling that conversion for you in the background. Regardless, we will be ignoring DIPs and scaling based solely on font size. The reason for this is to make fonts and boxes all look proportionally the same on both OD proper and in eClipboard. So assuming you use 14 flutter logical pixels for 100% font vs 11.5 in WPF, the conversion would look like this: Width/11.5*14. Notice that we are only converting based on font size. This makes our converted width a near perfect fit for the same text as the original. Width is only available on the field types that are h-stackable.</summary>
    </column>
    <column order="11" name="FontScale" type="int(11)">
      <summary>Applies to both the label on the field and the field itself. Never 0. Does not apply to Label types, though, since those are only handled by editing the rich text. Always has a valid value between 50 and 300. Default is 100, indicating normal size. WPF defines a DIP as 1/96". Open Dental uses 11.5 DIPs for nearly all fonts on desktop version. Old Microsoft font sizes were based on 1/72", so 11.5 converts to old 8.6. Android defines a DIP as 1/160". Typical recommended font size on Android seems to be about 16, which translates to 9.6 MS DIPs or 7.2 old Windows font. In other words, recommended phone fonts are physically slightly smaller than desktop fonts. EForms uses font sizes based on 100% being a standard normal size. 100% equates to 11.5 on desktop, probably about 16 on Android phones, and whatever our engineers come up with for tablets. By doing it this way, we do not have to explain anything complicated to users, and they also have very good control over font sizes.</summary>
    </column>
    <column order="12" name="IsRequired" type="tinyint(4)">
      <summary>False by default. If this is set to true, the patient will be required to fill out the field. If conditional logic causes a required field to not show, it will not enforce the requirement. The only checkboxes that allow this field are AllergiesNone and ProblemsNone. For those fields, this makes sure that either an allergy/prob was checked or None was checked.</summary>
    </column>
    <column order="13" name="ConditionalParent" type="varchar(255)">
      <summary>This string is the label of the field that acts as the parent for conditional logic. Empty string by default indicates no parent. Truncated to the first 255 characters. </summary>
    </column>
    <column order="14" name="ConditionalValue" type="text">
      <summary></summary>
    </column>
    <column order="15" name="LabelAlign" type="tinyint(4)">
      <summary>Enum:EnumEFormLabelAlign 0-TopLeft, 1-LeftLeft, 2-Right. Only used in RadioButtons for now.</summary>
      <Enumeration name="EnumEFormLabelAlign">
        <summary>Describes where the label is in relation to the rest of the field.</summary>
        <EnumValue name="TopLeft">0-Default. Above the radiobuttons, aligned left.</EnumValue>
        <EnumValue name="LeftLeft">1-Left of the remainder of the field, and left aligned within that space.</EnumValue>
        <EnumValue name="Right">2-Right of the remainder of the field, and left aligned within that space.</EnumValue>
      </Enumeration>
    </column>
    <column order="16" name="SpaceBelow" type="int(11)">
      <summary>The amount of space below each field. Overrides the form and global default. -1 indicates to use default. That way, 0 means 0 space. If multiple fields are stacked horizontally, then only the right-most field can have this field set.</summary>
    </column>
    <column order="17" name="ReportableName" type="varchar(255)">
      <summary>Allows reporting on fields that don't have DbLink.</summary>
    </column>
    <column order="18" name="IsLocked" type="tinyint(4)">
      <summary>If a field is locked, it stops a patient from editing the text when presented to them. Example is a consent form. Only available for TextField and CheckBox. This flag is set here in the EFormFieldDef and then EFormField inherits it with no UI to change it later. See additional notes in EFormField.</summary>
    </column>
    <column order="19" name="Border" type="tinyint(4)">
      <summary>Enum:EnumEFormBorder 0-none, 1-3D. Shaded borders are optional on each field. They are on by default when most fields are added. But they don't make sense in some cases, like labels and stacks of Y/N radio buttons for allergies. When a border is present, any single row textbox inside it gets shown as a single underline instead of a rectangle. If the textbox has text wrapping turned on, it will always be a rectangle.</summary>
      <Enumeration name="EnumEFormBorder">
        <summary></summary>
        <EnumValue name="None">0-No border</EnumValue>
        <EnumValue name="ThreeD">1-3D border with gradient shadows and rounded corners</EnumValue>
      </Enumeration>
    </column>
    <column order="20" name="IsWidthPercentage" type="tinyint(4)">
      <summary>False=DIPs / pixels at 96 dpi, True=Percentage. There is no mechanisms for "fill remainder" or "auto size to contents". There is no allowed mixing of fixed and percentage on the same row. Wrap won't happen until all columns have hit their MinWidth. If someone specifies percentages that add up to more than 100, that's ok. We will proportionally adapt. So in addition to expected percentages like 30-30-40, the user would get the same behavior by using 150-150-200. Let's use the example of 150-150-200 and assume MinWidths were 110-100-100. If available width was 400, then the widths would be 120-120-160. If available width was 330, then the widths would be 110-94-126, or (minWidth)-3/7-4/7. Below 310, they would start wrapping. If percentages add up to less than 100, then they might stop short of 100%. For example, 25-25-25 would come up short. They would continue to occupy 75% of available space until the space got so small that they started to hit their MinWidths. Let's assume MinWidths in that example were 50-100-100. If available width was 600, then the widths would be 150-150-150 (still 75%). If available width was 300, then the widths would be 75-100-100 (only 92%). Below 250, they would start wrapping.</summary>
    </column>
    <column order="21" name="MinWidth" type="int(11)">
      <summary>Only used with IsWidthPercentage.  If left blank/0, then no minimum width. A number might be present here but will be ignored if IsWidthPercentage is false.</summary>
    </column>
    <column order="22" name="WidthLabel" type="int(11)">
      <summary>If the label is to the left of the field, this is the width of that label. Only used for RadioButtons right now because that's the only type that allows labels to the left. In RadioButtons, this is helpful to allow a stack of radioButtons to line up. Default is 0 to indicate automatic.</summary>
    </column>
    <column order="23" name="SpaceToRight" type="int(11)">
      <summary>The amount of space to the right of each field. Overrides the form and global defaults. -1 indicates to use default. That way, 0 means 0 space. Not used for SigBox or MedicationList which use form level instead.</summary>
    </column>
    <column order="24" name="AutoImport" type="tinyint(4)">
      <summary>The moment the patient completes the form, this field will import to the database. The field should also be required if they want to prevent clearing it out. For example, even a field like last name needs to be able to change if patient got married or divorced, if office misspelled it, if child's last name is different, etc. Patient knows best. Also works great for address. This is important for multiple forms in a family to prevent duplicate entry of address, etc. Implemented for the following DbLinks: "addressSameEntireFamily", "Address", "Address2", "allergy:", "allergiesNone", "allergiesOther", "Birthdate", "City", "Email", "FName", "Gender", "HmPhone", "ICEName", "ICEPhone", "ins1PlanFromList", "ins2PlanFromList", "LName", "MiddleI", "Position", "PreferConfirmMethod", "PreferContactMethod", "PreferRecallMethod", "Preferred", "problem:", "problemsNone", "problemsOther", "referredFrom", "SSN", "State", "StudentStatus", "WirelessPhone", "wirelessPhoneSameEntireFamily", "WkPhone", "Zip".</summary>
    </column>
    <column order="25" name="PrefillFromGuar" type="tinyint(4)">
      <summary>If db value is empty for the patient, then prefill from guarantor. Used for addresses to avoid double entry for children. Implemented for the following DbLinks: "Address", "Address2", "City", "State", "Zip", "WirelessPhone".</summary>
    </column>
  </table>
  <table name="eformimportrule">
    <summary>This table is present, but it does absolutely nothing because we never finished implementing it. In the future: Each row is a rule that controls how form import logic works. It currently also applies to sheets. Clearly, if there's no row for a specific field, then a global rule handles it. Since there are 4 different situations, we might need 4 global rules just to start. But since users might forget to add them, if any of the 4 is missing, then that situation behaves the old way: action is Review.</summary>
    <column order="0" name="EFormImportRuleNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FieldName" type="varchar(255)">
      <summary>If empty, this is a global rule. if the field name matches a DbLink value, then this applies to the Db field. Otherwise, it must be a Non-db field. It will first try to match a reportable name and then a label.</summary>
    </column>
    <column order="2" name="Situation" type="tinyint(4)">
      <summary>Enum:EnumEFormImportSituation </summary>
      <Enumeration name="EnumEFormImportSituation">
        <summary></summary>
        <EnumValue name="New">0-Original blank and entered new value</EnumValue>
        <EnumValue name="Changed">1-</EnumValue>
        <EnumValue name="Deleted">2-</EnumValue>
        <EnumValue name="Invalid">3-Setup UI explains the fields that this can apply to.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="Action" type="tinyint(4)">
      <summary>Enum:EnumEFormImportAction </summary>
      <Enumeration name="EnumEFormImportAction">
        <summary></summary>
        <EnumValue name="Overwrite">0-</EnumValue>
        <EnumValue name="Review">1-</EnumValue>
        <EnumValue name="Ignore">2-</EnumValue>
        <EnumValue name="Fix">3-Setup UI explains the fixes that can be made.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="ehramendment">
    <summary>Used in EHR only.  Stores an entry indicating whether the office has accepted or denied the amendment.  Amendments can be verbal or written requests to add information to the patient's record.  The provider can either scan / import the document or create a detailed description that indicates what was verbally requested or where the document can be found.</summary>
    <column order="0" name="EhrAmendmentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="IsAccepted" type="tinyint(4)">
      <summary>Enum:YN Y=accepted, N=denied, U=requested.</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="Description" type="text">
      <summary>Description or user-defined location of the amendment.</summary>
    </column>
    <column order="4" name="Source" type="tinyint(4)">
      <summary>Enum:AmendmentSource Patient, Provider, Organization, Other.  Required.</summary>
      <Enumeration name="AmendmentSource">
        <summary>Source Enumeration</summary>
        <EnumValue name="Patient">0</EnumValue>
        <EnumValue name="Provider">1</EnumValue>
        <EnumValue name="Organization">2</EnumValue>
        <EnumValue name="Other">3</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="SourceName" type="text">
      <summary>User-defined name of the amendment source.  For example, a patient name or organization name.</summary>
    </column>
    <column order="6" name="FileName" type="varchar(255)">
      <summary>The file is stored in the A-Z folder in 'EhrAmendments' folder.  This field stores the name of the file.  The files are named automatically based on Date/time along with EhrAmendmentNum for uniqueness.  This meets the requirement of "appending" to the patient's record.</summary>
    </column>
    <column order="7" name="RawBase64" type="longtext">
      <summary>The raw file data encoded as base64.  Only used if there is no AtoZ folder.  This meets the requirement of "appending" to the patient's record.</summary>
    </column>
    <column order="8" name="DateTRequest" type="datetime">
      <summary>Date and time of the amendment request.</summary>
    </column>
    <column order="9" name="DateTAcceptDeny" type="datetime">
      <summary>Date and time of the amendment acceptance or denial.  If there is a date here, then the IsAccepted will be set.</summary>
    </column>
    <column order="10" name="DateTAppend" type="datetime">
      <summary>Date and time of the file being appended to the amendment or a link provided.</summary>
    </column>
  </table>
  <table name="ehraptobs">
    <summary>An EHR appointment observation.  Needed for syndromic surveillance messaging.  Each syndromic message requires at least one observation.</summary>
    <column order="0" name="EhrAptObsNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum.  There can be an unlimited number of observations per appointment.</summary>
    </column>
    <column order="2" name="IdentifyingCode" type="tinyint(4)">
      <summary>Enum:EhrAptObsIdentifier - Used in HL7 OBX-3 for syndromic surveillance.</summary>
      <Enumeration name="EhrAptObsIdentifier">
        <summary></summary>
        <EnumValue name="BodyTemp">0 - Body temperature:Temp:Enctrfrst:Patient:Qn:	Loinc code 11289-6.</EnumValue>
        <EnumValue name="DateIllnessOrInjury">1 - Illness or injury onset date and time:TmStp:Pt:Patient:Qn:	Loinc code 11368-8.</EnumValue>
        <EnumValue name="PatientAge">2 - Age Time Patient Reported	Loinc code 21612-7.</EnumValue>
        <EnumValue name="PrelimDiag">3 - Diagnosis.preliminary:Imp:Pt:Patient:Nom:	Loinc code 44833-2.</EnumValue>
        <EnumValue name="TriageNote">4 - Triage note:Find:Pt:Emergency department:Doc:	Loinc code 54094-8.</EnumValue>
        <EnumValue name="OxygenSaturation">5 - Oxygen saturation:MFr:Pt:BldA:Qn:Pulse oximetry	Loinc code 59408-5.</EnumValue>
        <EnumValue name="CheifComplaint">6 - Chief complaint:Find:Pt:Patient:Nom:Reported	Loinc code 8661-1.</EnumValue>
        <EnumValue name="TreatFacilityID">7 - Treating Facility Identifier	PHINQUESTION code SS001.</EnumValue>
        <EnumValue name="TreatFacilityLocation">8 - Treating Facility Location	PHINQUESTION code SS002.</EnumValue>
        <EnumValue name="VisitType">9 - Facility / Visit Type	PHINQUESTION code SS003.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="ValType" type="tinyint(4)">
      <summary>Enum:EhrAptObsType .  Used in HL7 OBX-2 for syndromic surveillance.  Identifies the data type for the observation value in ValReported.</summary>
      <Enumeration name="EhrAptObsType">
        <summary></summary>
        <EnumValue name="Address">0 - This should only be used with EhrAptObsIdentifier.TreatFacilityLocation.</EnumValue>
        <EnumValue name="Coded">1</EnumValue>
        <EnumValue name="DateAndTime">2</EnumValue>
        <EnumValue name="Numeric">3</EnumValue>
        <EnumValue name="Text">4</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ValReported" type="varchar(255)">
      <summary>The value of the observation. The value format must match the ValType.  This field could be text, a datetime, a code, etc..  Used in HL7 OBX-5 for syndromic surveillance.</summary>
    </column>
    <column order="5" name="UcumCode" type="varchar(255)">
      <summary>Used in HL7 OBX-6 for syndromic surveillance when ValType is Numeric (otherwise left blank).</summary>
    </column>
    <column order="6" name="ValCodeSystem" type="varchar(255)">
      <summary>When ValType is Coded, then this contains the code system corresponding to the code in ValReported.  When ValType is not Coded, then this field should be blank.
            Allowed values are LOINC,SNOMEDCT,ICD9,ICD10.</summary>
    </column>
  </table>
  <table name="ehrcareplan">
    <summary></summary>
    <column order="0" name="EhrCarePlanNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. </summary>
    </column>
    <column order="2" name="SnomedEducation" type="varchar(255)">
      <summary>Snomed code describing the type of educational instruction provided.  Limited to terms descending from the Snomed 409073007 (Education Hierarchy).</summary>
    </column>
    <column order="3" name="Instructions" type="varchar(255)">
      <summary>Instructions provided to the patient.</summary>
    </column>
    <column order="4" name="DatePlanned" type="date">
      <summary>This field does not help much with care plan instructions, but will be more helpful for other types of care plans if we expand in the future (for example, planned procedures).  We also saw examples where this date was included in the human readable part of a CCD, but not in the machine readable part.</summary>
    </column>
  </table>
  <table name="ehrlab">
    <summary>For EHR module, lab request that contains all required fields for HL7 Lab Reporting Interface (LRI).</summary>
    <column order="0" name="EhrLabNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  PID-3.1</summary>
    </column>
    <column order="2" name="OrderControlCode" type="varchar(255)">
      <summary>Always RE unless importing from outside sources.</summary>
    </column>
    <column order="3" name="PlacerOrderNum" type="varchar(255)">
      <summary>Placer order number assigned to this lab order, usually assigned by the dental office.  Not the same as EhrLabNum, but similar.  OBR.2.1 and ORC.2.1.</summary>
    </column>
    <column order="4" name="PlacerOrderNamespace" type="varchar(255)">
      <summary>Usually empty, only used if PlacerOrderNum+PlacerUniversalID cannot uniquely identify the lab order.  OBR.2.2 and ORC.2.2.</summary>
    </column>
    <column order="5" name="PlacerOrderUniversalID" type="varchar(255)">
      <summary>Usually OID root that uniquely identifies the context that makes PlacerOrderNum globally unique.  May be GUID if importing from other sources.   OBR.2.3 and ORC.2.3.</summary>
    </column>
    <column order="6" name="PlacerOrderUniversalIDType" type="varchar(255)">
      <summary>Always "ISO", unless importing from other sources.  OBR.2.4 and ORC.2.4</summary>
    </column>
    <column order="7" name="FillerOrderNum" type="varchar(255)">
      <summary>Filler order number assigned to this lab order, usually assigned by the laboratory.  Not the same as EhrLabNum, but similar.  OBR.3.1 and ORC.3.1.</summary>
    </column>
    <column order="8" name="FillerOrderNamespace" type="varchar(255)">
      <summary>Usually empty, only used if FillerOrderNum+FillerUniversalID cannot uniquely identify the lab order.  OBR.3.2 and ORC.3.2.</summary>
    </column>
    <column order="9" name="FillerOrderUniversalID" type="varchar(255)">
      <summary>Usually OID root that uniquely identifies the context that makes FillerOrderNum globally unique.  May be GUID if importing from other sources.  OBR.3.2 and ORC.3.3.</summary>
    </column>
    <column order="10" name="FillerOrderUniversalIDType" type="varchar(255)">
      <summary>Always "ISO", unless importing from other sources.  OBR.3.4 and ORC.3.4</summary>
    </column>
    <column order="11" name="PlacerGroupNum" type="varchar(255)">
      <summary>[0..1] May be empty.  Placer group number assigned to this lab order, usually assigned by the dental office.  ORC.4.1.</summary>
    </column>
    <column order="12" name="PlacerGroupNamespace" type="varchar(255)">
      <summary>[0..1] Usually empty, only used if PlacerGroupNum+PlacerUniversalID cannot uniquely identify the Group Num.  ORC.4.2.</summary>
    </column>
    <column order="13" name="PlacerGroupUniversalID" type="varchar(255)">
      <summary>[0..1] Usually OID root that uniquely identifies the context that makes PlacerGroupNum globally unique.  May be GUID if importing from other sources.   ORC.4.3.</summary>
    </column>
    <column order="14" name="PlacerGroupUniversalIDType" type="varchar(255)">
      <summary>[0..1] Always "ISO", unless importing from other sources.  ORC.4.4</summary>
    </column>
    <column order="15" name="OrderingProviderID" type="varchar(255)">
      <summary>May be provnum or NPI num or any other num, when combined with OrderingProviderIdAssigningAuthority should uniquely identify the provider.  ORC.12.1</summary>
    </column>
    <column order="16" name="OrderingProviderLName" type="varchar(255)">
      <summary>ORC.12.2</summary>
    </column>
    <column order="17" name="OrderingProviderFName" type="varchar(255)">
      <summary>ORC.12.3</summary>
    </column>
    <column order="18" name="OrderingProviderMiddleNames" type="varchar(255)">
      <summary>Middle names or initials therof.  ORC.12.4</summary>
    </column>
    <column order="19" name="OrderingProviderSuffix" type="varchar(255)">
      <summary>Example: JR or III.  ORC.12.5</summary>
    </column>
    <column order="20" name="OrderingProviderPrefix" type="varchar(255)">
      <summary>Example: DR, Not MD, MD would be stored in an optional field that was not implemented called OrderingProviderDegree.  ORC.12.6</summary>
    </column>
    <column order="21" name="OrderingProviderAssigningAuthorityNamespaceID" type="varchar(255)">
      <summary>Usually empty, "The value of [this field] reflects a local code that represents the combination of [the next two fields]."  ORC.12.9.1</summary>
    </column>
    <column order="22" name="OrderingProviderAssigningAuthorityUniversalID" type="varchar(255)">
      <summary>ISO compliant OID that represents the organization that assigned the unique provider ID.  ORC.12.9.2</summary>
    </column>
    <column order="23" name="OrderingProviderAssigningAuthorityIDType" type="varchar(255)">
      <summary>Always "ISO", unless importing from outside source.  ORC.12.9.3</summary>
    </column>
    <column order="24" name="OrderingProviderNameTypeCode" type="varchar(255)">
      <summary>Describes the type of name used.  ORC.12.10</summary>
    </column>
    <column order="25" name="OrderingProviderIdentifierTypeCode" type="varchar(255)">
      <summary>Must be value from HL70203 code set, see note at bottom of EhrLab.cs for usage.  ORC.12.13</summary>
    </column>
    <column order="26" name="SetIdOBR" type="bigint(20)">
      <summary>Enumerates the OBR segments within a single message starting with 1.  OBR.1</summary>
    </column>
    <column order="27" name="UsiID" type="varchar(255)">
      <summary>OBR.4.1</summary>
    </column>
    <column order="28" name="UsiText" type="varchar(255)">
      <summary>Description of UsiId.  OBR.4.2</summary>
    </column>
    <column order="29" name="UsiCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that UsiId came from.  OBR.4.3</summary>
    </column>
    <column order="30" name="UsiIDAlt" type="varchar(255)">
      <summary>OBR.4.4</summary>
    </column>
    <column order="31" name="UsiTextAlt" type="varchar(255)">
      <summary>Description of UsiIdAlt.  OBR.4.5</summary>
    </column>
    <column order="32" name="UsiCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that UsiId came from.  OBR.4.6</summary>
    </column>
    <column order="33" name="UsiTextOriginal" type="varchar(255)">
      <summary>Optional text that describes the original text used to encode the values above.  OBR.4.9</summary>
    </column>
    <column order="34" name="ObservationDateTimeStart" type="varchar(255)">
      <summary>Stored as string in the format YYYY[MM[DD[HH[MM[SS]]]]] where bracketed values are optional.  When time is not known will be valued "0000".  OBR.7.1</summary>
    </column>
    <column order="35" name="ObservationDateTimeEnd" type="varchar(255)">
      <summary>May be empty.  Stored as string in the format YYYY[MM[DD[HH[MM[SS]]]]] where bracketed values are optional.  OBR.8.1</summary>
    </column>
    <column order="36" name="SpecimenActionCode" type="varchar(255)">
      <summary>OBR.11</summary>
    </column>
    <column order="37" name="ResultDateTime" type="varchar(255)">
      <summary>Date Time that the result was stored or last updated.  Stored in the format YYYYMMDDHHmmss.  Required to be accurate to the second.  OBR.22.1</summary>
    </column>
    <column order="38" name="ResultStatus" type="varchar(255)">
      <summary>OBR.25</summary>
    </column>
    <column order="39" name="ParentObservationID" type="varchar(255)">
      <summary>OBR.26.1.1</summary>
    </column>
    <column order="40" name="ParentObservationText" type="varchar(255)">
      <summary>Description of ParentObservationId.  OBR.26.1.2</summary>
    </column>
    <column order="41" name="ParentObservationCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that ParentObservationId came from.  OBR.26.1.3</summary>
    </column>
    <column order="42" name="ParentObservationIDAlt" type="varchar(255)">
      <summary>OBR.26.1.4</summary>
    </column>
    <column order="43" name="ParentObservationTextAlt" type="varchar(255)">
      <summary>Description of ParentObservationIdAlt.  OBR.26.1.5</summary>
    </column>
    <column order="44" name="ParentObservationCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that ParentObservationIdAlt came from.  OBR.26.1.6</summary>
    </column>
    <column order="45" name="ParentObservationTextOriginal" type="varchar(255)">
      <summary>Optional text that describes the original text used to encode the values above.  OBR.26.1.9</summary>
    </column>
    <column order="46" name="ParentObservationSubID" type="varchar(255)">
      <summary>OBR.26.2</summary>
    </column>
    <column order="47" name="ParentPlacerOrderNum" type="varchar(255)">
      <summary>Placer order number assigned to this lab order, usually assigned by the dental office.  Not the same as EhrLabNum, but similar.  OBR.29.1.1.</summary>
    </column>
    <column order="48" name="ParentPlacerOrderNamespace" type="varchar(255)">
      <summary>Usually empty, only used if PlacerOrderNum+PlacerUniversalID cannot uniquely identify the lab order.  OBR.29.1.2</summary>
    </column>
    <column order="49" name="ParentPlacerOrderUniversalID" type="varchar(255)">
      <summary>Usually OID root that uniquely identifies the context that makes PlacerOrderNum globally unique.  May be GUID if importing from other sources.   OBR.29.1.3</summary>
    </column>
    <column order="50" name="ParentPlacerOrderUniversalIDType" type="varchar(255)">
      <summary>Always "ISO", unless importing from other sources.  OBR.29.1.4</summary>
    </column>
    <column order="51" name="ParentFillerOrderNum" type="varchar(255)">
      <summary>Filler order number assigned to this lab order, usually assigned by the laboratory.  Not the same as EhrLabNum, but similar.  OBR.29.2.1</summary>
    </column>
    <column order="52" name="ParentFillerOrderNamespace" type="varchar(255)">
      <summary>Usually empty, only used if FillerOrderNum+FillerUniversalID cannot uniquely identify the lab order.  OBR.29.2.2</summary>
    </column>
    <column order="53" name="ParentFillerOrderUniversalID" type="varchar(255)">
      <summary>Usually OID root that uniquely identifies the context that makes FillerOrderNum globally unique.  May be GUID if importing from other sources.  OBR.29.2.3</summary>
    </column>
    <column order="54" name="ParentFillerOrderUniversalIDType" type="varchar(255)">
      <summary>Always "ISO", unless importing from other sources.  OBR.29.2.4</summary>
    </column>
    <column order="55" name="ListEhrLabResultsHandlingF" type="tinyint(4)">
      <summary>"Film with patient."  Technically a coded value from HL70507.  Stored as a bool instead of 7 seperate columns. OBR.49.* is used to set both ListEhrLabResultsHandlingF and ListEhrLabResultsHandlingN.  OBR.49.*</summary>
    </column>
    <column order="56" name="ListEhrLabResultsHandlingN" type="tinyint(4)">
      <summary>"Notify provider when ready."  Technically a coded value from HL70507.  Stored as a bool instead of 7 seperate columns. OBR.49.* is used to set both ListEhrLabResultsHandlingF and ListEhrLabResultsHandlingN.  OBR.49.*</summary>
    </column>
    <column order="57" name="TQ1SetId" type="bigint(20)">
      <summary>Enumerates the TQ1 segments within a single message starting with 1.  TQ1.1</summary>
    </column>
    <column order="58" name="TQ1DateTimeStart" type="varchar(255)">
      <summary>Stored as string in the format YYYY[MM[DD[HH[MM[SS]]]]] where bracketed values are optional.  TQ1.7</summary>
    </column>
    <column order="59" name="TQ1DateTimeEnd" type="varchar(255)">
      <summary>Stored as string in the format YYYY[MM[DD[HH[MM[SS]]]]] where bracketed values are optional.  TQ1.8</summary>
    </column>
    <column order="60" name="IsCpoe" type="tinyint(4)">
      <summary>This gets set when a provider is logged in with a valid EHR key and then creates a lab.</summary>
    </column>
    <column order="61" name="OriginalPIDSegment" type="text">
      <summary>The PID Segment from the HL7 message used to generate or update the lab order.</summary>
    </column>
  </table>
  <table name="ehrlabclinicalinfo">
    <summary>For EHR module, lab request that contains all required fields for HL7 Lab Reporting Interface (LRI).  OBR.13.*</summary>
    <column order="0" name="EhrLabClinicalInfoNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EhrLabNum" type="bigint(20)" fk="ehrlab">
      <summary>FK to ehrlab.EhrLabNum.</summary>
    </column>
    <column order="2" name="ClinicalInfoID" type="varchar(255)">
      <summary>OBR.13.*.1</summary>
    </column>
    <column order="3" name="ClinicalInfoText" type="varchar(255)">
      <summary>Description of ClinicalInfoId.  OBR.13.*.2</summary>
    </column>
    <column order="4" name="ClinicalInfoCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that ClinicalInfoId came from.  OBR.13.*.3</summary>
    </column>
    <column order="5" name="ClinicalInfoIDAlt" type="varchar(255)">
      <summary>OBR.13.*.4</summary>
    </column>
    <column order="6" name="ClinicalInfoTextAlt" type="varchar(255)">
      <summary>Description of ClinicalInfoIdAlt.  OBR.13.*.5</summary>
    </column>
    <column order="7" name="ClinicalInfoCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that ClinicalInfoId came from.  OBR.13.*.6</summary>
    </column>
    <column order="8" name="ClinicalInfoTextOriginal" type="varchar(255)">
      <summary>Optional text that describes the original text used to encode the values above.  OBR.13.*.7</summary>
    </column>
  </table>
  <table name="ehrlabimage">
    <summary>Used to link images to an EHR lab.</summary>
    <column order="0" name="EhrLabImageNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EhrLabNum" type="bigint(20)" fk="ehrlab">
      <summary>FK to ehrlab.EhrLabNum.</summary>
    </column>
    <column order="2" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum.  Will be -1 to indicate that lab is expecting image results.</summary>
    </column>
  </table>
  <table name="ehrlabnote">
    <summary>For EHR module, May either be a note attached to an EhrLab or an EhrLabResult.  NTE.*</summary>
    <column order="0" name="EhrLabNoteNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EhrLabNum" type="bigint(20)" fk="ehrlab">
      <summary>FK to ehrlab.EhrLabNum.  Should never be zero.</summary>
    </column>
    <column order="2" name="EhrLabResultNum" type="bigint(20)" fk="ehrlabresult">
      <summary>FK to ehrlabresult.EhrLabResult.  May be 0 if this is a Lab Note, will be valued if this is an Ehr Lab Result Note.</summary>
    </column>
    <column order="3" name="Comments" type="text">
      <summary>Carret delimited list of comments.  Comments must be formatted text and cannot contain the following 6 characters |^&amp;~\#  NTE.*.*</summary>
    </column>
  </table>
  <table name="ehrlabresult">
    <summary>For EHR module, lab result that contains all required fields for HL7 Lab Reporting Interface (LRI).  OBX</summary>
    <column order="0" name="EhrLabResultNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EhrLabNum" type="bigint(20)" fk="ehrlab">
      <summary>FK to ehrlab.EhrLabNum.</summary>
    </column>
    <column order="2" name="SetIdOBX" type="bigint(20)">
      <summary>Enumerates the OBX segments within a single message starting with 1.  OBX.1</summary>
    </column>
    <column order="3" name="ValueType" type="varchar(255)">
      <summary>This field identifies the data type used for ObservationValue (OBX-5).  OBX.2</summary>
    </column>
    <column order="4" name="ObservationIdentifierID" type="varchar(255)">
      <summary>"LOINC shall be used as the standard coding system for this field if an appropriate LOINC code exists. Appropriate status is defined in the LOINC Manual Section 11.2 Classification of LOINC Term Status. If a local coding system is in use, a local code should also be sent to help with identification of coding issues. When no valid LOINC exists the local code may be the only code sent.  When populating this field with values, this guide does not give preference to the triplet in which the standard (LOINC) code should appear." OBX.3.1</summary>
    </column>
    <column order="5" name="ObservationIdentifierText" type="varchar(255)">
      <summary>Description of ObservationIdentifierId. OBX.3.2</summary>
    </column>
    <column order="6" name="ObservationIdentifierCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that ObservationIdentifierId came from. Should be "LN".  OBX.3.3</summary>
    </column>
    <column order="7" name="ObservationIdentifierIDAlt" type="varchar(255)">
      <summary>Probably a LoincCode or empty.  OBX.3.4</summary>
    </column>
    <column order="8" name="ObservationIdentifierTextAlt" type="varchar(255)">
      <summary>Description of ObservationIdentifierIdAlt.  OBX.3.5</summary>
    </column>
    <column order="9" name="ObservationIdentifierCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that ObservationIdentifierId came from. Should be "LN" or empty.  OBX.3.6</summary>
    </column>
    <column order="10" name="ObservationIdentifierTextOriginal" type="varchar(255)">
      <summary>Optional text that describes the original text used to encode the values above.  OBX.3.7</summary>
    </column>
    <column order="11" name="ObservationIdentifierSub" type="varchar(255)">
      <summary>OBX.4</summary>
    </column>
    <column order="12" name="ObservationValueCodedElementID" type="varchar(255)">
      <summary>OBX.5.1</summary>
    </column>
    <column order="13" name="ObservationValueCodedElementText" type="varchar(255)">
      <summary>Description of ObservationValueCodedElementId.  OBX.5.2</summary>
    </column>
    <column order="14" name="ObservationValueCodedElementCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that ObservationValueCodedElementId came from.  OBX.5.3</summary>
    </column>
    <column order="15" name="ObservationValueCodedElementIDAlt" type="varchar(255)">
      <summary>OBX.5.4</summary>
    </column>
    <column order="16" name="ObservationValueCodedElementTextAlt" type="varchar(255)">
      <summary>Description of ObservationValueCodedElementIdAlt.  OBX.5.5</summary>
    </column>
    <column order="17" name="ObservationValueCodedElementCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that ObservationValueCodedElementId came from.  OBX.5.6</summary>
    </column>
    <column order="18" name="ObservationValueCodedElementTextOriginal" type="varchar(255)">
      <summary>CWE only.  Optional text that describes the original text used to encode the values above.  OBX.5.7</summary>
    </column>
    <column order="19" name="ObservationValueDateTime" type="varchar(255)">
      <summary>Stored as string in the formatYYYY[MM[DD]] for DT and YYYYMMDDHHMMSS for TS. Note: this is the lab result value, not the DT the test was performed. OBX.5.1</summary>
    </column>
    <column order="20" name="ObservationValueTime" type="time">
      <summary>Note: this is the lab result value, not the time the test was performed. OBX.5.1</summary>
    </column>
    <column order="21" name="ObservationValueComparator" type="varchar(255)">
      <summary>OBX.5.1</summary>
    </column>
    <column order="22" name="ObservationValueNumber1" type="double">
      <summary>OBX.5.2</summary>
    </column>
    <column order="23" name="ObservationValueSeparatorOrSuffix" type="varchar(255)">
      <summary>OBX.5.3</summary>
    </column>
    <column order="24" name="ObservationValueNumber2" type="double">
      <summary>OBX.5.4</summary>
    </column>
    <column order="25" name="ObservationValueNumeric" type="double">
      <summary>OBX.5.1</summary>
    </column>
    <column order="26" name="ObservationValueText" type="varchar(255)">
      <summary>OBX.5.1</summary>
    </column>
    <column order="27" name="UnitsID" type="varchar(255)">
      <summary>"UCUM (Unified Code for Units of Measure) will be evaluated during the pilot for potential subsequent inclusion. As part of the pilot test, for dimensionless units the UCUM representation could be {string}, e.g., for titer the pilot might use {titer} to test feasibility. When sending units of measure as text, they must be placed in the correct component of OBX-6 (CWE_CRE.9)."  OBX.6.1</summary>
    </column>
    <column order="28" name="UnitsText" type="varchar(255)">
      <summary>Description of UnitsId.  OBX.6.2</summary>
    </column>
    <column order="29" name="UnitsCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that UnitsId came from. Should be "UCUM".  OBX.6.3</summary>
    </column>
    <column order="30" name="UnitsIDAlt" type="varchar(255)">
      <summary>OBX.6.4</summary>
    </column>
    <column order="31" name="UnitsTextAlt" type="varchar(255)">
      <summary>Description of UnitsIdAlt.  OBX.6.5</summary>
    </column>
    <column order="32" name="UnitsCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that UnitsId came from.  OBX.6.6</summary>
    </column>
    <column order="33" name="UnitsTextOriginal" type="varchar(255)">
      <summary>Optional text that describes the original text used to encode the values above.  OBX.6.7</summary>
    </column>
    <column order="34" name="referenceRange" type="varchar(255)">
      <summary>"Guidance: It is not appropriate to send the reference range for a result in an associated NTE segment. It would be appropriate to send additional information clarifying the reference range in an NTE associated with this OBX-"  OBX.7</summary>
    </column>
    <column order="35" name="AbnormalFlags" type="varchar(255)">
      <summary>Comma Delimited list of Abnormal Flags using HL70078 enum values.  OBX.8.*</summary>
    </column>
    <column order="36" name="ObservationResultStatus" type="varchar(255)">
      <summary>Coded status of result.  OBX.11</summary>
    </column>
    <column order="37" name="ObservationDateTime" type="varchar(255)">
      <summary>Stored as string in the format YYYYMMDD[HH[MM[SS]]]. "For specimen based test, if it is valued it must be the same as SPM-17.  
            If SPM-17 is present and relates to the same observation, then OBX-14 must be within the DR range."  OBX.14.1</summary>
    </column>
    <column order="38" name="AnalysisDateTime" type="varchar(255)">
      <summary>Stored as string in the format YYYYMMDD[HH[MM[SS]]].  "Be as precise as appropriate and available."  OBX.19.1</summary>
    </column>
    <column order="39" name="PerformingOrganizationName" type="varchar(255)">
      <summary>OBX.23.1</summary>
    </column>
    <column order="40" name="PerformingOrganizationNameAssigningAuthorityNamespaceId" type="varchar(255)">
      <summary>OBX.23.6.1</summary>
    </column>
    <column order="41" name="PerformingOrganizationNameAssigningAuthorityUniversalId" type="varchar(255)">
      <summary>The Assigning Authority component is used to identify the system, application, organization, etc. that assigned the ID in component 10.  OBX.23.6.2</summary>
    </column>
    <column order="42" name="PerformingOrganizationNameAssigningAuthorityUniversalIdType" type="varchar(255)">
      <summary>Should always be "ISO", unless importing.  OBX.23.6.3</summary>
    </column>
    <column order="43" name="PerformingOrganizationIdentifierTypeCode" type="varchar(255)">
      <summary>OBX.23.7</summary>
    </column>
    <column order="44" name="PerformingOrganizationIdentifier" type="varchar(255)">
      <summary>OBX.23.10</summary>
    </column>
    <column order="45" name="PerformingOrganizationAddressStreet" type="varchar(255)">
      <summary>OBX.24.1.1</summary>
    </column>
    <column order="46" name="PerformingOrganizationAddressOtherDesignation" type="varchar(255)">
      <summary>OBX.24.2</summary>
    </column>
    <column order="47" name="PerformingOrganizationAddressCity" type="varchar(255)">
      <summary>OBX.24.3</summary>
    </column>
    <column order="48" name="PerformingOrganizationAddressStateOrProvince" type="varchar(255)">
      <summary>USPS Alpha State Codes.  OBX.24.4</summary>
    </column>
    <column order="49" name="PerformingOrganizationAddressZipOrPostalCode" type="varchar(255)">
      <summary>OBX.24.5</summary>
    </column>
    <column order="50" name="PerformingOrganizationAddressCountryCode" type="varchar(255)">
      <summary>Should be the three letter Alpha Code derived from ISO 3166 alpha-3 code set. http://www.nationsonline.org/oneworld/country_code_list.htm OBX.24.6</summary>
    </column>
    <column order="51" name="PerformingOrganizationAddressAddressType" type="varchar(255)">
      <summary>OBX.24.7</summary>
    </column>
    <column order="52" name="PerformingOrganizationAddressCountyOrParishCode" type="varchar(255)">
      <summary>Should be based on FIPS 6-4. We are just importing the string as is. OBX.24.8</summary>
    </column>
    <column order="53" name="MedicalDirectorID" type="varchar(255)">
      <summary>May be provnum or NPI num or any other num, when combined with MedicalDirectorIdAssigningAuthority should uniquely identify the provider.  OBX.25.1</summary>
    </column>
    <column order="54" name="MedicalDirectorLName" type="varchar(255)">
      <summary>OBX.25.2</summary>
    </column>
    <column order="55" name="MedicalDirectorFName" type="varchar(255)">
      <summary>OBX.25.3</summary>
    </column>
    <column order="56" name="MedicalDirectorMiddleNames" type="varchar(255)">
      <summary>Middle names or initials therof.  OBX.25.4</summary>
    </column>
    <column order="57" name="MedicalDirectorSuffix" type="varchar(255)">
      <summary>Example: JR or III.  OBX.25.5</summary>
    </column>
    <column order="58" name="MedicalDirectorPrefix" type="varchar(255)">
      <summary>Example: DR, Not MD, MD would be stored in an optional field that was not implemented called MedicalDirectorDegree.  OBX.25.6</summary>
    </column>
    <column order="59" name="MedicalDirectorAssigningAuthorityNamespaceID" type="varchar(255)">
      <summary>Usually empty, "The value of [this field] reflects a local code that represents the combination of [the next two fields]."  OBX.25.9.1</summary>
    </column>
    <column order="60" name="MedicalDirectorAssigningAuthorityUniversalID" type="varchar(255)">
      <summary>ISO compliant OID that represents the organization that assigned the unique provider ID.  OBX.25.9.2</summary>
    </column>
    <column order="61" name="MedicalDirectorAssigningAuthorityIDType" type="varchar(255)">
      <summary>Always "ISO", unless importing from outside source.  OBX.25.9.3</summary>
    </column>
    <column order="62" name="MedicalDirectorNameTypeCode" type="varchar(255)">
      <summary>Describes the type of name used.  OBX.25.10</summary>
    </column>
    <column order="63" name="MedicalDirectorIdentifierTypeCode" type="varchar(255)">
      <summary>Must be value from HL70203 code set, see note at bottom of EhrLab.cs for usage.  OBX.25.13</summary>
    </column>
  </table>
  <table name="ehrlabresultscopyto">
    <summary>For EHR module, copy results to... that contains all required fields for HL7 Lab Reporting Interface (LRI).</summary>
    <column order="0" name="EhrLabResultsCopyToNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EhrLabNum" type="bigint(20)" fk="ehrlab">
      <summary>FK to ehrlab.EhrLabNum.</summary>
    </column>
    <column order="2" name="CopyToID" type="varchar(255)">
      <summary>May be provnum or NPI num or any other num, when combined with CopyToIdAssigningAuthority should uniquely identify the provider.  OBR.28.1</summary>
    </column>
    <column order="3" name="CopyToLName" type="varchar(255)">
      <summary>OBR.28.2</summary>
    </column>
    <column order="4" name="CopyToFName" type="varchar(255)">
      <summary>OBR.28.3</summary>
    </column>
    <column order="5" name="CopyToMiddleNames" type="varchar(255)">
      <summary>Middle names or initials therof.  OBR.28.4</summary>
    </column>
    <column order="6" name="CopyToSuffix" type="varchar(255)">
      <summary>Example: JR or III.  OBR.28.5</summary>
    </column>
    <column order="7" name="CopyToPrefix" type="varchar(255)">
      <summary>Example: DR, Not MD, MD would be stored in an optional field that was not implemented called CopyToDegree.  OBR.28.6</summary>
    </column>
    <column order="8" name="CopyToAssigningAuthorityNamespaceID" type="varchar(255)">
      <summary>Usually empty, "The value of [this field] reflects a local code that represents the combination of [the next two fields]."  OBR.28.9.1</summary>
    </column>
    <column order="9" name="CopyToAssigningAuthorityUniversalID" type="varchar(255)">
      <summary>ISO compliant OID that represents the organization that assigned the unique provider ID.  OBR.28.9.2</summary>
    </column>
    <column order="10" name="CopyToAssigningAuthorityIDType" type="varchar(255)">
      <summary>Always "ISO", unless importing from outside source.  OBR.28.9.3</summary>
    </column>
    <column order="11" name="CopyToNameTypeCode" type="varchar(255)">
      <summary>Describes the type of name used.  OBR.28.10</summary>
    </column>
    <column order="12" name="CopyToIdentifierTypeCode" type="varchar(255)">
      <summary>Must be value from HL70203 code set, see note at bottom of EhrLab.cs for usage.  OBR.28.13</summary>
    </column>
  </table>
  <table name="ehrlabspecimen">
    <summary>For EHR module, the specimen upon which the lab orders were/are to be performed on.  NTE.*</summary>
    <column order="0" name="EhrLabSpecimenNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EhrLabNum" type="bigint(20)" fk="ehrlab">
      <summary>FK to ehrlab.EhrLabNum.  May be 0.</summary>
    </column>
    <column order="2" name="SetIdSPM" type="bigint(20)">
      <summary>Enumerates the SPM segments within a single message starting with 1.  SPM.1</summary>
    </column>
    <column order="3" name="SpecimenTypeID" type="varchar(255)">
      <summary>SPM.2</summary>
    </column>
    <column order="4" name="SpecimenTypeText" type="varchar(255)">
      <summary>Description of SpecimenTypeId.  SPM.3</summary>
    </column>
    <column order="5" name="SpecimenTypeCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that SpecimenTypeId came from.  SPM.4</summary>
    </column>
    <column order="6" name="SpecimenTypeIDAlt" type="varchar(255)">
      <summary>SPM.5</summary>
    </column>
    <column order="7" name="SpecimenTypeTextAlt" type="varchar(255)">
      <summary>Description of SpecimenTypeIdAlt.  SPM.6</summary>
    </column>
    <column order="8" name="SpecimenTypeCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that SpecimenTypeId came from.  SPM.7</summary>
    </column>
    <column order="9" name="SpecimenTypeTextOriginal" type="varchar(255)">
      <summary>Optional text that describes the original text used to encode the values above.  SPM.8</summary>
    </column>
    <column order="10" name="CollectionDateTimeStart" type="varchar(255)">
      <summary>Stored as string in the format YYYYMMDD[HH[MM[SS]]] where bracketed values are optional.  When time is not known will be valued "0000".  SPM.17.1.1</summary>
    </column>
    <column order="11" name="CollectionDateTimeEnd" type="varchar(255)">
      <summary>May be empty.  Stored as string in the format YYYYMMDD[HH[MM[SS]]] where bracketed values are optional.  SPM.17.2.1</summary>
    </column>
  </table>
  <table name="ehrlabspecimencondition">
    <summary>For EHR module, the specimen upon which the lab orders were/are to be performed on.  SPM.24</summary>
    <column order="0" name="EhrLabSpecimenConditionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EhrLabSpecimenNum" type="bigint(20)" fk="ehrlabspecimen">
      <summary>FK to ehrlabspecimen.EhrLabSpecimenNum.</summary>
    </column>
    <column order="2" name="SpecimenConditionID" type="varchar(255)">
      <summary>SPM.24.1</summary>
    </column>
    <column order="3" name="SpecimenConditionText" type="varchar(255)">
      <summary>Description of SpecimenConditionId.  SPM.24.2</summary>
    </column>
    <column order="4" name="SpecimenConditionCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that SpecimenConditionId came from.  SPM.24.3</summary>
    </column>
    <column order="5" name="SpecimenConditionIDAlt" type="varchar(255)">
      <summary>SPM.24.4</summary>
    </column>
    <column order="6" name="SpecimenConditionTextAlt" type="varchar(255)">
      <summary>Description of SpecimenConditionIdAlt.  SPM.24.5</summary>
    </column>
    <column order="7" name="SpecimenConditionCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that SpecimenConditionId came from.  SPM.24.6</summary>
    </column>
    <column order="8" name="SpecimenConditionTextOriginal" type="varchar(255)">
      <summary>Optional text that describes the original text used to encode the values above.  SPM.24.7</summary>
    </column>
  </table>
  <table name="ehrlabspecimenrejectreason">
    <summary>For EHR module, the specimen upon which the lab orders were/are to be performed on.  (May Repeat) SPM.21</summary>
    <column order="0" name="EhrLabSpecimenRejectReasonNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EhrLabSpecimenNum" type="bigint(20)" fk="ehrlab">
      <summary>FK to ehrlab.EhrLabNum.  May be 0.</summary>
    </column>
    <column order="2" name="SpecimenRejectReasonID" type="varchar(255)">
      <summary> SPM.21.1</summary>
    </column>
    <column order="3" name="SpecimenRejectReasonText" type="varchar(255)">
      <summary>Description of SpecimenRejectReasonId.   SPM.21.2</summary>
    </column>
    <column order="4" name="SpecimenRejectReasonCodeSystemName" type="varchar(255)">
      <summary>CodeSystem that SpecimenRejectReasonId came from.   SPM.21.3</summary>
    </column>
    <column order="5" name="SpecimenRejectReasonIDAlt" type="varchar(255)">
      <summary> SPM.21.4</summary>
    </column>
    <column order="6" name="SpecimenRejectReasonTextAlt" type="varchar(255)">
      <summary>Description of SpecimenRejectReasonIdAlt.   SPM.21.5</summary>
    </column>
    <column order="7" name="SpecimenRejectReasonCodeSystemNameAlt" type="varchar(255)">
      <summary>CodeSystem that SpecimenRejectReasonId came from.   SPM.21.6</summary>
    </column>
    <column order="8" name="SpecimenRejectReasonTextOriginal" type="varchar(255)">
      <summary>Optional text that describes the original text used to encode the values above.   SPM.21.7</summary>
    </column>
  </table>
  <table name="ehrmeasure">
    <summary>For EHR module, automate measure calculation.</summary>
    <column order="0" name="EhrMeasureNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MeasureType" type="tinyint(4)">
      <summary>Enum:EhrMeasureType</summary>
      <Enumeration name="EhrMeasureType">
        <summary></summary>
        <EnumValue name="ProblemList">0</EnumValue>
        <EnumValue name="MedicationList">1</EnumValue>
        <EnumValue name="AllergyList">2</EnumValue>
        <EnumValue name="Demographics">3</EnumValue>
        <EnumValue name="Education">4</EnumValue>
        <EnumValue name="TimelyAccess">5</EnumValue>
        <EnumValue name="ProvOrderEntry">6</EnumValue>
        <EnumValue name="CPOE_MedOrdersOnly">7</EnumValue>
        <EnumValue name="CPOE_PreviouslyOrdered">8</EnumValue>
        <EnumValue name="Rx">9</EnumValue>
        <EnumValue name="VitalSigns">10</EnumValue>
        <EnumValue name="VitalSignsBMIOnly">11</EnumValue>
        <EnumValue name="VitalSignsBPOnly">12</EnumValue>
        <EnumValue name="Smoking">13</EnumValue>
        <EnumValue name="Lab">14</EnumValue>
        <EnumValue name="ElectronicCopy">15</EnumValue>
        <EnumValue name="ClinicalSummaries">16</EnumValue>
        <EnumValue name="Reminders">17</EnumValue>
        <EnumValue name="MedReconcile">18</EnumValue>
        <EnumValue name="SummaryOfCare">19- Summary of care record for transition or referral.</EnumValue>
        <EnumValue name="CPOE_LabOrdersOnly">20</EnumValue>
        <EnumValue name="CPOE_RadiologyOrdersOnly">21</EnumValue>
        <EnumValue name="ElectronicCopyAccess">22</EnumValue>
        <EnumValue name="SummaryOfCareElectronic">23</EnumValue>
        <EnumValue name="SecureMessaging">24</EnumValue>
        <EnumValue name="FamilyHistory">25</EnumValue>
        <EnumValue name="ElectronicNote">26</EnumValue>
        <EnumValue name="LabImages">27</EnumValue>
        <EnumValue name="VitalSigns2014">28</EnumValue>
        <EnumValue name="DrugDrugInteractChecking">29</EnumValue>
        <EnumValue name="DrugFormularyChecking">30</EnumValue>
        <EnumValue name="ProtectElectHealthInfo">31</EnumValue>
        <EnumValue name="ImmunizationRegistries">32</EnumValue>
        <EnumValue name="SyndromicSurveillance">33</EnumValue>
        <EnumValue name="PatientList">34</EnumValue>
        <EnumValue name="ClinicalInterventionRules">35</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="Numerator" type="smallint(6)">
      <summary>0-100, -1 indicates not entered yet.</summary>
    </column>
    <column order="3" name="Denominator" type="smallint(6)">
      <summary>0-100, -1 indicates not entered yet.</summary>
    </column>
  </table>
  <table name="ehrmeasureevent">
    <summary>Stores events for EHR that are needed for reporting purposes.</summary>
    <column order="0" name="EhrMeasureEventNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateTEvent" type="datetime">
      <summary>Date and time of measure event.</summary>
    </column>
    <column order="2" name="EventType" type="tinyint(4)">
      <summary>Enum:EhrMeasureEventType .</summary>
      <Enumeration name="EhrMeasureEventType">
        <summary></summary>
        <EnumValue name="EducationProvided">0</EnumValue>
        <EnumValue name="OnlineAccessProvided">1</EnumValue>
        <EnumValue name="ElectronicCopyRequested">2</EnumValue>
        <EnumValue name="ElectronicCopyProvidedToPt">3</EnumValue>
        <EnumValue name="ClinicalSummaryProvidedToPt">4, For one office visit.</EnumValue>
        <EnumValue name="ReminderSent">5</EnumValue>
        <EnumValue name="MedicationReconcile">6</EnumValue>
        <EnumValue name="SummaryOfCareProvidedToDr">7 - When Summary of Care is provided in one of the following ways: Printed, exported, or sent to the patient portal (for referrals To doctors).</EnumValue>
        <EnumValue name="TobaccoUseAssessed">8</EnumValue>
        <EnumValue name="TobaccoCessation">9</EnumValue>
        <EnumValue name="CurrentMedsDocumented">10</EnumValue>
        <EnumValue name="CPOE_MedOrdered">11</EnumValue>
        <EnumValue name="CPOE_LabOrdered">12</EnumValue>
        <EnumValue name="CPOE_RadOrdered">13</EnumValue>
        <EnumValue name="SummaryOfCareProvidedToDrElectronic">14 - When a Summary of Care is provided to a doctor electronically in one of the following ways: Exported (we assume they send another way), or a Direct message is sent with Summary of Care attached.</EnumValue>
        <EnumValue name="SecureMessageFromPat">15</EnumValue>
        <EnumValue name="DrugDrugInteractChecking">16</EnumValue>
        <EnumValue name="DrugFormularyChecking">17</EnumValue>
        <EnumValue name="ProtectElectHealthInfo">18</EnumValue>
        <EnumValue name="ImmunizationRegistries">19</EnumValue>
        <EnumValue name="SyndromicSurveillance">20</EnumValue>
        <EnumValue name="PatientList">21</EnumValue>
        <EnumValue name="ClinicalInterventionRules">22</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="4" name="MoreInfo" type="varchar(255)">
      <summary>Used to provide extra information about a measure event.  Not typically used.</summary>
    </column>
    <column order="5" name="CodeValueEvent" type="varchar(30)">
      <summary>The code for this event.  Example: TobaccoUseAssessed can be one of three LOINC codes: 11366-2 History of tobacco use Narrative, 68535-4 Have you used tobacco in the last 30 days, and 68536-2 Have you used smokeless tobacco product in the last 30 days.</summary>
    </column>
    <column order="6" name="CodeSystemEvent" type="varchar(30)">
      <summary>The code system name for the event code.  Examples: LOINC, SNOMEDCT.</summary>
    </column>
    <column order="7" name="CodeValueResult" type="varchar(30)">
      <summary>The code for this event result.  Example: A TobaccoUseAssessed event type could result in a finding of SNOMED code 8517006 - Ex-smoker (finding).  There are 54 allowed tobacco user/non-user codes, and the user is allowed to select from any SNOMED code if they wish, for a TobaccoUseAssessed event.</summary>
    </column>
    <column order="8" name="CodeSystemResult" type="varchar(30)">
      <summary>The code system for this event result.  Example: SNOMEDCT, </summary>
    </column>
    <column order="9" name="FKey" type="bigint(20)">
      <summary>A foreign key to a table associated with the EventType.  0 indicates not in use.  Used to properly count denominators for specific measure types.</summary>
    </column>
    <column order="10" name="TobaccoCessationDesire" type="tinyint">
      <summary>How eager a tobacco user is to quit using tobacco.  Scale of 1-10.</summary>
    </column>
    <column order="11" name="DateStartTobacco" type="date">
      <summary>The date the patient started using tobacco.</summary>
    </column>
  </table>
  <table name="ehrnotperformed">
    <summary>For EHR module, these are all the items 'not performed' on patients.  Each row will link to the ehrcode table to retrieve relevant data.  To join this table to the ehrcode table you must join on CodeValue and CodeSystem.  Some items will have associated reasons attached to specify why it was not performed.  Those reasons will also be defined in the ehrcode table, so it may be necessary to join with that table again for the data relevant to the reason.</summary>
    <column order="0" name="EhrNotPerformedNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="3" name="CodeValue" type="varchar(30)">
      <summary>This will be a FK to a specific code system table identified by the CodeSystem column.  The code for this item from one of the code systems supported.  Examples: 90656 or 442333005.</summary>
    </column>
    <column order="4" name="CodeSystem" type="varchar(30)" fk="codesystem">
      <summary>FK to codesystem.CodeSystemName. The code system name for this code.  Possible values are: CPT, CVX, LOINC, SNOMEDCT.</summary>
    </column>
    <column order="5" name="CodeValueReason" type="varchar(30)">
      <summary>FK to ehrcode.CodeValue.  This code may not exist in the ehrcode table, it may have been chosen from a bigger list of available codes.  In that case, this will be a FK to a specific code system table identified by the CodeSystem column.  The code for the reason the item was not performed from one of the code systems supported.  Examples: 182856006 or 419808006.</summary>
    </column>
    <column order="6" name="CodeSystemReason" type="varchar(30)" fk="codesystem">
      <summary>FK to codesystem.CodeSystemName. The code system name for this code.  Possible value is: SNOMEDCT.</summary>
    </column>
    <column order="7" name="Note" type="text">
      <summary>Relevant notes for this not performed item.  Just in case users want it, does not get reported in EHR quality measure reporting.</summary>
    </column>
    <column order="8" name="DateEntry" type="date">
      <summary>The date and time this item was created.  Can be edited to the date and time the item actually occurred.</summary>
    </column>
  </table>
  <table name="ehrpatient">
    <summary>Patient information needed for EHR.  1:1 relation to patient table.  They are stored here because we want to try to keep the size of the patient table a bit smaller. Some non-EHR columns have also been added, which isn't a big deal.</summary>
    <column order="0" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Also the primary key for this table. Always one to one relationship with patient table.  A new patient might not have an entry here until needed.</summary>
    </column>
    <column order="1" name="MotherMaidenFname" type="varchar(255)">
      <summary>Mother's maiden first name.  Exported in HL7 PID-6 for immunization messages.</summary>
    </column>
    <column order="2" name="MotherMaidenLname" type="varchar(255)">
      <summary>Mother's maiden last name.  Exported in HL7 PID-6 for immunization messages.</summary>
    </column>
    <column order="3" name="VacShareOk" type="tinyint(4)">
      <summary>Enum:YN  Indicates whether or not the patient wants to share their vaccination information with other EHRs.  Used in immunization export.</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="MedicaidState" type="varchar(50)">
      <summary>The abbreviation for the state for the patient's MedicaidID.
            Displayed in patient information window, used to validate the length of the MedicaidID.</summary>
    </column>
    <column order="5" name="SexualOrientation" type="varchar(255)">
      <summary>The patient's sexual orientation. Stored as a SNOMED code or HL7 null flavor.</summary>
    </column>
    <column order="6" name="GenderIdentity" type="varchar(255)">
      <summary>The patient's gender identity. Stored as a SNOMED code or HL7 null flavor.</summary>
    </column>
    <column order="7" name="SexualOrientationNote" type="varchar(255)">
      <summary>Will be blank unless SexualOrientation is OTH, additional orientation.</summary>
    </column>
    <column order="8" name="GenderIdentityNote" type="varchar(255)">
      <summary>Will be blank unless GenderIdentity is OTH, additional gender identity.</summary>
    </column>
    <column order="9" name="DischargeDate" type="datetime">
      <summary>Used in hospitals. Used to track patients discharge date.</summary>
    </column>
  </table>
  <table name="ehrprovkey">
    <summary>Used to store and track Ehr Provider Keys.  There can be multiple EhrProvKeys per provider.</summary>
    <column order="0" name="EhrProvKeyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Only used by HQ for generating keys for customers.  Will always be 0 for non-HQ users.</summary>
    </column>
    <column order="2" name="LName" type="varchar(255)">
      <summary>The provider LName.</summary>
    </column>
    <column order="3" name="FName" type="varchar(255)">
      <summary>The provider FName.</summary>
    </column>
    <column order="4" name="ProvKey" type="varchar(255)">
      <summary>The key assigned to the provider</summary>
    </column>
    <column order="5" name="FullTimeEquiv" type="float">
      <summary>Usually 1.  Can be less, like .5 or .25 to indicate possible discount is justified.</summary>
    </column>
    <column order="6" name="Notes" type="text">
      <summary>Any notes that the tech wishes to include regarding this situation.</summary>
    </column>
    <column order="7" name="YearValue" type="int(11)">
      <summary>Required when generating a new provider key.  It is used to determine annual EHR eligibility.  Format will always be YY.</summary>
    </column>
  </table>
  <table name="ehrquarterlykey">
    <summary>Also used by OD customer support to store and track Ehr Quarterly Keys for customers.</summary>
    <column order="0" name="EhrQuarterlyKeyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="YearValue" type="int(11)">
      <summary>Example 11</summary>
    </column>
    <column order="2" name="QuarterValue" type="int(11)">
      <summary>Example 2</summary>
    </column>
    <column order="3" name="PracticeName" type="varchar(255)">
      <summary>The customer must have this exact practice name entered in practice setup.</summary>
    </column>
    <column order="4" name="KeyValue" type="varchar(255)">
      <summary>The calculated key value, tied to year, quarter, and practice name.</summary>
    </column>
    <column order="5" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Always zero for customer databases.  When used by OD customer support, this is the customer num.</summary>
    </column>
    <column order="6" name="Notes" type="text">
      <summary>Any notes that the tech wishes to include regarding this situation.</summary>
    </column>
  </table>
  <table name="ehrsummaryccd">
    <summary>Can also be a CCR.  Received CCDs/CCRs are stored both here and in emailattach.  Sent CCDs are not saved here, but are only stored in emailattach.  To display a saved Ccd, it is combined with an internal stylesheet.</summary>
    <column order="0" name="EhrSummaryCcdNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateSummary" type="date">
      <summary>Date that this Ccd was received.</summary>
    </column>
    <column order="3" name="ContentSummary" type="longtext">
      <summary>The xml content of the received text file.</summary>
    </column>
    <column order="4" name="EmailAttachNum" type="bigint(20)" fk="emailattach">
      <summary>FK to emailattach.EmailAttachNum.  The Direct email attachment where the CCD xml message came from.  Needed to sync PatNum with the email PatNum if the PatNum is changed on the email.</summary>
    </column>
  </table>
  <table name="ehrtrigger">
    <summary>CDS Triggers when referenced in UI. Used for CDS automation.  May later be expanded to replace "automation."
            </summary>
    <column order="0" name="EhrTriggerNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Short description to describe the trigger.</summary>
    </column>
    <column order="2" name="ProblemSnomedList" type="text">
      <summary></summary>
    </column>
    <column order="3" name="ProblemIcd9List" type="text">
      <summary></summary>
    </column>
    <column order="4" name="ProblemIcd10List" type="text">
      <summary></summary>
    </column>
    <column order="5" name="ProblemDefNumList" type="text">
      <summary></summary>
    </column>
    <column order="6" name="MedicationNumList" type="text">
      <summary></summary>
    </column>
    <column order="7" name="RxCuiList" type="text">
      <summary></summary>
    </column>
    <column order="8" name="CvxList" type="text">
      <summary></summary>
    </column>
    <column order="9" name="AllergyDefNumList" type="text">
      <summary></summary>
    </column>
    <column order="10" name="DemographicsList" type="text">
      <summary>Age, Gender.  Can be multiple age entries but only one gender entry as coma delimited values.  Example: " age,&gt;18  age,&lt;=55  gender,male"</summary>
    </column>
    <column order="11" name="LabLoincList" type="text">
      <summary>List of loinc codes padded with spaces.</summary>
    </column>
    <column order="12" name="VitalLoincList" type="text">
      <summary>Examples:  Height,&gt;=72  Weight&lt;,100  BMI=  (BP currently not implemented.)</summary>
    </column>
    <column order="13" name="Instructions" type="text">
      <summary>The reccomended course of action for this intervention.  </summary>
    </column>
    <column order="14" name="Bibliography" type="text">
      <summary>Bibliographic information, not a URL. </summary>
    </column>
    <column order="15" name="Cardinality" type="tinyint(4)">
      <summary>Enum:MatchCardinality Requires One, OneOfEachCategory, TwoOrMore, or All for trigger to match.  </summary>
      <Enumeration name="MatchCardinality">
        <summary></summary>
        <EnumValue name="One">0 - If any one of the conditions are met from any of the categories.</EnumValue>
        <EnumValue name="OneOfEachCategory">1 - Must have one match from each of the categories with set values. Categories are :Medication, Allergy, Problem, Vitals, Age, Gender, and Lab Results.</EnumValue>
        <EnumValue name="TwoOrMore">2 - Must match any two conditions, may be from same category.</EnumValue>
        <EnumValue name="All">3 - Must match every code defined in the EhrTrigger.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="electid">
    <summary>Corresponds to the electid table in the database. 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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PayorID" type="varchar(255)">
      <summary>aka Electronic ID.  A simple string. This is not necessarily unique between different CarrierNames.  Also, different clearinghouses use different systems of PayorIDs.</summary>
    </column>
    <column order="2" name="CarrierName" type="varchar(255)">
      <summary>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 long 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>
    <column order="6" name="CommBridge" type="tinyint(4)">
      <summary>Enum:EclaimsCommBridge Where this Electronic ID came from. Will be 0 if created by the user. Currently, only ClaimConnect and EDS are supported.</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="ITRANS">9 Canadian clearinghouse.</EnumValue>
        <EnumValue name="Tesia">10</EnumValue>
        <EnumValue name="MercuryDE">11</EnumValue>
        <EnumValue name="ClaimX">12</EnumValue>
        <EnumValue name="DentiCal">13</EnumValue>
        <EnumValue name="EmdeonMedical">14</EnumValue>
        <EnumValue name="Claimstream">15 Canadian clearinghouse.</EnumValue>
        <EnumValue name="NHS">16 UK clearinghouse.</EnumValue>
        <EnumValue name="EDS">17</EnumValue>
        <EnumValue name="Ramq">18</EnumValue>
        <EnumValue name="EdsMedical">19</EnumValue>
        <EnumValue name="Lantek">20</EnumValue>
        <EnumValue name="ITRANS2">21 Canadian clearinghouse.  Similar to ITRANS except supports certificate and carrier list web fetching.</EnumValue>
        <EnumValue name="VyneDental">22</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="Attributes" type="varchar(255)">
      <summary>Comma delimited list of which PayerAttributes of a CommBridge are supported by this Electronic ID. Example: "0,2,8". Enum values for either EnumClaimConnectPayerAttributes or EnumEDSPayerAttributes.</summary>
    </column>
  </table>
  <table name="emailaddress">
    <summary>Stores all the connection info for one email address.  Linked to clinic by clinic.EmailAddressNum.  Sends email based on patient's clinic.</summary>
    <column order="0" name="EmailAddressNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SMTPserver" type="varchar(255)">
      <summary>For example smtp.gmail.com</summary>
    </column>
    <column order="2" name="EmailUsername" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="3" name="EmailPassword" type="varchar(255)">
      <summary>Password associated with this email address.  Encrypted when stored in the database and decrypted before using.</summary>
    </column>
    <column order="4" name="ServerPort" type="int(11)">
      <summary>Usually 587, sometimes 25 or 465.</summary>
    </column>
    <column order="5" name="UseSSL" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="6" name="SenderAddress" type="varchar(255)">
      <summary>The email address of the sender as it should appear to the recipient.</summary>
    </column>
    <column order="7" name="Pop3ServerIncoming" type="varchar(255)">
      <summary>For example pop.gmail.com</summary>
    </column>
    <column order="8" name="ServerPortIncoming" type="int(11)">
      <summary>Usually 110, sometimes 995.</summary>
    </column>
    <column order="9" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Associates a user with this email address.  A user may only have one email address associated with them.
            Can be 0 if no user is associated with this email address.</summary>
    </column>
    <column order="10" name="AccessToken" type="varchar(2000)">
      <summary>Needed for OAuth.</summary>
    </column>
    <column order="11" name="RefreshToken" type="text">
      <summary>Needed for OAuth.</summary>
    </column>
    <column order="12" name="DownloadInbox" type="tinyint(4)">
      <summary>When true, this will allow the user to download emails to their inbox.</summary>
    </column>
    <column order="13" name="QueryString" type="varchar(1000)">
      <summary>Allows gmail users to specify search parameters</summary>
    </column>
    <column order="14" name="AuthenticationType" type="tinyint(4)">
      <summary>Enum:OAuthType None=0,Google=1,Microsoft=2.  Indicates which OAuth type to use for the email address.</summary>
      <Enumeration name="OAuthType">
        <summary></summary>
        <EnumValue name="None">0 - Aka Using Password. Not using OAuth</EnumValue>
        <EnumValue name="Google">1 - Using OAuth for Google</EnumValue>
        <EnumValue name="Microsoft">2 - Using OAuth for Microsoft</EnumValue>
      </Enumeration>
    </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="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EmailMessageNum" type="bigint(20)" fk="emailmessage">
      <summary>FK to emailmessage.EmailMessageNum.  0 if EmailTemplateNum is set, otherwise must have a value.</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 sub directories and 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>
    <column order="4" name="EmailTemplateNum" type="bigint(20)" fk="emailtemplate">
      <summary>FK to emailtemplate.EmailTemplateNum.  0 if EmailMessageNum is set, otherwise must have a value.</summary>
    </column>
  </table>
  <table name="emailautograph">
    <summary>A manually created autograph that can be inserted at the bottom of an outgoing email.</summary>
    <column order="0" name="EmailAutographNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="text">
      <summary>Description of the autograph.  This is what the user sees when picking an autograph.</summary>
    </column>
    <column order="2" name="EmailAddress" type="varchar(255)">
      <summary>Email address(es) that this autograph is associated with.  An autograph can be associated with multiple addresses.</summary>
    </column>
    <column order="3" name="AutographText" type="text">
      <summary>The actual text of the autograph.</summary>
    </column>
  </table>
  <table name="emailhostingtemplate">
    <summary></summary>
    <column order="0" name="EmailHostingTemplateNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TemplateName" type="varchar(255)">
      <summary>Name of the template.</summary>
    </column>
    <column order="2" name="Subject" type="text">
      <summary>Default subject line.</summary>
    </column>
    <column order="3" name="BodyPlainText" type="mediumtext">
      <summary>Body of the email</summary>
    </column>
    <column order="4" name="BodyHTML" type="mediumtext">
      <summary>Body of the email. When email is regular html this will only contain the body text. Will contain full html when email type is RawHtml</summary>
    </column>
    <column order="5" name="TemplateId" type="bigint(20)">
      <summary>The email hosting template's identifier </summary>
    </column>
    <column order="6" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum </summary>
    </column>
    <column order="7" name="EmailTemplateType" type="varchar(255)">
      <summary>Enum:EmailType The type of email template this is (Regular HTML or Full HTML)</summary>
      <Enumeration name="EmailType">
        <summary></summary>
        <EnumValue name="Regular">0 - This is a regular email that may contain our special wiki markup. Not converted to html.</EnumValue>
        <EnumValue name="Html">1 - Html. Basic html email which uses the master template supplied by OD. Template includes header, styles, and the opening body tag. The user only needs to provide the body itself, which can inclcude tags that get automatically replaced.</EnumValue>
        <EnumValue name="RawHtml">2 - More advanced html that does not include the master template. User must provide everything.</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="TemplateType" type="varchar(255)">
      <summary>Enum:PromotionType the type of mass email this template is for</summary>
      <Enumeration name="PromotionType">
        <summary></summary>
        <EnumValue name="Manual">0 - Signifies Manually Sent Promotions like from Mass Emails</EnumValue>
        <EnumValue name="Birthday">1 - Signifies Birthday Greetings</EnumValue>
        <EnumValue name="Treatment">2 - Promotional Treatment</EnumValue>
        <EnumValue name="Special">3 - Special Promotions</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="emailmessage">
    <summary>Stores both sent and received emails, as well as saved emails which are still in composition.</summary>
    <column order="0" name="EmailMessageNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. The patient whom is sending this message. May be sent by a guarantor on behalf of a dependent.</summary>
    </column>
    <column order="2" name="ToAddress" type="text">
      <summary>Either a single email address or a comma-delimited list of addresses.  
            For web mail messages, this will not be an email address.  Instead, it will be the name of the corresponding patient or provider.</summary>
    </column>
    <column order="3" name="FromAddress" type="text">
      <summary>Valid email address.  For web mail messages, this will not be an email address.  Instead, it will be the name of the corresponding patient or provider.</summary>
    </column>
    <column order="4" name="Subject" type="text">
      <summary>Subject line.</summary>
    </column>
    <column order="5" name="BodyText" type="longtext">
      <summary>Body of the email. Both this and HtmlText are required if this is an HTML email.</summary>
    </column>
    <column order="6" name="MsgDateTime" type="datetime">
      <summary>Date and time the message was sent. Automated at the UI level.</summary>
    </column>
    <column order="7" name="SentOrReceived" type="tinyint">
      <summary>Enum:EmailSentOrReceived Neither, Received, Read, WebMailReceived, WebMailRecdRead, WebMailSent, WebMailSentRead, SentDirect, ReceivedEncrypted, ReceivedDirect, ReadDirect, AckDirectProcessed, AckDirectNotSent</summary>
      <Enumeration name="EmailSentOrReceived">
        <summary>0=Neither, 1=Sent, 2=Received, 3=Read, 4=WebMailReceived, 5=WebMailRecdRead, 6=WebMailSent, 7=WebMailSentRead, 8=SentDirect, 9=ReceivedEncrypted, 10=ReceivedDirect, 11=ReadDirect, 12=AckDirectProcessed, 13=AckDirectNotSent</summary>
        <EnumValue name="Neither">0 Unsent</EnumValue>
        <EnumValue name="Sent">1 For regular email only.</EnumValue>
        <EnumValue name="Received">2 For regular email only.  Shows in Inbox.  Once it's attached to a patient it will also show in Chart module.</EnumValue>
        <EnumValue name="Read">3 For received regular email only.  Has been read.  Shows in Inbox.  Once it's attached to a patient it will also show in Chart module.</EnumValue>
        <EnumValue name="WebMailReceived">4 WebMail received from patient portal.  Shows in OD Inbox and in pt Chart module.  Also shows in PP as a sent and unread WebMail msg.</EnumValue>
        <EnumValue name="WebMailRecdRead">5 WebMail received from patient portal that has been marked read.  Shows in the OD Inbox and in pt Chart module.  Also shows in PP as a sent and read WebMail.</EnumValue>
        <EnumValue name="WebMailSent">6 Webmail sent from provider to patient.  Shows in Chart module and also shows in PP as a received and unread WebMail msg.</EnumValue>
        <EnumValue name="WebMailSentRead">7 Webmail sent from provider to patient and read by patient.  Shows in Chart module and also shows in PP as a received and read WebMail msg.</EnumValue>
        <EnumValue name="SentDirect">8 Sent and encrypted using Direct. Required for counting messages in EHR modules g.1 and g.2, Automated Measure Calculation.</EnumValue>
        <EnumValue name="ReceivedEncrypted">9 Received email matches application/pkcs7-mime mime type, but could not be decrypted.  Shows in Inbox.  The user can decrypt from FormEmailMessageEdit.  If the user has the correct private key, then the status will change to Read.</EnumValue>
        <EnumValue name="ReceivedDirect">10 Received email matches application/pkcs7-mime mime type and has been decrypted.  Shows in Inbox.  Once it's attached to a patient it will also show in Chart module.  When viewing inside of FormEmailMessageEdit, the XML body of the message shows as xhtml instead of raw.  Still need to work on supporting collapsing and expanding, as required for meaningful use in 2014.</EnumValue>
        <EnumValue name="ReadDirect">11 For received direct messages.  Has been read.  Shows in Inbox.  Once it's attached to a patient it will also show in Chart module.  When viewing inside of FormEmailMessageEdit, the XML body of the message shows as xhtml.</EnumValue>
        <EnumValue name="AckDirectProcessed">12 Message Delivery Notification (MDN) processed.  Always outgoing.  Indicates to sender that a Direct message was received and decrypted, but not necessarily displayed for the user.  Does not show in patient Chart.  Attached to the same patient as the incoming email which caused the MDN to be sent.</EnumValue>
        <EnumValue name="AckDirectNotSent">13 Message Delivery Notification (MDN) created and saved to db, but not sent yet.  Does not show in patient Chart.  Attached to the same patient as the incoming email which caused the MDN to be created.
            This status is used to try resending MDNs if they fail to send.  The MDN is saved to the db so the unset MDNs can be found easily, and also because MDNs are hard to rebuild again later.</EnumValue>
        <EnumValue name="SecureEmailSent">14 Email sent via EmailHostingAPI.</EnumValue>
        <EnumValue name="SecureEmailReceivedUnread">15 Email received via EmailHostingAPI.  Has not been read.</EnumValue>
        <EnumValue name="SecureEmailReceivedRead">16 Email sent via EmailHostingAPI.  has been read.</EnumValue>
        <EnumValue name="SendFailed">17 Email failed to send.</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="RecipientAddress" type="varchar(255)">
      <summary>Copied from the EmailAddress.EmailUsername field when a message is received into the inbox.
            Similar to the ToAddress, except the ToAddress could contain multiple recipient addresses
            or group email address instead. The recipient address helps match the an email to a particular EmailAddress.</summary>
    </column>
    <column order="9" name="RawEmailIn" type="longtext">
      <summary>For incomming email only.  The raw email contents for encrypted email or email which we had trouble parsing.
            For unencrypted (clear text) email, this will be similar to the raw email except the attachments will be dissolved to prevent db bloating. 
            Can be used for debugging if there are any issues parsing the content.
            This will bloat the database a little bit, but we need it for now to ensure our inbox is working in real world scenarios.
            Might be blank for a few emails downloaded immediately after the email inbox feature was created.</summary>
    </column>
    <column order="10" name="ProvNumWebMail" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  The provider to whom this message was sent or from whom this message was sent.  Only used when EmailSentOrReceived is WebMailReceived, WebMailRecdRead, WebMailSent, or WebMailSentRead.  Will be 0 if not a web mail message.</summary>
    </column>
    <column order="11" name="PatNumSubj" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. Represents the patient to whom this email message is addressed, or from whom it is being sent on behalf of. If guarantor is sending on behalf of self then this field will match PatNum field.</summary>
    </column>
    <column order="12" name="CcAddress" type="text">
      <summary>Single address or comma-delimited list of addresses.  User may enter multiple email addresses for visible carbon copies.</summary>
    </column>
    <column order="13" name="BccAddress" type="text">
      <summary>Single email address or comma-delimited list of addresses.  User may enter multiple email addresses for blind carbon copies.</summary>
    </column>
    <column order="14" name="HideIn" type="tinyint(4)">
      <summary>Enum:HideInFlags None=0,EmailInbox=1,ApptEdit=2,ContrChartProgNotes=4,ContrAccountGridProg.  Indicates which places in the program that should not show this email message, bitwise. 0 means don't hide anywhere.</summary>
      <Enumeration name="HideInFlags">
        <summary>0 indicates don't hide anywhere.</summary>
        <EnumValue name="None">0 - None</EnumValue>
        <EnumValue name="EmailInbox">1 - Hide email from EmailInbox grids</EnumValue>
        <EnumValue name="ApptEdit">2 - Hide email from Appointment Edit grid</EnumValue>
        <EnumValue name="ChartProgNotes">4 - Hide email from ContrChart ProgNotes grid</EnumValue>
        <EnumValue name="AccountProgNotes">8 - No Longer Used - Was used to hide email from ContrAcount ProgNotes grid</EnumValue>
        <EnumValue name="AccountCommLog">16 - Hide email from ContrAcount CommLog grid</EnumValue>
      </Enumeration>
    </column>
    <column order="15" name="AptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum. Used to a attach an email to an appointment for eReminders and eConfirmations.</summary>
    </column>
    <column order="16" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Optional.  0 if unknown (ex recieved emails).</summary>
    </column>
    <column order="17" name="HtmlType" type="tinyint(4)">
      <summary>Enum:EmailType </summary>
      <Enumeration name="EmailType">
        <summary></summary>
        <EnumValue name="Regular">0 - This is a regular email that may contain our special wiki markup. Not converted to html.</EnumValue>
        <EnumValue name="Html">1 - Html. Basic html email which uses the master template supplied by OD. Template includes header, styles, and the opening body tag. The user only needs to provide the body itself, which can inclcude tags that get automatically replaced.</EnumValue>
        <EnumValue name="RawHtml">2 - More advanced html that does not include the master template. User must provide everything.</EnumValue>
      </Enumeration>
    </column>
    <column order="18" name="SecDateTEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="19" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="20" name="MsgType" type="varchar(255)">
      <summary>Enum:EmailMessageSource Stored in db as string. This is used to identify where in the program this message originated from. This is used for sent email messages.</summary>
      <Enumeration name="EmailMessageSource">
        <summary>The different parts in the program that send an email message. Stored in db as string, so do not change enum spellings.</summary>
        <EnumValue name="Undefined">Should not be used.</EnumValue>
        <EnumValue name="Legacy">This is used for all existing messages prior to v21.1.6.0.</EnumValue>
        <EnumValue name="Confirmation">Confirmation messages.</EnumValue>
        <EnumValue name="Cryo">Oregon Cryonics.</EnumValue>
        <EnumValue name="EConfirmation">Auto eConfirmation messages.</EnumValue>
        <EnumValue name="EHR">EHR messages.</EnumValue>
        <EnumValue name="EReminder">Auto eReminder messages.</EnumValue>
        <EnumValue name="Forward">Forward messages.</EnumValue>
        <EnumValue name="Hosting">Generated by Open Dental email hosting.</EnumValue>
        <EnumValue name="JobManager">Jobmanager messages.</EnumValue>
        <EnumValue name="Manual">Manual messages by office.</EnumValue>
        <EnumValue name="PatPortalInvite">Auto Patient portal invites.</EnumValue>
        <EnumValue name="PatPortalReset">Auto Patient portal pass code reset.</EnumValue>
        <EnumValue name="PaymentReceipt">Payment receipt.</EnumValue>
        <EnumValue name="Promotion">Auto Promotion messages.</EnumValue>
        <EnumValue name="Recall">Recall messages.</EnumValue>
        <EnumValue name="Reply">Reply messages.</EnumValue>
        <EnumValue name="Sheet">Sheet messages.</EnumValue>
        <EnumValue name="Statement">Statement messages.</EnumValue>
        <EnumValue name="ThankYou">Auto Thankyou messages.</EnumValue>
        <EnumValue name="TreatmentPlan">Treatment plan messages.</EnumValue>
        <EnumValue name="Verification">Auto verification messages.</EnumValue>
        <EnumValue name="WebMail">Webmail messages.</EnumValue>
        <EnumValue name="WebSchedASAP">Auto websched ASAP messages.</EnumValue>
        <EnumValue name="WebSchedRecall">Auto websched recall messages.</EnumValue>
        <EnumValue name="GeneralMessage">Appointment General Message.</EnumValue>
        <EnumValue name="NewPatThankYou">New patient web form thank you message.</EnumValue>
        <EnumValue name="MsgToPay">Payment Portal Msg-To-Pay message</EnumValue>
        <EnumValue name="EClipboardWeb">EClipboard Web URL message</EnumValue>
      </Enumeration>
    </column>
    <column order="21" name="FailReason" type="text">
      <summary>Reason the message failed to send. Blank if sent successful.</summary>
    </column>
  </table>
  <table name="emailmessageuid">
    <summary>Used to track which email messages have been downloaded into the inbox for a particular recipient address.
            Not linked to the email message itself because no link is needed.
            If we decide to add a foreign key to a EmailMessage later, we should consider what do to when an email message is deleted (set the foreign key to 0 perhaps).</summary>
    <column order="0" name="EmailMessageUidNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MsgId" type="text">
      <summary>The unique id for the associated EmailMessage.  </summary>
    </column>
    <column order="2" name="RecipientAddress" type="varchar(255)">
      <summary>Copied from the EmailAddress.EmailUsername field when a message is received into the inbox.
            Similar to the ToAddress of the EmailMessage, except the ToAddress could contain multiple recipient addresses
            or group email address instead. The recipient address helps match the EmailMessageUid to a particular EmailAddress.</summary>
    </column>
  </table>
  <table name="emailsecure">
    <summary>Tracks every secure email sent and received from or to a patient.</summary>
    <column order="0" name="EmailSecureNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="3" name="EmailMessageNum" type="bigint(20)" fk="emailmessage">
      <summary>FK to emailmessage.EmailMessageNum.  0 indicates email has not been successfully downloaded from API yet.</summary>
    </column>
    <column order="4" name="EmailChainFK" type="bigint(20)">
      <summary>FK to emailchain, as hosted by API.  Table does not exist at dental office.</summary>
    </column>
    <column order="5" name="EmailFK" type="bigint(20)">
      <summary>FK to email, as hosted by API.  Table does not exist at dental office.</summary>
    </column>
    <column order="6" name="DateTEntry" type="datetime">
      <summary>DateTime the entry was inserted</summary>
    </column>
    <column order="7" name="SecDateTEdit" type="timestamp">
      <summary>DateTime the entry was edited.</summary>
    </column>
  </table>
  <table name="emailsecureattach">
    <summary>Tracks every attachment linked to a secure email.</summary>
    <column order="0" name="EmailSecureAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="2" name="EmailAttachNum" type="bigint(20)" fk="emailattach">
      <summary>FK to emailattach.EmailAttachNum.  0 indicates attachment has not been successfully downloaded from API yet.</summary>
    </column>
    <column order="3" name="EmailSecureNum" type="bigint(20)" fk="emailsecure">
      <summary>FK to emailsecure.EmailSecureNum.</summary>
    </column>
    <column order="4" name="AttachmentGuid" type="varchar(50)">
      <summary>Attachment identifier, as hosted by API.  Table does not exist at dental office.</summary>
    </column>
    <column order="5" name="DisplayedFileName" type="varchar(255)">
      <summary>The displayed name of the file/object.</summary>
    </column>
    <column order="6" name="Extension" type="varchar(255)">
      <summary>The extension of the object (i.e. png).</summary>
    </column>
    <column order="7" name="DateTEntry" type="datetime">
      <summary>FK to email, as hosted by API.  Table does not exist at dental office.</summary>
    </column>
    <column order="8" name="SecDateTEdit" type="timestamp">
      <summary>DateTime the entry was edited.</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="bigint(20)">
      <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>
    <column order="3" name="Description" type="text">
      <summary>Different than Subject.  The description of the email template.  This is what the user sees in the list.</summary>
    </column>
    <column order="4" name="TemplateType" type="tinyint(4)">
      <summary>Enum:EmailType </summary>
      <Enumeration name="EmailType">
        <summary></summary>
        <EnumValue name="Regular">0 - This is a regular email that may contain our special wiki markup. Not converted to html.</EnumValue>
        <EnumValue name="Html">1 - Html. Basic html email which uses the master template supplied by OD. Template includes header, styles, and the opening body tag. The user only needs to provide the body itself, which can inclcude tags that get automatically replaced.</EnumValue>
        <EnumValue name="RawHtml">2 - More advanced html that does not include the master template. User must provide everything.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="employee">
    <summary>An employee at the dental office.</summary>
    <column order="0" name="EmployeeNum" type="bigint(20)">
      <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>
    <column order="6" name="PhoneExt" type="int(11)">
      <summary>The phone extension for the employee.  e.g. 101,102,etc.  This field is only visible for user editing if the pref DockPhonePanelShow is true (1).</summary>
    </column>
    <column order="7" name="PayrollID" type="varchar(255)">
      <summary>Used to store the payroll identification number used to generate payroll reports. ADP uses six digit number between 000051 and 999999.</summary>
    </column>
    <column order="8" name="WirelessPhone" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="9" name="EmailWork" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="10" name="EmailPersonal" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="11" name="IsFurloughed" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="12" name="IsWorkingHome" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="13" name="ReportsTo" type="bigint(20)" fk="employee">
      <summary>FK to employee.EmployeeNum</summary>
    </column>
    <column order="14" name="Title" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. This category is DefCat.EmployeeTitles (DefCat=56) for their Job title.</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="bigint(20)">
      <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="encounter">
    <summary>Mostly used for EHR.  This rigorously records encounters using rich automation, so that reporting can be easy and meaningful.  Encounters can also be tracked separately using billable procedures.  In contrast, encounters in this table are not billable.  There can be multiple encounters at one appointment because there can be different types.</summary>
    <column order="0" name="EncounterNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. </summary>
    </column>
    <column order="2" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. </summary>
    </column>
    <column order="3" name="CodeValue" type="varchar(30)">
      <summary>FK to ehrcode.CodeValue.  This code may not exist in the ehrcode table, it may have been chosen from a bigger list of available codes.  In that case, this will be a FK to a specific code system table identified by the CodeSystem column.  The code for this item from one of the code systems supported.  Examples: 185349003 or 406547006.</summary>
    </column>
    <column order="4" name="CodeSystem" type="varchar(30)" fk="codesystem">
      <summary>FK to codesystem.CodeSystemName. This will determine which specific code system table the CodeValue is a FK to.  We only allow the following CodeSystems in this table: CDT, CPT, HCPCS, and SNOMEDCT. </summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary></summary>
    </column>
    <column order="6" name="DateEncounter" type="date">
      <summary>Date the encounter occurred</summary>
    </column>
  </table>
  <table name="entrylog">
    <summary>Stores entries made for AppointmentCreate. Acts as an additional securitylog entry.</summary>
    <column order="0" name="EntryLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum</summary>
    </column>
    <column order="2" name="FKeyType" type="tinyint(4)">
      <summary>Enum:EntryLogFKeyType </summary>
      <Enumeration name="EntryLogFKeyType">
        <summary>These FKey Types are to be used as an identifier for what table the Fkey column is associated to</summary>
        <EnumValue name="Appointment">0</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FKey" type="bigint(20)">
      <summary>A foreign key to a table associated with the EntryLogFKeyType.</summary>
    </column>
    <column order="4" name="LogSource" type="tinyint(4)">
      <summary>Enum:LogSources</summary>
      <Enumeration name="LogSources">
        <summary>Known entities that create security logs.</summary>
        <EnumValue name="None">0 - Open Dental and unknown entities.</EnumValue>
        <EnumValue name="WebSched">1 - GWT Web Sched application Recall version.</EnumValue>
        <EnumValue name="InsPlanImport834">2 - X12 834 Insurance Plan Import from the Manage Module.</EnumValue>
        <EnumValue name="HL7">3 - HL7 is an automated process which the user may not be aware of.</EnumValue>
        <EnumValue name="DBM">4 - Database maintenance.  This process creates patients which are known to be missing,
            but the user may not be aware that the fix involves patient recreation.</EnumValue>
        <EnumValue name="FHIR">5 - FHIR is an automated process which the user may not be aware of.</EnumValue>
        <EnumValue name="PatientPortal">6 - Patient Portal application.</EnumValue>
        <EnumValue name="WebSchedNewPatAppt">7 - GWT Web Sched application New Patient Appointment version</EnumValue>
        <EnumValue name="AutoConfirmations">8 - Automated eConfirmation and eReminders</EnumValue>
        <EnumValue name="Diagnostic">9 - Open Dental messages created for debugging and diagnostic purposes. 
            For example, to diagnose an unhandled exception or unexpected behavior that is otherwise too hard to diagnose.</EnumValue>
        <EnumValue name="MobileWeb">10 - Mobile Web application.</EnumValue>
        <EnumValue name="CanadaEobAutoImport">11 - When retrieving reports in the background of FormOpenDental</EnumValue>
        <EnumValue name="WebSchedASAP">12 - Web Sched application for moving ASAP appointments.</EnumValue>
        <EnumValue name="OpenDentalService">13 - OpenDentalService.</EnumValue>
        <EnumValue name="BroadcastMonitor">14 - Broadcast Monitor.</EnumValue>
        <EnumValue name="AutoLogOff">15 - Automatic log off from main form.
            Used to track when auto log off needs to kill the program to force close open forms which are blocked or slow to respond.</EnumValue>
        <EnumValue name="ODMobile">16 - ODMobile App.</EnumValue>
        <EnumValue name="TextMessaging">17 - Open Dental text messaging.</EnumValue>
        <EnumValue name="CareCredit">18 - CareCredit.</EnumValue>
        <EnumValue name="WebSchedExistingPatient">19 - GWT Web Sched application Existing Patient Appointmention version</EnumValue>
        <EnumValue name="eRx">20 - eRx</EnumValue>
        <EnumValue name="SignupPortal">21 - SignupPortal</EnumValue>
        <EnumValue name="EmployerImport834">22 - X12 834 Employer Import from the Manage Module.</EnumValue>
        <EnumValue name="API">23 - The non-FHIR API.</EnumValue>
        <EnumValue name="ClaimReceiveAutomatic">24 - Indicates that a claim was automatically received.</EnumValue>
        <EnumValue name="PaymentPortal">25 - Indicates that a payment was made from the Payment Portal.</EnumValue>
        <EnumValue name="Era835Import">26 - X12 835 ERA automatic import.</EnumValue>
        <EnumValue name="ODTouch">27 - ODTouch mobile application.</EnumValue>
        <EnumValue name="eClipboard">28 - eClipboard mobile application.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="EntryDateTime" type="datetime">
      <summary>The date and time of the entry.  Its value is set when inserting and can never change.  Even if a user changes the date on their computer, 
            this remains accurate because it uses server time.</summary>
    </column>
  </table>
  <table name="eobattach">
    <summary>One file attached to an eob (claimpayment).  Multiple files can be attached to an eob using this method.  Order shown will be based on date/time scanned.</summary>
    <column order="0" name="EobAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClaimPaymentNum" type="bigint(20)" fk="claimpayment">
      <summary>FK to claimpayment.ClaimPaymentNum. Will be zero if this eobattach is for a preauthorization.</summary>
    </column>
    <column order="2" name="DateTCreated" type="datetime">
      <summary>Date/time created.</summary>
    </column>
    <column order="3" name="FileName" type="varchar(255)">
      <summary>The file is stored in the A-Z folder in 'EOBs' folder.  This field stores the name of the file.  The files are named automatically based on Date/time along with EobAttachNum for uniqueness.</summary>
    </column>
    <column order="4" name="RawBase64" type="text">
      <summary>The raw file data encoded as base64.  Only used if there is no AtoZ folder.</summary>
    </column>
    <column order="5" name="ClaimNumPreAuth" type="bigint(20)" fk="claim">
      <summary>FK to claim.ClaimNum of a preauthorization. Will be zero if this eobattach is for a claimpayment.</summary>
    </column>
  </table>
  <table name="equipment">
    <summary>Used for property tax tracking.</summary>
    <column order="0" name="EquipmentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="text">
      <summary>Short description, need not be very unique.</summary>
    </column>
    <column order="2" name="SerialNumber" type="varchar(255)">
      <summary>Must be unique among all pieces of equipment.  Auto-generated 3 char alpha numeric gives 1.5M unique serial numbers.  Zero never part of autogenerated serial number.</summary>
    </column>
    <column order="3" name="ModelYear" type="varchar(2)">
      <summary>Limit 2 char.</summary>
    </column>
    <column order="4" name="DatePurchased" type="date">
      <summary>Date when this corporation obtained the equipment.  Always has a valid value.</summary>
    </column>
    <column order="5" name="DateSold" type="date">
      <summary>Normally 01-01-0001 if equipment still in possession.  Once sold, a date will be present.</summary>
    </column>
    <column order="6" name="PurchaseCost" type="double">
      <summary>.</summary>
    </column>
    <column order="7" name="MarketValue" type="double">
      <summary>.</summary>
    </column>
    <column order="8" name="Location" type="text">
      <summary>Freeform text.</summary>
    </column>
    <column order="9" name="DateEntry" type="date">
      <summary>Security uses this date to lock older entries from accidental deletion.  Date, no time.</summary>
    </column>
    <column order="10" name="ProvNumCheckedOut" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. Only filled in if equipment has been checked out, otherwise 0.</summary>
    </column>
    <column order="11" name="DateCheckedOut" type="date">
      <summary>Only used when equipment has been checked out.</summary>
    </column>
    <column order="12" name="DateExpectedBack" type="date">
      <summary>Only used when equipment has been checked out.  Defaults to same day as check out.</summary>
    </column>
    <column order="13" name="DispenseNote" type="text">
      <summary>Any notes regarding the equipment checked out.</summary>
    </column>
    <column order="14" name="Status" type="text">
      <summary>Status of the equipment.</summary>
    </column>
  </table>
  <table name="erouting">
    <summary>A set of actions to take in sequence for each interaction with a specific patient.  Individual actions are in eRoutingAction. Templates are in eRoutingDef.  Only used in eClipboard for now.</summary>
    <column order="0" name="ERoutingNum" type="bigint(20)">
      <summary>Primary Key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Copied from eRoutingDef. </summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. The patient this eRouting is for.</summary>
    </column>
    <column order="3" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. The clinic this patient eRouting is in. Set to 0 if in headquarters or clinics are disabled.</summary>
    </column>
    <column order="4" name="SecDateTEntry" type="datetime">
      <summary>The DateTime this eRouting was created. eRoutings are created when they are started. Not able to edited by the user.</summary>
    </column>
    <column order="5" name="IsComplete" type="tinyint(4)">
      <summary>eRouting is considered complete if this is true. Used on backend to get incomplete eRouting without checking eRoutingActions</summary>
    </column>
  </table>
  <table name="eroutingaction">
    <summary>A single action attached to a eRouting. Only used in eClipboard for now.</summary>
    <column order="0" name="ERoutingActionNum" type="bigint(20)">
      <summary>Primary Key</summary>
    </column>
    <column order="1" name="ERoutingNum" type="bigint(20)" fk="erouting">
      <summary>FK to eRouting.ERoutingNum</summary>
    </column>
    <column order="2" name="ItemOrder" type="int(11)">
      <summary>Copied from eRoutingActionDef.ItemOrder.</summary>
    </column>
    <column order="3" name="ERoutingActionType" type="tinyint(4)">
      <summary>Enum:EnumERoutingActionType </summary>
      <Enumeration name="EnumERoutingActionType">
        <summary></summary>
        <EnumValue name="None">0-Shouldn't be present in db. Used in UI when user has not yet picked an action type.</EnumValue>
        <EnumValue name="PerioChart">1-Perio Chart</EnumValue>
        <EnumValue name="TreatmentPlan">2-Treatment Plan</EnumValue>
        <EnumValue name="PaymentPlan">3-Payment Plan</EnumValue>
        <EnumValue name="ChartProcedures">4-Chart Procedures</EnumValue>
        <EnumValue name="Imaging">5-Imaging</EnumValue>
        <EnumValue name="CompleteAppointment">6-Complete Appointment</EnumValue>
        <EnumValue name="TakePayment">7-Take Payment</EnumValue>
        <EnumValue name="ScheduleFollowup">8-Schedule Follow up</EnumValue>
        <EnumValue name="eRx">9-ERX</EnumValue>
        <EnumValue name="ExamSheet">10-Exam Sheet</EnumValue>
        <EnumValue name="ConsentForm">11-Consent Form</EnumValue>
        <EnumValue name="Medical">12-Medical</EnumValue>
        <EnumValue name="ChecklistItem">13-Checklist Item</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. This is the user that completed the action. If not complete, this will be 0.</summary>
    </column>
    <column order="5" name="IsComplete" type="tinyint(4)">
      <summary>True if marked complete, otherwise set to false.</summary>
    </column>
    <column order="6" name="DateTimeComplete" type="datetime">
      <summary>The date and time this action was set complete by the user.</summary>
    </column>
    <column order="7" name="ForeignKeyType" type="tinyint(4)">
      <summary> Enum:EnumERoutingFKType Indicates the type of object that ForeignKey references. None=0, Sheet=1 </summary>
    </column>
    <column order="8" name="ForeignKey" type="bigint(20)">
      <summary> FK to attached object. Type is indicated by ForeignKeyType. Sheet for Consent forms. </summary>
    </column>
    <column order="9" name="LabelOverride" type="varchar(255)">
      <summary> Override for the title of the eRouting Action. This will be shown in the eClipboard UI instead of EnumERoutingActionType description if it is present. </summary>
    </column>
  </table>
  <table name="eroutingactiondef">
    <summary>A single action attached to an ERoutingDef. Changing these does not alter any patient records. Only used in ODTouch for now.</summary>
    <column order="0" name="ERoutingActionDefNum" type="bigint(20)">
      <summary>PK</summary>
    </column>
    <column order="1" name="ERoutingDefNum" type="bigint(20)" fk="erouting">
      <summary>FK to eRouting.eRoutingDefNum. Defines what eRouting this action is tied to</summary>
    </column>
    <column order="2" name="ERoutingActionType" type="tinyint(4)">
      <summary>Enum:EnumeRoutingActionType </summary>
      <Enumeration name="EnumeRoutingActionType">
        <summary></summary>
      </Enumeration>
    </column>
    <column order="3" name="ItemOrder" type="int(11)">
      <summary>Determines the order the items show in the eRoutingactiondef and what order they are to be completed in.</summary>
    </column>
    <column order="4" name="SecDateTEntry" type="datetime">
      <summary>The date this action definition was created. Not able to edited by the user.</summary>
    </column>
    <column order="5" name="DateTLastModified" type="datetime">
      <summary>The date time this action was last changed. Not able to be edited by the user.</summary>
    </column>
    <column order="6" name="ForeignKeyType" type="tinyint(4)">
      <summary> Enum:EnumERoutingDefFKType Indicates the type of object that ForeignKey references. None=0, SheetDef=1 </summary>
    </column>
    <column order="7" name="ForeignKey" type="bigint(20)">
      <summary> FK to attached object. Type is indicated by ForeignKeyType. SheetDef for Consent forms. </summary>
    </column>
    <column order="8" name="LabelOverride" type="varchar(255)">
      <summary> Override for the title of the eRouting Action. This will be shown in the eClipboard UI instead of EnumERoutingActionType description if it is present. </summary>
    </column>
  </table>
  <table name="eroutingdef">
    <summary>A set of actions to take in sequence for each interaction with a patient.  Individual actions are in eRoutingActionDef.  Changing these does not alter any patient records. Only used in eClipboard for now.</summary>
    <column order="0" name="ERoutingDefNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. Represents the clinic that the eRouting is tied to, if any. Can be 0.</summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>The name of the eRouting.</summary>
    </column>
    <column order="3" name="UserNumCreated" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that created this eRouting. Cannot be edited by user.</summary>
    </column>
    <column order="4" name="UserNumModified" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that last edited this eRouting. Cannot be edited by user.</summary>
    </column>
    <column order="5" name="SecDateTEntered" type="datetime">
      <summary>Date Time this eRouting was created. Cannot be edited by user.</summary>
    </column>
    <column order="6" name="DateLastModified" type="datetime">
      <summary>Date time this eRouting was last edited. Cannot be edited by user.</summary>
    </column>
  </table>
  <table name="eroutingdeflink">
    <summary>There can be multiple eRoutingDefLinks for each eRoutingDef. For example, one eRoutingDef could have 4 appointment types as well as a billing type, for a total of 5 eRoutingDefLinks.  If an appointment has a matching AppointmentType and BillingType, then that eRouting is used.</summary>
    <column order="0" name="ERoutingDefLinkNum" type="bigint(20)">
      <summary>PK</summary>
    </column>
    <column order="1" name="ERoutingDefNum" type="bigint(20)" fk="eroutingdef">
      <summary>FK to eRoutingdef.eRoutingDefNum.</summary>
    </column>
    <column order="2" name="Fkey" type="bigint(20)">
      <summary>FK to other tables. Dictated by the FKey Type.</summary>
    </column>
    <column order="3" name="ERoutingType" type="tinyint(4)">
      <summary>Enum:EnumeRoutingType </summary>
      <Enumeration name="EnumeRoutingType">
        <summary></summary>
      </Enumeration>
    </column>
  </table>
  <table name="erxlog">
    <summary></summary>
    <column order="0" name="ErxLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="MsgText" type="mediumtext">
      <summary>Holds up to 16MB.</summary>
    </column>
    <column order="3" name="DateTStamp" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="4" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. The provider that the prescription request was sent by or on behalf of.</summary>
    </column>
    <column order="5" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to Userod.UserNum. The user that created the erx.</summary>
    </column>
  </table>
  <table name="eservicelog">
    <summary>Stores an ongoing record of EServices activity. User not allowed to edit.</summary>
    <column order="0" name="EServiceLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="LogDateTime" type="datetime">
      <summary>The date and time of the entry. It's value is set when inserting and can never change. Even if a user changes the date on their computer, this remains accurate because it uses server time.</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. Can be 0 if not applicable.</summary>
    </column>
    <column order="3" name="EServiceType" type="tinyint(4)">
      <summary>Enum:eServiceType Indicates which eService feature this log entry is associated with, such as Web Sched, Patient Portal, or eClipboard.</summary>
      <Enumeration name="eServiceType">
        <summary>Specifies which eService feature is involved in the logged action. Some actions correspond to multiple eServices, so this clarifies which specific eService is logged. For example, eServiceAction.WSTimeSlotChoose could be used for WSRecall, WSNewPatient, WSExistingPatient, etc. A combination of eServiceAction.WSTimeSlotChoose and eServiceType.WSRecall would indicate that the patient chose a time slot using WebSched Recall.</summary>
        <EnumValue name="Unknown">0. In the case of an action, this means Unknown.</EnumValue>
        <EnumValue name="WSRecall">1. This means the action done was a Web Sched Recall.</EnumValue>
        <EnumValue name="WSNewPat">2. This means the action done was for a New Patient.</EnumValue>
        <EnumValue name="WSExistingPat">3. This means the action done was for an Existing Patient.</EnumValue>
        <EnumValue name="WSAsap">4. This means the action done was for a Web Sched ASAP.</EnumValue>
        <EnumValue name="PatientPortal">5. This means the action done was for a Patient Portal.</EnumValue>
        <EnumValue name="EClipboard">6. This means the action done was for a Mobile Checkin.</EnumValue>
        <EnumValue name="ApptConfirmations">7. This means the action done was for a Appointment Confirmations.</EnumValue>
        <EnumValue name="WebForms">8. This means the action done was for a WebForm.</EnumValue>
        <EnumValue name="WSGeneral">9. This means the action done was for unspecified WebSched.</EnumValue>
        <EnumValue name="Arrivals">10. This means the action done was for Arrivals.</EnumValue>
        <EnumValue name="IntegratedTexting">11. This means the action done was for Integrated Texting.</EnumValue>
        <EnumValue name="ODTouch">12. This means the action done was for the mobile app ODTouch.</EnumValue>
        <EnumValue name="PaymentPortal">13. This means the action done was for the Payment Portal.</EnumValue>
        <EnumValue name="BetterDiag">14. This means the action done was for the Better Diagnostics AI bridge.</EnumValue>
        <EnumValue name="MassEmail">15. This means the action was done for Mass Email.</EnumValue>
        <EnumValue name="Pearl">16. This means the action was done for the Pearl AI bridge. Pearl is technically not an eService, but is logged using this table.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="EServiceAction" type="smallint(6)">
      <summary>Enum:eServiceAction Describes the specific action or event that occurred within the eService, such as scheduling an appointment, submitting a form, or logging in.</summary>
      <Enumeration name="eServiceAction">
        <summary>Describes a specific action that was taken in an eService feature.  Some actions are linked to multiple eServices. For example, moving an appointment on WebSched (WSMovedAppt) can be triggered from WebSchedNewPat, WebSchedExistingPat, WebSchedRecall, and WebSchedASAP.</summary>
        <EnumValue name="Undefined">0 - Should not be in the database.</EnumValue>
        <EnumValue name="WSHomeView">1 - Patient arrives at home view.</EnumValue>
        <EnumValue name="WSServiceSelect">2 - Patient chooses between new/existing/recall appointment on home view.</EnumValue>
        <EnumValue name="WSIdentify">3 - Patient identifies themselves.</EnumValue>
        <EnumValue name="WSScheduler">4 - Patient arrives at the scheduler page.</EnumValue>
        <EnumValue name="WSMonthSwitch">5 - Patient switches months in the timeslot picker.</EnumValue>
        <EnumValue name="WSTimeSlotChoose">6 - Patient selects an open timeslot.</EnumValue>
        <EnumValue name="WSConfirmationPopup">7 - Patient recieves the confirmation popup.</EnumValue>
        <EnumValue name="WSDateTimeYes">8 - Patient accepted the datetime.</EnumValue>
        <EnumValue name="WSDateTimeNo">9 - Patient declines the datetime.</EnumValue>
        <EnumValue name="WSTwoFactorSent">10 - Patient was sent a 2FA code.</EnumValue>
        <EnumValue name="WSTwoFactorPassed">11 - Patient successfully passed 2FA.</EnumValue>
        <EnumValue name="WSAppointmentScheduleFromClient">12 - Patient schedules appointment.</EnumValue>
        <EnumValue name="WSAppointmentScheduledFromServer">13 - Appointment scheduled.</EnumValue>
        <EnumValue name="CONFConfirmedAppt">14 - Appointment confirmation.</EnumValue>
        <EnumValue name="WSMovedAppt">15 - Appointment has been moved.</EnumValue>
        <EnumValue name="PPLoggedIn">16 - Patient logged into patient portal.</EnumValue>
        <EnumValue name="PPMadePayment">17 - Deprecated. Do not use.</EnumValue>
        <EnumValue name="ECAddedForm">18 - Form created.</EnumValue>
        <EnumValue name="ECCompletedForm">19 - Form was filled out.</EnumValue>
        <EnumValue name="ECLoggedIn">20 - eClipboard Checked In.</EnumValue>
        <EnumValue name="WFCompletedForm">21 - Web Forms Form Completed.</EnumValue>
        <EnumValue name="WSRecallNotFound">22 - Web Sched Recall Not Found.</EnumValue>
        <EnumValue name="WSRecallAlreadyScheduled">23 - Web Sched Already Scheduled.</EnumValue>
        <EnumValue name="ArrivalReceived">24 - Arrivals, patient arrived.</EnumValue>
        <EnumValue name="IntegratedTextingOptOut">25 - Integrated Texting, Patient Opted Out.</EnumValue>
        <EnumValue name="PPStatementPortalArrived">26 - Patient Portal, Patient Arrived At Statement Portal.</EnumValue>
        <EnumValue name="PPStatementPortalLoggedIn">27 - Patient Portal, Patient Logged In At Statement Portal.</EnumValue>
        <EnumValue name="PPStatementPortalDownloadStatement">28 - Patient Portal, Patient Downloaded Statement.</EnumValue>
        <EnumValue name="PPPaymentFormOpened">29 - Patient Portal, Patient Opened Payment Form.</EnumValue>
        <EnumValue name="PPPaymentFormOpenedFromLogin">30 - Patient Portal, Patient Opened Payment Form From Login.</EnumValue>
        <EnumValue name="PPOpenedHostedPaymentForm">31 - Patient Portal, Patient Opened Hosted Payment Form.</EnumValue>
        <EnumValue name="PPPayWithExistingFromClient">32 - Patient Portal, Patient Paid With Existing Card.</EnumValue>
        <EnumValue name="PPPaymentCreatedByXWeb">33 - Patient Portal, Patient Submitted Payment With XWeb.</EnumValue>
        <EnumValue name="PPPaymentCreatedByPayconnect">34 - Patient Portal, Patient Submitted Payment With PayConnect.</EnumValue>
        <EnumValue name="PPDuplicatePaymentAlert">35 - Patient Portal, Patient Notified of Possible Duplicate Payment.</EnumValue>
        <EnumValue name="PPDuplicatePaymentAllowed">36 - Patient Portal, Patient Allowed Submission of Duplicate Payment.</EnumValue>
        <EnumValue name="PPDuplicatePaymentDenied">37 - Patient Portal, Patient Rejected Submission of Duplicate Payment.</EnumValue>
        <EnumValue name="ECCheckInBYOD">38 - eClipboard - Check In for patients bringing their own device</EnumValue>
        <EnumValue name="ECCheckInStarted">39 - eClipboard - Check In process started</EnumValue>
        <EnumValue name="ECCheckInArrived">40 - eClipboard - Check In Arrived</EnumValue>
        <EnumValue name="ECCheckInSubmitted">41 - eClipboard - Check In Submitted</EnumValue>
        <EnumValue name="ECCheckInErrorApptNotFound">42 - eClipboard - Check In Error: Appt Not Found</EnumValue>
        <EnumValue name="ECCheckInErrorPatNumNotLinkedToAppt">43 - eClipboard - Check In Error: PatNum Not Linked To Appt</EnumValue>
        <EnumValue name="ECCheckInErrorDeviceSetupForOtherClinic">44 - eClipboard - Error: Device Setup for Other Clinic</EnumValue>
        <EnumValue name="ECCheckInErrorDeviceNotAllowedForCheckin">45 - eClipboard - Check In Error: Device Not Allowed for Checkin</EnumValue>
        <EnumValue name="ECCheckInErrorOfficeDeviceUsedAsBYOD">46 - eClipboard - Check In Error: Office Device used as BYOD</EnumValue>
        <EnumValue name="ECCheckInErrorNoApptFoundBYOD">47 - eClipboard - Check In Error: No Appointment Found BYOD</EnumValue>
        <EnumValue name="ECCheckInErrorNoApptFound">48 - eClipboard - Check In Error: No Appt Found</EnumValue>
        <EnumValue name="ECCheckInErrorMultiplePatsFound">49 - eClipboard - Check In Error: Multiple Pats Found</EnumValue>
        <EnumValue name="ECCheckInErrorSignatureError">50 - eClipboard - Check In Error: Signature Error</EnumValue>
        <EnumValue name="ECCheckInErrorDeprecatedMethod">51 - eClipboard - Check In Error: Deprecated Method</EnumValue>
        <EnumValue name="ECCheckInConfirmedApptWithProvYes">52 - eClipboard - Check In Confirmed Appt With Prov - Yes</EnumValue>
        <EnumValue name="ECCheckInConfirmedApptWithProvNo">53 - eClipboard - Check In Confirmed Appt With Prov - No</EnumValue>
        <EnumValue name="ECCheckInListSubmittedWithPicture">54 - eClipboard - Check In Took selfie before submitting</EnumValue>
        <EnumValue name="ECCheckInListSubmittedWithOutPicture">55 - eClipboard - Check In List Did not take selfie before submitting</EnumValue>
        <EnumValue name="ECCheckInListErrorSubmittedWithoutAllItems">56 - eClipboard - Check In List Error, submitted without all items</EnumValue>
        <EnumValue name="ECCheckInListXamSubmitError">57 - eClipboard - Check In List Submit Xamarin Error</EnumValue>
        <EnumValue name="ECCheckInListSumbitSuccess">58 - eClipboard - Check In Submit Success</EnumValue>
        <EnumValue name="ECCheckInListSumbitSuccessBYOD">59 - eClipboard - Check In Submit Success BYOD</EnumValue>
        <EnumValue name="ECCheckInListSelectedItem">60 - eClipboard - Check In List Selected Item</EnumValue>
        <EnumValue name="ECCheckInListSheetNextTapped">61 - eClipboard - Check In List Sheet Next Tapped</EnumValue>
        <EnumValue name="ECCheckInListSheetPrevTapped">62 - eClipboard - Check In List Sheet Prev Tapped</EnumValue>
        <EnumValue name="ECCheckInListSheetOfficeSignedTreatPlan">63 - eClipboard - Check In List Sheet Office signed Treatment Plan</EnumValue>
        <EnumValue name="ECCheckInListSheetPatientSignedTreatPlan">64 - eClipboard - Check In List Sheet Patient signed treatment plan</EnumValue>
        <EnumValue name="ECCheckInListSheetPatientSignedPaymentPlan">65 - eClipboard - Check In List Sheet Patient signed Payment Plan</EnumValue>
        <EnumValue name="ECPatientDirectedToMakePayment">66 - eClipboard - Check In List Sheet Patient signed Payment Plan</EnumValue>
        <EnumValue name="ECBYODValidationReached">67 - eClipboard - BYOD 6 Digit validation page reached</EnumValue>
        <EnumValue name="ECBYODValidationFailed">68 - eClipboard - BYOD 6 Digit validation failed</EnumValue>
        <EnumValue name="ECBYODValidationSuccess">69 - eClipboard - BYOD 6 Digit validation success</EnumValue>
        <EnumValue name="EC2FactorAuthShown">70 - eClipboard - 2 Factor Auth Screen Shown</EnumValue>
        <EnumValue name="EC2FactorAuthClosed">71 - eClipboard - 2 Factor Auth Close Clicked</EnumValue>
        <EnumValue name="EC2FactorAuthEmailSelected">72 - eClipboard - 2 Factor Auth Email Selected</EnumValue>
        <EnumValue name="EC2FactorAuthTextSelected">73 - eClipboard - 2 Factor Auth Text Selected</EnumValue>
        <EnumValue name="EC2FactorAuthCodeSubmitted">74 - eClipboard - 2 Factor Auth Code Submitted</EnumValue>
        <EnumValue name="EC2FactorAuthCodeSuccess">75 - eClipboard - 2 Factor Auth Code Success</EnumValue>
        <EnumValue name="EC2FactorAuthCodeFail">76 - eClipboard - 2 Factor Auth Code Fail</EnumValue>
        <EnumValue name="DoNotLog">77 - Used in Xam Exceptions. If this is sent back, error will not be logged. Default eServiceAction for XamException.</EnumValue>
        <EnumValue name="ECOpenPaymentPage">78 - eClipboard - patient opens payment page. Note should indicate where it is opened from</EnumValue>
        <EnumValue name="ECAddCreditCardTapped">79 - eClipboard - User tapped "Add Card"</EnumValue>
        <EnumValue name="ECCreditCardManageDoneTapped">80 - eClipboard - User tapped 'Done' on credit card manage page </EnumValue>
        <EnumValue name="ECCreditCardRemoved">81 - eClipboard - User removed a credit card </EnumValue>
        <EnumValue name="ECCreditCardPaymentWithNewCard">82 - eClipboard - User made payment with new credit card</EnumValue>
        <EnumValue name="ECCreditCardPaymentWIthExistingCard">83 - eClipboard - User made payment with existing credit card</EnumValue>
        <EnumValue name="ECCreditCardPaymentCancelled">84 - eClipboard - User tapped cancel when making a payment </EnumValue>
        <EnumValue name="ECCreditCardErrorDeleteCardNotFound">85 - eClipboard - Error: Delete card not found</EnumValue>
        <EnumValue name="ECCreditCardErrorDeleteCardPatNumDoesNotMatch">86 - eClipboard - Error: Delete credit card patnum does not match current patnum</EnumValue>
        <EnumValue name="ECCreditCardErrorDeleteCardInvalidAlias">87 - eClipboard - Error: Delete credit card invalid alias</EnumValue>
        <EnumValue name="ECCreditCardErrorDeleteCardPatientNotFound">88 - eClipboard - Error: Delete credit card patient not found</EnumValue>
        <EnumValue name="ECCreditCardErrorMakingPaymentWithAlias">89 - eClipboard - Error: error making payment</EnumValue>
        <EnumValue name="ECCreditCardErrorMakingPaymentPatientNotFound">90 - eClipboard - Error: Making Payment, patient not found</EnumValue>
        <EnumValue name="ECCreditCardErrorMakingPaymentInvalidAmount">91 - eClipboard - Error: Making Payment, invalid amount </EnumValue>
        <EnumValue name="ECQRScanAttempt">92 - EClipboard - QR scan window activated</EnumValue>
        <EnumValue name="ECQRScanCancel">93 - EClipboard - QR scan window cancelled</EnumValue>
        <EnumValue name="ECQRScanOk">94 - EClipboard - QR scan window success</EnumValue>
        <EnumValue name="ECSubmitSheetFailed">95 - EClipboard - Error: Failed to submit sheet or eForm</EnumValue>
        <EnumValue name="WFDownloadedForm">96 - Web Forms Form Downloaded.</EnumValue>
        <EnumValue name="WFDiscardedForm">97 - Web Forms Form Discarded.</EnumValue>
        <EnumValue name="WFSkippedForm">98 - Web Forms Form Skipped.</EnumValue>
        <EnumValue name="WFDeletedForm">99 - Web Forms Form Deleted.</EnumValue>
        <EnumValue name="WFError">100 - Web Forms Error.</EnumValue>
        <EnumValue name="WFCancelled">101 - Web Forms Cancelled Import.</EnumValue>
        <EnumValue name="PayPortalArrived">102 - Payment Portal - Unverified user arrived at the payment portal</EnumValue>
        <EnumValue name="PayPortalArrivedWithSessionToken">103 - Payment Portal - Verified user arrived at the payment portal</EnumValue>
        <EnumValue name="PayPortalArrivedWithPayGuid">104 - Payment Portal - User arrived at the payment portal via message-to-pay</EnumValue>
        <EnumValue name="SelectedPatient">105 - Web App - User provided patient information within the patient selection view</EnumValue>
        <EnumValue name="PayPortalSwitchedToCorrectClinic">106 - Payment Portal - Switched to selected patient's clinic</EnumValue>
        <EnumValue name="PayPortalRequestedCodeViaEmail">107 - Payment Portal - User requested an email authentication code</EnumValue>
        <EnumValue name="PayPortalRequestedCodeViaSms">108 - Payment Portal - User requested a text authentication code</EnumValue>
        <EnumValue name="PayPortalAuthenticatedViaEmail">109 - Payment Portal - User verified identity with an email authentication code</EnumValue>
        <EnumValue name="PayPortalAuthenticatedViaSms">110 - Payment Portal - User verified identity with an SMS authentication code</EnumValue>
        <EnumValue name="PayPortalUseAmountDue">111 - Payment Portal - User opted to pay amount due</EnumValue>
        <EnumValue name="PayPortalEnteredPayAmount">112 - Payment Portal - User entered a custom amount to pay</EnumValue>
        <EnumValue name="PayPortalSelectedPaymentMethod">113 - Payment Portal - User selected an existing payment method</EnumValue>
        <EnumValue name="PayPortalHostedFormLoaded">114 - Payment Portal - The make payment window was loaded</EnumValue>
        <EnumValue name="PayPortalPaymentSucceeded">115 - Payment Portal - The payment was processed successfully</EnumValue>
        <EnumValue name="PayPortalClickedPrint">116 - Payment Portal - The user printed their receipt</EnumValue>
        <EnumValue name="WebAppError">117 - Web App - The user received an error</EnumValue>
        <EnumValue name="BetterDiagPass">118 - Better Diagnostics AI - The BD API passed back 200 (OK).</EnumValue>
        <EnumValue name="BetterDiagFail">119 - Better Diagnostics AI - The BD API passed back non 200 (not OK).</EnumValue>
        <EnumValue name="BetterDiagException">120 - Better Diagnostics AI - The BD API thew an exception.</EnumValue>
        <EnumValue name="ECCheckinErrorEFormToImaging">121 eClipboard - Error: Submitted EForm Failed to Save to Imaging Module.</EnumValue>
        <EnumValue name="MassEmailUpload">122 - Mass Email - Email Addresses Uploaded</EnumValue>
        <EnumValue name="MassEmailUploadError">123 - Mass Email - Email Addresses Uploaded</EnumValue>
        <EnumValue name="MassEmailReceipt">124 - Mass Email Receipt</EnumValue>
        <EnumValue name="OcrInsuranceCardScannerError">125 - eClipboard - OCR insurance card scanner error</EnumValue>
        <EnumValue name="PearlSentImage">126 - Pearl - Image uploaded to Pearl API. Only logged once a day per clinic.</EnumValue>
        <EnumValue name="AppLoaded">127 - Web Sched - The application loaded without issue</EnumValue>
        <EnumValue name="VerificationMethodSelected">128 - Web Sched - User selected a two-factor authentication method</EnumValue>
        <EnumValue name="InsuranceInfoPresented">129 - Web Sched - User arrived at the insurance information view</EnumValue>
        <EnumValue name="ApptReasonSelected">130 - Web Sched - User selected an appointment reason</EnumValue>
        <EnumValue name="ApptConfirmPresented">131 - Web Sched - User prompted to confirm appointment details</EnumValue>
        <EnumValue name="ApptConfirmAttempted">132 - Web Sched - User confirmed their appointment details</EnumValue>
        <EnumValue name="ScheduleAnotherAppt">133 - Web Sched - User chose to schedule another appointment</EnumValue>
        <EnumValue name="ODTouchDeviceEnabled">134 - ODTouch - A device was updated.</EnumValue>
        <EnumValue name="ODTouchDeviceDisabled">135 - ODTouch - A device was updated.</EnumValue>
        <EnumValue name="MobileDeviceAdded">136 - Device Manager - A mobile device was added.</EnumValue>
        <EnumValue name="MobileDeviceDeleted">137 - Device Manager - A mobile device was deleted.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="KeyType" type="smallint(6)">
      <summary>Enum:FKeyType</summary>
      <Enumeration name="FKeyType">
        <summary>Type associated with FKey value.</summary>
        <EnumValue name="Undefined">0 Undefined.</EnumValue>
        <EnumValue name="ApptNum">1 Appointment Number.</EnumValue>
        <EnumValue name="PayNum">2 Payment Number.</EnumValue>
        <EnumValue name="SheetNum">3 Sheet Number.</EnumValue>
        <EnumValue name="UtmNum">4 Utm Number.</EnumValue>
        <EnumValue name="WebFormSheetID">5 Web Form Sheet Number.</EnumValue>
        <EnumValue name="SmsMtSentNum">6 SmsMtSent Number</EnumValue>
        <EnumValue name="SmsMtTerminatedNum">7 SmsMtTerminated Number</EnumValue>
        <EnumValue name="EFormNum">8 EForm Number.</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="LogGuid" type="varchar(36)">
      <summary>Guid for logging actions with no associated PatNum.</summary>
    </column>
    <column order="7" name="ClinicNum" type="bigint(20)">
      <summary>Clinic Number.</summary>
    </column>
    <column order="8" name="FKey" type="bigint(20)">
      <summary>FKey for given type.</summary>
    </column>
    <column order="9" name="DateTimeUploaded" type="datetime">
      <summary>The time this log was uploaded.</summary>
    </column>
    <column order="10" name="Note" type="varchar(255)">
      <summary>Additional information for the log. This is intentionally limited to 255 characters to prevent bloat.
            Add any new uses of this field to the list below. Provide the eServiceAction types and what the Note field represents for those types.
            PPPaymentCreatedByXWeb:				The amount of the payment.
            PPPaymentCreatedByPayconnect:	The amount of the payment.
            PPOpenedHostedPaymentForm:			The name of the merchant service that the hosted payment form belongs to.</summary>
    </column>
  </table>
  <table name="eserviceshortguid">
    <summary>For example, links a statement to a specific MsgToPay. ShortGuids are usually generated at ODHQ.</summary>
    <column order="0" name="EServiceShortGuidNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EServiceCode" type="varchar(255)">
      <summary>Enum:eServiceCode EService that this short GUID applies to.</summary>
      <Enumeration name="eServiceCode">
        <summary>Used by EServiceSignal.ServiceCode. Each service will have an entry here. Stored as an int for forward compatibility.</summary>
        <EnumValue name="Undefined">0 - Should not be used. If you are seeing this then an entry was made incorrectly.</EnumValue>
        <EnumValue name="ListenerService">1 - Runs 1 instance per customer on a given client PC.</EnumValue>
        <EnumValue name="IntegratedTexting">2 - Runs 1 instance total on HQ server.</EnumValue>
        <EnumValue name="HQProxyService">3 - Runs 1 instance total on HQ server.</EnumValue>
        <EnumValue name="MobileWeb">4 - EService WebApp.</EnumValue>
        <EnumValue name="PatientPortal">5 - EService WebApp.</EnumValue>
        <EnumValue name="WebSched">6 - EService WebApp. The "Recall" version of Web Sched.</EnumValue>
        <EnumValue name="WebForms">7 - EService WebApp.</EnumValue>
        <EnumValue name="ResellerPortal">8 - EService WebApp.</EnumValue>
        <EnumValue name="FeaturePortal">9 - EService WebApp.</EnumValue>
        <EnumValue name="ConfirmationRequest">10 - EService WebApp.</EnumValue>
        <EnumValue name="OAuth">11 - EService WebApp.</EnumValue>
        <EnumValue name="FHIR">12 - RESTful API from HL7.</EnumValue>
        <EnumValue name="WebSchedNewPatAppt">13 - EService WebApp. The "New Patient Appointment" version of Web Sched.</EnumValue>
        <EnumValue name="HQManager">14 - HQ only WebApp. Allows HQ to remotely modify web services.</EnumValue>
        <EnumValue name="Bundle">15 - Entitles this practice/clinic to all eServices. Supercedes any other repeat charges for this practice/clinic.</EnumValue>
        <EnumValue name="IntegratedTextingUsage">16 - IntegratedTexting is the actual enum value for texting access.  This value is for the usage portion.
            Not used in billing, mainly used to keep technicians from manually adding the "TextUse" procedure code as a repeating charge.</EnumValue>
        <EnumValue name="ResellerSoftwareOnly">17 - Resellers need to be able to give this service (not technically an eService) to their customers via sign up portal.</EnumValue>
        <EnumValue name="SignupPortal">18 - Denotes the SignupPortal web app.  Only currently used to get a new URL path separate from FeaturePortal.</EnumValue>
        <EnumValue name="SoftwareUpdate">19 - Used by WebServiceCustomerUpdate to ask WebServiceHQ if this RegKey is eligible for OD proper version updates.</EnumValue>
        <EnumValue name="WebSchedASAP">20 - EService Web App. The "ASAP" version of Web Sched.</EnumValue>
        <EnumValue name="BugSubmission">21 - Request made to store information about unhandled exceptions</EnumValue>
        <EnumValue name="PatientPortalMakePayment">22 - </EnumValue>
        <EnumValue name="PatientPortalViewStatement">23 - </EnumValue>
        <EnumValue name="WebHostSynch">24 - </EnumValue>
        <EnumValue name="Headmaster">25 - Monitoring app used by OD HQ.</EnumValue>
        <EnumValue name="EClipboard">26 - EClipboard mobile application.</EnumValue>
        <EnumValue name="ODHelp">27 - Displays Help information.</EnumValue>
        <EnumValue name="PaySimple">28- Originally for paysimple ACH payments</EnumValue>
        <EnumValue name="CustomerVersion">29 - Used for storing customers OD software versions.</EnumValue>
        <EnumValue name="ConfirmationOwn">30 - eServiceCode that corresponds to ProcCode 045 in customers db at HQ. Not used for eService validation. Use ConfirmationRequest insted.</EnumValue>
        <EnumValue name="IntegratedTextingOwn">31 - eServiceCode that corresponds to ProcCode 046 in customers db at HQ. Not used for eService validation. Use IntegratedTexting insted.</EnumValue>
        <EnumValue name="SoftwareOnly">32 - eServiceCode that corresponds to ProcCode 030 in customers db at HQ. Not used for eService validation.</EnumValue>
        <EnumValue name="SupplementalBackup">33</EnumValue>
        <EnumValue name="EmailMassUsage">34 - Will have a $0 RepeatCharge. Procedure will be generated each month as a function of number of masss email messages sent. Each email message has an incremental cost.</EnumValue>
        <EnumValue name="EmailSecureUsage">35 - Will have a $0 RepeatCharge. Procedure will be generated each month as a function of number of secure email messages sent. Each email message has an incremental cost.</EnumValue>
        <EnumValue name="EmailSecureAccess">36 - Has a RepeatCharge. Clinics sign up for access to use secure email. Each email sent will be charged an additional fee, see EmailSecureUsage.</EnumValue>
        <EnumValue name="ApptThankYou">37 - eService for Automated Appointment Thank-Yous and calendar events.</EnumValue>
        <EnumValue name="OregonCryo">38.</EnumValue>
        <EnumValue name="EserviceLog">39 - eServices logging service.</EnumValue>
        <EnumValue name="LicenseAgreementSig">40 - Used for storing customers license agreement acceptance signature. </EnumValue>
        <EnumValue name="WebFormManager">41 - A Windows service running at HQ that is monitored by Headmaster.</EnumValue>
        <EnumValue name="ODTouch">42 - Eclipboard Clinical Mobile application. Not included in the bundle.</EnumValue>
        <EnumValue name="PaymentPortalUI">43 - Payment Portal UI.</EnumValue>
        <EnumValue name="PaymentPortalApi">44 - Payment Portal Api.</EnumValue>
        <EnumValue name="EServiceApi">45 - EService Api.</EnumValue>
        <EnumValue name="AuthApi">46 - Auth Api.</EnumValue>
        <EnumValue name="ODTSurplus">47 - ODTouch Mobile application surcharge for additional devices that exceed the ODTouchDeviceLimitDefault pref.</EnumValue>
        <EnumValue name="OCR">48 - OCR Scans</EnumValue>
        <EnumValue name="UrlRedirect">49 - Used by ShortGuidLookup to redirect from an OD-generated Short URL to a long URL provided by customer.</EnumValue>
        <EnumValue name="DeveloperPortalApi">50 - Developer Portal API</EnumValue>
        <EnumValue name="DeveloperPortalUI">51 - Developer Portal UI</EnumValue>
        <EnumValue name="EmailHqService">52 - Email Transmission HQ Service</EnumValue>
        <EnumValue name="BetterDiagnostics">53 - Better Diagnostics AI. Not included in the bundle.</EnumValue>
        <EnumValue name="EmailMassAccess">54 - eService for Mass email signup. Not included in the bundle.</EnumValue>
        <EnumValue name="WebSchedExistingPatientUI">55 - Web Sched Existing Patient UI</EnumValue>
        <EnumValue name="WebSchedExistingPatientApi">56 - Web Sched Existing Patient Api</EnumValue>
        <EnumValue name="Chat"> 57 - xChatService api </EnumValue>
        <EnumValue name="TranscriptionAI">58 - AI transcription eService used for issuing and validating short-live authorization tokens for transcription socket connections.</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="ShortGuid" type="varchar(255)">
      <summary>A unique alphanumeric string that identifies something.</summary>
    </column>
    <column order="3" name="ShortURL" type="varchar(255)">
      <summary>URL generated by HQ.</summary>
    </column>
    <column order="4" name="FKey" type="bigint(20)">
      <summary>Usually identifies the object that is linked to ShortGUID.</summary>
    </column>
    <column order="5" name="FKeyType" type="varchar(255)">
      <summary>Describes the type of object referenced by the FKey.</summary>
    </column>
    <column order="6" name="DateTimeExpiration" type="datetime">
      <summary>Timestamp at which this short GUID will expire..</summary>
    </column>
    <column order="7" name="DateTEntry" type="datetime">
      <summary>The exact server time when this EServiceShortGuid was entered into db.  Handled automatically.</summary>
    </column>
  </table>
  <table name="eservicesignal">
    <summary>Communication item from workstation to OD HQ. Stores the statuses of the eConnector and other eServices. </summary>
    <column order="0" name="EServiceSignalNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ServiceCode" type="int(11)">
      <summary>Enum eServiceCode. Service which this signal applies to.</summary>
    </column>
    <column order="2" name="ReasonCategory" type="int(11)">
      <summary>The enum is at HQ as OpenDentalWebCore.BroadcasterThreadDefs. Can be zero if no grouping is necessary per a given service.</summary>
    </column>
    <column order="3" name="ReasonCode" type="int(11)">
      <summary>The enum is at HQ as OpenDentalWebCore.BroadcasterErrorCodes. This code is used to determine what actions to take and how to process this message. 
            It is a function of ReasonCategory. It will most likely be defined by an enum that lives on HQ-only closed source.</summary>
    </column>
    <column order="4" name="Severity" type="tinyint(4)">
      <summary>Enum:eServiceSignalSeverity </summary>
      <Enumeration name="eServiceSignalSeverity">
        <summary>Used to determine that status of the entire service.  Order of enum is important, from lowest to highest importance.</summary>
        <EnumValue name="None">Service is not in use and is not supposed to be in use.</EnumValue>
        <EnumValue name="NotEnabled">0-Service is not in use and is not supposed to be in use.</EnumValue>
        <EnumValue name="Info">1-Used to convey information. Does not change the "working" status of the service. Will always be inserted with IsProcess=true.</EnumValue>
        <EnumValue name="Working">2-Service is operational and working as designed. Typcially used for heartbeat and initialization.</EnumValue>
        <EnumValue name="Warning">3-Recoverable error has has occurred and no user intervention is required. Typically requires user acknowledgement only.</EnumValue>
        <EnumValue name="Error">4-Recoverable error has has occurred and user intervention is probably required in addition to user acknowledgement only.</EnumValue>
        <EnumValue name="Critical">5-Unrecoverable error and the service has shut itself off. Immediate user intervention is required.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="Description" type="text">
      <summary>Human readable description of what this signal means, or a message for the user.</summary>
    </column>
    <column order="6" name="SigDateTime" type="datetime">
      <summary>Time signal was sent.</summary>
    </column>
    <column order="7" name="Tag" type="text">
      <summary>Used to store serialized data that can be used for processing this signal.</summary>
    </column>
    <column order="8" name="IsProcessed" type="tinyint(4)">
      <summary>After a message has been processed or acknowledged this is set true. Not currently used for heartbeat or service status signals.</summary>
    </column>
  </table>
  <table name="etrans">
    <summary>One electronic transaction.  Typically, one claim or response.  Or one benefit request or response.  Is constantly being expanded to include more types of transactions with clearinghouses.  Also stores printing of paper claims.  Sometimes stores a copy of what was sent.</summary>
    <column order="0" name="EtransNum" type="bigint(20)">
      <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="bigint(20)" 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 physically printed.</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. V02 type 10.</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>
        <EnumValue name="BenefitInquiry270">24 X12-270.</EnumValue>
        <EnumValue name="BenefitResponse271">25 X12-271</EnumValue>
        <EnumValue name="AckError">26 When an electronic transmission is sent, and an error comes back instead of a message.  This stores information about the error.  The etrans with this type is attached it to the original etrans as an ack.</EnumValue>
        <EnumValue name="ERA_835">27 X12-835. Electronic Remittance Advice (ERA).  Also known an an electronic EOB.</EnumValue>
        <EnumValue name="Acknowledge_999">28 Ack from clearinghouse. X12-999.</EnumValue>
        <EnumValue name="Ack_Interchange">29 Simple and generic ack from clearinghouse which is used to replace 997s, 999s, or 277s.</EnumValue>
        <EnumValue name="Claim_Ramq">30 Carrier RAMQ located in Quebec Canada.</EnumValue>
        <EnumValue name="ItransNcpl">31 Canadian iTrans 2.0 users can download carrier information.</EnumValue>
        <EnumValue name="HTML">32 HTML response from clearinghouse.  Usually in addition to a 271 used to import benefits.</EnumValue>
        <EnumValue name="DXCAttachments">33 DXC Attachments. We make etrans entries for all communication with DXC's API.</EnumValue>
        <EnumValue name="Attachment_CA">34 Canada.  Type 09.</EnumValue>
        <EnumValue name="AttachmentAck_CA">35 Canada.  Type 19.</EnumValue>
        <EnumValue name="Claim_XConnect">36 DentalXChange XConnect Claim.</EnumValue>
        <EnumValue name="ClaimAck_XConnect">37 DentalXChange XConnect Claim Ack.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ClaimNum" type="bigint(20)" 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. Uncapped, but is modded by 1,000,000 when sent in a transaction as required by the standard.</summary>
    </column>
    <column order="6" name="CarrierTransCounter" type="int(11)">
      <summary>For Canada. Separate counter for each carrier. Uncapped, but is modded by 100,000 when sent in a transaction as required by the standard.</summary>
    </column>
    <column order="7" name="CarrierTransCounter2" type="int(11)">
      <summary>For Canada. Separate counter for each carrier. Uncapped, but is modded by 100,000 when sent in a transaction as required by the standard. If this claim includes secondary, then this is the counter for the secondary carrier.</summary>
    </column>
    <column order="8" name="CarrierNum" type="bigint(20)" fk="carrier">
      <summary>FK to carrier.CarrierNum.</summary>
    </column>
    <column order="9" name="CarrierNum2" type="bigint(20)" 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="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum 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="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="12" name="AckCode" type="varchar(255)">
      <summary>A=Accepted, R=Rejected, blank if not able to parse, Recd=Received (835s only).  More options will be added later.  The incoming 997 or 999 sets this flag automatically.  To find the 997 or 999, look for a matching BatchNumber with a similar date, since both the claims and the 997 or 999 will both have the same batch number.  The 997 or 999 does not have this flag set on itself.</summary>
    </column>
    <column order="13" 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 and 999s 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 or 999, because one 997 or 999 refers to multiple trans sets.</summary>
    </column>
    <column order="14" name="Note" type="text">
      <summary>Typical uses include indicating that the report was printed, the claim was resent, reason for rejection, etc.  For a 270, this contains the automatically generated short summary of the response.  The response could include the reason for failure, or it could be a short summary of the 271.</summary>
    </column>
    <column order="15" name="EtransMessageTextNum" type="bigint(20)" fk="etransmessagetext">
      <summary>FK to etransmessagetext.EtransMessageTextNum.  Can be 0 if there is no message text.  Multiple Etrans objects can refer to the same message text, very common in a batch.</summary>
    </column>
    <column order="16" name="AckEtransNum" type="bigint(20)" fk="etrans">
      <summary>FK to etrans.EtransNum.  Only has a non-zero value if there exists an ack etrans, like a 997, 999, 277ack, 271, 835, or ackError.
            There can be only one ack for any given etrans, but one ack can apply to multiple etran's that were sent as one batch.
            999 FK can be replaced by 277ack FK, and then by 835 FK.  This column does triple duty.
            The AckEtransNum can be used to chain together related etrans entries.  For example,
            if this is a 270 request, then AckEtransNum points to the 271 response.
            If this is a 271, then AckEtransNum points to the HTML (if any) for the response.</summary>
    </column>
    <column order="17" name="PlanNum" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum.  Used if EtransType.BenefitInquiry270 and BenefitResponse271 and Eligibility_CA.</summary>
    </column>
    <column order="18" name="InsSubNum" type="bigint(20)" fk="inssub">
      <summary>FK to inssub.InsSubNum.  Used if EtransType.BenefitInquiry270 and BenefitResponse271 and Eligibility_CA.</summary>
    </column>
    <column order="19" name="TranSetId835" type="varchar(255)">
      <summary>X12 ST02 Transaction Set Identifier for an 835.  Specifies the unique transaction id within the 835 that this etrans record corresponds to.  This column will always be set for 835s imported in version 14.3 or greater.  For 835s imported in version 14.2, this column will alway be blank.  If blank, and there is more than one transaction id within the 835, then FormEtrans835PickEob will show and allow the user to select the desired EOB from a list.  The X12 guide states that there is only one transaction (EOB) allowed per 835, but ClaimConnect returns multiple transactions (EOBs) within a single 835 and other clearinghouses probably do as well.  When an 835 is imported, it is examined to determine the number of transactions within it.  One etrans entry is created for each EOB within the 835.  We may have a similar issue with multiple transactions within 277s as well, but we have not seen any evidence yet.  Our current 277 implementation expects a single transaction, just as the X12 standard specifies.</summary>
    </column>
    <column order="20" name="CarrierNameRaw" type="varchar(60)">
      <summary>Only used if the CarrierNum is 0.  If CarrierNum is not 0, the name associated to CarrierNum will override
            CarrierNameRaw in the FormClaimsSend history grid.  Added for 835s so that customer databases are not cluttered with dummy carriers and
            so there is no extra processing time when FormClaimsSend is loading.  Size is 60 bytes to match 835 carrier name length.</summary>
    </column>
    <column order="21" name="PatientNameRaw" type="varchar(133)">
      <summary>Only used if the PatNum is 0.  If PatNum is not 0, the name associated to PatNum will override PatientNameRaw
            in the FormClaimsSend history grid.  Added for 835s so that there is no extra processing time when FormClaimsSend is loading,
            and so text representing the patient count can be used instead of an actual patient name.  Size is 133 bytes to match X12 specs for 
            last name (60), first name (35), middle name (25), suffix (10), and spaces in between (3).</summary>
    </column>
    <column order="22" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum</summary>
    </column>
  </table>
  <table name="etrans835">
    <summary>Corresponds to an etrans record containing a raw 835 X12 message attached in etransmessagetext table.  This is denoted by etrans.Etype=ERA_835</summary>
    <column order="0" name="Etrans835Num" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EtransNum" type="bigint(20)" fk="etrans">
      <summary>FK to etrans.EtransNum .</summary>
    </column>
    <column order="2" name="PayerName" type="varchar(60)">
      <summary>Up to 60 characters.  Corresponds to X835.PayerName, a read-only field.</summary>
    </column>
    <column order="3" name="TransRefNum" type="varchar(50)">
      <summary>Up to 50 characters.  Corresponds to X835.TransRefNum, a read-only field.</summary>
    </column>
    <column order="4" name="InsPaid" type="double">
      <summary>Corresponds to X835.InsPaid, a read-only field.</summary>
    </column>
    <column order="5" name="ControlId" type="varchar(9)">
      <summary>Up to 9 characters.  Corresponds to X835.ControlId, a read-only field.</summary>
    </column>
    <column order="6" name="PaymentMethodCode" type="varchar(3)">
      <summary>Up to 3 characters.  Corresponds to X835._paymentMethodCode, a read-only field.</summary>
    </column>
    <column order="7" name="PatientName" type="varchar(100)">
      <summary>Up to 100 characters (not based on actual patient name field sizes).
            Corresponds to Hx835_Claim.PatientName.ToString() if one patient, or says "(#)" if multiple patients to show count.</summary>
    </column>
    <column order="8" name="Status" type="tinyint(4)">
      <summary>Enum:X835Status .  Calculated status.  Only changes when ERA changes.</summary>
      <Enumeration name="X835Status">
        <summary></summary>
        <EnumValue name="None">1 - Just a place holder if there is an issue.  Should never show in UI.</EnumValue>
        <EnumValue name="Unprocessed">2 - There are no received claims attached to the ERA.  There can be one or more detached claims on the ERA.</EnumValue>
        <EnumValue name="Partial">3 - Some claims for this ERA have had financial information entered, no finalaized claim payment.</EnumValue>
        <EnumValue name="NotFinalized">4 - Ignores manually detached.  All claims for this ERA have had financial information entered, no finalaized claim payment.</EnumValue>
        <EnumValue name="FinalizedSomeDetached">5 - Some claims have been manually detached but all other claims have had financial information entered and finalaized claim payment created.</EnumValue>
        <EnumValue name="FinalizedAllDetached">6 - All claims have been manually detached.</EnumValue>
        <EnumValue name="Finalized">7 - All claims for this ERA have had financial information entered and a finalaized claim payment was created.</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="AutoProcessed" type="tinyint(4)">
      <summary>Enum:X835AutoProcessed .  The initial disposition of ERA's that have passed through our auto/semi-auto processing system.</summary>
      <Enumeration name="X835AutoProcessed">
        <summary>The initial disposition of ERA's that have passed through our auto/semi-auto processing system.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="SemiAutoIncomplete">1</EnumValue>
        <EnumValue name="SemiAutoComplete">2</EnumValue>
        <EnumValue name="FullAutoIncomplete">3</EnumValue>
        <EnumValue name="FullAutoComplete">4</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="IsApproved" type="tinyint(4)">
      <summary>True if a user has acknowledged the auto processed ERA.</summary>
    </column>
  </table>
  <table name="etrans835attach">
    <summary>Links a specific claim within an ERA 835 to an actual claim in the claims table.</summary>
    <column order="0" name="Etrans835AttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EtransNum" type="bigint(20)" fk="etrans">
      <summary>FK to etrans.EtransNum.</summary>
    </column>
    <column order="2" name="ClaimNum" type="bigint(20)" fk="claim">
      <summary>FK to claim.ClaimNum.  Can be 0, which indicates that the ERA claim does not have a match in OD.</summary>
    </column>
    <column order="3" name="ClpSegmentIndex" type="int(11)">
      <summary>Segment index for the CLP/Claim segment within the X12 document containing the 835.
            This index is unique, even if there are multiple 835 transactions within the X12 document.</summary>
    </column>
    <column order="4" name="DateTimeEntry" type="datetime">
      <summary>DateTime that the row was inserted.</summary>
    </column>
  </table>
  <table name="etransmessagetext">
    <summary>Each row is big.  The entire X12 message text is stored here, since it can be the same for multiple etrans objects, and since the messages can be so big.</summary>
    <column order="0" name="EtransMessageTextNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MessageText" type="mediumtext">
      <summary>The entire message text, including carriage returns.</summary>
    </column>
  </table>
  <table name="evaluation">
    <summary>An evaluation is for one student and is copied from an EvaluationDef. There are multiple evaluations per course, which add up to the final course grade. An evaluation is for a single day and can optionally have multiple criteria on it. Evaluations get created on the day they are filled out, not ahead of time. The user would typically set up at least one evaluationDef that didn't have any criteria on it for simple situations. There is no weight yet for different evaluations, so the automatically calculated course grades will treat all evaluations with equal weight.</summary>
    <column order="0" name="EvaluationNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="InstructNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="2" name="StudentNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="3" name="SchoolCourseNum" type="bigint(20)" fk="schoolcourse">
      <summary>FK to schoolcourse.SchoolCourseNum.  For example to PEDO 732.</summary>
    </column>
    <column order="4" name="EvalTitle" type="varchar(255)">
      <summary>Copied from evaluation def.  Not editable.</summary>
    </column>
    <column order="5" name="DateEval" type="date">
      <summary>Date of the evaluation.</summary>
    </column>
    <column order="6" name="GradingScaleNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="7" name="OverallGradeShowing" type="varchar(255)">
      <summary>OverallGradeNumber is calculated as described below.  Once the nearest number on the scale is found, the corresponding gradescaleitem.GradeShowing is used here.</summary>
    </column>
    <column order="8" name="OverallGradeNumber" type="float">
      <summary>Always recalculated as each individual criterion is changed, so no risk of getting out of synch.  Only considers criteria on the evaluation that use the same grading scale as the evaluation itself.  It's an average of all those criteria.  When averaging, the result will almost never exactly equal one of the numbers in the scale, so the nearest one must be found and used here.  For example, if the average is 3.6 on a 4 point scale, this will show 4.  Percentages will be rounded to the nearest whole number.  This is the value that will be returned in reports and also used in calculations of the student's grade for the term.</summary>
    </column>
    <column order="9" name="Notes" type="text">
      <summary>Any note that the instructor wishes to place at the bottom of this evaluation.</summary>
    </column>
    <column order="10" name="GradeOverride" type="float">
      <summary>-1 by default. The override grade number entered manually by the instructor. If populated, the OverallGradeShowing is derived from this override value instead.</summary>
    </column>
  </table>
  <table name="evaluationcriterion">
    <summary>One row on an evaluation. For example, a single evaluation would be created for one patient appointment. The criteria might include things like professionalism, patient comfort, anesthesia, prep, matrix, restoration, margins, contact, contours, polish, etc. Each criterion can be assigned a grade and the evaluation gets an overall grade. For simple situations the criteria can be left blank. There is no window to edit an individual criterion. That's done in FrmEvaluationEdit in the grid.</summary>
    <column order="0" name="EvaluationCriterionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EvaluationNum" type="bigint(20)" fk="evaluation">
      <summary>FK to evaluation.EvaluationNum</summary>
    </column>
    <column order="2" name="CriterionDescript" type="varchar(255)">
      <summary>Description that is displayed for the criterion.</summary>
    </column>
    <column order="3" name="IsCategoryName" type="tinyint(4)">
      <summary>This row will show in bold and will not have a grade attached to it.</summary>
    </column>
    <column order="4" name="GradingScaleNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="5" name="GradeShowing" type="varchar(255)">
      <summary>Copied from gradingscaleitem.GradeShowing.  Required.  For example A, B, C, D, F, or 1-10, pass, fail, 89, etc.  Except for percentages, must come from pick list.</summary>
    </column>
    <column order="6" name="GradeNumber" type="float">
      <summary>Copied from gradingscaleitem.GradeNumber.  Required.  For example A=4, A-=3.8, pass=1, percentages stored as 89, etc.  Except for percentages, must come from pick list.</summary>
    </column>
    <column order="7" name="Notes" type="text">
      <summary>A note about why this student received this particular grade on this criterion.</summary>
    </column>
    <column order="8" name="ItemOrder" type="int(11)">
      <summary>Copied from item order of def.  Defines the order that all the criteria show on the evaluation.  User not allowed to change here, only in the def.</summary>
    </column>
    <column order="9" name="MaxPointsPoss" type="float">
      <summary>For ScaleType=Points, sets the maximum value of points for this criterion.</summary>
    </column>
  </table>
  <table name="evaluationcriteriondef">
    <summary>One row on an EvaluationDef. The criteria might include things like professionalism, patient comfort, anesthesia, prep, matrix, restoration, margins, contact, contours, polish, etc. For simple situations the criteria can be left blank.</summary>
    <column order="0" name="EvaluationCriterionDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EvaluationDefNum" type="bigint(20)" fk="evaluationdef">
      <summary>FK to evaluationdef.EvaluationDefNum.</summary>
    </column>
    <column order="2" name="CriterionDescript" type="varchar(255)">
      <summary>Description that is displayed for the criterion.</summary>
    </column>
    <column order="3" name="IsCategoryName" type="tinyint(4)">
      <summary>This row will show in bold and will not have a grade attached to it.</summary>
    </column>
    <column order="4" name="GradingScaleNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary>Defines the order that all the criteria show on the evaluation.  Copied to ItemOrder of actual criterion.</summary>
    </column>
    <column order="6" name="MaxPointsPoss" type="float">
      <summary>For ScaleType=Points, sets the maximum value of points for this criterion.</summary>
    </column>
  </table>
  <table name="evaluationdef">
    <summary>An evaluation def is the entire form that the instructor sets up ahead of time.  Actual evaluations for students are copied from these 'templates', so an evaluation def can be altered or deleted without damaging any student record.  Evaluation defs are usually not specific to instructors, but if different instructors want different evaluation forms, they can use the description column to differentiate.  For example, the description can include the instructor's name or even the year.  But most commonly, the same evaluation will be used from year to year.  There should be a duplicate function to make a copy an entire evaluation def and then allow user to alter the SchoolCourseNum.</summary>
    <column order="0" name="EvaluationDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SchoolCourseNum" type="bigint(20)" fk="schoolcourse">
      <summary>FK to schoolcourse.SchoolCourseNum. Will be 0 when the evaluation def is for a course def.</summary>
    </column>
    <column order="2" name="EvalTitle" type="varchar(255)">
      <summary>Description of this evaluation form.</summary>
    </column>
    <column order="3" name="GradingScaleNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="4" name="SchoolCourseDefNum" type="bigint(20)" fk="schoolcoursedef">
      <summary>FK to schoolcoursedef.SchoolCourseNum. Will be 0 when the evaluation def is for a course.</summary>
    </column>
  </table>
  <table name="famaging">
    <summary>This table stores intermediate family aged balances just prior to updating the patient table.  Once the aging calculations are finished
            and the patient table is updated, this table is truncated.  At the start of the aging calculations this table is checked and if there are existing
            rows, we will notify the user and force them to decide whether an aging calculation has already begun or an error happened that prevented the
            calculations from finishing and the rows are left over and can be deleted.</summary>
    <column order="0" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Also the primary key for this table.  Always the PatNum for the Guarantor of a family.  A guarantor may not
            exist in this table if the family does not have a balance.  i.e. If a PatNum is not in this table, the aged balance columns on the patient table
            are set to 0, so either the patient is not the guarantor or the family has a zero balance.</summary>
    </column>
    <column order="1" name="Bal_0_30" type="double">
      <summary>Aged balance from 0 to 30 days old. Aging numbers are for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="2" name="Bal_31_60" type="double">
      <summary>Aged balance from 31 to 60 days old. Aging numbers are for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="3" name="Bal_61_90" type="double">
      <summary>Aged balance from 61 to 90 days old. Aging numbers are for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="4" name="BalOver90" type="double">
      <summary>Aged balance over 90 days old. Aging numbers are for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="5" name="InsEst" type="double">
      <summary>Insurance Estimate for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="6" name="BalTotal" type="double">
      <summary>Total balance for entire family before insurance estimate.  Not the same as the sum of the 4 aging balances because this can be 
            negative.  Only stored with guarantor.</summary>
    </column>
    <column order="7" name="PayPlanDue" type="double">
      <summary>Amount "due now" for all payment plans such that someone in this family is the payment plan guarantor.  
            This is the total of all payment plan charges past due (taking into account the PayPlansBillInAdvanceDays setting) subtract the amount 
            already paid for the payment plans.  Only stored with family guarantor.</summary>
    </column>
  </table>
  <table name="familyhealth">
    <summary>For EHR, this lets us record medical problems for family members.  These family members will usually not be in our database, and they are just recorded by relationship.</summary>
    <column order="0" name="FamilyHealthNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="Relationship" type="tinyint(4)">
      <summary>Enum:FamilyRelationship </summary>
      <Enumeration name="FamilyRelationship">
        <summary></summary>
        <EnumValue name="Parent">0</EnumValue>
        <EnumValue name="Sibling">1</EnumValue>
        <EnumValue name="Offspring">2</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="DiseaseDefNum" type="bigint(20)" fk="diseasedef">
      <summary>FK to diseasedef.DiseaseDefNum, which will have a SnoMed associated with it.</summary>
    </column>
    <column order="4" name="PersonName" type="varchar(255)">
      <summary>Name of the family member.</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="bigint(20)">
      <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 shown in the user interface as a blank entry.
            For clinic and/or provider fees, amount can be set to -1 which indicates that their fee should be blank and not use the default fee.</summary>
    </column>
    <column order="2" name="OldCode" type="varchar(15)">
      <summary>Do not use.</summary>
    </column>
    <column order="3" name="FeeSched" type="bigint(20)" fk="feesched">
      <summary>FK to feesched.FeeSchedNum.</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="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum.</summary>
    </column>
    <column order="7" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Must be 0 if feesched.IsGlobal=true.</summary>
    </column>
    <column order="8" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Must be 0 if feesched.IsGlobal=true.</summary>
    </column>
    <column order="9" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Gets set automatically to the user logged in when the row is inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="10" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="11" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="12" name="DateEffective" type="date">
      <summary>The date when the Fee is valid. Most users will have their fees with empty dates (0001-01-01) meaning their fees are always valid. This lets user enter a fee schedule ahead of an effective date. When we show fees to the user in areas where there is no date filter, we use today as the dateEffective. We don't show future fees in those areas.</summary>
    </column>
  </table>
  <table name="feesched">
    <summary>Fee schedule names used to be in the definition table, but now they have their own table.  We are about to have many many more fee schedules as we start automating allowed fees.</summary>
    <column order="0" name="FeeSchedNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>The name of the fee schedule.</summary>
    </column>
    <column order="2" name="FeeSchedType" type="int(11)">
      <summary>Enum:FeeScheduleType </summary>
      <Enumeration name="FeeScheduleType">
        <summary></summary>
        <EnumValue name="Normal">0</EnumValue>
        <EnumValue name="CoPay">1</EnumValue>
        <EnumValue name="OutNetwork">2, Formerly named "Allowed"</EnumValue>
        <EnumValue name="FixedBenefit">3</EnumValue>
        <EnumValue name="ManualBlueBook">4</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="ItemOrder" type="int(11)">
      <summary>Unlike with the old definition table, this ItemOrder is not as critical in the caching of data.  The item order is only for fee schedules of the same type.</summary>
    </column>
    <column order="4" name="IsHidden" type="tinyint(1)">
      <summary>True if the fee schedule is hidden.  Can't delete fee schedules or change their type once created.</summary>
    </column>
    <column order="5" name="IsGlobal" type="tinyint(4)">
      <summary>True if the fee schedule is used globally and linked to the HQ. Localization of the fees is not allowed. ClinicNum and ProvNum must both be zero for all fees.</summary>
    </column>
    <column order="6" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="7" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="8" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
  </table>
  <table name="feeschedgroup">
    <summary>Can be used when using clinics, and a single fee schedule has fees that are region specific and need to be different for different clinics. A FeeSchedGroup stores a list of clinics that one fee schedule applies to, overriding the normal fee sched. This is designed so that you can have a few "groups" per fee sched instead of dozens or hundreds of clinics. Fees are still created on a per-clinic basis, and we attempt to manage them when we do things like change fees or edit groups.</summary>
    <column order="0" name="FeeSchedGroupNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="2" name="FeeSchedNum" type="bigint(20)" fk="feesched">
      <summary>FK to FeeSched.FeeSchedNum.</summary>
    </column>
    <column order="3" name="ClinicNums" type="varchar(255)">
      <summary>Comma delimited list of Clinic.ClinicNums.</summary>
    </column>
  </table>
  <table name="feeschednote">
    <summary>A note that is attached to a fee schedule, and can additionally be associated with a clinic too.</summary>
    <column order="0" name="FeeSchedNoteNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FeeSchedNum" type="bigint(20)" fk="feesched">
      <summary>FK to feesched.FeeSchedNum.</summary>
    </column>
    <column order="2" name="ClinicNums" type="text">
      <summary>A comma delimited list of clinic nums that the fee schedule note is for. Can include 0. For most offices this will be empty string because they do not use clinics.</summary>
    </column>
    <column order="3" name="Note" type="text">
      <summary>A note for a particular fee schedule. No character lim.</summary>
    </column>
    <column order="4" name="DateEntry" type="date">
      <summary>The date of this note. User is allowed to change this date.</summary>
    </column>
    <column order="5" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="6" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change. The actual date of entry.</summary>
    </column>
    <column order="7" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program updates. Not user editable with the UI.</summary>
    </column>
  </table>
  <table name="fhircontactpoint">
    <summary>Details of a Technology mediated contact point (phone, fax, email, etc.). https://www.hl7.org/fhir/datatypes.html#contactpoint 
            .</summary>
    <column order="0" name="FHIRContactPointNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FHIRSubscriptionNum" type="bigint(20)" fk="fhirsubscription">
      <summary>FK to fhirsubscription.FHIRSubscriptionNum.</summary>
    </column>
    <column order="2" name="ContactSystem" type="tinyint(4)">
      <summary>Enum:ContactPointSystem </summary>
      <Enumeration name="ContactPointSystem">
        <summary></summary>
        <EnumValue name="Phone">The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable
            automatic dialing support but not required.</EnumValue>
        <EnumValue name="Fax">The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support 
            but not required.</EnumValue>
        <EnumValue name="Email">The value is an email address.</EnumValue>
        <EnumValue name="Pager">The value is a pager number. These may be local pager numbers that are only usable on a particular pager system.</EnumValue>
        <EnumValue name="Other">A contact that is not a phone, fax, or email address. The format of the value SHOULD be a URL. This is intended for various personal 
            contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. If this is not a URL, then it will require human 
            interpretation.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="ContactValue" type="varchar(255)">
      <summary>The actual contact point details.</summary>
    </column>
    <column order="4" name="ContactUse" type="tinyint(4)">
      <summary>Enum:ContactPointUse </summary>
      <Enumeration name="ContactPointUse">
        <summary></summary>
        <EnumValue name="Home">A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will 
            contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts 
            are available.</EnumValue>
        <EnumValue name="Work">An office contact point. First choice for business related contacts during business hours.</EnumValue>
        <EnumValue name="Temp">A temporary contact point. The period can provide more detailed information.</EnumValue>
        <EnumValue name="Old">This contact point is no longer in use (or was never correct, but retained for records).</EnumValue>
        <EnumValue name="Mobile">A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent 
            matters, not the first choice for routine business.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary>Specify preferred order of use (1 = highest)</summary>
    </column>
    <column order="6" name="DateStart" type="date">
      <summary>Time when the contact point started to be in use.</summary>
    </column>
    <column order="7" name="DateEnd" type="date">
      <summary>Timewhen the contact point stopped being used.</summary>
    </column>
  </table>
  <table name="fhirsubscription">
    <summary>A subscription by a client that requests an alert whenever a change is made to a FHIR resource.</summary>
    <column order="0" name="FHIRSubscriptionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Criteria" type="varchar(255)">
      <summary>Rule for server push criteria.</summary>
    </column>
    <column order="2" name="Reason" type="varchar(255)">
      <summary>Description of why this subscription was created.</summary>
    </column>
    <column order="3" name="SubStatus" type="tinyint(4)">
      <summary>Enum:SubscriptionStatus </summary>
      <Enumeration name="SubscriptionStatus">
        <summary>The status of a Subscription. https://www.hl7.org/fhir/valueset-subscription-status.html </summary>
        <EnumValue name="Requested">The client has requested the subscription, and the server has not yet set it up.</EnumValue>
        <EnumValue name="Active">The subscription is active.</EnumValue>
        <EnumValue name="Error">The server has an error executing the notification.</EnumValue>
        <EnumValue name="Off">Too many errors have occurred or the subscription has expired.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ErrorNote" type="text">
      <summary>Latest error note.</summary>
    </column>
    <column order="5" name="ChannelType" type="tinyint(4)">
      <summary>Enum:SubscriptionChannelType </summary>
      <Enumeration name="SubscriptionChannelType">
        <summary>Only rest_hook is supported by Open Dental FHIR. https://www.hl7.org/fhir/valueset-subscription-channel-type.html </summary>
        <EnumValue name="Rest_Hook">The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an 
            update (PUT) is made.</EnumValue>
        <EnumValue name="Websocket">The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the 
            websocket, and the client binds to this URL.</EnumValue>
        <EnumValue name="Email">	The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:).</EnumValue>
        <EnumValue name="Sms">The channel is executed by sending an SMS message to the phone number identified in the URL (tel:).</EnumValue>
        <EnumValue name="Message">	The channel is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc.) to the application identified in 
            the URI.</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="ChannelEndpoint" type="varchar(255)">
      <summary>Where the channel points to.</summary>
    </column>
    <column order="7" name="ChannelPayLoad" type="varchar(255)">
      <summary>Mimetype to send, or blank for no payload.</summary>
    </column>
    <column order="8" name="ChannelHeader" type="varchar(255)">
      <summary>Usage depends on the channel type.</summary>
    </column>
    <column order="9" name="DateEnd" type="datetime">
      <summary>When to automatically delete the subscription.</summary>
    </column>
    <column order="10" name="APIKeyHash" type="varchar(255)">
      <summary>A hash of the API key that was used in the request to create this subscription.</summary>
    </column>
  </table>
  <table name="fielddeflink">
    <summary>A better name would be FieldHide. This specifies places where PatFields or ApptFields should be hidden. PatFieldDefs already have an IsHidden field, so this is redundant there. But it's powerful for letting PatFields show in some places but not other places.</summary>
    <column order="0" name="FieldDefLinkNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="FieldDefNum" type="bigint(20)">
      <summary>A generic FieldDefNum FK to any particular field def item that will be defined by the FieldDefType column.</summary>
    </column>
    <column order="2" name="FieldDefType" type="tinyint(4)">
      <summary>Enum:FieldDefTypes Defines what FieldDefNum represents.</summary>
      <Enumeration name="FieldDefTypes">
        <summary>Enum representing different types of field defs.</summary>
        <EnumValue name="Appointment">0</EnumValue>
        <EnumValue name="Patient">1</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FieldLocation" type="tinyint(4)">
      <summary>Enum:FieldLocations Defines where this particular field def needs to be hidden.</summary>
      <Enumeration name="FieldLocations">
        <summary>Enum representing where the field def should be hidden.</summary>
        <EnumValue name="Account">0</EnumValue>
        <EnumValue name="AppointmentEdit">1</EnumValue>
        <EnumValue name="Chart">2</EnumValue>
        <EnumValue name="Family">3</EnumValue>
        <EnumValue name="OrthoChart">4</EnumValue>
        <EnumValue name="GroupNote">5</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="formpat">
    <summary>This is an old table that isn't really used anymore. We used to have a "questionnaire" that could be filled out by a patient, and this is it.  Each patient can have multiple questionnaires.</summary>
    <column order="0" name="FormPatNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" 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="gradingscale">
    <summary>Used in Evaluations.  Describes a scale to be used in grading.  Freeform scales are not allowed.  Percentage scales are handled a little differently than the other scales.</summary>
    <column order="0" name="GradingScaleNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>For example, A-F or Pass/Fail.</summary>
    </column>
    <column order="2" name="ScaleType" type="tinyint(4)">
      <summary>Enum:EnumScaleType Used to determine method of assigning grades.  PickList will be the only type that has GradingScaleItems.</summary>
      <Enumeration name="EnumScaleType">
        <summary>Used in GradingScale to determine how grades are assigned.</summary>
        <EnumValue name="PickList">0- User-Defined list of possible grades.  Grade is calculated as an average.</EnumValue>
        <EnumValue name="Percentage">1- Percentage Scale 0-100.  Grade is calculated as an average.</EnumValue>
        <EnumValue name="Weighted">2- Allows point values for grades.  Grade is calculated as a sum of all points out of points possible.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="gradingscaleitem">
    <summary>Only used when GradingScale.ScaleType=PickList, not Percentage or Points.  The specific grades allowed on a scale.  Contains both the GradeShowing and the equivalent number.  There are no FKs to these items.  The values are all copied from here into student records as they are used.</summary>
    <column order="0" name="GradingScaleItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="GradingScaleNum" type="bigint(20)" fk="gradingscale">
      <summary>FK to gradingscale.GradingScaleNum</summary>
    </column>
    <column order="2" name="GradeShowing" type="varchar(255)">
      <summary>For example A, B, C, D, F.  Optional.  If not specified, it shows the number.</summary>
    </column>
    <column order="3" name="GradeNumber" type="float">
      <summary>For example A=4, A-=3.8, pass=1, etc.  Required.  Enforced to be equal to or less than GradingScale.MaxPointsPoss.</summary>
    </column>
    <column order="4" name="Description" type="varchar(255)">
      <summary>Optional additional info about what this particular grade means.  Just used as guidance and does not get copied to the individual student record.</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="bigint(20)">
      <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="bigint(20)" 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="smallint(6)">
      <summary>Enum:EnumPermType Some permissions will treat a zero FKey differently. Some denote it as having access to everything for that PermType. I.e. Reports.</summary>
      <Enumeration name="EnumPermType">
        <summary>A hard-coded list of permissions which may be granted to usergroups.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="AppointmentsModule">1-No log entry.</EnumValue>
        <EnumValue name="FamilyModule">2-A Security Log entry is made each time that the Family module button is clicked, as well as each time that the selected patient is changed while within the Family module. If the preference AuditTrailVisitModuleShow is set to false then no entries are created.</EnumValue>
        <EnumValue name="AccountModule">3-Same behavior as FamilyModule.</EnumValue>
        <EnumValue name="TPModule">4-Same behavior as FamilyModule.</EnumValue>
        <EnumValue name="ChartModule">5-Same behavior as FamilyModule.</EnumValue>
        <EnumValue name="ImagingModule">6-Same behavior as FamilyModule.</EnumValue>
        <EnumValue name="ManageModule">7-No log entry.</EnumValue>
        <EnumValue name="Setup">8. Currently covers a wide variety of setup functions. </EnumValue>
        <EnumValue name="RxCreate">9</EnumValue>
        <EnumValue name="ProcComplEdit">10 - DEPRECATED - Uses date restrictions. Covers editing/deleting of Completed, EO, and EC procs. 
            Deleting procs of other statuses are covered by ProcDelete.
            </EnumValue>
        <EnumValue name="ChooseDatabase">11</EnumValue>
        <EnumValue name="Schedules">12</EnumValue>
        <EnumValue name="BlockoutEdit">13 - There are two kinds of blockouts: those flagged as NS(no sched) or DC(disable cut/copy/paste) and those with no flag. This permission handles the edit of blockouts with no flag. Logs an audit trail entry when a blockout is edited.  See BlockoutsFlagged permission for the other blockouts flagged as NS or DC. And see the other two blockout permissions for things other than edit.</EnumValue>
        <EnumValue name="ClaimSentEdit">14. Uses date restrictions.</EnumValue>
        <EnumValue name="PaymentCreate">15. Uses date restrictions.</EnumValue>
        <EnumValue name="PaymentEdit">16. Uses date restrictions.</EnumValue>
        <EnumValue name="AdjustmentCreate">17</EnumValue>
        <EnumValue name="AdjustmentEdit">18. Uses date restrictions.</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.  AppointmentDelete permission required in order to delete appointments.</EnumValue>
        <EnumValue name="Backup">28</EnumValue>
        <EnumValue name="TimecardsEditAll">29</EnumValue>
        <EnumValue name="DepositSlips">30</EnumValue>
        <EnumValue name="AccountingEdit">31. Uses date restrictions.</EnumValue>
        <EnumValue name="AccountingCreate">32. Uses date restrictions.</EnumValue>
        <EnumValue name="Accounting">33</EnumValue>
        <EnumValue name="AnesthesiaIntakeMeds">34</EnumValue>
        <EnumValue name="AnesthesiaControlMeds">35</EnumValue>
        <EnumValue name="InsPayCreate">36</EnumValue>
        <EnumValue name="InsPayEdit">37. Uses date restrictions. Edit Batch Insurance Payment.</EnumValue>
        <EnumValue name="TreatPlanEdit">38. Uses date restrictions.</EnumValue>
        <EnumValue name="ReportProdInc">39. DEPRECATED</EnumValue>
        <EnumValue name="TimecardDeleteEntry">40. Uses date restrictions.</EnumValue>
        <EnumValue name="EquipmentDelete">41. Uses date restrictions. All other equipment functions are covered by .Setup.</EnumValue>
        <EnumValue name="SheetEdit">42. Uses date restrictions. Also used in audit trail to log web form importing.</EnumValue>
        <EnumValue name="CommlogEdit">43. Uses date restrictions.</EnumValue>
        <EnumValue name="ImageDelete">44. Uses date restrictions. Allows deletion of images. SignedImageEdit permission is also needed to delete signed images.</EnumValue>
        <EnumValue name="PerioEdit">45. Uses date restrictions.</EnumValue>
        <EnumValue name="ProcEditShowFee">46. Shows the fee textbox in the proc edit window.</EnumValue>
        <EnumValue name="AdjustmentEditZero">47</EnumValue>
        <EnumValue name="EhrEmergencyAccess">48</EnumValue>
        <EnumValue name="ProcDelete">49. Uses date restrictions.  This only applies to non-completed procs.  Deletion of completed procs is covered by ProcCompleteStatusEdit.</EnumValue>
        <EnumValue name="EhrKeyAdd">50 - Only used at OD HQ.  No user interface.</EnumValue>
        <EnumValue name="ProviderEdit">51- Allows user to edit all providers. This is not fine-grained enough for extremely large organizations such as dental schools, so other permissions are being added as well.</EnumValue>
        <EnumValue name="EcwAppointmentRevise">52</EnumValue>
        <EnumValue name="ProcedureNoteFull">53</EnumValue>
        <EnumValue name="ReferralAdd">54</EnumValue>
        <EnumValue name="InsPlanChangeSubsc">55</EnumValue>
        <EnumValue name="RefAttachAdd">56</EnumValue>
        <EnumValue name="RefAttachDelete">57</EnumValue>
        <EnumValue name="CarrierCreate">58</EnumValue>
        <EnumValue name="GraphicalReports">59</EnumValue>
        <EnumValue name="AutoNoteQuickNoteEdit">60</EnumValue>
        <EnumValue name="EquipmentSetup">61</EnumValue>
        <EnumValue name="Billing">62</EnumValue>
        <EnumValue name="ProblemDefEdit">63</EnumValue>
        <EnumValue name="ProcFeeEdit">64- There is no user interface in the security window for this permission.  It is only used for tracking.</EnumValue>
        <EnumValue name="InsPlanChangeCarrierName">65- There is no user interface in the security window for this permission.  It is only used for tracking.  Only tracks changes to carriername, not any other carrier info.</EnumValue>
        <EnumValue name="TaskNoteEdit">66- (Was named TaskEdit prior to version 14.2.39) When editing an existing task: delete the task, edit original description, or double click on note rows.  Even if you don't have the permission, you can still edit your own task description (but not the notes) as long as it's in your inbox and as long as nobody but you has added any notes. </EnumValue>
        <EnumValue name="WikiListSetup">67- Add or delete lists and list columns..</EnumValue>
        <EnumValue name="Copy">68- There is no user interface in the security window for this permission.  It is only used for tracking.  Tracks copying of patient information.  Required by EHR.</EnumValue>
        <EnumValue name="Printing">69- There is no user interface in the security window for this permission.  It is only used for tracking.  Tracks printing of patient information.  Required by EHR.</EnumValue>
        <EnumValue name="MedicalInfoViewed">70- There is no user interface in the security window for this permission.  It is only used for tracking.  Tracks viewing of patient medical information.</EnumValue>
        <EnumValue name="PatProblemListEdit">71- Tracks creation and editing of patient problems.</EnumValue>
        <EnumValue name="PatMedicationListEdit">72- Tracks creation and edting of patient medications.</EnumValue>
        <EnumValue name="PatAllergyListEdit">73- Tracks creation and editing of patient allergies.</EnumValue>
        <EnumValue name="PatFamilyHealthEdit">74- There is no user interface in the security window for this permission.  It is only used for tracking.  Tracks creation and editing of patient family health history.</EnumValue>
        <EnumValue name="PatientPortal">75- There is no user interface in the security window for this permission.  It is only used for tracking.  Patient Portal access of patient information.  Required by EHR.</EnumValue>
        <EnumValue name="RxEdit">76</EnumValue>
        <EnumValue name="SchoolAdminStudentEdit">77- Assign this permission to a staff person who will administer setting up and editing Dental School Students in the system.</EnumValue>
        <EnumValue name="SchoolAdminInstructorEdit">78- Assign this permission to a staff person who will administer setting up and editing Dental School Instructors in the system.</EnumValue>
        <EnumValue name="OrthoChartEditFull">79- Uses date restrictions.  Has a unique audit trail so that users can track specific ortho chart edits.</EnumValue>
        <EnumValue name="PatientFieldEdit">80- There is no user interface in the security window for this permission.  It is only used for tracking.  Mainly used for ortho clinics.</EnumValue>
        <EnumValue name="SchoolAdminAcesss">81- Assign this permission to a staff member who needs full access to instructor and student records. Grants the ability to view anything they can view and perform any action on their behalf.</EnumValue>
        <EnumValue name="TreatPlanDiscountEdit">82- There is no user interface in the security window for this permission.  It is only used for tracking.</EnumValue>
        <EnumValue name="UserLogOnOff">83- There is no user interface in the security window for this permission.  It is only used for tracking.</EnumValue>
        <EnumValue name="TaskEdit">84- Allows user to edit other users' tasks.</EnumValue>
        <EnumValue name="EmailSend">85- Allows user to send unsecured email</EnumValue>
        <EnumValue name="WebMailSend">86- Allows user to send webmail</EnumValue>
        <EnumValue name="UserQueryAdmin">87- Allows user to run, edit, and write non-released queries.</EnumValue>
        <EnumValue name="InsPlanChangeAssign">88- Security permission for assignment of benefits.</EnumValue>
        <EnumValue name="ImageEdit">89- Uses date restrictions. Allows user to flip, rotate, resize, and crop image. Also allows editing of details on the "Item Info" window. SignedImageEdit permission is also needed to edit signed images.</EnumValue>
        <EnumValue name="EhrMeasureEventEdit">90- Allows editing of all measure events.  Also used to track changes made to events.</EnumValue>
        <EnumValue name="EServicesSetup">91- Allows users to edit settings in the eServices Setup window.  Also causes the Listener Service monitor thread to start upon logging in.</EnumValue>
        <EnumValue name="FeeSchedEdit">92- Allows users to edit Fee Schedules throughout the program.  Logs editing of fee schedule properties.</EnumValue>
        <EnumValue name="ProviderFeeEdit">93- Allows user to edit and delete provider specific fees overrides.</EnumValue>
        <EnumValue name="PatientMerge">94- Allows user to merge patients.</EnumValue>
        <EnumValue name="ClaimHistoryEdit">95- Only used in Claim History Status Edit</EnumValue>
        <EnumValue name="AppointmentCompleteEdit">96- Allows user to edit a completed appointment. AppointmentCompleteDelete permission required in order to delete completed appointments.</EnumValue>
        <EnumValue name="WebMailDelete">97- Audit trail for deleting webmail messages.  There is no user interface in the security window for this permission.</EnumValue>
        <EnumValue name="RequiredFields">98- Audit trail for saving a patient with required fields missing.  There is no user interface in the security window for this 
            permission.</EnumValue>
        <EnumValue name="ReferralMerge">99- Allows user to merge referrals.</EnumValue>
        <EnumValue name="ProcEdit">100- There is no user interface in the security window for this permission.  It is only used for tracking.
            Currently only used for tracking automatically changing the IsCpoe flag on procedures.  Can be enhanced to do more in the future.
            There is only one place where we could have automatically changed IsCpoe without a corresponding log of a different permission.
            That place is in the OnClosing of the Procedure Edit window.  We update this flag even when the user Cancels out of it.</EnumValue>
        <EnumValue name="ProviderMerge">101- Allows user to use the provider merge tool.</EnumValue>
        <EnumValue name="MedicationMerge">102- Allows user to use the medication merge tool.</EnumValue>
        <EnumValue name="AccountProcsQuickAdd">103- Allow users to use the Quick Add tool in the Account module.</EnumValue>
        <EnumValue name="ClaimSend">104- Allow users to send claims.</EnumValue>
        <EnumValue name="TaskListCreate">105- Allow users to create new task lists.</EnumValue>
        <EnumValue name="PatientCreate">106 - Audit when a new patient is added.</EnumValue>
        <EnumValue name="GraphicalReportSetup">107- Allows changing the settings for graphical repots.</EnumValue>
        <EnumValue name="PatientEdit">108 - Audit when a patient is edited and restrict editing patients.</EnumValue>
        <EnumValue name="InsPlanCreate">109 - Audit when an insurance plan is created.  Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanEdit">110 - Audit when an insurance plan is edited.  Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanCreateSub">111 - InsSub Created. Currently only used in X12 834 insurance plan import and in API.</EnumValue>
        <EnumValue name="InsPlanEditSub">112 - Audit when an insurance subscriber is edited. Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanAddPat">113 - Audit when a patient is added to an insurance plan.  Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanDropPat">114 - Audit when a patient is dropped from an insurance plan. Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanVerifyList">115 - Allows users to be assigned Insurance Verifications.</EnumValue>
        <EnumValue name="SplitCreatePastLockDate">116 - Allows users to bypass the global lock date to add paysplits.</EnumValue>
        <EnumValue name="ProcComplEditLimited">117 - DEPRECATED - Uses date restrictions.  Covers editing some fields of completed procs. </EnumValue>
        <EnumValue name="ClaimDelete">118 - Uses date restrictions based on the SecDateEntry field as the claim date.  Covers deleting a claim of any status
            (Sent, Waiting to Send, Received, etc).</EnumValue>
        <EnumValue name="InsWriteOffEdit">119 - Covers editing the Write-off and Write-off Override fields for claimprocs. Prevents the user from creating a claimproc to prevent subversion of an existing write-off. Prevents the user from deleting a claimproc as well, since otherwise deleting one outside the date range and creating a new one would subvert the date/days restriction.
            Uses date/days restriction based on the attached proc.DateEntryC; unless it's a total payment, then uses claimproc.SecDateEntry.Applies to all plan types (i.e. PPO, Category%, Capitation, etc).</EnumValue>
        <EnumValue name="ApptConfirmStatusEdit">120 - Allows users to change appointment confirmation status.</EnumValue>
        <EnumValue name="GraphicsRemoteEdit">121 - Audit trail for when users change graphical settings for another workstation in FormGraphics.cs.</EnumValue>
        <EnumValue name="AuditTrail">122 - Audit Trail (Separated from SecurityAdmin permission)</EnumValue>
        <EnumValue name="TreatPlanPresenterEdit">123 - Allows the user to change the presenter on a treatment plan.</EnumValue>
        <EnumValue name="ProviderAlphabetize">124 - Allows users to use the Alphabetize Provider button from FormProviderSetup to permanently re-order providers.</EnumValue>
        <EnumValue name="ClaimProcReceivedEdit">125 - Allows editing of claimprocs that are marked as received status.</EnumValue>
        <EnumValue name="StatementPatNumMismatch">126 - Used to diagnose an error in statement creation. Audit Trail Permission Only</EnumValue>
        <EnumValue name="MobileWeb">127 - User has access to ODTouch.</EnumValue>
        <EnumValue name="PatPlanCreate">128 - For logging purposes only.  Used when PatPlans are created and not otherwise logged.</EnumValue>
        <EnumValue name="PatPriProvEdit">129 - Allows the user to change a patient's primary provider, with audit trail logging.</EnumValue>
        <EnumValue name="ReferralEdit">130</EnumValue>
        <EnumValue name="PatientBillingEdit">131 - Allows users to change a patient's billing type.</EnumValue>
        <EnumValue name="ReportProdIncAllProviders">132 - Allows viewing annual prod inc of all providers instead of just a single provider.</EnumValue>
        <EnumValue name="ReportDaily">133 - Allows running daily reports. DEPRECATED.</EnumValue>
        <EnumValue name="ReportDailyAllProviders">134 - Allows viewing daily prod inc of all providers instead of just a single provider</EnumValue>
        <EnumValue name="PatientApptRestrict">135 - Allows user to change the appointment schedule flag.</EnumValue>
        <EnumValue name="SheetDelete">136 - Allows deleting sheets when they're associated to patients.</EnumValue>
        <EnumValue name="UpdateCustomTracking">137 - Allows updating custom tracking on claims.</EnumValue>
        <EnumValue name="GraphicsEdit">138 - Allows people to set graphics option for the workstation and other computers.</EnumValue>
        <EnumValue name="InsPlanOrthoEdit">139 - Allows user to change the fields within the Ortho tab of the Ins Plan Edit window.</EnumValue>
        <EnumValue name="ClaimProcClaimAttachedProvEdit">140 - Allows user to change the provider on claimproc when claimproc is attached to a claim.</EnumValue>
        <EnumValue name="InsPlanMerge">141 - Audit when insurance plans are merged.</EnumValue>
        <EnumValue name="InsCarrierCombine">142 - Allows user to combine carriers.</EnumValue>
        <EnumValue name="PopupEdit">143 - Allows user to edit popups. A user without this permission will still be able to edit their own popups.</EnumValue>
        <EnumValue name="InsPlanPickListExisting">144 - Allows user to select new insplan from list prior to dropping current insplan associated with a patplan.</EnumValue>
        <EnumValue name="OrthoChartEditUser">145 - Allows user to edit their own signed ortho charts even if they don't have full permission.</EnumValue>
        <EnumValue name="ProcedureNoteUser">146 - Allows user to edit procedure notes that they created themselves if they don't have full permission.</EnumValue>
        <EnumValue name="GroupNoteEditSigned">147 - Allows user to edit group notes signed by other users. If a user does not have this permission, they can still edit group notes
            that they themselves have signed.</EnumValue>
        <EnumValue name="WikiAdmin">148 - Allows user to lock and unlock wiki pages.  Also allows the user to edit locked wiki pages.</EnumValue>
        <EnumValue name="PayPlanEdit">149 - Allows user to create, edit, close, and delete payment plans.</EnumValue>
        <EnumValue name="ClaimEdit">150 - Used for logging when a claim is created, cancelled, or saved. </EnumValue>
        <EnumValue name="CommandQuery">151- Allows user to run command queries. Command queries are any non-SELECT queries for any non-temporary table.</EnumValue>
        <EnumValue name="ReplicationSetup">152 - Gives user access to the replication setup window.</EnumValue>
        <EnumValue name="PreAuthSentEdit">153 - Allows user to edit and delete sent and received pre-auths. Uses date restriction.</EnumValue>
        <EnumValue name="LogFeeEdit">154 - Edit fees (for logging only). Security log entry for this points to feeNum instead of CodeNum. </EnumValue>
        <EnumValue name="LogSubscriberEdit">155 - Log ClaimProcEdit</EnumValue>
        <EnumValue name="RecallEdit">156 - Logs changes to recalls, recalltypes, and recaltriggers.</EnumValue>
        <EnumValue name="ProcCodeEdit">157 - Allows users with this permission the ability to edit procedure codes.  Users with the Setup permission have this by default.
            Logs changes made to individual proc codes (excluding fee changes) including when run from proc code tools.</EnumValue>
        <EnumValue name="AddNewUser">158 - Allows users with this permission the ability to add new users. Security admins have this by default.</EnumValue>
        <EnumValue name="ClaimView">159 - Allows users with this permission the ability to view claims.</EnumValue>
        <EnumValue name="RepeatChargeTool">160 - Allows users to run the Repeat Charge Tool.</EnumValue>
        <EnumValue name="DiscountPlanAddDrop">161 - Logs when a discount plan is added or dropped from a patient.</EnumValue>
        <EnumValue name="TreatPlanSign">162 - Allows users with this permission the ability to sign treatment plans.</EnumValue>
        <EnumValue name="ProcExistingEdit">163 - Allows users with this permission to edit an existing EO or EC procedure.</EnumValue>
        <EnumValue name="UnrestrictedSearch">164 - Allows users to search for patients in all clinics even when they are restricted to clinics.
            Also allows user to reassign patient clinic.</EnumValue>
        <EnumValue name="ArchivedPatientEdit">165 - Allows users to edit patient information for archived patients. This really only stops editing inside Patient Edit window. Also see ArchivedPatientSelect. Blocking user from patient selection prevents changes to all the other tables.</EnumValue>
        <EnumValue name="CommlogPersistent">166 - HQ only. Must access from dropdown menu next to commlog button. Only for new commlog. Originally, this was written to allow commlogs to reuse a single persistent non-modal window. In about 2023, we accidentally introduced a bug that made it not reuse the original window. So now, it's multiple non-modal windows. We like the change, so we're keeping it.</EnumValue>
        <EnumValue name="VerifyPhoneOwnership">167 - Logs when a phone number has had its ownership verified. For OD HQ only.</EnumValue>
        <EnumValue name="SalesTaxAdjEdit">168 - HQ only. Allows users to make changes to Sales Tax type adjustments.</EnumValue>
        <EnumValue name="InsuranceVerification">169 - Allows user to set last verified dates for insurance benefits. Also allows access to FormInsVerificationList.</EnumValue>
        <EnumValue name="CreditCardMove">170 - Logs when a credit card is moved from one patient to another.  Makes a log for both patients.  Audit Trail Permission Only.</EnumValue>
        <EnumValue name="AgingRan">171 - Logs when aging is being ran and from where.</EnumValue>
        <EnumValue name="HeadmasterSetup">172 - HQ only. Allows user to add, edit, and delete Headmaster services and devices.</EnumValue>
        <EnumValue name="DashboardWidget">173 - Allows user to view a specific Dashboard Widget.</EnumValue>
        <EnumValue name="NewClaimsProcNotBilled">174 - Prevent users from creating bulk claims from the Procs Not Billed Report if past the lock date.</EnumValue>
        <EnumValue name="PatientPortalLogin">175 - Logging into patient portal. Used for audit trail only.</EnumValue>
        <EnumValue name="FAQEdit">176 - Allows user to create and edit FAQ objects shown by the help button(?).</EnumValue>
        <EnumValue name="FeatureRequestEdit">177 - HQ only. Alows user to edit feature request.</EnumValue>
        <EnumValue name="TaskReminderPopup">178- Logs when a reminder task is popped up.  Used for audit trail only.</EnumValue>
        <EnumValue name="SupplementalBackup">179 - Logs when changes are made to supplemental backup settings inside the FormBackup window.</EnumValue>
        <EnumValue name="WebSchedRecallManualSend">180 - Logs when a user sends a Web Sched Recall through the Recall List. Used for audit trail only</EnumValue>
        <EnumValue name="PatientSSNView">181 - Allows the user to unmask patient SSN for temporary viewing.  Logs any unmasks in the audit trail</EnumValue>
        <EnumValue name="PatientDOBView">182 - Allows the user to unmask patient DOB for temporary viewing.  Logs any unmasks in the audit trail</EnumValue>
        <EnumValue name="FamAgingTruncate">183 - Logs when the family aging table has been truncated. For audit trails only.</EnumValue>
        <EnumValue name="DiscountPlanMerge">184 - Logs when discount plans are merged. For audit trails only.</EnumValue>
        <EnumValue name="ProcCompleteStatusEdit">185 - Uses date restrictions.  Allows user to change status of a completed procedure, or delete compeleted procedure</EnumValue>
        <EnumValue name="ProcCompleteAddAdj">186 - Allows user to add an adjustment to a procedure (date locked)</EnumValue>
        <EnumValue name="ProcCompleteEditMisc">187 - Misc Edit that includes "Do Not Bill Ins" and "Hide Graphics" (date locked)</EnumValue>
        <EnumValue name="ProcCompleteNote">188 - Edit the note of a completed procedure</EnumValue>
        <EnumValue name="ProcCompleteEdit">189 - Edit main information of a procedure that is not already covered by the other permissions. Is not all inclusive.</EnumValue>
        <EnumValue name="ProtectedLeaveAdjustmentEdit">190 - User can create, edit, and delete time card adjustments for protected leave on their time card of the current pay period. Users that also have the Edit All Time Cards permission, have this permission for all time cards.</EnumValue>
        <EnumValue name="TimeAdjustEdit">191 - Logs when a time card adjustment is created, edited, or deleted.</EnumValue>
        <EnumValue name="QueryMonitor">192 - Permission for users to monitor queries</EnumValue>
        <EnumValue name="CommlogCreate">193 - Permission for users to create commlogs.</EnumValue>
        <EnumValue name="WebFormAccess">194 - Permission for users to modify and discard webforms</EnumValue>
        <EnumValue name="CloseOtherSessions">195 - Close other sessions of Open Dental Cloud</EnumValue>
        <EnumValue name="RepeatChargeCreate">196 - Permission for Repeating Charge creation.</EnumValue>
        <EnumValue name="RepeatChargeUpdate">197 - Permission for Repeating Charge update.</EnumValue>
        <EnumValue name="RepeatChargeDelete">198 - Permission for Repeating Charge deletion.</EnumValue>
        <EnumValue name="Zoom">199 - User can open the zoom window and edit zoom level. Used to block remote application users who all share the same computer.</EnumValue>
        <EnumValue name="FormAdded">200 - Permission for forms added to eclipboard mobile check in.</EnumValue>
        <EnumValue name="ImageExport">201. Uses date restrictions.</EnumValue>
        <EnumValue name="ImageCreate">202. Permission to Scan, Import, and Create Images.</EnumValue>
        <EnumValue name="CertificationEmployee">203 - Permission to update Employee Certifications.</EnumValue>
        <EnumValue name="CertificationSetup">204 - Permission to set up Certifications.</EnumValue>
        <EnumValue name="EmployerCreate">205 - Permission to create Employers.</EnumValue>
        <EnumValue name="AllowLoginFromAnyLocation">206 - Permission to allow users to login to ODCloud from any IP Address.</EnumValue>
        <EnumValue name="LogDoseSpotMedicationNoteEdit">207 - Logging only. Creates an entry if a medicationpat.PatNote needs to be truncated before sending to DoseSpot.</EnumValue>
        <EnumValue name="PayPlanChargeDateEdit">208 - Allows user to edit a payment plan charge date that has an APR.</EnumValue>
        <EnumValue name="DiscountPlanAdd">209 - Logs when discount plans are added. For audit trails only.</EnumValue>
        <EnumValue name="DiscountPlanEdit">210 - Logs when discount plans are edited. For audit trails only.</EnumValue>
        <EnumValue name="AllowFeeEditWhileReceivingClaim">211 - Permission to allow users without FeeSchedEdit permission to update fee schedule while receiving claims.</EnumValue>
        <EnumValue name="ManageHighSecurityProgProperties">212 - Permission for managing high security program properties.</EnumValue>
        <EnumValue name="CreditCardEdit">213 - Logs when a patient's credit card is edited.</EnumValue>
        <EnumValue name="MedicationDefEdit">214 - Allows user to edit medication definitions.</EnumValue>
        <EnumValue name="AllergyDefEdit">215 - Allows user to edit allergy definitions.</EnumValue>
        <EnumValue name="Advertising">216 - Allows user to setup and use Advertising features like Postcards.</EnumValue>
        <EnumValue name="TextMessageView">217 - Allows user to view text messages.</EnumValue>
        <EnumValue name="TextMessageSend">218 - Allows uer to send text messages.</EnumValue>
        <EnumValue name="RxMerge">219 - Allows user to merge prescriptions.</EnumValue>
        <EnumValue name="DefEdit">220 - Allows user to add or update Definitions.</EnumValue>
        <EnumValue name="UpdateInstall">221 - Allows user to install Open Dental updates.</EnumValue>
        <EnumValue name="AdjustmentTypeDeny">222 - Denies users access to specific adjustment types. Special type of permission where having this permission actually 
            denies users access. If a usergroup has an entry for this permission, then they do not have access to the adjustment type with the defnum
            that is stored in grouppermission.FKey. Pattern approved by Jordan.</EnumValue>
        <EnumValue name="StatementCSV">223 - Allows user to export statements as CSV files.</EnumValue>
        <EnumValue name="CarrierEdit">224 - Allows users to edit carriers.</EnumValue>
        <EnumValue name="ApiSubscription">225 - Logs when API subscriptions are added or deleted. For audit trails only.</EnumValue>
        <EnumValue name="SecurityGlobal">226 - Logs changes to global lock date. For audit trails only.</EnumValue>
        <EnumValue name="TaskDelete">228 - Allows user to delete tasks.</EnumValue>
        <EnumValue name="SetupWizard">229 - Allows user to use setup wizard.</EnumValue>
        <EnumValue name="ShowFeatures">230 - Allows user to use show features.</EnumValue>
        <EnumValue name="PrinterSetup">231 - Allows user to setup printer.</EnumValue>
        <EnumValue name="ProviderAdd">232 - Allows user to add provider.</EnumValue>
        <EnumValue name="ClinicEdit">233 - Allows user to edit clinic.</EnumValue>
        <EnumValue name="ApiAccountEdit">234 - Allows the editing of customer accounts for the ODApi via the BCM.</EnumValue>
        <EnumValue name="RegistrationKeyCreate">235 - Logs when registration keys are created. For audit trails only.</EnumValue>
        <EnumValue name="RegistrationKeyEdit">236 - Logs when registration keys are edited. For audit trails only.</EnumValue>
        <EnumValue name="AppointmentDelete">237 - Allows user to delete appointments.</EnumValue>
        <EnumValue name="AppointmentCompleteDelete">238 - Allows user to delete completed appointments.</EnumValue>
        <EnumValue name="AppointmentTypeEdit">239 - Logs when Appointment Types are edited. For audit trails only.</EnumValue>
        <EnumValue name="TextingAccountEdit">240 - Only used at OD HQ. Allows users to make high level changes in regards to texting.</EnumValue>
        <EnumValue name="WebChatEdit">241 - Logs when web chat sessions are edited. For audit trails only.</EnumValue>
        <EnumValue name="SupplierEdit">242 - Allows users to access FormSuppliers</EnumValue>
        <EnumValue name="SupplyPurchases">243 - Logs when any supply purchases are created, placed, or deleted.</EnumValue>
        <EnumValue name="PreferenceEditBroadcastMonitor">244 - Only used at OD HQ. Ability to edit table rows via Broadcast Monitor. </EnumValue>
        <EnumValue name="AppointmentResize">245 - Allows users to resize appointments.</EnumValue>
        <EnumValue name="CreditCardTerminal">246 - Logs when a user pays with a credit card. For Audit Trails only.</EnumValue>
        <EnumValue name="ViewAppointmentAuditTrail">247 - Only for viewing the audit trail in FormEditAppointment</EnumValue>
        <EnumValue name="PayPlanChargeEdit">248 - Logs when a user edits a payment plan charge.</EnumValue>
        <EnumValue name="ArchivedPatientSelect">249 - Also see ArchivedPatientEdit. Blocking user from patient selection prevents changes to all the other tables besides the patient table.  It's more rigorous.</EnumValue>
        <EnumValue name="CloudCustomerEdit">250 - Only used at OD HQ. Ability to edit Cloud tab info via Broadcast Monitor.</EnumValue>
        <EnumValue name="ChanSpy">251 - Only used at OD HQ. Ability to listen to live calls.</EnumValue>
        <EnumValue name="ClaimProcFieldsBilledToInsEdit">252 - Ability to edit Fee Billed to Insurance or Code Sent to Insurance in FormClaimProc, whether new or existing.</EnumValue>
        <EnumValue name="AllergyMerge">253 - Allow users to merge allergies.</EnumValue>
        <EnumValue name="AiChatSession">254 - Only used at OD HQ. Ability to open the AI chat window.</EnumValue>
        <EnumValue name="BadgeIdEdit">255 - Allow users to edit BadgeIds in the userod table.</EnumValue>
        <EnumValue name="ChildDaycareEdit">256 - Internal Child Daycare only. Allow users to make changes to the daycare. Only used at HQ.</EnumValue>
        <EnumValue name="PerioEditCopy">257 - Allow users to copy perio charts in the Perio Chart window.</EnumValue>
        <EnumValue name="LicenseAccept">258 - For audit trail only. Logs when a license is accepted by a user.</EnumValue>
        <EnumValue name="EFormEdit">259 - Uses date restrictions but no global lock date. Also used in audit trail to log importing.</EnumValue>
        <EnumValue name="EFormDelete">260 - Allows deleting eForms when they're attached to patients. No date restrictions.</EnumValue>
        <EnumValue name="MobileNotification">261 - Used for logging only. Can be used to log whenever mobile notifications are inserted into the database.</EnumValue>
        <EnumValue name="ChartViewsEdit">262 - Allows users to move chart views up and down, and add new chart views</EnumValue>
        <EnumValue name="SuperFamilyDisband">263 - Allows disbanding of Super Families.</EnumValue>
        <EnumValue name="ImageSignatureCreate">264 - Allows creation of note and signature for images without a signature.</EnumValue>
        <EnumValue name="SignedImageEdit">265 - Allows editing and deletion of note and signature for images with a signature. Allows users with the ImageEdit permission to edit signed images. Allows users with the ImageDelete permission to delete signed images.</EnumValue>
        <EnumValue name="BlockoutsFlagged">266 - There are two kinds of blockouts: those flagged as NS(no sched) or DC(disable cut/copy/paste) and those with no flag. This permission handles all the flagged blockouts, including add, edit, copy/paste, and delete. Logs an audit trail entry when a flagged blockout is added, edited, deleted, cut, copied, pasted, or cleared. See Blockouts permission for the other unflagged blockouts.</EnumValue>
        <EnumValue name="PayPlanUnlock">267 - Payment plans have a 'Locked' checkbox. This permission allows the user to uncheck that box which will unlock the payment plan. Users without this permission will not be able to unlock a payment plan.</EnumValue>
        <EnumValue name="SendAlertsFromHQ">268 - Allows sending notifications from HQ to customers. Only used at HQ.</EnumValue>
        <EnumValue name="TextAllEmployees">269 - Only used at OD HQ. Ability to send mass texts to all current employees.</EnumValue>
        <EnumValue name="ProcTPEditFee">270 - Allows editing the fee of a treatment planned procedure.</EnumValue>
        <EnumValue name="EFormImport">271 - Only used to make log entries.</EnumValue>
        <EnumValue name="BlockoutAdd">272 - This permission handles adding, pasting, and copying blockouts with no flag.</EnumValue>
        <EnumValue name="BlockoutDelete">273 - This permission handles deleting, cutting, and clearing blockouts with no flag.</EnumValue>
        <EnumValue name="PhoneExtension">274 - Only used at HQ to make audit trail entries when a change is made to a row in the Phone table.</EnumValue>
        <EnumValue name="PatientSelected">275 - Audit when a patient has been selected.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="FKey" type="bigint(20)">
      <summary>Generic foreign key to any other table.  Typically used in combination with PermType to give permission to specific things.</summary>
    </column>
  </table>
  <table name="guardian">
    <summary>Links patient to patient in a many to many database relationship.  The two PatNums need not be in the same family, but will usually be.
            The two PatNums could be in different families if the relationship was entered, then one of the patients in the relationship is moved to another family.
            This table can also be used for other relationship types besides guardians.  The table name is guardian because we only supported guardian relationships in the past,
            and we did not want to risk breaking queries by changing the table or column names. User can specify any relationship as a guardian or not a guardian.
            For example, a retired person might specify their brother or child as their guardian, or the user may want to record the brother of a patient as a non-guardian.</summary>
    <column order="0" name="GuardianNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNumChild" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  If Relationship is "Mother", then this PatNum is the child of the mother.</summary>
    </column>
    <column order="2" name="PatNumGuardian" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  If Relationship is "Mother", then this is the PatNum of the mother.</summary>
    </column>
    <column order="3" name="Relationship" type="tinyint(4)">
      <summary>Enum:GuardianRelationship .</summary>
      <Enumeration name="GuardianRelationship">
        <summary></summary>
        <EnumValue name="None">0 - Never stored in db guardian table, but can be stored in eFormField for import purposes.</EnumValue>
        <EnumValue name="Mother">1 - Added due to feature request.  Needed for EHR.</EnumValue>
        <EnumValue name="Stepfather">2 - Added due to feature request.</EnumValue>
        <EnumValue name="Stepmother">3 - Added due to feature request.</EnumValue>
        <EnumValue name="Grandfather">4 - Added due to feature request.</EnumValue>
        <EnumValue name="Grandmother">5 - Added due to feature request.</EnumValue>
        <EnumValue name="Father">6 - Added due to feature request.  Needed for EHR.</EnumValue>
        <EnumValue name="Brother">7 - Added for EHR.</EnumValue>
        <EnumValue name="CareGiver">8 - Added for EHR.</EnumValue>
        <EnumValue name="FosterChild">9 - Added for EHR.</EnumValue>
        <EnumValue name="Guardian">10 - Added for EHR.  Also meets request #154.</EnumValue>
        <EnumValue name="Grandparent">11 - Added for EHR.</EnumValue>
        <EnumValue name="Other">12 - Added for EHR.  Also meets request #154.</EnumValue>
        <EnumValue name="Parent">13 - Added for EHR.  Also meets request #154.</EnumValue>
        <EnumValue name="Stepchild">14 - Added for EHR.</EnumValue>
        <EnumValue name="Self">15 - Added for EHR.</EnumValue>
        <EnumValue name="Sibling">16 - Added for EHR.</EnumValue>
        <EnumValue name="Sister">17 - Added for EHR.  Also meets request #154.</EnumValue>
        <EnumValue name="Spouse">18 - Added for EHR.</EnumValue>
        <EnumValue name="Child">19 - Added for EHR.</EnumValue>
        <EnumValue name="LifePartner">20 - Added for EHR.</EnumValue>
        <EnumValue name="Friend">21 - Added for EHR.</EnumValue>
        <EnumValue name="Grandchild">22 - Added for EHR.</EnumValue>
        <EnumValue name="Sitter">23 - Added due to feature request. Maps to caregiver in EHR.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="IsGuardian" type="tinyint(4)">
      <summary>True if this specifies a guardian relationship, or false if any other relationship.
            When this flag is true, the relationship will show in the "Guardians" appointment view field and in the family module "Guardians" display field for the patient.  This also grants PHI access in the patient portal to the specific patient designated via PatNumChild.</summary>
    </column>
  </table>
  <table name="hcpcs">
    <summary>A code system used in EHR.  Healhtcare Common Procedure Coding System.  Another system used to describe procedure codes.</summary>
    <column order="0" name="HcpcsNum" type="bigint(20)">
      <summary>Primary key..</summary>
    </column>
    <column order="1" name="HcpcsCode" type="varchar(255)">
      <summary>Examples: AQ, J1040</summary>
    </column>
    <column order="2" name="DescriptionShort" type="varchar(255)">
      <summary>Short description.  This is the HCPCS supplied abbreviated description.</summary>
    </column>
  </table>
  <table name="hieclinic">
    <summary>Health Information Exchange clinic settings. This table stores settings for generating automatic CCDs.</summary>
    <column order="0" name="HieClinicNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClincNum.</summary>
    </column>
    <column order="2" name="SupportedCarrierFlags" type="tinyint(4)">
      <summary>Enum:HieCarrierFlags AllPatient=0,Medicaid=1.  Indicates the supported carrier, bitwise.</summary>
      <Enumeration name="HieCarrierFlags">
        <summary>Bit wise.</summary>
        <EnumValue name="AllCarriers">No carrier set. All carriers are supported.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="PathExportCCD" type="varchar(255)">
      <summary>The path to export CCD. This field will not be blank when enabled.</summary>
    </column>
    <column order="4" name="TimeOfDayExportCCD" type="bigint(20)">
      <summary>The time to export CCD.</summary>
    </column>
    <column order="5" name="IsEnabled" type="tinyint(4)">
      <summary></summary>
    </column>
  </table>
  <table name="hiequeue">
    <summary>Health Information Exchange queue. This table stores pending patients that need to be considered for an auto-generated CCD.</summary>
    <column order="0" name="HieQueueNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
  </table>
  <table name="histappointment">
    <summary>A historical copy of an appointment.  These are generated as a result of an appointment being edited.  When creating for insertion it needs a passed-in Appointment object.</summary>
    <column order="0" name="HistApptNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="HistUserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum  Identifies the user that changed this appointment from previous state, not the person who originally wrote it.</summary>
    </column>
    <column order="2" name="HistDateTStamp" type="datetime">
      <summary>The date and time that this appointment was edited and added to the Hist table.</summary>
    </column>
    <column order="3" name="HistApptAction" type="tinyint(4)">
      <summary>Enum:HistAppointmentAction .</summary>
      <Enumeration name="HistAppointmentAction">
        <summary></summary>
        <EnumValue name="Created">0</EnumValue>
        <EnumValue name="Changed">1</EnumValue>
        <EnumValue name="Missed">2</EnumValue>
        <EnumValue name="Cancelled">3</EnumValue>
        <EnumValue name="Deleted">4</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ApptSource" type="tinyint(4)">
      <summary>Enum:EServiceTypes .</summary>
      <Enumeration name="EServiceTypes">
        <summary></summary>
        <EnumValue name="None">Not an eService user.  All valid users should be this type otherwise permission checking will act differently.</EnumValue>
        <EnumValue name="EConnector"></EnumValue>
        <EnumValue name="Broadcaster"></EnumValue>
        <EnumValue name="BroadcastMonitor"></EnumValue>
        <EnumValue name="ServiceMainHQ"></EnumValue>
        <EnumValue name="OpenDentalService">Used by the OpenDentalService. Not a eService but we need the "phantom" user to behave like eService users.</EnumValue>
        <EnumValue name="OpenDentalAPIService">Used by the Open Dental API Service.</EnumValue>
        <EnumValue name="SecureEmailService">Used by the SecureEmailService.</EnumValue>
        <EnumValue name="ODXam">Used by WebServiceMainHQ. Used as a fall back value when users are using an older version of a mobile app.</EnumValue>
        <EnumValue name="EClipboard">Used by WebServiceMainHQ.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="AptNum" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="6" name="PatNum" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="7" name="AptStatus" type="tinyint(4)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="8" name="Pattern" type="varchar(255)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="9" name="Confirmed" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="10" name="TimeLocked" type="tinyint(4)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="11" name="Op" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="12" name="Note" type="text">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="13" name="ProvNum" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="14" name="ProvHyg" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="15" name="AptDateTime" type="datetime">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="16" name="NextAptNum" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="17" name="UnschedStatus" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="18" name="IsNewPatient" type="tinyint(4)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="19" name="ProcDescript" type="text">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="20" name="Assistant" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="21" name="ClinicNum" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="22" name="IsHygiene" type="tinyint(4)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="23" name="DateTStamp" type="timestamp">
      <summary>Not copied from Appointment. Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="24" name="DateTimeArrived" type="datetime">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="25" name="DateTimeSeated" type="datetime">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="26" name="DateTimeDismissed" type="datetime">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="27" name="InsPlan1" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="28" name="InsPlan2" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="29" name="DateTimeAskedToArrive" type="datetime">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="30" name="ProcsColored" type="text">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="31" name="ColorOverride" type="int(11)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="32" name="AppointmentTypeNum" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="33" name="SecUserNumEntry" type="bigint(20)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="34" name="SecDateTEntry" type="datetime">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="35" name="Priority" type="tinyint(4)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="36" name="ProvBarText" type="varchar(60)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="37" name="PatternSecondary" type="varchar(255)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="38" name="SecurityHash" type="varchar(255)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="39" name="ItemOrderPlanned" type="int(11)">
      <summary>Copied from Appointment.</summary>
    </column>
    <column order="40" name="IsMirrored" type="tinyint(4)">
      <summary>Copied from Appointment.</summary>
    </column>
  </table>
  <table name="hl7def">
    <summary>.</summary>
    <column order="0" name="HL7DefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="2" name="ModeTx" type="tinyint(4)">
      <summary>Enum:ModeTxHL7 File, TcpIp.</summary>
      <Enumeration name="ModeTxHL7">
        <summary></summary>
        <EnumValue name="File">0</EnumValue>
        <EnumValue name="TcpIp">1</EnumValue>
        <EnumValue name="Sftp">2.  Used for MedLab HL7 transmission, currently only LabCorp.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="IncomingFolder" type="varchar(255)">
      <summary>Used for File mode and for SFTP mode.  For file mode, this is the folder for inbound HL7 messages.
            For SFTP mode, this is the relative path from the SFTP root directory to the directory where the result messages can be found.
            The root or home directory '.' can be included in the path but is not necessary.  Examples: /./results or /results or results.</summary>
    </column>
    <column order="4" name="OutgoingFolder" type="varchar(255)">
      <summary>Only used for File mode</summary>
    </column>
    <column order="5" name="IncomingPort" type="varchar(255)">
      <summary>Only used for tcpip mode. Example: 1461</summary>
    </column>
    <column order="6" name="OutgoingIpPort" type="varchar(255)">
      <summary>Only used for tcpip mode. Example: 192.168.0.23:1462</summary>
    </column>
    <column order="7" name="FieldSeparator" type="varchar(5)">
      <summary>Only relevant for outgoing. Incoming field separators are defined in MSH. Default |.</summary>
    </column>
    <column order="8" name="ComponentSeparator" type="varchar(5)">
      <summary>Only relevant for outgoing. Incoming field separators are defined in MSH. Default ^.</summary>
    </column>
    <column order="9" name="SubcomponentSeparator" type="varchar(5)">
      <summary>Only relevant for outgoing. Incoming field separators are defined in MSH. Default &amp;.</summary>
    </column>
    <column order="10" name="RepetitionSeparator" type="varchar(5)">
      <summary>Only relevant for outgoing. Incoming field separators are defined in MSH. Default ~.</summary>
    </column>
    <column order="11" name="EscapeCharacter" type="varchar(5)">
      <summary>Only relevant for outgoing. Incoming field separators are defined in MSH. Default \.</summary>
    </column>
    <column order="12" name="IsInternal" type="tinyint(4)">
      <summary>If this is set, then there will be no child tables. Internal types are fully defined within the C# code rather than in the database.</summary>
    </column>
    <column order="13" name="InternalType" type="varchar(255)">
      <summary>Enum:HL7InternalType Stored in db as string, but used in OD as enum HL7InternalType. Example: eCWTight.  This will always have a value because we always start with a copy of some internal type.</summary>
      <Enumeration name="HL7InternalType">
        <summary>Stored in the database as a string.  The items in this enumeration can be freely rearranged without damaging the database.  But can't change spelling or remove existing items.</summary>
        <EnumValue name="eCWFull">Message structure is identical to eCWTight, minor changes in the program like showing patient demographics and the account module.Like eCWTight, eCW dictates the patients' PatNums in PID.2, so we try to locate the patient with that PatNum.If not found we do not attempt to use PID.4 ChartNumber or name, we assume new patient and insert.</EnumValue>
        <EnumValue name="eCWStandalone">Only Incoming ADT messages are processed, OD is responsible for adding patients so we assign PatNum.The incoming messages patient ID in PID.2 is stored as ChartNumber and PID.4 is not processed.The Account and Chart modules are visible and the users can change and add patients in OD.  No outgoing messages.</EnumValue>
        <EnumValue name="eCWTight">Patient demographics are hidden as well as account and appt modules.We let eCW dictate the PatNum values in PID.2 and trust that they are unique and longs (no string characters).Unlike Standalone, if the pat isn't found by PID.2 PatNum we don't try to locate the pat by PID.4 ChartNumber or name, we assume it's a new pat.</EnumValue>
        <EnumValue name="Centricity">Account and Appointment modules are visible and users can change and add patients.Only outgoing DFT message defined, no incoming messages are processed.</EnumValue>
        <EnumValue name="HL7v2_6">Our default behavior for processing and sending HL7 messages.Send and receive ADT and SIU messages, receive DFT messages.The v2.6 documentation claims both PID.2 and PID.4 are only retained for backward compatibility and PID.3 is now required and used for a list of patient IDs.We will still put ChartNumber in PID.2 (used to be referred to as 'external ID' by HL7 doc) for outgoing msgs and look for our PatNum in PID.2 for incoming msgs.We will now also check PID.3 for a repitition that contains our PatNum as part of the CX data type.Account and Appointments module are visible and users can change and add patients.</EnumValue>
        <EnumValue name="MedLabv2_3">This is currently used for LabCorp and is based on HL7 version 2.3 specifications.
            This interface has been built to the LabCorp standards and may not match the HL7 version 2.3 specs exactly.</EnumValue>
      </Enumeration>
    </column>
    <column order="14" name="InternalTypeVersion" type="varchar(50)">
      <summary>Example: 12.2.14. This will be empty if IsInternal. This records the version at which they made their copy. We might have made significant improvements since their copy.</summary>
    </column>
    <column order="15" name="IsEnabled" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="16" name="Note" type="text">
      <summary></summary>
    </column>
    <column order="17" name="HL7Server" type="varchar(255)">
      <summary>The machine name of the computer where the OpenDentHL7 service for this def is running.</summary>
    </column>
    <column order="18" name="HL7ServiceName" type="varchar(255)">
      <summary>The name of the HL7 service for this def.  Must begin with OpenDent...</summary>
    </column>
    <column order="19" name="ShowDemographics" type="tinyint(4)">
      <summary>Enum:HL7ShowDemographics Hide,Show,Change,ChangeAndAdd</summary>
      <Enumeration name="HL7ShowDemographics">
        <summary></summary>
        <EnumValue name="Hide">Cannot see or change.</EnumValue>
        <EnumValue name="Show">Can see, but not change.</EnumValue>
        <EnumValue name="Change">Can change, but not add patients.  Might get overwritten by next incoming message.</EnumValue>
        <EnumValue name="ChangeAndAdd">Can change and add patients.  Might get overwritten by next incoming message.</EnumValue>
      </Enumeration>
    </column>
    <column order="20" name="ShowAppts" type="tinyint(4)">
      <summary>Show Appointments module.</summary>
    </column>
    <column order="21" name="ShowAccount" type="tinyint(4)">
      <summary>Show Account module</summary>
    </column>
    <column order="22" name="IsQuadAsToothNum" type="tinyint(4)">
      <summary>Send the quadrant in the tooth number component instead of the surface component of the FT1.26 field of the outgoing DFT messages.  Only for eCW.</summary>
    </column>
    <column order="23" name="LabResultImageCat" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  Image category used by MedLab HL7 interfaces when storing PDFs received via inbound HL7 messages.</summary>
    </column>
    <column order="24" name="SftpUsername" type="varchar(255)">
      <summary>The username for logging into the Sftp server.</summary>
    </column>
    <column order="25" name="SftpPassword" type="varchar(255)">
      <summary>The password used with the SftpUsername to log into the Sftp server.  This won't be displayed to the user but will be stored as encrypted text in the db.</summary>
    </column>
    <column order="26" name="SftpInSocket" type="varchar(255)">
      <summary>The socket used to connect to the Sftp server for retrieving inbound HL7 messages.  Currently only used by MedLabv2_3 interfaces.
            This will be the address:port of the Sftp server to connect to for retrieving lab results.  Example: server.address.com:20020.</summary>
    </column>
    <column order="27" name="HasLongDCodes" type="tinyint(4)">
      <summary>For eCW HL7 interfaces only.  False by default.  When false, D codes sent in outbound DFT messages will be limited to 5 characters.
            Any additional characters will be stripped off when generating the HL7 message.  When true, D codes will not be truncated.</summary>
    </column>
    <column order="28" name="IsProcApptEnforced" type="tinyint(4)">
      <summary>If true a message box will warn users if they try to send procedures from the chart module that are not attached to an 
            appointment.</summary>
    </column>
  </table>
  <table name="hl7deffield">
    <summary>Multiple fields per segment.</summary>
    <column order="0" name="HL7DefFieldNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="HL7DefSegmentNum" type="bigint(20)" fk="hl7deffield">
      <summary>FK to hl7deffield.HL7DefSegmentNum</summary>
    </column>
    <column order="2" name="OrdinalPos" type="int(11)">
      <summary>Position within the segment.</summary>
    </column>
    <column order="3" name="TableId" type="varchar(255)">
      <summary>HL7 table Id, if applicable. Example: 0234. Example: 1234/2345.  DataType will be ID.</summary>
    </column>
    <column order="4" name="DataType" type="varchar(255)">
      <summary>The DataTypeHL7 enum will be unlinked from the db by storing as string in db. As it's loaded into OD, it will become an enum.</summary>
    </column>
    <column order="5" name="FieldName" type="varchar(255)">
      <summary>User will get to pick from a list of fields that we will maintain. Example: guar.nameLFM, prov.provIdName, or pat.addressCityStateZip.  See below for the full list.  This will be blank if this is a fixed text field.</summary>
    </column>
    <column order="6" name="FixedText" type="text">
      <summary>User will need to insert fixed text for some fields.  Either FixedText or FieldName will have a value, not both.</summary>
    </column>
  </table>
  <table name="hl7defmessage">
    <summary>There is no field for MessageStructureHL7 (ADT_A01), because that will be inferred. Defined in HL7 specs, section 2.16.3.</summary>
    <column order="0" name="HL7DefMessageNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="HL7DefNum" type="bigint(20)" fk="hl7def">
      <summary>FK to hl7def.HL7DefNum</summary>
    </column>
    <column order="2" name="MessageType" type="varchar(255)">
      <summary>Enum:MessageTypeHL7 Stored in db as string, but used in OD as enum MessageTypeHL7. Example: ADT</summary>
      <Enumeration name="MessageTypeHL7">
        <summary>The items in this enumeration can be freely rearranged without damaging the database.  But can't change spelling or remove existing item.</summary>
        <EnumValue name="NotDefined">Use this for unsupported message types</EnumValue>
        <EnumValue name="ACK">Message Acknowledgment</EnumValue>
        <EnumValue name="ADT">Demographics - A01,A04,A08,A28,A31</EnumValue>
        <EnumValue name="DFT">Detailed Financial Transaction - P03</EnumValue>
        <EnumValue name="ORU">Unsolicited Observation Message - R01</EnumValue>
        <EnumValue name="PPR">Patient Problem - PC1,PC2,PC3</EnumValue>
        <EnumValue name="SIU">Schedule Information Unsolicited - Event types S12 through S26.  Currently only S12, S14, S15, and S17 events are supported.  Inbound for eCW, outbound for other interfaces.</EnumValue>
        <EnumValue name="SRM">Schedule Request Message - Event types S01 through S11.  Currently only S03 and S04 events are supported.  Not used for eCW, inbound for other interfaces.</EnumValue>
        <EnumValue name="SRR">Schedule Request Response - Event types S01 through S11.  Currently only S03 and S04 events are supported.  Not used for eCW, inbound for other interfaces.</EnumValue>
        <EnumValue name="VXU">Unsolicited Vaccination Record Update - V04</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="EventType" type="varchar(255)">
      <summary>Enum:EventTypeHL7 Stored in db as string, but used in OD as enum EventTypeHL7. Example: A04, which is only used with ADT/ACK.</summary>
      <Enumeration name="EventTypeHL7">
        <summary>The items in this enumeration can be freely rearranged without damaging the database.  But can't change spelling or remove existing item.</summary>
        <EnumValue name="NotDefined">Use this for unsupported event types</EnumValue>
        <EnumValue name="A04">Only used with ADT/ACK.
            A04 - Register a PatientFor eCW, the A04 and A08 are inbound messages and are processed the same.  We attempt to locate the patient, if not found we insert one.For other interfaces, the same method of locating a patient and if not found inserting one will be used for inbound ADT^A04 and ADT^A08 messages.Outbound messages will have an A04 event type if a new patient is added</EnumValue>
        <EnumValue name="A08">Only used with ADT/ACK.
            A08 - Update Patient InfoA04 and A08 inbound are processed the same, but we will send the A08 event type if updating a patient in an outbound ADT.</EnumValue>
        <EnumValue name="P03">Only used with DFT/ACK.</EnumValue>
        <EnumValue name="PC1">Only used with PPR/ACK (Patient Problem messages).
            Not used for eCW.These are inbound messages for adding/updating patient problems.PC1 is the Add event.  Add and Update events will be handled the same for now.</EnumValue>
        <EnumValue name="PC2">Only used with PPR/ACK (Patient Problem messages).
            Not used for eCW.PC2 is the Update event.  Add and Update events will be handled the same for now.</EnumValue>
        <EnumValue name="S03">Only used with SRM/SRR/ACK.  S03 - Request Appointment Modification.
            Not used for eCW.These will be inbound and are used for updating a limited amount of information for an existing appointment.S03 messages are used to update appointments.  </EnumValue>
        <EnumValue name="S04">Only used with SRM/SRR/ACK.  S04 - Request Appointment Cancellation.
            Not used for eCW.S04 messages are used to set an appointment.AptStatus to ApptStatus.Broken.</EnumValue>
        <EnumValue name="S12">Only used with SIU/ACK.
            S12 - New ApptFor eCW, these are inbound, OD is considered an auxiliary application, and S12 and S14 messages are processed the same.For interfaces that require outbound SIU messages, OD is considered the filler application since OD has control over the operatories and schedules.As the filler application, events S12-S26 are the message events and they all have the same structure defined by HL7.Different actions in OD will cause a different outbound event type to be inserted, but the defined segments and fields will otherwise be the same.</EnumValue>
        <EnumValue name="S13">Only used with SIU/ACK.
            S13 - Appt Rescheduling</EnumValue>
        <EnumValue name="S14">Only used with SIU/ACK.
            S14 - Appt Modification</EnumValue>
        <EnumValue name="S15">Only used with SIU/ACK.
            S15 - Appt Cancellation</EnumValue>
        <EnumValue name="S17">Only used with SIU/ACK.
            S17 - Appt Deletion</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="InOrOut" type="tinyint(4)">
      <summary>Enum:InOutHL7 Incoming, Outgoing</summary>
      <Enumeration name="InOutHL7">
        <summary></summary>
        <EnumValue name="Incoming">0</EnumValue>
        <EnumValue name="Outgoing">1</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary>The only purpose of this column is to let you change the order in the HL7 Def windows.  It's just for convenience.</summary>
    </column>
    <column order="6" name="Note" type="text">
      <summary>text</summary>
    </column>
    <column order="7" name="MessageStructure" type="varchar(255)">
      <summary>Enum:MessageStructureHL7 Stored in db as string, but used in OD as enum MessageStructure. Example: ADT_A01, which is the structure used for event types A01, A04, A08, and A13.</summary>
      <Enumeration name="MessageStructureHL7">
        <summary></summary>
        <EnumValue name="NotDefined">Use this for unsupported message structures</EnumValue>
        <EnumValue name="ADT_A01">Used for ADT/ACK event types A01, A04, A08, and A13.
            We currently only support A04 and A08 event types, both will use this structure.</EnumValue>
        <EnumValue name="DFT_P03">Used for DFT/ACK event type P03.
            All outbound DFT's are this structure.</EnumValue>
        <EnumValue name="ORU_R01">Used for ORU/ACK event type R01.
            All inbound ORU - Unsolicited transmission of an observation message will use this structure.This is used for all inbound LabCorp messages.</EnumValue>
        <EnumValue name="PPR_PC1">Used for PPR/ACK event types PC1, PC2, and PC3.
            We currently only support PC1 (add problem) and PC2 (update problem), both use this structure.</EnumValue>
        <EnumValue name="SIU_S12">Used for SIU/ACK event types S12 through S24 and S26.
            We currently only support S12 through S17.Inbound SIU's are all treated the same, regardless of the event type.We send different event types in outbound SIU's depending on the action that causes the message.All SIU's, inbound or outbound, use this message structure.</EnumValue>
        <EnumValue name="SRM_S01">Used for SRM/ACK event types S01 through S11.
            We currently only support S03 (update appt request) and S04 (cancel appt request).SRM's are inbound and when the action of updating or cancelling the appt is completed, an SRR is sent.SRM's and SRR's still require ACK's.  i.e. SRM received, ACK sent, action completed leads to SRR sent, ACK received.SRM's and SRR's will all use this message structure.</EnumValue>
        <EnumValue name="SRR_S01">Used for SRR/ACK event types S01 through S11.
            We currently only support S03 and S04 (see SRM_S01).SRR's are outbound and sent when an SRM is processed correctly.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="hl7defsegment">
    <summary>multiple segments per message</summary>
    <column order="0" name="HL7DefSegmentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="HL7DefMessageNum" type="bigint(20)" fk="hl7defmessage">
      <summary>FK to hl7defmessage.HL7DefMessageNum</summary>
    </column>
    <column order="2" name="ItemOrder" type="int(11)">
      <summary>Since we don't enforce or automate, it can be 1-based or 0-based.  For outgoing, this affects the message structure.  For incoming, this is just for convenience and organization in the HL7 Def windows.</summary>
    </column>
    <column order="3" name="CanRepeat" type="tinyint(4)">
      <summary>For example, a DFT can have multiple FT1 segments.  This turns out to be a completely useless field, since we already know which ones can repeat.</summary>
    </column>
    <column order="4" name="IsOptional" type="tinyint(4)">
      <summary>If this is false, and an incoming message is missing this segment, then it gets logged as an error/failure.  If this is true, then it will gracefully skip a missing incoming segment.  Not used for outgoing.</summary>
    </column>
    <column order="5" name="SegmentName" type="varchar(255)">
      <summary>Stored in db as string, but used in OD as enum SegmentNameHL7. Example: PID.</summary>
    </column>
    <column order="6" name="Note" type="text">
      <summary>.</summary>
    </column>
  </table>
  <table name="hl7msg">
    <summary>HL7 messages sent and received.</summary>
    <column order="0" name="HL7MsgNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="HL7Status" type="int(11)">
      <summary>Enum:HL7MessageStatus Out/In are relative to Open Dental.  This is in contrast to the names of the old ecw folders, which were relative to the other program.  OutPending, OutSent, InReceived, InProcessed.</summary>
      <Enumeration name="HL7MessageStatus">
        <summary></summary>
        <EnumValue name="OutPending">0</EnumValue>
        <EnumValue name="OutSent">1</EnumValue>
        <EnumValue name="OutFailed">2-Tried to send, but there was a problem.  Will keep trying.</EnumValue>
        <EnumValue name="InProcessed">3</EnumValue>
        <EnumValue name="InFailed">4</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="MsgText" type="mediumtext">
      <summary>The actual HL7 message in its entirity.</summary>
    </column>
    <column order="3" name="AptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum.  Many of the messages contain "Visit ID" which is equivalent to our AptNum.</summary>
    </column>
    <column order="4" name="DateTStamp" type="timestamp">
      <summary>Used to determine which messages are old so that they can be cleaned up.</summary>
    </column>
    <column order="5" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="6" name="Note" type="text">
      <summary></summary>
    </column>
  </table>
  <table name="hl7procattach">
    <summary>Keeps track of whether procedures have been sent in an HL7 message.</summary>
    <column order="0" name="HL7ProcAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="HL7MsgNum" type="bigint(20)" fk="hl7msg">
      <summary>FK to hl7msg.HL7MsgNum.</summary>
    </column>
    <column order="2" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum.</summary>
    </column>
  </table>
  <table name="icd10">
    <summary>Other tables generally use the ICD10Code string as their foreign key.  It is implied that these are all ICD10CMs, although that may not be the case in the future.</summary>
    <column order="0" name="Icd10Num" type="bigint(20)">
      <summary>Primary key. Also identical to "Order Number" column in ICD10 documentation.</summary>
    </column>
    <column order="1" name="Icd10Code" type="varchar(255)">
      <summary>ICD-10-CM or ICD-10-PCS code. Dots are included. Not allowed to edit this column once saved in the database.</summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>Short Description provided by ICD10 documentation.</summary>
    </column>
    <column order="3" name="IsCode" type="varchar(255)">
      <summary>0 if the code is a “header” – not valid for submission on a UB04. 1 if the code is valid for submission on a UB04.</summary>
    </column>
  </table>
  <table name="icd9">
    <summary>Other tables generally use the ICD9Code string as their foreign key.  Currently synched to mobile server in a very inefficient manner.  It is implied that these are all ICD9CMs, although that may not be the case in the future.</summary>
    <column order="0" name="ICD9Num" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ICD9Code" type="varchar(255)">
      <summary>Not allowed to edit this column once saved in the database.</summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>Description.</summary>
    </column>
    <column order="3" name="DateTStamp" type="timestamp">
      <summary>The last date and time this row was altered.  Not user editable.</summary>
    </column>
  </table>
  <table name="imagedraw">
    <summary>Image text, lines. drawings, and scales. Attached to either a document or a mount. Drawings are in pixel coordinates of original image prior to any cropping or rotating. For a mount, coordinates are relative to the entire mount. Drawings do not get changed when cropping or rotating are changed. The result is that drawings always stay on the image in exactly the original location, and they move with the image.</summary>
    <column order="0" name="ImageDrawNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum</summary>
    </column>
    <column order="2" name="MountNum" type="bigint(20)" fk="mount">
      <summary>FK to mount.MountNum</summary>
    </column>
    <column order="3" name="ColorDraw" type="int(11)">
      <summary>For text, this is the foreground color. For lines, this is the color, and ColorBack is not used. For polygons, this is the fill color. No transparency component.</summary>
    </column>
    <column order="4" name="ColorBack" type="int(11)">
      <summary>Background color for text. Can be Transparent (0,255,255,255)=16777215.</summary>
    </column>
    <column order="5" name="DrawingSegment" type="text">
      <summary>Point data for a drawing segment.  The format would look similar to this: 45.2,68.1;48,70;49,72;0,0;55,88;etc.  It's simply a sequence of points, separated by semicolons.  Only positive floats are used, rounded to one decimal place.  0,0 is the upper left of the image or mount.  Cropping is ignored.  If the pen is picked up, it becomes a new segment, so a new row in the database.  Or, if this is DrawType.ScaleValue, then this field stores scale, decimal places, and units, separated by spaces.  Example: "123.4 0 mm". The first two are required; units is optional.</summary>
    </column>
    <column order="6" name="DrawText" type="varchar(255)">
      <summary>The location of the text in pixels is incorporated into this string.  Example: 25,123;This shows.  Carriage returns etc are not supported.  ColorDraw and FontSize are also used.  Unlike tooth initial, this does not support floats.</summary>
    </column>
    <column order="7" name="FontSize" type="float">
      <summary>This could vary significantly based on the size of the image.  It's always relative to orginal image or mount pixels. Always 0 for Pearl.</summary>
    </column>
    <column order="8" name="DrawType" type="tinyint(4)">
      <summary>Enum:ImageDrawType</summary>
      <Enumeration name="ImageDrawType">
        <summary></summary>
        <EnumValue name="Text">0 - Location and string, combined</EnumValue>
        <EnumValue name="Line">1 - A series of straight lines, stored the same as a pen drawing.</EnumValue>
        <EnumValue name="Pen">2 - One continuous segment of a drawing.</EnumValue>
        <EnumValue name="ScaleValue">3 - Stores a float, decimals, and units in the drawing segement. Only one of this type is allowed per image or mount.</EnumValue>
        <EnumValue name="Polygon">4 - A series of connected points forming the outline of a closed polygon. Stored same as pen drawing. Polygons only have a fill color, not any outline color.</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="ImageAnnotVendor" type="tinyint(4)">
      <summary>Enum:EnumImageAnnotVendor 0: Open Dental drawings and text, 1:Pearl AI annotations.</summary>
      <Enumeration name="EnumImageAnnotVendor">
        <summary></summary>
        <EnumValue name="OpenDental">0 - Open Dental drawings and text.</EnumValue>
        <EnumValue name="Pearl">1 - Pearl AI annotations.</EnumValue>
        <EnumValue name="BetterDiagnostics">2 - Better Diagnostics AI annotations.</EnumValue>
        <EnumValue name="BetterDiagnosticsPatientView">3 - Better Diagnostics AI annotations for Patient View.</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="Details" type="text">
      <summary>Extra space for any text. Currently only used for Pearl annotation categories, relationship properties, and relationship values, which are all stored as a single chunk of user readable text drawn straight to screen when hovering.</summary>
    </column>
    <column order="11" name="PearlLayer" type="tinyint(4)">
      <summary>Enum:Pearl.EnumCategoryOD This is how we hide and show layers for Pearl objects in the Imaging module.</summary>
      <Enumeration name="Pearl.EnumCategoryOD">
        <summary>This is for showing/hiding layers. Jordan-This list is tentative. I feel like there are a few missing. Each incoming Pearl annotation or toothpart must be able to be assigned to exactly one of these.</summary>
        <EnumValue name="None">0 - None.</EnumValue>
        <EnumValue name="Crown">1 - Crown.</EnumValue>
        <EnumValue name="PeriapicalRadiolucency">2 - Periapical Radiolucency.</EnumValue>
        <EnumValue name="Filling">3 - Filling.</EnumValue>
        <EnumValue name="Anatomy">4 - Anatomy.</EnumValue>
        <EnumValue name="CariesProgressed">5 - Caries -Progressed.</EnumValue>
        <EnumValue name="NotableMargin">6 - Notable Margin.</EnumValue>
        <EnumValue name="Implant">7 - Implant.</EnumValue>
        <EnumValue name="RootCanal">8 - Root Canal.</EnumValue>
        <EnumValue name="Bridge">9 - Bridge.</EnumValue>
        <EnumValue name="Calculus">10 - Calculus.</EnumValue>
        <EnumValue name="Measurements">11 - Measurements.</EnumValue>
        <EnumValue name="Bone">12 - Bone (Tooth Part).</EnumValue>
        <EnumValue name="Cementum">13 - Cementum (Tooth Part).</EnumValue>
        <EnumValue name="Dentin">14 - Dentin (Tooth Part).</EnumValue>
        <EnumValue name="Enamel">15 - Enamel (Tooth Part).</EnumValue>
        <EnumValue name="Pulp">16 - Pulp (Tooth Part).</EnumValue>
        <EnumValue name="Restoration">17 - Restoration (Tooth Part).</EnumValue>
        <EnumValue name="InferiorAlveolarNerve">18 - Inferior Alveolar Nerve (Tooth Part). Not included in legend.</EnumValue>
        <EnumValue name="Sinus">19 - Sinus (Tooth Part). Not included in legend.</EnumValue>
        <EnumValue name="NasalCavity">20 - NasalCavity (Tooth Part). Not included in legend.</EnumValue>
        <EnumValue name="CariesIncipient">21 - Caries -Incipient.</EnumValue>
      </Enumeration>
    </column>
    <column order="12" name="BetterDiagLayer" type="tinyint(4)">
      <summary>Enum:EnumCategoryBetterDiag This is how we hide and show layers for BetterDiagnostics objects in the Imaging module.</summary>
      <Enumeration name="EnumCategoryBetterDiag">
        <summary>Better Diagnostics enum for AI annotation categories. This is used to set the ImageDraw's BetterDiagLayer when processing results.</summary>
        <EnumValue name="None">0 - None.</EnumValue>
        <EnumValue name="Dentin">1 - Dentin.</EnumValue>
        <EnumValue name="Enamel">2 - Enamel.</EnumValue>
        <EnumValue name="Pulp">3 - Pulp.</EnumValue>
        <EnumValue name="Restoration">4 - Restoration.</EnumValue>
        <EnumValue name="Crown">5 - Crown.</EnumValue>
        <EnumValue name="Cavity">6 - Cavity.</EnumValue>
        <EnumValue name="BoneLoss">7 - Bone Loss.</EnumValue>
        <EnumValue name="PeriapicalRadiolucency">8 - Periapical Radiolucency.</EnumValue>
        <EnumValue name="BoneLevel">9 - Bone Level.</EnumValue>
        <EnumValue name="Iac">10 - Iac. Inferior alveolar canal.</EnumValue>
        <EnumValue name="NasalFloor">11 - Nasal floor.</EnumValue>
        <EnumValue name="NormalTmj">12 - Normal Tmj.</EnumValue>
        <EnumValue name="Sinus">13 - Sinus.</EnumValue>
        <EnumValue name="RootStumps">14 - Root stumps.</EnumValue>
        <EnumValue name="MissingTooth">15 - Missing tooth.</EnumValue>
        <EnumValue name="Calculus">16 - Calculus.</EnumValue>
        <EnumValue name="Disclaimer">17 - FDA Disclaimer.</EnumValue>
        <EnumValue name="MarginalDiscrepancy">18 - Marginal discrepancies.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="imagingdevice">
    <summary>Xray sensor, camera, etc. Depending on the hardware, this can either be one physical device or a set of similar devices.</summary>
    <column order="0" name="ImagingDeviceNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Any description of the device.</summary>
    </column>
    <column order="2" name="ComputerName" type="varchar(255)">
      <summary>Name of the computer where this device is available.  Optional.  If blank, then this device will be available to all computers.</summary>
    </column>
    <column order="3" name="DeviceType" type="tinyint(4)">
      <summary>Enum:EnumImgDeviceType TwainRadiograph, XDR(not functional), or TwainMulti.</summary>
      <Enumeration name="EnumImgDeviceType">
        <summary>Order cannot change, since we store in db as enum number.  But we show the list in the UI in a different order or our choosing.</summary>
        <EnumValue name="TwainRadiograph">0</EnumValue>
        <EnumValue name="XDR">1</EnumValue>
        <EnumValue name="TwainMulti">2</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="TwainName" type="varchar(255)">
      <summary>The name of the twain device as in Windows.</summary>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary></summary>
    </column>
    <column order="6" name="ShowTwainUI" type="tinyint(4)">
      <summary></summary>
    </column>
  </table>
  <table name="insbluebook">
    <summary>One row for each procedure primary/secondary claim combination. Records insurance plan and insurance payment data of a procedure that has been paid on primary or secondary insurance claim made to out of network plans. This data is used to estimate allowed fees and make more accurate insurance estimates. It will be processed and summarized as entries in InsBlueBookAllowedFees.</summary>
    <column order="0" name="InsBlueBookNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProcCodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum. The code of the procedure.</summary>
    </column>
    <column order="2" name="CarrierNum" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.CarrierNum. The carrier that the insurance plan belongs to.</summary>
    </column>
    <column order="3" name="PlanNum" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum. The insurance plan for which the claim was made.</summary>
    </column>
    <column order="4" name="GroupNum" type="varchar(25)">
      <summary>The insplan.GroupNum. May be blank.</summary>
    </column>
    <column order="5" name="InsPayAmt" type="double">
      <summary>The sum of InsPayAmt per claim for received and supplemental claimprocs of the procedure that are associated to the insurance plan. Not used for future estimate calculations.</summary>
    </column>
    <column order="6" name="AllowedOverride" type="double">
      <summary>The AllowedOverride of the received claimproc on the claim. This is the number that is actually used to provide the estimate for future payments.</summary>
    </column>
    <column order="7" name="DateTEntry" type="datetime">
      <summary>The date and time of entry. Not editable by user.</summary>
    </column>
    <column order="8" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum.</summary>
    </column>
    <column order="9" name="ProcDate" type="date">
      <summary>The date of service, derived from claimproc.ProcDate of the received claimproc on the claim.</summary>
    </column>
    <column order="10" name="ClaimType" type="varchar(10)">
      <summary>The claim.ClaimType. Currently only gathering data for primary and secondary claims, so this will be "P"(Primary) or "S"(Secondary).</summary>
    </column>
    <column order="11" name="ClaimNum" type="bigint(20)" fk="claim">
      <summary>FK to claim.ClaimNum.</summary>
    </column>
  </table>
  <table name="insbluebooklog">
    <summary>Logs all changes made to claimproc estimates that are made by the Blue Book feature.</summary>
    <column order="0" name="InsBlueBookLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClaimProcNum" type="bigint(20)" fk="claimproc">
      <summary>FK to claimproc.ClaimProcNum. The claimproc for which the estimate was changed.</summary>
    </column>
    <column order="2" name="AllowedFee" type="double">
      <summary>The new claimproc.InsEstTotal that was calculated from a group of AllowedOverrides by the Blue Book feature.</summary>
    </column>
    <column order="3" name="DateTEntry" type="datetime">
      <summary>The date and time of entry. Not editable by user.</summary>
    </column>
    <column order="4" name="Description" type="text">
      <summary>Explanation of how the Blue Book feature obtained the new insurance estimate.</summary>
    </column>
  </table>
  <table name="insbluebookrule">
    <summary>The insbluebookrule table represents an ordered hierarchy of rules that the program will attempt to apply when determining insurance estimates for out of network plans. If the highest priority rule does not produce an estimate, the program attempts to apply the second rule, and so on, until an estimate is obtained. Always same number of rows (6), just allowed to customize order and details.</summary>
    <column order="0" name="InsBlueBookRuleNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ItemOrder" type="smallint(6)">
      <summary>0 based. This rule's priority in the hierarchy of all insbluebookrules. 0 is highest priority.</summary>
    </column>
    <column order="2" name="RuleType" type="tinyint(4)">
      <summary>Enum:InsBlueBookRuleType Types 0 to 3 are for rules that determine estimates by looking at the payment history of an insurance plan, insurance plan group, carrier, or carrier group. Type 4 utilizes fee schedules that are attached to out of network plans that are manually maintained by the user. Type 5 bases estimates off of the provider fee.</summary>
      <Enumeration name="InsBlueBookRuleType">
        <summary></summary>
        <EnumValue name="InsurancePlan">0 - Insurance Plan</EnumValue>
        <EnumValue name="GroupNumber">1 - Group Number</EnumValue>
        <EnumValue name="InsuranceCarrier">2 - Insurance Carrier</EnumValue>
        <EnumValue name="InsuranceCarrierGroup">3 - Insurance Carrier Group</EnumValue>
        <EnumValue name="ManualBlueBookSchedule">4 - Manual Blue Book Schedule. You can set a manual BB fee sched on an InsPlan. So to calculate the allowed fee, it does not need to look at any entries in InsBlueBook table.</EnumValue>
        <EnumValue name="ProviderFee">5 - Provider Fee. Since this uses the provider fee, it also does not need to look at any entries in InsBlueBook table.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="LimitValue" type="int(11)">
      <summary>The number of years, months, weeks, or days of insurance payment history that will be considered when generating a Blue Book estimate. Will be 0 if the RuleType is 4-ManualBlueBookSchedule or 5-ProviderFee as limits do not apply to these rule types.</summary>
    </column>
    <column order="4" name="LimitType" type="tinyint(4)">
      <summary>Enum:InsBlueBookRuleLimitType Determines the unit of time that InsBlueBookRule.LimitValue represents. Will be 0-None if the RuleType is 4-ManualBlueBookSchedule or 5-ProviderFee as limits do not apply to these rule types.</summary>
      <Enumeration name="InsBlueBookRuleLimitType">
        <summary></summary>
        <EnumValue name="None">0 - None</EnumValue>
        <EnumValue name="Years">1 - Years</EnumValue>
        <EnumValue name="Months">2 - Months</EnumValue>
        <EnumValue name="Weeks">3 - Weeks</EnumValue>
        <EnumValue name="Days">4 - Days</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="inseditlog">
    <summary></summary>
    <column order="0" name="InsEditLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FKey" type="bigint(20)">
      <summary>Key to the foreign table.</summary>
    </column>
    <column order="2" name="LogType" type="tinyint(4)">
      <summary>Enum:InsEditLogType 0 - InsPlan, 1 - Carrier, 2 - Benefit, 3 - Employer.</summary>
      <Enumeration name="InsEditLogType">
        <summary></summary>
        <EnumValue name="InsPlan">0</EnumValue>
        <EnumValue name="Carrier">1</EnumValue>
        <EnumValue name="Benefit">2</EnumValue>
        <EnumValue name="Employer">3</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FieldName" type="varchar(255)">
      <summary>The name of the column that was altered.</summary>
    </column>
    <column order="4" name="OldValue" type="varchar(255)">
      <summary>The old value of this field.</summary>
    </column>
    <column order="5" name="NewValue" type="varchar(255)">
      <summary>The new value of this field.</summary>
    </column>
    <column order="6" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that made this change.</summary>
    </column>
    <column order="7" name="DateTStamp" type="timestamp">
      <summary>Time that the row was inserted into the DB.</summary>
    </column>
    <column order="8" name="ParentKey" type="bigint(20)">
      <summary>Stores the key to the parent table (insplan.PlanNum) when LogType = 2 (Benefit).</summary>
    </column>
    <column order="9" name="Description" type="varchar(255)">
      <summary>The string describing this entry. Displays different information depending on the LogType:
            0 - InsPlan: GroupNum and GroupName
            1 - Carrier: CarrierNum and CarrierName
            2 - Benefit: CovCat Description
            3 - Employer: Employer Name</summary>
    </column>
  </table>
  <table name="inseditpatlog">
    <summary></summary>
    <column order="0" name="InsEditPatLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FKey" type="bigint(20)">
      <summary>Foreign key to the field flagged with the PriKey attributed for the corresponding table type which is specified by LogType. Note, some logs do not use table type objects that are directly related to the LogType. E.g. Adjustment LogType uses a claimproc entity. 0 - PatPlan: patplan.PatPlanNum. 1 - Subscriber: inssub.InsSubNum. 2 - Adjustment: claimproc.ClaimProcNum.</summary>
    </column>
    <column order="2" name="LogType" type="tinyint(4)">
      <summary>Enum:InsEditPatLogType 0 - PatPlan, 1 - Subscriber, 2 - Adjustment.</summary>
      <Enumeration name="InsEditPatLogType">
        <summary></summary>
        <EnumValue name="PatPlan">0</EnumValue>
        <EnumValue name="Subscriber">1</EnumValue>
        <EnumValue name="Adjustment">2 - Adjustments to insurance benefits.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FieldName" type="varchar(255)">
      <summary>The name of the column that was altered.</summary>
    </column>
    <column order="4" name="OldValue" type="varchar(255)">
      <summary>The old value of this field.</summary>
    </column>
    <column order="5" name="NewValue" type="varchar(255)">
      <summary>The new value of this field.</summary>
    </column>
    <column order="6" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that made this change.</summary>
    </column>
    <column order="7" name="DateTStamp" type="timestamp">
      <summary>Time that the row was inserted into the DB.</summary>
    </column>
    <column order="8" name="ParentKey" type="bigint(20)">
      <summary>Used to store another foreign key link to another entity based off of the current LogType. 0 - PatPlan: Not used. 1 - Subscriber: Not used. 2 - Adjustment: claimproc.InsSubNum</summary>
    </column>
    <column order="9" name="Description" type="varchar(255)">
      <summary>The string describing this entry. Displays different information depending on the LogType: 1 - Subscriber: Subscriber's Name, 2 - Adjustment: Insurance Benefit</summary>
    </column>
  </table>
  <table name="insfilingcode">
    <summary>An optional field on insplan and claims.  This lets user customize so that they can track insurance types. Only used for e-claims. Typically two characters. Examples: CI for Commercial Insurance, VA for Veterans, WC for Worker's Comp, MB for Medicare part B, etc.</summary>
    <column order="0" name="InsFilingCodeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Descript" type="varchar(255)">
      <summary>Description of the insurance filing code.</summary>
    </column>
    <column order="2" name="EclaimCode" type="varchar(100)">
      <summary>Code for electronic claim.</summary>
    </column>
    <column order="3" name="ItemOrder" type="int(11)">
      <summary>Display order for this filing code within the UI.  0-indexed.</summary>
    </column>
    <column order="4" name="GroupType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  Reporting Group.</summary>
    </column>
    <column order="5" name="ExcludeOtherCoverageOnPriClaims" type="tinyint(4)">
      <summary>If set to true, and the patient's secondary insurance plan uses this insfilingcode, the secondary insurance plan will 
            not be populated on primary e-claims or paper claims.</summary>
    </column>
  </table>
  <table name="insfilingcodesubtype">
    <summary>Stores the list of insurance filing code subtypes.</summary>
    <column order="0" name="InsFilingCodeSubtypeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="InsFilingCodeNum" type="bigint(20)" fk="insfilingcode">
      <summary>FK to insfilingcode.insfilingcodenum</summary>
    </column>
    <column order="2" name="Descript" type="varchar(255)">
      <summary>The description of the insurance filing code subtype.</summary>
    </column>
  </table>
  <table name="inspending">
    <summary>This table is an easy way to import insurance into Open Dental. It avoids all the complexity of InsPlans, Carriers, InsSubs, and PatPlans. The API and eClipboard eForms both take advantage of this table. The office then has control over when and how they convert this InsPending to an actual insurance plan. Details are entered separately for each family member so it can look like there's some duplication in a family. But the UI to convert to a real ins plan handles that smoothly. Ins Pending shows to the left of normal insurance in the Family module. InsPending does not mix with InsSub or PatPlan. There can be multiple InsPendings per patient if needed.</summary>
    <column order="0" name="InsPendingNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum  The patient who has this insurance. Analogous to patplan.PatNum. Always required.</summary>
    </column>
    <column order="2" name="PatNumSubscriber" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum  The patient who is the subscriber. Always required.</summary>
    </column>
    <column order="3" name="Ordinal" type="tinyint">
      <summary>Number like 1, 2, 3, etc.  Represents primary ins, secondary ins, tertiary ins, etc. But this is really just an indicator of which ordinal the patient "wants" the insurance to go into. It always shows to the left of the true plans in the Family module. These aren't actually intermingled with ins plans. A number here does not indicate that the InsPending is actually in the desired position. Since it's not very important, it can also be 0.</summary>
    </column>
    <column order="4" name="Relationship" type="tinyint(4)">
      <summary>Enum:Relat Required to be Self if this is the subscriber (PatNum==PatNumSubscriber).</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="5" name="GroupNum" type="varchar(255)">
      <summary>Optional.</summary>
    </column>
    <column order="6" name="GroupName" type="varchar(255)">
      <summary>Optional.</summary>
    </column>
    <column order="7" name="Employer" type="varchar(255)">
      <summary>Optional.</summary>
    </column>
    <column order="8" name="SubscriberID" type="varchar(255)">
      <summary>Number assigned by insurance company. No dashes. Not allowed to be blank.</summary>
    </column>
    <column order="9" name="Phone" type="varchar(255)">
      <summary>Includes any punctuation.</summary>
    </column>
    <column order="10" name="CarrierName" type="varchar(255)">
      <summary></summary>
    </column>
  </table>
  <table name="insplan">
    <summary>Subscribers can share insplans by using the InsSub table.  The patplan table determines coverage for individual patients.  InsPlans can also exist without any subscriber. </summary>
    <column order="0" name="PlanNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="GroupName" type="varchar(50)">
      <summary>Optional</summary>
    </column>
    <column order="2" name="GroupNum" type="varchar(50)">
      <summary>Optional.  In Canada, this is called the Plan Number.</summary>
    </column>
    <column order="3" name="PlanNote" type="text">
      <summary>Note for this plan.  Same for all subscribers.</summary>
    </column>
    <column order="4" name="FeeSched" type="bigint(20)" fk="feesched">
      <summary>FK to feesched.FeeSchedNum.</summary>
    </column>
    <column order="5" name="PlanType" type="char(1)">
      <summary>""=percentage(the default),"p"=ppo_percentage,"f"=flatCopay,"c"=capitation.</summary>
    </column>
    <column order="6" name="ClaimFormNum" type="bigint(20)" fk="claimform">
      <summary>FK to claimform.ClaimFormNum. eg. "1" for ADA2002.  For ADA2006, it varies by office.</summary>
    </column>
    <column order="7" name="UseAltCode" type="tinyint">
      <summary>0=no,1=yes.  could later be extended if more alternates required</summary>
    </column>
    <column order="8" name="ClaimsUseUCR" type="tinyint">
      <summary>Fee billed on claim should be the standard provider fee for the patient's provider.</summary>
    </column>
    <column order="9" name="CopayFeeSched" type="bigint(20)" fk="feesched">
      <summary>FK to feesched.FeeSchedNum. 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="10" name="EmployerNum" type="bigint(20)" fk="employer">
      <summary>FK to employer.EmployerNum.</summary>
    </column>
    <column order="11" name="CarrierNum" type="bigint(20)" fk="carrier">
      <summary>FK to carrier.CarrierNum.</summary>
    </column>
    <column order="12" name="AllowedFeeSched" type="bigint(20)" fk="feesched">
      <summary>FK to feesched.FeeSchedNum.  Not usually used.  This fee schedule holds amounts allowed by carriers.  Always represents a feesched of type OutOfNetwork.</summary>
    </column>
    <column order="13" name="TrojanID" type="varchar(100)">
      <summary>.</summary>
    </column>
    <column order="14" name="DivisionNo" type="varchar(255)">
      <summary>Only used in Canada. It's a suffix to the plan number (group number).</summary>
    </column>
    <column order="15" name="IsMedical" type="tinyint">
      <summary>True if this is medical insurance rather than dental insurance.  When creating a claim, this, along with pref.</summary>
    </column>
    <column order="16" name="FilingCode" type="bigint(20)" fk="insfilingcode">
      <summary>FK to insfilingcode.InsFilingCodeNum.  Used for e-claims.  Also used for some complex reports in public health.  The e-claim usage might become obsolete when PlanID implemented by HIPAA.  Can be 0 to indicate none.  Then 'CI' will go out on claims.</summary>
    </column>
    <column order="17" name="DentaideCardSequence" type="tinyint">
      <summary>Canadian e-claim field. D11 and E07.  Zero indicates empty.  Mandatory value for Dentaide.  Not used for all others.  2 digit.  DEPRECATED - See CDAnet Message Formats+Standards 4.2_2021.</summary>
    </column>
    <column order="18" name="ShowBaseUnits" type="tinyint(1)">
      <summary>If checked, the units Qty will show the base units assigned to a procedure on the claim form.</summary>
    </column>
    <column order="19" name="CodeSubstNone" type="tinyint(1)">
      <summary>Set to true to not allow procedure code downgrade substitution on this insurance plan.</summary>
    </column>
    <column order="20" name="IsHidden" type="tinyint(4)">
      <summary>Set to true to hide it from the pick list and from the main list.</summary>
    </column>
    <column order="21" name="MonthRenew" type="tinyint(4)">
      <summary>The month, 1 through 12 when the insurance plan renews.  It will renew on the first of the month.  To indicate calendar year, set renew month to 0.</summary>
    </column>
    <column order="22" name="FilingCodeSubtype" type="bigint(20)" fk="insfilingcodesubtype">
      <summary>FK to insfilingcodesubtype.InsFilingCodeSubtypeNum</summary>
    </column>
    <column order="23" name="CanadianPlanFlag" type="varchar(5)">
      <summary>Canadian C12.  Single char, usually blank.  If non-blank, then it's one of three kinds of Provincial Medical Plans.  A=Newfoundland MCP Plan.  V=Veteran's Affairs Plan.  N=NIHB.  N and V are not yet in use, so they will result in blank being sent instead.  See Elig5.</summary>
    </column>
    <column order="24" name="CanadianDiagnosticCode" type="varchar(255)">
      <summary>Canadian C39. Required when CanadianPlanFlag is 'A'.</summary>
    </column>
    <column order="25" name="CanadianInstitutionCode" type="varchar(255)">
      <summary>Canadian C40. Required when CanadianPlanFlag is 'A'.</summary>
    </column>
    <column order="26" name="RxBIN" type="varchar(255)">
      <summary>BIN location number.  Only used with EHR.</summary>
    </column>
    <column order="27" name="CobRule" type="tinyint(4)">
      <summary>Enum:EnumCobRule 0=Basic, 1=Standard, 2=CarveOut. </summary>
      <Enumeration name="EnumCobRule">
        <summary></summary>
        <EnumValue name="Basic">0=Basic</EnumValue>
        <EnumValue name="Standard">1=Standard</EnumValue>
        <EnumValue name="CarveOut">2=CarveOut</EnumValue>
        <EnumValue name="SecondaryMedicaid">3=SecondaryMedicaid. The secondary insurance will reduce what it pays by what primary pays (like Basic). Then anything that would be the
            patient portion is a writeoff for the secondary insurance. Sometimes Medicaid is required to be the primary, so only use this if you are sure
            you are allowed to.</EnumValue>
      </Enumeration>
    </column>
    <column order="28" name="SopCode" type="varchar(255)" fk="sop">
      <summary>FK to sop.SopCode. Examples: 121, 3115, etc.  Acts as default for all patients using this insurance.  When code is changed for an insplan, it should change automatically for patients having that primary insurance. </summary>
    </column>
    <column order="29" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="30" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="31" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="32" name="HideFromVerifyList" type="tinyint(4)">
      <summary>Is false if this plan needs to be verified.</summary>
    </column>
    <column order="33" name="OrthoType" type="tinyint(4)">
      <summary>Enum:OrthoClaimType 0=InitialClaimOnly, 1=InitialPlusVisit, 2=InitialPlusPeriodic. 
            If this is an ortho claim, dictates what type of Ortho claim it is.</summary>
      <Enumeration name="OrthoClaimType">
        <summary></summary>
        <EnumValue name="InitialClaimOnly">Payment schedule to be determined after EOB is received.</EnumValue>
        <EnumValue name="InitialPlusVisit">D8080 submitted on initial banding with D8030 or D8670 submitted per visit.</EnumValue>
        <EnumValue name="InitialPlusPeriodic">D8080 submitted on initial banding and OrthoAutoProc (usually D8670.auto) submitted at a set frequency regardless of visits.
            Actual visits should use D8670 and be marked 'DoNotBillIns.'</EnumValue>
      </Enumeration>
    </column>
    <column order="34" name="OrthoAutoProcFreq" type="tinyint(4)">
      <summary>Enum:OrthoAutoProcFrequency The frequency that the automatic procedures and claims are created for insplans with an InitialPlusPeriodic OrthoType</summary>
      <Enumeration name="OrthoAutoProcFrequency">
        <summary></summary>
        <EnumValue name="Monthly"></EnumValue>
        <EnumValue name="Quarterly">Every three months.</EnumValue>
        <EnumValue name="SemiAnnual">Every six months.</EnumValue>
        <EnumValue name="Annual"></EnumValue>
      </Enumeration>
    </column>
    <column order="35" name="OrthoAutoProcCodeNumOverride" type="bigint(20)">
      <summary>If 0, this insplan uses the OrthoAutoProc preference.  Otherwise, this overrides that value.</summary>
    </column>
    <column order="36" name="OrthoAutoFeeBilled" type="double">
      <summary>The amount that the ortho auto procedure will bill to insurance by default. Overridden by patplan.OrthoAutoFeeBilledOverride.</summary>
    </column>
    <column order="37" name="OrthoAutoClaimDaysWait" type="int(11)">
      <summary>Usually 0 or 30. Number of days that should pass after the initial banding that an automatic Ortho claim/procedure are generated.</summary>
    </column>
    <column order="38" name="BillingType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.</summary>
    </column>
    <column order="39" name="HasPpoSubstWriteoffs" type="tinyint(4)">
      <summary>True by default.  When a plan allows downgrading procedures and this field is false, the writeoff will be $0 and the difference
            between the proc fee and the insurance estimate will be the patient portion.</summary>
    </column>
    <column order="40" name="ExclusionFeeRule" type="tinyint(4)">
      <summary>Enum:ExclusionRule  Controls how write-offs are handled for excluded (not covered) procedures on an in-network plan. Defaults to PracticeDefault. 0=Practice Default (use the global InsPlanUseUcrFeeForExclusions preference), 1=Do Nothing (apply the normal contracted fee and write-off logic), 2=Use Standard Provider Fee (apply the full standard provider fee with no write-offs)</summary>
      <Enumeration name="ExclusionRule">
        <summary></summary>
        <EnumValue name="PracticeDefault">0=Practice Default</EnumValue>
        <EnumValue name="DoNothing">1=Do Nothing</EnumValue>
        <EnumValue name="UseUcrFee">2=Use Standard Provider Fee</EnumValue>
      </Enumeration>
    </column>
    <column order="41" name="ManualFeeSchedNum" type="bigint(20)" fk="feesched">
      <summary>FK to feesched that has a FeeSchedType of 4-ManualBlueBook. Optional, can be 0.</summary>
    </column>
    <column order="42" name="IsBlueBookEnabled" type="tinyint(4)">
      <summary>determines if the plan is going to have BlueBook Enabled or not</summary>
    </column>
    <column order="43" name="InsPlansZeroWriteOffsOnAnnualMaxOverride" type="tinyint(4)">
      <summary>Enum:YN  Plan-level override for how write-offs are handled when the patient has met their annual maximum. 0=Default (use the global InsPlansZeroWriteOffsOnAnnualMax preference), 1=Yes (apply the full standard provider fee with no write-offs), 2=No (apply the normal contracted fee and write-off logic)</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="44" name="InsPlansZeroWriteOffsOnFreqOrAgingOverride" type="tinyint(4)">
      <summary>Enum:YN  Plan-level override for how write-offs are handled when a procedure is not covered due to an age or frequency limitation. 0=Default (use the global InsPlansZeroWriteOffsOnFreqOrAging preference), 1=Yes (apply the full standard provider fee with no write-offs), 2=No (apply the normal contracted fee and write-off logic)</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="45" name="PerVisitPatAmount" type="double">
      <summary>The per visit patient copay amount. 0 by default. When an appt is scheduled or set complete, a new proc gets created with code specified in pref.PerVisitPatAmountProcCode.</summary>
    </column>
    <column order="46" name="PerVisitInsAmount" type="double">
      <summary>The per visit amount to bill insurance. 0 by default. When an appt is scheduled or set complete, a new proc gets created with code specified in pref.PerVisitInsAmountProcCode.</summary>
    </column>
  </table>
  <table name="insplanpreference">
    <summary>Used to create overrides at the insurance plan level.</summary>
    <column order="0" name="InsPlanPrefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PlanNum" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum.</summary>
    </column>
    <column order="2" name="FKey" type="bigint(20)">
      <summary>FK to to a table associated with FKeyType</summary>
    </column>
    <column order="3" name="FKeyType" type="tinyint(4)">
      <summary>Enum:InsPlanPrefFKeyType ProcCodeNoBillIns</summary>
      <Enumeration name="InsPlanPrefFKeyType">
        <summary>The different types of overrides that can be created for an insurance plan.</summary>
        <EnumValue name="ProcCodeNoBillIns">0 - Overrides the procedurecode.NoBillIns field at the insurance plan level. FKey stores the CodeNum. ValueString stores NoBillInsOverride enum value.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ValueString" type="text">
      <summary>Used to hold the override. NoBillIns stores 0, 1.</summary>
    </column>
  </table>
  <table name="inssub">
    <summary>Multiple subscribers can have the same insurance plan.  But the patplan table is still what determines coverage for individual patients.</summary>
    <column order="0" name="InsSubNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PlanNum" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum.</summary>
    </column>
    <column order="2" name="Subscriber" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="3" name="DateEffective" type="date">
      <summary>Date plan became effective. Is 0001-01-01 if not set.</summary>
    </column>
    <column order="4" name="DateTerm" type="date">
      <summary>Date plan was terminated. Is 0001-01-01 if not set.</summary>
    </column>
    <column order="5" name="ReleaseInfo" type="tinyint(4)">
      <summary>Release of information signature is on file.</summary>
    </column>
    <column order="6" name="AssignBen" type="tinyint(4)">
      <summary>Assignment of benefits signature is on file.  For Canada, this handles Payee Code, F01.  Option to pay other third party is not included.</summary>
    </column>
    <column order="7" name="SubscriberID" type="varchar(255)">
      <summary>Number assigned by insurance company. No dashes. Not allowed to be blank.</summary>
    </column>
    <column order="8" 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.  Not at plan level because might be specific to subscriber.  If blank, we try to display a benefitNote for another subscriber to the plan.</summary>
    </column>
    <column order="9" name="SubscNote" type="text">
      <summary>Use to store any other info that affects coverage.</summary>
    </column>
    <column order="10" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="11" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="12" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="13" name="SecurityHash" type="varchar(255)">
      <summary>Holds the salted hash of the following inssub fields: PlanNum, Subscriber, SubscriberID, and DateTerm.</summary>
    </column>
  </table>
  <table name="installmentplan">
    <summary>Simpler than a payment plan.  Does not affect running account balances.  Allows override of finance charges.  Affects the "pay now" on statements.  Only one installmentplan is allowed for a family, attached to guarantor only.  This is loosely enforced.</summary>
    <column order="0" name="InstallmentPlanNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateAgreement" type="date">
      <summary>Date payment plan agreement was made.</summary>
    </column>
    <column order="3" name="DateFirstPayment" type="date">
      <summary>Date of first payment.</summary>
    </column>
    <column order="4" name="MonthlyPayment" type="double">
      <summary>Amount of monthly payment.</summary>
    </column>
    <column order="5" name="APR" type="float">
      <summary>Annual Percentage Rate. e.g. 12.</summary>
    </column>
    <column order="6" name="Note" type="varchar(255)">
      <summary>Note</summary>
    </column>
  </table>
  <table name="insverify">
    <summary>A row for the most recent time an insplan benefit or patplan enrollment was verified. Also see insverifyhist, which keeps a historical record. When a new plan is created, a row gets created here with no date. There is never more than one row per plan because old ones get moved over to InsVerifyHist.</summary>
    <column order="0" name="InsVerifyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateLastVerified" type="date">
      <summary>The date of the last successful verification. This date will be DateTime.MinVal upon insert and will not change until the user has verified insurance benefits or pat plan eligibility in FormInsVerificationList, or until the user has entered and saved a date in Eligibility Last Verified or Benefits Last Verified textboxes in FormInsPlan.</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. Typically 0. There is an optional feature that lets an office "assign" users to a verification so that they can split the load of verifying between different users.</summary>
    </column>
    <column order="3" name="VerifyType" type="tinyint(4)">
      <summary>Enum:VerifyTypes either InsuranceBenefits or PatientEnrollment</summary>
      <Enumeration name="VerifyTypes">
        <summary></summary>
        <EnumValue name="None">0.  This means FKey should be 0.</EnumValue>
        <EnumValue name="InsuranceBenefit">1.  This means FKey will link to insplan.PlanNum</EnumValue>
        <EnumValue name="PatientEnrollment">2.  This means FKey will link to patplan.PatPlanNum</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="FKey" type="bigint(20)">
      <summary>Foreign key either insplan.PlanNum or patplan.PatPlanNum.</summary>
    </column>
    <column order="5" name="DefNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Links to the category InsVerifyStatus</summary>
    </column>
    <column order="6" name="Note" type="text">
      <summary>Note for this insurance verification.</summary>
    </column>
    <column order="7" name="DateLastAssigned" type="datetime">
      <summary>Optional feature that's part of "assigning" users to verification. Default is DateTime.MinVal. The DateTime of when a userod.UserNum was last assigned/unassigned a patient's insverify in FormInsVerificationList, the last time the status was changed on the insverify, when a patient's patplan has been dropped, or whenever an error occurs when trying to batch verify patient benefits.</summary>
    </column>
    <column order="8" name="DateTimeEntry" type="datetime">
      <summary>DateTime the row was added.</summary>
    </column>
    <column order="9" name="HoursAvailableForVerification" type="double">
      <summary>Number of hours that were available from the time the insurance needed verified to the date of the appointment.
            Includes minutes if applicable.</summary>
    </column>
    <column order="10" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="11" name="SecurityHash" type="varchar(255)">
      <summary>Holds the salted hash of the following insverify fields: UserNum, DefNum, DateLastAssigned.</summary>
    </column>
  </table>
  <table name="insverifyhist">
    <summary>A historical copy of an insurance verification record.</summary>
    <column order="0" name="InsVerifyHistNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="InsVerifyNum" type="bigint(20)">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="2" name="DateLastVerified" type="date">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="3" name="UserNum" type="bigint(20)">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="4" name="VerifyType" type="tinyint(4)">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="5" name="FKey" type="bigint(20)">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="6" name="DefNum" type="bigint(20)">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="7" name="Note" type="text">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="8" name="DateLastAssigned" type="datetime">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="9" name="DateTimeEntry" type="datetime">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="10" name="HoursAvailableForVerification" type="double">
      <summary>Copied from InsVerify.</summary>
    </column>
    <column order="11" name="VerifyUserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  User that was logged on when row was inserted.</summary>
    </column>
    <column order="12" name="SecDateTEdit" type="timestamp">
      <summary>Not copied from Task. Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="13" name="SecurityHash" type="varchar(255)">
      <summary>Copied from InsVerify. When an InsVerifyHist is created, the 3 hashed fields remain unchanged, so this hash remains valid.</summary>
    </column>
  </table>
  <table name="intervention">
    <summary>An intervention ordered or performed.  Examples: smoking cessation and weightloss counseling.  Links to a definition in the ehrcode table using the CodeValue and CodeSystem.</summary>
    <column order="0" name="InterventionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. </summary>
    </column>
    <column order="3" name="CodeValue" type="varchar(30)">
      <summary>FK to ehrcode.CodeValue.  This code may not exist in the ehrcode table, it may have been chosen from a bigger list of available codes.  In that case, this will be a FK to a specific code system table identified by the CodeSystem column.  The code for this item from one of the code systems supported.  Examples: V65.3 or 418995006.</summary>
    </column>
    <column order="4" name="CodeSystem" type="varchar(30)" fk="codesystem">
      <summary>FK to codesystem.CodeSystemName. The code system name for this code.  Possible values are: CPT, HCPCS, ICD9CM, ICD10CM, and SNOMEDCT.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>User-entered details about the intervention for this patient.</summary>
    </column>
    <column order="6" name="DateEntry" type="date">
      <summary>The date of the intervention.</summary>
    </column>
    <column order="7" name="CodeSet" type="tinyint(4)">
      <summary>Enum:InterventionCodeSet AboveNormalWeight, BelowNormalWeight, TobaccoCessation, Nutrition, PhysicalActivity, Dialysis.</summary>
      <Enumeration name="InterventionCodeSet">
        <summary>Value sets for interventions.  This will limit the codes in FormInterventionEdit to a smaller list of codes and allow us to recommend codes to meet specific CQMs.</summary>
        <EnumValue name="AboveNormalWeight">0 - Above Normal Weight Follow-up/Referrals where weight assessment may occur</EnumValue>
        <EnumValue name="BelowNormalWeight">1 - Below Normal Weight Follow-up/Referrals where weight assessment may occur</EnumValue>
        <EnumValue name="Nutrition">2 - Counseling for Nutrition</EnumValue>
        <EnumValue name="PhysicalActivity">3 - Counseling for Physical Activity</EnumValue>
        <EnumValue name="TobaccoCessation">4 - Tobacco Use Cessation Counseling</EnumValue>
        <EnumValue name="Dialysis">5 - Dialysis Education/Other Services Related to Dialysis</EnumValue>
        <EnumValue name="None">6 - None</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="IsPatDeclined" type="tinyint(4)">
      <summary>Indicates whether the intervention was offered/recommended to the patient and the patient declined the treatment/referral.</summary>
    </column>
  </table>
  <table name="journalentry">
    <summary>Used in accounting to represent a single credit or debit entry.  There will always be at least 2 journal enties attached to every transaction.  All transactions balance to 0.</summary>
    <column order="0" name="JournalEntryNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TransactionNum" type="bigint(20)" fk="transaction">
      <summary>FK to transaction.TransactionNum</summary>
    </column>
    <column order="2" name="AccountNum" type="bigint(20)" fk="account">
      <summary>FK to account.AccountNum</summary>
    </column>
    <column order="3" name="DateDisplayed" type="date">
      <summary>Always the same for all journal entries within one transaction.</summary>
    </column>
    <column order="4" name="DebitAmt" type="double">
      <summary>Negative numbers never allowed.</summary>
    </column>
    <column order="5" name="CreditAmt" type="double">
      <summary>Negative numbers never allowed.</summary>
    </column>
    <column order="6" name="Memo" type="text">
      <summary>Was previously used as multi purpose for Payee and Notes also.</summary>
    </column>
    <column order="7" name="Splits" type="text">
      <summary>A human-readable description of the splits.  Used only for display purposes. Can be very large</summary>
    </column>
    <column order="8" name="CheckNumber" type="varchar(255)">
      <summary>Any user-defined string.  Usually a check number, but can also be D for deposit, Adj, etc.</summary>
    </column>
    <column order="9" name="ReconcileNum" type="bigint(20)" fk="reconcile">
      <summary>FK to reconcile.ReconcileNum. 0 if not attached to a reconcile. Not allowed to alter amounts if attached.</summary>
    </column>
    <column order="10" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user who created this journal entry.</summary>
    </column>
    <column order="11" name="SecDateTEntry" type="datetime">
      <summary>The date and time that this journal entry was created.</summary>
    </column>
    <column order="12" name="SecUserNumEdit" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user who last edited this journal entry.</summary>
    </column>
    <column order="13" name="SecDateTEdit" type="timestamp">
      <summary>The last time this journal entry was edited.</summary>
    </column>
    <column order="14" name="Payee" type="varchar(255)">
      <summary>Was previously mixed in with Memo. Limit 255 char.</summary>
    </column>
    <column order="15" name="Notes" type="text">
      <summary>Was previously mixed in with Memo. Limit 65k.</summary>
    </column>
  </table>
  <table name="labcase">
    <summary>A lab case.</summary>
    <column order="0" name="LabCaseNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="LaboratoryNum" type="bigint(20)" fk="laboratory">
      <summary>FK to laboratory.LaboratoryNum. The lab that the case gets sent to.  Required.</summary>
    </column>
    <column order="3" name="AptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum. This is how a lab case is attached to a scheduled appointment. Multiple labcases can be attached to any appointment. Labcase can exist without being attached to any appointments at all, making this zero.</summary>
    </column>
    <column order="4" name="PlannedAptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum.  This is how a lab case is attached to a planned appointment in addition to the scheduled appointment.</summary>
    </column>
    <column order="5" name="DateTimeDue" type="datetime">
      <summary>The due date that is put on the labslip.  NOT when you really need the labcase back, which is usually a day or two later and is the date of the appointment this case is attached to.</summary>
    </column>
    <column order="6" name="DateTimeCreated" type="datetime">
      <summary>When this lab case was created. User can edit.</summary>
    </column>
    <column order="7" name="DateTimeSent" type="datetime">
      <summary>Time that it actually went out to the lab.</summary>
    </column>
    <column order="8" name="DateTimeRecd" type="datetime">
      <summary>Date/time received back from the lab.  If this is filled, then the case is considered received.</summary>
    </column>
    <column order="9" name="DateTimeChecked" type="datetime">
      <summary>Date/time that quality was checked.  It is now completely ready for the patient.</summary>
    </column>
    <column order="10" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="11" name="Instructions" type="text">
      <summary>The text instructions for this labcase.</summary>
    </column>
    <column order="12" name="LabFee" type="double">
      <summary>This is used for tracking and informational purposes only. The fee is not used in any calculation.</summary>
    </column>
    <column order="13" name="DateTStamp" type="timestamp">
      <summary>Automatically updated whenever a row is added or changed.  Not user editable.</summary>
    </column>
    <column order="14" name="InvoiceNum" type="varchar(255)">
      <summary>Optional invoice number</summary>
    </column>
  </table>
  <table name="laboratory">
    <summary>A dental laboratory. Will be attached to lab cases.</summary>
    <column order="0" name="LaboratoryNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Description of lab.</summary>
    </column>
    <column order="2" name="Phone" type="varchar(255)">
      <summary>Freeform text includes punctuation.</summary>
    </column>
    <column order="3" name="Notes" type="text">
      <summary>Any notes.  No practical limit to amount of text.</summary>
    </column>
    <column order="4" name="Slip" type="bigint(20)" fk="sheetdef">
      <summary>FK to sheetdef.SheetDefNum.  Lab slips can be set for individual laboratories.  If zero, then the default internal lab slip will be used instead of a custom lab slip.</summary>
    </column>
    <column order="5" name="Address" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="6" name="City" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="7" name="State" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="8" name="Zip" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="9" name="Email" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="10" name="WirelessPhone" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="11" name="IsHidden" type="tinyint(4)">
      <summary>.</summary>
    </column>
  </table>
  <table name="labpanel">
    <summary>One lab panel comes back from the lab with multiple lab results.  Multiple panels can come back in one HL7 message.  This table loosely corresponds to the OBR segment.</summary>
    <column order="0" name="LabPanelNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="RawMessage" type="text">
      <summary>The entire raw HL7 message.  Can contain other labpanels in addition to this one.</summary>
    </column>
    <column order="3" name="LabNameAddress" type="varchar(255)">
      <summary>Both name and address in a single field.  OBR-20.</summary>
    </column>
    <column order="4" name="DateTStamp" type="timestamp">
      <summary>To be used for synch with web server.</summary>
    </column>
    <column order="5" name="SpecimenCondition" type="varchar(255)">
      <summary>OBR-13.  Usually blank.  Example: hemolyzed.</summary>
    </column>
    <column order="6" name="SpecimenSource" type="varchar(255)">
      <summary>OBR-15.  Usually blank.  Example: LNA&amp;Arterial Catheter&amp;HL70070.</summary>
    </column>
    <column order="7" name="ServiceId" type="varchar(255)">
      <summary>OBR-4-0, Service performed, id portion, LOINC.  For example, 24331-1.</summary>
    </column>
    <column order="8" name="ServiceName" type="varchar(255)">
      <summary>OBR-4-1, Service performed description.  Example, Lipid Panel.</summary>
    </column>
    <column order="9" name="MedicalOrderNum" type="bigint(20)" fk="medicalorder">
      <summary>FK to medicalorder.MedicalOrderNum.  Used to attach in imported lab panel to a lab order.  Multiple panels may be attached to an order.</summary>
    </column>
  </table>
  <table name="labresult">
    <summary>Medical labs, not dental labs.  Multiple labresults are attached to a labpanel.  Loosely corresponds to the OBX segment in HL7.</summary>
    <column order="0" name="LabResultNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="LabPanelNum" type="bigint(20)" fk="labpanel">
      <summary>FK to labpanel.LabPanelNum.</summary>
    </column>
    <column order="2" name="DateTimeTest" type="datetime">
      <summary>OBX-14.</summary>
    </column>
    <column order="3" name="TestName" type="varchar(255)">
      <summary>OBX-3-1, text portion.</summary>
    </column>
    <column order="4" name="DateTStamp" type="timestamp">
      <summary>To be used for synch with web server.</summary>
    </column>
    <column order="5" name="TestID" type="varchar(255)">
      <summary>OBX-3-0, id portion, LOINC.  For example, 10676-5.</summary>
    </column>
    <column order="6" name="ObsValue" type="varchar(255)">
      <summary>OBX-5. Value always stored as a string because the type might vary in the future.</summary>
    </column>
    <column order="7" name="ObsUnits" type="varchar(255)">
      <summary>OBX-6  For example, mL.  Was FK to drugunit.DrugUnitNum, but that would make reliable import problematic, so now it's just text.</summary>
    </column>
    <column order="8" name="ObsRange" type="varchar(255)">
      <summary>OBX-7  For example, &lt;200 or &gt;=40.</summary>
    </column>
    <column order="9" name="AbnormalFlag" type="tinyint(4)">
      <summary>Enum:LabAbnormalFlag 0-None, 1-Below, 2-Normal, 3-Above.</summary>
      <Enumeration name="LabAbnormalFlag">
        <summary></summary>
        <EnumValue name="None">0-No value.</EnumValue>
        <EnumValue name="Below">1-Below normal.</EnumValue>
        <EnumValue name="Normal">2-Normal.</EnumValue>
        <EnumValue name="Above">3-Above high normal.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="labturnaround">
    <summary>The amount of time it takes for a lab case to be processed at the lab.  Used to compute due dates.</summary>
    <column order="0" name="LabTurnaroundNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="LaboratoryNum" type="bigint(20)" fk="laboratory">
      <summary>FK to laboratory.LaboratoryNum. The lab that this item is attached to.</summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>The description of the service that the lab is performing.</summary>
    </column>
    <column order="3" name="DaysPublished" type="smallint(6)">
      <summary>The number of days that the lab publishes as the turnaround time for the service.</summary>
    </column>
    <column order="4" name="DaysActual" type="smallint(6)">
      <summary>The actual number of days.  Might be longer than DaysPublished due to travel time.  This is what the actual calculations will be done on.</summary>
    </column>
  </table>
  <table name="language">
    <summary>This is a list of phrases that need to be translated.  The primary key is a combination of the ClassType and the English phrase.  This table is currently filled dynmically at run time, but the plan is to fill it using a tool that parses the code.</summary>
    <column order="0" name="LanguageNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EnglishComments" type="text">
      <summary>No longer used.</summary>
    </column>
    <column order="2" name="ClassType" type="text">
      <summary>A string representing the class where the translation is used.</summary>
    </column>
    <column order="3" name="English" type="text">
      <summary>The English version of the phrase, case sensitive.</summary>
    </column>
    <column order="4" name="IsObsolete" type="tinyint">
      <summary>As this gets more sophisticated, we will use this field to mark some phrases obsolete instead of just deleting them outright.  That way, translators will still have access to them.  For now, this is not used at all.</summary>
    </column>
  </table>
  <table name="languageforeign">
    <summary>Will usually only contain translations for a single foreign language, although more are allowed.  The primary key is a combination of the ClassType and the English phrase and the culture.</summary>
    <column order="0" name="LanguageForeignNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClassType" type="text">
      <summary>A string representing the class where the translation is used.</summary>
    </column>
    <column order="2" name="English" type="text">
      <summary>The English version of the phrase.  Case sensitive.</summary>
    </column>
    <column order="3" name="Culture" type="varchar(255)">
      <summary>The specific culture name.  Almost always in 5 digit format like this: en-US.</summary>
    </column>
    <column order="4" name="Translation" type="text">
      <summary>The foreign translation.  Remember we use Unicode-8, so this translation can be in any language, including Russian, Hebrew, and Chinese.</summary>
    </column>
    <column order="5" name="Comments" type="text">
      <summary>Comments for other translators for the foreign language.</summary>
    </column>
  </table>
  <table name="languagepat">
    <summary>Practice-defined translations for text shown to patients. Unlike Language and LanguageForeign, which translate Open Dental's interface to a practice's preferred language, LanguagePat allows practices to customize translations of messages and information displayed to patients in their preferred language. Used right now for about 30 prefs for things like email messages. Also used for EForms. So either PrefName will be empty or EFormFieldDefNum will be 0. Sheets are translated differently, by making a copy of each SheetFieldDef used for each language.</summary>
    <column order="0" name="LanguagePatNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PrefName" type="varchar(255)">
      <summary>FK to pref.PrefName. There are about 30 of these in use. This allows us to translate the value stored for templates like email, postcard, text, etc. Will be empty string if this is an eForm translation.&gt;</summary>
    </column>
    <column order="2" name="Language" type="varchar(255)">
      <summary>Three-letter language name or custom language name.  The custom language name is the full string name and is not necessarily supported by Microsoft.
            This will typically be matched to the patient's preferred language to select the appropriate translation.
            Three-letter language name examples: eng (English), spa (Spanish), fra (French).Custom language name examples: Tahitian, American Sign Language, Morse Code.
            The LanguagesUsedByPatients preference stores the three-letter names that the practice chooses to support.
            </summary>
    </column>
    <column order="3" name="Translation" type="text">
      <summary>The translated text. Max 65,000 characters. Might store complex email templates.</summary>
    </column>
    <column order="4" name="EFormFieldDefNum" type="bigint(20)" fk="eformfielddef">
      <summary>FK to eformfielddef.EFormFieldDefNum. This is how eForms get translated. Once a def is converted to an eForm, this is not needed. The eForm fields have all the translated text. Will be 0 if this is a pref translation.</summary>
    </column>
  </table>
  <table name="letter">
    <summary>These are templates that are used to send simple letters to patients.</summary>
    <column order="0" name="LetterNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Description of the Letter.</summary>
    </column>
    <column order="2" name="BodyText" type="text">
      <summary>Text of the letter</summary>
    </column>
  </table>
  <table name="lettermerge">
    <summary>Describes the templates for letter merges to Word.</summary>
    <column order="0" name="LetterMergeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Description of this letter.</summary>
    </column>
    <column order="2" name="TemplateName" type="varchar(255)">
      <summary>The filename of the Word template. eg MyTemplate.doc.</summary>
    </column>
    <column order="3" name="DataFileName" type="varchar(255)">
      <summary>The name of the data file. eg MyTemplate.txt.</summary>
    </column>
    <column order="4" name="Category" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.</summary>
    </column>
    <column order="5" name="ImageFolder" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. This determines the default Image Category that will be selected when printing or previewing the letter.
            Can be 0 which means 'None' will be selected.</summary>
    </column>
  </table>
  <table name="lettermergefield">
    <summary>When doing a lettermerge, a data file is created with certain fields.  This is a list of those fields for each lettermerge.</summary>
    <column order="0" name="FieldNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="LetterMergeNum" type="bigint(20)" fk="lettermerge">
      <summary>FK to lettermerge.LetterMergeNum.</summary>
    </column>
    <column order="2" name="FieldName" type="varchar(255)">
      <summary>One of the preset available field names.</summary>
    </column>
  </table>
  <table name="limitedbetafeature">
    <summary>Limited Beta features are specific parts of the OpenDental suite of services that are locked behind a registration process while the feature undergoes improvement or further testing. This registration process is done through HQ working with a customer to determine if they will be a good candidate to use and test this feature before it's full release. If they are a good candidate, a row is inserted into their database that will allow them access to the feature. LimitedBetaFeatures get inserted during the nightly synch with our eServiceSignups. This is done in our call to WebServiceMainHQProxy.GetEServiceSetupFull. The nightly synch is the only place these rows get altered.</summary>
    <column order="0" name="LimitedBetaFeatureNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="1" name="LimitedBetaFeatureTypeNum" type="bigint(20)">
      <summary>Stores the integer value of the LimitedBetaFeatureEnum. This is done to prevent out of bounds exceptions due to versioning.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)">
      <summary>ClinicNum that is signed up for the feature. Clinic independant features only have one row with a clinicNum of -1.</summary>
    </column>
    <column order="3" name="IsSignedUp" type="tinyint(4)">
      <summary>An office is considered signed up if they have a valid version to be using this feature on, the feature is on limited beta, and they've signed up with HQ.</summary>
    </column>
  </table>
  <table name="loginattempt">
    <summary>Keeps track of failed login attempts.</summary>
    <column order="0" name="LoginAttemptNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserName" type="varchar(255)">
      <summary>The username that was attempted. May not be a username that exists.</summary>
    </column>
    <column order="2" name="LoginType" type="tinyint(4)">
      <summary>Enum:UserWebFKeyType The part of the program where an attempt was made. If we want to use this for other parts of the program
            that are do not use the userweb table, we can change this enum to a different one.</summary>
      <Enumeration name="UserWebFKeyType">
        <summary>The type of row that identifies which table FKey links to.</summary>
        <EnumValue name="Undefined">This is a default value that should never be saved into the table.</EnumValue>
        <EnumValue name="PatientPortal">FK to patient.PatNum</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="DateTFail" type="datetime">
      <summary>When the failed attempt was attempted.</summary>
    </column>
  </table>
  <table name="loinc">
    <summary>Logical Observation Identifiers Names and Codes (LOINC) used to identify both lab panels and lab results. Widths specified are from LOINC documentation and may not represent length of fields in the Open Dental Database.</summary>
    <column order="0" name="LoincNum" type="bigint(20)">
      <summary>Primary key. Internal use only.</summary>
    </column>
    <column order="1" name="LoincCode" type="varchar(255)">
      <summary>#EULA REQUIRED# Also called LOINC_NUM in the official LOINCDB. Width-10. LOINC244 column 1.</summary>
    </column>
    <column order="2" name="Component" type="varchar(255)">
      <summary>#EULA REQUIRED# First Major axis:component or analyte. Width-255. LOINC244 column 2.</summary>
    </column>
    <column order="3" name="PropertyObserved" type="varchar(255)">
      <summary>#EULA REQUIRED# Second major axis:property observed (e.g., mass vs. substance). Width-30. LOINC244 column 3.</summary>
    </column>
    <column order="4" name="TimeAspct" type="varchar(255)">
      <summary>#EULA REQUIRED# Third major axis:timing of the measurement (e.g., point in time vs 24 hours). Width-15. LOINC244 column 4.</summary>
    </column>
    <column order="5" name="SystemMeasured" type="varchar(255)">
      <summary>#EULA REQUIRED# Fourth major axis:type of specimen or system (e.g., serum vs urine). Width-100 LOINC244. column 5.</summary>
    </column>
    <column order="6" name="ScaleType" type="varchar(255)">
      <summary>#EULA REQUIRED# Fifth major axis:scale of measurement (e.g., qualitative vs. quantitative). Width-30. LOINC244 column 6.</summary>
    </column>
    <column order="7" name="MethodType" type="varchar(255)">
      <summary>#EULA REQUIRED# Sixth major axis:method of measurement. Width-50. LOINC244 column 7.</summary>
    </column>
    <column order="8" name="StatusOfCode" type="varchar(255)">
      <summary>#EULA REQUIRED# Width-10. LOINC244 column 13.ACTIVE = Concept is active. Use at will.TRIAL = Concept is experimental in nature. Use with caution as the concept and associated attributes may change. DISCOURAGED = Concept is not recommended for current use. New mappings to this concept are discouraged; although existing may mappings may continue to be valid in context. Wherever  possible, the superseding concept is indicated in the MAP_TO field in the MAP_TO table (see Table 28b) and should be used instead. DEPRECATED = Concept is deprecated. Concept should not be used, but it is retained in LOINC for historical purposes. Wherever possible, the superseding concept is indicated in the MAP_TO field (see Table 28b) and should be used both for new mappings and updating existing implementations..</summary>
    </column>
    <column order="9" name="NameShort" type="varchar(255)">
      <summary>#EULA REQUIRED# Introduced in version 2.07, this field is a concatenation of the fully specified LOINC name. The field width may change in a future release. Width 40. LOINC244 column 29.</summary>
    </column>
    <column order="10" name="ClassType" type="varchar(255)">
      <summary>1=Laboratory class; 2=Clinical class; 3=Claims attachments; 4=Surveys. LOINC244 column 16.</summary>
    </column>
    <column order="11" name="UnitsRequired" type="tinyint(4)">
      <summary>Y/N field that indicates that units are required when this LOINC is included as an OBX segment in a HIPAA attachment. LOINC244 column 26.</summary>
    </column>
    <column order="12" name="OrderObs" type="varchar(255)">
      <summary>Defines term as order only, observation only, or both. A fourth category, Subset, is used for terms that are subsets of a panel but do not represent a package that is known to be orderable we have defined them only to make it easier to maintain panels or other sets within the LOINC construct. LOINC244 column 30.</summary>
    </column>
    <column order="13" name="HL7FieldSubfieldID" type="varchar(255)">
      <summary>A value in this field means that the content should be delivered in the named field/subfield of the HL7 message. When NULL, the data for this data element should be sent in an OBX segment with this LOINC code stored in OBX-3 and with the value in the OBX-5. Width 50. LOINC244 column 32.</summary>
    </column>
    <column order="14" name="ExternalCopyrightNotice" type="text">
      <summary>External copyright holders copyright notice for this LOINC code. LOINC244 column 33.</summary>
    </column>
    <column order="15" name="NameLongCommon" type="varchar(255)">
      <summary>This field contains the LOINC term in a more readable format than the fully specified name. The long common names have been created via a table driven algorithmic process. Most abbreviations and acronyms that are used in the LOINC database have been fully spelled out in English. Width 255. LOINC244 column 35.</summary>
    </column>
    <column order="16" name="UnitsUCUM" type="varchar(255)">
      <summary>The Unified Code for Units of Measure (UCUM) is a code system intended to include all units of measures being contemporarily used in international science, engineering, and business. (www.unitsofmeasure.org ) This field contains example units of measures for this term expressed as UCUM units. Width 255. LOINC244 column 1.</summary>
    </column>
    <column order="17" name="RankCommonTests" type="int(11)">
      <summary>Ranking of approximately 2000 common tests performed by laboratories in USA. LOINC244 column 45.</summary>
    </column>
    <column order="18" name="RankCommonOrders" type="int(11)">
      <summary>Ranking of approximately 300 common orders performed by laboratories in USA. LOINC244 column 46.</summary>
    </column>
  </table>
  <table name="medicalorder">
    <summary>Ehr. Lab and radiology orders.  Medication orders are simply fields in medicationPat.</summary>
    <column order="0" name="MedicalOrderNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MedOrderType" type="tinyint(4)">
      <summary>Enum:MedicalOrderType Laboratory=0,Radiology=1.</summary>
      <Enumeration name="MedicalOrderType">
        <summary></summary>
        <EnumValue name="Laboratory">0- Laboratory</EnumValue>
        <EnumValue name="Radiology">1- Radiology</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="3" name="DateTimeOrder" type="datetime">
      <summary>Date and time of order.</summary>
    </column>
    <column order="4" name="Description" type="varchar(255)">
      <summary>User will be required to type entire order out from scratch.</summary>
    </column>
    <column order="5" name="IsDiscontinued" type="tinyint(4)">
      <summary>EHR requires Active/Discontinued status. 0=Active, 1=Discontinued.</summary>
    </column>
    <column order="6" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
  </table>
  <table name="medication">
    <summary>A list of medications, not attached to any particular patient.  Not allowed to delete if in use by a patient.  Not allowed to edit name once created due to possibility of damage to patient record.</summary>
    <column order="0" name="MedicationNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MedName" type="varchar(255)">
      <summary>Name of the medication.  User can change this.  If an RxCui is present, the RxNorm string can be pulled from the in-memory table for UI display in addition to the MedName.</summary>
    </column>
    <column order="2" name="GenericNum" type="bigint(20)" fk="medication">
      <summary>FK to medication.MedicationNum.  Cannot be zero.
            If this is a generic drug, then the GenericNum will be the same as the MedicationNum.
            Otherwise, if this is a brand drug, then the GenericNum will be a non-zero value corresponding to another medicaiton.</summary>
    </column>
    <column order="3" name="Notes" type="text">
      <summary>Examples: interactions, drug class, contraindications, etc.  Not typically for dosage.  Mg, times per days, etc. typically entered into MedicationPat.PatNote.</summary>
    </column>
    <column order="4" name="DateTStamp" type="timestamp">
      <summary>The last date and time this row was altered.  Not user editable.</summary>
    </column>
    <column order="5" name="RxCui" type="bigint(20)">
      <summary>RxNorm Code identifier.  We should have used a string type.  Used by EHR in CQM.  But the queries should use medicationpat.RxCui, NOT this RxCui, because all medicationpats (meds and orders) coming back from Ensora will not have a FK to this medication table.  When this RxCui is modified by the user, then medicationpat.RxCui is automatically updated where medicationpat.MedicationNum matches this medication.</summary>
    </column>
    <column order="6" name="IsHidden" type="tinyint(4)">
      <summary>.</summary>
    </column>
  </table>
  <table name="medicationpat">
    <summary>Links medications to patients.  For ehr, some of these can be considered 'medication orders', but only if they contain a PatNote (instructions), a ProvNum, and a DateStart.</summary>
    <column order="0" name="MedicationPatNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="MedicationNum" type="bigint(20)" fk="medication">
      <summary>FK to medication.MedicationNum.  If 0, implies that the medication order came from eRx.  This was done to allow MU2 measures to be set by either creating a medication from the medical window or by creating a manual prescription.</summary>
    </column>
    <column order="3" name="PatNote" type="text">
      <summary>Medication notes specific to this patient. Example: 10 mg tablets, two tabs 3 times per day</summary>
    </column>
    <column order="4" name="DateTStamp" type="timestamp">
      <summary>The last date and time this row was altered.  Not user editable.</summary>
    </column>
    <column order="5" name="DateStart" type="date">
      <summary>Date that the medication was started.  Can be minval if unknown.</summary>
    </column>
    <column order="6" name="DateStop" type="date">
      <summary>Date that the medication was stopped.  Can be minval if unknown.  If minval, then the medication is not "discontinued".  If prior to today, then the medication is "discontinued".  If today or a future date, then not discontinued yet.</summary>
    </column>
    <column order="7" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. Can be 0. Gets set to the patient's primary provider when adding a new med.  If adding the med from EHR, gets set to the ProvNum of the logged-in user.</summary>
    </column>
    <column order="8" name="MedDescript" type="varchar(255)">
      <summary>Used for eRx and eForm import. In these cases, MedicationNum=0.</summary>
    </column>
    <column order="9" name="RxCui" type="bigint(20)">
      <summary>For Ensora medical orders, corresponds to the RxCui of the prescription (Ensora only returns a value sometimes).  Otherwise, this field is synched with the medication.RxCui field based on medication.MedicationNum.  We should have used a string type.  The only purpose of this field is so that when CCDs are created, we have structured data to put in the XML, not just plain text.  Allergies exported in CCD do not look at this table, but only at the medication table.  Medications require MedicationPat.RxCui or Medication.RxCui to be exported on CCD.</summary>
    </column>
    <column order="10" name="ErxGuid" type="varchar(255)">
      <summary>Uniquely identifies the prescription corresponding to the medical order.
            Allows us to update existing eRx medical orders when refreshing prescriptions in the Chart (similar to how prescriptions are updated).
            Also used in 2-way medication synching with eRx.</summary>
    </column>
    <column order="11" name="IsCpoe" type="tinyint(4)">
      <summary>If eRx is used to prescribe a medication, a medication order is imported automatically into Open Dental.  If a provider is logged in, then this is CPOE (Computerized Provider Order Entry), and this will be true.   Or, if a provider is logged in and Rx entered through OD, it's also CPOE.  If a staff person is logged in, and enters an Rx through Ensora or OD, then this is non-CPOE, so false.</summary>
    </column>
  </table>
  <table name="medlab">
    <summary>The EHRLab table is structured to tightly with the HL7 standard and should have names that more reflect how the user will
            consume the data and for that reason for actual implementation we are using these medlab tables.
            Medical lab observation order.  This table is currently only used for LabCorp, but may be utilized by other third party lab
            services in the future.  These are the fields required for the LabCorp result report, used to link the order to the result(s),
            specimen(s), place(s) of service, or for linking parent and child results.
            This table contains data from the PID, ORC, OBR, and applicable NTE segments
            
             </summary>
    <column order="0" name="MedLabNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SendingApp" type="varchar(255)">
      <summary>MSH-2 - Sending Application.  Used to identify the LabCorp Lab System sending the results.
            Possible values for LabCorp (as of their v10.7 specs): '1100' - LabCorp Lab System, 'DIANON' - DIANON Systems,
            'ADL' - Acupath Diagnostic Laboratories, 'EGL' - Esoterix Genetic Laboratories.
            For backward compatibility only: 'CMBP', 'LITHOLINK', 'USLABS'</summary>
    </column>
    <column order="2" name="SendingFacility" type="varchar(255)">
      <summary>MSH-3 - Sending Facility.  Identifies the LabCorp laboratory responsible for the client.
            It could be a LabCorp assigned 'Responsible Lab Code' representing the responsible laboratory or it could be a CLIA number.</summary>
    </column>
    <column order="3" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  PID.2 - External Patient ID. LabCorp report field "Client Alt. Pat ID".</summary>
    </column>
    <column order="4" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Can be 0. Attempt to match ordering prov external IDs to internal provnum.</summary>
    </column>
    <column order="5" name="PatIDLab" type="varchar(255)">
      <summary>PID.3 - Lab Assigned Patient Id.  LabCorp report field "Specimen Number".  LabCorp assigned, alpha numeric specimen number.</summary>
    </column>
    <column order="6" name="PatIDAlt" type="varchar(255)">
      <summary>PID.4 - Alternate Patient ID.  LabCorp report field "Patient ID".  Alternate patient ID.</summary>
    </column>
    <column order="7" name="PatAge" type="varchar(255)">
      <summary>PID.7.2/7.3/7.4 - Patient Age Years/Months/Days.  LabCorp report field "Age (Y/M/D)".  YYY/MM/DD format.  Three chars for years,
            2 each for months and days.  Some tests require age for calculation of result.  This will be the age at the time of the test, so we will use
            the values in the message instead of re-calculating..</summary>
    </column>
    <column order="8" name="PatAccountNum" type="varchar(255)">
      <summary>PID.18.1 - Account Number.  LabCorp report field "Account Number".  LabCorp Client ID, 8 digit account number.</summary>
    </column>
    <column order="9" name="PatFasting" type="tinyint(4)">
      <summary>PID.18.7 - Fasting.  LabCorp report field "Fasting".  Y, N, or blank.
            A blank component will be stored as 0 - Unknown, the result report fasting field will be blank.</summary>
    </column>
    <column order="10" name="SpecimenID" type="varchar(255)">
      <summary>ORC.2.1 and OBR.2.1 - Unique Foreign Accession or Specimen ID.  LabCorp report field "Client Accession (ACC)".
            ID sent on the specimen container.</summary>
    </column>
    <column order="11" name="SpecimenIDFiller" type="varchar(255)">
      <summary>ORC.3.1 and OBR.3.1 - Internal (to LabCorp for example)/Filler Accession or Specimen ID.
            LabCorp assigned specimen number, reused on a yearly basis.</summary>
    </column>
    <column order="12" name="ObsTestID" type="varchar(255)">
      <summary>OBR.4.1 - Observation Battery Identifier.  Reflex result will have this value in OBR.29 to link the reflex to the parent.</summary>
    </column>
    <column order="13" name="ObsTestDescript" type="varchar(255)">
      <summary>OBR.4.2 - Observation Battery Text.  LabCorp report field "Tests Ordered".</summary>
    </column>
    <column order="14" name="ObsTestLoinc" type="varchar(255)">
      <summary>OBR.4.4 - Alternate Battery Identifier (LOINC).  This is the LOINC code for the test performed.
            When displaying the results, LabCorp requires OBR.4.2, the text name of the test to be displayed, not the LOINC code.
            But we will store it so we can link to the LOINC code table for reporting purposes.</summary>
    </column>
    <column order="15" name="ObsTestLoincText" type="varchar(255)">
      <summary>OBR.4.5 - Alternate Observation Battery Text (LOINC Description).  The LOINC code description for the test performed.
            We will display OBR.4.2 per LabCorp requirements, but we will store this description for reporting purposes.</summary>
    </column>
    <column order="16" name="DateTimeCollected" type="datetime">
      <summary>OBR.7 - Observation/Specimen Collection Date/Time.  LabCorp report field "Date &amp; Time Collected".
            yyyyMMddHHmm format in the message, no seconds.  May be blank.</summary>
    </column>
    <column order="17" name="TotalVolume" type="varchar(255)">
      <summary>OBR.9 - Collection/Urine Volume (Quantity/Field Value).  LabCorp report field "Total Volume".
            The LabCorp document says this field is "Numeric Characters", but the HL7 documentation data type as CQ, which is a number with units
            in the form of Quantity^Units.  The Units component has subcomponents: ID&amp;Text&amp;Name of Coding System&amp;Alt ID&amp;Alt Text&amp;
            Name of Alt Coding System&amp;Coding System Version ID&amp;Alt Coding System Version ID&amp;Original Text.
            We will make this a string column and store the Quantity with the Units ID subcomponent if present.
            The default unit of measurement is ML, so if the field is a number only we will add ML.</summary>
    </column>
    <column order="18" name="ActionCode" type="varchar(255)">
      <summary>Enum:ResultAction OBR.11 - Action Code.  Blank for normal result, "G" for reflex result.</summary>
      <Enumeration name="ResultAction">
        <summary>Order Result Action Code.  To identify the type of result being returned.</summary>
        <EnumValue name="None">0 - None.  Standard results will be blank.</EnumValue>
        <EnumValue name="A">1 - Add On.  Limited usage and not applicable for all add on tests.</EnumValue>
        <EnumValue name="G">2 - Reflex.  Lab generated result for test not on the original order.</EnumValue>
      </Enumeration>
    </column>
    <column order="19" name="ClinicalInfo" type="varchar(255)">
      <summary>OBR.13.1 - Relevant Clinical Information.  LabCorp report field "Additional Information".  The report field will be filled with this
            value from the first OBR record in the message.  The message limits this field to 64 characters, the rest is truncated.</summary>
    </column>
    <column order="20" name="DateTimeEntered" type="datetime">
      <summary>OBR.14 - Date/Time of Specimen Receipt in Lab.  LabCorp report field "Date Entered".  yyyyMMddHHmm format in the message, no seconds.
            Date and time the order was entered in the Lab System.</summary>
    </column>
    <column order="21" name="OrderingProvNPI" type="varchar(255)">
      <summary>ORC.12.1 and OBR.16.1 - Ordering Provider ID Number.  LabCorp report field "NPI".  ORC.12.* and OBR.16.* are repeatable, the eighth
            component identifies the source of the ID in the first component.  Component 8 possible values: "U"-UPIN,
            "P"-Provider Number (Medicaid or Commercial Ins Provider ID), "N"-NPI (Required for third party billing), "L"-Local (Physician ID).</summary>
    </column>
    <column order="22" name="OrderingProvLocalID" type="varchar(255)">
      <summary>ORC.12.1 and OBR.16.1 - Ordering Provider ID Number.  LabCorp report field "Physician ID".  ORC.12.* and OBR.16.* are repeatable,
            the eighth component identifies the source of the ID in the first component.  Component 8 possible values: "U"-UPIN,
            "P"-Provider Number (Medicaid or Commercial Ins Provider ID), "N"-NPI (Required for third party billing), "L"-Local (Physician ID).</summary>
    </column>
    <column order="23" name="OrderingProvLName" type="varchar(255)">
      <summary>ORC.12.2 and OBR.16.2 - Ordering Provider Last Name.  LabCorp report field "Physician Name".  Last, First.</summary>
    </column>
    <column order="24" name="OrderingProvFName" type="varchar(255)">
      <summary>ORC.12.3 and OBR.16.3 - Ordering Provider First Initial.  LabCorp report field "Physician Name".  Last, First.</summary>
    </column>
    <column order="25" name="SpecimenIDAlt" type="varchar(255)">
      <summary>OBR.18 - Alternate Unique Foreign Accession / Specimen ID.  LabCorp report field "Control Number".</summary>
    </column>
    <column order="26" name="DateTimeReported" type="datetime">
      <summary>OBR.22 - Date/Time Observations Reported.  LabCorp report field "Date &amp; Time Reported".  yyyyMMddHHmm format in the message, no secs.
            Date and time the results were released from the Lab System.</summary>
    </column>
    <column order="27" name="ResultStatus" type="varchar(255)">
      <summary>Enum:ResultStatus OBR.25 - Order Result Status.  LabCorp possible values: "F" - Final, "P" - Preliminary, "X" - Cancelled, "C" - Corrected.</summary>
      <Enumeration name="ResultStatus">
        <summary>Order Result Status.  Identification of status of results at the ordered item level.</summary>
        <EnumValue name="C">0 - Corrected Result.</EnumValue>
        <EnumValue name="F">1 - Final.  Result complete and verified.</EnumValue>
        <EnumValue name="I">2 - Incomplete.  For Discrete Microbiology Testing.</EnumValue>
        <EnumValue name="P">3 - Preliminary.  Final not yet obtained.</EnumValue>
        <EnumValue name="X">4 - Canceled.  Procedure cannot be done.  Result canceled due to Non-Performance.</EnumValue>
      </Enumeration>
    </column>
    <column order="28" name="ParentObsID" type="varchar(255)">
      <summary>OBR.26.1 - Link to Parent Result or Organism Link to Susceptibility.
            A reflex test will have the parent's OBX.3.1 value here for linking.</summary>
    </column>
    <column order="29" name="ParentObsTestID" type="varchar(255)">
      <summary>OBR.29 - Link to Parent Order.  A reflex test will have the value from OBR.4.1 of the original order in this field for linking.</summary>
    </column>
    <column order="30" name="NotePat" type="text">
      <summary>NTE.3 - Comment Text, PID Level.  The NTE segment is repeatable and the Comment Text component is limited to 78 characters.  Multiple
            NTE segments can be used for longer comments.  All NTE segments at the PID level will be concatenated and stored in this one field.</summary>
    </column>
    <column order="31" name="NoteLab" type="text">
      <summary>NTE.3 - Comment Text, OBR level.  The NTE segment is repeatable and the Comment Text component is limited to 78 characters.  Multiple
            NTE segments can be used for longer comments.  All NTE segments at the OBR level will be concatenated and stored in this one field.</summary>
    </column>
    <column order="32" name="FileName" type="varchar(255)">
      <summary>Not unique. More than one MedLab object can point to the same FileName, so deleting the MedLab object does not necessarily mean the
            file can also be deleted.  This is the filename of the original archived message that was processed to create this medlab object as well as
            associated medlabresult, medlabspecimen, and medlabfacility obects.  The files will be stored in the OpenDentImages folder in a sub-folder
            called MedLabHL7.  If a message is processed correctly it will be moved into the sub-folder MedLabHL7/Processed.  Any message that remains in
            the MedLabHL7 folder and aren't moved into the Processed folder failed at some point during processing.  If the option to store images directly
            in the database is chosen, this will be an empty field and there will not be the option to display the original HL7 message.  
            This is a relative file path from the ImageStore.GetPreferredAtoZpath(), 
            Example: "MedLabHL7/FileName.txt" OR "MedLabHL7/Processed/FileName.txt" 
            Use: string pathToFile=ODFileUtils.CombinePaths(ImageStore.GetPreferredAtoZpath(),FileName)</summary>
    </column>
    <column order="33" name="OriginalPIDSegment" type="text">
      <summary>The PID Segment from the HL7 message used to generate this MedLab object.</summary>
    </column>
  </table>
  <table name="medlabfacattach">
    <summary>Links a MedLab or a MedLabResult to a place of service.  Either the MedLabNum OR the MedLabResultNum column will be populated, never
            both, so this will link the facility to EITHER a MedLab OR a MedLabResult object.
            Every MedLab and MedLabResult will have 1 to many laboratories attached.</summary>
    <column order="0" name="MedLabFacAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MedLabNum" type="bigint(20)" fk="medlab">
      <summary>FK to medlab.MedLabNum.</summary>
    </column>
    <column order="2" name="MedLabResultNum" type="bigint(20)" fk="medlabresult">
      <summary>FK to medlabresult.MedLabResultNum.</summary>
    </column>
    <column order="3" name="MedLabFacilityNum" type="bigint(20)" fk="medlabfacility">
      <summary>FK to medlabfacility.MedLabFacilityNum.</summary>
    </column>
  </table>
  <table name="medlabfacility">
    <summary>Medical lab facility that performed the test procedure(s).  Contains data from the ZPS segment.  Each MedLab object can have one to
            many places of service, each in a repetition of the ZPS segment.  Each repetition will be its own row in this table.</summary>
    <column order="0" name="MedLabFacilityNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FacilityName" type="varchar(255)">
      <summary>ZPS.3 - Facility Name.  Medical lab location name that performed the testing.</summary>
    </column>
    <column order="2" name="Address" type="varchar(255)">
      <summary>ZPS.4.1 - Facility Address.</summary>
    </column>
    <column order="3" name="City" type="varchar(255)">
      <summary>ZPS.4.3 - Facility City.</summary>
    </column>
    <column order="4" name="State" type="varchar(255)">
      <summary>ZPS.4.4 - Facility State or Province.  Upper case state abbreviation.</summary>
    </column>
    <column order="5" name="Zip" type="varchar(255)">
      <summary>ZPS.4.5 - Facility Zip or Postal Code.</summary>
    </column>
    <column order="6" name="Phone" type="varchar(255)">
      <summary>ZPS.5 - Facility Phone Number.</summary>
    </column>
    <column order="7" name="DirectorTitle" type="varchar(255)">
      <summary>ZPS.7.1 - Facility Director Title.</summary>
    </column>
    <column order="8" name="DirectorLName" type="varchar(255)">
      <summary>ZPS.7.2 - Facility Director Last Name.</summary>
    </column>
    <column order="9" name="DirectorFName" type="varchar(255)">
      <summary>ZPS.7.3 - Facility Director First Name.</summary>
    </column>
  </table>
  <table name="medlabresult">
    <summary>Medical lab result.  The EHRLabResult table is structured too tightly with the HL7 standard and should have names that more reflect how 
            the user will consume the data and for that reason for actual implementation we are using these medlab tables.
            This table is currently only used for LabCorp, but may be utilized by other third party lab
            services in the future.  These fields are required for the LabCorp result report, used to link the result to an order,
            or for linking a parent and child result.  Contains data from the OBX, ZEF, and applicable NTE segments.</summary>
    <column order="0" name="MedLabResultNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MedLabNum" type="bigint(20)" fk="medlab">
      <summary>FK to medlab.medLabNum.  Each MedLab object can have one or more results pointing to it.</summary>
    </column>
    <column order="2" name="ObsID" type="varchar(255)">
      <summary>OBX.3.1 - Observation Identifier.  Reflex results will have the ObsID of the parent in OBR.26 for linking.</summary>
    </column>
    <column order="3" name="ObsText" type="varchar(255)">
      <summary>OBX.3.2 - Observation Text.  LabCorp report field "TESTS".  LabCorp test name.</summary>
    </column>
    <column order="4" name="ObsLoinc" type="varchar(255)">
      <summary>OBX.3.4 - Alternate Identifier (LOINC).  This is the LOINC code for the observation.
            When displaying the results, LabCorp requires OBX.3.2, the text name of the test to be displayed, not the LOINC code.
            But we will store it so we can link to the LOINC code table for reporting purposes.</summary>
    </column>
    <column order="5" name="ObsLoincText" type="varchar(255)">
      <summary>OBX.3.5 - Alternate Observation Text (LOINC Description).  The LOINC code description for the observation.
            We will display OBX.3.2 per LabCorp requirements, but we will store this description for reporting purposes.</summary>
    </column>
    <column order="6" name="ObsIDSub" type="varchar(255)">
      <summary>OBX.4 - Observation Sub ID.  Used to aid in the identification of results with the same Observation ID (OBX.3) within a given OBR.
            This value is used to tie the results to the same organism.  The value in OBX.5.3 tells whether this OBX is the organism, observation, or
            antibiotic and then the value in OBX.4 links them together as to whether this is for organism #1, organism #2, etc.</summary>
    </column>
    <column order="7" name="ObsValue" type="text">
      <summary>OBX.5.1 - Observation Value.  LabCorp report field "RESULT".
            Can be null if coded entries, prelims, canceled, or &gt;21 chars and being returned as an attached NTE.
            "TNP" will be reported for Test Not Performed.  For value &gt;21 chars in length: OBX.2 will be 'TX' for text,
            OBX.5 will be NULL (empty field), and the value will be in attached NTEs.
            Examples: Value less than 21 chars:
            OBX|1|ST|001180^Potassium, Serum^L||K+ is &gt;6.5 mEq/L.||3.5-5.5|A||N|F|19830527||200605040929|01|
            Value &gt;21 chars:
            OBX|6|TX|001180^Potassium, Serum^L||||3.5-5.5|||N|C|19830527||200511071406|01|
            NTE|1|L|Red cells observed in serum. Glucose may be falsely decreased.
            NTE|2|L|Potassium may be falsely increased.</summary>
    </column>
    <column order="8" name="ObsSubType" type="varchar(255)">
      <summary>Enum:DataSubtype OBX.5.3 - Data Subtype.  Used to identify the coding system. Required if Discrete Microbiology testing is ordered to identify
            Microbiology Result Type.  Example of use: If OBX.5.3 is ORM, then the observation sub ID in OBX.4 is used to associate the result with
            a specific organism.  OBX.4 might contain 1, 2, or 3 meaning the result is for organism #1, organism #2, or organism #3.</summary>
      <Enumeration name="DataSubtype">
        <summary>Used to identify the coding system. Required if Discrete Microbiology testing is ordered to identify Microbiology Result Type.
            Example of use: If OBX.5.3 is ORM, then the observation sub ID in OBX.4 is used to associate the result with a specific organism.
            OBX.4 might contain 1, 2, or 3 meaning the result is for organism #1, organism #2, or organism #3.</summary>
        <EnumValue name="Unknown">This idicates that we are unable to parse the value from the HL7 message into a data subtype.</EnumValue>
        <EnumValue name="ANT">Antibody (for Discrete Microbiology only)</EnumValue>
        <EnumValue name="ORM">Organism identifier (for Discrete Microbiology only)</EnumValue>
        <EnumValue name="ORP">Presumptive organism identifier (for Discrete Microbiology only)</EnumValue>
        <EnumValue name="OBS">Observation (for Discrete Microbiology only)</EnumValue>
        <EnumValue name="MOD">Modifier (for Discrete Microbiology only)</EnumValue>
        <EnumValue name="L">Local Identifier (default when no Microbiology Result Text)</EnumValue>
        <EnumValue name="PDF">Embedded PDF result type or separate PDF file</EnumValue>
        <EnumValue name="TIF">Embedded TIF result type or a separate TIF file</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="ObsUnits" type="varchar(255)">
      <summary>OBX.6.1 - Identifier.  LabCorp report field "UNITS".  Units of measure, if too large it will be in the NTE segment.</summary>
    </column>
    <column order="10" name="ReferenceRange" type="varchar(255)">
      <summary>OBX.7 - Reference Ranges.  LabCorp report field "REFERENCE INTERVAL".  Only if applicable.</summary>
    </column>
    <column order="11" name="AbnormalFlag" type="varchar(255)">
      <summary>Enum:AbnormalFlag OBX.8 - Abnormal Flags.  LabCorp report field "FLAG".  Blank or null is normal.  When this is displayed on the LabCorp report
            it must be the human readable display name, so for example _gt (&gt;) is displayed as "Panic High" and _lt (&lt;) is "Panic Low".</summary>
      <Enumeration name="AbnormalFlag">
        <summary>MedLab Abnormal Flags.  Similar to EhrLabResult.HL70078 abnormal flag enum.</summary>
        <EnumValue name="None">0 - None.  Blank or null value indicates normal result, so no abnormal flag.</EnumValue>
        <EnumValue name="_gt">1 - Panic High.  Actual value is "&gt;" but symbol cannot be used as an enum value.</EnumValue>
        <EnumValue name="_lt">2 - Panic Low.  Actual value is "&lt;" but symbol cannot be used as an enum value.</EnumValue>
        <EnumValue name="A">3 - Abnormal.  Applies to non-numeric results.</EnumValue>
        <EnumValue name="AA">4 - Critical Abnormal.  Applies to non-numeric results.</EnumValue>
        <EnumValue name="H">5 - Above High Normal.</EnumValue>
        <EnumValue name="HH">6 - Alert High.</EnumValue>
        <EnumValue name="I">7 - Intermediate.  For Discrete Microbiology susceptibilities only.</EnumValue>
        <EnumValue name="L">8 - Below Low Normal.</EnumValue>
        <EnumValue name="LL">9 - Alert Low.</EnumValue>
        <EnumValue name="NEG">10 - Negative for Drug Interpretation Codes and Discrete Microbiology.</EnumValue>
        <EnumValue name="POS">11 - Positive for Drug Interpretation Codes and Discrete Microbiology.</EnumValue>
        <EnumValue name="R">12 - Resistant.  For Discrete Microbiology susceptibilities only.</EnumValue>
        <EnumValue name="S">13 - Susceptible.  For Discrete Microbiology susceptibilities only.</EnumValue>
      </Enumeration>
    </column>
    <column order="12" name="ResultStatus" type="varchar(255)">
      <summary>Enum:ResultStatus OBX.11 - Observation Result Status.</summary>
      <Enumeration name="ResultStatus">
        <summary>Order Result Status.  Identification of status of results at the ordered item level.</summary>
        <EnumValue name="C">0 - Corrected Result.</EnumValue>
        <EnumValue name="F">1 - Final.  Result complete and verified.</EnumValue>
        <EnumValue name="I">2 - Incomplete.  For Discrete Microbiology Testing.</EnumValue>
        <EnumValue name="P">3 - Preliminary.  Final not yet obtained.</EnumValue>
        <EnumValue name="X">4 - Canceled.  Procedure cannot be done.  Result canceled due to Non-Performance.</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="DateTimeObs" type="datetime">
      <summary>OBX.14 - Date/Time of Observation.  yyyyMMddHHmm format in the message, no seconds.
            Date and time tech entered result into the Lab System.</summary>
    </column>
    <column order="14" name="FacilityID" type="varchar(255)">
      <summary>OBX.15 - Producer ID (Producer’s Reference).  LabCorp report field "LAB".  ID of LabCorp Facility responsible for performing the
            testing.  The Lab Name is supplied in the ZPS segment.</summary>
    </column>
    <column order="15" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum.  ZEF.2 - Embedded File.  Each result may have one or more ZEF segments for embedded files.
            The base-64 text version of the PDF is sent in ZEF.2.  If the file size exceeds 50k, then multiple segments will be sent with 50k blocks
            of the text.  When processing, we will concatenate all ZEF.2 fields, create the PDF document, store the file in the patient's image folder,
            and create an entry in the document table.  Then update this field with the pointer to the document table entry.</summary>
    </column>
    <column order="16" name="Note" type="text">
      <summary>NTE.3 at the OBX level.  The NTE segment is repeatable and the Comment Text component is limited to 78 characters.  Multiple NTE
            segments can be used for longer comments.  All NTE segments at the OBX level will be concatenated and stored in this one field.</summary>
    </column>
  </table>
  <table name="medlabspecimen">
    <summary>The EHRLabSpecimen table is structured to tightly with the HL7 standard and should have names that more reflect how the user will
            consume the data and for that reason for actual implementation we are using these medlab tables.
            Medical lab specimen.  Contains data from the SPM segment.  Each MedLab object can have 0 to many specimen segments.
            Each segment will be its own row in this table.</summary>
    <column order="0" name="MedLabSpecimenNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MedLabNum" type="bigint(20)" fk="medlab">
      <summary>FK to medlab.MedLabNum.  Each MedLab object can have 0 to many specimens pointing to it.</summary>
    </column>
    <column order="2" name="SpecimenID" type="varchar(255)">
      <summary>SPM.2 - Specimen ID.  Unique identifier for the specimen as referenced by the Placer application, the Filler application, or both.
            The value sent in this field should be the identification value sent on the specimen container.</summary>
    </column>
    <column order="3" name="SpecimenDescript" type="varchar(255)">
      <summary>SPM.14 - Specimen Description.  Additional information about the specimen.</summary>
    </column>
    <column order="4" name="DateTimeCollected" type="datetime">
      <summary>SPM.17 - Specimen Collection Date/Time.  yyyyMMddHHmm format in the message, no seconds.  The date and time when the specimen was
            acquired from the source.  This is a DR - Date/Time Range data type, so it may have more than one component if a specimen was collected over
            a period of time.  The first component is the start date/time so we will make sure to only store SPM.17.1 in this field.</summary>
    </column>
  </table>
  <table name="mobileappdevice">
    <summary>Stores information on mobile app devices. These are devices that utilize the Xamarin mobile application.</summary>
    <column order="0" name="MobileAppDeviceNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="2" name="DeviceName" type="varchar(255)">
      <summary>The name of the device.</summary>
    </column>
    <column order="3" name="UniqueID" type="varchar(255)">
      <summary>The unique identifier of the device. Platform specific.</summary>
    </column>
    <column order="4" name="IsEclipboardEnabled" type="tinyint(4)">
      <summary>Indicates whether the device is allowed to operate the checkin app. 
            For BYOD sessions will always be true because BYOD is authenticated by a unique URL link in a text message.</summary>
    </column>
    <column order="5" name="EclipboardLastAttempt" type="datetime">
      <summary>The date and time of the last attempted login for Eclipboard.</summary>
    </column>
    <column order="6" name="EclipboardLastLogin" type="datetime">
      <summary>The date and time of the last successful login for Eclipboard.</summary>
    </column>
    <column order="7" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. Indicates which patient is currently using the device. 0 indicates the device is not in use. -1 indicates
            that the device is in use but we do not yet know which patient is using the device.</summary>
    </column>
    <column order="8" name="LastCheckInActivity" type="datetime">
      <summary>The date and time when we last updated the PatNum field for this device (indication the current use-state of the device).</summary>
    </column>
    <column order="9" name="IsBYODDevice" type="tinyint(4)">
      <summary>Indicates whether a device is a BYOD device, defaults to false.</summary>
    </column>
    <column order="10" name="DevicePage" type="tinyint(4)">
      <summary>Current page of the device.</summary>
    </column>
    <column order="11" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. Indicates which user is currently logged into the device. 0 indicates this device is not logged into.</summary>
    </column>
    <column order="12" name="IsODTouchEnabled" type="tinyint(4)">
      <summary>Indicates whether this device is being used for ODTouch or not.</summary>
    </column>
    <column order="13" name="ODTouchLastLogin" type="datetime">
      <summary>The date and time of the last successful login for ODTouch.</summary>
    </column>
    <column order="14" name="ODTouchLastAttempt" type="datetime">
      <summary>The date and time of the last attempted login for ODTouch.</summary>
    </column>
  </table>
  <table name="mobilebrandingprofile">
    <summary>Deprecated. Use Branding instead. Branding Profile for eClipboard customization. One (or none) to One relationship with clinics. Allows customers to customize the look of their eClipboard with a Clinic name and Logo. </summary>
    <column order="0" name="MobileBrandingProfileNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="2" name="OfficeDescription" type="varchar(255)">
      <summary>The Clinic Name that will be shown on eClipboard CheckIn</summary>
    </column>
    <column order="3" name="LogoFilePath" type="varchar(255)">
      <summary>eConnector will fetch this file. Same path for every computer, so maybe use a network shared file. Shows as 90x90 pixels.</summary>
    </column>
    <column order="4" name="DateTStamp" type="timestamp">
      <summary>The time that this object was last modified or inserted. Automatically updated by MySQL every time a row is added or changed. Used to determine if eClipboard needs to fetch an updated mobile branding profile. </summary>
    </column>
  </table>
  <table name="mobiledatabyte">
    <summary>Table used to send various types of objects as bytes to ODXam applications. Example is a PDF for TxPlan or PaymentPlan. Row gets added here, sent to mobile device, and then consumed. Old rows are ignored.</summary>
    <column order="0" name="MobileDataByteNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="RawBase64Data" type="mediumtext">
      <summary>The bytes in Base64.</summary>
    </column>
    <column order="2" name="RawBase64Code" type="mediumtext">
      <summary>The unlock code in Base64. Blank if no unlock code required to retrieve.</summary>
    </column>
    <column order="3" name="RawBase64Tag" type="mediumtext">
      <summary>Misc data in Base64</summary>
    </column>
    <column order="4" name="PatNum" type="bigint(20)">
      <summary>Can start out as 0.</summary>
    </column>
    <column order="5" name="ActionType" type="tinyint(4)">
      <summary>Enum:eActionType Stores the intended action associated to this rows data.</summary>
      <Enumeration name="eActionType">
        <summary>Actions representing different endpoints in mobile app.</summary>
        <EnumValue name="None">0 - Placeholder</EnumValue>
        <EnumValue name="TreatmentPlan">1 - Row is associated to a TP pdf to be viewed in eClipboard.</EnumValue>
        <EnumValue name="MakePayment">2 - Instructs eClipboard to present patient with payment window.</EnumValue>
        <EnumValue name="PaymentPlan">3 - </EnumValue>
        <EnumValue name="PerioExam">4 - Associated with a list of perio exams.</EnumValue>
        <EnumValue name="ExamSheet">5 - Used by eClilpboard to fill out exam sheets.</EnumValue>
        <EnumValue name="Checkin">6 - Used by eClilpboard to checkin using QR code.</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="DateTimeEntry" type="datetime">
      <summary>The DateTime this row was entered.</summary>
    </column>
    <column order="7" name="DateTimeExpires" type="datetime">
      <summary>The DateTime that this row should be removed.</summary>
    </column>
  </table>
  <table name="mobilenotification">
    <summary>Mobile App devices periodically poll this table and retrieve any records that are relevant to the device itself, the user using the device, or the clinic
            the device belongs to. The mobile apps will then perform an action based on the mobile notification type.</summary>
    <column order="0" name="MobileNotificationNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="NotificationType" type="tinyint(4)">
      <summary>Enum:MobileNotificationType The type of notification. Example: TP. This will determine what actions the mobile app will perform upon retrieving this notification.</summary>
      <Enumeration name="MobileNotificationType">
        <summary>The different types of mobile notifications. Preserve order. CI = Checkin portion of app (eClipboard). ODM = ODMobile</summary>
        <EnumValue name="None">Default.</EnumValue>
        <EnumValue name="CI_CheckinPatient">Check-in a patient on a given device. For this type, the tag will have 3 items: the first name, last name, and birthdate of the patient in that order. 
            The birthdate will be in DateTime.Ticks.</EnumValue>
        <EnumValue name="CI_AddSheet">Tells the device that is currently filling out sheets to add a sheet to the list. For this type, the list of primary keys will have two items: the patnum and
            the SheetNum in that order.</EnumValue>
        <EnumValue name="CI_RemoveSheet">Tells the device that is currently fillout out sheets to remove a sheet from the list. For this type, the list of primary keys will have two items: the patnum
            and the SheetNum in that order.</EnumValue>
        <EnumValue name="CI_GoToCheckin">This mobile notification tells the device to stop whatever it is doing and go to a fresh checkin page. This may be a blank self-checkin or may be waiting for a mobile notification. This
            allows users from OD to "clear" the device of a stale patient. No primary keys or tags needed.</EnumValue>
        <EnumValue name="CI_NewEClipboardPrefs">This mobile notification occurs when the preferences for this device's clinic changes. The tags for this mobile notification will be the EClipboardAllowSelfCheckIn(bool), EClipboardMessageComplete(string), 
            EClipboardAllowSelfPortraitOnCheckIn(bool), and EClipboardPresentAvailableFormsOnCheckIn(bool) in that order.</EnumValue>
        <EnumValue name="IsAllowedChanged">This mobile notification occurs when the MobileAppDevice.IsAllowed changed for this device. The tag for this mobile notification will be IsAllowed (bool).
            If true then device which is currently awaiting in 'Not Allowed' state will try another login, should work this time. If false then force signout. Used for eClipboard and ODTouch.</EnumValue>
        <EnumValue name="ODM_LogoutODUser">This mobile notification occurs when a permission has changed for a given OD user and they are no longer allowed to use OD Mobile. 
            The ListPrimaryKeys may contain the UserNum of the user who is no longer allowed. This session will then be logged out of versioned OD Mobile.
            If ListPrimaryKeys IsNullOrEmpty() then assume all users for the given ClinicNum should be logged out. No UserNum filter necessary in this case.</EnumValue>
        <EnumValue name="CI_TreatmentPlan">This mobile notification occurs when a OD proper user sends a patients treatment plan to a specific device to show the user.
            ListPrimaryKeys =&gt; [MobileDataByteNum, PatNum, TreatPlanNum].
            ListTags Keys =&gt; The treatPlan.Heading, hasPracticeSig(Obsolete; based on if TP sheet has SigBoxPractice) .</EnumValue>
        <EnumValue name="CI_RemoveTreatmentPlan">
            This mobile notification occurs when a TreatmentPlan is deleted in OD and we want to tell a specific device so that they can remove it when viewing TreatmentPlans.
            ListPrimaryKeys =&gt; [TreatPlan.PatNum,TreatPlan.TreatPlanNum]
            </EnumValue>
        <EnumValue name="CI_SendPayment">This mobile notification occurs when a payment needs to be made on an eClip device. This either adds the Make Payment action item to the checkin checklist
            or it will open the QR code to scan from OD.
            ListPrimaryKeys =&gt; [TreatPlan.PatNum]</EnumValue>
        <EnumValue name="CI_RefreshPayment">This mobile notification occurs when a patient is currently on the device, when a payment is made, when a new card is added (XWeb only), and when a new 
            statement is created in OD.
            ListPrimaryKeys =&gt; [PatNum]</EnumValue>
        <EnumValue name="CI_PaymentPlan">This mobile notification occurs when an OD proper user sends a payment plan to a specific device.
            ListPrimaryKeys =&gt; [MobileDataByte.MobileDataByteNum,PayPlan.PatNum,PayPlan.PayPlanNum]
            ListTags =&gt; [PayPlan.PayPlanDate]</EnumValue>
        <EnumValue name="CI_RemovePaymentPlan">This mobile notification occurs when a payment plan is removed from the associated eClip device or when a payment plan is removed from OD proper.
            This will remove a payment plan from user view on eClip.
            ListPrimaryKeys =&gt; [PayPlan.PatNum,PayPlan.PayPlanNum]</EnumValue>
        <EnumValue name="ODT_ExamSheetsAll"></EnumValue>
        <EnumValue name="ODT_ExamSheet"></EnumValue>
        <EnumValue name="ODT_PrintError"></EnumValue>
        <EnumValue name="ODM_NewTextMessage">Occurs when a new text message is received. This is a workaround due to android push notifications no longer being supported for xamarin.</EnumValue>
        <EnumValue name="CI_AddEForm">Tells the device that is currently filling out forms to add an eForm to the list. For this type, the list of primary keys will have two items: the PatNum and the EFormNum in that order.</EnumValue>
        <EnumValue name="CI_RemoveEForm">Tells the device that is currently filling out forms to remove an eForm from the list. For this type, the list of primary keys will have two items: the PatNum and the EFormNum in that order.</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="DeviceId" type="varchar(255)">
      <summary>The device id for the mobile notification. Example is random string of 10-12 characters. Only the device with this DeviceId will retrieve this record.</summary>
    </column>
    <column order="3" name="PrimaryKeys" type="text">
      <summary>A comma-delimited list of primary keys associated with the mobile notification. See MobileNotificationType for what is included with each type. 
            Can include MobileDataByteNums, TreatPlanNum, SheetNums, and others.</summary>
    </column>
    <column order="4" name="Tags" type="text">
      <summary>A comma-delimited list of tags for this mobile notification. Can be anything. Different for each MobileNotificationType. See MobileNotificationType for what is included with each type.</summary>
    </column>
    <column order="5" name="DateTimeEntry" type="datetime">
      <summary>DateTime notification was entered into Db. Should not be edited.</summary>
    </column>
    <column order="6" name="DateTimeExpires" type="datetime">
      <summary>DateTime notification expires and becomes invalid.</summary>
    </column>
    <column order="7" name="AppTarget" type="tinyint(4)">
      <summary>Enum:EnumAppTarget Stores the mobile app that this notification is targeting. Prohibits a device running one app from consuming mobile 
            notifications intended for a different app.</summary>
      <Enumeration name="EnumAppTarget">
        <summary>The mobile apps that support mobile notifications. Must stay synched 1:1 with the ODXamBusiness.ApplicationTarget enum.</summary>
        <EnumValue name="eClipboard">0</EnumValue>
        <EnumValue name="ODMobile">1</EnumValue>
        <EnumValue name="ODTouch">2</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="mount">
    <summary>A mount shows in the images module just like other images in the tree.  But it is just a container for images within it rather than an actual image itself.  A mount layout cannot be edited once created for a patient (simply because we didn't add that functionality), but the individual images on it can be edited.</summary>
    <column order="0" name="MountNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="DocCategory" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Categories for documents.</summary>
    </column>
    <column order="3" name="DateCreated" type="datetime">
      <summary>The date/time at which the mount itself was created. Usually, all the images on the mount are the same date, but not always.</summary>
    </column>
    <column order="4" name="Description" type="varchar(255)">
      <summary>Used to provide a document description in the image module tree-view.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>To allow the user to enter specific information regarding the exam and tooth numbers, as well as points of interest in the xray images.</summary>
    </column>
    <column order="6" name="Width" type="int(11)">
      <summary>The width of the mount, in pixels.</summary>
    </column>
    <column order="7" name="Height" type="int(11)">
      <summary>The height of the mount, in pixels.</summary>
    </column>
    <column order="8" name="ColorBack" type="int(11)">
      <summary>Color of the mount background.  Typically white for photos and black for radiographs. Transparency not allowed.</summary>
    </column>
    <column order="9" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. Optional. Used for radiographs.</summary>
    </column>
    <column order="10" name="ColorFore" type="int(11)">
      <summary>Color of drawings and text.  Typically black for photos and white for radiographs.</summary>
    </column>
    <column order="11" name="ColorTextBack" type="int(11)">
      <summary>Color of drawing text background.  Typically white for photos and black for radiographs. Transparent is allowed.</summary>
    </column>
    <column order="12" name="FlipOnAcquire" type="tinyint(4)">
      <summary>If true, each image will be flipped as it's acquired. Because ScanX images are backwards.</summary>
    </column>
    <column order="13" name="AdjModeAfterSeries" type="tinyint(4)">
      <summary>If true, then it will switch to Adj mode instead of the usual Pan mode.</summary>
    </column>
  </table>
  <table name="mountdef">
    <summary>Template for each new mount.  But there is no linking of the mount back to this mountDef.  These can be freely deleted, renamed, moved, etc. without affecting any patient info.</summary>
    <column order="0" name="MountDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="ItemOrder" type="int(11)">
      <summary>The order that the mount defs will show in various lists.</summary>
    </column>
    <column order="3" name="Width" type="int(11)">
      <summary>The width of the mount, in pixels.</summary>
    </column>
    <column order="4" name="Height" type="int(11)">
      <summary>Height of the mount, in pixels.</summary>
    </column>
    <column order="5" name="ColorBack" type="int(11)">
      <summary>Color of the mount background.  Typically white for photos and black for radiographs.</summary>
    </column>
    <column order="6" name="ColorFore" type="int(11)">
      <summary>Color of drawings and text.  Typically black for photos and white for radiographs.</summary>
    </column>
    <column order="7" name="ColorTextBack" type="int(11)">
      <summary>Color of drawing text background.  Typically white for photos and black for radiographs. Transparent is allowed.</summary>
    </column>
    <column order="8" name="ScaleValue" type="varchar(255)">
      <summary>Scale, decimal places, and units, separated by spaces.  Example: "123.4 0 mm". The first two are required; units is optional.  When a mount is created, and if this isn't blank, then this is converted into an ImageDraw of type ScaleValue.</summary>
    </column>
    <column order="9" name="DefaultCat" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. If set, a new mount will go into this category, regardless of which category is currently selected.</summary>
    </column>
    <column order="10" name="FlipOnAcquire" type="tinyint(4)">
      <summary>If true, each image will be flipped as it's acquired. Because ScanX images are backwards.</summary>
    </column>
    <column order="11" name="AdjModeAfterSeries" type="tinyint(4)">
      <summary>If true, then it will switch to Adj mode instead of the usual Pan mode.</summary>
    </column>
  </table>
  <table name="mountitem">
    <summary>These are always attached to a mount. Like a mount, they cannot be edited.  Documents are attached to each MountItem using Document.MountItemNum field.  Image will always be cropped to make it look smaller or bigger if it doesn't exactly match the mount item rectangle ratio.</summary>
    <column order="0" name="MountItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MountNum" type="bigint(20)" fk="mount">
      <summary>FK to mount.MountNum.</summary>
    </column>
    <column order="2" name="Xpos" type="int(11)">
      <summary>The x position, in pixels, of the item on the mount.</summary>
    </column>
    <column order="3" name="Ypos" type="int(11)">
      <summary>The y position, in pixels, of the item on the mount.</summary>
    </column>
    <column order="4" name="ItemOrder" type="int(11)">
      <summary>The ordinal position of the item on the mount. 1-indexed because users see it.  Any item with an ItemOrder of 0 is text, which cannot accept an image or be clicked on. Any item with an ItemOrder of -1 is unmounted and will show in the umounted area instead of on the mount.</summary>
    </column>
    <column order="5" name="Width" type="int(11)">
      <summary>The width, in pixels, of the mount item rectangle.</summary>
    </column>
    <column order="6" name="Height" type="int(11)">
      <summary>The height, in pixels, of the mount item rectangle.</summary>
    </column>
    <column order="7" name="RotateOnAcquire" type="int(11)">
      <summary>0,90,180,or 270.</summary>
    </column>
    <column order="8" name="ToothNumbers" type="varchar(255)">
      <summary>An optional list of tooth numbers. In Db, rigorously formatted as American numbers, and separated by commas.  For display, uses hyphens for sequences.  Very likely supports international tooth numbers, but not tested for that.  These tooth numbers are initially copied here from the MountItemDef. They are then copied to the document (image) that gets put in this mount item.  So mountitem.ToothNumbers is not actually used to indicate the final tooth numbers.  use document.ToothNumbers instead.</summary>
    </column>
    <column order="9" name="TextShowing" type="text">
      <summary>Instead of an image, a mount item can show text. In this case, ItemOrder=0. Text color and background will be the mount default.</summary>
    </column>
    <column order="10" name="FontSize" type="float">
      <summary>This could vary significantly based on the size of the mount.  It's always relative to mount pixels.</summary>
    </column>
  </table>
  <table name="mountitemdef">
    <summary>These are always attached to mountdefs.  Can be deleted without any problems.</summary>
    <column order="0" name="MountItemDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="MountDefNum" type="bigint(20)" fk="mountdef">
      <summary>FK to mountdef.MountDefNum.</summary>
    </column>
    <column order="2" name="Xpos" type="int(11)">
      <summary>The x position, in pixels, of the item on the mount.</summary>
    </column>
    <column order="3" name="Ypos" type="int(11)">
      <summary>The y position, in pixels, of the item on the mount.</summary>
    </column>
    <column order="4" name="Width" type="int(11)">
      <summary>Width, in pixels, of the item rectangle on the mount.  Any cropping, rotating, etc, will all be defined in the original image itself.</summary>
    </column>
    <column order="5" name="Height" type="int(11)">
      <summary>Height, in pixels, of the item rectangle on the mount.  Any cropping, rotating, etc, will all be defined in the original image itself.</summary>
    </column>
    <column order="6" name="ItemOrder" type="int(11)">
      <summary>The ordinal position of the item on the mount. 1-indexed because users see it. 0 if TestShowing has a value.</summary>
    </column>
    <column order="7" name="RotateOnAcquire" type="int(11)">
      <summary>0,90,180,or 270.</summary>
    </column>
    <column order="8" name="ToothNumbers" type="varchar(255)">
      <summary>An optional list of tooth numbers. In Db, rigorously formatted as American numbers, and separated by commas.  For display, uses hyphens for sequences.  Very likely supports international tooth numbers, but not tested for that.</summary>
    </column>
    <column order="9" name="TextShowing" type="text">
      <summary>Instead of an image, a mount item can show text. In this case, ItemOrder=0. Text color and background will be the mount default.</summary>
    </column>
    <column order="10" name="FontSize" type="float">
      <summary>This could vary significantly based on the size of the mount.  It's always relative to mount pixels.</summary>
    </column>
  </table>
  <table name="msgtopaysent">
    <summary>AutoComm object for MsgToPay messages that have been queued or sent by the eConnector. The HQ version of this object is MsgToPayActive where a record is kept for ShortGuid/redirect purposes.
            Inherits IAutoCommApptGuid since they will all be attached to appointments.</summary>
    <column order="0" name="MsgToPaySentNum" type="bigint(20)">
      <summary>PK.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.ClinicNum for the corresponding patient.</summary>
    </column>
    <column order="3" name="SendStatus" type="tinyint(4)">
      <summary>Indicates status of message.</summary>
    </column>
    <column order="4" name="Source" type="tinyint(4)">
      <summary>Source of this object. Can be Manual (implemented) or EConnectorAutoComm (not yet implemented).</summary>
    </column>
    <column order="5" name="MessageType" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="6" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="7" name="Subject" type="text">
      <summary>Subject of the message.</summary>
    </column>
    <column order="8" name="Message" type="text">
      <summary>Content of the message.</summary>
    </column>
    <column order="9" name="EmailType" type="tinyint(4)">
      <summary>Only used for manually sent emails.</summary>
    </column>
    <column order="10" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="11" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</summary>
    </column>
    <column order="12" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
    <column order="13" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
    <column order="14" name="ShortGUID" type="varchar(255)">
      <summary>Generated by HQ. Identifies this AutoCommGuid in future transactions between HQ and OD.</summary>
    </column>
    <column order="15" name="DateTimeSendFailed" type="datetime">
      <summary></summary>
    </column>
    <column order="16" name="ApptNum" type="bigint(20)" fk="appointment">
      <summary>FK to Appointment.AptNum</summary>
    </column>
    <column order="17" name="ApptDateTime" type="datetime">
      <summary></summary>
    </column>
    <column order="18" name="TSPrior" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="19" name="StatementNum" type="bigint(20)" fk="statement">
      <summary>FK to Statement.StatementNum</summary>
    </column>
  </table>
  <table name="oidexternal">
    <summary></summary>
    <column order="0" name="OIDExternalNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="IDType" type="varchar(255)">
      <summary>Enum:IdentifierType Internal data type to be associated with.</summary>
      <Enumeration name="IdentifierType">
        <summary>Stored as string. Sorted and displayed in the order they are present in this enum.  Root should always be first.</summary>
        <EnumValue name="Root">Will most likely be the root of all other OIDs.  Represents the organization.</EnumValue>
        <EnumValue name="LabOrder">FK to ehrlab.EhrLabNum.  root+".1"</EnumValue>
        <EnumValue name="Patient">FK to patient.PatNum.  root+".2"</EnumValue>
        <EnumValue name="Provider">FK to provider.ProvNum.  root+".3"</EnumValue>
        <EnumValue name="CqmItem">This will be the root for all CQM reported items, like encounters, procedures, problems, etc.  root+".4"  The extension will be abbreviated name concatenated with the primary key of the object.  Examples: pat5231 or medpat197432 or proc231782 or notperf38291.  This is only used for generating QRDA documents and requires that the encounter, procedure, etc. is uniquely identified in the reports.  The root+".4" makes it unique to this office, the abbreviated name plus primary key makes it unique within the office.</EnumValue>
        <EnumValue name="Problem">FK to disease.DiseaseNum.  root+".5"</EnumValue>
        <EnumValue name="Appointment">FK to appointment.AptNum.  root+".6"</EnumValue>
        <EnumValue name="InsPlan">FK to insplan.PlanNum.  root+".7"</EnumValue>
        <EnumValue name="Procedure">FK to procedurelog.ProcNum.  root+".8"</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="IDInternal" type="bigint(20)">
      <summary>This should be a Primary Key to a Table Type defined by the IDType field. Example: If IDType==Patient, then this field should be a PatNum that is a FK to Patient.Patnum</summary>
    </column>
    <column order="3" name="IDExternal" type="varchar(255)">
      <summary>The OID extension, when combined with rootExternal it uniquely identifies an object.</summary>
    </column>
    <column order="4" name="rootExternal" type="varchar(255)">
      <summary>The OID root, when combined with IDExternal it uniquely identifies an object.</summary>
    </column>
  </table>
  <table name="oidinternal">
    <summary></summary>
    <column order="0" name="OIDInternalNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="IDType" type="varchar(255)">
      <summary>Enum:IdentifierType Internal data type to be associated with OIDRoot</summary>
      <Enumeration name="IdentifierType">
        <summary>Stored as string. Sorted and displayed in the order they are present in this enum.  Root should always be first.</summary>
        <EnumValue name="Root">Will most likely be the root of all other OIDs.  Represents the organization.</EnumValue>
        <EnumValue name="LabOrder">FK to ehrlab.EhrLabNum.  root+".1"</EnumValue>
        <EnumValue name="Patient">FK to patient.PatNum.  root+".2"</EnumValue>
        <EnumValue name="Provider">FK to provider.ProvNum.  root+".3"</EnumValue>
        <EnumValue name="CqmItem">This will be the root for all CQM reported items, like encounters, procedures, problems, etc.  root+".4"  The extension will be abbreviated name concatenated with the primary key of the object.  Examples: pat5231 or medpat197432 or proc231782 or notperf38291.  This is only used for generating QRDA documents and requires that the encounter, procedure, etc. is uniquely identified in the reports.  The root+".4" makes it unique to this office, the abbreviated name plus primary key makes it unique within the office.</EnumValue>
        <EnumValue name="Problem">FK to disease.DiseaseNum.  root+".5"</EnumValue>
        <EnumValue name="Appointment">FK to appointment.AptNum.  root+".6"</EnumValue>
        <EnumValue name="InsPlan">FK to insplan.PlanNum.  root+".7"</EnumValue>
        <EnumValue name="Procedure">FK to procedurelog.ProcNum.  root+".8"</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="IDRoot" type="varchar(255)">
      <summary>This is the root OID for this data type, when combined with extension, uniquely identifies a single object.</summary>
    </column>
  </table>
  <table name="operatory">
    <summary>Each row is a single operatory or column in the appts module.</summary>
    <column order="0" name="OperatoryNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="OpName" type="varchar(255)">
      <summary>The full name to show in the column.</summary>
    </column>
    <column order="2" name="Abbrev" type="varchar(255)">
      <summary>5 char or less. Not used much.</summary>
    </column>
    <column order="3" name="ItemOrder" type="smallint">
      <summary>The order that this op column will show.  Changing views only hides some ops; it does not change their order.  Zero based.</summary>
    </column>
    <column order="4" name="IsHidden" type="tinyint">
      <summary>Used instead of deleting to hide an op that is no longer used.</summary>
    </column>
    <column order="5" name="ProvDentist" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  The dentist assigned to this op.  If more than one dentist might be assigned to an op, then create a second op and use one for each dentist. If 0, then no dentist is assigned.</summary>
    </column>
    <column order="6" name="ProvHygienist" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  The hygienist assigned to this op.  If 0, then no hygienist is assigned.</summary>
    </column>
    <column order="7" name="IsHygiene" type="tinyint">
      <summary>Set true if this is a hygiene operatory.  The hygienist will then be considered the main provider for this op.</summary>
    </column>
    <column order="8" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0 if no clinic.</summary>
    </column>
    <column order="9" name="DateTStamp" type="timestamp">
      <summary>Not user editable. The last time this row was edited.</summary>
    </column>
    <column order="10" name="SetProspective" type="tinyint(4)">
      <summary>If true patients put into this operatory will have status set to prospective.</summary>
    </column>
    <column order="11" name="IsWebSched" type="tinyint(4)">
      <summary>Operatories with IsWebSched set to true will be the ONLY operatories considered when searching for available time slots.</summary>
    </column>
    <column order="12" name="IsNewPatAppt" type="tinyint(4)">
      <summary>Deprecated as of 18.1.  Entries within the deflink table indicate if this operatory is in fact available for WebSched New Pat Appt.
            Old summary: Operatories with IsNewPatAppt set to true will be the ONLY operatories considered when searching for available time slots.
            This is in regards to the New Patient Appointment portion of the Web Sched web application.</summary>
    </column>
    <column order="13" name="OperatoryType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. The type of the Operatory. This value is not normally used, but rather to just mark which type the Operatory is.</summary>
    </column>
  </table>
  <table name="orionproc">
    <summary></summary>
    <column order="0" name="OrionProcNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="1" name="ProcNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="2" name="DPC" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="3" name="DateScheduleBy" type="date">
      <summary></summary>
    </column>
    <column order="4" name="DateStopClock" type="date">
      <summary></summary>
    </column>
    <column order="5" name="Status2" type="int(11)">
      <summary></summary>
    </column>
    <column order="6" name="IsOnCall" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="7" name="IsEffectiveComm" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="8" name="IsRepair" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="9" name="DPCpost" type="tinyint(4)">
      <summary></summary>
    </column>
  </table>
  <table name="orthocase">
    <summary>Holds financial and timing information for a single ortho case. For procs linked to Orthocases, estimates are calculated based off of orthocase info, not insurance info. The orthocase numbers are automatically placed into InsPayEst and InsEstTotalOverride in Procedures.ComputeEstimates(), taking control from insurance. Procedure fees are calculated based on orthocase info, not fee schedules. All overrides (fees and insurance) are performed when the procedure is set complete.</summary>
    <column order="0" name="OrthoCaseNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The patient on this ortho case.</summary>
    </column>
    <column order="2" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. </summary>
    </column>
    <column order="3" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. </summary>
    </column>
    <column order="4" name="Fee" type="double">
      <summary>Total amount of procedure fees. Is editable by user.</summary>
    </column>
    <column order="5" name="FeeInsPrimary" type="double">
      <summary>The amount that primary insurance will cover for the entire ortho case.</summary>
    </column>
    <column order="6" name="FeePat" type="double">
      <summary>Calculated from Fee - FeeIns. </summary>
    </column>
    <column order="7" name="BandingDate" type="date">
      <summary>Date of Banding. </summary>
    </column>
    <column order="8" name="DebondDate" type="date">
      <summary>Date of Debond. </summary>
    </column>
    <column order="9" name="DebondDateExpected" type="date">
      <summary>Date of expected Debond.</summary>
    </column>
    <column order="10" name="IsTransfer" type="tinyint(4)">
      <summary>Used to denote that the banding date is used as the transfer date instead.</summary>
    </column>
    <column order="11" name="OrthoType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum</summary>
    </column>
    <column order="12" name="SecDateTEntry" type="datetime">
      <summary>DateTime ortho case was added. Not editable by user. </summary>
    </column>
    <column order="13" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.usernum. The usernum that added the OrthoCase. </summary>
    </column>
    <column order="14" name="SecDateTEdit" type="timestamp">
      <summary>Timestamp of the last modification to the ortho case. Not editable by user.</summary>
    </column>
    <column order="15" name="IsActive" type="tinyint(4)">
      <summary>Determines whether or not this is an active ortho case</summary>
    </column>
    <column order="16" name="FeeInsSecondary" type="double">
      <summary>The amount that secondary insurance will cover for the entire ortho case.
            Will be set to zero if patient doesn't have secondary insurance</summary>
    </column>
  </table>
  <table name="orthochart">
    <summary>For the orthochart feature, each row in this table is one cell in that grid.  An empty cell often corresponds to a missing db table row.</summary>
    <column order="0" name="OrthoChartNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateService" type="date">
      <summary>Deprecated, use orthochartrow table instead.  Date of service.</summary>
    </column>
    <column order="3" name="FieldName" type="varchar(255)">
      <summary>Keyed to displayfield.Description.</summary>
    </column>
    <column order="4" name="FieldValue" type="text">
      <summary>Stores the text that the user entered or picked.</summary>
    </column>
    <column order="5" name="UserNum" type="bigint(20)">
      <summary>Deprecated, use orthochartrow table instead. FK to userod.UserNum.  The user that created or last edited an ortho chart field.</summary>
    </column>
    <column order="6" name="ProvNum" type="bigint(20)">
      <summary>Deprecated, use orthochartrow table instead. FK to provider.ProvNum.  Can be 0.</summary>
    </column>
    <column order="7" name="OrthoChartRowNum" type="bigint(20)" fk="orthochartrow">
      <summary>FK to orthochartrow.OrthoChartRowNum.</summary>
    </column>
  </table>
  <table name="orthochartlog">
    <summary>This stores log entries for debugging the orthochart.  Logging gets turned on and off with the pref. This table will go away once the bug is found. </summary>
    <column order="0" name="OrthoChartLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="ComputerName" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="3" name="DateTimeLog" type="datetime">
      <summary>DateTime that this log entry was made</summary>
    </column>
    <column order="4" name="DateTimeService" type="datetime">
      <summary>DateTime of the chart row.</summary>
    </column>
    <column order="5" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  The user that created or last edited an ortho chart field.</summary>
    </column>
    <column order="6" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="7" name="OrthoChartRowNum" type="bigint(20)" fk="orthochartrow">
      <summary>FK to orthochartrow.OrthoChartRowNum.</summary>
    </column>
    <column order="8" name="LogData" type="mediumtext">
      <summary>This can be long and complex -- whatever you want. MediumText, so max length=16M.</summary>
    </column>
  </table>
  <table name="orthochartrow">
    <summary>Represent a row in the ortho chart UI grid.</summary>
    <column order="0" name="OrthoChartRowNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateTimeService" type="datetime">
      <summary>DateTime of service.</summary>
    </column>
    <column order="3" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  The user that created or last edited an ortho chart field.</summary>
    </column>
    <column order="4" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="5" name="Signature" type="text">
      <summary>Examples: "0:ritwq/wV8vlrgUYahhK+RH5UeBFA6W4jCkZdo0cDWd63aZb1S/W3Z4eW5LmchqfgniG23" and "1:52222559445999975122111500485555". The 1st character is whether or not the signature is Topaz. The 2nd character is a separator. The rest of the string is the hashed signature data. Raw signature data is the concatenation of the FieldName and FieldValue of all cells (orthocharts), ordered by FieldName.</summary>
    </column>
  </table>
  <table name="orthocharttab">
    <summary>This represents one column in one orthocharttab. The field name and width are retrieved from displayfield table using DisplayFieldNum. A displayfield can show on multiple orthocharttabs.</summary>
    <column order="0" name="OrthoChartTabNum" type="bigint(20)" fk="orthocharttab">
      <summary>FK to orthocharttab.OrthoChartTabNum.</summary>
    </column>
    <column order="1" name="TabName" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="2" name="ItemOrder" type="int(11)">
      <summary>The order of this column in the ortho chart tab.</summary>
    </column>
    <column order="3" name="IsHidden" type="tinyint(4)">
      <summary></summary>
    </column>
  </table>
  <table name="orthocharttablink">
    <summary>This represents one column in one orthocharttab. The field name and width are retrieved from displayfield table using DisplayFieldNum. A displayfield can show on multiple orthocharttabs.</summary>
    <column order="0" name="OrthoChartTabLinkNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ItemOrder" type="int(11)">
      <summary>The order of this column in the ortho chart tab.</summary>
    </column>
    <column order="2" name="OrthoChartTabNum" type="bigint(20)" fk="orthocharttab">
      <summary>FK to orthocharttab.OrthoChartTabNum.</summary>
    </column>
    <column order="3" name="DisplayFieldNum" type="bigint(20)" fk="displayfield">
      <summary>FK to displayfield.DisplayFieldNum. Use this to get field name and default width.</summary>
    </column>
    <column order="4" name="ColumnWidthOverride" type="int(11)">
      <summary>Overrides the DisplayField.ColumnWidth for OrthChartTabLinks when not 0. Otherwise uses associated DisplayFieldFieldNums DisplayField.ColumnWidth value.</summary>
    </column>
  </table>
  <table name="orthohardware">
    <summary>Represents one bracket, wire, or elastic.</summary>
    <column order="0" name="OrthoHardwareNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateExam" type="date">
      <summary>Every hardware entry is tied to a single date. At each exam, a copy can be made of the hardware from the previous exam, and then it can be edited. It normally shows the most recent exam, and the hardware items showing in the ortho grid only include the most recent exam. Not sure yet how we will show hardware for previous exams/dates.</summary>
    </column>
    <column order="3" name="OrthoHardwareType" type="tinyint(4)">
      <summary>Enum:EnumOrthoHardwareType Bracket, Wire, or Elastic.</summary>
      <Enumeration name="EnumOrthoHardwareType">
        <summary></summary>
        <EnumValue name="Bracket">0</EnumValue>
        <EnumValue name="Wire">1</EnumValue>
        <EnumValue name="Elastic">2</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="OrthoHardwareSpecNum" type="bigint(20)" fk="orthohardwarespec">
      <summary>FK to orthohardwarespec.OrthoHardwareSpecNum. This is where the description and color come from.</summary>
    </column>
    <column order="5" name="ToothRange" type="varchar(255)">
      <summary>Tooth numbers stored here are always stored in Universal (1-32) notation. They are displayed to the user as Palmer notation. For brackets, always use single tooth numbers, like 8. For wires, must use a range like 2-15. For elastics, typically use 2 teeth separated with commas, but more are allowed.</summary>
    </column>
    <column order="6" name="Note" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="7" name="IsHidden" type="tinyint(4)">
      <summary></summary>
    </column>
  </table>
  <table name="orthohardwarespec">
    <summary>Specification for ortho hardware. Linked to one type such as bracket, wire, or elastic. This is a pick list of description and color for the user. These remain linked to patient data, so changes here will affect historical chart entries.</summary>
    <column order="0" name="OrthoHardwareSpecNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="OrthoHardwareType" type="tinyint(4)">
      <summary>Enum:EnumOrthoHardwareType Bracket, Wire, or Elastic.</summary>
      <Enumeration name="EnumOrthoHardwareType">
        <summary></summary>
        <EnumValue name="Bracket">0</EnumValue>
        <EnumValue name="Wire">1</EnumValue>
        <EnumValue name="Elastic">2</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>Example NITI 16x25</summary>
    </column>
    <column order="3" name="ItemColor" type="int(11)">
      <summary></summary>
    </column>
    <column order="4" name="IsHidden" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary>0 indexed. User controls it with arrows.</summary>
    </column>
  </table>
  <table name="orthoplanlink">
    <summary>Used to attach payment plans and ortho schedules to an Ortho Case. </summary>
    <column order="0" name="OrthoPlanLinkNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="OrthoCaseNum" type="bigint(20)" fk="orthocase">
      <summary>FK to orthocase.OrthoCaseNum.</summary>
    </column>
    <column order="2" name="LinkType" type="tinyint(4)">
      <summary>Enum:OrthoPlanLinkType  Holds the type of object that is being linked. </summary>
      <Enumeration name="OrthoPlanLinkType">
        <summary></summary>
        <EnumValue name="OrthoSchedule">0 - OrthoSchedule </EnumValue>
        <EnumValue name="InsPayPlan">1 - Insurance Payment Plan </EnumValue>
        <EnumValue name="PatPayPlan">2 - Patient Payment Plan </EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FKey" type="bigint(20)">
      <summary>Holds the FKey of the object from the LinkType. </summary>
    </column>
    <column order="4" name="IsActive" type="tinyint(4)">
      <summary>Denotes if plan link is active or not.</summary>
    </column>
    <column order="5" name="SecDateTEntry" type="datetime">
      <summary>DateTime. Date plan link was added. Not editable by user. </summary>
    </column>
    <column order="6" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UseNum. User that added the plan link.</summary>
    </column>
  </table>
  <table name="orthoproclink">
    <summary>Used to attach procedures to an OrthoCase. Multiple procs are typically attached to one OrthoCase.</summary>
    <column order="0" name="OrthoProcLinkNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="OrthoCaseNum" type="bigint(20)" fk="orthocase">
      <summary>FK to orthocase.OrthoCaseNum.  </summary>
    </column>
    <column order="2" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum </summary>
    </column>
    <column order="3" name="SecDateTEntry" type="datetime">
      <summary>DateTime proclink was added. Not editable by user. </summary>
    </column>
    <column order="4" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. User that added the proc link. </summary>
    </column>
    <column order="5" name="ProcLinkType" type="tinyint(4)">
      <summary>Enum:OrthoProcType Indicates what type of procedure is being associated to Ortho Case in link.</summary>
      <Enumeration name="OrthoProcType">
        <summary>A procedures type as it relates to an Ortho Case</summary>
        <EnumValue name="Banding">0 - Procedure for putting appliance on.</EnumValue>
        <EnumValue name="Debond">1 - Procedure for removing appliance.</EnumValue>
        <EnumValue name="Visit">2 - All maintenance visits between Banding and Debond procedures.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="orthorx">
    <summary>A group of ortho hardware that allows for faster entry than one tooth at a time. Changes to this table do not affect any patient records.</summary>
    <column order="0" name="OrthoRxNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="OrthoHardwareSpecNum" type="bigint(20)" fk="orthohardwarespec">
      <summary>FK to orthohardwarespec.OrthoHardwareSpecNum. Description comes from here.</summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>The description used for picking the prescription from a list.</summary>
    </column>
    <column order="3" name="ToothRange" type="varchar(255)">
      <summary>Tooth numbers stored here are always stored in Universal (1-32) notation. They are displayed to the user as Palmer notation. For brackets and elastics, always use tooth numbers separated by commas, like 2,3,4,5,6. For wires, must use a range like 2-15.</summary>
    </column>
    <column order="4" name="ItemOrder" type="int(11)">
      <summary>0 indexed. User controls it with arrows.</summary>
    </column>
  </table>
  <table name="orthoschedule">
    <summary>Optional. Holds the Production Schedule for an OrthoCase. </summary>
    <column order="0" name="OrthoScheduleNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="BandingDateOverride" type="date">
      <summary>Override for banding date. </summary>
    </column>
    <column order="2" name="DebondDateOverride" type="date">
      <summary>Override for debond date. </summary>
    </column>
    <column order="3" name="BandingAmount" type="double">
      <summary>Amount to charge for banding procedure.</summary>
    </column>
    <column order="4" name="VisitAmount" type="double">
      <summary>Used every visit until the total off all visits+BandingAmount+DebondAmount=Fee of linked OrthoCase. </summary>
    </column>
    <column order="5" name="DebondAmount" type="double">
      <summary>Amount to charge for debond procedure.</summary>
    </column>
    <column order="6" name="IsActive" type="tinyint(4)">
      <summary>Is true if the ortho schedule is active. </summary>
    </column>
    <column order="7" name="SecDateTEdit" type="timestamp">
      <summary>DateTime the ortho schedule was last modified. Not editable by user.</summary>
    </column>
  </table>
  <table name="patfield">
    <summary>These are custom fields added and managed by the user. Each row here is a field value for one patient.</summary>
    <column order="0" name="PatFieldNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="FieldName" type="varchar(255)" fk="patfielddef">
      <summary>FK to patfielddef.FieldName.  The full name is shown here for ease of use when running queries.  But the user is only allowed to change fieldNames in the patFieldDef setup window.</summary>
    </column>
    <column order="3" name="FieldValue" type="text">
      <summary>Any text that the user types in.  For picklists, this will contain the picked text.  For dates, this is stored as the user typed it, after validating that it could be parsed.  So queries that involve dates won't work very well.  If we want better handling of date fields, we should add a column to this table.  Checkbox will either have a value of 1, or else the row will be deleted from the db.  Currency is handled in a culture neutral way, just like other currency in the db.</summary>
    </column>
    <column order="4" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="5" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="6" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
  </table>
  <table name="patfielddef">
    <summary>These are the definitions for the custom patient fields added and managed by the user.</summary>
    <column order="0" name="PatFieldDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FieldName" type="varchar(255)">
      <summary>This is treated as the key. The name of the field that the user will be allowed to fill in the patient info window.</summary>
    </column>
    <column order="2" name="FieldType" type="tinyint(4)">
      <summary>Enum:PatFieldType Text=0,PickList=1,Date=2,Checkbox=3,Currency=4</summary>
      <Enumeration name="PatFieldType">
        <summary></summary>
        <EnumValue name="Text">0</EnumValue>
        <EnumValue name="PickList">1</EnumValue>
        <EnumValue name="Date">2-Stored in db as entered, already localized.  For example, it could be 2/04/11, 2/4/11, 2/4/2011, or any other variant.  This makes it harder to create queries that filter by date, but easier to display dates as part of results.</EnumValue>
        <EnumValue name="Checkbox">3-If checked, value stored as "1".  If unchecked, row deleted.</EnumValue>
        <EnumValue name="Currency">4-Numbers only.</EnumValue>
        <EnumValue name="InCaseOfEmergency">5 - DEPRECATED. (Only used 16.3.1, deprecated by 16.3.4)</EnumValue>
        <EnumValue name="CareCreditStatus">6 - CareCredit pre-approval status. For example, FieldValue string="Pre-Approved", from CareCreditWebStatus enum.</EnumValue>
        <EnumValue name="CareCreditPreApprovalAmt">7 - CareCredit pre-approval amount.</EnumValue>
        <EnumValue name="CareCreditAvailableCredit">8 - CareCredit - Remaining available Credit for CareCredit cardholders.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="PickList" type="text">
      <summary>Deprecated. Use patfieldpickitem.</summary>
    </column>
    <column order="4" name="ItemOrder" type="int(11)">
      <summary></summary>
    </column>
    <column order="5" name="IsHidden" type="tinyint(4)">
      <summary>Hides this PatField for any patient where it's currently blank. If already in use by a patient, then it still shows.</summary>
    </column>
  </table>
  <table name="patfieldpickitem">
    <summary>Each row is an item in a PatFieldDef picklist. Not used unless the PatFieldDef is a Picklist type. These objects are created and managed by user.</summary>
    <column order="0" name="PatFieldPickItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatFieldDefNum" type="bigint(20)" fk="patfielddef">
      <summary>FK to patfielddef.PatFieldDefNum</summary>
    </column>
    <column order="2" name="Name" type="varchar(255)">
      <summary>Full text of PickList item.</summary>
    </column>
    <column order="3" name="Abbreviation" type="varchar(255)">
      <summary>Abbr to show when PickList item is displayed in cramped spaces like columns. Only implemented in Superfamily grid so far.</summary>
    </column>
    <column order="4" name="IsHidden" type="tinyint(4)">
      <summary>False for normal PickList items. Even if true/hidden, this item will still show in all the various windows where patient fields show. A hidden item will not normally show when picking from list for a patient unless the patient has already been assigned this item.</summary>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary>0-based.</summary>
    </column>
  </table>
  <table name="patient">
    <summary>One row for each patient.  Includes deleted patients.</summary>
    <column order="0" name="PatNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="LName" type="varchar(100)">
      <summary>Last name.</summary>
    </column>
    <column order="2" name="FName" type="varchar(100)">
      <summary>First name.</summary>
    </column>
    <column order="3" name="MiddleI" type="varchar(100)">
      <summary>Middle initial or name.</summary>
    </column>
    <column order="4" name="Preferred" type="varchar(100)">
      <summary>Preferred name, aka nickname.</summary>
    </column>
    <column order="5" name="PatStatus" type="tinyint">
      <summary>Enum:PatientStatus</summary>
      <Enumeration name="PatientStatus">
        <summary></summary>
        <EnumValue name="Patient">0</EnumValue>
        <EnumValue name="NonPatient">1</EnumValue>
        <EnumValue name="Inactive">2</EnumValue>
        <EnumValue name="Archived">3 - This status is also used for a merged patient that you're not keeping.</EnumValue>
        <EnumValue name="Deleted">4</EnumValue>
        <EnumValue name="Deceased">5</EnumValue>
        <EnumValue name="Prospective">6- Not an actual patient yet.</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="Gender" type="tinyint">
      <summary>Enum:PatientGender</summary>
      <Enumeration name="PatientGender">
        <summary>Known as administrativeGender (HL7 OID of 2.16.840.1.113883.5.1) Male=M, Female=F, Unknown=Undifferentiated=UN.</summary>
        <EnumValue name="Male">0</EnumValue>
        <EnumValue name="Female">1</EnumValue>
        <EnumValue name="Unknown">2- Required by HIPAA for privacy.  Required by ehr to track missing entries. EHR/HL7 known as undifferentiated (UN).</EnumValue>
        <EnumValue name="Other">3</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="Position" type="tinyint">
      <summary>Enum:PatientPosition Marital status would probably be a better name for this column.</summary>
      <Enumeration name="PatientPosition">
        <summary>Single, Married, Child, Widowed, Divorced.</summary>
        <EnumValue name="Single">0</EnumValue>
        <EnumValue name="Married">1</EnumValue>
        <EnumValue name="Child">2</EnumValue>
        <EnumValue name="Widowed">3</EnumValue>
        <EnumValue name="Divorced">4</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="Birthdate" type="date">
      <summary>Age is not stored in the database.  Age is always calculated as needed from birthdate.</summary>
    </column>
    <column order="9" name="SSN" type="varchar(100)">
      <summary>In the US, this is 9 digits, no dashes. For all other countries, any punctuation or format is allowed.</summary>
    </column>
    <column order="10" name="Address" type="varchar(100)">
      <summary>.</summary>
    </column>
    <column order="11" name="Address2" type="varchar(100)">
      <summary>Optional second address line.</summary>
    </column>
    <column order="12" name="City" type="varchar(100)">
      <summary>.</summary>
    </column>
    <column order="13" name="State" type="varchar(100)">
      <summary>2 Char in USA.  Used to store province for Canadian users.</summary>
    </column>
    <column order="14" name="Zip" type="varchar(100)">
      <summary>Postal code.  For Canadian claims, it must be ANANAN.  No validation gets done except there.</summary>
    </column>
    <column order="15" name="HmPhone" type="varchar(30)">
      <summary>Home phone. Includes any punctuation</summary>
    </column>
    <column order="16" name="WkPhone" type="varchar(30)">
      <summary>.</summary>
    </column>
    <column order="17" name="WirelessPhone" type="varchar(30)">
      <summary>.</summary>
    </column>
    <column order="18" name="Guarantor" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Head of household.</summary>
    </column>
    <column order="19" name="CreditType" type="char(1)">
      <summary>Single char. Shows at upper right corner of appointments.  Suggested use is A,B,or C to designate creditworthiness, 
            but it can actually be used for any purpose.</summary>
    </column>
    <column order="20" name="Email" type="varchar(100)">
      <summary>.</summary>
    </column>
    <column order="21" name="Salutation" type="varchar(100)">
      <summary>Dear __.  This field does not include the "Dear" or a trailing comma.  If this field is blank, then the typical salutation is 
            FName.  Or, if a Preferred name is present, that is used instead of FName.</summary>
    </column>
    <column order="22" name="EstBalance" type="double">
      <summary>Current patient balance.(not family). Never subtracts insurance estimates.</summary>
    </column>
    <column order="23" name="PriProv" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  The patient's primary provider.  Required.  The database maintenance tool ensures that every patient 
            always has this number set, so the program no longer has to handle 0.</summary>
    </column>
    <column order="24" name="SecProv" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Secondary provider (hygienist). Optional.</summary>
    </column>
    <column order="25" name="FeeSched" type="bigint(20)" fk="feesched">
      <summary>FK to feesched.FeeSchedNum.  Fee schedule for this patient.  Usually not used.  If missing, the practice default fee schedule is 
            used. If patient has insurance, then the fee schedule for the insplan is used.</summary>
    </column>
    <column order="26" name="BillingType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  Must have a value, or the patient will not show on some reports.</summary>
    </column>
    <column order="27" name="ImageFolder" type="varchar(100)">
      <summary>Name of folder where images will be stored. Not editable for now. Max length 100 because max path length is 260 and this is just part of the path..</summary>
    </column>
    <column order="28" name="AddrNote" type="text">
      <summary>Address or phone note.  Unlimited length in order to handle data from other programs during a conversion.</summary>
    </column>
    <column order="29" name="FamFinUrgNote" type="text">
      <summary>Family financial urgent note.  Only stored with guarantor, and shared for family.</summary>
    </column>
    <column order="30" name="MedUrgNote" type="varchar(255)">
      <summary>Individual patient note for Urgent medical.</summary>
    </column>
    <column order="31" name="ApptModNote" type="varchar(255)">
      <summary>Individual patient note for Appointment module note.</summary>
    </column>
    <column order="32" name="StudentStatus" type="char(1)">
      <summary>Single char.  Nonstudent='N' or blank, Parttime='P', Fulltime='F'.</summary>
    </column>
    <column order="33" name="SchoolName" type="varchar(255)">
      <summary>College name.  If Canadian, then this is field C10 and must be filled if C9 (patient.CanadianEligibilityCode) is 1 and patient 
            is 18 or older.</summary>
    </column>
    <column order="34" name="ChartNumber" type="varchar(100)">
      <summary>Usually blank. Alternative and supplement to PatNum. Can take alphanumeric. Usually set during conversion or when bridging to imaging software. Historically, it typically showed as a sticker on the outside of a paper chart.  Max length 100 to support larger ids for bridging to imaging softwares.</summary>
    </column>
    <column order="35" name="MedicaidID" type="varchar(20)">
      <summary>Optional. The Medicaid ID for this patient.</summary>
    </column>
    <column order="36" name="Bal_0_30" type="double">
      <summary>Aged balance from 0 to 30 days old. Aging numbers are for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="37" name="Bal_31_60" type="double">
      <summary>Aged balance from 31 to 60 days old. Aging numbers are for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="38" name="Bal_61_90" type="double">
      <summary>Aged balance from 61 to 90 days old. Aging numbers are for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="39" name="BalOver90" type="double">
      <summary>Aged balance over 90 days old. Aging numbers are for entire family.  Only stored with guarantor.</summary>
    </column>
    <column order="40" name="InsEst" type="double">
      <summary>Insurance Estimate for entire family. Only stored with guarantor.</summary>
    </column>
    <column order="41" name="BalTotal" type="double">
      <summary>Total balance for entire family before insurance estimate.  Not the same as the sum of the 4 aging balances because this can be 
            negative.  Only stored with guarantor.</summary>
    </column>
    <column order="42" name="EmployerNum" type="bigint(20)" fk="employer">
      <summary>FK to employer.EmployerNum.</summary>
    </column>
    <column order="43" name="EmploymentNote" type="varchar(255)">
      <summary>Not used since version 2.8.</summary>
    </column>
    <column order="44" name="County" type="varchar(255)" fk="county">
      <summary>FK to county.CountyName, although it will not crash if key absent.</summary>
    </column>
    <column order="45" name="GradeLevel" type="tinyint(4)">
      <summary>Enum:PatientGrade Gradelevel.</summary>
      <Enumeration name="PatientGrade">
        <summary>Grade level used in public health.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="First">1</EnumValue>
        <EnumValue name="Second">2</EnumValue>
        <EnumValue name="Third">3</EnumValue>
        <EnumValue name="Fourth">4</EnumValue>
        <EnumValue name="Fifth">5</EnumValue>
        <EnumValue name="Sixth">6</EnumValue>
        <EnumValue name="Seventh">7</EnumValue>
        <EnumValue name="Eighth">8</EnumValue>
        <EnumValue name="Ninth">9</EnumValue>
        <EnumValue name="Tenth">10</EnumValue>
        <EnumValue name="Eleventh">11</EnumValue>
        <EnumValue name="Twelfth">12</EnumValue>
        <EnumValue name="PrenatalWIC">13</EnumValue>
        <EnumValue name="PreK">14</EnumValue>
        <EnumValue name="Kindergarten">15</EnumValue>
        <EnumValue name="Other">16</EnumValue>
      </Enumeration>
    </column>
    <column order="46" name="Urgency" type="tinyint(4)">
      <summary>Enum:TreatmentUrgency Used in public health screenings.</summary>
      <Enumeration name="TreatmentUrgency">
        <summary>For public health.  Unknown, NoProblems, NeedsCarE, or Urgent.</summary>
        <EnumValue name="Unknown"></EnumValue>
        <EnumValue name="NoProblems"></EnumValue>
        <EnumValue name="NeedsCare"></EnumValue>
        <EnumValue name="Urgent"></EnumValue>
      </Enumeration>
    </column>
    <column order="47" name="DateFirstVisit" type="date">
      <summary>The date that the patient first visited the office.  Automated.</summary>
    </column>
    <column order="48" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. Can be zero if not attached to a clinic or no clinics set up.</summary>
    </column>
    <column order="49" name="HasIns" type="varchar(255)">
      <summary>For now, an 'I' indicates that the patient has insurance.  This is only used when displaying appointments.  
            It will later be expanded.  User can't edit.</summary>
    </column>
    <column order="50" name="TrophyFolder" type="varchar(255)">
      <summary>The Trophy bridge is inadequate, this attempts to make it usable for offices that have invested in Trophy hardware.</summary>
    </column>
    <column order="51" name="PlannedIsDone" type="tinyint">
      <summary>This simply indicates whether the 'done' box is checked in the chart module.  Used to be handled as a -1 in the NextAptNum field,
            but now that field is unsigned.</summary>
    </column>
    <column order="52" name="Premed" type="tinyint">
      <summary>Set to true if patient needs to be premedicated for appointments, includes PAC, halcion, etc.</summary>
    </column>
    <column order="53" name="Ward" type="varchar(255)">
      <summary>Only used in hospitals.</summary>
    </column>
    <column order="54" name="PreferConfirmMethod" type="tinyint">
      <summary>Enum:ContactMethod Used for eCR, which includes eReminders eConfirmations.</summary>
      <Enumeration name="ContactMethod">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="DoNotCall">1</EnumValue>
        <EnumValue name="HmPhone">2</EnumValue>
        <EnumValue name="WkPhone">3</EnumValue>
        <EnumValue name="WirelessPh">4</EnumValue>
        <EnumValue name="Email">5</EnumValue>
        <EnumValue name="SeeNotes">6</EnumValue>
        <EnumValue name="Mail">7</EnumValue>
        <EnumValue name="TextMessage">8</EnumValue>
      </Enumeration>
    </column>
    <column order="55" name="PreferContactMethod" type="tinyint">
      <summary>Enum:ContactMethod</summary>
      <Enumeration name="ContactMethod">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="DoNotCall">1</EnumValue>
        <EnumValue name="HmPhone">2</EnumValue>
        <EnumValue name="WkPhone">3</EnumValue>
        <EnumValue name="WirelessPh">4</EnumValue>
        <EnumValue name="Email">5</EnumValue>
        <EnumValue name="SeeNotes">6</EnumValue>
        <EnumValue name="Mail">7</EnumValue>
        <EnumValue name="TextMessage">8</EnumValue>
      </Enumeration>
    </column>
    <column order="56" name="PreferRecallMethod" type="tinyint">
      <summary>Enum:ContactMethod</summary>
      <Enumeration name="ContactMethod">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="DoNotCall">1</EnumValue>
        <EnumValue name="HmPhone">2</EnumValue>
        <EnumValue name="WkPhone">3</EnumValue>
        <EnumValue name="WirelessPh">4</EnumValue>
        <EnumValue name="Email">5</EnumValue>
        <EnumValue name="SeeNotes">6</EnumValue>
        <EnumValue name="Mail">7</EnumValue>
        <EnumValue name="TextMessage">8</EnumValue>
      </Enumeration>
    </column>
    <column order="57" name="SchedBeforeTime" type="time">
      <summary>.</summary>
    </column>
    <column order="58" name="SchedAfterTime" type="time">
      <summary>.</summary>
    </column>
    <column order="59" name="SchedDayOfWeek" type="tinyint">
      <summary>We do not use this, but some users do, so here it is. 0=none. Otherwise, 1-7 for day.</summary>
    </column>
    <column order="60" name="Language" type="varchar(100)">
      <summary>The primary language of the patient.  Typically eng (English), fra (French), spa (Spanish), or similar.  If it's a custom language, then it might look like Tahitian. If none, then empty string.</summary>
    </column>
    <column order="61" name="AdmitDate" type="date">
      <summary>Used in hospitals.  It can be before the first visit date.  It typically gets set automatically by the hospital system.</summary>
    </column>
    <column order="62" name="Title" type="varchar(15)">
      <summary>Includes any punctuation.  For example, Mr., Mrs., Miss, Dr., etc.  
            There is no selection mechanism yet for user; they must simply type it in.</summary>
    </column>
    <column order="63" name="PayPlanDue" type="double">
      <summary>Amount "due now" for all payment plans such that someone in this family is the payment plan guarantor.  
            This is the total of all payment plan charges past due (taking into account the PayPlansBillInAdvanceDays setting) subtract the amount 
            already paid for the payment plans.  Only stored with family guarantor.</summary>
    </column>
    <column order="64" name="SiteNum" type="bigint(20)" fk="site">
      <summary>FK to site.SiteNum. Can be zero. Replaces the old GradeSchool field with a proper foreign key.</summary>
    </column>
    <column order="65" name="DateTStamp" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or 
            program updates.  Not user editable.</summary>
    </column>
    <column order="66" name="ResponsParty" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. Can be zero.  Person responsible for medical decisions rather than finances.  Guarantor is still responsible
            for finances.  This is useful for nursing home residents.  Part of public health.</summary>
    </column>
    <column order="67" name="CanadianEligibilityCode" type="tinyint(4)">
      <summary>C09.  Eligibility Exception Code.  A number between 1-4.  0 is not acceptable for e-claims.
            1=FT student, 2=disabled, 3=disabled student, 4=code not applicable.  Warning.  4 is a 0 if using CDAnet version 02. 
            This column should have been created as an int. </summary>
    </column>
    <column order="68" name="AskToArriveEarly" type="int(11)">
      <summary>Number of minutes patient is asked to come early to appointments.</summary>
    </column>
    <column order="69" name="PreferContactConfidential" type="tinyint(4)">
      <summary>Enum:ContactMethod  Used for EHR.</summary>
      <Enumeration name="ContactMethod">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="DoNotCall">1</EnumValue>
        <EnumValue name="HmPhone">2</EnumValue>
        <EnumValue name="WkPhone">3</EnumValue>
        <EnumValue name="WirelessPh">4</EnumValue>
        <EnumValue name="Email">5</EnumValue>
        <EnumValue name="SeeNotes">6</EnumValue>
        <EnumValue name="Mail">7</EnumValue>
        <EnumValue name="TextMessage">8</EnumValue>
      </Enumeration>
    </column>
    <column order="70" name="SuperFamily" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  If this is the same as PatNum, then this is a SuperHead.  If zero, then not part of a superfamily.  
            Synched for entire family.  If family is part of a superfamily, then the guarantor for this family will show in the superfamily list in the
            Family module for anyone else who is in the superfamily.  Only a guarantor can be a superfamily head.</summary>
    </column>
    <column order="71" name="TxtMsgOk" type="tinyint(4)">
      <summary>Enum:YN</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="72" name="SmokingSnoMed" type="varchar(32)">
      <summary>EHR smoking status as a SNOMED code.  Will always be the most recent smoking status for the patient.</summary>
    </column>
    <column order="73" name="Country" type="varchar(255)">
      <summary>Country name.  Only used by HQ to add country names to statements.</summary>
    </column>
    <column order="74" name="DateTimeDeceased" type="datetime">
      <summary>Needed for EHR syndromic surveillance messaging.  Used in HL7 PID-29.  Also for feature request #3040.  Date and time because we 
            need precision to the minute in syndromic surveillence messging.</summary>
    </column>
    <column order="75" name="BillingCycleDay" type="int(11)">
      <summary>A number between 1 and 31 that is the day of month that repeat charges should be applied to this account. 
            Previously this was determined by the start date of the repeate charges.</summary>
    </column>
    <column order="76" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="77" name="SecDateEntry" type="date">
      <summary>Date automatically generated and user not allowed to change.  Date when patient was inserted.</summary>
    </column>
    <column order="78" name="HasSuperBilling" type="tinyint(4)">
      <summary>0 by default.  If true, this guarantor should be included in superbilling statements.</summary>
    </column>
    <column order="79" name="PatNumCloneFrom" type="bigint(20)">
      <summary>Deprecated, use patientlink table instead.
            Indicates if this patient should act as a clone of another patient. Previously, ortho cloned patients were signified by capitalizing the name fields of the newly cloned patient.
            This field will allow for an explicit flag to be set to indicate cloned status.</summary>
    </column>
    <column order="80" name="DiscountPlanNum" type="bigint(20)">
      <summary>Deprecated, use discountplansub table instead.
            FK to discountplan.DiscountPlanNum. Will be 0 if there is no DiscountPlan.</summary>
    </column>
    <column order="81" name="HasSignedTil" type="tinyint(4)">
      <summary>Signed Truth in Lending, relates to client permission to be charged interest on a payment plan.</summary>
    </column>
    <column order="82" name="ShortCodeOptIn" type="tinyint(4)">
      <summary>Syncs down from HQ and indicates whether the patient has texted STOP or START in response to text messages. Indicates if the patient has opted in, out, or not yet to using Short Codes for Appointment Texts.</summary>
    </column>
    <column order="83" name="SecurityHash" type="varchar(255)">
      <summary>Holds the salted hash of the PatNum. This prevents 3rd parties from inserting patients without our Db Integrity system noticing.</summary>
    </column>
  </table>
  <table name="patientlink">
    <summary>Keeps track of patients who have been merged or cloned.</summary>
    <column order="0" name="PatientLinkNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNumFrom" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. The patient that is linked from.
            For a Merge type, this is that patient that was merged from.
            For a Clone type, this is the original or master patient.</summary>
    </column>
    <column order="2" name="PatNumTo" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum, unless LinkType=PaySimple. The patient that is linked to.
            For a Merge type, this is that patient that was merged into.
            For a Clone type, this represents the clone that was made from the PatNumFrom patient.</summary>
    </column>
    <column order="3" name="LinkType" type="tinyint(4)">
      <summary>Enum:PatientLinkType The type of link.</summary>
      <Enumeration name="PatientLinkType">
        <summary>The manner in which two patients are linked together.</summary>
        <EnumValue name="Undefined">0</EnumValue>
        <EnumValue name="Merge">1 - The two patients have been merged into each other.</EnumValue>
        <EnumValue name="Clone">2 - A clone has been made of the From patient.  PatNumFrom is the original or master and PatNumTo is the clone.</EnumValue>
        <EnumValue name="PaySimple">3 - The PatNumFrom column will hold the ID for PaySimple.  This should not be used in OpenDental to get a patient.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="DateTimeLink" type="datetime">
      <summary>The time the link was created.</summary>
    </column>
  </table>
  <table name="patientnote">
    <summary>Essentially more columns in the patient table.  They are stored here because these fields can contain a lot of information, and we want to try to keep the size of the patient table a bit smaller.</summary>
    <column order="0" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Also the primary key for this table. Always one to one relationship with patient table.  A new patient might not have an entry here until needed.</summary>
    </column>
    <column order="1" name="FamFinancial" type="text">
      <summary>Only one note per family stored with guarantor.</summary>
    </column>
    <column order="2" name="ApptPhone" type="text">
      <summary>No longer used.</summary>
    </column>
    <column order="3" name="Medical" type="text">
      <summary>Medical Summary</summary>
    </column>
    <column order="4" name="Service" type="text">
      <summary>Service notes. Shows in Medical information window and in the Pt Info section of the Chart module.</summary>
    </column>
    <column order="5" name="MedicalComp" type="text">
      <summary>Complete current Medical History</summary>
    </column>
    <column order="6" name="Treatment" type="text">
      <summary>Shows in the Chart module normally just below the graphical tooth chart. Also known as Odontogram Notes.</summary>
    </column>
    <column order="7" name="ICEName" type="varchar(255)">
      <summary>In Case of Emergency Name.</summary>
    </column>
    <column order="8" name="ICEPhone" type="varchar(30)">
      <summary>In Case of Emergency Phone.</summary>
    </column>
    <column order="9" name="OrthoMonthsTreatOverride" type="int(11)">
      <summary>-1 by default. Overrides the default number of months for an ortho treatment for this patient.
            Gets automatically set to the current value found in the pref OrthoDefaultMonthsTreat when the first placement procedure has been completed and this value is -1.
            This column is an integer instead of a byte because it needs to store -1 so that users can override with the value of 0.
            When set to -1 the default practice value for the pref OrthoDefaultMonthsTreat is used.</summary>
    </column>
    <column order="10" name="DateOrthoPlacementOverride" type="date">
      <summary>Overrides the date of the first ortho procedure for this patient to use for ortho case patients. 
            If MinDate, then the date is derived by looking at the first ortho procedure for this patient.</summary>
    </column>
    <column order="11" name="SecDateTEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="12" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="13" name="Consent" type="tinyint(4)">
      <summary>Enum:PatConsentFlags None=0,ShareMedicationHistoryErx=1, Indicates if the patient consents for DoseSpot to access their medication
            history, bitwise.</summary>
      <Enumeration name="PatConsentFlags">
        <summary></summary>
        <EnumValue name="None">0 - None</EnumValue>
        <EnumValue name="ShareMedicationHistoryErx">1 - Patient consents for eRx to access their medication history</EnumValue>
      </Enumeration>
    </column>
    <column order="14" name="UserNumOrthoLocked" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. A real-time flag of which user is currently editing the Orth Chart.  Prevents concurrency issues. 0 indicates unlocked. -5 indicates that an instance of OD changed users locally in order to sign an Ortho Chart row. -4 only lasts for 5 seconds and indicates that a user saved the chart and all machines viewing that chart need to refresh -1 indicates another user with the same username took control.</summary>
    </column>
    <column order="15" name="Pronoun" type="tinyint(4)">
      <summary>Enum: PronounPreferred Patient Pronoun override. None indicates no override.</summary>
    </column>
  </table>
  <table name="patientportalinvite">
    <summary></summary>
    <column order="0" name="PatientPortalInviteNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="2" name="ApptNum" type="bigint(20)">
      <summary>Foreign key to the appointment represented by this AutoCommAppt.</summary>
    </column>
    <column order="3" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum for the corresponding appointment.</summary>
    </column>
    <column order="4" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="5" name="TSPrior" type="bigint(20)">
      <summary>This was the TSPrior used to send this reminder. </summary>
    </column>
    <column order="6" name="SendStatus" type="tinyint(4)">
      <summary>Indicates status of message.</summary>
    </column>
    <column order="7" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="8" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
    <column order="9" name="MessageType" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="10" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</summary>
    </column>
    <column order="11" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
    <column order="12" name="ApptDateTime" type="datetime">
      <summary>The Date and time of the original appointment. We need this in case the appointment was moved and needs another reminder sent out.</summary>
    </column>
  </table>
  <table name="patientrace">
    <summary>Each patient may have multiple races.  Used to represent a race or an ethnicity for a patient.</summary>
    <column order="0" name="PatientRaceNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="Race" type="tinyint(4)">
      <summary>Enum:PatRace Deprecated. CdcrecCode should be used exclusively.</summary>
      <Enumeration name="PatRace">
        <summary>Deprecated. Use CDCREC codes instead.</summary>
        <EnumValue name="NotSet">-1 - The value for all PatientRace entries after the Race column was deprecated.</EnumValue>
        <EnumValue name="Aboriginal">0 - Hidden for EHR.</EnumValue>
        <EnumValue name="AfricanAmerican">1 - CDCREC:2054-5 Race</EnumValue>
        <EnumValue name="AmericanIndian">2 - CDCREC:1002-5 Race</EnumValue>
        <EnumValue name="Asian">3 - CDCREC:2028-9 Race</EnumValue>
        <EnumValue name="DeclinedToSpecifyRace">4 - Our hard-coded option for EHR reporting.</EnumValue>
        <EnumValue name="HawaiiOrPacIsland">5 - CDCREC:2076-8 Race</EnumValue>
        <EnumValue name="Hispanic">6 - CDCREC:2135-2 Ethnicicty.  If EHR is turned on, our UI will force this to be supplemental to a base 'race'.</EnumValue>
        <EnumValue name="Multiracial">7 - We had to keep this for backward compatibility.  Hidden for EHR because it's explicitly not allowed.</EnumValue>
        <EnumValue name="Other">8 - CDCREC:2131-1 Race.</EnumValue>
        <EnumValue name="White">9 - CDCREC:2106-3 Race</EnumValue>
        <EnumValue name="NotHispanic">10 - CDCREC:2186-5 Ethnicity.  We originally used the lack of Hispanic to indicate NonHispanic.  Now we are going to explicitly store NonHispanic to make queries for ClinicalQualityMeasures easier.</EnumValue>
        <EnumValue name="DeclinedToSpecifyEthnicity">11 - Our hard-coded option for EHR reporting.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="CdcrecCode" type="varchar(255)" fk="cdcrec">
      <summary>FK to cdcrec.CdcrecCode. Example 2054-5. The value 'Declined to Specify' is stored as ASKU-ETHNICITY for ethnicity and ASKU-RACE as race.</summary>
    </column>
  </table>
  <table name="patplan">
    <summary>Each row represents the linking of one insplan to one patient for current coverage.  Dropping a plan will delete the entry in this table.  Deleting a patplan will delete the actual insplan (if no dependencies).</summary>
    <column order="0" name="PatPlanNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)">
      <summary>FK to  patient.PatNum.  The patient who currently has the insurance.  Not the same as the subscriber.</summary>
    </column>
    <column order="2" name="Ordinal" type="tinyint">
      <summary>Number like 1, 2, 3, etc.  Represents primary ins, secondary ins, tertiary ins, etc. 0 is not used</summary>
    </column>
    <column order="3" name="IsPending" type="tinyint">
      <summary>For informational purposes only. You have to enter the plan in order to check this box. Not related at all to the InsPending table.</summary>
    </column>
    <column order="4" name="Relationship" type="tinyint">
      <summary>Enum:Relat Remember that this may need to be changed in the Claim also, if already created.</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="5" name="PatID" type="varchar(100)">
      <summary>An optional patient ID which will override the insplan.SubscriberID on eclaims.  For Canada, this holds the Dependent Code, C17 and E17, and in that use it doesn't override subscriber id, but instead supplements it.</summary>
    </column>
    <column order="6" name="InsSubNum" type="bigint(20)" fk="inssub">
      <summary>FK to inssub.InsSubNum.  Gives info about the subscriber.</summary>
    </column>
    <column order="7" name="OrthoAutoFeeBilledOverride" type="double">
      <summary>Only for Ortho practices. The fee that will be charged out by the auto procedureto insurance each period. 
            Overrides insplan.OrthoAutoFeeBilled. -1 to use insplan default. Instantiated to -1 in the program so that it defaults to the insplan default.</summary>
    </column>
    <column order="8" name="OrthoAutoNextClaimDate" type="date">
      <summary>Only for Ortho practices. The date before which the next automatic ortho procedure/claim cannot be automatically generated.
            If blank, this patient's ortho treatment has been stopped.</summary>
    </column>
    <column order="9" name="SecDateTEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="10" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
  </table>
  <table name="patrestriction">
    <summary>Currently only used to block scheduling of specific patients.</summary>
    <column order="0" name="PatRestrictionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="PatRestrictType" type="tinyint(4)">
      <summary>Enum:PatRestrict </summary>
      <Enumeration name="PatRestrict">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="ApptSchedule">1 - Patient cannot be scheduled nor have schedule edited. This PatRestrict should probably be checked every place the group 
            permissions AppointmentCreate, AppointmentMove, and AppointmentEdit are checked.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="payconnectresponseweb">
    <summary>This table will never delete records, only upsert.  PayConnectResponseWeb rows are records of all payments made from the Patient Portal via either PayConnect's Web Portal, or PayConnect's Merchant Services WebService if using a credit card token as a result of PayConnect's Web Portal.</summary>
    <column order="0" name="PayConnectResponseWebNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="PayNum" type="bigint(20)" fk="payment">
      <summary>FK to payment.PayNum.</summary>
    </column>
    <column order="3" name="AccountToken" type="varchar(255)">
      <summary>The account token used to poll the processing status.</summary>
    </column>
    <column order="4" name="PaymentToken" type="varchar(255)">
      <summary>The payment token used for future payments.</summary>
    </column>
    <column order="5" name="ProcessingStatus" type="varchar(255)">
      <summary>Enum:PayConnectWebStatus Used to determine if the payment is pending, needs action, or is completed and attached to a payment.</summary>
      <Enumeration name="PayConnectWebStatus">
        <summary></summary>
        <EnumValue name="Created">0.</EnumValue>
        <EnumValue name="CreatedError">1.</EnumValue>
        <EnumValue name="Pending">2.</EnumValue>
        <EnumValue name="PendingError">3.</EnumValue>
        <EnumValue name="Expired">4.</EnumValue>
        <EnumValue name="Completed">5.</EnumValue>
        <EnumValue name="Cancelled">6.</EnumValue>
        <EnumValue name="Declined">7.</EnumValue>
        <EnumValue name="Unknown">8.</EnumValue>
        <EnumValue name="UnknownError">9.</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="DateTimeEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual datetime of entry.</summary>
    </column>
    <column order="7" name="DateTimePending" type="datetime">
      <summary>DateTime that the payment went to the pending status.</summary>
    </column>
    <column order="8" name="DateTimeCompleted" type="datetime">
      <summary>DateTime that the payment went to the completed status and is attached to a payment.</summary>
    </column>
    <column order="9" name="DateTimeExpired" type="datetime">
      <summary>DateTime that the payment opportunity time expired.</summary>
    </column>
    <column order="10" name="DateTimeLastError" type="datetime">
      <summary>DateTime of the last time that the payment had an error.</summary>
    </column>
    <column order="11" name="LastResponseStr" type="text">
      <summary>Raw JSON response (or error) from PayConnect.</summary>
    </column>
    <column order="12" name="CCSource" type="tinyint(4)">
      <summary>Enum:CreditCardSource .</summary>
      <Enumeration name="CreditCardSource">
        <summary></summary>
        <EnumValue name="None">0 - This is used when the payment is not a Credit Card. If CC, then this means we are storing the actual credit card number. Not recommended.</EnumValue>
        <EnumValue name="XServer">1 - Local installation of X-Charge</EnumValue>
        <EnumValue name="XWeb">2 - Credit card created via X-Web (an eService)</EnumValue>
        <EnumValue name="PayConnect">3 - PayConnect web service (from within OD).</EnumValue>
        <EnumValue name="XServerPayConnect">4 - Credit card has been added through the local installation of X-Charge and the PayConnect web service.</EnumValue>
        <EnumValue name="XWebPortalLogin">5 - Made from the login screen of the Patient Portal.</EnumValue>
        <EnumValue name="PaySimple">6 - PaySimple web service (from within OD).</EnumValue>
        <EnumValue name="PaySimpleACH">7 - PaySimple ACH web service (from within OD).</EnumValue>
        <EnumValue name="PayConnectPortal">8 - PayConnect credit card (made from Patient Portal)</EnumValue>
        <EnumValue name="PayConnectPortalLogin">9 - PayConnect credit card (made from Patient Portal Login screen).</EnumValue>
        <EnumValue name="CareCredit">10 - CareCredit.</EnumValue>
        <EnumValue name="EdgeExpressRCM">11 - Global Payments V1 Cloud (formerly EdgeExpress/GlobalPayments) when calling the RCM program.</EnumValue>
        <EnumValue name="EdgeExpressCNP">12 - Global Payments V1 Card Not Present API (formerly EdgeExpress/GlobalPayments).</EnumValue>
        <EnumValue name="API">13 - Payment taken through Open Dental API.</EnumValue>
        <EnumValue name="EdgeExpressPaymentPortal">14 - Global Payments V1 (formerly EdgeExpress/GlobalPayments) payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="EdgeExpressPaymentPortalGuest">15 - Global Payments V1 (formerly EdgeExpress/GlobalPayments) payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PayConnectPaymentPortal">16 - PayConnect payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="PayConnectPaymentPortalGuest">17 - PayConnect payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PaySimplePaymentPortal">18 - PaySimple payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="PaySimplePaymentPortalGuest">19 - PaySimple payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PaySimplePaymentPortalACH">20 - PaySimple ACH Payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="XWebPaymentPortal">21 - XWeb payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="XWebPaymentPortalGuest">22 - XWeb payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="MeetInTheCloudTerminal">23 - MeetInTheCloud (UI: Global Payments V2) payment via terminal.</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="Amount" type="double">
      <summary>The amount of the payment that is attempting to be made.</summary>
    </column>
    <column order="14" name="PayNote" type="varchar(255)">
      <summary>The note entered when making a payment.</summary>
    </column>
    <column order="15" name="IsTokenSaved" type="tinyint(4)">
      <summary>Whether or not the credit card token can be saved for future uses.</summary>
    </column>
    <column order="16" name="PayToken" type="varchar(255)">
      <summary>The payment token used to poll the processing status.</summary>
    </column>
    <column order="17" name="ExpDateToken" type="varchar(255)">
      <summary>Provides the Expiration Date of the account being accessed. Format is yyMM from XWeb gateway. Will be converted to ExpirationDate.</summary>
    </column>
    <column order="18" name="RefNumber" type="varchar(255)">
      <summary>The RefNumber associated to this transaction.  Will only be set for Completed PayConnectWebStatuses.</summary>
    </column>
    <column order="19" name="TransType" type="varchar(255)">
      <summary>The Transaction Type associated to this transaction.  Will only be set for Completed PayConnectWebStatuses.</summary>
    </column>
    <column order="20" name="EmailResponse" type="varchar(255)">
      <summary>Email address used for a requested receipt provided by the user when making a payment via the patient portal.</summary>
    </column>
    <column order="21" name="LogGuid" type="varchar(36)">
      <summary>The GUID used in EserviceLogs related to this response. May be blank.</summary>
    </column>
  </table>
  <table name="payment">
    <summary>A patient payment.  Always has at least one split.</summary>
    <column order="0" name="PayNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PayType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  This will be 0 if this is an income transfer to another provider. Examples: Cash, Check, CC, Refund.</summary>
    </column>
    <column order="2" name="PayDate" type="date">
      <summary>The date that the payment displays on the patient account.</summary>
    </column>
    <column order="3" name="PayAmt" type="double">
      <summary>Amount of the payment.  Must equal the sum of the splits.</summary>
    </column>
    <column order="4" name="CheckNum" type="varchar(25)">
      <summary>Check number is optional.</summary>
    </column>
    <column order="5" name="BankBranch" type="varchar(25)">
      <summary>Bank-branch code for checks. Example 19-7076.</summary>
    </column>
    <column order="6" name="PayNote" type="text">
      <summary>Any admin note.  Not for patient to see.  UI limits input length to 4000.</summary>
    </column>
    <column order="7" name="IsSplit" type="tinyint">
      <summary>No longer used.  Set to true to indicate that a payment has more than one paysplit.</summary>
    </column>
    <column order="8" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The patient where the payment entry will show.  But only the splits affect account balances.  This has a value even if the 'payment' is actually an income transfer to another provider.</summary>
    </column>
    <column order="9" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Can be 0 to indicate no clinic (unassigned). Copied from patient.ClinicNum when creating payment, but user can override.  Not used in provider income transfers.  Cannot be used in financial reporting when grouping by clinic, because payments may be split between clinics.</summary>
    </column>
    <column order="10" name="DateEntry" type="date">
      <summary>The date that this payment was entered.  Not user editable.</summary>
    </column>
    <column order="11" name="DepositNum" type="bigint(20)" fk="deposit">
      <summary>FK to deposit.DepositNum.  0 if not attached to any deposits.  Cash does not usually get attached to a deposit; only checks.</summary>
    </column>
    <column order="12" name="Receipt" type="text">
      <summary>Text of printed receipt if the payment was done electronically. Allows reprinting if needed.</summary>
    </column>
    <column order="13" name="IsRecurringCC" type="tinyint(4)">
      <summary>True if this was an automatically added recurring CC charge rather then one entered by the user.  This was set to true for all historical entries before version 11.1, but will be accurate after that.</summary>
    </column>
    <column order="14" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="15" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="16" name="PaymentSource" type="tinyint(4)">
      <summary>Enum:CreditCardSource Indicates the origin of the payment if the payment came from a credit card or from an external API. Will be 'None' if this payment did not use a credit card or API</summary>
      <Enumeration name="CreditCardSource">
        <summary></summary>
        <EnumValue name="None">0 - This is used when the payment is not a Credit Card. If CC, then this means we are storing the actual credit card number. Not recommended.</EnumValue>
        <EnumValue name="XServer">1 - Local installation of X-Charge</EnumValue>
        <EnumValue name="XWeb">2 - Credit card created via X-Web (an eService)</EnumValue>
        <EnumValue name="PayConnect">3 - PayConnect web service (from within OD).</EnumValue>
        <EnumValue name="XServerPayConnect">4 - Credit card has been added through the local installation of X-Charge and the PayConnect web service.</EnumValue>
        <EnumValue name="XWebPortalLogin">5 - Made from the login screen of the Patient Portal.</EnumValue>
        <EnumValue name="PaySimple">6 - PaySimple web service (from within OD).</EnumValue>
        <EnumValue name="PaySimpleACH">7 - PaySimple ACH web service (from within OD).</EnumValue>
        <EnumValue name="PayConnectPortal">8 - PayConnect credit card (made from Patient Portal)</EnumValue>
        <EnumValue name="PayConnectPortalLogin">9 - PayConnect credit card (made from Patient Portal Login screen).</EnumValue>
        <EnumValue name="CareCredit">10 - CareCredit.</EnumValue>
        <EnumValue name="EdgeExpressRCM">11 - Global Payments V1 Cloud (formerly EdgeExpress/GlobalPayments) when calling the RCM program.</EnumValue>
        <EnumValue name="EdgeExpressCNP">12 - Global Payments V1 Card Not Present API (formerly EdgeExpress/GlobalPayments).</EnumValue>
        <EnumValue name="API">13 - Payment taken through Open Dental API.</EnumValue>
        <EnumValue name="EdgeExpressPaymentPortal">14 - Global Payments V1 (formerly EdgeExpress/GlobalPayments) payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="EdgeExpressPaymentPortalGuest">15 - Global Payments V1 (formerly EdgeExpress/GlobalPayments) payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PayConnectPaymentPortal">16 - PayConnect payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="PayConnectPaymentPortalGuest">17 - PayConnect payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PaySimplePaymentPortal">18 - PaySimple payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="PaySimplePaymentPortalGuest">19 - PaySimple payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PaySimplePaymentPortalACH">20 - PaySimple ACH Payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="XWebPaymentPortal">21 - XWeb payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="XWebPaymentPortalGuest">22 - XWeb payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="MeetInTheCloudTerminal">23 - MeetInTheCloud (UI: Global Payments V2) payment via terminal.</EnumValue>
      </Enumeration>
    </column>
    <column order="17" name="ProcessStatus" type="tinyint(4)">
      <summary>Enum:ProcessStat Flags whether a payment came from online and needs to be processed.</summary>
      <Enumeration name="ProcessStat">
        <summary></summary>
        <EnumValue name="OfficeProcessed">0 - Payment made within the OD program.</EnumValue>
        <EnumValue name="OnlineProcessed">1 - Payment made from the Patient Portal and has been processed within OD.</EnumValue>
        <EnumValue name="OnlinePending">2 - Payment made from the Patient Portal and needs to be processed within OD.</EnumValue>
      </Enumeration>
    </column>
    <column order="18" name="RecurringChargeDate" type="date">
      <summary>The date of the recurring charge that this payment applies to.</summary>
    </column>
    <column order="19" name="ExternalId" type="varchar(255)">
      <summary>External Id</summary>
    </column>
    <column order="20" name="PaymentStatus" type="tinyint(4)">
      <summary>Enum:PaymentStatus </summary>
      <Enumeration name="PaymentStatus">
        <summary></summary>
        <EnumValue name="None">0 - None</EnumValue>
        <EnumValue name="PaySimpleAchPosted">1 - PaySimpleAchPosted</EnumValue>
        <EnumValue name="PaySimpleAchSettled">2 - PaySimpleAchSettled</EnumValue>
        <EnumValue name="PaySimpleAchFailed">3 - PaySimpleAchFailed</EnumValue>
      </Enumeration>
    </column>
    <column order="21" name="IsCcCompleted" type="tinyint(4)">
      <summary>A credit card transaction has been completed. This disables the CC buttons at the top of payment edit window to prevent duplicates.</summary>
    </column>
    <column order="22" name="MerchantFee" type="double">
      <summary>Stores any additional fees charged to the customer during a transaction. For display and reporting purposes.</summary>
    </column>
  </table>
  <table name="payortype">
    <summary>Used to identify the source of payment for a given patient at a given point in time.  As insurance is added and removed, rows should be either automatically inserted into this table, or the user should be prompted to specify what the new payor type is.  The DateStart of one payor type is interpreted as the end date of the previous payor type.  Example: Patient with no insurance may have payortype.SopCode=81 ("SelfPay").  Patient then adds Medicaid insurance and gets a second new PayorType entry with SopCode=2 (Medicaid).</summary>
    <column order="0" name="PayorTypeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateStart" type="date">
      <summary>Date of the beginning of new payor type.  End date is the DateStart of the next payor type entry.</summary>
    </column>
    <column order="3" name="SopCode" type="varchar(255)" fk="sop">
      <summary>FK to sop.SopCode. Examples: 121, 3115, etc. </summary>
    </column>
    <column order="4" name="Note" type="text">
      <summary></summary>
    </column>
  </table>
  <table name="payperiod">
    <summary>Used to view employee timecards.  Timecard entries are not linked to a pay period.  Instead, payperiods are set up, and the user can only view specific pay periods.  So it feels like they are linked, but it's date based.</summary>
    <column order="0" name="PayPeriodNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateStart" type="date">
      <summary>The first day of the payperiod</summary>
    </column>
    <column order="2" name="DateStop" type="date">
      <summary>The last day of the payperiod.  Inclusive, ignoring time of day.</summary>
    </column>
    <column order="3" name="DatePaycheck" type="date">
      <summary>The date that paychecks will be dated.  A few days after the dateStop.  Optional.</summary>
    </column>
  </table>
  <table name="payplan">
    <summary>Each row represents one signed agreement to make payments. </summary>
    <column order="0" name="PayPlanNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The patient who had the treatment done.</summary>
    </column>
    <column order="2" name="Guarantor" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The person responsible for the payments.  Does not need to be in the same family as the patient.  
            Not necessarily the same as the guarantor on the PayPlanCharge.</summary>
    </column>
    <column order="3" name="PayPlanDate" type="date">
      <summary>Date that the payment plan will display in the account.</summary>
    </column>
    <column order="4" name="APR" type="double">
      <summary>Annual percentage rate.  eg 18.  This does not take into consideration any late payments, but only the percentage used to calculate the amortization schedule.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>Generally used to archive the terms when the amortization schedule is created.</summary>
    </column>
    <column order="6" name="PlanNum" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum.  Will be 0 if standard payment plan.  But if this is being used to track expected insurance payments, then this will be the foreign key to insplan.PlanNum, and Guarantor will be 0.</summary>
    </column>
    <column order="7" name="CompletedAmt" type="double">
      <summary>The amount of the treatment that has already been completed.  This should match the sum of the principal amounts for most situations.  But if the procedures have not yet been completed, and the payment plan is to make any sense, then this number must be changed.</summary>
    </column>
    <column order="8" name="InsSubNum" type="bigint(20)" fk="inssub">
      <summary>FK to inssub.InsSubNum.  Will be 0 if standard payment plan.  But if this is being used to track expected insurance payments, then this will be the foreign key to inssub.InsSubNum, and Guarantor will be 0.</summary>
    </column>
    <column order="9" name="PaySchedule" type="tinyint(4)">
      <summary>Enum:PaymentSchedule How often payments are scheduled to be made. This was used to make charges for amortization schedules of patient payment plans before dynamic payment plans were created. It is conceptually the same as ChargeFrequency and provides the same options. This is still set in various places, but only ChargeFrequency is used in algorithms for creating charges. This is now only used for insurance and old patient payment plans.</summary>
      <Enumeration name="PaymentSchedule">
        <summary>Conceptually the same as the PayPlanFrequency enum. Still used to set PayPlan.PaySchedule, but only the PayPlanFrequency enum and PayPlan.ChargeFrequency are used in algorithms for creating charges.</summary>
        <EnumValue name="Monthly">0 - Pay 1 time every month.</EnumValue>
        <EnumValue name="MonthlyDayOfWeek">1 - Pay monthly, same week and day (e.g. 3rd Friday)</EnumValue>
        <EnumValue name="Weekly">2 - Pay every week per month.</EnumValue>
        <EnumValue name="BiWeekly">3 - Pay every other week per times per month.</EnumValue>
        <EnumValue name="Quarterly">4 - Pay 4 times per year.</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="NumberOfPayments" type="int(11)">
      <summary>The number of payments that will be made to complete the payment plan.</summary>
    </column>
    <column order="11" name="PayAmt" type="double">
      <summary>Payment amount due per payment plan charge.</summary>
    </column>
    <column order="12" name="DownPayment" type="double">
      <summary>The amount paid toward the payment plan when it was first opened.</summary>
    </column>
    <column order="13" name="IsClosed" type="tinyint(4)">
      <summary>True if this payment plan is closed.  Closed should not be edited.</summary>
    </column>
    <column order="14" name="Signature" type="text">
      <summary>The encrypted and bound signature in base64 format.  The signature is bound to the concatenation of the Total Amount,APR,Number of Payments,Payment Amount </summary>
    </column>
    <column order="15" name="SigIsTopaz" type="tinyint(4)">
      <summary>True if the signature is in Topaz format rather than OD format.</summary>
    </column>
    <column order="16" name="PlanCategory" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum</summary>
    </column>
    <column order="17" name="IsDynamic" type="tinyint(4)">
      <summary>True if this payment plan is a dynamic payment plan, false if it is static.</summary>
    </column>
    <column order="18" name="ChargeFrequency" type="tinyint(4)">
      <summary>Enum:PayPlanFrequency How often charges are created for the payment plan. This column was added when dynamic payment plans were created. Why this was added is uncertain because it is conceptually the same as PaySchedule and provides the same options. PaySchedule is still set in various places, but only ChargeFrequency is used in algorithms for creating charges. This is only used for dynamic payment plans.</summary>
      <Enumeration name="PayPlanFrequency">
        <summary>Conceptually the same as the PaymentSchedule enum. PaymentSchedule is still used to set PayPlan.PaySchedule, but only this enum and PayPlan.ChargeFrequency are used in algorithms for creating charges.</summary>
        <EnumValue name="Weekly">0 - Weekly </EnumValue>
        <EnumValue name="EveryOtherWeek">1 - Every Other Week</EnumValue>
        <EnumValue name="OrdinalWeekday">2 - Monthly, same week and day (e.g. 3rd Friday)</EnumValue>
        <EnumValue name="Monthly">3 - Monthly</EnumValue>
        <EnumValue name="Quarterly">4 - Quarterly</EnumValue>
      </Enumeration>
    </column>
    <column order="19" name="DatePayPlanStart" type="date">
      <summary>The date of the first payment plan charge. Does not include downpayment.</summary>
    </column>
    <column order="20" name="IsLocked" type="tinyint(4)">
      <summary>True if the payment plan is locked. This is "Locked", not just disabling the terms. Locked payment plans cannot add production or modify terms. The checkbox 'Locked' can't be unchecked unless the user has the PayPlanUnlock permission. If the preference PayPlanRequireLockForAPR is enabled, 'Locked' must be checked before saving a plan with APR.</summary>
    </column>
    <column order="21" name="DateInterestStart" type="date">
      <summary>The date on which the pay plan can begin posting interest charges.</summary>
    </column>
    <column order="22" name="DynamicPayPlanTPOption" type="tinyint(4)">
      <summary>Enum:DynamicPayPlanTPOptions Indicates the selected mode for how treatment planned procedures are handled by a dynamic payment plan.</summary>
      <Enumeration name="DynamicPayPlanTPOptions">
        <summary>Enum that changes how treatment planned procedures are handled in dynamic payment plans.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="AwaitComplete">1</EnumValue>
        <EnumValue name="TreatAsComplete">2</EnumValue>
      </Enumeration>
    </column>
    <column order="23" name="MobileAppDeviceNum" type="bigint(20)">
      <summary>A FK to the mobile app device that the PayPlan is currently on.</summary>
    </column>
    <column order="24" name="SecurityHash" type="varchar(255)">
      <summary>Holds the salted hash of the following paysplit fields: Guarantor, PayAmt, IsClosed, IsLocked. </summary>
    </column>
    <column order="25" name="SheetDefNum" type="bigint(20)" fk="sheetdef">
      <summary>FK to sheetdef.SheetDefNum. This is use when printing. Can only be payment plan type sheet. If 0, uses hard coded logic.</summary>
    </column>
  </table>
  <table name="payplancharge">
    <summary>One of the dated charges attached to a payment plan.  This has nothing to do with payments, but rather just causes the amount due to increase on the date of the charge.  The amount of the charge is the sum of the principal and the interest.</summary>
    <column order="0" name="PayPlanChargeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PayPlanNum" type="bigint(20)" fk="payplan">
      <summary>FK to payplan.PayPlanNum.</summary>
    </column>
    <column order="2" name="Guarantor" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The guarantor account that each charge will affect.  Does not have to match the guarantor of the payment plan.
            This column doesn't even have to point to a family guarantor at all because that has a different meaning than a PP guarantor. 
            E.g. Credits and Closeout debits will be linked to the patient, not guarantor.</summary>
    </column>
    <column order="3" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The patient account that the principal gets removed from.</summary>
    </column>
    <column order="4" name="ChargeDate" type="date">
      <summary>The date that the charge will show on the patient account.  Any charge with a future date will not show on the account yet and will not affect the balance.</summary>
    </column>
    <column order="5" name="Principal" type="double">
      <summary>For Debits, this is the principal charge amount.  For Credits (version 2 only), then this is the credit amount.</summary>
    </column>
    <column order="6" name="Interest" type="double">
      <summary>For Debits, this is the interest portion of this payment.  Always 0 for Credits.</summary>
    </column>
    <column order="7" name="Note" type="text">
      <summary>Any note about this particular payment plan charge</summary>
    </column>
    <column order="8" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  In old PPs, this was required to be the same for all payplancharges.  In DPPs, it can be different for each charge. This must match the object that FKey is pointing to, whether proc, adj, or orthocase. When a payment is applied, it's done with paysplit.PayPlanChargeNum. Those paysplit ProvNums also need to match. Old payment plans didn't need to have production attched, which is why ProvNums previously had to be the same.</summary>
    </column>
    <column order="9" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Since there is no ClincNum field at the payplan level, the clinic must be the same for all payplancharges.  It's initially assigned using the patient clinic.  Payments applied should be to this clinic, although the current user interface does not help with this.</summary>
    </column>
    <column order="10" name="ChargeType" type="tinyint(4)">
      <summary>Enum:PayPlanChargeType The charge type of the payment plan. 0 - ChargeDue, 1 - Production.  Only relevant for those on Payment Plan Version 2, not Dynamic Payment Plans.</summary>
      <Enumeration name="PayPlanChargeType">
        <summary>Jordan-I would like to change this enum, but it would break the API.</summary>
        <EnumValue name="Debit">0</EnumValue>
        <EnumValue name="Credit">1 -  The production can be either Procedure, Adjust, or Ortho. Only used for PPv2, not DPPs.</EnumValue>
      </Enumeration>
    </column>
    <column order="11" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum. The procedure that this payplancharge is attached to.  Only applies to credits. Since DPPs dont' use credits, this column is not used for DPPs. Always 0 for ChargeDue.  Can be 0 for production not attached to a procedure.</summary>
    </column>
    <column order="12" name="SecDateTEntry" type="datetime">
      <summary>DateTime payplancharge was added to the payplan. Not editable by user.</summary>
    </column>
    <column order="13" name="SecDateTEdit" type="timestamp">
      <summary>DateTime payplancharge was edited. Not editable by user.</summary>
    </column>
    <column order="14" name="StatementNum" type="bigint(20)" fk="statement">
      <summary>FK to statement.StatementNum.  Only used when the statement in an invoice.</summary>
    </column>
    <column order="15" name="FKey" type="bigint(20)">
      <summary>Only present for dynamic payment plans. Contains FKey of the link type. ProcNum, AdjNum, or OrthoCaseNum. Since one ChargeDue can be split to multiple procedures, multiple rows are created in that case. In UI, these would be grouped by due date unless user checked ungroup box. </summary>
    </column>
    <column order="16" name="LinkType" type="tinyint(4)">
      <summary>Enum:PayPlanLinkType Only present for dynamic payment plans. </summary>
      <Enumeration name="PayPlanLinkType">
        <summary></summary>
        <EnumValue name="None">0 - None. Should only be this when charges/credits are for regular static payment plans. </EnumValue>
        <EnumValue name="Adjustment">1 - Adjustment </EnumValue>
        <EnumValue name="Procedure">2 - Procedure </EnumValue>
        <EnumValue name="OrthoCase">3 - OrthoCase </EnumValue>
      </Enumeration>
    </column>
    <column order="17" name="IsOffset" type="tinyint(4)">
      <summary>Set to true if this charge is created to offset an overcharge. Dynamic payment plans can get into this rare scenario where a charge has been inserted into the database for too much value. There is a 'fix' that users can apply from within the dynamic payment plan overcharge report which will create offsetting negative charges. The Income Transfer logic needs to know that this is an overcharge in order to remove value from corresponding charge that is linked to the same production entry (proc, adj, etc).</summary>
    </column>
    <column order="18" name="IsDownPayment" type="tinyint(4)">
      <summary>Set to true if this charge is a down payment. There can be multiple charges marked as down payment on one pay plan because of how charges get split because they get attached to production.</summary>
    </column>
  </table>
  <table name="payplanlink">
    <summary>Each row represents Production for a Procedure, Adjustment, or OrthoCase on a (Dynamic) Payment Plan. The sum of these is the total of the payment plan.</summary>
    <column order="0" name="PayPlanLinkNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="PayPlanNum" type="bigint(20)" fk="payplan">
      <summary>FK to payplan.PayPlanNum</summary>
    </column>
    <column order="2" name="LinkType" type="tinyint(4)">
      <summary>Enum:PayPlanLinkType  The object type being linked to be credited. </summary>
      <Enumeration name="PayPlanLinkType">
        <summary></summary>
        <EnumValue name="None">0 - None. Should only be this when charges/credits are for regular static payment plans. </EnumValue>
        <EnumValue name="Adjustment">1 - Adjustment </EnumValue>
        <EnumValue name="Procedure">2 - Procedure </EnumValue>
        <EnumValue name="OrthoCase">3 - OrthoCase </EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FKey" type="bigint(20)">
      <summary>Stores the FKey of object being linked, known from link type. </summary>
    </column>
    <column order="4" name="AmountOverride" type="double">
      <summary>Optional override if full amount of object is not desired. </summary>
    </column>
    <column order="5" name="SecDateTEntry" type="datetime">
      <summary>DateTime. Date the link was created. If pref.PayPlanItemDateShowProc is false, then this is also the date that this entry shows in the main account module.</summary>
    </column>
  </table>
  <table name="payplantemplate">
    <summary>A template of payplan terms that can be copied to a payment plan.  Only used for dynamic payment plans, not patient payment plans.</summary>
    <column order="0" name="PayPlanTemplateNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="PayPlanTemplateName" type="varchar(255)">
      <summary>The name of the Pay Plan Template.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. Can be 0.</summary>
    </column>
    <column order="3" name="APR" type="double">
      <summary>Annual percentage rate.  eg 18.</summary>
    </column>
    <column order="4" name="InterestDelay" type="int(11)">
      <summary>The number of payments before interest is applied.</summary>
    </column>
    <column order="5" name="PayAmt" type="double">
      <summary>The total payment amount due for each period.</summary>
    </column>
    <column order="6" name="NumberOfPayments" type="int(11)">
      <summary>The total number of periods for the payment plan. If the Pay Plan is dynamic and NumberOfPayments is not 0 then this is only used to calculate the PayAmt. After the PayAmt is calculated, NumberOfPayments is set to 0.</summary>
    </column>
    <column order="7" name="ChargeFrequency" type="tinyint(4)">
      <summary>Enum:PayPlanFrequency How often charges are created for the payment plan. Monthly, weekly, etc.  Only for Dynamic Payment Plans.</summary>
      <Enumeration name="PayPlanFrequency">
        <summary>Conceptually the same as the PaymentSchedule enum. PaymentSchedule is still used to set PayPlan.PaySchedule, but only this enum and PayPlan.ChargeFrequency are used in algorithms for creating charges.</summary>
        <EnumValue name="Weekly">0 - Weekly </EnumValue>
        <EnumValue name="EveryOtherWeek">1 - Every Other Week</EnumValue>
        <EnumValue name="OrdinalWeekday">2 - Monthly, same week and day (e.g. 3rd Friday)</EnumValue>
        <EnumValue name="Monthly">3 - Monthly</EnumValue>
        <EnumValue name="Quarterly">4 - Quarterly</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="DownPayment" type="double">
      <summary>The amount paid toward the payment plan when it was first opened.</summary>
    </column>
    <column order="9" name="DynamicPayPlanTPOption" type="tinyint(4)">
      <summary>Enum:DynamicPayPlanTPOptions Indicates the selected mode for how treatment planned procedures are handled by a dynamic payment plan.  None, AwaitComplete, or TreatAsComplete.</summary>
      <Enumeration name="DynamicPayPlanTPOptions">
        <summary>Enum that changes how treatment planned procedures are handled in dynamic payment plans.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="AwaitComplete">1</EnumValue>
        <EnumValue name="TreatAsComplete">2</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="Note" type="varchar(255)">
      <summary>A detailed note of the terms shows for future reference. Any changes made to the terms will be added to the note. Other notes can be added as needed.</summary>
    </column>
    <column order="11" name="IsHidden" type="tinyint(4)">
      <summary>Templates can not be deleted, but can be hidden if not needed any more.</summary>
    </column>
    <column order="12" name="SheetDefNum" type="bigint(20)" fk="sheetdef">
      <summary>FK to sheetdef.SheetDefNum. This is use when printing. Can only be payment plan type sheet. If 0, uses hard coded logic.</summary>
    </column>
  </table>
  <table name="paysplit">
    <summary>Always attached to a payment.  Always affects exactly one patient account and one provider.</summary>
    <column order="0" name="SplitNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SplitAmt" type="double">
      <summary>Amount of split.</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.
            Can be the PatNum of the guarantor if this is a split for a payment plan and the guarantor is in another family.</summary>
    </column>
    <column order="3" name="ProcDate" type="date">
      <summary>DEPRECATED.  No longer used.  In older versions (before 7.0), this was the date that showed on the account.  Frequently the same as the date of the payment, but not necessarily.  Not when the payment was made.</summary>
    </column>
    <column order="4" name="PayNum" type="bigint(20)" fk="payment">
      <summary>FK to payment.PayNum.  Every paysplit must be linked to a payment.</summary>
    </column>
    <column order="5" name="IsDiscount" type="tinyint">
      <summary>No longer used.</summary>
    </column>
    <column order="6" name="DiscountType" type="tinyint">
      <summary>No longer used</summary>
    </column>
    <column order="7" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="8" name="PayPlanNum" type="bigint(20)" fk="payplan">
      <summary>FK to payplan.PayPlanNum.  0 if not attached to a payplan.</summary>
    </column>
    <column order="9" name="DatePay" type="date">
      <summary>Date always in perfect synch with Payment date.</summary>
    </column>
    <column order="10" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum.  0 if not attached to a procedure.</summary>
    </column>
    <column order="11" name="DateEntry" type="date">
      <summary>Date this paysplit was created.  User not allowed to edit.</summary>
    </column>
    <column order="12" name="UnearnedType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Usually 0 unless this is an Unearned / Prepayment split. If there is no procedure attached to the paysplit, defaults to the type set in Pref PrepaymentUnearnedType. In the paysplit UI, 0=None. When this is set, it defaults to the first one in the list of defs which is typically Prepayment.</summary>
    </column>
    <column order="13" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Can be 0.  Need not match the ClinicNum of the Payment, because a payment can be split between clinics.</summary>
    </column>
    <column order="14" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="15" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="16" name="FSplitNum" type="bigint(20)">
      <summary>No longer used.</summary>
    </column>
    <column order="17" name="AdjNum" type="bigint(20)" fk="adjustment">
      <summary>FK to adjustment.AdjNum.  Can be 0.  Indicates that this paysplit is meant to counteract an Adjustment.</summary>
    </column>
    <column order="18" name="PayPlanChargeNum" type="bigint(20)" fk="payplancharge">
      <summary>FK to payplancharge.PayPlanChargeNum. Can be 0. Indicates that this paysplit is meant to counteract a PayPlanCharge.</summary>
    </column>
    <column order="19" name="PayPlanDebitType" type="tinyint(4)">
      <summary>Enum:PayPlanDebitTypes Explicitly specifies what this paysplit should be applied towards in regards to principal or interest.</summary>
      <Enumeration name="PayPlanDebitTypes">
        <summary>Payment plan debit charge types. Used to keep track of payment splits made towards principal or interest.</summary>
        <EnumValue name="Unknown">0 - Legacy splits associated to payment plans did not specify what SplitAmt was applied towards and use this status.</EnumValue>
        <EnumValue name="Principal">1 - Flags a split as a principal only payment.</EnumValue>
        <EnumValue name="Interest">2 - Flags a split as an interest only payment.</EnumValue>
      </Enumeration>
    </column>
    <column order="20" name="SecurityHash" type="varchar(255)">
      <summary>Holds the salted hash of the following paysplit fields: PatNum, SplitAmt, DateEntry. </summary>
    </column>
  </table>
  <table name="paysuitepayment">
    <summary>Received from various instream PaySuite API calls. Primarily used to post or reconcile insurance payments in Open Dental.</summary>
    <column order="0" name="PaySuitePaymentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PaymentId" type="varchar(255)">
      <summary>PaySuite's payment identifier.</summary>
    </column>
    <column order="2" name="ProviderId" type="varchar(255)">
      <summary>CDA provider number of provider the payment was issued to. Provider.NationalProvID in Open Dental.</summary>
    </column>
    <column order="3" name="PaymentMethod" type="varchar(255)">
      <summary>"C" if payment is a cheque. "D" if payment is Direct Deposit.</summary>
    </column>
    <column order="4" name="PaymentReference" type="varchar(255)">
      <summary>Cheque number if PaymentMethod is "C". Direct deposit reference number if PaymentMethod is "D".</summary>
    </column>
    <column order="5" name="PaymentAmount" type="double">
      <summary>The total amount of the payment.</summary>
    </column>
    <column order="6" name="PaymentDate" type="date">
      <summary>Date the payment was made. Only specific to the date, not the time.</summary>
    </column>
    <column order="7" name="PaymentStatus" type="varchar(255)">
      <summary>PaySuite's payment status. "I"-Issued (Check/Direct Deposit not cashed or deposited yet), "P"-Paid (Check/Direct Deposit has been cashed or deposited), R-"Reversed", UT-Under Threshold (payment is too small for Direct Pay and will be rolled into a future payment).</summary>
    </column>
    <column order="8" name="ReversalReasonCode" type="varchar(255)">
      <summary>Reason the payment was reversed. "L"-Lost,"STO"-Stolen,"STA"-Stale,"MB"-Mailed back to instream,"PI"-Reversed by Payor,"O"-Other, blank if PaymentStatus is not "R".</summary>
    </column>
    <column order="9" name="AssociatedPaymentId" type="varchar(255)">
      <summary>If PaymentStatus is "R" or "UT", this is the PaymentId of the subsequent payment that this payment was rolled into. Will be blank for other statuses.</summary>
    </column>
    <column order="10" name="PaySuitePaymentDetailNum" type="bigint(20)">
      <summary>FK to PaySuitePaymentDetail</summary>
    </column>
    <column order="11" name="HasUnresolvedClaimPayment" type="tinyint(4)">
      <summary>True for PaySuitePayments with PaymentStatus "P" when the linked ClaimPayment has an incorrect amount, the linked ClaimPayment's ClaimProcs have an incorrect InsPayAmt sum, or there are missing or incorrect ClaimProcs linked to the ClaimPayment. True for PaySuitePayment with a PaymentStatus of "R" (Reversed) if a ClaimPayment is still linked to it.</summary>
    </column>
    <column order="12" name="ReconciliationStatus" type="tinyint(4)">
      <summary>Enum:EnumReconciliationStatus (0) DoNotProcess by default. Determines which stage of PaySuite reconciliation processing this PaySuitePayment is in.</summary>
      <Enumeration name="EnumReconciliationStatus">
        <summary>Determines which stage of PaySuite payment reconciliation a PaySuitePayment is in.</summary>
        <EnumValue name="DoNotProcess">0 - Set for PaySuitePayments we don't need to reconcile, those with a PaymentStatus of "I" (Issued), "UT" (UnderThreshold), or ones that enter the database as "R" (Reversed).</EnumValue>
        <EnumValue name="ReadyToProcess">1 - The OpenDentalService will attempt to reconcile these PaySuitePayments. We set this for PaySuitePayments that get inserted or updated with a PaymentStatus of "P" (Paid) and those that change from "P" to "R" (Reversed). A PaySuitePayment will also be set to this status from the UnresolvedClaims status after the user removes duplicate claims matches.</EnumValue>
        <EnumValue name="MultiClaimMatches">2 - The OpenDentalService sets this status during reconciliation processing when a claim has multiple matches in the database.</EnumValue>
        <EnumValue name="DiscrepanciesFound">3 - The OpenDentalService sets this status during reconciliation processing when discrepancies are found between a claim from the database and PaySuite's claim or eob.</EnumValue>
        <EnumValue name="NoDiscrepanciesFound">4 - Set when a PaySuitePayment matches all claims and no discrepancies are detected.</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="ClaimPaymentNum" type="bigint(20)" fk="claimpayment">
      <summary>FK to ClaimPayment. non-claim-specific PaySuite adjustments and fees will be added to the linked ClaimPayment without ClaimProcs to represent them.</summary>
    </column>
  </table>
  <table name="paysuitepaymentdetail">
    <summary>Additional details for a PaySuitePayment stored as a JSON string. The reason we have a separate table is because the json can be quite large and we don't usually need it.</summary>
    <column order="0" name="PaySuitePaymentDetailNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DetailsJson" type="mediumtext">
      <summary>JSON string containing additional details for a PaySuitePayment. Can be deserialized to class PaySuitePaymentDetails. Includes arrays for PaymentIds of payments rolled into this one, claims paid by this payment, adjustments to the payment, credits and debits issued by the payor during the payment period, and PaySuite fees (an empty array unless the provider's subscription method deducts fees from insurance payments).</summary>
    </column>
  </table>
  <table name="payterminal">
    <summary>Stores information about credit card terminals used for taking payments. Only used for PayConnect.</summary>
    <column order="0" name="PayTerminalNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Name" type="varchar(255)">
      <summary>User defined name for the payterminal. E.g. Front Desk.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="3" name="TerminalID" type="varchar(255)">
      <summary>Serial number of physical device, typically provided by the card processor.</summary>
    </column>
    <column order="4" name="CCIntegration" type="varchar(50)">
      <summary>Credit Card integration associated with the pay terminal (e.g. PayConnect)</summary>
    </column>
  </table>
  <table name="pearlrequest">
    <summary>Stores the necessary information for polling Pearl’s API to check if AI annotations have been generated for an image sent from the Imaging module. It's also used to prevent duplicate image submissions to the API, which would return an error response. To poll Pearl for an image, all that's required is a request_id and an organization_id. Organization_id is stored in the Pearl program link.</summary>
    <column order="0" name="PearlRequestNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="RequestId" type="varchar(255)">
      <summary>Request ID given to Pearl to uniquely identify this request. Generated as a GUID before uploading an image to Pearl.</summary>
    </column>
    <column order="2" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document. Links this request to the image that was sent. This is sufficient for mounts because mount images are sent individually to Pearl.</summary>
    </column>
    <column order="3" name="RequestStatus" type="tinyint(4)">
      <summary>Enum:EnumPearlStatus Keeps track of the request's status. Can be Polling, Received, or Error.</summary>
      <Enumeration name="EnumPearlStatus">
        <summary></summary>
        <EnumValue name="Polling">0 - An individual machine is actively polling Pearl.</EnumValue>
        <EnumValue name="Received">1 - The image was successfully processed and AI annotations were returned from Pearl.</EnumValue>
        <EnumValue name="Error">2 - An error occurred on Pearl’s side. Only set for errors that prevent this request from ever being fulfilled, such as the image being rejected.</EnumValue>
        <EnumValue name="TimedOut">3 - Pearl did not give results within the timeout period of 10 minutes. Polling for this request can be retried.</EnumValue>
        <EnumValue name="Uploading">4 - The image is being uploaded to Pearl.</EnumValue>
        <EnumValue name="ErrorUploading">5 - An error occurred while uploading. The image should be reuploaded..</EnumValue>
        <EnumValue name="ErrorProcessing">6 - An error occurred while processing. The image should not be reuploaded, but we can restart polling.</EnumValue>
        <EnumValue name="NoResults">7 - Pearl returned no results for this image. The image show not be reuploaded.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="DateTSent" type="date">
      <summary>The time the image was originally sent to Pearl.</summary>
    </column>
    <column order="5" name="DateTChecked" type="date">
      <summary>The most recent time an API call was made to Pearl to check the status of this request.</summary>
    </column>
  </table>
  <table name="perioexam">
    <summary>One perio exam for one patient on one date.  Has lots of periomeasures attached to it.</summary>
    <column order="0" name="PerioExamNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="ExamDate" type="date">
      <summary>.</summary>
    </column>
    <column order="3" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="4" name="DateTMeasureEdit" type="datetime">
      <summary>Date and time PerioExam was created or modified, including the associated PerioMeasure rows.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>Note box for exam based notes.</summary>
    </column>
  </table>
  <table name="periomeasure">
    <summary>One row can hold up to six measurements for one tooth, all of the same type.  Always attached to a perioexam.</summary>
    <column order="0" name="PerioMeasureNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PerioExamNum" type="bigint(20)" fk="perioexam">
      <summary>FK to perioexam.PerioExamNum.</summary>
    </column>
    <column order="2" name="SequenceType" type="tinyint">
      <summary>Enum:PerioSequenceType  eg probing, mobility, recession, etc.</summary>
      <Enumeration name="PerioSequenceType">
        <summary>In perio, the type of measurements for a given row.</summary>
        <EnumValue name="Mobility">0</EnumValue>
        <EnumValue name="Furcation">1</EnumValue>
        <EnumValue name="GingMargin">2-AKA recession.</EnumValue>
        <EnumValue name="MGJ">3-MucoGingivalJunction- the division between attached and unattached mucosa.</EnumValue>
        <EnumValue name="Probing">4</EnumValue>
        <EnumValue name="SkipTooth">5-For the skiptooth type, set surf to none, and ToothValue to 1.</EnumValue>
        <EnumValue name="BleedSupPlaqCalc">6. Sum of flags for bleeding(1), suppuration(2), plaque(4), and calculus(8).</EnumValue>
        <EnumValue name="CAL">7. But this type is never saved to the db. It is always calculated on the fly.</EnumValue>
        <EnumValue name="AttGing">8. Attached Gingiva.  This type is auto calculated and is never saved to the db.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="IntTooth" type="smallint(6)">
      <summary>Valid values are 1-32. Every measurement must be associated with a tooth.</summary>
    </column>
    <column order="4" name="ToothValue" type="smallint(6)">
      <summary>This is used when the measurement does not apply to a surface(mobility and skiptooth).  Valid values for all surfaces are 0 through 19, or -1 to represent no measurement taken.</summary>
    </column>
    <column order="5" name="MBvalue" type="smallint(6)">
      <summary>-1 represents no measurement and are very common. Values of 100+ represent positive values for Gingival Margins. Example: +5. Non-probing numbers show through from previous exams as slightly greyed out. The value from the most recent exam will show through. It will ignore any -1's on recent exams when deciding what should show through.</summary>
    </column>
    <column order="6" name="Bvalue" type="smallint(6)">
      <summary>.</summary>
    </column>
    <column order="7" name="DBvalue" type="smallint(6)">
      <summary>.</summary>
    </column>
    <column order="8" name="MLvalue" type="smallint(6)">
      <summary>.</summary>
    </column>
    <column order="9" name="Lvalue" type="smallint(6)">
      <summary>.</summary>
    </column>
    <column order="10" name="DLvalue" type="smallint(6)">
      <summary>.</summary>
    </column>
    <column order="11" name="SecDateTEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="12" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
  </table>
  <table name="pharmacy">
    <summary>An individual pharmacy store.</summary>
    <column order="0" name="PharmacyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PharmID" type="varchar(255)">
      <summary>NCPDPID assigned by NCPDP.  Not used yet.</summary>
    </column>
    <column order="2" name="StoreName" type="varchar(255)">
      <summary>For now, it can just be a common description.  Later, it might have to be an official designation.</summary>
    </column>
    <column order="3" name="Phone" type="varchar(255)">
      <summary>Includes all punctuation.</summary>
    </column>
    <column order="4" name="Fax" type="varchar(255)">
      <summary>Includes all punctuation.</summary>
    </column>
    <column order="5" name="Address" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="6" name="Address2" type="varchar(255)">
      <summary>Optional.</summary>
    </column>
    <column order="7" name="City" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="8" name="State" type="varchar(255)">
      <summary>Two char, uppercase.</summary>
    </column>
    <column order="9" name="Zip" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="10" name="Note" type="text">
      <summary>A freeform note for any info that is needed about the pharmacy, such as hours.</summary>
    </column>
    <column order="11" name="DateTStamp" type="timestamp">
      <summary>The last date and time this row was altered.  Not user editable.</summary>
    </column>
  </table>
  <table name="pharmclinic">
    <summary>Links a pharmacy store to a clinic.</summary>
    <column order="0" name="PharmClinicNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PharmacyNum" type="bigint(20)" fk="pharmacy">
      <summary>FK to pharmacy.PharmacyNum.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
  </table>
  <table name="phonenumber">
    <summary>Used to store phone numbers for patients.</summary>
    <column order="0" name="PhoneNumberNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="PhoneNumberVal" type="varchar(255)">
      <summary>The actual phone number for the patient.  Includes any punctuation.  No leading 1 or plus, so almost always 10 digits.</summary>
    </column>
    <column order="3" name="PhoneNumberDigits" type="varchar(30)">
      <summary>The phone number for the patient with all non-digit chars and any leading 1's or 0's removed.</summary>
    </column>
    <column order="4" name="PhoneType" type="tinyint(4)">
      <summary>Enum:PhoneType .  Used to determine which column in the patient table, if any, this row should be synced with.  Rows with 0 - Other
            are not synced with patient table columns.  The other values sync with their corresponding column in the patient table 1 - HmPhone,
            2 - WkPhone, and 3 - WirelessPhone.</summary>
      <Enumeration name="PhoneType">
        <summary>Used to identify which field, if any, in the patient table to </summary>
        <EnumValue name="Other">0 - Other</EnumValue>
        <EnumValue name="HmPhone">1 - HmPhone.  Row is synced with the patient.HmPhone column.</EnumValue>
        <EnumValue name="WkPhone">2 - WkPhone.  Row is synced with the patient.WkPhone column.</EnumValue>
        <EnumValue name="WirelessPhone">3 - WirelessPhone.  Row is synced with the patient.WirelessPhone column.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="popup">
    <summary>If an existing popup message gets changed, then an archive first gets created that's a copy of the original.  This is so that we can track historical changes.  When a new one gets created, all the archived popups will get automatically repointed to the new one.  If you "delete" a popup, it actually archives that popup.  All the other archives of that popup still point to the newly archived popup, but now there is no popup in that group with the IsArchived flag not set.</summary>
    <column order="0" name="PopupNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="Description" type="text">
      <summary>The text of the popup.</summary>
    </column>
    <column order="3" name="IsDisabled" type="tinyint(1)">
      <summary>Deprecated. Use DateTimeDisabled instead.</summary>
    </column>
    <column order="4" name="PopupLevel" type="tinyint(4)">
      <summary>Enum:EnumPopupLevel 0=Patient, 1=Family, 2=Superfamily. If Family, then this Popup will apply to the entire family.  If Superfamily, then this popup will apply to the entire superfamily.</summary>
      <Enumeration name="EnumPopupLevel">
        <summary></summary>
        <EnumValue name="Patient">0=Patient</EnumValue>
        <EnumValue name="Family">1=Family</EnumValue>
        <EnumValue name="SuperFamily">2=SuperFamily</EnumValue>
        <EnumValue name="Automation">3=Automation. Not in db. This is only used in FormPopupsForFam as a dummy status for temporary display objects that will not be in db.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="6" name="DateTimeEntry" type="datetime">
      <summary>The server time that this note was entered.  Cannot be changed by user.  Does not get changed automatically when level or isDisabled gets changed.  If note itself changes, then a new popup is created along with a new DateTimeEntry. Current popup's edit date gets set to the previous entry's DateTimeEntry</summary>
    </column>
    <column order="7" name="IsArchived" type="tinyint(4)">
      <summary>Indicates that this is not the most current popup and that it is an archive.  True for any archived or "deleted" popups.</summary>
    </column>
    <column order="8" name="PopupNumArchive" type="bigint(20)">
      <summary>This will be zero for current popups that show when a patient is selected.  Archived popups will have a value which is the FK to its parent Popup.  The parent popup could be the most recent popup or another archived popup.  Will be zero for current and "deleted" popups.</summary>
    </column>
    <column order="9" name="DateTimeDisabled" type="datetime">
      <summary>The DateTime at which this popup will be disabled. If this is DateTime.MinValue, then it will never be disabled.</summary>
    </column>
  </table>
  <table name="preference">
    <summary>Stores small bits of data for a wide variety of purposes.  Any data that's too small to warrant its own table will usually end up here.</summary>
    <column order="0" name="PrefName" type="varchar(255)">
      <summary>The text 'key' in the key/value pairing.</summary>
    </column>
    <column order="1" name="ValueString" type="text">
      <summary>The stored value.</summary>
    </column>
    <column order="2" name="PrefNum" type="bigint(20)">
      <summary>Primary key. Not actually used. All queries are designed to use PrefName.</summary>
    </column>
    <column order="3" name="Comments" type="text">
      <summary>Documentation on usage and values of each pref.  Mostly deprecated now in favor of using XML comments in the code.</summary>
    </column>
  </table>
  <table name="printer">
    <summary>One printer selection for one situation for one computer.</summary>
    <column order="0" name="PrinterNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ComputerNum" type="bigint(20)" fk="computer">
      <summary>FK to computer.ComputerNum.  This will be changed some day to refer to the computername, because it would make more sense as a key than a cryptic number.</summary>
    </column>
    <column order="2" name="PrintSit" type="tinyint">
      <summary>Enum:PrintSituation One of about 10 different situations where printing takes place. PrintSituation.Default is the OD default, not the windows default.</summary>
      <Enumeration name="PrintSituation">
        <summary>Used in the printer db table. Used to identify the printer to use for the given PrintSituation.</summary>
        <EnumValue name="Default">0- Covers any printing situation not listed separately.</EnumValue>
        <EnumValue name="Statement">1</EnumValue>
        <EnumValue name="LabelSingle">2</EnumValue>
        <EnumValue name="Claim">3</EnumValue>
        <EnumValue name="TPPerio">4- TP and perio</EnumValue>
        <EnumValue name="Rx">5</EnumValue>
        <EnumValue name="LabelSheet">6</EnumValue>
        <EnumValue name="Postcard">7</EnumValue>
        <EnumValue name="Appointments">8</EnumValue>
        <EnumValue name="RxControlled">9</EnumValue>
        <EnumValue name="Receipt">10</EnumValue>
        <EnumValue name="RxMulti">11</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="PrinterName" type="varchar(255)">
      <summary>The name of the printer as set from the specified computer. Usually, if no printer was selected for a specific or default situation, then there will be no row in the db. But this can also be an empty string. For example, if DisplayPrompt is true, then a row is required in the db even if no specific printer is selected. Empty string or missing row indicates to use windows default or OD default.</summary>
    </column>
    <column order="4" name="DisplayPrompt" type="tinyint">
      <summary>If true, then user will be prompted for printer.  Otherwise, print directly with little user interaction.</summary>
    </column>
    <column order="5" name="FileExtension" type="varchar(255)">
      <summary>String that holds the file extension type for this printer. No leading period. Example pdf or xps. Only used when IsVirtualPrinter is true.</summary>
    </column>
    <column order="6" name="IsVirtualPrinter" type="tinyint(4)">
      <summary>Bool that indicates if this printer is a virtual  printer (pdf, xps, etc).</summary>
    </column>
  </table>
  <table name="procapptcolor">
    <summary>An individual procedure code color range.</summary>
    <column order="0" name="ProcApptColorNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CodeRange" type="varchar(255)">
      <summary>Procedure code range defined by user.  Includes commas and dashes, but no spaces.  The codes need not be valid since they are ranges.</summary>
    </column>
    <column order="2" name="ColorText" type="int(11)">
      <summary>Color that shows in appointments</summary>
    </column>
    <column order="3" name="ShowPreviousDate" type="tinyint(4)">
      <summary>Adds most recent completed date to ProcsColored</summary>
    </column>
  </table>
  <table name="procbutton">
    <summary>The 'buttons' to show in the Chart module.  They must have items attached in order to do anything.</summary>
    <column order="0" name="ProcButtonNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>The text to show on the button.</summary>
    </column>
    <column order="2" name="ItemOrder" type="smallint">
      <summary>Order that they will show in the Chart module.</summary>
    </column>
    <column order="3" name="Category" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.</summary>
    </column>
    <column order="4" name="ButtonImage" type="text">
      <summary>If no image, then the clob will be an empty string.  In this case, the bitmap will be null when loaded from the database.</summary>
    </column>
    <column order="5" name="IsMultiVisit" type="tinyint(4)">
      <summary>Only useful for procedure buttons which cause more than one procedure to be charted.  Example: Crown (D code) and Delivery (N code).
            Causes the procedures generated by this procedure button to be grouped using links in the procmultivisit table.</summary>
    </column>
  </table>
  <table name="procbuttonitem">
    <summary>Attached to procbuttons.  These tell the program what to do when a user clicks on a button.  There are two types: proccodes or autocodes.</summary>
    <column order="0" name="ProcButtonItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProcButtonNum" type="bigint(20)" fk="procbutton">
      <summary>FK to procbutton.ProcButtonNum.</summary>
    </column>
    <column order="2" name="OldCode" type="varchar(15)">
      <summary>Do not use.</summary>
    </column>
    <column order="3" name="AutoCodeNum" type="bigint(20)" fk="autocode">
      <summary>FK to autocode.AutoCodeNum.  0 if this is a procedure code.</summary>
    </column>
    <column order="4" name="CodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum.  0 if this is an autocode.</summary>
    </column>
    <column order="5" name="ItemOrder" type="bigint(20)">
      <summary>Unusual ItemOrder column. Set implicitly based on the order procedures were added to the procedure button. This should prevent "random"
            ordered procedures on buttons with multiple procedures.</summary>
    </column>
  </table>
  <table name="procbuttonquick">
    <summary>Used to customize quick buttons in the chart module.</summary>
    <column order="0" name="ProcButtonQuickNum" type="bigint(20)">
      <summary>Primary Key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Description used for display.</summary>
    </column>
    <column order="2" name="CodeValue" type="varchar(255)" fk="procedurecode">
      <summary>FK to procedurecode.ProcCode. </summary>
    </column>
    <column order="3" name="Surf" type="varchar(255)">
      <summary>Surfaces. </summary>
    </column>
    <column order="4" name="YPos" type="int(11)">
      <summary>Zero based YPos, row number within panel.</summary>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary>Items within each row are sorted using item order. Smallest item order will be drawn on the left.</summary>
    </column>
    <column order="6" name="IsLabel" type="tinyint(4)">
      <summary>If true, this "button" will be displayed as a label.</summary>
    </column>
  </table>
  <table name="proccodenote">
    <summary>Stores the default note and time increments for one procedure code for one provider.  That way, an unlimited number of providers can each have different notes and times.  These notes and times override the defaults which are part of the procedurecode table.  So, for single provider offices, there will be no change to the current interface.</summary>
    <column order="0" name="ProcCodeNoteNum" type="bigint(20)">
      <summary>Primary Key.</summary>
    </column>
    <column order="1" name="CodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum.</summary>
    </column>
    <column order="2" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="3" name="Note" type="text">
      <summary>The note.</summary>
    </column>
    <column order="4" name="ProcTime" type="varchar(255)">
      <summary>X's and /'s describe Dr's time and assistant's time in the same increments as the user has set.</summary>
    </column>
    <column order="5" name="ProcStatus" type="tinyint(4)">
      <summary>Enum:ProcStat Indicates which status the procedure has to be set to in order for this note to take affect.
            Should only ever be 1 (TP) or 2 (C).  See procedurelog.ProcStatus for more info.</summary>
      <Enumeration name="ProcStat">
        <summary>Procedure Status.  These statuses are translated via class type "enumProcStat" (ex Lan.g("enumProcStat","..."))</summary>
        <EnumValue name="None">0 - Not used.</EnumValue>
        <EnumValue name="TP">1- Treatment Plan.</EnumValue>
        <EnumValue name="C">2- Complete.</EnumValue>
        <EnumValue name="EC">3- Existing Current Provider.</EnumValue>
        <EnumValue name="EO">4- Existing Other Provider.</EnumValue>
        <EnumValue name="R">5- Referred Out.</EnumValue>
        <EnumValue name="D">6- Deleted.</EnumValue>
        <EnumValue name="Cn">7- Condition.</EnumValue>
        <EnumValue name="TPi">8- Treatment Plan inactive.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="procedurecode">
    <summary>A list setup ahead of time with all the procedure codes used by the office.  Every procedurelog entry which is attached to a patient is also linked to this table.</summary>
    <column order="0" name="CodeNum" type="bigint(20)">
      <summary>Primary Key.  This happened in version 4.8.7.</summary>
    </column>
    <column order="1" name="ProcCode" type="varchar(15)">
      <summary>D-Code. Was Primary key, but now CodeNum is primary key.  Can hold dental codes, medical codes, custom codes, etc.</summary>
    </column>
    <column order="2" name="Descript" type="varchar(255)">
      <summary>The main description.</summary>
    </column>
    <column order="3" name="AbbrDesc" type="varchar(50)">
      <summary>Abbreviated description.</summary>
    </column>
    <column order="4" name="ProcTime" type="varchar(24)">
      <summary>X's and /'s describe Dr's time and assistant's time in the same increments as the user has set.</summary>
    </column>
    <column order="5" name="ProcCat" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  The category that this code will be found under in the search window.  Has nothing to do with insurance categories.</summary>
    </column>
    <column order="6" name="TreatArea" type="tinyint">
      <summary>Enum:TreatmentArea </summary>
      <Enumeration name="TreatmentArea">
        <summary>Used in procedurecode setup to specify the treatment area for a procedure.  This determines what fields are available when editing an appointment.</summary>
        <EnumValue name="None">0-goes on claims as blank.</EnumValue>
        <EnumValue name="Surf">1</EnumValue>
        <EnumValue name="Tooth">2</EnumValue>
        <EnumValue name="Mouth">3-goes on claims as 00.</EnumValue>
        <EnumValue name="Quad">4</EnumValue>
        <EnumValue name="Sextant">5</EnumValue>
        <EnumValue name="Arch">6</EnumValue>
        <EnumValue name="ToothRange">7</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="NoBillIns" type="tinyint">
      <summary>If true, do not usually bill this procedure to insurance.</summary>
    </column>
    <column order="8" name="IsProsth" type="tinyint">
      <summary>True if Crown,Bridge,Denture, or RPD. Forces user to enter Initial or Replacement and Date.</summary>
    </column>
    <column order="9" name="DefaultNote" type="text">
      <summary>The default procedure note to copy when marking complete.</summary>
    </column>
    <column order="10" name="IsHygiene" type="tinyint">
      <summary>Identifies hygiene procedures so that the correct provider can be selected.</summary>
    </column>
    <column order="11" name="GTypeNum" type="smallint">
      <summary>No longer used.</summary>
    </column>
    <column order="12" name="AlternateCode1" type="varchar(15)">
      <summary>For Medicaid.  There may be more later.</summary>
    </column>
    <column order="13" name="MedicalCode" type="varchar(15)" fk="procedurecode">
      <summary>FK to procedurecode.ProcCode.  The actual medical code that is being referenced must be setup first.  Anytime a procedure it added, this medical code will also be added to that procedure.  The user can change it in procedurelog.</summary>
    </column>
    <column order="14" name="IsTaxed" type="tinyint">
      <summary>Used by some offices.  SalesTaxPercentage has been added to the preference table to store the amount of sales tax to apply as an adjustment attached to a procedurelog entry.</summary>
    </column>
    <column order="15" name="PaintType" type="tinyint(4)">
      <summary>Enum:ToothPaintingType </summary>
      <Enumeration name="ToothPaintingType">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="Extraction">1</EnumValue>
        <EnumValue name="Implant">2</EnumValue>
        <EnumValue name="RCT">3</EnumValue>
        <EnumValue name="PostBU">4</EnumValue>
        <EnumValue name="FillingDark">5</EnumValue>
        <EnumValue name="FillingLight">6</EnumValue>
        <EnumValue name="CrownDark">7</EnumValue>
        <EnumValue name="CrownLight">8</EnumValue>
        <EnumValue name="BridgeDark">9</EnumValue>
        <EnumValue name="BridgeLight">10</EnumValue>
        <EnumValue name="DentureDark">11</EnumValue>
        <EnumValue name="DentureLight">12</EnumValue>
        <EnumValue name="Sealant">13</EnumValue>
        <EnumValue name="Veneer">14</EnumValue>
        <EnumValue name="Text">15-Text was previously called Watch</EnumValue>
        <EnumValue name="RetainedRoot">16</EnumValue>
        <EnumValue name="SpaceMaintainer">17</EnumValue>
      </Enumeration>
    </column>
    <column order="16" name="GraphicColor" type="int(11)">
      <summary>If set to anything but 0, then this will override the graphic color for all procedures of this code, regardless of the status.</summary>
    </column>
    <column order="17" name="LaymanTerm" type="varchar(255)">
      <summary>When creating treatment plans, this description will be used instead of the technical description.</summary>
    </column>
    <column order="18" name="IsCanadianLab" type="tinyint">
      <summary>Only used in Canada.  Set to true if this procedure code is only used as an adjunct to track the lab fee.</summary>
    </column>
    <column order="19" name="PreExisting" type="tinyint(1)">
      <summary>This is true if this procedure code existed before ADA code distribution changed at version 4.8, false otherwise.</summary>
    </column>
    <column order="20" name="BaseUnits" type="int(11)">
      <summary>Support for Base Units for a Code (like anesthesia).  Should normally be zero.</summary>
    </column>
    <column order="21" name="SubstitutionCode" type="varchar(25)" fk="procedurecode">
      <summary>FK to procedurecode.ProcCode.  Used for posterior composites because insurance substitutes the amalgam code when figuring the coverage.</summary>
    </column>
    <column order="22" name="SubstOnlyIf" type="int(11)">
      <summary>Enum:SubstitutionCondition Used so that posterior composites only substitute if tooth is molar.  Ins usually pays for premolar composites.</summary>
      <Enumeration name="SubstitutionCondition">
        <summary>Used for insurance substitutions conditions of procedurecodes.  Mostly for posterior composites.</summary>
        <EnumValue name="Always">0</EnumValue>
        <EnumValue name="Molar">1</EnumValue>
        <EnumValue name="SecondMolar">2</EnumValue>
        <EnumValue name="Never">3</EnumValue>
        <EnumValue name="Posterior">4</EnumValue>
      </Enumeration>
    </column>
    <column order="23" name="DateTStamp" type="timestamp">
      <summary>Last datetime that this row was inserted or updated.</summary>
    </column>
    <column order="24" name="IsMultiVisit" type="tinyint(4)">
      <summary>Deprecated</summary>
    </column>
    <column order="25" name="DrugNDC" type="varchar(255)">
      <summary>11 digits or blank, enforced.  For 837I</summary>
    </column>
    <column order="26" name="RevenueCodeDefault" type="varchar(255)">
      <summary>Gets copied to procedure.RevCode.  For 837I</summary>
    </column>
    <column order="27" name="ProvNumDefault" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  0 for none. Otherwise, this provider will be used for this code instead of the normal provider.</summary>
    </column>
    <column order="28" name="CanadaTimeUnits" type="double">
      <summary>For Canadian customers, tracks scaling insurance and periodontal scaling units for patients depending on coverage.</summary>
    </column>
    <column order="29" name="IsRadiology" type="tinyint(4)">
      <summary>Set to true for radiology procedures.  An EHR core measure uses this flag to help determine the denominator for rad orders.</summary>
    </column>
    <column order="30" name="DefaultClaimNote" type="text">
      <summary>Default note inserted to claim note when claim is created.</summary>
    </column>
    <column order="31" name="DefaultTPNote" type="text">
      <summary>The default procedure note used when creating a new treatment planned procedure.</summary>
    </column>
    <column order="32" name="BypassGlobalLock" type="tinyint(4)">
      <summary>Enum:BypassLockStatus Specifies whether a proceduce with this code can be created before the global lock date. The only values that
            should be used for this field are NeverBypass and BypassIfZero.</summary>
      <Enumeration name="BypassLockStatus">
        <summary>The conditions when the global lock date can be bypassed.</summary>
        <EnumValue name="NeverBypass">0 - Never bypass the lock date.</EnumValue>
        <EnumValue name="BypassIfZero">1 - Bypass the lock date if the fee is zero.</EnumValue>
        <EnumValue name="BypassAlways">2 - Always bypass the global lock date.</EnumValue>
      </Enumeration>
    </column>
    <column order="33" name="TaxCode" type="varchar(16)">
      <summary>Used only by OD HQ for Sales Tax.  This is the tax code we send to Avalara API so they can determine how much sales tax to charge for this procedure.  The only way to edit this value is through raw queries, which is very dangerous.</summary>
    </column>
    <column order="34" name="PaintText" type="varchar(255)">
      <summary>The text to draw on the tooth for paint type Text.</summary>
    </column>
    <column order="35" name="AreaAlsoToothRange" type="tinyint(4)">
      <summary>This is an adjunct to TreatArea. If Quad or Arch, then this allows users to also specify a tooth or tooth range.  Required by some insurance.</summary>
    </column>
    <column order="36" name="DiagnosticCodes" type="varchar(255)">
      <summary>Text to store up to 4 ICD-10 codes. Codes are comma-separated with no whitespace. Used to set the default DiagnosticCode, DiagnosticCode2, DiagnosticCode3, and DiagnosticCode4 fields for new procedures linked to the procedure code. When this field is not empty or null, it will override the ICD9DefaultForNewProcs preference. Example: M26.31,K08.401,K02.51</summary>
    </column>
  </table>
  <table name="procedurelog">
    <summary>Database table is procedurelog.  A procedure for a patient.  Can be treatment planned or completed.  Once it's completed, it gets tracked more closely by the security portion of the program.  A procedure can NEVER be deleted.  Status can just be changed to "deleted".
            A "Group Note" is a special kind of procedure. Its status is always EC. It always uses DCode "~GRP~". Just like all other procs, it can have exactly one ProcNote. To attach other procs to a Group Note, we use the ProcGroupItem table. It does not have to have any attachd procs, and their ProcStatuses do not matter (except maybe D). The ProvNum of a GroupNote can be set independently of the ProvNums on the attached procs.</summary>
    <column order="0" name="ProcNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="AptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum.  Only allowed to attach proc to one appt(not counting planned appt)</summary>
    </column>
    <column order="3" name="OldCode" type="varchar(15)">
      <summary>No longer used.</summary>
    </column>
    <column order="4" name="ProcDate" type="date">
      <summary>Procedure date that will show in the account as the date performed.  If just treatment planned, the date can be the date it was tp'd, or the date can be min val if we don't care. This has no time component. Also see ProcTime column.</summary>
    </column>
    <column order="5" name="ProcFee" type="double">
      <summary>Procedure fee.</summary>
    </column>
    <column order="6" name="Surf" type="varchar(10)">
      <summary>Surfaces (B/F, V, M, O/I, D, L). V is a special surface that is converted to B or F on all claims. You can also use "UL" etc for quadrant, "2" etc for sextant, "U","L" for arches.  Sextants in the United States are: 1 (Upper Right), 2 (Upper Anterior), 3 (Upper Left), 4 (Lower Left), 5 (Lower Anterior), 6 (Lower Right).  In Canada, Sextants are 03 through 08 (add 2 to the US sextant and prepend a zero).</summary>
    </column>
    <column order="7" name="ToothNum" type="varchar(2)">
      <summary>May be blank, otherwise 1-32 or A-T, 1 or 2 char. For supernumerary, add 50 to use 51-82. For supernumerary primary, use AS-TS.  For Canadian users, using FDI nomenclature, we use 51-55 as a placeholder for supernumerary teeth, which are tooth numbers 99, 19 (UL quadrant), 29 (UR quadrant), 39 (LR quadrant), and 49 (LL quadrant).  Logic for this is handled in the tooth logic class.</summary>
    </column>
    <column order="8" name="ToothRange" type="varchar(100)">
      <summary>May be blank, otherwise is series of toothnumbers separated by commas. No dashes. Tooth numbers include 1-32 or A-T.  Supernumeraries not supported here yet.</summary>
    </column>
    <column order="9" name="Priority" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  The definition.Category in the definition table is DefCat.TxPriorities (DefCat=20), which contains the text of the priority.  Identical to TreatPlanAttach.Priority but is used to prioritize treatment in the Treatment Plan Module for a single procedure.</summary>
    </column>
    <column order="10" name="ProcStatus" type="tinyint">
      <summary>Enum:ProcStat TP=1,Complete=2,Existing Cur Prov=3,Existing Other Prov=4,Referred=5,Deleted=6,Condition=7.</summary>
      <Enumeration name="ProcStat">
        <summary>Procedure Status.  These statuses are translated via class type "enumProcStat" (ex Lan.g("enumProcStat","..."))</summary>
        <EnumValue name="None">0 - Not used.</EnumValue>
        <EnumValue name="TP">1- Treatment Plan.</EnumValue>
        <EnumValue name="C">2- Complete.</EnumValue>
        <EnumValue name="EC">3- Existing Current Provider.</EnumValue>
        <EnumValue name="EO">4- Existing Other Provider.</EnumValue>
        <EnumValue name="R">5- Referred Out.</EnumValue>
        <EnumValue name="D">6- Deleted.</EnumValue>
        <EnumValue name="Cn">7- Condition.</EnumValue>
        <EnumValue name="TPi">8- Treatment Plan inactive.</EnumValue>
      </Enumeration>
    </column>
    <column order="11" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="12" name="Dx" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum, which contains text of the Diagnosis.</summary>
    </column>
    <column order="13" name="PlannedAptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum.  Was called NextAptNum in older versions.  Allows this procedure to be attached to a Planned appointment as well as a standard appointment.</summary>
    </column>
    <column order="14" name="PlaceService" type="tinyint">
      <summary>Enum:PlaceOfService  Only used in Public Health.  Defaults to Pref.DefaultProcedurePlaceService or Clinic.DefaultPlaceService if using clinics when completing or creating a new proc.</summary>
      <Enumeration name="PlaceOfService">
        <summary></summary>
        <EnumValue name="Office">0. Code 11</EnumValue>
        <EnumValue name="PatientsHome">1. Code 12</EnumValue>
        <EnumValue name="InpatHospital">2. Code 21</EnumValue>
        <EnumValue name="OutpatHospital">3. Code 22</EnumValue>
        <EnumValue name="SkilledNursFac">4. Code 31</EnumValue>
        <EnumValue name="CustodialCareFacility">5. Code 33.  In X12, a similar code AdultLivCareFac 35 is mentioned.</EnumValue>
        <EnumValue name="OtherLocation">6. Code 99.  We use 11 for office.</EnumValue>
        <EnumValue name="MobileUnit">7. Code 15</EnumValue>
        <EnumValue name="School">8. Code 03</EnumValue>
        <EnumValue name="MilitaryTreatFac">9. Code 26</EnumValue>
        <EnumValue name="FederalHealthCenter">10. Code 50</EnumValue>
        <EnumValue name="PublicHealthClinic">11. Code 71</EnumValue>
        <EnumValue name="RuralHealthClinic">12. Code 72</EnumValue>
        <EnumValue name="EmergencyRoomHospital">13. Code 23</EnumValue>
        <EnumValue name="AmbulatorySurgicalCenter">14. Code 24</EnumValue>
        <EnumValue name="TelehealthOutsideHome">15. Code 02.</EnumValue>
        <EnumValue name="TelehealthInHome">16. Code 10</EnumValue>
        <EnumValue name="OutreachSiteOrStreet">17. Code 27</EnumValue>
      </Enumeration>
    </column>
    <column order="15" name="Prosthesis" type="char(1)">
      <summary>Single char. Blank=no, I=Initial, R=Replacement.</summary>
    </column>
    <column order="16" name="DateOriginalProsth" type="date">
      <summary>For a prosthesis Replacement, this is the original date.</summary>
    </column>
    <column order="17" name="ClaimNote" type="varchar(80)">
      <summary>This note goes out on e-claims.  Not visible in Canada.</summary>
    </column>
    <column order="18" name="DateEntryC" type="date">
      <summary>This is the date this procedure was entered or set complete.  If not status C, then the value is ignored.  This date is set automatically when Insert, but older data or converted data might not have this value set.  It gets updated when set complete.  User never allowed to edit.  This will be enhanced later.</summary>
    </column>
    <column order="19" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0 if no clinic.</summary>
    </column>
    <column order="20" name="MedicalCode" type="varchar(15)" fk="procedurecode">
      <summary>FK to procedurecode.ProcCode. Optional.</summary>
    </column>
    <column order="21" name="DiagnosticCode" type="varchar(255)">
      <summary>Simple text for ICD-9 code. Gets sent with medical claims.</summary>
    </column>
    <column order="22" name="IsPrincDiag" type="tinyint">
      <summary>Set true if this medical diagnostic code is the principal diagnosis for the visit.  If no principal diagnosis is marked for any procedures on a medical e-claim, then it won't be allowed to be sent.  If more than one is marked, then it will just use one at random.</summary>
    </column>
    <column order="23" name="ProcNumLab" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum. Only used in Canada. If not zero, then this proc is a lab fee and this indicates to which actual procedure the lab fee is attached.  For ordinary use, they are treated like two separate procedures.  It's only for insurance claims that we need to know which lab fee belongs to which procedure.  Two lab fees may be attached to one procedure.</summary>
    </column>
    <column order="24" name="BillingTypeOne" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Lets some users track charges for certain types of reports.  For example, a Medicaid billing type could be assigned to a procedure, flagging it for inclusion in a report mandated by goverment.  Would be more useful if it was automated to flow down based on insurance plan type, but that can be added later.  Not visible if prefs.EasyHideMedicaid is true.</summary>
    </column>
    <column order="25" name="BillingTypeTwo" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  Same as BillingTypeOne, but used when there is a secondary billing type to account for.</summary>
    </column>
    <column order="26" name="CodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum</summary>
    </column>
    <column order="27" name="CodeMod1" type="char(2)">
      <summary>Modifier for certain CPT codes.</summary>
    </column>
    <column order="28" name="CodeMod2" type="char(2)">
      <summary>Modifier for certain CPT codes.</summary>
    </column>
    <column order="29" name="CodeMod3" type="char(2)">
      <summary>Modifier for certain CPT codes.</summary>
    </column>
    <column order="30" name="CodeMod4" type="char(2)">
      <summary>Modifier for certain CPT codes.</summary>
    </column>
    <column order="31" name="RevCode" type="varchar(45)">
      <summary>NUBC Revenue Code for medical/inst billing. Used on UB04 and 837I.</summary>
    </column>
    <column order="32" name="UnitQty" type="int(11)">
      <summary>Default is 1.  Becomes Service Unit Count on institutional UB claimforms SV205.  Becomes Service Unit Count on medical 1500 claimforms SV104.  Becomes procedure count on dental claims SV306.  Gets multiplied by fee in all accounting calculations.</summary>
    </column>
    <column order="33" name="BaseUnits" type="int(11)">
      <summary>Base units used for some billing codes.  Default is 0.  No UI for this field.  It is only edited in the ProcedureCode window.  The database maint tool changes BaseUnits of all procedures to match that of the procCode.  Not sure yet what it's for.</summary>
    </column>
    <column order="34" name="StartTime" type="int(11)">
      <summary>Start time in military.  No longer used, but not deleting just in case someone has critical information stored here.</summary>
    </column>
    <column order="35" name="StopTime" type="int(11)">
      <summary>Stop time in military.  No longer used, but not deleting just in case someone has critical information stored here.</summary>
    </column>
    <column order="36" name="DateTP" type="date">
      <summary>The date that the procedure was originally treatment planned.  Does not change when marked complete.</summary>
    </column>
    <column order="37" name="SiteNum" type="bigint(20)" fk="site">
      <summary>FK to site.SiteNum.</summary>
    </column>
    <column order="38" name="HideGraphics" type="tinyint(4)">
      <summary>Set to true to hide the chart graphics for this procedure.  For example, a crown was done, but then tooth extracted.</summary>
    </column>
    <column order="39" name="CanadianTypeCodes" type="varchar(20)">
      <summary>F16, up to 5 char. One or more of the following: A=Repair of a prior service, B=Temporary placement, C=TMJ, E=Implant, L=Appliance lost, S=Appliance stolen, X=none of the above.  Blank is equivalent to X for claim output, but one value will not be automatically converted to the other in this table.  That will allow us to track user entry for procedurecode.IsProsth.</summary>
    </column>
    <column order="40" name="ProcTime" type="time">
      <summary>Used to be part of the ProcDate, but that was causing reporting issues.</summary>
    </column>
    <column order="41" name="ProcTimeEnd" type="time">
      <summary>Marks the time a procedure was finished.</summary>
    </column>
    <column order="42" name="DateTStamp" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="43" name="Prognosis" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum, which contains text of the Prognosis.</summary>
    </column>
    <column order="44" name="DrugUnit" type="tinyint(4)">
      <summary>Enum:EnumProcDrugUnit For 837I and UB04</summary>
      <Enumeration name="EnumProcDrugUnit">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="InternationalUnit">1 - F2 on UB04.</EnumValue>
        <EnumValue name="Gram">2 - GR on UB04.</EnumValue>
        <EnumValue name="Milligram">3 - GR on UB04.</EnumValue>
        <EnumValue name="Milliliter">4 - ML on UB04.</EnumValue>
        <EnumValue name="Unit">5 - UN on UB04.</EnumValue>
      </Enumeration>
    </column>
    <column order="45" name="DrugQty" type="float">
      <summary>Includes fractions. For 837I</summary>
    </column>
    <column order="46" name="UnitQtyType" type="tinyint(4)">
      <summary>Enum:ProcUnitQtyType For dental, the type is always sent electronically as MultiProcs. For institutional SV204, Days will be sent electronically if chosen, otherwise ServiceUnits will be sent. For medical SV103, MinutesAnesth will be sent electronically if chosen, otherwise ServiceUnits will be sent.</summary>
      <Enumeration name="ProcUnitQtyType">
        <summary></summary>
        <EnumValue name="MultProcs">0-Only allowed on dental, and only option allowed on dental.  This is also the default for all procs in our UI.  For example, 4 PAs all on one line on the e-claim.</EnumValue>
        <EnumValue name="MinutesAnesth">1-Only allowed on medical SV103.</EnumValue>
        <EnumValue name="ServiceUnits">2-Allowed on medical SV103 and institutional SV204.  This is the default for both medical and inst when creating X12 claims, regardless of what is set on the proc.</EnumValue>
        <EnumValue name="Days">3-Only allowed on institutional SV204.</EnumValue>
      </Enumeration>
    </column>
    <column order="47" name="StatementNum" type="bigint(20)" fk="statement">
      <summary>FK to statement.StatementNum.  Only used when the statement in an invoice.</summary>
    </column>
    <column order="48" name="IsLocked" type="tinyint(4)">
      <summary>If this flag is set, then the proc is locked down tight.  No changes at all can be made except to append, sign, or invalidate. Invalidate really just sets the proc to status 'deleted'.  An invalidated proc retains its IsLocked status.  All locked procs will be status of C or D.  Locked group notes will be status of EC or D.</summary>
    </column>
    <column order="49" name="BillingNote" type="varchar(255)">
      <summary>A note that will show directly in the Account module.  Also used for repeating charges. Helps distinguish between charges for the same proccode in the same month.</summary>
    </column>
    <column order="50" name="RepeatChargeNum" type="bigint(20)" fk="repeatcharge">
      <summary>FK to repeatcharge.RepeatChargeNum.  Used in repeating charges to determine which procedures belong to each repeating charge. If the
            repeat charge that this RepeatChargeNum points to is deleted, this column will not be set to 0 so that a record will still exist that this
            procedure came from a repeat charge.</summary>
    </column>
    <column order="51" name="SnomedBodySite" type="varchar(255)">
      <summary>Some procedures require a SNOMED code which indicates that site on the body at which this procedure was performed.</summary>
    </column>
    <column order="52" name="DiagnosticCode2" type="varchar(255)">
      <summary>Simple text for ICD-9 code. Gets sent with medical claims.</summary>
    </column>
    <column order="53" name="DiagnosticCode3" type="varchar(255)">
      <summary>Simple text for ICD-9 code. Gets sent with medical claims.</summary>
    </column>
    <column order="54" name="DiagnosticCode4" type="varchar(255)">
      <summary>Simple text for ICD-9 code. Gets sent with medical claims.</summary>
    </column>
    <column order="55" name="ProvOrderOverride" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Ordering provider override.  Goes hand-in-hand with OrderingReferralNum.  Medical eclaims only.
            Defaults to zero.</summary>
    </column>
    <column order="56" name="Discount" type="double">
      <summary>Stores the dollar amount of the discount, not full price.  E.g.  for a 10% discount, Fee = $160 Discount = $16.  This column is used by treatment planned procedures to create an adjustment when set complete.  It should not be used as an accurate monetary discount value for completed procedures.</summary>
    </column>
    <column order="57" name="IsDateProsthEst" type="tinyint(4)">
      <summary>For prosthesis replacement procedures on 5010 eclaims only.  If true, indicates that the DateOriginalProsth is an estimated date.  Estimated dates are often used when the original prosthesis was performed by another doctor.</summary>
    </column>
    <column order="58" name="IcdVersion" type="tinyint">
      <summary>The ICD code version for all diagnosis codes on this procedure, including DiagnosisCode, DiagnosisCode2, DiagnosisCode3,
            and DiagnosisCode4.  Value of 9 for ICD-9, 10 for ICD-10, etc.  Default value is 9.  This value is copied from the DxIcdVersion preference
            when a procedure is created.  The user can also manually change the IcdVersion on individual procedures.</summary>
    </column>
    <column order="59" name="IsCpoe" type="tinyint(4)">
      <summary>Procedures will be flagged as CPOE (Computerized Provider Order Entry) if this procedure was created by a provider.
            If a provider views, edits, or has any interaction with this procedure after its creation, it will be flagged as IsCPOE.
            Also, there will be a helpful window where providers can go to to "approve" non-CPOE procedures and mark them as CPOE to help meet EHR measures.
            If a staff person is logged in and enters this procedure then this is non-CPOE, so false.</summary>
    </column>
    <column order="60" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="61" name="SecDateEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date and time of entry.</summary>
    </column>
    <column order="62" name="DateComplete" type="date">
      <summary>Normally do not use this field. The date the procedure was originally set complete. If status is set complete and then set to something other than complete, this field will be set to DateTime.MinValue if DateComplete is today.  If DateComplete is set to a day in the past and the status is changed from complete to something else, the field will not be cleared or updated.  Db only field used by one customer and this is how they requested it. PatNum #19191</summary>
    </column>
    <column order="63" name="OrderingReferralNum" type="bigint(20)" fk="referral">
      <summary>FK to referral.ReferralNum.  Goes hand-in-hand with ProvOrderOverride.  Medical eclaims only.  Defaults to zero.
            If set, and the ProvOrderOverride is not set, then this referral will go out at the ordering provider on medical e-claims.</summary>
    </column>
    <column order="64" name="TaxAmt" type="double">
      <summary>Holds the Sales Tax estimate for this procedure.  Becomes a finalized amount when the procedure is marked complete.</summary>
    </column>
    <column order="65" name="Urgency" type="tinyint(4)">
      <summary>Enum:ProcUrgency Used in 1500 Medical Claim Form box 24c. Normal=blank 24c,Emergency='Y' in 24c.</summary>
      <Enumeration name="ProcUrgency">
        <summary>Used for marking procedures on medical claims as 'Emergency' on the 1500 claim form.</summary>
        <EnumValue name="Normal">0 - Standard procedure urgency.  Most procedures will have this ProcUrgency.  This will result in the 1500 Medical Claim Form box 24c
            being blank.  (Normal=blank,Emergency='Y')</EnumValue>
        <EnumValue name="Emergency">1 - Emergency ProcUrgency is used to populate the 1500 Medical Claim Form box 24c with a 'Y'. (Emergency='Y',Normal=blank)</EnumValue>
      </Enumeration>
    </column>
    <column order="66" name="DiscountPlanAmt" type="double">
      <summary>The difference between the billed fee and discount plan fee. Frequently recalculated when procedure is TP.</summary>
    </column>
    <column order="67" name="NoBillIns" type="tinyint(4)">
      <summary>Preserves a “Do Not Bill Insurance” decision on individual procedures, ClaimProcs inherit this setting to their own NoBillIns preference as they are initially calculated and when they are regenerated due to insurance plan changes. Can only be set true by deliberately checking "Do Not Bill to Ins" on the Procedure Info window. Will automatically be set back to false if any attached ClaimProcs are manually edited to be billed to insurance. This field is not a separate checkbox on proc edit window. It just changes the behavior of the existing checkbox.</summary>
    </column>
  </table>
  <table name="procgroupitem">
    <summary>Links Procedures(groupnotes) to Procedures in a 1-n relationship.</summary>
    <column order="0" name="ProcGroupItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum.</summary>
    </column>
    <column order="2" name="GroupNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum.This is the group note that the procedure is in.</summary>
    </column>
  </table>
  <table name="procmultivisit">
    <summary>Example: a crown prep and seat is spread over two appointments. A ProcMultiVisit row is created for each procedure. The procedure "In Process" status is a derived status in the UI based on the existence of a link between procedures in this table. In Process is removed once all procs in the group have been set complete. Having a procedure become part of a multi-visit group can affect how benefits are calculated and will set claim statuses so that they reflect that a multi-visit group is in progress.</summary>
    <column order="0" name="ProcMultiVisitNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="GroupProcMultiVisitNum" type="bigint(20)" fk="procmultivisit">
      <summary>FK to procmultivisit.ProcMultiVisitNum.  Groups procmultivisit rows.  Set to the ProcMultiVisitNum of the first row in the group.</summary>
    </column>
    <column order="2" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum.</summary>
    </column>
    <column order="3" name="ProcStatus" type="tinyint(4)">
      <summary>Enum:ProcStat A copy of the value from procedurelog.ProcStatus, based on ProcNum.  Reduces queries and speeds up logic.</summary>
      <Enumeration name="ProcStat">
        <summary>Procedure Status.  These statuses are translated via class type "enumProcStat" (ex Lan.g("enumProcStat","..."))</summary>
        <EnumValue name="None">0 - Not used.</EnumValue>
        <EnumValue name="TP">1- Treatment Plan.</EnumValue>
        <EnumValue name="C">2- Complete.</EnumValue>
        <EnumValue name="EC">3- Existing Current Provider.</EnumValue>
        <EnumValue name="EO">4- Existing Other Provider.</EnumValue>
        <EnumValue name="R">5- Referred Out.</EnumValue>
        <EnumValue name="D">6- Deleted.</EnumValue>
        <EnumValue name="Cn">7- Condition.</EnumValue>
        <EnumValue name="TPi">8- Treatment Plan inactive.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="IsInProcess" type="tinyint(4)">
      <summary>A pseudo-status, calculated for the entire group and based on ProcStatuses of all procedures in the group. This will be true for all rows in an In Process group.</summary>
    </column>
    <column order="5" name="SecDateTEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="6" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="7" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
  </table>
  <table name="procnote">
    <summary>A procedure note for one procedure.  User does not have any direct control over this table at all.  It's handled automatically.  When user "edits" a procedure note, the program actually just adds another note.  No note can EVER be edited or deleted.</summary>
    <column order="0" name="ProcNoteNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum</summary>
    </column>
    <column order="3" name="EntryDateTime" type="datetime">
      <summary>The server time that this note was entered. Essentially a timestamp.</summary>
    </column>
    <column order="4" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>The actual note.</summary>
    </column>
    <column order="6" name="SigIsTopaz" type="tinyint">
      <summary>There are two kinds of signatures.  Topaz signatures use hardware manufactured by that company, and the signature is created by their library.  OD signatures work exactly the same way, but are only for on-screen signing.</summary>
    </column>
    <column order="7" name="Signature" type="text">
      <summary>The encrypted signature.  A signature starts as a collection of vectors.  The Topaz .sig file format is proprietary.  The OD signature format looks like this: 45,68;48,70;49,72;0,0;55,88;etc. Tenths are allowed, so it's common to see decimals.  It's simply a sequence of points, separated by semicolons.  0,0 represents pen up.  Then, a hash is created from the Note, concatenated directly with the userNum.  For example, "This is a note3" gets turned into a hash of 2849283940385391 (16 bytes).  The hash is used to encrypt the signature data string using symmetric encryption.  Therefore, the actual signature cannot be retrieved from the database by ordinary means.  Also, the signature info cannot even be retrieved by Open Dental at all unless it supplies the same hash as before, proving that the data has not changed since signed.  If OD supplies the correct hash, then it will be able to extract the sequence of vectors which it will then use to display the signature.  The OD sigs are not compressed, and the Topaz sigs are.  But there is very little difference in their sizes.  It would be very rare for a signature to be larger than 1000 bytes. There are also situations where the API or web service inserts a totally different here. The first two points are int.MinVal. Example: -2147483648,-2147483648;-2147483648,-2147483648;47,23;12,35;... The remaining points after the first two are the byte values of individual letters that make up a string that will be displayed inside the signature box.</summary>
    </column>
    <column order="8" name="UserNum2" type="bigint(20)">
      <summary>The user that signs a secondary signatureBoxWrapper.</summary>
    </column>
    <column order="9" name="Signature2" type="text">
      <summary>A secondary encrypted signature.  See "Signature" for more documentation.</summary>
    </column>
    <column order="10" name="SigIsTopaz2" type="tinyint">
      <summary>Topaz check for a secondary signature.  See SigIsTopaz for more documentation.</summary>
    </column>
  </table>
  <table name="proctp">
    <summary>These are copies of procedures that are attached to saved treatment plans.  The ProcNumOrig points to the actual procedurelog row.</summary>
    <column order="0" name="ProcTPNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TreatPlanNum" type="bigint(20)" fk="treatplan">
      <summary>FK to treatplan.TreatPlanNum.  The treatment plan to which this proc is attached.</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="3" name="ProcNumOrig" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum. This procNum is only here to compare and test the existence of the referenced procedure.  If present, it will check to see whether the procedure is still status TP.</summary>
    </column>
    <column order="4" name="ItemOrder" type="smallint">
      <summary>The order of this proc within its tp.  This is set when the tp is first created and can't be changed.  Drastically simplifies loading the tp.</summary>
    </column>
    <column order="5" name="Priority" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum which contains the text of the priority.</summary>
    </column>
    <column order="6" name="ToothNumTP" type="varchar(255)">
      <summary>A simple string displaying the tooth number.  If international tooth numbers are used, then this will be in international format already.  For Canadian users, using FDI nomenclature, we use 51 as a placeholder for supernumerary teeth, which is tooth number 99 according to CDHA standards (2/17/2014).  Logic for this is handled in the tooth logic class.</summary>
    </column>
    <column order="7" name="Surf" type="varchar(255)">
      <summary>Tooth surfaces or area.  This is already converted for international use.  If arch or quad, then it will have U,LR, etc.</summary>
    </column>
    <column order="8" name="ProcCode" type="varchar(15)">
      <summary>Not a foreign key.  Simply display text.  Can be changed by user at any time.</summary>
    </column>
    <column order="9" name="Descript" type="varchar(255)">
      <summary>Description is originally copied from procedurecode.Descript, but user can change it.</summary>
    </column>
    <column order="10" name="FeeAmt" type="double">
      <summary>The fee charged to the patient. Never gets automatically updated.</summary>
    </column>
    <column order="11" name="PriInsAmt" type="double">
      <summary>The amount primary insurance is expected to pay. Never gets automatically updated.</summary>
    </column>
    <column order="12" name="SecInsAmt" type="double">
      <summary>The amount secondary insurance is expected to pay. Never gets automatically updated.</summary>
    </column>
    <column order="13" name="PatAmt" type="double">
      <summary>The amount the patient is expected to pay. Never gets automatically updated.</summary>
    </column>
    <column order="14" name="Discount" type="double">
      <summary>The amount of discount.  Used for PPOs and procedure level discounts.</summary>
    </column>
    <column order="15" name="Prognosis" type="varchar(255)">
      <summary>Text from prognosis definition.  Can be changed by user at any time.</summary>
    </column>
    <column order="16" name="Dx" type="varchar(255)">
      <summary>Text from diagnosis definition.  Can be changed by user at any time.</summary>
    </column>
    <column order="17" name="ProcAbbr" type="varchar(50)">
      <summary>The ProcedureCode abbreviation.  Can be changed by user at any time.</summary>
    </column>
    <column order="18" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="19" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="20" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="21" name="FeeAllowed" type="double">
      <summary>The amount primary insurance allows. Should be the exact amount in the FormClaimProc allowed amount field. May be either the PPO fee
            or the out of network allowed fee.</summary>
    </column>
    <column order="22" name="TaxAmt" type="double">
      <summary>Holds the Sales Tax estimate for this procedure.  Used to review history when being reviewed by accounting.
            In the Treatment Plan, this represents an estimate and a record for pre-payments.</summary>
    </column>
    <column order="23" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Holds the ProvNum for this procedure's provider.</summary>
    </column>
    <column order="24" name="DateTP" type="date">
      <summary>Holds the DateTP for this procedure.</summary>
    </column>
    <column order="25" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Holds the ClinicNum for this procedure's clinic.</summary>
    </column>
    <column order="26" name="CatPercUCR" type="double">
      <summary>The UCR fee for the procedure. Cannot be changed by the user.</summary>
    </column>
  </table>
  <table name="program">
    <summary>Each row is a bridge to an outside program, frequently an imaging program.  Most of the bridges are hard coded, and simply need to be enabled.  But user can also add their own custom bridge.</summary>
    <column order="0" name="ProgramNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProgName" type="varchar(100)">
      <summary>Unique name for built-in program bridges. Not user-editable. enum ProgramName</summary>
    </column>
    <column order="2" name="ProgDesc" type="varchar(100)">
      <summary>Description that shows.</summary>
    </column>
    <column order="3" name="Enabled" type="tinyint">
      <summary>True if enabled.</summary>
    </column>
    <column order="4" name="Path" type="text">
      <summary>The path of the executable to run or file to open. Text since 255 is the largest VARCHAR supported and some softwares have long paths that can easily exceed 255 characters.</summary>
    </column>
    <column order="5" name="CommandLine" type="text">
      <summary>Some programs will accept command line arguments. Text since 255 is the largest VARCHAR supported and some softwares have long command line arguments that can easily exceed 255 characters.</summary>
    </column>
    <column order="6" name="Note" type="text">
      <summary>Notes about this program link. Peculiarities, etc.</summary>
    </column>
    <column order="7" name="PluginDllName" type="varchar(255)">
      <summary>If this is a Plugin, then this is the filename of the dll, including the extension.  The dll must be located in the application directory.</summary>
    </column>
    <column order="8" name="ButtonImage" type="text">
      <summary>If no image, then will be an empty string.  In this case, the bitmap will be null when loaded from the database.
            Must be a 22 x 22 image, and thus needs (width) x (height) x (depth) = 22 x 22 x 4 = 1936 bytes.</summary>
    </column>
    <column order="9" name="FileTemplate" type="text">
      <summary>For custom program links only.  Stores the template of a file to be generated when launching the program link.</summary>
    </column>
    <column order="10" name="FilePath" type="varchar(255)">
      <summary>For custom program links only.  Stores the path of a file to be generated when launching the program link.</summary>
    </column>
    <column order="11" name="IsDisabledByHq" type="tinyint(4)">
      <summary>Do not use directly.  Call Programs.IsEnabledByHq() instead.  Has HQ disabled this program for all customers via WebServiceHq.EnableAdditionalFeatures().  Using 'Disabled' because the web method will only send Programs HQ cares about.  Any user defined Programs should not be marked as 'Disabled' by default.</summary>
    </column>
    <column order="12" name="CustErr" type="varchar(255)">
      <summary>Typically blank. A value is added to this if we have disabled this program at HQ's side and will be updated during HqProgram.Download()</summary>
    </column>
  </table>
  <table name="programproperty">
    <summary>Some program links (bridges), have properties that need to be set.  The property names are always hard coded.  User can change the value.  The property is usually retrieved based on its name.</summary>
    <column order="0" name="ProgramPropertyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProgramNum" type="bigint(20)" fk="program">
      <summary>FK to program.ProgramNum</summary>
    </column>
    <column order="2" name="PropertyDesc" type="varchar(255)">
      <summary>The description or prompt for this property.  Blank for workstation overrides of program path.
            Many bridges use this description as an "internal description". This way it can act like a FK in order to look up this particular property.  Users cannot edit.</summary>
    </column>
    <column order="3" name="PropertyValue" type="text">
      <summary>The value. Could contain FK to other tables.</summary>
    </column>
    <column order="4" name="ComputerName" type="varchar(255)">
      <summary>The human-readable name of the computer on the network (not the IP address).  Only used when overriding program path.  Blank for typical Program Properties.</summary>
    </column>
    <column order="5" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  This is only used by a few bridges.  Set to 0 for most bridges.</summary>
    </column>
    <column order="6" name="IsMasked" type="tinyint(4)">
      <summary>Is true if the program property is sensitive information that would need to be masked in the UI. False by default.</summary>
    </column>
    <column order="7" name="IsHighSecurity" type="tinyint(4)">
      <summary>Is true if the program property is a high security property. False by default.</summary>
    </column>
  </table>
  <table name="promotion">
    <summary>This table represents a grouping of promotionlogs. When sending a waive of emails, this table links those promotion logs/emails together.</summary>
    <column order="0" name="PromotionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PromotionName" type="varchar(255)">
      <summary>The name of the promotion.</summary>
    </column>
    <column order="2" name="DateTimeCreated" type="date">
      <summary>The time this promotion was sent out.</summary>
    </column>
    <column order="3" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum
            The clinic this promotion was sent for.</summary>
    </column>
    <column order="4" name="TypePromotion" type="tinyint(4)">
      <summary>Enum:PromotionType - The type of promotion this is.</summary>
      <Enumeration name="PromotionType">
        <summary></summary>
        <EnumValue name="Manual">0 - Signifies Manually Sent Promotions like from Mass Emails</EnumValue>
        <EnumValue name="Birthday">1 - Signifies Birthday Greetings</EnumValue>
        <EnumValue name="Treatment">2 - Promotional Treatment</EnumValue>
        <EnumValue name="Special">3 - Special Promotions</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="promotionlog">
    <summary>When a reminder is sent for an appointment a record of that send is stored here. This is used to prevent re-sends of the same reminder.</summary>
    <column order="0" name="PromotionLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PromotionNum" type="bigint(20)" fk="promotion">
      <summary>FK to promotion.PromotionNum</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="3" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="4" name="EmailHostingFK" type="bigint(20)">
      <summary>A foreign key from the email hosting API that allows us to receive status updates on this specific email.</summary>
    </column>
    <column order="5" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</summary>
    </column>
    <column order="6" name="PromotionStatus" type="tinyint(4)">
      <summary>Enum:PromotionLogStatus </summary>
      <Enumeration name="PromotionLogStatus">
        <summary>Preserve order. If one needs to be added here, consider the verisonless webhook at HQ.</summary>
        <EnumValue name="Unknown">0 - Unknown</EnumValue>
        <EnumValue name="Pending">1 - Promotion has not been sent.</EnumValue>
        <EnumValue name="Bounced">2 - Email has bounced because email does not exist.</EnumValue>
        <EnumValue name="Unsubscribed">3 - User has unsubscribed in the passed and this was rejected.</EnumValue>
        <EnumValue name="Complaint">4 - This email was sent and then marked as spam by the user.</EnumValue>
        <EnumValue name="Delivered">5 - The email sent and delivered successfully.</EnumValue>
        <EnumValue name="Failed">6 - The email failed to send for a different reason than any of the reasons above.</EnumValue>
        <EnumValue name="Opened">7 - The email was opened by the user.</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum for the corresponding appointment.</summary>
    </column>
    <column order="8" name="SendStatus" type="tinyint(4)">
      <summary>Indicates status of message.</summary>
    </column>
    <column order="9" name="MessageType" type="tinyint(4)">
      <summary></summary>
    </column>
    <column order="10" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="11" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
    <column order="12" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
  </table>
  <table name="provider">
    <summary>A provider is usually a dentist or a hygienist.  But a provider might also be a denturist, a dental student, or a dental hygiene student.  A provider might also be a 'dummy', used only for billing purposes or for notes in the Appointments module.  There is no limit to the number of providers that can be added.</summary>
    <column order="0" name="ProvNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Abbr" type="varchar(255)">
      <summary>Abbreviation.  There was a limit of 5 char before version 5.4.  The new limit is 255 char.  This will allow more elegant solutions to various problems.  Providers will no longer be referred to by FName and LName.  Abbr is used as a human readable primary key.</summary>
    </column>
    <column order="2" name="ItemOrder" type="smallint">
      <summary>Order that provider will show in lists. 0-based.</summary>
    </column>
    <column order="3" name="LName" type="varchar(100)">
      <summary>Last name.</summary>
    </column>
    <column order="4" name="FName" type="varchar(100)">
      <summary>First name.</summary>
    </column>
    <column order="5" name="MI" type="varchar(100)">
      <summary>Middle inital or name.</summary>
    </column>
    <column order="6" name="Suffix" type="varchar(100)">
      <summary>eg. DMD or DDS.</summary>
    </column>
    <column order="7" name="FeeSched" type="bigint(20)" fk="feesched">
      <summary>FK to feesched.FeeSchedNum.</summary>
    </column>
    <column order="8" name="Specialty" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.</summary>
    </column>
    <column order="9" name="SSN" type="varchar(12)">
      <summary>or TIN.  No punctuation</summary>
    </column>
    <column order="10" name="StateLicense" type="varchar(15)">
      <summary>DEPRECATED. Can include punctuation</summary>
    </column>
    <column order="11" name="DEANum" type="varchar(15)">
      <summary>DEPRECATED.  DEANum can be found in the providerclinic table.</summary>
    </column>
    <column order="12" name="IsSecondary" type="tinyint">
      <summary>True if hygienist.</summary>
    </column>
    <column order="13" name="ProvColor" type="int(11)">
      <summary>Color that shows in appointments. 0 represents empty no color.</summary>
    </column>
    <column order="14" name="IsHidden" type="tinyint">
      <summary>If true, provider will not show on any lists. The provider will still be a selection option in standard reports. Use IsHiddenReport to hide from reports. Hidden providers cannot access eRx. This will not affect scheduled appointments.</summary>
    </column>
    <column order="15" name="UsingTIN" type="tinyint">
      <summary>True if the SSN field is actually a Tax ID Num</summary>
    </column>
    <column order="16" name="BlueCrossID" type="varchar(25)">
      <summary>No longer used since each state assigns a different ID.  Use the providerident instead which allows you to assign a different BCBS ID for each Payor ID.</summary>
    </column>
    <column order="17" name="SigOnFile" type="tinyint">
      <summary>Signature on file.</summary>
    </column>
    <column order="18" name="MedicaidID" type="varchar(20)">
      <summary>.</summary>
    </column>
    <column order="19" name="OutlineColor" type="int(11)">
      <summary>Color that shows in appointments as outline when highlighted. 0 represents empty no color.</summary>
    </column>
    <column order="20" name="SchoolClassNum" type="bigint(20)" fk="schoolclass">
      <summary>FK to schoolclass.SchoolClassNum Used in dental schools.  Each student is a provider.  This keeps track of which class they are in.</summary>
    </column>
    <column order="21" name="NationalProvID" type="varchar(255)">
      <summary>US NPI, and Canadian UIN/CDA provider number.</summary>
    </column>
    <column order="22" name="CanadianOfficeNum" type="varchar(100)">
      <summary>Canadian field required for e-claims.  Assigned by CDA.  It's OK to have multiple providers with the same OfficeNum.  Max length should be 4.</summary>
    </column>
    <column order="23" name="DateTStamp" type="timestamp">
      <summary>.</summary>
    </column>
    <column order="24" name="AnesthProvType" type="bigint(20)">
      <summary> FK to ??. Field used to set the Anesthesia Provider type. Used to filter the provider dropdowns on FormAnestheticRecord</summary>
    </column>
    <column order="25" name="TaxonomyCodeOverride" type="varchar(255)">
      <summary>If none of the supplied taxonomies works.  This will show on claims.</summary>
    </column>
    <column order="26" name="IsCDAnet" type="tinyint(4)">
      <summary>For Canada. Set to true if CDA Net or a Canadian billable provider.</summary>
    </column>
    <column order="27" name="EcwID" type="varchar(255)">
      <summary>The name of this field is bad and will soon be changed to MedicalSoftID.  This allows an ID field that can be used for HL7 synch with other software.  Before this field was added, we were using prov abbreviation, which did not work well.</summary>
    </column>
    <column order="28" name="StateRxID" type="varchar(255)">
      <summary>DEPRECATED. Provider medical State ID.</summary>
    </column>
    <column order="29" name="IsNotPerson" type="tinyint(4)">
      <summary>Default is false because most providers are persons.  But some dummy providers used for practices or billing entities are not persons.  This is needed on 837s.</summary>
    </column>
    <column order="30" name="StateWhereLicensed" type="varchar(50)">
      <summary>DEPRECATED. The state abbreviation where the state license number in the StateLicense field is legally registered.</summary>
    </column>
    <column order="31" name="EmailAddressNum" type="bigint(20)">
      <summary>Not currently used.  FK to emailaddress.EmailAddressNum.  Optional, can be 0.</summary>
    </column>
    <column order="32" name="IsInstructor" type="tinyint(4)">
      <summary>Default is false because most providers will not be instructors.  Used in Dental Schools</summary>
    </column>
    <column order="33" name="EhrMuStage" type="int(11)">
      <summary>Used to determine which stage of MU the provider is shown. 0=Global preference(Default), 1=Stage 1, 2=Stage 2, 3=Modified Stage 2.</summary>
    </column>
    <column order="34" name="ProvNumBillingOverride" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum</summary>
    </column>
    <column order="35" name="CustomID" type="varchar(255)">
      <summary>Custom ID used for reports or bridges only.</summary>
    </column>
    <column order="36" name="ProvStatus" type="tinyint(4)">
      <summary>Enum:ProviderStatus </summary>
      <Enumeration name="ProviderStatus">
        <summary>Status of the provider.</summary>
        <EnumValue name="Active">0</EnumValue>
        <EnumValue name="Deleted">1</EnumValue>
      </Enumeration>
    </column>
    <column order="37" name="IsHiddenReport" type="tinyint(4)">
      <summary>Determines whether the provider will show in the combobox on standard reports. IsHidden will not hide from reports. Data for this provider is still included on reports when running for "All" providers.</summary>
    </column>
    <column order="38" name="IsErxEnabled" type="tinyint(4)">
      <summary>Enum:ErxEnabledStatus Indicates whether or not the provider has individually agreed to accept eRx charges.  Defaults to Disabled for new providers.</summary>
      <Enumeration name="ErxEnabledStatus">
        <summary></summary>
        <EnumValue name="Disabled">0.</EnumValue>
        <EnumValue name="Enabled">1.</EnumValue>
        <EnumValue name="EnabledWithLegacy">2.</EnumValue>
      </Enumeration>
    </column>
    <column order="39" name="Birthdate" type="date">
      <summary>The birthdate of the provider.</summary>
    </column>
    <column order="40" name="SchedNote" type="varchar(255)">
      <summary>Indicates if the provider should only be scheduled in a certain way (e.g. Root canals only)</summary>
    </column>
    <column order="41" name="WebSchedDescript" type="varchar(500)">
      <summary>The description of the provider that is displayed to patients in Web Sched.</summary>
    </column>
    <column order="42" name="WebSchedImageLocation" type="varchar(255)">
      <summary>The image of the provider that is displayed to patients in Web Sched. File name only (path not included).
            This should be a file name in the A to Z folder.</summary>
    </column>
    <column order="43" name="HourlyProdGoalAmt" type="double">
      <summary>The hourly production goal amount of the provider.</summary>
    </column>
    <column order="44" name="DateTerm" type="date">
      <summary>The date that the provider's term ends. This can be used to prevent appointments from being scheduled, appointments from being 
            marked complete, prescriptions from being prescribed, and claims from being sent.</summary>
    </column>
    <column order="45" name="PreferredName" type="varchar(100)">
      <summary>The preferred name of the provider, shows what will be displayed to patients in eClipboard.</summary>
    </column>
  </table>
  <table name="providerclinic">
    <summary>Allows specifying DEA number override and other overrides for the given combination of provider and clinic. This is different from the ProviderClinicLink table. That table records which providers are restricted to which clinics.</summary>
    <column order="0" name="ProviderClinicNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="3" name="DEANum" type="varchar(15)">
      <summary>The DEA number for this provider and clinic.  The DEA number used to be stored in provider.DEANum.</summary>
    </column>
    <column order="4" name="StateLicense" type="varchar(50)">
      <summary>License number corresponding to the StateWhereLicensed.  Can include punctuation</summary>
    </column>
    <column order="5" name="StateRxID" type="varchar(255)">
      <summary>Provider medical State ID.</summary>
    </column>
    <column order="6" name="StateWhereLicensed" type="varchar(15)">
      <summary>The state abbreviation where the state license number in the StateLicense field is legally registered.</summary>
    </column>
    <column order="7" name="CareCreditMerchantId" type="varchar(20)">
      <summary>The merchant number for this provider and clinic.</summary>
    </column>
  </table>
  <table name="providercliniclink">
    <summary>This table restricts a provider to a certain clinic. Muliple entries will allow them access to multiple clinics. If a provider does not have an entry in this table, it means that provider is linked to all clinics. This is different from the ProviderClinic table. That table holds override information for providers for certain clinics.</summary>
    <column order="0" name="ProviderClinicLinkNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. An entry of -1 means the provider is associated to no clinics.</summary>
    </column>
  </table>
  <table name="providererx">
    <summary>Tracks which providers have access to eRx based on NPI.  Synchronized with HQ.</summary>
    <column order="0" name="ProviderErxNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Holder of registration key only for HQ record, in customer record this will be 0.</summary>
    </column>
    <column order="2" name="NationalProviderID" type="varchar(255)">
      <summary>NPI of a provider from the provider table.  May correspond to multiple records in the provider table.</summary>
    </column>
    <column order="3" name="IsEnabled" type="tinyint(4)">
      <summary>Enum:ErxStatus Set to Enabled if the provider with the given NationalProviderID has access to eRx.
            Pending statuses are treated as if Disabled.</summary>
      <Enumeration name="ErxStatus">
        <summary>Used by Erx to determine if the provider or clinic has been enabled at ODHQ.
            Enum is in this file because it belongs to multiple tables.
            This enum is copied to WebServiceCustomerUpdates/ClinicErx.cs.  See there for detailed comments.</summary>
        <EnumValue name="Disabled">0.</EnumValue>
        <EnumValue name="Enabled">1.</EnumValue>
        <EnumValue name="Undefined">2.</EnumValue>
        <EnumValue name="PendingAccountId">3.</EnumValue>
        <EnumValue name="NeedsManualAccountId">4.</EnumValue>
        <EnumValue name="PendingEmail">5.</EnumValue>
        <EnumValue name="Pending">6.</EnumValue>
        <EnumValue name="PendingEconnTransmit">7.</EnumValue>
        <EnumValue name="InTransitToEconn">8.</EnumValue>
        <EnumValue name="NeedsManualOfficeContact">9.</EnumValue>
        <EnumValue name="NeedsErxId">10.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="IsIdentifyProofed" type="tinyint(4)">
      <summary>True if HQ knows that the provider has completed the Identify Proofing (IDP) process and is allowed access to eRx.
            A provider can be enabled even when this is false if the provider is an existing provider before version 15.4 (a legacy provider).</summary>
    </column>
    <column order="5" name="IsSentToHq" type="tinyint(4)">
      <summary>Set to true if the NationalProviderID has been sent to HQ.  Will be false in customer db until sent.
            If true, this tells us that the IsEnabled and IsIdentityProofed flags are set according to HQ records.</summary>
    </column>
    <column order="6" name="IsEpcs" type="tinyint(4)">
      <summary>Set to true manually if the customer has completed their EPCS process.</summary>
    </column>
    <column order="7" name="ErxType" type="tinyint(4)">
      <summary>Enum:ErxOption Identifies which eRx option is being used when asking HQ if they are enabled.</summary>
      <Enumeration name="ErxOption">
        <summary>This Enumeration should match the enumeration in WebServiceCustomerUpdates.ProviderErx.
            Any changes made to this enum need to also be changed there.</summary>
        <EnumValue name="NewCrop">0. Rebranded to Ensora.</EnumValue>
        <EnumValue name="DoseSpot">1.</EnumValue>
        <EnumValue name="DoseSpotWithNewCrop">2.</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="UserId" type="varchar(255)">
      <summary>User identifier used by the associated ErxType.  Only used by OD HQ.</summary>
    </column>
    <column order="9" name="AccountId" type="varchar(25)">
      <summary>Only used by OD HQ.</summary>
    </column>
    <column order="10" name="RegistrationKeyNum" type="bigint(20)" fk="registrationkey">
      <summary>FK to registrationkey.RegistrationKeyNum.  HQ only, links to the registration key used to make this providererx row.</summary>
    </column>
  </table>
  <table name="providerident">
    <summary>Some insurance companies require special provider ID #s, and this table holds them.</summary>
    <column order="0" name="ProviderIdentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  An ID only applies to one provider.</summary>
    </column>
    <column order="2" name="PayorID" type="varchar(255)" fk="carrier">
      <summary>FK to carrier.ElectID  aka Electronic ID. An ID only applies to one insurance carrier.</summary>
    </column>
    <column order="3" name="SuppIDType" type="tinyint">
      <summary>Enum:ProviderSupplementalID</summary>
      <Enumeration name="ProviderSupplementalID">
        <summary>Used when submitting e-claims to some carriers who require extra provider identifiers.  Usage varies by company.  Only used as needed.  SiteNumber is the only one that is still used on 5010s.  The other 3 have been deprecated and replaced by NPI.</summary>
        <EnumValue name="BlueCross">0</EnumValue>
        <EnumValue name="BlueShield">1</EnumValue>
        <EnumValue name="SiteNumber">2</EnumValue>
        <EnumValue name="CommercialNumber">3</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="IDNumber" type="varchar(255)">
      <summary>The number assigned by the ins carrier.</summary>
    </column>
  </table>
  <table name="queryfilter">
    <summary>Each row is a query filter for the Query Monitor window. That window will exclude queries from showing and logging when they contain FilterText. This can significantly reduce the noise when looking through the queries.</summary>
    <column order="0" name="QueryFilterNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="GroupName" type="varchar(255)">
      <summary>This is a simple string instead of a FK to another small table.</summary>
    </column>
    <column order="2" name="FilterText" type="varchar(255)">
      <summary>The text that we look for in the query monitor. Any query that contains this text will be filtered out.</summary>
    </column>
  </table>
  <table name="question">
    <summary>Each row is one Question for one patient.  If a patient has never filled out a questionnaire, then they will have no rows in this table.</summary>
    <column order="0" name="QuestionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="ItemOrder" type="smallint">
      <summary>The order that this question shows in the list.</summary>
    </column>
    <column order="3" name="Description" type="text">
      <summary>The original question.</summary>
    </column>
    <column order="4" name="Answer" type="text">
      <summary>The answer to the question in text form.</summary>
    </column>
    <column order="5" name="FormPatNum" type="bigint(20)" fk="formpat">
      <summary>FK to formpat.FormPatNum</summary>
    </column>
  </table>
  <table name="questiondef">
    <summary>Each row represents one question on the medical history questionnaire.  Later, other questionnaires will be allowed, but for now, all questions are on one questionnaire for the patient.  This table has no dependencies, since the question is copied when added to a patient record.  Any row can be freely deleted or altered without any problems.</summary>
    <column order="0" name="QuestionDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="text">
      <summary>The question as presented to the patient.</summary>
    </column>
    <column order="2" name="ItemOrder" type="smallint">
      <summary>The order that the Questions will show.</summary>
    </column>
    <column order="3" name="QuestType" type="tinyint">
      <summary>Enum:QuestionType</summary>
      <Enumeration name="QuestionType">
        <summary>0=FreeformText, 1=YesNoUnknown. Allows for later adding other types, 3=picklist, 4, etc</summary>
        <EnumValue name="FreeformText">0</EnumValue>
        <EnumValue name="YesNoUnknown">1</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="quickpastecat">
    <summary>Quick paste categories are used by the quick paste notes feature. Every note must be in a category.</summary>
    <column order="0" name="QuickPasteCatNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="ItemOrder" type="smallint">
      <summary>The order of this category within the list. 0-based.</summary>
    </column>
    <column order="3" name="DefaultForTypes" type="text">
      <summary>Enum:EnumQuickPasteType  Each Category can be set to be the default category for multiple types of notes. Stored as integers separated by commas.</summary>
      <Enumeration name="EnumQuickPasteType">
        <summary>Each item in the enum should uniquely describe the location of a single TextBoxOD.  No sharing.  In many cases, this is tied to QuickPasteCat to determine which category to default to when opening.</summary>
        <EnumValue name="None">0 - If None is used for a TextRich, then QuickPasteNotes will be disabled. However, if an area does not have an assigned category, only Quick Paste Notes in the first category with this type can be used.</EnumValue>
        <EnumValue name="Procedure">1</EnumValue>
        <EnumValue name="Appointment">2</EnumValue>
        <EnumValue name="CommLog">3</EnumValue>
        <EnumValue name="Adjustment">4</EnumValue>
        <EnumValue name="Claim">5</EnumValue>
        <EnumValue name="Email">6</EnumValue>
        <EnumValue name="InsPlan">7</EnumValue>
        <EnumValue name="Letter">8</EnumValue>
        <EnumValue name="MedicalSummary">9</EnumValue>
        <EnumValue name="ServiceNotes">10</EnumValue>
        <EnumValue name="MedicalHistory">11</EnumValue>
        <EnumValue name="MedicationEdit">12</EnumValue>
        <EnumValue name="MedicationPat">13</EnumValue>
        <EnumValue name="PatAddressNote">14</EnumValue>
        <EnumValue name="Payment">15</EnumValue>
        <EnumValue name="PayPlan">16</EnumValue>
        <EnumValue name="Query">17</EnumValue>
        <EnumValue name="Referral">18</EnumValue>
        <EnumValue name="Rx">19</EnumValue>
        <EnumValue name="FinancialNotes">20</EnumValue>
        <EnumValue name="ChartTreatment">21</EnumValue>
        <EnumValue name="MedicalUrgent">22</EnumValue>
        <EnumValue name="Statement">23</EnumValue>
        <EnumValue name="Recall">24</EnumValue>
        <EnumValue name="Popup">25</EnumValue>
        <EnumValue name="TxtMsg">26</EnumValue>
        <EnumValue name="Task">27</EnumValue>
        <EnumValue name="Schedule">28</EnumValue>
        <EnumValue name="TreatPlan">29</EnumValue>
        <EnumValue name="ClaimCustomTrack">30</EnumValue>
        <EnumValue name="AutoNotePrompt">31</EnumValue>
        <EnumValue name="JobManager">32</EnumValue>
        <EnumValue name="ReadOnly">33 - Do not use</EnumValue>
        <EnumValue name="Lab">34</EnumValue>
        <EnumValue name="Equipment">35</EnumValue>
        <EnumValue name="Etrans834Import">36</EnumValue>
        <EnumValue name="InCaseOfEmergency">37</EnumValue>
        <EnumValue name="ProviderSearchFilter">38</EnumValue>
        <EnumValue name="ProgramLink">39</EnumValue>
        <EnumValue name="PhoneEmpDefaultStatus">40</EnumValue>
        <EnumValue name="WebChat">41</EnumValue>
        <EnumValue name="FAQ">42</EnumValue>
        <EnumValue name="Sheets">43-Just autonotes, not quickpaste.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="quickpastenote">
    <summary>Template for quick pasted note feature.</summary>
    <column order="0" name="QuickPasteNoteNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="QuickPasteCatNum" type="bigint(20)" fk="quickpastecat">
      <summary>FK to quickpastecat.QuickPasteCatNum.  Keeps track of which category this note is in.</summary>
    </column>
    <column order="2" name="ItemOrder" type="smallint">
      <summary>The order of this note within it's category. 0-based.</summary>
    </column>
    <column order="3" name="Note" type="text">
      <summary>The actual note. Can be multiple lines and possibly very long.</summary>
    </column>
    <column order="4" name="Abbreviation" type="varchar(255)">
      <summary>The abbreviation which will automatically substitute when preceded by a ?.</summary>
    </column>
  </table>
  <table name="reactivation">
    <summary>Track patient contact via a commlog type ("Reactivation").  
            Any commlogs of this type that occur after the last completed procedure will be considered a contact attempt.
            Patients should show in this list if they have previously completed procedures (excluding broken/canceled), 
            and the most recent was completed before the time span specified by the "Days Past" preference.  
            Include Patients with the following PatStatus: Patient, Inactive, Prospective
            Patients should not show in this list if they have been marked "Do not contact".
            Patients should not show in this list if a future appointment is scheduled.
            Once contacted, Patient should not show in this list.  Patient will later reappear in this list if the "Reactivation contact interval" time 
            period passes since the last contact and an appointment has not yet been scheduled.  
            If the patient is contacted the maximum number of times specified by the "Count Contact Max" preference, mark the patient as "Do Not Contact".  
            Example:
            Johnny Patient had his last procedure completed on 1/1/2018.  There is a "Reactivation" type commlog on his chart from 6/1/2018.  
            He does not have any future scheduled appointments.  Johnny would be included in the list of "Reactivation" patients, with a single contact 
            attempt having been made already.</summary>
    <column order="0" name="ReactivationNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="ReactivationStatus" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Uses the existing RecallUnschedStatus DefCat.</summary>
    </column>
    <column order="3" name="ReactivationNote" type="text">
      <summary>An administrative note for staff use.</summary>
    </column>
    <column order="4" name="DoNotContact" type="tinyint(4)">
      <summary>The patient can set this property if they don't want to be contacted so that it won't interfere with the max attempts to contact option.</summary>
    </column>
  </table>
  <table name="recall">
    <summary>A patient can only have one recall object per type.  
            The recall table stores a few dates that must be kept synchronized with other information in the database.  This is difficult.  
            Anytime one of the following items changes, things need to be synchronized: 
            procedurecode.SetRecall, any procedurelog change for a patient (procs added, deleted, completed, status changed, date changed, etc), patient status changed.  
            There are expected to be a few bugs in the synchronization logic, so anytime a patient's recall is opened, it will also update.
            
            During synchronization, the program will frequently alter DateDueCalc, DateDue, and DatePrevious based on trigger procs.  
            The system will also add and delete recalls as necessary. 
            But it will not delete a recall unless all values are default and there is no useful information.  
            When a user tries to delete a recall, they will only be successful if the trigger conditions do not apply.  
            Otherwise, they will have to disable the recall instead.</summary>
    <column order="0" name="RecallNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateDueCalc" type="date">
      <summary>Not editable.  The calculated date due. Generated by the program and subject to change anytime the conditions change. 
            It can be blank (0001-01-01) if no appropriate triggers. </summary>
    </column>
    <column order="3" name="DateDue" type="date">
      <summary>This is the date that is actually used when doing reports for recall. 
            It will usually be the same as DateDueCalc unless user has changed it. System will only update this field if it is the same as DateDueCalc.  
            Otherwise, it will be left alone.  Gets cleared along with DateDueCalc when resetting recall.  
            When setting disabled, this field will also be cleared.  This is the field to use if converting from another software.</summary>
    </column>
    <column order="4" name="DatePrevious" type="date">
      <summary>Not editable. Previous date that procedures were done to trigger this recall. It is calculated and enforced automatically.  
            If you want to affect this date, add a procedure to the chart with a status of C, EC, or EO.</summary>
    </column>
    <column order="5" name="RecallInterval" type="int(11)">
      <summary>The interval between recalls.  The Interval struct combines years, months, weeks, and days into a single integer value.</summary>
    </column>
    <column order="6" name="RecallStatus" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum, or 0 for none.</summary>
    </column>
    <column order="7" name="Note" type="text">
      <summary>An administrative note for staff use.</summary>
    </column>
    <column order="8" name="IsDisabled" type="tinyint">
      <summary>If true, this recall type will be disabled (there's only one type right now). 
            This is usually used rather than deleting the recall type from the patient because trigger conditions must be enforced for all patients.</summary>
    </column>
    <column order="9" name="DateTStamp" type="timestamp">
      <summary>Last datetime that this row was inserted or updated.</summary>
    </column>
    <column order="10" name="RecallTypeNum" type="bigint(20)" fk="recalltype">
      <summary>FK to recalltype.RecallTypeNum.</summary>
    </column>
    <column order="11" name="DisableUntilBalance" type="double">
      <summary>Default is 0.  If a positive number is entered, then the family balance must be less in order for this recall to show in the recall list.</summary>
    </column>
    <column order="12" name="DisableUntilDate" type="date">
      <summary>If a date is entered, then this recall will be disabled until that date.</summary>
    </column>
    <column order="13" name="DateScheduled" type="date">
      <summary>This will only have a value if a recall is scheduled.</summary>
    </column>
    <column order="14" name="Priority" type="tinyint(4)">
      <summary>Enum:RecallPriority Indicates if the appointment has any special priority.</summary>
      <Enumeration name="RecallPriority">
        <summary>Scheduling priority used by Recalls.</summary>
        <EnumValue name="Normal">0 - Default priority</EnumValue>
        <EnumValue name="ASAP">1 - Used to identify items for the ASAP list</EnumValue>
      </Enumeration>
    </column>
    <column order="15" name="TimePatternOverride" type="varchar(255)">
      <summary>Default is an empty string. Used to override a RecallTypes time pattern.</summary>
    </column>
  </table>
  <table name="recalltrigger">
    <summary>Links one procedurecode to one recalltype.  The presence of this trigger is used when determining DatePrevious in the recall table.</summary>
    <column order="0" name="RecallTriggerNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="RecallTypeNum" type="bigint(20)" fk="recalltype">
      <summary>FK to recalltype.RecallTypeNum</summary>
    </column>
    <column order="2" name="CodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum</summary>
    </column>
  </table>
  <table name="recalltype">
    <summary>All recalls are based on these recall types.  Recall triggers are in their own table.</summary>
    <column order="0" name="RecallTypeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="DefaultInterval" type="int(11)">
      <summary>The interval between recalls.  The Interval struct combines years, months, weeks, and days into a single integer value.</summary>
    </column>
    <column order="3" name="TimePattern" type="varchar(255)">
      <summary>Stores the length of the appointment in /'s and X's.  Used when scheduling the appointment.
            Each / or X represents one unit in regards to the global 'Time Increments' appointment view setting.
            This means that recall appointment lengths change along with the 'Time Increments' preference.  /X/ could rep 15 mins, 30 mins, etc.</summary>
    </column>
    <column order="4" name="Procedures" type="varchar(255)">
      <summary>What procedures to put on the recall appointment.  Comma delimited set of ProcCodes.  (We may change this to CodeNums).</summary>
    </column>
    <column order="5" name="AppendToSpecial" type="tinyint(4)">
      <summary>Set to true if this recall type should be automatically appended to the appointment when scheduling a special recall type.
            This boolean only gets considered if this recall type is a "manual" or "custom" recall type.
            If this recall type is flagged as a special recall type then variable is ignored.</summary>
    </column>
  </table>
  <table name="reconcile">
    <summary>Used in the Accounting section.  Each row represents one reconcile.  Transactions will be attached to it.</summary>
    <column order="0" name="ReconcileNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="AccountNum" type="bigint(20)" fk="account">
      <summary>FK to account.AccountNum</summary>
    </column>
    <column order="2" name="StartingBal" type="double">
      <summary>User enters starting balance here.</summary>
    </column>
    <column order="3" name="EndingBal" type="double">
      <summary>User enters ending balance here.</summary>
    </column>
    <column order="4" name="DateReconcile" type="date">
      <summary>The date that the reconcile was performed.</summary>
    </column>
    <column order="5" name="IsLocked" type="tinyint">
      <summary>If StartingBal + sum of entries selected = EndingBal, then user can lock.  Unlock requires special permission, which nobody will have by default.</summary>
    </column>
  </table>
  <table name="recurringcharge">
    <summary>This table holds a record of recurring charges that have been attempted.</summary>
    <column order="0" name="RecurringChargeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. The patient this recurring charge is for.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.ClinicNum. The clinic this recurring charge is for.</summary>
    </column>
    <column order="3" name="DateTimeCharge" type="datetime">
      <summary>The date time of the charge. </summary>
    </column>
    <column order="4" name="ChargeStatus" type="tinyint(4)">
      <summary>Enum:RecurringChargeStatus </summary>
      <Enumeration name="RecurringChargeStatus">
        <summary></summary>
        <EnumValue name="NotYetCharged">0 - The charge has not been attempted yet.</EnumValue>
        <EnumValue name="ChargeSuccessful">1 - The charge was successful.</EnumValue>
        <EnumValue name="ChargeFailed">2 - Processing the charge failed.</EnumValue>
        <EnumValue name="ChargeDeclined">3 - Processing the charge failed and was specifically declined.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="FamBal" type="double">
      <summary>The family balance at the time this charge was created.</summary>
    </column>
    <column order="6" name="PayPlanDue" type="double">
      <summary>The pay plan due at the time this charge was created.</summary>
    </column>
    <column order="7" name="TotalDue" type="double">
      <summary>The sum of the FamBal and PayPlanDue at the time this charge was created.</summary>
    </column>
    <column order="8" name="RepeatAmt" type="double">
      <summary>The recurring charge amount from the credit card at the time this charge was created.</summary>
    </column>
    <column order="9" name="ChargeAmt" type="double">
      <summary>The amount that was charged (or will be charged if the status is NotYetCharged).</summary>
    </column>
    <column order="10" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that processed this charge. Will be 0 if this was done automatically.</summary>
    </column>
    <column order="11" name="PayNum" type="bigint(20)" fk="payment">
      <summary>FK to payment.PayNum. The payment created from this charge.</summary>
    </column>
    <column order="12" name="CreditCardNum" type="bigint(20)" fk="creditcard">
      <summary>FK to creditcard.CreditCardNum. The credit card that caused this charge.</summary>
    </column>
    <column order="13" name="ErrorMsg" type="text">
      <summary>Any error message from processing this charge.</summary>
    </column>
  </table>
  <table name="refattach">
    <summary>Attaches a referral to a patient.</summary>
    <column order="0" name="RefAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ReferralNum" type="bigint(20)" fk="referral">
      <summary>FK to referral.ReferralNum.</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="3" name="ItemOrder" type="smallint">
      <summary>Order to display in patient info. One-based.  Will be automated more in future.</summary>
    </column>
    <column order="4" name="RefDate" type="date">
      <summary>Date of referral.</summary>
    </column>
    <column order="5" name="RefType" type="tinyint(4)">
      <summary>Enum:ReferralType 0=RefTo,1=RefFrom,2=RefCustom.</summary>
      <Enumeration name="ReferralType">
        <summary></summary>
        <EnumValue name="RefTo">0-</EnumValue>
        <EnumValue name="RefFrom">1-</EnumValue>
        <EnumValue name="RefCustom">2-Rarely used. Neither to nor from. Will not show on reports.</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="RefToStatus" type="tinyint">
      <summary>Enum:ReferralToStatus 0=None,1=Declined,2=Scheduled,3=Consulted,4=InTreatment,5=Complete.</summary>
      <Enumeration name="ReferralToStatus">
        <summary>0=None,1=Declined,2=Scheduled,3=Consulted,4=InTreatment,5=Complete</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="Declined">1</EnumValue>
        <EnumValue name="Scheduled">2</EnumValue>
        <EnumValue name="Consulted">3</EnumValue>
        <EnumValue name="InTreatment">4</EnumValue>
        <EnumValue name="Complete">5</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="Note" type="text">
      <summary>Why the patient was referred out, or less commonly, the circumstances of the referral source. Also used when importing from forms. A referral is created with LName=Other. It gets attached to the patient with a note here.</summary>
    </column>
    <column order="8" name="IsTransitionOfCare" type="tinyint(4)">
      <summary>Used to track ehr events.  All outgoing referrals default to true.  The incoming ones get a popup asking if it's a transition of care.</summary>
    </column>
    <column order="9" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum</summary>
    </column>
    <column order="10" name="DateProcComplete" type="date">
      <summary>.</summary>
    </column>
    <column order="11" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Used when referring out a patient to track the referring provider for EHR meaningful use.  Will be -1 when RefType is not set to RefTo.</summary>
    </column>
    <column order="12" name="DateTStamp" type="timestamp">
      <summary>The datetime this referral attachment was last edited.</summary>
    </column>
  </table>
  <table name="referral">
    <summary>All info about a referral is stored with that referral even if a patient.  That way, it's available for easy queries.</summary>
    <column order="0" name="ReferralNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="LName" type="varchar(100)">
      <summary>Last name. Or, if this is a referral like "website" or "word of mouth", then that text goes here in the LName field.</summary>
    </column>
    <column order="2" name="FName" type="varchar(100)">
      <summary>First name.</summary>
    </column>
    <column order="3" name="MName" type="varchar(100)">
      <summary>Middle name or initial.</summary>
    </column>
    <column order="4" name="SSN" type="varchar(9)">
      <summary>SSN or TIN, no punctuation.  For Canada, this holds the referring provider CDA num for claims.</summary>
    </column>
    <column order="5" name="UsingTIN" type="tinyint">
      <summary>Specificies if SSN is real SSN.</summary>
    </column>
    <column order="6" name="Specialty" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.</summary>
    </column>
    <column order="7" name="ST" type="varchar(2)">
      <summary>State</summary>
    </column>
    <column order="8" name="Telephone" type="varchar(30)">
      <summary>Primary phone. Prior to version 25.4, this was restrictive and only allowed exactly 10 digits.</summary>
    </column>
    <column order="9" name="Address" type="varchar(100)">
      <summary>.</summary>
    </column>
    <column order="10" name="Address2" type="varchar(100)">
      <summary>.</summary>
    </column>
    <column order="11" name="City" type="varchar(100)">
      <summary>.</summary>
    </column>
    <column order="12" name="Zip" type="varchar(10)">
      <summary>.</summary>
    </column>
    <column order="13" name="Note" type="text">
      <summary>Holds important info about the referral.</summary>
    </column>
    <column order="14" name="Phone2" type="varchar(30)">
      <summary>Additional phone no restrictions</summary>
    </column>
    <column order="15" name="IsHidden" type="tinyint">
      <summary>Can't delete a referral, but can hide if not needed any more.</summary>
    </column>
    <column order="16" name="NotPerson" type="tinyint">
      <summary>Set to true for referralls such as Yellow Pages.</summary>
    </column>
    <column order="17" name="Title" type="varchar(255)">
      <summary>i.e. DMD or DDS</summary>
    </column>
    <column order="18" name="EMail" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="19" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for referrals that are patients.</summary>
    </column>
    <column order="20" name="NationalProvID" type="varchar(255)">
      <summary>NPI for the referral</summary>
    </column>
    <column order="21" name="Slip" type="bigint(20)" fk="sheetdef">
      <summary>FK to sheetdef.SheetDefNum.  Referral slips can be set for individual referral sources.  If zero, then the default internal referral slip will be used instead of a custom referral slip.</summary>
    </column>
    <column order="22" name="IsDoctor" type="tinyint(4)">
      <summary>True if another dentist or physician.  Cannot be a patient.</summary>
    </column>
    <column order="23" name="IsTrustedDirect" type="tinyint(4)">
      <summary>True if checkbox E-mail Trust for Direct is checked.</summary>
    </column>
    <column order="24" name="DateTStamp" type="timestamp">
      <summary>The datetime this referral was last edited.</summary>
    </column>
    <column order="25" name="IsPreferred" type="tinyint(4)">
      <summary>True if the referral is a preferred referral. The only purpose is to allow filtering in the list of referrals so that the list can be much shorter.</summary>
    </column>
    <column order="26" name="BusinessName" type="varchar(255)">
      <summary>Represents the name of the business that the referral works for.</summary>
    </column>
    <column order="27" name="DisplayNote" type="varchar(4000)">
      <summary>This is a global field used for Scheduling Notes that will show in the family module patient info grid.</summary>
    </column>
  </table>
  <table name="referralcliniclink">
    <summary>Table to link referrals and clinics together.</summary>
    <column order="0" name="ReferralClinicLinkNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ReferralNum" type="bigint(20)" fk="referral">
      <summary>FK to referral.ReferralNum.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
  </table>
  <table name="registrationkey">
    <summary>Keeps track of which product keys have been assigned to which customers.
            This datatype is only used if the program is being run from a distributor installation.
            A single customer is allowed to have more than one key, to accommodate for various circumstances, including having multiple physical business locations.</summary>
    <column order="0" name="RegistrationKeyNum" type="bigint(20)">
      <summary>Primary Key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. The customer to which this registration key applies.</summary>
    </column>
    <column order="2" name="RegKey" type="varchar(4000)">
      <summary>The registration key as stored in the customer database.</summary>
    </column>
    <column order="3" name="Note" type="varchar(4000)">
      <summary>Db note about the registration key. Specifically, the note must include information about the location to which this key pertains, since once at least one key must be assigned to each location to be legal.</summary>
    </column>
    <column order="4" name="DateStarted" type="date">
      <summary>This will help later with tracking for licensing.</summary>
    </column>
    <column order="5" name="DateDisabled" type="date">
      <summary>This is used to completely disable a key.  Might possibly even cripple the user's program.  Usually only used if reassigning another key due to abuse or error.  If no date specified, then this key is still valid.</summary>
    </column>
    <column order="6" name="DateEnded" type="date">
      <summary>This is used when the customer cancels monthly support.  This still allows the customer to get downloads for bug fixes, but only up through a certain version.  Our web server program will use this date to deduce which version they are allowed to have.  Any version that was released as a beta before this date is allowed to be downloaded.</summary>
    </column>
    <column order="7" name="IsForeign" type="tinyint(1)">
      <summary>This is assigned automatically based on whether the registration key is a US version vs. a foreign version.  The foreign version is not able to unlock the procedure codes.  There are muliple layers of safeguards in place.</summary>
    </column>
    <column order="8" name="UsesServerVersion" type="tinyint(4)">
      <summary>Deprecated.</summary>
    </column>
    <column order="9" name="IsFreeVersion" type="tinyint(4)">
      <summary>We have given this customer a free version.  Typically in India.</summary>
    </column>
    <column order="10" name="IsOnlyForTesting" type="tinyint(4)">
      <summary>This customer is not using the software with live patient data, but only for testing and development purposes.</summary>
    </column>
    <column order="11" name="VotesAllotted" type="int(11)">
      <summary>Typically 100, although it can be more for multilocation offices.</summary>
    </column>
    <column order="12" name="IsResellerCustomer" type="tinyint(4)">
      <summary>This is a customer of a reseller, so this customer will not have full access to all our services.</summary>
    </column>
    <column order="13" name="HasEarlyAccess" type="tinyint(4)">
      <summary>This is a customer that is allowed early access to certain features.  E.g. downloading the Alpha version of the software.</summary>
    </column>
    <column order="14" name="DateTBackupScheduled" type="datetime">
      <summary>Deprecated. Moved to the supplementalbackups database. Next date and time of supplemental backup for the customer who owns this registration key.</summary>
    </column>
    <column order="15" name="BackupPassCode" type="varchar(32)">
      <summary>Deprecated. Moved to the supplementalbackups database. Pass code for next supplemental backup expected from this customer.</summary>
    </column>
    <column order="16" name="DateTClinicAccess" type="datetime">
      <summary>This is set at HQ and gives the office the ability to add new clinics until this time passes.</summary>
    </column>
  </table>
  <table name="reminderrule">
    <summary>Ehr</summary>
    <column order="0" name="ReminderRuleNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ReminderCriterion" type="tinyint(4)">
      <summary>Enum:EhrCriterion Problem,Medication,Allergy,Age,Gender,LabResult.</summary>
      <Enumeration name="EhrCriterion">
        <summary>EhrCriterion: Problem,Medication,Allergy,Age,Gender,LabResult</summary>
        <EnumValue name="Problem">0-DiseaseDef.  Shows as 'problem' because it needs to be human readable.</EnumValue>
        <EnumValue name="Medication">1-Medication</EnumValue>
        <EnumValue name="Allergy">2-AllergyDef</EnumValue>
        <EnumValue name="Age">3-Age</EnumValue>
        <EnumValue name="Gender">4-Gender</EnumValue>
        <EnumValue name="LabResult">5-LabResult</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="CriterionFK" type="bigint(20)">
      <summary>Foreign key to disease.DiseaseDefNum, medicationpat.MedicationNum, or allergy.AllergyDefNum. Will be 0 if Age, Gender, or LabResult are the trigger.</summary>
    </column>
    <column order="3" name="CriterionValue" type="varchar(255)">
      <summary>Only used if Age, Gender, or LabResult are the trigger. Examples: "&lt;25"(must include &lt; or &gt;), "Male"/"Female", "INR" (the simple description of the lab test)</summary>
    </column>
    <column order="4" name="Message" type="varchar(255)">
      <summary>Text that will show as the reminder.</summary>
    </column>
  </table>
  <table name="repeatcharge">
    <summary>Each row represents one charge that will be added. Usually monthly, but quarterly and annually are allowed.</summary>
    <column order="0" name="RepeatChargeNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="ProcCode" type="varchar(15)" fk="procedurecode">
      <summary>FK to procedurecode.ProcCode.  The code that will be added to the account as a completed procedure.</summary>
    </column>
    <column order="3" name="ChargeAmt" type="double">
      <summary>The amount that will be charged.  The amount from the procedurecode will not be used.  This way, a repeating charge cannot be accidentally altered.</summary>
    </column>
    <column order="4" name="DateStart" type="date">
      <summary>The date of the first charge if UseBillingCycleDays is not enabled.  Charges will always be added on the same day of the frequency start date. If UseBillingCycleDays is enabled, repeat charges will be applied on billing cycle day instead. If more than one frequency cycle goes by without applying repeating charges, then multiple procedures will be added.</summary>
    </column>
    <column order="5" name="DateStop" type="date">
      <summary>The last date on which a charge is allowed. Can be blank (0001-01-01) to represent a perpetual repeating charge.</summary>
    </column>
    <column order="6" name="Note" type="text">
      <summary>Any note for internal use.</summary>
    </column>
    <column order="7" name="CopyNoteToProc" type="tinyint(4)">
      <summary>Indicates that the note should be copied to the corresponding procedure billing note.</summary>
    </column>
    <column order="8" name="CreatesClaim" type="tinyint(4)">
      <summary>Set to true to have a claim automatically created for the patient with the procedure that is attached to this repeating charge.</summary>
    </column>
    <column order="9" name="IsEnabled" type="tinyint(4)">
      <summary>Set to false to disable the repeating charge.  This allows patients to have repeating charges in their history that are not active.  Used mainly for repeating charges with notes that should not be deleted.</summary>
    </column>
    <column order="10" name="UsePrepay" type="tinyint(4)">
      <summary>Set to true to use prepayments for repeating charges.</summary>
    </column>
    <column order="11" name="Npi" type="text">
      <summary>Stores the NPI of the provider on this repeating charge for Erx.  This used to be stored in the Note field but got moved over to its own column in 17.2.</summary>
    </column>
    <column order="12" name="ErxAccountId" type="text">
      <summary>Stores the Erx Account ID on this repeating charge for Erx.  This used to be stored in the Note field but got moved over to its own column in 17.2.</summary>
    </column>
    <column order="13" name="ProviderName" type="text">
      <summary>Stores the name of the provider on this repeating charge for Erx.  Value is received directly from Ensora.</summary>
    </column>
    <column order="14" name="ChargeAmtAlt" type="double">
      <summary>HQ Only. An alternate amount to be charged for this RepeatCharge in some cases. Should always default to -1 as -1 will be used as a flag to indicate it has not been set. A value of 0 means ChargeAmtAlt has been intentionally set to 0.</summary>
    </column>
    <column order="15" name="UnearnedTypes" type="varchar(4000)">
      <summary>If UsePrepay is true, when the procedure is created from this repeat charge, it will allocate payments from these unearned types. Stored as a comma separated list of DefNums of Category PaySplitUnearnedType. If empty, then all unearned types will be considered.</summary>
    </column>
    <column order="16" name="Frequency" type="tinyint(4)">
      <summary>Enum:EnumRepeatChargeFrequency 0-Monthly, 1-Quarterly, 2-Annually.</summary>
      <Enumeration name="EnumRepeatChargeFrequency">
        <summary></summary>
        <EnumValue name="Monthly">0 - Monthly</EnumValue>
        <EnumValue name="Quarterly">1 - Quarterly</EnumValue>
        <EnumValue name="Annually">2 - Annually</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="replicationserver">
    <summary>Replication server information. Used for server specific replication settings, manually entered by the user.  Each row is one server.</summary>
    <column order="0" name="ReplicationServerNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Descript" type="text">
      <summary>The description or name of the server.  Optional.</summary>
    </column>
    <column order="2" name="ServerId" type="int(10)">
      <summary>Db admin sets this server_id server variable on each replication server.  Allows us to know what server each workstation is connected to.  In display, it's ordered by this value.  Users are always forced to enter a value here.</summary>
    </column>
    <column order="3" name="RangeStart" type="bigint(20)">
      <summary>Deprecated. Only used for Random Primary Keys. The start of the key range for this server.  0 if no value entered yet.</summary>
    </column>
    <column order="4" name="RangeEnd" type="bigint(20)">
      <summary>Deprecated. Only used for Random Primary Keys. The end of the key range for this server.  0 if no value entered yet.</summary>
    </column>
    <column order="5" name="AtoZpath" type="varchar(255)">
      <summary>The AtoZpath for this server. Optional.</summary>
    </column>
    <column order="6" name="UpdateBlocked" type="tinyint(4)">
      <summary>If true, then this server cannot initiate an update.  Typical for satellite servers.</summary>
    </column>
    <column order="7" name="SlaveMonitor" type="varchar(255)">
      <summary>Deprecated. Monitoring the status of replication is now monitored by a separate service. See online manual for information on installing the new service. The description or name of the comptuer that will monitor replication for this server.</summary>
    </column>
  </table>
  <table name="reqneeded">
    <summary>For Dental Schools.  Requirements needed in order to complete course or graduation needs. Copied from def to course so that the ones attached to defs can be freely deleted or edited without affecting any students.</summary>
    <column order="0" name="ReqNeededNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Descript" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="SchoolCourseNum" type="bigint(20)" fk="schoolcourse">
      <summary>FK to schoolcourse.SchoolCourseNum. Will be 0 if req is for a course def or defining a grad requirement.</summary>
    </column>
    <column order="3" name="SchoolClassNum" type="bigint(20)" fk="schoolclass">
      <summary>FK to schoolclass.SchoolClassNum. Will be 0 if req is for a course def.</summary>
    </column>
    <column order="4" name="SchoolCourseDefNum" type="bigint(20)" fk="schoolcoursedef">
      <summary>FK to schoolcoursedef.SchoolCourseDef. Will be 0 if req is for a course or defining a grad requirement.</summary>
    </column>
  </table>
  <table name="reqstudent">
    <summary>For Dental Schools.  The purpose of this table changed significantly in version 4.5.  This now only stores completed requirements.  There can be multiple completed requirements of each ReqNeededNum.  No need to synchronize any longer.</summary>
    <column order="0" name="ReqStudentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ReqNeededNum" type="bigint(20)" fk="reqneeded">
      <summary>FK to reqneeded.ReqNeededNum.</summary>
    </column>
    <column order="2" name="Descript" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="3" name="SchoolCourseNum" type="bigint(20)" fk="schoolcourse">
      <summary>FK to schoolcourse.SchoolCourseNum.  Never 0.</summary>
    </column>
    <column order="4" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  The student.  Never 0.</summary>
    </column>
    <column order="5" name="AptNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="6" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="7" name="InstructorNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum</summary>
    </column>
    <column order="8" name="DateCompleted" type="date">
      <summary>The date that the requirement was completed.</summary>
    </column>
    <column order="9" name="ProcNum" type="bigint(20)">
      <summary>FK to procedure.ProcNum</summary>
    </column>
  </table>
  <table name="requiredfield">
    <summary>Each row represents a field that is required to be filled out.</summary>
    <column order="0" name="RequiredFieldNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FieldType" type="tinyint(4)">
      <summary>Enum:RequiredFieldType . The area of the program that uses this field.</summary>
      <Enumeration name="RequiredFieldType">
        <summary>The part of the program where this required field is used.</summary>
        <EnumValue name="PatientInfo">0 - Edit Patient Information window and Add Family (FormPatientAddAll) window.</EnumValue>
        <EnumValue name="InsPayEdit">1 - Edit Claim Payment window.</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="FieldName" type="varchar(50)">
      <summary>Enum:RequiredFieldName </summary>
      <Enumeration name="RequiredFieldName">
        <summary>This enum is stored as a string, so the order of values can be rearranged.</summary>
        <EnumValue name="Address"></EnumValue>
        <EnumValue name="Address2"></EnumValue>
        <EnumValue name="AddressPhoneNotes"></EnumValue>
        <EnumValue name="AdmitDate"></EnumValue>
        <EnumValue name="AskArriveEarly"></EnumValue>
        <EnumValue name="BatchNumber"></EnumValue>
        <EnumValue name="BillingType"></EnumValue>
        <EnumValue name="Birthdate"></EnumValue>
        <EnumValue name="Carrier"></EnumValue>
        <EnumValue name="ChartNumber"></EnumValue>
        <EnumValue name="CheckDate"></EnumValue>
        <EnumValue name="CheckNumber"></EnumValue>
        <EnumValue name="City"></EnumValue>
        <EnumValue name="Clinic"></EnumValue>
        <EnumValue name="CollegeName"></EnumValue>
        <EnumValue name="County"></EnumValue>
        <EnumValue name="CreditType"></EnumValue>
        <EnumValue name="DateFirstVisit"></EnumValue>
        <EnumValue name="DateTimeDeceased"></EnumValue>
        <EnumValue name="DepositAccountNumber"></EnumValue>
        <EnumValue name="DepositDate"></EnumValue>
        <EnumValue name="DischargeDate"></EnumValue>
        <EnumValue name="EligibilityExceptCode"></EnumValue>
        <EnumValue name="EmailAddress"></EnumValue>
        <EnumValue name="EmergencyName"></EnumValue>
        <EnumValue name="EmergencyPhone"></EnumValue>
        <EnumValue name="Employer"></EnumValue>
        <EnumValue name="Ethnicity"></EnumValue>
        <EnumValue name="FeeSchedule"></EnumValue>
        <EnumValue name="FirstName"></EnumValue>
        <EnumValue name="Gender"></EnumValue>
        <EnumValue name="GenderIdentity"></EnumValue>
        <EnumValue name="GradeLevel"></EnumValue>
        <EnumValue name="GroupName"></EnumValue>
        <EnumValue name="GroupNum"></EnumValue>
        <EnumValue name="HomePhone"></EnumValue>
        <EnumValue name="InsPayEditClinic"></EnumValue>
        <EnumValue name="InsurancePhone"></EnumValue>
        <EnumValue name="InsuranceSubscriber"></EnumValue>
        <EnumValue name="InsuranceSubscriberID"></EnumValue>
        <EnumValue name="Language"></EnumValue>
        <EnumValue name="LastName"></EnumValue>
        <EnumValue name="PaymentAmount"></EnumValue>
        <EnumValue name="PaymentType"></EnumValue>
        <EnumValue name="Position"></EnumValue>
        <EnumValue name="MedicaidID"></EnumValue>
        <EnumValue name="MedicaidState"></EnumValue>
        <EnumValue name="MiddleInitial"></EnumValue>
        <EnumValue name="MothersMaidenFirstName"></EnumValue>
        <EnumValue name="MothersMaidenLastName"></EnumValue>
        <EnumValue name="PatientStatus"></EnumValue>
        <EnumValue name="PreferConfirmMethod"></EnumValue>
        <EnumValue name="PreferContactMethod"></EnumValue>
        <EnumValue name="PreferRecallMethod"></EnumValue>
        <EnumValue name="PreferredName"></EnumValue>
        <EnumValue name="PrimaryProvider"></EnumValue>
        <EnumValue name="Race"></EnumValue>
        <EnumValue name="ReferredFrom"></EnumValue>
        <EnumValue name="ResponsibleParty"></EnumValue>
        <EnumValue name="Salutation"></EnumValue>
        <EnumValue name="SecondaryProvider"></EnumValue>
        <EnumValue name="SexualOrientation"></EnumValue>
        <EnumValue name="Site"></EnumValue>
        <EnumValue name="SocialSecurityNumber"></EnumValue>
        <EnumValue name="State"></EnumValue>
        <EnumValue name="StudentStatus"></EnumValue>
        <EnumValue name="TextOK"></EnumValue>
        <EnumValue name="Title"></EnumValue>
        <EnumValue name="TreatmentUrgency"></EnumValue>
        <EnumValue name="TrophyFolder"></EnumValue>
        <EnumValue name="Ward"></EnumValue>
        <EnumValue name="WirelessPhone"></EnumValue>
        <EnumValue name="WorkPhone"></EnumValue>
        <EnumValue name="Zip"></EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="requiredfieldcondition">
    <summary>When one of these conditions is true, the corresponding requiredfield will be triggered.</summary>
    <column order="0" name="RequiredFieldConditionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="RequiredFieldNum" type="bigint(20)" fk="requiredfield">
      <summary>FK to requiredfield.RequiredFieldNum.</summary>
    </column>
    <column order="2" name="ConditionType" type="varchar(50)">
      <summary>Enum:RequiredFieldName </summary>
      <Enumeration name="RequiredFieldName">
        <summary>This enum is stored as a string, so the order of values can be rearranged.</summary>
        <EnumValue name="Address"></EnumValue>
        <EnumValue name="Address2"></EnumValue>
        <EnumValue name="AddressPhoneNotes"></EnumValue>
        <EnumValue name="AdmitDate"></EnumValue>
        <EnumValue name="AskArriveEarly"></EnumValue>
        <EnumValue name="BatchNumber"></EnumValue>
        <EnumValue name="BillingType"></EnumValue>
        <EnumValue name="Birthdate"></EnumValue>
        <EnumValue name="Carrier"></EnumValue>
        <EnumValue name="ChartNumber"></EnumValue>
        <EnumValue name="CheckDate"></EnumValue>
        <EnumValue name="CheckNumber"></EnumValue>
        <EnumValue name="City"></EnumValue>
        <EnumValue name="Clinic"></EnumValue>
        <EnumValue name="CollegeName"></EnumValue>
        <EnumValue name="County"></EnumValue>
        <EnumValue name="CreditType"></EnumValue>
        <EnumValue name="DateFirstVisit"></EnumValue>
        <EnumValue name="DateTimeDeceased"></EnumValue>
        <EnumValue name="DepositAccountNumber"></EnumValue>
        <EnumValue name="DepositDate"></EnumValue>
        <EnumValue name="DischargeDate"></EnumValue>
        <EnumValue name="EligibilityExceptCode"></EnumValue>
        <EnumValue name="EmailAddress"></EnumValue>
        <EnumValue name="EmergencyName"></EnumValue>
        <EnumValue name="EmergencyPhone"></EnumValue>
        <EnumValue name="Employer"></EnumValue>
        <EnumValue name="Ethnicity"></EnumValue>
        <EnumValue name="FeeSchedule"></EnumValue>
        <EnumValue name="FirstName"></EnumValue>
        <EnumValue name="Gender"></EnumValue>
        <EnumValue name="GenderIdentity"></EnumValue>
        <EnumValue name="GradeLevel"></EnumValue>
        <EnumValue name="GroupName"></EnumValue>
        <EnumValue name="GroupNum"></EnumValue>
        <EnumValue name="HomePhone"></EnumValue>
        <EnumValue name="InsPayEditClinic"></EnumValue>
        <EnumValue name="InsurancePhone"></EnumValue>
        <EnumValue name="InsuranceSubscriber"></EnumValue>
        <EnumValue name="InsuranceSubscriberID"></EnumValue>
        <EnumValue name="Language"></EnumValue>
        <EnumValue name="LastName"></EnumValue>
        <EnumValue name="PaymentAmount"></EnumValue>
        <EnumValue name="PaymentType"></EnumValue>
        <EnumValue name="Position"></EnumValue>
        <EnumValue name="MedicaidID"></EnumValue>
        <EnumValue name="MedicaidState"></EnumValue>
        <EnumValue name="MiddleInitial"></EnumValue>
        <EnumValue name="MothersMaidenFirstName"></EnumValue>
        <EnumValue name="MothersMaidenLastName"></EnumValue>
        <EnumValue name="PatientStatus"></EnumValue>
        <EnumValue name="PreferConfirmMethod"></EnumValue>
        <EnumValue name="PreferContactMethod"></EnumValue>
        <EnumValue name="PreferRecallMethod"></EnumValue>
        <EnumValue name="PreferredName"></EnumValue>
        <EnumValue name="PrimaryProvider"></EnumValue>
        <EnumValue name="Race"></EnumValue>
        <EnumValue name="ReferredFrom"></EnumValue>
        <EnumValue name="ResponsibleParty"></EnumValue>
        <EnumValue name="Salutation"></EnumValue>
        <EnumValue name="SecondaryProvider"></EnumValue>
        <EnumValue name="SexualOrientation"></EnumValue>
        <EnumValue name="Site"></EnumValue>
        <EnumValue name="SocialSecurityNumber"></EnumValue>
        <EnumValue name="State"></EnumValue>
        <EnumValue name="StudentStatus"></EnumValue>
        <EnumValue name="TextOK"></EnumValue>
        <EnumValue name="Title"></EnumValue>
        <EnumValue name="TreatmentUrgency"></EnumValue>
        <EnumValue name="TrophyFolder"></EnumValue>
        <EnumValue name="Ward"></EnumValue>
        <EnumValue name="WirelessPhone"></EnumValue>
        <EnumValue name="WorkPhone"></EnumValue>
        <EnumValue name="Zip"></EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="Operator" type="tinyint(4)">
      <summary>Enum:ConditionOperator . The operator that is being applied to the ConditionType.</summary>
      <Enumeration name="ConditionOperator">
        <summary></summary>
        <EnumValue name="Equals">0: =</EnumValue>
        <EnumValue name="NotEquals">1: !=</EnumValue>
        <EnumValue name="GreaterThan">2: &gt;</EnumValue>
        <EnumValue name="LessThan">3: &lt;</EnumValue>
        <EnumValue name="GreaterThanOrEqual">4: &gt;=</EnumValue>
        <EnumValue name="LessThanOrEqual">5: &lt;=</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ConditionValue" type="varchar(255)">
      <summary>The value that the condition is being compared against. Could be 18, Fulltime, Male, etc.</summary>
    </column>
    <column order="5" name="ConditionRelationship" type="tinyint(4)">
      <summary>Enum:LogicalOperator 0-None,1-And,2-Or. This field is only used when comparing continuous values such as age or date.</summary>
      <Enumeration name="LogicalOperator">
        <summary></summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="And">1</EnumValue>
        <EnumValue name="Or">2</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="rxalert">
    <summary>Many-to-many relationship connecting Rx with DiseaseDef, AllergyDef, or Medication.  Only one of those links may be specified in a single row; the other two will be 0.</summary>
    <column order="0" name="RxAlertNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="RxDefNum" type="bigint(20)" fk="rxdef">
      <summary>FK to rxdef.RxDefNum.  This alert is to be shown when user attempts to write an Rx for this RxDef.</summary>
    </column>
    <column order="2" name="DiseaseDefNum" type="bigint(20)" fk="diseasedef">
      <summary>FK to diseasedef.DiseaseDefNum.  Only if DrugProblem interaction.  This is compared against disease.DiseaseDefNum using PatNum.  Drug-Problem (they call it Drug-Diagnosis) checking is also performed in Ensora.</summary>
    </column>
    <column order="3" name="AllergyDefNum" type="bigint(20)" fk="allergydef">
      <summary>FK to allergydef.AllergyDefNum.  Only if DrugAllergy interaction.  Compared against allergy.AllergyDefNum using PatNum.  Drug-Allergy checking is also perfomed in Ensora.</summary>
    </column>
    <column order="4" name="MedicationNum" type="bigint(20)" fk="medication">
      <summary>FK to medication.MedicationNum.  Only if DrugDrug interaction.  This will be compared against medicationpat.MedicationNum using PatNum.  Drug-Drug checking is also performed in Ensora.</summary>
    </column>
    <column order="5" name="NotificationMsg" type="varchar(255)">
      <summary>This is typically blank, so a default message will be displayed by OD.  But if this contains a message, then this message will be used instead.</summary>
    </column>
    <column order="6" name="IsHighSignificance" type="tinyint(4)">
      <summary>False by default.  Set to true to flag the drug-drug or drug-allergy intervention as high significance.</summary>
    </column>
  </table>
  <table name="rxdef">
    <summary>Rx definitions.  Can safely delete or alter, because they get copied to the rxPat table, not referenced.</summary>
    <column order="0" name="RxDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Drug" type="varchar(255)">
      <summary>The name of the drug.</summary>
    </column>
    <column order="2" name="Sig" type="varchar(255)">
      <summary>Directions intended for the pharmacist.</summary>
    </column>
    <column order="3" name="Disp" type="varchar(255)">
      <summary>Amount to dispense.</summary>
    </column>
    <column order="4" name="Refills" type="varchar(30)">
      <summary>Number of refills.</summary>
    </column>
    <column order="5" name="Notes" type="varchar(255)">
      <summary>Notes about this drug. Will not be copied to the rxpat.</summary>
    </column>
    <column order="6" name="IsControlled" type="tinyint(4)">
      <summary>Is a controlled substance.  This will affect the way it prints.</summary>
    </column>
    <column order="7" name="RxCui" type="bigint(20)">
      <summary>RxNorm Code identifier.  Copied down into medicationpat.RxCui (medical order) when a prescription is written.</summary>
    </column>
    <column order="8" name="IsProcRequired" type="tinyint(4)">
      <summary>If true will require procedure be attached to this prescription when printed.  Usually true if IsControlled is true.</summary>
    </column>
    <column order="9" name="PatientInstruction" type="text">
      <summary>Directions intended for the patient.</summary>
    </column>
  </table>
  <table name="rxnorm">
    <summary>RxNorm created from a zip file.</summary>
    <column order="0" name="RxNormNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="RxCui" type="varchar(255)">
      <summary>RxNorm Concept universal ID.  Throughout the program, this is actually used as the Primary Key of this table rather than the RxNormNum.</summary>
    </column>
    <column order="2" name="MmslCode" type="varchar(255)">
      <summary>Multum code.  Only used for crosscoding during import/export with electronic Rx program.  User cannot see multum codes.  Most of the rows in this table do not have an MmslCode and user searches ignore rows with an MmslCode.</summary>
    </column>
    <column order="3" name="Description" type="text">
      <summary>Only used for RxNorms, not Multums.</summary>
    </column>
  </table>
  <table name="rxpat">
    <summary>One Rx for one patient. Copied from rxdef rather than linked to it.</summary>
    <column order="0" name="RxNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="RxDate" type="date">
      <summary>Date of Rx.</summary>
    </column>
    <column order="3" name="Drug" type="varchar(255)">
      <summary>Drug name. Example: PenVK 500 mg capsules. Example: Percocet 5/500 tablets.</summary>
    </column>
    <column order="4" name="Sig" type="varchar(255)">
      <summary>Directions intended for the pharmacist. Example: Take 2 tablets twice a day.</summary>
    </column>
    <column order="5" name="Disp" type="varchar(255)">
      <summary>Amount to dispense. Example: 12 (twelve)</summary>
    </column>
    <column order="6" name="Refills" type="varchar(30)">
      <summary>Number of refills. Example: 3.  Example: 1 per month.</summary>
    </column>
    <column order="7" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="8" name="Notes" type="varchar(255)">
      <summary>Notes specific to this Rx.  Will not show on the printout.  For staff use only.</summary>
    </column>
    <column order="9" name="PharmacyNum" type="bigint(20)" fk="pharmacy">
      <summary>FK to pharmacy.PharmacyNum.</summary>
    </column>
    <column order="10" name="IsControlled" type="tinyint(4)">
      <summary>Is a controlled substance.  This will affect the way it prints.</summary>
    </column>
    <column order="11" name="DateTStamp" type="timestamp">
      <summary>The last date and time this row was altered.  Not user editable.</summary>
    </column>
    <column order="12" name="SendStatus" type="tinyint(4)">
      <summary>Enum:RxSendStatus </summary>
      <Enumeration name="RxSendStatus">
        <summary></summary>
        <EnumValue name="Unsent">0</EnumValue>
        <EnumValue name="InElectQueue">1- This will never be used in production.  It was only used for proof of concept when building EHR.</EnumValue>
        <EnumValue name="SentElect">2</EnumValue>
        <EnumValue name="Printed">3</EnumValue>
        <EnumValue name="Faxed">4</EnumValue>
        <EnumValue name="CalledIn">5</EnumValue>
        <EnumValue name="GaveScript">6</EnumValue>
        <EnumValue name="Pending">7</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="RxCui" type="bigint(20)">
      <summary>Deprecated.  RxNorm Code identifier.  Was used in FormRxSend for EHR 2011, but FormRxSend has been deleted.  No longer in use anywhere.  Still exists in db for now.</summary>
    </column>
    <column order="14" name="DosageCode" type="varchar(255)">
      <summary>NCI Pharmaceutical Dosage Form code.  Only used with ehr.  For example, C48542 is the code for “Tablet dosing unit”.  User enters code manually, and it's only used for Rx Send, which will be deprecated with 2014 cert.  Guaranteed that nobody actually uses or cares about this field.</summary>
    </column>
    <column order="15" name="ErxGuid" type="varchar(40)">
      <summary>eRx returns this unique identifier to use for electronic Rx.  Also set for Open Dental created medications using a different format.</summary>
    </column>
    <column order="16" name="IsErxOld" type="tinyint(4)">
      <summary>True for historic prescriptions which existed prior to version 15.4.  The purpose of this column is to keep historic reports accurate.</summary>
    </column>
    <column order="17" name="ErxPharmacyInfo" type="varchar(255)">
      <summary>The pharmacyinfo field contains the pharmacy name as well as other information about the pharmacy, but the information is inconsistent.
            The purpose of this field is to give the user means to visually verify they have the correct pharmacy selected.</summary>
    </column>
    <column order="18" name="IsProcRequired" type="tinyint(4)">
      <summary>If true will require procedure be attached to this prescription when printed.  Usually true if IsControlled is true.</summary>
    </column>
    <column order="19" name="ProcNum" type="bigint(20)">
      <summary>The procedure attached to this prescription when IsProcRequired is true.</summary>
    </column>
    <column order="20" name="DaysOfSupply" type="double">
      <summary>The number of days this prescription is intended to last.  Only used when IsProcRequired is true.</summary>
    </column>
    <column order="21" name="PatientInstruction" type="text">
      <summary>Directions intended for the patient.</summary>
    </column>
    <column order="22" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="23" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. Used to log who is accessing pdmp bridge</summary>
    </column>
    <column order="24" name="RxType" type="tinyint(4)">
      <summary>Enum:RxTypes to check what bridge is being used to access pdmp. Indexed in database</summary>
      <Enumeration name="RxTypes">
        <summary>RxType used to determine which bridge accesses patient history from PDMP. Rx is the default</summary>
        <EnumValue name="Rx">0 - Rx, existing entries should default to this</EnumValue>
        <EnumValue name="LogicoyAccess">1 - LogicoyAccess</EnumValue>
        <EnumValue name="BambooAccess">2 - </EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="schedule">
    <summary>One block of time.  Either for practice, provider, employee, or blockout.</summary>
    <column order="0" name="ScheduleNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SchedDate" type="date">
      <summary>Date for this timeblock.</summary>
    </column>
    <column order="2" name="StartTime" type="time">
      <summary>Start time for this timeblock.</summary>
    </column>
    <column order="3" name="StopTime" type="time">
      <summary>Stop time for this timeblock.</summary>
    </column>
    <column order="4" name="SchedType" type="tinyint">
      <summary>Enum:ScheduleType 0=Practice,1=Provider,2=Blockout,3=Employee.  Practice is used as a way to indicate holidays and as a way to put a
            note in for the entire practice for one day.  But whenever type is Practice, times will be ignored.</summary>
      <Enumeration name="ScheduleType">
        <summary>For schedule timeblocks.</summary>
        <EnumValue name="Practice">0</EnumValue>
        <EnumValue name="Provider">1</EnumValue>
        <EnumValue name="Blockout">2</EnumValue>
        <EnumValue name="Employee">3</EnumValue>
        <EnumValue name="WebSchedASAP">4 - A slot of time that an ASAP appointment can be moved up to.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum if a provider type.</summary>
    </column>
    <column order="6" name="BlockoutType" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum if blockout.  eg. HighProduction, RCT Only, Emerg.</summary>
    </column>
    <column order="7" name="Note" type="text">
      <summary>This contains various types of text entered by the user.</summary>
    </column>
    <column order="8" name="Status" type="tinyint">
      <summary>Enum:SchedStatus enumeration 0=Open,1=Override,2=Holiday.  All blocks have a status of Open, but user doesn't see the status. The "Override" status is used only by ODHQ in Phone Graph Edit window. Holidays are a special type of practice schedule item which do not have providers attached. Holidays are also used by blockouts. Used to differentiate between Practice SchedType Holidays and Notes.</summary>
      <Enumeration name="SchedStatus">
        <summary>Schedule status.  Open=0,Override=1,Holiday=2.</summary>
        <EnumValue name="Open">0</EnumValue>
        <EnumValue name="Override">1</EnumValue>
        <EnumValue name="Holiday">2</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="EmployeeNum" type="bigint(20)" fk="employee">
      <summary>FK to employee.EmployeeNum.</summary>
    </column>
    <column order="10" name="DateTStamp" type="timestamp">
      <summary>Last datetime that this row was inserted or updated.</summary>
    </column>
    <column order="11" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum if SchedType.Practice (holidays and practice notes) and applies to one clinic (operatories for one clinic). If
            SchedType.Practice and this applies to all clinics, or if any other SchedType, ClinicNum will be 0.  There won't be any scheduleop rows linking
            this schedule to operatories when the type is SchedType.Practice.  Instead, the linkage is implied based on the operatory.ClinicNum and applies
            to all operatories for the clinic.</summary>
    </column>
  </table>
  <table name="scheduledprocess">
    <summary></summary>
    <column order="0" name="ScheduledProcessNum" type="bigint(20)">
      <summary>Primary Key</summary>
    </column>
    <column order="1" name="ScheduledAction" type="varchar(50)">
      <summary>Enum:ScheduledActionEnum </summary>
      <Enumeration name="ScheduledActionEnum">
        <summary>Action to be selected by user when scheduling. When adding a new value to this Enum add a case for it in the ScheduledProcessThread in
            OpendentalService and a method to handle the action.</summary>
        <EnumValue name="RecallSync">0</EnumValue>
        <EnumValue name="InsVerifyBatch">1</EnumValue>
        <EnumValue name="Statements">2</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="TimeToRun" type="datetime">
      <summary>What time of the day it's supposed to run.</summary>
    </column>
    <column order="3" name="FrequencyToRun" type="varchar(50)">
      <summary>Enum:FrequencyToRunEnum </summary>
      <Enumeration name="FrequencyToRunEnum">
        <summary>Frequency with which an action will be run. When adding a new value to this Enum add a case for it in the ScheduledProcessThread in 
            OpendentalService with the logic to check if the action should be run.</summary>
        <EnumValue name="Daily">0</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="LastRanDateTime" type="datetime">
      <summary>Date and time when process last ran.</summary>
    </column>
  </table>
  <table name="scheduleop">
    <summary>Links one schedule block to one operatory.  A schedule block can be linked to one or more operatories.  A schedule can also not have any scheduleops.  For example the provider schedule.</summary>
    <column order="0" name="ScheduleOpNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ScheduleNum" type="bigint(20)" fk="schedule">
      <summary>FK to schedule.ScheduleNum.</summary>
    </column>
    <column order="2" name="OperatoryNum" type="bigint(20)" fk="operatory">
      <summary>FK to operatory.OperatoryNum.</summary>
    </column>
  </table>
  <table name="schoolapproval">
    <summary>Dental school instructor approval linked to a student item like a procedure or treatment plan.</summary>
    <column order="0" name="SchoolApprovalNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. The student. Never 0.</summary>
    </column>
    <column order="2" name="SignOffStatus" type="tinyint(4)">
      <summary>The current review status of the item.</summary>
    </column>
    <column order="3" name="InstructorNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. Indicates the instructor who reviewed this item.</summary>
    </column>
    <column order="4" name="AptNum" type="bigint(20)" fk="appointment">
      <summary>FK to appointment.AptNum. Indicates the appointment this approval is for. 0 if not applicable.</summary>
    </column>
    <column order="5" name="ProcNum" type="bigint(20)">
      <summary>FK to procedure.ProcNum. Indicates the procedure this approval is for. 0 if not applicable.</summary>
    </column>
    <column order="6" name="TreatPlanNum" type="bigint(20)" fk="treatplan">
      <summary>FK to treatplan.TreatPlanNum. Indicates the treatment plan this approval is for. 0 if not applicable.</summary>
    </column>
    <column order="7" name="PerioExamNum" type="bigint(20)" fk="perioexam">
      <summary>FK to perioexam.PerioExamNum. Indicates the perio exam this approval is for. 0 if not applicable.</summary>
    </column>
    <column order="8" name="AllergyNum" type="bigint(20)" fk="allergy">
      <summary>FK to allergy.AllergyNum. Indicates the allergy this approval is for. 0 if not applicable.</summary>
    </column>
    <column order="9" name="DiseaseNum" type="bigint(20)" fk="disease">
      <summary>FK to disease.DiseaseNum. Indicates the disease this approval is for. 0 if not applicable.</summary>
    </column>
    <column order="10" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum. Indicates the document this approval is for. 0 if not applicable.</summary>
    </column>
    <column order="11" name="MountNum" type="bigint(20)" fk="mount">
      <summary>FK to mount.MountNum. Indicates the mount this approval is for. 0 if not applicable.</summary>
    </column>
    <column order="12" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change. The actual date of entry.</summary>
    </column>
    <column order="13" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program updates. Not user editable with the UI.</summary>
    </column>
  </table>
  <table name="schoolclass">
    <summary>Used in dental schools.  eg. Dental 2009 or Hygiene 2007.</summary>
    <column order="0" name="SchoolClassNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="GradYear" type="int(11)">
      <summary>The year this class will graduate</summary>
    </column>
    <column order="2" name="Descript" type="varchar(255)">
      <summary>Description of this class. eg Dental or Hygiene</summary>
    </column>
  </table>
  <table name="schoolcourse">
    <summary>A scheduled course in dental schools. These are copied from SchoolCourseDef and are linked to a class cohort. Example: OP 732 Operative Dentistry Clinic II.Students are not linked individually to courses. Instead, it is assumed that all students from the specified class are in this course.</summary>
    <column order="0" name="SchoolCourseNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CourseID" type="varchar(255)">
      <summary>Alphanumeric. Example: PEDO 732.</summary>
    </column>
    <column order="2" name="Descript" type="varchar(255)">
      <summary>Full course name. Example: Pediatric Dentistry Clinic II</summary>
    </column>
    <column order="3" name="DateStart" type="date">
      <summary>Start date of the effective schedule. Required for default schedules</summary>
    </column>
    <column order="4" name="DateEnd" type="date">
      <summary>End date of the effective schedule. Required for default schedules.</summary>
    </column>
    <column order="5" name="SchoolClassNum" type="bigint(20)" fk="schoolclass">
      <summary>FK to schoolClass.SchoolClassNum. Indicates which class cohort this scheduled course is assigned to. Can be zero for older courses. Use SchoolCourseEnrollees to see the students registered for this course.</summary>
    </column>
    <column order="6" name="GradingScaleNum" type="bigint(20)" fk="gradingscale">
      <summary>FK to gradingscale.GradingScaleNum. Indicates the grading scale for this course. All associated EvaluationDefs must use the same grading scale.</summary>
    </column>
  </table>
  <table name="schoolcoursedef">
    <summary>A course definition used in dental schools. These predefined courses are added from the course directory and can be copied when scheduling actual courses for a class cohort. Example OP 732 Operative Dentistry Clinic II. Can be deleted without affecting scheduled SchoolCourse entries.</summary>
    <column order="0" name="SchoolCourseDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CourseID" type="varchar(255)">
      <summary>Alphanumeric. Example: PEDO 732.</summary>
    </column>
    <column order="2" name="Descript" type="varchar(255)">
      <summary>Full course name. Example: Pediatric Dentistry Clinic II</summary>
    </column>
    <column order="3" name="GradingScaleNum" type="bigint(20)" fk="gradingscale">
      <summary>FK to gradingscale.GradingScaleNum. Indicates the grading scale for this course. All associated EvaluationDefs must use the same grading scale.</summary>
    </column>
  </table>
  <table name="schoolcourseenrollee">
    <summary>Represents a student’s enrollment in a specific school course, including their current overall grade for the course.</summary>
    <column order="0" name="SchoolCourseEnrolleeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SchoolCourseNum" type="bigint(20)" fk="schoolcourse">
      <summary>FK to schoolcourse.SchoolCourseNum. Identifies the course in which the student is enrolled.</summary>
    </column>
    <column order="2" name="StudentNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. Identifies the student.</summary>
    </column>
    <column order="3" name="GradeNumber" type="float">
      <summary>-1 by default, indicating that no grade number is assigned when there are no corresponding evaluations. The student’s calculated overall grade for this course. Computed by averaging all evaluations for the course and student. This value is then used to determine the displayed grade. For pick list grading scales, the closest scale item is chosen. For percentage and weighted grading, the number itself is shown as a percentage. There is no weight yet for different evaluations, so the automatically calculated course grades will treat all evaluations with equal weight.</summary>
    </column>
    <column order="4" name="GradeOverride" type="float">
      <summary>-1 by default, indicating no grade override. An optional override grade manually entered by an instructor. If populated, this value takes precedence over GradeNumber for the overall grade for this course.</summary>
    </column>
  </table>
  <table name="schoolcourseinstructor">
    <summary>Links an instructor to a specific school course. A course can have multiple instructors, and an instructor can teach multiple courses.</summary>
    <column order="0" name="SchoolCourseInstructorNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SchoolCourseNum" type="bigint(20)" fk="schoolcourse">
      <summary>FK to schoolcourse.SchoolCourseNum. Identifies the course this instructor is assigned to.</summary>
    </column>
    <column order="2" name="InstructorNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum. Identifies the instructor assigned to this course.</summary>
    </column>
  </table>
  <table name="schoolcoursesched">
    <summary>Represents a single classroom session on a specific date and time for a school course's default schedule or a schedule override. Used for both SchoolCourse and SchoolCourseDef. Copied from def when creating course from def. For a typical course, there will be one row per scheduled day of the week, plus any override entries as needed.</summary>
    <column order="0" name="SchoolCourseSchedNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SchoolCourseDefNum" type="bigint(20)" fk="schoolcoursedef">
      <summary>FK to schoolcoursedef.SchoolCourseDefNum. Indicates the course definition that this schedule applies to. 0 if it's for a schoolcourse.</summary>
    </column>
    <column order="2" name="SchoolCourseNum" type="bigint(20)" fk="schoolcourse">
      <summary>FK to schoolcourse.SchoolCourseNum. Indicates the course that this schedule applies to. 0 if it's for a schoolcoursedef.</summary>
    </column>
    <column order="3" name="TimeStart" type="time">
      <summary>The time of day the course is scheduled to start. Only allowed to be Zero if this is an IsCanceled row.</summary>
    </column>
    <column order="4" name="TimeEnd" type="time">
      <summary>The time of day the course is scheduled to end. Only allowed to be Zero if this is an IsCanceled row.</summary>
    </column>
    <column order="5" name="DayOfTheWeek" type="tinyint(4)">
      <summary>The day of the week this schedule applies to. 0 is Sunday, 1 is Monday, up to 6 for Saturday. Ignored and not visible if override.</summary>
    </column>
    <column order="6" name="DateOverride" type="date">
      <summary>Date of the override. Used only for SchoolCourse, not SchoolCourseDef.</summary>
    </column>
    <column order="7" name="IsOverride" type="tinyint(4)">
      <summary>True if this entry represents an override to the default schedule. False if it's part of the default schedule. Not used for SchoolCourseDef. Multiple allowed per day.</summary>
    </column>
    <column order="8" name="IsCanceled" type="tinyint(4)">
      <summary>Only used for overrides. True if the course session is canceled on the override date.</summary>
    </column>
  </table>
  <table name="screen">
    <summary>Used in public health.  This screening table is meant to be general purpose.  It is compliant with the popular Basic Screening Survey.  It is also designed with minimal foreign keys and can be easily adapted to a tablet PC.  This table can be used with only the screengroup table, but is more efficient if provider, school, and county tables are also available.</summary>
    <column order="0" name="ScreenNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="Gender" type="tinyint">
      <summary>Enum:PatientGender </summary>
      <Enumeration name="PatientGender">
        <summary>Known as administrativeGender (HL7 OID of 2.16.840.1.113883.5.1) Male=M, Female=F, Unknown=Undifferentiated=UN.</summary>
        <EnumValue name="Male">0</EnumValue>
        <EnumValue name="Female">1</EnumValue>
        <EnumValue name="Unknown">2- Required by HIPAA for privacy.  Required by ehr to track missing entries. EHR/HL7 known as undifferentiated (UN).</EnumValue>
        <EnumValue name="Other">3</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="RaceOld" type="tinyint(4)">
      <summary>Enum:PatientRaceOld and ethnicity.</summary>
      <Enumeration name="PatientRaceOld">
        <summary>Deprecated, use patientrace table instead.  Temporarily used for converting old patient races to patientrace entries and screening.  Race and ethnicity for patient. Used by public health.  The problem is that everyone seems to want different choices.  If we give these choices their own table, then we also need to include mapping functions.  These are currently used in ArizonaReports, HL7 w ECW, EHR, and DrCeph bridge.  Foreign users would like their own mappings.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Multiracial">1</EnumValue>
        <EnumValue name="HispanicLatino">2</EnumValue>
        <EnumValue name="AfricanAmerican">3</EnumValue>
        <EnumValue name="White">4</EnumValue>
        <EnumValue name="HawaiiOrPacIsland">5</EnumValue>
        <EnumValue name="AmericanIndian">6</EnumValue>
        <EnumValue name="Asian">7</EnumValue>
        <EnumValue name="Other">8</EnumValue>
        <EnumValue name="Aboriginal">9</EnumValue>
        <EnumValue name="BlackHispanic">10 - Required by EHR.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="GradeLevel" type="tinyint(4)">
      <summary>Enum:PatientGrade </summary>
      <Enumeration name="PatientGrade">
        <summary>Grade level used in public health.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="First">1</EnumValue>
        <EnumValue name="Second">2</EnumValue>
        <EnumValue name="Third">3</EnumValue>
        <EnumValue name="Fourth">4</EnumValue>
        <EnumValue name="Fifth">5</EnumValue>
        <EnumValue name="Sixth">6</EnumValue>
        <EnumValue name="Seventh">7</EnumValue>
        <EnumValue name="Eighth">8</EnumValue>
        <EnumValue name="Ninth">9</EnumValue>
        <EnumValue name="Tenth">10</EnumValue>
        <EnumValue name="Eleventh">11</EnumValue>
        <EnumValue name="Twelfth">12</EnumValue>
        <EnumValue name="PrenatalWIC">13</EnumValue>
        <EnumValue name="PreK">14</EnumValue>
        <EnumValue name="Kindergarten">15</EnumValue>
        <EnumValue name="Other">16</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="Age" type="tinyint">
      <summary>Age of patient at the time the screening was done. Faster than recording birthdates.</summary>
    </column>
    <column order="5" name="Urgency" type="tinyint(4)">
      <summary>Enum:TreatmentUrgency</summary>
      <Enumeration name="TreatmentUrgency">
        <summary>For public health.  Unknown, NoProblems, NeedsCarE, or Urgent.</summary>
        <EnumValue name="Unknown"></EnumValue>
        <EnumValue name="NoProblems"></EnumValue>
        <EnumValue name="NeedsCare"></EnumValue>
        <EnumValue name="Urgent"></EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="HasCaries" type="tinyint">
      <summary>Enum:YN Set to true if patient has cavities.</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="NeedsSealants" type="tinyint">
      <summary>Enum:YN Set to true if patient needs sealants.</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="CariesExperience" type="tinyint">
      <summary>Enum:YN</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="EarlyChildCaries" type="tinyint">
      <summary>Enum:YN</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="ExistingSealants" type="tinyint">
      <summary>Enum:YN</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="11" name="MissingAllTeeth" type="tinyint">
      <summary>Enum:YN</summary>
      <Enumeration name="YN">
        <summary>0=Unknown,1=Yes, or 2=No. UI can be tricky. Some success with a 3x1 listbox, multicolumn, see FormPatientEdit. Radiobuttons are also an option.  You can also use another YN variable to store unknown, and then use a click event on the checkbox to change to Y or N.  You can also use a three state checkbox if you translate properly between the enums.</summary>
        <EnumValue name="Unknown">0</EnumValue>
        <EnumValue name="Yes">1</EnumValue>
        <EnumValue name="No">2</EnumValue>
      </Enumeration>
    </column>
    <column order="12" name="Birthdate" type="date">
      <summary>Optional</summary>
    </column>
    <column order="13" name="ScreenGroupNum" type="bigint(20)" fk="screengroup">
      <summary>FK to screengroup.ScreenGroupNum.</summary>
    </column>
    <column order="14" name="ScreenGroupOrder" type="smallint">
      <summary>The order of this item within its group.</summary>
    </column>
    <column order="15" name="Comments" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="16" name="ScreenPatNum" type="bigint(20)" fk="screenpat">
      <summary>FK to screenpat.ScreenPatNum.</summary>
    </column>
    <column order="17" name="SheetNum" type="bigint(20)" fk="sheet">
      <summary>FK to sheet.SheetNum</summary>
    </column>
  </table>
  <table name="screengroup">
    <summary>Used in public health.  The database table only has 3 columns.  There are 5 additional columns in C# that are not in the databae.  These extra columns are used in the UI to organize input, and are transferred to the screen table as needed.</summary>
    <column order="0" name="ScreenGroupNum" type="bigint(20)">
      <summary>Primary key</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Up to the user.</summary>
    </column>
    <column order="2" name="SGDate" type="date">
      <summary>The date of the screening.</summary>
    </column>
    <column order="3" name="ProvName" type="varchar(255)">
      <summary>Required.  Could be the name of the screener and not a provider necessarily.</summary>
    </column>
    <column order="4" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  ProvNAME is always entered, but ProvNum supplements it by letting user select from list.
            When entering a provNum, the name will be filled in automatically.
            Can be 0 if the provider is not in the list, but provName is required.</summary>
    </column>
    <column order="5" name="PlaceService" type="tinyint(4)">
      <summary>Enum:PlaceOfService Describes where the screening will take place.  Defaults to Zero(Office).</summary>
      <Enumeration name="PlaceOfService">
        <summary></summary>
        <EnumValue name="Office">0. Code 11</EnumValue>
        <EnumValue name="PatientsHome">1. Code 12</EnumValue>
        <EnumValue name="InpatHospital">2. Code 21</EnumValue>
        <EnumValue name="OutpatHospital">3. Code 22</EnumValue>
        <EnumValue name="SkilledNursFac">4. Code 31</EnumValue>
        <EnumValue name="CustodialCareFacility">5. Code 33.  In X12, a similar code AdultLivCareFac 35 is mentioned.</EnumValue>
        <EnumValue name="OtherLocation">6. Code 99.  We use 11 for office.</EnumValue>
        <EnumValue name="MobileUnit">7. Code 15</EnumValue>
        <EnumValue name="School">8. Code 03</EnumValue>
        <EnumValue name="MilitaryTreatFac">9. Code 26</EnumValue>
        <EnumValue name="FederalHealthCenter">10. Code 50</EnumValue>
        <EnumValue name="PublicHealthClinic">11. Code 71</EnumValue>
        <EnumValue name="RuralHealthClinic">12. Code 72</EnumValue>
        <EnumValue name="EmergencyRoomHospital">13. Code 23</EnumValue>
        <EnumValue name="AmbulatorySurgicalCenter">14. Code 24</EnumValue>
        <EnumValue name="TelehealthOutsideHome">15. Code 02.</EnumValue>
        <EnumValue name="TelehealthInHome">16. Code 10</EnumValue>
        <EnumValue name="OutreachSiteOrStreet">17. Code 27</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="County" type="varchar(255)" fk="county">
      <summary>FK to county.CountyName, although it will not crash if key absent.</summary>
    </column>
    <column order="7" name="GradeSchool" type="varchar(255)" fk="site">
      <summary>FK to site.Description, although it will not crash if key absent.</summary>
    </column>
    <column order="8" name="SheetDefNum" type="bigint(20)" fk="sheetdef">
      <summary>FK to sheetdef.SheetDefNum</summary>
    </column>
  </table>
  <table name="screenpat">
    <summary> This allows users to set up a list of students prior to actually going to the school.  It also serves to attach the exam sheet to the screening.</summary>
    <column order="0" name="ScreenPatNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="ScreenGroupNum" type="bigint(20)" fk="screengroup">
      <summary>FK to screengroup.ScreenGroupNum. Every screening is attached to a group (classroom)</summary>
    </column>
    <column order="3" name="SheetNum" type="bigint(20)">
      <summary>Was never used.  Was supposed to be FK to sheetdef.Sheet_DEF_Num, so not even named correctly.</summary>
    </column>
    <column order="4" name="PatScreenPerm" type="tinyint(4)">
      <summary>Enum:PatScreenPerm </summary>
      <Enumeration name="PatScreenPerm">
        <summary>Indicates if the patient does or does not have permission to do a screening.</summary>
        <EnumValue name="Unknown"></EnumValue>
        <EnumValue name="Allowed"></EnumValue>
        <EnumValue name="NoPermission"></EnumValue>
        <EnumValue name="Refused"></EnumValue>
        <EnumValue name="Absent"></EnumValue>
        <EnumValue name="Behavior"></EnumValue>
        <EnumValue name="Other"></EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="securitylog">
    <summary>Stores an ongoing record of database activity for security purposes.  User not allowed to edit.</summary>
    <column order="0" name="SecurityLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PermType" type="smallint(6)">
      <summary>Enum:EnumPermType</summary>
      <Enumeration name="EnumPermType">
        <summary>A hard-coded list of permissions which may be granted to usergroups.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="AppointmentsModule">1-No log entry.</EnumValue>
        <EnumValue name="FamilyModule">2-A Security Log entry is made each time that the Family module button is clicked, as well as each time that the selected patient is changed while within the Family module. If the preference AuditTrailVisitModuleShow is set to false then no entries are created.</EnumValue>
        <EnumValue name="AccountModule">3-Same behavior as FamilyModule.</EnumValue>
        <EnumValue name="TPModule">4-Same behavior as FamilyModule.</EnumValue>
        <EnumValue name="ChartModule">5-Same behavior as FamilyModule.</EnumValue>
        <EnumValue name="ImagingModule">6-Same behavior as FamilyModule.</EnumValue>
        <EnumValue name="ManageModule">7-No log entry.</EnumValue>
        <EnumValue name="Setup">8. Currently covers a wide variety of setup functions. </EnumValue>
        <EnumValue name="RxCreate">9</EnumValue>
        <EnumValue name="ProcComplEdit">10 - DEPRECATED - Uses date restrictions. Covers editing/deleting of Completed, EO, and EC procs. 
            Deleting procs of other statuses are covered by ProcDelete.
            </EnumValue>
        <EnumValue name="ChooseDatabase">11</EnumValue>
        <EnumValue name="Schedules">12</EnumValue>
        <EnumValue name="BlockoutEdit">13 - There are two kinds of blockouts: those flagged as NS(no sched) or DC(disable cut/copy/paste) and those with no flag. This permission handles the edit of blockouts with no flag. Logs an audit trail entry when a blockout is edited.  See BlockoutsFlagged permission for the other blockouts flagged as NS or DC. And see the other two blockout permissions for things other than edit.</EnumValue>
        <EnumValue name="ClaimSentEdit">14. Uses date restrictions.</EnumValue>
        <EnumValue name="PaymentCreate">15. Uses date restrictions.</EnumValue>
        <EnumValue name="PaymentEdit">16. Uses date restrictions.</EnumValue>
        <EnumValue name="AdjustmentCreate">17</EnumValue>
        <EnumValue name="AdjustmentEdit">18. Uses date restrictions.</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.  AppointmentDelete permission required in order to delete appointments.</EnumValue>
        <EnumValue name="Backup">28</EnumValue>
        <EnumValue name="TimecardsEditAll">29</EnumValue>
        <EnumValue name="DepositSlips">30</EnumValue>
        <EnumValue name="AccountingEdit">31. Uses date restrictions.</EnumValue>
        <EnumValue name="AccountingCreate">32. Uses date restrictions.</EnumValue>
        <EnumValue name="Accounting">33</EnumValue>
        <EnumValue name="AnesthesiaIntakeMeds">34</EnumValue>
        <EnumValue name="AnesthesiaControlMeds">35</EnumValue>
        <EnumValue name="InsPayCreate">36</EnumValue>
        <EnumValue name="InsPayEdit">37. Uses date restrictions. Edit Batch Insurance Payment.</EnumValue>
        <EnumValue name="TreatPlanEdit">38. Uses date restrictions.</EnumValue>
        <EnumValue name="ReportProdInc">39. DEPRECATED</EnumValue>
        <EnumValue name="TimecardDeleteEntry">40. Uses date restrictions.</EnumValue>
        <EnumValue name="EquipmentDelete">41. Uses date restrictions. All other equipment functions are covered by .Setup.</EnumValue>
        <EnumValue name="SheetEdit">42. Uses date restrictions. Also used in audit trail to log web form importing.</EnumValue>
        <EnumValue name="CommlogEdit">43. Uses date restrictions.</EnumValue>
        <EnumValue name="ImageDelete">44. Uses date restrictions. Allows deletion of images. SignedImageEdit permission is also needed to delete signed images.</EnumValue>
        <EnumValue name="PerioEdit">45. Uses date restrictions.</EnumValue>
        <EnumValue name="ProcEditShowFee">46. Shows the fee textbox in the proc edit window.</EnumValue>
        <EnumValue name="AdjustmentEditZero">47</EnumValue>
        <EnumValue name="EhrEmergencyAccess">48</EnumValue>
        <EnumValue name="ProcDelete">49. Uses date restrictions.  This only applies to non-completed procs.  Deletion of completed procs is covered by ProcCompleteStatusEdit.</EnumValue>
        <EnumValue name="EhrKeyAdd">50 - Only used at OD HQ.  No user interface.</EnumValue>
        <EnumValue name="ProviderEdit">51- Allows user to edit all providers. This is not fine-grained enough for extremely large organizations such as dental schools, so other permissions are being added as well.</EnumValue>
        <EnumValue name="EcwAppointmentRevise">52</EnumValue>
        <EnumValue name="ProcedureNoteFull">53</EnumValue>
        <EnumValue name="ReferralAdd">54</EnumValue>
        <EnumValue name="InsPlanChangeSubsc">55</EnumValue>
        <EnumValue name="RefAttachAdd">56</EnumValue>
        <EnumValue name="RefAttachDelete">57</EnumValue>
        <EnumValue name="CarrierCreate">58</EnumValue>
        <EnumValue name="GraphicalReports">59</EnumValue>
        <EnumValue name="AutoNoteQuickNoteEdit">60</EnumValue>
        <EnumValue name="EquipmentSetup">61</EnumValue>
        <EnumValue name="Billing">62</EnumValue>
        <EnumValue name="ProblemDefEdit">63</EnumValue>
        <EnumValue name="ProcFeeEdit">64- There is no user interface in the security window for this permission.  It is only used for tracking.</EnumValue>
        <EnumValue name="InsPlanChangeCarrierName">65- There is no user interface in the security window for this permission.  It is only used for tracking.  Only tracks changes to carriername, not any other carrier info.</EnumValue>
        <EnumValue name="TaskNoteEdit">66- (Was named TaskEdit prior to version 14.2.39) When editing an existing task: delete the task, edit original description, or double click on note rows.  Even if you don't have the permission, you can still edit your own task description (but not the notes) as long as it's in your inbox and as long as nobody but you has added any notes. </EnumValue>
        <EnumValue name="WikiListSetup">67- Add or delete lists and list columns..</EnumValue>
        <EnumValue name="Copy">68- There is no user interface in the security window for this permission.  It is only used for tracking.  Tracks copying of patient information.  Required by EHR.</EnumValue>
        <EnumValue name="Printing">69- There is no user interface in the security window for this permission.  It is only used for tracking.  Tracks printing of patient information.  Required by EHR.</EnumValue>
        <EnumValue name="MedicalInfoViewed">70- There is no user interface in the security window for this permission.  It is only used for tracking.  Tracks viewing of patient medical information.</EnumValue>
        <EnumValue name="PatProblemListEdit">71- Tracks creation and editing of patient problems.</EnumValue>
        <EnumValue name="PatMedicationListEdit">72- Tracks creation and edting of patient medications.</EnumValue>
        <EnumValue name="PatAllergyListEdit">73- Tracks creation and editing of patient allergies.</EnumValue>
        <EnumValue name="PatFamilyHealthEdit">74- There is no user interface in the security window for this permission.  It is only used for tracking.  Tracks creation and editing of patient family health history.</EnumValue>
        <EnumValue name="PatientPortal">75- There is no user interface in the security window for this permission.  It is only used for tracking.  Patient Portal access of patient information.  Required by EHR.</EnumValue>
        <EnumValue name="RxEdit">76</EnumValue>
        <EnumValue name="SchoolAdminStudentEdit">77- Assign this permission to a staff person who will administer setting up and editing Dental School Students in the system.</EnumValue>
        <EnumValue name="SchoolAdminInstructorEdit">78- Assign this permission to a staff person who will administer setting up and editing Dental School Instructors in the system.</EnumValue>
        <EnumValue name="OrthoChartEditFull">79- Uses date restrictions.  Has a unique audit trail so that users can track specific ortho chart edits.</EnumValue>
        <EnumValue name="PatientFieldEdit">80- There is no user interface in the security window for this permission.  It is only used for tracking.  Mainly used for ortho clinics.</EnumValue>
        <EnumValue name="SchoolAdminAcesss">81- Assign this permission to a staff member who needs full access to instructor and student records. Grants the ability to view anything they can view and perform any action on their behalf.</EnumValue>
        <EnumValue name="TreatPlanDiscountEdit">82- There is no user interface in the security window for this permission.  It is only used for tracking.</EnumValue>
        <EnumValue name="UserLogOnOff">83- There is no user interface in the security window for this permission.  It is only used for tracking.</EnumValue>
        <EnumValue name="TaskEdit">84- Allows user to edit other users' tasks.</EnumValue>
        <EnumValue name="EmailSend">85- Allows user to send unsecured email</EnumValue>
        <EnumValue name="WebMailSend">86- Allows user to send webmail</EnumValue>
        <EnumValue name="UserQueryAdmin">87- Allows user to run, edit, and write non-released queries.</EnumValue>
        <EnumValue name="InsPlanChangeAssign">88- Security permission for assignment of benefits.</EnumValue>
        <EnumValue name="ImageEdit">89- Uses date restrictions. Allows user to flip, rotate, resize, and crop image. Also allows editing of details on the "Item Info" window. SignedImageEdit permission is also needed to edit signed images.</EnumValue>
        <EnumValue name="EhrMeasureEventEdit">90- Allows editing of all measure events.  Also used to track changes made to events.</EnumValue>
        <EnumValue name="EServicesSetup">91- Allows users to edit settings in the eServices Setup window.  Also causes the Listener Service monitor thread to start upon logging in.</EnumValue>
        <EnumValue name="FeeSchedEdit">92- Allows users to edit Fee Schedules throughout the program.  Logs editing of fee schedule properties.</EnumValue>
        <EnumValue name="ProviderFeeEdit">93- Allows user to edit and delete provider specific fees overrides.</EnumValue>
        <EnumValue name="PatientMerge">94- Allows user to merge patients.</EnumValue>
        <EnumValue name="ClaimHistoryEdit">95- Only used in Claim History Status Edit</EnumValue>
        <EnumValue name="AppointmentCompleteEdit">96- Allows user to edit a completed appointment. AppointmentCompleteDelete permission required in order to delete completed appointments.</EnumValue>
        <EnumValue name="WebMailDelete">97- Audit trail for deleting webmail messages.  There is no user interface in the security window for this permission.</EnumValue>
        <EnumValue name="RequiredFields">98- Audit trail for saving a patient with required fields missing.  There is no user interface in the security window for this 
            permission.</EnumValue>
        <EnumValue name="ReferralMerge">99- Allows user to merge referrals.</EnumValue>
        <EnumValue name="ProcEdit">100- There is no user interface in the security window for this permission.  It is only used for tracking.
            Currently only used for tracking automatically changing the IsCpoe flag on procedures.  Can be enhanced to do more in the future.
            There is only one place where we could have automatically changed IsCpoe without a corresponding log of a different permission.
            That place is in the OnClosing of the Procedure Edit window.  We update this flag even when the user Cancels out of it.</EnumValue>
        <EnumValue name="ProviderMerge">101- Allows user to use the provider merge tool.</EnumValue>
        <EnumValue name="MedicationMerge">102- Allows user to use the medication merge tool.</EnumValue>
        <EnumValue name="AccountProcsQuickAdd">103- Allow users to use the Quick Add tool in the Account module.</EnumValue>
        <EnumValue name="ClaimSend">104- Allow users to send claims.</EnumValue>
        <EnumValue name="TaskListCreate">105- Allow users to create new task lists.</EnumValue>
        <EnumValue name="PatientCreate">106 - Audit when a new patient is added.</EnumValue>
        <EnumValue name="GraphicalReportSetup">107- Allows changing the settings for graphical repots.</EnumValue>
        <EnumValue name="PatientEdit">108 - Audit when a patient is edited and restrict editing patients.</EnumValue>
        <EnumValue name="InsPlanCreate">109 - Audit when an insurance plan is created.  Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanEdit">110 - Audit when an insurance plan is edited.  Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanCreateSub">111 - InsSub Created. Currently only used in X12 834 insurance plan import and in API.</EnumValue>
        <EnumValue name="InsPlanEditSub">112 - Audit when an insurance subscriber is edited. Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanAddPat">113 - Audit when a patient is added to an insurance plan.  Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanDropPat">114 - Audit when a patient is dropped from an insurance plan. Currently only used in X12 834 insurance plan import.</EnumValue>
        <EnumValue name="InsPlanVerifyList">115 - Allows users to be assigned Insurance Verifications.</EnumValue>
        <EnumValue name="SplitCreatePastLockDate">116 - Allows users to bypass the global lock date to add paysplits.</EnumValue>
        <EnumValue name="ProcComplEditLimited">117 - DEPRECATED - Uses date restrictions.  Covers editing some fields of completed procs. </EnumValue>
        <EnumValue name="ClaimDelete">118 - Uses date restrictions based on the SecDateEntry field as the claim date.  Covers deleting a claim of any status
            (Sent, Waiting to Send, Received, etc).</EnumValue>
        <EnumValue name="InsWriteOffEdit">119 - Covers editing the Write-off and Write-off Override fields for claimprocs. Prevents the user from creating a claimproc to prevent subversion of an existing write-off. Prevents the user from deleting a claimproc as well, since otherwise deleting one outside the date range and creating a new one would subvert the date/days restriction.
            Uses date/days restriction based on the attached proc.DateEntryC; unless it's a total payment, then uses claimproc.SecDateEntry.Applies to all plan types (i.e. PPO, Category%, Capitation, etc).</EnumValue>
        <EnumValue name="ApptConfirmStatusEdit">120 - Allows users to change appointment confirmation status.</EnumValue>
        <EnumValue name="GraphicsRemoteEdit">121 - Audit trail for when users change graphical settings for another workstation in FormGraphics.cs.</EnumValue>
        <EnumValue name="AuditTrail">122 - Audit Trail (Separated from SecurityAdmin permission)</EnumValue>
        <EnumValue name="TreatPlanPresenterEdit">123 - Allows the user to change the presenter on a treatment plan.</EnumValue>
        <EnumValue name="ProviderAlphabetize">124 - Allows users to use the Alphabetize Provider button from FormProviderSetup to permanently re-order providers.</EnumValue>
        <EnumValue name="ClaimProcReceivedEdit">125 - Allows editing of claimprocs that are marked as received status.</EnumValue>
        <EnumValue name="StatementPatNumMismatch">126 - Used to diagnose an error in statement creation. Audit Trail Permission Only</EnumValue>
        <EnumValue name="MobileWeb">127 - User has access to ODTouch.</EnumValue>
        <EnumValue name="PatPlanCreate">128 - For logging purposes only.  Used when PatPlans are created and not otherwise logged.</EnumValue>
        <EnumValue name="PatPriProvEdit">129 - Allows the user to change a patient's primary provider, with audit trail logging.</EnumValue>
        <EnumValue name="ReferralEdit">130</EnumValue>
        <EnumValue name="PatientBillingEdit">131 - Allows users to change a patient's billing type.</EnumValue>
        <EnumValue name="ReportProdIncAllProviders">132 - Allows viewing annual prod inc of all providers instead of just a single provider.</EnumValue>
        <EnumValue name="ReportDaily">133 - Allows running daily reports. DEPRECATED.</EnumValue>
        <EnumValue name="ReportDailyAllProviders">134 - Allows viewing daily prod inc of all providers instead of just a single provider</EnumValue>
        <EnumValue name="PatientApptRestrict">135 - Allows user to change the appointment schedule flag.</EnumValue>
        <EnumValue name="SheetDelete">136 - Allows deleting sheets when they're associated to patients.</EnumValue>
        <EnumValue name="UpdateCustomTracking">137 - Allows updating custom tracking on claims.</EnumValue>
        <EnumValue name="GraphicsEdit">138 - Allows people to set graphics option for the workstation and other computers.</EnumValue>
        <EnumValue name="InsPlanOrthoEdit">139 - Allows user to change the fields within the Ortho tab of the Ins Plan Edit window.</EnumValue>
        <EnumValue name="ClaimProcClaimAttachedProvEdit">140 - Allows user to change the provider on claimproc when claimproc is attached to a claim.</EnumValue>
        <EnumValue name="InsPlanMerge">141 - Audit when insurance plans are merged.</EnumValue>
        <EnumValue name="InsCarrierCombine">142 - Allows user to combine carriers.</EnumValue>
        <EnumValue name="PopupEdit">143 - Allows user to edit popups. A user without this permission will still be able to edit their own popups.</EnumValue>
        <EnumValue name="InsPlanPickListExisting">144 - Allows user to select new insplan from list prior to dropping current insplan associated with a patplan.</EnumValue>
        <EnumValue name="OrthoChartEditUser">145 - Allows user to edit their own signed ortho charts even if they don't have full permission.</EnumValue>
        <EnumValue name="ProcedureNoteUser">146 - Allows user to edit procedure notes that they created themselves if they don't have full permission.</EnumValue>
        <EnumValue name="GroupNoteEditSigned">147 - Allows user to edit group notes signed by other users. If a user does not have this permission, they can still edit group notes
            that they themselves have signed.</EnumValue>
        <EnumValue name="WikiAdmin">148 - Allows user to lock and unlock wiki pages.  Also allows the user to edit locked wiki pages.</EnumValue>
        <EnumValue name="PayPlanEdit">149 - Allows user to create, edit, close, and delete payment plans.</EnumValue>
        <EnumValue name="ClaimEdit">150 - Used for logging when a claim is created, cancelled, or saved. </EnumValue>
        <EnumValue name="CommandQuery">151- Allows user to run command queries. Command queries are any non-SELECT queries for any non-temporary table.</EnumValue>
        <EnumValue name="ReplicationSetup">152 - Gives user access to the replication setup window.</EnumValue>
        <EnumValue name="PreAuthSentEdit">153 - Allows user to edit and delete sent and received pre-auths. Uses date restriction.</EnumValue>
        <EnumValue name="LogFeeEdit">154 - Edit fees (for logging only). Security log entry for this points to feeNum instead of CodeNum. </EnumValue>
        <EnumValue name="LogSubscriberEdit">155 - Log ClaimProcEdit</EnumValue>
        <EnumValue name="RecallEdit">156 - Logs changes to recalls, recalltypes, and recaltriggers.</EnumValue>
        <EnumValue name="ProcCodeEdit">157 - Allows users with this permission the ability to edit procedure codes.  Users with the Setup permission have this by default.
            Logs changes made to individual proc codes (excluding fee changes) including when run from proc code tools.</EnumValue>
        <EnumValue name="AddNewUser">158 - Allows users with this permission the ability to add new users. Security admins have this by default.</EnumValue>
        <EnumValue name="ClaimView">159 - Allows users with this permission the ability to view claims.</EnumValue>
        <EnumValue name="RepeatChargeTool">160 - Allows users to run the Repeat Charge Tool.</EnumValue>
        <EnumValue name="DiscountPlanAddDrop">161 - Logs when a discount plan is added or dropped from a patient.</EnumValue>
        <EnumValue name="TreatPlanSign">162 - Allows users with this permission the ability to sign treatment plans.</EnumValue>
        <EnumValue name="ProcExistingEdit">163 - Allows users with this permission to edit an existing EO or EC procedure.</EnumValue>
        <EnumValue name="UnrestrictedSearch">164 - Allows users to search for patients in all clinics even when they are restricted to clinics.
            Also allows user to reassign patient clinic.</EnumValue>
        <EnumValue name="ArchivedPatientEdit">165 - Allows users to edit patient information for archived patients. This really only stops editing inside Patient Edit window. Also see ArchivedPatientSelect. Blocking user from patient selection prevents changes to all the other tables.</EnumValue>
        <EnumValue name="CommlogPersistent">166 - HQ only. Must access from dropdown menu next to commlog button. Only for new commlog. Originally, this was written to allow commlogs to reuse a single persistent non-modal window. In about 2023, we accidentally introduced a bug that made it not reuse the original window. So now, it's multiple non-modal windows. We like the change, so we're keeping it.</EnumValue>
        <EnumValue name="VerifyPhoneOwnership">167 - Logs when a phone number has had its ownership verified. For OD HQ only.</EnumValue>
        <EnumValue name="SalesTaxAdjEdit">168 - HQ only. Allows users to make changes to Sales Tax type adjustments.</EnumValue>
        <EnumValue name="InsuranceVerification">169 - Allows user to set last verified dates for insurance benefits. Also allows access to FormInsVerificationList.</EnumValue>
        <EnumValue name="CreditCardMove">170 - Logs when a credit card is moved from one patient to another.  Makes a log for both patients.  Audit Trail Permission Only.</EnumValue>
        <EnumValue name="AgingRan">171 - Logs when aging is being ran and from where.</EnumValue>
        <EnumValue name="HeadmasterSetup">172 - HQ only. Allows user to add, edit, and delete Headmaster services and devices.</EnumValue>
        <EnumValue name="DashboardWidget">173 - Allows user to view a specific Dashboard Widget.</EnumValue>
        <EnumValue name="NewClaimsProcNotBilled">174 - Prevent users from creating bulk claims from the Procs Not Billed Report if past the lock date.</EnumValue>
        <EnumValue name="PatientPortalLogin">175 - Logging into patient portal. Used for audit trail only.</EnumValue>
        <EnumValue name="FAQEdit">176 - Allows user to create and edit FAQ objects shown by the help button(?).</EnumValue>
        <EnumValue name="FeatureRequestEdit">177 - HQ only. Alows user to edit feature request.</EnumValue>
        <EnumValue name="TaskReminderPopup">178- Logs when a reminder task is popped up.  Used for audit trail only.</EnumValue>
        <EnumValue name="SupplementalBackup">179 - Logs when changes are made to supplemental backup settings inside the FormBackup window.</EnumValue>
        <EnumValue name="WebSchedRecallManualSend">180 - Logs when a user sends a Web Sched Recall through the Recall List. Used for audit trail only</EnumValue>
        <EnumValue name="PatientSSNView">181 - Allows the user to unmask patient SSN for temporary viewing.  Logs any unmasks in the audit trail</EnumValue>
        <EnumValue name="PatientDOBView">182 - Allows the user to unmask patient DOB for temporary viewing.  Logs any unmasks in the audit trail</EnumValue>
        <EnumValue name="FamAgingTruncate">183 - Logs when the family aging table has been truncated. For audit trails only.</EnumValue>
        <EnumValue name="DiscountPlanMerge">184 - Logs when discount plans are merged. For audit trails only.</EnumValue>
        <EnumValue name="ProcCompleteStatusEdit">185 - Uses date restrictions.  Allows user to change status of a completed procedure, or delete compeleted procedure</EnumValue>
        <EnumValue name="ProcCompleteAddAdj">186 - Allows user to add an adjustment to a procedure (date locked)</EnumValue>
        <EnumValue name="ProcCompleteEditMisc">187 - Misc Edit that includes "Do Not Bill Ins" and "Hide Graphics" (date locked)</EnumValue>
        <EnumValue name="ProcCompleteNote">188 - Edit the note of a completed procedure</EnumValue>
        <EnumValue name="ProcCompleteEdit">189 - Edit main information of a procedure that is not already covered by the other permissions. Is not all inclusive.</EnumValue>
        <EnumValue name="ProtectedLeaveAdjustmentEdit">190 - User can create, edit, and delete time card adjustments for protected leave on their time card of the current pay period. Users that also have the Edit All Time Cards permission, have this permission for all time cards.</EnumValue>
        <EnumValue name="TimeAdjustEdit">191 - Logs when a time card adjustment is created, edited, or deleted.</EnumValue>
        <EnumValue name="QueryMonitor">192 - Permission for users to monitor queries</EnumValue>
        <EnumValue name="CommlogCreate">193 - Permission for users to create commlogs.</EnumValue>
        <EnumValue name="WebFormAccess">194 - Permission for users to modify and discard webforms</EnumValue>
        <EnumValue name="CloseOtherSessions">195 - Close other sessions of Open Dental Cloud</EnumValue>
        <EnumValue name="RepeatChargeCreate">196 - Permission for Repeating Charge creation.</EnumValue>
        <EnumValue name="RepeatChargeUpdate">197 - Permission for Repeating Charge update.</EnumValue>
        <EnumValue name="RepeatChargeDelete">198 - Permission for Repeating Charge deletion.</EnumValue>
        <EnumValue name="Zoom">199 - User can open the zoom window and edit zoom level. Used to block remote application users who all share the same computer.</EnumValue>
        <EnumValue name="FormAdded">200 - Permission for forms added to eclipboard mobile check in.</EnumValue>
        <EnumValue name="ImageExport">201. Uses date restrictions.</EnumValue>
        <EnumValue name="ImageCreate">202. Permission to Scan, Import, and Create Images.</EnumValue>
        <EnumValue name="CertificationEmployee">203 - Permission to update Employee Certifications.</EnumValue>
        <EnumValue name="CertificationSetup">204 - Permission to set up Certifications.</EnumValue>
        <EnumValue name="EmployerCreate">205 - Permission to create Employers.</EnumValue>
        <EnumValue name="AllowLoginFromAnyLocation">206 - Permission to allow users to login to ODCloud from any IP Address.</EnumValue>
        <EnumValue name="LogDoseSpotMedicationNoteEdit">207 - Logging only. Creates an entry if a medicationpat.PatNote needs to be truncated before sending to DoseSpot.</EnumValue>
        <EnumValue name="PayPlanChargeDateEdit">208 - Allows user to edit a payment plan charge date that has an APR.</EnumValue>
        <EnumValue name="DiscountPlanAdd">209 - Logs when discount plans are added. For audit trails only.</EnumValue>
        <EnumValue name="DiscountPlanEdit">210 - Logs when discount plans are edited. For audit trails only.</EnumValue>
        <EnumValue name="AllowFeeEditWhileReceivingClaim">211 - Permission to allow users without FeeSchedEdit permission to update fee schedule while receiving claims.</EnumValue>
        <EnumValue name="ManageHighSecurityProgProperties">212 - Permission for managing high security program properties.</EnumValue>
        <EnumValue name="CreditCardEdit">213 - Logs when a patient's credit card is edited.</EnumValue>
        <EnumValue name="MedicationDefEdit">214 - Allows user to edit medication definitions.</EnumValue>
        <EnumValue name="AllergyDefEdit">215 - Allows user to edit allergy definitions.</EnumValue>
        <EnumValue name="Advertising">216 - Allows user to setup and use Advertising features like Postcards.</EnumValue>
        <EnumValue name="TextMessageView">217 - Allows user to view text messages.</EnumValue>
        <EnumValue name="TextMessageSend">218 - Allows uer to send text messages.</EnumValue>
        <EnumValue name="RxMerge">219 - Allows user to merge prescriptions.</EnumValue>
        <EnumValue name="DefEdit">220 - Allows user to add or update Definitions.</EnumValue>
        <EnumValue name="UpdateInstall">221 - Allows user to install Open Dental updates.</EnumValue>
        <EnumValue name="AdjustmentTypeDeny">222 - Denies users access to specific adjustment types. Special type of permission where having this permission actually 
            denies users access. If a usergroup has an entry for this permission, then they do not have access to the adjustment type with the defnum
            that is stored in grouppermission.FKey. Pattern approved by Jordan.</EnumValue>
        <EnumValue name="StatementCSV">223 - Allows user to export statements as CSV files.</EnumValue>
        <EnumValue name="CarrierEdit">224 - Allows users to edit carriers.</EnumValue>
        <EnumValue name="ApiSubscription">225 - Logs when API subscriptions are added or deleted. For audit trails only.</EnumValue>
        <EnumValue name="SecurityGlobal">226 - Logs changes to global lock date. For audit trails only.</EnumValue>
        <EnumValue name="TaskDelete">228 - Allows user to delete tasks.</EnumValue>
        <EnumValue name="SetupWizard">229 - Allows user to use setup wizard.</EnumValue>
        <EnumValue name="ShowFeatures">230 - Allows user to use show features.</EnumValue>
        <EnumValue name="PrinterSetup">231 - Allows user to setup printer.</EnumValue>
        <EnumValue name="ProviderAdd">232 - Allows user to add provider.</EnumValue>
        <EnumValue name="ClinicEdit">233 - Allows user to edit clinic.</EnumValue>
        <EnumValue name="ApiAccountEdit">234 - Allows the editing of customer accounts for the ODApi via the BCM.</EnumValue>
        <EnumValue name="RegistrationKeyCreate">235 - Logs when registration keys are created. For audit trails only.</EnumValue>
        <EnumValue name="RegistrationKeyEdit">236 - Logs when registration keys are edited. For audit trails only.</EnumValue>
        <EnumValue name="AppointmentDelete">237 - Allows user to delete appointments.</EnumValue>
        <EnumValue name="AppointmentCompleteDelete">238 - Allows user to delete completed appointments.</EnumValue>
        <EnumValue name="AppointmentTypeEdit">239 - Logs when Appointment Types are edited. For audit trails only.</EnumValue>
        <EnumValue name="TextingAccountEdit">240 - Only used at OD HQ. Allows users to make high level changes in regards to texting.</EnumValue>
        <EnumValue name="WebChatEdit">241 - Logs when web chat sessions are edited. For audit trails only.</EnumValue>
        <EnumValue name="SupplierEdit">242 - Allows users to access FormSuppliers</EnumValue>
        <EnumValue name="SupplyPurchases">243 - Logs when any supply purchases are created, placed, or deleted.</EnumValue>
        <EnumValue name="PreferenceEditBroadcastMonitor">244 - Only used at OD HQ. Ability to edit table rows via Broadcast Monitor. </EnumValue>
        <EnumValue name="AppointmentResize">245 - Allows users to resize appointments.</EnumValue>
        <EnumValue name="CreditCardTerminal">246 - Logs when a user pays with a credit card. For Audit Trails only.</EnumValue>
        <EnumValue name="ViewAppointmentAuditTrail">247 - Only for viewing the audit trail in FormEditAppointment</EnumValue>
        <EnumValue name="PayPlanChargeEdit">248 - Logs when a user edits a payment plan charge.</EnumValue>
        <EnumValue name="ArchivedPatientSelect">249 - Also see ArchivedPatientEdit. Blocking user from patient selection prevents changes to all the other tables besides the patient table.  It's more rigorous.</EnumValue>
        <EnumValue name="CloudCustomerEdit">250 - Only used at OD HQ. Ability to edit Cloud tab info via Broadcast Monitor.</EnumValue>
        <EnumValue name="ChanSpy">251 - Only used at OD HQ. Ability to listen to live calls.</EnumValue>
        <EnumValue name="ClaimProcFieldsBilledToInsEdit">252 - Ability to edit Fee Billed to Insurance or Code Sent to Insurance in FormClaimProc, whether new or existing.</EnumValue>
        <EnumValue name="AllergyMerge">253 - Allow users to merge allergies.</EnumValue>
        <EnumValue name="AiChatSession">254 - Only used at OD HQ. Ability to open the AI chat window.</EnumValue>
        <EnumValue name="BadgeIdEdit">255 - Allow users to edit BadgeIds in the userod table.</EnumValue>
        <EnumValue name="ChildDaycareEdit">256 - Internal Child Daycare only. Allow users to make changes to the daycare. Only used at HQ.</EnumValue>
        <EnumValue name="PerioEditCopy">257 - Allow users to copy perio charts in the Perio Chart window.</EnumValue>
        <EnumValue name="LicenseAccept">258 - For audit trail only. Logs when a license is accepted by a user.</EnumValue>
        <EnumValue name="EFormEdit">259 - Uses date restrictions but no global lock date. Also used in audit trail to log importing.</EnumValue>
        <EnumValue name="EFormDelete">260 - Allows deleting eForms when they're attached to patients. No date restrictions.</EnumValue>
        <EnumValue name="MobileNotification">261 - Used for logging only. Can be used to log whenever mobile notifications are inserted into the database.</EnumValue>
        <EnumValue name="ChartViewsEdit">262 - Allows users to move chart views up and down, and add new chart views</EnumValue>
        <EnumValue name="SuperFamilyDisband">263 - Allows disbanding of Super Families.</EnumValue>
        <EnumValue name="ImageSignatureCreate">264 - Allows creation of note and signature for images without a signature.</EnumValue>
        <EnumValue name="SignedImageEdit">265 - Allows editing and deletion of note and signature for images with a signature. Allows users with the ImageEdit permission to edit signed images. Allows users with the ImageDelete permission to delete signed images.</EnumValue>
        <EnumValue name="BlockoutsFlagged">266 - There are two kinds of blockouts: those flagged as NS(no sched) or DC(disable cut/copy/paste) and those with no flag. This permission handles all the flagged blockouts, including add, edit, copy/paste, and delete. Logs an audit trail entry when a flagged blockout is added, edited, deleted, cut, copied, pasted, or cleared. See Blockouts permission for the other unflagged blockouts.</EnumValue>
        <EnumValue name="PayPlanUnlock">267 - Payment plans have a 'Locked' checkbox. This permission allows the user to uncheck that box which will unlock the payment plan. Users without this permission will not be able to unlock a payment plan.</EnumValue>
        <EnumValue name="SendAlertsFromHQ">268 - Allows sending notifications from HQ to customers. Only used at HQ.</EnumValue>
        <EnumValue name="TextAllEmployees">269 - Only used at OD HQ. Ability to send mass texts to all current employees.</EnumValue>
        <EnumValue name="ProcTPEditFee">270 - Allows editing the fee of a treatment planned procedure.</EnumValue>
        <EnumValue name="EFormImport">271 - Only used to make log entries.</EnumValue>
        <EnumValue name="BlockoutAdd">272 - This permission handles adding, pasting, and copying blockouts with no flag.</EnumValue>
        <EnumValue name="BlockoutDelete">273 - This permission handles deleting, cutting, and clearing blockouts with no flag.</EnumValue>
        <EnumValue name="PhoneExtension">274 - Only used at HQ to make audit trail entries when a change is made to a row in the Phone table.</EnumValue>
        <EnumValue name="PatientSelected">275 - Audit when a patient has been selected.</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum</summary>
    </column>
    <column order="3" name="LogDateTime" type="datetime">
      <summary>The date and time of the entry.  It's value is set when inserting and can never change.  Even if a user changes the date on their computer, this remains accurate because it uses server time.</summary>
    </column>
    <column order="4" name="LogText" type="text">
      <summary>The description of exactly what was done. Varies by permission type.</summary>
    </column>
    <column order="5" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Can be 0 if not applicable.</summary>
    </column>
    <column order="6" name="CompName" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="7" name="FKey" type="bigint(20)">
      <summary>A foreign key to a table associated with the PermType.  0 indicates not in use.  
            This is typically used for objects that have specific audit trails so that users can see all audit entries related to a particular object.  
            Every permission using FKey should be included and implmented in the CrudAuditPerms enum so that securitylog FKeys are note orphaned.
            Additonaly, the tabletype will to have the [CrudTable(CrudAuditPerms=CrudAuditPerm._____] added with the new CrudAuditPerm you created.
            For the patient portal, it is used to indicate logs created on behalf of other patients.  
            It's uses include:  AptNum with PermType AppointmentCreate, AppointmentEdit, or AppointmentMove tracks all appointment logs for a particular 
            appointment.
            CodeNum with PermType ProcFeeEdit currently only tracks fee changes.  
            PatNum with PermType PatientPortal represents an entry that a patient made on behalf of another patient.
            	The PatNum column will represent the patient who is taking the action.  
            PlanNum with PermType InsPlanChangeCarrierName tracks carrier name changes.</summary>
    </column>
    <column order="8" name="LogSource" type="tinyint(4)">
      <summary>Enum:LogSources None, WebSched, InsPlanImport834, FHIR, PatientPortal.</summary>
      <Enumeration name="LogSources">
        <summary>Known entities that create security logs.</summary>
        <EnumValue name="None">0 - Open Dental and unknown entities.</EnumValue>
        <EnumValue name="WebSched">1 - GWT Web Sched application Recall version.</EnumValue>
        <EnumValue name="InsPlanImport834">2 - X12 834 Insurance Plan Import from the Manage Module.</EnumValue>
        <EnumValue name="HL7">3 - HL7 is an automated process which the user may not be aware of.</EnumValue>
        <EnumValue name="DBM">4 - Database maintenance.  This process creates patients which are known to be missing,
            but the user may not be aware that the fix involves patient recreation.</EnumValue>
        <EnumValue name="FHIR">5 - FHIR is an automated process which the user may not be aware of.</EnumValue>
        <EnumValue name="PatientPortal">6 - Patient Portal application.</EnumValue>
        <EnumValue name="WebSchedNewPatAppt">7 - GWT Web Sched application New Patient Appointment version</EnumValue>
        <EnumValue name="AutoConfirmations">8 - Automated eConfirmation and eReminders</EnumValue>
        <EnumValue name="Diagnostic">9 - Open Dental messages created for debugging and diagnostic purposes. 
            For example, to diagnose an unhandled exception or unexpected behavior that is otherwise too hard to diagnose.</EnumValue>
        <EnumValue name="MobileWeb">10 - Mobile Web application.</EnumValue>
        <EnumValue name="CanadaEobAutoImport">11 - When retrieving reports in the background of FormOpenDental</EnumValue>
        <EnumValue name="WebSchedASAP">12 - Web Sched application for moving ASAP appointments.</EnumValue>
        <EnumValue name="OpenDentalService">13 - OpenDentalService.</EnumValue>
        <EnumValue name="BroadcastMonitor">14 - Broadcast Monitor.</EnumValue>
        <EnumValue name="AutoLogOff">15 - Automatic log off from main form.
            Used to track when auto log off needs to kill the program to force close open forms which are blocked or slow to respond.</EnumValue>
        <EnumValue name="ODMobile">16 - ODMobile App.</EnumValue>
        <EnumValue name="TextMessaging">17 - Open Dental text messaging.</EnumValue>
        <EnumValue name="CareCredit">18 - CareCredit.</EnumValue>
        <EnumValue name="WebSchedExistingPatient">19 - GWT Web Sched application Existing Patient Appointmention version</EnumValue>
        <EnumValue name="eRx">20 - eRx</EnumValue>
        <EnumValue name="SignupPortal">21 - SignupPortal</EnumValue>
        <EnumValue name="EmployerImport834">22 - X12 834 Employer Import from the Manage Module.</EnumValue>
        <EnumValue name="API">23 - The non-FHIR API.</EnumValue>
        <EnumValue name="ClaimReceiveAutomatic">24 - Indicates that a claim was automatically received.</EnumValue>
        <EnumValue name="PaymentPortal">25 - Indicates that a payment was made from the Payment Portal.</EnumValue>
        <EnumValue name="Era835Import">26 - X12 835 ERA automatic import.</EnumValue>
        <EnumValue name="ODTouch">27 - ODTouch mobile application.</EnumValue>
        <EnumValue name="eClipboard">28 - eClipboard mobile application.</EnumValue>
      </Enumeration>
    </column>
    <column order="9" name="DefNum" type="bigint(20)">
      <summary>Not used.</summary>
    </column>
    <column order="10" name="DefNumError" type="bigint(20)">
      <summary>Not used.</summary>
    </column>
    <column order="11" name="DateTPrevious" type="datetime">
      <summary>Used to store the previous DateTStamp or SecDateTEdit of the object FKey refers to.</summary>
    </column>
  </table>
  <table name="securityloghash">
    <summary>Stores hashes of audit logs for detecting alteration.  User not allowed to edit.</summary>
    <column order="0" name="SecurityLogHashNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SecurityLogNum" type="bigint(20)" fk="securitylog">
      <summary>FK to securityLog.SecurityLogNum.</summary>
    </column>
    <column order="2" name="LogHash" type="varchar(255)">
      <summary>The SHA-256 hash of PermType, UserNum, LogDateTime, LogText, and PatNum, all concatenated together.  This hash has length of 32 bytes encoded as base64.  Used to detect if the entry has been altered outside of Open Dental.</summary>
    </column>
  </table>
  <table name="sequencecounter">
    <summary>This table is used when you need the "last" of some other table row. We can't use a datetime column to get the "last" one because those are only accurate to one second. This means you would need to choose between sometimes missing an entry (a boundary gap) and always getting duplicates that you would need to track and deduplicate on the client end. Most db engineers use the PK to solve this problem, but since we allow random PKs, this also won't work. This table is the solution. It has only one row for each other table where you are trying to solve this problem.  Document in this file each time you add a row.</summary>
    <column order="0" name="CounterNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CounterName" type="varchar(255)">
      <summary>This must be unique, typically just the name of the table you are using it for. Example: chatmsg.</summary>
    </column>
    <column order="2" name="CounterVal" type="bigint(20)">
      <summary>Just the number of the last item in the other table. </summary>
    </column>
  </table>
  <table name="sessiontoken">
    <summary>Stores the session token for when a user has logged into something.</summary>
    <column order="0" name="SessionTokenNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SessionTokenHash" type="varchar(255)">
      <summary>The hash of the token. Hashed using SHA3_512 without a salt.</summary>
    </column>
    <column order="2" name="Expiration" type="datetime">
      <summary>The datetime when this token will expire.</summary>
    </column>
    <column order="3" name="TokenType" type="tinyint(4)">
      <summary>Enum:SessionTokenType The type of token this is.</summary>
      <Enumeration name="SessionTokenType">
        <summary></summary>
        <EnumValue name="Undefined">0 - Should not be used in the database.</EnumValue>
        <EnumValue name="PatientPortal">1 - The patient has logged in with a username and password.</EnumValue>
        <EnumValue name="MobileWeb">2 - The OD user has logged in with a username and password.</EnumValue>
        <EnumValue name="ODHQ">3 - This token is for an OD HQ service that has authenticated to us.</EnumValue>
        <EnumValue name="PatientPortalVerifyUser">4 - The patient verified him or herself with just a name and birthdate.</EnumValue>
        <EnumValue name="TwoFactorAuth">5 - The patient has been sent a 2FA code.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="FKey" type="bigint(20)">
      <summary>The FKey this token is for. For Patient Portal tokens, this is patient.PatNum. For Mobile Web tokens, this is userod.UserNum.</summary>
    </column>
  </table>
  <table name="sheet">
    <summary>One sheet for one patient. A better name might be Form, but that name is not unique enough and has already been used by MS. Sheets allow customized layout for things like postcards and lab slips. They also support data that the user fills out for things like medical histories.</summary>
    <column order="0" name="SheetNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SheetType" type="int(11)">
      <summary>Enum:SheetTypeEnum</summary>
      <Enumeration name="SheetTypeEnum">
        <summary>Different types of sheets that can be used.</summary>
        <EnumValue name="LabelPatient">0-Requires SheetParameter for PatNum. Does not get saved to db.</EnumValue>
        <EnumValue name="LabelCarrier">1-Requires SheetParameter for CarrierNum. Does not get saved to db.</EnumValue>
        <EnumValue name="LabelReferral">2-Requires SheetParameter for ReferralNum. Does not get saved to db.</EnumValue>
        <EnumValue name="ReferralSlip">3-Requires SheetParameters for PatNum,ReferralNum.</EnumValue>
        <EnumValue name="LabelAppointment">4-Requires SheetParameter for AptNum. Does not get saved to db.</EnumValue>
        <EnumValue name="Rx">5-Requires SheetParameter for RxNum.</EnumValue>
        <EnumValue name="Consent">6-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="PatientLetter">7-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="ReferralLetter">8-Requires SheetParameters for PatNum,ReferralNum.</EnumValue>
        <EnumValue name="PatientForm">9-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="RoutingSlip">10-Requires SheetParameter for AptNum.  Does not get saved to db.</EnumValue>
        <EnumValue name="MedicalHistory">11-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="LabSlip">12-Requires SheetParameter for PatNum, LabCaseNum.</EnumValue>
        <EnumValue name="ExamSheet">13-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="DepositSlip">14-Requires SheetParameter for DepositNum.</EnumValue>
        <EnumValue name="Statement">15-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="MedLabResults">16-Requires SheetParameters for PatNum,MedLab,MedLabResult.</EnumValue>
        <EnumValue name="TreatmentPlan">17-Requires SheetParameters for PatNum,TreatmentPlan.</EnumValue>
        <EnumValue name="Screening">18-Requires SheetParameter for ScreenNum.  
            Optional SheetParameter for PatNum if screening is associated to a patient.</EnumValue>
        <EnumValue name="PaymentPlan">19-Used for Payment Plans to Sheets.</EnumValue>
        <EnumValue name="RxMulti">20-Requires SheetParameters for ListRxSheet and ListRxNums.</EnumValue>
        <EnumValue name="ERA">21</EnumValue>
        <EnumValue name="ERAGridHeader">22</EnumValue>
        <EnumValue name="RxInstruction">23</EnumValue>
        <EnumValue name="PatientDashboard">24-Deprecated. No longer needed when change was made to only display one Patient Dashboard at a time.  Defines the layout of a 
            patient specific dashboard sheet.  Not directly user editable.  Each sheetfielddef linked to this sheet type further links a
            PatientDashboardWidget type sheet to this PatientDashboard sheet, allowing users to place various PatientDashboardWidgets on their personal
            PatientDashboard.</EnumValue>
        <EnumValue name="PatientDashboardWidget">25-Defines the layout and elements of a Patient Dashboard.  Editable from Dashboard Setup with Setup permissions.</EnumValue>
        <EnumValue name="ChartModule">26</EnumValue>
        <EnumValue name="None">27-Not designed to be saved to the db.  Useful when needing a "none" or "all" default option for UI.</EnumValue>
        <EnumValue name="Check">28-For printing checks</EnumValue>
      </Enumeration>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  A saved sheet is always attached to a patient (except deposit slip).  There are a few sheets that are so minor that they don't get saved, such as a Carrier label.</summary>
    </column>
    <column order="3" name="DateTimeSheet" type="datetime">
      <summary>The date and time of the sheet as it will be displayed in the commlog. Updated when the patient fills out and submits the sheet via eClipboard.</summary>
    </column>
    <column order="4" name="FontSize" type="float">
      <summary>The default fontSize for the sheet.  The actual font must still be saved with each sheetField.</summary>
    </column>
    <column order="5" name="FontName" type="varchar(255)">
      <summary>The default fontName for the sheet.  The actual font must still be saved with each sheetField.</summary>
    </column>
    <column order="6" name="Width" type="int(11)">
      <summary>Width of each page in the sheet in pixels, 100 pixels per inch.</summary>
    </column>
    <column order="7" name="Height" type="int(11)">
      <summary>Height of each page in the sheet in pixels, 100 pixels per inch.</summary>
    </column>
    <column order="8" name="IsLandscape" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="9" name="InternalNote" type="text">
      <summary>An internal note for the use of the office staff regarding the sheet.  Not to be printed on the sheet in any way.</summary>
    </column>
    <column order="10" name="Description" type="varchar(255)">
      <summary>Copied from the SheetDef description.</summary>
    </column>
    <column order="11" name="ShowInTerminal" type="tinyint(4)">
      <summary>Examples: 1, 2, etc. The order that this sheet will show in the Kiosk queue, or zero if not set. Also determines if it will show in eClipboard in addition to any eClipboardSheetDef. For eClipboard, this is just treated like a boolean and that actual order is ignored.</summary>
    </column>
    <column order="12" name="IsWebForm" type="tinyint(4)">
      <summary>True if this sheet was downloaded from the webforms service. EForms uses Status field instead.</summary>
    </column>
    <column order="13" name="IsMultiPage" type="tinyint(4)">
      <summary>Forces old single page behavior, ignoring page breaks.</summary>
    </column>
    <column order="14" name="IsDeleted" type="tinyint(4)">
      <summary>Indicates whether or not this sheet has been marked deleted.</summary>
    </column>
    <column order="15" name="SheetDefNum" type="bigint(20)" fk="sheetdef">
      <summary>FK to sheetdef.SheetDefNum. The SheetDef that was used to create this sheet. Will be 0 if an internal sheet or if the sheet was created before 17.2. Can be 0 for sheets that were created from web forms that were associated to web form sheet defs missing this value at HQ. The original purpose of this column was to use it in connection with RefID of the Sheet and SheetDef to automate the updating of forms such as office policies when they change significantly. It is now also used when making a copy of a sheet. Also used alongside EClipboardSheetDef to determine whether patient has already filled out a form. </summary>
    </column>
    <column order="16" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum.  Referral letters are stored as PDF in the A to Z folder.</summary>
    </column>
    <column order="17" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. Used by webforms to limit the sheets displayed based on the currently selected clinic.</summary>
    </column>
    <column order="18" name="DateTSheetEdited" type="datetime">
      <summary>The date and time the sheet was inserted or last time someone opened the sheet and clicked OK on FormSheetFillEdit. Gets updated even if no changes were made to the sheet or sheetfields, because we don't want to do the lengthy work of comparing all fields. Only used for one thing: when editing a sheet to warn user if the sheet has been edited by someone else while you had that window open.</summary>
    </column>
    <column order="19" name="HasMobileLayout" type="tinyint(4)">
      <summary>If true then this Sheet has been designed for mobile and will be displayed as a mobile-friendly WebForm.</summary>
    </column>
    <column order="20" name="RevID" type="int(11)">
      <summary>Revision ID. Used to determine in conjunction with PrefillMode for eClipboard to determine whether to show a patient a new form or have them update their last filled out form. Must match up with SheetDef RevID to show a previously filled out form.</summary>
    </column>
    <column order="21" name="WebFormSheetID" type="bigint(20)">
      <summary>Only set when this sheet was created from a Web Form. FK to webforms_sheet.SheetID within the Web Forms server. Used to determine if this particular Web Form has been retrieved before in order to avoid creating duplicate sheet entries for a single Web Form.</summary>
    </column>
  </table>
  <table name="sheetdef">
    <summary>A definition (template) for a sheet.  Can be pulled from the database, or it can be internally defined.</summary>
    <column order="0" name="SheetDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>The description of this sheetdef.</summary>
    </column>
    <column order="2" name="SheetType" type="int(11)">
      <summary>Enum:SheetTypeEnum</summary>
      <Enumeration name="SheetTypeEnum">
        <summary>Different types of sheets that can be used.</summary>
        <EnumValue name="LabelPatient">0-Requires SheetParameter for PatNum. Does not get saved to db.</EnumValue>
        <EnumValue name="LabelCarrier">1-Requires SheetParameter for CarrierNum. Does not get saved to db.</EnumValue>
        <EnumValue name="LabelReferral">2-Requires SheetParameter for ReferralNum. Does not get saved to db.</EnumValue>
        <EnumValue name="ReferralSlip">3-Requires SheetParameters for PatNum,ReferralNum.</EnumValue>
        <EnumValue name="LabelAppointment">4-Requires SheetParameter for AptNum. Does not get saved to db.</EnumValue>
        <EnumValue name="Rx">5-Requires SheetParameter for RxNum.</EnumValue>
        <EnumValue name="Consent">6-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="PatientLetter">7-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="ReferralLetter">8-Requires SheetParameters for PatNum,ReferralNum.</EnumValue>
        <EnumValue name="PatientForm">9-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="RoutingSlip">10-Requires SheetParameter for AptNum.  Does not get saved to db.</EnumValue>
        <EnumValue name="MedicalHistory">11-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="LabSlip">12-Requires SheetParameter for PatNum, LabCaseNum.</EnumValue>
        <EnumValue name="ExamSheet">13-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="DepositSlip">14-Requires SheetParameter for DepositNum.</EnumValue>
        <EnumValue name="Statement">15-Requires SheetParameter for PatNum.</EnumValue>
        <EnumValue name="MedLabResults">16-Requires SheetParameters for PatNum,MedLab,MedLabResult.</EnumValue>
        <EnumValue name="TreatmentPlan">17-Requires SheetParameters for PatNum,TreatmentPlan.</EnumValue>
        <EnumValue name="Screening">18-Requires SheetParameter for ScreenNum.  
            Optional SheetParameter for PatNum if screening is associated to a patient.</EnumValue>
        <EnumValue name="PaymentPlan">19-Used for Payment Plans to Sheets.</EnumValue>
        <EnumValue name="RxMulti">20-Requires SheetParameters for ListRxSheet and ListRxNums.</EnumValue>
        <EnumValue name="ERA">21</EnumValue>
        <EnumValue name="ERAGridHeader">22</EnumValue>
        <EnumValue name="RxInstruction">23</EnumValue>
        <EnumValue name="PatientDashboard">24-Deprecated. No longer needed when change was made to only display one Patient Dashboard at a time.  Defines the layout of a 
            patient specific dashboard sheet.  Not directly user editable.  Each sheetfielddef linked to this sheet type further links a
            PatientDashboardWidget type sheet to this PatientDashboard sheet, allowing users to place various PatientDashboardWidgets on their personal
            PatientDashboard.</EnumValue>
        <EnumValue name="PatientDashboardWidget">25-Defines the layout and elements of a Patient Dashboard.  Editable from Dashboard Setup with Setup permissions.</EnumValue>
        <EnumValue name="ChartModule">26</EnumValue>
        <EnumValue name="None">27-Not designed to be saved to the db.  Useful when needing a "none" or "all" default option for UI.</EnumValue>
        <EnumValue name="Check">28-For printing checks</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FontSize" type="float">
      <summary>The default fontSize for the sheet.  The actual font must still be saved with each sheetField.</summary>
    </column>
    <column order="4" name="FontName" type="varchar(255)">
      <summary>The default fontName for the sheet.  The actual font must still be saved with each sheetField.</summary>
    </column>
    <column order="5" name="Width" type="int(11)">
      <summary>Width of each page in the sheet in pixels, 100 pixels per inch.</summary>
    </column>
    <column order="6" name="Height" type="int(11)">
      <summary>Height of each page in the sheet in pixels, 100 pixels per inch.</summary>
    </column>
    <column order="7" name="IsLandscape" type="tinyint(4)">
      <summary>Set to true to print landscape.</summary>
    </column>
    <column order="8" name="PageCount" type="int(11)">
      <summary>Amount of editable space. Actual size when filling sheet may be different.</summary>
    </column>
    <column order="9" name="IsMultiPage" type="tinyint(4)">
      <summary>If false, forces old single page behavior which ignores page breaks.</summary>
    </column>
    <column order="10" name="BypassGlobalLock" type="tinyint(4)">
      <summary>Enum:BypassLockStatus Specifies whether a sheet can be created before the global lock date.</summary>
      <Enumeration name="BypassLockStatus">
        <summary>The conditions when the global lock date can be bypassed.</summary>
        <EnumValue name="NeverBypass">0 - Never bypass the lock date.</EnumValue>
        <EnumValue name="BypassIfZero">1 - Bypass the lock date if the fee is zero.</EnumValue>
        <EnumValue name="BypassAlways">2 - Always bypass the global lock date.</EnumValue>
      </Enumeration>
    </column>
    <column order="11" name="HasMobileLayout" type="tinyint(4)">
      <summary>If true then this Sheet has been designed for mobile and will be displayed as a mobile-friendly WebForm.</summary>
    </column>
    <column order="12" name="DateTCreated" type="datetime">
      <summary>The Date and time that SheetDef was created. Defaults to 0001-01-01 00:00:00 for existing sheets. When duplicating a custom sheet,
            if the original custom sheet's DateTCreated is 0001-01-01 00:00:00, the duplicate's DateTCreated will also be 0001-01-01 00:00:00. This is
            because this column is used for altering text fields' positions in PDFs.</summary>
    </column>
    <column order="13" name="RevID" type="int(11)">
      <summary>Revision ID. Gets updated any time a sheet field is added or deleted from a sheetdef (this includes any time a new language is added) or a static text field is changed. Used to determine in conjunction with PrefillMode for eClipboard to determine whether to show a patient a new form or have them update their last filled out form. Must match up with Sheet RevID to show a filled out form.</summary>
    </column>
    <column order="14" name="AutoCheckSaveImage" type="tinyint(4)">
      <summary>Indicates whether sheets created with this sheet def get copied to the imaging module when changes are made and saved. It's badly named since we don't use a checkbox anymore.</summary>
    </column>
    <column order="15" name="AutoCheckSaveImageDocCategory" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Used to override the category that is selected when auto saving the sheet to the imaging module.  This allows users to choose the category that a sheet is saved to on a per sheet basis.</summary>
    </column>
  </table>
  <table name="sheetfield">
    <summary>One field on a sheet. Any language translations have already happened. See SheetFieldDef. How Exam Sheet replacement fields work: Fields can be placed in a static text field on a PatientLetter, ReferralSlip, or ReferralLetter. 1. For fields with FieldName (not misc), format is [ExamSheet:ExamSheetName;FieldName]. 2. For misc radiobuttons, format is [ExamSheet:ExamSheetName;RadioButtonGroupName]. 3. For other fields, format is [ExamSheet:ExamSheetName;ReportableName]. When replacing text, for misc checkboxes and radio buttons, this tag is replaced with the ReportableName if the checkbox is checked or radio button is selected, and with nothing otherwise.</summary>
    <column order="0" name="SheetFieldNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SheetNum" type="bigint(20)" fk="sheet">
      <summary>FK to sheet.SheetNum.</summary>
    </column>
    <column order="2" name="FieldType" type="int(11)">
      <summary>Enum:SheetFieldType  OutputText, InputField, StaticText,Parameter(only used for SheetField, not SheetFieldDef),Image,Drawing,Line,Rectangle,CheckBox,SigBox,PatImage,Grid, etc.</summary>
      <Enumeration name="SheetFieldType">
        <summary></summary>
        <EnumValue name="OutputText">0-Pulled from the database to be printed on the sheet.  Or also possibly just generated at runtime even though not pulled from the database.   User still allowed to change the output text as they are filling out the sheet so that it can different from what was initially generated.</EnumValue>
        <EnumValue name="InputField">1-A blank box that the user is supposed to fill in.</EnumValue>
        <EnumValue name="StaticText">2-This is text that is defined as part of the sheet and will never change from sheet to sheet.  </EnumValue>
        <EnumValue name="Parameter">3-Stores a parameter other than the PatNum.  Not meant to be seen on the sheet.  Only used for SheetField, not SheetFieldDef.</EnumValue>
        <EnumValue name="Image">4-Any image of any size, typically a background image for a form.</EnumValue>
        <EnumValue name="Drawing">5-One sequence of dots that makes a line.  Continuous without any breaks.  Each time the pen is picked up, it creates a new field row in the database.</EnumValue>
        <EnumValue name="Line">6-A simple line drawn from x,y to x+width,y+height.  So for these types, we must allow width and height to be negative or zero.</EnumValue>
        <EnumValue name="Rectangle">7-A simple rectangle outline.</EnumValue>
        <EnumValue name="CheckBox">8-A clickable area on the screen.  It's a form of input, so treated similarly to an InputField.  The X will go from corner to corner of the rectangle specified.  It can also behave like a radio button</EnumValue>
        <EnumValue name="SigBox">9-A signature box, either Topaz pad or directly on the screen with stylus/mouse.  The signature is encrypted based an a hash of all
            other field values in the entire sheet, excluding other SigBoxes.  The order is critical.</EnumValue>
        <EnumValue name="PatImage">10-An image specific to one patient.</EnumValue>
        <EnumValue name="Special">11-Special: Used for ToothChart, ToothChartLegend, and 3 more chart module items.</EnumValue>
        <EnumValue name="Grid">12-Grid: Placeable grids similar to ODGrids. Used primarily in statements.</EnumValue>
        <EnumValue name="ComboBox">13-ComboBox: Placeable combo box for selecting filled options.</EnumValue>
        <EnumValue name="ScreenChart">14-ScreenChart: A tooth chart that is desiged for screenings.</EnumValue>
        <EnumValue name="MobileHeader">15-MobileHeader: The parent field of a group of fields. All fields in between this field and the next MobileHeader will be grouped toghether in the mobile view.
            EG... "Personal", "Address and Home Phone", "Insurance". A mobile header will always have XPos,YPos,Width, and Height=0 to not show in non-mobile.</EnumValue>
        <EnumValue name="SigBoxPractice">16-A signature box, either Topaz pad or directly on the screen with stylus/mouse.  The signature is encrypted based an a hash of all 
            other field values in the entire sheet, excluding other SigBoxes.  The order is critical.</EnumValue>
        <EnumValue name="MobileStaticText">Used when we want alternate text to show for mobile. The non-mobile version would have TabOrderMobile=0 by checking the box. A mobile header will always have XPos,YPos,Width, and Height=0 to not show in non-mobile.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FieldName" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="4" name="FieldValue" type="text">
      <summary>For OutputText, this value is set before printing.  This is the data obtained from the database and ready to print.  For StaticText, this is copied from the sheetFieldDef, but in-line fields like [this] will have been filled.  For an archived sheet retrieved from the database (all SheetField rows), this value will have been saved and will not be filled again automatically.For InputField, this is the filled value. If an an AutoNote attached, then this field will start out like AutoNoteNum:### until they click to fill out the autonote.Parameter fieldtype: this will store the value of the parameter. FKs are numbers. Two of the parameters allow multiple ProcNums, which are stored here as comma list.Drawing fieldtype: this will be the point data for the lines.  The format would look similar to this: 45,68;48,70;49,72;0,0;55,88;etc.  It's simply a sequence of points, separated by semicolons.CheckBox: it will either be an X or empty.SigBox: the first char will be 0 or 1 to indicate SigIsTopaz, and all subsequent chars will be the Signature itself.PatImage: FK to document.DocNum, or blank, or "MountNum:####" to indicate mount instead of document.ComboBox: The chosen option, semicolon, then a pipe delimited list of options such as: March;January|February|March|AprilScreenChart: Contains a semicolon delimited list of a single number followed by groups of comma separated surfaces.
            The first digit represents what type of ScreenChart it is.  0 = Permanent, 1 = Primary
            It may look like 0;S,P,N;S,S,S;... etc.Grid: Not used. All grid content is generated on the fly rather than preserved in the database. In the future, we should serialize grid content into here. But we probably have to overhaul the language translation for grids first.</summary>
    </column>
    <column order="5" name="FontSize" type="float">
      <summary>The fontSize for this field regardless of the default for the sheet.  The actual font must be saved with each sheetField.</summary>
    </column>
    <column order="6" name="FontName" type="varchar(255)">
      <summary>The fontName for this field regardless of the default for the sheet.  The actual font must be saved with each sheetField.</summary>
    </column>
    <column order="7" name="FontIsBold" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="8" name="XPos" type="int(11)">
      <summary>In pixels.</summary>
    </column>
    <column order="9" name="YPos" type="int(11)">
      <summary>In pixels.</summary>
    </column>
    <column order="10" name="Width" type="int(11)">
      <summary>The field will be constrained horizontally to this size.  Not allowed to be zero.</summary>
    </column>
    <column order="11" name="Height" type="int(11)">
      <summary>The field will be constrained vertically to this size.  Not allowed to be stored as 0.  It's not allowed to be zero so that it will be visible on the designer. Set to 0 in memory by SheetUtil.CalculateHeights if image is innacessible for printing.</summary>
    </column>
    <column order="12" name="GrowthBehavior" type="int(11)">
      <summary>Enum:GrowthBehaviorEnum</summary>
      <Enumeration name="GrowthBehaviorEnum">
        <summary>For sheetFields</summary>
        <EnumValue name="None">Not allowed to grow.  Max size would be Height and Width.</EnumValue>
        <EnumValue name="DownLocal">Can grow down if needed, and will push nearby objects out of the way so that there is no overlap.</EnumValue>
        <EnumValue name="DownGlobal">Can grow down, and will push down all objects on the sheet that are below it.  Mostly used when drawing grids.</EnumValue>
        <EnumValue name="FillRightDown">Used with dynamic grids to grow the grid to fill to the right and bottom of the parent control, does not check for overlap.</EnumValue>
        <EnumValue name="FillDown">Used with dynamic grids to grow the grid to fill to the bottom of the parent control, does not check for overlap.</EnumValue>
        <EnumValue name="FillRight">Used with dynamic grids to grow the grid to fill to the right of the parent control, does not check for overlap.</EnumValue>
        <EnumValue name="FillDownFitColumns">Used with dynamic grids to grow the grid to fill vertical space in parent control and fit grid width to include all columns.
            Primarily for ProgressNotes grid in Chart Module.</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="RadioButtonValue" type="varchar(255)">
      <summary>This is only used for checkboxes that you want to behave like radiobuttons.  Set the FieldName the same for each Checkbox in the group.  The FieldValue will likely be X for one of them and empty string for the others.  Each of them will have a different RadioButtonValue.  Whichever box has X, the RadioButtonValue for that box will be used when importing.  This field is not used for "misc" radiobutton groups.</summary>
    </column>
    <column order="14" name="RadioButtonGroup" type="varchar(255)">
      <summary>Only used for radiobuttons with FieldName set to "misc". Name which identifies the group within which the radio button belongs.</summary>
    </column>
    <column order="15" name="IsRequired" type="tinyint(4)">
      <summary>Set to true if this field is required to have a value before the sheet is closed.</summary>
    </column>
    <column order="16" name="TabOrder" type="int(11)">
      <summary>Tab stop order for all fields. Only checkboxes and input fields can have values other than 0.</summary>
    </column>
    <column order="17" name="ReportableName" type="varchar(255)">
      <summary>Allows reporting on misc fields using queries. This is also used in Exam Sheet replacement fields as the value to show for checkboxes and radiobuttons. See summary of this table for explanation of how they can be used in Exam Sheet replacement fields.</summary>
    </column>
    <column order="18" name="TextAlign" type="tinyint(4)">
      <summary>Text Alignment for text fields.</summary>
    </column>
    <column order="19" name="ItemColor" type="int(11)">
      <summary>Text color, line color, rectangle color. -16777216 is Black. 0 means Empty, which we attempt to treat as black if it happens.</summary>
    </column>
    <column order="20" name="DateTimeSig" type="datetime">
      <summary>DateTime that a sheet was signed.</summary>
    </column>
    <column order="21" name="IsLocked" type="tinyint(4)">
      <summary>Only used in Output and Static fields. Gets locked in the setup and cannot be edited at all once it is in the SheetFillEdit window. Example might be for text of a consent form.</summary>
    </column>
    <column order="22" name="TabOrderMobile" type="int(11)">
      <summary>Tab stop order for all fields of a mobile sheet. One-based.  Only mobile fields can have values other than 0.
            If all SheetFieldDefs for a given SheetField are 0 then assume that this sheet has no mobile-specific view.</summary>
    </column>
    <column order="23" name="UiLabelMobile" type="text">
      <summary>Each input field for a mobile will need a corresponding UI label. This is what the user sees as the label describing what this input is for. EG "First Name:, Last Name:, Address, etc." For check boxes, this field should be blank otherwise a group box will be displayed to the user with this text. For radio buttons, this field should be set to the text of the group caption.</summary>
    </column>
    <column order="24" name="UiLabelMobileRadioButton" type="text">
      <summary>Human-readable label that will be displayed for radio button or checkbox item. Cannot use UiLabelMobile for this purpose as it is already dedicated to the radio group header that groups radio button items together.</summary>
    </column>
    <column order="25" name="SheetFieldDefNum" type="bigint(20)" fk="sheetfielddef">
      <summary>FK to sheetfielddef.SheetFieldDefNum. Only used in the Patient Forms window when the Prefill button is clicked.</summary>
    </column>
    <column order="26" name="CanElectronicallySign" type="tinyint(4)">
      <summary>When true, allows a user to sign a signature box electronically.  ESign/DigitallySign means clicking instead of using a stylus to write out the sig. If IsSigProvRestricted, then the E button for digitally signing won't be visible unless a provider is signed in. There is a completely separate Pref.SignatureAllowDigital which only applies to signing procedures etc., not sheets.</summary>
    </column>
    <column order="27" name="IsSigProvRestricted" type="tinyint(4)">
      <summary>When true, only allows the signature box to be signed by a provider. There is a completely separate Pref.NotesProviderSignatureOnly for doing the same thing in procedures etc., not sheets.</summary>
    </column>
    <column order="28" name="UserSigned" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. Only for sig boxes. Stores the OD user that signed. Only stores it if the user.ProvNum &gt; 0. Only needed when user clicks to change user before signing. Will have a value of 0 for sheets with sigboxes which have "Allow Electronic Signatures" or "Restrict Signature to Providers" left unchecked (ex. MedicalHistory sheet sigbox). In the richtextbox for drawing SigBoxes in FormSheetFillEdit.cs: "By: " will not show with the username if UserSigned value is 0. This is only used in sheets because other places like FormProcEdit can store in procnote.UserNum. Sheets is also the only places where the change user button shows within the sig box.</summary>
    </column>
  </table>
  <table name="sheetfielddef">
    <summary>One field on a sheetDef. Language translations are handled by the LanguagePat table. See SheetField. How Exam Sheet replacement fields work: Fields can be placed in a static text field on a PatientLetter, ReferralSlip, or ReferralLetter. 1. For fields with FieldName (not misc), format is [ExamSheet:ExamSheetName;FieldName]. 2. For misc radiobuttons, format is [ExamSheet:ExamSheetName;RadioButtonGroupName]. 3. For other fields, format is [ExamSheet:ExamSheetName;ReportableName].</summary>
    <column order="0" name="SheetFieldDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SheetDefNum" type="bigint(20)" fk="sheetdef">
      <summary>FK to sheetdef.SheetDefNum.</summary>
    </column>
    <column order="2" name="FieldType" type="int(11)">
      <summary>Enum:SheetFieldType  OutputText, InputField, StaticText,Parameter(only used for SheetField, not SheetFieldDef),Image,Drawing,Line,Rectangle,CheckBox,SigBox,PatImage,Grid, etc.</summary>
      <Enumeration name="SheetFieldType">
        <summary></summary>
        <EnumValue name="OutputText">0-Pulled from the database to be printed on the sheet.  Or also possibly just generated at runtime even though not pulled from the database.   User still allowed to change the output text as they are filling out the sheet so that it can different from what was initially generated.</EnumValue>
        <EnumValue name="InputField">1-A blank box that the user is supposed to fill in.</EnumValue>
        <EnumValue name="StaticText">2-This is text that is defined as part of the sheet and will never change from sheet to sheet.  </EnumValue>
        <EnumValue name="Parameter">3-Stores a parameter other than the PatNum.  Not meant to be seen on the sheet.  Only used for SheetField, not SheetFieldDef.</EnumValue>
        <EnumValue name="Image">4-Any image of any size, typically a background image for a form.</EnumValue>
        <EnumValue name="Drawing">5-One sequence of dots that makes a line.  Continuous without any breaks.  Each time the pen is picked up, it creates a new field row in the database.</EnumValue>
        <EnumValue name="Line">6-A simple line drawn from x,y to x+width,y+height.  So for these types, we must allow width and height to be negative or zero.</EnumValue>
        <EnumValue name="Rectangle">7-A simple rectangle outline.</EnumValue>
        <EnumValue name="CheckBox">8-A clickable area on the screen.  It's a form of input, so treated similarly to an InputField.  The X will go from corner to corner of the rectangle specified.  It can also behave like a radio button</EnumValue>
        <EnumValue name="SigBox">9-A signature box, either Topaz pad or directly on the screen with stylus/mouse.  The signature is encrypted based an a hash of all
            other field values in the entire sheet, excluding other SigBoxes.  The order is critical.</EnumValue>
        <EnumValue name="PatImage">10-An image specific to one patient.</EnumValue>
        <EnumValue name="Special">11-Special: Used for ToothChart, ToothChartLegend, and 3 more chart module items.</EnumValue>
        <EnumValue name="Grid">12-Grid: Placeable grids similar to ODGrids. Used primarily in statements.</EnumValue>
        <EnumValue name="ComboBox">13-ComboBox: Placeable combo box for selecting filled options.</EnumValue>
        <EnumValue name="ScreenChart">14-ScreenChart: A tooth chart that is desiged for screenings.</EnumValue>
        <EnumValue name="MobileHeader">15-MobileHeader: The parent field of a group of fields. All fields in between this field and the next MobileHeader will be grouped toghether in the mobile view.
            EG... "Personal", "Address and Home Phone", "Insurance". A mobile header will always have XPos,YPos,Width, and Height=0 to not show in non-mobile.</EnumValue>
        <EnumValue name="SigBoxPractice">16-A signature box, either Topaz pad or directly on the screen with stylus/mouse.  The signature is encrypted based an a hash of all 
            other field values in the entire sheet, excluding other SigBoxes.  The order is critical.</EnumValue>
        <EnumValue name="MobileStaticText">Used when we want alternate text to show for mobile. The non-mobile version would have TabOrderMobile=0 by checking the box. A mobile header will always have XPos,YPos,Width, and Height=0 to not show in non-mobile.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FieldName" type="varchar(255)">
      <summary>FieldName is used differently for different FieldTypes. 
            For OutputText, each sheet typically has a main datatable type. For example statements correspond to the statment table. See SheetFieldsAvailable.GetList() for available values.     If the output field exactly matches a column from the main table this will be the &lt;ColumnName&gt;. For example, "FName" on patient Forms.     If the output field exactly matches a column from a different table this will be the &lt;tablename&gt;.&lt;ColumnName&gt;. For example, appt.Note on Routing Slips.     If the output field is not a database column it must start with a lowercase letter. For example, "statementReceiptInvoice" on Statements.For InputField, these are hardcoded to correspond to DB fields, for example "FName" corresponsds to patient.FName. See SheetFieldsAvailable.GetList() for available values.For Image, this file name with extention, for example "image1.jpg". Some image names are handled specially, for example "Patient Info.gif". Images are stored in &lt;imagefolder&gt;\SheetImages\image1.jpg.For CheckBox, this groups checkboxes together so that only one per group can be checked.For PatImage, this is the name of the DocCategory.For Special, identifies the type of special field. Currently only ToothChart and ToothChartLegend.For Grid, this is the specific type of grid. See SheetUtil.GetDataTableForGridType() for values. For example "StatementPayPlan". Column names use hard coded display fields that can be found in SheetUtil.GetGridColumnAvailable().For all other fieldtypes, FieldName is blank or irrelevant.</summary>
    </column>
    <column order="4" name="FieldValue" type="text">
      <summary>For StaticText, this text can include bracketed fields, like [nameLF].
            For OutputText and InputField, this will be blank.  If an InputField has an AutoNote attached, then this field will be AutoNoteNum:'value'. Example AutoNoteNum:268.For CheckBoxes, either X or blank.  Even if the checkbox is set to behave like a radio button.  For Pat Images, this is blank.  The filename of a PatImage will later be stored in SheetField.FieldValue.For ComboBoxes, the chosen option, semicolon, then a pipe delimited list of options such as: March;January|February|March|AprilFor ScreenCharts, a semicolon delimited list of comma separated surfaces.  It may look like S,P,N;S,S,S;... etc.For Grid, not used. All grid content is generated on the fly rather than preserved in the database. In the future, we should serialize grid content into here. But we probably have to overhaul the language translation for grids first.</summary>
    </column>
    <column order="5" name="FontSize" type="float">
      <summary>The fontSize for this field regardless of the default for the sheet.  The actual font must be saved with each sheetField.</summary>
    </column>
    <column order="6" name="FontName" type="varchar(255)">
      <summary>The fontName for this field regardless of the default for the sheet.  The actual font must be saved with each sheetField.</summary>
    </column>
    <column order="7" name="FontIsBold" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="8" name="XPos" type="int(11)">
      <summary>In pixels.</summary>
    </column>
    <column order="9" name="YPos" type="int(11)">
      <summary>In pixels.</summary>
    </column>
    <column order="10" name="Width" type="int(11)">
      <summary>The field will be constrained horizontally to this size.  Not allowed to be zero.
            When SheetType is associated to a dynamic layout def and GrowthBehavior is set to a dynamic value this value represents the corresponding controls minimum width.</summary>
    </column>
    <column order="11" name="Height" type="int(11)">
      <summary>The field will be constrained vertically to this size.  Not allowed to be 0.  It's not allowed to be zero so that it will be visible on the designer.
            When SheetType is associated to a dynamic layout def and GrowthBehavior is set to a dynamic value this value represents the corresponding controls minimum height.</summary>
    </column>
    <column order="12" name="GrowthBehavior" type="int(11)">
      <summary>Enum:GrowthBehaviorEnum</summary>
      <Enumeration name="GrowthBehaviorEnum">
        <summary>For sheetFields</summary>
        <EnumValue name="None">Not allowed to grow.  Max size would be Height and Width.</EnumValue>
        <EnumValue name="DownLocal">Can grow down if needed, and will push nearby objects out of the way so that there is no overlap.</EnumValue>
        <EnumValue name="DownGlobal">Can grow down, and will push down all objects on the sheet that are below it.  Mostly used when drawing grids.</EnumValue>
        <EnumValue name="FillRightDown">Used with dynamic grids to grow the grid to fill to the right and bottom of the parent control, does not check for overlap.</EnumValue>
        <EnumValue name="FillDown">Used with dynamic grids to grow the grid to fill to the bottom of the parent control, does not check for overlap.</EnumValue>
        <EnumValue name="FillRight">Used with dynamic grids to grow the grid to fill to the right of the parent control, does not check for overlap.</EnumValue>
        <EnumValue name="FillDownFitColumns">Used with dynamic grids to grow the grid to fill vertical space in parent control and fit grid width to include all columns.
            Primarily for ProgressNotes grid in Chart Module.</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="RadioButtonValue" type="varchar(255)">
      <summary>This is only used for checkboxes that you want to behave like radiobuttons.  Set the FieldName the same for each Checkbox in the group.  The FieldValue will likely be X for one of them and empty string for the others.  Each of them will have a different RadioButtonValue.  Whichever box has X, the RadioButtonValue for that box will be used when importing.  This field is not used for "misc" radiobutton groups.</summary>
    </column>
    <column order="14" name="RadioButtonGroup" type="varchar(255)">
      <summary>Only used for radiobuttons with FieldName set to "misc". Name which identifies the group within which the radio button belongs.</summary>
    </column>
    <column order="15" name="IsRequired" type="tinyint(4)">
      <summary>Set to true if this field is required to have a value before the sheet is closed.</summary>
    </column>
    <column order="16" name="TabOrder" type="int(11)">
      <summary>The Bitmap should be converted to Base64 using POut.Bitmap() before placing in this field.  Not stored in the database.  Only used when uploading SheetDefs to the web server.</summary>
    </column>
    <column order="17" name="ReportableName" type="varchar(255)">
      <summary>Allows reporting on misc fields using queries. See summary of this table for explanation of how they can be used in Exam Sheet replacement fields.</summary>
    </column>
    <column order="18" name="TextAlign" type="tinyint(4)">
      <summary>Text Alignment for text fields.</summary>
    </column>
    <column order="19" name="IsPaymentOption" type="tinyint(4)">
      <summary>Used to determine if the field should be hidden when printing statements.</summary>
    </column>
    <column order="20" name="ItemColor" type="int(11)">
      <summary>Text color, line color, rectangle color.</summary>
    </column>
    <column order="21" name="IsLocked" type="tinyint(4)">
      <summary>Only used in Output and Static fields. Gets locked in the setup and cannot be edited at all once it is in the SheetFillEdit window. Example might be for text of a consent form.</summary>
    </column>
    <column order="22" name="TabOrderMobile" type="int(11)">
      <summary>Tab stop order for all fields of a mobile sheet. One-based.  Only mobile fields can have values other than 0. If all SheetFieldDefs for a given SheetField are 0 then assume that this sheet has no mobile-specific view.</summary>
    </column>
    <column order="23" name="UiLabelMobile" type="text">
      <summary>Each input field for a mobile will need a corresponding UI label. This is what the user sees as the label describing what this input is for. EG "First Name:, Last Name:, Address, etc." For check boxes, this field should be blank otherwise a group box will be displayed to the user with this text. For radio buttons, this field should be set to the text of the group caption.</summary>
    </column>
    <column order="24" name="UiLabelMobileRadioButton" type="text">
      <summary>Human-readable label that will be displayed for radio button or checkbox item.  Cannot use UiLabelMobile for this purpose as it is already dedicated to the radio group header that groups radio button items together. This is also used in Exam Sheet replacement fields as the value to show for checkboxes and radiobuttons.</summary>
    </column>
    <column order="25" name="LayoutMode" type="tinyint(4)">
      <summary>Enum:SheetFieldLayoutMode Just used in Chart module for ecw or medical. Otherwise, use SheetFieldLayoutMode.Default. TP mode in Chart module is no longer included here.</summary>
      <Enumeration name="SheetFieldLayoutMode">
        <summary>For Chart layout. If we alter this list, we must edit the XML resource files that store our default sheetDefs.</summary>
        <EnumValue name="Default">Valid for every SheetTypeEnum. When SheetTypeEnum is associated to a dynamic layout this is the way the layout will show by default.</EnumValue>
        <EnumValue name="TreatPlan">Deprecated. Chart module dynamic layout when we are viewing the SheetFieldLayoutMode.Default and the Treatment Plans checkbox is checked.</EnumValue>
        <EnumValue name="Ecw">Chart module dynamic layout when ECW is enabled.</EnumValue>
        <EnumValue name="EcwTreatPlan">Deprecated. Chart module dynamic layout when ECW is enabled and the Treatment Plans checkbox is checked.</EnumValue>
        <EnumValue name="Orion">Deprecated. Chart module dynamic layout when Orion is enabled.</EnumValue>
        <EnumValue name="OrionTreatPlan">Deprecated. Chart module dynamic layout when Orion is enabled and the Treatment Plans checkbox is checked.</EnumValue>
        <EnumValue name="MedicalPractice">Chart module dynamic layout when current clinic is associated to a medical clinic or practice.</EnumValue>
        <EnumValue name="MedicalPracticeTreatPlan">Deprecated. Chart module dynamic layout when current clinic is associated to a medical clinic or practice and the Treatment Plans checkbox is checked.</EnumValue>
      </Enumeration>
    </column>
    <column order="26" name="Language" type="varchar(255)">
      <summary>Blank by default. When set, patient.Language will attempt to match to SheetFieldDefs with a matching Language value.</summary>
    </column>
    <column order="27" name="CanElectronicallySign" type="tinyint(4)">
      <summary>When true, allows a user to sign a signature box electronically which means clicking instead of using a stylus to write out the sig. If IsSigProvRestricted, then the E button for digitally signing won't be visible unless a provider is signed in. There is a completely separate Pref.SignatureAllowDigital which only applies to signing procedures etc., not sheets.</summary>
    </column>
    <column order="28" name="IsSigProvRestricted" type="tinyint(4)">
      <summary>When true, only allows the signature box to be signed by a provider. There is a completely separate Pref.NotesProviderSignatureOnly for doing the same thing in procedures etc., not sheets.</summary>
    </column>
  </table>
  <table name="sigbutdef">
    <summary>This defines the light buttons on the left of the main screen.</summary>
    <column order="0" name="SigButDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ButtonText" type="varchar(255)">
      <summary>The text on the button</summary>
    </column>
    <column order="2" name="ButtonIndex" type="smallint(6)">
      <summary>0-based index defines the order of the buttons.</summary>
    </column>
    <column order="3" name="SynchIcon" type="tinyint">
      <summary>0=none, or 1-9. The cell in the 3x3 tic-tac-toe main program icon that is to be synched with this button.  It will light up or clear whenever this button lights or clears.</summary>
    </column>
    <column order="4" name="ComputerName" type="varchar(255)">
      <summary>Blank for the default buttons.  Or contains the computer name for the buttons that override the defaults.</summary>
    </column>
    <column order="5" name="SigElementDefNumUser" type="bigint(20)" fk="sigelementdef">
      <summary>FK to sigelementdef.SigElementDefNum</summary>
    </column>
    <column order="6" name="SigElementDefNumExtra" type="bigint(20)" fk="sigelementdef">
      <summary>FK to sigelementdef.SigElementDefNum</summary>
    </column>
    <column order="7" name="SigElementDefNumMsg" type="bigint(20)" fk="sigelementdef">
      <summary>FK to sigelementdef.SigElementDefNum</summary>
    </column>
  </table>
  <table name="sigelementdef">
    <summary>This defines the items that will be available for clicking when composing a manual message.
            Also, these are referred to in the button definitions as a sequence of elements.</summary>
    <column order="0" name="SigElementDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="LightRow" type="tinyint">
      <summary>If this element should cause a button to light up, this would be the row.  0 means none.</summary>
    </column>
    <column order="2" name="LightColor" type="int(11)">
      <summary>If a light row is set, this is the color it will turn when triggered.  Ack sets it back to white.
            Note that color and row can be in two separate elements of the same signal.</summary>
    </column>
    <column order="3" name="SigElementType" type="tinyint">
      <summary>Enum:SignalElementType  0=User,1=Extra,2=Message.</summary>
      <Enumeration name="SignalElementType">
        <summary>0=User,1=Extra,2=Message.</summary>
        <EnumValue name="User">0-To and From lists.  Not tied in any way to the users that are part of security.</EnumValue>
        <EnumValue name="Extra">Typically used to insert "family" before "phone" signals.</EnumValue>
        <EnumValue name="Message">Elements of this type show in the last column and trigger the message to be sent.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="SigText" type="varchar(255)">
      <summary>The text that shows for the element, like the user name or the two word message.  No long text is stored here.</summary>
    </column>
    <column order="5" name="Sound" type="mediumtext">
      <summary>The sound to play for this element.  Wav file stored in the database in string format until "played".  If empty string, then no sound.</summary>
    </column>
    <column order="6" name="ItemOrder" type="smallint(6)">
      <summary>The order of this element within the list of the same type.</summary>
    </column>
  </table>
  <table name="sigmessage">
    <summary>These are messages sent and received in the Manage module. Affects the main icon with the 9 boxes. Also causes a recorded sound to play so that everyone knows who the message is for.</summary>
    <column order="0" name="SigMessageNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ButtonText" type="varchar(255)">
      <summary>The text on the button</summary>
    </column>
    <column order="2" name="ButtonIndex" type="int(11)">
      <summary>0-based index defines the order of the buttons.</summary>
    </column>
    <column order="3" name="SynchIcon" type="tinyint">
      <summary>0=none, or 1-9. The cell in the 3x3 tic-tac-toe main program icon that is to be synched with this button.
            It will light up or clear whenever this button lights or clears.</summary>
    </column>
    <column order="4" name="FromUser" type="varchar(255)">
      <summary>Text version of 'user' this message was sent from, which can actually be any description of a group or individual.</summary>
    </column>
    <column order="5" name="ToUser" type="varchar(255)">
      <summary>Text version of 'user' this message was sent to, which can actually be any description of a group or individual.</summary>
    </column>
    <column order="6" name="MessageDateTime" type="datetime">
      <summary>Automatically set to the date and time upon insert.  Uses server time.</summary>
    </column>
    <column order="7" name="AckDateTime" type="datetime">
      <summary>This date time will get set as soon as this message has been acknowledged.  How lights get turned off.</summary>
    </column>
    <column order="8" name="SigText" type="varchar(255)">
      <summary>The text that shows for the element, like the user name or the two word message.  No long text is stored here.</summary>
    </column>
    <column order="9" name="SigElementDefNumUser" type="bigint(20)" fk="sigelementdef">
      <summary>FK to sigelementdef.SigElementDefNum</summary>
    </column>
    <column order="10" name="SigElementDefNumExtra" type="bigint(20)" fk="sigelementdef">
      <summary>FK to sigelementdef.SigElementDefNum</summary>
    </column>
    <column order="11" name="SigElementDefNumMsg" type="bigint(20)" fk="sigelementdef">
      <summary>FK to sigelementdef.SigElementDefNum</summary>
    </column>
  </table>
  <table name="signalod">
    <summary>Open Dental uses a memory cache for many common small tables that don't change very often. If one computer makes a change to a cache table, then they insert a row in this table to indicate to all other computers that they need to update their cache for the given table. Certain entries in this table can also trigger the Appointments module to refresh if that date is currently showing for any computer. To add a row here, use DataValid.SetInvalid. See the discussion in Cache.cs. It seems like the rows that use KeyType and FKey seem to be treated very differently from the rows that use InvalidType for the cache.</summary>
    <column order="0" name="SignalNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateViewing" type="date">
      <summary>If IType=Date, then this is the affected date in the Appointments module.</summary>
    </column>
    <column order="2" name="SigDateTime" type="datetime">
      <summary>The exact server time when this signal was entered into db.
            This does not need to be set by sender since it's handled automatically.</summary>
    </column>
    <column order="3" name="FKey" type="bigint(20)">
      <summary>Usually identifies the object that was edited to cause the signal to be created.
            Can be used for special scenarios based on the FKeyType.  E.g. for SmsMsgUnreadCount, this represents a count, not an FK.</summary>
    </column>
    <column order="4" name="FKeyType" type="varchar(255)">
      <summary>Enum:KeyType Describes the type of object referenced by the FKey.</summary>
      <Enumeration name="KeyType">
        <summary>Do not combine with SignalType (I think this means InvalidType?), they must be seperate. Stored as string, safe to reorder enum values.</summary>
        <EnumValue name="Undefined">Probably represented by empty string, but possibly by "Undefined".</EnumValue>
        <EnumValue name="FeeSched"></EnumValue>
        <EnumValue name="Job"></EnumValue>
        <EnumValue name="Operatory"></EnumValue>
        <EnumValue name="PhoneExtension">HQ only.  FKey will be the extension of the corresponding phone that is invalid.
            Specifically used to talk to the PhoneTrackingServer in order to let it know that an extension has changed (e.g. queue change).</EnumValue>
        <EnumValue name="Provider"></EnumValue>
        <EnumValue name="SigMessage"></EnumValue>
        <EnumValue name="SmsMsgUnreadCount">Special KeyType that does not use a FK but instead will set FKey to a count of unread messages.
            Used along side the SmsTextMsgReceivedUnreadCount InvalidType.</EnumValue>
        <EnumValue name="Task"></EnumValue>
        <EnumValue name="ProcessId">Used to identify which signals a form can ignore.  If the FKey==Process.GetCurrentProcess().Id then this process sent it so ignore
            it.  Used in FormTerminal, FormTerminalManager, and FormSheetFillEdit (for forms being filled at a kiosk).</EnumValue>
        <EnumValue name="ConfKick">Used to notify the phone tracking server to kick all users out of a conference room.</EnumValue>
        <EnumValue name="PatNum">Used in AccModule, TPModule, and PerioExams.</EnumValue>
        <EnumValue name="UserOd">Deprecated. Indicates Signalod pertains to a specific UserOd.</EnumValue>
        <EnumValue name="EmailAddress">Used to indicate that this specific email address is what this signal is for</EnumValue>
        <EnumValue name="ChanSpy">This is HQ specific and will be used to listen in on live calls</EnumValue>
        <EnumValue name="Computer">Used to speficy that the passed-in computerNum is what the signal is for.</EnumValue>
      </Enumeration>
    </column>
    <column order="5" name="IType" type="tinyint(4)">
      <summary>Enum:InvalidType Indicates what cache or entity has been changed.</summary>
      <Enumeration name="InvalidType">
        <summary>When the autorefresh message is sent to the other computers, this is the type.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="Date">1 Deprecated. Not used with any other flags</EnumValue>
        <EnumValue name="AllLocal">2 Deprecated.  Inefficient.  All flags combined except Date and Tasks.</EnumValue>
        <EnumValue name="Task">3 Not used with any other flags.  Used to just indicate added tasks, but now it indicates any change at all except those where a popup is needed.  If we also want a popup, then use TaskPopup.</EnumValue>
        <EnumValue name="ProcCodes">4</EnumValue>
        <EnumValue name="Prefs">5</EnumValue>
        <EnumValue name="Views">6 ApptViews, ApptViewItems, AppointmentRules, ProcApptColors.</EnumValue>
        <EnumValue name="AutoCodes">7</EnumValue>
        <EnumValue name="Carriers">8</EnumValue>
        <EnumValue name="ClearHouses">9</EnumValue>
        <EnumValue name="Computers">10</EnumValue>
        <EnumValue name="InsCats">11</EnumValue>
        <EnumValue name="Employees">12- Also includes payperiods.</EnumValue>
        <EnumValue name="StartupOld">13- Deprecated.</EnumValue>
        <EnumValue name="Defs">14- Defs</EnumValue>
        <EnumValue name="Email">15. Templates and addresses, but not messages.</EnumValue>
        <EnumValue name="Fees">16. Obsolete</EnumValue>
        <EnumValue name="Letters">17</EnumValue>
        <EnumValue name="QuickPaste">18- Invalidates quick paste notes and cats.</EnumValue>
        <EnumValue name="Security">19- Userods, UserGroups, UserGroupAttaches, and GroupPermissions</EnumValue>
        <EnumValue name="Programs">20 - Also includes program properties.</EnumValue>
        <EnumValue name="ToolButsAndMounts">21- Also includes MountDefs and ImagingDevices</EnumValue>
        <EnumValue name="Providers">22- Also includes clinics.</EnumValue>
        <EnumValue name="ClaimForms">23- Also includes ClaimFormItems.</EnumValue>
        <EnumValue name="ZipCodes">24</EnumValue>
        <EnumValue name="LetterMerge">25</EnumValue>
        <EnumValue name="DentalSchools">26- Includes SchoolClass, SchoolCourse, SchoolCourseDef, SchoolCourseSched, and ReqNeeded.</EnumValue>
        <EnumValue name="Operatories">27</EnumValue>
        <EnumValue name="TaskPopup">28</EnumValue>
        <EnumValue name="Sites">29</EnumValue>
        <EnumValue name="Pharmacies">30</EnumValue>
        <EnumValue name="Sheets">31 - Also include EForms.</EnumValue>
        <EnumValue name="RecallTypes">32</EnumValue>
        <EnumValue name="FeeScheds">33</EnumValue>
        <EnumValue name="PhoneNumbers">34. This is used internally by OD, Inc with the phonenumber table and the phone server.</EnumValue>
        <EnumValue name="Signals">35. Deprecated, use SigMessages instead.  Old summary: Signal/message defs</EnumValue>
        <EnumValue name="DisplayFields">36. And ChartViews.</EnumValue>
        <EnumValue name="PatFields">37. And ApptFields and PatFieldPickItems.</EnumValue>
        <EnumValue name="AccountingAutoPays">38</EnumValue>
        <EnumValue name="ProcButtons">39</EnumValue>
        <EnumValue name="Diseases">40.  Includes ICD9s.</EnumValue>
        <EnumValue name="Languages">41. Includes LanguagePats</EnumValue>
        <EnumValue name="AutoNotes">42</EnumValue>
        <EnumValue name="ElectIDs">43</EnumValue>
        <EnumValue name="Employers">44</EnumValue>
        <EnumValue name="ProviderIdents">45</EnumValue>
        <EnumValue name="ShutDownNow">46</EnumValue>
        <EnumValue name="InsFilingCodes">47</EnumValue>
        <EnumValue name="ReplicationServers">48</EnumValue>
        <EnumValue name="Automation">49</EnumValue>
        <EnumValue name="PhoneAsteriskReload">50. This is used internally by OD, Inc with the phone server to trigger the phone system to reload after changing which call groups users are in.
            Also used when sending a signal to the phone tracking server to kick users in conference rooms.  This will be used additionally to listen in on live calls.</EnumValue>
        <EnumValue name="TimeCardRules">51</EnumValue>
        <EnumValue name="Vaccines">52. Includes DrugManufacturers and DrugUnits.</EnumValue>
        <EnumValue name="HL7Defs">53. Includes all 4 HL7Def tables.</EnumValue>
        <EnumValue name="DictCustoms">54</EnumValue>
        <EnumValue name="Wiki">55. Caches the wiki master page and the wikiListHeaderWidths</EnumValue>
        <EnumValue name="Sops">56. SourceOfPayment</EnumValue>
        <EnumValue name="EhrCodes">57. In-Memory table used for hard-coded codes and CQMs</EnumValue>
        <EnumValue name="AppointmentTypes">58. Used to override appointment color.  Might be used for other appointment attributes in the future.</EnumValue>
        <EnumValue name="Medications">59. Caches the medication list to stop from over-refreshing and causing slowness.</EnumValue>
        <EnumValue name="SmsTextMsgReceivedUnreadCount">60. This is a special InvalidType which indicates a refresh, but also includes the data to be refreshed inside of the signalod.FKey field.</EnumValue>
        <EnumValue name="ProviderErxs">61</EnumValue>
        <EnumValue name="Jobs">62. This is used internally by OD, refreshes the jobs windows in the Job Manager.</EnumValue>
        <EnumValue name="JobPermission">63. This is used internally by OD, refreshes the jobRoles</EnumValue>
        <EnumValue name="StateAbbrs">64. Caches the StateAbbrs used for helping prefill state fields and for state validations.</EnumValue>
        <EnumValue name="RequiredFields">65</EnumValue>
        <EnumValue name="Ebills">66</EnumValue>
        <EnumValue name="UserClinics">67. Not used.</EnumValue>
        <EnumValue name="Appointment">68. Replaces the deprecated "Date" invalid type for more granularity on invalid signals.</EnumValue>
        <EnumValue name="OrthoChartTabs">69 Also includes OrthoHardwareSpecs.</EnumValue>
        <EnumValue name="SigMessages">70. A user either acknowledged or added to the messaging buttons system.</EnumValue>
        <EnumValue name="AlertSubs">71. Deprecated.</EnumValue>
        <EnumValue name="AlertItems">72. THIS IS NOT CACHED. But is used to make server run the alert logic in OpenDentalService.</EnumValue>
        <EnumValue name="VoiceMails">73. This is used internally by OD HQ, refreshes the voice mails.</EnumValue>
        <EnumValue name="Kiosk">74. Used to refresh the active kiosk grid in FormTerminalManager and loaded patient with list of forms in FormTerminal.</EnumValue>
        <EnumValue name="ClinicPrefs">75</EnumValue>
        <EnumValue name="EmailMessages">76. Not addresses or templates, but inbox and sent messages.</EnumValue>
        <EnumValue name="WebSchedRecallReminders">77. The eConnector has finished sending web sched recall reminders.</EnumValue>
        <EnumValue name="SmsBlockPhones">78.</EnumValue>
        <EnumValue name="AlertCategories">79.</EnumValue>
        <EnumValue name="AlertCategoryLinks">80.</EnumValue>
        <EnumValue name="UnfinalizedPayMenuUpdate">81. Used in updating menu item in report menu.</EnumValue>
        <EnumValue name="ClinicErxs">82. Used for validating clinics for eRx.</EnumValue>
        <EnumValue name="DisplayReports">83.</EnumValue>
        <EnumValue name="UserQueries">84.</EnumValue>
        <EnumValue name="Schedules">85. Schedules are not cached, but alerts other workstations if the schedules were changed</EnumValue>
        <EnumValue name="PhoneComps">86. This is used internally by OD, refreshes the computer / extension linker table.</EnumValue>
        <EnumValue name="PhoneMap">87. Used internally by OD, refreshes call center map associated with tables MapArea and MapAreaContainer.</EnumValue>
        <EnumValue name="SmsPhones">88.</EnumValue>
        <EnumValue name="WebChatSessions">89.  Chat support through our website at http://opendental.com/contact.html.
            Used to indicate a new session has been created, an existing session has been destroyed, or messages inside the session have changed.</EnumValue>
        <EnumValue name="TaskList">90. Used for tracking refreshes on tabs 'for [User]', 'New for [User]', 'Main', 'Reminders'.</EnumValue>
        <EnumValue name="TaskAuthor">91. Used for tracking refreshes on tab 'Open Tasks'.</EnumValue>
        <EnumValue name="TaskPatient">92. Used for tracking refreshes on tab 'Patient Tasks'.</EnumValue>
        <EnumValue name="Referral">93. Used for refreshing the Referral cache.</EnumValue>
        <EnumValue name="ProcMultiVisits">94. Used for refreshing "In Process" pseudo procedure statuses.</EnumValue>
        <EnumValue name="ProviderClinicLink">95. Used for refreshing the ProviderClinicLink cache.</EnumValue>
        <EnumValue name="EClipboard">96. Used for refreshing the KioskManager with eClipboard information.</EnumValue>
        <EnumValue name="TPModule">97. Used for refreshing the TP module for a specific patient. PatNum used in FKey.</EnumValue>
        <EnumValue name="ActiveInstance">98. Used for closing Cloud sessions. ActiveInstanceNum is the Fkey.</EnumValue>
        <EnumValue name="PhoneEmpDefaults">99. Used internally by OD HQ.</EnumValue>
        <EnumValue name="UserOdPrefs">100. Not used.</EnumValue>
        <EnumValue name="JobTeams">101. Used internally by OD HQ.</EnumValue>
        <EnumValue name="AccModule">102. Used to refresh the Account Module for a specific patient. PatNum used in FKey.</EnumValue>
        <EnumValue name="LimitedBetaFeature">103. Used for limitedBetaFeature Cache.</EnumValue>
        <EnumValue name="PerioExams">104. Used to refresh Perio Chart. patient.PatNum used in FKey.</EnumValue>
        <EnumValue name="EmailInboxRetrieve">105. </EnumValue>
        <EnumValue name="ApiSubscriptions">106. Table in db is apisubscriptions. Small and changes rarely, but all workstations must know about the change.</EnumValue>
        <EnumValue name="ERoutingDef">107. Used as template for Patient eRouting</EnumValue>
        <EnumValue name="FlowActionDef">108. Used as template for Patient eRouting Actions</EnumValue>
        <EnumValue name="FlowDefLink">109. Used to link PatientFlowDefs with other objects: appointments, appt types, billing types, etc. </EnumValue>
        <EnumValue name="CodeGroups">110. Group of codes used with frequency limitations.</EnumValue>
        <EnumValue name="BillingList">111. Used to refresh the billing list when it's open and a patient's account was adjusted. Works immediately on the current computer and at the signal interval of about 10 seconds on other computers.</EnumValue>
        <EnumValue name="ConnectionStoreClear">112. Indicates that database connection settings have changed and the cached connections should be reinitialized.</EnumValue>
        <EnumValue name="Children">113. Used to keep the daycare map and parent check in/out window synced. Has nothing to do with the cache.</EnumValue>
        <EnumValue name="Print">114. Instructs a specific computer to print the RemotePrintRequest that is attached as json. This signal is generated by eConnector in response to a print request from ODTouch or possibly others.</EnumValue>
        <EnumValue name="WebChatAiAssistants">115. This is used internally by OD, refreshes the AI assistant list. Fkey is not used.</EnumValue>
        <EnumValue name="MassEmail">116. Used to refresh the mass email upload form.</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="RemoteRole" type="tinyint(4)">
      <summary>Enum:MiddleTierRole The MiddleTierRole of the instance that created this signal.</summary>
      <Enumeration name="MiddleTierRole">
        <summary>Default ClientDirect.</summary>
        <EnumValue name="ClientDirect">This dll is on a local workstation, and this workstation has successfully connected directly to the database with no Middle Tier layer.</EnumValue>
        <EnumValue name="ClientMT">Workstation that is getting its data from the Middle Tier web service on the server.</EnumValue>
        <EnumValue name="ServerMT">This dll is part of the Middle Tier web server that is providing data via web services.</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="MsgValue" type="text">
      <summary>Message value of the signal.</summary>
    </column>
  </table>
  <table name="site">
    <summary>Generally used by mobile clinics to track the temporary locations where treatment is performed, such as schools, nursing homes, and community centers.  Replaces the old school table.  </summary>
    <column order="0" name="SiteNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="Note" type="text">
      <summary>Notes could include phone, contacts, etc.</summary>
    </column>
    <column order="3" name="Address" type="varchar(100)">
      <summary></summary>
    </column>
    <column order="4" name="Address2" type="varchar(100)">
      <summary>Optional second address line.</summary>
    </column>
    <column order="5" name="City" type="varchar(100)">
      <summary></summary>
    </column>
    <column order="6" name="State" type="varchar(100)">
      <summary>2 Char in USA.  Used to store province for Canadian users.</summary>
    </column>
    <column order="7" name="Zip" type="varchar(100)">
      <summary>Postal code.</summary>
    </column>
    <column order="8" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  Default provider for the site.</summary>
    </column>
    <column order="9" name="PlaceService" type="tinyint(4)">
      <summary>Enum:PlaceOfService Describes where the site is located.</summary>
      <Enumeration name="PlaceOfService">
        <summary></summary>
        <EnumValue name="Office">0. Code 11</EnumValue>
        <EnumValue name="PatientsHome">1. Code 12</EnumValue>
        <EnumValue name="InpatHospital">2. Code 21</EnumValue>
        <EnumValue name="OutpatHospital">3. Code 22</EnumValue>
        <EnumValue name="SkilledNursFac">4. Code 31</EnumValue>
        <EnumValue name="CustodialCareFacility">5. Code 33.  In X12, a similar code AdultLivCareFac 35 is mentioned.</EnumValue>
        <EnumValue name="OtherLocation">6. Code 99.  We use 11 for office.</EnumValue>
        <EnumValue name="MobileUnit">7. Code 15</EnumValue>
        <EnumValue name="School">8. Code 03</EnumValue>
        <EnumValue name="MilitaryTreatFac">9. Code 26</EnumValue>
        <EnumValue name="FederalHealthCenter">10. Code 50</EnumValue>
        <EnumValue name="PublicHealthClinic">11. Code 71</EnumValue>
        <EnumValue name="RuralHealthClinic">12. Code 72</EnumValue>
        <EnumValue name="EmergencyRoomHospital">13. Code 23</EnumValue>
        <EnumValue name="AmbulatorySurgicalCenter">14. Code 24</EnumValue>
        <EnumValue name="TelehealthOutsideHome">15. Code 02.</EnumValue>
        <EnumValue name="TelehealthInHome">16. Code 10</EnumValue>
        <EnumValue name="OutreachSiteOrStreet">17. Code 27</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="smsblockphone">
    <summary>If a number is entered in this table, then any incoming text message will not be entered into the database.</summary>
    <column order="0" name="SmsBlockPhoneNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="BlockWirelessNumber" type="varchar(255)">
      <summary>The phone number to be blocked.</summary>
    </column>
  </table>
  <table name="smsfrommobile">
    <summary>A Mobile Originating SMS bound for the office. Will usually be a re-constructed message.</summary>
    <column order="0" name="SmsFromMobileNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. Not sent from HQ.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. </summary>
    </column>
    <column order="3" name="CommlogNum" type="bigint(20)" fk="commlog">
      <summary>FK to commlog.CommlogNum. Not sent from HQ.</summary>
    </column>
    <column order="4" name="MsgText" type="text">
      <summary>Contents of the message.</summary>
    </column>
    <column order="5" name="DateTimeReceived" type="datetime">
      <summary>Date and time message was inserted into the DB. Not sent from HQ.</summary>
    </column>
    <column order="6" name="SmsPhoneNumber" type="varchar(255)">
      <summary>This is the Phone Number of the office that the mobile device sent a message to.</summary>
    </column>
    <column order="7" name="MobilePhoneNumber" type="varchar(255)">
      <summary>This is the PhoneNumber that this message was sent from.</summary>
    </column>
    <column order="8" name="MsgPart" type="int(11)">
      <summary>Message part sequence number. For single part messages this should always be 1. 
            For messages that exist as multiple parts, due to staggered delivery of the parts, this will be a number between 1 and MsgTotal.</summary>
    </column>
    <column order="9" name="MsgTotal" type="int(11)">
      <summary>Total count of message parts for this single message identified by MsgRefID.
            For single part messages this should always be 1.</summary>
    </column>
    <column order="10" name="MsgRefID" type="varchar(255)">
      <summary>Each part of a multipart message will have the same MsgRefID.</summary>
    </column>
    <column order="11" name="SmsStatus" type="tinyint(4)">
      <summary>Enum:SmsFromStatus .</summary>
      <Enumeration name="SmsFromStatus">
        <summary>Status of an incoming message.</summary>
        <EnumValue name="ReceivedUnread">0</EnumValue>
        <EnumValue name="ReceivedRead">1</EnumValue>
      </Enumeration>
    </column>
    <column order="12" name="Flags" type="varchar(255)">
      <summary>Words surrounded by spaces, flags should be all lower case. This allows simple querrying. Example: " junk  recall " allows you to 
            write "WHERE Flags like "% junk %" without having to worry about commas. Also, adding and removing tags is easier. Example: Flags=Flags.Replace(" junk ","");</summary>
    </column>
    <column order="13" name="IsHidden" type="tinyint(4)">
      <summary>Messages are not deleted, they can only be hidden.</summary>
    </column>
    <column order="14" name="MatchCount" type="int(11)">
      <summary></summary>
    </column>
    <column order="15" name="GuidMessage" type="varchar(255)" fk="confirmationrequest">
      <summary>FK to confirmationrequest.GuidMessageFromMobile. Generated at HQ when the confirmation pending is terminated with confirmation text message.</summary>
    </column>
    <column order="16" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
  </table>
  <table name="smsphone">
    <summary>A phone number used to send and receive SMS.
            When clinics is enabled all SmsPhones with clinic num 0 should be updated to have clinic num of the lowest numbered clinic.
            When clinics are disabled, all SmsPhones with the lowest numbered clinic num should be re-associated to clinic number 0.</summary>
    <column order="0" name="SmsPhoneNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum. </summary>
    </column>
    <column order="2" name="PhoneNumber" type="varchar(255)">
      <summary>String representation of the phone number in international format. Ex: 15035551234 This field should not contain any formatting characters.</summary>
    </column>
    <column order="3" name="DateTimeActive" type="datetime">
      <summary>Date and time this phone number became active.</summary>
    </column>
    <column order="4" name="DateTimeInactive" type="datetime">
      <summary>Date and time this phone number became inactive. Once inactive, the phone is dead and cannot be reactivated. A new number will have to be purchased.</summary>
    </column>
    <column order="5" name="InactiveCode" type="varchar(255)">
      <summary>Used to indicate why this phone number was made inactive.</summary>
    </column>
    <column order="6" name="CountryCode" type="varchar(255)">
      <summary>Country linked to this phone's clinic at the instant that this phone is created. Based on ISO31661.</summary>
    </column>
  </table>
  <table name="smstomobile">
    <summary>Messages are only inserted into this table after they are accepted by ODHQ.</summary>
    <column order="0" name="SmsToMobileNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="GuidMessage" type="varchar(255)">
      <summary>GUID. Uniquely identifies this message and is used for tracking message status.</summary>
    </column>
    <column order="3" name="GuidBatch" type="varchar(255)">
      <summary>GUID. When sending batch messages, all messages will have the same batch GUID that should be the GUID of the first message within the batch.</summary>
    </column>
    <column order="4" name="SmsPhoneNumber" type="varchar(255)">
      <summary>This is the sending phone number in international format. Each office may have several different numbers that they use.</summary>
    </column>
    <column order="5" name="MobilePhoneNumber" type="varchar(255)">
      <summary>The phone number that this message was sent to. Must be kept in addition to the PatNum.</summary>
    </column>
    <column order="6" name="IsTimeSensitive" type="tinyint(4)">
      <summary>Set to true if this message should "jump the queue" and be sent asap.</summary>
    </column>
    <column order="7" name="MsgType" type="tinyint(4)">
      <summary>Enum:SmsMessageSource  This is used to identify where in the program this message originated from.</summary>
      <Enumeration name="SmsMessageSource">
        <summary>This helps us determine how to handle messages.</summary>
        <EnumValue name="Undefined">0. Should not be used.
            Short Code Supported: NO
            </EnumValue>
        <EnumValue name="DirectSms">1. This should be used for one-off messages that might be sent as direct communication with patient.
            Short Code Supported: NO
            </EnumValue>
        <EnumValue name="Recall">2. Used when sending single or batch recall SMS from the Open Dental program.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="Reminder">3. Used when sending single or batch reminder SMS.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="TestNoCharge">4. Used when sending a test message from HQ. Customer will not be charged for this message.
            Short Code Supported: NO
            </EnumValue>
        <EnumValue name="Confirmation">5. Used when sending confirmations.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="ConfirmationRequest">6. Used when sending confirmation requests. Will be the subject of automated response processing.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="RecallAuto">7. Used when sending batch recall SMS from the eConnector.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="AsapManual">8. Used when sending single or batch SMS from the clicking the Text button on the ASAP window.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="WebSchedASAP">9. Sending an SMS for the Web Sched ASAP feature.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="Verify">10. Sending an SMS for the Web Sched verify feature.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="Statements">11. Sending an SMS to let the patient know that a statement is available.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="VerifyWSNP">12. Sending an SMS to let the patient know that a statement is available.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="Headmaster">13. Sent from the Headmaster app.
            Short Code Supported: NO
            </EnumValue>
        <EnumValue name="NoReply">14. Used with Short Codes to send an AutoReply message (not a monitored line).
            Short Code Supported: N/A
            </EnumValue>
        <EnumValue name="ODMobile">15. Send from ODMobile app.
            Short Code Supported: NO
            </EnumValue>
        <EnumValue name="ApptThankYou">16. Used when sending appointment/schedule Thank You's.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="ConfirmationAutoReply">17. Used when the patient responds positively to an eConfirmation.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="OptInPrompt">18. Used with Short Codes to send a message prompting the patient to opt in to receiving Short Code sms.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="StopReply">19. Used with Short Codes to send a message confirming the patient has opted out of receiving Short Code sms.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="HelpReply">20. Used with Short Codes to send a message detailing help options for the patient.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="OptInReply">21. Used with Short Codes to send a message confirming the patient has opted in to receiving Short Code sms.
            Short Code Supported: YES
            </EnumValue>
        <EnumValue name="Arrival">22. Used to texting patients about appointment arrival instructions.</EnumValue>
        <EnumValue name="ByodToken">23. Used for 2 factor authentication in mobile apps.</EnumValue>
        <EnumValue name="GeneralMessage">24. Used when sending appointment general messages.</EnumValue>
        <EnumValue name="ApptNewPatThankYou">25. Used when sending webforms for new patients on appointment schedule.</EnumValue>
        <EnumValue name="VerifyPaymentPortal">26. Used when sending verification codes for the Payment Portal web app.
            Short Code Supported: NO</EnumValue>
        <EnumValue name="MsgToPay">27. Used for Payment Portal Msg-To-Pay messages.
            Short Code Supported: NO</EnumValue>
        <EnumValue name="OptOutReply">28. Used when the office checks NO for the patient to receive texts in the patient edit form. 
            Short Code Supported: NO
            </EnumValue>
        <EnumValue name="EClipboardWeb">29. Used when sending eClipboard Web URLs to patients. 
            Short Code Supported: NO
            </EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="MsgText" type="text">
      <summary>The contents of the message.</summary>
    </column>
    <column order="9" name="SmsStatus" type="tinyint(4)">
      <summary>Enum:SmsDeliveryStatus  Set by the Listener, tracks status of SMS.</summary>
      <Enumeration name="SmsDeliveryStatus">
        <summary>None should never be used, the code should be re-written to not use it.</summary>
        <EnumValue name="None">0. Should not be used.</EnumValue>
        <EnumValue name="Pending">1. After a message has been accepted at ODHQ. Before any feedback.</EnumValue>
        <EnumValue name="DeliveryConf">2. Delivered to customer, carrier replied with confirmation.</EnumValue>
        <EnumValue name="DeliveryUnconf">3. Delivered to customer, no confirmation of failure or delivery sent back from carrier.</EnumValue>
        <EnumValue name="FailWithCharge">4. Attempted delivery, failure message return after arriving at handset.</EnumValue>
        <EnumValue name="FailNoCharge">5. Attempted delivery, immediate failure confirmation received from carrier.</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="MsgParts" type="int(11)">
      <summary>The count of parts that this message will be broken into when sent.
            A single long message will be broken into several smaller 153 utf8 or 70 unicode character messages.</summary>
    </column>
    <column order="11" name="MsgChargeUSD" type="float">
      <summary>The amount charged to the customer. Total cost for this message always stored in US Dollars.</summary>
    </column>
    <column order="12" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0 when not using clinics.</summary>
    </column>
    <column order="13" name="CustErrorText" type="varchar(255)">
      <summary>Only used when SmsDeliveryStatus==Failed.</summary>
    </column>
    <column order="14" name="DateTimeSent" type="datetime">
      <summary>Time message was accepted at ODHQ.</summary>
    </column>
    <column order="15" name="DateTimeTerminated" type="datetime">
      <summary>Date time that the message was either successfully delivered or failed.</summary>
    </column>
    <column order="16" name="IsHidden" type="tinyint(4)">
      <summary>Messages are hidden, not deleted.</summary>
    </column>
    <column order="17" name="MsgDiscountUSD" type="float">
      <summary>Any discount applied to this message. 
            If a particular messages has a MsgDiscountUSD &gt; 0  then the MsgChargeUSD will reflect the charge to the customer after the discount has already been applied. 
            Multi-part messages will still be charged the wholesale rate for all parts after the first part.
            To calculate the typical charge that this customer would pay without the discount use MsgChargeUSD + MsgDiscountUSD.
            To calculate the percentage discounted off standard charges use (MsgDiscountUSD / (MsgChargeUSD + MsgDiscountUSD)).</summary>
    </column>
    <column order="18" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="19" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum, represents the currently logged in user.</summary>
    </column>
  </table>
  <table name="snomed">
    <summary>We do not import synonyms, only "Fully Specified Name records". Snomed for holding a large list of codes. Codes in use are copied into the DiseaseDef table.  SNOMED CT maintained, owned and copyright International Health Terminology Standards Development Organisation (IHTSDO).</summary>
    <column order="0" name="SnomedNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SnomedCode" type="varchar(255)">
      <summary>Used as FK by other tables.  Also called the Concept ID.  Not allowed to edit this column once saved in the database.</summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>Also called "Term", "Name", or "Fully Specified Name".  Not editable and doesn't change.</summary>
    </column>
  </table>
  <table name="sop">
    <summary></summary>
    <column order="0" name="SopNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="1" name="SopCode" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary></summary>
    </column>
  </table>
  <table name="stateabbr">
    <summary>State abbreviations are always copied to patient records rather than linked.  
            Items in this list can be freely altered or deleted without harming patient data.</summary>
    <column order="0" name="StateAbbrNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(50)">
      <summary>Full state name</summary>
    </column>
    <column order="2" name="Abbr" type="varchar(50)">
      <summary>Short state abbreviation (usually 2 digit)</summary>
    </column>
    <column order="3" name="MedicaidIDLength" type="int(11)">
      <summary>The length that the Medicaid ID should be for this state. If 0, then the Medicaid length is not enforced for this state</summary>
    </column>
  </table>
  <table name="statement">
    <summary>Represents one statement for one family.  Usually already sent, but could still be waiting to send.</summary>
    <column order="0" name="StatementNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. Typically the guarantor.  Can also be the patient for walkout statements.</summary>
    </column>
    <column order="2" name="DateSent" type="date">
      <summary>This will always be a valid and reasonable date regardless of whether it's actually been sent yet.</summary>
    </column>
    <column order="3" name="DateRangeFrom" type="date">
      <summary>Typically 45 days before dateSent</summary>
    </column>
    <column order="4" name="DateRangeTo" type="date">
      <summary>Any date &gt;= year 2200 is considered max val.  We generally try to automate this value to be the same date as the statement rather than the max val.  This is so that when payment plans are displayed, we can add approximately 10 days to effectively show the charge that will soon be due.  Adding the 10 days is not done until display time.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>Can include line breaks.  This ordinary note will be in the standard font.</summary>
    </column>
    <column order="6" name="NoteBold" type="text">
      <summary>More important notes may go here.  Font will be bold.  Color and size of text will be customizable in setup.</summary>
    </column>
    <column order="7" name="Mode_" type="tinyint">
      <summary>Enum:StatementMode Mail, InPerson, Email, Electronic.</summary>
      <Enumeration name="StatementMode">
        <summary>0-Mail, 1-InPerson, 2-Email, 3-Electronic, 4-API</summary>
        <EnumValue name="Mail">0</EnumValue>
        <EnumValue name="InPerson">1</EnumValue>
        <EnumValue name="Email">2</EnumValue>
        <EnumValue name="Electronic">3-Send the statement over the internet to an API. That company then sends the actual statement, usually by paper.</EnumValue>
        <EnumValue name="API">4-The statement was generated by a third-party API developer. Optionally associated with a DocNum.</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="HidePayment" type="tinyint(1)">
      <summary>Set true to hide the credit card section, and the please pay box.</summary>
    </column>
    <column order="9" name="SinglePatient" type="tinyint(1)">
      <summary>One patient on statement instead of entire family.</summary>
    </column>
    <column order="10" name="Intermingled" type="tinyint(1)">
      <summary>If entire family, then this determines whether they are all intermingled into one big grid, or whether they are all listed in separate grids.</summary>
    </column>
    <column order="11" name="IsSent" type="tinyint(1)">
      <summary>True</summary>
    </column>
    <column order="12" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum when a pdf has been archived.</summary>
    </column>
    <column order="13" name="DateTStamp" type="timestamp">
      <summary>Date/time last altered.</summary>
    </column>
    <column order="14" name="IsReceipt" type="tinyint(4)">
      <summary>This flag changes the text at the top of a statement from "statement" to "receipt". In regular view this will only include today's payments. In service date view, this will include all of today's payments along with the procedures they are tied to, regardless of the procedure's date.</summary>
    </column>
    <column order="15" name="IsInvoice" type="tinyint(4)">
      <summary>This flag is for marking a statement as Invoice.  The statement will contain procedures, adjustments, and/or payplan charges. When creating an invoice, if no rows in the Account module are selected then the statement will be automatically made with things from today. If there are other rows selected, regardless of date, it will be made with those.</summary>
    </column>
    <column order="16" name="IsInvoiceCopy" type="tinyint(4)">
      <summary>Only used if IsInvoice=true.  The first printout will not be a copy.  Subsequent printouts will show "copy" on them.</summary>
    </column>
    <column order="17" name="EmailSubject" type="varchar(255)">
      <summary>Empty string by default.  Only used to override BillingEmailSubject pref when emailing statements.  Only set when statements are created from the Billing Options window.  No UI for editing.</summary>
    </column>
    <column order="18" name="EmailBody" type="mediumtext">
      <summary>Empty string by default.  Only used to override BillingEmailBodyText pref when emailing statements.  Only set when statements are created from the Billing Options window.  No UI for editing.  Limit in db: 16M char.</summary>
    </column>
    <column order="19" name="SuperFamily" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  Typically zero unless a super family statement is desired.
            Will be non-zero if the patient is associated with a super family and a super family statement is desired.</summary>
    </column>
    <column order="20" name="IsBalValid" type="tinyint(4)">
      <summary>True for statements generated in version 16.1 or greater, except those created via Open Dental API. Older statements did not store InsEst or BalTotal. Statements generated via Open Dental API do not use InsEst or BalTotal.</summary>
    </column>
    <column order="21" name="InsEst" type="double">
      <summary>Insurance Estimate for entire family, taken from guarantor at time of statement being sent/saved. For invoices, this field contains the total adjustment amount instead.</summary>
    </column>
    <column order="22" name="BalTotal" type="double">
      <summary>Total balance for entire family before insurance estimate.  
            Not the same as the sum of the 4 aging balances because this can be negative.</summary>
    </column>
    <column order="23" name="StatementType" type="varchar(50)">
      <summary>Enum:StmtType NotSet, LimitedStatement, Walkout.</summary>
      <Enumeration name="StmtType">
        <summary>The type of this statement.  This will eventually replace IsReceipt and IsInvoice. Stored as EnumAsString.</summary>
        <EnumValue name="NotSet">Regular statement.</EnumValue>
        <EnumValue name="LimitedStatement">Contains information about specific procedures, patient payments, insurance payments, or adjustments. User can select specific things.</EnumValue>
        <EnumValue name="Walkout">Marks statement as walkout. Statements of this type will have all of the information from what happened today (procedures, payments, adjustments, etc.) In service date view, some extra effort goes into deciding what to show. In regular view, it's simpler to just show things for today.</EnumValue>
      </Enumeration>
    </column>
    <column order="24" name="ShortGUID" type="varchar(30)">
      <summary>A short alphanumeric string used to uniquely identify this statement.</summary>
    </column>
    <column order="25" name="StatementShortURL" type="varchar(50)">
      <summary>A short URL that can be visited to view this statement. Useful to include in text messages.</summary>
    </column>
    <column order="26" name="StatementURL" type="varchar(255)">
      <summary>A URL that can be visited to view this statement.</summary>
    </column>
    <column order="27" name="SmsSendStatus" type="tinyint(4)">
      <summary>Enum:AutoCommStatus Stores what should be done or was done in regards to SMS messaging for this statement.</summary>
      <Enumeration name="AutoCommStatus">
        <summary>Used by both Statement and WebSchedRecall (and probably other places).</summary>
        <EnumValue name="Undefined">0 - Should not be in the database but can be used in the program.</EnumValue>
        <EnumValue name="DoNotSend">1 - Do not send a reminder.</EnumValue>
        <EnumValue name="SendNotAttempted">2 - We will send, but send has not been attempted yet.</EnumValue>
        <EnumValue name="SendSuccessful">3 - Has been sent successfully.</EnumValue>
        <EnumValue name="SendFailed">4 - Attempted to send but not successful.</EnumValue>
        <EnumValue name="SentAwaitingReceipt">5 - Has been sent successfully, awaiting receipt.</EnumValue>
      </Enumeration>
    </column>
    <column order="28" name="LimitedCustomFamily" type="tinyint(4)">
      <summary>Enum:EnumLimitedCustomFamily Indicates the scope of a custom limited statement. Special behavior in getSuperFamAccount for Family and SuperFamily.</summary>
      <Enumeration name="EnumLimitedCustomFamily">
        <summary>Indicates the scope of a limited custom statement. Special logic in AccountModules.GetSuperFamAccount when set</summary>
        <EnumValue name="None">None=0</EnumValue>
        <EnumValue name="Patient">Patient=1</EnumValue>
        <EnumValue name="Family">Family=2</EnumValue>
        <EnumValue name="SuperFamily">SuperFamily=3</EnumValue>
      </Enumeration>
    </column>
    <column order="29" name="ShowTransSinceBalZero" type="tinyint(4)">
      <summary>Used for setting the "Show transactions since zero/negative balance" checkbox when opening/editing a statement. True for statements that were saved with "Show transactions since zero/negative balance" checked. For new statements, the value is set according to the BillingShowTransSinceBalZero pref (except for statements created from Billing, where the checkbox in the Billing Options window overrides this).</summary>
    </column>
    <column order="30" name="IsServiceDateView" type="tinyint(4)">
      <summary>When true, the statement will be made using service date view for the main grid. When false, the regular account view will be used.</summary>
    </column>
  </table>
  <table name="statementprod">
    <summary>Links production items to a statement. Also tracks whether or not a late charge adjustment has been created for the production item.</summary>
    <column order="0" name="StatementProdNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="StatementNum" type="bigint(20)" fk="statement">
      <summary>FK to statement.StatementNum. The statement that the production item is on.</summary>
    </column>
    <column order="2" name="FKey" type="bigint(20)">
      <summary>Foreign key to linked production item.</summary>
    </column>
    <column order="3" name="ProdType" type="tinyint(4)">
      <summary>Enum:ProductionType Type of production item.</summary>
      <Enumeration name="ProductionType">
        <summary></summary>
        <EnumValue name="Procedure">0 - Procedure</EnumValue>
        <EnumValue name="Adjustment">1 - Adjustment</EnumValue>
        <EnumValue name="PayPlanCharge">2 - PayPlanCharge</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="LateChargeAdjNum" type="bigint(20)" fk="adjustment">
      <summary>FK to adjustment.AdjNum. The late charge adjustment made for this production item. 0 if no late charge has been made.</summary>
    </column>
    <column order="5" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum. The pdf document last associated to the statement. Will be 0 for statements that are sent electronically when pdfs are not saved for electronic statements.</summary>
    </column>
  </table>
  <table name="stmtlink">
    <summary>Attaches individual rows of Procs, Adjustments, Payments, etc to a Statement object so that we can recreate the statement again later.</summary>
    <column order="0" name="StmtLinkNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="StatementNum" type="bigint(20)" fk="statement">
      <summary>FK to statement.StatementNum.</summary>
    </column>
    <column order="2" name="StmtLinkType" type="tinyint(4)">
      <summary>Enum:StmtLinkTypes Represents what object FKey corresponds to.</summary>
      <Enumeration name="StmtLinkTypes">
        <summary></summary>
        <EnumValue name="Proc">0 - Procedure</EnumValue>
        <EnumValue name="PaySplit">1 - Pay split</EnumValue>
        <EnumValue name="Adj">2 - Adjustment</EnumValue>
        <EnumValue name="ClaimPay">3 - ClaimPay</EnumValue>
        <EnumValue name="PayPlanCharge">4 - Pay plan charge</EnumValue>
        <EnumValue name="PatNum">5 - Patient </EnumValue>
        <EnumValue name="MsgToPaySent">6 - MsgToPaySent </EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="FKey" type="bigint(20)">
      <summary>FK to type of PK of another object depending on StmtLinkType value. E.g. procedurelog.ProcNum, paysplit.PaySplitNum, adjustment.AdjNum, etc.</summary>
    </column>
  </table>
  <table name="substitutionlink">
    <summary>Entries in this table will represent procedurecodes that the insurance plan wants to SKIP when considering substitution codes.</summary>
    <column order="0" name="SubstitutionLinkNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PlanNum" type="bigint(20)" fk="insplan">
      <summary>FK to insplan.PlanNum.</summary>
    </column>
    <column order="2" name="CodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum.</summary>
    </column>
    <column order="3" name="SubstitutionCode" type="varchar(25)" fk="procedurecode">
      <summary>FK to procedurecode.ProcCode.</summary>
    </column>
    <column order="4" name="SubstOnlyIf" type="int(11)">
      <summary>Enum:SubstitutionCondition </summary>
      <Enumeration name="SubstitutionCondition">
        <summary>Used for insurance substitutions conditions of procedurecodes.  Mostly for posterior composites.</summary>
        <EnumValue name="Always">0</EnumValue>
        <EnumValue name="Molar">1</EnumValue>
        <EnumValue name="SecondMolar">2</EnumValue>
        <EnumValue name="Never">3</EnumValue>
        <EnumValue name="Posterior">4</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="supplier">
    <summary>A company that provides supplies for the office, typically dental supplies.</summary>
    <column order="0" name="SupplierNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Name" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="Phone" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="3" name="CustomerId" type="varchar(255)">
      <summary>The customer ID that this office uses for transactions with the supplier</summary>
    </column>
    <column order="4" name="Website" type="text">
      <summary>Full address to website.  We might make it clickable.</summary>
    </column>
    <column order="5" name="UserName" type="varchar(255)">
      <summary>The username used to log in to the supplier website.</summary>
    </column>
    <column order="6" name="Password" type="varchar(255)">
      <summary>The password to log in to the supplier website.  Not encrypted or hidden in any way.</summary>
    </column>
    <column order="7" name="Note" type="text">
      <summary>Any note regarding supplier.  Could hold address, CC info, etc.</summary>
    </column>
  </table>
  <table name="supply">
    <summary>A dental supply or office supply item.</summary>
    <column order="0" name="SupplyNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SupplierNum" type="bigint(20)" fk="supplier">
      <summary>FK to supplier.SupplierNum</summary>
    </column>
    <column order="2" name="CatalogNumber" type="varchar(255)">
      <summary>The catalog item number that the supplier uses to identify the supply.</summary>
    </column>
    <column order="3" name="Descript" type="varchar(255)">
      <summary>The description can be similar to the catalog, but not required.  Typically includes qty per box/case, etc.</summary>
    </column>
    <column order="4" name="Category" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  User can define their own categories for supplies.</summary>
    </column>
    <column order="5" name="ItemOrder" type="int(11)">
      <summary>The zero-based order of this supply within it's category.  Hidden supplies can be included in this order.</summary>
    </column>
    <column order="6" name="LevelDesired" type="float">
      <summary>Aka Stock Level.  The level that a fresh order should bring item back up to.  Can include fractions.  If this is 0, then it will be displayed as having this field blank rather than showing 0.  This simply gives a cleaner look.</summary>
    </column>
    <column order="7" name="IsHidden" type="tinyint(1)">
      <summary>If hidden, then this supply item won't normally show in the main list.</summary>
    </column>
    <column order="8" name="Price" type="double">
      <summary>The price per unit that the supplier charges for this supply.  If this is 0.00, then no price will be displayed.</summary>
    </column>
    <column order="9" name="BarCodeOrID" type="varchar(255)">
      <summary>Scanned code from a reader.</summary>
    </column>
    <column order="10" name="DispDefaultQuant" type="float">
      <summary>Only used for dental schools.  This is the typical quantity dispensed at the window.</summary>
    </column>
    <column order="11" name="DispUnitsCount" type="int(11)">
      <summary>Only used in dental schools.  For example, 20 capsules composite per container.</summary>
    </column>
    <column order="12" name="DispUnitDesc" type="varchar(255)">
      <summary>Only used in dental schools.  Description of the units when dispensing for use.  For example: Capsule, cartridge, carpule, glove, or needle.</summary>
    </column>
    <column order="13" name="LevelOnHand" type="float">
      <summary>Deprecated.</summary>
    </column>
    <column order="14" name="OrderQty" type="int(11)">
      <summary>The amount to order when the next SupplyOrder is created.  Creating a SupplyOrder then zeroes this out, so it's just a temporary value.</summary>
    </column>
  </table>
  <table name="supplyneeded">
    <summary>A supply freeform typed in by a user.</summary>
    <column order="0" name="SupplyNeededNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="text">
      <summary>.</summary>
    </column>
    <column order="2" name="DateAdded" type="date">
      <summary>.</summary>
    </column>
  </table>
  <table name="supplyorder">
    <summary>One supply order to one supplier.  Contains SupplyOrderItems.</summary>
    <column order="0" name="SupplyOrderNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SupplierNum" type="bigint(20)" fk="supplier">
      <summary>FK to supplier.SupplierNum.</summary>
    </column>
    <column order="2" name="DatePlaced" type="date">
      <summary>A date greater than 2200 (eg 2500), is considered a max date.  A max date is used for an order that was started but has not yet been placed.  This puts it at the end of the list where it belongs, but it will display as blank.  Only one unplaced order is allowed per supplier.</summary>
    </column>
    <column order="3" name="Note" type="text">
      <summary>.</summary>
    </column>
    <column order="4" name="AmountTotal" type="double">
      <summary>The sum of all the amounts of each item on the order.  If any of the item prices are zero, then it won't auto calculate this total.  This will allow the user to manually put in the total without having it get deleted.</summary>
    </column>
    <column order="5" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. User that placed the order, is editable.</summary>
    </column>
    <column order="6" name="ShippingCharge" type="double">
      <summary>The order's shipping charge.</summary>
    </column>
    <column order="7" name="DateReceived" type="date">
      <summary>The date the order was received. If the SupplyOrder existed before updating to version 19.4, then this value will be set to the date
            the office updated to 19.4.</summary>
    </column>
  </table>
  <table name="supplyorderitem">
    <summary>One item on one supply order.  This table links supplies to orders as well as storing a small amount of additional info.</summary>
    <column order="0" name="SupplyOrderItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SupplyOrderNum" type="bigint(20)" fk="supplyorder">
      <summary>FK to supplyorder.supplyOrderNum.</summary>
    </column>
    <column order="2" name="SupplyNum" type="bigint(20)" fk="supply">
      <summary>FK to supply.SupplyNum.</summary>
    </column>
    <column order="3" name="Qty" type="int(11)">
      <summary>How many were ordered.</summary>
    </column>
    <column order="4" name="Price" type="double">
      <summary>Price per unit on this order.</summary>
    </column>
    <column order="5" name="DateReceived" type="date">
      <summary>Optional. The order itself already has this field. But if a partial order comes in, and if the user wants to track item dates separately, then they can do it here.</summary>
    </column>
  </table>
  <table name="task">
    <summary>A task is a single todo item.  Also see taskhist, which keeps a historical record.</summary>
    <column order="0" name="TaskNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TaskListNum" type="bigint(20)" fk="tasklist">
      <summary>FK to tasklist.TaskListNum.  If 0, then it will show in the trunk of a section.  This is temporarily -1 to indicate that a task is not assigned to a tasklist yet, but -1 never gets saved to the db.</summary>
    </column>
    <column order="2" name="DateTask" type="date">
      <summary>Only used if this task is assigned to a dated category.  Children are NOT dated.  Only dated if they should show in the trunk for a date category.  They can also have a parent if they are in the main list as well.</summary>
    </column>
    <column order="3" name="KeyNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum or appointment.AptNum. Only used when ObjectType is not 0.</summary>
    </column>
    <column order="4" name="Descript" type="text">
      <summary>The description of this task.  Might be very long.</summary>
    </column>
    <column order="5" name="TaskStatus" type="tinyint">
      <summary>Enum:TaskStatusEnum New,Viewed,Done.  We may want to put an index on this column someday.</summary>
      <Enumeration name="TaskStatusEnum">
        <summary></summary>
        <EnumValue name="New">0</EnumValue>
        <EnumValue name="Viewed">1</EnumValue>
        <EnumValue name="Done">2</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="IsRepeating" type="tinyint">
      <summary>True if it is to show in the repeating section.  There should be no date.  All children and parents should also be set to IsRepeating=true.</summary>
    </column>
    <column order="7" name="DateType" type="tinyint">
      <summary>Enum:TaskDateType  None, Day, Week, Month.  If IsRepeating, then setting to None effectively disables the repeating feature.</summary>
      <Enumeration name="TaskDateType">
        <summary>For use by the older Repeating Tasks feature.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="Day">1</EnumValue>
        <EnumValue name="Week">2</EnumValue>
        <EnumValue name="Month">3</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="FromNum" type="bigint(20)" fk="task">
      <summary>FK to task.TaskNum  If this is derived from a repeating task, then this will hold the TaskNum of that task.  It helps automate the adding and deleting of tasks.  It might be deleted automatically if not are marked complete.</summary>
    </column>
    <column order="9" name="ObjectType" type="tinyint">
      <summary>Enum:TaskObjectType  0=none,1=Patient,2=Appointment.  More will be added later. If a type is selected, then the KeyNum will contain the primary key of the corresponding Patient or Appointment.  Does not really have anything to do with the ObjectType of the parent tasklist, although they tend to match.</summary>
      <Enumeration name="TaskObjectType">
        <summary>Used when attaching objects to tasks.  These are the choices.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="Patient">1</EnumValue>
        <EnumValue name="Appointment">2</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="DateTimeEntry" type="datetime">
      <summary>The date and time that this task was added.  User editable.
            For reminder tasks, this field is used to indicate the date and time the reminder will take effect.</summary>
    </column>
    <column order="11" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  The person who created the task.</summary>
    </column>
    <column order="12" name="DateTimeFinished" type="datetime">
      <summary>The date and time that this task was marked "done".</summary>
    </column>
    <column order="13" name="PriorityDefNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  The priority for this task which is used when filling task lists.  The placement of the task in the list is dependent on the item order of the definitions.</summary>
    </column>
    <column order="14" name="ReminderGroupId" type="varchar(20)">
      <summary>Optional.  Set to null or empty if not a reminder task.
            For repeating reminders, the ReminderGroupId will be the same for each task spawned from any task in the group.</summary>
    </column>
    <column order="15" name="ReminderType" type="smallint(6)">
      <summary>Bit field.</summary>
    </column>
    <column order="16" name="ReminderFrequency" type="int(11)">
      <summary></summary>
    </column>
    <column order="17" name="DateTimeOriginal" type="datetime">
      <summary>The original datetime that the row was inserted.  Used to sort the list by the order entered.
            Using taskhist.DateTimeOriginal will get the datetime that the task row was inserted, not the taskhist.</summary>
    </column>
    <column order="18" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="19" name="DescriptOverride" type="varchar(255)">
      <summary>Limited to 256 char. If present, shows only this text in task list grids instead of prepending date, aggregating notes, etc. Shows as Short Descript in the UI for space reasons.</summary>
    </column>
    <column order="20" name="IsReadOnly" type="tinyint(1)">
      <summary>Determines if this task can be edited by most users. Currently only used at HQ.</summary>
    </column>
    <column order="21" name="Category" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum. Only used when pref.TaskCategoryShow is set to true.</summary>
    </column>
    <column order="22" name="TriagePosition" type="int(11)">
      <summary>The position in the 'Triage' tasklist that a task was in when it was claimed by a support technician.  It is 1 indexed.  Only used for our 'Triage' tasklist at OD HQ and is for training purposes.</summary>
    </column>
  </table>
  <table name="taskancestor">
    <summary>Represents one ancestor of one task.  Each task will have at least one ancestor unless it is directly on a main trunk.  
            An ancestor is defined as a tasklist that is higher in the hierarchy for the task, regardless of how many levels up it is.  
            This allows us to mark task lists as having "new" tasks, and it allows us to quickly check for new tasks for a user on startup.</summary>
    <column order="0" name="TaskAncestorNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TaskNum" type="bigint(20)" fk="task">
      <summary>FK to task.TaskNum</summary>
    </column>
    <column order="2" name="TaskListNum" type="bigint(20)" fk="tasklist">
      <summary>FK to tasklist.TaskListNum</summary>
    </column>
  </table>
  <table name="taskattachment">
    <summary>An attachment to a task. Attachment can be a document or a string.</summary>
    <column order="0" name="TaskAttachmentNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TaskNum" type="bigint(20)" fk="task">
      <summary>FK to task.TaskNum.</summary>
    </column>
    <column order="2" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum. If no document is attached, then this field will be 0.</summary>
    </column>
    <column order="3" name="TextValue" type="text">
      <summary>Used to store text that doesn't need to be visible from the main task edit window at all times.</summary>
    </column>
    <column order="4" name="Description" type="varchar(255)">
      <summary>A brief description of this attachment. If document is linked, used for document description as well.</summary>
    </column>
  </table>
  <table name="taskhist">
    <summary>A historical copy of a task.  These are generated as a result of a task being edited, so there can be multiple entries here per task.  When creating for insertion it needs a passed-in Task object.</summary>
    <column order="0" name="TaskHistNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNumHist" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum  Identifies the user that changed this task from this state, not the person who originally wrote it.</summary>
    </column>
    <column order="2" name="DateTStamp" type="datetime">
      <summary>The date and time that this task was edited and added to the Hist table. This value will not be updated by MySQL whenever the row changes.</summary>
    </column>
    <column order="3" name="IsNoteChange" type="tinyint(4)">
      <summary>True if the note was changed when this historical copy was created.</summary>
    </column>
    <column order="4" name="TaskNum" type="bigint(20)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="5" name="TaskListNum" type="bigint(20)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="6" name="DateTask" type="date">
      <summary>Copied from Task.</summary>
    </column>
    <column order="7" name="KeyNum" type="bigint(20)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="8" name="Descript" type="text">
      <summary>Copied from Task.</summary>
    </column>
    <column order="9" name="TaskStatus" type="tinyint(4)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="10" name="IsRepeating" type="tinyint(4)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="11" name="DateType" type="tinyint(4)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="12" name="FromNum" type="bigint(20)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="13" name="ObjectType" type="tinyint(4)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="14" name="DateTimeEntry" type="datetime">
      <summary>Copied from Task.</summary>
    </column>
    <column order="15" name="UserNum" type="bigint(20)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="16" name="DateTimeFinished" type="datetime">
      <summary>Copied from Task.</summary>
    </column>
    <column order="17" name="PriorityDefNum" type="bigint(20)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="18" name="ReminderGroupId" type="varchar(20)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="19" name="ReminderType" type="smallint(6)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="20" name="ReminderFrequency" type="int(11)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="21" name="DateTimeOriginal" type="datetime">
      <summary>Copied from Task.</summary>
    </column>
    <column order="22" name="SecDateTEdit" type="timestamp">
      <summary>Not copied from Task. Automatically updated by MySQL every time a row is added or changed.</summary>
    </column>
    <column order="23" name="DescriptOverride" type="varchar(255)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="24" name="IsReadOnly" type="tinyint(1)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="25" name="Category" type="bigint(20)">
      <summary>Copied from Task.</summary>
    </column>
    <column order="26" name="TriagePosition" type="int(11)">
      <summary>Copied from Task.</summary>
    </column>
  </table>
  <table name="tasklist">
    <summary>A tasklist is like a folder system, where it can have child tasklists as well as tasks.</summary>
    <column order="0" name="TaskListNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Descript" type="varchar(255)">
      <summary>The description of this tasklist.  Might be very long, but not usually.</summary>
    </column>
    <column order="2" name="Parent" type="bigint(20)" fk="tasklist">
      <summary>FK to tasklist.TaskListNum  The parent task list to which this task list is assigned.  If zero, then this task list is on the main trunk of one of the sections.</summary>
    </column>
    <column order="3" name="DateTL" type="date">
      <summary>Optional. Set to 0001-01-01 for no date.  If a date is assigned, then this list will also be available from the date section.</summary>
    </column>
    <column order="4" name="IsRepeating" type="tinyint">
      <summary>True if it is to show in the repeating section.  There should be no date.  All children should also be set to IsRepeating=true.</summary>
    </column>
    <column order="5" name="DateType" type="tinyint">
      <summary>Enum:TaskDateType  None, Day, Week, Month.  If IsRepeating, then setting to None effectively disables the repeating feature.</summary>
      <Enumeration name="TaskDateType">
        <summary>For use by the older Repeating Tasks feature.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="Day">1</EnumValue>
        <EnumValue name="Week">2</EnumValue>
        <EnumValue name="Month">3</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="FromNum" type="bigint(20)" fk="tasklist">
      <summary>FK to tasklist.TaskListNum  If this is derived from a repeating list, then this will hold the TaskListNum of that list.  It helps automate the adding and deleting of lists.  It might be deleted automatically if no tasks are marked complete.</summary>
    </column>
    <column order="7" name="ObjectType" type="tinyint">
      <summary>Enum:TaskObjectType  0=none, 1=Patient, 2=Appointment.  More will be added later. If a type is selected, then this list will be visible in the appropriate places for attaching the correct type of object.  The type is not copied to a task when created.  Tasks in this list do not have to be of the same type.  You can only attach an object to a task, not a tasklist.</summary>
      <Enumeration name="TaskObjectType">
        <summary>Used when attaching objects to tasks.  These are the choices.</summary>
        <EnumValue name="None">0</EnumValue>
        <EnumValue name="Patient">1</EnumValue>
        <EnumValue name="Appointment">2</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="DateTimeEntry" type="datetime">
      <summary>The date and time that this list was added.  Used to sort the list by the order entered.</summary>
    </column>
    <column order="9" name="GlobalTaskFilterType" type="tinyint(4)">
      <summary>Enum:GlobalTaskFilterType 0=Disabled, 1=Default, 2=None, 3=Clinic, 4=Region.  If a type is selected, then tasks in this tasklist will be filtered by default 
            such that only tasks that match the tasklist's GlobalFilterType will show in the view. Disabled is not valid for tasklists and will be treated as Default if applied to a tasklist; it is only valid on the TasksGlobalFilterType preference.</summary>
      <Enumeration name="GlobalTaskFilterType">
        <summary></summary>
      </Enumeration>
    </column>
    <column order="10" name="TaskListStatus" type="tinyint(4)">
      <summary>Enum:TaskListStatusEnum 0=Active, 1=Archived. Archived task lists are hidden from the Task Window's User, Main, and Reminder tabs by default.</summary>
      <Enumeration name="TaskListStatusEnum">
        <summary>Determines if a task list is Active or Archived.</summary>
        <EnumValue name="Active">0 - Active.</EnumValue>
        <EnumValue name="Archived">1 - Archived.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="tasknote">
    <summary>A tasknote is a note that may be added to a task. Many notes may be attached to a task. A user may only edit their own tasknotes within a task.</summary>
    <column order="0" name="TaskNoteNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TaskNum" type="bigint(20)" fk="task">
      <summary>FK to task.TaskNum. The task this tasknote is attached to.</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user who created this tasknote.</summary>
    </column>
    <column order="3" name="DateTimeNote" type="datetime">
      <summary>Date and time the note was created or last modified (editable).</summary>
    </column>
    <column order="4" name="Note" type="text">
      <summary>Note. Text that the user wishes to show on the task.</summary>
    </column>
  </table>
  <table name="tasksubscription">
    <summary>A subscription of one user to either a tasklist or to a task.</summary>
    <column order="0" name="TaskSubscriptionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum</summary>
    </column>
    <column order="2" name="TaskListNum" type="bigint(20)" fk="tasklist">
      <summary>FK to tasklist.TaskListNum  When this is not 0 then TaskNum will be 0.</summary>
    </column>
    <column order="3" name="TaskNum" type="bigint(20)" fk="task">
      <summary>FK to task.TaskNum.  When this is not 0 then TaskListNum will be 0.</summary>
    </column>
  </table>
  <table name="taskunread">
    <summary>When a task is created or a comment made, a series of these taskunread objects are created, one for each user who is subscribed to the tasklist.  Duplicates are intelligently avoided.  Rows are deleted once user reads the task.</summary>
    <column order="0" name="TaskUnreadNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TaskNum" type="bigint(20)" fk="task">
      <summary>FK to task.TaskNum.</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
  </table>
  <table name="terminalactive">
    <summary>Each row is 1 computer, or if in RDP session, 1 connection from 1 computer, currently acting as a terminal for patient input.</summary>
    <column order="0" name="TerminalActiveNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ComputerName" type="varchar(255)">
      <summary>The name of the computer where the terminal is active. On RDP, this is client name.</summary>
    </column>
    <column order="2" name="TerminalStatus" type="tinyint">
      <summary>Enum:TerminalStatusEnum  No longer used.  Instead, the PatNum field is used.  Used to indicates at what point the patient was in the
            sequence. 0=standby, 1=PatientInfo, 2=Medical, 3=UpdateOnly.  If status is 1, then nobody else on the network could open the patient edit
            window for that patient.</summary>
      <Enumeration name="TerminalStatusEnum">
        <summary>Indicates at what point the patient is in the sequence. 0=standby, 1=PatientInfo, 2=Medical, 3=UpdateOnly.</summary>
        <EnumValue name="Standby">0</EnumValue>
        <EnumValue name="PatientInfo">1</EnumValue>
        <EnumValue name="Medical">2</EnumValue>
        <EnumValue name="UpdateOnly">3. Only the patient info tab will be visible.  This is just to let patient up date their address and phone number.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.  The patient currently showing in the terminal.  If 0, then terminal is in standby mode.</summary>
    </column>
    <column order="4" name="SessionId" type="int(11)">
      <summary>The ID of the session from which this terminal instance was started.  The session ID is unique per computer login, so if this is a
            terminal server every remote connection will have a unique session ID.  A kiosk is identified by ComputerName+SessionId+ProcessId.</summary>
    </column>
    <column order="5" name="ProcessId" type="int(11)">
      <summary>The ID of the process that initiated this kiosk instance.  This is unique per active computer process, so if a row exists with a
            ProcessId that matches the instance we're about to start, we know it is safe to delete it, it must be left over and needs cleaned up.</summary>
    </column>
    <column order="6" name="SessionName" type="varchar(255)">
      <summary>The name of the computer used to make the remote connection to the app server when enabling kiosk mode. Could also be a name manually
            entered by the user if there's already a connection to the app server from the same computer session. This serves as a human-readable name for
            the ComputerName+SessionId+ProcessId to uniquely identify a kiosk. We will display the ComputerName and SessionName to the user in the kiosk
            manager, but we will use the ComputerName+SessionId+ProcessId when the kiosk checks for available forms to display.</summary>
    </column>
  </table>
  <table name="timeadjust">
    <summary>Used on employee timecards to make adjustments.  Used to make the end-of-the week OT entries.  Can be used instead of a clock event by admin so that a clock event doesn't have to be created.</summary>
    <column order="0" name="TimeAdjustNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EmployeeNum" type="bigint(20)" fk="employee">
      <summary>FK to employee.EmployeeNum</summary>
    </column>
    <column order="2" name="TimeEntry" type="datetime">
      <summary>The date and time that this entry will show on timecard.</summary>
    </column>
    <column order="3" name="RegHours" type="time">
      <summary>The number of regular hours to adjust timecard by.  Can be + or -.</summary>
    </column>
    <column order="4" name="OTimeHours" type="time">
      <summary>Overtime hours. Usually +.  Automatically combined with a - adj to RegHours.  Another option is clockevent.OTimeHours.</summary>
    </column>
    <column order="5" name="Note" type="text">
      <summary>.</summary>
    </column>
    <column order="6" name="IsAuto" type="tinyint(4)">
      <summary>Set to true if this adjustment was automatically made by the system.  When the calc weekly OT tool is run, these types of adjustments are fair game for deletion.  Other adjustments are preserved.</summary>
    </column>
    <column order="7" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  The clinic the TimeAdjust was entered at.</summary>
    </column>
    <column order="8" name="PtoDefNum" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum.  Defaults to 0.  Is set to 0 for general adjustments.
            When not 0, points to a definition in the TimeCardAdjTypes category.</summary>
    </column>
    <column order="9" name="PtoHours" type="time">
      <summary>PTO Hours.  The number of PTO hours applied to a specific day.  Ignored if PtoDefNum is 0.</summary>
    </column>
    <column order="10" name="IsUnpaidProtectedLeave" type="tinyint(4)">
      <summary>Defaults to false. True when this TimeAdjust is for unpaid protected leave. Hours from unpaid protected leave adjustments contribute to hours worked, but not to payable hours.</summary>
    </column>
    <column order="11" name="SecuUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that created this TimeAdjust.</summary>
    </column>
  </table>
  <table name="timecardrule">
    <summary>A rule for automation of timecard overtime.  Can apply to one employee or all.</summary>
    <column order="0" name="TimeCardRuleNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="EmployeeNum" type="bigint(20)" fk="employee">
      <summary>FK to employee.EmployeeNum. If zero, then this rule applies to all employees.</summary>
    </column>
    <column order="2" name="OverHoursPerDay" type="time">
      <summary>Typical example is 8:00.  In California, any work after the first 8 hours is overtime.</summary>
    </column>
    <column order="3" name="AfterTimeOfDay" type="time">
      <summary>Typical example is 16:00 to indicate that all time worked after 4pm for specific employees is at Rate2 rate.</summary>
    </column>
    <column order="4" name="BeforeTimeOfDay" type="time">
      <summary>Typical example is 6:00 to indicate that all time worked before 6am for specific employees is at Rate2 rate.</summary>
    </column>
    <column order="5" name="IsOvertimeExempt" type="tinyint(4)">
      <summary>Indicates if the employee should have overtime calculated for their hours worked in a pay period.</summary>
    </column>
    <column order="6" name="MinClockInTime" type="time">
      <summary>When set this is the earliest an employee can clock in. Otherwise minimum dateTime represents not set.</summary>
    </column>
    <column order="7" name="HasWeekendRate3" type="tinyint(4)">
      <summary>Indicates if the employee is eligible to earn Rate3 rate for weekend hours.</summary>
    </column>
  </table>
  <table name="toolbutitem">
    <summary>Each row represents one toolbar button to be placed on a toolbar and linked to a program.</summary>
    <column order="0" name="ToolButItemNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ProgramNum" type="bigint(20)" fk="program">
      <summary>FK to program.ProgramNum.</summary>
    </column>
    <column order="2" name="ToolBar" type="smallint">
      <summary>Enum:EnumToolBar The toolbar to show the button on.</summary>
      <Enumeration name="EnumToolBar">
        <summary></summary>
        <EnumValue name="AccountModule">0</EnumValue>
        <EnumValue name="ApptModule">1</EnumValue>
        <EnumValue name="ChartModule">2</EnumValue>
        <EnumValue name="ImagingModule">3</EnumValue>
        <EnumValue name="FamilyModule">4</EnumValue>
        <EnumValue name="TreatmentPlanModule">5</EnumValue>
        <EnumValue name="ClaimsSend">6</EnumValue>
        <EnumValue name="MainToolbar">7 Shows in the toolbar at the top that is common to all modules.</EnumValue>
        <EnumValue name="ReportsMenu">8 Shows in the main menu Reports submenu.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="ButtonText" type="varchar(255)">
      <summary>The text to show on the toolbar button.</summary>
    </column>
  </table>
  <table name="toothgridcell">
    <summary>Holds one recorded cell value for a tooth grid, which is a special kind of sheet field type that shows a grid with 32 rows and configurable columns.  The entire grid is a single large sheet field.</summary>
    <column order="0" name="ToothGridCellNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SheetFieldNum" type="bigint(20)" fk="sheetfield">
      <summary>FK to sheetfield.SheetFieldNum.  Required.</summary>
    </column>
    <column order="2" name="ToothGridColNum" type="bigint(20)" fk="toothgridcol">
      <summary>FK to toothgridcol.ToothGridColNum.  This tells which column it belongs in.  Can't use the column name here because multiple columns could have the same name.</summary>
    </column>
    <column order="3" name="ValueEntered" type="varchar(255)">
      <summary>Cannot be empty.  For a tooth-level cell, the only allowed value is X.  If the cell is unchecked, then it won't even have a row in this table.  For a surface level column, only valid surfaces can be entered:MOIDBFLV  Enforced.  FreeText columns can have any text up to 255 char.</summary>
    </column>
    <column order="4" name="ToothNum" type="varchar(10)">
      <summary>Corresponds exactly to procedurelog.ToothNum.  May be blank, otherwise 1-32, 51-82, A-T, or AS-TS, 1 or 2 char.  Gets internationalized as being displayed.</summary>
    </column>
  </table>
  <table name="toothgridcol">
    <summary>Defines the columns present in a single completed tooth grid, which is a special kind of sheet field that shows a grid with 32 rows and configurable columns.  The entire grid is a single large sheet field.  This table defines how the grid is layed out on an actual sheet, pulled initially from a ToothGridDef.  The data itself is recorded in ToothGridCell.</summary>
    <column order="0" name="ToothGridColNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="SheetFieldNum" type="bigint(20)" fk="sheet">
      <summary>FK to sheet.SheetFieldNum.  Required.</summary>
    </column>
    <column order="2" name="NameItem" type="varchar(255)">
      <summary>Pulled from the ToothGridDef.  This can be a NameInternal , or it can be a NameShowing if it's a user-defined column.</summary>
    </column>
    <column order="3" name="CellType" type="tinyint(4)">
      <summary>Enum:ToothGridCellType  0=HardCoded, 1=Tooth, 2=Surface, 3=FreeText.</summary>
      <Enumeration name="ToothGridCellType">
        <summary>0=HardCoded, 1=Tooth, 2=Surface, 3=FreeText.</summary>
        <EnumValue name="HardCoded">0</EnumValue>
        <EnumValue name="Tooth">1</EnumValue>
        <EnumValue name="Surface">2</EnumValue>
        <EnumValue name="FreeText">3</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ItemOrder" type="smallint(6)">
      <summary>Order of the column to display.  Every entry must have a unique itemorder.</summary>
    </column>
    <column order="5" name="ColumnWidth" type="smallint(6)">
      <summary>.</summary>
    </column>
    <column order="6" name="CodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum.  This allows data entered to flow into main program as actual completed or tp procedures.</summary>
    </column>
    <column order="7" name="ProcStatus" type="tinyint(4)">
      <summary>Enum:ProcStat  If these flow into main program, then this is the status that the new procs will have.</summary>
      <Enumeration name="ProcStat">
        <summary>Procedure Status.  These statuses are translated via class type "enumProcStat" (ex Lan.g("enumProcStat","..."))</summary>
        <EnumValue name="None">0 - Not used.</EnumValue>
        <EnumValue name="TP">1- Treatment Plan.</EnumValue>
        <EnumValue name="C">2- Complete.</EnumValue>
        <EnumValue name="EC">3- Existing Current Provider.</EnumValue>
        <EnumValue name="EO">4- Existing Other Provider.</EnumValue>
        <EnumValue name="R">5- Referred Out.</EnumValue>
        <EnumValue name="D">6- Deleted.</EnumValue>
        <EnumValue name="Cn">7- Condition.</EnumValue>
        <EnumValue name="TPi">8- Treatment Plan inactive.</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="toothgriddef">
    <summary> Defines the columns present in a tooth grid, which is a special kind of sheet field def that shows a grid with 32 rows and configurable columns.  Can be edited without damaging any completed sheets.</summary>
    <column order="0" name="ToothGridDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="NameInternal" type="varchar(255)">
      <summary>This is the internal name that OD uses to identify the column.  Blank if this is a user-defined column.  We will keep a hard-coded list of available NameInternals in the code to pick from.</summary>
    </column>
    <column order="2" name="NameShowing" type="varchar(255)">
      <summary>The user may override the internal name for display purposes.  If this is a user-defined column, this is the only name, since there is no NameInternal.</summary>
    </column>
    <column order="3" name="CellType" type="tinyint(4)">
      <summary>Enum:ToothGridCellType  0=HardCoded, 1=Tooth, 2=Surface, 3=FreeText.</summary>
      <Enumeration name="ToothGridCellType">
        <summary>0=HardCoded, 1=Tooth, 2=Surface, 3=FreeText.</summary>
        <EnumValue name="HardCoded">0</EnumValue>
        <EnumValue name="Tooth">1</EnumValue>
        <EnumValue name="Surface">2</EnumValue>
        <EnumValue name="FreeText">3</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ItemOrder" type="smallint(6)">
      <summary>Order of the column to display.  Every entry must have a unique itemorder.</summary>
    </column>
    <column order="5" name="ColumnWidth" type="smallint(6)">
      <summary>.</summary>
    </column>
    <column order="6" name="CodeNum" type="bigint(20)" fk="procedurecode">
      <summary>FK to procedurecode.CodeNum.  This allows data entered to flow into main program as actual completed or tp procedures.</summary>
    </column>
    <column order="7" name="ProcStatus" type="tinyint(4)">
      <summary>Enum:ProcStat  If these flow into main program, then this is the status that the new procs will have.</summary>
      <Enumeration name="ProcStat">
        <summary>Procedure Status.  These statuses are translated via class type "enumProcStat" (ex Lan.g("enumProcStat","..."))</summary>
        <EnumValue name="None">0 - Not used.</EnumValue>
        <EnumValue name="TP">1- Treatment Plan.</EnumValue>
        <EnumValue name="C">2- Complete.</EnumValue>
        <EnumValue name="EC">3- Existing Current Provider.</EnumValue>
        <EnumValue name="EO">4- Existing Other Provider.</EnumValue>
        <EnumValue name="R">5- Referred Out.</EnumValue>
        <EnumValue name="D">6- Deleted.</EnumValue>
        <EnumValue name="Cn">7- Condition.</EnumValue>
        <EnumValue name="TPi">8- Treatment Plan inactive.</EnumValue>
      </Enumeration>
    </column>
    <column order="8" name="SheetFieldDefNum" type="bigint(20)" fk="sheetfielddef">
      <summary>FK to sheetfielddef.SheetFieldDefNum</summary>
    </column>
  </table>
  <table name="toothinitial">
    <summary>Used to track missing teeth, primary teeth, movements, and drawings.</summary>
    <column order="0" name="ToothInitialNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum</summary>
    </column>
    <column order="2" name="ToothNum" type="varchar(2)">
      <summary>1-32 or A-Z. Supernumeraries not supported here yet.</summary>
    </column>
    <column order="3" name="InitialType" type="tinyint">
      <summary>Enum:ToothInitialType</summary>
      <Enumeration name="ToothInitialType">
        <summary></summary>
        <EnumValue name="Missing">0</EnumValue>
        <EnumValue name="Hidden">1 - Also hides the number.  Number can be primary or permanent.</EnumValue>
        <EnumValue name="Primary">2 - Only used with 1-32.  "sets" this tooth as a primary tooth.  The result is that the primary tooth shows in addition to the perm, and that the letter shows in addition to the number.  It also does a Shift0 -12 and some other handy movements.  Even if this is set to true, there can be a separate entry for a missing primary tooth; this would be almost equivalent to not even setting the tooth as primary, but would also allow user to select the letter.</EnumValue>
        <EnumValue name="ShiftM">3 - Mesial mm</EnumValue>
        <EnumValue name="ShiftO">4 - Occlusal/incisal mm</EnumValue>
        <EnumValue name="ShiftB">5 - Buccal aka Labial mm</EnumValue>
        <EnumValue name="Rotate">6 - Clockwise as viewed from occlusal/incisal.</EnumValue>
        <EnumValue name="TipM">7 - Mesial degrees</EnumValue>
        <EnumValue name="TipB">8 - Buccal degrees</EnumValue>
        <EnumValue name="Drawing">9 - One segment of a drawing.</EnumValue>
        <EnumValue name="Text">10 - Location and string, combined</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="Movement" type="float">
      <summary>Shift in mm, or rotation / tipping in degrees.</summary>
    </column>
    <column order="5" name="DrawingSegment" type="text">
      <summary>Point data for a drawing segment.  The format would look similar to this: 45,68;48,70;49,72;0,0;55,88;etc.  It's simply a sequence of points, separated by semicolons.  Only positive numbers are used.  0,0 is the upper left of the tooth chart, and the lower right is at 410,307.  This scale of 410,307 is always used, regardless of how the tooth chart control is scaled for viewing.  Floats with tenths can be included.  If the pen is picked up, it becomes a new segment, so a new row in the database.</summary>
    </column>
    <column order="6" name="ColorDraw" type="int(11)">
      <summary>.</summary>
    </column>
    <column order="7" name="SecDateTEntry" type="datetime">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="8" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="9" name="DrawText" type="varchar(255)">
      <summary>For text not associated with any tooth. The location of the text within 410,307 is incorporated into this string.  Example: 25.3,123.8;This shows.  Carriage returns etc are not supported.  ColorDraw is used.</summary>
    </column>
  </table>
  <table name="transaction">
    <summary>Used in the accounting section of the program.  Each row is one transaction in the ledger, and must always have at least two JournalEntries (splits).  All JournalEntries must always add up to zero.</summary>
    <column order="0" name="TransactionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateTimeEntry" type="datetime">
      <summary>Not user editable.  Server time.</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that entered this transaction.</summary>
    </column>
    <column order="3" name="DepositNum" type="bigint(20)" fk="deposit">
      <summary>FK to deposit.DepositNum.  Will eventually be replaced by a source document table, and deposits will just be one of many types.</summary>
    </column>
    <column order="4" name="PayNum" type="bigint(20)" fk="payment">
      <summary>FK to payment.PayNum.  Like DepositNum, it will eventually be replaced by a source document table, and payments will just be one of many types.</summary>
    </column>
    <column order="5" name="SecUserNumEdit" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user who last edited this transaction.</summary>
    </column>
    <column order="6" name="SecDateTEdit" type="timestamp">
      <summary>The last time this transaction was edited.</summary>
    </column>
    <column order="7" name="TransactionInvoiceNum" type="bigint(20)" fk="transactioninvoice">
      <summary>FK to transactioninvoice.TransactionInvoiceNum.  A document that can be attached to the transaction.</summary>
    </column>
    <column order="8" name="NeedsReview" type="tinyint(4)">
      <summary>Deprecated</summary>
    </column>
  </table>
  <table name="transactioninvoice">
    <summary>Used in the accounting section of the program.  Each row contains a document that is attached to a transaction.</summary>
    <column order="0" name="TransactionInvoiceNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FileName" type="varchar(255)">
      <summary>File name including the extension.</summary>
    </column>
    <column order="2" name="InvoiceData" type="mediumtext">
      <summary>The raw file data converted to base64. Will be blank when using FilePath.</summary>
    </column>
    <column order="3" name="FilePath" type="varchar(255)">
      <summary>Full file path. Will be blank when using InvoiceData.</summary>
    </column>
  </table>
  <table name="treatplan">
    <summary>Stores all treatment plans, including Active, Inactive, and Saved treatment plans. 
             Active and Inactive treatment plans use treatplanattaches to reference attached procedures. As procedures are set complete, they get
             removed from active and inactive treatment plans. Saved treatment plans use proctps, which are copies of the procedure, 
             and will not change after being saved. </summary>
    <column order="0" name="TreatPlanNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="DateTP" type="date">
      <summary>The date of the treatment plan</summary>
    </column>
    <column order="3" name="Heading" type="varchar(255)">
      <summary>The heading that shows at the top of the treatment plan.  Usually 'Proposed Treatment Plan'</summary>
    </column>
    <column order="4" name="Note" type="text">
      <summary>A note specific to this treatment plan that shows at the bottom.</summary>
    </column>
    <column order="5" name="Signature" type="text">
      <summary>The encrypted and bound signature in base64 format.  The signature is bound to the concatenation of the tp Note, DateTP, and to each proctp Descript and PatAmt.</summary>
    </column>
    <column order="6" name="SigIsTopaz" type="tinyint(1)">
      <summary>True if the signature is in Topaz format rather than OD format.</summary>
    </column>
    <column order="7" name="ResponsParty" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum. Can be 0.  The patient responsible for approving the treatment.  Public health field not visible to everyone else.</summary>
    </column>
    <column order="8" name="DocNum" type="bigint(20)" fk="document">
      <summary>FK to document.DocNum. Can be 0.  If signed, this is the pdf document of the TP at time of signing. See PrefName.TreatPlanSaveSignedToPdf</summary>
    </column>
    <column order="9" name="TPStatus" type="tinyint(4)">
      <summary>Enum:TreatPlanStatus Determines the type of treatment plan this is. 0 - Saved, 1 - Active, 2 - Inactive.</summary>
      <Enumeration name="TreatPlanStatus">
        <summary>0 - Saved, 1 - Active, 2 - Inactive </summary>
        <EnumValue name="Saved">0 - Saved treatment plans. Prior to version 15.4.1 all treatment plans were considered archived. Archived TPs are linked to ProcTPs.</EnumValue>
        <EnumValue name="Active">1 - Current active TP. There should be only one Active TP per patient. This is a TP linked directly to procedures via the TreatPlanAttach table.</EnumValue>
        <EnumValue name="Inactive">2 - Current inactive TP. This is a TP linked directly to procedures via the TreatPlanAttach table.</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="SecUserNumEntry" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  Set to the user logged in when the row was inserted at SecDateEntry date and time.</summary>
    </column>
    <column order="11" name="SecDateEntry" type="date">
      <summary>Timestamp automatically generated and user not allowed to change.  The actual date of entry.</summary>
    </column>
    <column order="12" name="SecDateTEdit" type="timestamp">
      <summary>Automatically updated by MySQL every time a row is added or changed. Could be changed due to user editing, custom queries or program
            updates.  Not user editable with the UI.</summary>
    </column>
    <column order="13" name="UserNumPresenter" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum. The user that will present the treatment plan. 
            Defaults to the user that entered the treatment plan, but can be changed with the TreatPlanPresenterEdit permission.</summary>
    </column>
    <column order="14" name="TPType" type="tinyint(4)">
      <summary>Enum:TreatPlanType Determines the type of insurance this treatment plan was saved with.  Used for displaying proper information when loading.</summary>
      <Enumeration name="TreatPlanType">
        <summary>0 - Insurance, 1 - Discount Plan</summary>
        <EnumValue name="Insurance">0 - Treatment plan saved for regular insurance.</EnumValue>
        <EnumValue name="Discount">1 - Treatment plan saved for discount plan.</EnumValue>
      </Enumeration>
    </column>
    <column order="15" name="SignaturePractice" type="text">
      <summary>The encrypted and bound signature in base64 format.  The signature is bound to the concatenation of the tp Note, DateTP, and to each proctp Descript and PatAmt.</summary>
    </column>
    <column order="16" name="DateTSigned" type="datetime">
      <summary>The date of the treatment plan is signed.</summary>
    </column>
    <column order="17" name="DateTPracticeSigned" type="datetime">
      <summary>The date of the treatment plan is signed by the office.</summary>
    </column>
    <column order="18" name="SignatureText" type="varchar(255)">
      <summary>The typed name of the person who signed the treatplan.</summary>
    </column>
    <column order="19" name="SignaturePracticeText" type="varchar(255)">
      <summary>The typed name of the person who signed the practice signature.</summary>
    </column>
    <column order="20" name="MobileAppDeviceNum" type="bigint(20)" fk="mobileappdevice">
      <summary>FK to MobileAppDevice.</summary>
    </column>
  </table>
  <table name="treatplanattach">
    <summary>Links active and inactive treatment plans to procedurelog rows. When the treatment plan or chart modules are selected, any treatplanattach rows that are linked to
            completed or deleted procedures will be deleted.</summary>
    <column order="0" name="TreatPlanAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TreatPlanNum" type="bigint(20)" fk="treatplan">
      <summary>FK to treatplan.TreatPlanNum.</summary>
    </column>
    <column order="2" name="ProcNum" type="bigint(20)" fk="procedurelog">
      <summary>FK to procedurelog.ProcNum.</summary>
    </column>
    <column order="3" name="Priority" type="bigint(20)" fk="definition">
      <summary>FK to definition.DefNum, which contains the text of the priority. Identical to Procedure.Priority but used to allow different priorities
             for the same procedure depending on which TP it is a part of.</summary>
    </column>
  </table>
  <table name="treatplanparam">
    <summary>Stores check box information for each treatment plan, so that when a signed treatment plan PDF needs to be saved from
            eClipboard, it can correctly save and generate the PDF.</summary>
    <column order="0" name="TreatPlanParamNum" type="bigint(20)">
      <summary></summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to Patient.</summary>
    </column>
    <column order="2" name="TreatPlanNum" type="bigint(20)" fk="treatplan">
      <summary>FK to TreatPlan.</summary>
    </column>
    <column order="3" name="ShowDiscount" type="tinyint(4)">
      <summary>Value is set by the Discount check box in the Tx Module.</summary>
    </column>
    <column order="4" name="ShowMaxDed" type="tinyint(4)">
      <summary>Value is set by the Use Ins Max and Deduct check box in the Tx Module.</summary>
    </column>
    <column order="5" name="ShowSubTotals" type="tinyint(4)">
      <summary>Value is set by the Subtotals check box in the Tx Module.</summary>
    </column>
    <column order="6" name="ShowTotals" type="tinyint(4)">
      <summary>Value is set by the Totals check box in the Tx Module.</summary>
    </column>
    <column order="7" name="ShowCompleted" type="tinyint(4)">
      <summary>Value is set by the Graphical Completed Tx check box in the Tx Module.</summary>
    </column>
    <column order="8" name="ShowFees" type="tinyint(4)">
      <summary>Value is set by the Fees check box in the Tx Module.</summary>
    </column>
    <column order="9" name="ShowIns" type="tinyint(4)">
      <summary>Value is set by the Insurances Estimates check box in the Tx Module.</summary>
    </column>
  </table>
  <table name="tsitranslog">
    <summary>Transworld Systems Inc (TSI) transaction log.  Logs communication between the Open Dental program and TSI.  Entries contain information
            about accounts placed with TSI, payments or adjustments to accounts placed, or transactions to Suspend, Reinstate or Cancel accounts.</summary>
    <column order="0" name="TsiTransLogNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the guarantor of the account sent to TSI for collection services.  TSI refers to this as the Debtor Reference
            or Responsible Party Account Number.</summary>
    </column>
    <column order="2" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  The user who sent the account for placement with TSI or who suspended, reinstated or cancelled collection
            services for an account placed with TSI or who created the payment/adjustment for an account placed with TSI.</summary>
    </column>
    <column order="3" name="TransType" type="tinyint(4)">
      <summary>Enum:TsiTransType - Identifies the transaction message sent to TSI.  Can be a message for placing/cancelling/suspending/reinstating
            collection services for an account or to notify TSI of a payment/writeoff/adjustment entered into OD.</summary>
      <Enumeration name="TsiTransType">
        <summary>Identifies the transaction type represented by this log entry.  Could be a for placing/cancelling/suspending/reinstating an account or
            for a payment/writeoff/adjustment to an account balance.  Don't remove items or alter order of this enum, FKey requires this to be static.</summary>
        <EnumValue name="None">-1 - None: Used for marking trans that represent account items NOT sent to Transworld.  The TsiTransLogs with this trans type are used
            to prevent the ODService from sending the trans to Transworld.  Example: Transworld collects a payment from a patient and deduct their fee and
            send the practice the remaining amt.  Office staff will enter the payment in the patient's account and then enter an adjustment to account for
            Transworld's fee.  TsiTransLogs will be inserted for the paysplits and adjustment so that we don't send those trans to Transworld and cause an
            infinite loop of sorts.  Logs with this type will be update by the ODService if the ledger trans amt is updated.</EnumValue>
        <EnumValue name="CN">0 - Cancel: cancel collection services for an account. Collection services can be restarted but will incur another TSI fee.</EnumValue>
        <EnumValue name="CR">1 - Credit Adjustment: negative adjustment to reduce balance. Example: a discount given or portion of the debt written off.</EnumValue>
        <EnumValue name="DB">2 - Debit Adjustment: positive adjustment to increase balance.  Offices are supposed to stop all finance charges once placed with TSI,
            but there may be other transactions that require increasing the amount owed.</EnumValue>
        <EnumValue name="PF">3 - Paid in Full: payment entered that pays off account balance.  Closes account with TSI and stops collection activity.</EnumValue>
        <EnumValue name="PL">4 - Placement: account sent to TSI for Accelerator/Profit Recovery/Collection services.</EnumValue>
        <EnumValue name="PP">5 - Partial Payment: payment by either patient or ins payment/writeoff that pays a portion of the balance.</EnumValue>
        <EnumValue name="PT">6 - Paid in Full, Thank You: payment entered that pays off account balance.  Closes account with TSI and stops collection activity.
            TSI will send a Thank You letter to the patient free of charge.</EnumValue>
        <EnumValue name="RI">7 - Reinstate: an account that has been suspended can be reinstated within 50 days and the collection services will resume where it
            left off.  After 50 days the account is automatically cancelled and in order to restart collection services the office would have to initiate a
            new placement, which will incur another TSI fee.</EnumValue>
        <EnumValue name="SS">8 - Suspend: places collection services for the account on hold for up to 50 days.  Example: After an account is placed with TSI, the
            customer comes into the office and agrees to a payment plan.  The account can be suspended and if the patient fails to make a payment within 50
            days the account can be reinstated and the collection process will resume where it left off and TSI will not charge an additional fee.  After
            50 days the account is automatically cancelled by TSI and in order to restart the collection process, the office would have to initiate a new
            placement which starts the collection process over and will result in an additional TSI fee.</EnumValue>
        <EnumValue name="Agg">9 - To differentiate aggregate rows from rows linked to transactions in the OD db.</EnumValue>
        <EnumValue name="Excluded">10 - Used for adjustments entered with the SyncExcludePosAdjType or SyncExcludeNegAdjType set in the Transworld program link.
            Excluded from syncing with TSI and from the amount due calculation used in future msgs or to determine if the acct is paid in full.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="TransDateTime" type="datetime">
      <summary>Timestamp at which this row was created. Auto generated on insert.  Identifies exactly when the action happened in OD to cause the
            message to be sent to TSI.</summary>
    </column>
    <column order="5" name="ServiceType" type="tinyint(4)">
      <summary>Enum:TsiServiceType - for placements, this is the type of collection activity that will start on the account being placed.</summary>
      <Enumeration name="TsiServiceType">
        <summary>Don't remove items or alter order of this enum, FKey requires this to be static.</summary>
        <EnumValue name="Accelerator">0 - Accelerator</EnumValue>
        <EnumValue name="ProfitRecovery">1 - Profit Recovery</EnumValue>
        <EnumValue name="ProfessionalCollections">2 - Professional Collections</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="ServiceCode" type="tinyint(4)">
      <summary>Enum:TsiServiceCode - for placements, intensity of first letter sent to guarantor.  Will usually be 0 - Diplomatic.</summary>
      <Enumeration name="TsiServiceCode">
        <summary>The service code determines the intensity of the first letter.  According to a TSI rep during a conference call, Diplomatic will be what
            most offices will want to use.  Bad check is rarely used.  Don't remove items or alter order of this enum, FKey requires this to be static.</summary>
        <EnumValue name="Diplomatic">0 - Diplomatic: most commonly used service code.</EnumValue>
        <EnumValue name="Intensive">1 - Intensive:  More intense first letter.</EnumValue>
        <EnumValue name="BadCheck">3 - Bad Check: in a conference call with TSI one of the reps said this is rarely used.</EnumValue>
      </Enumeration>
    </column>
    <column order="7" name="TransAmt" type="double">
      <summary>Used for payments/writeoffs/adjustments, amount applied to the debt.</summary>
    </column>
    <column order="8" name="AccountBalance" type="double">
      <summary>Total balance due on the account by the patient, i.e. BalTotal-InsPayEst-WoEst.  If this is a placement, this is the debt amount TSI
            is going to attempt to collect.  If this is a payment/writeoff/adjustment, this is the new balance after the transaction amount is applied to
            the debt.</summary>
    </column>
    <column order="9" name="FKeyType" type="tinyint(4)">
      <summary>Enum:TsiFKeyType - Used in conjunction with FKey to point to the item that this log row represents.</summary>
      <Enumeration name="TsiFKeyType">
        <summary>Identifies the table to which FKey points.  Don't remove items or alter order of this enum, FKey requires this to be static.</summary>
        <EnumValue name="None">-1 - None.  For place, suspend, cancel, agg.</EnumValue>
        <EnumValue name="Adjustment">0 - adjustment.AdjNum.  Can be a positive (Debit) or negative (Credit) adjustment to the amount owed.  The resulting message
            TsiTransType is DB (Debit) for positive adjustments or CR (Credit) for negative adjustments.</EnumValue>
        <EnumValue name="Claimproc">1 - claimproc.ClaimProcNum. For ins payments and/or writeoffs entered after the account has been placed with TSI.  The resulting
            message TsiTransType is PP (Partial Payment), PF (Paid in Full), or PT (Paid in Full, Thank You).</EnumValue>
        <EnumValue name="PayPlan">2 - payplan.PayPlanNum.  In payplan version 1 the entire CompletedAmt is aged, so it will be negative (credit) and decrease the amount
            owed.  The resulting message TsiTransType is CR (Credit).</EnumValue>
        <EnumValue name="PayPlanCharge">3 - payplancharge.PayPlanChargeNum.  Depends on payplan version, could be negative (credit - decrease amount owed) or
            positive (debit - increase amount owed).  The resulting message TsiTransType is DB (Debit) if positive or CR (Credit) if negative.</EnumValue>
        <EnumValue name="PaySplit">4 - paysplit.SplitNum.  Patient payment on an account placed with TSI.  The resulting message TsiTransType is PP (Partial Payment),
            PF (Paid in Full), or PT (Paid in Full, Thank You).</EnumValue>
        <EnumValue name="Procedure">5 - procedurelog.ProcNum.  Positive (debit, increases the amount owed).  The resulting message TsiTransType is DB (Debit).</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="FKey" type="bigint(20)">
      <summary>Foreign key to the table defined by the corresponding FKeyType.  Currently supports paysplit.SplitNum, claimproc.ClaimProcNum,
            adjustment.AdjNum, procedurelog.ProcNum, payplan.PayPlanNum, payplancharge.PayPlanChargeNum.</summary>
    </column>
    <column order="11" name="RawMsgText" type="varchar(1000)">
      <summary>Raw pipe-delimited message sent to TSI.</summary>
    </column>
    <column order="12" name="ClientId" type="varchar(25)">
      <summary>If ServiceType for the placement is TsiDemandType.AcceleratorPr, this will be the Accelerator/Profit Recovery client ID.
            If TsiServiceType.Collection it will be the Collection client ID. Will always match the first field, Client Number, in the RawMsgText.</summary>
    </column>
    <column order="13" name="TransJson" type="mediumtext">
      <summary>Json serialized string representation of the TsiTrans list used to calculate the account balance for this guarantor at the time of
            placement with Transworld.  Used to update Transworld if any of the transactions are modified after placement.</summary>
    </column>
    <column order="14" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  This will be 0 if clinics are not enabled.  This will be 0 for logs prior to version 18.4.</summary>
    </column>
    <column order="15" name="AggTransLogNum" type="bigint(20)" fk="tsitranslog">
      <summary>FK to tsitranslog.TransLogNum.  Will be 0 if not part of an aggregate group.  Will be 0 for logs prior to version 18.4.</summary>
    </column>
  </table>
  <table name="ucum">
    <summary>Unified Code for Units of Measure.  UCUM is not a stricly defined list of codes but is instead a language definition that allows for all units and derived units to be named.  Examples: g (grams), g/L (grams per liter), g/L/s (grams per liter per second), g/L/s/s (grams per liter per second per second), etc... are all allowed units meaning there is an infinite number of units that can be defined using UCUM conventions.  The codes stored in this table are merely a common subset that was readily available and premade.</summary>
    <column order="0" name="UcumNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UcumCode" type="varchar(255)">
      <summary>Indexed.  Also called concept code. Example: mol/mL</summary>
    </column>
    <column order="2" name="Description" type="varchar(255)">
      <summary>Also called Concept Name.  Human readable form of the UCUM code. Example: Moles Per MilliLiter [Substance Concentration Units]</summary>
    </column>
    <column order="3" name="IsInUse" type="tinyint(4)">
      <summary>True if this unit of measure is or has ever been in use.  Useful for assisting users to select common units.</summary>
    </column>
  </table>
  <table name="updatehistory">
    <summary>Makes an entry every time Open Dental has successfully updated to a newer version.
            New entries will always be for the newest version being used so that users can see a "history" of how long they used previous versions.
            This will also help EHR customers when attesting or when they get audited.</summary>
    <column order="0" name="UpdateHistoryNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="DateTimeUpdated" type="datetime">
      <summary>DateTime that OD was updated to the Version.</summary>
    </column>
    <column order="2" name="ProgramVersion" type="varchar(255)">
      <summary>The version that OD was updated to.</summary>
    </column>
    <column order="3" name="Signature" type="text">
      <summary>Obfuscated string containing when and who accepted the license agreement.</summary>
    </column>
  </table>
  <table name="userclinic">
    <summary>This creates a many-to-many relationship between users and clinics. An entry in this table means that the user has access to the clinic. Not used unless userod.ClinicIsRestricted is turned on for a user.  Userod.Clinic is also used separately, regardless of whether this table is used. Provider access is derived from this by using the userod.ProvNum.</summary>
    <column order="0" name="UserClinicNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum</summary>
    </column>
  </table>
  <table name="usergroup">
    <summary>A group of users.  Security permissions are determined by the usergroup of a user.</summary>
    <column order="0" name="UserGroupNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="UserGroupNumCEMT" type="bigint(20)" fk="usergroup">
      <summary>FK to usergroup.UserGroupNum.  The user group num within the Central Manager database.  Only editable via CEMT.  Can change when CEMT syncs.</summary>
    </column>
  </table>
  <table name="usergroupattach">
    <summary>Allows multiple groups to be attached to a user.  Security permissions are determined by the usergroups of a user.</summary>
    <column order="0" name="UserGroupAttachNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="2" name="UserGroupNum" type="bigint(20)" fk="usergroup">
      <summary>FK to usergroup.UserGroupNum. </summary>
    </column>
  </table>
  <table name="userod">
    <summary>(User OD since "user" is a reserved word) Users are a completely separate entity from Providers and Employees even though they can be linked.  A usernumber can never be changed, ensuring a permanent way to record database entries and leave an audit trail.  A user can be a provider, employee, or neither.</summary>
    <column order="0" name="UserNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserName" type="varchar(255)">
      <summary>.</summary>
    </column>
    <column order="2" name="Password" type="varchar(255)">
      <summary>The password details in a "HashType$Salt$Hash" format, separating the different fields by '$'.
            This is NOT the actual password but the encoded password hash.
            If the contents of this variable are not in the aforementioned format, it is assumed to be a legacy password hash (MD5).</summary>
    </column>
    <column order="3" name="UserGroupNum" type="bigint(20)">
      <summary>Deprecated. Use UserGroupAttaches to link Userods to UserGroups.</summary>
    </column>
    <column order="4" name="EmployeeNum" type="bigint(20)" fk="employee">
      <summary>FK to employee.EmployeeNum. Used for timecards to block access by other users.</summary>
    </column>
    <column order="5" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  Default clinic for this user.  It causes new patients to default to this clinic when entered by this user.  If 0, then user has no default clinic or default clinic is HQ if clinics are enabled. Also see userod.ClinicIsRestricted and userclinic table.</summary>
    </column>
    <column order="6" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  It is possible to have multiple userods attached to a single provider.</summary>
    </column>
    <column order="7" name="IsHidden" type="tinyint(1)">
      <summary>Set true to hide user from login list.</summary>
    </column>
    <column order="8" name="TaskListInBox" type="bigint(20)" fk="tasklist">
      <summary>FK to tasklist.TaskListNum.  0 if no inbox setup yet.  It is assumed that the TaskList is in the main trunk, but this is not strictly enforced.  User can't delete an attached TaskList, but they could move it.</summary>
    </column>
    <column order="9" name="AnesthProvType" type="int(2)">
      <summary> Defaults to 3 (regular user) unless specified. Helps populates the Anesthetist, Surgeon, Assistant and Circulator dropdowns properly on FormAnestheticRecord/// </summary>
    </column>
    <column order="10" name="DefaultHidePopups" type="tinyint(4)">
      <summary>If set to true, the BlockSubsc button will start out pressed for this user.</summary>
    </column>
    <column order="11" name="PasswordIsStrong" type="tinyint(4)">
      <summary>Gets set to true if strong passwords are turned on, and this user changes their password to a strong password.  We don't store actual passwords, so this flag is the only way to tell.</summary>
    </column>
    <column order="12" name="ClinicIsRestricted" type="tinyint(4)">
      <summary>When true, prevents user from having access to clinics that are not in the corresponding userclinic table. Many places throughout the program will optionally remove the 'All' option from this user when true. Also see userod.ClinicNum and userclinic table. This field handles the double negative issue because the default must be no restriction.</summary>
    </column>
    <column order="13" name="InboxHidePopups" type="tinyint(4)">
      <summary>If set to true, the BlockInbox button will start out pressed for this user.</summary>
    </column>
    <column order="14" name="UserNumCEMT" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  The user num within the Central Manager database.  Only editable via CEMT.  Can change when CEMT syncs.</summary>
    </column>
    <column order="15" name="DateTFail" type="datetime">
      <summary>The date and time of the most recent log in failure for this user.  Set to MinValue after user logs in successfully.</summary>
    </column>
    <column order="16" name="FailedAttempts" type="tinyint">
      <summary>The number of times this user has failed to log into their account.  Set to 0 after user logs in successfully.</summary>
    </column>
    <column order="17" name="DomainUser" type="varchar(255)">
      <summary>The username for the ActiveDirectory user to link the account to. Consists of the Pref DomainObjectGuid followed by the domain user name. Example:634dd357-3902-48e2-b6d3-9b84dada6bd2\KyleG.</summary>
    </column>
    <column order="18" name="IsPasswordResetRequired" type="tinyint(4)">
      <summary>Boolean.  If true, the user's password needs to be reset on next login.</summary>
    </column>
    <column order="19" name="MobileWebPin" type="varchar(255)">
      <summary>A hashed pin that is used for mobile web validation on eClipboard. Not used in OD proper.</summary>
    </column>
    <column order="20" name="MobileWebPinFailedAttempts" type="tinyint">
      <summary>The number of attempts the mobile web pin has failed. Reset on successful attempt.</summary>
    </column>
    <column order="21" name="DateTLastLogin" type="datetime">
      <summary>Minimum date if last login date and time is unknown.
            Otherwise contians the last date and time this user successfully logged in.</summary>
    </column>
    <column order="22" name="EClipboardClinicalPin" type="varchar(128)">
      <summary>Pin for ODT. This is the hashed value of the pin. Not used in OD proper.</summary>
    </column>
    <column order="23" name="BadgeId" type="varchar(255)">
      <summary>A unique number that corresponds to the number on an employee badge. The last numbers on an employee badge. Will be 1 to 4 digits. These numbers are assigned to the badges by the factory. We order a specific range of badges, such as 1801-2000, which are assigned in order and not reused to avoid duplicates. The first four digits on the badges are not used by the Lenel OnGuard software, so we do not use them here either.</summary>
    </column>
  </table>
  <table name="userodapptview">
    <summary>Keeps track of the last appointment view used on a per user basis.  Users can have multiple rows in this table when using clinics.</summary>
    <column order="0" name="UserodApptViewNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="2" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.  0 if clinics is not being used or if the user has not been assigned a clinic.</summary>
    </column>
    <column order="3" name="ApptViewNum" type="bigint(20)" fk="apptview">
      <summary>FK to apptview.ApptViewNum.</summary>
    </column>
  </table>
  <table name="userodpref">
    <summary>This is a specific preference for a unique Userod. Typically just a few for each user. These all could have all been columns in the userod table. Most of these just hold a ValueString of some sort.</summary>
    <column order="0" name="UserOdPrefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="2" name="Fkey" type="bigint(20)">
      <summary>Foreign key to a table associated with FkeyType. Usually 0, but it does contain an actual Fky in the case of program, clinicLast, SheetDef.SheetDefNum, ImageCats, and possibly others.</summary>
    </column>
    <column order="3" name="FkeyType" type="tinyint(4)">
      <summary>Enum:UserOdFkeyType This is the field that tells us which kind of row this is. It's badly named because in most cases, Fkey is just 0, and the row is just storing a ValueString.</summary>
      <Enumeration name="UserOdFkeyType">
        <summary>These FKey Types are to be used as an identifier for what table the Fkey column is associated with, or what type of value it is. Not always associated with a database table.  Examples: TaskCollapse, SuppressLogOffMessage, AcctProcBreakdown. Do not reorder items, since they are numbers in the db.</summary>
        <EnumValue name="ImageCategoryExpanded">0 - Imaging module expanded categories.  Presence of a row means expanded.  Absence means collapsed.  No valuestring needed. Can have FKey that relates to ImageCat defNum</EnumValue>
        <EnumValue name="ClinicLast">1 - FKey to ClinicNum Used to track the last opened clinic for the user.</EnumValue>
        <EnumValue name="WikiHomePage">2 - Wiki home pages use ValueString to store the name of the wiki page instead of Fkey due to how FormWiki loads pages.</EnumValue>
        <EnumValue name="AutoNoteExpandedCats">3 - ValueString will be a comma delimited list of DefNums for the last expanded categories for the user.  When FormAutoNotes loads,
            these categories will be expanded again.</EnumValue>
        <EnumValue name="TaskCollapse">4 - Controls whether tasks will be collapsed or not by default</EnumValue>
        <EnumValue name="CommlogPersistClearNote">5 - When FormCommItem is in Persistent mode, clear the note text box after the user creates a commlog.</EnumValue>
        <EnumValue name="CommlogPersistClearEndDate">6 - When FormCommItem is in Persistent mode, clear the End text box after the user creates a commlog.</EnumValue>
        <EnumValue name="CommlogPersistUpdateDateTimeWithNewPatient">7 - When FormCommItem is in Persistent mode, update the Date / Time text box with NOW() whenver the patient changes.</EnumValue>
        <EnumValue name="PerioCurrentExamOnly">8 - Whether or not to display just the currently selected exam in the Perio Chart.</EnumValue>
        <EnumValue name="SmsGroupBy">9 - Text message grouping preference. 0 - None; 1 - By Patient;</EnumValue>
        <EnumValue name="TaskListBlock">10 - Stores a TaskListNum that the corresponding user wants to block all pop ups from.</EnumValue>
        <EnumValue name="Program">11 - FKey to ProgramNum. Also used in DoseSpot for the DoseSpot User ID, stored in ValueString.</EnumValue>
        <EnumValue name="SuppressLogOffMessage">12</EnumValue>
        <EnumValue name="AcctProcBreakdown">13 - Sets the default state of the Account Module "Show Proc Breakdowns" checkbox.</EnumValue>
        <EnumValue name="ProgramUserName">14 - Stores user specific username for programs, generally used for Oryx.ProgNum.</EnumValue>
        <EnumValue name="ProgramPassword">15 - Stores user specific password for programs.</EnumValue>
        <EnumValue name="Dashboard">16 - Stores user specific dashboard to open on load. FKey points to the SheetDef.SheetDefNum that the user last had open.</EnumValue>
        <EnumValue name="UserTheme">17 - Deprecated. </EnumValue>
        <EnumValue name="DynamicChartLayout">18 - Stores the Dynamic Chart Layout SheetDef.SheetDefNum selected by a user, FKey points to ShetDef.SheetDefNum.</EnumValue>
        <EnumValue name="PerioAutoAdvanceFacialsFirst">19 - Whether or not to set the perio auto advance to custom.</EnumValue>
        <EnumValue name="LogOffTimerOverride">20 - Stores the value (in minutes) of when the user should be auto logged off.</EnumValue>
        <EnumValue name="ReceivedSupplyOrders">21 - Whether or not we check the "Show received" checkbox when loading the supply order history.</EnumValue>
        <EnumValue name="ToothChartUsesDiffColorByProv">22 - Color defs can be used for different proc statuses when the user's provider doesn't match the procedure's provider.</EnumValue>
        <EnumValue name="ShowAutomatedCommlog">23 - Whether to show automated commlogs in the account module, chart module, and appointment edit window.</EnumValue>
        <EnumValue name="QueryMonitorHasStackTraces">24 - Preference that indicates whether stack traces are to be logged by the query monitor or not. If exists 0 or 1 is stored in ValueString</EnumValue>
        <EnumValue name="WikiSearchIncludeContent">25 - Preference only applies to the wiki search. Set and unset only in the wiki search window. Box defaults to checked if this preference is not set.</EnumValue>
        <EnumValue name="TaskBlockedMakeSound">26 - Sets whether tasks popups that are blocked still play the sound notification. If true, sound will play. If false, sound will be blocked as well.</EnumValue>
        <EnumValue name="ImageSelectorWidth">27 - Stores the width of the left Image Selector (tree) of the Imaging module in the ValueString. Does not store expanded/collapsed, so this width would be the expanded width. There is no limit. Does not use FKey.</EnumValue>
        <EnumValue name="DefaultMapSetting">28 HQ only. This is used for storing the default map to open up on a customers DB for a specific user. Examples include Engineers, Daycare , Conv/Techs. The Fkey points to the MapAreaContaainer.MapAreaContainerNum table.</EnumValue>
        <EnumValue name="DefaultTestingTeamJM">29 HQ only. Stores the default testing team that is selected when opening the Testing tab in the Job Manager.</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ValueString" type="text">
      <summary>Used to hold the value relating to the flag. FKey=0 in this case. This can be a simple primitive value, a comma separated list, or a complex document in xml.</summary>
    </column>
    <column order="5" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to Clinic.ClinicNum, The default clinic for a User. This is duplicate info that's already available in userod.ClinicNum, but having it here might allow simpler queries or linq.</summary>
    </column>
  </table>
  <table name="userquery">
    <summary>A list of query favorites that users can run.</summary>
    <column order="0" name="QueryNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="Description" type="varchar(255)">
      <summary>Description.</summary>
    </column>
    <column order="2" name="FileName" type="varchar(255)">
      <summary>The name of the file to export to.</summary>
    </column>
    <column order="3" name="QueryText" type="mediumtext">
      <summary>The text of the query.</summary>
    </column>
    <column order="4" name="IsReleased" type="tinyint(4)">
      <summary>Determines whether the query is safe for users with lower permissions.  Also causes this user query to be available in the Main Menu, Reports, Query Favorites Filtered.</summary>
    </column>
    <column order="5" name="IsPromptSetup" type="tinyint(4)">
      <summary>Determines whether the Query Favorites window should prompt for query values via FormQueryParser/'SET Fields' popup when running query.</summary>
    </column>
    <column order="6" name="DefaultFormatRaw" type="tinyint(4)">
      <summary>Determines whether the UserQuery window loads with the 'Raw' format radio button pre-selected. For a new userquery, this is set based on pref.UserQueryDefaultRaw.</summary>
    </column>
  </table>
  <table name="userweb">
    <summary>Holds credentials for web applications.  Each userweb entry should be linked to a table type or entity of sorts.
            E.g. Patient Portal credentials will have an FKey to patient.PatNum and an FKeyType linked to "UserWebFKeyType.PatientPortal".</summary>
    <column order="0" name="UserWebNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="FKey" type="bigint(20)">
      <summary>Foreign key to the table defined by the corresponding FKeyType.</summary>
    </column>
    <column order="2" name="FKeyType" type="tinyint(4)">
      <summary>Enum:UserWebFKeyType The type of row that identifies which table FKey links to.</summary>
      <Enumeration name="UserWebFKeyType">
        <summary>The type of row that identifies which table FKey links to.</summary>
        <EnumValue name="Undefined">This is a default value that should never be saved into the table.</EnumValue>
        <EnumValue name="PatientPortal">FK to patient.PatNum</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="UserName" type="varchar(255)">
      <summary></summary>
    </column>
    <column order="4" name="Password" type="varchar(255)">
      <summary>The password details in a "HashType$Salt$Hash" format, separating the different fields by '$'.
            This is NOT the actual password but the encoded password hash.
            If the contents of this variable are not in the aforementioned format, it is assumed to be a legacy password hash (MD5).</summary>
    </column>
    <column order="5" name="PasswordResetCode" type="varchar(255)">
      <summary>A randomly generated code that can be used to reset the password.</summary>
    </column>
    <column order="6" name="RequireUserNameChange" type="tinyint(4)">
      <summary>Set to true to require a user to change their UserName.</summary>
    </column>
    <column order="7" name="DateTimeLastLogin" type="datetime">
      <summary>The last time when the user used their credentials to log in.</summary>
    </column>
    <column order="8" name="RequirePasswordChange" type="tinyint(4)">
      <summary>Set to true to require a user to change their Password.</summary>
    </column>
  </table>
  <table name="utm">
    <summary>A UTM (urchin tracking module) code is a simple string that you can add to the end of a URL to track the performance of campaigns and content.</summary>
    <column order="0" name="UtmNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CampaignName" type="varchar(500)">
      <summary>Text that identifies a specific campaign or promotion identifying why traffic is being directed to the users website.</summary>
    </column>
    <column order="2" name="MediumInfo" type="varchar(500)">
      <summary>Text that tracks how traffic is getting to the users website, such as email or social media.</summary>
    </column>
    <column order="3" name="SourceInfo" type="varchar(500)">
      <summary>Text that identifies where traffic is originating from.</summary>
    </column>
  </table>
  <table name="vaccinedef">
    <summary>A vaccine definition.  Should not be altered once linked to VaccinePat.</summary>
    <column order="0" name="VaccineDefNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="CVXCode" type="varchar(255)">
      <summary>RXA-5-1.</summary>
    </column>
    <column order="2" name="VaccineName" type="varchar(255)">
      <summary>Name of vaccine.  RXA-5-2.</summary>
    </column>
    <column order="3" name="DrugManufacturerNum" type="bigint(20)" fk="drugmanufacturer">
      <summary>FK to drugmanufacturer.DrugManufacturerNum.</summary>
    </column>
  </table>
  <table name="vaccineobs">
    <summary>Vaccine observation.  There may be multiple vaccine observations for each vaccine.</summary>
    <column order="0" name="VaccineObsNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="VaccinePatNum" type="bigint(20)" fk="vaccinepat">
      <summary>FK to vaccinepat.VaccinePatNum. </summary>
    </column>
    <column order="2" name="ValType" type="tinyint(4)">
      <summary>Enum:VaccineObsType Coded, Dated, Numeric, Text, DateAndTime.  Used in HL7 OBX-2.</summary>
      <Enumeration name="VaccineObsType">
        <summary>Corresponds to HL7 table 0125.</summary>
        <EnumValue name="Coded">0 - Code CE.  Coded entry. (default)</EnumValue>
        <EnumValue name="Dated">1 - Code DT.  Date (no time).</EnumValue>
        <EnumValue name="Numeric">2 - Code NM.  Numeric.</EnumValue>
        <EnumValue name="Text">3 - Code ST.  String.</EnumValue>
        <EnumValue name="DateAndTime">4 - Code TS.  Date and time.</EnumValue>
      </Enumeration>
    </column>
    <column order="3" name="IdentifyingCode" type="tinyint(4)">
      <summary>Enum:VaccineObsIdentifier  Identifies the observation question.  Used in HL7 OBX-3.</summary>
      <Enumeration name="VaccineObsIdentifier">
        <summary>Corresponds to HL7 value set NIP003 (http://hl7v2-iz-testing.nist.gov/mu-immunization/).
            This code set is a subset of LOINC codes.  Used in HL7 OBX-3.</summary>
        <EnumValue name="DatePublished">0 - LOINC code 29768-9.  Date vaccine information statement published:TmStp:Pt:Patient:Qn: (default)</EnumValue>
        <EnumValue name="DatePresented">1 - LOINC code 29769-7.  Date vaccine information statement presented:TmStp:Pt:Patient:Qn:</EnumValue>
        <EnumValue name="DatePrecautionExpiration">2 - LOINC code 30944-3.  Date of vaccination temporary contraindication and or precaution expiration:TmStp:Pt:Patient:Qn:</EnumValue>
        <EnumValue name="Precaution">3 - LOINC code 30945-0.  Vaccination contraindication and or precaution:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="DatePrecautionEffective">4 - LOINC code 30946-8.  Date vaccination contraindication and or precaution effective:TmStp:Pt:Patient:Qn:</EnumValue>
        <EnumValue name="TypeOf">5 - LOINC code 30956-7.  Type:ID:Pt:Vaccine:Nom:</EnumValue>
        <EnumValue name="FundsPurchasedWith">6 - LOINC code 30963-3.  Funds vaccine purchased with:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="DoseNumber">7 - LOINC code 30973-2.  Dose number:Num:Pt:Patient:Qn:</EnumValue>
        <EnumValue name="NextDue">8 - LOINC code 30979-9.  Vaccines due next:Cmplx:Pt:Patient:Set:</EnumValue>
        <EnumValue name="DateDue">9 - LOINC code 30980-7.  Date vaccine due:TmStp:Pt:Patient:Qn:</EnumValue>
        <EnumValue name="DateEarliestAdminister">10 - LOINC code 30981-5.  Earliest date to give:TmStp:Pt:Patient:Qn:</EnumValue>
        <EnumValue name="ReasonForcast">11 - LOINC code 30982-3.  Reason applied by forcast logic to project this vaccine:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="Reaction">12 - LOINC code 31044-1.  Reaction:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="ComponentType">13 - LOINC code 38890-0.  Vaccine component type:ID:Pt:Vaccine:Nom:</EnumValue>
        <EnumValue name="TakeResponseType">14 - LOINC code 46249-9.  Vaccination take-response type:Prid:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="DateTakeResponse">15 - LOINC code 46250-7.  Vaccination take-response date:TmStp:Pt:Patient:Qn:</EnumValue>
        <EnumValue name="ScheduleUsed">16 - LOINC code 59779-9.  Immunization schedule used:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="Series">17 - LOINC code 59780-7.  Immunization series:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="DoseValidity">18 - LOINC code 59781-5.  Dose validity:Find:Pt:Patient:Ord:</EnumValue>
        <EnumValue name="NumDosesPrimary">19 - LOINC code 59782-3.  Number of doses in primary immunization series:Num:Pt:Patient:Qn:</EnumValue>
        <EnumValue name="StatusInSeries">20 - LOINC code 59783-1.  Status in immunization series:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="DiseaseWithImmunity">21 - LOINC code 59784-9.  Disease with presumed immunity:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="Indication">22 - LOINC code 59785-6.  Indication for Immunization:Find:Pt:Patient:Nom:</EnumValue>
        <EnumValue name="FundPgmEligCat">23 - LOINC code 64994-7.  Vaccine fund pgm elig cat</EnumValue>
        <EnumValue name="DocumentType">24 - LOINC code 69764-9.  Document type</EnumValue>
      </Enumeration>
    </column>
    <column order="4" name="ValReported" type="varchar(255)">
      <summary>The observation value.  The type of the value depends on the ValType.  Used in HL7 OBX-5.</summary>
    </column>
    <column order="5" name="ValCodeSystem" type="tinyint(4)">
      <summary>Enum:VaccineObsValCodeSystem  CVX, HL70064.  The observation value code system when ValType is Coded.  Used in HL7 OBX-5.</summary>
      <Enumeration name="VaccineObsValCodeSystem">
        <summary>Used in HL7 OBX-5.</summary>
        <EnumValue name="CVX">0 (default)</EnumValue>
        <EnumValue name="HL70064">1</EnumValue>
        <EnumValue name="SCT">2</EnumValue>
      </Enumeration>
    </column>
    <column order="6" name="VaccineObsNumGroup" type="bigint(20)" fk="vaccineobs">
      <summary>FK to vaccineobs.VaccineObsNum.  All vaccineobs records with matching GroupId are in the same group.  Set to 0 if this vaccine observation is not part of a group.  Used in HL7 OBX-4.</summary>
    </column>
    <column order="7" name="UcumCode" type="varchar(255)">
      <summary>Used in HL7 OBX-6.</summary>
    </column>
    <column order="8" name="DateObs" type="date">
      <summary>Date of observation.  Used in HL7 OBX-14.</summary>
    </column>
    <column order="9" name="MethodCode" type="varchar(255)">
      <summary>Code from code set CDCPHINVS (this code system is not yet fully defined, so user has to enter manually).  Used in HL7 OBX-17.  Only required when IdentifyingCode is FundPgmEligCat.</summary>
    </column>
  </table>
  <table name="vaccinepat">
    <summary>A vaccine given to a patient on a date.</summary>
    <column order="0" name="VaccinePatNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="VaccineDefNum" type="bigint(20)" fk="vaccinedef">
      <summary>FK to vaccinedef.VaccineDefNum.  Can be 0 if and only if CompletionStatus=NotAdministered, in which case CVX code is assumed to be 998 (not administered) and there is no manufacturer.</summary>
    </column>
    <column order="2" name="DateTimeStart" type="datetime">
      <summary>The datetime that the vaccine was administered.</summary>
    </column>
    <column order="3" name="DateTimeEnd" type="datetime">
      <summary>Typically set to the same as DateTimeStart.  User can change.</summary>
    </column>
    <column order="4" name="AdministeredAmt" type="float">
      <summary>Size of the dose of the vaccine.  0 indicates unknown and gets converted to 999 on HL7 output.</summary>
    </column>
    <column order="5" name="DrugUnitNum" type="bigint(20)" fk="drugunit">
      <summary>FK to drugunit.DrugUnitNum. Unit of measurement of the AdministeredAmt.  0 represents null.  When going out in HL7 RXA-7, the units must be valid UCUM or the export will be blocked.
            Sometime in the future, we may want to convert this column to a string and name it "UcumCode".  For now left alone for backwards compatibility.</summary>
    </column>
    <column order="6" name="LotNumber" type="varchar(255)">
      <summary>Optional.  Used in HL7 RXA-9.1.</summary>
    </column>
    <column order="7" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="8" name="Note" type="text">
      <summary>Documentation sometimes required.</summary>
    </column>
    <column order="9" name="FilledCity" type="varchar(255)">
      <summary>The city where the vaccine was filled.  This can be different than the practice office city for historical vaccine information.  Exported in HL7 ORC-3.</summary>
    </column>
    <column order="10" name="FilledST" type="varchar(255)">
      <summary>The state where the vaccine was filled.  This can be different than the practice office state for historical vaccine infromation.  Exported in HL7 ORC-3.</summary>
    </column>
    <column order="11" name="CompletionStatus" type="tinyint(4)">
      <summary>Enum:VaccineCompletionStatus Exported in HL7 RXA-20.  Corresponds to HL7 table 0322 (guide page 225).</summary>
      <Enumeration name="VaccineCompletionStatus">
        <summary>Exported in HL7 RXA-20.  Corresponds to HL7 table 0322 (guide page 225).</summary>
        <EnumValue name="Complete">0 - Code CP.  Default.</EnumValue>
        <EnumValue name="Refused">1 - Code RE</EnumValue>
        <EnumValue name="NotAdministered">2 - Code NA</EnumValue>
        <EnumValue name="PartiallyAdministered">3 - Code PA</EnumValue>
      </Enumeration>
    </column>
    <column order="12" name="AdministrationNoteCode" type="tinyint(4)">
      <summary>Enum:VaccineAdministrationNote Exported in HL7 RXA-9.  Corresponds to CDC code set NIP001 (http://hl7v2-iz-testing.nist.gov/mu-immunization/).</summary>
      <Enumeration name="VaccineAdministrationNote">
        <summary>Exported in HL7 RXA-9.  Corresponds to CDC code set NIP001 (http://hl7v2-iz-testing.nist.gov/mu-immunization/).</summary>
        <EnumValue name="NewRecord">0 - Code 00.  Default.</EnumValue>
        <EnumValue name="HistoricalSourceUnknown">1 - Code 01</EnumValue>
        <EnumValue name="HistoricalOtherProvider">2 - Code 02</EnumValue>
        <EnumValue name="HistoricalParentsWrittenRecord">3 - Code 03</EnumValue>
        <EnumValue name="HistoricalParentsRecall">4 - Code 04</EnumValue>
        <EnumValue name="HistoricalOtherRegistry">5 - Code 05</EnumValue>
        <EnumValue name="HistoricalBirthCertificate">6 - Code 06</EnumValue>
        <EnumValue name="HistoricalSchoolRecord">7 - Code 07</EnumValue>
        <EnumValue name="HistoricalPublicAgency">8 - Code 08</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.  The user that the vaccine was entered by.  May be 0 for vaccines added before this column was created.  Exported in HL7 ORD-10.</summary>
    </column>
    <column order="14" name="ProvNumOrdering" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  The provider who ordered the vaccine.  Exported in HL7 ORD-12.</summary>
    </column>
    <column order="15" name="ProvNumAdminister" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.  The provider who administered the vaccine.  Exported in HL7 RXA-10.</summary>
    </column>
    <column order="16" name="DateExpire" type="date">
      <summary>The date that the vaccine expires.  Exported in HL7 RXA-16.</summary>
    </column>
    <column order="17" name="RefusalReason" type="tinyint(4)">
      <summary>Enum:VaccineRefusalReason Exported in HL7 RXA-18.  Corresponds to CDC code set NIP002 (http://hl7v2-iz-testing.nist.gov/mu-immunization/).</summary>
      <Enumeration name="VaccineRefusalReason">
        <summary>Exported in HL7 RXA-18.  Corresponds to CDC code set NIP002 (http://hl7v2-iz-testing.nist.gov/mu-immunization/).</summary>
        <EnumValue name="None">0 - No code.  Default.  Not sent in HL7 messages.  Only used in UI.</EnumValue>
        <EnumValue name="ParentalDecision">1 - Code 00</EnumValue>
        <EnumValue name="ReligiousExemption">2 - Code 01</EnumValue>
        <EnumValue name="Other">3 - Code 02</EnumValue>
        <EnumValue name="PatientDecision">4 - Code 03</EnumValue>
      </Enumeration>
    </column>
    <column order="18" name="ActionCode" type="tinyint(4)">
      <summary>Enum:VaccineAction Exported in HL7 RXA-21.  Corresponds to HL7 table 0323 (guide page 225).</summary>
      <Enumeration name="VaccineAction">
        <summary>Exported in HL7 RXA-21.  Corresponds to HL7 table 0323 (guide page 225).</summary>
        <EnumValue name="Add">0 - Code A.  Default.</EnumValue>
        <EnumValue name="Delete">1 - Code D</EnumValue>
        <EnumValue name="Update">2 - Code U</EnumValue>
      </Enumeration>
    </column>
    <column order="19" name="AdministrationRoute" type="tinyint(4)">
      <summary>Enum:VaccineAdministrationRoute Exported in HL7 RXR-1.  Corresponds to HL7 table 0162 (guide page 200).</summary>
      <Enumeration name="VaccineAdministrationRoute">
        <summary>Exported in HL7 RXR-1.  Corresponds to HL7 table 0162 (guide page 200).</summary>
        <EnumValue name="None">0 - No code.  Default.  Not sent in HL7 messages.  Used in UI only.</EnumValue>
        <EnumValue name="Intradermal">1 - Code ID.</EnumValue>
        <EnumValue name="Intramuscular">2 - Code IM.</EnumValue>
        <EnumValue name="Nasal">3 - Code NS.</EnumValue>
        <EnumValue name="Intravenous">4 - Code IV.</EnumValue>
        <EnumValue name="Oral">5 - Code PO.</EnumValue>
        <EnumValue name="Other">6 - Code OTH.</EnumValue>
        <EnumValue name="Subcutaneous">7 - Code SC.</EnumValue>
        <EnumValue name="Transdermal">8 - Code TD.</EnumValue>
      </Enumeration>
    </column>
    <column order="20" name="AdministrationSite" type="tinyint(4)">
      <summary>Enum:VaccineAdministrationSite Exported in HL7 RXR-2.  Corresponds to HL7 table 0163 (guide page 201).</summary>
      <Enumeration name="VaccineAdministrationSite">
        <summary>Exported in HL7 RXR-2.  Corresponds to HL7 table 0163 (guide page 201).</summary>
        <EnumValue name="None">0 - No code.  Default.  Not sent in HL7 messages.  Used in UI only.</EnumValue>
        <EnumValue name="LeftThigh">1- Code LT</EnumValue>
        <EnumValue name="LeftArm">2 - Code LA</EnumValue>
        <EnumValue name="LeftDeltoid">3 - Code LD</EnumValue>
        <EnumValue name="LeftGluteousMedius">4 - Code LG</EnumValue>
        <EnumValue name="LeftVastusLateralis">5 - Code LVL</EnumValue>
        <EnumValue name="LeftLowerForearm">6 - Code LLFA</EnumValue>
        <EnumValue name="RightArm">7 - Code RA</EnumValue>
        <EnumValue name="RightThigh">8 - Code RT</EnumValue>
        <EnumValue name="RightVastusLateralis">9 - Code RVL</EnumValue>
        <EnumValue name="RightGluteousMedius">10 - Code RG</EnumValue>
        <EnumValue name="RightDeltoid">11 - Code RD</EnumValue>
        <EnumValue name="RightLowerForearm">12 - Code RLFA</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="vitalsign">
    <summary>For EHR module, one dated vital sign entry.  BMI is calulated on demand based on height and weight and may be one of 4 ALOINC codes. 39156-5 "Body mass index (BMI) [Ratio]" is most applicable.</summary>
    <column order="0" name="VitalsignNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="Height" type="float">
      <summary>Height of patient in inches. Fractions might be needed some day.  Allowed to be 0.  Six possible LOINC codes, most applicable is 8302-2, "Body height".</summary>
    </column>
    <column order="3" name="Weight" type="float">
      <summary>Lbs.  Allowed to be 0. Six possible LOINC codes, most applicable is 29463-7, "Body weight".</summary>
    </column>
    <column order="4" name="BpSystolic" type="smallint(6)">
      <summary>Units are mmHg (millimeters of mercury). Allowed to be 0. LOINC code 8480-6.</summary>
    </column>
    <column order="5" name="BpDiastolic" type="smallint(6)">
      <summary>Units are mmHg (millimeters of mercury). Allowed to be 0. LOINC code 8462-4.</summary>
    </column>
    <column order="6" name="DateTaken" type="date">
      <summary>The date that the vitalsigns were taken.</summary>
    </column>
    <column order="7" name="HasFollowupPlan" type="tinyint(4)">
      <summary>For an abnormal BMI measurement this must be true in order to meet quality measurement.</summary>
    </column>
    <column order="8" name="IsIneligible" type="tinyint(4)">
      <summary>If a BMI was not recorded, this must be true in order to meet quality measurement.  For children, this is used as an IsPregnant flag, the only valid reason for not taking BMI on children.</summary>
    </column>
    <column order="9" name="Documentation" type="text">
      <summary>A general note inside the VS window.</summary>
    </column>
    <column order="10" name="ChildGotNutrition" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="11" name="ChildGotPhysCouns" type="tinyint(4)">
      <summary>.</summary>
    </column>
    <column order="12" name="WeightCode" type="varchar(255)">
      <summary>Used for CQMs.  SNOMED CT code either Normal="", Overweight="238131007", or Underweight="248342006".  Set when BMI is found to be "out of range", based on age groups.  Should be calculated when vital sign is saved.  Calculate based on age as of Jan 1 of the year vitals were taken.  Not currently displayed to user.</summary>
    </column>
    <column order="13" name="HeightExamCode" type="varchar(30)">
      <summary>FK to ehrcode.CodeValue.  Also FK to LOINC.LoincCode.  Used for CQMs.  LOINC code used to describe the height exam performed.  Examples: Body Height Measured=3137-7, Body Height Stated=3138-5, Body Height --pre surgery=8307-1.  We will default to Body Height=8302-2, but user can choose another from the list of 6 allowed.  Can be blank if BP only.</summary>
    </column>
    <column order="14" name="WeightExamCode" type="varchar(30)">
      <summary>FK to ehrcode.CodeValue.  Also FK to LOINC.LoincCode.  Used for CQMs.  LOINC code used to describe the weight exam performed.  Examples: Body Weight Measured=3141-9, Body Weight Stated=3142-7, Body Weight --with clothes=8350-1.  We will default to Body Weight=29463-7, but user can choose another from the list of 6 allowed.  Can be blank if BP only.</summary>
    </column>
    <column order="15" name="BMIExamCode" type="varchar(30)">
      <summary>FK to ehrcode.CodeValue.  Also FK to LOINC.LoincCode.  Used for CQMs.  LOINC code used to describe the BMI percentile calculated.  We will use LOINC 59576-9 - BMI Percentile Per age and gender.  Can be blank if BP only.</summary>
    </column>
    <column order="16" name="EhrNotPerformedNum" type="bigint(20)" fk="ehrnotperformed">
      <summary>FK to ehrnotperformed.EhrNotPerformedNum.  This will link a vitalsign to the EhrNotPerformed object where the reason not performed will be stored.  The linking will allow us to display the not performed reason directly in the vital sign window and will make CQM queries easier.  Will be 0 if not linked to an EhrNotPerformed object.</summary>
    </column>
    <column order="17" name="PregDiseaseNum" type="bigint(20)" fk="disease">
      <summary>FK to disease.DiseaseNum.  This will link this vitalsign object to a pregnancy diagnosis for this patient.  It will be 0 for non pregnant patients.  The disease it is linked to will be inserted automatically based on the default value set.  In order to change this code for this specific exam it will have to be changed in the problems list.</summary>
    </column>
    <column order="18" name="BMIPercentile" type="int(11)">
      <summary>BMI percentile of patient, based on gender and age and the calculated BMI.  We will use the CDC numbers to calculate percentile found here: (http://www.cdc.gov/nchs/data/series/sr_11/sr11_246.pdf).</summary>
    </column>
    <column order="19" name="Pulse" type="int(11)">
      <summary>Recorded pulse of the patient. Stored in beats per minute.</summary>
    </column>
  </table>
  <table name="webschedcarrierrule">
    <summary></summary>
    <column order="0" name="WebSchedCarrierRuleNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="2" name="CarrierName" type="varchar(255)">
      <summary>Name of the carrier.</summary>
    </column>
    <column order="3" name="DisplayName" type="varchar(255)">
      <summary>Set by the user. This is what is shown as a selection for the patient in the WebSched UI.</summary>
    </column>
    <column order="4" name="Message" type="text">
      <summary>Return message sent back to patients through WebSched. Set by the office after a patient has made a carrier selection.</summary>
    </column>
    <column order="5" name="Rule" type="tinyint(4)">
      <summary>Enum:RuleType Allow, AllowWithInput, AllowWithMessage, Block.</summary>
      <Enumeration name="RuleType">
        <summary></summary>
        <EnumValue name="Allow">0</EnumValue>
        <EnumValue name="AllowWithInput">1</EnumValue>
        <EnumValue name="AllowWithMessage">2</EnumValue>
        <EnumValue name="BlockWithMessage">3</EnumValue>
      </Enumeration>
    </column>
  </table>
  <table name="webschedrecall">
    <summary>Web Sched recall reminders that may have been sent via EConnector to HQ.</summary>
    <column order="0" name="WebSchedRecallNum" type="bigint(20)">
      <summary>PK. Generated by HQ.</summary>
    </column>
    <column order="1" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum for the corresponding appointment.</summary>
    </column>
    <column order="2" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum for the corresponding patient.</summary>
    </column>
    <column order="3" name="RecallNum" type="bigint(20)" fk="recall">
      <summary>FK to recall.RecallNum. Generated by OD.</summary>
    </column>
    <column order="4" name="DateTimeEntry" type="datetime">
      <summary>Generated by OD. Timestamp when row is created.</summary>
    </column>
    <column order="5" name="DateDue" type="datetime">
      <summary>The date that the recall is due.</summary>
    </column>
    <column order="6" name="ReminderCount" type="int(11)">
      <summary>The number of reminders that have been sent for this recall.</summary>
    </column>
    <column order="7" name="DateTimeSent" type="datetime">
      <summary>DateTime the message was sent.</summary>
    </column>
    <column order="8" name="DateTimeSendFailed" type="datetime">
      <summary>The most recent time that sending a reminder failed. Will be 01/01/0001 if a reminder has never been attempted.</summary>
    </column>
    <column order="9" name="SendStatus" type="tinyint(4)">
      <summary>Enum:AutoCommStatus The status of the email or text being sent for this recall.</summary>
      <Enumeration name="AutoCommStatus">
        <summary>Used by both Statement and WebSchedRecall (and probably other places).</summary>
        <EnumValue name="Undefined">0 - Should not be in the database but can be used in the program.</EnumValue>
        <EnumValue name="DoNotSend">1 - Do not send a reminder.</EnumValue>
        <EnumValue name="SendNotAttempted">2 - We will send, but send has not been attempted yet.</EnumValue>
        <EnumValue name="SendSuccessful">3 - Has been sent successfully.</EnumValue>
        <EnumValue name="SendFailed">4 - Attempted to send but not successful.</EnumValue>
        <EnumValue name="SentAwaitingReceipt">5 - Has been sent successfully, awaiting receipt.</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="ShortGUID" type="varchar(255)">
      <summary>Generated by HQ. Identifies this AutoCommGuid in future transactions between HQ and OD.</summary>
    </column>
    <column order="11" name="ResponseDescript" type="text">
      <summary>Generated by OD in some cases and HQ in others. Any human readable error message generated by either HQ or EConnector. Used for debugging.</summary>
    </column>
    <column order="12" name="Source" type="tinyint(4)">
      <summary>Enum:WebSchedRecallSource Where this row came from.</summary>
      <Enumeration name="WebSchedRecallSource">
        <summary></summary>
        <EnumValue name="Undefined">0 - Should not be in the database.</EnumValue>
        <EnumValue name="FormRecallList">1 - Originated from a user clicking the Web Sched button in the Recall List.</EnumValue>
        <EnumValue name="EConnectorAutoComm">2 - The eConnector created this row in the Auto Comm Web Sched thread.</EnumValue>
      </Enumeration>
    </column>
    <column order="13" name="CommlogNum" type="bigint(20)" fk="commlog">
      <summary>FK to commlog associated to this WebSchedRecall.</summary>
    </column>
    <column order="14" name="MessageType" type="tinyint(4)">
      <summary>Enum:CommType The type of message being sent for this recall.</summary>
      <Enumeration name="CommType">
        <summary></summary>
        <EnumValue name="Invalid">-1 - Do not use.</EnumValue>
        <EnumValue name="Preferred">0 - Use text OR email based on patient preference.</EnumValue>
        <EnumValue name="Text">1 - Attempt to send text message, if successful do not send via email. (Unless, a SendAll bool is used, which usually negates the need for this enumeration.)</EnumValue>
        <EnumValue name="Email">2 - Attempt to send email message, if successful do not send via text. (Unless, a SendAll bool is used, which usually negates the need for this enumeration.)</EnumValue>
        <EnumValue name="SecureEmail">3 - Attempt to send secure email message. </EnumValue>
      </Enumeration>
    </column>
    <column order="15" name="MessageFk" type="bigint(20)">
      <summary>FK to primary key of appropriate table.</summary>
    </column>
    <column order="16" name="ApptReminderRuleNum" type="bigint(20)" fk="apptreminderrule">
      <summary>FK to apptreminderrule.ApptReminderRuleNum. Allows us to look up the rules to determine how to send this apptcomm out.</summary>
    </column>
  </table>
  <table name="wikilistheaderwidth">
    <summary>Keeps track of column widths in Wiki Lists.</summary>
    <column order="0" name="WikiListHeaderWidthNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ListName" type="varchar(255)">
      <summary>Name of the list that this header belongs to.  Tablename without the prefix.</summary>
    </column>
    <column order="2" name="ColName" type="varchar(255)">
      <summary>Name of the column that this header belongs to.</summary>
    </column>
    <column order="3" name="ColWidth" type="int(11)">
      <summary>Width in pixels of column.</summary>
    </column>
    <column order="4" name="PickList" type="text">
      <summary>Newline delimited list of options for the user to select from when adding or editing a wiki list item.</summary>
    </column>
    <column order="5" name="IsHidden" type="tinyint(4)">
      <summary>Hide or show this column in the UI.</summary>
    </column>
  </table>
  <table name="wikilisthist">
    <summary>Rows never edited, just added.  Contains all historical versions of each list.</summary>
    <column order="0" name="WikiListHistNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="2" name="ListName" type="varchar(255)">
      <summary>Will not be unique because there are multiple revisions per page.</summary>
    </column>
    <column order="3" name="ListHeaders" type="text">
      <summary>The contents of the corresponding WikiListHeaderWidths row converted to a string in format ColName1,ColWidth1;ColName2,ColWidth2;...  Database type text/varChar2(4000) (65K/4K)</summary>
    </column>
    <column order="4" name="ListContent" type="mediumtext">
      <summary>The entire contents of the revision are stored as XML.  Database type mediumtext/clob (16M,4G)</summary>
    </column>
    <column order="5" name="DateTimeSaved" type="datetime">
      <summary>The DateTime from the original WikiPage object.</summary>
    </column>
  </table>
  <table name="wikipage">
    <summary>Rows never edited, just added, unless the wiki page is a draft.  Contains only newest versions of each page and all drafts.</summary>
    <column order="0" name="WikiPageNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="2" name="PageTitle" type="varchar(255)">
      <summary>Must be unique.  Any character is allowed except: \r, \n, and ".  Needs to be tested, especially with apostrophes.</summary>
    </column>
    <column order="3" name="KeyWords" type="varchar(255)">
      <summary>Automatically filled from the [[Keywords:]] tab in the PageContent field as page is being saved.</summary>
    </column>
    <column order="4" name="PageContent" type="mediumtext">
      <summary>Content of page stored in "wiki markup language".  This should never be updated, unless it is a draft.  Medtext (16M)</summary>
    </column>
    <column order="5" name="DateTimeSaved" type="datetime">
      <summary>The DateTime that the page was saved to the DB.  User can't directly edit.</summary>
    </column>
    <column order="6" name="IsDraft" type="tinyint(4)">
      <summary>Signifies that the wiki page is a draft, and will only show in the Wiki Drafts form.</summary>
    </column>
    <column order="7" name="IsLocked" type="tinyint(4)">
      <summary>Records if a wiki page is locked.  If it is locked, only user swith the WikiAdmin permission are allowed to edit the page</summary>
    </column>
    <column order="8" name="IsDeleted" type="tinyint(4)">
      <summary>This flag will be set when the user archives the WikiPage.</summary>
    </column>
    <column order="9" name="PageContentPlainText" type="mediumtext">
      <summary>Content of page stored without any HTML markup or wiki page links.  This plain text allows for easier searching.</summary>
    </column>
  </table>
  <table name="wikipagehist">
    <summary>Rows never edited, just added.  Contains all historical versions of each page as well.</summary>
    <column order="0" name="WikiPageNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="UserNum" type="bigint(20)" fk="userod">
      <summary>FK to userod.UserNum.</summary>
    </column>
    <column order="2" name="PageTitle" type="varchar(255)">
      <summary>Will not be unique because there are multiple revisions per page.</summary>
    </column>
    <column order="3" name="PageContent" type="mediumtext">
      <summary>The entire contents of the revision are stored in "wiki markup language".  This should never be updated.  Medtext (16M)</summary>
    </column>
    <column order="4" name="DateTimeSaved" type="datetime">
      <summary>The DateTime from the original WikiPage object.</summary>
    </column>
    <column order="5" name="IsDeleted" type="tinyint(4)">
      <summary>This flag will only be set for the revision where the user marked it deleted, not the ones prior.</summary>
    </column>
  </table>
  <table name="xchargetransaction">
    <summary>XCharge transactions that have been imported into OD.  Used by reconcile tool.  Keeps a history, but no references to these rows from other tables.</summary>
    <column order="0" name="XChargeTransactionNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="TransType" type="varchar(255)">
      <summary>Usually "CCPurchase."</summary>
    </column>
    <column order="2" name="Amount" type="double">
      <summary>Amount.</summary>
    </column>
    <column order="3" name="CCEntry" type="varchar(255)">
      <summary>Credit card entry method. Usually "Keyed".</summary>
    </column>
    <column order="4" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="5" name="Result" type="varchar(255)">
      <summary>Result: AP for approved, DECLINE for declined.</summary>
    </column>
    <column order="6" name="ClerkID" type="varchar(255)">
      <summary>ClerkID. Open Dental username with a possible " R" at the end to indicate a recurring charge.</summary>
    </column>
    <column order="7" name="ResultCode" type="varchar(255)">
      <summary>ResultCode: 000 for approved, 005 for declined.</summary>
    </column>
    <column order="8" name="Expiration" type="varchar(255)">
      <summary>Expiration is shown as a four digit number (string since it may contain leading zeros).</summary>
    </column>
    <column order="9" name="CCType" type="varchar(255)">
      <summary>VISA, AMEX, MC, DISC etc.</summary>
    </column>
    <column order="10" name="CreditCardNum" type="varchar(255)">
      <summary>Usually looks like 123456XXXXXX7890.</summary>
    </column>
    <column order="11" name="BatchNum" type="varchar(255)">
      <summary>BatchNum.</summary>
    </column>
    <column order="12" name="ItemNum" type="varchar(255)">
      <summary>ItemNum. Starts at 0001 for each batch.</summary>
    </column>
    <column order="13" name="ApprCode" type="varchar(255)">
      <summary>Approval code. 6 characters. 72142Z for example.</summary>
    </column>
    <column order="14" name="TransactionDateTime" type="datetime">
      <summary>TransactionDateTime. Is taken from the Date and Time columns in X-Charge.</summary>
    </column>
    <column order="15" name="BatchTotal" type="double">
      <summary>BatchTotal. Stores the BatchTotal from XCharge. This is a cumulative value for all transactions up to this row in the same batch. BatchTotal from the last transaction in a batch should match the sum of all the Amount fields for the same batch</summary>
    </column>
  </table>
  <table name="xwebresponse">
    <summary>Received as XML output from XWeb gateway. Not all fields are available for all method calls. This is a combination of all possible output fields. 
            The fields that are available are dependent on which method was called and the given result.
            HPF (XWeb Hosted Payment Form) Payments and HPF CC Alias creations will each enter a row in this table. That row will be monitored by the eConnector and updated when the XWebResponseCode changes from Pending.
             -- 1) Create the row and indicate the HPF/OTK.
             -- 2) Poll the OTK (one-time key) until an XWebResponseCode is available. Update the row with information about the transaction.
            DTG (XWeb Direct To Gateway) Will enter 1 row in this table. 
             -- 1) Make the DTG payment using a pre-authorized CC alias. Create row with information about the transaction.
            Any fields prefixed with 'Gateaway output' come directly as XML output from the XWeb Gateway. All other fields are derived by OD.
            The class instance will created by eConnector by deserializing an XML string as received from XWeb Gateway. 
            The fields names MUST NOT CHANGE for this reason. XML will not deserialize if the names do not match EXACTLY.</summary>
    <column order="0" name="XWebResponseNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="PatNum" type="bigint(20)" fk="patient">
      <summary>FK to patient.PatNum.</summary>
    </column>
    <column order="2" name="ProvNum" type="bigint(20)" fk="provider">
      <summary>FK to provider.ProvNum.</summary>
    </column>
    <column order="3" name="ClinicNum" type="bigint(20)" fk="clinic">
      <summary>FK to clinic.ClinicNum.</summary>
    </column>
    <column order="4" name="PaymentNum" type="bigint(20)" fk="payment">
      <summary>FK to payment.PayNum.</summary>
    </column>
    <column order="5" name="DateTEntry" type="datetime">
      <summary>Timestamp at which this row was created. Auto generated on insert.</summary>
    </column>
    <column order="6" name="DateTUpdate" type="datetime">
      <summary>Timestamp at which this row was last updated. Will be updated each time the OTK status is polled and one final time when XWebResponseCode changes from Pending.</summary>
    </column>
    <column order="7" name="TransactionStatus" type="tinyint(4)">
      <summary>Inidicates which phase of the XWeb process this transaction is in. See class summary for details.</summary>
    </column>
    <column order="8" name="ResponseCode" type="int(11)">
      <summary>Gateaway output. Pre-defined responses generated by XWeb. Will be converted to strongly typed enum XWebResponseCode.</summary>
    </column>
    <column order="9" name="XWebResponseCode" type="varchar(255)">
      <summary>Enum:XWebResponseCodes Strongly typed representation of ResponseCode. Initialized by XWebInputAbs.CreateGatewayResponse().</summary>
      <Enumeration name="XWebResponseCodes">
        <summary>Various statuses from XWeb. These states are returned directly from the XWeb gateway. A more complete list can be found at \\opendental.od\serverfiles\Storage\OPEN DENTAL\Programmers Documents\Bridge Info\X-Charge\EdgeExpress\EdgeExpress Card Not Present API 1.0.0.pdf.</summary>
        <EnumValue name="Undefined">1000</EnumValue>
        <EnumValue name="OtkSuccess">100</EnumValue>
        <EnumValue name="Approval">000</EnumValue>
        <EnumValue name="Declined">001</EnumValue>
        <EnumValue name="AliasSuccess">005</EnumValue>
        <EnumValue name="PartialApproval">007</EnumValue>
        <EnumValue name="AutoDecline">009</EnumValue>
        <EnumValue name="InvalidExpirationDate">010</EnumValue>
        <EnumValue name="ZeroDollarAuthApproval">032 - Used when creating a card alias.</EnumValue>
        <EnumValue name="ExpiredWithoutApproval">101 - Expired Without Approval.  Hosted Form timed out without Approval, OTK was never launched, or Invalid OTK</EnumValue>
        <EnumValue name="Pending">102 - Pending (neither of the above events has occurred yet)</EnumValue>
        <EnumValue name="ParsingError">800 Parsing Error Unable to parse the XML request sent.</EnumValue>
        <EnumValue name="MaxRequestDataExceededError">801 Maximum Request Data Exceeded Error - The XML request exceeds the 2048-byte maximum size.</EnumValue>
        <EnumValue name="DuplicateFieldError">802 Duplicate Field Error - The XML request had more than one copy of a particular field. The field causing the error may be specified.</EnumValue>
        <EnumValue name="ImproperDLLError">803 Improper DLL Error - Unrecognized DLL name. This can be caused by a wrong URL entered into the "Server Location" setting under XCharge Server Setup, Credit Cards, Connection.</EnumValue>
        <EnumValue name="SpecificationVersionError">804 Specification Version Error - XML error, the Specification Version field is set incorrectly.</EnumValue>
        <EnumValue name="AuthenticationError">805 Authentication Error -  The XWeb ID, Auth Key or Terminal ID fields are incorrect (check for leading and trailing spaces if they appear to match those on file). The field causing the error may be specified.</EnumValue>
        <EnumValue name="ProductionMerchantSetUpError">806 Production Merchant Set Up Error - The Mode was incorrectly sent. This can happen when trying to process on theProduction server with a Development or Test Mode Processing Account.</EnumValue>
        <EnumValue name="TestMerchantSetUpError">807 Test Merchant Set Up Error - The Mode was incorrectly sent. This can happen when trying to process on the Testserver with a Development or Production Mode Processing Account.</EnumValue>
        <EnumValue name="DevelopmentMerchantSetUpError">808 Development Merchant Set Up Error - The Mode was incorrectly sent. This can happen when trying to process on theDevelopment server with a Production or Test Mode Processing Account.</EnumValue>
        <EnumValue name="RequiredFieldNotSentError">809 Required Field Not Sent Error - A field that is required for this transaction type was not sent. The field causing theerror may be specified.</EnumValue>
        <EnumValue name="InconsistentConditionalFieldError">810 Inconsistent Conditional Field Error - A field that does not have to be sent was sent in the wrong context. The field causing the error may be specified.</EnumValue>
        <EnumValue name="ImproperFieldDataError">811 Improper Field Data Error - A field sent to the EdgeExpress Gateway was not formatted correctly. This could pertain to Processing Account Information configured in XCharge or BMS, or card information. The field causing the error may be specified.</EnumValue>
        <EnumValue name="UnrecognizedNameTagError">812 Unrecognized Name / Tag Error - The XML tag sent is not in the API</EnumValue>
        <EnumValue name="DuplicateTransactionError">813 Duplicate Transaction Error - A transaction was run for the same amount on the same card within a certain time limit. The duplicate checking time is set on the EdgeExpress Gateway, usuallybetween 1 and 60 minutes.</EnumValue>
        <EnumValue name="InvalidReferenceError">814 Invalid Reference Error - The Transaction ID used for a Void, Return, etc. is invalid. </EnumValue>
        <EnumValue name="TransactionAlreadyVoided">815 Transaction Already Voided - The Transaction ID used for a Void was already voided.</EnumValue>
        <EnumValue name="TransactionAlreadyCaptured">816 Transaction Already Captured - The Transaction ID used for a Capture of an Authorized charge was already used and the transaction has been Captured.</EnumValue>
        <EnumValue name="EmptyBatch">817 Empty Batch - The batch is empty and cannot settle. You cannot settle an empty batch.</EnumValue>
        <EnumValue name="MerchantLockedForSettlement">818 Merchant Locked For Settlement - The Processing Account is in the process of being settled/batched. Wait a moment and try again.</EnumValue>
        <EnumValue name="MerchantLockedForMaintenance">819 Merchant Locked for Maintenance - The Processing Account is locked for database or server maintenance. Wait amoment and try again.</EnumValue>
        <EnumValue name="TemporaryServiceOutage">820 Temporary Service Outage - Retry Transaction - The EdgeExpress Gateway itself may be down. Wait a moment and try again.</EnumValue>
        <EnumValue name="ProcessingHostUnavailable">821 Processing Host Unavailable - Certain back end account parameters may not be set correctly. Have the account settings checked. Specifically, check the TSYS Vital Hierarchy Values. </EnumValue>
        <EnumValue name="InvalidAccountData">823 Invalid Account Data - A field sent to the EdgeExpress Gateway appears invalid (correctly formatted but not on file). This could pertain to Processing Account Information configured in XCharge or BMS, or card information. The field causing the response may be specified.</EnumValue>
        <EnumValue name="IndustryMismatchError">824 Industry Mismatch Error - The Processing Account is configured with the incorrect Market Type. This can occur if XCharge or BMS is not configured with the same Market Type as the EdgeExpress Gateway.</EnumValue>
        <EnumValue name="RejectedInternalSupportOnly">825 Rejected Internal support only -  Reserved for Fraud, Not currently implemented. </EnumValue>
        <EnumValue name="InvalidCardType">827 Invalid Card Type -  The account number entered is not valid for the card type entered. If Card Type is Visa, then the account number must be for a Visa account. </EnumValue>
        <EnumValue name="CardTypeNotSupported">828 Card Type Not Supported - The card type (Visa, Mastercard, American Express, etc.) for the attempted transaction is not enabled at the EdgeExpress Gateway.</EnumValue>
        <EnumValue name="CardCodeRequired">829 Card Code Required - The Card Security Code (CSC, also known as the CVV, CVC or CID) is set to "required" for keyed transactions at the EdgeExpress Gateway, but was not sent.</EnumValue>
        <EnumValue name="AddressRequired">830 Address Required - The address (house number, part of the Address Verification System) is set to "required" for keyed transactions at the EdgeExpress Gateway, but was not sent.</EnumValue>
        <EnumValue name="ZipCodeRequired">831 ZIP Code Required - The ZIP code (part of the Address Verification System) is set to "required" for keyed transactions at the EdgeExpress Gateway, but was not sent.</EnumValue>
        <EnumValue name="EncodedDataFormatError">832 Encoded Data Format Error - Encoded format of check image file could not be read or was not submitted when expected.</EnumValue>
        <EnumValue name="CheckServicesImageErrorMICRAndAmout">833 Check Services Image Error - MICR and Amount cannot be read The attempted paper check scan failed. When this occurs you should have the option to manually enter the check information or rescan the check.</EnumValue>
        <EnumValue name="CheckServicesImageErrorMICROnly">834 Check Services Image Error - MICR cannot be read The attempted paper check scan failed. When this occurs you should have the option to manually enter the check information or rescan the check.</EnumValue>
        <EnumValue name="CheckServicesImageErrorAmountOnly">835 Check Services Image Error - Amount cannot be read The attempted paper check scan failed. When this occurs you should have the option to manually enter the check information or rescan the check.</EnumValue>
        <EnumValue name="EmailServiceError">838 Email Service Error - The EdgeExpress Gateway attempted to send an email, possibly for a password reset request, but the attempt failed.</EnumValue>
        <EnumValue name="InvalidReferenceErrorResponseCodeMisMatch">842 Invalid Reference Error - Response code returned when the referenced transaction type does not match.</EnumValue>
        <EnumValue name="TSYSError">900 TSYS Error - Error thrown by Processor TSYS: the EdgeExpress Gateway is setup correctly, but the card or other value submitted is incorrect. SERV NOT ALLOWED usually indicates a Decline, Failure CV indicates the Card Type is not supported (e.g. AMEX needs to be enabled), and Failure HV indicates an error on the account setup in the EdgeExpress Gateway.</EnumValue>
        <EnumValue name="ProcessorError">901 Processor Error Can be Global or TSYS errors (900 Global Payments Error: or 900 TSYS Error:) are returned on transactions if a processor setting is not configured correctly. This can occur if the card or transaction type is not enabled on the Processing Account at the processor end.</EnumValue>
      </Enumeration>
    </column>
    <column order="10" name="ResponseDescription" type="varchar(255)">
      <summary>Gateaway output. Gives a more detailed description on the ResponseCode.</summary>
    </column>
    <column order="11" name="OTK" type="varchar(255)">
      <summary>Gateaway output. This is the One Time Key that is used to launch the Hosted Payment Form. 
            The status of the OTK can be polled to determine if the end user has completed the HPF or if it has expired.</summary>
    </column>
    <column order="12" name="HpfUrl" type="text">
      <summary>This URL will be generated as a result of the OTK. The URL can be browsed in an IFRAME to create a secure portal between a browser 
            and the XWeb server. It is used with EdgeExpress now that HPF is deprecated.</summary>
    </column>
    <column order="13" name="HpfExpiration" type="datetime">
      <summary>Timestamp at which this HPF will expire. The end user will only be able to access the HPF before it has expired. This expiration is set explicitly when creating the HPF.</summary>
    </column>
    <column order="14" name="TransactionID" type="varchar(255)">
      <summary>Gateaway output. Each transaction is given a reference for future use. This can be used to void the transaction.</summary>
    </column>
    <column order="15" name="TransactionType" type="varchar(255)">
      <summary>Gateaway output. The type of transaction that was processed. Must be a string data type because it comes from the Gateway as a string.</summary>
    </column>
    <column order="16" name="Alias" type="varchar(255)">
      <summary>Gateaway output. A credit transaction will return an alias which is now linked to the credit card which was used. 
            This alias can be used in the future to make DTG payments and circumvent the need for the secure HPF. Only applies when Credit (not Debit) data is submitted on the HPF.
            CreditCard.XChargeToken is often set to this value.</summary>
    </column>
    <column order="17" name="CardType" type="varchar(255)">
      <summary>Gateaway output. The card type used for this transaction. 
            "Credit" - for cards that support signature only.
            "Debit/Credit" - for cards that support either PIN-entry or signature.
            "Debit/ATM" - for cards that support PIN-entry only.
            "FSA" - for Flexible Spending Accounts</summary>
    </column>
    <column order="18" name="CardBrand" type="varchar(255)">
      <summary>Gateaway output. The card brand used for this transaction. Possible values include "Visa", "MasterCard", "Discover", "American Express", "Diners Club", "JCB", "PayPal".</summary>
    </column>
    <column order="19" name="CardBrandShort" type="varchar(255)">
      <summary>Gateaway output. The industry standard abbreviation of the card brand. 
            Possible values include "VS", "MC", "DS", "AX", "DCIDISC", "JCB-DISC", "PP" (order respective to CardBrand above).</summary>
    </column>
    <column order="20" name="MaskedAcctNum" type="varchar(255)">
      <summary>Gateaway output. Provides a masked format of the account number. The format will show the last 4 digits, the remainder will masked out with an asterisk character.
            End user will be presented with a list of previously generated MaskedAcctNum(s) when making a payment. These are linked to an alias which can be used to make a DTG payment.
            This ciccumvents the need to use the HPF.</summary>
    </column>
    <column order="21" name="Amount" type="double">
      <summary>Gateaway output. Amount of credit card and check transactions.</summary>
    </column>
    <column order="22" name="ApprovalCode" type="varchar(255)">
      <summary>Gateaway output. A 6 digit authorization approval code.</summary>
    </column>
    <column order="23" name="CardCodeResponse" type="varchar(255)">
      <summary>Gateaway output. Response from the Card Security Code lookup. Only applies when Credit(not Debit) data is submitted on the HPF.</summary>
    </column>
    <column order="24" name="ReceiptID" type="int(11)">
      <summary>Gateaway output. An identification number assigned by the OpenEdge Gateway to the receipt.</summary>
    </column>
    <column order="25" name="ExpDate" type="varchar(255)">
      <summary>Gateaway output. Provides the Expiration Date of the account being accessed. Format is yyMM from XWeb gateway. Will be converted to ExpirationDate.</summary>
    </column>
    <column order="26" name="EntryMethod" type="varchar(255)">
      <summary>Gateaway output. Indicates how the account number was entered by the end user. Always 'KEYED' in our case.</summary>
    </column>
    <column order="27" name="ProcessorResponse" type="varchar(255)">
      <summary>Gateaway output. The response from the processor. It is only returned on transactions that are processed by the processor (Auth, Sales and Settlements).</summary>
    </column>
    <column order="28" name="BatchNum" type="int(11)">
      <summary>Gateaway output. This indicates the current open batch number.</summary>
    </column>
    <column order="29" name="BatchAmount" type="double">
      <summary>Gateaway output. Net amount of Credit and Debit Card transactions in batch.</summary>
    </column>
    <column order="30" name="AccountExpirationDate" type="date">
      <summary>The expiration date of the credit card that was referenced in this transaction. DateTime representation of ExpDate. Initialized by XWebInputAbs.CreateGatewayResponse().</summary>
    </column>
    <column order="31" name="DebugError" type="text">
      <summary>Debug information regarding this response. Can only be set by XWebResponses.ProcessOutstandingTransactions().</summary>
    </column>
    <column order="32" name="PayNote" type="text">
      <summary>Will be entered as Payment.PayNote once payment transaction has completed.</summary>
    </column>
    <column order="33" name="CCSource" type="tinyint(4)">
      <summary>Enum:CreditCardSource The source of where this transaction originated from.</summary>
      <Enumeration name="CreditCardSource">
        <summary></summary>
        <EnumValue name="None">0 - This is used when the payment is not a Credit Card. If CC, then this means we are storing the actual credit card number. Not recommended.</EnumValue>
        <EnumValue name="XServer">1 - Local installation of X-Charge</EnumValue>
        <EnumValue name="XWeb">2 - Credit card created via X-Web (an eService)</EnumValue>
        <EnumValue name="PayConnect">3 - PayConnect web service (from within OD).</EnumValue>
        <EnumValue name="XServerPayConnect">4 - Credit card has been added through the local installation of X-Charge and the PayConnect web service.</EnumValue>
        <EnumValue name="XWebPortalLogin">5 - Made from the login screen of the Patient Portal.</EnumValue>
        <EnumValue name="PaySimple">6 - PaySimple web service (from within OD).</EnumValue>
        <EnumValue name="PaySimpleACH">7 - PaySimple ACH web service (from within OD).</EnumValue>
        <EnumValue name="PayConnectPortal">8 - PayConnect credit card (made from Patient Portal)</EnumValue>
        <EnumValue name="PayConnectPortalLogin">9 - PayConnect credit card (made from Patient Portal Login screen).</EnumValue>
        <EnumValue name="CareCredit">10 - CareCredit.</EnumValue>
        <EnumValue name="EdgeExpressRCM">11 - Global Payments V1 Cloud (formerly EdgeExpress/GlobalPayments) when calling the RCM program.</EnumValue>
        <EnumValue name="EdgeExpressCNP">12 - Global Payments V1 Card Not Present API (formerly EdgeExpress/GlobalPayments).</EnumValue>
        <EnumValue name="API">13 - Payment taken through Open Dental API.</EnumValue>
        <EnumValue name="EdgeExpressPaymentPortal">14 - Global Payments V1 (formerly EdgeExpress/GlobalPayments) payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="EdgeExpressPaymentPortalGuest">15 - Global Payments V1 (formerly EdgeExpress/GlobalPayments) payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PayConnectPaymentPortal">16 - PayConnect payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="PayConnectPaymentPortalGuest">17 - PayConnect payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PaySimplePaymentPortal">18 - PaySimple payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="PaySimplePaymentPortalGuest">19 - PaySimple payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="PaySimplePaymentPortalACH">20 - PaySimple ACH Payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="XWebPaymentPortal">21 - XWeb payment taken through the Payment Portal.</EnumValue>
        <EnumValue name="XWebPaymentPortalGuest">22 - XWeb payment taken through the Payment Portal as a guest.</EnumValue>
        <EnumValue name="MeetInTheCloudTerminal">23 - MeetInTheCloud (UI: Global Payments V2) payment via terminal.</EnumValue>
      </Enumeration>
    </column>
    <column order="34" name="OrderId" type="varchar(255)">
      <summary>Generated by us but necessary for Card Not Present API calls. Used to link transactions together (e.g. for returns).</summary>
    </column>
    <column order="35" name="EmailResponse" type="varchar(255)">
      <summary>Email address used for a requested receipt provided by the user when making a payment via the patient portal.</summary>
    </column>
    <column order="36" name="LogGuid" type="varchar(36)">
      <summary>The GUID used in EserviceLogs related to this response. May be blank.</summary>
    </column>
  </table>
  <table name="zipcode">
    <summary>Zipcodes are also known as postal codes.  Zipcodes are always copied to patient records rather than linked.  So items in this list can be freely altered or deleted without harming patient data.</summary>
    <column order="0" name="ZipCodeNum" type="bigint(20)">
      <summary>Primary key.</summary>
    </column>
    <column order="1" name="ZipCodeDigits" type="varchar(20)">
      <summary>The actual zipcode.</summary>
    </column>
    <column order="2" name="City" type="varchar(100)">
      <summary>.</summary>
    </column>
    <column order="3" name="State" type="varchar(20)">
      <summary>.</summary>
    </column>
    <column order="4" name="IsFrequent" type="tinyint">
      <summary>If true, then it will show in the dropdown list in the patient edit window.</summary>
    </column>
  </table>
</database>