Browse files

Finished issue #25

Merge branch 'feature/concept-filtering' into develop
  • Loading branch information...
2 parents 88e27cd + 9250140 commit a803bf8dcc4eed68e92f36d2e27e718baf818384 @mwl mwl committed Sep 12, 2012
View
29 sc-dbgenerate/src/main/java/dk/sst/snomedcave/dbgenerate/SnomedParser.java
@@ -8,7 +8,9 @@
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import static java.lang.System.currentTimeMillis;
import static org.neo4j.graphdb.DynamicRelationshipType.withName;
@@ -21,6 +23,7 @@
Map<String, Long> conceptIds = new HashMap<String, Long>();
Map<String, String> conceptTerms = new HashMap<String, String>();
+ Set<String> deadAllergies = new HashSet<String>();
Map<String, String> configConcept = new HashMap<String, String>() {{
put("type", "exact");
@@ -87,8 +90,30 @@ else if ("term".equals(in.getRecordName())) {
}
}
+ private void readDeadAllergies() {
+ BeanReader in = getBeanReader("/data/dead_allergies.csv", "deadallergies");
+
+ Object record;
+ while ((record = in.read()) != null) {
+ if ("header".equals(in.getRecordName())) {
+ //Map<String, Object> header = (Map<String, Object>) record;
+ logger.debug("Parsing header: ignoring");
+ }
+ else if ("deadallergy".equals(in.getRecordName())) {
+ final Map<String, Object> term = (Map<String, Object>) record;
+
+ deadAllergies.add((String) term.get("conceptId"));
+ }
+ else {
+ logger.warn("unable to parse \"" + record + "\"");
+ }
+
+ }
+ }
+
public void importConcept() {
readTerms();
+ readDeadAllergies();
long startTime = currentTimeMillis();
BeanReader in = getBeanReader("/data/0/sct_concepts.txt", "concepts");
@@ -120,6 +145,10 @@ else if ("concept".equals(in.getRecordName())) {
private long saveConcept(final Map<String, Object> concept) {
concept.put("__type__", "dk.sst.snomedcave.model.Concept");
final String conceptId = (String) concept.get("conceptId");
+ if (deadAllergies.contains(conceptId)) {
+ concept.put("status", 42l);
+ logger.info("Concept " + conceptId + " got status 42");
+ }
concept.put("term", conceptTerms.containsKey(conceptId) ? conceptTerms.get(conceptId) : "");
final long nodeId = inserter.createNode(concept);
conceptIds.put(conceptId, nodeId);
View
25 sc-dbgenerate/src/main/resources/beanio-deadallergies.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beanio xmlns="http://www.beanio.org/2012/03">
+ <!--
+Begrebs ID;Fuldt specificerende term;Foretrukken term ID;Foretrukken term;
+293702004;Chenodeoxycholic and ursodeoxycholic acid allergy (disorder);3,84786E+15;allergi over for chenodeoxycholsyre og ursodeoxycholsyre; -->
+ <stream name="deadallergies" format="delimited">
+ <parser>
+ <property name="delimiter" value=";"/>
+ </parser>
+ <!-- 'class' binds the header record to a java.util.HashMap -->
+ <record name="header" class="map">
+ <field name="ConceptId" literal="Begrebs ID" rid="true"/>
+ <field name="FullyspecifiedName" literal="Fuldt specificerende term" rid="true"/>
+ <field name="preferredNameId" literal="Foretrukken term ID" rid="true"/>
+ <field name="preferredName" literal="Foretrukken term" rid="true"/>
+ </record>
+
+ <record name="deadallergy" class="map">
+ <field name="conceptId"/>
+ <field name="fullyspecifiedName"/>
+ <field name="preferredNameId"/>
+ <field name="preferredName"/>
+ </record>
+ </stream>
+</beanio>
View
25 sc-dbgenerate/src/main/resources/data/dead_allergies.csv
@@ -0,0 +1,25 @@
+Begrebs ID;Fuldt specificerende term;Foretrukken term ID;Foretrukken term;
+293702004;Chenodeoxycholic and ursodeoxycholic acid allergy (disorder);3,84786E+15;allergi over for chenodeoxycholsyre og ursodeoxycholsyre;
+294056005;Methyldopa and diuretic allergy (disorder);3,84574E+15;allergi over for methyldopa og diuretikum;
+294306008;Dimethyl-ether propane allergy (disorder);4,17588E+15;allergi over for dimethylether og propan;
+294432001;Chlorhexidine hydrochloride and neomycin sulfate allergy (disorder);4,11169E+15;allergi over for chlorhexidinhydrochlorid og neomycinsulfat;
+294522005;Ampicillin and cloxacillin allergy (disorder);3,98211E+15;allergi over for ampicillin og cloxacillin;
+294523000;Amoxicillin + clavulanate potassium allergy (disorder);4,74383E+15;allergi over for amoxicillin og clavulanatkalium;
+294525007;Piperacillin and tazobactam allergy (disorder);3,9821E+15;allergi over for piperacillin og tazobactam;
+294526008;Pivampicillin and pivmecillinam allergy (disorder);3,95117E+15;allergi over for pivampicillin og pivmecillinam;
+294527004;Ticarcillin and clavulanic acid allergy (disorder);4,09828E+15;allergi over for ticarcillin og clavulansyre;
+294594004;Sulfamethoxazole and trimethoprim allergy (disorder);4,74384E+15;allergi over for sulfamethoxazol og trimethoprim;
+294770001;Cyproterone acetate and ethinylestradiol allergy (disorder);4,11131E+15;allergi over for cyproteronacetat og ethinylenestradiol;
+294824002;Oxytocin and ergometrine allergy (disorder);3,95489E+15;allergi over for oxytocin og ergometrin;
+294837004;Disodium etidronate and calcium carbonate allergy (disorder);4,19829E+15;allergi over for etidronatdinatrium og calciumcarbonat;
+294892008;Iron and folic acid allergy (disorder);3,95336E+15;allergi over for jern og folsyre;
+295012004;Amiloride and loop diuretic allergy (disorder);4,17548E+15;allergi over for amilorid og loop-diuretikum;
+295013009;Amiloride and thiazide diuretic allergy (disorder);4,17554E+15;allergi over for diuretikum indeholdende amilorid og thiazid;
+295014003;Spironolactone and loop diuretic allergy (disorder);4,17549E+15;allergi over for spironolacton og loop-diuretikum;
+295015002;Spironolactone and thiazide diuretic allergy (disorder);4,17564E+15;allergi over for diuretikum indeholdende spironolacton og thiazid;
+295016001;Triamterene and loop diuretic allergy (disorder);4,1755E+15;allergi over for triamteren og loop-diuretikum;
+295017005;Triamterene and thiazide diuretic allergy (disorder);4,17565E+15;allergi over for diuretikum indeholdende triamteren og thiazid;
+297938000;Acetaminophen and dextropropoxyphene allergy (disorder);3,71385E+15;allergi over for co-proxamol;
+293809001;Co-beneldopa allergy (disorder);3,84649E+15;allergi over for co-beneldopa;
+293810006;Co-careldopa allergy (disorder);3,8465E+15;allergi over for co-careldopa;
+294524006;Ampicillin + flucloxacillin allergy (disorder);434801014;Co-fluampicil allergy;
View
2 sc-web/src/main/webapp/index.html
@@ -11,7 +11,7 @@
<title>Cave register</title>
</head>
<body>
-<div class="savedindicator animation"><i class="icon-ok"></i>&nbsp;Gemt!</div>
+<div class="savedindicator"><i class="icon-ok"></i>&nbsp;Gemt!</div>
<div class="container-fluid" ng-controller="IdentityCtrl">
<div class="navbar">
<div class="navbar-inner">
View
1 sc-web/src/main/webapp/js/application.js
@@ -19,6 +19,7 @@ module.controller("IdentityCtrl", function($scope, $location, $log, $http, $time
}
$scope.saveIdentity = function() {
$http.put("/identities/" + $scope.identity.cpr, $scope.identity).success(function(data, status) {
+ $(".savedindicator").addClass("animation")
$(".savedindicator").addClass("active")
$timeout(function () {
$(".savedindicator").removeClass("active")

0 comments on commit a803bf8

Please sign in to comment.