Skip to content

Commit

Permalink
Cleanup work
Browse files Browse the repository at this point in the history
  • Loading branch information
akimball-hw committed Sep 17, 2015
1 parent 4a327d9 commit 1740672
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/org/healthwise/quantumleap/parsing/beans/ConceptBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public List<String> getCuis() {
}

public void addCui(String cui) {
this.cuis.add(cui);
if (!(cui == null && cui.equals("null"))) {
this.cuis.add(cui);
}
}

public List<String> getDocs() {
Expand Down Expand Up @@ -190,7 +192,10 @@ public String getFacetId() {
}

public void setFacetId(String facetId) {
this.facetId = facetId;
if (facetId != null && !facetId.equals("null")) {
this.facetId = facetId;
}

}


Expand Down Expand Up @@ -258,7 +263,7 @@ public String render() {
// if we only have one broader
if (this.getBroader().size() == 1) {
out.append(" <skos:broader rdf:resource=\"#HWCV_" + this.getBroader().get(0) + "\"/>\n");
out.append(" <skos:hasTopConcept rdf:resource=\"#HWCV_" + this.getBroader().get(0) + "\"/>\n");
//out.append(" <skos:hasTopConcept rdf:resource=\"#HWCV_" + this.getBroader().get(0) + "\"/>\n");
} else {
// we have more than one
iter = this.getBroader().iterator();
Expand All @@ -268,7 +273,7 @@ public String render() {
if (broaderAsInt > 19999) {
out.append(" <skos:broader rdf:resource=\"#HWCV_" + broaderId + "\"/>\n");
} else {
out.append(" <skos:hasTopConcept rdf:resource=\"#HWCV_" + broaderId + "\"/>\n");
//out.append(" <skos:hasTopConcept rdf:resource=\"#HWCV_" + broaderId + "\"/>\n");
}
}
}
Expand Down Expand Up @@ -334,20 +339,20 @@ public String render() {
iter = this.getCuis().iterator();
while (iter.hasNext()) {
String cui = (String) iter.next();
out.append(" <hw_legacy:has_relevant_cui rdf:resource=\"http://www.healthwise.org/legacy/concept_schema#" + cui + "\"/>\n");
out.append(" <hw_legacy:has_cui rdf:resource=\"http://www.healthwise.org/legacy/concept_data#" + cui + "\"/>\n");
}
}

if (this.getDocs().size() > 0) {
iter = this.getDocs().iterator();
while (iter.hasNext()) {
String doc = (String) iter.next();
out.append(" <hw_legacy:has_relevant_hwid rdf:resource=\"http://www.healthwise.org/legacy/concept_schema#" + doc + "\"/>\n");
out.append(" <hw_legacy:has_hwid rdf:resource=\"http://www.healthwise.org/legacy/concept_data#" + doc + "\"/>\n");
}
}

if (this.getRdId() != null) {
out.append(" <hw_legacy:has_rd_id rdf:resource=\"http://www.healthwise.org/legacy/concept_schema#" + getRdId() + "\"/>\n");
out.append(" <hw_legacy:has_rd rdf:resource=\"http://www.healthwise.org/legacy/concept_data#" + getRdId() + "\"/>\n");
}


Expand All @@ -372,11 +377,16 @@ public String render() {
}


if (this.getFacetId() != null || !this.getFacetId().equals("null")) {
out.append(" <hw_legacy:has_facet_id rdf:resource=\"http://www.healthwise.org/legacy/concept_schema#" + getFacetId() + "\"/>\n");
if (this.getFacetId() != null && !this.getFacetId().equals("null")) {

out.append(" <hw_legacy:has_facet rdf:resource=\"http://www.healthwise.org/legacy/concept_data#" + getFacetId() + "\"/>\n");
}

out.append(" <" + HWNS + ":" + LIFECYCLE + ">" + getLifecycleStage() + "</" + HWNS + ":" + LIFECYCLE + ">\n");
if (getLifecycleStage() == null || getLifecycleStage().equals("null")) {
out.append(" <" + HWNS + ":" + LIFECYCLE + ">" + "unkown" + "</" + HWNS + ":" + LIFECYCLE + ">\n");
} else {
out.append(" <" + HWNS + ":" + LIFECYCLE + ">" + getLifecycleStage() + "</" + HWNS + ":" + LIFECYCLE + ">\n");
}



Expand Down

0 comments on commit 1740672

Please sign in to comment.