From: maroni Date: Mon, 5 Mar 2012 19:19:32 +0000 (-0300) Subject: (no commit message) X-Git-Url: http://200.18.67.61/gitweb/?a=commitdiff_plain;h=09143e23d0e31904fe05befb50074829a0b68c24;p=simdecs2.git --- diff --git a/src/java/org/ufcspa/simdecs/mb/editarcasos/EditarCasoBean.java b/src/java/org/ufcspa/simdecs/mb/editarcasos/EditarCasoBean.java index c3217a9..1c963a4 100644 --- a/src/java/org/ufcspa/simdecs/mb/editarcasos/EditarCasoBean.java +++ b/src/java/org/ufcspa/simdecs/mb/editarcasos/EditarCasoBean.java @@ -4,7 +4,6 @@ */ package org.ufcspa.simdecs.mb.editarcasos; -import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -192,8 +191,11 @@ public class EditarCasoBean extends DefaultManagedBean { } public void processaRede() { - UnBUtil unBUtil = UnBUtil.getInstance(); - unBUtil.abreRede(); + idPaciente = Long.valueOf(getTextParameter("pIdPaciente")); + Paciente paciente = em.find(Paciente.class, idPaciente); + + UnBUtil unBUtil = UnBUtil.getInstance(paciente.getRede().getNomeArquivo()); + unBUtil.abreRede(paciente.getRede().getNomeArquivo()); // Sinais e Sintomas for (Object nodo : sinaisSintomas.getSource()) { @@ -373,7 +375,7 @@ public class EditarCasoBean extends DefaultManagedBean { examesFisicos = new DualListModel(origemExamesFisicos, destinoExamesFisicos); examesComplementares = new DualListModel(origemExamesComplementares, destinoExamesComplementares); - UnBUtil unBUtil = UnBUtil.getInstance(); + UnBUtil unBUtil = UnBUtil.getInstance(paciente.getRede().getNomeArquivo()); diagnosticos = unBUtil.getProbabilidadeDiagnosticos(); condutas = unBUtil.getProbabilidadeCondutas(); diff --git a/src/java/org/ufcspa/simdecs/util/UnBUtil.java b/src/java/org/ufcspa/simdecs/util/UnBUtil.java index 74b1987..f73335c 100644 --- a/src/java/org/ufcspa/simdecs/util/UnBUtil.java +++ b/src/java/org/ufcspa/simdecs/util/UnBUtil.java @@ -27,17 +27,17 @@ public class UnBUtil { private static UnBUtil unBUtil; private ProbabilisticNetwork rede; - private UnBUtil() { - abreRede(); + private UnBUtil(String caminhoRede) { + abreRede(caminhoRede); } - public final void abreRede() { + public final void abreRede(String caminhoRede) { try { // required to run unbbayes gui classes on server System.setProperty("java.awt.headless", "false"); rede = new ProbabilisticNetwork(null); - XMLBIFIO.loadXML(new File("/Users/maroni/NetBeansProjects/SimDeCS/samples/headache.xml"), rede); + XMLBIFIO.loadXML(new File(caminhoRede), rede); } catch (Exception e) { e.printStackTrace(); @@ -47,9 +47,9 @@ public class UnBUtil { compilar(); } - public static UnBUtil getInstance() { + public static UnBUtil getInstance(String caminhoRede) { if (unBUtil == null) - unBUtil = new UnBUtil(); + unBUtil = new UnBUtil(caminhoRede); return unBUtil; } diff --git a/samples/headache.xml b/src/java/redes/headache.xml similarity index 100% rename from samples/headache.xml rename to src/java/redes/headache.xml diff --git a/web/editarcasos/editarCaso.xhtml b/web/editarcasos/editarCaso.xhtml index daae159..17ddc2e 100644 --- a/web/editarcasos/editarCaso.xhtml +++ b/web/editarcasos/editarCaso.xhtml @@ -155,7 +155,9 @@ -