orthanc 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/orthanc/modalities.rb +47 -11
- data/lib/orthanc/response.rb +5 -1
- data/lib/orthanc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf9301babd64787d744d69a9a81464e3398fe4d
|
4
|
+
data.tar.gz: b8e4c42dac43349a5b14f8ac0fa0ad4cfb80433e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 185f53de1ddf328fbca69fb818d0b46c50ece065b54c78c5c0827d16232740ad450167bef087bece28312a4e0b36c2016ac060c459fdab0bf02f846f9e11fbb8
|
7
|
+
data.tar.gz: faf58cb724d81b4325a9052cb1046e41e0feed709f9db707298a71b434fba7779c0dd33ae4cace4f92b8336ac5669471f64adf2c0667100476e68b0813951298
|
data/lib/orthanc/modalities.rb
CHANGED
@@ -24,33 +24,69 @@ module Orthanc
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# POST /modalities/{dicom}/echo
|
27
|
-
def echo(payload = {}) # C-Echo SCU
|
28
|
-
|
27
|
+
def echo(payload = {}) # C-Echo SCU. Return true if successful
|
28
|
+
base_uri["echo"].post(payload){|response, request, result, &block|
|
29
|
+
if response.code == 200
|
30
|
+
return true
|
31
|
+
else
|
32
|
+
return false
|
33
|
+
end
|
34
|
+
}
|
29
35
|
end
|
30
36
|
|
31
37
|
# POST /modalities/{dicom}/find
|
32
|
-
def find(payload = {})
|
33
|
-
|
38
|
+
def find(payload = {}) # C-Echo SCU. Return true if successful
|
39
|
+
base_uri["find"].post(payload){|response, request, result, &block|
|
40
|
+
if response.code == 200
|
41
|
+
return handle_response(response)
|
42
|
+
else
|
43
|
+
return false
|
44
|
+
end
|
45
|
+
}
|
34
46
|
end
|
35
47
|
|
36
48
|
# POST /modalities/{dicom}/find-patient
|
37
|
-
def find_patient(payload = {})
|
38
|
-
|
49
|
+
def find_patient(payload = {}) # eg. '{"PatientName":"JOD*","PatientSex":"M"}'
|
50
|
+
base_uri["find-patient"].post(payload){|response, request, result, &block|
|
51
|
+
if response.code == 200
|
52
|
+
return handle_response(response)
|
53
|
+
else
|
54
|
+
return false
|
55
|
+
end
|
56
|
+
}
|
39
57
|
end
|
40
58
|
|
41
59
|
# POST /modalities/{dicom}/find-series
|
42
|
-
def find_series(payload = {})
|
43
|
-
|
60
|
+
def find_series(payload = {}) # eg. '{"PatientID":"0555643F"}'
|
61
|
+
base_uri["find-series"].post(payload){|response, request, result, &block|
|
62
|
+
if response.code == 200
|
63
|
+
return handle_response(response)
|
64
|
+
else
|
65
|
+
return false
|
66
|
+
end
|
67
|
+
}
|
44
68
|
end
|
45
69
|
|
46
70
|
# POST /modalities/{dicom}/find-study
|
47
|
-
def find_study(payload = {})
|
48
|
-
|
71
|
+
def find_study(payload = {}) # eg. '{"PatientID":"0555643F","StudyInstanceUID":"1.2.840.113704.1.111.2768.1239195678.57"}'
|
72
|
+
base_uri["find-study"].post(payload){|response, request, result, &block|
|
73
|
+
if response.code == 200
|
74
|
+
return handle_response(response)
|
75
|
+
else
|
76
|
+
return false
|
77
|
+
end
|
78
|
+
}
|
49
79
|
end
|
50
80
|
|
51
81
|
# POST /modalities/{dicom}/store
|
52
82
|
def store(payload = {}) # POST body = UUID series, UUID instance, or raw DICOM file
|
53
|
-
|
83
|
+
base_uri["store"].post(payload){|response, request, result, &block|
|
84
|
+
if response.code == 200
|
85
|
+
return true
|
86
|
+
else
|
87
|
+
return false
|
88
|
+
end
|
89
|
+
}
|
54
90
|
end
|
55
91
|
|
56
92
|
end
|
data/lib/orthanc/response.rb
CHANGED
@@ -16,7 +16,11 @@ module Response
|
|
16
16
|
parsed_response = JSON.parse(response)
|
17
17
|
|
18
18
|
if parsed_response.class == Array
|
19
|
-
|
19
|
+
# Normalize to an array inside a hash, so RecursiveOpenStruct can act
|
20
|
+
data = {}
|
21
|
+
data["response"] = parsed_response
|
22
|
+
return RecursiveOpenStruct.new(data.to_snake_keys, recurse_over_arrays: true ).response
|
23
|
+
|
20
24
|
elsif parsed_response.class == Hash
|
21
25
|
return RecursiveOpenStruct.new(parsed_response.to_snake_keys, recurse_over_arrays: true )
|
22
26
|
else
|
data/lib/orthanc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orthanc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Rascovsky
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|