pharmaobservatory 0.1.7 → 0.1.8

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 (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +83 -4
  3. data/docs/BiomarkerAlleleFrequenciesResponse.md +58 -0
  4. data/docs/BiomarkerAlleleFrequenciesRow.md +62 -0
  5. data/docs/BiomarkerAssayProvidersResponse.md +58 -0
  6. data/docs/BiomarkerAssayProvidersRow.md +72 -0
  7. data/docs/BiomarkerEvidenceByYearResponse.md +58 -0
  8. data/docs/BiomarkerEvidenceByYearRow.md +32 -0
  9. data/docs/BiomarkerTraversalStatusResponse.md +58 -0
  10. data/docs/BiomarkerTraversalStatusRow.md +36 -0
  11. data/docs/BiomarkersApi.md +320 -0
  12. data/docs/CompaniesApi.md +1001 -99
  13. data/docs/CompanyAssetsRow.md +5 -1
  14. data/docs/CompanyBiomarkerCapabilityResponse.md +58 -0
  15. data/docs/CompanyBiomarkerCapabilityRow.md +68 -0
  16. data/docs/CompanyProgramsRow.md +5 -1
  17. data/docs/CompanyRareDiseaseDeclarationsResponse.md +58 -0
  18. data/docs/CompanyRareDiseaseDeclarationsRow.md +52 -0
  19. data/docs/GxpFacilitiesRow.md +22 -0
  20. data/docs/LegalEntitiesApi.md +981 -101
  21. data/docs/LegalEntitiesRecordAttributes.md +6 -0
  22. data/docs/LegalEntitySecFilingsResponse.md +58 -0
  23. data/docs/LegalEntitySecFilingsRow.md +44 -0
  24. data/docs/OrgDisclosureTrendResponse.md +58 -0
  25. data/docs/OrgDisclosureTrendRow.md +62 -0
  26. data/docs/OwnershipSourceCoverageResponse.md +58 -0
  27. data/docs/OwnershipSourceCoverageRow.md +62 -0
  28. data/docs/ProgramLicensingCandidatesRow.md +5 -1
  29. data/docs/ProgramsRow.md +1 -1
  30. data/docs/RwdConductorDeliveryResponse.md +58 -0
  31. data/docs/RwdConductorDeliveryRow.md +74 -0
  32. data/docs/RwdConductorFootprintResponse.md +58 -0
  33. data/docs/RwdConductorFootprintRow.md +40 -0
  34. data/docs/RwdConductorStudiesResponse.md +58 -0
  35. data/docs/RwdConductorStudiesRow.md +42 -0
  36. data/docs/RwdConductorsApi.md +393 -0
  37. data/docs/RwdConductorsRecord.md +38 -0
  38. data/docs/RwdConductorsResponse.md +58 -0
  39. data/docs/RwdConductorsRow.md +72 -0
  40. data/docs/RwdInstitutionsApi.md +153 -0
  41. data/docs/RwdInstitutionsRecord.md +38 -0
  42. data/docs/RwdInstitutionsResponse.md +58 -0
  43. data/docs/RwdInstitutionsRow.md +154 -0
  44. data/docs/RwdNetworksApi.md +153 -0
  45. data/docs/RwdNetworksRecord.md +38 -0
  46. data/docs/RwdNetworksResponse.md +58 -0
  47. data/docs/RwdNetworksRow.md +110 -0
  48. data/docs/RwdStudiesApi.md +80 -0
  49. data/docs/SbtiCrosscheckResponse.md +58 -0
  50. data/docs/SbtiCrosscheckRow.md +48 -0
  51. data/docs/SponsorDeliveryResponse.md +58 -0
  52. data/docs/SponsorDeliveryRow.md +52 -0
  53. data/docs/SponsorPatentMentionsResponse.md +58 -0
  54. data/docs/SponsorPatentMentionsRow.md +42 -0
  55. data/docs/SponsorTrialConditionsResponse.md +58 -0
  56. data/docs/SponsorTrialConditionsRow.md +36 -0
  57. data/docs/SponsorTrialDrugsResponse.md +58 -0
  58. data/docs/SponsorTrialDrugsRow.md +34 -0
  59. data/lib/pharmaobservatory/api/biomarkers_api.rb +336 -0
  60. data/lib/pharmaobservatory/api/companies_api.rb +1131 -130
  61. data/lib/pharmaobservatory/api/legal_entities_api.rb +1047 -123
  62. data/lib/pharmaobservatory/api/rwd_conductors_api.rb +413 -0
  63. data/lib/pharmaobservatory/api/rwd_institutions_api.rb +161 -0
  64. data/lib/pharmaobservatory/api/rwd_networks_api.rb +161 -0
  65. data/lib/pharmaobservatory/api/rwd_studies_api.rb +84 -0
  66. data/lib/pharmaobservatory/models/biomarker_allele_frequencies_response.rb +478 -0
  67. data/lib/pharmaobservatory/models/biomarker_allele_frequencies_row.rb +465 -0
  68. data/lib/pharmaobservatory/models/biomarker_assay_providers_response.rb +478 -0
  69. data/lib/pharmaobservatory/models/biomarker_assay_providers_row.rb +520 -0
  70. data/lib/pharmaobservatory/models/biomarker_evidence_by_year_response.rb +478 -0
  71. data/lib/pharmaobservatory/models/biomarker_evidence_by_year_row.rb +300 -0
  72. data/lib/pharmaobservatory/models/biomarker_traversal_status_response.rb +478 -0
  73. data/lib/pharmaobservatory/models/biomarker_traversal_status_row.rb +322 -0
  74. data/lib/pharmaobservatory/models/company_assets_row.rb +24 -2
  75. data/lib/pharmaobservatory/models/company_biomarker_capability_response.rb +478 -0
  76. data/lib/pharmaobservatory/models/company_biomarker_capability_row.rb +498 -0
  77. data/lib/pharmaobservatory/models/company_programs_row.rb +24 -2
  78. data/lib/pharmaobservatory/models/company_rare_disease_declarations_response.rb +478 -0
  79. data/lib/pharmaobservatory/models/company_rare_disease_declarations_row.rb +410 -0
  80. data/lib/pharmaobservatory/models/gxp_facilities_row.rb +122 -1
  81. data/lib/pharmaobservatory/models/legal_entities_record_attributes.rb +28 -1
  82. data/lib/pharmaobservatory/models/legal_entity_sec_filings_response.rb +478 -0
  83. data/lib/pharmaobservatory/models/legal_entity_sec_filings_row.rb +370 -0
  84. data/lib/pharmaobservatory/models/org_disclosure_trend_response.rb +478 -0
  85. data/lib/pharmaobservatory/models/org_disclosure_trend_row.rb +465 -0
  86. data/lib/pharmaobservatory/models/ownership_source_coverage_response.rb +478 -0
  87. data/lib/pharmaobservatory/models/ownership_source_coverage_row.rb +465 -0
  88. data/lib/pharmaobservatory/models/program_licensing_candidates_row.rb +24 -2
  89. data/lib/pharmaobservatory/models/programs_row.rb +1 -1
  90. data/lib/pharmaobservatory/models/rwd_conductor_delivery_response.rb +478 -0
  91. data/lib/pharmaobservatory/models/rwd_conductor_delivery_row.rb +537 -0
  92. data/lib/pharmaobservatory/models/rwd_conductor_footprint_response.rb +478 -0
  93. data/lib/pharmaobservatory/models/rwd_conductor_footprint_row.rb +346 -0
  94. data/lib/pharmaobservatory/models/rwd_conductor_studies_response.rb +478 -0
  95. data/lib/pharmaobservatory/models/rwd_conductor_studies_row.rb +355 -0
  96. data/lib/pharmaobservatory/models/rwd_conductors_record.rb +385 -0
  97. data/lib/pharmaobservatory/models/rwd_conductors_response.rb +478 -0
  98. data/lib/pharmaobservatory/models/rwd_conductors_row.rb +526 -0
  99. data/lib/pharmaobservatory/models/rwd_institutions_record.rb +385 -0
  100. data/lib/pharmaobservatory/models/rwd_institutions_response.rb +478 -0
  101. data/lib/pharmaobservatory/models/rwd_institutions_row.rb +981 -0
  102. data/lib/pharmaobservatory/models/rwd_networks_record.rb +385 -0
  103. data/lib/pharmaobservatory/models/rwd_networks_response.rb +478 -0
  104. data/lib/pharmaobservatory/models/rwd_networks_row.rb +733 -0
  105. data/lib/pharmaobservatory/models/sbti_crosscheck_response.rb +478 -0
  106. data/lib/pharmaobservatory/models/sbti_crosscheck_row.rb +388 -0
  107. data/lib/pharmaobservatory/models/sponsor_delivery_response.rb +478 -0
  108. data/lib/pharmaobservatory/models/sponsor_delivery_row.rb +410 -0
  109. data/lib/pharmaobservatory/models/sponsor_patent_mentions_response.rb +478 -0
  110. data/lib/pharmaobservatory/models/sponsor_patent_mentions_row.rb +355 -0
  111. data/lib/pharmaobservatory/models/sponsor_trial_conditions_response.rb +478 -0
  112. data/lib/pharmaobservatory/models/sponsor_trial_conditions_row.rb +322 -0
  113. data/lib/pharmaobservatory/models/sponsor_trial_drugs_response.rb +478 -0
  114. data/lib/pharmaobservatory/models/sponsor_trial_drugs_row.rb +311 -0
  115. data/lib/pharmaobservatory/version.rb +1 -1
  116. data/lib/pharmaobservatory.rb +46 -0
  117. metadata +94 -2
@@ -0,0 +1,465 @@
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 ownership_source_coverage dataset: one row per ownership source class and subject as that source names it. A grouped request returns the group columns and the measures instead, as additional properties.
18
+ class OwnershipSourceCoverageRow
19
+ # The ownership source class (for example sec_def_14a for proxy statements, sec_form_adv for Form ADV).
20
+ attr_accessor :source_class
21
+
22
+ # The subject as the source names it: the source's own reference for the owned company.
23
+ attr_accessor :subject_source_ref
24
+
25
+ # The subject's name as filed.
26
+ attr_accessor :subject_name
27
+
28
+ # Legal-entity level: the organization record of the subject.
29
+ attr_accessor :subject_org_id
30
+
31
+ # Company level: the company the subject belongs to (null when unresolved).
32
+ attr_accessor :subject_company_id
33
+
34
+ # Display name of the subject's company.
35
+ attr_accessor :subject_company_name
36
+
37
+ # Group level: the subject's current ultimate parent company; a root company's group is itself.
38
+ attr_accessor :subject_group_id
39
+
40
+ # Display name of the subject's group.
41
+ attr_accessor :subject_group_name
42
+
43
+ # The system the source class is read from (for example sec_edgar).
44
+ attr_accessor :source_system
45
+
46
+ # The whole-source state: loaded, served_by_dedicated_mart (13F is served by the institutional holdings datasets), no_documents_ingested or source_not_ingested.
47
+ attr_accessor :source_load_state
48
+
49
+ # Documents the whole source has ingested.
50
+ attr_accessor :source_documents_ingested
51
+
52
+ # What the source read about this subject: reported, no_reportable_owner, extraction_abstained or read_no_owner.
53
+ attr_accessor :coverage_state
54
+
55
+ # Documents the source ingested about this subject.
56
+ attr_accessor :documents_ingested
57
+
58
+ # Ownership observations the source recorded about this subject.
59
+ attr_accessor :observations
60
+
61
+ # Ownership relationships that currently stand.
62
+ attr_accessor :current_edges
63
+
64
+ # Distinct owners the source named for this subject.
65
+ attr_accessor :owners_distinct
66
+
67
+ # Named owners that did not resolve to an organization or investor.
68
+ attr_accessor :owners_unresolved
69
+
70
+ # Filings that positively stated the subject has no reportable owner.
71
+ attr_accessor :no_reportable_owner_statements
72
+
73
+ # Documents on which the extractor abstained.
74
+ attr_accessor :extraction_abstained
75
+
76
+ # The latest filing date the source holds for this subject.
77
+ attr_accessor :last_filing_date
78
+
79
+ # The latest as-of date among the subject's observations.
80
+ attr_accessor :max_as_of_date
81
+
82
+ # The licence of the source.
83
+ attr_accessor :source_license
84
+
85
+ # The credit line for the source.
86
+ attr_accessor :attribution
87
+
88
+ # Attribute mapping from ruby-style variable name to JSON key.
89
+ def self.attribute_map
90
+ {
91
+ :'source_class' => :'source_class',
92
+ :'subject_source_ref' => :'subject_source_ref',
93
+ :'subject_name' => :'subject_name',
94
+ :'subject_org_id' => :'subject_org_id',
95
+ :'subject_company_id' => :'subject_company_id',
96
+ :'subject_company_name' => :'subject_company_name',
97
+ :'subject_group_id' => :'subject_group_id',
98
+ :'subject_group_name' => :'subject_group_name',
99
+ :'source_system' => :'source_system',
100
+ :'source_load_state' => :'source_load_state',
101
+ :'source_documents_ingested' => :'source_documents_ingested',
102
+ :'coverage_state' => :'coverage_state',
103
+ :'documents_ingested' => :'documents_ingested',
104
+ :'observations' => :'observations',
105
+ :'current_edges' => :'current_edges',
106
+ :'owners_distinct' => :'owners_distinct',
107
+ :'owners_unresolved' => :'owners_unresolved',
108
+ :'no_reportable_owner_statements' => :'no_reportable_owner_statements',
109
+ :'extraction_abstained' => :'extraction_abstained',
110
+ :'last_filing_date' => :'last_filing_date',
111
+ :'max_as_of_date' => :'max_as_of_date',
112
+ :'source_license' => :'source_license',
113
+ :'attribution' => :'attribution'
114
+ }
115
+ end
116
+
117
+ # Returns attribute mapping this model knows about
118
+ def self.acceptable_attribute_map
119
+ attribute_map
120
+ end
121
+
122
+ # Returns all the JSON keys this model knows about
123
+ def self.acceptable_attributes
124
+ acceptable_attribute_map.values
125
+ end
126
+
127
+ # Attribute type mapping.
128
+ def self.openapi_types
129
+ {
130
+ :'source_class' => :'String',
131
+ :'subject_source_ref' => :'String',
132
+ :'subject_name' => :'String',
133
+ :'subject_org_id' => :'String',
134
+ :'subject_company_id' => :'String',
135
+ :'subject_company_name' => :'String',
136
+ :'subject_group_id' => :'String',
137
+ :'subject_group_name' => :'String',
138
+ :'source_system' => :'String',
139
+ :'source_load_state' => :'String',
140
+ :'source_documents_ingested' => :'Integer',
141
+ :'coverage_state' => :'String',
142
+ :'documents_ingested' => :'Integer',
143
+ :'observations' => :'Integer',
144
+ :'current_edges' => :'Integer',
145
+ :'owners_distinct' => :'Integer',
146
+ :'owners_unresolved' => :'Integer',
147
+ :'no_reportable_owner_statements' => :'Integer',
148
+ :'extraction_abstained' => :'Integer',
149
+ :'last_filing_date' => :'Date',
150
+ :'max_as_of_date' => :'Date',
151
+ :'source_license' => :'String',
152
+ :'attribution' => :'String'
153
+ }
154
+ end
155
+
156
+ # List of attributes with nullable: true
157
+ def self.openapi_nullable
158
+ Set.new([
159
+ :'source_class',
160
+ :'subject_source_ref',
161
+ :'subject_name',
162
+ :'subject_org_id',
163
+ :'subject_company_id',
164
+ :'subject_company_name',
165
+ :'subject_group_id',
166
+ :'subject_group_name',
167
+ :'source_system',
168
+ :'source_load_state',
169
+ :'source_documents_ingested',
170
+ :'coverage_state',
171
+ :'documents_ingested',
172
+ :'observations',
173
+ :'current_edges',
174
+ :'owners_distinct',
175
+ :'owners_unresolved',
176
+ :'no_reportable_owner_statements',
177
+ :'extraction_abstained',
178
+ :'last_filing_date',
179
+ :'max_as_of_date',
180
+ :'source_license',
181
+ :'attribution'
182
+ ])
183
+ end
184
+
185
+ # Initializes the object
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ def initialize(attributes = {})
188
+ if (!attributes.is_a?(Hash))
189
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::OwnershipSourceCoverageRow` initialize method"
190
+ end
191
+
192
+ # check to see if the attribute exists and convert string to symbol for hash key
193
+ acceptable_attribute_map = self.class.acceptable_attribute_map
194
+ attributes = attributes.each_with_object({}) { |(k, v), h|
195
+ if (!acceptable_attribute_map.key?(k.to_sym))
196
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::OwnershipSourceCoverageRow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
197
+ end
198
+ h[k.to_sym] = v
199
+ }
200
+
201
+ if attributes.key?(:'source_class')
202
+ self.source_class = attributes[:'source_class']
203
+ end
204
+
205
+ if attributes.key?(:'subject_source_ref')
206
+ self.subject_source_ref = attributes[:'subject_source_ref']
207
+ end
208
+
209
+ if attributes.key?(:'subject_name')
210
+ self.subject_name = attributes[:'subject_name']
211
+ end
212
+
213
+ if attributes.key?(:'subject_org_id')
214
+ self.subject_org_id = attributes[:'subject_org_id']
215
+ end
216
+
217
+ if attributes.key?(:'subject_company_id')
218
+ self.subject_company_id = attributes[:'subject_company_id']
219
+ end
220
+
221
+ if attributes.key?(:'subject_company_name')
222
+ self.subject_company_name = attributes[:'subject_company_name']
223
+ end
224
+
225
+ if attributes.key?(:'subject_group_id')
226
+ self.subject_group_id = attributes[:'subject_group_id']
227
+ end
228
+
229
+ if attributes.key?(:'subject_group_name')
230
+ self.subject_group_name = attributes[:'subject_group_name']
231
+ end
232
+
233
+ if attributes.key?(:'source_system')
234
+ self.source_system = attributes[:'source_system']
235
+ end
236
+
237
+ if attributes.key?(:'source_load_state')
238
+ self.source_load_state = attributes[:'source_load_state']
239
+ end
240
+
241
+ if attributes.key?(:'source_documents_ingested')
242
+ self.source_documents_ingested = attributes[:'source_documents_ingested']
243
+ end
244
+
245
+ if attributes.key?(:'coverage_state')
246
+ self.coverage_state = attributes[:'coverage_state']
247
+ end
248
+
249
+ if attributes.key?(:'documents_ingested')
250
+ self.documents_ingested = attributes[:'documents_ingested']
251
+ end
252
+
253
+ if attributes.key?(:'observations')
254
+ self.observations = attributes[:'observations']
255
+ end
256
+
257
+ if attributes.key?(:'current_edges')
258
+ self.current_edges = attributes[:'current_edges']
259
+ end
260
+
261
+ if attributes.key?(:'owners_distinct')
262
+ self.owners_distinct = attributes[:'owners_distinct']
263
+ end
264
+
265
+ if attributes.key?(:'owners_unresolved')
266
+ self.owners_unresolved = attributes[:'owners_unresolved']
267
+ end
268
+
269
+ if attributes.key?(:'no_reportable_owner_statements')
270
+ self.no_reportable_owner_statements = attributes[:'no_reportable_owner_statements']
271
+ end
272
+
273
+ if attributes.key?(:'extraction_abstained')
274
+ self.extraction_abstained = attributes[:'extraction_abstained']
275
+ end
276
+
277
+ if attributes.key?(:'last_filing_date')
278
+ self.last_filing_date = attributes[:'last_filing_date']
279
+ end
280
+
281
+ if attributes.key?(:'max_as_of_date')
282
+ self.max_as_of_date = attributes[:'max_as_of_date']
283
+ end
284
+
285
+ if attributes.key?(:'source_license')
286
+ self.source_license = attributes[:'source_license']
287
+ end
288
+
289
+ if attributes.key?(:'attribution')
290
+ self.attribution = attributes[:'attribution']
291
+ end
292
+ end
293
+
294
+ # Show invalid properties with the reasons. Usually used together with valid?
295
+ # @return Array for valid properties with the reasons
296
+ def list_invalid_properties
297
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
298
+ invalid_properties = Array.new
299
+ invalid_properties
300
+ end
301
+
302
+ # Check to see if the all the properties in the model are valid
303
+ # @return true if the model is valid
304
+ def valid?
305
+ warn '[DEPRECATED] the `valid?` method is obsolete'
306
+ true
307
+ end
308
+
309
+ # Checks equality by comparing each attribute.
310
+ # @param [Object] Object to be compared
311
+ def ==(o)
312
+ return true if self.equal?(o)
313
+ self.class == o.class &&
314
+ source_class == o.source_class &&
315
+ subject_source_ref == o.subject_source_ref &&
316
+ subject_name == o.subject_name &&
317
+ subject_org_id == o.subject_org_id &&
318
+ subject_company_id == o.subject_company_id &&
319
+ subject_company_name == o.subject_company_name &&
320
+ subject_group_id == o.subject_group_id &&
321
+ subject_group_name == o.subject_group_name &&
322
+ source_system == o.source_system &&
323
+ source_load_state == o.source_load_state &&
324
+ source_documents_ingested == o.source_documents_ingested &&
325
+ coverage_state == o.coverage_state &&
326
+ documents_ingested == o.documents_ingested &&
327
+ observations == o.observations &&
328
+ current_edges == o.current_edges &&
329
+ owners_distinct == o.owners_distinct &&
330
+ owners_unresolved == o.owners_unresolved &&
331
+ no_reportable_owner_statements == o.no_reportable_owner_statements &&
332
+ extraction_abstained == o.extraction_abstained &&
333
+ last_filing_date == o.last_filing_date &&
334
+ max_as_of_date == o.max_as_of_date &&
335
+ source_license == o.source_license &&
336
+ attribution == o.attribution
337
+ end
338
+
339
+ # @see the `==` method
340
+ # @param [Object] Object to be compared
341
+ def eql?(o)
342
+ self == o
343
+ end
344
+
345
+ # Calculates hash code according to all attributes.
346
+ # @return [Integer] Hash code
347
+ def hash
348
+ [source_class, subject_source_ref, subject_name, subject_org_id, subject_company_id, subject_company_name, subject_group_id, subject_group_name, source_system, source_load_state, source_documents_ingested, coverage_state, documents_ingested, observations, current_edges, owners_distinct, owners_unresolved, no_reportable_owner_statements, extraction_abstained, last_filing_date, max_as_of_date, source_license, attribution].hash
349
+ end
350
+
351
+ # Builds the object from hash
352
+ # @param [Hash] attributes Model attributes in the form of hash
353
+ # @return [Object] Returns the model itself
354
+ def self.build_from_hash(attributes)
355
+ return nil unless attributes.is_a?(Hash)
356
+ attributes = attributes.transform_keys(&:to_sym)
357
+ transformed_hash = {}
358
+ openapi_types.each_pair do |key, type|
359
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
360
+ transformed_hash["#{key}"] = nil
361
+ elsif type =~ /\AArray<(.*)>/i
362
+ # check to ensure the input is an array given that the attribute
363
+ # is documented as an array but the input is not
364
+ if attributes[attribute_map[key]].is_a?(Array)
365
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
366
+ end
367
+ elsif !attributes[attribute_map[key]].nil?
368
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
369
+ end
370
+ end
371
+ new(transformed_hash)
372
+ end
373
+
374
+ # Deserializes the data based on type
375
+ # @param string type Data type
376
+ # @param string value Value to be deserialized
377
+ # @return [Object] Deserialized data
378
+ def self._deserialize(type, value)
379
+ case type.to_sym
380
+ when :Time
381
+ Time.parse(value)
382
+ when :Date
383
+ Date.parse(value)
384
+ when :String
385
+ value.to_s
386
+ when :Integer
387
+ value.to_i
388
+ when :Float
389
+ value.to_f
390
+ when :Boolean
391
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
392
+ true
393
+ else
394
+ false
395
+ end
396
+ when :Object
397
+ # generic object (usually a Hash), return directly
398
+ value
399
+ when /\AArray<(?<inner_type>.+)>\z/
400
+ inner_type = Regexp.last_match[:inner_type]
401
+ value.map { |v| _deserialize(inner_type, v) }
402
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
403
+ k_type = Regexp.last_match[:k_type]
404
+ v_type = Regexp.last_match[:v_type]
405
+ {}.tap do |hash|
406
+ value.each do |k, v|
407
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
408
+ end
409
+ end
410
+ else # model
411
+ # models (e.g. Pet) or oneOf
412
+ klass = PharmaObservatory.const_get(type)
413
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
414
+ end
415
+ end
416
+
417
+ # Returns the string representation of the object
418
+ # @return [String] String presentation of the object
419
+ def to_s
420
+ to_hash.to_s
421
+ end
422
+
423
+ # to_body is an alias to to_hash (backward compatibility)
424
+ # @return [Hash] Returns the object in the form of hash
425
+ def to_body
426
+ to_hash
427
+ end
428
+
429
+ # Returns the object in the form of hash
430
+ # @return [Hash] Returns the object in the form of hash
431
+ def to_hash
432
+ hash = {}
433
+ self.class.attribute_map.each_pair do |attr, param|
434
+ value = self.send(attr)
435
+ if value.nil?
436
+ is_nullable = self.class.openapi_nullable.include?(attr)
437
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
438
+ end
439
+
440
+ hash[param] = _to_hash(value)
441
+ end
442
+ hash
443
+ end
444
+
445
+ # Outputs non-array value in the form of hash
446
+ # For object, use to_hash. Otherwise, just return the value
447
+ # @param [Object] value Any valid value
448
+ # @return [Hash] Returns the value in the form of hash
449
+ def _to_hash(value)
450
+ if value.is_a?(Array)
451
+ value.compact.map { |v| _to_hash(v) }
452
+ elsif value.is_a?(Hash)
453
+ {}.tap do |hash|
454
+ value.each { |k, v| hash[k] = _to_hash(v) }
455
+ end
456
+ elsif value.respond_to? :to_hash
457
+ value.to_hash
458
+ else
459
+ value
460
+ end
461
+ end
462
+
463
+ end
464
+
465
+ end
@@ -49,9 +49,15 @@ module PharmaObservatory
49
49
  # Every MeSH descriptor id at or above the condition in the tree, the condition itself included. Filter a subtree with = ANY.
50
50
  attr_accessor :condition_ancestor_ids
51
51
 
52
- # Highest phase reached: 0 early phase 1 through 6 for phase 4 (marketed); -1 when unstated.
52
+ # Highest phase reached on the 0 to 4 scale: 0 not reported, 1 through 4 for phase 1 through phase 4 (4 is marketed); a split phase folds up to its higher phase.
53
53
  attr_accessor :max_phase
54
54
 
55
+ # The furthest phase reached with the split phases kept: Early 1, Phase 1, Phase 1/2, Phase 2, Phase 2/3, Phase 3, Phase 4, or Not reported. max_phase is the same value folded onto 0 to 4 (a split phase counts as its higher phase).
56
+ attr_accessor :max_phase_label
57
+
58
+ # The finest phase rank behind max_phase_label: 6 Phase 4, 5 Phase 3, 4 Phase 2/3, 3 Phase 2, 2 Phase 1/2, 1 Phase 1, 0 Early 1, -1 not reported. Sort on it to order programs by furthest phase with the split phases kept; max_phase is the same value folded onto 0 to 4.
59
+ attr_accessor :max_phase_fine_rank
60
+
55
61
  # Lead-sponsored trials in the program.
56
62
  attr_accessor :n_trials
57
63
 
@@ -94,6 +100,8 @@ module PharmaObservatory
94
100
  :'condition_name' => :'condition_name',
95
101
  :'condition_ancestor_ids' => :'condition_ancestor_ids',
96
102
  :'max_phase' => :'max_phase',
103
+ :'max_phase_label' => :'max_phase_label',
104
+ :'max_phase_fine_rank' => :'max_phase_fine_rank',
97
105
  :'n_trials' => :'n_trials',
98
106
  :'n_active' => :'n_active',
99
107
  :'last_year' => :'last_year',
@@ -131,6 +139,8 @@ module PharmaObservatory
131
139
  :'condition_name' => :'String',
132
140
  :'condition_ancestor_ids' => :'Array<String>',
133
141
  :'max_phase' => :'Integer',
142
+ :'max_phase_label' => :'String',
143
+ :'max_phase_fine_rank' => :'Integer',
134
144
  :'n_trials' => :'Integer',
135
145
  :'n_active' => :'Integer',
136
146
  :'last_year' => :'Integer',
@@ -158,6 +168,8 @@ module PharmaObservatory
158
168
  :'condition_name',
159
169
  :'condition_ancestor_ids',
160
170
  :'max_phase',
171
+ :'max_phase_label',
172
+ :'max_phase_fine_rank',
161
173
  :'n_trials',
162
174
  :'n_active',
163
175
  :'last_year',
@@ -236,6 +248,14 @@ module PharmaObservatory
236
248
  self.max_phase = attributes[:'max_phase']
237
249
  end
238
250
 
251
+ if attributes.key?(:'max_phase_label')
252
+ self.max_phase_label = attributes[:'max_phase_label']
253
+ end
254
+
255
+ if attributes.key?(:'max_phase_fine_rank')
256
+ self.max_phase_fine_rank = attributes[:'max_phase_fine_rank']
257
+ end
258
+
239
259
  if attributes.key?(:'n_trials')
240
260
  self.n_trials = attributes[:'n_trials']
241
261
  end
@@ -305,6 +325,8 @@ module PharmaObservatory
305
325
  condition_name == o.condition_name &&
306
326
  condition_ancestor_ids == o.condition_ancestor_ids &&
307
327
  max_phase == o.max_phase &&
328
+ max_phase_label == o.max_phase_label &&
329
+ max_phase_fine_rank == o.max_phase_fine_rank &&
308
330
  n_trials == o.n_trials &&
309
331
  n_active == o.n_active &&
310
332
  last_year == o.last_year &&
@@ -325,7 +347,7 @@ module PharmaObservatory
325
347
  # Calculates hash code according to all attributes.
326
348
  # @return [Integer] Hash code
327
349
  def hash
328
- [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, condition_ancestor_ids, max_phase, n_trials, n_active, last_year, last_update_year, withdrawn, cause_name, dalys_millions, deaths_millions, druggability].hash
350
+ [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, condition_ancestor_ids, max_phase, max_phase_label, max_phase_fine_rank, n_trials, n_active, last_year, last_update_year, withdrawn, cause_name, dalys_millions, deaths_millions, druggability].hash
329
351
  end
330
352
 
331
353
  # Builds the object from hash
@@ -37,7 +37,7 @@ module PharmaObservatory
37
37
  # True for a specific disease, false for a broad MeSH umbrella condition.
38
38
  attr_accessor :is_indication
39
39
 
40
- # Highest phase reached across the program's trials: 0 not reported, 1 through 4 for phase 1 through phase 4 (the 0 to 4 scale; see caveats).
40
+ # Highest phase reached across the program's trials: 0 not reported, 1 through 4 for phase 1 through phase 4 (the 0 to 4 scale shared with company_programs; see caveats).
41
41
  attr_accessor :max_phase
42
42
 
43
43
  # Distinct trials of the program, across all sponsors.