This commit is contained in:
Roberto Orden Erena
2019-12-14 11:23:06 +01:00
parent 239e9b7640
commit 9136d53f2c
6 changed files with 244 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 120 KiB