generated from StanfordSpezi/SpeziTemplateApplication
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load Trials from the NCI Trials API (#18)
# Load Trials from the NCI Trials API ## ⚙️ Release Notes - Extends the OpenAPI Spec to include response details - Demonstrates loading trials using all example IDs provided in the API documentation ### Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
- Loading branch information
1 parent
cbfc6aa
commit e9f011e
Showing
53 changed files
with
6,382 additions
and
4,309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 18 additions & 18 deletions
36
NCIClinicalTrialsSearchAPI/OpenAPIClient/Classes/OpenAPIs/APIs/TrialsAPI.swift
Large diffs are not rendered by default.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
NCIClinicalTrialsSearchAPI/OpenAPIClient/Classes/OpenAPIs/Models/Arm.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Arm.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct Arm: Codable, JSONEncodable, Hashable { | ||
|
||
public var interventions: [Intervention]? | ||
public var name: String? | ||
public var description: String? | ||
public var type: String? | ||
|
||
public init(interventions: [Intervention]? = nil, name: String? = nil, description: String? = nil, type: String? = nil) { | ||
self.interventions = interventions | ||
self.name = name | ||
self.description = description | ||
self.type = type | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case interventions | ||
case name | ||
case description | ||
case type | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(interventions, forKey: .interventions) | ||
try container.encodeIfPresent(name, forKey: .name) | ||
try container.encodeIfPresent(description, forKey: .description) | ||
try container.encodeIfPresent(type, forKey: .type) | ||
} | ||
} | ||
|
44 changes: 44 additions & 0 deletions
44
NCIClinicalTrialsSearchAPI/OpenAPIClient/Classes/OpenAPIs/Models/CentralContact.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// CentralContact.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct CentralContact: Codable, JSONEncodable, Hashable { | ||
|
||
public var phone: AnyCodable? | ||
public var name: AnyCodable? | ||
public var type: AnyCodable? | ||
public var email: AnyCodable? | ||
|
||
public init(phone: AnyCodable? = nil, name: AnyCodable? = nil, type: AnyCodable? = nil, email: AnyCodable? = nil) { | ||
self.phone = phone | ||
self.name = name | ||
self.type = type | ||
self.email = email | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case phone | ||
case name | ||
case type | ||
case email | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(phone, forKey: .phone) | ||
try container.encodeIfPresent(name, forKey: .name) | ||
try container.encodeIfPresent(type, forKey: .type) | ||
try container.encodeIfPresent(email, forKey: .email) | ||
} | ||
} | ||
|
36 changes: 36 additions & 0 deletions
36
NCIClinicalTrialsSearchAPI/OpenAPIClient/Classes/OpenAPIs/Models/Collaborators.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// Collaborators.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct Collaborators: Codable, JSONEncodable, Hashable { | ||
|
||
public var name: String? | ||
public var functionalRole: String? | ||
|
||
public init(name: String? = nil, functionalRole: String? = nil) { | ||
self.name = name | ||
self.functionalRole = functionalRole | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case name | ||
case functionalRole = "functional_role" | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(name, forKey: .name) | ||
try container.encodeIfPresent(functionalRole, forKey: .functionalRole) | ||
} | ||
} | ||
|
36 changes: 36 additions & 0 deletions
36
NCIClinicalTrialsSearchAPI/OpenAPIClient/Classes/OpenAPIs/Models/Coordinates.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// Coordinates.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct Coordinates: Codable, JSONEncodable, Hashable { | ||
|
||
public var lon: Double? | ||
public var lat: Double? | ||
|
||
public init(lon: Double? = nil, lat: Double? = nil) { | ||
self.lon = lon | ||
self.lat = lat | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case lon | ||
case lat | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(lon, forKey: .lon) | ||
try container.encodeIfPresent(lat, forKey: .lat) | ||
} | ||
} | ||
|
56 changes: 56 additions & 0 deletions
56
NCIClinicalTrialsSearchAPI/OpenAPIClient/Classes/OpenAPIs/Models/Disease.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// Disease.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct Disease: Codable, JSONEncodable, Hashable { | ||
|
||
public var inclusionIndicator: String? | ||
public var isLeadDisease: Bool? | ||
public var synonyms: [String]? | ||
public var nciThesaurusConceptId: String? | ||
public var name: String? | ||
public var type: [String]? | ||
public var parents: [String]? | ||
|
||
public init(inclusionIndicator: String? = nil, isLeadDisease: Bool? = nil, synonyms: [String]? = nil, nciThesaurusConceptId: String? = nil, name: String? = nil, type: [String]? = nil, parents: [String]? = nil) { | ||
self.inclusionIndicator = inclusionIndicator | ||
self.isLeadDisease = isLeadDisease | ||
self.synonyms = synonyms | ||
self.nciThesaurusConceptId = nciThesaurusConceptId | ||
self.name = name | ||
self.type = type | ||
self.parents = parents | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case inclusionIndicator = "inclusion_indicator" | ||
case isLeadDisease = "is_lead_disease" | ||
case synonyms | ||
case nciThesaurusConceptId = "nci_thesaurus_concept_id" | ||
case name | ||
case type | ||
case parents | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(inclusionIndicator, forKey: .inclusionIndicator) | ||
try container.encodeIfPresent(isLeadDisease, forKey: .isLeadDisease) | ||
try container.encodeIfPresent(synonyms, forKey: .synonyms) | ||
try container.encodeIfPresent(nciThesaurusConceptId, forKey: .nciThesaurusConceptId) | ||
try container.encodeIfPresent(name, forKey: .name) | ||
try container.encodeIfPresent(type, forKey: .type) | ||
try container.encodeIfPresent(parents, forKey: .parents) | ||
} | ||
} | ||
|
36 changes: 36 additions & 0 deletions
36
NCIClinicalTrialsSearchAPI/OpenAPIClient/Classes/OpenAPIs/Models/Eligibility.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// Eligibility.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct Eligibility: Codable, JSONEncodable, Hashable { | ||
|
||
public var unstructured: [UnstructuredEligibility]? | ||
public var structured: StructuredEligibility? | ||
|
||
public init(unstructured: [UnstructuredEligibility]? = nil, structured: StructuredEligibility? = nil) { | ||
self.unstructured = unstructured | ||
self.structured = structured | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case unstructured | ||
case structured | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(unstructured, forKey: .unstructured) | ||
try container.encodeIfPresent(structured, forKey: .structured) | ||
} | ||
} | ||
|
36 changes: 36 additions & 0 deletions
36
NCIClinicalTrialsSearchAPI/OpenAPIClient/Classes/OpenAPIs/Models/Identifier.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// Identifier.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct Identifier: Codable, JSONEncodable, Hashable { | ||
|
||
public var name: String? | ||
public var value: String? | ||
|
||
public init(name: String? = nil, value: String? = nil) { | ||
self.name = name | ||
self.value = value | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case name | ||
case value | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(name, forKey: .name) | ||
try container.encodeIfPresent(value, forKey: .value) | ||
} | ||
} | ||
|
Oops, something went wrong.