Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Service not responding json anymore

  • Loading branch information...
commit 2166bd37c9df6d1d04681096a3afe169d45bc3e8 1 parent b9ffc4b
Martin Westergaard Lassen authored September 16, 2012
2  sc-web/src/main/java/dk/sst/snomedcave/controllers/DrugController.java
@@ -107,7 +107,7 @@ public boolean evaluate(ConceptRelation relation) {
107 107
 
108 108
         concept = conceptRepository.findOne(causativesDrugAllergy.get(0).getChild().getNodeId());
109 109
 
110  
-        return new ResponseEntity<String>(gson.toJson(concept.getConceptId()), HttpStatus.OK);
  110
+        return new ResponseEntity<String>(concept.getConceptId(), HttpStatus.OK);
111 111
     }
112 112
 
113 113
     private long causativeAgentId() {
4  sc-web/src/main/webapp/js/application.js
@@ -109,8 +109,8 @@ module.directive("caveRegistration", function($http, $log) {
109 109
         scope.findDrug = function(query) {
110 110
             scope.allergyTree = undefined;
111 111
             $log.info("Will lookup " + query)
112  
-            $http.get("/drugs/concepttree?name=" + query).success(function(drug, status) {
113  
-                getConcept(drug.allergyId)
  112
+            $http.get("/drugs/concepttree?name=" + query).success(function(allergyId, status) {
  113
+                getConcept(allergyId)
114 114
             })
115 115
         }
116 116
 
8  sc-web/src/test/java/dk/sst/snomedcave/controllers/DrugControllerTest.java
@@ -36,10 +36,10 @@ public DrugController drugController() {
36 36
 
37 37
     @Test
38 38
     public void willAlwaysReturnNonCombinedDrug() throws Exception {
39  
-        for (int i = 0; i < 10; i++) {
40  
-            String json = drugController.tree("Paracetamol").getBody();
41  
-            assertNotNull(json);
42  
-            assertEquals(i + " of 10", "293584003", gson.fromJson(json, String.class));
  39
+        for (int i = 0; i < 100; i++) {
  40
+            String allergyId = drugController.tree("Paracetamol").getBody();
  41
+            assertNotNull(allergyId);
  42
+            assertEquals(i + " of 10", "293584003", allergyId);
43 43
         }
44 44
     }
45 45
 }

0 notes on commit 2166bd3

Please sign in to comment.
Something went wrong with that request. Please try again.