Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
Added Web Client
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMarcogliese committed Oct 21, 2017
1 parent 9677379 commit de589ef
Show file tree
Hide file tree
Showing 38 changed files with 6,693 additions and 21 deletions.
2 changes: 1 addition & 1 deletion patientgenerator.iml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file:https://$MODULE_DIR$/web/WEB-INF/web.xml" />
<deploymentDescriptor name="web.xml" url="file:https://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file:https://$MODULE_DIR$/src/main/webapp" relative="/" />
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/client/PatientGeneratorClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package client;
import client.classes.GenerationResponse;
import client.classes.GenerationService;
import client.classes.GenerationService_Service;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Objects;

@WebServlet(name = "PatientGeneratorClient")
public class PatientGeneratorClient extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

client.classes.GenerationService service = new GenerationService_Service().getPort(GenerationService.class);

String selection = request.getParameter("element_8");
if(Objects.equals(selection, "random")){
int count = Integer.valueOf(request.getParameter("element_3"));
GenerationResponse generationResponse = service.generatePatients(count,false);
List<String> list = generationResponse.getPatients().getPatient();
String str = String.join("\n", list);
request.setAttribute("patients", str);
RequestDispatcher view = request.getRequestDispatcher("result.jsp");
view.forward(request,response);
} else if (Objects.equals(selection, "options")){

}
}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

}
}
168 changes: 168 additions & 0 deletions src/main/java/client/classes/Address.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@

package client.classes;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;


/**
* <p>Java class for address complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="address">
* &lt;complexContent>
* &lt;restriction base="{http:https://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="city" type="{http:https://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="country" type="{http:https://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="stateProvince" type="{http:https://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="streetAddress" type="{http:https://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="zipPostalCode" type="{http:https://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "address", propOrder = {
"city",
"country",
"stateProvince",
"streetAddress",
"zipPostalCode"
})
public class Address {

protected String city;
protected String country;
protected String stateProvince;
protected String streetAddress;
protected String zipPostalCode;

/**
* Gets the value of the city property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCity() {
return city;
}

/**
* Sets the value of the city property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCity(String value) {
this.city = value;
}

/**
* Gets the value of the country property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCountry() {
return country;
}

/**
* Sets the value of the country property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCountry(String value) {
this.country = value;
}

/**
* Gets the value of the stateProvince property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStateProvince() {
return stateProvince;
}

/**
* Sets the value of the stateProvince property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStateProvince(String value) {
this.stateProvince = value;
}

/**
* Gets the value of the streetAddress property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStreetAddress() {
return streetAddress;
}

/**
* Sets the value of the streetAddress property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStreetAddress(String value) {
this.streetAddress = value;
}

/**
* Gets the value of the zipPostalCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getZipPostalCode() {
return zipPostalCode;
}

/**
* Sets the value of the zipPostalCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setZipPostalCode(String value) {
this.zipPostalCode = value;
}

}
114 changes: 114 additions & 0 deletions src/main/java/client/classes/AlternateIdentifier.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@

package client.classes;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;


/**
* <p>Java class for alternateIdentifier complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="alternateIdentifier">
* &lt;complexContent>
* &lt;restriction base="{http:https://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="type" type="{http:https://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="value" type="{http:https://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="assigningAuthority" type="{http:https://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "alternateIdentifier", propOrder = {
"type",
"value",
"assigningAuthority"
})
public class AlternateIdentifier {

protected String type;
protected String value;
protected String assigningAuthority;

/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getType() {
return type;
}

/**
* Sets the value of the type property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setType(String value) {
this.type = value;
}

/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}

/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}

/**
* Gets the value of the assigningAuthority property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAssigningAuthority() {
return assigningAuthority;
}

/**
* Sets the value of the assigningAuthority property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAssigningAuthority(String value) {
this.assigningAuthority = value;
}

}
Loading

0 comments on commit de589ef

Please sign in to comment.