pharmaobservatory 0.1.11 → 0.1.13

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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -6
  3. data/docs/CompaniesApi.md +332 -4
  4. data/docs/CompaniesRecordAttributes.md +2 -0
  5. data/docs/CompaniesRow.md +1 -1
  6. data/docs/CompanyAssetsRow.md +5 -1
  7. data/docs/CompanyCompetitorsRow.md +8 -2
  8. data/docs/CompanyCosponsorsResponse.md +58 -0
  9. data/docs/CompanyCosponsorsRow.md +58 -0
  10. data/docs/CompanyPeerProfileResponse.md +58 -0
  11. data/docs/CompanyPeerProfileRow.md +60 -0
  12. data/docs/CompanyPeersResponse.md +58 -0
  13. data/docs/CompanyPeersRow.md +54 -0
  14. data/docs/CompanyProgramsRow.md +4 -0
  15. data/docs/InvestorPortfolioRow.md +41 -11
  16. data/docs/InvestorsApi.md +4 -4
  17. data/docs/InvestorsRow.md +3 -1
  18. data/docs/LegalEntitiesApi.md +80 -0
  19. data/docs/ProgramLicensingCandidatesRow.md +4 -0
  20. data/lib/pharmaobservatory/api/companies_api.rb +366 -2
  21. data/lib/pharmaobservatory/api/investors_api.rb +2 -2
  22. data/lib/pharmaobservatory/api/legal_entities_api.rb +84 -0
  23. data/lib/pharmaobservatory/models/companies_record_attributes.rb +10 -1
  24. data/lib/pharmaobservatory/models/companies_row.rb +1 -1
  25. data/lib/pharmaobservatory/models/company_assets_row.rb +27 -5
  26. data/lib/pharmaobservatory/models/company_competitors_row.rb +40 -7
  27. data/lib/pharmaobservatory/models/company_cosponsors_response.rb +478 -0
  28. data/lib/pharmaobservatory/models/company_cosponsors_row.rb +445 -0
  29. data/lib/pharmaobservatory/models/company_peer_profile_response.rb +478 -0
  30. data/lib/pharmaobservatory/models/company_peer_profile_row.rb +454 -0
  31. data/lib/pharmaobservatory/models/company_peers_response.rb +478 -0
  32. data/lib/pharmaobservatory/models/company_peers_row.rb +421 -0
  33. data/lib/pharmaobservatory/models/company_programs_row.rb +23 -1
  34. data/lib/pharmaobservatory/models/investor_portfolio_row.rb +180 -13
  35. data/lib/pharmaobservatory/models/investors_row.rb +13 -2
  36. data/lib/pharmaobservatory/models/program_licensing_candidates_row.rb +23 -1
  37. data/lib/pharmaobservatory/version.rb +1 -1
  38. data/lib/pharmaobservatory.rb +6 -0
  39. metadata +14 -2
@@ -0,0 +1,421 @@
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 company_peers dataset: one row per ordered company pair: an industry company and one of its top 10 peers by the match ladder. A grouped request returns the group columns and the measures instead, as additional properties.
18
+ class CompanyPeersRow
19
+ # Company level: the company the row is about; the entry key for the companies object type.
20
+ attr_accessor :company_id
21
+
22
+ # Display name of the company.
23
+ attr_accessor :company_name
24
+
25
+ # Group level: the company's current ultimate parent; a root's group is itself.
26
+ attr_accessor :group_id
27
+
28
+ # Display name of the group.
29
+ attr_accessor :group_name
30
+
31
+ # Company level: the peer company.
32
+ attr_accessor :peer_company_id
33
+
34
+ # Display name of the peer company.
35
+ attr_accessor :peer_company_name
36
+
37
+ # Group level: the peer's current ultimate parent; a root's group is itself.
38
+ attr_accessor :peer_group_id
39
+
40
+ # Display name of the peer's group.
41
+ attr_accessor :peer_group_name
42
+
43
+ # The peer's rank for the company, 1 is the closest match: match_level first, then the closeness of lead-trial counts, then of biologic share. Dense 1 to N.
44
+ attr_accessor :peer_rank
45
+
46
+ # What the peer matched the company on. 1 stage, modality, area and size; 2 stage, modality and area; 3 stage, modality and size; 4 stage and modality. Stage and modality always match.
47
+ attr_accessor :match_level
48
+
49
+ # True when the peer shares the company's primary therapeutic area.
50
+ attr_accessor :matched_area
51
+
52
+ # True when the peer shares the company's size band.
53
+ attr_accessor :matched_size
54
+
55
+ # The peer's lead stage, the furthest phase of its live owned programs. Equal to the company's lead stage on every row.
56
+ attr_accessor :lead_stage
57
+
58
+ # The peer's lead drug, the highest-phase live owned drug (ties: most trials).
59
+ attr_accessor :lead_drug_name
60
+
61
+ # Share, 0 to 1, of the peer's live owned drugs that are biologic (GSRS protein or nucleic acid substance type).
62
+ attr_accessor :biologic_share
63
+
64
+ # biologic when biologic_share is at least 0.5, else non_biologic. Equal to the company's band on every row.
65
+ attr_accessor :modality_band
66
+
67
+ # The peer's primary therapeutic area: the MeSH top-level category with the most live owned program trials.
68
+ attr_accessor :primary_area
69
+
70
+ # Distinct lead-sponsored trials of the peer's subtree.
71
+ attr_accessor :num_lead_trials
72
+
73
+ # Band of num_lead_trials: 1-4, 5-19, 20-99 or 100+.
74
+ attr_accessor :size_band
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'company_id' => :'company_id',
80
+ :'company_name' => :'company_name',
81
+ :'group_id' => :'group_id',
82
+ :'group_name' => :'group_name',
83
+ :'peer_company_id' => :'peer_company_id',
84
+ :'peer_company_name' => :'peer_company_name',
85
+ :'peer_group_id' => :'peer_group_id',
86
+ :'peer_group_name' => :'peer_group_name',
87
+ :'peer_rank' => :'peer_rank',
88
+ :'match_level' => :'match_level',
89
+ :'matched_area' => :'matched_area',
90
+ :'matched_size' => :'matched_size',
91
+ :'lead_stage' => :'lead_stage',
92
+ :'lead_drug_name' => :'lead_drug_name',
93
+ :'biologic_share' => :'biologic_share',
94
+ :'modality_band' => :'modality_band',
95
+ :'primary_area' => :'primary_area',
96
+ :'num_lead_trials' => :'num_lead_trials',
97
+ :'size_band' => :'size_band'
98
+ }
99
+ end
100
+
101
+ # Returns attribute mapping this model knows about
102
+ def self.acceptable_attribute_map
103
+ attribute_map
104
+ end
105
+
106
+ # Returns all the JSON keys this model knows about
107
+ def self.acceptable_attributes
108
+ acceptable_attribute_map.values
109
+ end
110
+
111
+ # Attribute type mapping.
112
+ def self.openapi_types
113
+ {
114
+ :'company_id' => :'String',
115
+ :'company_name' => :'String',
116
+ :'group_id' => :'String',
117
+ :'group_name' => :'String',
118
+ :'peer_company_id' => :'String',
119
+ :'peer_company_name' => :'String',
120
+ :'peer_group_id' => :'String',
121
+ :'peer_group_name' => :'String',
122
+ :'peer_rank' => :'Integer',
123
+ :'match_level' => :'Integer',
124
+ :'matched_area' => :'Boolean',
125
+ :'matched_size' => :'Boolean',
126
+ :'lead_stage' => :'String',
127
+ :'lead_drug_name' => :'String',
128
+ :'biologic_share' => :'Float',
129
+ :'modality_band' => :'String',
130
+ :'primary_area' => :'String',
131
+ :'num_lead_trials' => :'Integer',
132
+ :'size_band' => :'String'
133
+ }
134
+ end
135
+
136
+ # List of attributes with nullable: true
137
+ def self.openapi_nullable
138
+ Set.new([
139
+ :'company_id',
140
+ :'company_name',
141
+ :'group_id',
142
+ :'group_name',
143
+ :'peer_company_id',
144
+ :'peer_company_name',
145
+ :'peer_group_id',
146
+ :'peer_group_name',
147
+ :'peer_rank',
148
+ :'match_level',
149
+ :'matched_area',
150
+ :'matched_size',
151
+ :'lead_stage',
152
+ :'lead_drug_name',
153
+ :'biologic_share',
154
+ :'modality_band',
155
+ :'primary_area',
156
+ :'num_lead_trials',
157
+ :'size_band'
158
+ ])
159
+ end
160
+
161
+ # Initializes the object
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ def initialize(attributes = {})
164
+ if (!attributes.is_a?(Hash))
165
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::CompanyPeersRow` initialize method"
166
+ end
167
+
168
+ # check to see if the attribute exists and convert string to symbol for hash key
169
+ acceptable_attribute_map = self.class.acceptable_attribute_map
170
+ attributes = attributes.each_with_object({}) { |(k, v), h|
171
+ if (!acceptable_attribute_map.key?(k.to_sym))
172
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::CompanyPeersRow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
173
+ end
174
+ h[k.to_sym] = v
175
+ }
176
+
177
+ if attributes.key?(:'company_id')
178
+ self.company_id = attributes[:'company_id']
179
+ end
180
+
181
+ if attributes.key?(:'company_name')
182
+ self.company_name = attributes[:'company_name']
183
+ end
184
+
185
+ if attributes.key?(:'group_id')
186
+ self.group_id = attributes[:'group_id']
187
+ end
188
+
189
+ if attributes.key?(:'group_name')
190
+ self.group_name = attributes[:'group_name']
191
+ end
192
+
193
+ if attributes.key?(:'peer_company_id')
194
+ self.peer_company_id = attributes[:'peer_company_id']
195
+ end
196
+
197
+ if attributes.key?(:'peer_company_name')
198
+ self.peer_company_name = attributes[:'peer_company_name']
199
+ end
200
+
201
+ if attributes.key?(:'peer_group_id')
202
+ self.peer_group_id = attributes[:'peer_group_id']
203
+ end
204
+
205
+ if attributes.key?(:'peer_group_name')
206
+ self.peer_group_name = attributes[:'peer_group_name']
207
+ end
208
+
209
+ if attributes.key?(:'peer_rank')
210
+ self.peer_rank = attributes[:'peer_rank']
211
+ end
212
+
213
+ if attributes.key?(:'match_level')
214
+ self.match_level = attributes[:'match_level']
215
+ end
216
+
217
+ if attributes.key?(:'matched_area')
218
+ self.matched_area = attributes[:'matched_area']
219
+ end
220
+
221
+ if attributes.key?(:'matched_size')
222
+ self.matched_size = attributes[:'matched_size']
223
+ end
224
+
225
+ if attributes.key?(:'lead_stage')
226
+ self.lead_stage = attributes[:'lead_stage']
227
+ end
228
+
229
+ if attributes.key?(:'lead_drug_name')
230
+ self.lead_drug_name = attributes[:'lead_drug_name']
231
+ end
232
+
233
+ if attributes.key?(:'biologic_share')
234
+ self.biologic_share = attributes[:'biologic_share']
235
+ end
236
+
237
+ if attributes.key?(:'modality_band')
238
+ self.modality_band = attributes[:'modality_band']
239
+ end
240
+
241
+ if attributes.key?(:'primary_area')
242
+ self.primary_area = attributes[:'primary_area']
243
+ end
244
+
245
+ if attributes.key?(:'num_lead_trials')
246
+ self.num_lead_trials = attributes[:'num_lead_trials']
247
+ end
248
+
249
+ if attributes.key?(:'size_band')
250
+ self.size_band = attributes[:'size_band']
251
+ end
252
+ end
253
+
254
+ # Show invalid properties with the reasons. Usually used together with valid?
255
+ # @return Array for valid properties with the reasons
256
+ def list_invalid_properties
257
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
258
+ invalid_properties = Array.new
259
+ invalid_properties
260
+ end
261
+
262
+ # Check to see if the all the properties in the model are valid
263
+ # @return true if the model is valid
264
+ def valid?
265
+ warn '[DEPRECATED] the `valid?` method is obsolete'
266
+ true
267
+ end
268
+
269
+ # Checks equality by comparing each attribute.
270
+ # @param [Object] Object to be compared
271
+ def ==(o)
272
+ return true if self.equal?(o)
273
+ self.class == o.class &&
274
+ company_id == o.company_id &&
275
+ company_name == o.company_name &&
276
+ group_id == o.group_id &&
277
+ group_name == o.group_name &&
278
+ peer_company_id == o.peer_company_id &&
279
+ peer_company_name == o.peer_company_name &&
280
+ peer_group_id == o.peer_group_id &&
281
+ peer_group_name == o.peer_group_name &&
282
+ peer_rank == o.peer_rank &&
283
+ match_level == o.match_level &&
284
+ matched_area == o.matched_area &&
285
+ matched_size == o.matched_size &&
286
+ lead_stage == o.lead_stage &&
287
+ lead_drug_name == o.lead_drug_name &&
288
+ biologic_share == o.biologic_share &&
289
+ modality_band == o.modality_band &&
290
+ primary_area == o.primary_area &&
291
+ num_lead_trials == o.num_lead_trials &&
292
+ size_band == o.size_band
293
+ end
294
+
295
+ # @see the `==` method
296
+ # @param [Object] Object to be compared
297
+ def eql?(o)
298
+ self == o
299
+ end
300
+
301
+ # Calculates hash code according to all attributes.
302
+ # @return [Integer] Hash code
303
+ def hash
304
+ [company_id, company_name, group_id, group_name, peer_company_id, peer_company_name, peer_group_id, peer_group_name, peer_rank, match_level, matched_area, matched_size, lead_stage, lead_drug_name, biologic_share, modality_band, primary_area, num_lead_trials, size_band].hash
305
+ end
306
+
307
+ # Builds the object from hash
308
+ # @param [Hash] attributes Model attributes in the form of hash
309
+ # @return [Object] Returns the model itself
310
+ def self.build_from_hash(attributes)
311
+ return nil unless attributes.is_a?(Hash)
312
+ attributes = attributes.transform_keys(&:to_sym)
313
+ transformed_hash = {}
314
+ openapi_types.each_pair do |key, type|
315
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = nil
317
+ elsif type =~ /\AArray<(.*)>/i
318
+ # check to ensure the input is an array given that the attribute
319
+ # is documented as an array but the input is not
320
+ if attributes[attribute_map[key]].is_a?(Array)
321
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
322
+ end
323
+ elsif !attributes[attribute_map[key]].nil?
324
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
325
+ end
326
+ end
327
+ new(transformed_hash)
328
+ end
329
+
330
+ # Deserializes the data based on type
331
+ # @param string type Data type
332
+ # @param string value Value to be deserialized
333
+ # @return [Object] Deserialized data
334
+ def self._deserialize(type, value)
335
+ case type.to_sym
336
+ when :Time
337
+ Time.parse(value)
338
+ when :Date
339
+ Date.parse(value)
340
+ when :String
341
+ value.to_s
342
+ when :Integer
343
+ value.to_i
344
+ when :Float
345
+ value.to_f
346
+ when :Boolean
347
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
348
+ true
349
+ else
350
+ false
351
+ end
352
+ when :Object
353
+ # generic object (usually a Hash), return directly
354
+ value
355
+ when /\AArray<(?<inner_type>.+)>\z/
356
+ inner_type = Regexp.last_match[:inner_type]
357
+ value.map { |v| _deserialize(inner_type, v) }
358
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
359
+ k_type = Regexp.last_match[:k_type]
360
+ v_type = Regexp.last_match[:v_type]
361
+ {}.tap do |hash|
362
+ value.each do |k, v|
363
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
364
+ end
365
+ end
366
+ else # model
367
+ # models (e.g. Pet) or oneOf
368
+ klass = PharmaObservatory.const_get(type)
369
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
370
+ end
371
+ end
372
+
373
+ # Returns the string representation of the object
374
+ # @return [String] String presentation of the object
375
+ def to_s
376
+ to_hash.to_s
377
+ end
378
+
379
+ # to_body is an alias to to_hash (backward compatibility)
380
+ # @return [Hash] Returns the object in the form of hash
381
+ def to_body
382
+ to_hash
383
+ end
384
+
385
+ # Returns the object in the form of hash
386
+ # @return [Hash] Returns the object in the form of hash
387
+ def to_hash
388
+ hash = {}
389
+ self.class.attribute_map.each_pair do |attr, param|
390
+ value = self.send(attr)
391
+ if value.nil?
392
+ is_nullable = self.class.openapi_nullable.include?(attr)
393
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
394
+ end
395
+
396
+ hash[param] = _to_hash(value)
397
+ end
398
+ hash
399
+ end
400
+
401
+ # Outputs non-array value in the form of hash
402
+ # For object, use to_hash. Otherwise, just return the value
403
+ # @param [Object] value Any valid value
404
+ # @return [Hash] Returns the value in the form of hash
405
+ def _to_hash(value)
406
+ if value.is_a?(Array)
407
+ value.compact.map { |v| _to_hash(v) }
408
+ elsif value.is_a?(Hash)
409
+ {}.tap do |hash|
410
+ value.each { |k, v| hash[k] = _to_hash(v) }
411
+ end
412
+ elsif value.respond_to? :to_hash
413
+ value.to_hash
414
+ else
415
+ value
416
+ end
417
+ end
418
+
419
+ end
420
+
421
+ end
@@ -64,6 +64,12 @@ module PharmaObservatory
64
64
  # approved, active or abandoned.
65
65
  attr_accessor :lifecycle
66
66
 
67
+ # True when the sponsor is judged to develop the drug (an experimental arm, a regulatory holder, or an inferred lead); false when it is the backbone or comparator of a combination, one of many leads of a crowded drug, or not the holder of a generic. Every row is kept; this column labels it.
68
+ attr_accessor :owned
69
+
70
+ # Why owned is what it is: experimental_arm, regulatory_holder or inferred_lead (owned), or backbone, comparator, crowded_not_lead or generic_not_holder (not owned). inferred_lead is an inference made where the trials give no arm evidence either way.
71
+ attr_accessor :ownership_basis
72
+
67
73
  # Disability-adjusted life years (DALYs, millions) of the condition's global burden, from the Global Burden of Disease (GBD) 2021 study of the Institute for Health Metrics and Evaluation (IHME). Null for a caller without the licence for this column; see withheld_columns.
68
74
  attr_accessor :dalys_millions
69
75
 
@@ -86,6 +92,8 @@ module PharmaObservatory
86
92
  :'last_year' => :'last_year',
87
93
  :'withdrawn' => :'withdrawn',
88
94
  :'lifecycle' => :'lifecycle',
95
+ :'owned' => :'owned',
96
+ :'ownership_basis' => :'ownership_basis',
89
97
  :'dalys_millions' => :'dalys_millions'
90
98
  }
91
99
  end
@@ -119,6 +127,8 @@ module PharmaObservatory
119
127
  :'last_year' => :'Integer',
120
128
  :'withdrawn' => :'Boolean',
121
129
  :'lifecycle' => :'String',
130
+ :'owned' => :'Boolean',
131
+ :'ownership_basis' => :'String',
122
132
  :'dalys_millions' => :'Float'
123
133
  }
124
134
  end
@@ -142,6 +152,8 @@ module PharmaObservatory
142
152
  :'last_year',
143
153
  :'withdrawn',
144
154
  :'lifecycle',
155
+ :'owned',
156
+ :'ownership_basis',
145
157
  :'dalys_millions'
146
158
  ])
147
159
  end
@@ -226,6 +238,14 @@ module PharmaObservatory
226
238
  self.lifecycle = attributes[:'lifecycle']
227
239
  end
228
240
 
241
+ if attributes.key?(:'owned')
242
+ self.owned = attributes[:'owned']
243
+ end
244
+
245
+ if attributes.key?(:'ownership_basis')
246
+ self.ownership_basis = attributes[:'ownership_basis']
247
+ end
248
+
229
249
  if attributes.key?(:'dalys_millions')
230
250
  self.dalys_millions = attributes[:'dalys_millions']
231
251
  end
@@ -267,6 +287,8 @@ module PharmaObservatory
267
287
  last_year == o.last_year &&
268
288
  withdrawn == o.withdrawn &&
269
289
  lifecycle == o.lifecycle &&
290
+ owned == o.owned &&
291
+ ownership_basis == o.ownership_basis &&
270
292
  dalys_millions == o.dalys_millions
271
293
  end
272
294
 
@@ -279,7 +301,7 @@ module PharmaObservatory
279
301
  # Calculates hash code according to all attributes.
280
302
  # @return [Integer] Hash code
281
303
  def hash
282
- [sponsor_org_id, sponsor_name, sponsor_company_id, sponsor_company_name, sponsor_group_id, sponsor_group_name, drug_id, drug_name, condition_id, condition_name, max_phase, n_trials, n_active, last_year, withdrawn, lifecycle, dalys_millions].hash
304
+ [sponsor_org_id, sponsor_name, sponsor_company_id, sponsor_company_name, sponsor_group_id, sponsor_group_name, drug_id, drug_name, condition_id, condition_name, max_phase, n_trials, n_active, last_year, withdrawn, lifecycle, owned, ownership_basis, dalys_millions].hash
283
305
  end
284
306
 
285
307
  # Builds the object from hash