pharmaobservatory 0.1.24 → 0.1.26

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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +45 -4
  3. data/docs/BiomarkerLiteratureAllResponse.md +58 -0
  4. data/docs/BiomarkerLiteratureAllRow.md +36 -0
  5. data/docs/BiomarkerLiteratureOrgsResponse.md +58 -0
  6. data/docs/BiomarkerLiteratureOrgsRow.md +34 -0
  7. data/docs/BiomarkerLiteraturePeopleResponse.md +58 -0
  8. data/docs/BiomarkerLiteraturePeopleRow.md +36 -0
  9. data/docs/BiomarkersApi.md +240 -0
  10. data/docs/CompanyCompetitorsRow.md +1 -1
  11. data/docs/CompanyRareDiseaseDeclarationsRow.md +1 -1
  12. data/docs/ConditionLiteratureOrgsResponse.md +58 -0
  13. data/docs/ConditionLiteratureOrgsRow.md +34 -0
  14. data/docs/ConditionLiteraturePeopleResponse.md +58 -0
  15. data/docs/ConditionLiteraturePeopleRow.md +36 -0
  16. data/docs/ConditionLiteratureResponse.md +58 -0
  17. data/docs/ConditionLiteratureRow.md +36 -0
  18. data/docs/ConditionsApi.md +320 -0
  19. data/docs/ConditionsRecord.md +2 -0
  20. data/docs/InvestigatorsApi.md +320 -0
  21. data/docs/InvestmentGraphNodesRow.md +4 -2
  22. data/docs/LegalEntitiesApi.md +160 -0
  23. data/docs/OrgLiteraturePeopleResponse.md +58 -0
  24. data/docs/OrgLiteraturePeopleRow.md +36 -0
  25. data/docs/OrgLiteratureResponse.md +58 -0
  26. data/docs/OrgLiteratureRow.md +40 -0
  27. data/docs/PatientOrganisationResponse.md +58 -0
  28. data/docs/PatientOrganisationRow.md +74 -0
  29. data/docs/RareDiseaseOrganizationsRow.md +1 -1
  30. data/docs/RareDiseaseTrialSitesRow.md +5 -3
  31. data/docs/RareDiseasesApi.md +80 -0
  32. data/docs/RareDiseasesRecord.md +2 -0
  33. data/docs/TargetLiteratureOrgsResponse.md +58 -0
  34. data/docs/TargetLiteratureOrgsRow.md +34 -0
  35. data/docs/TargetLiteraturePeopleResponse.md +58 -0
  36. data/docs/TargetLiteraturePeopleRow.md +36 -0
  37. data/docs/TargetLiteratureResponse.md +58 -0
  38. data/docs/TargetLiteratureRow.md +36 -0
  39. data/docs/TargetsApi.md +240 -0
  40. data/lib/pharmaobservatory/api/biomarkers_api.rb +252 -0
  41. data/lib/pharmaobservatory/api/conditions_api.rb +336 -0
  42. data/lib/pharmaobservatory/api/investigators_api.rb +336 -0
  43. data/lib/pharmaobservatory/api/legal_entities_api.rb +168 -0
  44. data/lib/pharmaobservatory/api/rare_diseases_api.rb +84 -0
  45. data/lib/pharmaobservatory/api/targets_api.rb +252 -0
  46. data/lib/pharmaobservatory/models/biomarker_literature_all_response.rb +478 -0
  47. data/lib/pharmaobservatory/models/biomarker_literature_all_row.rb +322 -0
  48. data/lib/pharmaobservatory/models/biomarker_literature_orgs_response.rb +478 -0
  49. data/lib/pharmaobservatory/models/biomarker_literature_orgs_row.rb +311 -0
  50. data/lib/pharmaobservatory/models/biomarker_literature_people_response.rb +478 -0
  51. data/lib/pharmaobservatory/models/biomarker_literature_people_row.rb +322 -0
  52. data/lib/pharmaobservatory/models/company_competitors_row.rb +1 -1
  53. data/lib/pharmaobservatory/models/company_rare_disease_declarations_row.rb +1 -1
  54. data/lib/pharmaobservatory/models/condition_literature_orgs_response.rb +478 -0
  55. data/lib/pharmaobservatory/models/condition_literature_orgs_row.rb +311 -0
  56. data/lib/pharmaobservatory/models/condition_literature_people_response.rb +478 -0
  57. data/lib/pharmaobservatory/models/condition_literature_people_row.rb +322 -0
  58. data/lib/pharmaobservatory/models/condition_literature_response.rb +478 -0
  59. data/lib/pharmaobservatory/models/condition_literature_row.rb +322 -0
  60. data/lib/pharmaobservatory/models/conditions_record.rb +13 -1
  61. data/lib/pharmaobservatory/models/investment_graph_nodes_row.rb +19 -6
  62. data/lib/pharmaobservatory/models/org_literature_people_response.rb +478 -0
  63. data/lib/pharmaobservatory/models/org_literature_people_row.rb +322 -0
  64. data/lib/pharmaobservatory/models/org_literature_response.rb +478 -0
  65. data/lib/pharmaobservatory/models/org_literature_row.rb +344 -0
  66. data/lib/pharmaobservatory/models/patient_organisation_response.rb +478 -0
  67. data/lib/pharmaobservatory/models/patient_organisation_row.rb +545 -0
  68. data/lib/pharmaobservatory/models/rare_disease_organizations_row.rb +1 -1
  69. data/lib/pharmaobservatory/models/rare_disease_trial_sites_row.rb +15 -4
  70. data/lib/pharmaobservatory/models/rare_diseases_record.rb +13 -1
  71. data/lib/pharmaobservatory/models/target_literature_orgs_response.rb +478 -0
  72. data/lib/pharmaobservatory/models/target_literature_orgs_row.rb +311 -0
  73. data/lib/pharmaobservatory/models/target_literature_people_response.rb +478 -0
  74. data/lib/pharmaobservatory/models/target_literature_people_row.rb +322 -0
  75. data/lib/pharmaobservatory/models/target_literature_response.rb +478 -0
  76. data/lib/pharmaobservatory/models/target_literature_row.rb +322 -0
  77. data/lib/pharmaobservatory/version.rb +1 -1
  78. data/lib/pharmaobservatory.rb +24 -0
  79. metadata +50 -2
@@ -0,0 +1,545 @@
1
+ =begin
2
+ #Pharma Observatory Public REST API
3
+
4
+ #Read-only REST API over the Pharma Observatory biomedical data platform. Reference: https://pharmaobservatory.com/api-reference
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PharmaObservatory
17
+ # One row of the patient_organisation dataset: one row per active patient organisation, disease or condition page it is listed on, and link kind. A grouped request returns the group columns and the measures instead, as additional properties.
18
+ class PatientOrganisationRow
19
+ # Which kind of page the row is listed on: rare_disease (a rare disease page, entered on orpha_code) or condition (a condition page, entered on condition_id).
20
+ attr_accessor :target_kind
21
+
22
+ # The orpha_code of a rare_disease row or the condition_id of a condition row: the key the row is entered on. Always present, so it can stand in a sort or a cursor.
23
+ attr_accessor :target_key
24
+
25
+ # The ORPHA code of the disease the row is listed under, the digits in the web page address (/rare-diseases/558); null on a condition row. The entry key of the rare_diseases object type.
26
+ attr_accessor :orpha_code
27
+
28
+ # The MeSH descriptor id of the condition the row is listed under (D followed by six to nine digits); null on a rare disease row. The entry key of the conditions object type.
29
+ attr_accessor :condition_id
30
+
31
+ # The organisation's id: a spine organisation id (edgar:, ror:, sponsor: and the like) when the organisation folded onto an organisation we already hold, else pag:<registrable domain of its website>.
32
+ attr_accessor :patient_organisation_id
33
+
34
+ # The legal-entity id of the organisation when it folded onto one we already hold, the join to legal_entities; null for a pag: organisation, which has no spine record.
35
+ attr_accessor :org_id
36
+
37
+ # The organisation's name as its own website states it.
38
+ attr_accessor :name
39
+
40
+ # The organisation's website as it states it.
41
+ attr_accessor :website_url
42
+
43
+ # The country the organisation declares (ISO 3166-1 alpha-2), else its primary location's country.
44
+ attr_accessor :country
45
+
46
+ # The region of its primary location.
47
+ attr_accessor :region
48
+
49
+ # The city of its primary location.
50
+ attr_accessor :city
51
+
52
+ # How many locations the organisation lists.
53
+ attr_accessor :location_count
54
+
55
+ # The languages the organisation says it works in, as it states them.
56
+ attr_accessor :languages
57
+
58
+ # The organisation's own phone numbers, as stated. Organisation-level channels only: no person's line.
59
+ attr_accessor :phones
60
+
61
+ # The organisation's own email addresses, as stated, minus any address whose local part looks like a person's name. Organisation-level channels only.
62
+ attr_accessor :emails
63
+
64
+ # The organisation's own contact page addresses.
65
+ attr_accessor :contact_urls
66
+
67
+ # The organisation's own social media addresses.
68
+ attr_accessor :social_urls
69
+
70
+ # The services the organisation's own pages say it offers, from a closed list: support_groups, helpline, information_and_education, patient_registry, research_funding, advocacy_and_policy, financial_assistance, care_navigation, clinical_trial_matching, other.
71
+ attr_accessor :service_codes
72
+
73
+ # For a service coded other, the organisation's own words for it. Empty when it states none.
74
+ attr_accessor :other_service_labels
75
+
76
+ # How the organisation reaches the disease or condition the row is listed under: declared (its own page names it), mapped (a condition row: it declares a rare disease this condition is mapped to; the mapped_* columns say which), broader (a rare disease row: it declared a broader parent disease) or narrower (a rare disease row: it declared a narrower child disease). A broader or narrower row never says the organisation declares THIS disease.
77
+ attr_accessor :link_kind
78
+
79
+ # The page's group order: 1 declared, 2 mapped, 3 broader, 4 narrower.
80
+ attr_accessor :link_rank
81
+
82
+ # How much of its work the organisation says the disease is: sole_focus, one_of_several or umbrella; null when it states none.
83
+ attr_accessor :declared_scope
84
+
85
+ # The disease name the organisation actually declared. On a broader, narrower or mapped row it is NOT this page's disease.
86
+ attr_accessor :declared_name
87
+
88
+ # On a mapped row, the ORPHA code of the declared rare disease the condition is mapped to; null otherwise.
89
+ attr_accessor :mapped_orpha_code
90
+
91
+ # On a mapped row, the preferred name of that rare disease; null otherwise.
92
+ attr_accessor :mapped_disease_name
93
+
94
+ # On a mapped row, how the rare disease relates to the condition (exact, broader or narrower); null otherwise.
95
+ attr_accessor :mapping_relation
96
+
97
+ # The page of the organisation's own website the declaration came from.
98
+ attr_accessor :source_url
99
+
100
+ # The date that page was retrieved.
101
+ attr_accessor :retrieved_on
102
+
103
+ # The source credit line for the row: Source: <organisation name>, <page address>, retrieved <date>. Mandatory wherever the row is shown.
104
+ attr_accessor :credit
105
+
106
+ # Attribute mapping from ruby-style variable name to JSON key.
107
+ def self.attribute_map
108
+ {
109
+ :'target_kind' => :'target_kind',
110
+ :'target_key' => :'target_key',
111
+ :'orpha_code' => :'orpha_code',
112
+ :'condition_id' => :'condition_id',
113
+ :'patient_organisation_id' => :'patient_organisation_id',
114
+ :'org_id' => :'org_id',
115
+ :'name' => :'name',
116
+ :'website_url' => :'website_url',
117
+ :'country' => :'country',
118
+ :'region' => :'region',
119
+ :'city' => :'city',
120
+ :'location_count' => :'location_count',
121
+ :'languages' => :'languages',
122
+ :'phones' => :'phones',
123
+ :'emails' => :'emails',
124
+ :'contact_urls' => :'contact_urls',
125
+ :'social_urls' => :'social_urls',
126
+ :'service_codes' => :'service_codes',
127
+ :'other_service_labels' => :'other_service_labels',
128
+ :'link_kind' => :'link_kind',
129
+ :'link_rank' => :'link_rank',
130
+ :'declared_scope' => :'declared_scope',
131
+ :'declared_name' => :'declared_name',
132
+ :'mapped_orpha_code' => :'mapped_orpha_code',
133
+ :'mapped_disease_name' => :'mapped_disease_name',
134
+ :'mapping_relation' => :'mapping_relation',
135
+ :'source_url' => :'source_url',
136
+ :'retrieved_on' => :'retrieved_on',
137
+ :'credit' => :'credit'
138
+ }
139
+ end
140
+
141
+ # Returns attribute mapping this model knows about
142
+ def self.acceptable_attribute_map
143
+ attribute_map
144
+ end
145
+
146
+ # Returns all the JSON keys this model knows about
147
+ def self.acceptable_attributes
148
+ acceptable_attribute_map.values
149
+ end
150
+
151
+ # Attribute type mapping.
152
+ def self.openapi_types
153
+ {
154
+ :'target_kind' => :'String',
155
+ :'target_key' => :'String',
156
+ :'orpha_code' => :'String',
157
+ :'condition_id' => :'String',
158
+ :'patient_organisation_id' => :'String',
159
+ :'org_id' => :'String',
160
+ :'name' => :'String',
161
+ :'website_url' => :'String',
162
+ :'country' => :'String',
163
+ :'region' => :'String',
164
+ :'city' => :'String',
165
+ :'location_count' => :'Integer',
166
+ :'languages' => :'Array<String>',
167
+ :'phones' => :'Array<String>',
168
+ :'emails' => :'Array<String>',
169
+ :'contact_urls' => :'Array<String>',
170
+ :'social_urls' => :'Array<String>',
171
+ :'service_codes' => :'Array<String>',
172
+ :'other_service_labels' => :'Array<String>',
173
+ :'link_kind' => :'String',
174
+ :'link_rank' => :'Integer',
175
+ :'declared_scope' => :'String',
176
+ :'declared_name' => :'String',
177
+ :'mapped_orpha_code' => :'String',
178
+ :'mapped_disease_name' => :'String',
179
+ :'mapping_relation' => :'String',
180
+ :'source_url' => :'String',
181
+ :'retrieved_on' => :'Date',
182
+ :'credit' => :'String'
183
+ }
184
+ end
185
+
186
+ # List of attributes with nullable: true
187
+ def self.openapi_nullable
188
+ Set.new([
189
+ :'target_kind',
190
+ :'target_key',
191
+ :'orpha_code',
192
+ :'condition_id',
193
+ :'patient_organisation_id',
194
+ :'org_id',
195
+ :'name',
196
+ :'website_url',
197
+ :'country',
198
+ :'region',
199
+ :'city',
200
+ :'location_count',
201
+ :'languages',
202
+ :'phones',
203
+ :'emails',
204
+ :'contact_urls',
205
+ :'social_urls',
206
+ :'service_codes',
207
+ :'other_service_labels',
208
+ :'link_kind',
209
+ :'link_rank',
210
+ :'declared_scope',
211
+ :'declared_name',
212
+ :'mapped_orpha_code',
213
+ :'mapped_disease_name',
214
+ :'mapping_relation',
215
+ :'source_url',
216
+ :'retrieved_on',
217
+ :'credit'
218
+ ])
219
+ end
220
+
221
+ # Initializes the object
222
+ # @param [Hash] attributes Model attributes in the form of hash
223
+ def initialize(attributes = {})
224
+ if (!attributes.is_a?(Hash))
225
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::PatientOrganisationRow` initialize method"
226
+ end
227
+
228
+ # check to see if the attribute exists and convert string to symbol for hash key
229
+ acceptable_attribute_map = self.class.acceptable_attribute_map
230
+ attributes = attributes.each_with_object({}) { |(k, v), h|
231
+ if (!acceptable_attribute_map.key?(k.to_sym))
232
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::PatientOrganisationRow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
233
+ end
234
+ h[k.to_sym] = v
235
+ }
236
+
237
+ if attributes.key?(:'target_kind')
238
+ self.target_kind = attributes[:'target_kind']
239
+ end
240
+
241
+ if attributes.key?(:'target_key')
242
+ self.target_key = attributes[:'target_key']
243
+ end
244
+
245
+ if attributes.key?(:'orpha_code')
246
+ self.orpha_code = attributes[:'orpha_code']
247
+ end
248
+
249
+ if attributes.key?(:'condition_id')
250
+ self.condition_id = attributes[:'condition_id']
251
+ end
252
+
253
+ if attributes.key?(:'patient_organisation_id')
254
+ self.patient_organisation_id = attributes[:'patient_organisation_id']
255
+ end
256
+
257
+ if attributes.key?(:'org_id')
258
+ self.org_id = attributes[:'org_id']
259
+ end
260
+
261
+ if attributes.key?(:'name')
262
+ self.name = attributes[:'name']
263
+ end
264
+
265
+ if attributes.key?(:'website_url')
266
+ self.website_url = attributes[:'website_url']
267
+ end
268
+
269
+ if attributes.key?(:'country')
270
+ self.country = attributes[:'country']
271
+ end
272
+
273
+ if attributes.key?(:'region')
274
+ self.region = attributes[:'region']
275
+ end
276
+
277
+ if attributes.key?(:'city')
278
+ self.city = attributes[:'city']
279
+ end
280
+
281
+ if attributes.key?(:'location_count')
282
+ self.location_count = attributes[:'location_count']
283
+ end
284
+
285
+ if attributes.key?(:'languages')
286
+ if (value = attributes[:'languages']).is_a?(Array)
287
+ self.languages = value
288
+ end
289
+ end
290
+
291
+ if attributes.key?(:'phones')
292
+ if (value = attributes[:'phones']).is_a?(Array)
293
+ self.phones = value
294
+ end
295
+ end
296
+
297
+ if attributes.key?(:'emails')
298
+ if (value = attributes[:'emails']).is_a?(Array)
299
+ self.emails = value
300
+ end
301
+ end
302
+
303
+ if attributes.key?(:'contact_urls')
304
+ if (value = attributes[:'contact_urls']).is_a?(Array)
305
+ self.contact_urls = value
306
+ end
307
+ end
308
+
309
+ if attributes.key?(:'social_urls')
310
+ if (value = attributes[:'social_urls']).is_a?(Array)
311
+ self.social_urls = value
312
+ end
313
+ end
314
+
315
+ if attributes.key?(:'service_codes')
316
+ if (value = attributes[:'service_codes']).is_a?(Array)
317
+ self.service_codes = value
318
+ end
319
+ end
320
+
321
+ if attributes.key?(:'other_service_labels')
322
+ if (value = attributes[:'other_service_labels']).is_a?(Array)
323
+ self.other_service_labels = value
324
+ end
325
+ end
326
+
327
+ if attributes.key?(:'link_kind')
328
+ self.link_kind = attributes[:'link_kind']
329
+ end
330
+
331
+ if attributes.key?(:'link_rank')
332
+ self.link_rank = attributes[:'link_rank']
333
+ end
334
+
335
+ if attributes.key?(:'declared_scope')
336
+ self.declared_scope = attributes[:'declared_scope']
337
+ end
338
+
339
+ if attributes.key?(:'declared_name')
340
+ self.declared_name = attributes[:'declared_name']
341
+ end
342
+
343
+ if attributes.key?(:'mapped_orpha_code')
344
+ self.mapped_orpha_code = attributes[:'mapped_orpha_code']
345
+ end
346
+
347
+ if attributes.key?(:'mapped_disease_name')
348
+ self.mapped_disease_name = attributes[:'mapped_disease_name']
349
+ end
350
+
351
+ if attributes.key?(:'mapping_relation')
352
+ self.mapping_relation = attributes[:'mapping_relation']
353
+ end
354
+
355
+ if attributes.key?(:'source_url')
356
+ self.source_url = attributes[:'source_url']
357
+ end
358
+
359
+ if attributes.key?(:'retrieved_on')
360
+ self.retrieved_on = attributes[:'retrieved_on']
361
+ end
362
+
363
+ if attributes.key?(:'credit')
364
+ self.credit = attributes[:'credit']
365
+ end
366
+ end
367
+
368
+ # Show invalid properties with the reasons. Usually used together with valid?
369
+ # @return Array for valid properties with the reasons
370
+ def list_invalid_properties
371
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
372
+ invalid_properties = Array.new
373
+ invalid_properties
374
+ end
375
+
376
+ # Check to see if the all the properties in the model are valid
377
+ # @return true if the model is valid
378
+ def valid?
379
+ warn '[DEPRECATED] the `valid?` method is obsolete'
380
+ true
381
+ end
382
+
383
+ # Checks equality by comparing each attribute.
384
+ # @param [Object] Object to be compared
385
+ def ==(o)
386
+ return true if self.equal?(o)
387
+ self.class == o.class &&
388
+ target_kind == o.target_kind &&
389
+ target_key == o.target_key &&
390
+ orpha_code == o.orpha_code &&
391
+ condition_id == o.condition_id &&
392
+ patient_organisation_id == o.patient_organisation_id &&
393
+ org_id == o.org_id &&
394
+ name == o.name &&
395
+ website_url == o.website_url &&
396
+ country == o.country &&
397
+ region == o.region &&
398
+ city == o.city &&
399
+ location_count == o.location_count &&
400
+ languages == o.languages &&
401
+ phones == o.phones &&
402
+ emails == o.emails &&
403
+ contact_urls == o.contact_urls &&
404
+ social_urls == o.social_urls &&
405
+ service_codes == o.service_codes &&
406
+ other_service_labels == o.other_service_labels &&
407
+ link_kind == o.link_kind &&
408
+ link_rank == o.link_rank &&
409
+ declared_scope == o.declared_scope &&
410
+ declared_name == o.declared_name &&
411
+ mapped_orpha_code == o.mapped_orpha_code &&
412
+ mapped_disease_name == o.mapped_disease_name &&
413
+ mapping_relation == o.mapping_relation &&
414
+ source_url == o.source_url &&
415
+ retrieved_on == o.retrieved_on &&
416
+ credit == o.credit
417
+ end
418
+
419
+ # @see the `==` method
420
+ # @param [Object] Object to be compared
421
+ def eql?(o)
422
+ self == o
423
+ end
424
+
425
+ # Calculates hash code according to all attributes.
426
+ # @return [Integer] Hash code
427
+ def hash
428
+ [target_kind, target_key, orpha_code, condition_id, patient_organisation_id, org_id, name, website_url, country, region, city, location_count, languages, phones, emails, contact_urls, social_urls, service_codes, other_service_labels, link_kind, link_rank, declared_scope, declared_name, mapped_orpha_code, mapped_disease_name, mapping_relation, source_url, retrieved_on, credit].hash
429
+ end
430
+
431
+ # Builds the object from hash
432
+ # @param [Hash] attributes Model attributes in the form of hash
433
+ # @return [Object] Returns the model itself
434
+ def self.build_from_hash(attributes)
435
+ return nil unless attributes.is_a?(Hash)
436
+ attributes = attributes.transform_keys(&:to_sym)
437
+ transformed_hash = {}
438
+ openapi_types.each_pair do |key, type|
439
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
440
+ transformed_hash["#{key}"] = nil
441
+ elsif type =~ /\AArray<(.*)>/i
442
+ # check to ensure the input is an array given that the attribute
443
+ # is documented as an array but the input is not
444
+ if attributes[attribute_map[key]].is_a?(Array)
445
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
446
+ end
447
+ elsif !attributes[attribute_map[key]].nil?
448
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
449
+ end
450
+ end
451
+ new(transformed_hash)
452
+ end
453
+
454
+ # Deserializes the data based on type
455
+ # @param string type Data type
456
+ # @param string value Value to be deserialized
457
+ # @return [Object] Deserialized data
458
+ def self._deserialize(type, value)
459
+ case type.to_sym
460
+ when :Time
461
+ Time.parse(value)
462
+ when :Date
463
+ Date.parse(value)
464
+ when :String
465
+ value.to_s
466
+ when :Integer
467
+ value.to_i
468
+ when :Float
469
+ value.to_f
470
+ when :Boolean
471
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
472
+ true
473
+ else
474
+ false
475
+ end
476
+ when :Object
477
+ # generic object (usually a Hash), return directly
478
+ value
479
+ when /\AArray<(?<inner_type>.+)>\z/
480
+ inner_type = Regexp.last_match[:inner_type]
481
+ value.map { |v| _deserialize(inner_type, v) }
482
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
483
+ k_type = Regexp.last_match[:k_type]
484
+ v_type = Regexp.last_match[:v_type]
485
+ {}.tap do |hash|
486
+ value.each do |k, v|
487
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
488
+ end
489
+ end
490
+ else # model
491
+ # models (e.g. Pet) or oneOf
492
+ klass = PharmaObservatory.const_get(type)
493
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
494
+ end
495
+ end
496
+
497
+ # Returns the string representation of the object
498
+ # @return [String] String presentation of the object
499
+ def to_s
500
+ to_hash.to_s
501
+ end
502
+
503
+ # to_body is an alias to to_hash (backward compatibility)
504
+ # @return [Hash] Returns the object in the form of hash
505
+ def to_body
506
+ to_hash
507
+ end
508
+
509
+ # Returns the object in the form of hash
510
+ # @return [Hash] Returns the object in the form of hash
511
+ def to_hash
512
+ hash = {}
513
+ self.class.attribute_map.each_pair do |attr, param|
514
+ value = self.send(attr)
515
+ if value.nil?
516
+ is_nullable = self.class.openapi_nullable.include?(attr)
517
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
518
+ end
519
+
520
+ hash[param] = _to_hash(value)
521
+ end
522
+ hash
523
+ end
524
+
525
+ # Outputs non-array value in the form of hash
526
+ # For object, use to_hash. Otherwise, just return the value
527
+ # @param [Object] value Any valid value
528
+ # @return [Hash] Returns the value in the form of hash
529
+ def _to_hash(value)
530
+ if value.is_a?(Array)
531
+ value.compact.map { |v| _to_hash(v) }
532
+ elsif value.is_a?(Hash)
533
+ {}.tap do |hash|
534
+ value.each { |k, v| hash[k] = _to_hash(v) }
535
+ end
536
+ elsif value.respond_to? :to_hash
537
+ value.to_hash
538
+ else
539
+ value
540
+ end
541
+ end
542
+
543
+ end
544
+
545
+ end
@@ -58,7 +58,7 @@ module PharmaObservatory
58
58
  # The source the assertion was read from.
59
59
  attr_accessor :source_key
60
60
 
61
- # The record in the source the assertion comes from.
61
+ # The record in the source the assertion comes from. NULL for the patient_organisation_site source, whose id is an internal page-version key.
62
62
  attr_accessor :source_record_id
63
63
 
64
64
  # A link to the source record, where it has one.
@@ -40,13 +40,13 @@ module PharmaObservatory
40
40
  # The facility's country as filed.
41
41
  attr_accessor :country
42
42
 
43
- # The site's latitude in degrees; null when no coordinate is known.
43
+ # The site's distance-ready latitude in degrees: one real filed location, the one most of the site's registry filings agree on, the same point the site has on the disease page map and in the nearest-site list. Null when the site is not mappable (its filings disagree, or are coarser than a city). Not the mean of the site's locations.
44
44
  attr_accessor :latitude
45
45
 
46
- # The site's longitude in degrees; null when no coordinate is known.
46
+ # The site's distance-ready longitude in degrees, paired with latitude; null exactly when latitude is.
47
47
  attr_accessor :longitude
48
48
 
49
- # The source of the coordinate: aact (the registry's own), geonames (GeoNames) or als (Amazon Location Service).
49
+ # The source of the latitude and longitude: aact (the registry's own), geonames (GeoNames) or als (Amazon Location Service); null when latitude is.
50
50
  attr_accessor :coord_source
51
51
 
52
52
  # The MeSH condition ids through which the disease reaches the site's trials.
@@ -61,6 +61,9 @@ module PharmaObservatory
61
61
  # Those trials that are recruiting, not yet recruiting, active or enrolling by invitation.
62
62
  attr_accessor :n_active_trials
63
63
 
64
+ # Those directly tagged trials that are recruiting or not yet recruiting, the statuses a person can volunteer for. A subset of n_trials_direct; active but closed and invitation-only trials are not counted.
65
+ attr_accessor :n_open_trials_direct
66
+
64
67
  # The earliest start year among those trials.
65
68
  attr_accessor :first_trial_year
66
69
 
@@ -88,6 +91,7 @@ module PharmaObservatory
88
91
  :'n_trials' => :'n_trials',
89
92
  :'n_trials_direct' => :'n_trials_direct',
90
93
  :'n_active_trials' => :'n_active_trials',
94
+ :'n_open_trials_direct' => :'n_open_trials_direct',
91
95
  :'first_trial_year' => :'first_trial_year',
92
96
  :'last_trial_year' => :'last_trial_year',
93
97
  :'last_update_posted_date' => :'last_update_posted_date'
@@ -122,6 +126,7 @@ module PharmaObservatory
122
126
  :'n_trials' => :'Integer',
123
127
  :'n_trials_direct' => :'Integer',
124
128
  :'n_active_trials' => :'Integer',
129
+ :'n_open_trials_direct' => :'Integer',
125
130
  :'first_trial_year' => :'Integer',
126
131
  :'last_trial_year' => :'Integer',
127
132
  :'last_update_posted_date' => :'Date'
@@ -146,6 +151,7 @@ module PharmaObservatory
146
151
  :'n_trials',
147
152
  :'n_trials_direct',
148
153
  :'n_active_trials',
154
+ :'n_open_trials_direct',
149
155
  :'first_trial_year',
150
156
  :'last_trial_year',
151
157
  :'last_update_posted_date'
@@ -230,6 +236,10 @@ module PharmaObservatory
230
236
  self.n_active_trials = attributes[:'n_active_trials']
231
237
  end
232
238
 
239
+ if attributes.key?(:'n_open_trials_direct')
240
+ self.n_open_trials_direct = attributes[:'n_open_trials_direct']
241
+ end
242
+
233
243
  if attributes.key?(:'first_trial_year')
234
244
  self.first_trial_year = attributes[:'first_trial_year']
235
245
  end
@@ -278,6 +288,7 @@ module PharmaObservatory
278
288
  n_trials == o.n_trials &&
279
289
  n_trials_direct == o.n_trials_direct &&
280
290
  n_active_trials == o.n_active_trials &&
291
+ n_open_trials_direct == o.n_open_trials_direct &&
281
292
  first_trial_year == o.first_trial_year &&
282
293
  last_trial_year == o.last_trial_year &&
283
294
  last_update_posted_date == o.last_update_posted_date
@@ -292,7 +303,7 @@ module PharmaObservatory
292
303
  # Calculates hash code according to all attributes.
293
304
  # @return [Integer] Hash code
294
305
  def hash
295
- [orpha_code, mapping_arm, site_id, site_rank, site_name, city, state, country, latitude, longitude, coord_source, condition_ids, n_trials, n_trials_direct, n_active_trials, first_trial_year, last_trial_year, last_update_posted_date].hash
306
+ [orpha_code, mapping_arm, site_id, site_rank, site_name, city, state, country, latitude, longitude, coord_source, condition_ids, n_trials, n_trials_direct, n_active_trials, n_open_trials_direct, first_trial_year, last_trial_year, last_update_posted_date].hash
296
307
  end
297
308
 
298
309
  # Builds the object from hash
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module PharmaObservatory
17
17
  class RareDiseasesRecord
18
+ # Sections of the object's web page, by key: patient_organisations, the list the page shows of the organisations that name the disease or condition on their own websites (state, empty_state, coverage, groups of entries carrying the patient_organisation dataset's columns, the per-entry credit and the lane attribution).
19
+ attr_accessor :sections
20
+
18
21
  attr_accessor :object_type
19
22
 
20
23
  attr_accessor :id
@@ -40,6 +43,7 @@ module PharmaObservatory
40
43
  # Attribute mapping from ruby-style variable name to JSON key.
41
44
  def self.attribute_map
42
45
  {
46
+ :'sections' => :'sections',
43
47
  :'object_type' => :'object_type',
44
48
  :'id' => :'id',
45
49
  :'record' => :'record',
@@ -67,6 +71,7 @@ module PharmaObservatory
67
71
  # Attribute type mapping.
68
72
  def self.openapi_types
69
73
  {
74
+ :'sections' => :'Hash<String, Object>',
70
75
  :'object_type' => :'String',
71
76
  :'id' => :'String',
72
77
  :'record' => :'RareDiseasesRow',
@@ -104,6 +109,12 @@ module PharmaObservatory
104
109
  h[k.to_sym] = v
105
110
  }
106
111
 
112
+ if attributes.key?(:'sections')
113
+ if (value = attributes[:'sections']).is_a?(Hash)
114
+ self.sections = value
115
+ end
116
+ end
117
+
107
118
  if attributes.key?(:'object_type')
108
119
  self.object_type = attributes[:'object_type']
109
120
  else
@@ -243,6 +254,7 @@ module PharmaObservatory
243
254
  def ==(o)
244
255
  return true if self.equal?(o)
245
256
  self.class == o.class &&
257
+ sections == o.sections &&
246
258
  object_type == o.object_type &&
247
259
  id == o.id &&
248
260
  record == o.record &&
@@ -265,7 +277,7 @@ module PharmaObservatory
265
277
  # Calculates hash code according to all attributes.
266
278
  # @return [Integer] Hash code
267
279
  def hash
268
- [object_type, id, record, attributes, datasets, attribution, source_credit, freshness, build, build_state, restriction].hash
280
+ [sections, object_type, id, record, attributes, datasets, attribution, source_credit, freshness, build, build_state, restriction].hash
269
281
  end
270
282
 
271
283
  # Builds the object from hash