Avances en la pantalla de registro de usuarios nuevos (pacientes).
* Actualización de script para crear tablas (Todo a minusculas, no case sensitive) * Script de datos de pruebas de especialides médicas. * Nuevo bean para registro de usuarios (Quidato de filtro de seguridad de login, acceso sin login). * Actualización de entidades JPA con campos Identity. * Enumerado para gestionar tipos de usuarios (Paciente, Medico Familia, Especialista y Administrador) * Clase común para realizar validaciones (función para validar nif).
This commit is contained in:
@@ -1,207 +1,223 @@
|
||||
-- Table: "MyHealth"."Administrator"
|
||||
/*
|
||||
DROP TABLE myhealth.Administrator;
|
||||
DROP TABLE myhealth.FamilyDoctor;
|
||||
DROP TABLE myhealth.MedicalSpecialty;
|
||||
DROP TABLE myhealth.MedicalTest;
|
||||
DROP TABLE myhealth.Patient;
|
||||
DROP TABLE myhealth.PrimaryHealthCareCenter;
|
||||
DROP TABLE myhealth.Question;
|
||||
DROP TABLE myhealth.Response;
|
||||
DROP TABLE myhealth.SpecialistDoctor;
|
||||
DROP TABLE myhealth.Visit;
|
||||
*/
|
||||
|
||||
-- DROP TABLE "MyHealth"."Administrator";
|
||||
-- Table: MyHealth.Administrator
|
||||
|
||||
CREATE TABLE "MyHealth"."Administrator"
|
||||
-- DROP TABLE MyHealth.Administrator;
|
||||
|
||||
CREATE TABLE MyHealth.Administrator
|
||||
(
|
||||
email character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
password character varying(100) COLLATE pg_catalog."default",
|
||||
CONSTRAINT "Administrator_pkey" PRIMARY KEY (email)
|
||||
email character varying(50) COLLATE pg_catalog.default NOT NULL,
|
||||
password character varying(100) COLLATE pg_catalog.default,
|
||||
CONSTRAINT Administrator_pkey PRIMARY KEY (email)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."Administrator"
|
||||
ALTER TABLE MyHealth.Administrator
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."FamilyDoctor"
|
||||
-- Table: MyHealth.FamilyDoctor
|
||||
|
||||
-- DROP TABLE "MyHealth"."FamilyDoctor";
|
||||
-- DROP TABLE MyHealth.FamilyDoctor;
|
||||
|
||||
CREATE TABLE "MyHealth"."FamilyDoctor"
|
||||
CREATE TABLE MyHealth.FamilyDoctor
|
||||
(
|
||||
id character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
nif character(50) COLLATE pg_catalog."default",
|
||||
surname character varying(100) COLLATE pg_catalog."default",
|
||||
email character varying(120) COLLATE pg_catalog."default",
|
||||
name character varying(100) COLLATE pg_catalog."default",
|
||||
"PrimaryHealthCareCenterId" character varying(50) COLLATE pg_catalog."default",
|
||||
CONSTRAINT "FamilyDoctor_pkey" PRIMARY KEY (id)
|
||||
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
||||
password character(50) COLLATE pg_catalog.default,
|
||||
nif character(50) COLLATE pg_catalog.default,
|
||||
surname character varying(100) COLLATE pg_catalog.default,
|
||||
email character varying(120) COLLATE pg_catalog.default,
|
||||
name character varying(100) COLLATE pg_catalog.default,
|
||||
PrimaryHealthCareCenterId character varying(50) COLLATE pg_catalog.default,
|
||||
CONSTRAINT FamilyDoctor_pkey PRIMARY KEY (id)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."FamilyDoctor"
|
||||
ALTER TABLE MyHealth.FamilyDoctor
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."MedicalSpeciality"
|
||||
-- Table: MyHealth.MedicalSpecialty
|
||||
|
||||
-- DROP TABLE "MyHealth"."MedicalSpeciality";
|
||||
-- DROP TABLE MyHealth.MedicalSpecialty;
|
||||
|
||||
CREATE TABLE "MyHealth"."MedicalSpeciality"
|
||||
CREATE TABLE MyHealth.MedicalSpecialty
|
||||
(
|
||||
name text COLLATE pg_catalog."default" NOT NULL,
|
||||
description text COLLATE pg_catalog."default",
|
||||
CONSTRAINT "MedicalSpeciality_pkey" PRIMARY KEY (name)
|
||||
name text COLLATE pg_catalog.default NOT NULL,
|
||||
description text COLLATE pg_catalog.default,
|
||||
CONSTRAINT MedicalSpecialty_pkey PRIMARY KEY (name)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."MedicalSpeciality"
|
||||
ALTER TABLE MyHealth.MedicalSpecialty
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."MedicalTest"
|
||||
-- Table: MyHealth.MedicalTest
|
||||
|
||||
-- DROP TABLE "MyHealth"."MedicalTest";
|
||||
-- DROP TABLE MyHealth.MedicalTest;
|
||||
|
||||
CREATE TABLE "MyHealth"."MedicalTest"
|
||||
CREATE TABLE MyHealth.MedicalTest
|
||||
(
|
||||
id integer NOT NULL,
|
||||
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
||||
date date,
|
||||
"time" abstime,
|
||||
result text COLLATE pg_catalog."default",
|
||||
"highResImage" bytea,
|
||||
time abstime,
|
||||
result text COLLATE pg_catalog.default,
|
||||
highResImage bytea,
|
||||
type integer,
|
||||
"PatientId" character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
"SpecialistDoctorId" character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
CONSTRAINT "MedicalTest_pkey" PRIMARY KEY (id)
|
||||
PatientId character varying(50) COLLATE pg_catalog.default NOT NULL,
|
||||
SpecialistDoctorId character varying(50) COLLATE pg_catalog.default NOT NULL,
|
||||
CONSTRAINT MedicalTest_pkey PRIMARY KEY (id)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."MedicalTest"
|
||||
ALTER TABLE MyHealth.MedicalTest
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."Patient"
|
||||
-- Table: MyHealth.Patient
|
||||
|
||||
-- DROP TABLE "MyHealth"."Patient";
|
||||
-- DROP TABLE MyHealth.Patient;
|
||||
|
||||
CREATE TABLE "MyHealth"."Patient"
|
||||
CREATE TABLE MyHealth.Patient
|
||||
(
|
||||
id character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
nif character(50) COLLATE pg_catalog."default",
|
||||
surname character varying(100) COLLATE pg_catalog."default",
|
||||
email character varying(120) COLLATE pg_catalog."default",
|
||||
name character varying(100) COLLATE pg_catalog."default",
|
||||
"FamilyDoctorId" character varying(50) COLLATE pg_catalog."default",
|
||||
CONSTRAINT "Patient_pkey" PRIMARY KEY (id)
|
||||
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
||||
password character(50) COLLATE pg_catalog.default,
|
||||
nif character(50) COLLATE pg_catalog.default,
|
||||
surname character varying(100) COLLATE pg_catalog.default,
|
||||
email character varying(120) COLLATE pg_catalog.default,
|
||||
name character varying(100) COLLATE pg_catalog.default,
|
||||
FamilyDoctorId character varying(50) COLLATE pg_catalog.default,
|
||||
CONSTRAINT Patient_pkey PRIMARY KEY (id)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."Patient"
|
||||
ALTER TABLE MyHealth.Patient
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."PrimaryHealthCareCenter"
|
||||
-- Table: MyHealth.PrimaryHealthCareCenter
|
||||
|
||||
-- DROP TABLE "MyHealth"."PrimaryHealthCareCenter";
|
||||
-- DROP TABLE MyHealth.PrimaryHealthCareCenter;
|
||||
|
||||
CREATE TABLE "MyHealth"."PrimaryHealthCareCenter"
|
||||
CREATE TABLE MyHealth.PrimaryHealthCareCenter
|
||||
(
|
||||
name character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
location character varying(256) COLLATE pg_catalog."default",
|
||||
CONSTRAINT "PrimaryHealthCareCenter_pkey" PRIMARY KEY (name)
|
||||
name character varying(50) COLLATE pg_catalog.default NOT NULL,
|
||||
location character varying(256) COLLATE pg_catalog.default,
|
||||
CONSTRAINT PrimaryHealthCareCenter_pkey PRIMARY KEY (name)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."PrimaryHealthCareCenter"
|
||||
ALTER TABLE MyHealth.PrimaryHealthCareCenter
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."Question"
|
||||
-- Table: MyHealth.Question
|
||||
|
||||
-- DROP TABLE "MyHealth"."Question";
|
||||
-- DROP TABLE MyHealth.Question;
|
||||
|
||||
CREATE TABLE "MyHealth"."Question"
|
||||
CREATE TABLE MyHealth.Question
|
||||
(
|
||||
id integer NOT NULL,
|
||||
title character varying(512) COLLATE pg_catalog."default" NOT NULL,
|
||||
message character varying(8000) COLLATE pg_catalog."default" NOT NULL,
|
||||
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
||||
title character varying(512) COLLATE pg_catalog.default NOT NULL,
|
||||
message character varying(8000) COLLATE pg_catalog.default NOT NULL,
|
||||
status integer,
|
||||
"PatientId" character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
CONSTRAINT "Question_pkey" PRIMARY KEY (id)
|
||||
PatientId character varying(50) COLLATE pg_catalog.default NOT NULL,
|
||||
CONSTRAINT Question_pkey PRIMARY KEY (id)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."Question"
|
||||
ALTER TABLE MyHealth.Question
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."Response"
|
||||
-- Table: MyHealth.Response
|
||||
|
||||
-- DROP TABLE "MyHealth"."Response";
|
||||
-- DROP TABLE MyHealth.Response;
|
||||
|
||||
CREATE TABLE "MyHealth"."Response"
|
||||
CREATE TABLE MyHealth.Response
|
||||
(
|
||||
id integer NOT NULL,
|
||||
response character varying(8000) COLLATE pg_catalog."default",
|
||||
"QuestionId" integer NOT NULL,
|
||||
CONSTRAINT "Response_pkey" PRIMARY KEY (id)
|
||||
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
||||
response character varying(8000) COLLATE pg_catalog.default,
|
||||
QuestionId integer NOT NULL,
|
||||
CONSTRAINT Response_pkey PRIMARY KEY (id)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."Response"
|
||||
ALTER TABLE MyHealth.Response
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."SpecialistDoctor"
|
||||
-- Table: MyHealth.SpecialistDoctor
|
||||
|
||||
-- DROP TABLE "MyHealth"."SpecialistDoctor";
|
||||
-- DROP TABLE MyHealth.SpecialistDoctor;
|
||||
|
||||
CREATE TABLE "MyHealth"."SpecialistDoctor"
|
||||
CREATE TABLE MyHealth.SpecialistDoctor
|
||||
(
|
||||
id character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
nif character(50) COLLATE pg_catalog."default",
|
||||
surname character varying(100) COLLATE pg_catalog."default",
|
||||
email character varying(120) COLLATE pg_catalog."default",
|
||||
name character varying(100) COLLATE pg_catalog."default",
|
||||
"MedicalSpecialtyId" character varying(50) COLLATE pg_catalog."default",
|
||||
CONSTRAINT "SpecialistDoctor_pkey" PRIMARY KEY (id)
|
||||
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
||||
password character(50) COLLATE pg_catalog.default,
|
||||
nif character(50) COLLATE pg_catalog.default,
|
||||
surname character varying(100) COLLATE pg_catalog.default,
|
||||
email character varying(120) COLLATE pg_catalog.default,
|
||||
name character varying(100) COLLATE pg_catalog.default,
|
||||
MedicalSpecialtyId character varying(50) COLLATE pg_catalog.default,
|
||||
CONSTRAINT SpecialistDoctor_pkey PRIMARY KEY (id)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."SpecialistDoctor"
|
||||
ALTER TABLE MyHealth.SpecialistDoctor
|
||||
OWNER to "USER";
|
||||
|
||||
-- Table: "MyHealth"."Visit"
|
||||
-- Table: MyHealth.Visit
|
||||
|
||||
-- DROP TABLE "MyHealth"."Visit";
|
||||
-- DROP TABLE MyHealth.Visit;
|
||||
|
||||
CREATE TABLE "MyHealth"."Visit"
|
||||
CREATE TABLE MyHealth.Visit
|
||||
(
|
||||
id integer NOT NULL,
|
||||
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
||||
date date NOT NULL,
|
||||
"time" abstime NOT NULL,
|
||||
observations character varying(4000) COLLATE pg_catalog."default",
|
||||
result text COLLATE pg_catalog."default",
|
||||
"PatientId" character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
"FamilyDoctorId" character varying(50) COLLATE pg_catalog."default" NOT NULL,
|
||||
CONSTRAINT "Visit_pkey" PRIMARY KEY (id)
|
||||
time abstime NOT NULL,
|
||||
observations character varying(4000) COLLATE pg_catalog.default,
|
||||
result text COLLATE pg_catalog.default,
|
||||
PatientId character varying(50) COLLATE pg_catalog.default NOT NULL,
|
||||
FamilyDoctorId character varying(50) COLLATE pg_catalog.default NOT NULL,
|
||||
CONSTRAINT Visit_pkey PRIMARY KEY (id)
|
||||
)
|
||||
WITH (
|
||||
OIDS = FALSE
|
||||
)
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE "MyHealth"."Visit"
|
||||
ALTER TABLE MyHealth.Visit
|
||||
OWNER to "USER";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user