398 + 400
This commit is contained in:
parent
66b8798553
commit
e008933a01
6
pom.xml
6
pom.xml
@ -437,7 +437,11 @@
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
|
||||
<artifactId>owasp-java-html-sanitizer</artifactId>
|
||||
<version>20240325.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<!--<repositories>
|
||||
|
||||
@ -4,6 +4,7 @@ import com.triz.trizservice.modeles.Centre;
|
||||
import com.triz.trizservice.modeles.Machine;
|
||||
import com.triz.trizservice.modeles.ServiceUser;
|
||||
import com.triz.trizservice.modeles.TypeMachine;
|
||||
import com.triz.trizservice.security.impl.PingService;
|
||||
import com.triz.trizservice.service.TransactionService;
|
||||
import com.triz.util.UtilContext;
|
||||
import java.io.BufferedReader;
|
||||
@ -49,6 +50,9 @@ public class DicomPacsBean implements Serializable {
|
||||
@Autowired
|
||||
public UtilContext context;
|
||||
|
||||
@Autowired
|
||||
private PingService pingService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
centre = context.getCurrentEtablissement();
|
||||
@ -61,7 +65,7 @@ public class DicomPacsBean implements Serializable {
|
||||
dernierMajOrthanc = null;
|
||||
etatMwlScp = "Actif";
|
||||
dernierEtudeRecu = null;
|
||||
ping("localhost");
|
||||
pingService.startPingThread();
|
||||
}
|
||||
|
||||
public void prepareNew() {
|
||||
@ -183,31 +187,7 @@ public class DicomPacsBean implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public void ping(String host) {
|
||||
System.out.println("ping");
|
||||
System.out.println("host " + host);
|
||||
try {
|
||||
|
||||
Process process = Runtime.getRuntime()
|
||||
.exec("ping -n 4 " + host);
|
||||
|
||||
BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(
|
||||
process.getInputStream(),
|
||||
Charset.forName("CP850")
|
||||
)
|
||||
);
|
||||
|
||||
String line;
|
||||
|
||||
while ((line = reader.readLine()) != null) {
|
||||
System.out.println(line);
|
||||
}
|
||||
|
||||
process.waitFor();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
public boolean isActif() {
|
||||
return pingService.isActif();
|
||||
}
|
||||
}
|
||||
|
||||
961
src/main/java/com/triz/trizservice/bean/ExamenBean.java
Normal file
961
src/main/java/com/triz/trizservice/bean/ExamenBean.java
Normal file
@ -0,0 +1,961 @@
|
||||
package com.triz.trizservice.bean;
|
||||
|
||||
import com.itextpdf.text.Document;
|
||||
import com.itextpdf.text.Element;
|
||||
import com.itextpdf.text.Font;
|
||||
import com.itextpdf.text.FontFactory;
|
||||
import com.itextpdf.text.PageSize;
|
||||
import com.itextpdf.text.Paragraph;
|
||||
import com.itextpdf.text.Phrase;
|
||||
import com.itextpdf.text.pdf.PdfPCell;
|
||||
import com.itextpdf.text.pdf.PdfPTable;
|
||||
import com.itextpdf.text.pdf.PdfWriter;
|
||||
|
||||
import com.triz.trizservice.modeles.AlertesMedicales;
|
||||
import com.triz.trizservice.modeles.Centre;
|
||||
import com.triz.trizservice.modeles.Consultation;
|
||||
import com.triz.trizservice.modeles.Examen;
|
||||
import com.triz.trizservice.modeles.Machine;
|
||||
import com.triz.trizservice.modeles.Medecin;
|
||||
import com.triz.trizservice.modeles.Patient;
|
||||
import com.triz.trizservice.modeles.Queue;
|
||||
import com.triz.trizservice.modeles.ServiceUser;
|
||||
import com.triz.trizservice.modeles.SpecialiteMedicale;
|
||||
import com.triz.trizservice.modeles.TypeExamen;
|
||||
import com.triz.trizservice.service.TransactionService;
|
||||
|
||||
import com.triz.util.UtilContext;
|
||||
import com.triz.util.UtilFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
// Attention : PAS d'import Font ici
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import org.primefaces.PrimeFaces;
|
||||
import org.primefaces.model.DefaultStreamedContent;
|
||||
import org.primefaces.model.StreamedContent;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
|
||||
/**
|
||||
* Bean pour la liste des examens (file d'attente / queue).
|
||||
*
|
||||
* TODO : remplacer QueueFacade par le vrai service/DAO utilisé dans le projet
|
||||
* (celui qui alimente medecinBean.allMedecin, ex: medecinFacade.findAll()).
|
||||
*/
|
||||
@Component("examenBean")
|
||||
@Scope("view")
|
||||
public class ExamenBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
private TransactionService service; // TODO : remplacer par le vrai service/DAO
|
||||
|
||||
@Autowired
|
||||
private UtilContext context; // TODO : remplacer par le vrai service/DAO
|
||||
|
||||
private List<Queue> allQueue;
|
||||
|
||||
private Examen selectedExamen;
|
||||
|
||||
private Queue selectedQueue;
|
||||
|
||||
private Centre centre;
|
||||
|
||||
private Date filterDateDebut;
|
||||
private Date filterDateFin;
|
||||
private boolean filterMesExamens;
|
||||
private boolean filterMesBrouillons;
|
||||
private Medecin filterMedecinAssigne;
|
||||
private SpecialiteMedicale filterSpecialiteMedicale;
|
||||
private Machine filterMachine;
|
||||
private Medecin filterManipulateur;
|
||||
private Medecin filterMedecinInterprete;
|
||||
private List<Medecin> medecinList;
|
||||
private List<SpecialiteMedicale> specialiteMedicaleList;
|
||||
private List<Machine> machineList;
|
||||
private List<ServiceUser> manipulateurList;
|
||||
private Patient filterPatient;
|
||||
private List<Patient> patientList;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
centre = context.getCurrentEtablissement();
|
||||
allQueue = service.getQueueByCentre(centre, new Date());
|
||||
medecinList = service.getAllMedecinByCenter(centre);
|
||||
specialiteMedicaleList = service.findAll(SpecialiteMedicale.class);
|
||||
machineList = service.getAllByCentre(Machine.class, centre);
|
||||
patientList = service.getAllByCentre(Patient.class, centre);
|
||||
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Statut affiché : queue.status, avec règle d'archivage automatique
|
||||
// (Signé + date < aujourd'hui => affiché "Archivé" sans écrire en base)
|
||||
// ---------------------------------------------------------------
|
||||
public String getDisplayStatus(Queue q) {
|
||||
if (q == null || q.getStatus() == null) {
|
||||
return "";
|
||||
}
|
||||
if (getExamenByQueue(q) == null) {
|
||||
return "Enregistrer";
|
||||
}
|
||||
if (isAnnule(q)) {
|
||||
return "Annulé";
|
||||
}
|
||||
|
||||
Consultation consultation = service.getConsultationByExamen(getExamenByQueue(q));
|
||||
if (consultation != null) {
|
||||
if (consultation.getFilePathSignature() == null) {
|
||||
return "Préliminaire";
|
||||
} else {
|
||||
return "Signé";
|
||||
}
|
||||
}
|
||||
if (getExamenByQueue(q).getHeureDebut() != null && getExamenByQueue(q).getHeureFin() == null && getExamenByQueue(q).getAnnule() == false) {
|
||||
return "En cours";
|
||||
}
|
||||
|
||||
if (getExamenByQueue(q).getHeureDebut() != null && getExamenByQueue(q).getHeureFin() != null && getExamenByQueue(q).getAnnule() == false) {
|
||||
return "Terminé";
|
||||
}
|
||||
|
||||
return q.getStatus();
|
||||
}
|
||||
|
||||
public String getStatusBadgeClass(Queue q) {
|
||||
String status = getDisplayStatus(q);
|
||||
if (status == null) {
|
||||
return "";
|
||||
}
|
||||
switch (status) {
|
||||
case "Programmé":
|
||||
return "status-programme";
|
||||
case "Enregistré":
|
||||
return "status-enregistre";
|
||||
case "En cours":
|
||||
return "status-encours";
|
||||
case "Terminé":
|
||||
return "status-termine";
|
||||
case "Préliminaire":
|
||||
return "status-preliminaire";
|
||||
case "Signé":
|
||||
return "status-signe";
|
||||
case "Addenda":
|
||||
return "status-addenda";
|
||||
|
||||
case "Annulé":
|
||||
return "status-annule";
|
||||
case "Enregistrer":
|
||||
return "status-enregister";
|
||||
default:
|
||||
return "status-programme";
|
||||
}
|
||||
}
|
||||
|
||||
// MODIF : accès direct via q.getFkExamen() (relation simple Queue -> Examen)
|
||||
private boolean isAnnule(Queue q) {
|
||||
return getExamenByQueue(q) != null && Boolean.TRUE.equals(getExamenByQueue(q).getAnnule());
|
||||
}
|
||||
//
|
||||
// private boolean isDateAvantAujourdhui(Date date) {
|
||||
// if (date == null) {
|
||||
// return false;
|
||||
// }
|
||||
// Calendar today = Calendar.getInstance();
|
||||
// today.set(Calendar.HOUR_OF_DAY, 0);
|
||||
// today.set(Calendar.MINUTE, 0);
|
||||
// today.set(Calendar.SECOND, 0);
|
||||
// today.set(Calendar.MILLISECOND, 0);
|
||||
// return date.before(today.getTime());
|
||||
// }
|
||||
|
||||
public String voirExamen(Examen exam) {
|
||||
return "form.xhtml?faces-redirect=true&id=" + exam.getId();
|
||||
}
|
||||
|
||||
public String voirDossierPatient(Patient q) {
|
||||
return "/views/patient/form.xhtml?faces-redirect=true&patient=" + q.getId();
|
||||
}
|
||||
|
||||
public List<Queue> getAllQueue() {
|
||||
return allQueue;
|
||||
}
|
||||
|
||||
public void setAllQueue(List<Queue> allQueue) {
|
||||
this.allQueue = allQueue;
|
||||
}
|
||||
|
||||
public Queue getSelectedQueue() {
|
||||
return selectedQueue;
|
||||
}
|
||||
|
||||
public void setSelectedQueue(Queue selectedQueue) {
|
||||
this.selectedQueue = selectedQueue;
|
||||
}
|
||||
|
||||
public String ajouter() {
|
||||
return "form.xhtml?faces-redirect=true&modifier=true";
|
||||
}
|
||||
|
||||
public Examen getExamenByQueue(Queue queue) {
|
||||
|
||||
List<Examen> examens = service.getExamenByQueue(queue);
|
||||
|
||||
if (examens == null || examens.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (Examen examen : examens) {
|
||||
if (Boolean.FALSE.equals(examen.getAnnule())) {
|
||||
return examen;
|
||||
}
|
||||
}
|
||||
|
||||
return examens.get(0);
|
||||
}
|
||||
|
||||
public Examen getSelectedExamen() {
|
||||
return selectedExamen;
|
||||
}
|
||||
|
||||
public void setSelectedExamen(Examen selectedExamen) {
|
||||
this.selectedExamen = selectedExamen;
|
||||
}
|
||||
|
||||
public String alerteMedicaleByPatient(Queue queue) {
|
||||
List<TypeExamen> liste = service.getTypeExamenByPatient(queue.getFkPatient());
|
||||
|
||||
if (liste == null || liste.isEmpty()) {
|
||||
|
||||
return "none";
|
||||
} else {
|
||||
if (!liste.contains(queue.getFkTypeExamen())) {
|
||||
|
||||
return "warning";
|
||||
} else {
|
||||
|
||||
return "danger";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// + listes pour les p:selectOneMenu : medecinList, specialiteMedicaleList, machineList, manipulateurList
|
||||
// (à charger dans @PostConstruct ou init())
|
||||
public void applyFilters() {
|
||||
allQueue = service.getQueueByCentre(centre, new Date());
|
||||
String requete = "";
|
||||
List<Queue> filtered = new ArrayList<>(allQueue); // liste source non filtrée
|
||||
System.out.println("filtered " + filtered.size());
|
||||
System.out.println("filterDateDebut " + filterDateDebut + " filterDateFin " + filterDateFin);
|
||||
if (filterDateDebut != null && filterDateFin != null) {
|
||||
requete = " and s.date between '" + filterDateDebut + "' and '" + filterDateFin + "'";
|
||||
System.out.println("requete " + requete);
|
||||
filtered = service.getQueueByCentreByRequete(centre, requete);
|
||||
} else {
|
||||
if (filterDateDebut != null) {
|
||||
requete = " and s.date >= '" + filterDateDebut + "'";
|
||||
}
|
||||
if (filterDateFin != null) {
|
||||
requete = " and s.date <='" + filterDateFin + "'";
|
||||
}
|
||||
filtered = service.getQueueByCentreByRequete(centre, requete);
|
||||
}
|
||||
|
||||
if (filterMesBrouillons) {
|
||||
filtered.removeIf(q -> !hasCurrentUserDraftConsultation(q));
|
||||
}
|
||||
if (filterMedecinInterprete != null) {
|
||||
filtered.removeIf(q -> getExamenByQueue(q) == null
|
||||
|| !Objects.equals(getExamenByQueue(q).getFkInterpreteurAssi(), filterMedecinInterprete));
|
||||
}
|
||||
if (filterSpecialiteMedicale != null) {
|
||||
filtered.removeIf(q -> q.getFkTypeExamen() == null || q.getFkTypeExamen().getSpecialiteMedicale() == null
|
||||
|| !Objects.equals(q.getFkTypeExamen().getSpecialiteMedicale(), filterSpecialiteMedicale));
|
||||
}
|
||||
if (filterMachine != null) {
|
||||
filtered.removeIf(q -> !Objects.equals(q.getFkTypeExamen().getFkMachine(), filterMachine));
|
||||
}
|
||||
|
||||
if (filterMedecinAssigne != null) {
|
||||
filtered.removeIf(q -> {
|
||||
Examen examen = getExamenByQueue(q);
|
||||
if (examen == null || examen.getConsultationList() == null) {
|
||||
return true;
|
||||
}
|
||||
return examen.getConsultationList().stream()
|
||||
.noneMatch(c -> Objects.equals(c.getFkMedecin(), filterMedecinAssigne));
|
||||
});
|
||||
}
|
||||
System.out.println("filterManipulateur " + filterManipulateur);
|
||||
if (filterManipulateur != null) {
|
||||
filtered.removeIf(q -> getExamenByQueue(q) == null
|
||||
|| !Objects.equals(getExamenByQueue(q).getManipulateur(), filterManipulateur));
|
||||
}
|
||||
|
||||
if (filterPatient != null) {
|
||||
filtered.removeIf(q
|
||||
-> q.getFkPatient() == null
|
||||
|| !Objects.equals(q.getFkPatient(), filterPatient));
|
||||
}
|
||||
this.allQueue = filtered;
|
||||
System.out.println("allQueue " + allQueue.size());
|
||||
PrimeFaces.current().ajax().update("form:dataTable");
|
||||
}
|
||||
|
||||
public void resetFilters() {
|
||||
filterDateDebut = null;
|
||||
filterDateFin = null;
|
||||
filterMesBrouillons = false;
|
||||
filterMedecinAssigne = null;
|
||||
filterSpecialiteMedicale = null;
|
||||
filterMachine = null;
|
||||
filterManipulateur = null;
|
||||
filterMedecinInterprete = null;
|
||||
filterPatient = null;
|
||||
}
|
||||
|
||||
private boolean hasCurrentUserDraftConsultation(Queue q) {
|
||||
Examen examen = getExamenByQueue(q);
|
||||
if (examen == null || examen.getConsultationList() == null) {
|
||||
return false;
|
||||
}
|
||||
ServiceUser currentUser = context.getCurrentUser();
|
||||
if (currentUser == null) {
|
||||
return false;
|
||||
}
|
||||
return examen.getConsultationList().stream()
|
||||
.anyMatch(c -> "brouillon".equals(getTypeConsultation(c))
|
||||
&& Objects.equals(c.getFkEcritpar(), currentUser));
|
||||
}
|
||||
|
||||
public String getTypeConsultation(Consultation consultation) {
|
||||
if (consultation != null) {
|
||||
if (consultation.getSessionAnnule() == true) {
|
||||
return "annule";
|
||||
}
|
||||
if (consultation.getDefinitive() == null || consultation.getBrouillon() == null) {
|
||||
return "normal";
|
||||
}
|
||||
if (consultation.getDefinitive() == true) {
|
||||
return "definitve";
|
||||
} else {
|
||||
if (consultation.getBrouillon() == true) {
|
||||
return "brouillon";
|
||||
} else {
|
||||
return "normal";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public Date getFilterDateDebut() {
|
||||
return filterDateDebut;
|
||||
}
|
||||
|
||||
public void setFilterDateDebut(Date filterDateDebut) {
|
||||
this.filterDateDebut = filterDateDebut;
|
||||
}
|
||||
|
||||
public Date getFilterDateFin() {
|
||||
return filterDateFin;
|
||||
}
|
||||
|
||||
public void setFilterDateFin(Date filterDateFin) {
|
||||
this.filterDateFin = filterDateFin;
|
||||
}
|
||||
|
||||
public boolean isFilterMesExamens() {
|
||||
return filterMesExamens;
|
||||
}
|
||||
|
||||
public void setFilterMesExamens(boolean filterMesExamens) {
|
||||
this.filterMesExamens = filterMesExamens;
|
||||
}
|
||||
|
||||
public boolean isFilterMesBrouillons() {
|
||||
return filterMesBrouillons;
|
||||
}
|
||||
|
||||
public void setFilterMesBrouillons(boolean filterMesBrouillons) {
|
||||
this.filterMesBrouillons = filterMesBrouillons;
|
||||
}
|
||||
|
||||
public Medecin getFilterMedecinAssigne() {
|
||||
return filterMedecinAssigne;
|
||||
}
|
||||
|
||||
public void setFilterMedecinAssigne(Medecin filterMedecinAssigne) {
|
||||
this.filterMedecinAssigne = filterMedecinAssigne;
|
||||
}
|
||||
|
||||
public SpecialiteMedicale getFilterSpecialiteMedicale() {
|
||||
return filterSpecialiteMedicale;
|
||||
}
|
||||
|
||||
public void setFilterSpecialiteMedicale(SpecialiteMedicale filterSpecialiteMedicale) {
|
||||
this.filterSpecialiteMedicale = filterSpecialiteMedicale;
|
||||
}
|
||||
|
||||
public Machine getFilterMachine() {
|
||||
return filterMachine;
|
||||
}
|
||||
|
||||
public void setFilterMachine(Machine filterMachine) {
|
||||
this.filterMachine = filterMachine;
|
||||
}
|
||||
|
||||
public Medecin getFilterManipulateur() {
|
||||
return filterManipulateur;
|
||||
}
|
||||
|
||||
public void setFilterManipulateur(Medecin filterManipulateur) {
|
||||
this.filterManipulateur = filterManipulateur;
|
||||
}
|
||||
|
||||
public Medecin getFilterMedecinInterprete() {
|
||||
return filterMedecinInterprete;
|
||||
}
|
||||
|
||||
public void setFilterMedecinInterprete(Medecin filterMedecinInterprete) {
|
||||
this.filterMedecinInterprete = filterMedecinInterprete;
|
||||
}
|
||||
|
||||
public List<Medecin> getMedecinList() {
|
||||
return medecinList;
|
||||
}
|
||||
|
||||
public void setMedecinList(List<Medecin> medecinList) {
|
||||
this.medecinList = medecinList;
|
||||
}
|
||||
|
||||
public List<SpecialiteMedicale> getSpecialiteMedicaleList() {
|
||||
return specialiteMedicaleList;
|
||||
}
|
||||
|
||||
public void setSpecialiteMedicaleList(List<SpecialiteMedicale> specialiteMedicaleList) {
|
||||
this.specialiteMedicaleList = specialiteMedicaleList;
|
||||
}
|
||||
|
||||
public List<Machine> getMachineList() {
|
||||
return machineList;
|
||||
}
|
||||
|
||||
public void setMachineList(List<Machine> machineList) {
|
||||
this.machineList = machineList;
|
||||
}
|
||||
|
||||
public List<ServiceUser> getManipulateurList() {
|
||||
return manipulateurList;
|
||||
}
|
||||
|
||||
public void setManipulateurList(List<ServiceUser> manipulateurList) {
|
||||
this.manipulateurList = manipulateurList;
|
||||
}
|
||||
|
||||
public StreamedContent exportListeExamensPdf() {
|
||||
|
||||
try {
|
||||
|
||||
String fileName = "Liste_Examens_" + System.currentTimeMillis() + ".pdf";
|
||||
|
||||
File file = new File(
|
||||
UtilFile.getFilePath(
|
||||
"PDF",
|
||||
fileName
|
||||
)
|
||||
);
|
||||
|
||||
file.getParentFile().mkdirs();
|
||||
|
||||
Document document = new Document(PageSize.A4.rotate());
|
||||
|
||||
PdfWriter.getInstance(
|
||||
document,
|
||||
new FileOutputStream(file)
|
||||
);
|
||||
|
||||
document.open();
|
||||
|
||||
Font centreFont = FontFactory.getFont(
|
||||
FontFactory.HELVETICA_BOLD,
|
||||
16
|
||||
);
|
||||
|
||||
Font titleFont = FontFactory.getFont(
|
||||
FontFactory.HELVETICA_BOLD,
|
||||
14,
|
||||
Font.UNDERLINE
|
||||
);
|
||||
|
||||
Font infoFont = FontFactory.getFont(
|
||||
FontFactory.HELVETICA,
|
||||
10
|
||||
);
|
||||
|
||||
Paragraph centreParagraph = new Paragraph(
|
||||
centre != null ? centre.getName() : "",
|
||||
centreFont
|
||||
);
|
||||
|
||||
centreParagraph.setAlignment(Element.ALIGN_CENTER);
|
||||
|
||||
document.add(centreParagraph);
|
||||
|
||||
document.add(new Paragraph(" "));
|
||||
|
||||
Paragraph title = new Paragraph(
|
||||
"Liste des examens",
|
||||
titleFont
|
||||
);
|
||||
|
||||
title.setAlignment(Element.ALIGN_CENTER);
|
||||
|
||||
document.add(title);
|
||||
|
||||
document.add(new Paragraph(" "));
|
||||
|
||||
Paragraph dateGeneration = new Paragraph(
|
||||
"Date de génération : "
|
||||
+ new SimpleDateFormat("dd/MM/yyyy HH:mm")
|
||||
.format(new Date()),
|
||||
infoFont
|
||||
);
|
||||
|
||||
dateGeneration.setAlignment(Element.ALIGN_RIGHT);
|
||||
|
||||
document.add(dateGeneration);
|
||||
|
||||
document.add(new Paragraph(" "));
|
||||
|
||||
PdfPTable table = new PdfPTable(8);
|
||||
|
||||
table.setWidthPercentage(100);
|
||||
|
||||
table.setWidths(new float[]{
|
||||
15f, // Code
|
||||
25f, // Patient
|
||||
10f, // Sexe
|
||||
15f, // Priorité
|
||||
15f, // Status
|
||||
20f, // Type
|
||||
20f, // Machine
|
||||
20f // Date
|
||||
});
|
||||
|
||||
Font headerFont = FontFactory.getFont(
|
||||
FontFactory.HELVETICA_BOLD,
|
||||
10
|
||||
);
|
||||
PdfPCell cell;
|
||||
|
||||
cell = new PdfPCell(new Phrase("Code", headerFont));
|
||||
cell.setBorderWidth(1);
|
||||
table.addCell(cell);
|
||||
|
||||
cell = new PdfPCell(new Phrase("Patient", headerFont));
|
||||
cell.setBorderWidth(1);
|
||||
table.addCell(cell);
|
||||
|
||||
cell = new PdfPCell(new Phrase("Sexe", headerFont));
|
||||
cell.setBorderWidth(1);
|
||||
table.addCell(cell);
|
||||
|
||||
cell = new PdfPCell(new Phrase("Priorité", headerFont));
|
||||
cell.setBorderWidth(1);
|
||||
table.addCell(cell);
|
||||
|
||||
cell = new PdfPCell(new Phrase("Status", headerFont));
|
||||
cell.setBorderWidth(1);
|
||||
table.addCell(cell);
|
||||
|
||||
cell = new PdfPCell(new Phrase("Type examen", headerFont));
|
||||
cell.setBorderWidth(1);
|
||||
table.addCell(cell);
|
||||
|
||||
cell = new PdfPCell(new Phrase("Machine", headerFont));
|
||||
cell.setBorderWidth(1);
|
||||
table.addCell(cell);
|
||||
|
||||
cell = new PdfPCell(new Phrase("Créé le", headerFont));
|
||||
cell.setBorderWidth(1);
|
||||
table.addCell(cell);
|
||||
|
||||
Font rowFont = FontFactory.getFont(
|
||||
FontFactory.HELVETICA,
|
||||
9
|
||||
);
|
||||
|
||||
SimpleDateFormat sdfDate = new SimpleDateFormat("dd/MM/yyyy");
|
||||
SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss");
|
||||
|
||||
for (Queue q : allQueue) {
|
||||
|
||||
table.addCell(new Phrase(
|
||||
q.getFkPatient() != null
|
||||
? q.getFkPatient().getCodePatient()
|
||||
: "",
|
||||
rowFont));
|
||||
|
||||
table.addCell(new Phrase(
|
||||
q.getFkPatient() != null
|
||||
? q.getFkPatient().getNom() + " "
|
||||
+ q.getFkPatient().getPrenom()
|
||||
: "",
|
||||
rowFont));
|
||||
|
||||
table.addCell(new Phrase(
|
||||
q.getFkPatient() != null
|
||||
? q.getFkPatient().getSexe()
|
||||
: "",
|
||||
rowFont));
|
||||
|
||||
table.addCell(new Phrase(
|
||||
q.getFkPriority() != null
|
||||
? q.getFkPriority().getDesignation()
|
||||
: "",
|
||||
rowFont));
|
||||
|
||||
table.addCell(new Phrase(
|
||||
getDisplayStatus(q),
|
||||
rowFont));
|
||||
|
||||
table.addCell(new Phrase(
|
||||
q.getFkTypeExamen() != null
|
||||
? q.getFkTypeExamen().getNom()
|
||||
: "",
|
||||
rowFont));
|
||||
|
||||
table.addCell(new Phrase(
|
||||
q.getFkTypeExamen() != null
|
||||
&& q.getFkTypeExamen().getFkMachine() != null
|
||||
? q.getFkTypeExamen().getFkMachine().getNom()
|
||||
: "",
|
||||
rowFont));
|
||||
|
||||
String dateCreation = "";
|
||||
|
||||
if (q.getDate() != null) {
|
||||
|
||||
dateCreation
|
||||
= sdfDate.format(q.getDate());
|
||||
|
||||
if (q.getCreatedAt() != null) {
|
||||
|
||||
dateCreation += " "
|
||||
+ sdfTime.format(q.getCreatedAt());
|
||||
}
|
||||
}
|
||||
|
||||
table.addCell(new Phrase(
|
||||
dateCreation,
|
||||
rowFont));
|
||||
}
|
||||
|
||||
document.add(table);
|
||||
|
||||
document.close();
|
||||
|
||||
return DefaultStreamedContent.builder()
|
||||
.name(fileName)
|
||||
.contentType("application/pdf")
|
||||
.stream(() -> {
|
||||
try {
|
||||
return new FileInputStream(file);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public StreamedContent exportListeExamensExcel() {
|
||||
|
||||
try {
|
||||
|
||||
String fileName = "Liste_Examens_" + System.currentTimeMillis() + ".xlsx";
|
||||
|
||||
File file = new File(
|
||||
UtilFile.getFilePath(
|
||||
"Excel",
|
||||
fileName
|
||||
)
|
||||
);
|
||||
|
||||
file.getParentFile().mkdirs();
|
||||
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
|
||||
Sheet sheet = workbook.createSheet("Examens");
|
||||
|
||||
sheet.addMergedRegion(
|
||||
new CellRangeAddress(0, 0, 0, 8));
|
||||
|
||||
sheet.addMergedRegion(
|
||||
new CellRangeAddress(2, 2, 0, 8));
|
||||
|
||||
sheet.addMergedRegion(
|
||||
new CellRangeAddress(4, 4, 0, 8));
|
||||
|
||||
/*
|
||||
* STYLE TITRE
|
||||
*/
|
||||
CellStyle titleStyle = workbook.createCellStyle();
|
||||
|
||||
org.apache.poi.ss.usermodel.Font titleFont = workbook.createFont();
|
||||
titleFont.setBold(true);
|
||||
titleFont.setUnderline(org.apache.poi.ss.usermodel.Font.U_SINGLE);
|
||||
titleFont.setFontHeightInPoints((short) 14);
|
||||
|
||||
titleStyle.setFont(titleFont);
|
||||
titleStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
/*
|
||||
* STYLE ENTETE
|
||||
*/
|
||||
CellStyle headerStyle = workbook.createCellStyle();
|
||||
|
||||
org.apache.poi.ss.usermodel.Font headerFont = workbook.createFont();
|
||||
headerFont.setBold(true);
|
||||
|
||||
headerStyle.setFont(headerFont);
|
||||
|
||||
headerStyle.setBorderTop(BorderStyle.THIN);
|
||||
headerStyle.setBorderBottom(BorderStyle.THIN);
|
||||
headerStyle.setBorderLeft(BorderStyle.THIN);
|
||||
headerStyle.setBorderRight(BorderStyle.THIN);
|
||||
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
|
||||
/*
|
||||
* STYLE DONNEES
|
||||
*/
|
||||
CellStyle dataStyle = workbook.createCellStyle();
|
||||
|
||||
dataStyle.setBorderTop(BorderStyle.THIN);
|
||||
dataStyle.setBorderBottom(BorderStyle.THIN);
|
||||
dataStyle.setBorderLeft(BorderStyle.THIN);
|
||||
dataStyle.setBorderRight(BorderStyle.THIN);
|
||||
|
||||
int rowNum = 0;
|
||||
|
||||
Row centreRow = sheet.createRow(rowNum++);
|
||||
centreRow.setHeightInPoints(25);
|
||||
|
||||
Cell centreCell = centreRow.createCell(0);
|
||||
|
||||
centreCell.setCellValue(
|
||||
centre != null ? centre.getName() : "");
|
||||
|
||||
centreCell.setCellStyle(titleStyle);
|
||||
|
||||
rowNum++;
|
||||
|
||||
Row titleRow = sheet.createRow(rowNum++);
|
||||
titleRow.setHeightInPoints(25);
|
||||
|
||||
Cell titleCell = titleRow.createCell(0);
|
||||
|
||||
titleCell.setCellValue("Liste des examens");
|
||||
|
||||
titleCell.setCellStyle(titleStyle);
|
||||
|
||||
rowNum++;
|
||||
|
||||
Row dateRow = sheet.createRow(rowNum++);
|
||||
|
||||
Cell dateCell = dateRow.createCell(0);
|
||||
|
||||
dateCell.setCellValue(
|
||||
"Date de génération : "
|
||||
+ new SimpleDateFormat("dd/MM/yyyy HH:mm")
|
||||
.format(new Date()));
|
||||
|
||||
rowNum += 2;
|
||||
|
||||
/*
|
||||
* ENTETES
|
||||
*/
|
||||
Row header = sheet.createRow(rowNum++);
|
||||
|
||||
String[] headers = {
|
||||
"Code Patient",
|
||||
"Nom Patient",
|
||||
"Sexe",
|
||||
"Priorité",
|
||||
"Status",
|
||||
"Type Examen",
|
||||
"Machine",
|
||||
"Date",
|
||||
"Heure"
|
||||
};
|
||||
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
|
||||
Cell cell = header.createCell(i);
|
||||
|
||||
cell.setCellValue(headers[i]);
|
||||
|
||||
cell.setCellStyle(headerStyle);
|
||||
}
|
||||
|
||||
SimpleDateFormat sdfDate
|
||||
= new SimpleDateFormat("dd/MM/yyyy");
|
||||
|
||||
SimpleDateFormat sdfTime
|
||||
= new SimpleDateFormat("HH:mm:ss");
|
||||
|
||||
/*
|
||||
* DONNEES
|
||||
*/
|
||||
for (Queue q : allQueue) {
|
||||
|
||||
Row row = sheet.createRow(rowNum++);
|
||||
|
||||
Cell c0 = row.createCell(0);
|
||||
c0.setCellValue(
|
||||
q.getFkPatient() != null
|
||||
? q.getFkPatient().getCodePatient()
|
||||
: "");
|
||||
c0.setCellStyle(dataStyle);
|
||||
|
||||
Cell c1 = row.createCell(1);
|
||||
c1.setCellValue(
|
||||
q.getFkPatient() != null
|
||||
? q.getFkPatient().getNom() + " "
|
||||
+ q.getFkPatient().getPrenom()
|
||||
: "");
|
||||
c1.setCellStyle(dataStyle);
|
||||
|
||||
Cell c2 = row.createCell(2);
|
||||
c2.setCellValue(
|
||||
q.getFkPatient() != null
|
||||
? q.getFkPatient().getSexe()
|
||||
: "");
|
||||
c2.setCellStyle(dataStyle);
|
||||
|
||||
Cell c3 = row.createCell(3);
|
||||
c3.setCellValue(
|
||||
q.getFkPriority() != null
|
||||
? q.getFkPriority().getDesignation()
|
||||
: "");
|
||||
c3.setCellStyle(dataStyle);
|
||||
|
||||
Cell c4 = row.createCell(4);
|
||||
c4.setCellValue(getDisplayStatus(q));
|
||||
c4.setCellStyle(dataStyle);
|
||||
|
||||
Cell c5 = row.createCell(5);
|
||||
c5.setCellValue(
|
||||
q.getFkTypeExamen() != null
|
||||
? q.getFkTypeExamen().getNom()
|
||||
: "");
|
||||
c5.setCellStyle(dataStyle);
|
||||
|
||||
Cell c6 = row.createCell(6);
|
||||
c6.setCellValue(
|
||||
q.getFkTypeExamen() != null
|
||||
&& q.getFkTypeExamen().getFkMachine() != null
|
||||
? q.getFkTypeExamen().getFkMachine().getNom()
|
||||
: "");
|
||||
c6.setCellStyle(dataStyle);
|
||||
|
||||
Cell c7 = row.createCell(7);
|
||||
c7.setCellValue(
|
||||
q.getDate() != null
|
||||
? sdfDate.format(q.getDate())
|
||||
: "");
|
||||
c7.setCellStyle(dataStyle);
|
||||
|
||||
Cell c8 = row.createCell(8);
|
||||
c8.setCellValue(
|
||||
q.getCreatedAt() != null
|
||||
? sdfTime.format(q.getCreatedAt())
|
||||
: "");
|
||||
c8.setCellStyle(dataStyle);
|
||||
}
|
||||
|
||||
/*
|
||||
* LARGEUR COLONNES
|
||||
*/
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
sheet.autoSizeColumn(i);
|
||||
}
|
||||
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
|
||||
workbook.write(fos);
|
||||
|
||||
fos.close();
|
||||
workbook.close();
|
||||
|
||||
return DefaultStreamedContent.builder()
|
||||
.name(fileName)
|
||||
.contentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
.stream(() -> {
|
||||
try {
|
||||
return new FileInputStream(file);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Patient getFilterPatient() {
|
||||
return filterPatient;
|
||||
}
|
||||
|
||||
public void setFilterPatient(Patient filterPatient) {
|
||||
this.filterPatient = filterPatient;
|
||||
}
|
||||
|
||||
public List<Patient> getPatientList() {
|
||||
return patientList;
|
||||
}
|
||||
|
||||
public void setPatientList(List<Patient> patientList) {
|
||||
this.patientList = patientList;
|
||||
}
|
||||
}
|
||||
1056
src/main/java/com/triz/trizservice/bean/ExamenDetailBean.java
Normal file
1056
src/main/java/com/triz/trizservice/bean/ExamenDetailBean.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -26,14 +26,18 @@ import com.triz.trizservice.modeles.MedecinSpecialiste;
|
||||
import com.triz.util.UtilContext;
|
||||
import com.triz.trizservice.modeles.ServiceUser;
|
||||
import com.triz.trizservice.modeles.TypealerteTypeexamen;
|
||||
import com.triz.trizservice.security.impl.PingService;
|
||||
import com.triz.trizservice.service.TransactionService;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import org.primefaces.PrimeFaces;
|
||||
|
||||
@Component("parametresBean")
|
||||
@Scope("view")
|
||||
@Scope("session")
|
||||
public class ParametresBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -42,6 +46,8 @@ public class ParametresBean implements Serializable {
|
||||
private UtilContext utilContext;
|
||||
@Autowired
|
||||
private TransactionService service;
|
||||
@Autowired
|
||||
private PingService pingService;
|
||||
|
||||
// ===================== Paramètres de vue =====================
|
||||
private String centre1; // f:viewParam - id du centre a afficher
|
||||
@ -101,6 +107,7 @@ public class ParametresBean implements Serializable {
|
||||
|
||||
chargerToutesLesListes();
|
||||
resetSelections();
|
||||
pingService.startPingThread();
|
||||
}
|
||||
|
||||
private void chargerToutesLesListes() {
|
||||
@ -231,7 +238,7 @@ public class ParametresBean implements Serializable {
|
||||
public void editerTypeExamen(TypeExamen t) {
|
||||
System.out.println("modifier dpuis type alerte");
|
||||
typeExamenSelected = t;
|
||||
System.out.println("modifier dpuis type alerte "+t.getNom());
|
||||
System.out.println("modifier dpuis type alerte " + t.getNom());
|
||||
PrimeFaces.current().ajax().update(":parametresForm:dlgTypeExamenContent");
|
||||
}
|
||||
|
||||
@ -444,7 +451,7 @@ public class ParametresBean implements Serializable {
|
||||
|
||||
public void editerTypeAlerte(TypeAlerteMedical ta) {
|
||||
typeAlerteSelected = ta;
|
||||
selectedTypeExamen=service.getTypeExamenByTypeAlerte(ta);
|
||||
selectedTypeExamen = service.getTypeExamenByTypeAlerte(ta);
|
||||
PrimeFaces.current().ajax().update(":parametresForm:dlgTypeAlerteContent");
|
||||
}
|
||||
|
||||
@ -489,7 +496,7 @@ public class ParametresBean implements Serializable {
|
||||
}
|
||||
}
|
||||
System.out.println("EXAMEN ID = " + type.getId());
|
||||
System.out.println("EXAMEN NOM = " + type.getNom()) ;// L'association n'existe pas encore
|
||||
System.out.println("EXAMEN NOM = " + type.getNom());// L'association n'existe pas encore
|
||||
if (!existe) {
|
||||
TypealerteTypeexamen types = new TypealerteTypeexamen();
|
||||
types.setFkAlerte(typeAlerteSelected);
|
||||
@ -761,4 +768,7 @@ public class ParametresBean implements Serializable {
|
||||
return examns.size();
|
||||
}
|
||||
|
||||
public boolean isActif() {
|
||||
return pingService.isActif();
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,13 +9,22 @@ import javax.faces.convert.Converter;
|
||||
import javax.faces.convert.FacesConverter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
||||
|
||||
@FacesConverter("machineConverter")
|
||||
@Component
|
||||
public class MachineConverter implements Converter {
|
||||
|
||||
@Autowired
|
||||
protected transient TransactionService service;
|
||||
public TransactionService service;
|
||||
|
||||
public MachineConverter() {
|
||||
// JSF instancie ce convertisseur lui-même (new MachineConverter()),
|
||||
// donc @Autowired ne se déclenche jamais tout seul.
|
||||
// Cet appel va chercher le WebApplicationContext Spring actif
|
||||
// et injecte manuellement les champs @Autowired de cette instance.
|
||||
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAsObject(FacesContext fc, UIComponent uic, String value) {
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.triz.trizservice.bean.converter;
|
||||
|
||||
import com.triz.trizservice.modeles.Medecin;
|
||||
import com.triz.trizservice.modeles.SpecialiteMedicale;
|
||||
import com.triz.trizservice.service.TransactionService;
|
||||
import java.util.UUID;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.convert.Converter;
|
||||
import javax.faces.convert.FacesConverter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author FORCE TECH
|
||||
*/
|
||||
@FacesConverter("medecinConverter")
|
||||
@Component
|
||||
public class MedecinConverter implements Converter {
|
||||
|
||||
@Autowired
|
||||
protected transient TransactionService service;
|
||||
|
||||
public MedecinConverter() {
|
||||
// JSF instancie ce convertisseur lui-même (new MachineConverter()),
|
||||
// donc @Autowired ne se déclenche jamais tout seul.
|
||||
// Cet appel va chercher le WebApplicationContext Spring actif
|
||||
// et injecte manuellement les champs @Autowired de cette instance.
|
||||
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAsObject(FacesContext fc, UIComponent uic, String value) {
|
||||
|
||||
if (value == null || value.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return service.findById(Medecin.class, UUID.fromString(value));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAsString(FacesContext fc, UIComponent uic, Object object) {
|
||||
if (object == null) {
|
||||
return "";
|
||||
}
|
||||
if (object instanceof Medecin) {
|
||||
Medecin machine = (Medecin) object;
|
||||
if (machine.getId() == null) {
|
||||
return "";
|
||||
}
|
||||
return machine.getId().toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.triz.trizservice.bean.converter;
|
||||
|
||||
import com.triz.trizservice.modeles.Patient;
|
||||
import com.triz.trizservice.service.TransactionService;
|
||||
import java.util.UUID;
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.convert.Converter;
|
||||
import javax.faces.convert.FacesConverter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
||||
|
||||
@FacesConverter(value = "patientConverter")
|
||||
@Component
|
||||
public class PatientConverter implements Converter {
|
||||
|
||||
@Autowired
|
||||
private TransactionService service;
|
||||
|
||||
public PatientConverter() {
|
||||
// JSF instancie ce convertisseur lui-même (new MachineConverter()),
|
||||
// donc @Autowired ne se déclenche jamais tout seul.
|
||||
// Cet appel va chercher le WebApplicationContext Spring actif
|
||||
// et injecte manuellement les champs @Autowired de cette instance.
|
||||
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAsObject(FacesContext fc, UIComponent uic, String value) {
|
||||
|
||||
if (value == null || value.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return service.findById(Patient.class, UUID.fromString(value));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAsString(FacesContext fc, UIComponent uic, Object object) {
|
||||
|
||||
if (object == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (object instanceof String) {
|
||||
return (String) object;
|
||||
}
|
||||
|
||||
if (!(object instanceof Patient)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
Patient patient = (Patient) object;
|
||||
|
||||
return patient.getId() != null
|
||||
? patient.getId().toString()
|
||||
: "";
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,6 +7,7 @@ package com.triz.trizservice.bean.converter;
|
||||
import com.triz.trizservice.modeles.Centre;
|
||||
import com.triz.trizservice.modeles.SpecialiteMedicale;
|
||||
import com.triz.trizservice.service.TransactionService;
|
||||
import java.util.UUID;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.context.FacesContext;
|
||||
@ -14,6 +15,7 @@ import javax.faces.convert.Converter;
|
||||
import javax.faces.convert.FacesConverter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -22,27 +24,45 @@ import org.springframework.stereotype.Component;
|
||||
@FacesConverter("specialiteMedicaleConverter")
|
||||
@Component
|
||||
public class SpecialiteMedicaleConverter implements Converter {
|
||||
@Autowired
|
||||
|
||||
@Autowired
|
||||
protected transient TransactionService service;
|
||||
|
||||
public SpecialiteMedicaleConverter() {
|
||||
// JSF instancie ce convertisseur lui-même (new MachineConverter()),
|
||||
// donc @Autowired ne se déclenche jamais tout seul.
|
||||
// Cet appel va chercher le WebApplicationContext Spring actif
|
||||
// et injecte manuellement les champs @Autowired de cette instance.
|
||||
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAsObject(FacesContext fc, UIComponent uic, String value) {
|
||||
try {
|
||||
return service.findById(SpecialiteMedicale.class, value);
|
||||
} catch (NumberFormatException e)
|
||||
{
|
||||
new FacesMessage(FacesMessage.SEVERITY_ERROR, "Conversion Error", "Specialite Medicale n'existe pas.");
|
||||
}
|
||||
|
||||
return null;
|
||||
if (value == null || value.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return service.findById(SpecialiteMedicale.class, UUID.fromString(value));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAsString(FacesContext fc, UIComponent uic, Object object) {
|
||||
if (object != null) {
|
||||
return String.valueOf(((SpecialiteMedicale) object).getName());
|
||||
} else {
|
||||
return null;
|
||||
if (object == null) {
|
||||
return "";
|
||||
}
|
||||
if (object instanceof SpecialiteMedicale) {
|
||||
SpecialiteMedicale machine = (SpecialiteMedicale) object;
|
||||
if (machine.getId() == null) {
|
||||
return "";
|
||||
}
|
||||
return machine.getId().toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,6 +84,12 @@ public class Centre implements Serializable {
|
||||
@OneToMany(mappedBy = "fkCentre")
|
||||
private List<SalleDeSoin> salleDeSoinList;
|
||||
|
||||
@Column(name = "telephone")
|
||||
private String telephone;
|
||||
|
||||
@Column(name = "email")
|
||||
private String email;
|
||||
|
||||
public Centre() {
|
||||
}
|
||||
|
||||
@ -104,7 +110,6 @@ public class Centre implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
@ -268,4 +273,20 @@ public class Centre implements Serializable {
|
||||
this.joursFerierList = joursFerierList;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public void setTelephone(String telephone) {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,10 +7,12 @@ package com.triz.trizservice.modeles;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.Lob;
|
||||
@ -63,9 +65,9 @@ public class Consultation implements Serializable {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
@Lob
|
||||
@GeneratedValue
|
||||
@Column(name = "id")
|
||||
private Object id;
|
||||
private UUID id;
|
||||
@Column(name = "session_annule")
|
||||
private Boolean sessionAnnule;
|
||||
@Column(name = "date")
|
||||
@ -86,19 +88,23 @@ public class Consultation implements Serializable {
|
||||
@JoinColumn(name = "fk_patient", referencedColumnName = "id")
|
||||
@ManyToOne
|
||||
private Patient fkPatient;
|
||||
@Column(name = "brouillon")
|
||||
private Boolean brouillon;
|
||||
@Column(name = "definitive")
|
||||
private Boolean definitive;
|
||||
|
||||
public Consultation() {
|
||||
}
|
||||
|
||||
public Consultation(Object id) {
|
||||
public Consultation(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Object getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Object id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@ -207,7 +213,6 @@ public class Consultation implements Serializable {
|
||||
this.fkPatient = fkPatient;
|
||||
}
|
||||
|
||||
|
||||
@XmlTransient
|
||||
public List<Filepathrapportdictee> getFilepathrapportdicteeList() {
|
||||
return filepathrapportdicteeList;
|
||||
@ -225,4 +230,20 @@ public class Consultation implements Serializable {
|
||||
this.fkEcritpar = fkEcritpar;
|
||||
}
|
||||
|
||||
public Boolean getBrouillon() {
|
||||
return brouillon;
|
||||
}
|
||||
|
||||
public void setBrouillon(Boolean brouillon) {
|
||||
this.brouillon = brouillon;
|
||||
}
|
||||
|
||||
public Boolean getDefinitive() {
|
||||
return definitive;
|
||||
}
|
||||
|
||||
public void setDefinitive(Boolean definitive) {
|
||||
this.definitive = definitive;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.triz.trizservice.modeles;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.Lob;
|
||||
@ -25,10 +23,6 @@ import javax.validation.constraints.Size;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author FORCE TECH
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "examen")
|
||||
@XmlRootElement
|
||||
@ -65,9 +59,9 @@ public class Examen implements Serializable {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
@Lob
|
||||
@GeneratedValue
|
||||
@Column(name = "id")
|
||||
private Object id;
|
||||
private UUID id;
|
||||
@Column(name = "annule")
|
||||
private Boolean annule;
|
||||
@Column(name = "date")
|
||||
@ -83,24 +77,38 @@ public class Examen implements Serializable {
|
||||
private List<ImageCles> imageClesList;
|
||||
@OneToMany(mappedBy = "fkExamen")
|
||||
private List<FichierExamen> fichierExamenList;
|
||||
@JoinColumn(name = "fk_queue", referencedColumnName = "id")
|
||||
@ManyToOne
|
||||
private Queue fkQueue;
|
||||
@OneToMany(mappedBy = "fkExamen")
|
||||
private List<Consultation> consultationList;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "fk_queue")
|
||||
private Queue fkQueue;
|
||||
|
||||
// MODIF : ajout de l'interprète assigné (le seul champ "médecin" conservé sur Examen)
|
||||
@JoinColumn(name = "fk_interpreteur_assi", referencedColumnName = "id")
|
||||
@ManyToOne
|
||||
private Medecin fkInterpreteurAssi;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "fk_manipulateur")
|
||||
private Medecin manipulateur;
|
||||
|
||||
@Size(max = 2147483647)
|
||||
@Column(name = "observation")
|
||||
private String observation;
|
||||
|
||||
public Examen() {
|
||||
}
|
||||
|
||||
public Examen(Object id) {
|
||||
public Examen(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Object getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Object id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@ -152,7 +160,6 @@ public class Examen implements Serializable {
|
||||
this.regionExaminee = regionExaminee;
|
||||
}
|
||||
|
||||
|
||||
public String getIndicationClinique() {
|
||||
return indicationClinique;
|
||||
}
|
||||
@ -187,14 +194,6 @@ public class Examen implements Serializable {
|
||||
this.fichierExamenList = fichierExamenList;
|
||||
}
|
||||
|
||||
public Queue getFkQueue() {
|
||||
return fkQueue;
|
||||
}
|
||||
|
||||
public void setFkQueue(Queue fkQueue) {
|
||||
this.fkQueue = fkQueue;
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<Consultation> getConsultationList() {
|
||||
return consultationList;
|
||||
@ -204,6 +203,14 @@ public class Examen implements Serializable {
|
||||
this.consultationList = consultationList;
|
||||
}
|
||||
|
||||
public Medecin getFkInterpreteurAssi() {
|
||||
return fkInterpreteurAssi;
|
||||
}
|
||||
|
||||
public void setFkInterpreteurAssi(Medecin fkInterpreteurAssi) {
|
||||
this.fkInterpreteurAssi = fkInterpreteurAssi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
@ -213,7 +220,6 @@ public class Examen implements Serializable {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
||||
if (!(object instanceof Examen)) {
|
||||
return false;
|
||||
}
|
||||
@ -229,4 +235,38 @@ public class Examen implements Serializable {
|
||||
return "com.triz.trizservice.modeles.Examen[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
public String getLateralite() {
|
||||
return lateralite;
|
||||
}
|
||||
|
||||
public void setLateralite(String lateralite) {
|
||||
this.lateralite = lateralite;
|
||||
}
|
||||
|
||||
public Queue getFkQueue() {
|
||||
return fkQueue;
|
||||
}
|
||||
|
||||
public void setFkQueue(Queue fkQueue) {
|
||||
this.fkQueue = fkQueue;
|
||||
}
|
||||
|
||||
public String getObservation() {
|
||||
return observation;
|
||||
}
|
||||
|
||||
public void setObservation(String observation) {
|
||||
this.observation = observation;
|
||||
}
|
||||
|
||||
public Medecin getManipulateur() {
|
||||
return manipulateur;
|
||||
}
|
||||
|
||||
public void setManipulateur(Medecin manipulateur) {
|
||||
this.manipulateur = manipulateur;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -6,9 +6,11 @@ package com.triz.trizservice.modeles;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.Lob;
|
||||
@ -40,9 +42,9 @@ public class FichierExamen implements Serializable {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
@Lob
|
||||
@GeneratedValue
|
||||
@Column(name = "id")
|
||||
private Object id;
|
||||
private UUID id;
|
||||
@Column(name = "date")
|
||||
@Temporal(TemporalType.DATE)
|
||||
private Date date;
|
||||
@ -59,15 +61,15 @@ public class FichierExamen implements Serializable {
|
||||
public FichierExamen() {
|
||||
}
|
||||
|
||||
public FichierExamen(Object id) {
|
||||
public FichierExamen(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Object getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Object id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@ -6,9 +6,11 @@ package com.triz.trizservice.modeles;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.Lob;
|
||||
@ -40,9 +42,9 @@ public class Filepathrapportdictee implements Serializable {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
@Lob
|
||||
@GeneratedValue
|
||||
@Column(name = "id")
|
||||
private Object id;
|
||||
private UUID id;
|
||||
@Column(name = "date")
|
||||
@Temporal(TemporalType.DATE)
|
||||
private Date date;
|
||||
@ -59,15 +61,15 @@ public class Filepathrapportdictee implements Serializable {
|
||||
public Filepathrapportdictee() {
|
||||
}
|
||||
|
||||
public Filepathrapportdictee(Object id) {
|
||||
public Filepathrapportdictee(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Object getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Object id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +48,9 @@ public class ImageCles implements Serializable {
|
||||
@JoinColumn(name = "fk_examen", referencedColumnName = "id")
|
||||
@ManyToOne
|
||||
private Examen fkExamen;
|
||||
@Size(max = 500)
|
||||
@Column(name = "file_path", length = 500)
|
||||
private String filePath;
|
||||
|
||||
public ImageCles() {
|
||||
}
|
||||
@ -113,4 +116,11 @@ public class ImageCles implements Serializable {
|
||||
return "com.triz.trizservice.modeles.ImageCles[ uidDesinstancesSop=" + uidDesinstancesSop + " ]";
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,6 +50,8 @@ public class Parametre implements Serializable {
|
||||
@JoinColumn(name = "fk_centre", referencedColumnName = "id")
|
||||
@ManyToOne
|
||||
private Centre fkCentre;
|
||||
@Column(name = "addresse_ip")
|
||||
private String addresse_ip;
|
||||
|
||||
public Parametre() {
|
||||
}
|
||||
@ -115,4 +117,12 @@ public class Parametre implements Serializable {
|
||||
return "com.triz.trizservice.modeles.Parametre[ id=" + id + " ]";
|
||||
}
|
||||
|
||||
public String getAddresse_ip() {
|
||||
return addresse_ip;
|
||||
}
|
||||
|
||||
public void setAddresse_ip(String addresse_ip) {
|
||||
this.addresse_ip = addresse_ip;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ public class Patient implements Serializable {
|
||||
private String telephoneRelative;
|
||||
// @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
|
||||
@Size(max = 2147483647)
|
||||
@Column(name="email")
|
||||
@Column(name = "email")
|
||||
private String email;
|
||||
@Size(max = 2147483647)
|
||||
@Column(name = "sexe")
|
||||
@ -106,6 +106,8 @@ public class Patient implements Serializable {
|
||||
private List<AlertesMedicales> alertesMedicalesList;
|
||||
@OneToMany(mappedBy = "fkPatient")
|
||||
private List<Queue> queueList;
|
||||
@Column(name = "code_patient", unique = true, length = 10)
|
||||
private String codePatient;
|
||||
|
||||
public Patient() {
|
||||
}
|
||||
@ -122,7 +124,6 @@ public class Patient implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Date getDateNaissance() {
|
||||
return dateNaissance;
|
||||
}
|
||||
@ -131,7 +132,6 @@ public class Patient implements Serializable {
|
||||
this.dateNaissance = dateNaissance;
|
||||
}
|
||||
|
||||
|
||||
public String getTelephoneRelative() {
|
||||
return telephoneRelative;
|
||||
}
|
||||
@ -140,7 +140,6 @@ public class Patient implements Serializable {
|
||||
this.telephoneRelative = telephoneRelative;
|
||||
}
|
||||
|
||||
|
||||
public Date getCreeLe() {
|
||||
return creeLe;
|
||||
}
|
||||
@ -251,7 +250,6 @@ public class Patient implements Serializable {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -301,4 +299,12 @@ public class Patient implements Serializable {
|
||||
this.consultationList = consultationList;
|
||||
}
|
||||
|
||||
public String getCodePatient() {
|
||||
return codePatient;
|
||||
}
|
||||
|
||||
public void setCodePatient(String codePatient) {
|
||||
this.codePatient = codePatient;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,18 +1,15 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.triz.trizservice.modeles;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
@ -25,10 +22,6 @@ import javax.validation.constraints.Size;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author FORCE TECH
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "queue")
|
||||
@XmlRootElement
|
||||
@ -51,19 +44,15 @@ public class Queue implements Serializable {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
@Lob
|
||||
@GeneratedValue
|
||||
@Column(name = "id")
|
||||
private Object id;
|
||||
private UUID id;
|
||||
@Column(name = "date")
|
||||
@Temporal(TemporalType.DATE)
|
||||
private Date date;
|
||||
@Column(name = "created_at")
|
||||
@Temporal(TemporalType.TIME)
|
||||
private Date createdAt;
|
||||
@OneToMany(mappedBy = "fkQueue")
|
||||
private List<QueueStatusTime> queueStatusTimeList;
|
||||
@OneToMany(mappedBy = "fkQueue")
|
||||
private List<Examen> examenList;
|
||||
@JoinColumn(name = "fk_patient", referencedColumnName = "id")
|
||||
@ManyToOne
|
||||
private Patient fkPatient;
|
||||
@ -73,26 +62,26 @@ public class Queue implements Serializable {
|
||||
@JoinColumn(name = "fk_queue_tips", referencedColumnName = "id")
|
||||
@ManyToOne
|
||||
private QueueTips fkQueueTips;
|
||||
@JoinColumn(name = "fk_type_examen", referencedColumnName = "id")
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "fk_type_examen")
|
||||
private TypeExamen fkTypeExamen;
|
||||
|
||||
public Queue() {
|
||||
}
|
||||
|
||||
public Queue(Object id) {
|
||||
public Queue(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Object getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Object id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
@ -118,15 +107,6 @@ public class Queue implements Serializable {
|
||||
this.queueStatusTimeList = queueStatusTimeList;
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
public List<Examen> getExamenList() {
|
||||
return examenList;
|
||||
}
|
||||
|
||||
public void setExamenList(List<Examen> examenList) {
|
||||
this.examenList = examenList;
|
||||
}
|
||||
|
||||
public Patient getFkPatient() {
|
||||
return fkPatient;
|
||||
}
|
||||
@ -151,14 +131,6 @@ public class Queue implements Serializable {
|
||||
this.fkQueueTips = fkQueueTips;
|
||||
}
|
||||
|
||||
public TypeExamen getFkTypeExamen() {
|
||||
return fkTypeExamen;
|
||||
}
|
||||
|
||||
public void setFkTypeExamen(TypeExamen fkTypeExamen) {
|
||||
this.fkTypeExamen = fkTypeExamen;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
@ -168,7 +140,6 @@ public class Queue implements Serializable {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
||||
if (!(object instanceof Queue)) {
|
||||
return false;
|
||||
}
|
||||
@ -200,4 +171,12 @@ public class Queue implements Serializable {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public TypeExamen getFkTypeExamen() {
|
||||
return fkTypeExamen;
|
||||
}
|
||||
|
||||
public void setFkTypeExamen(TypeExamen fkTypeExamen) {
|
||||
this.fkTypeExamen = fkTypeExamen;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,9 +6,11 @@ package com.triz.trizservice.modeles;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.Lob;
|
||||
@ -37,9 +39,9 @@ public class QueueStatusTime implements Serializable {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
@Lob
|
||||
@GeneratedValue
|
||||
@Column(name = "id")
|
||||
private Object id;
|
||||
private UUID id;
|
||||
@Column(name = "time")
|
||||
@Temporal(TemporalType.TIME)
|
||||
private Date time;
|
||||
@ -53,15 +55,15 @@ public class QueueStatusTime implements Serializable {
|
||||
public QueueStatusTime() {
|
||||
}
|
||||
|
||||
public QueueStatusTime(Object id) {
|
||||
public QueueStatusTime(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Object getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Object id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@ -6,9 +6,11 @@ package com.triz.trizservice.modeles;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.NamedQueries;
|
||||
@ -36,9 +38,9 @@ public class Status implements Serializable {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
@Lob
|
||||
@GeneratedValue
|
||||
@Column(name = "id")
|
||||
private Object id;
|
||||
private UUID id;
|
||||
@Basic(optional = false)
|
||||
@NotNull
|
||||
@Size(min = 1, max = 2147483647)
|
||||
@ -50,20 +52,20 @@ public class Status implements Serializable {
|
||||
public Status() {
|
||||
}
|
||||
|
||||
public Status(Object id) {
|
||||
public Status(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Status(Object id, String designation) {
|
||||
public Status(UUID id, String designation) {
|
||||
this.id = id;
|
||||
this.designation = designation;
|
||||
}
|
||||
|
||||
public Object getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Object id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@ -70,6 +70,9 @@ public class TypeExamen implements Serializable {
|
||||
@JoinColumn(name = "fk_patient", referencedColumnName = "id")
|
||||
@ManyToOne
|
||||
private Patient fkPatient;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "fk_specialite_medicale")
|
||||
private SpecialiteMedicale specialiteMedicale;
|
||||
|
||||
public TypeExamen() {
|
||||
}
|
||||
@ -123,8 +126,6 @@ public class TypeExamen implements Serializable {
|
||||
this.fkPatient = fkPatient;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
@ -158,7 +159,6 @@ public class TypeExamen implements Serializable {
|
||||
this.nom = nom;
|
||||
}
|
||||
|
||||
|
||||
@XmlTransient
|
||||
public List<TypealerteTypeexamen> getTypealerteTypeexamenList() {
|
||||
return typealerteTypeexamenList;
|
||||
@ -168,4 +168,13 @@ public class TypeExamen implements Serializable {
|
||||
this.typealerteTypeexamenList = typealerteTypeexamenList;
|
||||
}
|
||||
|
||||
public SpecialiteMedicale getSpecialiteMedicale() {
|
||||
return specialiteMedicale;
|
||||
}
|
||||
|
||||
public void setSpecialiteMedicale(SpecialiteMedicale specialiteMedicale) {
|
||||
this.specialiteMedicale = specialiteMedicale;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.triz.trizservice.security.impl;
|
||||
|
||||
import com.triz.trizservice.modeles.Machine;
|
||||
import com.triz.trizservice.service.TransactionService;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PingService {
|
||||
|
||||
private volatile boolean actif;
|
||||
private volatile boolean started = false;
|
||||
|
||||
@Autowired
|
||||
private TransactionService service;
|
||||
|
||||
public boolean isActif() {
|
||||
return actif;
|
||||
}
|
||||
|
||||
public synchronized void startPingThread() {
|
||||
|
||||
if (started) {
|
||||
System.out.println("Thread déjà démarré");
|
||||
return;
|
||||
}
|
||||
|
||||
started = true;
|
||||
|
||||
Thread pingThread = new Thread(() -> {
|
||||
|
||||
while (true) {
|
||||
|
||||
try {
|
||||
ping();
|
||||
Thread.sleep(10000); // 30 secondes
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
pingThread.setDaemon(true);
|
||||
pingThread.start();
|
||||
|
||||
System.out.println("Thread Ping démarré");
|
||||
}
|
||||
|
||||
private void ping() {
|
||||
|
||||
try {
|
||||
|
||||
List<Machine> machines = service.getMachineMotOrtahnc();
|
||||
|
||||
actif = false;
|
||||
|
||||
for (Machine machine : machines) {
|
||||
System.out.println("machine "+machine.getNom());
|
||||
Process process = Runtime.getRuntime()
|
||||
.exec("ping -n 1 " + machine.getIp());
|
||||
|
||||
int result = process.waitFor();
|
||||
|
||||
if (result == 0) {
|
||||
actif = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
actif = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,11 +5,15 @@
|
||||
*/
|
||||
package com.triz.trizservice.service;
|
||||
|
||||
import com.triz.trizservice.modeles.AlertesMedicales;
|
||||
import com.triz.trizservice.modeles.Centre;
|
||||
import com.triz.trizservice.modeles.Consultation;
|
||||
import com.triz.trizservice.modeles.Examen;
|
||||
import com.triz.trizservice.modeles.Machine;
|
||||
import com.triz.trizservice.modeles.Medecin;
|
||||
import com.triz.trizservice.modeles.MedecinSpecialiste;
|
||||
import com.triz.trizservice.modeles.Patient;
|
||||
import com.triz.trizservice.modeles.Queue;
|
||||
import com.triz.trizservice.modeles.SalleDeSoin;
|
||||
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
|
||||
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
|
||||
@ -27,6 +31,7 @@ import com.triz.trizservice.modeles.TypeExamen;
|
||||
import com.triz.trizservice.modeles.TypealerteTypeexamen;
|
||||
import com.triz.trizservice.modeles.Wilaya;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -146,16 +151,30 @@ public interface DaoService {
|
||||
|
||||
public List<ServiceUser> getAllUserByCentreNotInMedecin(Centre centre);
|
||||
|
||||
public <T> List<T> getAllByCentre(Class<T> clazz, Centre centre);
|
||||
public <T> List<T> getAllByCentre(Class<T> clazz, Centre centre);
|
||||
|
||||
public <T> T getByCentre(Class<T> clazz, Centre centre);
|
||||
public <T> T getByCentre(Class<T> clazz, Centre centre);
|
||||
|
||||
public List<Machine> getMachineBySalle(SalleDeSoin salle);
|
||||
public List<Machine> getMachineBySalle(SalleDeSoin salle);
|
||||
|
||||
public List<TypeExamen> getTypeExamenByTypeAlerte(TypeAlerteMedical type);
|
||||
public List<TypeExamen> getTypeExamenByTypeAlerte(TypeAlerteMedical type);
|
||||
|
||||
public List<MedecinSpecialiste> getMedecinSpecialisteBySpecialite(SpecialiteMedicale type);
|
||||
public List<MedecinSpecialiste> getMedecinSpecialisteBySpecialite(SpecialiteMedicale type);
|
||||
|
||||
public List<TypealerteTypeexamen> getTypeAlerteExamenByTypeAlerte(TypeAlerteMedical type);
|
||||
|
||||
public List<Machine> getMachineMotOrtahnc();
|
||||
|
||||
public List<Examen> getExamenByQueue(Queue queue);
|
||||
|
||||
public List<TypeExamen> getTypeExamenByPatient(Patient patient);
|
||||
|
||||
public List<Queue> getQueueByCentre(Centre centre,Date date);
|
||||
|
||||
public Medecin getMedecinByUser(ServiceUser user);
|
||||
|
||||
public Consultation getConsultationByExamen(Examen examen);
|
||||
|
||||
public List<Queue> getQueueByCentreByRequete(Centre centre,String requete);
|
||||
|
||||
}
|
||||
|
||||
@ -6,11 +6,15 @@
|
||||
*/
|
||||
package com.triz.trizservice.service;
|
||||
|
||||
import com.triz.trizservice.modeles.AlertesMedicales;
|
||||
import com.triz.trizservice.modeles.Centre;
|
||||
import com.triz.trizservice.modeles.Consultation;
|
||||
import com.triz.trizservice.modeles.Examen;
|
||||
import com.triz.trizservice.modeles.Machine;
|
||||
import com.triz.trizservice.modeles.Medecin;
|
||||
import com.triz.trizservice.modeles.MedecinSpecialiste;
|
||||
import com.triz.trizservice.modeles.Patient;
|
||||
import com.triz.trizservice.modeles.Queue;
|
||||
import com.triz.trizservice.modeles.SalleDeSoin;
|
||||
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
|
||||
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
|
||||
@ -28,6 +32,7 @@ import com.triz.trizservice.modeles.TypeExamen;
|
||||
import com.triz.trizservice.modeles.TypealerteTypeexamen;
|
||||
import com.triz.trizservice.modeles.Wilaya;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -158,4 +163,18 @@ public interface TransactionService {
|
||||
public List<MedecinSpecialiste> getMedecinSpecialisteBySpecialite(SpecialiteMedicale type);
|
||||
|
||||
public List<TypealerteTypeexamen> getTypeAlerteExamenByTypeAlerte(TypeAlerteMedical type);
|
||||
|
||||
public List<Machine> getMachineMotOrtahnc();
|
||||
|
||||
public List<Examen> getExamenByQueue(Queue queue);
|
||||
|
||||
public List<TypeExamen> getTypeExamenByPatient(Patient patient);
|
||||
|
||||
public List<Queue> getQueueByCentre(Centre centre,Date date);
|
||||
|
||||
public Medecin getMedecinByUser(ServiceUser user);
|
||||
|
||||
public Consultation getConsultationByExamen(Examen examen);
|
||||
|
||||
public List<Queue> getQueueByCentreByRequete(Centre centre,String requete);
|
||||
}
|
||||
|
||||
@ -5,11 +5,15 @@
|
||||
*/
|
||||
package com.triz.trizservice.service.impl;
|
||||
|
||||
import com.triz.trizservice.modeles.AlertesMedicales;
|
||||
import com.triz.trizservice.modeles.Centre;
|
||||
import com.triz.trizservice.modeles.Consultation;
|
||||
import com.triz.trizservice.modeles.Examen;
|
||||
import com.triz.trizservice.modeles.Machine;
|
||||
import com.triz.trizservice.modeles.Medecin;
|
||||
import com.triz.trizservice.modeles.MedecinSpecialiste;
|
||||
import com.triz.trizservice.modeles.Patient;
|
||||
import com.triz.trizservice.modeles.Queue;
|
||||
import com.triz.trizservice.modeles.SalleDeSoin;
|
||||
import com.triz.trizservice.service.DaoService;
|
||||
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
|
||||
@ -407,8 +411,8 @@ public class DaoServiceImpl implements DaoService {
|
||||
|
||||
@Override
|
||||
public List<Machine> getMachineBySalle(SalleDeSoin salle) {
|
||||
return getCurrentSession().createQuery("select s from Machine s where s.fkSalle =:salle ").setParameter("salle", salle).list();
|
||||
}
|
||||
return getCurrentSession().createQuery("select s from Machine s where s.fkSalle =:salle ").setParameter("salle", salle).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypeExamen> getTypeExamenByTypeAlerte(TypeAlerteMedical type) {
|
||||
@ -417,11 +421,66 @@ public class DaoServiceImpl implements DaoService {
|
||||
|
||||
@Override
|
||||
public List<MedecinSpecialiste> getMedecinSpecialisteBySpecialite(SpecialiteMedicale type) {
|
||||
return getCurrentSession().createQuery("select s from MedecinSpecialiste s where s.fkSpecialite=:type ").setParameter("type", type).list();
|
||||
return getCurrentSession().createQuery("select s from MedecinSpecialiste s where s.fkSpecialite=:type ").setParameter("type", type).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypealerteTypeexamen> getTypeAlerteExamenByTypeAlerte(TypeAlerteMedical type) {
|
||||
return getCurrentSession().createQuery("select s from TypealerteTypeexamen s where s.fkAlerte=:type ").setParameter("type", type).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Machine> getMachineMotOrtahnc() {
|
||||
String hql = "SELECT m "
|
||||
+ "FROM Machine m "
|
||||
+ "LEFT JOIN m.fkTypeMachine tm "
|
||||
+ "WHERE m.actif = true "
|
||||
+ "AND (tm IS NULL OR LOWER(tm.type) NOT LIKE :type)";
|
||||
|
||||
List<Machine> machines = getCurrentSession().createQuery(hql, Machine.class)
|
||||
.setParameter("type", "%orthanc%")
|
||||
.getResultList();
|
||||
|
||||
return machines;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Examen> getExamenByQueue(Queue queue) {
|
||||
return getCurrentSession().createQuery("select s from Examen s where s.fkQueue=:type ").setParameter("type", queue).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypeExamen> getTypeExamenByPatient(Patient patient) {
|
||||
return getCurrentSession().createQuery(
|
||||
"select distinct tte.fkExamen "
|
||||
+ "from AlertesMedicales am "
|
||||
+ "join am.fkTypeAlerteMedical tam, "
|
||||
+ "TypealerteTypeexamen tte "
|
||||
+ "where am.fkPatient = :patient "
|
||||
+ "and tte.fkAlerte = tam",
|
||||
TypeExamen.class
|
||||
)
|
||||
.setParameter("patient", patient)
|
||||
.getResultList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Queue> getQueueByCentre(Centre centre,Date date) {
|
||||
return getCurrentSession().createQuery("select s from Queue s where s.fkPatient.fkCentre=:centre and s.date=:date ").setParameter("centre", centre).setParameter("date", date).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Medecin getMedecinByUser(ServiceUser user) {
|
||||
return (Medecin) getCurrentSession().createQuery("select s from Medecin s where s.fkUser=:user ").setParameter("user", user).setMaxResults(1).uniqueResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Consultation getConsultationByExamen(Examen examen) {
|
||||
return (Consultation) getCurrentSession().createQuery("select s from Consultation s where s.fkExamen=:examen and s.sessionAnnule=false").setParameter("examen", examen).setMaxResults(1).uniqueResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Queue> getQueueByCentreByRequete(Centre centre, String requete) {
|
||||
return getCurrentSession().createQuery("select s from Queue s where s.fkPatient.fkCentre=:centre"+requete).setParameter("centre", centre).list();
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,11 +5,15 @@
|
||||
*/
|
||||
package com.triz.trizservice.service.impl;
|
||||
|
||||
import com.triz.trizservice.modeles.AlertesMedicales;
|
||||
import com.triz.trizservice.modeles.Centre;
|
||||
import com.triz.trizservice.modeles.Consultation;
|
||||
import com.triz.trizservice.modeles.Examen;
|
||||
import com.triz.trizservice.modeles.Machine;
|
||||
import com.triz.trizservice.modeles.Medecin;
|
||||
import com.triz.trizservice.modeles.MedecinSpecialiste;
|
||||
import com.triz.trizservice.modeles.Patient;
|
||||
import com.triz.trizservice.modeles.Queue;
|
||||
import com.triz.trizservice.modeles.SalleDeSoin;
|
||||
import com.triz.trizservice.modeles.ServiceFonctiongroupe;
|
||||
import com.triz.trizservice.modeles.ServiceFonctionnaliter;
|
||||
@ -29,6 +33,7 @@ import com.triz.trizservice.modeles.Wilaya;
|
||||
import com.triz.trizservice.service.DaoService;
|
||||
import com.triz.trizservice.service.TransactionService;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -406,6 +411,48 @@ public class TransactionServiceImpl implements TransactionService {
|
||||
@Transactional("transactionManager")
|
||||
@Override
|
||||
public List<TypealerteTypeexamen> getTypeAlerteExamenByTypeAlerte(TypeAlerteMedical type) {
|
||||
return daoService.getTypeAlerteExamenByTypeAlerte(type);
|
||||
return daoService.getTypeAlerteExamenByTypeAlerte(type);
|
||||
}
|
||||
|
||||
@Transactional("transactionManager")
|
||||
@Override
|
||||
public List<Machine> getMachineMotOrtahnc() {
|
||||
return daoService.getMachineMotOrtahnc();
|
||||
}
|
||||
|
||||
@Transactional("transactionManager")
|
||||
@Override
|
||||
public List<Examen> getExamenByQueue(Queue queue) {
|
||||
return daoService.getExamenByQueue(queue);
|
||||
}
|
||||
|
||||
@Transactional("transactionManager")
|
||||
@Override
|
||||
public List<TypeExamen> getTypeExamenByPatient(Patient patient) {
|
||||
return daoService.getTypeExamenByPatient(patient);
|
||||
}
|
||||
|
||||
@Transactional("transactionManager")
|
||||
@Override
|
||||
public List<Queue> getQueueByCentre(Centre centre,Date date) {
|
||||
return daoService.getQueueByCentre(centre,date);
|
||||
}
|
||||
|
||||
@Transactional("transactionManager")
|
||||
@Override
|
||||
public Medecin getMedecinByUser(ServiceUser user) {
|
||||
return daoService.getMedecinByUser(user);
|
||||
}
|
||||
|
||||
@Transactional("transactionManager")
|
||||
@Override
|
||||
public Consultation getConsultationByExamen(Examen examen) {
|
||||
return daoService.getConsultationByExamen(examen);
|
||||
}
|
||||
|
||||
@Transactional("transactionManager")
|
||||
@Override
|
||||
public List<Queue> getQueueByCentreByRequete(Centre centre, String requete) {
|
||||
return daoService.getQueueByCentreByRequete(centre, requete);
|
||||
}
|
||||
}
|
||||
|
||||
92
src/main/java/com/triz/trizservice/servlet/ImageServlet.java
Normal file
92
src/main/java/com/triz/trizservice/servlet/ImageServlet.java
Normal file
@ -0,0 +1,92 @@
|
||||
package com.triz.trizservice.servlet;
|
||||
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@WebServlet("/image")
|
||||
public class ImageServlet extends HttpServlet {
|
||||
|
||||
// Racine commune à tous les dossiers virtuels servis par ce servlet.
|
||||
private static final String RACINE = "C:\\.trizRis";
|
||||
|
||||
// Whitelist des sous-dossiers autorisés : le client envoie une clé
|
||||
// ("images", "Examen", ...) et non un chemin — ça évite qu'un uid/dossier
|
||||
// arbitraire permette de lire n'importe quel fichier du disque (path traversal).
|
||||
// TODO : ajouter ici toute nouvelle destination de fichiers à l'avenir.
|
||||
private static final Map<String, String> DOSSIERS_AUTORISES = new HashMap<>();
|
||||
|
||||
static {
|
||||
DOSSIERS_AUTORISES.put("images", RACINE + File.separator + "images");
|
||||
DOSSIERS_AUTORISES.put("Examen", RACINE + File.separator + "Examen");
|
||||
}
|
||||
private static final String DOSSIER_PAR_DEFAUT = "images";
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request,
|
||||
HttpServletResponse response)
|
||||
throws IOException {
|
||||
|
||||
String uid = request.getParameter("uid");
|
||||
String dossierParam = request.getParameter("dossier");
|
||||
String dossierCle = (dossierParam == null || dossierParam.trim().isEmpty())
|
||||
? DOSSIER_PAR_DEFAUT
|
||||
: dossierParam;
|
||||
|
||||
System.out.println("====================================");
|
||||
System.out.println(">>> ImageServlet APPELE");
|
||||
System.out.println("URI : " + request.getRequestURI());
|
||||
System.out.println("UID : " + uid);
|
||||
System.out.println("DOSSIER : " + dossierCle);
|
||||
System.out.println("====================================");
|
||||
|
||||
if (uid == null || uid.trim().isEmpty()) {
|
||||
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Paramètre uid manquant");
|
||||
return;
|
||||
}
|
||||
|
||||
String dossierPhysique = DOSSIERS_AUTORISES.get(dossierCle);
|
||||
if (dossierPhysique == null) {
|
||||
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Dossier non autorisé");
|
||||
return;
|
||||
}
|
||||
|
||||
// uid doit être un simple nom de fichier (celui renvoyé par getName()) ;
|
||||
// on rejette toute tentative de traversal par précaution.
|
||||
if (uid.contains("..") || uid.contains("/") || uid.contains("\\")) {
|
||||
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "uid invalide");
|
||||
return;
|
||||
}
|
||||
|
||||
File fichier = new File(dossierPhysique, uid);
|
||||
System.out.println("Image demandée : " + fichier.getAbsolutePath());
|
||||
|
||||
if (!fichier.exists() || !fichier.isFile()) {
|
||||
System.out.println("Image introuvable : " + fichier.getAbsolutePath());
|
||||
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Image introuvable");
|
||||
return;
|
||||
}
|
||||
|
||||
String contentType = getServletContext().getMimeType(fichier.getName());
|
||||
if (contentType == null) {
|
||||
contentType = "application/octet-stream";
|
||||
}
|
||||
response.setContentType(contentType);
|
||||
response.setContentLengthLong(fichier.length());
|
||||
|
||||
try (FileInputStream input = new FileInputStream(fichier); OutputStream output = response.getOutputStream()) {
|
||||
byte[] buffer = new byte[8192];
|
||||
int longueur;
|
||||
while ((longueur = input.read(buffer)) != -1) {
|
||||
output.write(buffer, 0, longueur);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,7 @@ import org.springframework.stereotype.Service;
|
||||
public class UtilFile {
|
||||
|
||||
public String getVirtualFileUrl(String dossier, String id) {
|
||||
System.out.println(" TestOf Access : "+id);
|
||||
System.out.println(" TestOf Access : " + id);
|
||||
if (id != null) {
|
||||
if (!(id.endsWith(".png") | id.endsWith(".PNG") | id.endsWith(".jpg") | id.endsWith(".JPG") | id.endsWith(".jpeg") | id.endsWith(".JPEG") | id.endsWith(".jfif") | id.endsWith(".JFIF"))) {
|
||||
id = id + ".png";
|
||||
@ -36,7 +36,7 @@ public class UtilFile {
|
||||
}
|
||||
String imageBaseUrl = getImageApplicationUri();
|
||||
String url = imageBaseUrl + "/." + dossier + "/" + id;
|
||||
System.out.println(" TestOf Access2 : "+url);
|
||||
System.out.println(" TestOf Access2 : " + url);
|
||||
return url;
|
||||
|
||||
}
|
||||
@ -48,12 +48,11 @@ public class UtilFile {
|
||||
//System.out.println("getVirtualFileUrl :"+imageBaseUrl+"/.trizDistribution" + "/." + dossier + "/" + id);
|
||||
// String url = imageBaseUrl + "/.trizDistribution" + "/." + dossier + "/" + id;
|
||||
String url = imageBaseUrl + "/." + dossier + "/" + id;
|
||||
System.out.println("TestOfLink : "+ url);
|
||||
System.out.println("TestOfLink : " + url);
|
||||
return url;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String getVirtualFileUrl(String dossier, String repertoire, String id) {
|
||||
String imageBaseUrl = getImageApplicationUri();
|
||||
//String homeBaseDirectory = getDirectoryName();
|
||||
@ -63,17 +62,31 @@ public class UtilFile {
|
||||
return url;
|
||||
}
|
||||
|
||||
public String getVirtualImageUrl(String dossier, String repertoire, String id) {
|
||||
if (id == null || id.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
String url = "/image?uid=" + java.net.URLEncoder.encode(id, "UTF-8")
|
||||
+ "&dossier=" + java.net.URLEncoder.encode(repertoire, "UTF-8");
|
||||
System.out.println("URL IMAGE = " + url);
|
||||
return url;
|
||||
} catch (java.io.UnsupportedEncodingException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getDirectoryHome() {
|
||||
String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_CHEMAIN);
|
||||
if (racine == null) {
|
||||
racine = System.getProperty("user.home");
|
||||
}
|
||||
File file = new File(racine + File.separator + ".trizDistribution" );
|
||||
File file = new File(racine + File.separator + ".trizRis");
|
||||
|
||||
//System.err.println("file :" + file.getPath());
|
||||
file.mkdirs();
|
||||
|
||||
return racine + File.separator + ".trizDistribution";
|
||||
return racine + File.separator + ".trizRis";
|
||||
|
||||
}
|
||||
|
||||
@ -82,26 +95,26 @@ public class UtilFile {
|
||||
if (racine == null) {
|
||||
racine = System.getProperty("user.home");
|
||||
}
|
||||
File file = new File(racine + File.separator + ".trizDistribution" + File.separator + "." + dossier);
|
||||
File file = new File(racine + File.separator + ".trizRis " + File.separator + dossier);
|
||||
|
||||
//System.err.println("file :" + file.getPath());
|
||||
file.mkdirs();
|
||||
|
||||
return racine + File.separator + ".trizDistribution" + File.separator + "." + dossier;
|
||||
return racine + File.separator + ".trizRis" + File.separator + dossier;
|
||||
|
||||
}
|
||||
|
||||
public static String getDirectoryMobileName(String dossier, String racine) {
|
||||
//String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN);
|
||||
|
||||
return racine + "/" + ".trizDistribution" + "/" + "." + dossier /*+ "/"*/;
|
||||
return racine + "/" + ".trizRis" + "/" + "." + dossier /*+ "/"*/;
|
||||
|
||||
}
|
||||
|
||||
public static String getDirectoryMobileNameWithPath(String dossier) {
|
||||
String racine = new UtilGetParametre().getPropertyByKey(UtilGetParametre.TRIZDISTRIBUTION_DOSSIER_MOBILE_CHEMAIN);
|
||||
|
||||
return /*racine + "/" +*/ ".trizDistribution" + "/" + "." + dossier /*+ "/"*/;
|
||||
return /*racine + "/" +*/ ".trizRis" + "/" + "." + dossier /*+ "/"*/;
|
||||
|
||||
}
|
||||
|
||||
@ -116,7 +129,7 @@ public class UtilFile {
|
||||
}
|
||||
if (chemain.endsWith(".png") | chemain.endsWith(".PNG")) {
|
||||
BufferedImage bufferedImage;
|
||||
newChemain = chemain.substring(0, chemain.length()-4) + "_conv.jpg";
|
||||
newChemain = chemain.substring(0, chemain.length() - 4) + "_conv.jpg";
|
||||
try {
|
||||
|
||||
//read image file
|
||||
@ -140,7 +153,7 @@ public class UtilFile {
|
||||
}
|
||||
}
|
||||
File imageFile = new File(chemain);
|
||||
newChemain = chemain.substring(0, chemain.length()-(imageFile.getName().length()))+ "red_" + imageFile.getName();
|
||||
newChemain = chemain.substring(0, chemain.length() - (imageFile.getName().length())) + "red_" + imageFile.getName();
|
||||
File compressedImageFile = new File(newChemain);
|
||||
String file_reselt = imageFile.getName();
|
||||
int max = 0;
|
||||
@ -250,23 +263,21 @@ public class UtilFile {
|
||||
if (racine == null) {
|
||||
racine = System.getProperty("user.home");
|
||||
}
|
||||
File file = new File(racine + File.separator + ".trizDistribution" );
|
||||
File file = new File(racine + File.separator + ".trizRis");
|
||||
|
||||
//System.err.println("file :" + file.getPath());
|
||||
file.mkdirs();
|
||||
|
||||
return racine + File.separator + ".trizDistribution" ;
|
||||
return racine + File.separator + ".trizRis";
|
||||
|
||||
}
|
||||
|
||||
public static String getURLPath(String ip){
|
||||
public static String getURLPath(String ip) {
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
|
||||
ip = ip+ ":"+request.getLocalPort()+request.getContextPath();
|
||||
System.out.println("getURLPath:"+ip);
|
||||
ip = ip + ":" + request.getLocalPort() + request.getContextPath();
|
||||
System.out.println("getURLPath:" + ip);
|
||||
return ip;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -886,3 +886,52 @@ WHERE nom = 'Orthanc Principal';
|
||||
|
||||
ALTER TABLE machine
|
||||
ALTER COLUMN last_update TYPE TIMESTAMP USING last_update::timestamp;
|
||||
|
||||
ALTER TABLE examen ADD COLUMN fk_interpreteur_assi uuid;
|
||||
|
||||
ALTER TABLE centre
|
||||
ADD COLUMN telephone VARCHAR(50),
|
||||
ADD COLUMN email VARCHAR(255);
|
||||
|
||||
ALTER TABLE parametre
|
||||
ADD COLUMN addresse_ip VARCHAR(50);
|
||||
|
||||
ALTER TABLE examen
|
||||
ADD COLUMN observation text;
|
||||
|
||||
--- Fonctionnalite "consulter examen" ---
|
||||
INSERT INTO service_fonctionnaliter (id,nom)
|
||||
VALUES ('consult_examen','Consulter examen');
|
||||
|
||||
--- Fonctionnalite "consulter examen" ---
|
||||
INSERT INTO service_fonctionnaliter (id,nom)
|
||||
VALUES ('visu_examen','Visualiser examen');
|
||||
|
||||
ALTER TABLE consultation
|
||||
ADD COLUMN brouillon boolean;
|
||||
|
||||
ALTER TABLE consultation
|
||||
ADD COLUMN definitive boolean;
|
||||
|
||||
ALTER TABLE image_cles
|
||||
ADD COLUMN file_path VARCHAR(500);
|
||||
|
||||
ALTER TABLE type_examen
|
||||
ADD COLUMN fk_specialite_medicale UUID;
|
||||
ALTER TABLE type_examen
|
||||
ADD CONSTRAINT fk_type_examen_specialite
|
||||
FOREIGN KEY (fk_specialite_medicale)
|
||||
REFERENCES specialite_medicale(id);
|
||||
|
||||
ALTER TABLE examen
|
||||
ADD COLUMN fk_manipulateur UUID;
|
||||
ALTER TABLE examen
|
||||
ADD CONSTRAINT examen_fk_manipulateur_fkey
|
||||
FOREIGN KEY (fk_manipulateur)
|
||||
REFERENCES medecin(id);
|
||||
|
||||
ALTER TABLE patient
|
||||
ADD COLUMN code_patient VARCHAR(10);
|
||||
|
||||
ALTER TABLE patient
|
||||
ADD CONSTRAINT uk_patient_code UNIQUE (code_patient);
|
||||
@ -4319,3 +4319,104 @@ distribution.page.medecins.confirmerSuppression=\u00cates-vous s\u00fbr de voulo
|
||||
distribution.page.medecins.confirmerActivation=\u00cates-vous s\u00fbr de vouloir activer ce m\u00e9decin ?
|
||||
distribution.page.oui=Oui
|
||||
distribution.page.non=Non
|
||||
|
||||
distribution.page.examen=Examens
|
||||
distribution.page.examens.liste=Liste des Examens
|
||||
distribution.page.patient.code=Code Patient
|
||||
distribution.page.patient.nom=Patient
|
||||
distribution.page.patient.sexe=Sexe
|
||||
distribution.page.status=Status
|
||||
distribution.page.typeExamen=Type d'examen
|
||||
distribution.page.machine=Machine
|
||||
distribution.page.consulter=Consulter
|
||||
distribution.page.examen.liste.message.non=Aucun examen trouv\u00e9
|
||||
distribution.page.priorite=Priorit\u00e9
|
||||
distribution.page.creeLe=Cr\u00e9\u00e9 le
|
||||
|
||||
distribution.page.examen=Examens
|
||||
distribution.page.examens.liste=Liste des Examens
|
||||
distribution.page.examen.liste.message.non=Aucun examen trouv\u00e9
|
||||
distribution.page.patient.code=Code Patient
|
||||
distribution.page.patient.nom=Patient
|
||||
distribution.page.patient.sexe=Sexe
|
||||
distribution.page.priorite=Priorit\u00e9
|
||||
distribution.page.status=Status
|
||||
distribution.page.typeExamen=Type d'examen
|
||||
distribution.page.machine=Machine
|
||||
distribution.page.creeLe=Cr\u00e9\u00e9 le
|
||||
distribution.page.consulter=Consulter
|
||||
|
||||
distribution.page.examen.detail=D\u00e9tail Examen
|
||||
distribution.page.retour=Retour
|
||||
distribution.page.examen.ajouterSignature=Ajouter Signature
|
||||
distribution.page.examen.visualiser=Visualizer
|
||||
distribution.page.examen.consultation=Consultation
|
||||
distribution.page.modifier=Modifier
|
||||
distribution.page.observation=Observation
|
||||
distribution.page.interpreteurAssigne=Interpr\u00e9teur Assign\u00e9
|
||||
distribution.page.completeLe=Compl\u00e9t\u00e9 le
|
||||
distribution.page.consulteLe=Consult\u00e9 le
|
||||
distribution.page.rapportCreeLe=Rapport cr\u00e9\u00e9 le
|
||||
distribution.page.etudeInstanceId=Etude Instance Id
|
||||
distribution.page.lateralite=Lat\u00e9ralit\u00e9
|
||||
distribution.page.consultation=Consultation
|
||||
distribution.page.fichiers=Fichiers attach\u00e9s
|
||||
distribution.page.imagesCles=Images Cl\u00e9s
|
||||
distribution.page.historiqueConsultation=Historique Consultation
|
||||
distribution.page.typeConsultation=Type Consultation
|
||||
distribution.page.preliminaire=Pr\u00e9liminaire
|
||||
distribution.page.medecinConsultant=M\u00e9decin Consultant
|
||||
distribution.page.rapportEcritPar=Rapport \u00c9crit par
|
||||
distribution.page.rapportEcrit=Rapport \u00c9crit
|
||||
distribution.page.rapportsDictes=Rapports Dict\u00e9s
|
||||
distribution.page.ajouterEnregistrement=Ajouter un enregistrement
|
||||
distribution.page.aucuneConsultation=Aucune consultation associ\u00e9e
|
||||
distribution.page.enregistrer=Enregistrer
|
||||
distribution.page.voirPlus=Voir plus
|
||||
distribution.page.voirMoins=Voir Moins
|
||||
|
||||
distribution.page.rapport=Rapport
|
||||
|
||||
distribution.page.fichiers.ajouter=Ajouter un fichier
|
||||
distribution.page.fichiers.aucun= il n'existe aucun fichier
|
||||
distribution.page.fichiers.confirmerSuppression=Voulez-vous vraiment supprimer ce fichier ?
|
||||
# Onglet Historique Consultation
|
||||
distribution.page.historiqueConsultation=Historique Consultation
|
||||
distribution.label.dateHeure=Date et heure
|
||||
distribution.label.etat=\u00c9tat
|
||||
distribution.label.medecin=M\u00e9decin
|
||||
distribution.message.aucuneConsultation=Aucune consultation pour cet examen
|
||||
|
||||
# \u00c9tats de consultation (via getTypeConsultation)
|
||||
distribution.statut.annule=Annul\u00e9
|
||||
distribution.statut.normal=Normal
|
||||
distribution.statut.definitve=D\u00e9finitive
|
||||
distribution.statut.brouillon=Brouillon
|
||||
|
||||
distribution.label.actions=Actions
|
||||
distribution.label.rapportConsultation=Rapport de consultation
|
||||
distribution.label.fermer=Fermer
|
||||
distribution.message.aucuneImageCle=Aucune image cl\u00e9 pour cet examen
|
||||
|
||||
distribution.filtre.periode=P\u00e9riode
|
||||
distribution.filtre.dateDebut=Date de d\u00e9but
|
||||
distribution.filtre.dateFin=Date de fin
|
||||
distribution.filtre.rapide=Filtres rapides
|
||||
distribution.filtre.mesExamens=Examens qui me sont assign\u00e9s
|
||||
distribution.filtre.mesBrouillons=Mes brouillons en cours
|
||||
distribution.filtre.criteres=Crit\u00e8res
|
||||
distribution.filtre.medecinAssigne=M\u00e9decin assign\u00e9
|
||||
distribution.filtre.specialite=Sp\u00e9cialit\u00e9 m\u00e9dicale
|
||||
distribution.filtre.typeMachine=Type machine
|
||||
distribution.filtre.manipulateur=Manipulateur
|
||||
distribution.filtre.medecinInterprete=M\u00e9decin interpr\u00e8te
|
||||
distribution.filtre.medecinManipulateur=M\u00e9decin Manipulateur
|
||||
distribution.filtre.reinitialiser=R\u00e9initialiser
|
||||
distribution.filtre.appliquer=Appliquer
|
||||
distribution.page.valider=Valider
|
||||
distribution.page.annuler=Annuler
|
||||
distribution.message.consultationValidee=Examen valid\u00e9e avec succ\u00e8s
|
||||
distribution.message.consultationAnnulee=Examen annul\u00e9e
|
||||
distribution.page.selectionner=S\u00e9lectionner
|
||||
distribution.page.confirmerValidation=Confirmez-vous la validation de cet examen ?
|
||||
distribution.page.confirmerAnnulation=Confirmez-vous l'annulation de cet examen ?
|
||||
@ -119,7 +119,7 @@
|
||||
<p:menuitem id="m_examen"
|
||||
value="Examens"
|
||||
icon="pi pi-heart"
|
||||
url="#{request.contextPath}/views/secteur/list.xhtml?idpage=Suivis_flotte"
|
||||
url="#{request.contextPath}/views/Examen/list.xhtml?idpage=Suivis_flotte"
|
||||
rendered="#{utilControleAccess.isshowPrivilegeAdd('exam')}" />
|
||||
|
||||
<p:menuitem id="m_dossier_patients"
|
||||
|
||||
BIN
src/main/webapp/resources/images/Vector.png
Normal file
BIN
src/main/webapp/resources/images/Vector.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@ -19,6 +19,7 @@
|
||||
.dicom-cards {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
@ -220,7 +221,19 @@
|
||||
border: 0.5px solid #B4B2A9;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.dicom-card-value-actif {
|
||||
color: #0D9488;
|
||||
}
|
||||
.dicom-card-value-actif .pi {
|
||||
color: #0D9488;
|
||||
}
|
||||
|
||||
.dicom-card-value-inactif {
|
||||
color: #EF4444;
|
||||
}
|
||||
.dicom-card-value-inactif .pi {
|
||||
color: #EF4444;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h:form id="dicomPacsForm">
|
||||
@ -240,16 +253,21 @@
|
||||
</h:outputText>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dicom-card">
|
||||
<div class="dicom-card-title">
|
||||
<span class="pi pi-sync" /> Etat MWL SCP
|
||||
<h:panelGroup id="statusPanel" layout="block" style="flex:1;">
|
||||
<div class="dicom-card">
|
||||
<div class="dicom-card-title">
|
||||
<span class="pi pi-sync" /> Etat MWL SCP
|
||||
</div>
|
||||
<div class="dicom-card-value #{dicomPacsBean.actif ? 'dicom-card-value-actif' : 'dicom-card-value-inactif'}">
|
||||
<span class="#{dicomPacsBean.actif ? 'pi pi-check-circle' : 'pi pi-times-circle'}" />
|
||||
<h:outputText value="#{dicomPacsBean.actif ? 'Actif' : 'Inactif'}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dicom-card-value dicom-card-value-actif">
|
||||
<span class="pi pi-check-circle" />
|
||||
<h:outputText value="#{dicomPacsBean.etatMwlScp}" />
|
||||
</div>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
<p:poll widgetVar="pollStatusCentre"
|
||||
interval="10"
|
||||
update="statusPanel"
|
||||
onerror="if (args && args.status === 'server') { window.location.reload(); }" />
|
||||
|
||||
<div class="dicom-card">
|
||||
<div class="dicom-card-title">
|
||||
@ -282,7 +300,9 @@
|
||||
rendered="#{utilControleAccess.isshowPrivilegeAdd('pacs')}"
|
||||
actionListener="#{dicomPacsBean.prepareNew}"
|
||||
update=":dicomPacsForm:dlgMachine"
|
||||
oncomplete="PF('wDlgMachine').show()" />
|
||||
onclick="if (PF('pollStatusCentre')) {
|
||||
PF('pollStatusCentre').stop();"
|
||||
oncomplete ="PF('wDlgMachine').show()" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -346,6 +366,8 @@
|
||||
rendered="#{utilControleAccess.isshowPrivilegeUpdate('pacs')}"
|
||||
actionListener="#{dicomPacsBean.prepareEdit(machine)}"
|
||||
oncomplete="PF('wDlgMachine').show()"
|
||||
onclick="if (PF('pollStatusCentre')) {
|
||||
PF('pollStatusCentre').stop();"
|
||||
process="@this"/>
|
||||
</p:column>
|
||||
|
||||
|
||||
1505
src/main/webapp/views/Examen/form.xhtml
Normal file
1505
src/main/webapp/views/Examen/form.xhtml
Normal file
File diff suppressed because it is too large
Load Diff
444
src/main/webapp/views/Examen/list.xhtml
Normal file
444
src/main/webapp/views/Examen/list.xhtml
Normal file
@ -0,0 +1,444 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
template="/WEB-INF/layout/template.xhtml">
|
||||
<ui:define name="title">
|
||||
#{msg['distribution.page.examen']}
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="breadcrumb">
|
||||
<f:metadata>
|
||||
<f:viewParam name="homeOutcome" value="/favorites/dashboard" />
|
||||
<f:viewParam name="value" value="Examens" />
|
||||
|
||||
</f:metadata>
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="content">
|
||||
<style>
|
||||
.card .ui-datatable-tablewrapper table td,
|
||||
.card .ui-datatable-tablewrapper table th {
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
.card .ui-datatable-tablewrapper table td {
|
||||
padding-top: 14px !important;
|
||||
padding-bottom: 14px !important;
|
||||
}
|
||||
|
||||
.page-center-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: calc(100vh - 160px);
|
||||
}
|
||||
.page-center-wrapper .card {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-header-title {
|
||||
font-weight: 700;
|
||||
font-size: 1.05rem;
|
||||
color: #343a40;
|
||||
}
|
||||
|
||||
.btn-green-outline,
|
||||
.btn-green-outline.ui-button {
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid #0D9488 !important;
|
||||
color: #0D9488 !important;
|
||||
}
|
||||
.btn-green-outline:hover {
|
||||
background-color: #e6f5f4 !important;
|
||||
}
|
||||
|
||||
.btn-view-green,
|
||||
.btn-view-green.ui-button {
|
||||
background-color: #0D9488 !important;
|
||||
border-color: #0D9488 !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
.btn-view-green:hover {
|
||||
background-color: #0b7d73 !important;
|
||||
}
|
||||
|
||||
.btn-export {
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid #dee2e6 !important;
|
||||
color: #0D9488 !important;
|
||||
}
|
||||
.btn-export:hover {
|
||||
background-color: #e6f5f4 !important;
|
||||
border-color: #0D9488 !important;
|
||||
}
|
||||
|
||||
.patient-code-link {
|
||||
color: #0D9488;
|
||||
font-weight: 600;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
.patient-code-link:hover {
|
||||
color: #0b7d73;
|
||||
}
|
||||
.patient-code-link .pi {
|
||||
font-size: 0.85rem;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 4px 14px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.status-programme {
|
||||
background-color: #6c757d;
|
||||
}
|
||||
.status-enregistre {
|
||||
background-color: #F5A623;
|
||||
}
|
||||
.status-encours {
|
||||
background-color: #29ABE2;
|
||||
}
|
||||
.status-termine {
|
||||
background-color: #A9744F;
|
||||
}
|
||||
.status-preliminaire {
|
||||
background-color: #0D9488;
|
||||
}
|
||||
.status-signe {
|
||||
background-color: #378ADD;
|
||||
}
|
||||
.status-addenda {
|
||||
background-color: #9B59B6;
|
||||
}
|
||||
|
||||
.status-annule {
|
||||
background-color: #F16B77;
|
||||
}
|
||||
.status-enregister {
|
||||
background-color: #6366F1;
|
||||
}
|
||||
|
||||
.examen-filter-panel.ui-overlaypanel {
|
||||
border-radius: 8px;
|
||||
border: 0.5px solid #B4B2A9;
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
}
|
||||
|
||||
.examen-filter-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.filter-section-title {
|
||||
font-size: 11px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
font-weight: 600;
|
||||
color: #6B6B63;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.filter-date-range {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.filter-date-range .ui-calendar {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.filter-checkbox-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.filter-select.ui-selectonemenu {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.filter-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 0.5px solid #B4B2A9;
|
||||
}
|
||||
.examen-filter-panel.ui-overlaypanel {
|
||||
width: 440px !important;
|
||||
}
|
||||
|
||||
.examen-filter-grid {
|
||||
padding: 8px 4px;
|
||||
}
|
||||
|
||||
.filter-select.ui-selectonemenu {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Bouton de fermeture (le rond avec le X) */
|
||||
.examen-filter-panel .ui-overlaypanel-close {
|
||||
background-color: #0D9488 !important;
|
||||
border-color: #0D9488 !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
.examen-filter-panel .ui-overlaypanel-close:hover {
|
||||
background-color: #0b7d73 !important;
|
||||
border-color: #0b7d73 !important;
|
||||
}
|
||||
|
||||
/* Selon la version PrimeFaces, l'icône est soit une police d'icônes (pi), soit un sprite ui-icon */
|
||||
.examen-filter-panel .ui-overlaypanel-close .pi,
|
||||
.examen-filter-panel .ui-overlaypanel-close .ui-icon-closethick {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="page-center-wrapper">
|
||||
<h:form id="form">
|
||||
#{examenBean.init()}
|
||||
<div class="card">
|
||||
<p:dataTable id="dataTable" var="q"
|
||||
rows="30" paginator="true" draggableColumns="true"
|
||||
value="#{examenBean.allQueue}"
|
||||
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
|
||||
rowsPerPageTemplate="20,30,40,60,80,100"
|
||||
emptyMessage="#{msg['distribution.page.examen.liste.message.non']}"
|
||||
selectionMode="single"
|
||||
rowKey="#{q.id}">
|
||||
|
||||
<f:facet name="header">
|
||||
<div class="flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<span class="table-header-title">#{msg['distribution.page.examens.liste']}</span>
|
||||
</div>
|
||||
<div>
|
||||
<p:commandButton id="filterToggle" type="button" styleClass="mr-2 mb-2 btn-green-outline"
|
||||
icon="pi pi-filter" value="Filtre" />
|
||||
<p:overlayPanel id="filterPanel" for="filterToggle" widgetVar="filterPanelWidget"
|
||||
dismissable="true" showCloseIcon="true" styleClass="examen-filter-panel"
|
||||
style="width:380px">
|
||||
|
||||
<div class="examen-filter-grid">
|
||||
|
||||
<div class="filter-section-title">#{msg['distribution.filtre.periode']}</div>
|
||||
<div class="filter-date-range">
|
||||
<p:calendar value="#{examenBean.filterDateDebut}" pattern="dd/MM/yyyy"
|
||||
placeholder="#{msg['distribution.filtre.dateDebut']}" >
|
||||
<p:ajax event="dateSelect" update="dateFin"/>
|
||||
</p:calendar>
|
||||
<p:calendar id="dateFin" value="#{examenBean.filterDateFin}" pattern="dd/MM/yyyy"
|
||||
placeholder="#{msg['distribution.filtre.dateFin']}" mindate="#{examenBean.filterDateDebut}" />
|
||||
</div>
|
||||
|
||||
<div class="filter-section-title">#{msg['distribution.filtre.rapide']}</div>
|
||||
<div class="filter-checkbox-row">
|
||||
<p:selectBooleanCheckbox value="#{examenBean.filterMesExamens}" />
|
||||
<label>#{msg['distribution.filtre.mesExamens']}</label>
|
||||
</div>
|
||||
<div class="filter-checkbox-row">
|
||||
<p:selectBooleanCheckbox value="#{examenBean.filterMesBrouillons}" />
|
||||
<label>#{msg['distribution.filtre.mesBrouillons']}</label>
|
||||
</div>
|
||||
|
||||
<div class="filter-section-title">#{msg['distribution.filtre.criteres']}</div>
|
||||
|
||||
<p:selectOneMenu value="#{examenBean.filterMedecinAssigne}" filter="true" filterMatchMode="contains" styleClass="filter-select" converter="medecinConverter">
|
||||
<f:converter binding="#{medecinConverter}" />
|
||||
<f:selectItem itemLabel="#{msg['distribution.filtre.medecinAssigne']}" itemValue="" /> <f:selectItems value="#{examenBean.medecinList}" var="m" itemLabel="#{m.fkUser.nom} #{m.fkUser.prenom}" itemValue="#{m}" />
|
||||
</p:selectOneMenu>
|
||||
|
||||
<p:selectOneMenu value="#{examenBean.filterSpecialiteMedicale}" filter="true" filterMatchMode="contains" styleClass="filter-select" converter="specialiteMedicaleConverter">
|
||||
<f:converter binding="#{specialiteMedicaleConverter}" />
|
||||
<f:selectItem itemLabel="#{msg['distribution.filtre.specialite']}" itemValue="" />
|
||||
<f:selectItems value="#{examenBean.specialiteMedicaleList}" var="s" itemLabel="#{s.name}" itemValue="#{s}" />
|
||||
</p:selectOneMenu>
|
||||
|
||||
<p:selectOneMenu value="#{examenBean.filterMachine}" filter="true" filterMatchMode="contains" styleClass="filter-select" converter="machineConverter">
|
||||
<f:converter binding="#{machineConverter}" />
|
||||
<f:selectItem itemLabel="#{msg['distribution.filtre.typeMachine']}" itemValue="" />
|
||||
<f:selectItems value="#{examenBean.machineList}" var="mc" itemLabel="#{mc.nom}" itemValue="#{mc}" />
|
||||
</p:selectOneMenu>
|
||||
|
||||
<p:selectOneMenu value="#{examenBean.filterMedecinInterprete}" filter="true" filterMatchMode="contains" styleClass="filter-select" converter="medecinConverter">
|
||||
<f:converter binding="#{medecinConverter}" />
|
||||
<f:selectItem itemLabel="#{msg['distribution.filtre.medecinInterprete']}" itemValue="" />
|
||||
<f:selectItems value="#{examenBean.medecinList}" var="mi" itemLabel="#{mi.fkUser.nom} #{mi.fkUser.prenom}" itemValue="#{mi}" />
|
||||
</p:selectOneMenu>
|
||||
|
||||
<p:selectOneMenu value="#{examenBean.filterManipulateur}" filter="true" filterMatchMode="contains" styleClass="filter-select" converter="medecinConverter">
|
||||
<f:converter binding="#{medecinConverter}" />
|
||||
<f:selectItem itemLabel="#{msg['distribution.filtre.medecinManipulateur']}" itemValue="" />
|
||||
<f:selectItems value="#{examenBean.medecinList}" var="mi" itemLabel="#{mi.fkUser.nom} #{mi.fkUser.prenom}" itemValue="#{mi}" />
|
||||
</p:selectOneMenu>
|
||||
|
||||
<p:selectOneMenu value="#{examenBean.filterPatient}"
|
||||
filter="true"
|
||||
filterMatchMode="contains"
|
||||
styleClass="filter-select"
|
||||
converter="patientConverter">
|
||||
|
||||
<f:converter binding="#{patientConverter}" />
|
||||
|
||||
<f:selectItem itemLabel="Patient" itemValue="" />
|
||||
|
||||
<f:selectItems value="#{examenBean.patientList}"
|
||||
var="p"
|
||||
itemLabel="#{p.codePatient} - #{p.nom} #{p.prenom}"
|
||||
itemValue="#{p}" />
|
||||
|
||||
</p:selectOneMenu>
|
||||
|
||||
<div class="filter-actions">
|
||||
<p:commandButton value="#{msg['distribution.filtre.reinitialiser']}"
|
||||
styleClass="btn-green-outline"
|
||||
actionListener="#{examenBean.resetFilters}"
|
||||
action="#{examenBean.applyFilters}"
|
||||
update="dataTable" />
|
||||
<p:commandButton value="#{msg['distribution.filtre.appliquer']}"
|
||||
styleClass="btn-view-green"
|
||||
action="#{examenBean.applyFilters}"
|
||||
process="@form"
|
||||
update="dataTable"
|
||||
oncomplete="PF('filterPanelWidget').hide()" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</p:overlayPanel>
|
||||
<p:commandButton id="xlsExport" styleClass="mr-2 mb-2 btn-export"
|
||||
icon="pi pi-file-excel" title="Excel" ajax="false">
|
||||
|
||||
<p:fileDownload
|
||||
value="#{examenBean.exportListeExamensExcel()}" />
|
||||
|
||||
</p:commandButton>
|
||||
|
||||
<p:commandButton id="pdfExport" styleClass="mr-2 mb-2 btn-export"
|
||||
ajax="false" icon="pi pi-file-pdf" title="PDF">
|
||||
<p:fileDownload
|
||||
value="#{examenBean.exportListeExamensPdf()}" />
|
||||
</p:commandButton>
|
||||
|
||||
<p:commandButton id="toggler" styleClass="mr-2 mb-2 btn-green-outline"
|
||||
type="button" value="Columns" icon="pi pi-align-justify"/>
|
||||
<p:columnToggler datasource="dataTable" trigger="toggler" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</f:facet>
|
||||
<p:column headerText="Alerte" style="width:60px;text-align:center;">
|
||||
<h:panelGroup rendered="#{examenBean.alerteMedicaleByPatient(q) eq 'none'}">
|
||||
<i class="pi pi-shield"
|
||||
style="color:#22C55E;font-size:1.3rem"></i>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup rendered="#{examenBean.alerteMedicaleByPatient(q) eq 'warning'}">
|
||||
<i class="pi pi-exclamation-triangle"
|
||||
style="color:#F59E0B;font-size:1.3rem"></i>
|
||||
</h:panelGroup>
|
||||
|
||||
<h:panelGroup rendered="#{examenBean.alerteMedicaleByPatient(q) eq 'danger'}">
|
||||
<i class="pi pi-ban"
|
||||
style="color:#EF4444;font-size:1.3rem"></i>
|
||||
</h:panelGroup>
|
||||
|
||||
|
||||
</p:column>
|
||||
|
||||
<!-- Code patient (NIN) -->
|
||||
<p:column style="text-align: center;" headerText="#{msg['distribution.page.patient.code']}"
|
||||
filterBy="#{q.fkPatient.codePatient}" filterMatchMode="contains" sortBy="#{q.fkPatient.codePatient}">
|
||||
<h:outputText value="#{q.fkPatient.codePatient}" />
|
||||
</p:column>
|
||||
|
||||
|
||||
<!-- Nom patient -->
|
||||
<p:column style="text-align: center;" headerText="#{msg['distribution.page.patient.nom']}"
|
||||
filterBy="#{q.fkPatient.nom} #{q.fkPatient.prenom}" filterMatchMode="contains" sortBy="#{q.fkPatient.nom} #{q.fkPatient.prenom}">
|
||||
<p:commandLink styleClass="patient-code-link" process="@this"
|
||||
action="#{examenBean.voirDossierPatient(q)}">
|
||||
<h:outputText value="#{q.fkPatient.nom} #{q.fkPatient.prenom}" />
|
||||
<span class="pi pi-external-link" />
|
||||
</p:commandLink>
|
||||
</p:column>
|
||||
|
||||
<!-- Sexe -->
|
||||
<p:column style="text-align: center;" headerText="#{msg['distribution.page.patient.sexe']}"
|
||||
filterBy="#{q.fkPatient.sexe}" filterMatchMode="contains" sortBy="#{q.fkPatient.sexe}">
|
||||
<h:outputText value="#{q.fkPatient.sexe}" />
|
||||
</p:column>
|
||||
|
||||
<!-- Priorité -->
|
||||
<p:column style="text-align: center;" headerText="#{msg['distribution.page.priorite']}"
|
||||
filterBy="#{q.fkPriority.designation}" filterMatchMode="contains" sortBy="#{q.fkPriority.poids}">
|
||||
<h:outputText value="#{q.fkPriority.designation}" />
|
||||
</p:column>
|
||||
|
||||
<!-- Status (calculé, badge coloré) -->
|
||||
<p:column style="text-align: center;" headerText="#{msg['distribution.page.status']}"
|
||||
filterBy="#{examenBean.getDisplayStatus(q)}" filterMatchMode="contains">
|
||||
<h:panelGroup styleClass="status-badge #{examenBean.getStatusBadgeClass(q)}">
|
||||
<h:outputText value="#{examenBean.getDisplayStatus(q)}" />
|
||||
</h:panelGroup>
|
||||
</p:column>
|
||||
|
||||
<!-- Type d'examen : via q.fkExamen.fkTypeExamen -->
|
||||
<p:column style="text-align: center;" headerText="#{msg['distribution.page.typeExamen']}"
|
||||
filterBy="#{q.fkTypeExamen.nom}" filterMatchMode="contains" sortBy="#{q.fkTypeExamen.nom}">
|
||||
<h:outputText value="#{q.fkTypeExamen.nom}" />
|
||||
</p:column>
|
||||
|
||||
<!-- Machine : via q.fkExamen.fkTypeExamen.fkMachine -->
|
||||
<p:column style="text-align: center;" headerText="#{msg['distribution.page.machine']}"
|
||||
filterBy="#{q.fkTypeExamen.fkMachine.nom}" filterMatchMode="contains" sortBy="#{q.fkTypeExamen.fkMachine.nom}">
|
||||
<h:outputText value="#{q.fkTypeExamen.fkMachine.nom}" />
|
||||
</p:column>
|
||||
|
||||
<!-- Créé le -->
|
||||
<p:column style="text-align: center;" headerText="#{msg['distribution.page.creeLe']}"
|
||||
sortBy="#{q.date}">
|
||||
<h:outputText value="#{q.date}">
|
||||
<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Africa/Algiers"/>
|
||||
</h:outputText>
|
||||
<h:outputText value=" a "/>
|
||||
<h:outputText value="#{q.createdAt}">
|
||||
<f:convertDateTime pattern="HH:mm:ss" timeZone="GMT+1"/>
|
||||
</h:outputText>
|
||||
</p:column>
|
||||
|
||||
<!-- Action -->
|
||||
<p:column style="width:100px; text-align: center;" exportable="false"
|
||||
draggable="false" toggleable="false" headerText="Action">
|
||||
<p:commandButton id="buttonSelect" styleClass="btn-view-green"
|
||||
style="height:30px; text-align: center"
|
||||
action="#{examenBean.voirExamen(examenBean.getExamenByQueue(q))}"
|
||||
rendered="#{examenBean.getExamenByQueue(q) ne null and examenBean.getExamenByQueue(q).annule ne true}"
|
||||
icon="pi pi-search" title="#{msg['distribution.page.consulter']}"
|
||||
>
|
||||
</p:commandButton>
|
||||
</p:column>
|
||||
|
||||
</p:dataTable>
|
||||
|
||||
|
||||
</div>
|
||||
</h:form>
|
||||
</div>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
@ -530,17 +530,26 @@
|
||||
update="parametresForm"
|
||||
action="#{parametresBean.annuler()}"
|
||||
immediate="true"
|
||||
onclick="if (PF('pollStatusCentre')) {
|
||||
PF('pollStatusCentre').stop();
|
||||
}"
|
||||
styleClass="btn-outline-gray" />
|
||||
</div>
|
||||
<div style="text-align: right; display: flex; gap: 8px;">
|
||||
<p:commandButton value="Supprimer" icon="pi pi-trash"
|
||||
<p:commandButton value="Desactiver" icon="pi pi-trash"
|
||||
process="@this"
|
||||
action="#{parametresBean.deleteCentre()}"
|
||||
onclick="if (PF('pollStatusCentre')) {
|
||||
PF('pollStatusCentre').stop();
|
||||
}"
|
||||
rendered="#{parametresBean.canEdit and utilControleAccess.isshowPrivilegeRemove('param')}"
|
||||
styleClass="btn-red-pill" />
|
||||
<p:commandButton value="Enregistrer" icon="pi pi-save"
|
||||
rendered="#{parametresBean.canEdit}"
|
||||
action="#{parametresBean.saveCentre()}"
|
||||
onclick="if (PF('pollStatusCentre')) {
|
||||
PF('pollStatusCentre').stop();
|
||||
}"
|
||||
update="@form"
|
||||
process="@this"
|
||||
styleClass="btn-teal-pill" />
|
||||
@ -549,6 +558,9 @@
|
||||
rendered="#{!parametresBean.canEdit and utilControleAccess.isshowPrivilegeUpdate('param')}"
|
||||
action="#{parametresBean.editCentre()}"
|
||||
update="@form"
|
||||
onclick="if (PF('pollStatusCentre')) {
|
||||
PF('pollStatusCentre').stop();
|
||||
}"
|
||||
styleClass="btn-teal-pill" />
|
||||
</div>
|
||||
</div>
|
||||
@ -563,6 +575,16 @@
|
||||
<span class="info-value"><h:outputText value="#{parametresBean.centreSelected.name}" /></span>
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
<span class="info-label"><i class="pi pi-building"></i>Téléphone</span>
|
||||
<span class="info-value"><h:outputText value="#{parametresBean.centreSelected.telephone}" /></span>
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
<span class="info-label"><i class="pi pi-building"></i>Email</span>
|
||||
<span class="info-value"><h:outputText value="#{parametresBean.centreSelected.email}" /></span>
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
<span class="info-label"><i class="pi pi-map-marker"></i>Wilaya</span>
|
||||
<span class="info-value"><h:outputText value="#{parametresBean.centreSelected.fkWilaya.name}" /></span>
|
||||
@ -601,11 +623,11 @@
|
||||
</div>
|
||||
<div class="edit-field-row">
|
||||
<span class="edit-field-label"><i class="pi pi-phone"></i>Téléphone</span>
|
||||
<div class="edit-field-input"><p:inputText ><p:ajax event="change"/></p:inputText></div>
|
||||
<div class="edit-field-input"><p:inputText value="#{parametresBean.centreSelected.telephone}" ><p:ajax event="change"/></p:inputText></div>
|
||||
</div>
|
||||
<div class="edit-field-row">
|
||||
<span class="edit-field-label"><i class="pi pi-envelope"></i>Email</span>
|
||||
<div class="edit-field-input"><p:inputText ><p:ajax event="change"/></p:inputText></div>
|
||||
<div class="edit-field-input"><p:inputText value="#{parametresBean.centreSelected.email}" ><p:ajax event="change"/></p:inputText></div>
|
||||
</div>
|
||||
<div class="edit-field-row">
|
||||
<span class="edit-field-label"><i class="pi pi-map-marker"></i>Wilaya</span>
|
||||
@ -660,17 +682,30 @@
|
||||
<!-- MODIF : adresse_ip absente de la table parametre, cf. explication -->
|
||||
<div class="info-row">
|
||||
<span class="info-label">Adresse IP</span>
|
||||
<span class="info-value"><h:outputText /></span>
|
||||
<span class="info-value"><h:outputText value="#{parametresBean.parametre.addresse_ip}" /></span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">Port</span>
|
||||
<span class="info-value"><h:outputText value="#{parametresBean.parametre.mwlScpPort}" /></span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">Status</span>
|
||||
<span class="info-value"><h:outputText value="#{parametresBean.parametre.mwlScpPort}" /></span>
|
||||
</div>
|
||||
<h:panelGroup id="statusPanel">
|
||||
|
||||
<div class="info-row">
|
||||
<span class="info-label">Status</span>
|
||||
<span class="info-value">
|
||||
<h:outputText
|
||||
value="#{parametresBean.actif ? 'Actif' : 'Inactif'}"
|
||||
style="font-weight:bold;color:#{parametresBean.actif ? 'green' : 'red'};" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</h:panelGroup>`
|
||||
</div>
|
||||
<p:poll widgetVar="pollStatusCentre"
|
||||
interval="10"
|
||||
update="statusPanel"
|
||||
rendered="#{!parametresBean.canEdit}"
|
||||
onerror="if (args && args.status === 'server') { window.location.reload(); }" />
|
||||
</h:panelGroup>
|
||||
<h:panelGroup rendered="#{parametresBean.canEdit}">
|
||||
<div class="edit-field-row">
|
||||
@ -679,16 +714,13 @@
|
||||
</div>
|
||||
<div class="edit-field-row">
|
||||
<span class="edit-field-label">Adresse IP *</span>
|
||||
<div class="edit-field-input"><p:inputText ><p:ajax event="change"/></p:inputText></div>
|
||||
<div class="edit-field-input"><p:inputText value="#{parametresBean.parametre.addresse_ip}" ><p:ajax event="change"/></p:inputText></div>
|
||||
</div>
|
||||
<div class="edit-field-row">
|
||||
<span class="edit-field-label">Port *</span>
|
||||
<div class="edit-field-input"><p:inputText value="#{parametresBean.parametre.mwlScpPort}" ><p:ajax event="change"/></p:inputText></div>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">Status</span>
|
||||
<span class="info-value"><p:inputText value="#{parametresBean.parametre.mwlScpPort}" ><p:ajax event="change"/></p:inputText></span>
|
||||
</div>
|
||||
|
||||
</h:panelGroup>
|
||||
</p:tab>
|
||||
|
||||
@ -964,6 +996,14 @@
|
||||
<p:ajax event="change"/>
|
||||
</p:selectOneMenu>
|
||||
</div>
|
||||
<div class="crud-field-row">
|
||||
<label>Spécialités médicales </label>
|
||||
<p:selectOneMenu value="#{parametresBean.typeExamenSelected.specialiteMedicale}" converter="specialiteMedicaleConverter">
|
||||
<f:converter binding="#{specialiteMedicaleConverter}" />
|
||||
<f:selectItems value="#{parametresBean.listeSpecialites}" var="m" itemLabel="#{m.name}" itemValue="#{m}" />
|
||||
<p:ajax event="change"/>
|
||||
</p:selectOneMenu>
|
||||
</div>
|
||||
<div style="text-align:right; padding-top:12px; border-top:0.5px solid #B4B2A9; background-color:#F1EFE8; margin:16px -20px -20px -20px; padding:12px 20px;">
|
||||
<p:commandButton value="Annuler" styleClass="btn-dialog-cancel" onclick="PF('dlgTypeExamen').hide()" type="button" process="@this"/>
|
||||
<p:commandButton value="Enregistrer" styleClass="btn-dialog-confirm" action="#{parametresBean.saveTypeExamen()}" oncomplete="PF('dlgTypeExamen').hide()" update=":parametresForm:tabViewParametres:tabExamen parametresForm:growlMessages" process="@parent"/>
|
||||
|
||||
11
src/main/webapp/views/patient/form.xhtml
Normal file
11
src/main/webapp/views/patient/form.xhtml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html">
|
||||
<h:head>
|
||||
<title>Facelet Title</title>
|
||||
</h:head>
|
||||
<h:body>
|
||||
Hello from Facelets
|
||||
</h:body>
|
||||
</html>
|
||||
11
src/main/webapp/views/patient/list.xhtml
Normal file
11
src/main/webapp/views/patient/list.xhtml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html">
|
||||
<h:head>
|
||||
<title>Facelet Title</title>
|
||||
</h:head>
|
||||
<h:body>
|
||||
Hello from Facelets
|
||||
</h:body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user