Base de Datos Ii
Base de Datos Ii
6) Ahora es importante ampliar el modelo para incluir áreas del hospital, por
ejemplo, urgencias, zona de hospitalización, área de atención prenatal,
área infantil. De manera que según el cuarto donde se encuentra internado
el paciente se pueda determinar el área del hospital en el que se encuentra,
realice los cambios/actualizaciones necesarias en su modelo,
impleméntelas y documente un ejemplo.
https://drive.google.com/drive/folders/15RxIQqYzGViBUNWXJ072iqyhm1pEAcEM?usp=sharing
Script-16
dump-fckstort-202211291743
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- TOC entry 24 (class 2615 OID 2200)
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--
--
-- TOC entry 4198 (class 0 OID 0)
-- Dependencies: 24
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
--
-- TOC entry 227 (class 1259 OID 733492)
-- Name: alergia; Type: TABLE; Schema: public; Owner: fckstort
--
--
-- TOC entry 226 (class 1259 OID 733490)
-- Name: alergia_idalergia_seq; Type: SEQUENCE; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4199 (class 0 OID 0)
-- Dependencies: 226
-- Name: alergia_idalergia_seq; Type: SEQUENCE OWNED BY; Schema: public;
Owner: fckstort
--
--
-- TOC entry 235 (class 1259 OID 759213)
-- Name: alergia_paciente; Type: TABLE; Schema: public; Owner: fckstort
--
--
-- TOC entry 234 (class 1259 OID 759211)
-- Name: alergia_paciente_idalergia_seq; Type: SEQUENCE; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4200 (class 0 OID 0)
-- Dependencies: 234
-- Name: alergia_paciente_idalergia_seq; Type: SEQUENCE OWNED BY; Schema:
public; Owner: fckstort
--
--
-- TOC entry 233 (class 1259 OID 759209)
-- Name: alergia_paciente_numero_de_identificacion_seq; Type: SEQUENCE;
Schema: public; Owner: fckstort
--
--
-- TOC entry 4201 (class 0 OID 0)
-- Dependencies: 233
-- Name: alergia_paciente_numero_de_identificacion_seq; Type: SEQUENCE OWNED
BY; Schema: public; Owner: fckstort
--
--
-- TOC entry 237 (class 1259 OID 831310)
-- Name: area_del_hospital; Type: TABLE; Schema: public; Owner: fckstort
--
--
-- TOC entry 236 (class 1259 OID 831308)
-- Name: area_del_hospital_idareahospital_seq; Type: SEQUENCE; Schema:
public; Owner: fckstort
--
--
-- TOC entry 4202 (class 0 OID 0)
-- Dependencies: 236
-- Name: area_del_hospital_idareahospital_seq; Type: SEQUENCE OWNED BY;
Schema: public; Owner: fckstort
--
--
-- TOC entry 243 (class 1259 OID 831551)
-- Name: cama; Type: TABLE; Schema: public; Owner: fckstort
--
--
-- TOC entry 241 (class 1259 OID 831545)
-- Name: cama_idcama_seq; Type: SEQUENCE; Schema: public; Owner: fckstort
--
--
-- TOC entry 4203 (class 0 OID 0)
-- Dependencies: 241
-- Name: cama_idcama_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner:
fckstort
--
--
-- TOC entry 242 (class 1259 OID 831547)
-- Name: cama_idcuarto_seq; Type: SEQUENCE; Schema: public; Owner: fckstort
--
--
-- TOC entry 4204 (class 0 OID 0)
-- Dependencies: 242
-- Name: cama_idcuarto_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner:
fckstort
--
--
-- TOC entry 240 (class 1259 OID 831338)
-- Name: cuarto; Type: TABLE; Schema: public; Owner: fckstort
--
--
-- TOC entry 239 (class 1259 OID 831336)
-- Name: cuarto_idareahospital_seq; Type: SEQUENCE; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4205 (class 0 OID 0)
-- Dependencies: 239
-- Name: cuarto_idareahospital_seq; Type: SEQUENCE OWNED BY; Schema: public;
Owner: fckstort
--
--
-- TOC entry 238 (class 1259 OID 831334)
-- Name: cuarto_idcuarto_seq; Type: SEQUENCE; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4206 (class 0 OID 0)
-- Dependencies: 238
-- Name: cuarto_idcuarto_seq; Type: SEQUENCE OWNED BY; Schema: public;
Owner: fckstort
--
--
-- TOC entry 232 (class 1259 OID 759071)
-- Name: paciente; Type: TABLE; Schema: public; Owner: fckstort
--
--
-- TOC entry 246 (class 1259 OID 1523014)
-- Name: registro; Type: TABLE; Schema: public; Owner: fckstort
--
--
-- TOC entry 229 (class 1259 OID 758956)
-- Name: tipo_de_sangre; Type: TABLE; Schema: public; Owner: fckstort
--
--
-- TOC entry 247 (class 1259 OID 1534474)
-- Name: datos_pacientes_actuales_view; Type: VIEW; Schema: public; Owner:
fckstort
--
--
-- TOC entry 231 (class 1259 OID 759069)
-- Name: paciente_id_tipodesangre_seq; Type: SEQUENCE; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4207 (class 0 OID 0)
-- Dependencies: 231
-- Name: paciente_id_tipodesangre_seq; Type: SEQUENCE OWNED BY; Schema:
public; Owner: fckstort
--
--
-- TOC entry 230 (class 1259 OID 759067)
-- Name: paciente_numero_de_identificacion_seq; Type: SEQUENCE; Schema:
public; Owner: fckstort
--
CREATE SEQUENCE public.paciente_numero_de_identificacion_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 4208 (class 0 OID 0)
-- Dependencies: 230
-- Name: paciente_numero_de_identificacion_seq; Type: SEQUENCE OWNED BY;
Schema: public; Owner: fckstort
--
--
-- TOC entry 245 (class 1259 OID 1523012)
-- Name: registro_idcama_seq; Type: SEQUENCE; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4209 (class 0 OID 0)
-- Dependencies: 245
-- Name: registro_idcama_seq; Type: SEQUENCE OWNED BY; Schema: public;
Owner: fckstort
--
ALTER SEQUENCE public.registro_idcama_seq OWNED BY public.registro.idcama;
--
-- TOC entry 244 (class 1259 OID 1523010)
-- Name: registro_numero_de_identificacion_seq; Type: SEQUENCE; Schema:
public; Owner: fckstort
--
--
-- TOC entry 4210 (class 0 OID 0)
-- Dependencies: 244
-- Name: registro_numero_de_identificacion_seq; Type: SEQUENCE OWNED BY;
Schema: public; Owner: fckstort
--
--
-- TOC entry 228 (class 1259 OID 758954)
-- Name: tipo_de_sangre_id_tipodesangre_seq; Type: SEQUENCE; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4211 (class 0 OID 0)
-- Dependencies: 228
-- Name: tipo_de_sangre_id_tipodesangre_seq; Type: SEQUENCE OWNED BY;
Schema: public; Owner: fckstort
--
--
-- TOC entry 4006 (class 2604 OID 733495)
-- Name: alergia idalergia; Type: DEFAULT; Schema: public; Owner: fckstort
--
--
-- TOC entry 4010 (class 2604 OID 759216)
-- Name: alergia_paciente numero_de_identificacion; Type: DEFAULT; Schema:
public; Owner: fckstort
--
--
-- TOC entry 4011 (class 2604 OID 759217)
-- Name: alergia_paciente idalergia; Type: DEFAULT; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4012 (class 2604 OID 831313)
-- Name: area_del_hospital idareahospital; Type: DEFAULT; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4015 (class 2604 OID 831554)
-- Name: cama idcama; Type: DEFAULT; Schema: public; Owner: fckstort
--
--
-- TOC entry 4016 (class 2604 OID 831555)
-- Name: cama idcuarto; Type: DEFAULT; Schema: public; Owner: fckstort
--
--
-- TOC entry 4013 (class 2604 OID 831341)
-- Name: cuarto idcuarto; Type: DEFAULT; Schema: public; Owner: fckstort
--
--
-- TOC entry 4014 (class 2604 OID 831342)
-- Name: cuarto idareahospital; Type: DEFAULT; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4008 (class 2604 OID 759074)
-- Name: paciente numero_de_identificacion; Type: DEFAULT; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4009 (class 2604 OID 759075)
-- Name: paciente id_tipodesangre; Type: DEFAULT; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4017 (class 2604 OID 1523017)
-- Name: registro numero_de_identificacion; Type: DEFAULT; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4018 (class 2604 OID 1523018)
-- Name: registro idcama; Type: DEFAULT; Schema: public; Owner: fckstort
--
--
-- TOC entry 4007 (class 2604 OID 758959)
-- Name: tipo_de_sangre id_tipodesangre; Type: DEFAULT; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4181 (class 0 OID 759213)
-- Dependencies: 235
-- Data for Name: alergia_paciente; Type: TABLE DATA; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4183 (class 0 OID 831310)
-- Dependencies: 237
-- Data for Name: area_del_hospital; Type: TABLE DATA; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4186 (class 0 OID 831338)
-- Dependencies: 240
-- Data for Name: cuarto; Type: TABLE DATA; Schema: public; Owner: fckstort
--
--
-- TOC entry 4192 (class 0 OID 1523014)
-- Dependencies: 246
-- Data for Name: registro; Type: TABLE DATA; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4175 (class 0 OID 758956)
-- Dependencies: 229
-- Data for Name: tipo_de_sangre; Type: TABLE DATA; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4212 (class 0 OID 0)
-- Dependencies: 226
-- Name: alergia_idalergia_seq; Type: SEQUENCE SET; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4213 (class 0 OID 0)
-- Dependencies: 234
-- Name: alergia_paciente_idalergia_seq; Type: SEQUENCE SET; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4214 (class 0 OID 0)
-- Dependencies: 233
-- Name: alergia_paciente_numero_de_identificacion_seq; Type: SEQUENCE SET;
Schema: public; Owner: fckstort
--
SELECT
pg_catalog.setval('public.alergia_paciente_numero_de_identificacion_seq', 1,
false);
--
-- TOC entry 4215 (class 0 OID 0)
-- Dependencies: 236
-- Name: area_del_hospital_idareahospital_seq; Type: SEQUENCE SET; Schema:
public; Owner: fckstort
--
SELECT pg_catalog.setval('public.area_del_hospital_idareahospital_seq', 1,
false);
--
-- TOC entry 4216 (class 0 OID 0)
-- Dependencies: 241
-- Name: cama_idcama_seq; Type: SEQUENCE SET; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4217 (class 0 OID 0)
-- Dependencies: 242
-- Name: cama_idcuarto_seq; Type: SEQUENCE SET; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4218 (class 0 OID 0)
-- Dependencies: 239
-- Name: cuarto_idareahospital_seq; Type: SEQUENCE SET; Schema: public;
Owner: fckstort
--
SELECT pg_catalog.setval('public.cuarto_idareahospital_seq', 1, false);
--
-- TOC entry 4219 (class 0 OID 0)
-- Dependencies: 238
-- Name: cuarto_idcuarto_seq; Type: SEQUENCE SET; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4220 (class 0 OID 0)
-- Dependencies: 231
-- Name: paciente_id_tipodesangre_seq; Type: SEQUENCE SET; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4221 (class 0 OID 0)
-- Dependencies: 230
-- Name: paciente_numero_de_identificacion_seq; Type: SEQUENCE SET; Schema:
public; Owner: fckstort
--
SELECT pg_catalog.setval('public.paciente_numero_de_identificacion_seq', 1,
false);
--
-- TOC entry 4222 (class 0 OID 0)
-- Dependencies: 245
-- Name: registro_idcama_seq; Type: SEQUENCE SET; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4223 (class 0 OID 0)
-- Dependencies: 244
-- Name: registro_numero_de_identificacion_seq; Type: SEQUENCE SET; Schema:
public; Owner: fckstort
--
SELECT pg_catalog.setval('public.registro_numero_de_identificacion_seq', 1,
false);
--
-- TOC entry 4224 (class 0 OID 0)
-- Dependencies: 228
-- Name: tipo_de_sangre_id_tipodesangre_seq; Type: SEQUENCE SET; Schema:
public; Owner: fckstort
--
SELECT pg_catalog.setval('public.tipo_de_sangre_id_tipodesangre_seq', 1,
false);
--
-- TOC entry 4020 (class 2606 OID 733497)
-- Name: alergia alergia_pkey; Type: CONSTRAINT; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4028 (class 2606 OID 831315)
-- Name: area_del_hospital area_del_hospital_pkey; Type: CONSTRAINT; Schema:
public; Owner: fckstort
--
--
-- TOC entry 4032 (class 2606 OID 831558)
-- Name: cama cama_pkey; Type: CONSTRAINT; Schema: public; Owner: fckstort
--
ALTER TABLE ONLY public.cama
ADD CONSTRAINT cama_pkey PRIMARY KEY (idcama);
--
-- TOC entry 4030 (class 2606 OID 831344)
-- Name: cuarto cuarto_pkey; Type: CONSTRAINT; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4026 (class 2606 OID 759219)
-- Name: alergia_paciente numero_de_identificacion_idalergia_pk; Type:
CONSTRAINT; Schema: public; Owner: fckstort
--
--
-- TOC entry 4024 (class 2606 OID 759077)
-- Name: paciente paciente_pkey; Type: CONSTRAINT; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4022 (class 2606 OID 758961)
-- Name: tipo_de_sangre tipo_de_sangre_pkey; Type: CONSTRAINT; Schema:
public; Owner: fckstort
--
--
-- TOC entry 4037 (class 2606 OID 831559)
-- Name: cama cama_idcuarto_fkey; Type: FK CONSTRAINT; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4035 (class 2606 OID 759225)
-- Name: alergia_paciente idalergia_alergia_paciente_fkey; Type: FK
CONSTRAINT; Schema: public; Owner: fckstort
--
--
-- TOC entry 4036 (class 2606 OID 831345)
-- Name: cuarto idareadelhospital_fkey; Type: FK CONSTRAINT; Schema: public;
Owner: fckstort
--
--
-- TOC entry 4038 (class 2606 OID 1523019)
-- Name: registro idcama_fk; Type: FK CONSTRAINT; Schema: public; Owner:
fckstort
--
--
-- TOC entry 4034 (class 2606 OID 759220)
-- Name: alergia_paciente numero_de_identificacion_alergia_paciente_fkey;
Type: FK CONSTRAINT; Schema: public; Owner: fckstort
--
--
-- TOC entry 4039 (class 2606 OID 1523024)
-- Name: registro numero_de_identificacion_fk; Type: FK CONSTRAINT; Schema:
public; Owner: fckstort
--
--
-- TOC entry 4033 (class 2606 OID 759078)
-- Name: paciente tipo_de_sangre_paciente_fkey; Type: FK CONSTRAINT; Schema:
public; Owner: fckstort
--
--
-- PostgreSQL database dump complete
--