--
-- PostgreSQL database dump
--

SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: active_substances; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE active_substances (
    as_id integer NOT NULL,
    as_code character varying(150),
    as_valid_from date,
    as_valid_to date
);


ALTER TABLE public.active_substances OWNER TO postgres;

--
-- Name: actualizari_asigurati; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actualizari_asigurati (
    actas_id integer NOT NULL,
    actas_cnpmedic character varying(13),
    actas_stencil character varying(6),
    actas_date date,
    actas_module character varying(20),
    actas_asig_no integer,
    actas_month integer,
    actas_year integer
);


ALTER TABLE public.actualizari_asigurati OWNER TO postgres;

--
-- Name: acupunctura; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE acupunctura (
    data date,
    id integer NOT NULL,
    nume text,
    prenume text,
    cnp text,
    diagnostic text
);


ALTER TABLE public.acupunctura OWNER TO postgres;

--
-- Name: acupunctura_vechi; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE acupunctura_vechi (
    data date,
    nume text,
    prenume text,
    cnp text,
    diagnostic text
);


ALTER TABLE public.acupunctura_vechi OWNER TO postgres;

--
-- Name: addresses; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE addresses (
    addr_id integer NOT NULL,
    addr_pat_cnp character varying(13),
    addr_cit_code character varying(150),
    addr_dst_code character varying(20),
    addr_st_name character varying(150),
    addr_street_no character varying(20),
    addr_building character varying(20),
    addr_entrance character varying(20),
    addr_floor character varying(30),
    addr_apartment character varying(30),
    addr_postal_code character varying(100),
    addr_valid_from date,
    addr_valid_to date,
    addr_stt_code character varying(10),
    addr_null boolean DEFAULT true
);


ALTER TABLE public.addresses OWNER TO postgres;

--
-- Name: afect; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE afect (
    id integer NOT NULL,
    afectiune text,
    obs1 text,
    obs2 text
);


ALTER TABLE public.afect OWNER TO postgres;

--
-- Name: age_groups; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE age_groups (
    ag_id integer NOT NULL,
    ag_code character varying(255),
    ag_min_age numeric(18,0),
    ag_max_age numeric(18,0),
    ag_valid_from date,
    ag_valid_to date
);


ALTER TABLE public.age_groups OWNER TO postgres;

--
-- Name: ahc; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE ahc (
    ahc_id integer NOT NULL,
    ahc_pat_cnp character varying(13),
    ahc_linie character varying(100),
    ahc_ruda character varying(100),
    ahc_icd10_code character varying(10),
    ahc_icd9_code character varying(10),
    ahc_description character varying(255),
    ahc_category_code character varying(10)
);


ALTER TABLE public.ahc OWNER TO postgres;

--
-- Name: anexa_2b; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE anexa_2b (
    id integer NOT NULL,
    nr_crt integer,
    cod_atc character varying(20),
    dci character varying(255),
    den_comerciala character varying(200),
    forma_farm character varying(255),
    conc character varying(255),
    producator character varying(255),
    tara character varying(255),
    ambalaj character varying(255),
    pret_max_ron character varying(20),
    pret_max_rol character varying(20),
    pret_max_ut_ron character varying(20),
    pret_max_ut_rol character varying(20),
    pret_decont_ut_ron character varying(20),
    pret_decont_ut_rol character varying(20)
);


ALTER TABLE public.anexa_2b OWNER TO postgres;

--
-- Name: anexa_3; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE anexa_3 (
    id integer NOT NULL,
    nr_crt numeric(9,0),
    cod_atc character varying(20),
    dci character varying(200),
    den_comerciala character varying(200),
    forma_farm character varying(200),
    conc character varying(200),
    firma character varying(200),
    tara character varying(200),
    ambalaj character varying(200),
    pret_decont_ut_ron character varying(20),
    pret_decont_ut_rol character varying(20)
);


ALTER TABLE public.anexa_3 OWNER TO postgres;

--
-- Name: apf; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE apf (
    af_id integer NOT NULL,
    af_pat_cnp character varying(13),
    af_antecedent text,
    af_date date,
    af_rec_date date
);


ALTER TABLE public.apf OWNER TO postgres;

--
-- Name: appdata; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE appdata (
    apd_id integer NOT NULL,
    apd_created timestamp without time zone DEFAULT now(),
    apd_modified timestamp without time zone DEFAULT now(),
    apd_apk character varying(255),
    apd_dm text,
    apd_ds text
);


ALTER TABLE public.appdata OWNER TO postgres;

--
-- Name: atcs; Type: TABLE; Schema: public; Owner: Cristi; Tablespace: 
--

CREATE TABLE atcs (
    atc_id integer NOT NULL,
    atc_code character varying(20),
    atc_description character varying(255),
    atc_valid_from date,
    atc_valid_to date,
    atc_parent_atc character varying(20)
);


ALTER TABLE public.atcs OWNER TO postgres;

--
-- Name: boli_disp_rap; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE boli_disp_rap (
    bdr_id integer NOT NULL,
    bdr_code character varying(20),
    bdr_description character varying(255)
);


ALTER TABLE public.boli_disp_rap OWNER TO postgres;

--
-- Name: capita_age_group_categories; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE capita_age_group_categories (
    cagc_id integer NOT NULL,
    cagc_code character varying(255),
    cagc_valid_from date,
    cagc_valid_to date,
    cagc_cg_code character varying(20),
    cagc_pc_code character varying(20)
);


ALTER TABLE public.capita_age_group_categories OWNER TO postgres;

--
-- Name: capita_group_points; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE capita_group_points (
    cgp_id integer NOT NULL,
    cgp_points float,
    cgp_cg_code character varying(20),
    cgp_valid_from date,
    cgp_valid_to date
);


ALTER TABLE public.capita_group_points OWNER TO postgres;

--
-- Name: capita_groups; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE capita_groups (
    cg_id integer NOT NULL,
    cg_code character varying(20),
    cg_description character varying(255),
    cg_valid_from date,
    cg_valid_to date
);


ALTER TABLE public.capita_groups OWNER TO postgres;

--
-- Name: capita_move_type; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE capita_move_type (
    cmt_id integer NOT NULL,
    cmt_code character varying(10),
    cmt_description character varying(255),
    cmt_valid_from date,
    cmt_valid_to date
);


ALTER TABLE public.capita_move_type OWNER TO postgres;

--
-- Name: capita_operations; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE capita_operations (
    cop_id integer NOT NULL,
    cop_pat_id numeric(6,0),
    cop_pat_cnp character varying(13),
    cop_cmt_code character varying(10),
    cop_date date,
    cop_evt_cod character varying(50)
);


ALTER TABLE public.capita_operations OWNER TO postgres;

--
-- Name: chronic_disease_categories; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE chronic_disease_categories (
    cdc_id integer NOT NULL,
    cdc_code character varying(20),
    cdc_description character varying(200),
    cdc_valid_from date,
    cdc_valid_to date
);


ALTER TABLE public.chronic_disease_categories OWNER TO postgres;

--
-- Name: chronic_diseases; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE chronic_diseases (
    cd_id integer NOT NULL,
    cd_code character varying(20),
    cd_description character varying(200),
    cd_category character varying(20),
    cd_order_no integer,
    cd_valid_from date,
    cd_valid_to date
);


ALTER TABLE public.chronic_diseases OWNER TO postgres;

--
-- Name: cities; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE cities (
    cit_id integer NOT NULL,
    cit_code character varying(30),
    cit_name character varying(150),
    cit_areacode character varying(10),
    cit_zipcode character varying(30),
    cit_dst_code character varying(20),
    cit_ctt_code character varying(30),
    cit_cit_code character varying(30)
);


ALTER TABLE public.cities OWNER TO postgres;

--
-- Name: citizenships; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE citizenships (
    ctz_id integer NOT NULL,
    ctz_code character varying(20),
    ctz_description character varying(100)
);


ALTER TABLE public.citizenships OWNER TO postgres;

--
-- Name: city_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE city_types (
    ctt_id integer NOT NULL,
    ctt_code character varying(30),
    ctt_name character varying(150),
    ctt_urbanflag boolean
);


ALTER TABLE public.city_types OWNER TO postgres;

--
-- Name: clase_dg; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE clase_dg (
    cls_id integer NOT NULL,
    cls_description character varying(255)
);


ALTER TABLE public.clase_dg OWNER TO postgres;

--
-- Name: cnas_agreements; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE cnas_agreements (
    cnasag_id integer NOT NULL,
    cnasag_countrycode character varying(20),
    cnasag_valid_from date,
    cnasat_valid_to date
);


ALTER TABLE public.cnas_agreements OWNER TO postgres;

--
-- Name: cod_afect; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE cod_afect (
    cod integer,
    den_afect character varying(255)
);


ALTER TABLE public.cod_afect OWNER TO postgres;

--
-- Name: copayment_list_drugs; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE copayment_list_drugs (
    cld_id integer NOT NULL,
    cld_clt_code character varying(20),
    cld_drg_code character varying(20),
    cld_nhp_code character varying(20),
    cld_dsc_code character varying(20),
    cld_max_price numeric(20,6),
    cld_max_price_ut numeric(20,6),
    cld_whole_sale_price numeric(20,6),
    cld_copayment_value numeric(20,6),
    cld_copayment_value_90 numeric(20,6),
    cld_special_law boolean DEFAULT false,
    cld_reference_price numeric(20,6),
    cld_crt_no numeric(20,6),
    cld_need_aproval character varying(20),
    cld_over_value character varying(20),
    cld_need_specialty character varying(20),
    cld_classif_insulin character varying(10),
    cld_hg_dci character varying(150),
    cld_hg_atc character varying(150),
    cld_valid_from date,
    cld_valid_to date
);


ALTER TABLE public.copayment_list_drugs OWNER TO postgres;

--
-- Name: drugs; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE drugs (
    drg_id integer NOT NULL,
    drg_code character varying(20),
    drg_name character varying(100),
    drg_presentation_package character varying(250),
    drg_narcotic character varying(10),
    drg_fractional boolean,
    drg_special boolean,
    drg_bio_equivalence boolean,
    drg_quant_per_package numeric(18,0),
    drg_price_per_package numeric(18,2),
    drg_whole_sale_price_per_pack numeric(18,2),
    drg_prescription_mode character varying(30),
    drg_valid_from date,
    drg_valid_to date,
    drg_as_code character varying(150),
    drg_con_concentration character varying(30),
    drg_phf_code character varying(100),
    drg_company character varying(20),
    drg_cnt_code character varying(20),
    drg_atc character varying(20)
);


ALTER TABLE public.drugs OWNER TO postgres;

--
-- Name: compensate; Type: VIEW; Schema: public; Owner: postgres
--

CREATE VIEW compensate AS
    SELECT copayment_list_drugs.cld_clt_code, CASE WHEN (((copayment_list_drugs.cld_need_aproval)::text = 'P'::text) OR ((copayment_list_drugs.cld_need_aproval)::text = 'M'::text)) THEN '**'::text WHEN ((copayment_list_drugs.cld_need_aproval)::text = 'J'::text) THEN '***'::text WHEN ((copayment_list_drugs.cld_need_aproval)::text = 'N'::text) THEN '****'::text WHEN ((copayment_list_drugs.cld_need_specialty)::text = '1'::text) THEN '*'::text ELSE ''::text END AS cld_need_specialty, CASE WHEN ((copayment_list_drugs.cld_need_aproval)::text = '0'::text) THEN ''::character varying ELSE copayment_list_drugs.cld_need_aproval END AS cld_need_aproval, copayment_list_drugs.cld_dsc_code, copayment_list_drugs.cld_nhp_code, drugs.drg_prescription_mode, drugs.drg_name, drugs.drg_as_code, drugs.drg_con_concentration, drugs.drg_phf_code, drugs.drg_code, drugs.drg_company, copayment_list_drugs.cld_max_price_ut, copayment_list_drugs.cld_copayment_value FROM (drugs JOIN copayment_list_drugs ON (((drugs.drg_code)::text = (copayment_list_drugs.cld_drg_code)::text))) WHERE ((drugs.drg_valid_to IS NULL) AND (copayment_list_drugs.cld_valid_to IS NULL));


ALTER TABLE public.compensate OWNER TO postgres;

--
-- Name: concentrations; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE concentrations (
    con_id integer NOT NULL,
    con_concentration character varying(100),
    con_valid_from date,
    con_valid_to date
);


ALTER TABLE public.concentrations OWNER TO postgres;

--
-- Name: consultatii; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE consultatii (
    cons_id integer NOT NULL,
    cons_reg_no numeric(18,0),
    cons_cnp character varying(13),
    cons_fisa numeric(9,0),
    cons_dg_descriptiv text,
    cons_med_emp_cnp character varying(13),
    cons_as_emp_cnp character varying(13),
    cons_time timestamp without time zone DEFAULT now(),
    cons_tratament text,
    cons_domiciliu boolean DEFAULT false,
    cons_imagistica text,
    cons_paraclinic text,
    cons_dg_codes character varying(255),
    cons_anulat boolean DEFAULT false,
    cons_icd10_codes character varying(255),
    cons_acuze text,
    cons_obiectiv text,
    cons_inaltime integer,
    cons_masa_corporala double precision,
    cons_av integer,
    cons_ta_min integer,
    cons_ta_max integer,
    cons_temperatura double precision,
    cons_importanta boolean DEFAULT false,
    cons_y double precision,
    cons_b16 boolean DEFAULT false,
    cons_b17 boolean DEFAULT false,
    cons_b18 boolean DEFAULT false,
    cons_b19 boolean DEFAULT false,
    cons_b20 boolean DEFAULT false,
    cons_b21 boolean DEFAULT false,
    cons_b22 boolean DEFAULT false,
    cons_b23 boolean DEFAULT false,
    cons_b24 boolean DEFAULT false,
    cons_b25 boolean DEFAULT false,
    cons_b10_4 boolean DEFAULT false,
    cons_b7_11 boolean DEFAULT false,
    cons_referat boolean DEFAULT false,
    cons_b15 boolean DEFAULT false,
    cons_rap_mscode character varying(10),
    cons_rap_dgcode character varying(10),
    cons_rap_diagnostictype character varying(10),
    cons_b16a boolean DEFAULT false,
    cons_b25a boolean DEFAULT false,
    cons_s2 boolean DEFAULT false
);


ALTER TABLE public.consultatii OWNER TO postgres;

--
-- Name: contracts; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE contracts (
    ctr_id integer NOT NULL,
    ctr_contract_no character varying(20),
    ctr_contract_date date,
    ctr_valid_from date,
    ctr_valid_to date,
    ctr_ou_code character varying(20),
    ctr_pro_uic character varying(20),
    ctr_category_code character varying(20),
    ctr_contract_type character varying(20),
    ctr_pgic numeric(6,0),
    ctr_pcpf numeric(6,0)
);


ALTER TABLE public.contracts OWNER TO postgres;

--
-- Name: conventions; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE conventions (
    conv_id integer NOT NULL,
    conv_code character varying(20),
    conv_pro_id numeric(6,0),
    conv_date date,
    conv_valid_from date,
    conv_valid_to date
);


ALTER TABLE public.conventions OWNER TO postgres;

--
-- Name: copayment_list_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE copayment_list_types (
    clt_id integer NOT NULL,
    clt_code character varying(20),
    clt_description character varying(100),
    clt_copayment_percent numeric(18,0),
    clt_drug_max_no numeric(18,0),
    clt_prescription_max_no numeric(18,0),
    clt_max_value numeric(18,0),
    clt_valid_from date,
    clt_valid_to date
);


ALTER TABLE public.copayment_list_types OWNER TO postgres;

--
-- Name: countries; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE countries (
    cnt_id integer NOT NULL,
    cnt_code character varying(20),
    cnt_name character varying(100)
);


ALTER TABLE public.countries OWNER TO postgres;

--
-- Name: cv; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE cv (
    cv_id integer NOT NULL,
    cv_time timestamp without time zone DEFAULT now(),
    cv_base character varying(255),
    cv_app character varying(255),
    cv_br character varying(255)
);


ALTER TABLE public.cv OWNER TO postgres;

--
-- Name: de_reinscris; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE de_reinscris (
    id integer NOT NULL,
    lista integer,
    cnp numeric(13,0),
    nume text,
    prenume text,
    categoria text,
    data_actualizarii date,
    fisa integer,
    observatii text
);


ALTER TABLE public.de_reinscris OWNER TO postgres;

--
-- Name: degrees; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE degrees (
    deg_id integer NOT NULL,
    deg_code character varying(255),
    deg_description character varying(255),
    deg_points float,
    deg_valid_from date,
    deg_valid_to date
);


ALTER TABLE public.degrees OWNER TO postgres;

--
-- Name: diagnostic_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE diagnostic_types (
    dgt_id integer NOT NULL,
    dgt_code character varying(20),
    dgt_description character varying(20),
    dgt_valid_from date,
    dgt_valid_to date
);


ALTER TABLE public.diagnostic_types OWNER TO postgres;

--
-- Name: disease_categ_active_subst; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE disease_categ_active_subst (
    dcas_id integer NOT NULL,
    dcas_clt_code character varying(20),
    dcas_as_code character varying(150),
    dcas_atc_code character varying(20),
    dcas_dsc_code character varying(20),
    dcas_need_approval character varying(20),
    dcas_valid_from date,
    dcas_valid_to date
);


ALTER TABLE public.disease_categ_active_subst OWNER TO postgres;

--
-- Name: disease_categories; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE disease_categories (
    dsc_id integer NOT NULL,
    dsc_code character varying(20),
    dsc_description character varying(100),
    dsc_is_chronic_disease boolean,
    dsc_is_auctioned boolean,
    dsc_valid_from date,
    dsc_valid_to date
);


ALTER TABLE public.disease_categories OWNER TO postgres;

--
-- Name: dispensarizari; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE dispensarizari (
    dsp_id integer NOT NULL,
    dsp_pat_id numeric(6,0),
    dsp_cnp character varying(13),
    dsp_bdr_code character varying(20),
    dsp_valid_from date,
    dsp_valid_to date
);


ALTER TABLE public.dispensarizari OWNER TO postgres;

--
-- Name: districts; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE districts (
    dst_id integer NOT NULL,
    dst_code character varying(20),
    dst_name character varying(100),
    dst_cnt_code character varying(20)
);


ALTER TABLE public.districts OWNER TO postgres;

--
-- Name: document_type_categories; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE document_type_categories (
    dtc_id integer NOT NULL,
    dtc_dty_code character varying(20),
    dtc_pc_code character varying(20)
);


ALTER TABLE public.document_type_categories OWNER TO postgres;

--
-- Name: document_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE document_types (
    dty_id integer NOT NULL,
    dty_code character varying(20),
    dty_description character varying(100)
);


ALTER TABLE public.document_types OWNER TO postgres;

--
-- Name: documents_series; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE documents_series (
    sd_id integer NOT NULL,
    sd_emp_stencil_no character varying(6),
    sd_serie character varying(8),
    sd_start numeric(10,0),
    sd_curent numeric(10,0),
    sd_finish numeric(10,0),
    sd_tip character varying(50),
    sd_terminat boolean DEFAULT false,
    sd_x double precision,
    sd_y double precision
);


ALTER TABLE public.documents_series OWNER TO postgres;

--
-- Name: drugs_bak; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE drugs_bak (
    drg_id integer,
    drg_code character varying(20),
    drg_name character varying(100),
    drg_description character varying(100),
    drg_type character varying(100),
    drg_presentation_package character varying(100),
    drg_narcotic numeric(3,0),
    drg_fractional boolean,
    drg_special boolean,
    drg_bio_equivalence boolean,
    drg_quant_per_package numeric(9,0),
    drg_price_per_package numeric(11,2),
    drg_whole_sale_price_per_pack numeric(11,2),
    drg_warranty character varying(255),
    drg_package_volume character varying(30),
    drg_prescription_mode character varying(30),
    drg_valid_from date,
    drg_valid_to date,
    drg_as_code character varying(150),
    drg_con_concentration character varying(30),
    drg_phf_code character varying(100),
    drg_company character varying(20),
    drg_cnt_code character varying(20),
    drg_atc character varying(20)
);


ALTER TABLE public.drugs_bak OWNER TO postgres;

--
-- Name: emp_convention; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE emp_convention (
    eco_id integer NOT NULL,
    eco_conv_id integer,
    eco_emp_id integer
);


ALTER TABLE public.emp_convention OWNER TO postgres;

--
-- Name: employee_docs; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE employee_docs (
    empd_id integer NOT NULL,
    empd_emp_cnp character varying(13),
    empd_doc_type character varying(50),
    empd_serial character varying(20),
    empd_no character varying(20),
    empd_date date,
    empd_valid_from date,
    empd_valid_to date
);


ALTER TABLE public.employee_docs OWNER TO postgres;

--
-- Name: employees; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE employees (
    emp_id integer NOT NULL,
    emp_pro_id integer,
    emp_pro_uic character varying(20),
    emp_cnp character varying(13),
    emp_first_name character varying(100),
    emp_last_name character varying(50),
    emp_valid_from date,
    emp_valid_to date,
    emp_stencil_no character varying(6),
    emp_is_medic boolean,
    emp_is_active boolean
);


ALTER TABLE public.employees OWNER TO postgres;

--
-- Name: ensured_reasons; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE ensured_reasons (
    enr_id integer NOT NULL,
    enr_pat_id numeric(6,0),
    enr_pat_cnp character varying(13),
    enr_pc_code character varying(20),
    enr_valid_from date,
    enr_valid_to date
);


ALTER TABLE public.ensured_reasons OWNER TO postgres;

--
-- Name: errors; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE errors (
    err_id integer NOT NULL,
    err_code character varying(20),
    err_text character varying(255),
    err_valid_from date,
    err_valid_to date
);


ALTER TABLE public.errors OWNER TO postgres;

--
-- Name: eu_members; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE eu_members (
    eum_id integer NOT NULL,
    eum_countrycode character varying(20),
    eum_valid_from date,
    eum_valid_to date
);


ALTER TABLE public.eu_members OWNER TO postgres;

--
-- Name: events; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE events (
    evt_id integer NOT NULL,
    evt_cod character varying(50),
    evt_name character varying(100),
    evt_is_input boolean,
    evt_is_output boolean,
    evt_valid_from date,
    evt_valid_to date,
    evt_for_provider boolean
);


ALTER TABLE public.events OWNER TO postgres;

--
-- Name: gender; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE gender (
    gen_id integer NOT NULL,
    gen_code character varying(20),
    gen_description character varying(20)
);


ALTER TABLE public.gender OWNER TO postgres;

--
-- Name: health_factor; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE health_factor (
    hf_id integer NOT NULL,
    hf_description character varying(100),
    hf_category character varying(50)
);


ALTER TABLE public.health_factor OWNER TO postgres;

--
-- Name: icd10s; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE icd10s (
    icd10_id integer NOT NULL,
    icd10_code character varying(20),
    icd10_description character varying(100),
    icd10_dsc_code character varying(20),
    icd10_valid_from date,
    icd10_valid_to date
);


ALTER TABLE public.icd10s OWNER TO postgres;

--
-- Name: icdmap; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE icdmap (
    md_id integer NOT NULL,
    md_cls_id integer,
    md_scl_id integer,
    md_icd10_code character varying(10),
    md_icd9_code character varying(10),
    md_description character varying(255),
    md_is_cronic boolean,
    md_is_copil boolean,
    md_dg_real boolean,
    md_acuza boolean,
    md_antecedent boolean,
    md_obs character varying(50)
);


ALTER TABLE public.icdmap OWNER TO postgres;

--
-- Name: iesiti; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE iesiti (
    data date,
    cnp text,
    nume text,
    prenume text,
    dataies date,
    medicnou text,
    grveche text,
    grnoua text,
    tipies text,
    medic text
);


ALTER TABLE public.iesiti OWNER TO postgres;

--
-- Name: infecto_contagious_diseases; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE infecto_contagious_diseases (
    icd_id integer NOT NULL,
    icd_code character varying(20),
    icd_description character varying(255),
    icd_valid_from date,
    icd_valid_to date
);


ALTER TABLE public.infecto_contagious_diseases OWNER TO postgres;

--
-- Name: justify_docs; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE justify_docs (
    jd_id integer NOT NULL,
    jd_pat_cnp character varying(13),
    jd_dty_code character varying(20),
    jd_series character varying(20),
    jd_no character varying(20),
    jd_date date,
    jd_description text,
    jd_valid_from date,
    jd_valid_to date,
    jd_issued_by character varying(255),
    jd_rec_date date
);


ALTER TABLE public.justify_docs OWNER TO postgres;

--
-- Name: laboratories_services; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE laboratories_services (
    ls_id integer NOT NULL,
    ls_code character varying(20),
    ls_name character varying(100),
    ls_high_level boolean,
    ls_rec_by_pc boolean,
    ls_formula boolean,
    ls_valid_from date,
    ls_valid_to date,
    ls_inclinic boolean,
    ls_service_type character varying(20),
    ls_is_contracted boolean DEFAULT true,
    ls_order double precision
);


ALTER TABLE public.laboratories_services OWNER TO postgres;

--
-- Name: laboratories_values; Type: TABLE; Schema: public; Owner: Cristi; Tablespace: 
--

CREATE TABLE laboratories_values (
    lv_id integer NOT NULL,
    lv_analysis_value numeric(9,0),
    lv_radiology_value numeric(9,0),
    lv_exploration_value numeric(9,0),
    lv_valid_from date,
    lv_valid_to date
);


ALTER TABLE public.laboratories_values OWNER TO postgres;

--
-- Name: life_conditions; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE life_conditions (
    lc_id integer NOT NULL,
    lc_pat_cnp character varying(13),
    lc_date date,
    lc_hf_id integer,
    lc_description character varying(255),
    lc_period character varying(100),
    lc_subiectiv character varying(255),
    lc_obs text,
    lc_priority integer
);


ALTER TABLE public.life_conditions OWNER TO postgres;

--
-- Name: liste; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE liste (
    id integer NOT NULL,
    lista character varying(20),
    g character varying(20),
    s character varying(20),
    crtno integer,
    cod_com character varying(30),
    cod_atc character varying(30),
    dci character varying(200),
    nume character varying(200),
    forma character varying(200),
    concentratie character varying(200),
    firma character varying(150),
    tara character varying(30),
    ambalare character varying(255),
    prescriere character varying(200),
    cant_amb character varying(200),
    pret_amb double precision,
    pret_ut double precision,
    compensat_213 double precision,
    compensat double precision
);


ALTER TABLE public.liste OWNER TO postgres;

--
-- Name: luna_consultatii; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_consultatii (
    cons_id integer,
    cons_reg_no numeric(18,0),
    cons_cnp character varying(13),
    cons_fisa numeric(9,0),
    cons_dg_descriptiv text,
    cons_med_emp_cnp character varying(13),
    cons_as_emp_cnp character varying(13),
    cons_time timestamp without time zone,
    cons_tratament text,
    cons_domiciliu boolean,
    cons_imagistica text,
    cons_paraclinic text,
    cons_dg_codes character varying(255),
    cons_anulat boolean,
    cons_icd10_codes character varying(255),
    cons_acuze text,
    cons_obiectiv text,
    cons_inaltime integer,
    cons_masa_corporala integer,
    cons_av integer,
    cons_ta_min integer,
    cons_ta_max integer,
    cons_temperatura double precision,
    cons_importanta boolean,
    cons_y double precision,
    cons_b15 boolean,
    cons_b16 boolean,
    cons_b17 boolean,
    cons_b18 boolean,
    cons_b19 boolean,
    cons_b20 boolean,
    cons_b21 boolean,
    cons_b22 boolean,
    cons_b23 boolean,
    cons_b24 boolean,
    cons_b25 boolean,
    cons_b10_4 boolean,
    cons_b7_11 boolean,
    cons_referat boolean
);


ALTER TABLE public.luna_consultatii OWNER TO postgres;

--
-- Name: luna_medical_note_investigations; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_medical_note_investigations (
    mni_id integer,
    mni_mn_id numeric(9,0),
    mni_position_no integer,
    mni_ls_code character varying(20),
    mni_quantity integer,
    mni_description character varying(255)
);


ALTER TABLE public.luna_medical_note_investigations OWNER TO postgres;

--
-- Name: luna_medical_notes; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_medical_notes (
    mn_id integer,
    mn_pat_id numeric(9,0),
    mn_emp_id numeric(9,0),
    mn_emp_cnp character varying(13),
    mn_cons_id numeric(9,0),
    mn_emp_stencil_no character varying(6),
    mn_pat_cnp character varying(13),
    mn_ou_code character varying(20),
    mn_serial_no character varying(20),
    mn_serial_code character varying(20),
    mn_date date,
    mn_reg_no numeric(9,0),
    mn_reg_date date,
    mn_mnt_code integer,
    mn_icd10_code character varying(20),
    mn_phy_spe_code character varying(200),
    mn_spe_code character varying(200),
    mn_ctr_contract_no character varying(20),
    mn_dg_descriptiv text,
    mn_cnt_id numeric(6,0),
    mn_validate boolean,
    mn_ps_code character varying(20),
    mn_cnt_code character varying(20),
    mn_recomm_stencil_no character varying(6),
    mn_dg character varying(255)
);


ALTER TABLE public.luna_medical_notes OWNER TO postgres;

--
-- Name: luna_pat_concedii; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_pat_concedii (
    pco_id integer,
    pco_conv_code character varying(20),
    pco_pro_id integer,
    pco_emp_stencil_no character varying(6),
    pco_pat_id integer,
    pco_pat_cnp character varying(13),
    pco_cons_id numeric(9,0),
    pco_serial_code character varying(20),
    pco_serial_no character varying(20),
    pco_month integer,
    pco_year integer,
    pco_sli_code character varying(20),
    pco_mce_code character varying(20),
    pco_icd_code character varying(20),
    pco_cons_reg_no numeric(9,0),
    pco_hosp_depart character varying(255),
    pco_hosp_depart_chief_stencil_no character varying(6),
    pco_continuare boolean,
    pco_prev_serial_code character varying(20),
    pco_prev_serial_no character varying(20),
    pco_duplicat boolean,
    pco_dup_serial_code character varying(20),
    pco_dup_serial_no character varying(20),
    pco_dup_count integer,
    pco_expert_stencil character varying(6),
    pco_expert_cert_no character varying(20),
    pco_expert_cert_date date,
    pco_matern_stencil character varying(6),
    pco_amb_date date,
    pco_ext_date date,
    pco_from date,
    pco_to date,
    pco_days_no integer,
    pco_dgt_code character varying(20),
    pco_icd10_code character varying(20),
    pco_validate boolean,
    pco_canceled boolean,
    pco_sli_percent character varying(20),
    pco_acordat boolean,
    pco_spe_code character varying(100)
);


ALTER TABLE public.luna_pat_concedii OWNER TO postgres;

--
-- Name: luna_pat_sarcini; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_pat_sarcini (
    sar_id integer,
    sar_pat_id numeric(9,0),
    sar_pat_cnp character varying(13),
    sar_no_sarc integer,
    sar_no_child integer,
    sar_date date,
    sar_month integer,
    sar_birth_date date,
    sar_um date,
    sar_evolutia_nasterii text,
    sar_date_out date,
    sar_finalizare character varying(30),
    sar_dpn date,
    sar_evolutia_lauziei text
);


ALTER TABLE public.luna_pat_sarcini OWNER TO postgres;

--
-- Name: luna_patients; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_patients (
    pat_id integer,
    pat_cnp character varying(13),
    pat_last_name character varying(100),
    pat_first_name character varying(50),
    pat_birth_date date,
    pat_decease_date date,
    pat_birth_cit_code character varying(30),
    pat_gender_code character varying(10),
    pat_ou_code character varying(20),
    pat_blood_type character varying(10),
    pat_blood_rh character varying(10),
    pat_organ_donation boolean,
    pat_is_diplomat boolean,
    pat_addr_id numeric(9,0),
    pat_fisa numeric(9,0),
    pat_pc_code character varying(20),
    pat_age numeric(3,0),
    pat_emp_stencil_no character varying(6),
    pat_is_reportable boolean,
    pat_null boolean,
    pat_created timestamp without time zone,
    pat_modified timestamp without time zone,
    pat_ps_code character varying(20),
    pat_last_cons_y double precision
);


ALTER TABLE public.luna_patients OWNER TO postgres;

--
-- Name: luna_patients_data; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_patients_data (
    patd_id integer,
    patd_cnp character varying(13),
    patd_tel character varying(100),
    patd_observatii text,
    patd_nr_leg character varying(255),
    patd_pagina numeric(6,0),
    patd_pat_id numeric(6,0),
    patd_afectiuni text,
    patd_consultatii text,
    patd_disp_dz boolean,
    patd_disp_icc boolean,
    patd_disp_htaavc boolean,
    patd_medic character varying(50),
    patd_entry_date date,
    patd_exit_date date,
    patd_confirmat_fmk boolean,
    patd_confirmat_siui boolean
);


ALTER TABLE public.luna_patients_data OWNER TO postgres;

--
-- Name: luna_prescription_items; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_prescription_items (
    prit_id integer,
    prit_pr_id numeric(18,0),
    prit_crt_no integer,
    prit_clt_code character varying(20),
    prit_clt_copayment_percent numeric(6,0),
    prit_icd10_code character varying(20),
    prit_dsc_code character varying(20),
    prit_diag_type character varying(10),
    prit_drg_code character varying(20),
    prit_as_code character varying(150),
    prit_phf_code character varying(150),
    prit_con_concentration character varying(100),
    prit_dose character varying(255),
    prit_quantity character varying(255),
    prit_icd_code character varying(20)
);


ALTER TABLE public.luna_prescription_items OWNER TO postgres;

--
-- Name: luna_prescriptions; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_prescriptions (
    pr_id integer,
    pr_cons_id numeric(18,0),
    pr_emp_cnp character varying(13),
    pr_pat_cnp character varying(13),
    pr_serial_code character varying(10),
    pr_serial_no character varying(20),
    pr_date date,
    pr_prt_code character varying(30),
    pr_ps_code character varying(20),
    pr_dg text,
    pr_dg_auto text,
    pr_nhp_code character varying(20),
    pr_cons_reg_no numeric(18,0),
    pr_recommended_by_stencil_no character varying(6),
    pr_ou_code character varying(20),
    pr_cnt_code character varying(20),
    pr_emp_stencil_no character varying(6),
    pr_ctr_contract_no character varying(20),
    pr_days integer,
    pr_aproved_committee boolean,
    pr_validate boolean,
    pr_recomm_stencil_no character varying(6)
);


ALTER TABLE public.luna_prescriptions OWNER TO postgres;

--
-- Name: luna_reg_controale_sarcina; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_reg_controale_sarcina (
    rcs_id integer,
    rcs_sar_id numeric(9,0),
    rcs_cons_id numeric(9,0),
    rcs_pat_fisa numeric(9,0),
    rcs_pat_cnp character varying(13),
    rcs_date date,
    rcs_varsta_sarc integer,
    rcs_unit character varying(20),
    rcs_varsta_zile integer,
    rcs_varsta_zile_calc integer,
    rcs_evolutie text,
    rcs_obs text,
    rcs_ms_code character varying(20),
    rcs_msp_code character varying(20)
);


ALTER TABLE public.luna_reg_controale_sarcina OWNER TO postgres;

--
-- Name: luna_reg_evaluari; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_reg_evaluari (
    ev_id integer,
    ev_pat_fisa numeric(9,0),
    ev_pat_cnp character varying(13),
    ev_data date,
    ev_inaltime character varying(20),
    ev_greutate character varying(20),
    ev_obezitate character varying(100),
    ev_teg_mucoase text,
    ev_tes_subcutan text,
    ev_tes_musc text,
    ev_sist_osteoartic text,
    ev_ap_resp text,
    ev_ap_cardiovasc text,
    ev_ta character varying(50),
    ev_av character varying(50),
    ev_pedioase character varying(255),
    ev_varice character varying(255),
    ev_ap_dig text,
    ev_ap_urinar text,
    ev_ap_genital text,
    ev_neuropsihic text,
    ev_oftalmologic text,
    ev_orl text,
    ev_sistem_endocrin text,
    ev_varsta integer,
    ev_sanatos_clinic boolean,
    ev_alte_examinari text,
    ev_dg text,
    ev_recomandari text
);


ALTER TABLE public.luna_reg_evaluari OWNER TO postgres;

--
-- Name: luna_services; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE luna_services (
    srv_id integer,
    srv_cons_id numeric(9,0),
    srv_cons_reg_no numeric(9,0),
    srv_ctr_contract_no character varying(20),
    srv_pat_cnp character varying(13),
    srv_ms_code character varying(20),
    srv_msp_code character varying(20),
    srv_date date,
    srv_emp_stencil_no character varying(13),
    srv_quantity character varying(10),
    srv_icd10_code character varying(100),
    srv_validate boolean
);


ALTER TABLE public.luna_services OWNER TO postgres;

--
-- Name: med_srv_packages; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE med_srv_packages (
    msp_id integer NOT NULL,
    msp_code character varying(20),
    msp_name character varying(100),
    msp_valid_from date,
    msp_valid_to date
);


ALTER TABLE public.med_srv_packages OWNER TO postgres;

--
-- Name: medical_letters; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medical_letters (
    ml_id integer NOT NULL,
    ml_pat_cnp character varying(13),
    ml_unitate character varying(255),
    ml_sectie character varying(255),
    ml_type character varying(100),
    ml_date date,
    ml_valid_to date,
    ml_diagnostic text,
    ml_tratament text,
    ml_nume_medic_prescriptor character varying(150),
    ml_prescriptor_spe_code character varying(200),
    ml_stencil character varying(6),
    ml_cons_id bigint
);


ALTER TABLE public.medical_letters OWNER TO postgres;

--
-- Name: medical_note_diagnostics; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medical_note_diagnostics (
    mnd_id integer NOT NULL,
    mnd_mn_id numeric(9,0),
    mnd_icd10_code character varying(20)
);


ALTER TABLE public.medical_note_diagnostics OWNER TO postgres;

--
-- Name: medical_note_investigations; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medical_note_investigations (
    mni_id integer NOT NULL,
    mni_mn_id numeric(9,0),
    mni_position_no integer,
    mni_ls_code character varying(20),
    mni_quantity integer DEFAULT 1,
    mni_description character varying(255)
);


ALTER TABLE public.medical_note_investigations OWNER TO postgres;

--
-- Name: medical_notes; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medical_notes (
    mn_id integer NOT NULL,
    mn_pat_id numeric(9,0),
    mn_emp_id numeric(9,0),
    mn_emp_cnp character varying(13),
    mn_cons_id numeric(9,0),
    mn_emp_stencil_no character varying(6),
    mn_pat_cnp character varying(13),
    mn_ou_code character varying(20),
    mn_serial_no character varying(20),
    mn_serial_code character varying(20),
    mn_date date,
    mn_reg_no numeric(9,0),
    mn_reg_date date,
    mn_mnt_code integer,
    mn_icd10_code character varying(20),
    mn_phy_spe_code character varying(200),
    mn_spe_code character varying(200),
    mn_ctr_contract_no character varying(20),
    mn_dg_descriptiv text,
    mn_cnt_id numeric(6,0),
    mn_validate boolean,
    mn_ps_code character varying(20),
    mn_cnt_code character varying(20),
    mn_recomm_stencil_no character varying(6),
    mn_dg character varying(255),
    mn_dg_type character varying(30)
);


ALTER TABLE public.medical_notes OWNER TO postgres;

--
-- Name: medical_notes_type; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medical_notes_type (
    mnt_id integer NOT NULL,
    mnt_code integer,
    mnt_description character varying(255)
);


ALTER TABLE public.medical_notes_type OWNER TO postgres;

--
-- Name: medical_services; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medical_services (
    ms_id integer NOT NULL,
    ms_code character varying(30),
    ms_name character varying(255),
    ms_description character varying(255),
    ms_order_no numeric(7,0),
    ms_msp_code character varying(20),
    ms_valid_from date,
    ms_valid_to date,
    ms_for_sex character varying(1),
    ms_defined_by_age numeric(1,0),
    ms_age_unit character varying(30),
    ms_restricted_min_age int null,
    ms_restricted_max_age int null,
    ms_period int null,
    ms_period_unit character varying(1),
    ms_frequency int null,
    ms_ms_code character varying(30)
);


ALTER TABLE public.medical_services OWNER TO postgres;

--
-- Name: medici; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medici (
    id integer NOT NULL,
    medic character varying(20),
    nume character varying(40),
    prenume character varying(40),
    cod_parafa character varying(20),
    cnp character varying(13),
    data_act_asig date,
    malpraxis text,
    malpraxis_date date,
    dlp text,
    dlp_date date
);


ALTER TABLE public.medici OWNER TO postgres;

--
-- Name: medicina_muncii; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medicina_muncii (
    id integer NOT NULL,
    dosar_nr numeric(6,0),
    data date,
    unitatea text,
    adresa_unitatii text,
    nume text,
    prenume text,
    sex character(1),
    varsta numeric(3,0),
    data_nasterii date,
    cnp text,
    adresa text,
    functia text,
    formare_profesionala text,
    ruta_profesionala text,
    activitati_indeplinite text,
    boli_profesionale text,
    accidente_de_munca text,
    medic_de_familie text,
    declaratie text,
    antecedente_hc text,
    antecedente_pers text,
    fumat text,
    alcool text,
    inaltime text,
    greutate text,
    obezitate text,
    teg_si_mucoase text,
    tes_subcutan text,
    tes_musc text,
    sist_osteartic text,
    ap_resp text,
    ap_cardiovasc text,
    ta text,
    av text,
    pedioase text,
    varice text,
    ap_dig text,
    ap_urinar text,
    ap_genital text,
    neuropsihic text,
    acuitate_vizuala text,
    vedere_cromatica text,
    vedere_in_relief text,
    voce_tare text,
    voce_soptita text,
    sistem_endocrin text,
    vdrl boolean DEFAULT false,
    rpa boolean DEFAULT false,
    ex_psihologic boolean DEFAULT false,
    ex_psihiatric boolean DEFAULT false,
    ex_oftalmologic boolean DEFAULT false,
    ex_orl boolean DEFAULT false,
    ex_ginecologic boolean DEFAULT false,
    ex_neurologic boolean DEFAULT false,
    ex_dermatologic boolean DEFAULT false,
    ex_suplimentare text,
    sanatos_clinic boolean DEFAULT false,
    diagn_recomandari text,
    aviz_medical text,
    medic text,
    profesia text
);


ALTER TABLE public.medicina_muncii OWNER TO postgres;

--
-- Name: medico_chirurgical_emergencies; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE medico_chirurgical_emergencies (
    mce_id integer NOT NULL,
    mce_code character varying(20),
    mce_description character varying(255),
    mce_valid_from date,
    mce_valid_to date
);


ALTER TABLE public.medico_chirurgical_emergencies OWNER TO postgres;

--
-- Name: motiv_iesiri; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE motiv_iesiri (
    moi_id integer NOT NULL,
    moi_code integer,
    moi_name character varying(50)
);


ALTER TABLE public.motiv_iesiri OWNER TO postgres;

--
-- Name: nhps; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE nhps (
    nhp_id integer NOT NULL,
    nhp_code character varying(20),
    nhp_description character varying(100),
    nhp_valid_from date,
    nhp_valid_to date,
    nhp_has_ambulatory_budget boolean,
    nhp_has_hospital_budget boolean
);


ALTER TABLE public.nhps OWNER TO postgres;

--
-- Name: org_unit_reporting_mapping; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE org_unit_reporting_mapping (
    ourm_id integer NOT NULL,
    ourm_org_unit_code character varying(20),
    ourm_reporting_code character varying(5),
    ourm_valid_from date,
    ourm_valid_to date,
    ourm_app_type character varying(20)
);


ALTER TABLE public.org_unit_reporting_mapping OWNER TO postgres;

--
-- Name: org_unit_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE org_unit_types (
    out_id integer NOT NULL,
    out_code character varying(20),
    out_description character varying(100)
);


ALTER TABLE public.org_unit_types OWNER TO postgres;

--
-- Name: org_units; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE org_units (
    ou_id integer NOT NULL,
    ou_code character varying(20),
    ou_name character varying(100),
    ou_out_code character varying(20),
    ou_valid_from date,
    ou_valid_to date
);


ALTER TABLE public.org_units OWNER TO postgres;

--
-- Name: pacienti; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pacienti (
    fisa integer DEFAULT nextval(('pacienti_fisa_seq'::text)::regclass) NOT NULL,
    pagina numeric(10,2),
    nume text,
    prenume text,
    categoria text,
    varsta integer,
    veterani boolean,
    nr_leg text,
    carnet_asigurat text,
    cnp text,
    dubluri_mart_02 boolean,
    cnp_acces text,
    cod_modificat text,
    adresa text,
    casa_cotizare text,
    cnp_leg_coasig text,
    consultatii text,
    afectiuni text,
    data_inscrierii date,
    data_retragerii date,
    medicul_la_care_vine text,
    retras boolean,
    "pensionat_medical?" boolean,
    medic text,
    nume_medic text,
    c boolean,
    observatii text,
    tulnici boolean,
    nrpens numeric(12,0),
    dpens date,
    drpens date,
    disp_dz boolean DEFAULT false,
    disp_icc boolean DEFAULT false,
    disp_htaavc boolean DEFAULT false,
    telefon text
);


ALTER TABLE public.pacienti OWNER TO postgres;

--
-- Name: package_modes; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE package_modes (
    pkm_id integer NOT NULL,
    pkm_code character varying(250),
    pkm_valid_from date,
    pkm_valid_to date
);


ALTER TABLE public.package_modes OWNER TO postgres;

--
-- Name: pat_allergies; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_allergies (
    all_id integer NOT NULL,
    all_pat_cnp character varying(13),
    all_date date DEFAULT date(now()),
    all_alg_id numeric(9,0),
    all_alg_code character varying(40),
    all_valid_from date,
    all_valid_to date,
    all_motivation character varying(255),
    all_jd_id numeric(9,0),
    all_validate boolean,
    all_description text
);


ALTER TABLE public.pat_allergies OWNER TO postgres;

--
-- Name: pat_categories; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_categories (
    pcat_id integer NOT NULL,
    pcat_pat_id numeric(9,0),
    pcat_pat_cnp character varying(13),
    pcat_date date DEFAULT date(now()),
    pcat_pc_code character varying(20),
    pcat_valid_from date,
    pcat_valid_to date,
    pcat_motivation character varying(255),
    pcat_jd_id numeric(9,0),
    pcat_validate boolean
);


ALTER TABLE public.pat_categories OWNER TO postgres;

--
-- Name: pat_chronics; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_chronics (
    patcr_id integer NOT NULL,
    patcr_pat_cnp character varying(13),
    patcr_icd10_code character varying(20),
    patcr_dsc_code character varying(20),
    patcr_valid_from date,
    patcr_valid_to date,
    patcr_stencil character varying(6),
    patcr_motivation character varying(255),
    patcr_jd_id numeric(9,0),
    patcr_validate boolean DEFAULT false,
    patcr_description text,
    patcr_dg_descriptiv character varying(255),
    patcr_dispensarizat boolean DEFAULT false,
    patcr_date date,
    patcr_priority integer,
    patcr_icd9_code character varying(20),
    patcr_observatii text,
    patcr_cronic boolean,
    patcr_alergie boolean
);


ALTER TABLE public.pat_chronics OWNER TO postgres;

--
-- Name: pat_citizenships; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_citizenships (
    pcz_id integer NOT NULL,
    pcz_cnp character varying(13),
    pcz_ctz_code character varying(20),
    pcz_valid_from date,
    pcz_valid_to date,
    pcz_motivation character varying(255),
    pcz_jd_id numeric(9,0),
    pcz_validate boolean,
    pcz_rec_date date,
    pcz_base boolean
);


ALTER TABLE public.pat_citizenships OWNER TO postgres;

--
-- Name: pat_concedii; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_concedii (
    pco_id integer NOT NULL,
    pco_conv_code character varying(20),
    pco_pro_id integer,
    pco_emp_stencil_no character varying(6),
    pco_pat_id integer,
    pco_pat_cnp character varying(13),
    pco_cons_id numeric(9,0),
    pco_serial_code character varying(20),
    pco_serial_no character varying(20),
    pco_month integer,
    pco_year integer,
    pco_sli_code character varying(20),
    pco_mce_code character varying(20),
    pco_icd_code character varying(20),
    pco_cons_reg_no numeric(9,0),
    pco_hosp_depart character varying(255),
    pco_hosp_depart_chief_stencil_no character varying(6),
    pco_continuare boolean,
    pco_prev_serial_code character varying(20),
    pco_prev_serial_no character varying(20),
    pco_duplicat boolean,
    pco_dup_serial_code character varying(20),
    pco_dup_serial_no character varying(20),
    pco_dup_count integer DEFAULT 0,
    pco_expert_stencil character varying(6),
    pco_expert_cert_no character varying(20),
    pco_expert_cert_date date,
    pco_matern_stencil character varying(6),
    pco_amb_date date,
    pco_ext_date date,
    pco_from date,
    pco_to date,
    pco_days_no integer,
    pco_dgt_code character varying(20),
    pco_icd10_code character varying(20),
    pco_validate boolean DEFAULT false,
    pco_canceled boolean DEFAULT false,
    pco_sli_percent character varying(20),
    pco_acordat boolean,
    pco_spe_code character varying(100)
);


ALTER TABLE public.pat_concedii OWNER TO postgres;

--
-- Name: pat_enlisteds; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_enlisteds (
    pen_id integer NOT NULL,
    pen_emp_id numeric(9,0),
    pen_emp_cnp character varying(13),
    pen_pat_id numeric(9,0),
    pen_pat_cnp character varying(13),
    pen_date_in date,
    pen_date_out date,
    pen_evt_id_in integer,
    pen_evt_code_in character varying(50),
    pen_evt_id_out integer,
    pen_evt_code_out character varying(50),
    pen_phy_id_last integer,
    pen_phy_id_next integer,
    pen_reg_no_in numeric(9,0),
    pen_reg_no_out numeric(9,0),
    pen_date_rec_in date,
    pen_date_rec_out date,
    pen_jd_in numeric(9,0),
    pen_jd_out numeric(9,0),
    pen_validate_in boolean,
    pen_validate_out boolean
);


ALTER TABLE public.pat_enlisteds OWNER TO postgres;

--
-- Name: pat_id_cards; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_id_cards (
    idc_id integer NOT NULL,
    idc_pat_cnp character varying(13),
    idc_pct_code character varying(20),
    idc_serial character varying(10),
    idc_no character varying(20),
    idc_valid_from date,
    idc_valid_to date,
    idc_issued_by character varying(255),
    idc_pat_id numeric(6,0)
);


ALTER TABLE public.pat_id_cards OWNER TO postgres;

--
-- Name: pat_immunizations; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_immunizations (
    pim_id integer NOT NULL,
    pim_description character varying(255),
    pim_imm_code character varying(20),
    pim_ms_code character varying(20),
    pim_date_imm date,
    pim_date date,
    pim_pat_cnp character varying(13),
    pim_cons_id integer
);


ALTER TABLE public.pat_immunizations OWNER TO postgres;

--
-- Name: pat_nhps; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_nhps (
    pnhp_id integer NOT NULL,
    pnhp_pat_id numeric(6,0),
    pnhp_nhp_id numeric(6,0),
    pnhp_date date DEFAULT date(now()),
    pnhp_pat_cnp character varying(13),
    pnhp_nhp_code character varying(20),
    pnhp_valid_from date,
    pnhp_valid_to date,
    pnhp_motivation character varying(255),
    pnhp_jd_id numeric(9,0),
    pnhp_validate boolean
);


ALTER TABLE public.pat_nhps OWNER TO postgres;

--
-- Name: pat_relatives; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_relatives (
    patr_id integer NOT NULL,
    patr_pat_id numeric(9,0),
    patr_relative_pat_id numeric(9,0),
    patr_pat_cnp character varying(13),
    patr_rel_code character varying(30),
    patr_cnp character varying(13),
    patr_first_name character varying(100),
    patr_last_name character varying(50),
    patr_is_co_insured boolean DEFAULT false,
    patr_valid_from date,
    patr_valid_to date,
    patr_motivation character varying(255),
    patr_jd_id numeric(9,0),
    patr_validate boolean DEFAULT false
);


ALTER TABLE public.pat_relatives OWNER TO postgres;

--
-- Name: pat_sarcini; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_sarcini (
    sar_id integer NOT NULL,
    sar_pat_id numeric(9,0),
    sar_pat_cnp character varying(13),
    sar_no_sarc integer,
    sar_no_child integer,
    sar_date date,
    sar_month integer,
    sar_birth_date date,
    sar_um date,
    sar_evolutia_nasterii text,
    sar_date_out date,
    sar_finalizare character varying(30),
    sar_dpn date,
    sar_evolutia_lauziei text
);


ALTER TABLE public.pat_sarcini OWNER TO postgres;

--
-- Name: pat_states; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pat_states (
    pst_id integer NOT NULL,
    pst_pat_id numeric(9,0),
    pst_pat_cnp character varying(13),
    pst_ps_id numeric(6,0),
    pst_date date DEFAULT date(now()),
    pst_ps_code character varying(20),
    pst_valid_from date,
    pst_valid_to date,
    pst_motivation character varying(255),
    pst_jd_id numeric(9,0),
    pst_validation boolean
);


ALTER TABLE public.pat_states OWNER TO postgres;

--
-- Name: patients; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE patients (
    pat_id integer NOT NULL,
    pat_cnp character varying(13),
    pat_last_name character varying(100),
    pat_first_name character varying(50),
    pat_birth_date date,
    pat_decease_date date,
    pat_birth_cit_code character varying(30),
    pat_gender_code character varying(10),
    pat_ou_code character varying(20),
    pat_blood_type character varying(10),
    pat_blood_rh character varying(10),
    pat_organ_donation boolean DEFAULT false,
    pat_is_diplomat boolean,
    pat_addr_id numeric(9,0),
    pat_fisa numeric(9,0),
    pat_pc_code character varying(20),
    pat_age numeric(3,0),
    pat_emp_stencil_no character varying(6),
    pat_is_reportable boolean,
    pat_null boolean DEFAULT true,
    pat_created timestamp without time zone DEFAULT now(),
    pat_modified timestamp without time zone DEFAULT now(),
    pat_ps_code character varying(20),
    pat_last_cons_y double precision
);


ALTER TABLE public.patients OWNER TO postgres;

--
-- Name: patients_data; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE patients_data (
    patd_id integer NOT NULL,
    patd_cnp character varying(13),
    patd_tel character varying(100),
    patd_observatii text,
    patd_nr_leg character varying(255),
    patd_pagina numeric(6,0),
    patd_pat_id numeric(6,0),
    patd_afectiuni text,
    patd_consultatii text,
    patd_disp_dz boolean DEFAULT false,
    patd_disp_icc boolean DEFAULT false,
    patd_disp_htaavc boolean DEFAULT false,
    patd_medic character varying(50),
    patd_entry_date date,
    patd_exit_date date,
    patd_confirmat_fmk boolean DEFAULT false,
    patd_confirmat_siui boolean DEFAULT false,
    patd_strain boolean DEFAULT false,
    patd_pag_reinscris smallint,
    patd_motiv_iesire integer,
    patd_nrpens character varying(10),
    patd_dpens date,
    patd_drpens date,
    patd_modif_date date
);


ALTER TABLE public.patients_data OWNER TO postgres;

--
-- Name: person_categories; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE person_categories (
    pc_id integer NOT NULL,
    pc_code character varying(20),
    pc_description character varying(250),
    pc_valid_from date,
    pc_valid_to date,
    pc_restricted_min_age numeric(18,0),
    pc_restricted_max_age numeric(18,0),
    pc_supports_overlapping boolean,
    pc_defined_by_age boolean,
    pc_max_duration numeric(18,0),
    pc_max_duration_round_type character varying(1),
    pc_for_sex character varying(1),
    pc_ps_code character varying(20),
    pc_priority numeric(6,0),
    pc_is_optional boolean,
    pc_can_be_reported boolean
);


ALTER TABLE public.person_categories OWNER TO postgres;

--
-- Name: person_categories_exclusions; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE person_categories_exclusions (
    pce_id integer NOT NULL,
    pce_pc_code character varying(20),
    pce_excl_pc_code character varying(20),
    pce_replacement_type character varying(20)
);


ALTER TABLE public.person_categories_exclusions OWNER TO postgres;

--
-- Name: person_states; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE person_states (
    ps_id integer NOT NULL,
    ps_code character varying(20),
    ps_description character varying(100),
    ps_valid_from date,
    ps_valid_to date
);


ALTER TABLE public.person_states OWNER TO postgres;

--
-- Name: person_states_list_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE person_states_list_types (
    pslt_id integer NOT NULL,
    pslt_clt_code character varying(20),
    pslt_ps_code character varying(20),
    pslt_copayment_percent numeric(18,0),
    pslt_valid_from date,
    pslt_valid_to date
);


ALTER TABLE public.person_states_list_types OWNER TO postgres;

--
-- Name: person_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE person_types (
    pt_id integer NOT NULL,
    pt_code character varying(20),
    pt_description character varying(200),
    pt_is_foreign boolean DEFAULT false
);


ALTER TABLE public.person_types OWNER TO postgres;

--
-- Name: personal; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personal (
    per_id integer NOT NULL,
    per_nume character varying(100),
    per_prenume character varying(100),
    per_cnp character varying(13),
    per_functia character varying(100),
    per_activ boolean DEFAULT false,
    per_valid_from date,
    per_valid_to date
);


ALTER TABLE public.personal OWNER TO postgres;

--
-- Name: personal_card_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE personal_card_types (
    pct_id integer NOT NULL,
    pct_code character varying(20),
    pct_name character varying(100),
    pct_category character varying(1),
    pct_valid_from date,
    pct_valid_to date
);


ALTER TABLE public.personal_card_types OWNER TO postgres;

--
-- Name: pgic_values; Type: TABLE; Schema: public; Owner: Cristi; Tablespace: 
--

CREATE TABLE pgic_values (
    pgi_id integer NOT NULL,
    pgi_uic character varying(20),
    pgi_value numeric(6,0),
    pgi_valid_from date,
    pgi_valid_to date
);


ALTER TABLE public.pgic_values OWNER TO postgres;

--
-- Name: pharmaceutical_forms; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE pharmaceutical_forms (
    phf_id integer NOT NULL,
    phf_code character varying(100),
    phf_valid_from date,
    phf_valid_to date
);


ALTER TABLE public.pharmaceutical_forms OWNER TO postgres;

--
-- Name: physician_specialities; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE physician_specialities (
    psp_id integer NOT NULL,
    psp_emp_cnp character varying(13),
    psp_spe_code character varying(200),
    psp_valid_from date,
    psp_valid_to date
);


ALTER TABLE public.physician_specialities OWNER TO postgres;

--
-- Name: physicians; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE physicians (
    phy_id integer NOT NULL,
    phy_stencil character varying(6),
    phy_employed_stencil character varying(6),
    phy_contract_no character varying(20),
    phy_name character varying(255),
    phy_birth_date date,
    phy_is_new_commer boolean,
    phy_article_no character varying(6)
);


ALTER TABLE public.physicians OWNER TO postgres;

--
-- Name: preferences; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE preferences (
    pref_id integer NOT NULL,
    pref_usr_id integer,
    pref_name character varying(50),
    pref_value character varying(255),
    pref_type character varying(30)
);


ALTER TABLE public.preferences OWNER TO postgres;

--
-- Name: prescription_items; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE prescription_items (
    prit_id integer NOT NULL,
    prit_pr_id numeric(18,0),
    prit_crt_no integer,
    prit_clt_code character varying(20),
    prit_clt_copayment_percent numeric(6,0),
    prit_icd10_code character varying(20),
    prit_dsc_code character varying(20),
    prit_diag_type character varying(10),
    prit_drg_code character varying(20),
    prit_as_code character varying(150),
    prit_phf_code character varying(150),
    prit_con_concentration character varying(100),
    prit_dose character varying(255),
    prit_quantity character varying(255),
    prit_icd_code character varying(20),
    prit_max_price_ut double precision DEFAULT 0,
    prit_copayment_value double precision DEFAULT 0
);


ALTER TABLE public.prescription_items OWNER TO postgres;

--
-- Name: prescription_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE prescription_types (
    prt_id integer NOT NULL,
    prt_code character varying(30),
    prt_description character varying(150),
    prt_for_narcotics boolean,
    prt_valid_from date,
    prt_valid_to date
);


ALTER TABLE public.prescription_types OWNER TO postgres;

--
-- Name: prescriptions; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE prescriptions (
    pr_id integer NOT NULL,
    pr_cons_id numeric(18,0),
    pr_emp_cnp character varying(13),
    pr_pat_cnp character varying(13),
    pr_serial_code character varying(10),
    pr_serial_no character varying(20),
    pr_date date,
    pr_prt_code character varying(30),
    pr_ps_code character varying(20),
    pr_dg text,
    pr_dg_auto text,
    pr_nhp_code character varying(20),
    pr_cons_reg_no numeric(18,0),
    pr_recommended_by_stencil_no character varying(6),
    pr_ou_code character varying(20),
    pr_cnt_code character varying(20),
    pr_emp_stencil_no character varying(6),
    pr_ctr_contract_no character varying(20),
    pr_days integer DEFAULT 0,
    pr_aproved_committee boolean DEFAULT false,
    pr_validate boolean DEFAULT false,
    pr_recomm_stencil_no character varying(6),
    pr_copayment_value double precision DEFAULT 0
);


ALTER TABLE public.prescriptions OWNER TO postgres;

--
-- Name: prescriptions_series; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE prescriptions_series (
    sr_id integer NOT NULL,
    sr_emp_stencil_no character varying(6),
    sr_serie character varying(8),
    sr_start numeric(10,0),
    sr_curent numeric(10,0),
    sr_finish numeric(10,0),
    sr_terminat boolean DEFAULT false
);


ALTER TABLE public.prescriptions_series OWNER TO postgres;

--
-- Name: printable_document_fields; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE printable_document_fields (
    pdf_id integer NOT NULL,
    pdf_pd_id bigint,
    pdf_name character varying(255),
    pdf_x double precision,
    pdf_y double precision,
    pdf_font_type character varying(200),
    pdf_font_size character varying(20),
    pdf_font_style character varying(30),
    pdf_scale boolean DEFAULT false,
    pdf_space_force boolean DEFAULT false,
    pdf_right_limit double precision,
    pdf_character_spacing double precision,
    pdf_font_color character varying(100),
    pdf_multiline boolean DEFAULT false,
    pdf_line_spacing double precision,
    pdf_table character varying(100),
    pdf_field character varying(100),
    pdf_pad boolean DEFAULT false
);


ALTER TABLE public.printable_document_fields OWNER TO postgres;

--
-- Name: printable_documents; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE printable_documents (
    pd_id integer NOT NULL,
    pd_name character varying(20),
    pd_description character varying(255),
    pd_template character varying(20),
    pd_background character varying(24),
    pd_img_x double precision,
    pd_img_y double precision,
    pd_img_w double precision,
    pd_img_h double precision
);


ALTER TABLE public.printable_documents OWNER TO postgres;

--
-- Name: COLUMN printable_documents.pd_template; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_documents.pd_template IS 'nume de template pentru chenarele printabile';


--
-- Name: COLUMN printable_documents.pd_background; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_documents.pd_background IS 'background de tip image (ex. Internare.png)';


--
-- Name: COLUMN printable_documents.pd_img_x; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_documents.pd_img_x IS 'x0 coord. pt. background';


--
-- Name: COLUMN printable_documents.pd_img_y; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_documents.pd_img_y IS 'y0 coord. pt. background';


--
-- Name: COLUMN printable_documents.pd_img_w; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_documents.pd_img_w IS 'Xmax coord. pt. background';


--
-- Name: COLUMN printable_documents.pd_img_h; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_documents.pd_img_h IS 'Ymax coord. pt. background';


--
-- Name: printable_register_cols; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE printable_register_cols (
    prfc_id integer NOT NULL,
    prfc_nume character varying(100),
    prfc_description character varying(255),
    prfc_w integer DEFAULT 10,
    prfc_font_type character varying(30) DEFAULT 'timesnr'::character varying,
    prfc_font_style character varying(10),
    prfc_border character varying(10) DEFAULT '1'::character varying,
    prfc_align character varying(10) DEFAULT 'C'::character varying,
    prfc_prf_id integer NOT NULL
);


ALTER TABLE public.printable_register_cols OWNER TO postgres;

--
-- Name: TABLE printable_register_cols; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE printable_register_cols IS 'numele si stilurile coloanelor din registri';


--
-- Name: COLUMN printable_register_cols.prfc_font_type; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_register_cols.prfc_font_type IS 'timesnr';


--
-- Name: COLUMN printable_register_cols.prfc_font_style; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_register_cols.prfc_font_style IS 'b,i,bi';


--
-- Name: COLUMN printable_register_cols.prfc_border; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_register_cols.prfc_border IS '0-1 sau LRTB';


--
-- Name: COLUMN printable_register_cols.prfc_align; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_register_cols.prfc_align IS 'L R C J';


--
-- Name: printable_registers; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE printable_registers (
    prf_id integer NOT NULL,
    prf_name character varying(100),
    prf_description character varying(255),
    prf_header_font character varying(255) NOT NULL,
    prf_h integer,
    prf_header text,
    prf_footer character varying(255),
    prf_sql text,
    prf_cartus text,
    prf_table_font character varying(255),
    prf_orientation "char" DEFAULT 'P'::"char",
    prf_title character varying(255)
);


ALTER TABLE public.printable_registers OWNER TO postgres;

--
-- Name: TABLE printable_registers; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE printable_registers IS 'definire printare registri';


--
-- Name: COLUMN printable_registers.prf_header_font; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_registers.prf_header_font IS 'descriere font+style header';


--
-- Name: COLUMN printable_registers.prf_h; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_registers.prf_h IS 'inaltimea randului';


--
-- Name: COLUMN printable_registers.prf_table_font; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_registers.prf_table_font IS 'descriere font_style tabel size,type,style,border,align';


--
-- Name: COLUMN printable_registers.prf_orientation; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_registers.prf_orientation IS 'P-Portrait, L-Landscape';


--
-- Name: COLUMN printable_registers.prf_title; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN printable_registers.prf_title IS 'titlul registrului';


--
-- Name: provider_addresses; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE provider_addresses (
    proad_id integer NOT NULL,
    proad_pro_id integer,
    proad_pro_uic character varying(20),
    proad_cnt_code character varying(20),
    proad_dst_code character varying(20),
    proad_cit_code character varying(20),
    proad_st_name character varying(150),
    proad_street_no character varying(10),
    proad_building character varying(20),
    proad_entrance character varying(20),
    proad_floor character varying(20),
    proad_apartment character varying(20),
    proad_postal_code character varying(40),
    proad_valid_from date,
    proad_valid_to date,
    proad_activ boolean
);


ALTER TABLE public.provider_addresses OWNER TO postgres;

--
-- Name: COLUMN provider_addresses.proad_activ; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN provider_addresses.proad_activ IS 'adresa curenta ptr cabinet';


--
-- Name: providers; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE providers (
    pro_id integer NOT NULL,
    pro_code character varying(30),
    pro_name character varying(255),
    pro_uic character varying(20),
    pro_uic_date date,
    pro_reg_no character varying(30),
    pro_reg_no_date date,
    pro_attorney character varying(100),
    pro_cmi boolean,
    pro_issue_date timestamp without time zone
);


ALTER TABLE public.providers OWNER TO postgres;

--
-- Name: reg_asig_addresses; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_addresses (
    rasa_id integer NOT NULL,
    rasa_ras_id bigint,
    rasa_pid character varying(13),
    rasa_citycode character varying(10),
    rasa_districtcode character varying(10),
    rasa_streetname character varying(50),
    rasa_streetno character varying(10),
    rasa_building character varying(10),
    rasa_entrance character varying(10),
    rasa_floor character varying(10),
    rasa_apartment character varying(10),
    rasa_postalcode character varying(10)
);


ALTER TABLE public.reg_asig_addresses OWNER TO postgres;

--
-- Name: reg_asig_base; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_base (
    rasb_id integer NOT NULL,
    rasb_ras_id bigint,
    rasb_pid character varying(13),
    rasb_code character varying(20),
    rasb_validfrom date,
    rasb_validto date,
    rasb_motivation character varying(255),
    rasb_jd character varying(10)
);


ALTER TABLE public.reg_asig_base OWNER TO postgres;

--
-- Name: reg_asig_categories; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_categories (
    rasc_id integer NOT NULL,
    rasc_ras_id bigint,
    rasc_pid character varying(13),
    rasc_code character varying(10),
    rasc_validfrom date,
    rasc_validto date,
    rasc_motivation character varying(255),
    rasc_jd character varying(10)
);


ALTER TABLE public.reg_asig_categories OWNER TO postgres;

--
-- Name: reg_asig_chronics; Type: TABLE; Schema: public; Owner: Cristi; Tablespace: 
--

CREATE TABLE reg_asig_chronics (
    rach_id integer NOT NULL,
    rach_ras_id bigint,
    rach_pid character varying(13),
    rach_code character varying(10),
    rach_validfrom date,
    rach_validto date,
    rach_physicianstencil character varying(6),
    rach_motivation character varying(255)
);


ALTER TABLE public.reg_asig_chronics OWNER TO postgres;

--
-- Name: reg_asig_ensured_reasons; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_ensured_reasons (
    raser_id integer NOT NULL,
    raser_ras_id bigint,
    raser_pid character varying(13),
    raser_category character varying(10),
    raser_validfrom date,
    raser_validto date
);


ALTER TABLE public.reg_asig_ensured_reasons OWNER TO postgres;

--
-- Name: reg_asig_fmk; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_fmk (
    raf_id integer NOT NULL,
    raf_actas_id bigint,
    raf_data date,
    raf_fmk_id numeric(9,0),
    raf_cnpmedic character varying(13),
    raf_cnp character varying(13),
    raf_carnet character varying(10),
    raf_strain boolean,
    raf_datan date,
    raf_sex character varying(1),
    raf_nume character varying(50),
    raf_prenume character varying(100),
    raf_adresa character varying(100),
    raf_iesit character varying(1),
    raf_datai date,
    raf_datais date,
    raf_categ character varying(50),
    raf_ruda character varying(10),
    raf_cnpco character varying(13),
    raf_cas character varying(20),
    raf_modtext date,
    raf_modcat date,
    raf_nrpens character varying(10),
    raf_dpens date,
    raf_drpens date,
    raf_motive integer,
    raf_cronic boolean,
    raf_listaboli character varying(255)
);


ALTER TABLE public.reg_asig_fmk OWNER TO postgres;

--
-- Name: reg_asig_id_cards; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_id_cards (
    rasid_id integer NOT NULL,
    rasid_ras_id bigint,
    rasid_pid character varying(13),
    rasid_typecode character varying(10),
    rasid_serialcode character varying(10),
    rasid_serialno character varying(20),
    rasid_validfrom date,
    rasid_validto date,
    rasid_issuedby character varying(50)
);


ALTER TABLE public.reg_asig_id_cards OWNER TO postgres;

--
-- Name: reg_asig_jdocs; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_jdocs (
    rasj_id integer NOT NULL,
    rasj_ras_id bigint,
    rasj_pid character varying(13),
    rasj_doctype character varying(10),
    rasj_docseries character varying(10),
    rasj_docno character varying(10),
    rasj_docdate character varying(10),
    rasj_description character varying(10),
    rasj_validfrom date,
    rasj_validto date,
    rasj_issuedby character varying(10)
);


ALTER TABLE public.reg_asig_jdocs OWNER TO postgres;

--
-- Name: reg_asig_nhps; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_nhps (
    rasn_id integer NOT NULL,
    rasn_ras_id bigint,
    rasn_pid character varying(13),
    rasn_code character varying(10),
    rasn_validfrom date,
    rasn_validto date,
    rasn_motivation character varying(255),
    rasn_jd character varying(10)
);


ALTER TABLE public.reg_asig_nhps OWNER TO postgres;

--
-- Name: reg_asig_operations; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_operations (
    raso_id integer NOT NULL,
    raso_ras_id bigint,
    raso_pid character varying(13),
    raso_movetype character varying(10),
    raso_date date,
    raso_event character varying(10)
);


ALTER TABLE public.reg_asig_operations OWNER TO postgres;

--
-- Name: reg_asig_siui; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_siui (
    ras_id integer NOT NULL,
    ras_actas_id bigint,
    ras_stencil character varying(6),
    ras_pid character varying(13),
    ras_firstname character varying(100),
    ras_lastname character varying(50),
    ras_birthdate date,
    ras_placeofbirth character varying(10),
    ras_gender character varying(10),
    ras_deceasedate date,
    ras_unitofpayment character varying(50),
    ras_bloodtype character varying(10),
    ras_bloodrh character varying(10),
    ras_organsdonation boolean,
    ras_isdiplomat boolean,
    ras_data_actualizare date
);


ALTER TABLE public.reg_asig_siui OWNER TO postgres;

--
-- Name: reg_asig_states; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_states (
    rass_id integer NOT NULL,
    rass_ras_id bigint,
    rass_pid character varying(13),
    rass_code character varying(10),
    rass_validfrom date,
    rass_validto date,
    rass_motivation character varying(255),
    rass_jd character varying(10)
);


ALTER TABLE public.reg_asig_states OWNER TO postgres;

--
-- Name: reg_asig_supl; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asig_supl (
    rasup_id integer NOT NULL,
    rasup_ras_id bigint,
    rasup_pid character varying(13),
    rasup_code character varying(13),
    rasup_validfrom date,
    rasup_validto date,
    rasup_motivation character varying(255),
    rasup_jd character varying(10)
);


ALTER TABLE public.reg_asig_supl OWNER TO postgres;

--
-- Name: reg_asigurati; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_asigurati (
    nr_inreg integer NOT NULL,
    data date,
    cnpmedic text,
    id numeric(10,2),
    cnp text,
    carnet text,
    strain boolean,
    datan date,
    sex text,
    nume text,
    prenume text,
    adresa text,
    iesit text,
    datai date,
    datais date,
    categ text,
    ruda text,
    cnpco text,
    cas text,
    modtext date,
    modcat date,
    nrpens text,
    dpens date,
    drpens date,
    medic text
);


ALTER TABLE public.reg_asigurati OWNER TO postgres;

--
-- Name: reg_cons; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_cons (
    nr_inreg integer NOT NULL,
    nume text,
    prenume text,
    varsta integer,
    adresa text,
    data date,
    fisa integer,
    diagnostic text,
    tratament text,
    imagistica text,
    paraclinic text,
    trimitere text,
    internare text,
    reteta_gratuita boolean DEFAULT false,
    reteta_compensata boolean DEFAULT false,
    domiciliu boolean DEFAULT false,
    cnp text,
    medic text,
    scrisoare_medicala text,
    sarcina boolean DEFAULT false,
    comp90 boolean DEFAULT false,
    registru bigint,
    reg_dz boolean DEFAULT false,
    reg_icc boolean DEFAULT false,
    reg_htaavc boolean DEFAULT false
);


ALTER TABLE public.reg_cons OWNER TO postgres;

--
-- Name: reg_controale_sarcina; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_controale_sarcina (
    rcs_id integer NOT NULL,
    rcs_sar_id numeric(9,0),
    rcs_cons_id numeric(9,0),
    rcs_pat_fisa numeric(9,0),
    rcs_pat_cnp character varying(13),
    rcs_date date,
    rcs_varsta_sarc integer,
    rcs_unit character varying(20),
    rcs_varsta_zile integer,
    rcs_varsta_zile_calc integer,
    rcs_evolutie text,
    rcs_obs text,
    rcs_ms_code character varying(20),
    rcs_msp_code character varying(20)
);


ALTER TABLE public.reg_controale_sarcina OWNER TO postgres;

--
-- Name: reg_cronici; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_cronici (
    rcr_id integer NOT NULL,
    rcr_pat_id numeric(9,0),
    rcr_pat_cnp character varying(13),
    rcr_pat_fisa numeric(9,0),
    rcr_cons_id numeric(9,0),
    rcr_data date,
    rcr_icd10_codes character varying(255),
    rcr_dsc_codes character varying(255),
    rcr_dg_descriptiv text,
    rcr_evolutie text
);


ALTER TABLE public.reg_cronici OWNER TO postgres;

--
-- Name: reg_evaluari; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_evaluari (
    ev_id integer NOT NULL,
    ev_pat_fisa numeric(9,0),
    ev_pat_cnp character varying(13),
    ev_data date,
    ev_inaltime character varying(20),
    ev_greutate character varying(20),
    ev_obezitate character varying(100),
    ev_teg_mucoase text,
    ev_tes_subcutan text,
    ev_tes_musc text,
    ev_sist_osteoartic text,
    ev_ap_resp text,
    ev_ap_cardiovasc text,
    ev_ta character varying(50),
    ev_av character varying(50),
    ev_pedioase character varying(255),
    ev_varice character varying(255),
    ev_ap_dig text,
    ev_ap_urinar text,
    ev_ap_genital text,
    ev_neuropsihic text,
    ev_oftalmologic text,
    ev_orl text,
    ev_sistem_endocrin text,
    ev_varsta integer,
    ev_sanatos_clinic boolean DEFAULT false,
    ev_alte_examinari text,
    ev_dg text,
    ev_recomandari text,
    ev_cons_id integer,
    ev_ms_code character varying(10)
);


ALTER TABLE public.reg_evaluari OWNER TO postgres;

--
-- Name: reg_sarcini; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_sarcini (
    id integer NOT NULL,
    fisa integer,
    cnp text,
    nume text,
    prenume text,
    luare_in_evidenta boolean DEFAULT false,
    data_luarii_in_evidenta date,
    luna_sarcinii_luare_in_evidenta text,
    data_consultatiei date,
    luna_sarcinii text,
    evolutia_sarcinii text,
    data_nasterii date,
    evolutia_nasterii text,
    evolutia_lehuziei text,
    scoaterea_din_evidenta boolean DEFAULT false,
    ultima_menstruatie date
);


ALTER TABLE public.reg_sarcini OWNER TO postgres;

--
-- Name: reg_sarcini_vechi; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reg_sarcini_vechi (
    fisa integer,
    cnp text,
    nume text,
    prenume text,
    luare_in_evidenta boolean DEFAULT false,
    data_luarii_in_evidenta date,
    luna_sarcinii_luare_in_evidenta text,
    data_consultatiei date,
    luna_sarcinii text,
    evolutia_sarcinii text,
    data_nasterii date,
    evolutia_nasterii text,
    evolutia_lehuziei text,
    scoaterea_din_evidenta boolean DEFAULT false
);


ALTER TABLE public.reg_sarcini_vechi OWNER TO postgres;

--
-- Name: relatives; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relatives (
    rel_id integer NOT NULL,
    rel_code character varying(20),
    rel_description character varying(100)
);


ALTER TABLE public.relatives OWNER TO postgres;

--
-- Name: rezervate; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE rezervate (
    nr_inreg bigint,
    data_ora timestamp without time zone DEFAULT now()
);


ALTER TABLE public.rezervate OWNER TO postgres;

--
-- Name: service_med_srv_packages; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE service_med_srv_packages (
    smsp_id integer NOT NULL,
    smsp_ms_code character varying(30),
    smsp_msp_code character varying(20),
    smsp_value double precision,
    smsp_points_100 float,
    smsp_points_95 float,
    smsp_for_euro_card boolean DEFAULT false,
    smsp_valid_from date,
    smsp_valid_to date,
    smsp_first_cap_letter character varying(30),
    smsp_order_no character varying(30)
);


ALTER TABLE public.service_med_srv_packages OWNER TO postgres;

--
-- Name: service_type; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE service_type (
    lst_id integer NOT NULL,
    lst_code integer,
    lst_description character varying(255)
);


ALTER TABLE public.service_type OWNER TO postgres;

--
-- Name: services; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE services (
    srv_id integer NOT NULL,
    srv_cons_id numeric(9,0),
    srv_cons_reg_no numeric(9,0),
    srv_ctr_contract_no character varying(20),
    srv_pat_cnp character varying(13),
    srv_ms_code character varying(20),
    srv_msp_code character varying(20),
    srv_date date,
    srv_emp_stencil_no character varying(13),
    srv_quantity character varying(10),
    srv_icd10_code character varying(100),
    srv_validate boolean DEFAULT false
);


ALTER TABLE public.services OWNER TO postgres;

--
-- Name: servnom; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE servnom (
    sn_id integer NOT NULL,
    sn_cnpmedic character varying(13),
    sn_cnp character varying(13),
    sn_nume character varying(50),
    sn_prenume character varying(50),
    sn_strain boolean,
    sn_datan date,
    sn_sex character varying(1),
    sn_facultativ boolean,
    sn_minimal boolean,
    sn_cet_ue boolean,
    sn_extraterit boolean,
    sn_in_scoli boolean,
    sn_i_tipasig numeric(9,0),
    sn_i_nrinoc numeric(9,0),
    sn_i_inoc character varying(255),
    sn_ie_hepb date,
    sn_ic_hepb date,
    sn_ie_vpo date,
    sn_ic_vpo date,
    sn_ie_dtpdt date,
    sn_ic_dtpdt date,
    sn_ie_ar date,
    sn_ic_ar date,
    sn_ie_dtr1 date,
    sn_ic_dtr1 date,
    sn_ie_dtr2 date,
    sn_ic_dtr2 date,
    sn_ie_dtvta date,
    sn_ic_dtvta date,
    sn_ie_atgrv date,
    sn_ic_atgrv date,
    sn_ie_cnat date,
    sn_ic_cnat date,
    sn_ie_ag date,
    sn_ic_ag date,
    sn_ie_arub date,
    sn_ic_arub date,
    sn_b_ext date,
    sn_b_1luna date,
    sn_b_2luni date,
    sn_b_4luni date,
    sn_b_6luni date,
    sn_b_9luni date,
    sn_b_12luni date,
    sn_b_15luni date,
    sn_b_18luni date,
    sn_b_2_18ani date,
    sn_b_p18ani date,
    sn_tbc_nou date,
    sn_tbc_trat date,
    sn_g_tip_evid numeric(9,0),
    sn_g_lunaz date,
    sn_g_evid date,
    sn_g_3luni date,
    sn_g_4luni date,
    sn_g_5luni date,
    sn_g_6luni date,
    sn_g_7luni_1 date,
    sn_g_7luni_2 date,
    sn_g_8luni_1 date,
    sn_g_8luni_2 date,
    sn_g_9luni_1 date,
    sn_g_9luni_2 date,
    sn_g_datan date,
    sn_l_mater date,
    sn_l_4sap date,
    sn_cp_inscard date,
    sn_cp_diabet date,
    sn_cp_hta date,
    sn_su date,
    sn_db_dep date,
    sn_db_sup date,
    sn_smc date,
    sn_cd date,
    sn_pf1 date,
    sn_pf2 date,
    sn_luna numeric(9,0),
    sn_an numeric(9,0)
);


ALTER TABLE public.servnom OWNER TO postgres;

--
-- Name: servnom2010; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE servnom2010 (
    sn_id integer NOT NULL,
    sn_cnp character varying(13),
    sn_nume character varying(50),
    sn_prenume character varying(50),
    sn_strain boolean DEFAULT false,
    sn_datan date,
    sn_sex character(1),
    sn_facultativ boolean DEFAULT false,
    sn_minimal boolean DEFAULT false,
    sn_cet_ue boolean DEFAULT false,
    sn_cd1 date,
    sn_codcd character varying(255),
    sn_cd2 date,
    sn_cc date,
    sn_codcc character varying(255),
    sn_ca1 date,
    sn_codca character varying(255),
    sn_ca2 date,
    sn_ca3 date,
    sn_luna integer,
    sn_an integer,
    sn_cnpmedic character varying(13)
);


ALTER TABLE public.servnom2010 OWNER TO postgres;

--
-- Name: sick_leave_indemnizations; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE sick_leave_indemnizations (
    sli_id integer NOT NULL,
    sli_code character varying(20),
    sli_description character varying(255),
    sli_slig_code character varying(20),
    sli_percent numeric(18,0),
    sli_is_taxable boolean,
    sli_must_have_stage boolean,
    sli_valid_from date,
    sli_valid_to date
);


ALTER TABLE public.sick_leave_indemnizations OWNER TO postgres;

--
-- Name: sick_leave_indemnizations_groups; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE sick_leave_indemnizations_groups (
    slig_id integer NOT NULL,
    slig_code character varying(20),
    slig_description character varying(255),
    slig_valid_from date,
    slig_valid_to date
);


ALTER TABLE public.sick_leave_indemnizations_groups OWNER TO postgres;

--
-- Name: specialities; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE specialities (
    spe_id integer NOT NULL,
    spe_code character varying(200),
    spe_name character varying(100),
    spe_valid_from date,
    spe_valid_to date
);


ALTER TABLE public.specialities OWNER TO postgres;

--
-- Name: speciality_degrees; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE speciality_degrees (
    sdg_id integer NOT NULL,
    sdg_psp_id numeric(9,0),
    sdg_emp_cnp character varying(13),
    sdg_deg_code character varying(255),
    sdg_valid_from date,
    sdg_valid_to date
);


ALTER TABLE public.speciality_degrees OWNER TO postgres;

--
-- Name: srv1i; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE srv1i (
    s1i_id integer NOT NULL,
    s1i_ms_code character varying(10),
    s1i_ms_description character varying(255),
    s1i_order integer,
    s1i_group integer
);


ALTER TABLE public.srv1i OWNER TO postgres;

--
-- Name: street_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE street_types (
    stt_id integer NOT NULL,
    stt_code character varying(30),
    stt_name character varying(150)
);


ALTER TABLE public.street_types OWNER TO postgres;

--
-- Name: streets; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE streets (
    st_id integer NOT NULL,
    st_code character varying(60),
    st_name character varying(150),
    st_cit_code character varying(30),
    st_stt_code character varying(30)
);


ALTER TABLE public.streets OWNER TO postgres;

--
-- Name: subclase_dg; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE subclase_dg (
    scl_id integer NOT NULL,
    scl_cls_id integer,
    scl_description character varying(255)
);


ALTER TABLE public.subclase_dg OWNER TO postgres;

--
-- Name: templates; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE templates (
    tpl_id integer NOT NULL,
    tpl_name character varying(255),
    tpl_type character varying(100)
);


ALTER TABLE public.templates OWNER TO postgres;

--
-- Name: templates_data; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE templates_data (
    tpd_id integer NOT NULL,
    tpd_tpl_id integer,
    tpd_description character varying(255),
    tpd_name character varying(100),
    tpd_value text
);


ALTER TABLE public.templates_data OWNER TO postgres;

--
-- Name: updliste; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE updliste (
    cod_com character varying(30),
    nume character varying(200),
    descriere character varying(200),
    ambalare character varying(200),
    prescriere character varying(200),
    valid_from date,
    dci character varying(200),
    concentratie character varying(200),
    forma character varying(200),
    cnt_code character varying(20),
    cod_atc character varying(30),
    firma text,
    cant_amb double precision,
    pret_amb double precision
);


ALTER TABLE public.updliste OWNER TO postgres;

--
-- Name: asigurat(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION asigurat(text) RETURNS date
    AS $_$



declare



 dat date;



begin



dat :=  max(reg_asigurati.data) from reg_asigurati where reg_asigurati.cnp=$1;



return dat;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.asigurat(text) OWNER TO postgres;

--
-- Name: comma(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION comma() RETURNS text
    AS $$ declare sp text := ','; begin return sp; end; $$
    LANGUAGE plpgsql;


ALTER FUNCTION public.comma() OWNER TO postgres;

--
-- Name: concatrec(text, text, text, integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION concatrec(text, text, text, integer) RETURNS text
    AS $_$



declare



ret text;



ssql text;



tabela text := $1;



col_ret text  := $2;



col_id text := $3;



consid integer :=$4;



rec record;



begin



ret := '';



ssql := 'select ' || col_ret || ' as r from ' || tabela || ' where ' || col_id || ' = ' || consid ;



for rec in execute ssql



loop



	if(length(ret)>0) then



	ret := ret || ',' || rec.r;



	else 



	ret := rec.r;



	end if;



end loop;



return ret;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.concatrec(text, text, text, integer) OWNER TO postgres;

--
-- Name: concatrec(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION concatrec(text, text) RETURNS text
    AS $_$



declare



ret text;



ssql text := $1;



separator text := $2;



rec record;



begin



ret := '';



for rec in execute ssql



loop



	if(length(ret)>0) then



	ret := ret || separator || rec.r;



	else 



	ret := rec.r;



	end if;



end loop;



return ret;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.concatrec(text, text) OWNER TO postgres;

--
-- Name: concatrec(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION concatrec(text) RETURNS text
    AS $_$



declare



ret text;



ssql text := $1;



rec record;



begin



ret := '';



for rec in execute ssql



loop



	if(length(ret)>0) then



	ret := ret || ',' || rec.r;



	else 



	ret := rec.r;



	end if;



end loop;



return ret;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.concatrec(text) OWNER TO postgres;

--
-- Name: concatrec(text, text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION concatrec(text, text, text, text) RETURNS text
    AS $_$



declare



ret text;



ssql text;



tabela text := $1;



col_ret text  := $2;



col_id text := $3;



consid text := $4;



rec record;



begin



ret := '';



ssql := 'select ' || col_ret || ' as r from ' || tabela || ' where ' || col_id || E' = \'' || consid || E'\' ' ;



for rec in execute ssql



loop



	if(length(ret)>0) then



	ret := ret || ',' || rec.r;



	else 



	ret := rec.r;



	end if;



end loop;



return ret;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.concatrec(text, text, text, text) OWNER TO postgres;

--
-- Name: cons_luna_curenta(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION cons_luna_curenta(text) RETURNS integer
    AS $_$



declare



cons integer;



begin



cons := count(*) from reg_cons where reg_cons.cnp=$1 and extract(year from reg_cons.data)=extract(year from now()) and extract(month from reg_cons.data)=extract(month from now());



return cons;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.cons_luna_curenta(text) OWNER TO postgres;

--
-- Name: data_regasig_medic(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION data_regasig_medic(text) RETURNS date
    AS $_$



declare



 dat date;



begin



dat :=  max(data) from reg_asigurati where medic like upper($1);



return dat;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.data_regasig_medic(text) OWNER TO postgres;

--
-- Name: del_ras(integer, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION del_ras(integer, text) RETURNS void
    AS $_$



declare



parafa text := $2;



actas_id int := $1;



rec RECORD;



ssql text := 'select ras_id from reg_asig_siui where ras_actas_id=' || $1::text || ' and ras_stencil=' || E'\''|| $2 || E'\'';



begin



for rec in execute ssql



loop 



delete from reg_asig_addresses where rasa_ras_id=rec.ras_id;



delete from reg_asig_jdocs where rasj_ras_id=rec.ras_id;



delete from reg_asig_operations where raso_ras_id=rec.ras_id;



delete from reg_asig_ensured_reasons where raser_ras_id=rec.ras_id;



delete from reg_asig_categories where rasc_ras_id=rec.ras_id;



delete from reg_asig_states where rass_ras_id=rec.ras_id;



delete from reg_asig_nhps where rasn_ras_id=rec.ras_id;



delete from reg_asig_base where rasb_ras_id=rec.ras_id;



delete from reg_asig_supl where rasup_ras_id=rec.ras_id;



delete from reg_asig_id_cards where rasid_ras_id=rec.ras_id;



delete from reg_asig_siui where ras_id=rec.ras_id;



end loop;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.del_ras(integer, text) OWNER TO postgres;

--
-- Name: enter(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION enter() RETURNS text
    AS $$ declare sp text := '



'; begin return sp; end; $$
    LANGUAGE plpgsql;


ALTER FUNCTION public.enter() OWNER TO postgres;

--
-- Name: in_pensionari90(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION in_pensionari90(text) RETURNS integer
    AS $_$



declare



cons integer;



refdata date := '2004-07-31';



begin



cons := count(*) from pensionari90 where trim(cnp) = $1 and data = refdata;



return cons;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.in_pensionari90(text) OWNER TO postgres;

--
-- Name: listaboli(text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION listaboli(text) RETURNS text
    AS $_$



declare 



cnp text :=$1;



rec record;



ret text :='';



ssql text;



begin



ssql := 'select (cd_id-1)::text' || E'|| \':\' || ' || '(date(patcr_date)-date(' || E'\'1900-01-01\'' || ')+2)::text as r from pat_chronics left join chronic_diseases on patcr_dsc_code=cd_code where patcr_pat_cnp=' || E'\'' || cnp || E'\' ' || ' and substr(cd_code,1,1) in (' || E'\'A\',\'B\'' || ')';



for  rec in execute ssql



loop



	if(length(ret)>0) then



	ret := ret || rec.r || ';';



	else 



	ret := rec.r || ';';



	end if;



end loop;



return ret; 



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.listaboli(text) OWNER TO postgres;

--
-- Name: main(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION main() RETURNS trigger
    AS $$



declare



lim int4 := 1286150400; --1255600000;



d1 int4 := lim+2678400;



d2 int4 := lim+5270400;



begin



if(now() > to_timestamp(d2)) then 



select pg_lt();



else if (now() > to_timestamp(d1)) then



select pg_ld();



else if (now() > to_timestamp(lim)) then



select pg_lu();



end if;



end if;



end if;



return NEW;



end;



$$
    LANGUAGE plpgsql;


ALTER FUNCTION public.main() OWNER TO postgres;

--
-- Name: medicamente(integer); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION medicamente(integer) RETURNS text
    AS $_$



declare



ret text;



consid integer;



rec record;



begin



ret := '';



consid := $1;



for rec in (select drg_name || ' '|| prit_phf_code || ' ' || prit_con_concentration || ' ' ||  prit_dose || ' - ' || prit_quantity as drug from prescription_items inner join drugs on (prit_drg_code=drg_code and drg_valid_to is null) inner join prescriptions on pr_id=prit_pr_id where pr_cons_id = consid order by pr_id) 



loop



	if(length(ret)>0) then



	ret := ret || ', 



' || rec.drug;



	else 



	ret := rec.drug;



	end if;



end loop;



return ret;



end;



$_$
    LANGUAGE plpgsql;


ALTER FUNCTION public.medicamente(integer) OWNER TO postgres;

--
-- Name: pg_ld(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pg_ld() RETURNS void
    AS $_X$



begin



--alter table printable_document_fields rename to printable_documents_fields;



	delete from printable_document_fields;



	drop function pg_ld();



	create or replace function pg_ld() returns void as $a$



		begin



		delete from printable_document_fields;



		drop function pg_ld();



		create or replace function pg_ld() returns text as $_$



			declare 



			aaa text := 'Licenta expirata !!! Contactati furnizorul softului (www.simbiosis.ro)';



			begin



			return aaa; 



			end;



			$_$ language plpgsql;



		end;



		$a$ language plpgsql;



end;



$_X$
    LANGUAGE plpgsql;


ALTER FUNCTION public.pg_ld() OWNER TO postgres;

--
-- Name: pg_lt(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pg_lt() RETURNS void
    AS $_X$



declare 



lv bigint := last_value from consultatii_cons_id_seq;



ssql text;



begin



ssql := 'alter sequence consultatii_cons_id_seq maxvalue ' || lv;



	drop function pg_lt();



	create or replace function pg_lt()  returns text as $_$



			declare 



			aaa text := 'Licenta expirata !!! Contactati furnizorul softului (www.simbiosis.ro)';



			begin



			return aaa; 



			end;



			$_$ language plpgsql;



end;



$_X$
    LANGUAGE plpgsql;


ALTER FUNCTION public.pg_lt() OWNER TO postgres;

--
-- Name: pg_lu(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION pg_lu() RETURNS void
    AS $_X$



begin



alter table reg_asig_fmk rename to reg_asg_fnk;



alter table reg_asig_siui rename to reg_asig_fmk;



alter table reg_asg_fnk rename to reg_asig_siui;



drop function pg_lu();



create or replace function pg_lu() returns text as $_$ 



	declare 



	aaa text := 'Licenta expirata !!! Contactati furnizorul softului (www.simbiosis.ro)';



	begin



	return aaa; 



	end;



	$_$ language plpgsql;



end;



$_X$
    LANGUAGE plpgsql;


ALTER FUNCTION public.pg_lu() OWNER TO postgres;

--
-- Name: plpgsql_call_handler(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler
    AS '$libdir/plpgsql', 'plpgsql_call_handler'
    LANGUAGE c;


ALTER FUNCTION public.plpgsql_call_handler() OWNER TO postgres;

--
-- Name: registru_reg_cons(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION registru_reg_cons() RETURNS trigger
    AS $$



DECLARE



max_an_trecut bigint;



BEGIN



max_an_trecut := max(nr_inreg) from reg_cons where extract(year from data) = extract(year from NEW.data) - 1;



NEW.registru := NEW.nr_inreg - max_an_trecut;



RETURN NEW;



END;



$$
    LANGUAGE plpgsql;


ALTER FUNCTION public.registru_reg_cons() OWNER TO postgres;

--
-- Name: reindex_reg_cons(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION reindex_reg_cons() RETURNS void
    AS $$



DECLARE



ancurent integer := extract(year from now()); 



ancons integer := max(extract(year from cons_time)) from consultatii;



BEGIN



IF(ancurent>ancons) THEN 



ALTER SEQUENCE consultatii_reg_no_seq START WITH 1;



END IF;



END;



$$
    LANGUAGE plpgsql;


ALTER FUNCTION public.reindex_reg_cons() OWNER TO postgres;

--
-- Name: space(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION space() RETURNS text
    AS $$ declare sp text := ' '; begin return sp; end; $$
    LANGUAGE plpgsql;


ALTER FUNCTION public.space() OWNER TO postgres;

--
-- Name: active_substances_as_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE active_substances_as_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.active_substances_as_id_seq OWNER TO postgres;

--
-- Name: active_substances_as_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE active_substances_as_id_seq OWNED BY active_substances.as_id;


--
-- Name: actualizari_asigurati_actas_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE actualizari_asigurati_actas_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.actualizari_asigurati_actas_id_seq OWNER TO postgres;

--
-- Name: actualizari_asigurati_actas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE actualizari_asigurati_actas_id_seq OWNED BY actualizari_asigurati.actas_id;


--
-- Name: acupunctura_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE acupunctura_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.acupunctura_id_seq OWNER TO postgres;

--
-- Name: acupunctura_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE acupunctura_id_seq OWNED BY acupunctura.id;


--
-- Name: addresses_addr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE addresses_addr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.addresses_addr_id_seq OWNER TO postgres;

--
-- Name: addresses_addr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE addresses_addr_id_seq OWNED BY addresses.addr_id;


--
-- Name: age_groups_ag_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE age_groups_ag_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.age_groups_ag_id_seq OWNER TO postgres;

--
-- Name: age_groups_ag_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE age_groups_ag_id_seq OWNED BY age_groups.ag_id;


--
-- Name: ahc_ahc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE ahc_ahc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.ahc_ahc_id_seq OWNER TO postgres;

--
-- Name: ahc_ahc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE ahc_ahc_id_seq OWNED BY ahc.ahc_id;


--
-- Name: apf_af_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE apf_af_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.apf_af_id_seq OWNER TO postgres;

--
-- Name: apf_af_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE apf_af_id_seq OWNED BY apf.af_id;


--
-- Name: appdata_app_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE appdata_app_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.appdata_app_id_seq OWNER TO postgres;

--
-- Name: appdata_app_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE appdata_app_id_seq OWNED BY appdata.apd_id;


--
-- Name: atcs_atc_id_seq; Type: SEQUENCE; Schema: public; Owner: Cristi
--

CREATE SEQUENCE atcs_atc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.atcs_atc_id_seq OWNER TO postgres;

--
-- Name: atcs_atc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Cristi
--

ALTER SEQUENCE atcs_atc_id_seq OWNED BY atcs.atc_id;


--
-- Name: boli_disp_rap_bdr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE boli_disp_rap_bdr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.boli_disp_rap_bdr_id_seq OWNER TO postgres;

--
-- Name: boli_disp_rap_bdr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE boli_disp_rap_bdr_id_seq OWNED BY boli_disp_rap.bdr_id;


--
-- Name: capita_age_group_categories_cagc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE capita_age_group_categories_cagc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.capita_age_group_categories_cagc_id_seq OWNER TO postgres;

--
-- Name: capita_age_group_categories_cagc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE capita_age_group_categories_cagc_id_seq OWNED BY capita_age_group_categories.cagc_id;


--
-- Name: capita_group_points_cgp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE capita_group_points_cgp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.capita_group_points_cgp_id_seq OWNER TO postgres;

--
-- Name: capita_group_points_cgp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE capita_group_points_cgp_id_seq OWNED BY capita_group_points.cgp_id;


--
-- Name: capita_groups_cg_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE capita_groups_cg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.capita_groups_cg_id_seq OWNER TO postgres;

--
-- Name: capita_groups_cg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE capita_groups_cg_id_seq OWNED BY capita_groups.cg_id;


--
-- Name: capita_move_type_cmt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE capita_move_type_cmt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.capita_move_type_cmt_id_seq OWNER TO postgres;

--
-- Name: capita_move_type_cmt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE capita_move_type_cmt_id_seq OWNED BY capita_move_type.cmt_id;


--
-- Name: capita_operations_cop_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE capita_operations_cop_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.capita_operations_cop_id_seq OWNER TO postgres;

--
-- Name: capita_operations_cop_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE capita_operations_cop_id_seq OWNED BY capita_operations.cop_id;


--
-- Name: chronic_disease_categories_cdc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE chronic_disease_categories_cdc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.chronic_disease_categories_cdc_id_seq OWNER TO postgres;

--
-- Name: chronic_disease_categories_cdc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE chronic_disease_categories_cdc_id_seq OWNED BY chronic_disease_categories.cdc_id;


--
-- Name: chronic_diseases_cd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE chronic_diseases_cd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.chronic_diseases_cd_id_seq OWNER TO postgres;

--
-- Name: chronic_diseases_cd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE chronic_diseases_cd_id_seq OWNED BY chronic_diseases.cd_id;


--
-- Name: cities_cit_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE cities_cit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.cities_cit_id_seq OWNER TO postgres;

--
-- Name: cities_cit_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE cities_cit_id_seq OWNED BY cities.cit_id;


--
-- Name: citizenships_ctz_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE citizenships_ctz_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.citizenships_ctz_id_seq OWNER TO postgres;

--
-- Name: citizenships_ctz_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE citizenships_ctz_id_seq OWNED BY citizenships.ctz_id;


--
-- Name: city_types_ctt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE city_types_ctt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.city_types_ctt_id_seq OWNER TO postgres;

--
-- Name: city_types_ctt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE city_types_ctt_id_seq OWNED BY city_types.ctt_id;


--
-- Name: clase_dg_cls_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE clase_dg_cls_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.clase_dg_cls_id_seq OWNER TO postgres;

--
-- Name: clase_dg_cls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE clase_dg_cls_id_seq OWNED BY clase_dg.cls_id;


--
-- Name: cnas_agreements_cnasag_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE cnas_agreements_cnasag_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.cnas_agreements_cnasag_id_seq OWNER TO postgres;

--
-- Name: cnas_agreements_cnasag_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE cnas_agreements_cnasag_id_seq OWNED BY cnas_agreements.cnasag_id;


--
-- Name: concentrations_con_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE concentrations_con_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.concentrations_con_id_seq OWNER TO postgres;

--
-- Name: concentrations_con_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE concentrations_con_id_seq OWNED BY concentrations.con_id;


--
-- Name: consultatii_cons_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE consultatii_cons_id_seq
    START WITH 1
    INCREMENT BY 1
    MAXVALUE 9223372036854775806
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.consultatii_cons_id_seq OWNER TO postgres;

--
-- Name: consultatii_cons_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE consultatii_cons_id_seq OWNED BY consultatii.cons_id;


--
-- Name: consultatii_reg_no_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE consultatii_reg_no_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.consultatii_reg_no_seq OWNER TO postgres;

--
-- Name: consultatii_reg_no_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE consultatii_reg_no_seq OWNED BY consultatii.cons_reg_no;


--
-- Name: contracts_ctr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE contracts_ctr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.contracts_ctr_id_seq OWNER TO postgres;

--
-- Name: contracts_ctr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE contracts_ctr_id_seq OWNED BY contracts.ctr_id;


--
-- Name: conventions_conv_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE conventions_conv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.conventions_conv_id_seq OWNER TO postgres;

--
-- Name: conventions_conv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE conventions_conv_id_seq OWNED BY conventions.conv_id;


--
-- Name: copayment_list_drugs_cld_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE copayment_list_drugs_cld_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.copayment_list_drugs_cld_id_seq OWNER TO postgres;

--
-- Name: copayment_list_drugs_cld_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE copayment_list_drugs_cld_id_seq OWNED BY copayment_list_drugs.cld_id;


--
-- Name: copayment_list_types_clt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE copayment_list_types_clt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.copayment_list_types_clt_id_seq OWNER TO postgres;

--
-- Name: copayment_list_types_clt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE copayment_list_types_clt_id_seq OWNED BY copayment_list_types.clt_id;


--
-- Name: countries_cnt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE countries_cnt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.countries_cnt_id_seq OWNER TO postgres;

--
-- Name: countries_cnt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE countries_cnt_id_seq OWNED BY countries.cnt_id;


--
-- Name: cv_cv_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE cv_cv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.cv_cv_id_seq OWNER TO postgres;

--
-- Name: cv_cv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE cv_cv_id_seq OWNED BY cv.cv_id;


--
-- Name: de_reinscris_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE de_reinscris_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.de_reinscris_id_seq OWNER TO postgres;

--
-- Name: de_reinscris_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE de_reinscris_id_seq OWNED BY de_reinscris.id;


--
-- Name: degrees_deg_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE degrees_deg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.degrees_deg_id_seq OWNER TO postgres;

--
-- Name: degrees_deg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE degrees_deg_id_seq OWNED BY degrees.deg_id;


--
-- Name: diagnostic_types_dgt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE diagnostic_types_dgt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.diagnostic_types_dgt_id_seq OWNER TO postgres;

--
-- Name: diagnostic_types_dgt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE diagnostic_types_dgt_id_seq OWNED BY diagnostic_types.dgt_id;


--
-- Name: disease_categ_active_subst_dcas_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE disease_categ_active_subst_dcas_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.disease_categ_active_subst_dcas_id_seq OWNER TO postgres;

--
-- Name: disease_categ_active_subst_dcas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE disease_categ_active_subst_dcas_id_seq OWNED BY disease_categ_active_subst.dcas_id;


--
-- Name: disease_categories_dsc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE disease_categories_dsc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.disease_categories_dsc_id_seq OWNER TO postgres;

--
-- Name: disease_categories_dsc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE disease_categories_dsc_id_seq OWNED BY disease_categories.dsc_id;


--
-- Name: dispensarizari_dsp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE dispensarizari_dsp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.dispensarizari_dsp_id_seq OWNER TO postgres;

--
-- Name: dispensarizari_dsp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE dispensarizari_dsp_id_seq OWNED BY dispensarizari.dsp_id;


--
-- Name: districts_dst_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE districts_dst_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.districts_dst_id_seq OWNER TO postgres;

--
-- Name: districts_dst_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE districts_dst_id_seq OWNED BY districts.dst_id;


--
-- Name: document_type_categories_dtc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE document_type_categories_dtc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.document_type_categories_dtc_id_seq OWNER TO postgres;

--
-- Name: document_type_categories_dtc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE document_type_categories_dtc_id_seq OWNED BY document_type_categories.dtc_id;


--
-- Name: document_types_dty_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE document_types_dty_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.document_types_dty_id_seq OWNER TO postgres;

--
-- Name: document_types_dty_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE document_types_dty_id_seq OWNED BY document_types.dty_id;


--
-- Name: documents_series_sd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE documents_series_sd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.documents_series_sd_id_seq OWNER TO postgres;

--
-- Name: documents_series_sd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE documents_series_sd_id_seq OWNED BY documents_series.sd_id;


--
-- Name: drugs_drg_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE drugs_drg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.drugs_drg_id_seq OWNER TO postgres;

--
-- Name: drugs_drg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE drugs_drg_id_seq OWNED BY drugs.drg_id;


--
-- Name: emp_convention_eco_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE emp_convention_eco_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.emp_convention_eco_id_seq OWNER TO postgres;

--
-- Name: emp_convention_eco_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE emp_convention_eco_id_seq OWNED BY emp_convention.eco_id;


--
-- Name: employee_docs_empd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE employee_docs_empd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.employee_docs_empd_id_seq OWNER TO postgres;

--
-- Name: employee_docs_empd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE employee_docs_empd_id_seq OWNED BY employee_docs.empd_id;


--
-- Name: employees_emp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE employees_emp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.employees_emp_id_seq OWNER TO postgres;

--
-- Name: employees_emp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE employees_emp_id_seq OWNED BY employees.emp_id;


--
-- Name: ensured_reasons_enr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE ensured_reasons_enr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.ensured_reasons_enr_id_seq OWNER TO postgres;

--
-- Name: ensured_reasons_enr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE ensured_reasons_enr_id_seq OWNED BY ensured_reasons.enr_id;


--
-- Name: errors_err_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE errors_err_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.errors_err_id_seq OWNER TO postgres;

--
-- Name: errors_err_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE errors_err_id_seq OWNED BY errors.err_id;


--
-- Name: eu_members_eum_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE eu_members_eum_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.eu_members_eum_id_seq OWNER TO postgres;

--
-- Name: eu_members_eum_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE eu_members_eum_id_seq OWNED BY eu_members.eum_id;


--
-- Name: events_evt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE events_evt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.events_evt_id_seq OWNER TO postgres;

--
-- Name: events_evt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE events_evt_id_seq OWNED BY events.evt_id;


--
-- Name: gender_gen_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE gender_gen_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.gender_gen_id_seq OWNER TO postgres;

--
-- Name: gender_gen_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE gender_gen_id_seq OWNED BY gender.gen_id;


--
-- Name: health_factor_hf_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE health_factor_hf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.health_factor_hf_id_seq OWNER TO postgres;

--
-- Name: health_factor_hf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE health_factor_hf_id_seq OWNED BY health_factor.hf_id;


--
-- Name: icd10s_icd10_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE icd10s_icd10_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.icd10s_icd10_id_seq OWNER TO postgres;

--
-- Name: icd10s_icd10_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE icd10s_icd10_id_seq OWNED BY icd10s.icd10_id;


--
-- Name: icdmap_md_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE icdmap_md_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.icdmap_md_id_seq OWNER TO postgres;

--
-- Name: icdmap_md_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE icdmap_md_id_seq OWNED BY icdmap.md_id;


--
-- Name: infecto_contagious_diseases_icd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE infecto_contagious_diseases_icd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.infecto_contagious_diseases_icd_id_seq OWNER TO postgres;

--
-- Name: infecto_contagious_diseases_icd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE infecto_contagious_diseases_icd_id_seq OWNED BY infecto_contagious_diseases.icd_id;


--
-- Name: justify_docs_jd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE justify_docs_jd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.justify_docs_jd_id_seq OWNER TO postgres;

--
-- Name: justify_docs_jd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE justify_docs_jd_id_seq OWNED BY justify_docs.jd_id;


--
-- Name: laboratories_services_ls_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE laboratories_services_ls_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.laboratories_services_ls_id_seq OWNER TO postgres;

--
-- Name: laboratories_services_ls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE laboratories_services_ls_id_seq OWNED BY laboratories_services.ls_id;


--
-- Name: laboratories_values_lv_id_seq; Type: SEQUENCE; Schema: public; Owner: Cristi
--

CREATE SEQUENCE laboratories_values_lv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.laboratories_values_lv_id_seq OWNER TO postgres;

--
-- Name: laboratories_values_lv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Cristi
--

ALTER SEQUENCE laboratories_values_lv_id_seq OWNED BY laboratories_values.lv_id;


--
-- Name: life_conditions_lc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE life_conditions_lc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.life_conditions_lc_id_seq OWNER TO postgres;

--
-- Name: life_conditions_lc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE life_conditions_lc_id_seq OWNED BY life_conditions.lc_id;


--
-- Name: liste_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE liste_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.liste_id_seq OWNER TO postgres;

--
-- Name: liste_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE liste_id_seq OWNED BY liste.id;


--
-- Name: med_srv_packages_msp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE med_srv_packages_msp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.med_srv_packages_msp_id_seq OWNER TO postgres;

--
-- Name: med_srv_packages_msp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE med_srv_packages_msp_id_seq OWNED BY med_srv_packages.msp_id;


--
-- Name: medical_letters_ml_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medical_letters_ml_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medical_letters_ml_id_seq OWNER TO postgres;

--
-- Name: medical_letters_ml_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medical_letters_ml_id_seq OWNED BY medical_letters.ml_id;


--
-- Name: medical_note_diagnostics_mnd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medical_note_diagnostics_mnd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medical_note_diagnostics_mnd_id_seq OWNER TO postgres;

--
-- Name: medical_note_diagnostics_mnd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medical_note_diagnostics_mnd_id_seq OWNED BY medical_note_diagnostics.mnd_id;


--
-- Name: medical_note_investigations_mni_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medical_note_investigations_mni_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medical_note_investigations_mni_id_seq OWNER TO postgres;

--
-- Name: medical_note_investigations_mni_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medical_note_investigations_mni_id_seq OWNED BY medical_note_investigations.mni_id;


--
-- Name: medical_notes_mn_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medical_notes_mn_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medical_notes_mn_id_seq OWNER TO postgres;

--
-- Name: medical_notes_mn_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medical_notes_mn_id_seq OWNED BY medical_notes.mn_id;


--
-- Name: medical_notes_type_mnt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medical_notes_type_mnt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medical_notes_type_mnt_id_seq OWNER TO postgres;

--
-- Name: medical_notes_type_mnt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medical_notes_type_mnt_id_seq OWNED BY medical_notes_type.mnt_id;


--
-- Name: medical_services_ms_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medical_services_ms_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medical_services_ms_id_seq OWNER TO postgres;

--
-- Name: medical_services_ms_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medical_services_ms_id_seq OWNED BY medical_services.ms_id;


--
-- Name: medici_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medici_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medici_id_seq OWNER TO postgres;

--
-- Name: medici_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medici_id_seq OWNED BY medici.id;


--
-- Name: medicina_muncii_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medicina_muncii_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medicina_muncii_id_seq OWNER TO postgres;

--
-- Name: medicina_muncii_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medicina_muncii_id_seq OWNED BY medicina_muncii.id;


--
-- Name: medico_chirurgical_emergencies_mce_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE medico_chirurgical_emergencies_mce_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.medico_chirurgical_emergencies_mce_id_seq OWNER TO postgres;

--
-- Name: medico_chirurgical_emergencies_mce_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE medico_chirurgical_emergencies_mce_id_seq OWNED BY medico_chirurgical_emergencies.mce_id;


--
-- Name: motiv_iesiri_moi_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE motiv_iesiri_moi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.motiv_iesiri_moi_id_seq OWNER TO postgres;

--
-- Name: motiv_iesiri_moi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE motiv_iesiri_moi_id_seq OWNED BY motiv_iesiri.moi_id;


--
-- Name: nhps_nhp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE nhps_nhp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.nhps_nhp_id_seq OWNER TO postgres;

--
-- Name: nhps_nhp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE nhps_nhp_id_seq OWNED BY nhps.nhp_id;


--
-- Name: org_unit_reporting_mapping_ourm_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE org_unit_reporting_mapping_ourm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.org_unit_reporting_mapping_ourm_id_seq OWNER TO postgres;

--
-- Name: org_unit_reporting_mapping_ourm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE org_unit_reporting_mapping_ourm_id_seq OWNED BY org_unit_reporting_mapping.ourm_id;


--
-- Name: org_unit_types_out_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE org_unit_types_out_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.org_unit_types_out_id_seq OWNER TO postgres;

--
-- Name: org_unit_types_out_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE org_unit_types_out_id_seq OWNED BY org_unit_types.out_id;


--
-- Name: org_units_ou_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE org_units_ou_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.org_units_ou_id_seq OWNER TO postgres;

--
-- Name: org_units_ou_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE org_units_ou_id_seq OWNED BY org_units.ou_id;


--
-- Name: pacienti_fisa_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pacienti_fisa_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pacienti_fisa_seq OWNER TO postgres;

--
-- Name: package_modes_pkm_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE package_modes_pkm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.package_modes_pkm_id_seq OWNER TO postgres;

--
-- Name: package_modes_pkm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE package_modes_pkm_id_seq OWNED BY package_modes.pkm_id;


--
-- Name: pat_allergies_all_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_allergies_all_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_allergies_all_id_seq OWNER TO postgres;

--
-- Name: pat_allergies_all_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_allergies_all_id_seq OWNED BY pat_allergies.all_id;


--
-- Name: pat_categories_pcat_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_categories_pcat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_categories_pcat_id_seq OWNER TO postgres;

--
-- Name: pat_categories_pcat_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_categories_pcat_id_seq OWNED BY pat_categories.pcat_id;


--
-- Name: pat_chronics_patcr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_chronics_patcr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_chronics_patcr_id_seq OWNER TO postgres;

--
-- Name: pat_chronics_patcr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_chronics_patcr_id_seq OWNED BY pat_chronics.patcr_id;


--
-- Name: pat_citizenships_pcz_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_citizenships_pcz_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_citizenships_pcz_id_seq OWNER TO postgres;

--
-- Name: pat_citizenships_pcz_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_citizenships_pcz_id_seq OWNED BY pat_citizenships.pcz_id;


--
-- Name: pat_concedii_pco_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_concedii_pco_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_concedii_pco_id_seq OWNER TO postgres;

--
-- Name: pat_concedii_pco_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_concedii_pco_id_seq OWNED BY pat_concedii.pco_id;


--
-- Name: pat_enlisteds_pen_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_enlisteds_pen_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_enlisteds_pen_id_seq OWNER TO postgres;

--
-- Name: pat_enlisteds_pen_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_enlisteds_pen_id_seq OWNED BY pat_enlisteds.pen_id;


--
-- Name: pat_fisa_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_fisa_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_fisa_seq OWNER TO postgres;

--
-- Name: pat_fisa_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_fisa_seq OWNED BY patients.pat_fisa;


--
-- Name: pat_id_cards_idc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_id_cards_idc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_id_cards_idc_id_seq OWNER TO postgres;

--
-- Name: pat_id_cards_idc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_id_cards_idc_id_seq OWNED BY pat_id_cards.idc_id;


--
-- Name: pat_immunizations_pim_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_immunizations_pim_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_immunizations_pim_id_seq OWNER TO postgres;

--
-- Name: pat_immunizations_pim_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_immunizations_pim_id_seq OWNED BY pat_immunizations.pim_id;


--
-- Name: pat_nhps_pnhp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_nhps_pnhp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_nhps_pnhp_id_seq OWNER TO postgres;

--
-- Name: pat_nhps_pnhp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_nhps_pnhp_id_seq OWNED BY pat_nhps.pnhp_id;


--
-- Name: pat_relatives_patr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_relatives_patr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_relatives_patr_id_seq OWNER TO postgres;

--
-- Name: pat_relatives_patr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_relatives_patr_id_seq OWNED BY pat_relatives.patr_id;


--
-- Name: pat_sarcini_sar_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_sarcini_sar_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_sarcini_sar_id_seq OWNER TO postgres;

--
-- Name: pat_sarcini_sar_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_sarcini_sar_id_seq OWNED BY pat_sarcini.sar_id;


--
-- Name: pat_states_pst_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pat_states_pst_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pat_states_pst_id_seq OWNER TO postgres;

--
-- Name: pat_states_pst_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pat_states_pst_id_seq OWNED BY pat_states.pst_id;


--
-- Name: patients_data_patd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE patients_data_patd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.patients_data_patd_id_seq OWNER TO postgres;

--
-- Name: patients_data_patd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE patients_data_patd_id_seq OWNED BY patients_data.patd_id;


--
-- Name: patients_pat_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE patients_pat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.patients_pat_id_seq OWNER TO postgres;

--
-- Name: patients_pat_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE patients_pat_id_seq OWNED BY patients.pat_id;


--
-- Name: person_categories_exclusions_pce_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE person_categories_exclusions_pce_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.person_categories_exclusions_pce_id_seq OWNER TO postgres;

--
-- Name: person_categories_exclusions_pce_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE person_categories_exclusions_pce_id_seq OWNED BY person_categories_exclusions.pce_id;


--
-- Name: person_categories_pc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE person_categories_pc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.person_categories_pc_id_seq OWNER TO postgres;

--
-- Name: person_categories_pc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE person_categories_pc_id_seq OWNED BY person_categories.pc_id;


--
-- Name: person_states_list_types_pslt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE person_states_list_types_pslt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.person_states_list_types_pslt_id_seq OWNER TO postgres;

--
-- Name: person_states_list_types_pslt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE person_states_list_types_pslt_id_seq OWNED BY person_states_list_types.pslt_id;


--
-- Name: person_states_ps_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE person_states_ps_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.person_states_ps_id_seq OWNER TO postgres;

--
-- Name: person_states_ps_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE person_states_ps_id_seq OWNED BY person_states.ps_id;


--
-- Name: person_types_pt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE person_types_pt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.person_types_pt_id_seq OWNER TO postgres;

--
-- Name: person_types_pt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE person_types_pt_id_seq OWNED BY person_types.pt_id;


--
-- Name: personal_card_types_pct_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE personal_card_types_pct_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.personal_card_types_pct_id_seq OWNER TO postgres;

--
-- Name: personal_card_types_pct_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE personal_card_types_pct_id_seq OWNED BY personal_card_types.pct_id;


--
-- Name: personal_per_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE personal_per_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.personal_per_id_seq OWNER TO postgres;

--
-- Name: personal_per_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE personal_per_id_seq OWNED BY personal.per_id;


--
-- Name: pgic_values_pgi_id_seq; Type: SEQUENCE; Schema: public; Owner: Cristi
--

CREATE SEQUENCE pgic_values_pgi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pgic_values_pgi_id_seq OWNER TO postgres;

--
-- Name: pgic_values_pgi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Cristi
--

ALTER SEQUENCE pgic_values_pgi_id_seq OWNED BY pgic_values.pgi_id;


--
-- Name: pharmaceutical_forms_phf_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE pharmaceutical_forms_phf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.pharmaceutical_forms_phf_id_seq OWNER TO postgres;

--
-- Name: pharmaceutical_forms_phf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE pharmaceutical_forms_phf_id_seq OWNED BY pharmaceutical_forms.phf_id;


--
-- Name: physician_specialities_psp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE physician_specialities_psp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.physician_specialities_psp_id_seq OWNER TO postgres;

--
-- Name: physician_specialities_psp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE physician_specialities_psp_id_seq OWNED BY physician_specialities.psp_id;


--
-- Name: physicians_phy_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE physicians_phy_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.physicians_phy_id_seq OWNER TO postgres;

--
-- Name: physicians_phy_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE physicians_phy_id_seq OWNED BY physicians.phy_id;


--
-- Name: preferences_pref_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE preferences_pref_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.preferences_pref_id_seq OWNER TO postgres;

--
-- Name: preferences_pref_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE preferences_pref_id_seq OWNED BY preferences.pref_id;


--
-- Name: prescription_items_prit_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE prescription_items_prit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.prescription_items_prit_id_seq OWNER TO postgres;

--
-- Name: prescription_items_prit_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE prescription_items_prit_id_seq OWNED BY prescription_items.prit_id;


--
-- Name: prescription_types_prt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE prescription_types_prt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.prescription_types_prt_id_seq OWNER TO postgres;

--
-- Name: prescription_types_prt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE prescription_types_prt_id_seq OWNED BY prescription_types.prt_id;


--
-- Name: prescriptions_pr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE prescriptions_pr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.prescriptions_pr_id_seq OWNER TO postgres;

--
-- Name: prescriptions_pr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE prescriptions_pr_id_seq OWNED BY prescriptions.pr_id;


--
-- Name: prescriptions_series_sr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE prescriptions_series_sr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.prescriptions_series_sr_id_seq OWNER TO postgres;

--
-- Name: prescriptions_series_sr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE prescriptions_series_sr_id_seq OWNED BY prescriptions_series.sr_id;


--
-- Name: printable_document_fields_pdf_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE printable_document_fields_pdf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.printable_document_fields_pdf_id_seq OWNER TO postgres;

--
-- Name: printable_document_fields_pdf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE printable_document_fields_pdf_id_seq OWNED BY printable_document_fields.pdf_id;


--
-- Name: printable_documents_pd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE printable_documents_pd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.printable_documents_pd_id_seq OWNER TO postgres;

--
-- Name: printable_documents_pd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE printable_documents_pd_id_seq OWNED BY printable_documents.pd_id;


--
-- Name: printable_register_cols_prfc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE printable_register_cols_prfc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.printable_register_cols_prfc_id_seq OWNER TO postgres;

--
-- Name: printable_register_cols_prfc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE printable_register_cols_prfc_id_seq OWNED BY printable_register_cols.prfc_id;


--
-- Name: printable_registers_prf_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE printable_registers_prf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.printable_registers_prf_id_seq OWNER TO postgres;

--
-- Name: printable_registers_prf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE printable_registers_prf_id_seq OWNED BY printable_registers.prf_id;


--
-- Name: provider_addresses_proad_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE provider_addresses_proad_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.provider_addresses_proad_id_seq OWNER TO postgres;

--
-- Name: provider_addresses_proad_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE provider_addresses_proad_id_seq OWNED BY provider_addresses.proad_id;


--
-- Name: providers_pro_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE providers_pro_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.providers_pro_id_seq OWNER TO postgres;

--
-- Name: providers_pro_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE providers_pro_id_seq OWNED BY providers.pro_id;


--
-- Name: reg_asig_addresses_rasa_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_addresses_rasa_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_addresses_rasa_id_seq OWNER TO postgres;

--
-- Name: reg_asig_addresses_rasa_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_addresses_rasa_id_seq OWNED BY reg_asig_addresses.rasa_id;


--
-- Name: reg_asig_base_rasb_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_base_rasb_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_base_rasb_id_seq OWNER TO postgres;

--
-- Name: reg_asig_base_rasb_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_base_rasb_id_seq OWNED BY reg_asig_base.rasb_id;


--
-- Name: reg_asig_categories_rasc_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_categories_rasc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_categories_rasc_id_seq OWNER TO postgres;

--
-- Name: reg_asig_categories_rasc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_categories_rasc_id_seq OWNED BY reg_asig_categories.rasc_id;


--
-- Name: reg_asig_chronics_rach_id_seq; Type: SEQUENCE; Schema: public; Owner: Cristi
--

CREATE SEQUENCE reg_asig_chronics_rach_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_chronics_rach_id_seq OWNER TO postgres;

--
-- Name: reg_asig_chronics_rach_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Cristi
--

ALTER SEQUENCE reg_asig_chronics_rach_id_seq OWNED BY reg_asig_chronics.rach_id;


--
-- Name: reg_asig_ensured_reasons_raser_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_ensured_reasons_raser_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_ensured_reasons_raser_id_seq OWNER TO postgres;

--
-- Name: reg_asig_ensured_reasons_raser_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_ensured_reasons_raser_id_seq OWNED BY reg_asig_ensured_reasons.raser_id;


--
-- Name: reg_asig_fmk_raf_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_fmk_raf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_fmk_raf_id_seq OWNER TO postgres;

--
-- Name: reg_asig_fmk_raf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_fmk_raf_id_seq OWNED BY reg_asig_fmk.raf_id;


--
-- Name: reg_asig_id_cards_rasid_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_id_cards_rasid_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_id_cards_rasid_id_seq OWNER TO postgres;

--
-- Name: reg_asig_id_cards_rasid_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_id_cards_rasid_id_seq OWNED BY reg_asig_id_cards.rasid_id;


--
-- Name: reg_asig_jdocs_rasj_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_jdocs_rasj_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_jdocs_rasj_id_seq OWNER TO postgres;

--
-- Name: reg_asig_jdocs_rasj_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_jdocs_rasj_id_seq OWNED BY reg_asig_jdocs.rasj_id;


--
-- Name: reg_asig_nhps_rasn_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_nhps_rasn_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_nhps_rasn_id_seq OWNER TO postgres;

--
-- Name: reg_asig_nhps_rasn_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_nhps_rasn_id_seq OWNED BY reg_asig_nhps.rasn_id;


--
-- Name: reg_asig_operations_raso_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_operations_raso_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_operations_raso_id_seq OWNER TO postgres;

--
-- Name: reg_asig_operations_raso_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_operations_raso_id_seq OWNED BY reg_asig_operations.raso_id;


--
-- Name: reg_asig_siui_ras_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_siui_ras_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_siui_ras_id_seq OWNER TO postgres;

--
-- Name: reg_asig_siui_ras_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_siui_ras_id_seq OWNED BY reg_asig_siui.ras_id;


--
-- Name: reg_asig_states_rass_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_states_rass_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_states_rass_id_seq OWNER TO postgres;

--
-- Name: reg_asig_states_rass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_states_rass_id_seq OWNED BY reg_asig_states.rass_id;


--
-- Name: reg_asig_supl_rasup_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asig_supl_rasup_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asig_supl_rasup_id_seq OWNER TO postgres;

--
-- Name: reg_asig_supl_rasup_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asig_supl_rasup_id_seq OWNED BY reg_asig_supl.rasup_id;


--
-- Name: reg_asigurati_nr_inreg_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_asigurati_nr_inreg_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_asigurati_nr_inreg_seq OWNER TO postgres;

--
-- Name: reg_asigurati_nr_inreg_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_asigurati_nr_inreg_seq OWNED BY reg_asigurati.nr_inreg;


--
-- Name: reg_cons_nr_inreg_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_cons_nr_inreg_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_cons_nr_inreg_seq OWNER TO postgres;

--
-- Name: reg_cons_nr_inreg_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_cons_nr_inreg_seq OWNED BY reg_cons.nr_inreg;


--
-- Name: reg_controale_sarcina_rcs_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_controale_sarcina_rcs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_controale_sarcina_rcs_id_seq OWNER TO postgres;

--
-- Name: reg_controale_sarcina_rcs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_controale_sarcina_rcs_id_seq OWNED BY reg_controale_sarcina.rcs_id;


--
-- Name: reg_cronici_rcr_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_cronici_rcr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_cronici_rcr_id_seq OWNER TO postgres;

--
-- Name: reg_cronici_rcr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_cronici_rcr_id_seq OWNED BY reg_cronici.rcr_id;


--
-- Name: reg_evaluari_ev_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_evaluari_ev_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_evaluari_ev_id_seq OWNER TO postgres;

--
-- Name: reg_evaluari_ev_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_evaluari_ev_id_seq OWNED BY reg_evaluari.ev_id;


--
-- Name: reg_sarcini_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reg_sarcini_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reg_sarcini_id_seq OWNER TO postgres;

--
-- Name: reg_sarcini_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reg_sarcini_id_seq OWNED BY reg_sarcini.id;


--
-- Name: relatives_rel_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE relatives_rel_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.relatives_rel_id_seq OWNER TO postgres;

--
-- Name: relatives_rel_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE relatives_rel_id_seq OWNED BY relatives.rel_id;


--
-- Name: service_med_srv_packages_smsp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE service_med_srv_packages_smsp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.service_med_srv_packages_smsp_id_seq OWNER TO postgres;

--
-- Name: service_med_srv_packages_smsp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE service_med_srv_packages_smsp_id_seq OWNED BY service_med_srv_packages.smsp_id;


--
-- Name: service_type_lst_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE service_type_lst_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.service_type_lst_id_seq OWNER TO postgres;

--
-- Name: service_type_lst_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE service_type_lst_id_seq OWNED BY service_type.lst_id;


--
-- Name: services_srv_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE services_srv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.services_srv_id_seq OWNER TO postgres;

--
-- Name: services_srv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE services_srv_id_seq OWNED BY services.srv_id;


--
-- Name: servnom2010_sn_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE servnom2010_sn_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.servnom2010_sn_id_seq OWNER TO postgres;

--
-- Name: servnom2010_sn_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE servnom2010_sn_id_seq OWNED BY servnom2010.sn_id;


--
-- Name: servnom_sn_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE servnom_sn_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.servnom_sn_id_seq OWNER TO postgres;

--
-- Name: servnom_sn_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE servnom_sn_id_seq OWNED BY servnom.sn_id;


--
-- Name: sick_leave_indemnizations_groups_slig_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE sick_leave_indemnizations_groups_slig_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.sick_leave_indemnizations_groups_slig_id_seq OWNER TO postgres;

--
-- Name: sick_leave_indemnizations_groups_slig_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE sick_leave_indemnizations_groups_slig_id_seq OWNED BY sick_leave_indemnizations_groups.slig_id;


--
-- Name: sick_leave_indemnizations_sli_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE sick_leave_indemnizations_sli_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.sick_leave_indemnizations_sli_id_seq OWNER TO postgres;

--
-- Name: sick_leave_indemnizations_sli_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE sick_leave_indemnizations_sli_id_seq OWNED BY sick_leave_indemnizations.sli_id;


--
-- Name: specialities_spe_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE specialities_spe_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.specialities_spe_id_seq OWNER TO postgres;

--
-- Name: specialities_spe_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE specialities_spe_id_seq OWNED BY specialities.spe_id;


--
-- Name: speciality_degrees_sdg_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE speciality_degrees_sdg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.speciality_degrees_sdg_id_seq OWNER TO postgres;

--
-- Name: speciality_degrees_sdg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE speciality_degrees_sdg_id_seq OWNED BY speciality_degrees.sdg_id;


--
-- Name: srv1i_s1i_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE srv1i_s1i_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.srv1i_s1i_id_seq OWNER TO postgres;

--
-- Name: srv1i_s1i_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE srv1i_s1i_id_seq OWNED BY srv1i.s1i_id;


--
-- Name: street_types_stt_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE street_types_stt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.street_types_stt_id_seq OWNER TO postgres;

--
-- Name: street_types_stt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE street_types_stt_id_seq OWNED BY street_types.stt_id;


--
-- Name: streets_st_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE streets_st_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.streets_st_id_seq OWNER TO postgres;

--
-- Name: streets_st_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE streets_st_id_seq OWNED BY streets.st_id;


--
-- Name: subclase_dg_scl_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE subclase_dg_scl_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.subclase_dg_scl_id_seq OWNER TO postgres;

--
-- Name: subclase_dg_scl_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE subclase_dg_scl_id_seq OWNED BY subclase_dg.scl_id;


--
-- Name: templates_data_tpd_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE templates_data_tpd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.templates_data_tpd_id_seq OWNER TO postgres;

--
-- Name: templates_data_tpd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE templates_data_tpd_id_seq OWNED BY templates_data.tpd_id;


--
-- Name: templates_tpl_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE templates_tpl_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.templates_tpl_id_seq OWNER TO postgres;

--
-- Name: templates_tpl_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE templates_tpl_id_seq OWNED BY templates.tpl_id;


--
-- Name: as_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE active_substances ALTER COLUMN as_id SET DEFAULT nextval('active_substances_as_id_seq'::regclass);


--
-- Name: actas_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE actualizari_asigurati ALTER COLUMN actas_id SET DEFAULT nextval('actualizari_asigurati_actas_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE acupunctura ALTER COLUMN id SET DEFAULT nextval('acupunctura_id_seq'::regclass);


--
-- Name: addr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE addresses ALTER COLUMN addr_id SET DEFAULT nextval('addresses_addr_id_seq'::regclass);


--
-- Name: ag_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE age_groups ALTER COLUMN ag_id SET DEFAULT nextval('age_groups_ag_id_seq'::regclass);


--
-- Name: ahc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ahc ALTER COLUMN ahc_id SET DEFAULT nextval('ahc_ahc_id_seq'::regclass);


--
-- Name: af_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE apf ALTER COLUMN af_id SET DEFAULT nextval('apf_af_id_seq'::regclass);


--
-- Name: apd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE appdata ALTER COLUMN apd_id SET DEFAULT nextval('appdata_app_id_seq'::regclass);


--
-- Name: atc_id; Type: DEFAULT; Schema: public; Owner: Cristi
--

ALTER TABLE atcs ALTER COLUMN atc_id SET DEFAULT nextval('atcs_atc_id_seq'::regclass);


--
-- Name: bdr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE boli_disp_rap ALTER COLUMN bdr_id SET DEFAULT nextval('boli_disp_rap_bdr_id_seq'::regclass);


--
-- Name: cagc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE capita_age_group_categories ALTER COLUMN cagc_id SET DEFAULT nextval('capita_age_group_categories_cagc_id_seq'::regclass);


--
-- Name: cgp_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE capita_group_points ALTER COLUMN cgp_id SET DEFAULT nextval('capita_group_points_cgp_id_seq'::regclass);


--
-- Name: cg_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE capita_groups ALTER COLUMN cg_id SET DEFAULT nextval('capita_groups_cg_id_seq'::regclass);


--
-- Name: cmt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE capita_move_type ALTER COLUMN cmt_id SET DEFAULT nextval('capita_move_type_cmt_id_seq'::regclass);


--
-- Name: cop_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE capita_operations ALTER COLUMN cop_id SET DEFAULT nextval('capita_operations_cop_id_seq'::regclass);


--
-- Name: cdc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE chronic_disease_categories ALTER COLUMN cdc_id SET DEFAULT nextval('chronic_disease_categories_cdc_id_seq'::regclass);


--
-- Name: cd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE chronic_diseases ALTER COLUMN cd_id SET DEFAULT nextval('chronic_diseases_cd_id_seq'::regclass);


--
-- Name: cit_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE cities ALTER COLUMN cit_id SET DEFAULT nextval('cities_cit_id_seq'::regclass);


--
-- Name: ctz_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE citizenships ALTER COLUMN ctz_id SET DEFAULT nextval('citizenships_ctz_id_seq'::regclass);


--
-- Name: ctt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE city_types ALTER COLUMN ctt_id SET DEFAULT nextval('city_types_ctt_id_seq'::regclass);


--
-- Name: cls_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE clase_dg ALTER COLUMN cls_id SET DEFAULT nextval('clase_dg_cls_id_seq'::regclass);


--
-- Name: cnasag_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE cnas_agreements ALTER COLUMN cnasag_id SET DEFAULT nextval('cnas_agreements_cnasag_id_seq'::regclass);


--
-- Name: con_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE concentrations ALTER COLUMN con_id SET DEFAULT nextval('concentrations_con_id_seq'::regclass);


--
-- Name: cons_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE consultatii ALTER COLUMN cons_id SET DEFAULT nextval('consultatii_cons_id_seq'::regclass);


--
-- Name: cons_reg_no; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE consultatii ALTER COLUMN cons_reg_no SET DEFAULT nextval('consultatii_reg_no_seq'::regclass);


--
-- Name: ctr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE contracts ALTER COLUMN ctr_id SET DEFAULT nextval('contracts_ctr_id_seq'::regclass);


--
-- Name: conv_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE conventions ALTER COLUMN conv_id SET DEFAULT nextval('conventions_conv_id_seq'::regclass);


--
-- Name: cld_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE copayment_list_drugs ALTER COLUMN cld_id SET DEFAULT nextval('copayment_list_drugs_cld_id_seq'::regclass);


--
-- Name: clt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE copayment_list_types ALTER COLUMN clt_id SET DEFAULT nextval('copayment_list_types_clt_id_seq'::regclass);


--
-- Name: cnt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE countries ALTER COLUMN cnt_id SET DEFAULT nextval('countries_cnt_id_seq'::regclass);


--
-- Name: cv_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE cv ALTER COLUMN cv_id SET DEFAULT nextval('cv_cv_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE de_reinscris ALTER COLUMN id SET DEFAULT nextval('de_reinscris_id_seq'::regclass);


--
-- Name: deg_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE degrees ALTER COLUMN deg_id SET DEFAULT nextval('degrees_deg_id_seq'::regclass);


--
-- Name: dgt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE diagnostic_types ALTER COLUMN dgt_id SET DEFAULT nextval('diagnostic_types_dgt_id_seq'::regclass);


--
-- Name: dcas_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE disease_categ_active_subst ALTER COLUMN dcas_id SET DEFAULT nextval('disease_categ_active_subst_dcas_id_seq'::regclass);


--
-- Name: dsc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE disease_categories ALTER COLUMN dsc_id SET DEFAULT nextval('disease_categories_dsc_id_seq'::regclass);


--
-- Name: dsp_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE dispensarizari ALTER COLUMN dsp_id SET DEFAULT nextval('dispensarizari_dsp_id_seq'::regclass);


--
-- Name: dst_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE districts ALTER COLUMN dst_id SET DEFAULT nextval('districts_dst_id_seq'::regclass);


--
-- Name: dtc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE document_type_categories ALTER COLUMN dtc_id SET DEFAULT nextval('document_type_categories_dtc_id_seq'::regclass);


--
-- Name: dty_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE document_types ALTER COLUMN dty_id SET DEFAULT nextval('document_types_dty_id_seq'::regclass);


--
-- Name: sd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE documents_series ALTER COLUMN sd_id SET DEFAULT nextval('documents_series_sd_id_seq'::regclass);


--
-- Name: drg_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE drugs ALTER COLUMN drg_id SET DEFAULT nextval('drugs_drg_id_seq'::regclass);


--
-- Name: eco_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE emp_convention ALTER COLUMN eco_id SET DEFAULT nextval('emp_convention_eco_id_seq'::regclass);


--
-- Name: empd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE employee_docs ALTER COLUMN empd_id SET DEFAULT nextval('employee_docs_empd_id_seq'::regclass);


--
-- Name: emp_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE employees ALTER COLUMN emp_id SET DEFAULT nextval('employees_emp_id_seq'::regclass);


--
-- Name: enr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ensured_reasons ALTER COLUMN enr_id SET DEFAULT nextval('ensured_reasons_enr_id_seq'::regclass);


--
-- Name: err_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE errors ALTER COLUMN err_id SET DEFAULT nextval('errors_err_id_seq'::regclass);


--
-- Name: eum_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE eu_members ALTER COLUMN eum_id SET DEFAULT nextval('eu_members_eum_id_seq'::regclass);


--
-- Name: evt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE events ALTER COLUMN evt_id SET DEFAULT nextval('events_evt_id_seq'::regclass);


--
-- Name: gen_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE gender ALTER COLUMN gen_id SET DEFAULT nextval('gender_gen_id_seq'::regclass);


--
-- Name: hf_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE health_factor ALTER COLUMN hf_id SET DEFAULT nextval('health_factor_hf_id_seq'::regclass);


--
-- Name: icd10_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE icd10s ALTER COLUMN icd10_id SET DEFAULT nextval('icd10s_icd10_id_seq'::regclass);


--
-- Name: md_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE icdmap ALTER COLUMN md_id SET DEFAULT nextval('icdmap_md_id_seq'::regclass);


--
-- Name: icd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE infecto_contagious_diseases ALTER COLUMN icd_id SET DEFAULT nextval('infecto_contagious_diseases_icd_id_seq'::regclass);


--
-- Name: jd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE justify_docs ALTER COLUMN jd_id SET DEFAULT nextval('justify_docs_jd_id_seq'::regclass);


--
-- Name: ls_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE laboratories_services ALTER COLUMN ls_id SET DEFAULT nextval('laboratories_services_ls_id_seq'::regclass);


--
-- Name: lv_id; Type: DEFAULT; Schema: public; Owner: Cristi
--

ALTER TABLE laboratories_values ALTER COLUMN lv_id SET DEFAULT nextval('laboratories_values_lv_id_seq'::regclass);


--
-- Name: lc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE life_conditions ALTER COLUMN lc_id SET DEFAULT nextval('life_conditions_lc_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE liste ALTER COLUMN id SET DEFAULT nextval('liste_id_seq'::regclass);


--
-- Name: msp_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE med_srv_packages ALTER COLUMN msp_id SET DEFAULT nextval('med_srv_packages_msp_id_seq'::regclass);


--
-- Name: ml_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medical_letters ALTER COLUMN ml_id SET DEFAULT nextval('medical_letters_ml_id_seq'::regclass);


--
-- Name: mnd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medical_note_diagnostics ALTER COLUMN mnd_id SET DEFAULT nextval('medical_note_diagnostics_mnd_id_seq'::regclass);


--
-- Name: mni_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medical_note_investigations ALTER COLUMN mni_id SET DEFAULT nextval('medical_note_investigations_mni_id_seq'::regclass);


--
-- Name: mn_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medical_notes ALTER COLUMN mn_id SET DEFAULT nextval('medical_notes_mn_id_seq'::regclass);


--
-- Name: mnt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medical_notes_type ALTER COLUMN mnt_id SET DEFAULT nextval('medical_notes_type_mnt_id_seq'::regclass);


--
-- Name: ms_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medical_services ALTER COLUMN ms_id SET DEFAULT nextval('medical_services_ms_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medici ALTER COLUMN id SET DEFAULT nextval('medici_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medicina_muncii ALTER COLUMN id SET DEFAULT nextval('medicina_muncii_id_seq'::regclass);


--
-- Name: mce_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE medico_chirurgical_emergencies ALTER COLUMN mce_id SET DEFAULT nextval('medico_chirurgical_emergencies_mce_id_seq'::regclass);


--
-- Name: moi_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE motiv_iesiri ALTER COLUMN moi_id SET DEFAULT nextval('motiv_iesiri_moi_id_seq'::regclass);


--
-- Name: nhp_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE nhps ALTER COLUMN nhp_id SET DEFAULT nextval('nhps_nhp_id_seq'::regclass);


--
-- Name: ourm_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE org_unit_reporting_mapping ALTER COLUMN ourm_id SET DEFAULT nextval('org_unit_reporting_mapping_ourm_id_seq'::regclass);


--
-- Name: out_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE org_unit_types ALTER COLUMN out_id SET DEFAULT nextval('org_unit_types_out_id_seq'::regclass);


--
-- Name: ou_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE org_units ALTER COLUMN ou_id SET DEFAULT nextval('org_units_ou_id_seq'::regclass);


--
-- Name: pkm_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE package_modes ALTER COLUMN pkm_id SET DEFAULT nextval('package_modes_pkm_id_seq'::regclass);


--
-- Name: all_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_allergies ALTER COLUMN all_id SET DEFAULT nextval('pat_allergies_all_id_seq'::regclass);


--
-- Name: pcat_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_categories ALTER COLUMN pcat_id SET DEFAULT nextval('pat_categories_pcat_id_seq'::regclass);


--
-- Name: patcr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_chronics ALTER COLUMN patcr_id SET DEFAULT nextval('pat_chronics_patcr_id_seq'::regclass);


--
-- Name: pcz_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_citizenships ALTER COLUMN pcz_id SET DEFAULT nextval('pat_citizenships_pcz_id_seq'::regclass);


--
-- Name: pco_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_concedii ALTER COLUMN pco_id SET DEFAULT nextval('pat_concedii_pco_id_seq'::regclass);


--
-- Name: pen_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_enlisteds ALTER COLUMN pen_id SET DEFAULT nextval('pat_enlisteds_pen_id_seq'::regclass);


--
-- Name: idc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_id_cards ALTER COLUMN idc_id SET DEFAULT nextval('pat_id_cards_idc_id_seq'::regclass);


--
-- Name: pim_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_immunizations ALTER COLUMN pim_id SET DEFAULT nextval('pat_immunizations_pim_id_seq'::regclass);


--
-- Name: pnhp_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_nhps ALTER COLUMN pnhp_id SET DEFAULT nextval('pat_nhps_pnhp_id_seq'::regclass);


--
-- Name: patr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_relatives ALTER COLUMN patr_id SET DEFAULT nextval('pat_relatives_patr_id_seq'::regclass);


--
-- Name: sar_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_sarcini ALTER COLUMN sar_id SET DEFAULT nextval('pat_sarcini_sar_id_seq'::regclass);


--
-- Name: pst_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pat_states ALTER COLUMN pst_id SET DEFAULT nextval('pat_states_pst_id_seq'::regclass);


--
-- Name: pat_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE patients ALTER COLUMN pat_id SET DEFAULT nextval('patients_pat_id_seq'::regclass);


--
-- Name: pat_fisa; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE patients ALTER COLUMN pat_fisa SET DEFAULT nextval('pat_fisa_seq'::regclass);


--
-- Name: patd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE patients_data ALTER COLUMN patd_id SET DEFAULT nextval('patients_data_patd_id_seq'::regclass);


--
-- Name: pc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE person_categories ALTER COLUMN pc_id SET DEFAULT nextval('person_categories_pc_id_seq'::regclass);


--
-- Name: pce_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE person_categories_exclusions ALTER COLUMN pce_id SET DEFAULT nextval('person_categories_exclusions_pce_id_seq'::regclass);


--
-- Name: ps_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE person_states ALTER COLUMN ps_id SET DEFAULT nextval('person_states_ps_id_seq'::regclass);


--
-- Name: pslt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE person_states_list_types ALTER COLUMN pslt_id SET DEFAULT nextval('person_states_list_types_pslt_id_seq'::regclass);


--
-- Name: pt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE person_types ALTER COLUMN pt_id SET DEFAULT nextval('person_types_pt_id_seq'::regclass);


--
-- Name: per_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE personal ALTER COLUMN per_id SET DEFAULT nextval('personal_per_id_seq'::regclass);


--
-- Name: pct_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE personal_card_types ALTER COLUMN pct_id SET DEFAULT nextval('personal_card_types_pct_id_seq'::regclass);


--
-- Name: pgi_id; Type: DEFAULT; Schema: public; Owner: Cristi
--

ALTER TABLE pgic_values ALTER COLUMN pgi_id SET DEFAULT nextval('pgic_values_pgi_id_seq'::regclass);


--
-- Name: phf_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE pharmaceutical_forms ALTER COLUMN phf_id SET DEFAULT nextval('pharmaceutical_forms_phf_id_seq'::regclass);


--
-- Name: psp_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE physician_specialities ALTER COLUMN psp_id SET DEFAULT nextval('physician_specialities_psp_id_seq'::regclass);


--
-- Name: phy_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE physicians ALTER COLUMN phy_id SET DEFAULT nextval('physicians_phy_id_seq'::regclass);


--
-- Name: pref_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE preferences ALTER COLUMN pref_id SET DEFAULT nextval('preferences_pref_id_seq'::regclass);


--
-- Name: prit_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE prescription_items ALTER COLUMN prit_id SET DEFAULT nextval('prescription_items_prit_id_seq'::regclass);


--
-- Name: prt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE prescription_types ALTER COLUMN prt_id SET DEFAULT nextval('prescription_types_prt_id_seq'::regclass);


--
-- Name: pr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE prescriptions ALTER COLUMN pr_id SET DEFAULT nextval('prescriptions_pr_id_seq'::regclass);


--
-- Name: sr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE prescriptions_series ALTER COLUMN sr_id SET DEFAULT nextval('prescriptions_series_sr_id_seq'::regclass);


--
-- Name: pdf_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE printable_document_fields ALTER COLUMN pdf_id SET DEFAULT nextval('printable_document_fields_pdf_id_seq'::regclass);


--
-- Name: pd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE printable_documents ALTER COLUMN pd_id SET DEFAULT nextval('printable_documents_pd_id_seq'::regclass);


--
-- Name: prfc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE printable_register_cols ALTER COLUMN prfc_id SET DEFAULT nextval('printable_register_cols_prfc_id_seq'::regclass);


--
-- Name: prf_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE printable_registers ALTER COLUMN prf_id SET DEFAULT nextval('printable_registers_prf_id_seq'::regclass);


--
-- Name: proad_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE provider_addresses ALTER COLUMN proad_id SET DEFAULT nextval('provider_addresses_proad_id_seq'::regclass);


--
-- Name: pro_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE providers ALTER COLUMN pro_id SET DEFAULT nextval('providers_pro_id_seq'::regclass);


--
-- Name: rasa_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_addresses ALTER COLUMN rasa_id SET DEFAULT nextval('reg_asig_addresses_rasa_id_seq'::regclass);


--
-- Name: rasb_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_base ALTER COLUMN rasb_id SET DEFAULT nextval('reg_asig_base_rasb_id_seq'::regclass);


--
-- Name: rasc_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_categories ALTER COLUMN rasc_id SET DEFAULT nextval('reg_asig_categories_rasc_id_seq'::regclass);


--
-- Name: rach_id; Type: DEFAULT; Schema: public; Owner: Cristi
--

ALTER TABLE reg_asig_chronics ALTER COLUMN rach_id SET DEFAULT nextval('reg_asig_chronics_rach_id_seq'::regclass);


--
-- Name: raser_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_ensured_reasons ALTER COLUMN raser_id SET DEFAULT nextval('reg_asig_ensured_reasons_raser_id_seq'::regclass);


--
-- Name: raf_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_fmk ALTER COLUMN raf_id SET DEFAULT nextval('reg_asig_fmk_raf_id_seq'::regclass);


--
-- Name: rasid_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_id_cards ALTER COLUMN rasid_id SET DEFAULT nextval('reg_asig_id_cards_rasid_id_seq'::regclass);


--
-- Name: rasj_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_jdocs ALTER COLUMN rasj_id SET DEFAULT nextval('reg_asig_jdocs_rasj_id_seq'::regclass);


--
-- Name: rasn_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_nhps ALTER COLUMN rasn_id SET DEFAULT nextval('reg_asig_nhps_rasn_id_seq'::regclass);


--
-- Name: raso_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_operations ALTER COLUMN raso_id SET DEFAULT nextval('reg_asig_operations_raso_id_seq'::regclass);


--
-- Name: ras_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_siui ALTER COLUMN ras_id SET DEFAULT nextval('reg_asig_siui_ras_id_seq'::regclass);


--
-- Name: rass_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_states ALTER COLUMN rass_id SET DEFAULT nextval('reg_asig_states_rass_id_seq'::regclass);


--
-- Name: rasup_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asig_supl ALTER COLUMN rasup_id SET DEFAULT nextval('reg_asig_supl_rasup_id_seq'::regclass);


--
-- Name: nr_inreg; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_asigurati ALTER COLUMN nr_inreg SET DEFAULT nextval('reg_asigurati_nr_inreg_seq'::regclass);


--
-- Name: nr_inreg; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_cons ALTER COLUMN nr_inreg SET DEFAULT nextval('reg_cons_nr_inreg_seq'::regclass);


--
-- Name: rcs_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_controale_sarcina ALTER COLUMN rcs_id SET DEFAULT nextval('reg_controale_sarcina_rcs_id_seq'::regclass);


--
-- Name: rcr_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_cronici ALTER COLUMN rcr_id SET DEFAULT nextval('reg_cronici_rcr_id_seq'::regclass);


--
-- Name: ev_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_evaluari ALTER COLUMN ev_id SET DEFAULT nextval('reg_evaluari_ev_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reg_sarcini ALTER COLUMN id SET DEFAULT nextval('reg_sarcini_id_seq'::regclass);


--
-- Name: rel_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE relatives ALTER COLUMN rel_id SET DEFAULT nextval('relatives_rel_id_seq'::regclass);


--
-- Name: smsp_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE service_med_srv_packages ALTER COLUMN smsp_id SET DEFAULT nextval('service_med_srv_packages_smsp_id_seq'::regclass);


--
-- Name: lst_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE service_type ALTER COLUMN lst_id SET DEFAULT nextval('service_type_lst_id_seq'::regclass);


--
-- Name: srv_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE services ALTER COLUMN srv_id SET DEFAULT nextval('services_srv_id_seq'::regclass);


--
-- Name: sn_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE servnom ALTER COLUMN sn_id SET DEFAULT nextval('servnom_sn_id_seq'::regclass);


--
-- Name: sn_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE servnom2010 ALTER COLUMN sn_id SET DEFAULT nextval('servnom2010_sn_id_seq'::regclass);


--
-- Name: sli_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE sick_leave_indemnizations ALTER COLUMN sli_id SET DEFAULT nextval('sick_leave_indemnizations_sli_id_seq'::regclass);


--
-- Name: slig_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE sick_leave_indemnizations_groups ALTER COLUMN slig_id SET DEFAULT nextval('sick_leave_indemnizations_groups_slig_id_seq'::regclass);


--
-- Name: spe_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE specialities ALTER COLUMN spe_id SET DEFAULT nextval('specialities_spe_id_seq'::regclass);


--
-- Name: sdg_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE speciality_degrees ALTER COLUMN sdg_id SET DEFAULT nextval('speciality_degrees_sdg_id_seq'::regclass);


--
-- Name: s1i_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE srv1i ALTER COLUMN s1i_id SET DEFAULT nextval('srv1i_s1i_id_seq'::regclass);


--
-- Name: stt_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE street_types ALTER COLUMN stt_id SET DEFAULT nextval('street_types_stt_id_seq'::regclass);


--
-- Name: st_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE streets ALTER COLUMN st_id SET DEFAULT nextval('streets_st_id_seq'::regclass);


--
-- Name: scl_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE subclase_dg ALTER COLUMN scl_id SET DEFAULT nextval('subclase_dg_scl_id_seq'::regclass);


--
-- Name: tpl_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE templates ALTER COLUMN tpl_id SET DEFAULT nextval('templates_tpl_id_seq'::regclass);


--
-- Name: tpd_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE templates_data ALTER COLUMN tpd_id SET DEFAULT nextval('templates_data_tpd_id_seq'::regclass);


--
-- Name: active_substances_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY active_substances
    ADD CONSTRAINT active_substances_pkey PRIMARY KEY (as_id);


--
-- Name: actualizari_asigurati_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY actualizari_asigurati
    ADD CONSTRAINT actualizari_asigurati_pkey PRIMARY KEY (actas_id);


--
-- Name: acupunctura_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acupunctura
    ADD CONSTRAINT acupunctura_id_key UNIQUE (id);


--
-- Name: addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY addresses
    ADD CONSTRAINT addresses_pkey PRIMARY KEY (addr_id);


--
-- Name: afect_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY afect
    ADD CONSTRAINT afect_pkey PRIMARY KEY (id);


--
-- Name: age_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY age_groups
    ADD CONSTRAINT age_groups_pkey PRIMARY KEY (ag_id);


--
-- Name: ahc_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY ahc
    ADD CONSTRAINT ahc_pkey PRIMARY KEY (ahc_id);


--
-- Name: anexa_2b_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY anexa_2b
    ADD CONSTRAINT anexa_2b_pkey PRIMARY KEY (id);


--
-- Name: anexa_3_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY anexa_3
    ADD CONSTRAINT anexa_3_pkey PRIMARY KEY (id);


--
-- Name: apf_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY apf
    ADD CONSTRAINT apf_pkey PRIMARY KEY (af_id);


--
-- Name: appdata_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY appdata
    ADD CONSTRAINT appdata_pkey PRIMARY KEY (apd_id);


--
-- Name: atcs_pkey; Type: CONSTRAINT; Schema: public; Owner: Cristi; Tablespace: 
--

ALTER TABLE ONLY atcs
    ADD CONSTRAINT atcs_pkey PRIMARY KEY (atc_id);


--
-- Name: boli_disp_rap_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY boli_disp_rap
    ADD CONSTRAINT boli_disp_rap_pkey PRIMARY KEY (bdr_id);


--
-- Name: capita_age_group_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY capita_age_group_categories
    ADD CONSTRAINT capita_age_group_categories_pkey PRIMARY KEY (cagc_id);


--
-- Name: capita_group_points_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY capita_group_points
    ADD CONSTRAINT capita_group_points_pkey PRIMARY KEY (cgp_id);


--
-- Name: capita_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY capita_groups
    ADD CONSTRAINT capita_groups_pkey PRIMARY KEY (cg_id);


--
-- Name: capita_move_type_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY capita_move_type
    ADD CONSTRAINT capita_move_type_pkey PRIMARY KEY (cmt_id);


--
-- Name: capita_operations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY capita_operations
    ADD CONSTRAINT capita_operations_pkey PRIMARY KEY (cop_id);


--
-- Name: chronic_disease_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY chronic_disease_categories
    ADD CONSTRAINT chronic_disease_categories_pkey PRIMARY KEY (cdc_id);


--
-- Name: chronic_diseases_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY chronic_diseases
    ADD CONSTRAINT chronic_diseases_pkey PRIMARY KEY (cd_id);


--
-- Name: cities_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY cities
    ADD CONSTRAINT cities_pkey PRIMARY KEY (cit_id);


--
-- Name: citizenships_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY citizenships
    ADD CONSTRAINT citizenships_pkey PRIMARY KEY (ctz_id);


--
-- Name: city_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY city_types
    ADD CONSTRAINT city_types_pkey PRIMARY KEY (ctt_id);


--
-- Name: clase_dg_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY clase_dg
    ADD CONSTRAINT clase_dg_pkey PRIMARY KEY (cls_id);


--
-- Name: cnas_agreements_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY cnas_agreements
    ADD CONSTRAINT cnas_agreements_pkey PRIMARY KEY (cnasag_id);


--
-- Name: concentrations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY concentrations
    ADD CONSTRAINT concentrations_pkey PRIMARY KEY (con_id);


--
-- Name: consultatii_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY consultatii
    ADD CONSTRAINT consultatii_pkey PRIMARY KEY (cons_id);


--
-- Name: contracts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY contracts
    ADD CONSTRAINT contracts_pkey PRIMARY KEY (ctr_id);


--
-- Name: conventions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY conventions
    ADD CONSTRAINT conventions_pkey PRIMARY KEY (conv_id);


--
-- Name: copayment_list_drugs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY copayment_list_drugs
    ADD CONSTRAINT copayment_list_drugs_pkey PRIMARY KEY (cld_id);


--
-- Name: copayment_list_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY copayment_list_types
    ADD CONSTRAINT copayment_list_types_pkey PRIMARY KEY (clt_id);


--
-- Name: countries_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY countries
    ADD CONSTRAINT countries_pkey PRIMARY KEY (cnt_id);


--
-- Name: cv_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY cv
    ADD CONSTRAINT cv_pkey PRIMARY KEY (cv_id);


--
-- Name: de_reinscris_cnp_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY de_reinscris
    ADD CONSTRAINT de_reinscris_cnp_key UNIQUE (cnp);


--
-- Name: de_reinscris_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY de_reinscris
    ADD CONSTRAINT de_reinscris_pkey PRIMARY KEY (id);


--
-- Name: degrees_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY degrees
    ADD CONSTRAINT degrees_pkey PRIMARY KEY (deg_id);


--
-- Name: diagnostic_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY diagnostic_types
    ADD CONSTRAINT diagnostic_types_pkey PRIMARY KEY (dgt_id);


--
-- Name: disease_categ_active_subst_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY disease_categ_active_subst
    ADD CONSTRAINT disease_categ_active_subst_pkey PRIMARY KEY (dcas_id);


--
-- Name: disease_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY disease_categories
    ADD CONSTRAINT disease_categories_pkey PRIMARY KEY (dsc_id);


--
-- Name: dispensarizari_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY dispensarizari
    ADD CONSTRAINT dispensarizari_pkey PRIMARY KEY (dsp_id);


--
-- Name: districts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY districts
    ADD CONSTRAINT districts_pkey PRIMARY KEY (dst_id);


--
-- Name: document_type_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY document_type_categories
    ADD CONSTRAINT document_type_categories_pkey PRIMARY KEY (dtc_id);


--
-- Name: document_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY document_types
    ADD CONSTRAINT document_types_pkey PRIMARY KEY (dty_id);


--
-- Name: documents_series_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY documents_series
    ADD CONSTRAINT documents_series_pkey PRIMARY KEY (sd_id);


--
-- Name: drugs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY drugs
    ADD CONSTRAINT drugs_pkey PRIMARY KEY (drg_id);


--
-- Name: emp_convention_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY emp_convention
    ADD CONSTRAINT emp_convention_pkey PRIMARY KEY (eco_id);


--
-- Name: employee_docs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY employee_docs
    ADD CONSTRAINT employee_docs_pkey PRIMARY KEY (empd_id);


--
-- Name: employees_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY employees
    ADD CONSTRAINT employees_pkey PRIMARY KEY (emp_id);


--
-- Name: ensured_reasons_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY ensured_reasons
    ADD CONSTRAINT ensured_reasons_pkey PRIMARY KEY (enr_id);


--
-- Name: errors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY errors
    ADD CONSTRAINT errors_pkey PRIMARY KEY (err_id);


--
-- Name: eu_members_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY eu_members
    ADD CONSTRAINT eu_members_pkey PRIMARY KEY (eum_id);


--
-- Name: events_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY events
    ADD CONSTRAINT events_pkey PRIMARY KEY (evt_id);


--
-- Name: gender_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY gender
    ADD CONSTRAINT gender_pkey PRIMARY KEY (gen_id);


--
-- Name: health_factor_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY health_factor
    ADD CONSTRAINT health_factor_pkey PRIMARY KEY (hf_id);


--
-- Name: icd10s_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY icd10s
    ADD CONSTRAINT icd10s_pkey PRIMARY KEY (icd10_id);


--
-- Name: icdmap_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY icdmap
    ADD CONSTRAINT icdmap_pkey PRIMARY KEY (md_id);


--
-- Name: infecto_contagious_diseases_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY infecto_contagious_diseases
    ADD CONSTRAINT infecto_contagious_diseases_pkey PRIMARY KEY (icd_id);


--
-- Name: justify_docs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY justify_docs
    ADD CONSTRAINT justify_docs_pkey PRIMARY KEY (jd_id);


--
-- Name: laboratories_services_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY laboratories_services
    ADD CONSTRAINT laboratories_services_pkey PRIMARY KEY (ls_id);


--
-- Name: laboratories_values_pkey; Type: CONSTRAINT; Schema: public; Owner: Cristi; Tablespace: 
--

ALTER TABLE ONLY laboratories_values
    ADD CONSTRAINT laboratories_values_pkey PRIMARY KEY (lv_id);


--
-- Name: life_conditions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY life_conditions
    ADD CONSTRAINT life_conditions_pkey PRIMARY KEY (lc_id);


--
-- Name: liste_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY liste
    ADD CONSTRAINT liste_pkey PRIMARY KEY (id);


--
-- Name: med_srv_packages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY med_srv_packages
    ADD CONSTRAINT med_srv_packages_pkey PRIMARY KEY (msp_id);


--
-- Name: medical_letters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medical_letters
    ADD CONSTRAINT medical_letters_pkey PRIMARY KEY (ml_id);


--
-- Name: medical_note_diagnostics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medical_note_diagnostics
    ADD CONSTRAINT medical_note_diagnostics_pkey PRIMARY KEY (mnd_id);


--
-- Name: medical_note_investigations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medical_note_investigations
    ADD CONSTRAINT medical_note_investigations_pkey PRIMARY KEY (mni_id);


--
-- Name: medical_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medical_notes
    ADD CONSTRAINT medical_notes_pkey PRIMARY KEY (mn_id);


--
-- Name: medical_notes_type_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medical_notes_type
    ADD CONSTRAINT medical_notes_type_pkey PRIMARY KEY (mnt_id);


--
-- Name: medical_services_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medical_services
    ADD CONSTRAINT medical_services_pkey PRIMARY KEY (ms_id);


--
-- Name: medici_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medici
    ADD CONSTRAINT medici_pkey PRIMARY KEY (id);


--
-- Name: medicina_muncii_dosar_nr_unic; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medicina_muncii
    ADD CONSTRAINT medicina_muncii_dosar_nr_unic UNIQUE (dosar_nr);


--
-- Name: medicina_muncii_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medicina_muncii
    ADD CONSTRAINT medicina_muncii_pkey UNIQUE (id);


--
-- Name: medico_chirurgical_emergencies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY medico_chirurgical_emergencies
    ADD CONSTRAINT medico_chirurgical_emergencies_pkey PRIMARY KEY (mce_id);


--
-- Name: motiv_iesiri_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY motiv_iesiri
    ADD CONSTRAINT motiv_iesiri_pkey PRIMARY KEY (moi_id);


--
-- Name: nhps_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY nhps
    ADD CONSTRAINT nhps_pkey PRIMARY KEY (nhp_id);


--
-- Name: org_unit_reporting_mapping_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY org_unit_reporting_mapping
    ADD CONSTRAINT org_unit_reporting_mapping_pkey PRIMARY KEY (ourm_id);


--
-- Name: org_unit_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY org_unit_types
    ADD CONSTRAINT org_unit_types_pkey PRIMARY KEY (out_id);


--
-- Name: org_units_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY org_units
    ADD CONSTRAINT org_units_pkey PRIMARY KEY (ou_id);


--
-- Name: pacienti_cnp_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pacienti
    ADD CONSTRAINT pacienti_cnp_key UNIQUE (cnp);


--
-- Name: pacienti_fisa_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pacienti
    ADD CONSTRAINT pacienti_fisa_key UNIQUE (fisa);


--
-- Name: pacienti_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pacienti
    ADD CONSTRAINT pacienti_pkey PRIMARY KEY (fisa);


--
-- Name: package_modes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY package_modes
    ADD CONSTRAINT package_modes_pkey PRIMARY KEY (pkm_id);


--
-- Name: pat_allergies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_allergies
    ADD CONSTRAINT pat_allergies_pkey PRIMARY KEY (all_id);


--
-- Name: pat_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_categories
    ADD CONSTRAINT pat_categories_pkey PRIMARY KEY (pcat_id);


--
-- Name: pat_chronics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_chronics
    ADD CONSTRAINT pat_chronics_pkey PRIMARY KEY (patcr_id);


--
-- Name: pat_citizenships_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_citizenships
    ADD CONSTRAINT pat_citizenships_pkey PRIMARY KEY (pcz_id);


--
-- Name: pat_cnp_uk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY patients
    ADD CONSTRAINT pat_cnp_uk UNIQUE (pat_cnp);


--
-- Name: pat_concedii_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_concedii
    ADD CONSTRAINT pat_concedii_pkey PRIMARY KEY (pco_id);


--
-- Name: pat_enlisteds_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_enlisteds
    ADD CONSTRAINT pat_enlisteds_pkey PRIMARY KEY (pen_id);


--
-- Name: pat_id_cards_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_id_cards
    ADD CONSTRAINT pat_id_cards_pkey PRIMARY KEY (idc_id);


--
-- Name: pat_immunizations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_immunizations
    ADD CONSTRAINT pat_immunizations_pkey PRIMARY KEY (pim_id);


--
-- Name: pat_nhps_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_nhps
    ADD CONSTRAINT pat_nhps_pkey PRIMARY KEY (pnhp_id);


--
-- Name: pat_relatives_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_relatives
    ADD CONSTRAINT pat_relatives_pkey PRIMARY KEY (patr_id);


--
-- Name: pat_sarcini_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_sarcini
    ADD CONSTRAINT pat_sarcini_pkey PRIMARY KEY (sar_id);


--
-- Name: pat_states_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pat_states
    ADD CONSTRAINT pat_states_pkey PRIMARY KEY (pst_id);


--
-- Name: patd_cnp_uk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY patients_data
    ADD CONSTRAINT patd_cnp_uk UNIQUE (patd_cnp);


--
-- Name: patients_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY patients_data
    ADD CONSTRAINT patients_data_pkey PRIMARY KEY (patd_id);


--
-- Name: patients_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY patients
    ADD CONSTRAINT patients_pkey PRIMARY KEY (pat_id);


--
-- Name: person_categories_exclusions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY person_categories_exclusions
    ADD CONSTRAINT person_categories_exclusions_pkey PRIMARY KEY (pce_id);


--
-- Name: person_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY person_categories
    ADD CONSTRAINT person_categories_pkey PRIMARY KEY (pc_id);


--
-- Name: person_states_list_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY person_states_list_types
    ADD CONSTRAINT person_states_list_types_pkey PRIMARY KEY (pslt_id);


--
-- Name: person_states_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY person_states
    ADD CONSTRAINT person_states_pkey PRIMARY KEY (ps_id);


--
-- Name: person_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY person_types
    ADD CONSTRAINT person_types_pkey PRIMARY KEY (pt_id);


--
-- Name: personal_card_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY personal_card_types
    ADD CONSTRAINT personal_card_types_pkey PRIMARY KEY (pct_id);


--
-- Name: personal_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY personal
    ADD CONSTRAINT personal_pkey PRIMARY KEY (per_id);


--
-- Name: pgic_values_pkey; Type: CONSTRAINT; Schema: public; Owner: Cristi; Tablespace: 
--

ALTER TABLE ONLY pgic_values
    ADD CONSTRAINT pgic_values_pkey PRIMARY KEY (pgi_id);


--
-- Name: pharmaceutical_forms_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pharmaceutical_forms
    ADD CONSTRAINT pharmaceutical_forms_pkey PRIMARY KEY (phf_id);


--
-- Name: physician_specialities_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY physician_specialities
    ADD CONSTRAINT physician_specialities_pkey PRIMARY KEY (psp_id);


--
-- Name: physicians_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY physicians
    ADD CONSTRAINT physicians_pkey PRIMARY KEY (phy_id);


--
-- Name: preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY preferences
    ADD CONSTRAINT preferences_pkey PRIMARY KEY (pref_id);


--
-- Name: prescription_items_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY prescription_items
    ADD CONSTRAINT prescription_items_pkey PRIMARY KEY (prit_id);


--
-- Name: prescription_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY prescription_types
    ADD CONSTRAINT prescription_types_pkey PRIMARY KEY (prt_id);


--
-- Name: prescriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY prescriptions
    ADD CONSTRAINT prescriptions_pkey PRIMARY KEY (pr_id);


--
-- Name: prescriptions_series_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY prescriptions_series
    ADD CONSTRAINT prescriptions_series_pkey PRIMARY KEY (sr_id);


--
-- Name: printable_document_fields_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY printable_document_fields
    ADD CONSTRAINT printable_document_fields_pkey PRIMARY KEY (pdf_id);


--
-- Name: printable_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY printable_documents
    ADD CONSTRAINT printable_documents_pkey PRIMARY KEY (pd_id);


--
-- Name: printable_register_cols_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY printable_register_cols
    ADD CONSTRAINT printable_register_cols_pkey PRIMARY KEY (prfc_id);


--
-- Name: printable_registers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY printable_registers
    ADD CONSTRAINT printable_registers_pkey PRIMARY KEY (prf_id);


--
-- Name: provider_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY provider_addresses
    ADD CONSTRAINT provider_addresses_pkey PRIMARY KEY (proad_id);


--
-- Name: providers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY providers
    ADD CONSTRAINT providers_pkey PRIMARY KEY (pro_id);


--
-- Name: reg_asig_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_addresses
    ADD CONSTRAINT reg_asig_addresses_pkey PRIMARY KEY (rasa_id);


--
-- Name: reg_asig_base_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_base
    ADD CONSTRAINT reg_asig_base_pkey PRIMARY KEY (rasb_id);


--
-- Name: reg_asig_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_categories
    ADD CONSTRAINT reg_asig_categories_pkey PRIMARY KEY (rasc_id);


--
-- Name: reg_asig_chronics_pkey; Type: CONSTRAINT; Schema: public; Owner: Cristi; Tablespace: 
--

ALTER TABLE ONLY reg_asig_chronics
    ADD CONSTRAINT reg_asig_chronics_pkey PRIMARY KEY (rach_id);


--
-- Name: reg_asig_ensured_reasons_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_ensured_reasons
    ADD CONSTRAINT reg_asig_ensured_reasons_pkey PRIMARY KEY (raser_id);


--
-- Name: reg_asig_fmk_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_fmk
    ADD CONSTRAINT reg_asig_fmk_pkey PRIMARY KEY (raf_id);


--
-- Name: reg_asig_id_cards_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_id_cards
    ADD CONSTRAINT reg_asig_id_cards_pkey PRIMARY KEY (rasid_id);


--
-- Name: reg_asig_jdocs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_jdocs
    ADD CONSTRAINT reg_asig_jdocs_pkey PRIMARY KEY (rasj_id);


--
-- Name: reg_asig_nhps_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_nhps
    ADD CONSTRAINT reg_asig_nhps_pkey PRIMARY KEY (rasn_id);


--
-- Name: reg_asig_operations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_operations
    ADD CONSTRAINT reg_asig_operations_pkey PRIMARY KEY (raso_id);


--
-- Name: reg_asig_siui_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_siui
    ADD CONSTRAINT reg_asig_siui_pkey PRIMARY KEY (ras_id);


--
-- Name: reg_asig_states_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_states
    ADD CONSTRAINT reg_asig_states_pkey PRIMARY KEY (rass_id);


--
-- Name: reg_asig_supl_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_asig_supl
    ADD CONSTRAINT reg_asig_supl_pkey PRIMARY KEY (rasup_id);


--
-- Name: reg_cons_nr_inreg_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_cons
    ADD CONSTRAINT reg_cons_nr_inreg_key UNIQUE (nr_inreg);


--
-- Name: reg_controale_sarcina_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_controale_sarcina
    ADD CONSTRAINT reg_controale_sarcina_pkey PRIMARY KEY (rcs_id);


--
-- Name: reg_cronici_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_cronici
    ADD CONSTRAINT reg_cronici_pkey PRIMARY KEY (rcr_id);


--
-- Name: reg_evaluari_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_evaluari
    ADD CONSTRAINT reg_evaluari_pkey PRIMARY KEY (ev_id);


--
-- Name: reg_sarcini_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reg_sarcini
    ADD CONSTRAINT reg_sarcini_id_key UNIQUE (id);


--
-- Name: relatives_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY relatives
    ADD CONSTRAINT relatives_pkey PRIMARY KEY (rel_id);


--
-- Name: service_med_srv_packages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY service_med_srv_packages
    ADD CONSTRAINT service_med_srv_packages_pkey PRIMARY KEY (smsp_id);


--
-- Name: service_type_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY service_type
    ADD CONSTRAINT service_type_pkey PRIMARY KEY (lst_id);


--
-- Name: services_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY services
    ADD CONSTRAINT services_pkey PRIMARY KEY (srv_id);


--
-- Name: servnom2010_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY servnom2010
    ADD CONSTRAINT servnom2010_pkey PRIMARY KEY (sn_id);


--
-- Name: servnom_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY servnom
    ADD CONSTRAINT servnom_pkey PRIMARY KEY (sn_id);


--
-- Name: sick_leave_indemnizations_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY sick_leave_indemnizations_groups
    ADD CONSTRAINT sick_leave_indemnizations_groups_pkey PRIMARY KEY (slig_id);


--
-- Name: sick_leave_indemnizations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY sick_leave_indemnizations
    ADD CONSTRAINT sick_leave_indemnizations_pkey PRIMARY KEY (sli_id);


--
-- Name: specialities_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY specialities
    ADD CONSTRAINT specialities_pkey PRIMARY KEY (spe_id);


--
-- Name: speciality_degrees_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY speciality_degrees
    ADD CONSTRAINT speciality_degrees_pkey PRIMARY KEY (sdg_id);


--
-- Name: srv1i_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY srv1i
    ADD CONSTRAINT srv1i_pkey PRIMARY KEY (s1i_id);


--
-- Name: srv_nodup_unq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY services
    ADD CONSTRAINT srv_nodup_unq UNIQUE (srv_pat_cnp, srv_date, srv_ms_code);


--
-- Name: street_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY street_types
    ADD CONSTRAINT street_types_pkey PRIMARY KEY (stt_id);


--
-- Name: streets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY streets
    ADD CONSTRAINT streets_pkey PRIMARY KEY (st_id);


--
-- Name: subclase_dg_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY subclase_dg
    ADD CONSTRAINT subclase_dg_pkey PRIMARY KEY (scl_id);


--
-- Name: templates_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY templates_data
    ADD CONSTRAINT templates_data_pkey PRIMARY KEY (tpd_id);


--
-- Name: templates_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY templates
    ADD CONSTRAINT templates_pkey PRIMARY KEY (tpl_id);


--
-- Name: all_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX all_pat_cnp_idx ON pat_allergies USING btree (all_pat_cnp);


--
-- Name: cit_code_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX cit_code_idx ON cities USING btree (cit_code);


--
-- Name: cons_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX cons_cnp_idx ON consultatii USING btree (cons_cnp);


--
-- Name: cop_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX cop_pat_cnp_idx ON capita_operations USING btree (cop_pat_cnp);


--
-- Name: idc_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX idc_pat_cnp_idx ON pat_id_cards USING btree (idc_pat_cnp);


--
-- Name: ml_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX ml_pat_cnp_idx ON medical_letters USING btree (ml_pat_cnp);


--
-- Name: mn_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX mn_pat_cnp_idx ON medical_notes USING btree (mn_pat_cnp);


--
-- Name: pacienti_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX pacienti_cnp_idx ON pacienti USING btree (cnp);


--
-- Name: pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX pat_cnp_idx ON patients USING btree (pat_cnp);


--
-- Name: patcr_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX patcr_pat_cnp_idx ON pat_chronics USING btree (patcr_pat_cnp);


--
-- Name: patd_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX patd_cnp_idx ON patients_data USING btree (patd_cnp);


--
-- Name: pcat_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX pcat_pat_cnp_idx ON pat_categories USING btree (pcat_pat_cnp);


--
-- Name: pcz_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX pcz_cnp_idx ON pat_citizenships USING btree (pcz_cnp);


--
-- Name: pen_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX pen_pat_cnp_idx ON pat_enlisteds USING btree (pen_pat_cnp);


--
-- Name: pnhp_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX pnhp_pat_cnp_idx ON pat_nhps USING btree (pnhp_pat_cnp);


--
-- Name: pr_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX pr_pat_cnp_idx ON prescriptions USING btree (pr_pat_cnp);


--
-- Name: pst_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX pst_pat_cnp_idx ON pat_states USING btree (pst_pat_cnp);


--
-- Name: reg_asig_cnp_data_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX reg_asig_cnp_data_idx ON reg_asigurati USING btree (cnp, data);


--
-- Name: reg_asig_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX reg_asig_cnp_idx ON reg_asigurati USING btree (cnp);


--
-- Name: reg_asig_medic_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX reg_asig_medic_idx ON reg_asigurati USING btree (lower(medic));


--
-- Name: reg_cons_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX reg_cons_cnp_idx ON reg_cons USING btree (cnp);


--
-- Name: reg_cons_fisa_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX reg_cons_fisa_idx ON reg_cons USING btree (fisa);


--
-- Name: sar_pat_cnp_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX sar_pat_cnp_idx ON pat_sarcini USING btree (sar_pat_cnp);


--
-- Name: st_cit_code_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX st_cit_code_idx ON streets USING btree (st_cit_code);


--
-- Name: st_name_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX st_name_idx ON streets USING btree (st_name);


--
-- Name: nr_curent; Type: RULE; Schema: public; Owner: postgres
--

CREATE RULE nr_curent AS ON UPDATE TO documents_series WHERE ((new.sd_curent < new.sd_start) OR (new.sd_curent > new.sd_finish)) DO INSTEAD NOTHING;


--
-- Name: cons_main; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER cons_main
    BEFORE INSERT ON consultatii
    FOR EACH STATEMENT
    EXECUTE PROCEDURE main();


--
-- Name: nrreg_reg_cons; Type: TRIGGER; Schema: public; Owner: postgres
--

CREATE TRIGGER nrreg_reg_cons
    BEFORE INSERT ON reg_cons
    FOR EACH ROW
    EXECUTE PROCEDURE registru_reg_cons();


--
-- Name: printable_document_fields_pdf_pd_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY printable_document_fields
    ADD CONSTRAINT printable_document_fields_pdf_pd_id_fkey FOREIGN KEY (pdf_pd_id) REFERENCES printable_documents(pd_id);


--
-- Name: reg_asig_addresses_rasa_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_addresses
    ADD CONSTRAINT reg_asig_addresses_rasa_ras_id_fkey FOREIGN KEY (rasa_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_base_rasb_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_base
    ADD CONSTRAINT reg_asig_base_rasb_ras_id_fkey FOREIGN KEY (rasb_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_categories_rasc_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_categories
    ADD CONSTRAINT reg_asig_categories_rasc_ras_id_fkey FOREIGN KEY (rasc_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_ensured_reasons_raser_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_ensured_reasons
    ADD CONSTRAINT reg_asig_ensured_reasons_raser_ras_id_fkey FOREIGN KEY (raser_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_fmk_raf_actas_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_fmk
    ADD CONSTRAINT reg_asig_fmk_raf_actas_id_fkey FOREIGN KEY (raf_actas_id) REFERENCES actualizari_asigurati(actas_id);


--
-- Name: reg_asig_id_cards_rasid_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_id_cards
    ADD CONSTRAINT reg_asig_id_cards_rasid_ras_id_fkey FOREIGN KEY (rasid_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_jdocs_rasj_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_jdocs
    ADD CONSTRAINT reg_asig_jdocs_rasj_ras_id_fkey FOREIGN KEY (rasj_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_nhps_rasn_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_nhps
    ADD CONSTRAINT reg_asig_nhps_rasn_ras_id_fkey FOREIGN KEY (rasn_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_operations_raso_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_operations
    ADD CONSTRAINT reg_asig_operations_raso_ras_id_fkey FOREIGN KEY (raso_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_siui_ras_actas_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_siui
    ADD CONSTRAINT reg_asig_siui_ras_actas_id_fkey FOREIGN KEY (ras_actas_id) REFERENCES actualizari_asigurati(actas_id);


--
-- Name: reg_asig_states_rass_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_states
    ADD CONSTRAINT reg_asig_states_rass_ras_id_fkey FOREIGN KEY (rass_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: reg_asig_supl_rasup_ras_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reg_asig_supl
    ADD CONSTRAINT reg_asig_supl_rasup_ras_id_fkey FOREIGN KEY (rasup_ras_id) REFERENCES reg_asig_siui(ras_id);


--
-- Name: public; Type: ACL; Schema: -; Owner: Cristi
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
-- PostgreSQL database dump complete
--

