Skip to content

Commit

Permalink
Added JAR files and New Dto objects for REST response
Browse files Browse the repository at this point in the history
* The jar files required by the project has been added to the repository. This will make sure that the jar files versions can be managed properly.
* Added new DTO objects to build the REST response of the parsed claim. The ProcedureDto stores information about the procedure, ServiceInformationDto will store information about the service information details.
* The .gitignore file has been updated to not ignore jar files from now on.
  • Loading branch information
Shubham Bansal committed Jun 27, 2012
1 parent 635acb3 commit 572c33a
Show file tree
Hide file tree
Showing 25 changed files with 299 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
Expand Down
Binary file added WebContent/WEB-INF/lib/asm-3.1.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/commons-logging-1.1.1.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/fontbox-1.7.0.jar
Binary file not shown.
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jackson-jaxrs-1.9.2.jar
Binary file not shown.
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jackson-xc-1.9.2.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jempbox-1.7.0.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jersey-client-1.12.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jersey-core-1.12.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jersey-json-1.12.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jersey-server-1.12.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jersey-servlet-1.12.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jettison-1.1.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/jsr311-api-1.1.1.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/log4j-1.2.17.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/pdfbox-1.7.0.jar
Binary file not shown.
39 changes: 32 additions & 7 deletions src/com/parser/dto/ClaimDto.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
package com.parser.dto;

import java.util.ArrayList;
import java.util.List;

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

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.parser.model.Claim;
import com.parser.model.ServiceInformation;

@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ClaimDto {

private String providerName;
private String insuranceProvider;
private List<ServiceInformationDto> serviceInformations = new ArrayList<ServiceInformationDto>();

public ClaimDto() {}

public ClaimDto(String provider) {
this.providerName = provider;
public ClaimDto(Claim claim) {
this.insuranceProvider = claim.getInsuranceProvider();
for (ServiceInformation serviceInformation : claim.getServiceInformations()) {
ServiceInformationDto serviceDto = new ServiceInformationDto(serviceInformation);
serviceInformations.add(serviceDto);
}
}

public String getInsuranceProvider() {
return insuranceProvider;
}

public void setInsuranceProvider(String insuranceProvider) {
this.insuranceProvider = insuranceProvider;
}

public String getProviderName() {
return providerName;
public List<ServiceInformationDto> getServiceInformations() {
return serviceInformations;
}

public void setProviderName(String providerName) {
this.providerName = providerName;
public void setServiceInformations(List<ServiceInformationDto> serviceInformations) {
this.serviceInformations = serviceInformations;
}

}
28 changes: 28 additions & 0 deletions src/com/parser/dto/ListOfProceduresDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.parser.dto;

import java.util.List;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class ListOfProceduresDto {

private List<ProcedureDto> procedures;

protected ListOfProceduresDto() {
}

public ListOfProceduresDto(List<ProcedureDto> procedures) {
this.procedures = procedures;
}

public List<ProcedureDto> getProcedures() {
return procedures;
}

public void setProcedures(List<ProcedureDto> procedures) {
this.procedures = procedures;
}


}
33 changes: 33 additions & 0 deletions src/com/parser/dto/ListOfServiceInformationsDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.parser.dto;

import java.util.List;

import javax.xml.bind.annotation.XmlRootElement;

/**
* Dto object for storing a list of <code>ServiceInformationDto</code>
* @author shubhambansal
*
*/
@XmlRootElement
public class ListOfServiceInformationsDto {

private List<ServiceInformationDto> serviceInformations;

protected ListOfServiceInformationsDto() {
}

public ListOfServiceInformationsDto(List<ServiceInformationDto> serviceInformations) {
this.serviceInformations = serviceInformations;
}

public List<ServiceInformationDto> getServiceInformations() {
return serviceInformations;
}

public void setServiceInformations(
List<ServiceInformationDto> serviceInformations) {
this.serviceInformations = serviceInformations;
}

}
74 changes: 74 additions & 0 deletions src/com/parser/dto/ProcedureDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.parser.dto;

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

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.parser.model.Procedure;

@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProcedureDto {

private String procedureName;
private String serviceDate;
private String amountBilled;
private String amountCovered;
private String amountNotCovered;

public ProcedureDto() {
}

public ProcedureDto(Procedure procedure) {
this.procedureName = procedure.getName();
this.serviceDate = procedure.getServiceDate();
this.amountBilled = procedure.getAmountBilled();
this.amountCovered = procedure.getAmountCovered();
this.amountNotCovered = procedure.getAmountNotCovered();
}

public String getProcedureName() {
return procedureName;
}

public void setProcedureName(String procedureName) {
this.procedureName = procedureName;
}

public String getServiceDate() {
return serviceDate;
}

public void setServiceDate(String serviceDate) {
this.serviceDate = serviceDate;
}

public String getAmountBilled() {
return amountBilled;
}

public void setAmountBilled(String amountBilled) {
this.amountBilled = amountBilled;
}

public String getAmountCovered() {
return amountCovered;
}

public void setAmountCovered(String amountCovered) {
this.amountCovered = amountCovered;
}

public String getAmountNotCovered() {
return amountNotCovered;
}

public void setAmountNotCovered(String amountNotCovered) {
this.amountNotCovered = amountNotCovered;
}


}
129 changes: 129 additions & 0 deletions src/com/parser/dto/ServiceInformationDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
package com.parser.dto;

import java.util.ArrayList;
import java.util.List;

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

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.parser.model.Procedure;
import com.parser.model.ServiceInformation;

@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ServiceInformationDto {

private String totalAmountBilled;
private String totalNotCovered;
private String totalCovered;
private String ppoReduction;
private String coinsuranceAmount;
private String totalDeductions;
private String totalBenefitsApproved;
private String amountOwedToProvider;

private List<ProcedureDto> procedures = new ArrayList<ProcedureDto>();

protected ServiceInformationDto() {
}

public ServiceInformationDto(ServiceInformation serviceInformation) {
this.totalAmountBilled = checkString(serviceInformation.getTotalAmountBilled());
this.totalNotCovered = checkString(serviceInformation.getTotalNotCovered());
this.totalCovered = checkString(serviceInformation.getTotalCovered());
this.ppoReduction = checkString(serviceInformation.getPpoReduction());
this.coinsuranceAmount = checkString(serviceInformation.getPpoReduction());
this.totalDeductions = checkString(serviceInformation.getTotalDeductions());
this.totalBenefitsApproved = checkString(serviceInformation.getTotalBenefitsApproved());
this.amountOwedToProvider = checkString(serviceInformation.getAmountOwedToProvider());

for (Procedure procedure : serviceInformation.getProcedures()) {
ProcedureDto procedureDto = new ProcedureDto(procedure);
procedures.add(procedureDto);
}
}

private String checkString(Object value) {
if(value == null) {
return null;
}
return value.toString();
}

public String getTotalAmountBilled() {
return totalAmountBilled;
}

public void setTotalAmountBilled(String totalAmountBilled) {
this.totalAmountBilled = totalAmountBilled;
}

public String getTotalNotCovered() {
return totalNotCovered;
}

public void setTotalNotCovered(String totalNotCovered) {
this.totalNotCovered = totalNotCovered;
}

public String getTotalCovered() {
return totalCovered;
}

public void setTotalCovered(String totalCovered) {
this.totalCovered = totalCovered;
}

public String getPpoReduction() {
return ppoReduction;
}

public void setPpoReduction(String ppoReduction) {
this.ppoReduction = ppoReduction;
}

public String getCoinsuranceAmount() {
return coinsuranceAmount;
}

public void setCoinsuranceAmount(String coinsuranceAmount) {
this.coinsuranceAmount = coinsuranceAmount;
}

public String getTotalDeductions() {
return totalDeductions;
}

public void setTotalDeductions(String totalDeductions) {
this.totalDeductions = totalDeductions;
}

public String getTotalBenefitsApproved() {
return totalBenefitsApproved;
}

public void setTotalBenefitsApproved(String totalBenefitsApproved) {
this.totalBenefitsApproved = totalBenefitsApproved;
}

public String getAmountOwedToProvider() {
return amountOwedToProvider;
}

public void setAmountOwedToProvider(String amountOwedToProvider) {
this.amountOwedToProvider = amountOwedToProvider;
}

public List<ProcedureDto> getProcedures() {
return procedures;
}

public void setProcedures(List<ProcedureDto> procedures) {
this.procedures = procedures;
}

}
2 changes: 1 addition & 1 deletion src/com/parser/main/PDFParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class PDFParser {
public static void main(String[] args) {
try {
String fileName = "/Users/shubhambansal/Downloads/cancer1.pdf";
String fileName = "/Users/shubhambansal/Downloads/cancer.pdf";
// String fileName = "/Users/shubhambansal/Downloads/mammogram.pdf";
// String fileName = "/Users/shubhambansal/Downloads/physical.pdf";
long time = System.currentTimeMillis();
Expand Down
4 changes: 2 additions & 2 deletions src/com/parser/rest/ClaimsResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public class ClaimsResource {
@GET
@Produces (MediaType.APPLICATION_JSON)
public Response getClaims(@QueryParam("file") String fileName) {
fileName = "/Users/shubhambansal/Downloads/cancer1.pdf";
fileName = "/Users/shubhambansal/Downloads/cancer.pdf";
try {
ParsingController controller = new ParsingController();
controller.parse(fileName);
ClaimDto claim = new ClaimDto(controller.getClaim().getInsuranceProvider());
ClaimDto claim = new ClaimDto(controller.getClaim());
return Response.ok(claim).build();
} catch (Exception e) {
return Response.status(Status.BAD_REQUEST).build();
Expand Down

0 comments on commit 572c33a

Please sign in to comment.