openehr 1.2.999999 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +5 -5
- data/lib/openehr/am/template.rb +57 -26
- data/lib/openehr/parser/opt_parser.rb +149 -23
- data/lib/openehr/rm/common/archetyped.rb +1 -1
- data/lib/openehr/rm/data_types/uri.rb +0 -1
- data/lib/openehr/rm/factory.rb +111 -30
- data/lib/openehr/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8b6b9646daa3a967d9addfb4effc70408a402ff746a52fc549bff5ed150593b
|
4
|
+
data.tar.gz: 9390b872a07e6b3e3291489cfd1dc2ef87cc8eb41f3d2906aab829cfeb317937
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4d0d99c554e80da635c8d4d4bbbef09c5937dede153582e68793611e4708afac008eef063b2ca4a2b57cb7d25f6e18cf0db0914e9f74bf4463b200dd60a764a
|
7
|
+
data.tar.gz: 2b57b5b3556a2d431e7643936026067438d8d1405a9ad443cc7cd237cc7cd37f9b8dbf83085f3aa4d5407d3e3957a01945664b3e00fffa82299a23ab82387a60
|
data/README.rdoc
CHANGED
@@ -7,9 +7,9 @@ A Ruby implementation of the openEHR specifications
|
|
7
7
|
|
8
8
|
= Requirements
|
9
9
|
|
10
|
-
* Supports CRuby 2.
|
11
|
-
* Developed with CRuby
|
12
|
-
* Ruby 2.
|
10
|
+
* Supports CRuby 2.5.0 or later.
|
11
|
+
* Developed with CRuby 3.0.0 on FreeBSD and Linux.
|
12
|
+
* Ruby 2.4 or earlier are no longer supported.
|
13
13
|
|
14
14
|
=Description
|
15
15
|
|
@@ -34,7 +34,7 @@ This package excludes:
|
|
34
34
|
* Terminology service(moved to openehr-terminology package)
|
35
35
|
* Rails plugin(moved to openehr-rails package
|
36
36
|
|
37
|
-
Almost all classes passed the test constructed by
|
37
|
+
Almost all classes passed the test constructed by RSpec23 These spec
|
38
38
|
files are under /spec.
|
39
39
|
|
40
40
|
Some specifications are not well determined yet, such as rm/security
|
@@ -66,7 +66,7 @@ All Rights Reserved.
|
|
66
66
|
|
67
67
|
This product is released under Apache 2.0 license
|
68
68
|
|
69
|
-
Copyright [2012-
|
69
|
+
Copyright [2012-2020] openEHR Ruby implementation project.
|
70
70
|
|
71
71
|
Licensed under the Apache License, Version 2.0 (the "License");
|
72
72
|
you may not use this file except in compliance with the License.
|
data/lib/openehr/am/template.rb
CHANGED
@@ -1,49 +1,80 @@
|
|
1
|
+
require_relative 'archetype'
|
2
|
+
|
1
3
|
module OpenEHR
|
2
4
|
module AM
|
3
5
|
module Template
|
4
|
-
class
|
5
|
-
|
6
|
+
# OPERATIONAL_TEMPLATE class represents a "compiled" template derived from
|
7
|
+
# a source TEMPLATE by a "flattening" process, used for generating and
|
8
|
+
# validating reference model instance data.
|
9
|
+
# According to openEHR AOM2 specification, it inherits from AUTHORED_ARCHETYPE.
|
10
|
+
class OperationalTemplate < OpenEHR::AM::Archetype::Archetype
|
11
|
+
attr_reader :component_terminologies, :terminology_extracts, :template_id
|
6
12
|
|
7
13
|
def initialize(args = {})
|
8
|
-
|
9
|
-
|
14
|
+
# Initialize parent archetype with template-specific archetype_id
|
15
|
+
template_args = args.dup
|
16
|
+
template_args[:archetype_id] = args[:template_id] if args[:template_id] && !args[:archetype_id]
|
17
|
+
|
18
|
+
super(template_args)
|
19
|
+
|
10
20
|
self.template_id = args[:template_id]
|
11
|
-
self.
|
12
|
-
self.
|
13
|
-
self.definition = args[:definition]
|
14
|
-
self.component_terminologies = args[:component_terminologies]
|
21
|
+
self.component_terminologies = args[:component_terminologies] || {}
|
22
|
+
self.terminology_extracts = args[:terminology_extracts] || {}
|
15
23
|
end
|
16
24
|
|
17
|
-
def
|
18
|
-
|
25
|
+
def template_id=(template_id)
|
26
|
+
if template_id.nil?
|
27
|
+
raise ArgumentError, 'template_id is mandatory for operational template'
|
28
|
+
end
|
29
|
+
@template_id = template_id
|
30
|
+
# Update archetype_id to match template_id for consistency
|
31
|
+
@archetype_id = template_id if template_id
|
19
32
|
end
|
20
33
|
|
21
|
-
def
|
22
|
-
|
23
|
-
@concept = concept
|
34
|
+
def component_terminologies=(component_terminologies)
|
35
|
+
@component_terminologies = component_terminologies || {}
|
24
36
|
end
|
25
37
|
|
26
|
-
def
|
27
|
-
@
|
38
|
+
def terminology_extracts=(terminology_extracts)
|
39
|
+
@terminology_extracts = terminology_extracts || {}
|
28
40
|
end
|
29
41
|
|
30
|
-
|
31
|
-
|
32
|
-
|
42
|
+
# Returns true if this is a valid operational template
|
43
|
+
def is_valid_operational_template?
|
44
|
+
return false if template_id.nil?
|
45
|
+
return false if definition.nil?
|
46
|
+
return false if component_terminologies.nil?
|
47
|
+
true
|
33
48
|
end
|
34
49
|
|
35
|
-
|
36
|
-
|
37
|
-
|
50
|
+
# Returns whether the template is specialized (should be true for operational templates)
|
51
|
+
def is_specialized?
|
52
|
+
!parent_archetype_id.nil?
|
38
53
|
end
|
39
54
|
|
40
|
-
|
41
|
-
|
42
|
-
|
55
|
+
# Get all archetype identifiers referenced in this operational template
|
56
|
+
def referenced_archetype_ids
|
57
|
+
component_terminologies.keys
|
43
58
|
end
|
44
59
|
|
45
|
-
|
46
|
-
|
60
|
+
# Get terminology for a specific archetype
|
61
|
+
def terminology_for_archetype(archetype_id)
|
62
|
+
component_terminologies[archetype_id]
|
63
|
+
end
|
64
|
+
|
65
|
+
# Override concept to use template concept or fallback to archetype concept
|
66
|
+
def concept
|
67
|
+
@concept || (archetype_id ? archetype_id.concept_name : nil)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Compatibility method for backward compatibility with existing tests
|
71
|
+
def language
|
72
|
+
original_language
|
73
|
+
end
|
74
|
+
|
75
|
+
# Compatibility setter for language (maps to original_language)
|
76
|
+
def language=(language)
|
77
|
+
self.original_language = language
|
47
78
|
end
|
48
79
|
end
|
49
80
|
end
|
@@ -39,9 +39,24 @@ module OpenEHR
|
|
39
39
|
def parse
|
40
40
|
@opt = Nokogiri::XML::Document.parse(File.open(@filename))
|
41
41
|
@opt.remove_namespaces!
|
42
|
+
|
42
43
|
uid = OpenEHR::RM::Support::Identification::UIDBasedID.new(value: text_on_path(@opt, UID_PATH))
|
43
44
|
defs = definition
|
44
|
-
|
45
|
+
|
46
|
+
# Create operational template with archetype-compatible parameters
|
47
|
+
OpenEHR::AM::Template::OperationalTemplate.new(
|
48
|
+
uid: uid,
|
49
|
+
concept: concept,
|
50
|
+
original_language: language,
|
51
|
+
description: description,
|
52
|
+
template_id: template_id,
|
53
|
+
archetype_id: template_id, # Use template_id as archetype_id for compatibility
|
54
|
+
definition: defs,
|
55
|
+
ontology: create_template_ontology,
|
56
|
+
component_terminologies: @component_terminologies || {},
|
57
|
+
terminology_extracts: @component_terminologies || {},
|
58
|
+
adl_version: "1.4"
|
59
|
+
)
|
45
60
|
end
|
46
61
|
|
47
62
|
private
|
@@ -92,6 +107,30 @@ module OpenEHR
|
|
92
107
|
archetype_terminology(nodes)
|
93
108
|
end
|
94
109
|
|
110
|
+
def create_template_ontology
|
111
|
+
# Create a basic ontology for the template using the main concept
|
112
|
+
concept_code = 'at0000'
|
113
|
+
original_lang = language
|
114
|
+
|
115
|
+
term_definitions = {
|
116
|
+
original_lang.code_string => [
|
117
|
+
OpenEHR::AM::Archetype::Terminology::ArchetypeTerm.new(
|
118
|
+
code: concept_code,
|
119
|
+
items: {
|
120
|
+
'text' => concept || 'Template',
|
121
|
+
'description' => 'Operational template'
|
122
|
+
}
|
123
|
+
)
|
124
|
+
]
|
125
|
+
}
|
126
|
+
|
127
|
+
OpenEHR::AM::Archetype::Terminology::ArchetypeTerminology.new(
|
128
|
+
concept_code: concept_code,
|
129
|
+
original_language: original_lang,
|
130
|
+
term_definitions: term_definitions
|
131
|
+
)
|
132
|
+
end
|
133
|
+
|
95
134
|
def archetype_terminology(nodes)
|
96
135
|
td = term_definitions(nodes)
|
97
136
|
concept_code = td[language.code_string][0]
|
@@ -174,10 +213,23 @@ module OpenEHR
|
|
174
213
|
end
|
175
214
|
|
176
215
|
def c_code_phrase(attr_xml, node)
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
216
|
+
terminology_id_node = attr_xml.at('terminology_id/value')
|
217
|
+
terminology_id = terminology_id_node ? OpenEHR::RM::Support::Identification::TerminologyID.new(value: terminology_id_node.text.strip) : nil
|
218
|
+
|
219
|
+
code_list_nodes = attr_xml.xpath('code_list')
|
220
|
+
code_list = code_list_nodes.map { |code_node| code_node.text.strip }
|
221
|
+
code_list = [code_list.first] if code_list.size == 1 && code_list.first.empty?
|
222
|
+
|
223
|
+
occurrences_node = attr_xml.at('occurrences')
|
224
|
+
occurrences_obj = occurrences_node ? occurrences(occurrences_node) : nil
|
225
|
+
|
226
|
+
OpenEHR::AM::OpenEHRProfile::DataTypes::Text::CCodePhrase.new(
|
227
|
+
terminology_id: terminology_id,
|
228
|
+
code_list: code_list,
|
229
|
+
path: node.path,
|
230
|
+
occurrences: occurrences_obj,
|
231
|
+
rm_type_name: 'CODE_PHRASE'
|
232
|
+
)
|
181
233
|
end
|
182
234
|
|
183
235
|
def archetype_slot(attr_xml,node)
|
@@ -193,20 +245,57 @@ module OpenEHR
|
|
193
245
|
end
|
194
246
|
|
195
247
|
def occurrences(occurrence_xml)
|
248
|
+
return nil if occurrence_xml.nil?
|
249
|
+
|
196
250
|
lower_node = occurrence_xml.at('lower')
|
197
251
|
upper_node = occurrence_xml.at('upper')
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
252
|
+
lower_included_node = occurrence_xml.at('lower_included')
|
253
|
+
upper_included_node = occurrence_xml.at('upper_included')
|
254
|
+
lower_unbounded_node = occurrence_xml.at('lower_unbounded')
|
255
|
+
upper_unbounded_node = occurrence_xml.at('upper_unbounded')
|
256
|
+
|
257
|
+
lower = lower_node ? lower_node.text.to_i : nil
|
258
|
+
upper = upper_node ? upper_node.text.to_i : nil
|
259
|
+
lower_included = lower_included_node ? to_bool(lower_included_node.text) : (lower.nil? ? nil : true)
|
260
|
+
upper_included = upper_included_node ? to_bool(upper_included_node.text) : (upper.nil? ? nil : true)
|
261
|
+
lower_unbounded = lower_unbounded_node ? to_bool(lower_unbounded_node.text) : false
|
262
|
+
upper_unbounded = upper_unbounded_node ? to_bool(upper_unbounded_node.text) : false
|
263
|
+
|
264
|
+
# Handle unbounded intervals properly
|
265
|
+
if upper_unbounded || upper.nil?
|
266
|
+
upper = nil
|
267
|
+
upper_included = nil
|
268
|
+
end
|
269
|
+
|
270
|
+
if lower_unbounded || lower.nil?
|
271
|
+
lower = nil
|
272
|
+
lower_included = nil
|
273
|
+
end
|
274
|
+
|
275
|
+
OpenEHR::AssumedLibraryTypes::Interval.new(
|
276
|
+
lower: lower,
|
277
|
+
upper: upper,
|
278
|
+
lower_included: lower_included,
|
279
|
+
upper_included: upper_included
|
280
|
+
)
|
203
281
|
end
|
204
282
|
|
205
283
|
def cardinality(xml)
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
284
|
+
return nil if xml.nil?
|
285
|
+
|
286
|
+
order_node = xml.at('is_ordered')
|
287
|
+
unique_node = xml.at('is_unique')
|
288
|
+
interval_node = xml.at('interval')
|
289
|
+
|
290
|
+
order = order_node ? to_bool(order_node.text) : false
|
291
|
+
unique = unique_node ? to_bool(unique_node.text) : false
|
292
|
+
interval = interval_node ? occurrences(interval_node) : nil
|
293
|
+
|
294
|
+
OpenEHR::AM::Archetype::ConstraintModel::Cardinality.new(
|
295
|
+
is_ordered: order,
|
296
|
+
is_unique: unique,
|
297
|
+
interval: interval
|
298
|
+
)
|
210
299
|
end
|
211
300
|
|
212
301
|
def constraint_ref(attr_xml, node)
|
@@ -278,18 +367,56 @@ module OpenEHR
|
|
278
367
|
end
|
279
368
|
|
280
369
|
def c_date(xml)
|
281
|
-
|
370
|
+
pattern = xml.at('pattern')
|
371
|
+
range = xml.at('range')
|
372
|
+
if pattern
|
373
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CDate.new(pattern: pattern.text)
|
374
|
+
elsif range
|
375
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CDate.new(range: occurrences(range))
|
376
|
+
else
|
377
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CDate.new
|
378
|
+
end
|
282
379
|
end
|
283
380
|
|
284
381
|
def c_date_time(xml)
|
285
|
-
|
382
|
+
pattern = xml.at('pattern')
|
383
|
+
range = xml.at('range')
|
384
|
+
if pattern
|
385
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CDateTime.new(pattern: pattern.text)
|
386
|
+
elsif range
|
387
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CDateTime.new(range: occurrences(range))
|
388
|
+
else
|
389
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CDateTime.new
|
390
|
+
end
|
286
391
|
end
|
287
392
|
|
288
393
|
def c_integer(xml)
|
289
|
-
|
394
|
+
range = xml.at('range')
|
395
|
+
list = xml.xpath('list')
|
396
|
+
if range
|
397
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CInteger.new(range: occurrences(range))
|
398
|
+
elsif !list.empty?
|
399
|
+
list_values = list.map { |item| item.text.to_i }
|
400
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CInteger.new(list: list_values)
|
401
|
+
else
|
402
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CInteger.new
|
403
|
+
end
|
290
404
|
end
|
291
405
|
|
292
406
|
def c_boolean(xml)
|
407
|
+
true_valid = xml.at('true_valid')
|
408
|
+
false_valid = xml.at('false_valid')
|
409
|
+
assumed_value = xml.at('assumed_value')
|
410
|
+
|
411
|
+
true_valid_value = true_valid ? to_bool(true_valid.text) : nil
|
412
|
+
false_valid_value = false_valid ? to_bool(false_valid.text) : nil
|
413
|
+
assumed_value_value = assumed_value ? to_bool(assumed_value.text) : nil
|
414
|
+
|
415
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CBoolean.new(
|
416
|
+
true_valid: true_valid_value,
|
417
|
+
false_valid: false_valid_value,
|
418
|
+
assumed_value: assumed_value_value
|
419
|
+
)
|
293
420
|
end
|
294
421
|
|
295
422
|
def string(attr_xml)
|
@@ -309,12 +436,11 @@ module OpenEHR
|
|
309
436
|
end
|
310
437
|
|
311
438
|
def to_bool(str)
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
return nil
|
439
|
+
return nil if str.nil?
|
440
|
+
str = str.text if str.respond_to?(:text)
|
441
|
+
return true if /true/i =~ str.to_s
|
442
|
+
return false if /false/i =~ str.to_s
|
443
|
+
nil
|
318
444
|
end
|
319
445
|
end
|
320
446
|
end
|
@@ -95,7 +95,7 @@ module OpenEHR
|
|
95
95
|
attr_reader :archetype_id, :rm_version
|
96
96
|
attr_accessor :template_id
|
97
97
|
|
98
|
-
def initialize(args
|
98
|
+
def initialize(**args)
|
99
99
|
self.archetype_id = args[:archetype_id]
|
100
100
|
self.rm_version = args[:rm_version]
|
101
101
|
self.template_id = args[:template_id]
|
data/lib/openehr/rm/factory.rb
CHANGED
@@ -8,10 +8,26 @@ module OpenEHR
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class << self
|
11
|
-
def create(type,
|
12
|
-
|
13
|
-
|
11
|
+
def create(type, **param)
|
12
|
+
if type.include? '_'
|
13
|
+
type = type.downcase.camelize
|
14
|
+
else
|
15
|
+
type = type.capitalize
|
16
|
+
end
|
17
|
+
class_eval("#{type}Factory").create(params(param))
|
14
18
|
end
|
19
|
+
|
20
|
+
def params(param)
|
21
|
+
param.each_with_object({}) do |item, parameters|
|
22
|
+
key = item.shift
|
23
|
+
value = item.shift
|
24
|
+
if value.instance_of? Hash
|
25
|
+
parameters[key] = Factory.create(value[:_type], **value)
|
26
|
+
else
|
27
|
+
parameters[key] = value
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
15
31
|
end
|
16
32
|
|
17
33
|
def build
|
@@ -155,75 +171,140 @@ module OpenEHR
|
|
155
171
|
end
|
156
172
|
|
157
173
|
class DvDateFactory
|
158
|
-
def self.create(
|
159
|
-
OpenEHR::RM::DataTypes::Quantity::DateTime::DvDate.new(
|
174
|
+
def self.create(param)
|
175
|
+
OpenEHR::RM::DataTypes::Quantity::DateTime::DvDate.new(param)
|
160
176
|
end
|
161
177
|
end
|
162
178
|
|
163
179
|
class DvTimeFactory
|
164
|
-
def self.create(
|
165
|
-
DataTypes::Quantity::DateTime::DvTime.new(
|
180
|
+
def self.create(param)
|
181
|
+
DataTypes::Quantity::DateTime::DvTime.new(param)
|
166
182
|
end
|
167
183
|
end
|
168
184
|
|
169
185
|
class DvDateTimeFactory
|
170
|
-
def self.create(
|
171
|
-
DataTypes::Quantity::DateTime::DvDateTime.new(
|
186
|
+
def self.create(param)
|
187
|
+
DataTypes::Quantity::DateTime::DvDateTime.new(param)
|
172
188
|
end
|
173
189
|
end
|
174
190
|
|
175
191
|
class DvDurationFactory
|
176
|
-
def self.create(
|
177
|
-
DataTypes::Quantity::DateTime::DvDuration.new(
|
192
|
+
def self.create(param)
|
193
|
+
DataTypes::Quantity::DateTime::DvDuration.new(param)
|
178
194
|
end
|
179
195
|
end
|
180
196
|
|
181
197
|
class DvEncapsulatedFactory
|
182
|
-
def self.create(
|
183
|
-
DataTypes::Encapsulated::DvEncapsulated.new(
|
198
|
+
def self.create(param)
|
199
|
+
DataTypes::Encapsulated::DvEncapsulated.new(param)
|
184
200
|
end
|
185
201
|
end
|
186
202
|
|
187
203
|
class DvMultimediaFactory
|
188
|
-
def self.create(
|
189
|
-
DataTypes::Encapsulated::DvMultimedia.new(
|
204
|
+
def self.create(param)
|
205
|
+
DataTypes::Encapsulated::DvMultimedia.new(param)
|
190
206
|
end
|
191
207
|
end
|
192
208
|
|
193
209
|
class DvParsableFactory
|
194
|
-
def self.create(
|
195
|
-
DataTypes::Encapsulated::DvParsable.new(
|
210
|
+
def self.create(param)
|
211
|
+
DataTypes::Encapsulated::DvParsable.new(param)
|
196
212
|
end
|
197
213
|
end
|
198
214
|
|
199
215
|
class DvUriFactory
|
200
|
-
def self.create(
|
201
|
-
DataTypes::URI::DvUri.new(
|
216
|
+
def self.create(param)
|
217
|
+
DataTypes::URI::DvUri.new(param)
|
202
218
|
end
|
203
219
|
end
|
204
220
|
|
205
221
|
class DvEhrUriFactory
|
206
|
-
def self.create(
|
207
|
-
DataTypes::URI::DvEhrUri.new(
|
222
|
+
def self.create(param)
|
223
|
+
DataTypes::URI::DvEhrUri.new(param)
|
208
224
|
end
|
209
225
|
end
|
210
226
|
|
211
|
-
class
|
212
|
-
def self.create(
|
213
|
-
Composition::Content::Entry::Observation.new(
|
227
|
+
class ObservationFactory
|
228
|
+
def self.create(param)
|
229
|
+
Composition::Content::Entry::Observation.new(param)
|
214
230
|
end
|
215
231
|
end
|
216
232
|
|
217
|
-
class
|
218
|
-
def self.create(
|
219
|
-
Composition::Content::Navigation::Section.new(
|
233
|
+
class SectionFactory
|
234
|
+
def self.create(param)
|
235
|
+
Composition::Content::Navigation::Section.new(param)
|
220
236
|
end
|
221
237
|
end
|
222
238
|
|
223
|
-
class
|
224
|
-
def self.create(
|
225
|
-
DataStructures::ItemStructure::Representation::Cluster.new(
|
239
|
+
class ClusterFactory
|
240
|
+
def self.create(param)
|
241
|
+
DataStructures::ItemStructure::Representation::Cluster.new(param)
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
class ArchetypedFactory
|
246
|
+
def self.create(param)
|
247
|
+
OpenEHR::RM::Common::Archetyped::Archetyped.new(**param)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
class ArchetypeIdFactory
|
252
|
+
def self.create(param)
|
253
|
+
OpenEHR::RM::Support::Identification::ArchetypeID.new(param)
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
class TemplateIdFactory
|
258
|
+
def self.create(param)
|
259
|
+
OpenEHR::RM::Support::Identification::TemplateID.new(param)
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
class TerminologyIdFactory
|
264
|
+
def self.create(param)
|
265
|
+
OpenEHR::RM::Support::Identification::TerminologyID.new(param)
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
class GenericIdFactory
|
270
|
+
def self.create(param)
|
271
|
+
OpenEHR::RM::Support::Identification::GenericID.new(param)
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
class PartyRefFactory
|
276
|
+
def self.create(param)
|
277
|
+
OpenEHR::RM::Support::Identification::PartyRef.new(param)
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
class PartyIdentifiedFactory
|
282
|
+
def self.create(param)
|
283
|
+
OpenEHR::RM::Common::Generic::PartyIdentified.new(param)
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
class EventContextFactory
|
288
|
+
def self.create(param)
|
289
|
+
OpenEHR::RM::Composition::EventContext.new(param)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
class TermMappingFactory
|
294
|
+
def self.create(param)
|
295
|
+
OpenEHR::RM::DataTypes::Text::TermMapping.new(param)
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
class CompositionFactory < Factory
|
300
|
+
class << self
|
301
|
+
def create_from_json(json)
|
302
|
+
hash = JSON.parse(json, max_nesting: false, symbolize_names: true)
|
303
|
+
OpenEHR::RM::Composition::Composition.new(params(hash))
|
304
|
+
end
|
226
305
|
end
|
227
306
|
end
|
228
307
|
end
|
229
308
|
end
|
309
|
+
|
310
|
+
|
data/lib/openehr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openehr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinji KOBAYASHI
|
@@ -9,10 +9,9 @@ authors:
|
|
9
9
|
- Michael Deryugin
|
10
10
|
- Dmitry Lavrov
|
11
11
|
- Evgeny Strokov
|
12
|
-
autorequire:
|
13
12
|
bindir: bin
|
14
13
|
cert_chain: []
|
15
|
-
date:
|
14
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: rake
|
@@ -347,7 +346,6 @@ homepage: http://openehr.jp
|
|
347
346
|
licenses:
|
348
347
|
- Apache 2.0
|
349
348
|
metadata: {}
|
350
|
-
post_install_message:
|
351
349
|
rdoc_options: []
|
352
350
|
require_paths:
|
353
351
|
- lib
|
@@ -362,8 +360,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
362
360
|
- !ruby/object:Gem::Version
|
363
361
|
version: '0'
|
364
362
|
requirements: []
|
365
|
-
rubygems_version: 3.
|
366
|
-
signing_key:
|
363
|
+
rubygems_version: 3.6.7
|
367
364
|
specification_version: 4
|
368
365
|
summary: Ruby implementation of the openEHR specification
|
369
366
|
test_files: []
|