-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `openemr`
--

-- --------------------------------------------------------

--
-- Table structure for table `form_encounter`
--

CREATE TABLE IF NOT EXISTS `form_encounter` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uuid` binary(16) DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `reason` longtext,
  `facility` longtext,
  `facility_id` int(11) NOT NULL DEFAULT '0',
  `pid` bigint(20) DEFAULT NULL,
  `encounter` bigint(20) DEFAULT NULL,
  `onset_date` datetime DEFAULT NULL,
  `sensitivity` varchar(30) DEFAULT NULL,
  `billing_note` text,
  `pc_catid` int(11) NOT NULL DEFAULT '5' COMMENT 'event category from openemr_postcalendar_categories',
  `last_level_billed` int(11) NOT NULL DEFAULT '0' COMMENT '0=none, 1=ins1, 2=ins2, etc',
  `last_level_closed` int(11) NOT NULL DEFAULT '0' COMMENT '0=none, 1=ins1, 2=ins2, etc',
  `last_stmt_date` date DEFAULT NULL,
  `stmt_count` int(11) NOT NULL DEFAULT '0',
  `provider_id` int(11) DEFAULT '0' COMMENT 'default and main provider for this visit',
  `supervisor_id` int(11) DEFAULT '0' COMMENT 'supervising provider, if any, for this visit',
  `invoice_refno` varchar(31) NOT NULL DEFAULT '',
  `referral_source` varchar(31) NOT NULL DEFAULT '',
  `billing_facility` int(11) NOT NULL DEFAULT '0',
  `external_id` varchar(20) DEFAULT NULL,
  `pos_code` tinyint(4) DEFAULT NULL,
  `parent_encounter_id` bigint(20) DEFAULT NULL,
  `class_code` varchar(10) NOT NULL DEFAULT 'AMB',
  `shift` varchar(31) NOT NULL DEFAULT '',
  `voucher_number` varchar(255) NOT NULL DEFAULT '' COMMENT 'also called referral number',
  `discharge_disposition` varchar(100) DEFAULT NULL,
  `encounter_type_code` varchar(31) DEFAULT NULL COMMENT 'not all types are categories',
  `encounter_type_description` text,
  `referring_provider_id` int(11) DEFAULT '0' COMMENT 'referring provider, if any, for this visit',
  `date_end` datetime DEFAULT NULL,
  `encounter_status` varchar(255) DEFAULT NULL,
  `in_collection` tinyint(1) DEFAULT NULL,
  `pat_profile_data` text,
  `end_date` datetime DEFAULT NULL,
  `complete_encounter` tinyint(1) NOT NULL DEFAULT '0',
  `duration` time DEFAULT NULL COMMENT 'encounter start date to end date different time',
  `create_user` varchar(255) DEFAULT NULL COMMENT 'encounter first create user name',
  `status_doc` int(1) DEFAULT NULL COMMENT 'create user is Physicians 1 else 0',
  `action_taken` varchar(100) DEFAULT NULL,
  `enc_status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uuid` (`uuid`),
  KEY `pid_encounter` (`pid`,`encounter`),
  KEY `encounter_date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
COMMIT;

