Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
- <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
- <%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
- <%@taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>IDOC AUTHORING TOOL</title>
- </head>
- <body>
- <div id="BasePage" >
- <p>
- <u> </u><font size="7"><u>IDOC AUTHORING TOOL</u></font></p>
- <p> </p>
- <html:form method="POST" action ="" >
- <p>Enter/Choose ailment :
- <html:select name="AuthoringForm" property="disease_name" size="1">
- <option>Malaria</option>
- <option>High Fever</option>
- <option>Cholera</option>
- </html:select></p>
- <p>Choose Authoring Mode :
- <select size="1" name="AuthoringOption" id ="AuthoringOption" onChange="javascript:display_toggle()">
- <option selected="selected"> </option>
- <option value ="1">Input Desicion Tree</option>
- <option value ="2">Input Prevention</option>
- <option value ="3">Input Symptoms</option>
- </select></p>
- <form method="POST" >
- <fieldset style="width: 381px; height: 126px; padding: 2">
- <legend align="left"> </legend>
- Tick off patient context :
- <html:radio value="Men" name="AuthoringForm" property="patient_context" disabled="false"/>Men
- <html:radio value="Womwen" name="AuthoringForm" property="patient_context" disabled="false"/>Women
- <p>
- <html:radio value="Child" name="AuthoringForm" property="patient_context" disabled="false"/>Child
- <html:radio value="Al" name="AuthoringForm" property="patient_context" disabled="false"/>All
- </fieldset>
- </form>
- <p> Enter Pre Conditions</p>
- <!--<html:form method="POST" action="symptoms">-->
- <p> <html:textarea rows="2" name="AuthoringForm" cols="20" property="patient_precondition" ></html:textarea>
- <!-- <input type="submit" value="Submit" name="B3"></p>-->
- </html:form>
- <!--</html:form>-->
- </div>
- <!--_______________________________________________________ -->
- <script type ="text/javascript">
- function display_toggle(){
- var e =document.getElementById("AuthoringOption").value;
- if (e =="1"){
- document.getElementById("Symptoms").style.display="none";
- document.getElementById("Prevention").style.display="none";
- document.getElementById("decisiontree").style.display="block";
- }
- else if(e =="2"){
- document.getElementById("Prevention").style.display="block";
- document.getElementById("decisiontree").style.display="none";
- document.getElementById("Symptoms").style.display="none";
- }
- else if(e =="3"){
- document.getElementById("decisiontree").style.display="none";
- document.getElementById("Symptoms").style.display="block";
- document.getElementById("Prevention").style.display="none";
- }
- }
- </script>
- <div id="Symptoms" style="display:none;">
- <html:form method="POST" action="symptoms">
- <p> Must Have Symptoms :
- May Have Symptoms :</p>
- <p> <html:textarea rows="2" name="AuthoringForm" cols="20" property="must_have_symptoms"></html:textarea>
- <!-- <input type="submit" value="Submit" name="B2">-->
- <html:textarea rows="2" name="AuthoringForm" cols="20" property="may_have_symptoms"></html:textarea>
- <input type="submit" value="Submit" name="symptomsButton"></p>
- </html:form>
- </div>
- <!--___________________________________________________________________________________________ -->
- <div id="Prevention" style="display:none;">
- <html:form method="POST" action="prevention">
- <p> Input for Prevention :
- </p>
- <p> <html:textarea rows="8" name="AuthoringForm" cols="79" property="prevention"></html:textarea>
- <input type="submit" value="Submit" name="preventionButton">
- </p>
- </html:form>
- </div>
- <!--____________________________________________________________________________________________ -->
- <div id="decisiontree" style="display:none;">
- <p>Enter Follow Up Questions :</p>
- <html:form method="POST" action="decisiontree">
-
- <html:textarea rows="4" name="AuthoringForm" cols="45" property="follow_up_questions"></html:textarea>
- <input type="radio" value="Yes" checked name="followDecision"> Yes
- <input type="radio" name="followDecision" value="No"> No
- <input type="submit" value="Submit" name="followupQuestionButton"><p>
- </p>
- </html:form>
- <html:form method="POST" action="decisiontreexml">
- <p>
- </p>
- <fieldset style="width: 1225px; height: 451px; padding: 2">
- <legend>Decision Tree Preview </legend>
- </fieldset><p>
- </p>
- </html:form>
- </div>
- </body>
- </html>
- package com.vaannila.action;
- import java.io.IOException;
- import java.sql.Connection;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- import java.sql.Statement;
- import javax.servlet.ServletException;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.struts.action.Action;
- import org.apache.struts.action.ActionForm;
- import org.apache.struts.action.ActionForward;
- import org.apache.struts.action.ActionMapping;
- import com.vaannila.FormBean.AuthoringForm;
- import com.vaannila.dao.databaseConnection;
- public class symptomsAction extends Action {
- private final static String SUCCESS = "success";
- private final static String FAILURE = "failure";
- Connection conn=databaseConnection.connectionfactory();
- PreparedStatement pstatement =null;
- int updateQuery;
- public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException
- {
- String diease_name=null;
- String getMay_have_symptoms=null;
- String getMust_have_symptoms=null;
- String preconditions=null;
- String patientcontext=null;
- if (form !=null){
- AuthoringForm symptomform=(AuthoringForm)form ;
- //System.out.println("the value of the symptomform "+symptomform);
- diease_name=symptomform.getDisease_name();
- System.out.println("the value of the diease_name "+diease_name);
- getMay_have_symptoms=symptomform.getMay_have_symptoms();
- System.out.println("the value of the patientcontext "+getMay_have_symptoms);
- getMust_have_symptoms= symptomform.getMust_have_symptoms();
- System.out.println("the value of the getMust_have_symptoms "+getMust_have_symptoms);
- preconditions=symptomform.getPatient_precondition();
- System.out.println("the value of the preconditions "+preconditions);
- patientcontext=symptomform.getPatient_context();
- System.out.println("the value of the patientcontext "+patientcontext);
- }
- try {
- String QueryString="Insert into doc_symptom (DISEASE_NAME,PATIENT_CONTEXT,PATIENT_PRECONDITION,DISEASE_MUST_SYMPTOMS,DISEASE_MAY_SYMPTOMS) VALUES (?,?,?,?,?)";
- //DISEASE_NAME,PATIENT_CONTEXT,PATIENT_PRECONDITION,DISEASE_MUST_SYMPTOMS,DISEASE_MAY_SYMPTOMS
- pstatement =conn.prepareStatement(QueryString);
- pstatement.setString(1,diease_name);
- pstatement.setString(5,getMay_have_symptoms );
- pstatement.setString(4,getMust_have_symptoms );
- pstatement.setString(3,preconditions );
- pstatement.setString(2,patientcontext );
- updateQuery= pstatement.executeUpdate();
- }
- catch(Exception e ){
- e.printStackTrace();
- return mapping.findForward(FAILURE);
- }
- finally{
- try {
- conn.close();
- pstatement.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- return mapping.findForward(SUCCESS);
- }
- }
- package com.vaannila.FormBean;
- import org.apache.struts.action.ActionForm;
- public class AuthoringForm extends ActionForm {
- private static final long serialVersionUID = 1L;
- private String decision_id = null;
- private String disease_name =null;
- private String patient_context=null;
- private String patient_precondition=null;
- private String prevention_id=null;
- private String prevention= null;
- private String symptom_id=null;
- private String must_have_symptoms=null;
- private String may_have_symptoms=null;
- private String follow_up_questions=null;
- public String getFollow_up_questions() {
- return follow_up_questions;
- }
- public void setFollow_up_questions(String follow_up_questions) {
- this.follow_up_questions = follow_up_questions;
- }
- public String getDecision_id() {
- return decision_id;
- }
- public void setDecision_id(String decision_id) {
- this.decision_id = decision_id;
- }
- public String getDisease_name() {
- return disease_name;
- }
- public void setDisease_name(String disease_name) {
- this.disease_name = disease_name;
- }
- public String getPatient_context() {
- return patient_context;
- }
- public void setPatient_context(String patient_context) {
- this.patient_context = patient_context;
- }
- public String getPatient_precondition() {
- return patient_precondition;
- }
- public void setPatient_precondition(String patient_precondition) {
- this.patient_precondition = patient_precondition;
- }
- public String getPrevention_id() {
- return prevention_id;
- }
- public void setPrevention_id(String prevention_id) {
- this.prevention_id = prevention_id;
- }
- public String getPrevention() {
- return prevention;
- }
- public void setPrevention(String prevention) {
- this.prevention = prevention;
- }
- public String getSymptom_id() {
- return symptom_id;
- }
- public void setSymptom_id(String symptom_id) {
- this.symptom_id = symptom_id;
- }
- public String getMust_have_symptoms() {
- return must_have_symptoms;
- }
- public void setMust_have_symptoms(String must_have_symptoms) {
- this.must_have_symptoms = must_have_symptoms;
- }
- public String getMay_have_symptoms() {
- return may_have_symptoms;
- }
- public void setMay_have_symptoms(String may_have_symptoms) {
- this.may_have_symptoms = may_have_symptoms;
- }
- }
Add Comment
Please, Sign In to add comment