CREATE TABLE IF NOT EXISTS public.tprog_nota_enfe_hosp
(
codpro integer NOT NULL DEFAULT nextval('tprog_nota_enfe_hosp_codpro_seq'::regclass),
cod_usua numeric(20,0) DEFAULT 0,
fechaini timestamp without time zone,
fechafin timestamp without time zone,
fechaprog time with time zone,
obser text COLLATE pg_catalog."default" DEFAULT ' '::text,
id_med character(20) COLLATE pg_catalog."default" DEFAULT ' '::bpchar,
abierta boolean DEFAULT true,
obserterm text COLLATE pg_catalog."default" DEFAULT ' '::text,
fechaterm timestamp without time zone,
CONSTRAINT tprog_nota_enfe_hosp_pkey PRIMARY KEY (codpro)
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tprog_nota_enfe_hosp
OWNER to sa;
CREATE TABLE IF NOT EXISTS public.tnota_enfe_hosp
(
num_nota integer NOT NULL DEFAULT nextval('tnota_enfe_hosp_num_nota_seq'::regclass),
cod_admi numeric(20,0) DEFAULT 0,
fecha timestamp without time zone,
nota text COLLATE pg_catalog."default" DEFAULT ' '::text,
id_med character(20) COLLATE pg_catalog."default" DEFAULT ' '::bpchar,
cod_usua numeric(20,0) DEFAULT 0,
codpro integer DEFAULT 0,
CONSTRAINT tnota_enfe_hosp_pkey PRIMARY KEY (num_nota),
CONSTRAINT tnota_enfe_hosp_cod_admi_fkey FOREIGN KEY (cod_admi)
REFERENCES public.tadmision (cod_admi) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT
NOT VALID,
CONSTRAINT tnota_enfe_hosp_codpro_fkey FOREIGN KEY (codpro)
REFERENCES public.tprog_nota_enfe_hosp (codpro) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tnota_enfe_hosp
OWNER to sa;
COMMENT ON TABLE public.tnota_enfe_hosp
IS 'para el almacenamiento de las notas de enfermeria hospitalarias';
-- Index: tnota_enfe_hosp_cod_admi
-- DROP INDEX IF EXISTS public.tnota_enfe_hosp_cod_admi;
CREATE INDEX IF NOT EXISTS tnota_enfe_hosp_cod_admi
ON public.tnota_enfe_hosp USING btree
(cod_admi ASC NULLS LAST)
TABLESPACE pg_default;
CREATE TABLE IF NOT EXISTS public.tsignosvitales
(
consec integer NOT NULL DEFAULT nextval('tsignosvitales_consec_seq'::regclass),
admision integer NOT NULL,
codmed integer NOT NULL,
fecha timestamp without time zone NOT NULL,
tad numeric(20,0),
tas numeric(20,0),
fc numeric(20,0),
fr numeric(20,0),
spo2 numeric(20,0),
tempe numeric(20,2),
fechacrea timestamp without time zone NOT NULL DEFAULT now(),
transfusion integer,
CONSTRAINT tsignosvitales_pk PRIMARY KEY (consec),
CONSTRAINT "FK_tsignostivales_admision" FOREIGN KEY (admision)
REFERENCES public.tadmision (cod_admi) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT "FK_tsignosvitales_codmed" FOREIGN KEY (codmed)
REFERENCES public.tmedico (codigo) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT "tsignosvitales_transfusion_FK" FOREIGN KEY (transfusion)
REFERENCES public.tmaestro_transfusiones (consec) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tsignosvitales
OWNER to postgres;
CREATE TABLE IF NOT EXISTS public.tliquidos
(
numliq integer NOT NULL DEFAULT nextval('tliquidos_numliq_seq'::regclass),
cod_admi numeric(20,0) DEFAULT 0,
codpro integer DEFAULT 0,
cod_usua numeric(20,0) DEFAULT 0,
fecha timestamp without time zone,
liquidos character(100) COLLATE pg_catalog."default" DEFAULT ' '::bpchar,
cant numeric(6,2) DEFAULT 0,
fechacrea timestamp without time zone NOT NULL DEFAULT now(),
CONSTRAINT tliquidos_pkey PRIMARY KEY (numliq),
CONSTRAINT tliquidos_cod_admi_fkey FOREIGN KEY (cod_admi)
REFERENCES public.tadmision (cod_admi) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT tliquidos_cod_usua_fkey FOREIGN KEY (cod_usua)
REFERENCES public.tusuario (cod_usua) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT tliquidos_codpro_fkey FOREIGN KEY (codpro)
REFERENCES public.tprog_nota_enfe_hosp (codpro) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tliquidos
OWNER to sa;
COMMENT ON TABLE public.tliquidos
IS 'tabla para guardar ingresos de liquidos control de liquidos registros de enfermeria.';
COMMENT ON COLUMN public.tliquidos.numliq
IS 'consecutivo interno de la tabla pk';
COMMENT ON COLUMN public.tliquidos.cod_admi
IS 'codigo de la admision de la atencion';
COMMENT ON COLUMN public.tliquidos.codpro
IS 'codigo de la programacion del turno de enfermeria. fk';
COMMENT ON COLUMN public.tliquidos.cod_usua
IS 'codigo del usuario que inserto el regitro fk';
COMMENT ON COLUMN public.tliquidos.fecha
IS 'fecha del registro del ingreso de liquidos';
COMMENT ON COLUMN public.tliquidos.liquidos
IS 'nmbre del liquido que ingreso';
COMMENT ON COLUMN public.tliquidos.cant
IS 'cantidades en cc.';
COMMENT ON COLUMN public.tliquidos.fechacrea
IS 'fecha de insercion en bd.';
CREATE TABLE IF NOT EXISTS public.tliquidosegr
(
numegr integer NOT NULL DEFAULT nextval('tliquidosegr_numegr_seq'::regclass),
cod_admi numeric(20,0) DEFAULT 0,
codpro integer DEFAULT 0,
cod_usua numeric(20,0) DEFAULT 0,
fecha timestamp without time zone,
diuresis numeric(6,0) DEFAULT 0,
depos numeric(6,0) DEFAULT 0,
sng numeric(6,0) DEFAULT 0,
dren numeric(6,0) DEFAULT 0,
otros numeric(6,0) DEFAULT 0,
fechacrea timestamp without time zone DEFAULT now(),
CONSTRAINT tliquidosegr_pkey PRIMARY KEY (numegr),
CONSTRAINT tliquidosegr_cod_admi_fkey FOREIGN KEY (cod_admi)
REFERENCES public.tadmision (cod_admi) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT tliquidosegr_cod_usua_fkey FOREIGN KEY (cod_usua)
REFERENCES public.tusuario (cod_usua) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT tliquidosegr_codpro_fkey FOREIGN KEY (codpro)
REFERENCES public.tprog_nota_enfe_hosp (codpro) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tliquidosegr
OWNER to sa;
COMMENT ON TABLE public.tliquidosegr
IS 'liquidos egresados para registros de enfermeria control de liquidos.';
COMMENT ON COLUMN public.tliquidosegr.numegr
IS 'consecutivo interno de la tabla pk';
COMMENT ON COLUMN public.tliquidosegr.cod_admi
IS 'codigo de la admision de la atencion. fk';
COMMENT ON COLUMN public.tliquidosegr.codpro
IS 'codigo de la programacion del turno de enfermeria fk';
COMMENT ON COLUMN public.tliquidosegr.cod_usua
IS 'codigo del usuario que inserta en la tabla fk';
COMMENT ON COLUMN public.tliquidosegr.fecha
IS 'fecha del registro';
COMMENT ON COLUMN public.tliquidosegr.diuresis
IS 'liquidos eliminados por diuresis';
COMMENT ON COLUMN public.tliquidosegr.depos
IS 'liquidos eliminados por deposiciones';
COMMENT ON COLUMN public.tliquidosegr.sng
IS 'liquidos eliminados por sng
';
COMMENT ON COLUMN public.tliquidosegr.dren
IS 'liquidos eliminados por drenajes';
COMMENT ON COLUMN public.tliquidosegr.otros
IS 'liquidos eliminados por otros';
COMMENT ON COLUMN public.tliquidosegr.fechacrea
IS 'fecha de insercion en la base de datos.';
CREATE TABLE IF NOT EXISTS public.tmaestro_transfusiones
(
consec integer NOT NULL DEFAULT nextval('tmaestro_transfusiones_consec_seq'::regclass),
fecha timestamp without time zone,
cod_ord integer,
fecharegistro timestamp without time zone,
fechacierre timestamp without time zone,
activo boolean,
anotaciones text COLLATE pg_catalog."default",
admision integer,
codmed integer,
fechacrea timestamp without time zone DEFAULT now(),
codubi integer,
CONSTRAINT tmaestro_transfusiones_pk PRIMARY KEY (consec),
CONSTRAINT "FK_tmaestrotransfusiones_admision" FOREIGN KEY (admision)
REFERENCES public.tadmision (cod_admi) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT "FK_tmaestrotransfusiones_codmed" FOREIGN KEY (codmed)
REFERENCES public.tmedico (codigo) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT "FK_tmaestrotransfusiones_codord" FOREIGN KEY (cod_ord)
REFERENCES public.tord_proc (cod_ord) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT "tmaestro_transfusiones_codubi_FK" FOREIGN KEY (codubi)
REFERENCES public.thubicacion (cod_ubi) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tmaestro_transfusiones
OWNER to siscolsi;
CREATE TABLE IF NOT EXISTS public.tdetalle_transfusiones
(
consec integer NOT NULL DEFAULT nextval('tdetalle_transfusiones_consec_seq'::regclass),
idmaestro integer,
tiposangre character varying(20) COLLATE pg_catalog."default",
unidad integer,
sello character varying(100) COLLATE pg_catalog."default",
fechainicio timestamp without time zone,
fechavence timestamp without time zone,
equipo text COLLATE pg_catalog."default",
complicaciones text COLLATE pg_catalog."default",
CONSTRAINT pk_tdetalle_transfusiones_consec PRIMARY KEY (consec),
CONSTRAINT tdetalle_transfusiones_idmaestro_fk FOREIGN KEY (idmaestro)
REFERENCES public.tmaestro_transfusiones (consec) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tdetalle_transfusiones
OWNER to siscolsi;
CREATE TABLE IF NOT EXISTS public.tcateter
(
conse integer NOT NULL DEFAULT nextval('tcateter_conse_seq'::regclass),
descripcion character varying(200) COLLATE pg_catalog."default" NOT NULL,
estado boolean NOT NULL DEFAULT true,
CONSTRAINT tcateter_pkey PRIMARY KEY (conse)
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tcateter
OWNER to postgres;
COMMENT ON TABLE public.tcateter
IS 'para configurar los catateres que se les hace seguimiento desde la opcion de enfermeria.';
COMMENT ON COLUMN public.tcateter.conse
IS 'consecutivo interno';
COMMENT ON COLUMN public.tcateter.descripcion
IS 'nombre del cateter ';
COMMENT ON COLUMN public.tcateter.estado
IS 'estado de la configuracion';
CREATE TABLE IF NOT EXISTS public.tseguimiento_cateter
(
conseg integer NOT NULL DEFAULT nextval('tseguimiento_cateter_conseg_seq'::regclass),
codmed integer,
cod_admi numeric(20,0) NOT NULL,
fecha timestamp without time zone NOT NULL,
estom boolean NOT NULL DEFAULT false,
toraxant boolean NOT NULL DEFAULT false,
toraxpos boolean NOT NULL DEFAULT false,
msizq boolean NOT NULL DEFAULT false,
msder boolean NOT NULL DEFAULT false,
vejig boolean NOT NULL DEFAULT false,
miizq boolean NOT NULL DEFAULT false,
mider boolean NOT NULL DEFAULT false,
subclizq boolean NOT NULL DEFAULT false,
subclder boolean NOT NULL DEFAULT false,
cavasup boolean NOT NULL DEFAULT false,
cavainfer boolean NOT NULL DEFAULT false,
traque boolean NOT NULL DEFAULT false,
fechainsercion timestamp without time zone,
fecharetiro timestamp without time zone NOT NULL,
fechacuracion timestamp without time zone NOT NULL,
fechacrea timestamp without time zone NOT NULL DEFAULT now(),
obser_proce text COLLATE pg_catalog."default",
complicaciones text COLLATE pg_catalog."default",
observaciones text COLLATE pg_catalog."default",
CONSTRAINT tseguimiento_cateter_pkey PRIMARY KEY (conseg),
CONSTRAINT tseguimiento_cateter_cod_admi_fkey FOREIGN KEY (cod_admi)
REFERENCES public.tadmision (cod_admi) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT tseguimiento_cateter_codmed_fkey FOREIGN KEY (codmed)
REFERENCES public.tmedico (codigo) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tseguimiento_cateter
OWNER to postgres;
COMMENT ON TABLE public.tseguimiento_cateter
IS 'para guardar los seguimientos a los catateres intrahospitalarios';
COMMENT ON COLUMN public.tseguimiento_cateter.conseg
IS 'consecutivo interno para el guardado del seguimiento a catacter';
COMMENT ON COLUMN public.tseguimiento_cateter.codmed
IS 'codigo del profesional que realiza el seguimiento';
COMMENT ON COLUMN public.tseguimiento_cateter.cod_admi
IS 'codigo de la admision ';
COMMENT ON COLUMN public.tseguimiento_cateter.fecha
IS 'fecha del seguimiento del cateter';
COMMENT ON COLUMN public.tseguimiento_cateter.estom
IS 'ubicacion estomago';
COMMENT ON COLUMN public.tseguimiento_cateter.toraxant
IS 'ubicacion torax anterior';
COMMENT ON COLUMN public.tseguimiento_cateter.toraxpos
IS 'ubicacion torax posterior';
COMMENT ON COLUMN public.tseguimiento_cateter.msizq
IS 'ubicacion miembro superior izquierdo';
COMMENT ON COLUMN public.tseguimiento_cateter.msder
IS 'ubicacion miebro superior derecho';
COMMENT ON COLUMN public.tseguimiento_cateter.vejig
IS 'ubicacion vejiga';
COMMENT ON COLUMN public.tseguimiento_cateter.miizq
IS 'ubicacion miembro inferior izquierdo';
COMMENT ON COLUMN public.tseguimiento_cateter.mider
IS 'ubicacion miembro infeiror derecho';
COMMENT ON COLUMN public.tseguimiento_cateter.subclizq
IS 'ubicacion subclavia izquierda';
COMMENT ON COLUMN public.tseguimiento_cateter.subclder
IS 'ubicacion subclavia derecha';
COMMENT ON COLUMN public.tseguimiento_cateter.cavasup
IS 'ubicacion cava superior';
COMMENT ON COLUMN public.tseguimiento_cateter.cavainfer
IS 'ubicacion cava inferior';
COMMENT ON COLUMN public.tseguimiento_cateter.traque
IS 'ubicacion traquea';
COMMENT ON COLUMN public.tseguimiento_cateter.fechainsercion
IS 'fecha de insercion del cateter';
COMMENT ON COLUMN public.tseguimiento_cateter.fecharetiro
IS 'fecha de retiro de catater';
COMMENT ON COLUMN public.tseguimiento_cateter.fechacuracion
IS 'fecha de curacion';
COMMENT ON COLUMN public.tseguimiento_cateter.fechacrea
IS 'fecha de insercion en BD.';
COMMENT ON COLUMN public.tseguimiento_cateter.obser_proce
IS 'observaciones del seguimiento de cateteres';
COMMENT ON COLUMN public.tseguimiento_cateter.complicaciones
IS 'complicaciones del seguimiento del catater';
COMMENT ON COLUMN public.tseguimiento_cateter.observaciones
IS 'observaciones del seguimiento';
CREATE TABLE IF NOT EXISTS public.tseguimiento_cateterdet
(
conse integer NOT NULL DEFAULT nextval('tseguimiento_cateterdet_conse_seq'::regclass),
consegui integer NOT NULL,
consecat integer NOT NULL,
descripcion text COLLATE pg_catalog."default",
fechacrea timestamp without time zone NOT NULL DEFAULT now(),
CONSTRAINT tseguimiento_cateterdet_pkey PRIMARY KEY (conse),
CONSTRAINT tseguimiento_cateterdet_consecat_fkey FOREIGN KEY (consecat)
REFERENCES public.tcateter (conse) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT tseguimiento_cateterdet_consegui_fkey FOREIGN KEY (consegui)
REFERENCES public.tseguimiento_cateter (conseg) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tseguimiento_cateterdet
OWNER to postgres;
COMMENT ON TABLE public.tseguimiento_cateterdet
IS 'detalle de os seguimientos de catater';
COMMENT ON COLUMN public.tseguimiento_cateterdet.conse
IS 'consecutivo interno';
COMMENT ON COLUMN public.tseguimiento_cateterdet.consegui
IS 'consecutivo del seguimiento fk tseguimiento_cateter';
COMMENT ON COLUMN public.tseguimiento_cateterdet.consecat
IS 'consecutivo del cateter creado fk tcateter';
COMMENT ON COLUMN public.tseguimiento_cateterdet.descripcion
IS 'descripcion del seguimiento';
COMMENT ON COLUMN public.tseguimiento_cateterdet.fechacrea
IS 'fecha de insercion en BD';
To embed this project on your website, copy the following code and paste it into your website's HTML: