...
Swagger integration | ||||
---|---|---|---|---|
| ||||
openapi: 3.0.0 info: description: >- Allows for adding of volunteers, assignment and cancellation of appointments. version: 1.0.01-oas3 title: ClinSpark Recruit servers: paths: /saveVolunteer: post: tags: - url: 'https://{customerId}.clinspark.com/api/v1/recruit' variables: customerId: recruit summary: Saves a new volunteer operationId: saveVolunteer requestBody: content: application/json: schema: $ref: '#/components/schemas/Volunteer' description: JSON volunteer to add required: true responses: '200': description: 'Success: OK message.' '401': description: 'Unauthorized: Must add Basic Authentication headers' '422': description: >- Invalid request: There are input validation errors; look at the JSON response for details. security: - basicAuth: [] /findActiveStudySites: get: tags: - recruit summary: Finds study sites that are actively recruiting parameters: - name: studyName in: query description: >- Case insensitive study name used to match study sites with the corresponding name required: false schema: type: string - name: siteId in: query description: >- ID of a given site; only study sites with the corresponding site will be returned required: false schema: type: number format: int64 - name: siteName in: query description: >- Case insensitive site name used to match study sites with the corresponding name required: false schema: type: string - name: locationOid in: query description: >- Case sensitive location OID used to match study sites with the corresponding OID required: false schema: type: string responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/StudySite' '401': description: 'Unauthorized: Must add Basic Authentication headers' security: - basicAuth: [] /findUnassignedAppointments: get: tags: - recruit summary: Finds appointments for the given study site parameters: - name: studySiteId in: query description: ID of a given study site required: true schema: type: number format: int64 - name: cohortName in: query description: >- Case insensitive cohort name used for a wild card search; only appointments that have an assigned cohort matching will be returned required: false schema: type: string - name: appointmentType in: query description: >- Case insensitive appointment typed used for a wild card search; only appointments that have an apointment type matching will be returned required: false schema: type: string responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/RecruitmentAppointment' '401': description: 'Unauthorized: Must add Basic Authentication headers' security: - basicAuth: [] /volunteerStudySearch: get: tags: - recruit summary: >- Finds matching studies for the found volunteer using the advanced volunteer search. The advanced searches must be not be archived and must have a study associated while actively recruiting. If the advanced search also specifies a site, that site in question must match the volunteer. The boolean eligible property in the response array indicates whether or not a study match has occurred. parameters: - name: volunteerId in: query description: primary key of the volunteer required: false schema: type: integer format: int64 - name: externalId in: query description: ID from source system required: false schema: type: string - name: emailAddress in: query description: Case insensitive email address required: false schema: type: string - name: mobilePhone in: query description: Will be converted to ISO format before a query takes place required: false schema: type: string responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/VolunteerSearchResult' '401': description: 'Unauthorized: Must add Basic Authentication headers' security: - basicAuth: [] /listVolunteerAppointments: get: tags: - recruit summary: >- Finds appointments for the given volunteer found by one of the parameters supplied parameters: - name: volunteerId in: query description: primary key of the volunteer required: false schema: type: integer format: int64 - name: externalId in: query description: ID from source system required: false schema: type: string - name: emailAddress in: query description: Case insensitive email address required: false schema: type: string - name: mobilePhone in: query description: Will be converted to ISO format before a query takes place required: false schema: type: string responses: '200': description: successful operation content: default: community-dev application/json: description: Customer ID assignedschema: by the service provider - url: 'https://{ngrokPrefix}.ngrok.io/clinspark/api/v1/recruit' variables: type: array ngrokPrefix: default: 04f5b951df6d items: description: first part of ngrok-assigned id paths: /saveVolunteer: post$ref: '#/components/schemas/RecruitmentAppointment' tags: '401': - recruit description: summary: Saves a new volunteer'Unauthorized: Must add Basic Authentication headers' operationIdsecurity: saveVolunteer - requestBodybasicAuth: [] /assignAppointment: contentpost: tags: application/json: - recruit schemasummary: Allows for assigning a given appointment to a matching volunteer $ref parameters: '#/components/schemas/Volunteer' - descriptionname: JSONrecruitmentAppointmentId volunteer to add requiredin: truequery responses: description: ID from source '200':system descriptionrequired: 'Success:true OK message.' '401'schema: description: 'Unauthorizedtype: Mustnumber add Basic Authentication headers' '422'format: int64 - descriptionname: >-volunteerId in: query Invalid request: There are input validation errors;description: lookID atfrom the JSONvolunteer required: false response for details. securityschema: - basicAuth: [] /findActiveStudySitestype: int64 get: - tagsname: externalId - recruit in: query summary: Finds study sites that are actively recruitingdescription: ID from source system parameters: - namerequired: studyNamefalse inschema: query descriptiontype: >-string - name: emailAddress Case insensitive study name used to match studyin: sitesquery with the description: Case insensitive email corresponding nameaddress required: false schema: type: string - name: siteIdmobilePhone in: query description: >-Will be converted to ISO format before a query takes place ID of a given site; only study sites with the corresponding siterequired: false will be returnedschema: requiredtype: falsestring - schemaname: appointmentNotes typein: numberquery required: false format: int64 -schema: name: siteName intype: querystring descriptionresponses: >- '200': Case insensitive site name used to matchdescription: studysuccessful sitesoperation with the content: corresponding name application/json: required: false schema: type: stringobject - name'401': locationOid description: in'Unauthorized: queryMust add Basic Authentication headers' description'422': >- description: rendered if Caseappointment sensitivecould locationnot OIDbe usedfound to match study sites with the security: - basicAuth: [] corresponding OID /cancelAppointment: post: required: false tags: - schema:recruit summary: Allows for canceling a type:given stringappointment responsesparameters: - '200'name: recruitmentAppointmentId description in: successfulquery operation contentdescription: ID from source system application/json: required: true schema: type: arraynumber itemsformat: int64 responses: type'200': object description: successful operation properties: {} content: security: - basicAuthapplication/json: [] /findUnassignedAppointments: get: tagsschema: - recruit summarytype: object Finds appointments for the given study site '401': parameters: description: 'Unauthorized: Must -add name:Basic studySiteIdAuthentication headers' in: query'422': description: IDrendered ofif aappointment givencould studynot sitebe found requiredsecurity: true - basicAuth: [] schemaservers: - url: https://altasciences-sandbox.clinspark.com/api/v1/recruit components: securitySchemes: typebasicAuth: number type: http format scheme: basic int64 schemas: VolunteerAnswer: - name: cohortName type: object inproperties: query question: description: >- type: string Case insensitive cohort name used forexample: aFavorite wildweb cardapplication? search; only description: Verbatim custom volunteer appointmentsquestion that have an assigned cohort matching will be returnedanswer: requiredtype: falsestring schemadescription: Answer format must match that defined by the custom question type Volunteer: string type: object - name: appointmentType properties: inexternalId: query type: description:string >- example: '987123' Case insensitive appointment typed used for a wild card search;description: onlyUnique identifier in originating recruitment system appointments thattitle: have an apointment type matching will be returned type: string required: false example: Mr schema: firstName: type: string responses example: Joseph '200' middleName: descriptiontype: successfulstring operation contentdescription: >- application/json: can be an initial, if no value is provided a '-' will be stored schema:with the volunteer reocord type: array lastName: itemstype: string example: Padres $ref genderMale: '#/components/schemas/RecruitmentAppointment' '400'type: boolean descriptionethnicHispanic: Invalid username supplied '404':type: boolean description: Usernull notindicates foundunknown security: otherRace: - basicAuth: [] /listVolunteerAppointmentstype: string get: tagsdescription: additional race details if race type doesn't match - recruit summarydateOfBirth: >- Finds appointmentstype: forstring the given volunteer found by one of the example: '1980-05-27' parameters supplied parametersdescription: ISO DOB in form - name: externalIdof yyyy-MM-dd innameSuffix: query descriptiontype: IDstring from source system requireddescription: false jr, II schemanationality: type: string - namepreferredLanguage: emailAddress intype: querystring address: description: Case insensitive email address type: string required: false city: schema: type: string typeregion: string - nametype: mobilePhonestring indescription: query>- description: Willshould bematch convertedregions toconfigured ISOin formatthe beforevolunteer aconfiguration query takes place component; required:ie falsestate / province schemacountry: type: string responses postalCode: '200'type: string homePhone: description: successful operation type: string content: description: >- application/json: tightly validated based on the general settings schema:configured; should be as close type:to arrayISO format as possible with leading country code. items: https://github.com/google/libphonenumber is used for underlying $ref: '#/components/schemas/RecruitmentAppointment' validation '400'workPhone: descriptiontype: Invalidstring username supplied '404'description: see homePhone descriptionmobilePhone: User not found securitytype: string - basicAuthdescription: [] /assignAppointment: post:same rules apply as homePhone, but must be unique in database tagsphoneNotes: - recruit type: string summary: Allows for assigning a given appointmentdescription: tocan abe matchingarbitrary volunteernotes to guide recruiters about making phone parameters:calls - namecontactableByPhone: recruitmentAppointmentId intype: queryboolean description: ID from source system volunteer's permission to be contacted by phone requireddefault: true schemacontactableBySms: type: numberboolean formatdescription: int64volunteer's permission to be contacted by SMS - name: externalId in: query default: true descriptioncontactableByEmailCampaign: ID from source system type: boolean required: false description: volunteer's permission to be schema:contacted by emails typedefault: stringtrue - namenextOfKin: emailAddress intype: querystring description: Case>- insensitive email address notes generally required:about falsewho to contact should there be a reason to do schema: so in type:an stringemergency situation - namevolunteerEmploymentStatus: mobilePhone intype: querystring descriptionenum: Will be converted to ISO format before a query- takesUnemployed place required: false- Student schema: - EmployedPartTime type: string - EmployedFullTime responses: '200': - Retired descriptionweightKilos: successful operation contenttype: number application/jsonformat: double example: 123.45 schema: heightMeters: type: number object '422'format: double descriptionexample: rendered2.12 if appointment could not be found vegetarian: security: type: boolean - basicAuth: [] /cancelAppointment: postdescription: null indicates unknown tags: surgicallySterile: - recruit summarytype: Allowsboolean for canceling a given appointment parametersdefault: false - namecontraceptionType: recruitmentAppointmentId intype: querystring descriptionexample: Abstinence ID from source system description: should match a type required:configured truein the volunteer configure component schema: numberOfChildren: type: numberinteger description: value format:should int64only be present for females responses: '200':minimum: 0 descriptionmaximum: successful20 operation contentmenstruationStartAge: application/jsontype: integer description: value should schema:only be present for females minimum: 8 type: object '422'maximum: 50 descriptionmenstruationEndAge: rendered if appointment could not be found securitytype: integer - basicAuthdescription: value []should components:only be present securitySchemes:for females basicAuth: typeminimum: http10 scheme: basic schemasmaximum: 100 VolunteerAnswer: lastPeriodStartDate: type: object propertiestype: string question description: In form of yyyy-MM-dd; value should only be present for type:females string regularPeriodIntervalDays: example: Favorite web application? type: integer description: Verbatim custom volunteer question description: value should only be present for answer:females typeminimum: string0 descriptionmaximum: Answer format100 must match that defined by the custom question regularPeriodDurationDays: Volunteer: type: objectinteger properties: description: value should only be present for externalId:females typeminimum: string0 examplemaximum: '987123'100 currentlyPregnant: description: Unique identifier in originating recruitment system type: boolean title: description: value should only be present type:for stringfemales exampledefault: Mrfalse firstNamecurrentlyBreastFeeding: type: stringboolean exampledescription: Josephvalue should only be present for females middleName: typedefault: stringfalse descriptionchildBearingPotential: >- type: boolean can be an initial, if no value is provided a '-' will be stored with description: value should only be present for females the volunteerdefault: reocordfalse lastNameallergies: type: stringboolean exampledescription: null Padresindicates unknown genderMaleemailAddress: type: string boolean ethnicHispanicdescription: >- type: boolean must be unique; strictly validated using Apache Commons description:Email null indicates unknown otherRace: Validator framework typecontactSource: string descriptiontype: additional race details if race type doesn't matchstring dateOfBirthdescription: >- type: string describes how a volunteer contact occurred; should match example: '1980-05-27'a source description: ISO DOBconfigured in formthe volunteer of yyyy-MM-ddconfigure component nameSuffixgeneralPractitioner: type: string description: volunteer'jr,s II'physician nationalitygeneralPractitionerPhoneNumber: type: string preferredLanguage: description: volunteer's physician phone number type: string addressgeneralPractitionerAddress: type: string city description: volunteer's physician address type siteName: string regiontype: string typeexample: stringBase Site description: >- the shouldname matchof regionsthe configuredsite inthat the volunteer configurationshould be associated with; component;if ienot stateprovided, /use provincesiteId countrysiteId: type: integer string postalCodeformat: int64 typeexample: -1 string homePhonedescription: >- type: string description: >- the id of the site that the volunteer should be associated with; if not provided, use tightlysiteName validated based on the general settings configured; should volunteerAnswers: type: bearray as close to ISO format as possible with leading country code.example: https://github.com/google/libphonenumber is used for underlying- question: Favorite web application? validation answer: Gmail workPhone: - question: Favorite number? type: string description: see homePhoneanswer: '123' mobilePhone: - question: Favorite decimal? type: string descriptionanswer: 'same123.4' rules apply as homePhone, but must be unique in database' - question: Favorite date? phoneNotes: typeanswer: string'1969-07-20' description: can>- be arbitrary notes to guide recruiters about making phone calls array of simple objects with verbatim contactableByPhone:ClinSpark questions and type: boolean corresponding answers description: volunteer's permission to be contacteditems: by phone default$ref: true'#/components/schemas/VolunteerAnswer' contactableBySmsvolunteerNotes: type: booleanarray descriptionexample: volunteer's permission to be contacted by SMS - Volunteer travels often default: true contactableByEmailCampaign: - Is afraid of needles type: boolean description: Simple notes that move to description:a volunteer's permissionnotes to besection contacted by emails items: default: true nextOfKintype: string typevolunteerRaces: string descriptiontype: >-array notes generally about who to contact should there be a reason to do example: - American Indian or Alaska Native so in an emergency situation description: Must match race names defined in volunteerEmploymentStatus:ClinSpark typeitems: string enumtype: string volunteerSubstanceUse: - Unemployed type: array - Student example: - EmployedPartTime - substanceUseCategory: Alcohol - EmployedFullTime name: Beer - Retired weightKilosuseFrequency: Week type: number useConsumption: '5' format: double consumptionUnit: example: 123.45Glass/Bottle (.5L) heightMeters: substanceUseStatus: Social type: number format: doublestartDate: '2001' example: 2.12 lastConsumed: '2021-07-21' vegetarian: substanceNotes: Enjoys type:heavy booleanIPAs description: >- null indicates unknown surgicallySterile: array of simple objects with verbatim ClinSpark questions and type: boolean corresponding default:answers false contraceptionTypeitems: type: string $ref: '#/components/schemas/VolunteerSubstanceUse' VolunteerSubstanceUse: example: Abstinence type: object properties: description: should match a type configured in the volunteersubstanceUseCategory: configure component numberOfChildrentype: string type example: integerAlcohol descriptionenum: value should only be present for females - Alcohol minimum: 0 - Caffeine maximum: 20 - menstruationStartAge:Tobacco type: integer - Drugs descriptionname: value should only be present for females type: string minimum: 8 description: >- maximum: 50 must be associated menstruationEndAge:with the relevant category defined in the type: integer volunteer configure component description: value should only be present for femalesuseFrequency: minimumtype: 10string maximum: 100description: provides context to the useConsumption lastPeriodStartDatedefault: Week type enum: string - description:Day In form of yyyy-MM-dd; value should only be present for females - Week regularPeriodIntervalDays: - Month type: integer - Year description: value should only be present for femalesuseConsumption: minimumtype: 0string maximumdescription: 100>- regularPeriodDurationDays: the amount of the substance consumed in the type:defined integerfrequency; description: value should only be presenta fornumber females minimumdefault: 0'5' consumptionUnit: maximum: 100 currentlyPregnanttype: string typedescription: boolean>- must be description:associated valuewith shouldthe onlyrelevant becategory present/ forname femalesdefined in the default: false volunteer configure component currentlyBreastFeeding: default: Glass/Bottle (.5L) type: boolean substanceUseStatus: description: value should only be present fortype: femalesstring defaultenum: false childBearingPotential: - Social type: boolean - Regular description: value should only be present for females - Previous defaultstartDate: false allergiestype: string type description: >- boolean description: null indicates unknown emailAddress: yyyy-MM-dd; for partial dates, simply omit the fields 2009 would be type: string2009, Jan of 2008 would be 2008-01, Feb 12 2007 would description: >-be 2007-02-12 endDate: must be unique; strictly validated using Apache Commons Emailtype: string description: Validatorsee frameworkstartDate contactSourcelastConsumed: type: string description: >-see startDate substanceNotes: describes how a volunteer contact occurred; should match atype: sourcestring description: general configurednotes inabout the volunteersubstance configureuse component RecruitmentAppointment: generalPractitioner: type: object typeproperties: string descriptionid: volunteer's physician generalPractitionerPhoneNumbertype: integer type: string format: int64 description: volunteer's physicianappointmentType: phone number generalPractitionerAddresstype: string typeexample: stringScreening description: volunteer's physician addressconfigured with study site details siteNameappointmentNumber: type: string example: BaseA0001 Site estimatedAppointmentDurationMinutes: description: >- type: integer the name of the site that theformat: volunteerint32 should be associated with; appointmentNotes: if not provided, usetype: siteIdstring siteIdappointmentTime: type: integerstring formatdescription: ISO date int64time in UTC examplecohort: -1 $ref: '#/components/schemas/Cohort' description: >- recruitmentAppointmentStatus: the idtype: ofstring the site that the volunteer should be associated with; if enum: not provided,- useUnassigned siteName volunteerAnswers: - Assigned type: array - CheckedIn example: - Failed - question: Favorite web application? - Success answerdateCreated: Gmail type: string - question: Favorite number? format: date-time answer lastUpdated: '123' type: string - question: Favorite decimal? format: date-time answerCohort: '123.4' type: object - questionproperties: Favorite date? disabled: answer: '1969-07-20' type: boolean description: >- default: false arrayrequireVolunteerRecruitment: of simple objects with verbatim ClinSpark questions and type: boolean corresponding answers default: false itemsname: type: string $ref: '#/components/schemas/VolunteerAnswer' volunteerRacesexample: Cohort 1 typedescription: array exampletype: string subjectNumberAction: - American Indian or Alaska Native type: string description: Must match race namesenum: defined in ClinSpark - items:SCREENING type: string - LEAD_IN volunteerSubstanceUse: - RANDOMIZATION type: array - APPOINTMENT example: dataLocked: - substanceUseCategory: Alcohol type: boolean namedescription: Beer>- is data useFrequency:associated Weekwith the cohort locked for further data useConsumption: '5' collection? consumptionUnitdefault: Glass/Bottle (.5L)false recruitmentActive: substanceUseStatus: Social type: boolean startDatedescription: '2001'is the cohort active for recruitment lastConsumedrecruitmentMaleGoal: '2021-07-21' type: number substanceNotes: Enjoys heavy IPAs format: int32 description: >- recruitmentFemaleGoal: arraytype: ofnumber simple objects with verbatim ClinSpark questions and format: int32 corresponding answersrecruitmentGoal: itemstype: number $refformat: '#/components/schemas/VolunteerSubstanceUse'int32 VolunteerSubstanceUseVolunteerSearchResult: type: object properties: substanceUseCategoryeligible: type: stringboolean exampledescription: Alcohol true if the volunteer matches criteria of the volunteer search enum: default: false - Alcohol name: -type: Caffeinestring description: the -name Tobaccoof the advanced search study: - Drugs name:$ref: '#/components/schemas/Study' site: type: string $ref: '#/components/schemas/Site' description: >- cohort: must be associated with the relevant category defined in the$ref: '#/components/schemas/Cohort' Site: type: object volunteer configure componentproperties: useFrequencyid: type: stringinteger descriptionformat: provides context to the useConsumptionint64 archived: defaulttype: Weekboolean enumdescription: is site archived? -default: false Day name: - Week type: string - Month example: Grafton volunteerRegionLabel: - Year useConsumptiontype: string typeexample: stringState description: >-allows for customizing a region (ie State, Province, etc) the amount of the substancevolunteerEnrollmentConfirmationStatement: consumed in the defined frequency; type: string should be a number description: statement made during point of enrollment when staff default: '5'is present consumptionUnitheightUnits: type: string descriptionenum: >- - mustMeters be associated with the relevant category / name defined in the - Centimeters volunteer configure component - Inches defaultweightUnits: Glass/Bottle (.5L) substanceUseStatustype: string typeenum: string - enum:Kilo - Social Pound address: - Regulartype: string description: -street Previousaddress startDatecity: type: string stateProvince: description: >- type: string yyyy-MM-dd; for partial dates, simply omit the fields 2009 would be postalCode: type: string 2009,country: Jan of 2008 would be 2008-01, Feb 12 2007 would be 2007-02-12type: string endDatephoneNumber: type: string descriptionfaxNumber: see startDate lastConsumedtype: string typetimeZoneId: string descriptiontype: seestring startDate substanceNotesinvestigatorId: type: string investigatorName: description: general notes about the substancetype: usestring RecruitmentAppointmentStudy: type: object properties: id: type: integer format: int64 appointmentTypestudyState: type: string exampleenum: Screening description: configured- withDESIGN study site details appointmentNumber: - ACTIVE type: string - LOCKED example: A0001 - ARCHIVED estimatedAppointmentDurationMinutes: type: integername: formattype: int32string appointmentNotesdescription: type: string appointmentTimeprotocolName: type: string epochs: descriptiontype: ISOarray date time in UTC items: cohort: $ref: '#/components/schemas/CohortEpoch' recruitmentAppointmentStatus: Epoch: type: stringobject enumproperties: disabled: - Unassigned type: boolean - Assigned default: false - CheckedIn name: - Failed type: string -example: SuccessTreatment dateCreateddescription: type: string formatexample: date-timeTreatment lastUpdatedcohorts: type: stringarray format: date-timeitems: $ref: '#/components/schemas/Cohort' StudySite: type: object properties: disabledid: type: booleaninteger defaultformat: falseint64 requireVolunteerRecruitmentunassignedAppointmentCount: type: booleannumber defaultformat: falseint32 nameappointmentTypes: type: stringarray example: Cohort 1 description: - Screening type: string - OPV subjectNumberAction: items: type: string type: string enum: locationOid: - SCREENING type: string - LEAD_IN example: '1' investigatorId: - RANDOMIZATION type: string - APPOINTMENT investigatorName: dataLocked: type: string type: boolean appointmentsRequireRecruitmentVolunteer: description: >- type: boolean is dataappointmentsRequireRecruitmentVolunteerInCohort: associated with the cohort locked for further data type: boolean collection?recruitmentDescription: defaulttype: falsestring recruitmentActivedefaultAppointmentDurationMinutes: type: booleannumber descriptionformat: isint32 the cohort active for recruitment recruitmentMaleGoal: type: number format: int32 recruitmentFemaleGoal: type: number format: int32 recruitmentGoalsite: type: number$ref: '#/components/schemas/Site' study: format$ref: int32'#/components/schemas/Study' |
...