diff --git a/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeRemote.java b/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeRemote.java index d1b02ed..78b6173 100644 --- a/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeRemote.java +++ b/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeRemote.java @@ -1,7 +1,11 @@ package ejb.medicalTest; +import java.util.Date; + import javax.ejb.Remote; +import TO.MedicalSpecialtyTO; + /** * Interfaz remota del EJB Definimos los métodos que estarán disponibles para * los clientes del EJB @@ -11,8 +15,14 @@ import javax.ejb.Remote; */ @Remote public interface MedicalTestFacadeRemote { - /** - * Definimos la interfaz remota - */ - public void ejbMethod(String parameter); + public void askQuestion(int professionalNumber, String title, String message); + public void answerQuestion(String question, String response); + public void listAllPendingQuestions(int professionalNumber); + public void addMedicalTest(int idMedicalTest, Date date, long time, int testType, String observations); + public void getMedicalTest(int idMedicalTest); + public void getQuestion(String question); + public void addImage(int idMedicalTest, String image); + public void updateImage(int idMedicalTest, String image); + public void removeImage(int idMedicalTest); + public void findSpecialistDoctorByMedicalSpeciality(MedicalSpecialtyTO speciality); } \ No newline at end of file diff --git a/1.sources/MyHealth/src/jpa/ImageJPA.java b/1.sources/MyHealth/src/jpa/ImageJPA.java new file mode 100644 index 0000000..7381f36 --- /dev/null +++ b/1.sources/MyHealth/src/jpa/ImageJPA.java @@ -0,0 +1,69 @@ +package jpa; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import TO.PatientTO; +import TO.SpecialistDoctorTO; + +/** + * + * @author Marcos García Núñez (mgarcianun@uoc.edu) + * + */ +@Entity +@Table(name = "MyHealth.Question") +public class ImageJPA implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + private int id; + private String response; + + @ManyToOne + @JoinColumn (name="QuestionId") + private PatientTO question; + + public ImageJPA() { + } + + public ImageJPA(int id, String response, PatientTO question) { + this.id = id; + this.response = response; + this.question = question; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getResponse() { + return response; + } + + public void setResponse(String response) { + this.response = response; + } + + public PatientTO getQuestion() { + return question; + } + + public void setQuestion(PatientTO question) { + this.question = question; + } +} \ No newline at end of file diff --git a/1.sources/MyHealth/src/jpa/QuestionJPA.java b/1.sources/MyHealth/src/jpa/QuestionJPA.java new file mode 100644 index 0000000..d43c22e --- /dev/null +++ b/1.sources/MyHealth/src/jpa/QuestionJPA.java @@ -0,0 +1,92 @@ +package jpa; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import TO.PatientTO; +import TO.SpecialistDoctorTO; + +/** + * + * @author Marcos García Núñez (mgarcianun@uoc.edu) + * + */ +@Entity +@Table(name = "MyHealth.Question") +public class QuestionJPA implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + private int id; + private String title; + private String message; + private int status; + + @ManyToOne + @JoinColumn (name="PatientId") + private PatientTO patient; + + public QuestionJPA() { + } + + public QuestionJPA(int id, String title, String message, int status, PatientTO patient) { + this.id = id; + this.title = title; + this.message = message; + this.status = status; + this.patient = patient; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public PatientTO getPatient() { + return patient; + } + + public void setPatient(PatientTO patient) { + this.patient = patient; + } + + + +} diff --git a/1.sources/MyHealth/src/jpa/ResponseJPA.java b/1.sources/MyHealth/src/jpa/ResponseJPA.java new file mode 100644 index 0000000..ff9e93e --- /dev/null +++ b/1.sources/MyHealth/src/jpa/ResponseJPA.java @@ -0,0 +1,69 @@ +package jpa; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import TO.PatientTO; +import TO.SpecialistDoctorTO; + +/** + * + * @author Marcos García Núñez (mgarcianun@uoc.edu) + * + */ +@Entity +@Table(name = "MyHealth.Question") +public class ResponseJPA implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + private int id; + private String response; + + @ManyToOne + @JoinColumn (name="QuestionId") + private PatientTO question; + + public ResponseJPA() { + } + + public ResponseJPA(int id, String response, PatientTO question) { + this.id = id; + this.response = response; + this.question = question; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getResponse() { + return response; + } + + public void setResponse(String response) { + this.response = response; + } + + public PatientTO getQuestion() { + return question; + } + + public void setQuestion(PatientTO question) { + this.question = question; + } +} \ No newline at end of file diff --git a/2.database/model.mwb b/2.database/model.mwb index 79a147c..bd2ce80 100644 Binary files a/2.database/model.mwb and b/2.database/model.mwb differ diff --git a/2.database/model.png b/2.database/model.png index 07d7caa..bc31323 100644 Binary files a/2.database/model.png and b/2.database/model.png differ