Finished outstanding doc TODOs in meta document. (#6987)
[openemr.git] / Documentation / EHI_Export / schemaspy / schemas / openemr.meta.xml
bloba3f38737ece97e260875528179e4ca6fd4c524ab
1 <schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schemameta.xsd" >
2     <tables>
4         <table name="patient_data" comments="Main patient record that contains patient demographic information">
5             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
6             <column name="uuid" comments="UUID of the record"/>
7             <column name="pharmacy_id" comments="The patient's default pharmacy to send prescriptions to">
8                 <foreignKey table="pharmacies" column="id" />
9             </column>
10             <column name="pid" comments="The internal patient identifier used throughout the export to represent this unique patient record"/>
11             <column name="pubpid" comments="The public facing Medical Record Number (MRN) of the patient"/>
12             <column name="care_team_provider"  comments="List of care team providers where each id is the provider id contained in the users.id. Entries are separated by a the pipe | symbol." />
13             <column name="care_team_facility"  comments="List of care team facilities where each id is the facility/organization id contained in the facilities.id. Entries are separated by a the pipe | symbol" />
14             <column name="providerID" comments="The id of the assigned provider to this user">
15                 <foreignKey table="users" column="id" />
16             </column>
17             <column name="ref_providerID" comments="The id of the user that referred this patient">
18                 <foreignKey table="users" column="id" />
19             </column>
20             <column name="created_by" comments="The id of the user that initially created this record">
21                 <foreignKey table="users" column="id" />
22             </column>
23             <column name="updated_by" comments="The id of the user that last updated this record">
24                 <foreignKey table="users" column="id" />
25             </column>
26             <column name="title" comments="Title of the patient"/>
27             <column name="language" comments="Language preference of the patient"/>
28             <column name="financial" comments="Financial information of the patient"/>
29             <column name="fname" comments="First name of the patient"/>
30             <column name="lname" comments="Last name of the patient"/>
31             <column name="mname" comments="Middle name of the patient"/>
32             <column name="DOB" comments="Date of Birth of the patient"/>
33             <column name="street" comments="Street address of the patient"/>
34             <column name="postal_code" comments="Postal code of the patient's address"/>
35             <column name="city" comments="City of the patient's address"/>
36             <column name="state" comments="State of the patient's address"/>
37             <column name="country_code" comments="Country code of the patient's address"/>
38             <column name="drivers_license" comments="Driver's license of the patient"/>
39             <column name="ss" comments="Social Security Number of the patient"/>
40             <column name="occupation" comments="Occupation of the patient. UNEMPLOYED, STUDENT, PT STUDENT, or anything else to indicate employed."/>
41             <column name="phone_home" comments="Home phone number of the patient"/>
42             <column name="phone_biz" comments="Business phone number of the patient"/>
43             <column name="phone_contact" comments="Contact phone number of the patient"/>
44             <column name="phone_cell" comments="Cell phone number of the patient"/>
46             <column name="status" comments="Marital Status: M = Married, S = Single, or something else"/>
47             <column name="contact_relationship" comments="Relationship of the contact person"/>
48             <column name="date" comments="Date related to the patient"/>
49             <column name="sex" comments="Gender of the patient"/>
50             <column name="referrer" comments="Referrer of the patient"/>
51             <column name="referrerID" comments="ID of the referring user"/>
52             <column name="email" comments="Email address of the patient"/>
53             <column name="email_direct" comments="Trusted Direct email address of the patient"/>
54             <column name="ethnoracial" comments="Ethnicity/Race information of the patient"/>
55             <column name="race" comments="Race of the patient"/>
56             <column name="ethnicity" comments="Ethnicity of the patient"/>
57             <column name="religion" comments="Religion of the patient"/>
58             <column name="interpretter" comments="Interpreter information for the patient"/>
59             <column name="migrantseasonal" comments="Migrant/Seasonal worker information"/>
60             <column name="family_size" comments="Family size information of the patient"/>
61             <column name="monthly_income" comments="Monthly income information of the patient"/>
62             <column name="billing_note" comments="Billing notes for the patient"/>
63             <column name="homeless" comments="Homeless status of the patient"/>
64             <column name="financial_review" comments="Financial review date"/>
65             <column name="genericname1" comments="Generic name field 1"/>
66             <column name="genericval1" comments="Generic value field 1"/>
67             <column name="genericname2" comments="Generic name field 2"/>
68             <column name="genericval2" comments="Generic value field 2"/>
69             <column name="hipaa_mail" comments="HIPAA Mail setting"/>
70             <column name="hipaa_voice" comments="HIPAA Voice setting"/>
71             <column name="hipaa_notice" comments="HIPAA Notice setting"/>
72             <column name="hipaa_message" comments="HIPAA Message setting"/>
73             <column name="hipaa_allowsms" comments="HIPAA Allow SMS setting"/>
74             <column name="hipaa_allowemail" comments="HIPAA Allow Email setting"/>
75             <column name="squad" comments="The Athletic Squad this patient is a member of"/>
76             <column name="fitness" comments="The sport team Fitness level assigned to this patient"/>
77             <column name="referral_source" comments="Source of referral for the patient"/>
78             <column name="usertext1" comments="User text field 1"/>
79             <column name="usertext2" comments="User text field 2"/>
80             <column name="usertext3" comments="User text field 3"/>
81             <column name="usertext4" comments="User text field 4"/>
82             <column name="usertext5" comments="User text field 5"/>
83             <column name="usertext6" comments="User text field 6"/>
84             <column name="usertext7" comments="User text field 7"/>
85             <column name="usertext8" comments="User text field 8"/>
86             <column name="userlist1" comments="User list field 1"/>
87             <column name="userlist2" comments="User list field 2"/>
88             <column name="userlist3" comments="User list field 3"/>
89             <column name="userlist4" comments="User list field 4"/>
90             <column name="userlist5" comments="User list field 5"/>
91             <column name="userlist6" comments="User list field 6"/>
92             <column name="userlist7" comments="User list field 7"/>
93             <column name="pricelevel" comments="Price level information of the patient"/>
94             <column name="regdate" comments="Registration Date"/>
95             <column name="contrastart" comments="Date contraceptives initially used"/>
96             <column name="completed_ad" comments="Completed Ad information"/>
97             <column name="ad_reviewed" comments="Date Ad reviewed"/>
98             <column name="vfc" comments="VFC information"/>
99             <column name="mothersname" comments="Mother's name"/>
100             <column name="guardiansname" comments="Guardian's name"/>
101             <column name="allow_imm_reg_use" comments="Allow Immunization Registry Use"/>
102             <column name="allow_imm_info_share" comments="Allow Immunization Information Sharing"/>
103             <column name="allow_health_info_ex" comments="Allow Health Information Exchange"/>
104             <column name="allow_patient_portal" comments="Allow Patient Portal"/>
105             <column name="deceased_date" comments="Date of Decease"/>
106             <column name="deceased_reason" comments="Reason of Decease"/>
107             <column name="soap_import_status" comments="SOAP Import Status (1-Prescription Press 2-Prescription Import 3-Allergy Press 4-Allergy Import)"/>
108         </table>
110         <!-- Allergies Data -->
111         <!--        - Medical Problems-->
112         <!--        - Medications-->
113         <!--        - Medical Devices-->
114         <!--        - Surgeries-->
115         <!--        - Dental Issues-->
116         <table name="lists" comments="Patient issues list including allergies, medical problems, medications, medical devices, surgeries, and dental issues. Type of issue is in the type column.">
117             <column name="id" comments="Primary identifier of the record"/>
118             <column name="uuid" comments="UUID of the record"/>
119             <column name="date" comments="Date the issue was created"/>
120             <column name="type" comments="The type of the issue (allergy, medication, etc) where the issue_types.category='default'">
121                 <foreignKey table="issue_types" column="type" />
122             </column>
123             <column name="subtype" comments="The sub type of the issue where the list_options.list_id='issue_subtypes'">
124                 <foreignKey table="list_options" column="option_id" />
125             </column>
126             <column name="title" comments="The human readable description of the issue" />
127             <column name="udi" comments="The unique device identifier.  Populated if the issue is of type medical_device" />
128             <column name="udi_data" comments="The JSON serialized medical device as returned from the https://accessgudid.nlm.nih.gov/api/v2/devices/lookup.json api.  Populated if the issue is of type medical_device" />
129             <column name="begdate" comments="The beginning date for when this issue occurred as reported by the patient or the provider" />
130             <column name="enddate" comments="The end date for when this issue occurred as reported by the patient or the provider" />
131             <column name="returndate" comments="UNUSED - will be removed in the future" />
132             <column name="occurrence" comments="Comes from the list_options.list_id='occurrence' and is the frequency that this issue occurs for the patient">
133                 <foreignKey table="list_options" column="option_id" />
134             </column>
135             <column name="classification" comments="UNUSED - will be removed in the future" />
136             <column name="referredby" comments="The human readable name of Referring physician and practice" />
137             <column name="extrainfo" comments="UNUSED - will be removed in the future" />
138             <column name="diagnosis" comments="The diagnosis of the issue.  Format is a text string in the format of 'system:code[;system:code2;system:coden]'" />
139             <column name="activity" comments="Value of 0 means the record has been deleted, 1 means the record is active in the system" />
140             <column name="comments" comments="Human readable additional notes/comments of the issue" />
141             <column name="pid" comments="The internal patient identifier">
142                         <foreignKey table="patient_data" column="pid" />
143             </column>
144             <column name="user" comments="The user that created or last updated this issue">
145                 <foreignKey table="users" column="username" />
146             </column>
147             <column name="groupname" comments="The user group that created or last updated this issue">
148                 <foreignKey table="groups" column="name" />
149             </column>
150             <column name="outcome" comments="Comes from the list_options.list_id='outcome' and represents the outcome of the issue">
151                 <foreignKey table="list_options" column="option_id" />
152             </column>
153             <column name="destination" comments="Human readable name of GP, Secondary care specialist, etc." />
154             <column name="reinjury_id" comments="UNUSED - will be removed in the future" />
155             <column name="injury_part" comments="UNUSED - will be removed in the future" />
156             <column name="injury_type" comments="UNUSED - will be removed in the future" />
157             <column name="injury_grade" comments="UNUSED - will be removed in the future" />
158             <column name="reaction" comments="Comes from the list_options.list_id='reaction' and represents the reaction of the patient to the allergy">
159                 <foreignKey table="list_options" column="option_id" />
160             </column>
161             <column name="verification" comments="Comes from the list_options.list_id='allergyintolerance-verification' and represents the confirmation status of the allergy">
162                 <foreignKey table="list_options" column="option_id" />
163             </column>
164             <column name="external_allergyid" comments="An identifier for an allergy from an external eRx system" />
165             <column name="erx_source" comments="O if the allergy issue originated in OpenEMR, 1 if the allergy issue originated in an external system" />
166             <column name="erx_uploaded" comments="O if allergy is still waiting to be uploaded to an external system (such as eRX), 1 if the allergy issue has been successfully received by the eRX system" />
167             <column name="modifydate" comments="The date the issue record was last modified" />
168             <column name="severity_al" comments="Comes from the list_options.list_id='severity_ccda' and represents the severity of the allergic reaction of the patient to the allergy">
169                 <foreignKey table="list_options" column="option_id" />
170             </column>
171             <column name="external_id" comments="UNUSED - will be removed in the future" />
172             <column name="list_option_id" comments="Comes from the list_options.list_id=CONCAT(lists.type,'_issue_list') and represents the prefilled list option id that was chosen as a template to create this issue">
173                 <foreignKey table="list_options" column="option_id" />
174             </column>
175         </table>
177         <table name="issue_types" comments="Contains the list of issue types that medical health issue can be."></table>
178         <table name="list_options" comments="Contains lists of unique value sets that a record's property can be.  Individual values/options in the list may be linked to a specific codesystem"></table>
179         <table name="lists_medication">
180             <column name="list_id"  comments="The internal lists identifier">
181                 <foreignKey table="lists" column="id" />
182             </column>
183             <column name="created_by"  comments="The user that created this record">
184                 <foreignKey table="users" column="id" />
185             </column>
186         </table>
188         <!-- Patient History -->
189         <table name="history_data" comments="Contains patient eating,sleeping,drinking,drug habits as well as other patient health history information">
190             <column name="pid"  comments="The internal patient identifier">
191                 <foreignKey table="patient_data" column="pid" />
192             </column>
193             <column name="created_by"  comments="The user that created this record">
194                 <foreignKey table="users" column="id" />
195             </column>
196         </table>
198         <!-- Patient Care Team, Previous Names in patient_history -->
199         <table name="patient_history" comments="Contains previous historical entries of the patient's care team (providers and facilities) as well as patient previous name information">
200             <column name="pid"  comments="The internal patient identifier">
201                 <foreignKey table="patient_data" column="pid" />
202             </column>
203             <column name="care_team_provider"  comments="List of care team providers where each id is the provider id contained in the users.id. Entries are separated by a the pipe | symbol." />
204             <column name="care_team_facility"  comments="List of care team facilities where each id is the facility/organization id contained in the facilities.id. Entries are separated by a the pipe | symbol" />
205             <column name="created_by"  comments="The user that created this record">
206                 <foreignKey table="users" column="id" />
207             </column>
208         </table>
210 <!--        - Prescriptions-->
211         <table name="prescriptions" comments="Internal and External prescription information">
212             <column name="patient_id"  comments="The internal patient identifier">
213                 <foreignKey table="patient_data" column="pid" />
214             </column>
215             <column name="patient_id"  comments="The internal patient identifier">
216                 <foreignKey table="patient_data" column="pid" />
217             </column>
218             <column name="filled_by_id" comments="UNUSED - will be removed in the future" />
219             <column name="pharmacy_id"  comments="The internal identifier for the pharmacy that is connected to this prescription">
220                 <foreignKey table="pharmacies" column="id" />
221             </column>
222             <column name="provider_id" comments="The id of the user that created this prescription">
223                 <foreignKey table="users" column="id" />
224             </column>
225             <column name="drug_id" comments="The id of the drug that was prescribed to the patient. 0 if the drug was manually entered">
226                 <foreignKey table="drugs" column="drug_id" />
227             </column>
229             <column name="created_by" comments="The id of the user that initially created this record">
230                 <foreignKey table="users" column="id" />
231             </column>
232             <column name="updated_by" comments="The id of the user that last updated this record">
233                 <foreignKey table="users" column="id" />
234             </column>
235         </table>
237 <!--        - Immunizations-->
238         <table name="immunizations" comments="Patient Immunizations">
239             <column name="patient_id"  comments="The internal patient identifier">
240                 <foreignKey table="patient_data" column="pid" />
241             </column>
242             <column name="administered_by_id" comments="The person that administered the immunization">
243                 <foreignKey table="users" column="id" />
244             </column>
245             <column name="created_by" comments="The user that created this record">
246                 <foreignKey table="users" column="id" />
247             </column>
248             <column name="updated_by" comments="The user that last updated this record">
249                 <foreignKey table="users" column="id" />
250             </column>
251             <column name="ordering_provider" comments="The provider that issued the order to administer this immunization">
252                 <foreignKey table="users" column="id" />
253             </column>
254             <column name="immunization_id" comments="Comes from the list_options.list_id='immunizations' and represents common list of immunizations the EMR works with">
255                 <foreignKey table="list_options" column="option_id" />
256             </column>
257             <column name="amount_administered_unit" comments="Comes from the list_options.list_id='drug_units' and represents the units of drug administered">
258                 <foreignKey table="list_options" column="option_id" />
259             </column>
260             <column name="manufacturer" comments="Comes from the list_options.list_id='Immunization_Manufacturer' and represents a list of immunization manufacturers">
261                 <foreignKey table="list_options" column="option_id" />
262             </column>
263             <column name="route" comments="Comes from the list_options.list_id='drug_route' and represents a list of immunization manufacturers">
264                 <foreignKey table="list_options" column="option_id" />
265             </column>
266             <column name="administration_site" comments="Comes from the list_options.list_id='immunization_administered_site' and represents the body sites where the immunization can be administered">
267                 <foreignKey table="list_options" column="option_id" />
268             </column>
269             <column name="information_source" comments="Comes from the list_options.list_id='immunization_informationsource' and represents where the source of information the immmunization is coming from originates">
270                 <foreignKey table="list_options" column="option_id" />
271             </column>
272             <column name="completion_status" comments="Comes from the list_options.list_id='Immunization_Completion_Status' and represents the status of the immunization">
273                 <foreignKey table="list_options" column="option_id" />
274             </column>
275             <column name="refusal_reason" comments="Comes from the list_options.list_id='immunization_refusal_reason' and represents the reasons the individual refused immunization">
276                 <foreignKey table="list_options" column="option_id" />
277             </column>
278         </table>
279         <table name="immunization_observation" comments="Individual observations for a specific immunization">
280             <column name="imo_pid"  comments="The internal patient identifier">
281                 <foreignKey table="patient_data" column="pid" />
282             </column>
283             <column name="imo_im_id"  comments="The immunization record this observation is part of">
284                 <foreignKey table="immunizations" column="id" />
285             </column>
286             <column name="imo_user" comments="The user that is recording the observation for this immunization">
287                 <foreignKey table="users" column="id" />
288             </column>
289         </table>
291 <!--        - Patient Insurance-->
292         <table name="insurance_data" comments="Patient Insurance information">
293             <column name="pid"  comments="The internal patient identifier">
294                 <foreignKey table="patient_data" column="pid" />
295             </column>
296             <column name="provider"  comments="The insurance company that insures the patient">
297                 <foreignKey table="insurance_companies" column="id" />
298             </column>
299             <column name="policy_type"  comments="Whether this is the 'primary', 'secondary', or 'tertiary' insurance" />
300         </table>
302         <table name="insurance_companies" comments="Insurance company">
303             <column name="ins_type_code"  comments="The type of insurance company this record is">
304                 <foreignKey table="insurance_type_codes" column="id" />
305             </column>
306         </table>
308         <table name="insurance_type_codes" comments="Contains a list of different insurance types or categories that an insurance company is related to.  This type includes both public and private payer types"></table>
310 <!--        - Patient Messages (pnotes)-->
311         <table name="pnotes" comments="Patient Messages about the healthcare treatment of the patient">
312             <column name="pid"  comments="The internal patient identifier">
313                 <foreignKey table="patient_data" column="pid" />
314             </column>
315             <column name="user">
316                 <foreignKey table="users" column="id" />
317             </column>
318             <column name="assigned_to">
319                 <foreignKey table="users" column="id" />
320             </column>
321             <column name="groupname">
322                 <foreignKey table="groups" column="name" />
323             </column>
324             <column name="update_by">
325                 <foreignKey table="users" column="id" />
326             </column>
327             <column name="update_by">
328                 <foreignKey table="users" column="id" />
329             </column>
330             <column name="message_status" comments="Comes from the list_options.list_id='message_status' and represents the status of the message">
331                 <foreignKey table="list_options" column="option_id" />
332             </column>
333         </table>
335         <table name="patient_reminders" comments="Patient Reminders generated from the clinical decision support engine that are sent via a communication medium to the patient">
336             <column name="pid"  comments="The internal patient identifier">
337                 <foreignKey table="patient_data" column="pid" />
338             </column>
339             <column name="reason_inactivated">
340                 <foreignKey table="list_options" column="option_id" />
341             </column>
342             <column name="due_status">
343                 <foreignKey table="list_options" column="option_id" />
344             </column>
345             <column name="category">
346                 <foreignKey table="rule_action_item" column="category" />
347             </column>
348             <column name="item">
349                 <foreignKey table="rule_action_item" column="item" />
350             </column>
351         </table>
352         <!-- rule_patient_data -->
353         <table name="rule_patient_data" comments="Patient Reminders that the Clinical Decision Support system is configured to run for this specific patient.">
354             <column name="pid"  comments="The internal patient identifier">
355                 <foreignKey table="patient_data" column="pid" />
356             </column>
357             <column name="category">
358                 <foreignKey table="rule_action_item" column="category" />
359             </column>
360             <column name="item">
361                 <foreignKey table="rule_action_item" column="item" />
362             </column>
363         </table>
364         <table name="rule_action_item" comments="Patient Reminders configuration for Clinical Decision Support individual rule settings">
365             <column name="category">
366                 <foreignKey table="list_options" column="option_id" />
367             </column>
368             <column name="item">
369                 <foreignKey table="list_options" column="option_id" />
370             </column>
371         </table>
373 <!--        - Patient Disclosures-->
374         <!-- see disc_fragement.php::getDisclosureByDate() -->
375         <table name="extended_log" comments="Holds the disclosures of EHI made to third parties for a given patient">
376             <column name="id" />
377             <column name="date" />
378             <column name="event" />
379             <column name="user" />
380             <column name="recipient" />
381             <column name="description" />
382             <column name="patient_id"  comments="The internal patient identifier">
383                 <foreignKey table="patient_data" column="pid" />
384             </column>
385         </table>
387 <!--        - Patient Amendments-->
388         <table name="amendments" comments="Holds requests to amend health care information typically initiated by the patient or an insurance company">
389             <column name="amendment_id" comments="Primary key for the amendment record. It uniquely identifies each amendment."/>
390             <column name="amendment_date" comments="The date when the amendment request was made."/>
391             <column name="pid"  comments="The internal patient identifier">
392                 <foreignKey table="patient_data" column="pid" />
393             </column>
394             <column name="amendment_by" comments="Comes from the list_options.list_id='amendment_from' and represents who is requesting the amendment">
395                 <foreignKey table="list_options" column="option_id" />
396             </column>
397             <column name="amendment_status" comments="Comes from the list_options.list_id='amendment_status' and represents the current status of the amendment">
398                 <foreignKey table="list_options" column="option_id" />
399             </column>
400             <column name="created_by" comments="The id of the user that initially created this amendment">
401                 <foreignKey table="users" column="id" />
402             </column>
403             <column name="modified_by" comments="The id of the user that last modified this amendment">
404                 <foreignKey table="users" column="id" />
405             </column>
406             <column name="amendment_desc" comments="Detailed information about the amendment, including any additional notes or changes."/>
407             <column name="created_time" comments="Timestamp indicating when the amendment record was created."/>
408             <column name="modified_time" comments="Timestamp indicating when the amendment record was last modified."/>
409         </table>
410         <table name="amendments_history" comments="Contains clinicinan comments regarding an amendment request">
411             <column name="amendment_id"  comments="The internal amendment id">
412                 <foreignKey table="amendments" column="amendment_id" />
413             </column>
414             <column name="amendment_status" comments="Comes from the list_options.list_id='amendment_status' and represents the current status of the amendment">
415                 <foreignKey table="list_options" column="option_id" />
416             </column>
417             <column name="created_by" comments="The id of the user that initially created this amendment">
418                 <foreignKey table="users" column="id" />
419             </column>
420             <column name="created_time" comments="Timestamp indicating when the amendment record was created."/>
421             <column name="amendment_note" comments="Comments regarding the amendment as entered by the creating user.  Also contains a human readable description of the amendment status.">
422                 <foreignKey table="list_options" column="option_id" />
423             </column>
424         </table>
426 <!--        - Patient Vitals-->
427         <table name="form_vitals" comments="Records of patient vital sign assessment">
428             <column name="pid"  comments="The internal patient identifier">
429                 <foreignKey table="patient_data" column="pid" />
430             </column>
431             <column name="user">
432                 <foreignKey table="users" column="username" />
433             </column>
434             <column name="groupname">
435                 <foreignKey table="groups" column="name" />
436             </column>
437         </table>
438         <table name="form_vital_details" comments="Record of a specific vital sign measurement, including its interpretation, and reason of the measurement">
439             <column name="form_id">
440                 <foreignKey table="form_vitals" column="id" />
441             </column>
442             <column name="interpretation_list_id ">
443                 <foreignKey table="list_options" column="list_id" />
444             </column>
445             <column name="interpretation_option_id ">
446                 <foreignKey table="list_options" column="option_id" />
447             </column>
448             <column name="reason_status" comments="Valid values are 'completed','negated','pending' or '' for none" />
449         </table>
450 <!--        - Patient recalls-->
451         <table name="medex_recalls" comments="Tracks Patient Recalls.  Recalls are when a patient should be reached out to or contacted for a healthcare followup.">
452             <column name="r_ID" comments="Unique ID for the recall record"/>
453             <column name="r_pid"  comments="The internal patient identifier">
454                 <foreignKey table="patient_data" column="pid" />
455             </column>
456             <column name="r_facility"  comments="FK facility.id associated with the recall">
457                 <foreignKey table="facility" column="id" />
458             </column>
459             <column name="r_provider" comments="Provider ID associated with the recall FK to users.id">
460                 <foreignKey table="users" column="id" />
461             </column>
463             <column name="r_PRACTID" comments="UNUSED - Practice ID associated with the recall"/>
464             <column name="r_eventDate" comments="Date of Appointment or Recall"/>
465             <column name="r_reason" comments="Reason for the recall"/>
466             <column name="r_created" comments="Timestamp when the recall was created"/>
467         </table>
468 <!--        - Clinical Reminders-->
469         <table name="clinical_plans" comments="The Clinical Quality Measures that are being applied to a specific patient to track.  This is used in the clinical reminders system">
470             <column name="pid"  comments="The internal patient identifier">
471                 <foreignKey table="patient_data" column="pid" />
472             </column>
473         </table>
474 <!--        - Recall Appts-->
475 <!--        - Patient Appointments-->
476         <table name="openemr_postcalendar_events" comments="Holds records for Patient Appointment/Calendar information">
477             <column name="pc_eid" comments="Surrogate id of the record used as the primary incrementing key"/>
478             <column name="pc_pid"  comments="The internal patient identifier">
479                 <foreignKey table="patient_data" column="pid" />
480             </column>
481             <column name="pc_catid" comments="The appointment category">
482                 <foreignKey table="openemr_postcalendar_categories" column="pc_catid" />
483             </column>
484             <column name="pc_aid" comments="The provider this appointment is connected to">
485                 <foreignKey table="users" column="id" />
486             </column>
487             <column name="pc_gid" comments="The therapy group id this appointment is for">
488                 <foreignKey table="therapy_groups" column="group_id"/>
489             </column>
490             <column name="pc_facility" comments="The facility for where the service for this appointment will be rendered">
491                 <foreignKey table="facility" column="id" />
492             </column>
493             <column name="pc_apptstatus"  comments="Comes from the list_options.list_id='apptstat' if it is a single patient appointment OR list_options.list_id='groupstat' if this is a group appointment. It represents the current appointment status checked in, checked out, waiting, etc">
494                 <foreignKey table="list_options" column="option_id" />
495             </column>
496             <column name="pc_room"  comments="Comes from the list_options.list_id='patient_flow_board_rooms' and represents the facility room that the patient has been assigned to for this appointment if one has been assigned">
497                 <foreignKey table="list_options" column="option_id" />
498             </column>
499             <column name="pc_billing_location" comments="Billing facility location of the event">
500                 <foreignKey table="facility" column="id" />
501             </column>
502             <column name="pc_informant" comments="User creating the event">
503                 <foreignKey table="users" column="id" />
504             </column>
505             <column name="pc_prefcatid" comments="Preferred category id for a provider available slot">
506                 <foreignKey table="openemr_postcalendar_categories" column="pc_catid" />
507             </column>
508             <column name="pc_multiple" comments="Multiple occurrences of the event. Used if this is a recurring appointment."/>
509             <column name="pc_title" comments="Title of the event"/>
510             <column name="pc_time" comments="Time of the event"/>
511             <column name="pc_hometext" comments="Description of the event"/>
512             <column name="pc_comments" comments="Comments associated with the event"/>
513             <column name="pc_counter" comments="Event counter"/>
514             <column name="pc_topic" comments="Topic id of the event"/>
515             <column name="pc_eventDate" comments="Date of the event"/>
516             <column name="pc_endDate" comments="End date of the event"/>
517             <column name="pc_duration" comments="Duration of the event"/>
518             <column name="pc_recurrtype" comments="Recurrence type of the event"/>
519             <column name="pc_recurrspec" comments="Recurrence specification of the event"/>
520             <column name="pc_recurrfreq" comments="Recurrence frequency of the event"/>
521             <column name="pc_startTime" comments="Start time of the event"/>
522             <column name="pc_endTime" comments="End time of the event"/>
523             <column name="pc_alldayevent" comments="Indicates if the event is an all-day event"/>
524             <column name="pc_location" comments="Location of the event"/>
525             <column name="pc_conttel" comments="Contact telephone number"/>
526             <column name="pc_contname" comments="Contact name"/>
527             <column name="pc_contemail" comments="Contact email address"/>
528             <column name="pc_website" comments="Website associated with the event"/>
529             <column name="pc_fee" comments="Event fee"/>
530             <column name="pc_eventstatus" comments="Event status -1=hidden,0=queued,1=approved"/>
531             <column name="pc_sharing" comments="Sharing status of the event"/>
532             <column name="pc_language" comments="Language of the event"/>
533             <column name="pc_sendalertsms" comments="Send SMS alerts for the event"/>
534             <column name="pc_sendalertemail" comments="Send email alerts for the event"/>
535             <column name="uuid" comments="UUID of the record"/>
536         </table>
537         <table name="openemr_postcalendar_categories" comments="Contains the types / categories a patient scheduled appointment can be">
538             <column name="pc_catid" comments="Auto-incremented identifier for the appointment category"/>
539             <column name="pc_constant_id" comments="Identifier for the appointment category which is referenced in the codebase for appointment specific functionality"/>
540             <column name="pc_catname" comments="Name of the appointment category"/>
541             <column name="pc_catcolor" comments="Visual display color associated with the appointment category"/>
542             <column name="pc_catdesc" comments="Description of the appointment category"/>
543             <column name="pc_recurrtype" comments="Type of recurring appointment 0=Not recurring,1=Recurring appointment"/>
544             <column name="pc_enddate" comments="End date of the appointment"/>
545             <column name="pc_recurrspec" comments="Specification for recurring appointments in php array serialized format. Includes information on the repeating frequency, the type of repeat (daily, weekday,week,monthly, etc)"/>
546             <column name="pc_recurrfreq" comments="Frequency of recurring appointments"/>
547             <column name="pc_duration" comments="Duration of the appointment in seconds"/>
548             <column name="pc_end_date_flag" comments="Flag indicating the use of an end date for the appointment"/>
549             <column name="pc_end_date_type" comments="Type of end date for the appointment"/>
550             <column name="pc_end_date_freq" comments="Frequency of the end date"/>
551             <column name="pc_end_all_day" comments="Flag indicating if the end date is all-day"/>
552             <column name="pc_dailylimit" comments="Limit on daily appointments for the category"/>
553             <column name="pc_cattype" comments="Type of category used in grouping categories"/>
554             <column name="pc_active" comments="Flag indicating the category is active"/>
555             <column name="pc_seq" comments="Sequence number for the category"/>
556             <column name="aco_spec" comments="Access control for the category.  Empty on export" exclude="true"/>
557         </table>
559         <table name="patient_tracker" comments="Patient appointment events that occur in the system. Used in the patient flowboard and for patient data reporting">
560             <column name="id" comments="Surrogate ID of the patient tracker record used as the primary incrementing key"/>
561             <column name="pid"  comments="The internal patient identifier">
562                 <foreignKey table="patient_data" column="pid" />
563             </column>
564             <column name="eid"  comments="The calendar appointment id">
565                 <foreignKey table="openemr_postcalendar_events" column="pc_eid" />
566             </column>
567             <column name="original_user" comments="This is the user that created the original record">
568                 <foreignKey table="users" column="username" />
569             </column>
570             <column name="encounter"  comments="The encounter the patient appointment is connected to">
571                 <foreignKey table="form_encounter" column="encounter" />
572             </column>
573             <column name="date"  comments="The datetime this tracker event was created" />
574             <column name="apptdate"  comments="The appointment date this patient tracker record applies to" />
575             <column name="appttime"  comments="The appointment time this patient tracker record applies to" />
576             <column name="random_drug_test"  comments="Tracks if the patient should be given a randomized drug test. NULL if not randomized. If randomized, 0 is no, 1 is yes" />
577             <column name="drug_screen_completed"  comments="Tracks if the patient has completed a drug screening. 0 if no, 1, if they have completed a drug screening" />
578         </table>
579         <table name="patient_tracker_element" comments="Used for tracking individual state changes in the appointment/encounter of a patient">
580             <column name="pt_tracker_id" comments="maps to id column in patient_tracker table">
581                 <foreignKey table="patient_tracker" column="id" />
582             </column>
583             <column name="seq" comments="This is a numerical sequence for this pt_tracker_id events     and in combination with the pt_tracker_id uniquely identifies this record" />
584             <column name="start_datetime"  comments="The datetime this tracker element event was created" />
585             <column name="room"  comments="Comes from the list_options.list_id='patient_flow_board_rooms' and represents the facility room that the patient has been assigned to and this tracker element is connected to">
586                 <foreignKey table="list_options" column="option_id" />
587             </column>
588             <column name="status"  comments="Comes from the list_options.list_id='apptstat' if it is a single patient appointment OR list_options.list_id='groupstat' if this is a group appointment. It represents the current appointment status at the time this tracker element was created">
589                 <foreignKey table="list_options" column="option_id" />
590             </column>
591             <column name="user" comments="This is the user that created this element">
592                 <foreignKey table="users" column="username" />
593             </column>
594         </table>
596         <!--        - Patient Documents-->
597         <table name="documents" comments="Stores all of the digital documents that are connected to a patient.">
598             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
599             <column name="uuid" comments="Binary of Unique User Identifier that is for both external reference to this entity and for future offline use."/>
600             <column name="type" comments="Type of the document (e.g., 'file_url', 'blob', 'web_url')"/>
601             <column name="size" comments="Size of the document in bytes"/>
602             <column name="date" comments="Date when the document was created"/>
603             <column name="date_expires" comments="Date when the document expires and is no longer available."/>
604             <column name="url" comments="URL of the document"/>
605             <column name="thumb_url" comments="URL of the document's thumbnail"/>
606             <column name="mimetype" comments="MIME type of the document"/>
607             <column name="pages" comments="If the document is a multi-page format like tiff and has at least 1 page this will be 1 or greater,if a non-multi-page format this should be null or empty"/>
608             <column name="owner" comments="Foreign key identifier to users of who initially persisted the document">
609                 <foreignKey table="users" column="id" />
610             </column>
611             <column name="revision" comments="Timestamp of the last time the document was changed and persisted"/>
612             <column name="foreign_id"  comments="The internal patient identifier">
613                 <foreignKey table="patient_data" column="pid" />
614             </column>
615             <column name="docdate" comments="Date (YYYY-MM-DD) logically associated with the document, e.g. when a picture was taken."/>
616             <column name="hash" comments="Hash value of the document from when it was uploaded"/>
617             <column name="list_id" comments="FK to lists.id associated with the document when the document is related to an issue">
618                 <foreignKey table="lists" column="id" />
619             </column>
620             <column name="name" comments="Name of the document. Populated since OpenEMR versions 6.0.0+"/>
621             <column name="drive_uuid" comments="UUID of the document's drive. Empty in export" exclude="true"/>
622             <column name="couch_docid" comments="CouchDB document ID"/>
623             <column name="couch_revid" comments="CouchDB revision ID"/>
624             <column name="storagemethod" comments="Storage method (0->Harddisk, 1->CouchDB)"/>
625             <column name="path_depth" comments="Depth of path to use in the URL to find the document. Not applicable for CouchDB. . Empty in export." exclude="true"/>
626             <column name="imported" comments="Parsing status for CCR/CCD/CCDA importing"/>
627             <column name="encounter_id" comments="Encounter ID if tagged">
628                 <foreignKey table="form_encounter" column="encounter" />
629             </column>
630             <column name="encounter_check" comments="If an encounter is created while tagging (0 or 1)"/>
631             <column name="audit_master_approval_status" comments="Approval status from audit_master table"/>
632             <column name="audit_master_id" comments="ID from the audit_master table"/>
633             <column name="documentationOf" comments="Used for CCDA and lab documents where the individual / contents of the documentation of a service event is recorded"/>
634             <column name="encrypted" comments="Encryption status (0->No, 1->Yes)"/>
635             <column name="document_data" comments="Additional metadata concerning the document is stored here.  CCDA/CDA documents store their validation log in this field and DICOM files store a JSON history of actions taken on the DICOM in this field"/>
636             <column name="deleted" comments="Flag indicating if the document is deleted (0 or 1).  If a file has been marked as deleted the underlying file stored in the file storage system is NOT included in data exports and is no longer available for retrieval"/>
637             <column name="foreign_reference_id" comments="DB Unique identifier reference to another table record in the database.  This is not unique in the document. The table that this record points to is in the foreign_reference_table"/>
638             <column name="foreign_reference_table" comments="Table associated with the foreign reference_id will be populated if foreign_reference_id is populated"/>
639         </table>
640         <table name="notes"  comments="Clinical notes and comments for individual patient documents">
641             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
642             <column name="foreign_id"  comments="The documents.id key for the document this note is connected to">
643                 <foreignKey table="documents" column="id" />
644             </column>
645             <column name="note" comments="The notes or comments for the document referenced in foreign_id"/>
646             <column name="owner" comments="Foreign key identifier to users of who initially created this note">
647                 <foreignKey table="users" column="id" />
648             </column>
649             <column name="date" comments="Date and time the note was created" />
650             <column name="revision" comments="UNUSED" />
651         </table>
652 <!--        - Patient Transactions (Billing  Legal  Patient Request  Physician Request  Referral/Counter Referral)-->
653         <table name="transactions" comments="Represents patient referrals, and transactional records for billing, legal, and requests from the patient or their physician">
654             <column name="pid"  comments="The internal patient identifier">
655                 <foreignKey table="patient_data" column="pid" />
656             </column>
657         </table>
658         <table name="lbf_data" comments="Dynamic Field values that are part of the following forms: Demographics, Facility Specific User Information, History Form, and custom dynamically generated encounter forms">
659             <column name="form_id">
660                 <foreignKey table="transactions" column="id" />
661             </column>
662             <column name="field_id">
663                 <foreignKey table="layout_options" column="field_id" />
664             </column>
665         </table>
666         <table name="lbt_data" comments="Dynamic Field values that an installation can use to extend the data stored in the transactions table">
667             <column name="form_id">
668                 <foreignKey table="transactions" column="id" />
669             </column>
670             <column name="field_id">
671                 <foreignKey table="layout_options" column="field_id" />
672             </column>
673         </table>
674         <table name="layout_options" comments="Holds the layout settings for a specific dynamic field in the system">
675             <column name="form_id">
676                 <foreignKey table="layout_group_properties" column="grp_form_id" />
677             </column>
678             <column name="group_id">
679                 <foreignKey table="layout_group_properties" column="grp_group_id" />
680             </column>
681         </table>
682         <table name="layout_group_properties" comments="Record of the grouped fields used in dynamic layout based forms (LBF)"></table>
683 <!--        - Patient Encounters-->
684         <table name="forms" comments="Patient chart forms that are connected to a patient's encounter visit. Serves as the base record containing all of the common form encounter properties where each sub-type form has data records contained in a table that is named CONCAT('form_',formdir)">
686             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
687             <column name="date" comments="Date of the form"/>
688             <column name="encounter" comments="ID of the associated encounter"/>
689             <column name="form_name" comments="Name of the form"/>
690             <column name="form_id" comments="ID of the specific form instance"/>
691             <column name="pid"  comments="The internal patient identifier">
692                 <foreignKey table="patient_data" column="pid" />
693             </column>
694             <column name="user" comments="User responsible for creating this form.">
695                 <foreignKey table="users" column="username" />
696             </column>
697             <column name="groupname" comments="The groupname that created this record.">
698                 <foreignKey table="groups" column="name" />
699             </column>
700             <column name="authorized" comments="Authorization status"/>
701             <column name="deleted" comments="Flag indicating if the form has been deleted"/>
702             <column name="formdir" comments="Directory name of where the form exists in the filesystem.  Also is the suffix name of the sub-type form that holds the individual form data for this form.  The full table name is CONCAT('form_',formdir)"/>
703             <column name="therapy_group_id" comments="ID of the therapy group that this form's encounter session is connected to">
704                 <foreignKey table="therapy_groups" column="group_id"/>
705             </column>
706             <column name="issue_id" comments="References lists.id to identify the medical issue this form is connected to">
707                 <foreignKey table="lists" column="id" />
708             </column>
709             <column name="provider_id" comments="References users.id to identify the provider who is responsible for or involved in the healthcare this form relates to.  This field is only populated in some types of procedure order forms and when a form is a dynamic Layout Based Form (LBF)">
710                 <foreignKey table="users" column="id" />
711             </column>
712         </table>
713 <!--        - Encounter Summary-->
714         <table name="form_encounter" comments="Represents the information related to a patient's visit to a healthcare provider.  This is different than an appointment as this table tracks the actual service of care">
715             <column name="pid"  comments="The internal patient identifier">
716                 <foreignKey table="patient_data" column="pid" />
717             </column>
718             <column name="last_level_billed"  comments="The party for whom payment was last billed. -1=Nobody, 0=Patient, 1=Ins1, 2=Ins2, 3=Ins3" />
719             <column name="last_level_closed"  comments="The party for whom payment was last received. -1=Nobody, 0=Patient, 1=Ins1, 2=Ins2, 3=Ins3" />
720         </table>
721         <table name="issue_encounter" comments="Links patient medical issues in the lists table with patient service encounters">
722             <column name="pid"  comments="The internal patient identifier">
723                 <foreignKey table="patient_data" column="pid" />
724             </column>
725             <column name="encounter" comments="References form_encounter.encounter, representing the encounter that is connected to the issue">
726                 <foreignKey table="form_encounter" column="encounter" />
727             </column>
728             <column name="list_id" comments="Represents the specific medical issue (allergy,surgery,etc) this encounter is linked to">
729                 <foreignKey table="lists" column="id" />
730             </column>
731             <column name="resolved" comments="0=Issue not resolved,1=Issue is resolved" />
732         </table>
734 <!--        - Fee Sheet-->
735 <!--        - Misc Billing Options-->
736         <table name="form_misc_billing_options" comments="Contains encounter claims billing options that modifies the claims submitted for this encounter">
737             <column name="pid"  comments="The internal patient identifier">
738                 <foreignKey table="patient_data" column="pid" />
739             </column>
740         </table>
742 <!--        - Care Plan-->
743         <table name="form_care_plan" comments="Patient Clinical Care Plans">
744             <column name="pid" comments="The internal patient identifier">
745                 <foreignKey table="patient_data" column="pid" />
746             </column>
747         </table>
749 <!--        - Clinical Instructions-->
750         <table name="form_clinical_instructions" comments="Patient clinical instructions chart note">
751             <column name="pid"  comments="The internal patient identifier">
752                 <foreignKey table="patient_data" column="pid" />
753             </column>
754             <column name="instruction"  comments="The actual instructions to be given to the patient" />
755         </table>
757 <!--        - Clinical Notes-->
758         <table name="form_clinical_notes" comments="Patient clinical notes with support for USCDI V1 standardized note types">
759             <column name="pid"  comments="The internal patient identifier">
760                 <foreignKey table="patient_data" column="pid" />
761             </column>
762             <column name="clinical_notes_type" comments="Comes from the list_options.list_id='Clinical_Note_Type' and represents the standardized note type for this note">
763                 <foreignKey table="list_options" column="option_id" />
764             </column>
765             <column name="clinical_notes_category" comments="Comes from the list_options.list_id='Clinical_Note_Category' and represents the main category for this kind of clinical note">
766                 <foreignKey table="list_options" column="option_id" />
767             </column>
768         </table>
770 <!--        - Eye Exam-->
771         <table name="form_eye_acuity" comments="This table is related to recording visual acuity measurements for different eye conditions.">
772             <column name="pid"  comments="The internal patient identifier">
773                 <foreignKey table="patient_data" column="pid" />
774             </column>
775         </table>
776         <table name="form_eye_antseg" comments="This table is used to store data related to anterior segment eye examinations, which typically include details about the front portion of the eye, such as the cornea, lens, iris, and pupil.">
777             <column name="pid">
778                 <foreignKey table="patient_data" column="pid" />
779             </column>
780         </table>
781         <table name="form_eye_base" comments="Eye form base container record that all other eye forms are connected to">
782             <column name="pid"  comments="The internal patient identifier">
783                 <foreignKey table="patient_data" column="pid" />
784             </column>
785         </table>
786         <table name="form_eye_biometrics" comments="This table stores biometric data related to the eye, including axial length, pupil diameter, and other measurements.">
787             <column name="pid"  comments="The internal patient identifier">
788                 <foreignKey table="patient_data" column="pid" />
789             </column>
790         </table>
791         <table name="form_eye_external" comments="This table is used for recording external eye examination findings.">
792             <column name="pid"  comments="The internal patient identifier">
793                 <foreignKey table="patient_data" column="pid" />
794             </column>
795         </table>
796         <table name="form_eye_hpi" comments="This table stores the history of present illness (HPI) information related to eye conditions.">
797             <column name="pid"  comments="The internal patient identifier">
798                 <foreignKey table="patient_data" column="pid" />
799             </column>
800         </table>
801         <table name="form_eye_locking" comments="Used for tracking the editing status of a form and whether it is currently being edited by a user">
802             <column name="pid"  comments="The internal patient identifier">
803                 <foreignKey table="patient_data" column="pid" />
804             </column>
805         </table>
806         <table name="form_eye_mag_dispense" comments="Stores information related to eye prescriptions and dispensing for both the left (OS) and right (OD) eyes">
807             <column name="pid"  comments="The internal patient identifier">
808                 <foreignKey table="patient_data" column="pid" />
809             </column>
810         </table>
811         <table name="form_eye_mag_impplan" comments="Stores implementation plans for eye-related activities.">
812             <column name="pid"  comments="The internal patient identifier">
813                 <foreignKey table="patient_data" column="pid" />
814             </column>
815         </table>
816         <table name="form_eye_mag_orders" comments="This table is used to track eye-related orders, such as eyeglass or contact lens orders.">
817             <column name="pid"  comments="The internal patient identifier">
818                 <foreignKey table="patient_data" column="pid" />
819             </column>
820         </table>
821         <table name="form_eye_mag_wearing" comments="This table is used to record information related to wearing eyeglasses or contact lenses.">
822             <column name="pid"  comments="The internal patient identifier">
823                 <foreignKey table="patient_data" column="pid" />
824             </column>
825         </table>
826         <table name="form_eye_neuro" comments="This table includes numerous fields for recording the results of neurological tests and assessments, such as near and distant vision, motility measurements, comments, and various neurological parameters.">
827             <column name="pid"  comments="The internal patient identifier">
828                 <foreignKey table="patient_data" column="pid" />
829             </column>
830         </table>
831         <table name="form_eye_postseg" comments="This table is used for storing data related to posterior segment eye examinations, which typically involve the back of the eye, including the retina, optic disc, macula, and blood vessels.">
832             <column name="pid"  comments="The internal patient identifier">
833                 <foreignKey table="patient_data" column="pid" />
834             </column>
835         </table>
836         <table name="form_eye_refraction" comments="This table is used for recording eye refraction details, including sphere, cylinder, axis, prism, and base measurements.">
837             <column name="pid"  comments="The internal patient identifier">
838                 <foreignKey table="patient_data" column="pid" />
839             </column>
840         </table>
841         <table name="form_eye_ros" comments="This table stores review of systems (ROS) information related to various aspects of the eye and its associated systems.">
842             <column name="pid"  comments="The internal patient identifier">
843                 <foreignKey table="patient_data" column="pid" />
844             </column>
845         </table>
846         <table name="form_eye_vitals" comments="This table is used for recording vital signs and measurements related to the eye.">
847             <column name="pid"  comments="The internal patient identifier">
848                 <foreignKey table="patient_data" column="pid" />
849             </column>
850         </table>
851         <table name="form_taskman" comments="This table holds eye related tasks for providing care to the patient.">
852             <column name="PATIENT_ID"  comments="The internal patient identifier">
853                 <foreignKey table="patient_data" column="pid" />
854             </column>
855         </table>
857 <!--        - Functional and Cognitive Status-->
858         <table name="form_functional_cognitive_status" comments="Holds information about assessments, evaluations, or observations of a patient's functional and cognitive abilities.">
859             <column name="pid"  comments="The internal patient identifier">
860                 <foreignKey table="patient_data" column="pid" />
861             </column>
862         </table>
863 <!--        - Observation-->
864         <table name="form_observation" comments="Used for recording observations related to patients during medical encounters">
865             <column name="pid"  comments="The internal patient identifier">
866                 <foreignKey table="patient_data" column="pid" />
867             </column>
868         </table>
869 <!--        - Review of Systems-->
870         <table name="form_reviewofs" comments="Review of Systems observations of the patient. Providers can use this form or the form_ros.">
871             <column name="pid"  comments="The internal patient identifier">
872                 <foreignKey table="patient_data" column="pid" />
873             </column>
874         </table>
876 <!--        - Review of Systems Checks-->
877         <table name="form_ros" comments="Review of Systems observations of the patient. Providers can use this form or the form_reviewofs">
878             <column name="pid"  comments="The internal patient identifier">
879                 <foreignKey table="patient_data" column="pid" />
880             </column>
881         </table>
883 <!--        - SOAP-->
884         <table name="form_soap" comments="Holds Subjective, Objective, Assessment, and Plan (SOAP) notes">
885             <column name="pid"  comments="The internal patient identifier">
886                 <foreignKey table="patient_data" column="pid" />
887             </column>
888         </table>
890 <!--        - Speech Dictation-->
891         <table name="form_dictation" comments="Patient chart note that holds notes created from a provider's speech dictation software">
892             <column name="pid"  comments="The internal patient identifier">
893                 <foreignKey table="patient_data" column="pid" />
894             </column>
895         </table>
897 <!--        - CAMOS-->
898         <table name="form_CAMOS" comments="Computer Aided Medical Ordering System notes that are part of a patient's chart">
899             <column name="pid"  comments="The internal patient identifier">
900                 <foreignKey table="patient_data" column="pid" />
901             </column>
902             <column name="category"  comments="The category that this note is based upon">
903                 <foreignKey table="form_CAMOS_category" column="category" />
904             </column>
905             <column name="subcategory"  comments="The CAMOS subcategory template that this note is based on">
906                 <foreignKey table="form_CAMOS_item" column="item" />
907             </column>
908             <column name="item"  comments="The CAMOS item template that this note is based on">
909                 <foreignKey table="form_CAMOS_item" column="item" />
910             </column>
911             <column name="content"  comments="The actual chart note text that was entered in for the patient" />
912         </table>
913         <table name="form_CAMOS_category" comments="Note categories used in the CAMOS note generator">
914             <column name="pid"  comments="The internal patient identifier">
915                 <foreignKey table="patient_data" column="pid" />
916             </column>
917             <column name="groupname" comments="The groupname that created this record.">
918                 <foreignKey table="groups" column="name" />
919             </column>
920             <column name="user" comments="User responsible for creating this category.">
921                 <foreignKey table="users" column="username" />
922             </column>
923         </table>
924         <table name="form_CAMOS_item" comments="CAMOS patient chart templates for a single item inside a CAMOS subcategory">
925             <column name="pid"  comments="The internal patient identifier">
926                 <foreignKey table="patient_data" column="pid" />
927             </column>
928             <column name="groupname" comments="The groupname that created this record.">
929                 <foreignKey table="groups" column="name" />
930             </column>
931             <column name="user" comments="User responsible for creating this category.">
932                 <foreignKey table="users" column="username" />
933             </column>
934             <column name="subcategory_id" comments="The CAMOS subcategory this item is part of.">
935                 <foreignKey table="form_CAMOS_subcategory" column="id" />
936             </column>
937         </table>
938         <table name="form_CAMOS_subcategory" comments="CAMOS patient chart sub categories inside a single category">
939             <column name="pid"  comments="The internal patient identifier">
940                 <foreignKey table="patient_data" column="pid" />
941             </column>
942             <column name="category_id"  comments="The CAMOS category this subcategory is part of.">
943                 <foreignKey table="form_CAMOS_category" column="id" />
944             </column>
945         </table>
947 <!--        - Procedure Order-->
948         <!--        - Patient Labs-->
949         <table name="procedure_order" comments="A procedure order is an encounter form within a patient visit representing an order for one or more procedures and its associated report/results for the procedure.  Orders can be for either internal or external procedure providers">
950             <column name="procedure_order_id" comments="Surrogate id of the procedure order record" />
951             <column name="uuid" comments="UUID of the record" />
952             <column name="patient_id"  comments="The internal patient identifier">
953                 <foreignKey table="patient_data" column="pid" />
954             </column>
955             <column name="provider_id" comments="References users.id, representing the ordering provider">
956                 <foreignKey table="users" column="id" />
957             </column>
958             <column name="encounter_id" comments="References form_encounter.encounter, representing the encounter for the order">
959                 <foreignKey table="form_encounter" column="encounter" />
960             </column>
961             <column name="date_collected" comments="Time the specimen was collected" />
962             <column name="date_ordered" comments="Date and time the order was placed" />
963             <column name="order_priority" comments="Comes from the list_options.list_id='ord_priority' and represents the priority of the order">
964                 <foreignKey table="list_options" column="option_id" />
965             </column>
966             <column name="order_status" comments="Comes from the list_options.list_id='ord_status' and represents the status of the order (pending, routed, complete, canceled)">
967                 <foreignKey table="list_options" column="option_id" />
968             </column>
969             <column name="patient_instructions" comments="Instructions to be given to the patient for the procedure" />
970             <column name="activity" comments="0 if the record is deleted, 1 if the record is active" />
971             <column name="control_id" comments="Control ID sent back from the lab" />
972             <column name="lab_id" comments="References procedure_providers.ppid and is the lab or provider of the procedure that will process the order and the order is being sent to">
973                 <foreignKey table="procedure_providers" column="ppid" />
974             </column>
975             <column name="specimen_type" comments="Comes from the list_options.list_id='Specimen_Type' and represents the specimen type collected for the procedure">
976                 <foreignKey table="list_options" column="option_id" />
977             </column>
978             <column name="specimen_location" comments="Comes from the list_options.list_id='Specimen_Location' and represents the location the specimen was collected at">
979                 <foreignKey table="list_options" column="option_id" />
980             </column>
981             <column name="specimen_volume" comments="Volume of the specimen" />
982             <column name="date_transmitted" comments="Time of order transmission (null if unsent)" />
983             <column name="clinical_hx" comments="Clinical history text relevant to the order" />
984             <column name="external_id" comments="External identifier" />
985             <column name="history_order" comments="Indicates if the order is added for history purposes only. 0=No, 1=Yes" />
986             <column name="order_diagnosis" comments="Primary order diagnosis" />
987             <column name="billing_type" comments="Comes from the list_options.list_id='procedure_billing' and represents the kind billing being used for this procedure order (insurance, self-pay, etc)">
988                 <foreignKey table="list_options" column="option_id" />
989             </column>
990             <column name="specimen_fasting" comments="Fasting status of the patient at the time the specimen was collected. 0=Patient not fasting, 1=Patient was fasting at time of collection" />
991             <column name="order_psc" comments="Should the order for the Patient  Service Center (PSC) be put on hold. 0=No, 1=Yes" />
992             <column name="order_abn" comments="The status of the US CMS Advanced Beneficiary Notice and whether the patient has already been given the ABN. Possible values are 'not_required'=Patient doesn't need an ABN, 'required'=Patient needs to be given an ABN before procedure can occur, or 'signed'=Patient has already been given an ABN and signed it." />
993             <column name="collector_id" comments="References users.id, representing the individual that collected the specimen">
994                 <foreignKey table="users" column="id" />
995             </column>
996             <column name="account" comments="The specific name of the facility location associated with the order where the lab work will be sent from.  This is typically used for LabCorp orders." />
997             <column name="account_facility" comments="Facility Location associated with the order where the lab work is being sent from.  This is typically used for LabCorp orders.">
998                 <foreignKey table="facility" column="id" />
999             </column>
1000             <column name="provider_number" comments="Provider number" />
1001             <column name="procedure_order_type" comments="Comes from the list_options.list_id='order_type' and represents the type of procedure order this is (order, lab test, imaging, physical exams, etc">
1002                 <foreignKey table="list_options" column="option_id" />
1003             </column>
1004             <column name="procedure_type" comments="Comes from the list_options.list_id='proc_type' and represents the kind of procedure_type this is ('group', 'order', 'discrete_result', etc')">
1005                 <foreignKey table="list_options" column="option_id" />
1006             </column>
1007         </table>
1008         <table name="procedure_providers" comments="This table holds both internal and external laboratories as well as other organizations that provide lab testing, results, and other procedures that can be ordered by a provider">
1009             <column name="ppid" comments="Surrogate ID of the record used as the primary incrementing key"/>
1010             <column name="uuid" comments="UUID of the record"/>
1011             <column name="name" comments="Name of the laboratory or organization"/>
1012             <column name="npi" comments="National Provider Identifier (NPI)"/>
1013             <column name="send_app_id" comments="Sending application ID (MSH-3.1). Empty on Export" exclude="true"/>
1014             <column name="send_fac_id" comments="Sending facility ID (MSH-4.1). Empty on Export" exclude="true"/>
1015             <column name="recv_app_id" comments="Receiving application ID (MSH-5.1). Empty on Export" exclude="true"/>
1016             <column name="recv_fac_id" comments="Receiving facility ID (MSH-6.1). Empty on Export" exclude="true"/>
1017             <column name="DorP" comments="Debugging or Production (MSH-11). Empty on Export" exclude="true"/>
1018             <column name="direction" comments="Bidirectional or Results-only. Empty on Export" exclude="true"/>
1019             <column name="lab_id" comments="Laboratory ID"/>
1020             <column name="protocol" comments="Protocol for communication. Empty on Export" exclude="true"/>
1021             <column name="remote_host" comments="Remote host for communication. Empty on Export" exclude="true"/>
1022             <column name="login" comments="Login information for communication. Empty on Export" exclude="true"/>
1023             <column name="password" comments="Password for communication. Empty on Export" exclude="true"/>
1024             <column name="orders_path" comments="Path for orders. Empty on Export" exclude="true"/>
1025             <column name="results_path" comments="Path for results. Empty on Export" exclude="true"/>
1026             <column name="notes" comments="Additional notes or information. Empty on Export" exclude="true"/>
1027             <column name="lab_director" comments="ID of the laboratory director"/>
1028             <column name="active" comments="Indicates whether the provider is active"/>
1029             <column name="type" comments="Type of provider or organization"/>
1030         </table>
1031         <table name="procedure_order_code" comments="Holds individual procedure / labs ordered from the procedure_type table for a given procedure order.  It contains also the individual diagnosis code that is related to the ordered procedure">
1032             <column name="procedure_order_id">
1033                 <foreignKey table="procedure_order" column="procedure_order_id" />
1034             </column>
1035             <column name="procedure_code">
1036                 <foreignKey table="procedure_type" column="procedure_code" />
1037             </column>
1038         </table>
1039         <table name="procedure_answers" comments="Answers to questions that are requested to be answered for a given procedure by a procedure provider (lab, or other provider)">
1040             <column name="procedure_order_id">
1041                 <foreignKey table="procedure_order" column="procedure_order_id" />
1042             </column>
1043             <column name="procedure_order_seq" />
1044             <column name="question_code">
1045                 <foreignKey table="procedure_questions" column="question_code" />
1046             </column>
1047         </table>
1048         <table name="procedure_questions" comments="Information/questions that should be answered for a given procedure as requested by the procedure service provider. Created as part of the procedure compendium import/creation process.">
1049             <column name="question_code"/>
1050             <column name="lab_id">
1051                 <foreignKey table="procedure_providers" column="ppid" />
1052             </column>
1053             <column name="procedure_code">
1054                 <foreignKey table="procedure_type" column="procedure_code" />
1055             </column>
1056         </table>
1057         <table name="procedure_result" comments="The table stores the actual results and findings from medical procedures and tests, such as laboratory tests, radiology reports, diagnostic imaging, and other clinical tests.">
1058             <column name="procedure_result_id" comments="Surrogate id of the record used as the primary incrementing key"/>
1059             <column name="uuid" comments="UUID of the record"/>
1060             <column name="procedure_report_id">
1061                 <foreignKey table="procedure_report" column="procedure_report_id" />
1062             </column>
1063             <column name="result_data_type" comments="N=Numeric, S=String, F=Formatted, E=External, L=Long text as the first line of comments"/>
1064             <column name="result_code" comments="LOINC code, might match a procedure_type.procedure_code"/>
1065             <column name="result_text" comments="Description of result_code"/>
1066             <column name="date" comments="Lab-provided date specific to this result"/>
1067             <column name="facility" comments="Lab-provided testing facility ID"/>
1068             <column name="units" comments="Units for the result"/>
1069             <column name="result" comments="Result data"/>
1070             <column name="range" comments="Result range"/>
1071             <column name="abnormal" comments="Abnormal values (no, yes, high, low)"/>
1072             <column name="comments" comments="Comments from the lab"/>
1073             <column name="document_id" comments="References documents.id if this result is a document">
1074                 <foreignKey table="documents" column="id" />
1075             </column>
1076             <column name="result_status" comments="Result status (preliminary, cannot be done, final, corrected, incomplete, etc.)"/>
1077             <column name="date_end" comments="Lab-provided end date specific to this result"/>
1078         </table>
1079         <table name="procedure_report" comments="Procedure order overall report container for an ordered procedure result in procedure_order_codes which represents findings, conclusions, and recommendations for the procedure order">
1080             <column name="procedure_report_id" comments="Unique identifier for the procedure report. This is the primary key."/>
1081             <column name="uuid" comments="Universally unique identifier for the procedure report."/>
1082             <column name="procedure_order_seq" comments="References procedure_order_code.procedure_order_seq." />
1083             <column name="procedure_order_id" comments="References the procedure order for which this report is associated.">
1084                 <foreignKey table="procedure_order" column="procedure_order_id" />
1085             </column>
1086             <column name="source" comments="References the user who entered this report data.">
1087                 <foreignKey table="users" column="id" />
1088             </column>
1089             <column name="date_collected" comments="Date and time when the report was collected."/>
1090             <column name="date_collected_tz" comments="Timezone offset from UTC for the date collected."/>
1091             <column name="date_report" comments="Date and time when the report was generated."/>
1092             <column name="date_report_tz" comments="Timezone offset from UTC for the date reported."/>
1093             <column name="specimen_num" comments="A unique identifier for the specimen associated with the report."/>
1094             <column name="report_status" comments="Comes from the list_options.list_id='proc_rep_status' and represents the current state/status of the report (e.g. received, complete, error)">
1095                 <foreignKey table="list_options" column="option_id" />
1096             </column>
1097             <column name="review_status" comments="The status of the report review (e.g., pending review, received, reviewed)."/>
1098             <column name="report_notes" comments="Notes from the lab related to the report."/>
1099         </table>
1100         <table name="procedure_type" comments="This table holds a compendium of possible procedures and labs that can be ordered by the procedure ordering system within OpenEMR">
1101             <column name="procedure_type_id" comments="Surrogate id of the record used as the primary incrementing key"/>
1102             <column name="parent" comments="References procedure_type.procedure_type_id for heirarchies of procedure types"/>
1103             <column name="name" comments="Name for this category, procedure or result type"/>
1104             <column name="lab_id" comments="References procedure_providers.ppid, 0 means default to parent"/>
1105             <column name="procedure_code" comments="Code and code system identifying this procedure in the format of [codesystem:code]" />
1106             <column name="procedure_type" comments="Comes from the list_options.list_id='proc_type' and represents the kind of procedure_type this is ('group', 'order', 'discrete_result', etc')">
1107                 <foreignKey table="list_options" column="option_id" />
1108             </column>
1109             <column name="body_site" comments="Where to do injection, e.g. arm, buttock"/>
1110             <column name="specimen" comments="Blood, urine, saliva, etc."/>
1111             <column name="route_admin" comments="Oral, injection"/>
1112             <column name="laterality" comments="Left, right, ..."/>
1113             <column name="description" comments="Descriptive text for procedure_code"/>
1114             <column name="standard_code" comments="Industry standard code type and code (e.g. CPT4:12345)"/>
1115             <column name="related_code" comments="Suggested code(s) for follow-up services if result is abnormal"/>
1116             <column name="units" comments="Default for procedure_result.units"/>
1117             <column name="range" comments="Default for procedure_result.range"/>
1118             <column name="seq" comments="Sequence number for ordering"/>
1119             <column name="activity" comments="1=active, 0=inactive"/>
1120             <column name="notes" comments="Additional notes to enhance description"/>
1121             <column name="transport" comments=""/>
1122             <column name="procedure_type_name" comments=""/>
1123         </table>
1125 <!--        - Questionnaire Responses-->
1126         <table name="form_questionnaire_assessments" comments="Holds questionnaires results for a patient entered in by a provider as a patient charted form">
1127             <column name="pid"  comments="The internal patient identifier">
1128                 <foreignKey table="patient_data" column="pid" />
1129             </column>
1130             <column name="response_id"  comments="The foreign uuid key to the questionnaire_response.response_id">
1131                 <foreignKey table="questionnaire_response" column="response_id" />
1132             </column>
1133             <column name="questionnaire_id"  comments="The foreign uuid key to the questionnaire.questionnaire_id">
1134                 <foreignKey table="questionnaire_repository" column="questionnaire_id" />
1135             </column>
1136             <column name="user">
1137                 <foreignKey table="users" column="username" />
1138             </column>
1139             <column name="groupname" comments="The groupname that created this record.">
1140                 <foreignKey table="groups" column="name" />
1141             </column>
1142         </table>
1144         <table name="pro_assessments" comments="Contains Patient Reported Outcome assessment results as delivered via the PROMIS assessment delivery system">
1145             <column name="patient_id"  comments="The internal patient identifier">
1146                 <foreignKey table="patient_data" column="pid" />
1147             </column>
1148             <column name="user_id">
1149                 <foreignKey table="users" column="id" />
1150             </column>
1151         </table>
1152         <table name="questionnaire_response" comments="Holds questionnaire results for a patient ">
1153             <column name="patient_id"  comments="The internal patient identifier">
1154                 <foreignKey table="patient_data" column="pid" />
1155             </column>
1156             <column name="audit_user_id">
1157                 <foreignKey table="users" column="id" />
1158             </column>
1159             <column name="creator_user_id">
1160                 <foreignKey table="users" column="id" />
1161             </column>
1162             <column name="encounter">
1163                 <foreignKey table="form_encounter" column="encounter" />
1164             </column>
1165             <column name="questionnaire_foreign_id">
1166                 <foreignKey table="questionnaire_repository" column="id" />
1167             </column>
1168         </table>
1170         <table name="questionnaire_repository" comments="Holds questionnaires that providers or patients fill out for healthcare information collection and/or assessment.">
1171             <column name="id" comments="Unique identifier for the questionnaire record"/>
1172             <column name="uuid" comments="Universally unique identifier for the questionnaire in the EMR system"/>
1173             <column name="questionnaire_id" comments="Unique public identifier"/>
1174             <column name="provider" comments="Identifier for the provider associated with the inputting/creation of this questionnaire"/>
1175             <column name="version" comments="Version number of the questionnaire"/>
1176             <column name="created_date" comments="Date and time when the questionnaire was created"/>
1177             <column name="modified_date" comments="Date and time when the questionnaire was last modified"/>
1178             <column name="name" comments="Name or title of the questionnaire"/>
1179             <column name="type" comments="Type of questionnaire (e.g., FHIR 'Questionnaire')"/>
1180             <column name="profile" comments="Profile information for the questionnaire"/>
1181             <column name="active" comments="Indicates if the questionnaire is active (1 for active, 0 for inactive)"/>
1182             <column name="status" comments="Status information for the questionnaire"/>
1183             <column name="source_url" comments="URL associated with the questionnaire for where the questionnaire originated or where more information about the questionnaire can be obtained"/>
1184             <column name="code" comments="Code associated with the questionnaire"/>
1185             <column name="code_display" comments="Display information for the code associated with the questionnaire"/>
1186             <column name="questionnaire" comments="JSON serialized version of the questionnaire.  If the type of this record is Questionnaire than the JSON will be a serialized definition of a FHIR Questionnaire resource"/>
1187             <column name="lform" comments="National Institutes of Health (NIH) Lforms version of text content for the questionnaire (e.g., for long forms)"/>
1188         </table>
1190         <!--        - Aftercare Plan-->
1191         <table name="form_aftercare_plan" comments="Table for chart notes on patient aftercare plans, including Acute Intoxication/Withdrawal, Emotional/Behavioral Conditions and Complications, and Relapse Potential for patients' care plans.">
1192             <column name="id" comments="Unique identifier for each aftercare plan entry. Primary key." />
1193             <column name="date" comments="Date and time when the aftercare plan was created." />
1194             <column name="pid"  comments="The internal patient identifier">
1195                 <foreignKey table="patient_data" column="pid" />
1196             </column>
1197             <column name="user" comments="User responsible for creating the aftercare plan.">
1198                 <foreignKey table="users" column="username" />
1199             </column>
1200             <column name="provider" comments="Provider assigned to the patient for aftercare planning.UNUSED" />
1201             <column name="groupname" comments="The groupname that created this record.">
1202                 <foreignKey table="groups" column="name" />
1203             </column>
1204             <column name="authorized" comments="Indicates authorization status for the aftercare plan." />
1205             <column name="activity" comments="1 if plan is active, 0 if deleted" />
1206             <column name="client_name" comments="Human readable name of the patient for whom the aftercare plan is created." />
1207             <column name="admit_date" comments="Date when the patient was admitted to the aftercare plan." />
1208             <column name="discharged" comments="Date when the patient was discharged from the aftercare plan." />
1209             <column name="goal_a_acute_intoxication" comments="1st Goal for Acute Intoxication/Withdrawal." />
1210             <column name="goal_a_acute_intoxication_I" comments="2nd Goal for Acute Intoxication/Withdrawal." />
1211             <column name="goal_a_acute_intoxication_II" comments="3rd Goal for Acute Intoxication/Withdrawal." />
1212             <column name="goal_b_emotional_behavioral_conditions" comments="1st Goal for Emotional/Behavioral Conditions and Complications." />
1213             <column name="goal_b_emotional_behavioral_conditions_I" comments="2nd Goal for Emotional/Behavioral Conditions and Complications." />
1214             <column name="goal_c_relapse_potential" comments="1st Goal related to Relapse Potential." />
1215             <column name="goal_c_relapse_potential_I" comments="2nd Goal related to Relapse Potential." />
1216         </table>
1218         <!--        - Ankle Evaluation Form-->
1219         <table name="form_ankleinjury" comments="Represents a provider's evaluation of an ankle injury including x-ray information, diagnosis, and recommended treatments">
1220             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
1221             <column name="date" comments="Date of the evaluation"/>
1222             <column name="pid" comments="The internal patient identifier">
1223                 <foreignKey table="patient_data" column="pid" />
1224             </column>
1225             <column name="user" comments="User responsible for creating the record.">
1226                 <foreignKey table="users" column="username" />
1227             </column>
1228             <column name="groupname" comments="The groupname that created this record.">
1229                 <foreignKey table="groups" column="name" />
1230             </column>
1231             <column name="authorized" comments="Authorization status"/>
1232             <column name="activity" comments="Activity status, 1=form is active, 0=inactive"/>
1233             <column name="ankle_date_of_injury" comments="Date of the ankle injury"/>
1234             <column name="ankle_work_related" comments="Work-related information for the injury"/>
1235             <column name="ankle_foot" comments="Foot information related to the injury"/>
1236             <column name="ankle_severity_of_pain" comments="Severity of pain associated with the injury 1-3"/>
1237             <column name="ankle_significant_swelling" comments="Indication of significant swelling"/>
1238             <column name="ankle_onset_of_swelling" comments="Onset of swelling"/>
1239             <column name="ankle_how_did_injury_occur" comments="Description of how the injury occurred"/>
1240             <column name="ankle_ottawa_bone_tenderness" comments="Information about Ottawa bone tenderness"/>
1241             <column name="ankle_able_to_bear_weight_steps" comments="Ability to bear weight and steps information"/>
1242             <column name="ankle_x_ray_interpretation" comments="Interpretation of X-ray results"/>
1243             <column name="ankle_additional_x_ray_notes" comments="Additional notes related to X-ray"/>
1244             <column name="ankle_diagnosis1" comments="Diagnosis 1 for the ankle injury"/>
1245             <column name="ankle_diagnosis2" comments="Diagnosis 2 for the ankle injury"/>
1246             <column name="ankle_diagnosis3" comments="Diagnosis 3 for the ankle injury"/>
1247             <column name="ankle_diagnosis4" comments="Diagnosis 4 for the ankle injury"/>
1248             <column name="ankle_plan" comments="Recommended treatment plan for the ankle injury"/>
1249             <column name="ankle_additional_diagnosis" comments="Additional diagnosis for the ankle injury"/>
1250         </table>
1252         <!--        - Bronchitis Form-->
1253         <table name="form_bronchitis" comments="Records symptoms, diagnosis, and recommended treatments for bronchitis in a patient">
1254             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
1255             <column name="date" comments="Date when the record was created"/>
1256             <column name="pid"  comments="The internal patient identifier">
1257                 <foreignKey table="patient_data" column="pid" />
1258             </column>
1259             <column name="user" comments="User responsible for creating the record.">
1260                 <foreignKey table="users" column="username" />
1261             </column>
1262             <column name="groupname" comments="The groupname that created this record.">
1263                 <foreignKey table="groups" column="name" />
1264             </column>
1265             <column name="authorized" comments="Authorization flag"/>
1266             <column name="activity" comments="Activity status, 1=form is active, 0=inactive"/>
1267             <column name="bronchitis_date_of_illness" comments="Date of illness for bronchitis"/>
1268             <column name="bronchitis_hpi" comments="History of Present Illness for bronchitis"/>
1269             <column name="bronchitis_ops_fever" comments="Operations related to fever"/>
1270             <column name="bronchitis_ops_cough" comments="Operations related to cough"/>
1271             <column name="bronchitis_ops_dizziness" comments="Operations related to dizziness"/>
1272             <column name="bronchitis_ops_chest_pain" comments="Operations related to chest pain"/>
1273             <column name="bronchitis_ops_dyspnea" comments="Operations related to dyspnea"/>
1274             <column name="bronchitis_ops_sweating" comments="Operations related to sweating"/>
1275             <column name="bronchitis_ops_wheezing" comments="Operations related to wheezing"/>
1276             <column name="bronchitis_ops_malaise" comments="Operations related to malaise"/>
1277             <column name="bronchitis_ops_sputum" comments="Operations related to sputum"/>
1278             <column name="bronchitis_ops_appearance" comments="Operations related to appearance"/>
1279             <column name="bronchitis_ops_all_reviewed" comments="Operations related to all reviewed"/>
1280             <column name="bronchitis_review_of_pmh" comments="Review of Past Medical History for bronchitis"/>
1281             <column name="bronchitis_review_of_medications" comments="Review of medications for bronchitis"/>
1282             <column name="bronchitis_review_of_allergies" comments="Review of allergies for bronchitis"/>
1283             <column name="bronchitis_review_of_sh" comments="Review of social history for bronchitis"/>
1284             <column name="bronchitis_review_of_fh" comments="Review of family history for bronchitis"/>
1285             <column name="bronchitis_tms_normal_right" comments="Tympanic Membrane and Sinus - Normal Right"/>
1286             <column name="bronchitis_tms_normal_left" comments="Tympanic Membrane and Sinus - Normal Left"/>
1287             <column name="bronchitis_nares_normal_right" comments="Nares - Normal Right"/>
1288             <column name="bronchitis_nares_normal_left" comments="Nares - Normal Left"/>
1289             <column name="bronchitis_tms_thickened_right" comments="Tympanic Membrane and Sinus - Thickened Right"/>
1290             <column name="bronchitis_tms_thickened_left" comments="Tympanic Membrane and Sinus - Thickened Left"/>
1291             <column name="bronchitis_tms_af_level_right" comments="Tympanic Membrane and Sinus - AF Level Right"/>
1292             <column name="bronchitis_tms_af_level_left" comments="Tympanic Membrane and Sinus - AF Level Left"/>
1293             <column name="bronchitis_nares_swelling_right" comments="Nares - Swelling Right"/>
1294             <column name="bronchitis_nares_swelling_left" comments="Nares - Swelling Left"/>
1295             <column name="bronchitis_tms_retracted_right" comments="Tympanic Membrane and Sinus - Retracted Right"/>
1296             <column name="bronchitis_tms_retracted_left" comments="Tympanic Membrane and Sinus - Retracted Left"/>
1297             <column name="bronchitis_nares_discharge_right" comments="Nares - Discharge Right"/>
1298             <column name="bronchitis_nares_discharge_left" comments="Nares - Discharge Left"/>
1299             <column name="bronchitis_tms_bulging_right" comments="Tympanic Membrane and Sinus - Bulging Right"/>
1300             <column name="bronchitis_tms_bulging_left" comments="Tympanic Membrane and Sinus - Bulging Left"/>
1301             <column name="bronchitis_tms_perforated_right" comments="Tympanic Membrane and Sinus - Perforated Right"/>
1302             <column name="bronchitis_tms_perforated_left" comments="Tympanic Membrane and Sinus - Perforated Left"/>
1303             <column name="bronchitis_tms_nares_not_examined" comments="Tympanic Membrane and Sinus - Nares Not Examined"/>
1304             <column name="bronchitis_no_sinus_tenderness" comments="No sinus tenderness"/>
1305             <column name="bronchitis_oropharynx_normal" comments="Oropharynx - Normal"/>
1306             <column name="bronchitis_sinus_tenderness_frontal_right" comments="Sinus Tenderness - Frontal Right"/>
1307             <column name="bronchitis_sinus_tenderness_frontal_left" comments="Sinus Tenderness - Frontal Left"/>
1308             <column name="bronchitis_oropharynx_erythema" comments="Oropharynx - Erythema"/>
1309             <column name="bronchitis_oropharynx_exudate" comments="Oropharynx - Exudate"/>
1310             <column name="bronchitis_oropharynx_abcess" comments="Oropharynx - Abscess"/>
1311             <column name="bronchitis_oropharynx_ulcers" comments="Oropharynx - Ulcers"/>
1312             <column name="bronchitis_sinus_tenderness_maxillary_right" comments="Sinus Tenderness - Maxillary Right"/>
1313             <column name="bronchitis_sinus_tenderness_maxillary_left" comments="Sinus Tenderness - Maxillary Left"/>
1314             <column name="bronchitis_oropharynx_appearance" comments="Oropharynx - Appearance"/>
1315             <column name="bronchitis_sinus_tenderness_not_examined" comments="Sinus Tenderness - Not Examined"/>
1316             <column name="bronchitis_oropharynx_not_examined" comments="Oropharynx - Not Examined"/>
1317             <column name="bronchitis_heart_pmi" comments="Heart - PMI (Point of Maximal Impulse)"/>
1318             <column name="bronchitis_heart_s3" comments="Heart - S3 Sound"/>
1319             <column name="bronchitis_heart_s4" comments="Heart - S4 Sound"/>
1320             <column name="bronchitis_heart_click" comments="Heart - Click Sound"/>
1321             <column name="bronchitis_heart_rub" comments="Heart - Rub Sound"/>
1322             <column name="bronchitis_heart_murmur" comments="Heart - Murmur"/>
1323             <column name="bronchitis_heart_grade" comments="Heart - Grade"/>
1324             <column name="bronchitis_heart_location" comments="Heart - Location"/>
1325             <column name="bronchitis_heart_normal" comments="Heart - Normal Exam"/>
1326             <column name="bronchitis_heart_not_examined" comments="Heart - Not Examined"/>
1327             <column name="bronchitis_lungs_bs_normal" comments="Lungs - Breath Sounds Normal"/>
1328             <column name="bronchitis_lungs_bs_reduced" comments="Lungs - Breath Sounds Reduced"/>
1329             <column name="bronchitis_lungs_bs_increased" comments="Lungs - Breath Sounds Increased"/>
1330             <column name="bronchitis_lungs_crackles_lll" comments="Lungs - Crackles - Left Lower Lobe"/>
1331             <column name="bronchitis_lungs_crackles_rll" comments="Lungs - Crackles - Right Lower Lobe"/>
1332             <column name="bronchitis_lungs_crackles_bll" comments="Lungs - Crackles - Both Lower Lobes"/>
1333             <column name="bronchitis_lungs_rubs_lll" comments="Lungs - Rubs - Left Lower Lobe"/>
1334             <column name="bronchitis_lungs_rubs_rll" comments="Lungs - Rubs - Right Lower Lobe"/>
1335             <column name="bronchitis_lungs_rubs_bll" comments="Lungs - Rubs - Both Lower Lobes"/>
1336             <column name="bronchitis_lungs_wheezes_lll" comments="Lungs - Wheezes - Left Lower Lobe"/>
1337             <column name="bronchitis_lungs_wheezes_rll" comments="Lungs - Wheezes - Right Lower Lobe"/>
1338             <column name="bronchitis_lungs_wheezes_bll" comments="Lungs - Wheezes - Both Lower Lobes"/>
1339             <column name="bronchitis_lungs_wheezes_dll" comments="Lungs - Wheezes - Diffuse"/>
1340             <column name="bronchitis_lungs_normal_exam" comments="Lungs - Normal Exam"/>
1341             <column name="bronchitis_lungs_not_examined" comments="Lungs - Not Examined"/>
1342             <column name="bronchitis_diagnostic_tests" comments="Diagnostic tests for bronchitis"/>
1343             <column name="diagnosis1_bronchitis_form" comments="Diagnosis 1 for bronchitis form"/>
1344             <column name="diagnosis2_bronchitis_form" comments="Diagnosis 2 for bronchitis form"/>
1345             <column name="diagnosis3_bronchitis_form" comments="Diagnosis 3 for bronchitis form"/>
1346             <column name="diagnosis4_bronchitis_form" comments="Diagnosis 4 for bronchitis form"/>
1347             <column name="bronchitis_additional_diagnosis" comments="Additional diagnoses for bronchitis"/>
1348             <column name="bronchitis_treatment" comments="Treatment information for bronchitis"/>
1349         </table>
1351         <!--        - Track Anything-->
1352         <table name="form_track_anything" comments="Clinical note form that allows clinicians to provide point in time and longitudinal tracking of any data element they configure">
1353             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1354                 <foreignKey table="forms" column="form_id" />
1355             </column>
1356             <column name="pid"  comments="The internal patient identifier">
1357                 <foreignKey table="patient_data" column="pid" />
1358             </column>
1359             <column name="procedure_type_id">
1360                 <foreignKey table="form_track_anything_type" column="track_anything_type_id" />
1361             </column>
1362             <column name="name"  comments="The name of the type of the data element being tracked" />
1363         </table>
1364         <table name="form_track_anything_type" comments="Represents the category grouping / track of the data element being tracked via the track_anything form">
1365             <column name="name"  comments="The name of the type of the data element being tracked" />
1366             <column name="description"  comments="Description of the data element type being tracked" />
1367             <column name="parent"  comments="This is a reference to a parent form_track_anything_type element. 0=There is no parent, if !0 then it is the track_anything_type_id for the parent element" />
1368             <column name="position"  comments="The order this element should be filled out in the track anything population mechanism" />
1369             <column name="active"  comments="1=The element is active and allows for data entry, 0=data entry is disabled and the element is not displayed to the user" />
1370         </table>
1371         <table name="form_track_anything_results">
1372             <column name="id" comments="Surrogate ID of the result record used as the primary incrementing key"/>
1373             <column name="track_anything_id">
1374                 <foreignKey table="form_track_anything" column="id" />
1375             </column>
1376             <column name="track_timestamp" comments="The time this result was recorded" />
1377             <column name="itemid" comments="The data element that is being tracked for this result that is found in the form_track_anything_type table">
1378                 <foreignKey table="form_track_anything_type" column="track_anything_type_id" />
1379             </column>
1380             <column name="result" comments="The user entered response for this data element being tracked" />
1381             <column name="comment" comments="UNUSED" />
1382             <column name="notes" comments="UNUSED" />
1383         </table>
1386 <!--        - Social Screening Tool-->
1387         <table name="form_sdoh" comments="Encounter form that holds results for the Social Determinants of Health Screening Tool">
1388             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1389                 <foreignKey table="forms" column="form_id" />
1390             </column>
1391             <column name="pid"  comments="The internal patient identifier">
1392                 <foreignKey table="patient_data" column="pid" />
1393             </column>
1394             <column name="user" comments="The user that created this record.">
1395                 <foreignKey table="users" column="id" />
1396             </column>
1397             <column name="groupname" comments="The groupname that created this record.">
1398                 <foreignKey table="groups" column="name" />
1399             </column>
1400         </table>
1402 <!--        - Graphic Pain Map-->
1403         <table name="form_painmap" comments="Patient pain map form. Pain map image for mapping this form is stored in the EHI zip export at images/painmap.png">
1404             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1405                 <foreignKey table="forms" column="form_id" />
1406             </column>
1407             <column name="pid"  comments="The internal patient identifier">
1408                 <foreignKey table="patient_data" column="pid" />
1409             </column>
1410             <column name="user" comments="The user that created this record.">
1411                 <foreignKey table="users" column="id" />
1412             </column>
1413             <column name="groupname" comments="The groupname that created this record." >
1414                 <foreignKey table="groups" column="name" />
1415             </column>
1416             <column name="data" comments="Data of the patient pain map to overlay ontop of the pain image.  Each mapped data element is in the following format x1CoordinatePixels^y1CoordinatePixels^pain1Description}...}." />
1417         </table>
1419 <!--        - Treatment Plan-->
1420         <table name="form_treatment_plan" comments="Patient treatment plan form">
1421             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1422                 <foreignKey table="forms" column="form_id" />
1423             </column>
1424             <column name="user" comments="The user that created this record." >
1425                 <foreignKey table="users" column="id" />
1426             </column>
1427             <column name="groupname" comments="The groupname that created this record.">
1428                 <foreignKey table="groups" column="name" />
1429             </column>
1430             <column name="pid"  comments="The internal patient identifier">
1431                 <foreignKey table="patient_data" column="pid" />
1432             </column>
1433         </table>
1435 <!--        - Physical Exam-->
1436         <table name="form_physical_exam" comments="Physical Examination clinical note">
1437             <column name="forms_id">
1438                 <foreignKey table="forms" column="id" />
1439             </column>
1440             <column name="line_id">
1441                 <foreignKey table="form_physical_exam_diagnoses" column="line_id" />
1442             </column>
1443             <column name="diagnosis">
1444                 <foreignKey table="form_physical_exam_diagnoses" column="diagnosis" />
1445             </column>
1446         </table>
1447         <table name="form_physical_exam_diagnoses" comments="Physical Exam Diagnosis for a physical exam that was conducted">
1448         </table>
1450 <!--        - Prior Authorization-->
1451         <table name="form_prior_auth" comments="Patient Prior Authorization records">
1452             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1453                 <foreignKey table="forms" column="form_id" />
1454             </column>
1455             <column name="pid"  comments="The internal patient identifier">
1456                 <foreignKey table="patient_data" column="pid" />
1457             </column>
1458         </table>
1460 <!--        - GAD-7-->
1461         <table name="form_gad7" comments="Encounter form that holds patient results for the GAD7 assessment">
1462             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1463                 <foreignKey table="forms" column="form_id" />
1464             </column>
1465             <column name="user" comments="The user that created this record.">
1466                 <foreignKey table="users" column="id" />
1467             </column>
1468             <column name="groupname" comments="The groupname that created this record.">
1469                 <foreignKey table="groups" column="name"  />
1470             </column>
1471             <column name="pid"  comments="The internal patient identifier">
1472                 <foreignKey table="patient_data" column="pid" />
1473             </column>
1474         </table>
1476 <!--        - PHQ-9-->
1477         <table name="form_phq9" comments="Encounter form that holds patient results for the PHQ9 assessment">
1478             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1479                 <foreignKey table="forms" column="form_id" />
1480             </column>
1481             <column name="user" comments="The user that created this record.">
1482                 <foreignKey table="users" column="id"  />
1483             </column>
1484             <column name="groupname" comments="The groupname that created this record." >
1485                 <foreignKey table="groups" column="name" />
1486             </column>
1487             <column name="pid"  comments="The internal patient identifier">
1488                 <foreignKey table="patient_data" column="pid" />
1489             </column>
1490         </table>
1492 <!--        - Work/School Note-->
1493         <table name="form_note" comments="Work/School note written by a provider for a patient to provide documentation of their medical condition to their work or school">
1494             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1495                 <foreignKey table="forms" column="form_id" />
1496             </column>
1497             <column name="pid"  comments="The internal patient identifier">
1498                 <foreignKey table="patient_data" column="pid" />
1499             </column>
1500         </table>
1502 <!--        - Transfer Summary-->
1503         <table name="form_transfer_summary" comments="Records transfer summary of care and is an alternative to recording referrals in the transactions table">
1504             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1505                 <foreignKey table="forms" column="form_id" />
1506             </column>
1507             <column name="pid"  comments="The internal patient identifier">
1508                 <foreignKey table="patient_data" column="pid" />
1509             </column>
1510         </table>
1512 <!--        - Clinic Note-->
1513         <table name="form_clinic_note" comments="Holds patient history, provider examination conducted, patient treatment plan, and follow up status">
1514             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1515                 <foreignKey table="forms" column="form_id" />
1516             </column>
1517         </table>
1519 <!--        patient notes-->
1520 <!--        patient documents-->
1521         <table name="onsite_documents" comments="Digital documents that have been assigned to a patient from a document_template that the patient has saved or submitted for review by clinical staff">
1522             <column name="pid"  comments="The internal patient identifier">
1523                 <foreignKey table="patient_data" column="pid" />
1524             </column>
1525             <column name="facility">
1526                 <foreignKey table="facility" column="id" />
1527             </column>
1528             <column name="encounter">
1529                 <foreignKey table="form_encounter" column="encounter" />
1530             </column>
1531             <column name="user" comments="User who created the esignature">
1532                 <foreignKey table="users" column="id" />
1533             </column>
1534         </table>
1536         <table name="document_templates" comments="Digital document templates that are assigned to patients">
1537             <column name="pid"  comments="The internal patient identifier.">
1538                 <foreignKey table="patient_data" column="pid" />
1539             </column>
1540             <column name="template_content" comments="Digital document template that is assigned to a patient to be filled out.  Uses Domain Specific Language (DSL) template tags to inject specific functionality into the template for patients to fill out.  Patient data template tags can be found at the following URL: https://www.open-emr.org/wiki/index.php/Patient_Portal_Document_Templates" />
1541         </table>
1543         <table name="onsite_signatures" comments="Patient portal digital signatures used for patient documents and anywhere else a signature is required in the portal">
1544             <column name="pid"  comments="The internal patient identifier">
1545                 <foreignKey table="patient_data" column="pid" />
1546             </column>
1547             <column name="encounter">
1548                 <foreignKey table="form_encounter" column="encounter" />
1549             </column>
1550             <column name="type" comments="witness-signature " />
1551             <column name="signer" comments="If type=witness-signature signer will be 'Witness Signature' if type='admin-signature' then signer will be the Username of the clinical staff member that signed, if type='patient-signature' then the value will be the patient's name" />
1552             <column name="user" comments="User who created the esignature.  If the signature is a staff member (administrator/witness) it will come from the users.username.  If it is a patient signature the value will be '-patient-'" />
1553             <column name="sig_image" comments="The image of the signature as a Data URI created from a browser Canvas object representing an image/png image of the signature" />
1554             <column name="sig_hash" comments="sha3-512 hash of the sig_image" />
1555         </table>
1556         <table name="patient_access_onsite" comments="Holds patient portal onsite credentials, username information and login meta information">
1557             <column name="portal_pwd" comments="Hash of the patient password.  Empty for export." exclude="true"/>
1558             <column name="portal_onetime" comments="One time login key.  Empty for export." exclude="true"/>
1559             <column name="pid"  comments="The internal patient identifier">
1560                 <foreignKey table="patient_data" column="pid" />
1561             </column>
1562         </table>
1563         <table name="onsite_portal_activity" comments="Patient portal activity (document submission, and other activities) that requires review before they are accepted into the patient chart">
1564             <column name="patient_id"  comments="The internal patient identifier">
1565                 <foreignKey table="patient_data" column="pid" />
1566             </column>
1567         </table>
1568         <table name="onsite_mail" comments="Patient asynchronous messages to and from clinical staff">
1569             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
1570             <column name="date" comments="Date and time of the message"/>
1571             <column name="owner" comments="Owner of the message. If this is a message intended for a patient this will be the patient_data.pid if it is for a user this will be the users.id"/>
1572             <column name="user" comments="User associated with the message"/>
1573             <column name="groupname" comments="Name of the group associated with the message"/>
1574             <column name="activity" comments="Activity associated with the message. 0=deleted, 1=message is active"/>
1575             <column name="authorized" comments="Authorization status of the message"/>
1576             <column name="header" comments="Header of the message"/>
1577             <column name="title" comments="Title of the message"/>
1578             <column name="body" comments="Body of the message"/>
1579             <column name="recipient_id" comments="ID of the message recipient. If a patient is sending this message to a user this will be the users.id, otherwise it is i the patient_data.pid"/>
1580             <column name="recipient_name" comments="Name of the message recipient. This will be the first and last name of the recipient."/>
1581             <column name="sender_id" comments="ID of the message sender.  If a patient is sending this message to a user this will be the patient_data.pid, otherwise it is the users.id"/>
1582             <column name="sender_name" comments="Name of the message sender"/>
1583             <column name="assigned_to" comments="Assignment information for the message"/>
1584             <column name="deleted" comments="Flag indicating whether the mail is deleted"/>
1585             <column name="delete_date" comments="Date and time when the message was deleted"/>
1586             <column name="mtype" comments="Message type ('Notification', 'Message')"/>
1587             <column name="message_status" comments="Status of the message ('Done','New')"/>
1588             <column name="mail_chain" comments="Mail chain ID"/>
1589             <column name="reply_mail_chain" comments="Reply mail chain ID"/>
1590             <column name="is_msg_encrypted" comments="Whether the message is encrypted (0-Not encrypted, 1-Encrypted)"/>
1591         </table>
1592         <table name="onsite_messages" comments="Patient secure chat messages to and from clinical staff for real time communication">
1593             <column name="id" comments="Surrogate ID of the message record" />
1594             <column name="username" comments="Username associated with the message sender  This will be the patient's portal username if a patient sent the message.  Otherwise it is the user's username if a user sent the message." />
1595             <column name="message" comments="The content of the chat message" />
1596             <column name="ip" comments="IP address of the sender.  Empty on export" exclude="true" />
1597             <column name="date" comments="Timestamp of when the message was sent" />
1598             <column name="sender_id" comments="ID of the message sender.  This will be the patient_data.pid if a patient sent the message.  Otherwise it is the users.id if a user sent the message." />
1599             <column name="recip_id" comments="JSON array of message recipients.  If the message is being sent to one or more clinical staff it will be a JSON array of the usernames from the users table.  If a user sends the message it will be a JSON array of one or more patient_data.pid ids.  On EHI export this array is filtered to only include patient_data.pids that are in the the specific export task.  These messages will be duplicated if patients are in different export tasks but received the same message." />
1600         </table>
1601         <!--        - External Data (Encounters  Procedures) -->
1602         <table name="external_encounters" comments="Holds data on encounters that exist outside of this EMR that were in a patient CCDA import">
1603             <column name="ee_pid"  comments="The internal patient identifier">
1604                 <foreignKey table="patient_data" column="pid" />
1605             </column>
1606         </table>
1607         <table name="external_procedures" comments="Holds data on external procedures that exist outside of this EMR that were in a patient CCDA import">
1608             <column name="ep_pid"  comments="The internal patient identifier">
1609                 <foreignKey table="patient_data" column="pid" />
1610             </column>
1611             <column name="ep_encounter"  comments="The encounter for the external procedure">
1612                 <foreignKey table="form_encounter" column="encounter" />
1613             </column>
1614         </table>
1616         <table name="shared_attributes" comments="Dynamic patient, encounter, and transaction table properties created via LBF/LBT mechanism">
1617             <column name="pid"  comments="The internal patient identifier">
1618                 <foreignKey table="patient_data" column="pid" />
1619             </column>
1620             <column name="encounter"  comments="0 if patient attribute, else this is an encounter attribute and references the form_encounter.encounter property">
1621                 <foreignKey table="form_encounter" column="encounter" />
1622             </column>
1623             <column name="field_id"  comments="references layout_options.field_id and is the unique property name of this shared attribute">
1624                 <foreignKey table="layout_options" column="field_id" />
1625             </column>
1626             <column name="user_id" comments="User who last updated this shared attribute">
1627                 <foreignKey table="users" column="id" />
1628             </column>
1629         </table>
1631         <table name="claims" comments="Insurance Billing Claims - Used for tracking and submission of billing claims to payers">
1632             <column name="patient_id"  comments="The internal patient identifier">
1633                 <foreignKey table="patient_data" column="pid" />
1634             </column>
1635             <column name="encounter_id" comments="Encounter identifier - Identifier for the patient encounter associated with the claim">
1636                 <foreignKey table="form_encounter" column="encounter" />
1637             </column>
1638             <column name="version" comments="Claim version - Incremented in code to track changes in claims" />
1639             <column name="payer_id"  comments="The insurance company being billed. If this is self-pay the id will be 0">
1640                 <foreignKey table="insurance_companies" column="id" />
1641             </column>
1642             <column name="status" comments="Claim status - Status of the billing claim. -1=Leave Unchanged,1=Unbilled,2=Mark as billed, 7=Denied" />
1643             <column name="payer_type" comments="The payer type code, indicating the source of payment (0=patient, 1=primary insurance, 2=secondary insurance, etc)." />
1644             <column name="bill_process" comments="Billing process status. -1=Leave unchanged, 0=Claim is open,1=Processing in progress,2=Billed,3=Error" />
1645             <column name="bill_time" comments="Billing time - The datetime this bill was created" />
1646             <column name="process_time" comments="Processing time - Time of claim processing" />
1647             <column name="process_file" comments="Processing file - File associated with claim processing" />
1648             <column name="target" comments="Claim target - Target associated with the claim" />
1649             <column name="x12_partner_id" comments="X12 Partner identifier - Identifier for the X12 partner.  Empty in export" exclude="true" />
1650             <column name="submitted_claim" comments="Submitted claim - Claims form data" />
1651         </table>
1653         <table name="voids" comments="Tracks a voided receipt or checkout for a patient">
1654             <column name="patient_id"  comments="The internal patient identifier">
1655                 <foreignKey table="patient_data" column="pid" />
1656             </column>
1657             <column name="encounter_id">
1658                 <foreignKey table="form_encounter" column="encounter" />
1659             </column>
1660             <column name="user_id">
1661                 <foreignKey table="users" column="id" />
1662             </column>
1663         </table>
1665         <table name="billing" comments="Patient billing records for billing codes - Used for Claims Processing">
1666             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
1667             <column name="pid"  comments="The internal patient identifier">
1668                         <foreignKey table="patient_data" column="pid" />
1669             </column>
1670             <column name="provider_id"  comments="The insurance company being billed. If this is self-pay the id will be 0">
1671                 <foreignKey table="insurance_companies" column="id" />
1672             </column>
1673             <column name="payer_id"  comments="The insurance company being billed. If this is self-pay the id will be 0">
1674                 <foreignKey table="insurance_companies" column="id" />
1675             </column>
1676             <column name="x12_partner_id"  comments="The X12 partner clearinghouse id. Empty On Export" exclude="true" />
1677             <column name="user" comments="The user that created this billing record.">
1678                 <foreignKey table="users" column="id" />
1679             </column>
1680             <column name="groupname" comments="Group name associated with the billing record">
1681                 <foreignKey table="groups" column="name" />
1682             </column>
1683             <column name="encounter" comments="The encounter that this billing record is connected to">
1684                 <foreignKey table="form_encounter" column="encounter" />
1685             </column>
1688             <column name="date" comments="Date associated with the billing record"/>
1689             <column name="code_type" comments="Type of billing code"/>
1690             <column name="code" comments="Billing code"/>
1691             <column name="authorized" comments="Authorization status (1 for authorized, 0 for unauthorized)"/>
1692             <column name="code_text" comments="Text associated with the billing code"/>
1693             <column name="billed" comments="Billing status (1 for billed, 0 for unbilled)"/>
1694             <column name="activity" comments="Activity status (1 for active, 0 for inactive)"/>
1695             <column name="bill_process" comments="Bill process code -1=leave unprocessed,0=open,1=in progress,2=billed"/>
1696             <column name="bill_date" comments="Date when billing moved into the billed status"/>
1697             <column name="process_date" comments="Date when the bill was moved into the processing state"/>
1698             <column name="process_file" comments="File associated with billing process"/>
1699             <column name="modifier" comments="Modifier for billing code"/>
1700             <column name="units" comments="Number of units for billing"/>
1701             <column name="fee" comments="Fee associated with billing"/>
1702             <column name="justify" comments="Justification for billing code"/>
1703             <column name="target" comments="Target associated with billing code"/>
1704             <column name="ndc_info" comments="NDC (National Drug Code) information"/>
1705             <column name="notecodes" comments="Notecodes associated with billing"/>
1706             <column name="external_id" comments="External identifier associated with billing"/>
1707             <column name="pricelevel" comments="Price level associated with billing"/>
1708             <column name="revenue_code" comments="Item revenue code"/>
1709             <column name="chargecat" comments="Comes from the list_options.list_id='chargecats' and represents the charge category for certain insursers">
1710                 <foreignKey table="list_options" column="option_id" />
1711             </column>
1712         </table>
1714         <table name="drugs" comments="Contains information about drugs that are dispensed/prescribed to patients.  Also holds product inventory information if providers are internally managing their own drugs/medical supplies">
1716         </table>
1718         <table name="drug_sales" comments="Product/Drug sales to Patients">
1719             <column name="sale_id"  comments="The unique identifier for this record" />
1720             <column name="pid"  comments="The internal patient identifier">
1721                 <foreignKey table="patient_data" column="pid" />
1722             </column>
1723             <column name="encounter" comments="The patient encounter which resulted in this drug being sold to the patient.">
1724                 <foreignKey table="form_encounter" column="encounter" />
1725             </column>
1726             <column name="drug_id" comments="The id of the drug that was sold to the patient. 0 if the record is not dispensed to a patient">
1727                 <foreignKey table="drugs" column="drug_id" />
1728             </column>
1729             <column name="sale_date"  comments="The date the sale occurred on" />
1730             <column name="fee"  comments="The total price of the sale for the drug that was sold to the patient" />
1731             <column name="quantity"  comments="The number of items sold of the drug" />
1732             <column name="distributor_id" comments="UNUSED - will be removed in the future" />
1733         </table>
1735         <table name="ar_activity" comments="Accounts Receivable item entries in invoice/claim activity">
1736             <column name="pid"  comments="The internal patient identifier">
1737                 <foreignKey table="patient_data" column="pid" />
1738             </column>
1739             <column name="encounter" comments="The identifier for the encounter for which the payment is connected to (foreign key reference to the forms_encounter.encounter).">
1740                 <foreignKey table="form_encounter" column="encounter" />
1741             </column>
1742             <column name="sequence_no" comments="A unique identifier for this payment activity, incremented in the code." />
1743             <column name="code_type"  comments="The code system that is used for this billing activity" />
1744             <column name="code"  comments="The code in the code system referenced in code_type that is the main billing code for this billing activity" />
1745             <column name="modifier"  comments="Billing code modifier" />
1746             <column name="payer_type" comments="The payer type code, indicating the source of payment (0=patient, 1=primary insurance, 2=secondary insurance, etc)."/>
1747             <column name="post_time" comments="The timestamp indicating when the payment was posted (in DATETIME format)."/>
1748             <column name="post_user" comments="The user ID (foreign key reference to the users table) of the person who posted the payment.">
1749                 <foreignKey table="users" column="id" />
1750             </column>
1751             <column name="fee"  comments="The billing fee that is being requested for payment of services rendered" />
1752             <column name="post_time"  comments="Time of the posting on the date referenced in post_date" />
1754             <column name="session_id" comments="The session ID (foreign key reference to the ar_session table) associated with this payment activity, if applicable.">
1755                 <foreignKey table="ar_session" column="session_id" />
1756             </column>
1757             <column name="memo" comments="Additional comments or adjustment reasons related to the payment activity."/>
1758             <column name="pay_amount" comments="The actual payment amount received (in DECIMAL format), which may differ from the fee amount due to adjustments or discounts."/>
1759             <column name="adj_amount" comments="The adjustment amount, if any, to account for changes in the payment (in DECIMAL format)."/>
1760             <column name="modified_time" comments="The timestamp indicating when this payment activity was last modified (in DATETIME format)."/>
1761             <column name="follow_up" comments="A flag (CHAR) indicating follow-up actions needed for this payment activity (e.g., 'y' for yes, 'n' for no)."/>
1762             <column name="follow_up_note" comments="Additional notes or instructions related to follow-up actions for this payment activity (in TEXT format)."/>
1763             <column name="account_code" comments="The account code used to categorize or classify this payment activity (e.g., a billing code or account code)."/>
1764             <column name="reason_code" comments="An optional reason code used to explain adjustments or changes in the payment amount (e.g., primary payer adjustment reason code)."/>
1765             <column name="deleted" comments="A timestamp (in DATETIME format) indicating when the payment activity was deleted (NULL if active, otherwise when voided)."/>
1766             <column name="post_date" comments="The date (in DATE format) when the payment was posted, if specified at the time of payment."/>
1767             <column name="payer_claim_number" comments="The claim number or reference number provided by the payer or insurance company for this payment activity."/>
1768         </table>
1770         <!--        - Patient Ledger -->
1771         <table name="ar_session" comments="Accounts Receivable overall payment made towards a patient invoice/claim and is the main table that holds the patient payments ledger">
1772             <column name="session_id" comments="The unique identifier for an accounting session, used as a surrogate key."/>
1773             <column name="payer_id"  comments="The insurance company being billed. If this is self-pay the id will be 0">
1774                 <foreignKey table="insurance_companies" column="id" />
1775             </column>
1776             <column name="user_id" comments="The reference to the user ID the created this billing session">
1777                 <foreignKey table="users" column="id" />
1778             </column>
1779             <column name="patient_id"  comments="The internal patient identifier">
1780                 <foreignKey table="patient_data" column="pid" />
1781             </column>
1782             <column name="payment_type" comments="Comes from the list_options.list_id='payment_type' and represents the type of payment, such as if this is a patient or insurance payment.">
1783                 <foreignKey table="list_options" column="option_id" />
1784             </column>
1785             <column name="adjustment_code" comments="Comes from the list_options.list_id='payment_adjustment_code' and represents the payment adjustment code to apply.">
1786                 <foreignKey table="list_options" column="option_id" />
1787             </column>
1788             <column name="payment_method" comments="Comes from the list_options.list_id='payment_method' The method of payment, e.g., ACH, Cash, CC, Check, etc.">
1789                 <foreignKey table="list_options" column="option_id" />
1790             </column>
1792             <column name="closed" comments="A flag indicating if the session is closed. 0 for open, 1 for closed."/>
1793             <column name="reference" comments="The check or EOB (Explanation of Benefits) number associated with the payment."/>
1794             <column name="check_date" comments="The date when the check was received for the payment."/>
1795             <column name="deposit_date" comments="The date when the payment was deposited."/>
1796             <column name="pay_total" comments="The total payment amount for the claim or billing invoice."/>
1797             <column name="created_time" comments="The timestamp when the payment record was created."/>
1798             <column name="modified_time" comments="The date and time of the last modification to the payment record."/>
1799             <column name="global_amount" comments="The global amount for the payment."/>
1800             <column name="description" comments="Additional description or notes related to the payment."/>
1801             <column name="post_to_date" comments="The date when the payment is posted to the claim or billing invoice."/>
1802         </table>
1804         <table name="eligibility_verification" comments="Insurance Eligibility Verification Tracking">
1805             <column name="verification_id" comments="Unique identifier for eligibility verification"/>
1806             <column name="insurance_id"  comments="The patient insurance that eligibility is being checked against">
1807                 <foreignKey table="insurance_data" column="id" />
1808             </column>
1809             <column name="response_id" comments="Identifier for the response related to the eligibility verification"/>
1810             <column name="eligibility_check_date" comments="Date and time when the eligibility check was performed"/>
1811             <column name="copay" comments="Patient copayment amount"/>
1812             <column name="deductible" comments="Patient deductible amount"/>
1813             <column name="deductiblemet" comments="Indicates whether the deductible has been met ('Y' or 'N')"/>
1814             <column name="create_date" comments="Date when the record was created"/>
1815         </table>
1816         <table name="benefit_eligibility" comments="Holds the eligible patient benefits for a specific insurance as received from an eligibility verification">
1817             <column name="response_id" comments="Surrogate ID of the benefit eligibility record used as the primary incrementing key"/>
1818             <column name="verification_id"  comments="The eligibility verification record that these benefits are retrieved from">
1819                 <foreignKey table="eligibility_verification" column="verification_id" />
1820             </column>
1821             <column name="type" comments="Type of benefit"/>
1822             <column name="benefit_type" comments="Type of the benefit, if applicable"/>
1823             <column name="start_date" comments="Start date for the benefit coverage"/>
1824             <column name="end_date" comments="End date for the benefit coverage"/>
1825             <column name="coverage_level" comments="Coverage level, if specified"/>
1826             <column name="coverage_type" comments="Type of coverage"/>
1827             <column name="plan_type" comments="Type of insurance plan"/>
1828             <column name="plan_description" comments="Description of the insurance plan"/>
1829             <column name="coverage_period" comments="Period of coverage"/>
1830             <column name="amount" comments="Benefit amount, if applicable"/>
1831             <column name="percent" comments="Benefit percentage, if applicable"/>
1832             <column name="network_ind" comments="Network indicator"/>
1833             <column name="message" comments="Additional message or information"/>
1834             <column name="response_status" comments="Status of the response (Active 'A' or Denied 'D')"/>
1835             <column name="response_create_date" comments="Date when the benefit response was created"/>
1836             <column name="response_modify_date" comments="Date when the benefit response was last modified"/>
1837         </table>
1839         <!-- Therapy Groups, counselors, participants, participant_attendance -->
1840         <table name="form_groups_encounter" comments="Represents the information related to a group of patient's visit to a healthcare provider.  This is different than an appointment as this table tracks the actual service of care for a therapy group">
1841             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1842                 <foreignKey table="forms" column="form_id" />
1843             </column>
1844             <column name="date" comments="Date and time of the encounter"/>
1845             <column name="reason" comments="The reason for the encounter"/>
1846             <column name="facility" comments="The facility or location of the encounter"/>
1847             <column name="facility_id" comments="Unique identifier for the facility where the encounter took place.">
1848                 <foreignKey table="facility" column="id" />
1849             </column>
1850             <column name="group_id" comments="FK to the therapy group that is attending for the encounter service">
1851                 <foreignKey table="therapy_groups" column="group_id" />
1852             </column>
1853             <column name="onset_date" comments="The date when the condition or issue for the group started"/>
1854             <column name="sensitivity" comments="Sensitivity information related to the encounter as to who should be able to access / view this encounter"/>
1855             <column name="billing_note" comments="Notes related to billing for the encounter"/>
1856             <column name="pc_catid" comments="The encounter service category taken from 'openemr_postcalendar_categories'">
1857                 <foreignKey table="openemr_postcalendar_categories" column="pc_catid" />
1858             </column>
1859             <column name="last_level_billed"  comments="The party for whom payment was last billed. 0=None, 1=Ins1, 2=Ins2, 3=Ins3" />
1860             <column name="last_level_closed"  comments="The party for whom payment was last received. 0=None, 1=Ins1, 2=Ins2, 3=Ins3" />
1861             <column name="last_stmt_date" comments="The date of the last statement"/>
1862             <column name="stmt_count" comments="The statement count"/>
1863             <column name="provider_id" comments="Default and main provider for this visit">
1864                 <foreignKey table="users" column="id" />
1865             </column>
1866             <column name="supervisor_id" comments="Supervising provider, if any, for this visit">
1867                 <foreignKey table="users" column="id" />
1868             </column>
1869             <column name="invoice_refno" comments="Reference number for the invoice"/>
1870             <column name="referral_source" comments="Source of the referral"/>
1871             <column name="facility_id" comments="Unique identifier for the billing facility that will be used for this encounter.">
1872                 <foreignKey table="facility" column="id" />
1873             </column>
1874             <column name="billing_facility" comments="ID of the billing facility"/>
1875             <column name="external_id" comments="External ID associated with the encounter"/>
1876             <column name="pos_code" comments="Place of service code"/>
1877             <column name="counselors" comments="Information about counselors related to the encounter"/>
1878             <column name="appt_id"  comments="The calendar appointment id that this encounter is associated with or that this encounter was created from">
1879                 <foreignKey table="openemr_postcalendar_events" column="pc_eid" />
1880             </column>
1881         </table>
1882         <table name="form_group_attendance" comments="Group encounter form for tracking the attendance of therapy participants to a group session encounter">
1883             <column name="id" comments="The primary key which is the same as the forms.form_id column">
1884                 <foreignKey table="forms" column="form_id" />
1885             </column>
1886             <column name="group_id" comments="FK to the therapy group that this attendance form is tracking">
1887                 <foreignKey table="therapy_groups" column="group_id" />
1888             </column>
1889             <column name="user" comments="The username of the user that created this record.">
1890                 <foreignKey table="users" column="username" />
1891             </column>
1892             <column name="groupname" comments="User Group that the user was part of that created this record (This is not the therapy group)">
1893                 <foreignKey table="groups" column="name" />
1894             </column>
1895             <column name="encounter_id" comments="The group encounter that this group attendance form is part of">
1896                 <foreignKey table="form_groups_encounter" column="encounter" />
1897             </column>
1898             <column name="authorized" comments="Authorization status (1 for authorized, 0 for unauthorized)"/>
1899             <column name="activity" comments="Activity status (1 for active, 0 for inactive)"/>
1900         </table>
1902         <table name="therapy_groups_participant_attendance" comments="Track patient attendance to a therapy group session as contained in the Used by the form_group_attendance table">
1903             <column name="pid"  comments="The internal patient identifier">
1904                 <foreignKey table="patient_data" column="pid" />
1905             </column>
1906             <column name="form_id"  comments="The group attendance encounter form that is the container entity used to track this patient's attendance">
1907                 <foreignKey table="form_group_attendance" column="id" />
1908             </column>
1909             <column name="meeting_patient_comment" comments="Comments about the participant's attendance in the meeting"/>
1910             <column name="meeting_patient_status" comments="The patient status in the meeting from the list_options.list_id='groupstat'">
1911                 <foreignKey table="list_options" column="option_id" />
1912             </column>
1913         </table>
1914         <table name="therapy_groups_participants" comments="Connects the patient participants to a therapy group">
1915             <column name="pid"  comments="The internal patient identifier">
1916                 <foreignKey table="patient_data" column="pid" />
1917             </column>
1918             <column name="group_id">
1919                 <foreignKey table="therapy_groups" column="group_id" />
1920             </column>
1921         </table>
1922         <table name="therapy_groups" comments="Contains all of the therapy groups that exist in the system">
1923             <column name="group_id" comments="Surrogate id of the record used as the primary incrementing key"/>
1924             <column name="name" comments="The name of the therapy group"/>
1925             <column name="group_status" comments="Represents the current status of the therapy group. 10=Active, 20=Finished, 30=Canceled"/>
1926             <column name="group_type" comments="Represents the type of therapy group. 1=Closed, 2=Open, 3=Training"/>
1927             <column name="group_participation" comments="Represents the participant requirements for the group. 1=Mandatory, 2=Optional"/>
1928             <column name="group_start_date" comments="Represents the date the group should start"/>
1929             <column name="group_end_date" comments="Represents the date the group should end"/>
1930             <column name="group_notes" comments="Notes about the overall therapy group"/>
1931             <column name="group_guest_counselors" comments="Names of guest counselors participating in the group that do not exist in the users table"/>
1932         </table>
1933         <table name="therapy_groups_counselors" comments="Contains the relationships between the counselors in a therapy group and the group">
1934             <column name="group_id">
1935                 <foreignKey table="therapy_groups" column="group_id" />
1936             </column>
1937             <column name="user_id">
1938                 <foreignKey table="users" column="id" />
1939             </column>
1940         </table>
1942         <table name="facility" comments="The facility table holds all of the facilities that provide healthcare in the EMR. It contains the primary billing location and other service locations/organizations that are not insurance companies tracked inside the EMR">
1943             <column name="id" comments="Surrogate id of the record used as the primary incrementing key"/>
1944             <column name="uuid" comments="UUID of the record"/>
1945             <column name="name" comments="The name of the facility"/>
1946             <column name="phone" comments="Phone number of the facility"/>
1947             <column name="fax" comments="Fax number of the facility"/>
1948             <column name="street" comments="Street address of the facility"/>
1949             <column name="city" comments="City where the facility is located"/>
1950             <column name="state" comments="State where the facility is located"/>
1951             <column name="postal_code" comments="Postal code of the facility"/>
1952             <column name="country_code" comments="Country code of the facility"/>
1953             <column name="federal_ein" comments="Federal Employer Identification Number of the facility" exclude="true"/>
1954             <column name="website" comments="Website of the facility"/>
1955             <column name="email" comments="Email address of the facility"/>
1956             <column name="service_location" comments="Indicates if it's a service location (0-Not a service location, 1-Service location)"/>
1957             <column name="billing_location" comments="Indicates if it's a billing location (0-Not a billing location, 1-Billing location)"/>
1958             <column name="accepts_assignment" comments="Indicates if the facility accepts assignment (0-Does not accept assignment, 1-Accepts assignment)"/>
1959             <column name="pos_code" comments="POS (Place of Service) code of the facility"/>
1960             <column name="x12_sender_id" comments="X12 Sender ID of the facility. EMPTY IN Export" exclude="true"/>
1961             <column name="attn" comments="Attention line for the facility"/>
1962             <column name="domain_identifier" comments="Domain identifier for the facility"/>
1963             <column name="facility_npi" comments="NPI (National Provider Identifier) for the facility"/>
1964             <column name="facility_taxonomy" comments="Taxonomy code for the facility"/>
1965             <column name="tax_id_type" comments="Tax ID type for the facility"/>
1966             <column name="color" comments="Color code for the facility"/>
1967             <column name="primary_business_entity" comments="Primary business entity (0-Not set as the primary business entity, 1-Set as the primary business entity)"/>
1968             <column name="facility_code" comments="Facility code for the facility"/>
1969             <column name="extra_validation" comments="Extra validation indicator (0-No extra validation, 1-Extra validation)"/>
1970             <column name="mail_street" comments="Mailing street address of the facility"/>
1971             <column name="mail_street2" comments="Additional mailing street address of the facility"/>
1972             <column name="mail_city" comments="Mailing city of the facility"/>
1973             <column name="mail_state" comments="Mailing state of the facility"/>
1974             <column name="mail_zip" comments="Mailing ZIP code of the facility"/>
1975             <column name="oid" comments="For HIEs, CCDA, and FHIR an OID is required/wanted for the facility"/>
1976             <column name="iban" comments="International Bank Account Number (IBAN) for the facility EMPTY IN Export" exclude="true"/>
1977             <column name="info" comments="Additional information about the facility EMPTY in Export" exclude="true"/>
1978             <column name="weno_id" comments="WENO ID for the facility" exclude="true"/>
1979             <column name="inactive" comments="Indicates if the facility is inactive (0-Active, 1-Inactive)"/>
1980         </table>
1982         <table name="users" comments="Contains actors in the system that are not patients.  This includes providers, employees, and external organizations/contacts records as well as system processes.  This does not include API actors">
1983             <column name="id" comments="Unique identifier for each user in the system."/>
1984             <column name="uuid" comments="Universally unique identifier for the user."/>
1985             <column name="username" comments="The username associated with the user's account."/>
1986             <column name="password" comments="The password for the user's account." exclude="true"/>
1987             <column name="authorized" comments="Indicates whether the user is authorized (1 for authorized, 0 for unauthorized)."/>
1988             <column name="info" comments="Additional information or notes about the user." exclude="true"/>
1989             <column name="source" comments="An indicator of the source of the user (e.g., internal or external)."/>
1990             <column name="fname" comments="First name of the user."/>
1991             <column name="mname" comments="Middle name of the user."/>
1992             <column name="lname" comments="Last name of the user."/>
1993             <column name="suffix" comments="Suffix for the user's name (e.g., Jr., Sr.)."/>
1994             <column name="federaltaxid" comments="Federal Tax ID associated with the user." exclude="true"/>
1995             <column name="federaldrugid" comments="Federal Drug ID associated with the user." exclude="true"/>
1996             <column name="upin" comments="Universal Physician Identification Number for the user."/>
1997             <column name="facility" comments="The facility where the user is associated."/>
1998             <column name="facility_id" comments="Unique identifier for the user's associated facility.">
1999                 <foreignKey table="facility" column="id" />
2000             </column>
2001             <column name="see_auth" comments="Indicates if the user has the ability to see authorizations."/>
2002             <column name="active" comments="Indicates the user's activity status (1 for active, 0 for inactive)."/>
2003             <column name="npi" comments="National Provider Identifier for the user."/>
2004             <column name="title" comments="Title or designation of the user (e.g., MD, RN)."/>
2005             <column name="specialty" comments="The specialty of the user (e.g., cardiology, pediatrics)."/>
2006             <column name="billname" comments="Billing name for the user."/>
2007             <column name="email" comments="Email address associated with the user's account. EMPTY for exports"/>
2008             <column name="email_direct" comments="Trusted Direct email address for the user."/>
2009             <column name="google_signin_email" comments="Email address for Google Sign-In (if applicable). EMPTY for exports" exclude="true"/>
2010             <column name="url" comments="URL associated with the user's profile."/>
2011             <column name="assistant" comments="Name of the user's assistant or support staff."/>
2012             <column name="organization" comments="Name of the user's organization or practice."/>
2013             <column name="valedictory" comments="Valedictory or honorary title of the user."/>
2014             <column name="street" comments="Street address for the user. EMPTY for exports" exclude="true"/>
2015             <column name="streetb" comments="Secondary street address for the user. EMPTY for exports" exclude="true"/>
2016             <column name="city" comments="City of residence or practice for the user. EMPTY for exports" exclude="true"/>
2017             <column name="state" comments="State or province of residence or practice for the user. EMPTY for exports" exclude="true"/>
2018             <column name="zip" comments="ZIP code or postal code for the user. EMPTY for exports" exclude="true"/>
2019             <column name="street2" comments="Alternative street address for the user. EMPTY for exports" exclude="true"/>
2020             <column name="streetb2" comments="Alternative street address for the user. EMPTY for exports" exclude="true"/>
2021             <column name="city2" comments="Alternative City of residence or practice for the user. EMPTY for exports" exclude="true"/>
2022             <column name="state2" comments="Alternative State or province of residence or practice for the user. EMPTY for exports" exclude="true"/>
2023             <column name="zip2" comments="Alternative ZIP code or postal code for the user. EMPTY for exports" exclude="true"/>
2024             <column name="phone" comments="Phone number for the user. EMPTY for exports" exclude="true"/>
2025             <column name="fax" comments="Fax number for the user. EMPTY for exports" exclude="true"/>
2026             <column name="phonew1" comments="Work phone number for the user."/>
2027             <column name="phonew2" comments="Alternative Work phone number for the user."/>
2028             <column name="phonecell" comments="Cell phone number for the user. EMPTY for exports" exclude="true"/>
2029             <column name="notes" comments="Additional notes or comments about the user. EMPTY for exports" exclude="true"/>
2030             <column name="cal_ui" comments="UNUSED" exclude="true"/>
2031             <column name="taxonomy" comments="Taxonomy code associated with the user."/>
2032             <column name="calendar" comments="Indicates whether the user appears in the calendar (1 for appears, 0 for doesn't appear)."/>
2033             <column name="abook_type" comments="Address book type for the user."/>
2034             <column name="default_warehouse" comments="Default warehouse for the user."/>
2035             <column name="irnpool" comments="IRN (Insurance Referral Network) pool for the user."/>
2036             <column name="state_license_number" comments="State license number for the user."/>
2037             <column name="weno_prov_id" comments="WENO Provider ID for the user. EMPTY for exports" exclude="true"/>
2038             <column name="newcrop_user_role" comments="NewCrop user role for the user.EMPTY for exports" exclude="true"/>
2039             <column name="cpoe" comments="Indicates whether the user has CPOE (Computerized Physician Order Entry) capabilities."/>
2040             <column name="physician_type" comments="Type or designation of the physician (e.g., standard, specialist)."/>
2041             <column name="main_menu_role" comments="Main menu role for the user. EMPTY for exports" exclude="true"/>
2042             <column name="patient_menu_role" comments="Patient menu role for the user. EMPTY for exports" exclude="true"/>
2043             <column name="portal_user" comments="Indicates if the user is a portal user (1 for portal user, 0 for non-portal user). EMPTY for exports" exclude="true"/>
2044             <column name="supervisor_id" comments="Unique identifier of the user's supervisor. EMPTY for exports" exclude="true"/>
2045             <column name="billing_facility" comments="Billing facility information for the user."/>
2046             <column name="billing_facility_id" comments="Unique identifier for the user's billing facility.">
2047                     <foreignKey table="facility" column="id" />
2048             </column>
2049         </table>
2051         <table name="groups" comments="Represent groups of users in the system">
2052             <column name="id" comments="Surrogate id of the record used as the primary incrementing key."/>
2053             <column name="name" comments="The name of the group."/>
2054             <column name="user" comments="The username of the user that belongs to this group.">
2055                 <foreignKey table="users" column="username" />
2056             </column>
2057         </table>
2059         <table name="esign_signatures" comments="Holds the digital author signature records for encounters and individual charted forms in the system.">
2060             <column name="id" comments="Surrogate id of the record used as the primary incrementing key."/>
2061             <column name="tid" comments="Table row ID for signature. This is either the forms.id or the form_encounter.encounter id"/>
2062             <column name="table" comments="Table name for the signature. This will either be 'forms' if it represents an individual form the provider is e-signing or 'form_encounter' if it represents the entire encounter record the provider is attesting to."/>
2063             <column name="uid" comments="User id for the signing user.">
2064                 <foreignKey table="users" column="id" />
2065             </column>
2066             <column name="datetime" comments="Datetime of the signature action."/>
2067             <column name="is_lock" comments="Indicates whether the record is signed, locked, or amended."/>
2068             <column name="amendment" comments="Amendment text, if any."/>
2069             <column name="hash" comments="Hash of signed data. For an individual form_[formdir] this will be the hash of the string concatenation of all of the column values for the main entry table. For an overall encounter this will be the string concatenation of all individual form records that are connected to the encounter."/>
2070             <column name="signature_hash" comments="Hash of the signature itself hash(tid,table,uid,is_lock,hash,amendment). sha1= less than 50 chars; greater than 50chars=sha3-512 algorithm. "/>
2071         </table>
2073         <table name="pharmacies" comments="Contains records of pharmacies that a patient uses, or that providers interact with"></table>
2074     </tables>
2075 </schemaMeta>