Skip to content

Commit

Permalink
Load Trials from the NCI Trials API (#18)
Browse files Browse the repository at this point in the history
# 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
PSchmiedmayer authored May 6, 2024
1 parent cbfc6aa commit e9f011e
Show file tree
Hide file tree
Showing 53 changed files with 6,382 additions and 4,309 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
with:
artifactname: OwnYourData.xcresult
runsonlabels: '["macOS", "self-hosted"]'
setupSimulators: true
setupfirebaseemulator: true
customcommand: "firebase emulators:exec 'fastlane test'"
uploadcoveragereport:
Expand Down
8,959 changes: 4,761 additions & 4,198 deletions NCIClinicalTrialsSearchAPI.json

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions NCIClinicalTrialsSearchAPI/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,48 @@ OpenAPIClient/Classes/OpenAPIs/Extensions.swift
OpenAPIClient/Classes/OpenAPIs/JSONDataEncoding.swift
OpenAPIClient/Classes/OpenAPIs/JSONEncodingHelper.swift
OpenAPIClient/Classes/OpenAPIs/Models.swift
OpenAPIClient/Classes/OpenAPIs/Models/Arm.swift
OpenAPIClient/Classes/OpenAPIs/Models/CentralContact.swift
OpenAPIClient/Classes/OpenAPIs/Models/Collaborators.swift
OpenAPIClient/Classes/OpenAPIs/Models/Coordinates.swift
OpenAPIClient/Classes/OpenAPIs/Models/Disease.swift
OpenAPIClient/Classes/OpenAPIs/Models/Eligibility.swift
OpenAPIClient/Classes/OpenAPIs/Models/Identifier.swift
OpenAPIClient/Classes/OpenAPIs/Models/Intervention.swift
OpenAPIClient/Classes/OpenAPIs/Models/Masking.swift
OpenAPIClient/Classes/OpenAPIs/Models/OutcomeMeasure.swift
OpenAPIClient/Classes/OpenAPIs/Models/Site.swift
OpenAPIClient/Classes/OpenAPIs/Models/StatusHistory.swift
OpenAPIClient/Classes/OpenAPIs/Models/StructuredEligibility.swift
OpenAPIClient/Classes/OpenAPIs/Models/TrialDetail.swift
OpenAPIClient/Classes/OpenAPIs/Models/TrialResponse.swift
OpenAPIClient/Classes/OpenAPIs/Models/UnstructuredEligibility.swift
OpenAPIClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift
OpenAPIClient/Classes/OpenAPIs/SynchronizedDictionary.swift
OpenAPIClient/Classes/OpenAPIs/URLSessionImplementations.swift
OpenAPIClient/Classes/OpenAPIs/Validation.swift
Package.swift
README.md
docs/Arm.md
docs/BiomarkersAPI.md
docs/CentralContact.md
docs/Collaborators.md
docs/Coordinates.md
docs/Disease.md
docs/DiseasesAPI.md
docs/Eligibility.md
docs/Identifier.md
docs/Intervention.md
docs/InterventionsAPI.md
docs/Masking.md
docs/OrganizationsAPI.md
docs/OutcomeMeasure.md
docs/Site.md
docs/StatusHistory.md
docs/StructuredEligibility.md
docs/TrialDetail.md
docs/TrialResponse.md
docs/TrialsAPI.md
docs/UnstructuredEligibility.md
git_push.sh
project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation
import FoundationNetworking
#endif
open class OpenAPIClientAPI {
public static var basePath = "https://clinicaltrialsapi-int.cancer.gov/api/v2"
public static var basePath = "https://clinicaltrialsapi.cancer.gov/api/v2"
public static var customHeaders: [String: String] = [:]
public static var credential: URLCredential?
public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory()
Expand Down

Large diffs are not rendered by default.

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)
}
}

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)
}
}

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)
}
}

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)
}
}

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)
}
}

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)
}
}

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)
}
}

Loading

0 comments on commit e9f011e

Please sign in to comment.