diff --git a/avni-server-api/src/main/resources/api/external-api.yaml b/avni-server-api/src/main/resources/api/external-api.yaml index 3b7c94199..3bd57d9ea 100644 --- a/avni-server-api/src/main/resources/api/external-api.yaml +++ b/avni-server-api/src/main/resources/api/external-api.yaml @@ -1,13 +1,21 @@ +--- openapi: 3.0.0 info: - description: This is for API consumers of Avni - version: "1.0.0" title: Avni API + description: This is for API consumers of Avni contact: email: avniproject@googlegroups.com license: name: AGPL 3.0 - url: 'https://opensource.org/licenses/AGPL-3.0' + url: https://opensource.org/licenses/AGPL-3.0 + version: 1.0.0 +servers: + - url: https://virtserver.swaggerhub.com/samanvay/avni-external/1.0.0 + description: SwaggerHub API Auto Mocking + - url: https://app.avniproject.org/ + description: Avni production server + - url: https://staging.avniproject.org/ + description: Avni staging server tags: - name: Subject paths: @@ -16,55 +24,60 @@ paths: tags: - Subject summary: Get paged list of subjects - operationId: subjects description: | By passing in the appropriate options, you can get the subjects in set of pages + operationId: subjects parameters: - - in: query - name: lastModifiedDateTime - description: date-time in ISO datetime format. All the subjects which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. "2000-10-31T01:30:00.000Z". + - name: lastModifiedDateTime + in: query + description: "date-time in ISO datetime format. All the subjects which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. \"2000-10-31T01:30:00.000Z\"." required: true + style: form + explode: true schema: type: string - - in: query - name: subjectType + - name: subjectType + in: query description: subject type required: false + style: form + explode: true schema: type: string - - in: query - name: concepts - description: Allows to search by concepts. Remember that '{' and '}' are not valid in a url, and need to be escaped with %7B and %7D respectively. - example: '{"Diagnosis": "Diabetes", "Blood Group": "B+"}' + - name: concepts + in: query + description: "Allows to search by concepts. Remember that '{' and '}' are not valid in a url, and need to be escaped with %7B and %7D respectively." required: false + style: form + explode: true schema: type: string - - in: query - name: locationIds + example: "{\"Diagnosis\": \"Diabetes\", \"Blood Group\": \"B+\"}" + - name: locationIds + in: query description: comma seperated location names from higher level to lower level required: false + style: form + explode: true schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': - description: successful, a page of subjects + "200": + description: "successful, a page of subjects" content: application/json: schema: - allOf: - - $ref: '#/components/schemas/ResponsePage' - properties: - content: - type: array - items: - $ref: '#/components/schemas/Subject' - '400': + $ref: '#/components/schemas/inline_response_200' + "400": description: bad input parameter /api/subject/{ID}: get: @@ -75,104 +88,156 @@ paths: Provide the ID of the subject. The ID is in UUID format, the external id used by Avni. OR provide the ExternalID of the Subject. Legacy ID set by the external integrating system. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/Subject' - '400': + "400": description: bad input parameter - delete: + put: tags: - Subject - summary: Delete a specific subject by ID or External ID - description: | - Provide the ID of the subject. The ID is in UUID format, the external id used by Avni. - OR provide the ExternalID of the Subject. Legacy ID set by the external integrating system. + summary: Updates all attributes of an existing subject. If no value is specified for an attribute then it would be updated to null/undefined. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubjectBody' + required: true responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/Subject' - '400': - description: bad input parameter - '404': - description: entity not found - put: + patch: tags: - Subject - summary: Updates an existing subject + summary: Updates subject with only the values provided in the request. If no value is specified for an attribute then it would be left unchanged. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito requestBody: - required: true content: application/json: schema: $ref: '#/components/schemas/SubjectBody' + required: true responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/Subject' + delete: + tags: + - Subject + summary: Delete a specific subject by ID or External ID + description: | + Provide the ID of the subject. The ID is in UUID format, the external id used by Avni. + OR provide the ExternalID of the Subject. Legacy ID set by the external integrating system. + parameters: + - name: ID + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uuid + - name: auth-token + in: header + required: false + style: simple + explode: false + schema: + type: string + description: token provided by cognito + responses: + "200": + description: successful + content: + application/json: + schema: + $ref: '#/components/schemas/Subject' + "400": + description: bad input parameter + "404": + description: entity not found /api/subject: post: tags: - Subject summary: Creates a new subject parameters: - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito requestBody: - required: true content: application/json: schema: $ref: '#/components/schemas/SubjectBody' + required: true responses: - '200': + "200": description: successful content: application/json: @@ -186,43 +251,46 @@ paths: description: | By passing in the appropriate options, you can get the program enrolments in set of pages. There are three use cases supported, get a list of all enrolments, get a list of all enrolments within a program, and get a list of enrolments for a subject and program. parameters: - - in: query - name: lastModifiedDateTime - description: date-time in ISO datetime format. All the program enrolments which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. "2000-10-31T01:30:00.000Z". It is mandatory unless subject and programs are are specified + - name: lastModifiedDateTime + in: query + description: "date-time in ISO datetime format. All the program enrolments which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. \"2000-10-31T01:30:00.000Z\". It is mandatory unless subject and programs are are specified" required: false + style: form + explode: true schema: type: string - - in: query - name: program + - name: program + in: query description: program name. mandatory if subject is specified. required: false + style: form + explode: true schema: type: string - - in: query - name: subject + - name: subject + in: query description: external id of the subject required: false + style: form + explode: true schema: type: string - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': - description: successful, a page of program enrolments + "200": + description: "successful, a page of program enrolments" content: application/json: schema: - allOf: - - $ref: '#/components/schemas/ResponsePage' - properties: - content: - type: array - items: - $ref: '#/components/schemas/ProgramEnrolment' - '400': + $ref: '#/components/schemas/inline_response_200_1' + "400": description: bad input parameter /api/programEnrolment/{ID}: get: @@ -233,104 +301,122 @@ paths: Provide the ID of the program enrolment. The ID is in UUID format, the external id used by Avni OR provide the ExternalID of the Program Enrolment. Legacy ID set by the external integrating system. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/ProgramEnrolment' - '400': + "400": description: bad input parameter - delete: + put: tags: - Program Enrolment - summary: Delete a specific program enrolment by ID or External ID - description: | - Provide the ID of the program enrolment. The ID is in UUID format, the external id used by Avni - OR provide the ExternalID of the Program Enrolment. Legacy ID set by the external integrating system. + summary: Updates an existing program enrolment parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProgramEnrolmentBody' + required: true responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/ProgramEnrolment' - '400': - description: bad input parameter - '404': - description: entity not found - put: + delete: tags: - Program Enrolment - summary: Updates an existing program enrolment + summary: Delete a specific program enrolment by ID or External ID + description: | + Provide the ID of the program enrolment. The ID is in UUID format, the external id used by Avni + OR provide the ExternalID of the Program Enrolment. Legacy ID set by the external integrating system. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ProgramEnrolmentBody' responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/ProgramEnrolment' + "400": + description: bad input parameter + "404": + description: entity not found /api/programEnrolment: post: tags: - Program Enrolment summary: Creates a new program enrolment parameters: - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito requestBody: - required: true content: application/json: schema: $ref: '#/components/schemas/ProgramEnrolmentBody' + required: true responses: - '200': + "200": description: successful content: application/json: @@ -344,44 +430,47 @@ paths: description: | By passing in the appropriate options, you can get the program encounters in set of pages parameters: - - in: query - name: lastModifiedDateTime - description: date-time in ISO datetime format. All the program encounters which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. "2000-10-31T01:30:00.000Z". + - name: lastModifiedDateTime + in: query + description: "date-time in ISO datetime format. All the program encounters which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. \"2000-10-31T01:30:00.000Z\"." required: true + style: form + explode: true schema: type: string - - in: query - name: encounter type + - name: encounter type + in: query description: program encounter type name required: false + style: form + explode: true schema: type: string - - in: query - name: programEnrolmentId + - name: programEnrolmentId + in: query description: ID of program enrolment required: false + style: form + explode: true schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': - description: successful, a page of program encounters + "200": + description: "successful, a page of program encounters" content: application/json: schema: - allOf: - - $ref: '#/components/schemas/ResponsePage' - properties: - content: - type: array - items: - $ref: '#/components/schemas/ProgramEncounter' - '400': + $ref: '#/components/schemas/inline_response_200_2' + "400": description: bad input parameter /api/programEncounter/{ID}: get: @@ -392,104 +481,122 @@ paths: Provide the ID of the program encounter. The ID is in UUID format, the external id used by Avni OR provide the ExternalID of the program encounter. Legacy ID set by the external integrating system. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/ProgramEncounter' - '400': + "400": description: bad input parameter - delete: + put: tags: - Program Encounter - summary: Delete a specific program encounter by ID or External ID - description: | - Provide the ID of the program encounter. The ID is in UUID format, the external id used by Avni - OR provide the ExternalID of the program encounter. Legacy ID set by the external integrating system. + summary: Updates an existing program encounter parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProgramEncounterBody' + required: true responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/ProgramEncounter' - '400': - description: bad input parameter - '404': - description: entity not found - put: + delete: tags: - Program Encounter - summary: Updates an existing program encounter + summary: Delete a specific program encounter by ID or External ID + description: | + Provide the ID of the program encounter. The ID is in UUID format, the external id used by Avni + OR provide the ExternalID of the program encounter. Legacy ID set by the external integrating system. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ProgramEncounterBody' responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/ProgramEncounter' + "400": + description: bad input parameter + "404": + description: entity not found /api/programEncounter: post: tags: - Program Encounter summary: Creates a new program encounter parameters: - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito requestBody: - required: true content: application/json: schema: $ref: '#/components/schemas/ProgramEncounterBody' + required: true responses: - '200': + "200": description: successful content: application/json: @@ -503,51 +610,56 @@ paths: description: | By passing in the appropriate options, you can get the subject encounters in set of pages. parameters: - - in: query - name: lastModifiedDateTime - description: date-time in ISO datetime format. All the subject encounters which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. "2000-10-31T01:30:00.000Z". + - name: lastModifiedDateTime + in: query + description: "date-time in ISO datetime format. All the subject encounters which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. \"2000-10-31T01:30:00.000Z\"." required: false + style: form + explode: true schema: type: string - - in: query - name: encounter type + - name: encounter type + in: query description: subject encounter type name required: false + style: form + explode: true schema: type: string - - in: query - name: subjectId + - name: subjectId + in: query description: ID of the subject required: false + style: form + explode: true schema: type: string format: uuid - - in: query - name: concepts - description: Allows to search by concepts. Remember that '{' and '}' are not valid in a url, and need to be escaped with %7B and %7D respectively. - example: '{"Diagnosis": "Diabetes", "Blood Group": "B+"}' + - name: concepts + in: query + description: "Allows to search by concepts. Remember that '{' and '}' are not valid in a url, and need to be escaped with %7B and %7D respectively." required: false + style: form + explode: true schema: type: string - - in: header - name: auth-token + example: "{\"Diagnosis\": \"Diabetes\", \"Blood Group\": \"B+\"}" + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': - description: successful, a page of subject encounters + "200": + description: "successful, a page of subject encounters" content: application/json: schema: - allOf: - - $ref: '#/components/schemas/ResponsePage' - properties: - content: - type: array - items: - $ref: '#/components/schemas/Encounter' - '400': + $ref: '#/components/schemas/inline_response_200_3' + "400": description: bad input parameter /api/encounter/{ID}: get: @@ -558,104 +670,156 @@ paths: Provide the ID of the subject encounter. The ID is in UUID format, the external id used by Avni OR provide the ExternalID of the program encounter. Legacy ID set by the external integrating system. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/Encounter' - '400': + "400": description: bad input parameter - delete: + put: tags: - Subject Encounter - summary: Delete a specific subject encounter by ID or External ID - description: | - Provide the ID of the subject encounter. The ID is in UUID format, the external id used by Avni - OR provide the ExternalID of the Subject Encounter. Legacy ID set by the external integrating system. + summary: Updates all attributes of an existing encounter. If no value is specified for an attribute then it would be updated to null/undefined. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EncounterBody' + required: true responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/Encounter' - '400': - description: bad input parameter - '404': - description: entity not found - put: + patch: tags: - Subject Encounter - summary: Updates an existing encounter + summary: Updates subject with only the values provided in the request. If no value is specified for an attribute then it would be left unchanged. parameters: - - in: path - name: ID + - name: ID + in: path required: true + style: simple + explode: false schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito requestBody: - required: true content: application/json: schema: $ref: '#/components/schemas/EncounterBody' + required: true responses: - '200': + "200": description: successful content: application/json: schema: $ref: '#/components/schemas/Encounter' + delete: + tags: + - Subject Encounter + summary: Delete a specific subject encounter by ID or External ID + description: | + Provide the ID of the subject encounter. The ID is in UUID format, the external id used by Avni + OR provide the ExternalID of the Subject Encounter. Legacy ID set by the external integrating system. + parameters: + - name: ID + in: path + required: true + style: simple + explode: false + schema: + type: string + format: uuid + - name: auth-token + in: header + required: false + style: simple + explode: false + schema: + type: string + description: token provided by cognito + responses: + "200": + description: successful + content: + application/json: + schema: + $ref: '#/components/schemas/Encounter' + "400": + description: bad input parameter + "404": + description: entity not found /api/encounter: post: tags: - Subject Encounter summary: Creates a new encounter parameters: - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito requestBody: - required: true content: application/json: schema: $ref: '#/components/schemas/EncounterBody' + required: true responses: - '200': + "200": description: successful content: application/json: @@ -669,45 +833,48 @@ paths: description: | By passing in the appropriate options, you can get the group subjects in set of pages. parameters: - - in: query - name: lastModifiedDateTime - description: date-time in ISO datetime format. All the group subject which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. "2000-10-31T01:30:00.000Z". + - name: lastModifiedDateTime + in: query + description: "date-time in ISO datetime format. All the group subject which have been updated since this time will be returned. The value should be specified in the following format - yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. \"2000-10-31T01:30:00.000Z\"." required: false + style: form + explode: true schema: type: string - - in: query - name: groupSubjectId + - name: groupSubjectId + in: query description: ID of the group subject required: false + style: form + explode: true schema: type: string format: uuid - - in: query - name: memberSubjectId + - name: memberSubjectId + in: query description: ID of the member subject required: false + style: form + explode: true schema: type: string format: uuid - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito responses: - '200': - description: successful, a page of group subject + "200": + description: "successful, a page of group subject" content: application/json: schema: - allOf: - - $ref: '#/components/schemas/ResponsePage' - properties: - content: - type: array - items: - $ref: '#/components/schemas/Encounter' - '400': + $ref: '#/components/schemas/inline_response_200_3' + "400": description: bad input parameter /api/task: post: @@ -715,26 +882,27 @@ paths: - Task summary: Creates a new task parameters: - - in: header - name: auth-token + - name: auth-token + in: header + required: false + style: simple + explode: false schema: type: string description: token provided by cognito requestBody: - required: true content: application/json: schema: $ref: '#/components/schemas/TaskBody' + required: true responses: - '200': + "200": description: successful content: application/json: schema: - allOf: - - $ref: '#/components/schemas/Task' - - $ref: '#/components/schemas/TaskBody' + $ref: '#/components/schemas/inline_response_200_4' components: schemas: Subject: @@ -745,7 +913,7 @@ components: format: uuid External ID: type: string - description: Legacy ID set by the external integrating system, this field is optional. + description: "Legacy ID set by the external integrating system, this field is optional." Voided: type: boolean Subject type: @@ -756,23 +924,26 @@ components: Registration date: type: string format: date - example: '2016-08-29' + example: 2016-08-29 location: type: object - description: 'full hierarchy of location is provided, each one as key-value pair. Example {"Village": "Ganks", "Block": "Ynaos"}' additionalProperties: type: string + description: "full hierarchy of location is provided, each one as key-value pair" + example: "{\"Village\": \"Ganks\", \"Block\": \"Ynaos\"}" relatives: type: array items: $ref: '#/components/schemas/SubjectRelationship' observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts). Note that first name, last name and middle name (if allowed on subject type comes here) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts). Note that first name, last name and middle name (if allowed on subject type comes here)" example: Phone number: 9801010101 - Medical problems: ["Asthama", "Diabetes"] - Marriage date: '1994-08-29' + Medical problems: + - Asthama + - Diabetes + Marriage date: 1994-08-29 encounters: type: array items: @@ -790,26 +961,26 @@ components: properties: External ID: type: string - description: Legacy ID set by the external integrating system, this field is optional. + description: "Legacy ID set by the external integrating system, this field is optional." Subject type: type: string example: Individual Address: type: string - example: India, Uttarakhand, Dehradun description: Complete address of the subject + example: "India, Uttarakhand, Dehradun" Date of birth: type: string - format: date description: Applicable only for Person type subject + format: date Gender: type: string - example: Male description: Applicable only for Person type subject + example: Male Registration date: type: string - format: date description: Registration date + format: date First name: type: string Middle name: @@ -821,7 +992,7 @@ components: $ref: '#/components/schemas/GeoLocation' observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" Profile picture: type: string Voided: @@ -840,15 +1011,15 @@ components: example: d290f1ee-6c54-4b01-90e6-d701748f0851 Relative external ID: type: string - description: Relative's Legacy ID set by the external integrating system, this field is optional. + description: "Relative's Legacy ID set by the external integrating system, this field is optional." Enter date: type: string format: date-time - example: '2017-07-21T17:32:28Z' + example: 2017-07-21T17:32:28Z Exit date: type: string format: date-time - example: '2017-11-14T17:34:28Z' + example: 2017-11-14T17:34:28Z ProgramEnrolment: type: object properties: @@ -857,7 +1028,7 @@ components: format: uuid External ID: type: string - description: Legacy ID set by the external integrating system, this field is optional. + description: "Legacy ID set by the external integrating system, this field is optional." Voided: type: boolean Subject ID: @@ -865,7 +1036,7 @@ components: format: uuid Subject external ID: type: string - description: Subject's Legacy ID set by the external integrating system, this field is optional. + description: "Subject's Legacy ID set by the external integrating system, this field is optional." Subject type: type: string Program: @@ -883,10 +1054,10 @@ components: $ref: '#/components/schemas/GeoLocation' observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" exitObservations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" encounters: type: array items: @@ -902,57 +1073,57 @@ components: format: uuid External ID: type: string - description: Legacy ID set by the external integrating system, this field is optional. + description: "Legacy ID set by the external integrating system, this field is optional." Voided: type: boolean Subject ID: type: string - format: uuid description: id of the subject + format: uuid Subject external ID: type: string - description: Subject's Legacy ID set by the external integrating system, this field is optional. + description: "Subject's Legacy ID set by the external integrating system, this field is optional." Subject type: type: string - description: name of the subject type to which this encounter belongs, same as subject type in the subject resource + description: "name of the subject type to which this encounter belongs, same as subject type in the subject resource" Enrolment ID: type: string - format: uuid description: id of the program enrolment + format: uuid Enrolment external ID: type: string - description: Enrolment's Legacy ID set by the external integrating system, this field is optional. + description: "Enrolment's Legacy ID set by the external integrating system, this field is optional." Program: type: string - description: name of the program of the enrolment to which this encounter belongs, same as program in the program enrolment resource + description: "name of the program of the enrolment to which this encounter belongs, same as program in the program enrolment resource" Encounter type: type: string example: Monthly Visit Encounter location: $ref: '#/components/schemas/GeoLocation' - Encounter datetime: + Encounter date time: type: string format: date-time Earliest scheduled date: type: string - format: date description: available only for scheduled encounters + format: date Max scheduled date: type: string - format: date description: available only for scheduled encounters + format: date observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" Cancel location: $ref: '#/components/schemas/GeoLocation' Cancel datetime: type: string - format: date-time description: available only for cancelled encounters + format: date-time cancelObservations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" audit: $ref: '#/components/schemas/Audit' ProgramEncounterBody: @@ -960,45 +1131,45 @@ components: properties: External ID: type: string - description: Legacy ID set by the external integrating system, this field is optional. + description: "Legacy ID set by the external integrating system, this field is optional." Enrolment ID: type: string - format: uuid description: id of the program enrolment + format: uuid Enrolment external ID: type: string - description: Enrolment's Legacy ID set by the external integrating system, this field is optional. + description: "Enrolment's Legacy ID set by the external integrating system, this field is optional." Program: type: string - description: name of the program of the enrolment to which this encounter belongs, same as program in the program enrolment resource + description: "name of the program of the enrolment to which this encounter belongs, same as program in the program enrolment resource" Encounter type: type: string example: Monthly Visit Encounter location: $ref: '#/components/schemas/GeoLocation' - Encounter datetime: + Encounter date time: type: string format: date-time Earliest scheduled date: type: string - format: date description: available only for scheduled encounters + format: date Max scheduled date: type: string - format: date description: available only for scheduled encounters + format: date observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" Cancel location: $ref: '#/components/schemas/GeoLocation' Cancel datetime: type: string - format: date-time description: available only for cancelled encounters + format: date-time cancelObservations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" Voided: type: boolean Encounter: @@ -1009,7 +1180,7 @@ components: format: uuid External ID: type: string - description: Legacy ID set by the external integrating system, this field is optional. + description: "Legacy ID set by the external integrating system, this field is optional." Voided: type: boolean Encounter type: @@ -1017,39 +1188,39 @@ components: example: Monthly Visit Subject ID: type: string - format: uuid description: id of the subject + format: uuid Subject external ID: type: string - description: Subject's Legacy ID set by the external integrating system, this field is optional. + description: "Subject's Legacy ID set by the external integrating system, this field is optional." Subject type: type: string - description: name of the subject type to which this encounter belongs, same as subject type in the subject resource + description: "name of the subject type to which this encounter belongs, same as subject type in the subject resource" Encounter location: $ref: '#/components/schemas/GeoLocation' - Encounter datetime: + Encounter date time: type: string format: date-time Earliest scheduled date: type: string - format: date description: available only for scheduled encounters + format: date Max scheduled date: type: string - format: date description: available only for scheduled encounters + format: date observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" Cancel location: $ref: '#/components/schemas/GeoLocation' Cancel datetime: type: string - format: date-time description: available only for cancelled encounters + format: date-time cancelObservations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" audit: $ref: '#/components/schemas/Audit' ProgramEnrolmentBody: @@ -1057,17 +1228,17 @@ components: properties: External ID: type: string - description: Legacy ID set by the external integrating system, this field is optional. + description: "Legacy ID set by the external integrating system, this field is optional." Program: type: string example: ANC program Subject ID: type: string - format: uuid description: id of the subject + format: uuid Subject external ID: type: string - description: Subject's Legacy ID set by the external integrating system, this field is optional. + description: "Subject's Legacy ID set by the external integrating system, this field is optional." Enrolment location: $ref: '#/components/schemas/GeoLocation' Exit location: @@ -1080,10 +1251,10 @@ components: format: date-time observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" exitObservations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" Voided: type: boolean EncounterBody: @@ -1097,82 +1268,82 @@ components: example: Monthly Visit Subject ID: type: string - format: uuid description: id of the subject + format: uuid Subject external ID: type: string description: Subject's Legacy ID set by the external integrating system Encounter location: $ref: '#/components/schemas/GeoLocation' - Encounter datetime: + Encounter date time: type: string format: date-time Earliest scheduled date: type: string - format: date description: available only for scheduled encounters + format: date Max scheduled date: type: string - format: date description: available only for scheduled encounters + format: date observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" Cancel location: $ref: '#/components/schemas/GeoLocation' Cancel datetime: type: string - format: date-time description: available only for cancelled encounters + format: date-time cancelObservations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts) + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts)" Voided: type: boolean GeoLocation: type: object - description: Available if the location is enabled by the user properties: X: type: number example: 19.1253108 - Y: + "Y": type: number example: 74.7364501 + description: Available if the location is enabled by the user Audit: type: object properties: Created at: type: string format: date-time - example: '2016-07-21T17:32:28Z' + example: 2016-07-21T17:32:28Z Last modified at: type: string format: date-time - example: '2018-07-21T17:32:28Z' + example: 2018-07-21T17:32:28Z Created by: type: string description: Username which the user uses for login - example: 'narayan@jnpct' + example: narayan@jnpct Last modified by: type: string description: Username which the user uses for login - example: 'sheela@jnpct' + example: sheela@jnpct ResponsePage: type: object properties: totalElements: type: integer - example: 1226 description: Number of entities (like subject) in all the pages put together + example: 1226 totalPages: type: integer - example: 13 description: Total number of pages + example: 13 pageSize: type: integer - example: 100 description: Number of entities in each page + example: 100 Task: type: object properties: @@ -1198,24 +1369,24 @@ components: type: string Scheduled on: type: string - format: date-time description: Optional field + format: date-time Completed on: type: string - format: date-time description: Optional field + format: date-time Assigned to: type: string description: The login username of the user to which the task should be assigned metadata: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts" example: Contact number: "9801010101" - Preferred time of day: 'Day' + Preferred time of day: Day observations: type: object - description: as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts + description: "as key value pairs. key is string and value of type (date, string, number or array of string of name of concepts" example: Duration of talk: 25 Subject ID: @@ -1224,12 +1395,39 @@ components: Subject External ID: type: string description: The ID of the calling system for the subject for which this task is to be done -servers: - # Added by API Auto Mocking Plugin - - description: SwaggerHub API Auto Mocking - url: https://virtserver.swaggerhub.com/samanvay/avni-external/1.0.0 - # staging and production server - - description: Avni production server - url: https://app.avniproject.org/ - - description: Avni staging server - url: https://staging.avniproject.org/ \ No newline at end of file + inline_response_200: + properties: + content: + type: array + items: + $ref: '#/components/schemas/Subject' + allOf: + - $ref: '#/components/schemas/ResponsePage' + inline_response_200_1: + properties: + content: + type: array + items: + $ref: '#/components/schemas/ProgramEnrolment' + allOf: + - $ref: '#/components/schemas/ResponsePage' + inline_response_200_2: + properties: + content: + type: array + items: + $ref: '#/components/schemas/ProgramEncounter' + allOf: + - $ref: '#/components/schemas/ResponsePage' + inline_response_200_3: + properties: + content: + type: array + items: + $ref: '#/components/schemas/Encounter' + allOf: + - $ref: '#/components/schemas/ResponsePage' + inline_response_200_4: + allOf: + - $ref: '#/components/schemas/Task' + - $ref: '#/components/schemas/TaskBody'