Skip to content

Commit

Permalink
Merge pull request #20 from monikadrajer/master
Browse files Browse the repository at this point in the history
Improved performance by multi threading
  • Loading branch information
drbgfc authored Nov 28, 2017
2 parents 5f3ef1f + bc6e22c commit 97e0fce
Show file tree
Hide file tree
Showing 46 changed files with 823 additions and 219 deletions.
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,32 @@
<artifactId>apache-log4j-extras</artifactId>
<version>1.2.17</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.9.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDAAllergy.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDAAllergy extends CCDAXmlSnippet {

Expand All @@ -9,6 +10,7 @@ public class CCDAAllergy extends CCDAXmlSnippet {
private CCDACode sectionCode;
private ArrayList<CCDAAllergyConcern> allergyConcern;
private ArrayList<String> referenceLinks;
private List<CCDAID> idList;

public boolean isSectionNullFlavourWithNI() {
return isSectionNullFlavourWithNI;
Expand Down Expand Up @@ -54,6 +56,14 @@ public void setReferenceLinks(ArrayList<String> referenceLinks) {
this.referenceLinks = referenceLinks;
}

public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

public CCDAAllergy()
{

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDAEncounter.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDAEncounter extends CCDAXmlSnippet {

Expand All @@ -9,6 +10,7 @@ public class CCDAEncounter extends CCDAXmlSnippet {
private CCDACode sectionCode;
private ArrayList<CCDAEncounterActivity> encActivities;
private ArrayList<String> referenceLinks;
private List<CCDAID> idLIst;

public boolean isSectionNullFlavourWithNI() {
return isSectionNullFlavourWithNI;
Expand Down Expand Up @@ -53,6 +55,14 @@ public ArrayList<String> getReferenceLinks() {
public void setReferenceLinks(ArrayList<String> referenceLinks) {
this.referenceLinks = referenceLinks;
}

public List<CCDAID> getIdLIst() {
return idLIst;
}

public void setIdLIst(List<CCDAID> idLIst) {
this.idLIst = idLIst;
}

@Override
public int hashCode() {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDAImmunization.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDAImmunization extends CCDAXmlSnippet {

Expand All @@ -9,6 +10,7 @@ public class CCDAImmunization extends CCDAXmlSnippet {
private CCDACode sectionCode;
private ArrayList<CCDAImmunizationActivity> immActivity;
private ArrayList<String> referenceLinks;
private List<CCDAID> idList;

public boolean isSectionNullFlavourWithNI() {
return isSectionNullFlavourWithNI;
Expand Down Expand Up @@ -55,6 +57,14 @@ public ArrayList<String> getReferenceLinks() {
public void setReferenceLinks(ArrayList<String> referenceLinks) {
this.referenceLinks = referenceLinks;
}

public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

public CCDAImmunization()
{
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDALabResult.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDALabResult extends CCDAXmlSnippet{

Expand All @@ -10,6 +11,7 @@ public class CCDALabResult extends CCDAXmlSnippet{
private Boolean isLabTestInsteadOfResult;
private ArrayList<String> referenceLinks;
private boolean isSectionNullFlavourWithNI;
private List<CCDAID> idList = new ArrayList<>();

public CCDALabResult()
{
Expand Down Expand Up @@ -71,6 +73,14 @@ public boolean isSectionNullFlavourWithNI() {
public void setSectionNullFlavourWithNI(boolean isSectionNullFlavourWithNI) {
this.isSectionNullFlavourWithNI = isSectionNullFlavourWithNI;
}

public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

@Override
public int hashCode() {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDAMedication.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDAMedication extends CCDAXmlSnippet{

Expand All @@ -9,6 +10,7 @@ public class CCDAMedication extends CCDAXmlSnippet{
private CCDACode sectionCode;
private ArrayList<CCDAMedicationActivity> medActivities;
private ArrayList<String> referenceLinks;
private List<CCDAID> idList;

public boolean isSectionNullFlavourWithNI() {
return isSectionNullFlavourWithNI;
Expand Down Expand Up @@ -58,6 +60,14 @@ public ArrayList<CCDAMedicationActivity> getMedActivities() {
public void setMedActivities(ArrayList<CCDAMedicationActivity> medActivities) {
this.medActivities = medActivities;
}

public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

@Override
public int hashCode() {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDAPOT.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDAPOT extends CCDAXmlSnippet{

Expand All @@ -12,6 +13,7 @@ public class CCDAPOT extends CCDAXmlSnippet{
private ArrayList<CCDAProcActProc> plannedProcedure;
private ArrayList<CCDAMedicationActivity> plannedMedicationActivity;
private ArrayList<CCDAEncounterActivity> plannedEncounter;
private List<CCDAID> idList;


public boolean isSectionNullFlavourWithNI() {
Expand Down Expand Up @@ -66,6 +68,14 @@ public void setPlannedEncounter(
ArrayList<CCDAEncounterActivity> plannedEncounter) {
this.plannedEncounter = plannedEncounter;
}
public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

@Override
public int hashCode() {
final int prime = 31;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDAProblem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDAProblem extends CCDAXmlSnippet{

Expand All @@ -9,6 +10,7 @@ public class CCDAProblem extends CCDAXmlSnippet{
private CCDACode sectionCode;
private ArrayList<CCDAProblemConcern> problemConcerns;
private ArrayList<String> referenceLinks;
private List<CCDAID> idList;

public boolean isSectionNullFlavourWithNI() {
return isSectionNullFlavourWithNI;
Expand Down Expand Up @@ -53,6 +55,14 @@ public ArrayList<String> getReferenceLinks() {
public void setReferenceLinks(ArrayList<String> referenceLinks) {
this.referenceLinks = referenceLinks;
}

public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

public CCDAProblem()
{
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDAProcedure.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDAProcedure extends CCDAXmlSnippet{

Expand All @@ -9,6 +10,7 @@ public class CCDAProcedure extends CCDAXmlSnippet{
private CCDACode sectionCode;
private ArrayList<CCDAProcActProc> procActsProcs;
private ArrayList<String> referenceLinks;
private List<CCDAID> idList;



Expand Down Expand Up @@ -60,6 +62,14 @@ public ArrayList<String> getReferenceLinks() {
public void setReferenceLinks(ArrayList<String> referenceLinks) {
this.referenceLinks = referenceLinks;
}

public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

@Override
public int hashCode() {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDASocialHistory.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDASocialHistory extends CCDAXmlSnippet{

Expand All @@ -11,6 +12,7 @@ public class CCDASocialHistory extends CCDAXmlSnippet{
private ArrayList<CCDATobaccoUse> tobaccoUse;
private CCDASocialHistoryGenderObs socialHistoryGenderObs;
private ArrayList<String> referenceLinks;
private List<CCDAID> idList;

public boolean isSectionNullFlavourWithNI() {
return isSectionNullFlavourWithNI;
Expand Down Expand Up @@ -76,6 +78,14 @@ public CCDASocialHistoryGenderObs getSocialHistoryGenderObs() {
public void setSocialHistoryGenderObs(CCDASocialHistoryGenderObs socialHistoryGenderObs) {
this.socialHistoryGenderObs = socialHistoryGenderObs;
}

public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

@Override
public int hashCode() {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/sitenv/ccdaparsing/model/CCDAVitalSigns.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sitenv.ccdaparsing.model;

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

public class CCDAVitalSigns extends CCDAXmlSnippet{

Expand All @@ -9,6 +10,7 @@ public class CCDAVitalSigns extends CCDAXmlSnippet{
private CCDACode sectionCode;
private ArrayList<CCDAVitalOrg> vitalsOrg;
private ArrayList<String> referenceLinks;
List<CCDAID> idList;

public boolean isSectionNullFlavourWithNI() {
return isSectionNullFlavourWithNI;
Expand Down Expand Up @@ -53,6 +55,14 @@ public ArrayList<String> getReferenceLinks() {
public void setReferenceLinks(ArrayList<String> referenceLinks) {
this.referenceLinks = referenceLinks;
}

public List<CCDAID> getIdList() {
return idList;
}

public void setIdList(List<CCDAID> idList) {
this.idList = idList;
}

public CCDAVitalSigns()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
package org.sitenv.ccdaparsing.processing;

import java.util.ArrayList;
import java.util.concurrent.Future;

import javax.xml.transform.TransformerException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;

import org.apache.log4j.Logger;
import org.sitenv.ccdaparsing.model.CCDACareTeamMember;
import org.sitenv.ccdaparsing.model.CCDAParticipant;
import org.sitenv.ccdaparsing.util.ApplicationConstants;
import org.sitenv.ccdaparsing.util.ApplicationUtil;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

@Service
public class CareTeamMemberProcessor {

public static CCDACareTeamMember retrieveCTMDetails(XPath xPath , Document doc) throws XPathExpressionException,TransformerException
private static final Logger logger = Logger.getLogger(CareTeamMemberProcessor.class);

@Async()
public Future<CCDACareTeamMember> retrieveCTMDetails(XPath xPath , Document doc) throws XPathExpressionException,TransformerException
{
long startTime = System.currentTimeMillis();
logger.info("care team members parsing Start time:"+ startTime);

NodeList performerNodeList = (NodeList) xPath.compile(ApplicationConstants.CTM_EXPRESSION).evaluate(doc, XPathConstants.NODESET);
CCDACareTeamMember careTeamMember = new CCDACareTeamMember();
ArrayList<CCDAParticipant> participantList = new ArrayList<>();
Expand All @@ -39,11 +51,12 @@ public static CCDACareTeamMember retrieveCTMDetails(XPath xPath , Document doc)
participantList.add(participant);
}
careTeamMember.setMembers(participantList);
logger.info("care team members parsing End time:"+ (System.currentTimeMillis() - startTime));

return careTeamMember;
return new AsyncResult<CCDACareTeamMember>(careTeamMember);
}

public static void readName(Element nameElement,CCDAParticipant participant,XPath xPath) throws XPathExpressionException
private void readName(Element nameElement,CCDAParticipant participant,XPath xPath) throws XPathExpressionException
{
if(nameElement != null)
{
Expand Down
Loading

0 comments on commit 97e0fce

Please sign in to comment.