openapi: 3.0.3 info: title: VCPR.ORG Protocol Editor API version: 2.1.0 contact: name: Jim Ehrlich, DVM url: https://github.com/VCPR-ORG/publicAPI email: jehrlich@vcpr.org description: >- API serving the Veterinary Protocol Manager™ application. © DairySight LLC, Argyle NY 2020 servers: - description: Production server, uses production database. url: https://VCPR.ORG - description: Staging server, uses staging database. url: https://stage.VCPR.ORG - description: Test server, uses regenerated test database. url: https://test.VCPR.ORG - description: Local server. url: http://localhost tags: - name: VOR description: available to veterinarians. - name: MOR description: available to farm managers. - name: ALL_USERS description: available to all users. - name: SAOR description: available to system administrators. - name: TOR description: available to farm employees. - name: LOR description: available to pharmacy curators. - name: FARM description: available to farm accounts. - name: CLINIC description: available to vet clinic accounts. - name: User description: Endpoints and models related to user management. - name: Protocol description: Endpoints and models related to protocol management. - name: Prescription description: Endpoints and models related to prescription management. - name: Case description: Endpoints and models related to case management. - name: Promise description: Endpoints and models related to promise management. security: - apiKey: [] authToken: [] paths: /editor: get: operationId: loadEditor description: load Protocol Editor tags: [SAOR, VOR] responses: "200": description: load Protocol Editor content: text/html: schema: {} "401": $ref: "#/components/responses/Unauthorized" /farm: get: operationId: loadFarmApp description: load Farm App tags: [SAOR, VOR, MOR] responses: "200": description: load Farm App content: text/html: schema: {} "401": $ref: "#/components/responses/Unauthorized" /admin: get: operationId: loadAdminApp description: load Admin app tags: [SAOR] responses: "200": description: load SPA content: text/html: schema: {} "401": $ref: "#/components/responses/Unauthorized" /signin: get: operationId: signin description: Log in with user credentials tags: [ALL_USERS] parameters: - name: returnPath in: query required: false schema: type: string description: >- After a successful signin, the server will attempt to redirect to this path, if supplied. example: /spa/editor responses: "303": description: show user a form to supply credentials content: text/html: schema: {} /api/users: get: operationId: getUsers tags: [VOR] summary: list of Users IDs description: Returns the ID and names of all active Users of the type(s) specified. parameters: - name: usertypes in: query required: false schema: type: array items: type: string default: [VOR] description: User types to include responses: "200": description: OK content: application/json: schema: type: object properties: vors: type: array items: type: object properties: users: type: integer description: User's ID "401": $ref: "#/components/responses/Unauthorized" "403": $ref: "#/components/responses/Forbidden" put: operationId: updateUser tags: [ALL_USERS] summary: update user data description: >- Users may update their own data. A VOR may also update User data of a User in a `CLIENT` relationship with that VOR. A SAOR may update data of any User. requestBody: required: true content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/User" responses: "200": description: User updated content: application/json: schema: properties: updated-records: type: integer description: number of db records altered "400": $ref: "#/components/responses/BadRequest" /api/users/vors: get: operationId: getVORs tags: [VOR] summary: list of VORs description: list of VOR users. responses: "200": description: OK content: application/json: schema: properties: vors: type: array items: type: object properties: id: type: integer description: User's ID name: type: string description: User's Name "401": $ref: "#/components/responses/Unauthorized" "403": $ref: "#/components/responses/Forbidden" /api/users/logins: post: operationId: userLogin tags: [ALL_USERS] security: [] summary: user login description: >- Authenticate a User and the app requesting a token, returning a token for use in future secured requests. requestBody: required: true content: application/json: schema: type: object required: - apikey - identifier - password properties: apikey: type: string description: >- An API key assigned to an application for access to this API. To request a free API key please contact the system administrator. example: t0CGzpQ4cgu1OBy44sBt identifier: type: string description: "`User.uname`, normally the same as `User.email`" example: someUser password: type: string description: >- User password minLength: 8 example: somePassword responses: "200": description: Successful login content: application/json: schema: $ref: "#/components/schemas/SuccessfulLogin" "400": $ref: "#/components/responses/BadRequest" get: operationId: renewUserToken tags: [ALL_USERS] summary: renew token x-reviewed: JLE 2022/5/30 description: >- Renews the User's access token for use in future secured requests. responses: "200": description: Success – token refreshed content: application/json: schema: $ref: "#/components/schemas/SuccessfulLogin" "401": $ref: "#/components/responses/Unauthorized" /api/users/{id}: get: operationId: getUser tags: [ALL_USERS] summary: get user data description: >- Returns User data as specified by User `id`. Any User may get their own data. A VOR may get User data of Users in a `CLIENT` relationship with that VOR. A SAOR may get data of any User. parameters: - name: id in: path schema: type: integer required: true description: User ID key example: 2 responses: "200": description: User content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/User" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" delete: operationId: deleteUser x-no-test: true tags: [SAOR, VOR] summary: delete user description: >- This endpoint supports the (reversible) "delete" of a User by setting user.status to `REMOVED`. Removed Users are not visible in normal queries. parameters: - name: id in: path schema: type: integer required: true description: User ID key example: 5 responses: "200": description: User deleted content: application/json: schema: type: object properties: deleted: type: integer description: number of Users deleted "401": $ref: "#/components/responses/Unauthorized" "403": $ref: "#/components/responses/Forbidden" /api/visits/{id}: get: operationId: getVisits tags: [ALL_USERS] summary: list of all description: list of . parameters: - name: id in: path schema: type: integer required: true description: User ID key example: 2 responses: "200": description: OK content: application/json: schema: properties: visits: type: array items: $ref: "#/components/schemas/Login" /api/users/sandboxClient: post: operationId: createSandboxClient tags: [VOR] summary: create a sandbox user description: >- Create a sandbox user of MOR `UserType` who is a `CLIENT` of logged-in VOR. This allows the VOR to prescribe to the sandbox client, then view prescriptions from the client's point of view using the Farm App. requestBody: required: true content: application/json: schema: type: string description: The username for the sandbox client. This must not match an existing `User.username` responses: "200": description: Sandbox user created content: application/json: schema: type: object properties: sandboxClient: type: string description: username of sandbox client "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" delete: operationId: deleteSandboxClient tags: [SAOR, VOR] summary: delete sandboxClient description: >- Delete the User and CLIENT Relation records from the database, irreversibly removing the sandbocx client, but not any existing Prescriptions. responses: "200": description: Sandbox user deleted content: application/json: schema: type: object properties: deleted: type: integer description: number of Users deleted "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/users/addresses: put: operationId: updateAddress tags: [ALL_USERS] summary: update address description: >- A User may update their own address. requestBody: required: true content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/User" responses: "200": description: User updated content: application/json: schema: properties: updated-records: type: integer description: number of db records altered "401": $ref: "#/components/responses/Unauthorized" /api/users/addresses/{id}: get: operationId: getAddress x-reviewed: JLE 2022/5/31 tags: [ALL_USERS] summary: address of user description: >- Address of user specified by `id`. parameters: - name: id in: path schema: type: integer required: true description: User ID key example: 2 responses: "200": description: User content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/Address" "401": $ref: "#/components/responses/Unauthorized" /api/users/profiles: put: operationId: updateProfile tags: [ALL_USERS] summary: update profile description: >- A User may update their own profile. requestBody: required: true content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/Profile" responses: "200": description: Profile updated content: application/json: schema: properties: profile: $ref: "#/components/schemas/Profile" "401": $ref: "#/components/responses/Unauthorized" "409": $ref: "#/components/responses/Conflict" post: operationId: createProfile summary: create profile description: >- Create a User with Address, and UserPrefs. requestBody: required: true content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/Profile" responses: "200": description: the created Profile content: application/json: schema: $ref: "#/components/schemas/Profile" "401": $ref: "#/components/responses/Unauthorized" /api/users/profiles/{id}: get: operationId: getProfile tags: [ALL_USERS] summary: Profile of user description: >- Profile of user specified by `id`. parameters: - name: id in: path schema: type: integer required: true description: User ID key example: 2 responses: "200": description: User content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/Address" "401": $ref: "#/components/responses/Unauthorized" /api/users/token/{token}: get: operationId: confirmToken description: used for clickable link to confirm a token sent in email. tags: [ALL_USERS] parameters: - name: token in: path schema: type: string required: true description: single-use token required for authentication example: 2frfgjty responses: "200": description: OK content: text/html: schema: description: web page confirmation. type: string format: html "401": $ref: "#/components/responses/Unauthorized" /api/users/withholds: get: operationId: getWithholds x-reviewed: JLE 2022/5/31 tags: [MOR] summary: withholds description: get withholds that include present or future time. responses: "200": description: OK content: application/json: schema: properties: labels: type: array items: $ref: "#/components/schemas/Withhold" /api/users/comments: post: operationId: recordComment tags: [ALL_USERS] summary: record a User comment description: >- Records a User comment to the database and emails admin. It supports privacy controls. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Comment" responses: "200": description: Success – comment recorded content: application/json: schema: type: object properties: recorded: type: integer "400": $ref: "#/components/responses/BadRequest" /api/users/relations: post: operationId: getRelations tags: [VOR] summary: add a relationship description: >- adds a relationship of the type specified by `name` to the current User, who must be a VOR. Defaults to CLIENT relationship. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Relationship" responses: "200": description: related User content: application/json: schema: type: string "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/users/my-right-relations: get: operationId: myRightRelations tags: [VOR] summary: get my right-related users description: get my right-related users parameters: - in: query name: relationship schema: $ref: "#/components/schemas/Relationship" - in: query name: withAddress schema: type: boolean default: false example: false description: whether to return user's addresses too responses: "200": description: OK content: application/json: schema: description: array of Users properties: prescriptions: type: array items: oneOf: - $ref: "#/components/schemas/User" - $ref: "#/components/schemas/Profile" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" post: operationId: createRightRelation tags: [VOR] summary: add a User with relationship description: >- This endpoint adds a User and a relationship of the type specified by `name` to the current User, who must be a VOR. Defaults to CLIENT relationship. parameters: - name: relationship in: query required: true schema: $ref: "#/components/schemas/Relationship" - name: usertype in: query required: true schema: $ref: "#/components/schemas/UserType" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/User" responses: "200": description: related User content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/User" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/prescriptionsByMe: get: operationId: getRxBy tags: [VOR] summary: get my prescriptions description: get prescriptions prescribed by the current User. responses: "200": description: OK content: application/json: schema: description: array of prescriptions accessible to current User properties: prescriptions: type: array items: $ref: "#/components/schemas/Prescription" of: type: integer description: total number of prescriptions available "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/prescriptionsToMe: get: operationId: getRxTo tags: [VOR] summary: get prescriptions prescribed to me description: get prescriptions prescribed to the current User. responses: "200": description: OK content: application/json: schema: description: array of prescriptions accessible to current User properties: prescriptions: type: array items: $ref: "#/components/schemas/Prescription" of: type: integer description: total number of prescriptions available /api/protocols/shares: get: operationId: getMyProtocolShares tags: [VOR] summary: get my protocol shares description: >- This endpoint retrieves a User's Protocol shares, optionally filtered by Protocol and recipient. parameters: - name: pxFilter in: query schema: type: integer required: false description: select only shares of this Protocol ID - name: toFilter in: query schema: type: integer required: false description: select only shares to this VOR User responses: "200": description: OK content: application/json: schema: type: object properties: shares: type: array items: $ref: "#/components/schemas/ProtocolShare" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" post: operationId: createProtocolShare tags: [VOR] summary: create protocol share description: This endpoint shares a protocol with another VOR User. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProtocolShare" responses: "200": description: protocol shared content: application/json: schema: type: object properties: shared: type: integer description: number of shares created example: 1 "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" delete: operationId: deleteProtocolShare tags: [VOR] summary: delete protocol share description: This endpoint retracts a Protocol share with another VOR User. parameters: - name: pxId in: query schema: type: integer required: true description: Protocol ID - name: toVor in: query schema: type: integer required: true description: ID of VOR to whom Protocol was shared responses: "200": description: Success – Protocol share deleted content: application/json: schema: type: object properties: un-shared: type: integer description: number of shares deleted "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/sharesToAll/: get: operationId: getSharesToAll tags: [VOR] summary: list of User's shared protocols description: This endpoint retrieves a list of User's protocols shared to all VORs. responses: "200": description: OK content: application/json: schema: type: object properties: shares: type: array items: type: object properties: pxId: type: integer description: Protocol ID name: type: string description: Protocol name clonable: type: boolean description: >- switch to determine whether other VORs are allowed to clone this Protocol example: true example: shares: - pxId: 1 name: example protocol clonable: false "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/sharesToAll/{pxId}: post: operationId: shareToAll tags: [VOR] summary: share Protocol with all VOR Users description: This endpoint shares a User's protocol with all VOR Users. parameters: - name: pxId in: path schema: type: integer required: true explode: true description: ID of Protocol to be shared - name: clonable in: query schema: type: boolean required: false explode: true responses: "204": $ref: "#/components/responses/NoContent" "400": $ref: "#/components/responses/BadRequest" delete: operationId: unShareToAll tags: [VOR] summary: cancel sharing description: wip -- This endpoint probably unshares protocols to all. parameters: - name: pxId in: path example: 1 schema: type: integer required: true description: ID of Protocol responses: "204": description: no content /api/protocols/amducatags: put: operationId: getAMDUCATags tags: [VOR] summary: AMDUCA-tag protocol description: add tags to protocol per AMDUCA rules requestBody: content: application/json: schema: $ref: "#/components/schemas/Protocol" responses: "200": description: Success – updated Protocol content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/Protocol" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/tags: get: operationId: getProtocolTags tags: [VOR] summary: list of all Tags description: Returns the full array of tags for protocols and treatments. responses: "200": description: OK content: application/json: schema: properties: tags: type: array items: $ref: "#/components/schemas/Tag" post: operationId: createTag tags: [SAOR] summary: create Tag description: Create a Tag. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Tag" responses: "200": description: Success – Tag recorded content: application/json: schema: type: object properties: tag: $ref: "#/components/schemas/Tag" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" /api/protocols/tags/{id}: delete: operationId: deleteTag tags: [SAOR] summary: Tag description: Delete Tag. parameters: - name: id in: path schema: type: integer required: true responses: "200": description: deleted content: application/json: schema: properties: deleted: type: integer description: number of db records deleted "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/tags/remedies: put: operationId: executeRemedy tags: [VOR] description: Apply a Remedy to a Protocol, returning the fixed Protocol. requestBody: content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/Protocol" remedy: $ref: "#/components/schemas/Remedy" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Protocol" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/promises: get: operationId: getPromisess tags: [VOR] summary: list of Promises description: VOR users have access to a set of public promises plus any Promises they have created for their own use. responses: "200": description: OK content: application/json: schema: properties: promises: type: array items: $ref: "#/components/schemas/Promise" /api/protocols/publicPromises: post: operationId: createPublicPromise tags: [SAOR] summary: create a public Promise description: >- REcord a Promise type that will be public (available to all VORs) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Promise" responses: "200": description: OK content: application/json: schema: properties: promise: $ref: "#/components/schemas/Promise" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/privatePromises: post: operationId: createPrivatePromise tags: [VOR] summary: create a private Promise description: >- Create a Promise type that will be private (available only to the VOR recording it) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Promise" responses: "200": description: OK content: application/json: schema: properties: promise: $ref: "#/components/schemas/Promise" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/promises/{id}: get: operationId: getPromise tags: [VOR, MOR, TOR] summary: get a Promise description: get a Promise parameters: - name: id in: path schema: type: integer required: true description: promise ID example: 32 responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Promise" /api/logging: post: operationId: logMessage tags: [ANY_USER] summary: log a message to server description: adds a timestamped entry to server logs parameters: - name: severity in: query required: false description: >- logging level severity, defaulting to INFO schema: type: string enum: - INFO - ERROR - DEBUG - WARN default: INFO responses: "200": description: message logged content: application/json: schema: type: object properties: logged: type: string description: the message logged "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/messages: post: operationId: sendMessage tags: [VOR, MOR, SAOR] summary: send a message to another user description: send a message to another user parameters: - name: modes in: query required: false style: pipeDelimited explode: false description: >- Mode(s) or channel(s) to use in messaging, defaulting to EMAIL schema: type: array items: $ref: "#/components/schemas/MessageMode" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UserMessage" responses: "200": description: message sent successfully content: application/json: schema: type: object properties: message: $ref: "#/components/schemas/UserMessage" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /messages/ok/{token}/: get: operationId: okMessage security: [] tags: [ALL_USERS] summary: respond to a message identified by token description: >- Respond to a message according to the content in the message, secured by a token that links the response to a UserMessage. Typically token expires in 48 hr. parameters: - name: token in: path required: true description: a token supplied in a message asking for a response. Token typically expires in 48 hr. schema: type: string - name: response in: query required: false description: >- A message may include a question requiring a yes-or-no response. For example, an email message could include links for "confirm" or decline" with only the first setting the response parameter to true. schema: type: boolean default: false description: recipient's answer to a binary question. responses: "200": description: OK content: text/html: schema: description: web page confirming action requested in a message response type: string format: html "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /api/protocols: get: operationId: getMyProtocols tags: [VOR] summary: protocols owned by user description: >- Retrieve all Protocols owned by, or shared with, the current User. The default excludes deleted (status DEPRECATED) protocols. parameters: - name: statuses in: query required: false style: pipeDelimited explode: false description: >- filter Protocols to include only Protocols with listed statuses. If this parameter is omitted, the query defaults to all status values **except** DEPRECATED. schema: type: string example: "VALIDATED|PRESCRIBED" - name: tags in: query required: false style: pipeDelimited explode: false description: >- filter Protocols to include only Protocols with at least one of the tags listed. schema: type: string example: ORGANIC - name: offset in: query schema: type: integer default: 0 description: page start required: false - name: limit in: query schema: type: integer default: 20 description: maximum page length required: false responses: "200": description: OK content: application/json: schema: description: array of Protocols type: object properties: protocols: type: array items: $ref: "#/components/schemas/Protocol" of: type: integer description: total number of prescriptions available "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" post: operationId: createProtocol tags: [VOR] summary: record and validate aprotocol description: This endpoint saves and validates a Protocol. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Protocol" responses: "200": description: Success – recorded Protocol content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/Protocol" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" put: operationId: updateProtocol tags: [VOR] summary: update protocol description: This endpoint updates and validates a Protocol. requestBody: content: application/json: schema: $ref: "#/components/schemas/Protocol" responses: "200": description: Success – updated Protocol content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/Protocol" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/validate: put: operationId: validateProtocol tags: [VOR] summary: This endpoint validates a protocol without saving it. description: >- This endpoint validates a protocol for prescribing without saving it. It should only be called if the user wants to prescribe a protocol without saving changes. The endpoints to save or update protocols automatically include validation.4 requestBody: content: application/json: schema: $ref: "#/components/schemas/Protocol" responses: "200": description: Success – updated Protocol content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/Protocol" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/eligibilities: get: operationId: getEligibilities tags: [VOR] summary: list of all eligibilities description: >- This endpoint returns an array of Eligibilities from which a User may choose. The ID field is authoritative, i.e., is all that is needed to identify a particular Eligibility. responses: "200": description: OK content: application/json: schema: description: array of eligibilities type: object properties: eligibilities: type: array items: $ref: "#/components/schemas/Eligibility" post: operationId: createEligibility tags: [SAOR] summary: create Eligibility description: Creation a Eligibility. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Eligibility" responses: "200": description: Success – Eligibility recorded content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/Eligibility" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/eligibilities/{id}}: delete: operationId: deleteEligibility tags: [SAOR] summary: Eligibility description: Delete Eligibility. x-reviewed: JLE 2022/5/31 parameters: - name: id in: path schema: type: integer required: true responses: "200": description: deleted content: application/json: schema: properties: deleted: type: integer description: number of db records deleted "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/eligibilities/fdaspecies: get: operationId: getExFDASpecies tags: [VOR] summary: list of fda species description: >- "Species" is the term FDA uses to describe a class of animals in a label claim. responses: "200": description: OK content: application/json: schema: description: array of FDASpecies type: object properties: eligibilities: type: array items: $ref: "#/components/schemas/FDASpecies" /api/protocols/diagnoses: get: operationId: getDiagnoses tags: [VOR] summary: list of all diagnoses description: >- Returns an array of all coded Diagnoses known to the system. responses: "200": description: OK content: application/json: schema: type: object properties: diagnoses: type: array items: $ref: "#/components/schemas/Diagnosis" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" post: operationId: createDiagnosis tags: [SAOR] summary: create Eligibility description: Create a Diagnosis. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Diagnosis" responses: "200": description: Success – Diagnosis recorded content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/Diagnosis" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/diagnoses/{id}: delete: operationId: deleteDiagnosis tags: [SAOR] summary: Diagnosis description: Delete Diagnosis. x-reviewed: JLE 2022/5/31 parameters: - name: id in: path schema: type: integer required: true responses: "200": description: deleted content: application/json: schema: properties: deleted: type: integer description: number of db records deleted "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/libs: get: operationId: getLibraryProtocols tags: [VOR] summary: list of library protocols description: >- This endpoint retrieves all protocols owned by, or shared with, the current User. responses: "200": description: OK content: application/json: schema: description: array of Protocols from public library type: object properties: protocols: type: array items: $ref: "#/components/schemas/Protocol" of: type: integer description: total number of prescriptions available /api/protocols/exclusivestubs: get: operationId: getExclusivestubs tags: [VOR] summary: list of all diagnoses description: >- returns an array of Pxes . responses: "200": description: OK content: application/json: schema: description: array of pxes owned by the VOR type: object properties: diagnoses: type: array items: $ref: "#/components/schemas/Px" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/dosages: post: operationId: validateDosage tags: [VOR] summary: validate a structured Dosage description: validate a Dosage with SizeFunction and SequewnceFunction returning an test '_dose" description. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DoseFunctions" responses: "200": description: _dose content: application/json: schema: properties: _dose: type: string description: string representation of submitted Dosage "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/libstubs: get: operationId: getLibraryPxes tags: [VOR] summary: list of library pxes description: >- This endpoint returns all the Protocols owned by, or shared with, the current User. responses: "200": description: OK content: application/json: schema: description: array of protocol stubs from public library type: object properties: pxes: type: array items: $ref: "#/components/schemas/Px" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/{id}: get: operationId: getProtocol tags: [VOR] summary: retrieve protocol by ID description: This endpoint retrieves a Protocol by `protocol.id`. parameters: - name: id in: path schema: type: integer example: 7 required: true description: Protocol ID key responses: "200": description: OK content: application/json: schema: properties: protocol: $ref: "#/components/schemas/Protocol" text/html: schema: properties: protocol: $ref: "#/components/schemas/Protocol" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" delete: operationId: deleteProtocol tags: [VOR] summary: delete protocol description: >- Change `protocol.status` to DELETED (this does not actually remove it from the database). parameters: - name: id in: path schema: type: integer required: true description: Protocol ID key responses: "200": description: Protocol deprecated content: application/json: schema: type: object properties: deprecated: type: integer description: number of Protocols deprecated "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/prescriptions: get: operationId: getPrescriptions tags: [VOR] summary: list of all diagnoses description: >- This responses: "200": description: OK content: application/json: schema: description: array of prescriptions type: object properties: diagnoses: type: array items: $ref: "#/components/schemas/Prescription" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" post: operationId: createPrescription tags: [VOR] summary: Prescribe a Protocol to a client description: >- create a Prescription and email it if requested requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PrescriptionRequest" responses: "201": description: Created content: application/json: schema: properties: prescription: $ref: "#/components/schemas/Prescription" pdfError: $ref: "#/components/schemas/Error" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/{id}/prescriptions: get: operationId: getPrescriptionsOfProtocol tags: [VOR] summary: list of all diagnoses description: >- returns an array of Prescriptions parameters: - name: id in: path schema: type: integer required: true description: Protocol ID key responses: "200": description: OK content: application/json: schema: description: array of prescriptions type: object properties: diagnoses: type: array items: $ref: "#/components/schemas/Prescription" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/protocols/prescriptions/{id}: get: operationId: XgetPrescription tags: [VOR] summary: retrieve prescription by ID description: Retrieve a Prescription by `prescription.id`. parameters: - name: id in: path schema: type: string example: Vi1y9kbpEj7Upqy7 required: true description: Prescription ID key responses: "200": description: OK content: application/json: schema: properties: prescription: $ref: "#/components/schemas/Prescription" text/html: schema: type: string application/pdf: schema: type: string format: binary "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/helpkeys: get: operationId: getHelpkeys tags: [ALL_USERS] summary: list of all diagnoses description: >- Returns an array of keys used to identify help messages. responses: "200": description: OK content: application/json: schema: description: array of help keys type: object properties: keys: type: array items: type: string "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/help/{key}: get: operationId: getHelp tags: [ALL_USERS] summary: help message description: return a help message, normally to be displayed in a popup help screen. parameters: - name: key in: path schema: type: string required: true description: help screen key responses: "200": description: OK content: application/json: schema: properties: help: type: string "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" post: operationId: createHelp tags: [SAOR] summary: create help screen description: Creation a help screen. x-reviewed: JLE 2022/5/31 parameters: - name: key in: path schema: type: string required: true description: help screen key requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/HelpScreen" responses: "200": description: Success – help screen recorded content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/HelpScreen" "400": $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" delete: operationId: deleteHelp tags: [SAOR] summary: delete help screen description: Delete help screen. x-reviewed: JLE 2022/5/31 parameters: - name: key in: path schema: type: string required: true description: help screen key responses: "200": description: deleted content: application/json: schema: properties: deleted: type: integer description: number of db records deleted "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/labels: get: operationId: getLabels tags: [VOR] summary: list of all labelclaims description: This endpoint returns the full array of drug labels. responses: "200": description: OK content: application/json: schema: properties: labels: type: array items: $ref: "#/components/schemas/LabelClaim" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" post: operationId: createLabelClaim tags: [SAOR] summary: create labelclaim description: Creation a labelclaim. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LabelClaim" responses: "200": description: Success – labelclaim recorded content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/LabelClaim" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" put: operationId: updateLabelClaim tags: [SAOR] summary: update labelclaim description: update a labelclaim. requestBody: content: application/json: schema: $ref: "#/components/schemas/LabelClaim" responses: "200": description: Success – © Protocol content: application/json: schema: type: object properties: protocol: $ref: "#/components/schemas/LabelClaim" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/labels/{id}: get: operationId: getLabel tags: [VOR] summary: labelclaim description: Return specified labelclaim. parameters: - name: id in: path schema: type: integer required: true description: labelclaim ID example: 32 responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/LabelClaim" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/labels/inserts/{lxId}: get: operationId: getPackageInsert tags: [VOR] summary: package insert description: Retrieve the product package insert. parameters: - name: lxId in: path schema: type: integer required: true description: label ID example: 32 responses: "200": description: OK content: application/json: schema: type: string format: html "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" "404": $ref: "#/components/responses/NotFound" /api/spl/{ndc}: get: operationId: getGbdLinkByNDC tags: [VOR] summary: get detail of a Greenbook Drug as a link description: This parameters: - name: ndc in: path schema: type: string required: true description: >- unique hyphenated number with up to 10 digits in 2 or 3 segments as labelerCode-productCode-packageCode. packageCode may not be needed. example: 0010-3832 responses: "200": description: OK content: text/html: schema: description: Standard Product Label as html type: string format: html "303": description: Redirect to SPL file served from FDA server content: text/xml: schema: description: XML SPL data file served from FDA server type: string format: xml /api/spl/{ndc}/{image}: get: operationId: getGbdL tags: [VOR] summary: get detail of a Greenbook Drug as a link description: This parameters: - name: ndc in: path schema: type: string required: true description: >- unique hyphenated number with up to 10 digits in 2 or 3 segments as labelerCode-productCode-packageCode. packageCode may not be needed. example: 0010-3495 - name: image in: path schema: type: string required: true description: name of image file example: 601588-image-fake.jpg responses: "200": description: OK content: application/json: schema: description: URL link to XML SPL data file type: string format: url "303": description: Redirect to SPL file served from FDA server content: text/xml: schema: description: XML SPL data file served from FDA server type: string format: xml /api/prescriptions/{id}/: get: operationId: getPrescription tags: [VOR] summary: retrieve prescription by ID description: Retrieve a Prescription by `prescription.id`. parameters: - name: id in: path schema: type: string example: Vi1y9kbpEj7Upqy7 required: true description: Prescription ID key responses: "200": description: OK content: application/json: schema: properties: prescription: $ref: "#/components/schemas/Prescription" text/html: schema: type: string application/pdf: schema: type: string format: binary delete: operationId: deletePrescription tags: [VOR, MOR] summary: recall or decline a prescription description: >- Prescriptions are immutable except for metadata, and cannot actually be deleted. This endpoint makes a prescription unavailable for use. If called by the VOR, it sets staus to RECALLED. If called by the MOR to whom it is prescribed, it sets status to DECLINED. New cases cannot be enrolled if either RECALLED or DECLIENED. parameters: - name: id in: path schema: type: string example: Vi1y9kbpEj7Upqy7 required: true description: Prescription ID key responses: "200": description: prescription updated content: application/json: schema: properties: updated: type: integer "401": $ref: "#/components/responses/Unauthorized" /api/cases: post: operationId: depecatedEnrollCase tags: [VOR, MOR] summary: enroll case, deprecated in favor of POST /api/cases2 which will be moved to this path eventually description: Creates a Case linked to a prescription. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Case" responses: "200": description: Success – recorded Case content: application/json: schema: type: object properties: case: type: object properties: id: type: integer promises: type: integer doses: type: integer withhold: type: integer "400": $ref: "#/components/responses/BadRequest" get: operationId: myCases tags: [VOR] summary: list of cases description: Get all current cases for this user responses: "200": description: Success content: application/json: schema: properties: cases: type: array items: $ref: "#/components/schemas/Case" "401": $ref: "#/components/responses/Unauthorized" /api/cases2: post: operationId: enrollCase tags: [VOR, MOR] summary: enroll Case returning tasks description: Enrolls a Case from its Prescription and generates DoseTasks, Promise tasks, and Withhold as specified in the Protocol. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Case" responses: "200": description: Success – tasks generated content: application/json: schema: type: object properties: case: type: object properties: id: type: integer description: Case ID promises: type: array description: Promise tasks to be completed items: $ref: "#/components/schemas/PTask" doses: type: array description: Dose tasks to be completed items: $ref: "#/components/schemas/DoseTask" withhold: description: Meat or milk withholding, if required $ref: "#/components/schemas/Withhold" "400": $ref: "#/components/responses/BadRequest" /api/cases/{caseId}: get: operationId: getCaseHx tags: [VOR, MOR] summary: get history for a single Case (with tasks) description: Case plus tasks generated for the Case plus any data returned on task execution parameters: - name: caseId in: path schema: type: integer required: true description: ID number of Case responses: "200": description: OK content: application/json: schema: properties: caseHx: $ref: "#/components/schemas/CaseHx" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/Unauthorized" /api/rx-cases: get: operationId: rxWithCases tags: [VOR, MOR] summary: prescriptions with cases description: A filtered list of Prescriptions with Cases enrolled to each. parameters: - name: vorId in: query schema: type: integer description: ID number of prescribing VOR required: false - name: morId in: query schema: type: integer description: ID number of MOR prescribed to required: false - name: protocolId in: query schema: type: integer description: ID number of protocol prescribed required: false - name: enrolledBefore in: query schema: type: string format: date-time example: 2020-01-10T22:20:39Z description: last date limit for Case enrollment - name: enrolledAfter in: query schema: type: string format: date-time example: 2019-01-10T22:20:39Z description: earliest date limit for Case enrollment - name: offset in: query schema: type: integer default: 0 description: page start required: false - name: limit in: query schema: type: integer default: 20 description: maximum page length required: false responses: "200": description: Success content: application/json: schema: properties: rxesWithCases: type: array items: $ref: "#/components/schemas/RxWithCases" of: type: integer description: total number of cases available "401": $ref: "#/components/responses/Unauthorized" /api/prescriptions/{rxId}/cases: get: operationId: Cases tags: [VOR] summary: list of cases for a rx description: Get all current cases for this prescription and this user parameters: - name: rxId in: path schema: type: string required: true description: prescription uuid example: Vi1y9kbpEj7Upqy7 responses: "200": description: Success – token refreshed content: application/json: schema: properties: cases: type: array items: $ref: "#/components/schemas/Case" "401": $ref: "#/components/responses/Unauthorized" /api/users/tasks: post: operationId: executeTask tags: [VOR, MOR] summary: execute task description: Mark task status as completed requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AnimalTask" responses: "200": description: Success, Protocol recorded content: application/json: schema: type: object properties: case: $ref: "#/components/schemas/Case" "400": $ref: "#/components/responses/BadRequest" get: operationId: myRxCases tags: [VOR] summary: list of cases by Rx description: Get all current cases for this Rx responses: "200": description: Success – token refreshed content: application/json: schema: properties: cases: type: array items: $ref: "#/components/schemas/Case" "401": $ref: "#/components/responses/Unauthorized" /api/admin/product: get: operationId: getGbdHeaderArrayByNDC tags: [VOR] summary: get Greenbook Drug summary by NDC pattern description: >- This endpoint returns the summary listing of a Greenbook Drug by NDC pattern. parameters: - name: ndcProd in: query schema: type: integer required: false description: first section labeler code of a NDC - name: ndcLabeler in: query schema: type: integer required: false description: mid section product code of a NDC - name: ndcBrand in: query schema: type: integer required: false description: end section package code of a NDC responses: "200": description: OK content: application/json: schema: type: array items: $ref: "#/components/schemas/Product" /api/admin/product/{ndc}: get: operationId: getGbdHeaderByNDC tags: [VOR] summary: get summary listing of a Greenbook Drug description: >- This endpoint returns the summary listing of a Greenbook Drug by ndc identifier. parameters: - name: ndc in: path schema: type: string required: true description: >- unique 10-digit, 3-segment number. labelerCode-productCode-packageCode example: 0061-4321-03 responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Product" text/html: schema: type: string /api/admin/spl/{ndc}: get: operationId: getSPL tags: [VOR, MOR, SAOR] parameters: - name: ndc in: path schema: type: string required: true description: >- unique 10-digit, 3-segment number. labelerCode-productCode-packageCode example: 0061-4321-03 responses: "401": $ref: "#/components/responses/Unauthorized" /api/admin/gbd: get: operationId: getGreenbookDrugs tags: [SAOR] summary: greenbook drugs description: Return GBDs. parameters: - name: ndcProd in: query schema: type: integer required: false description: first section labeler code of a NDC - name: ndcLabeler in: query schema: type: integer required: false description: mid section product code of a NDC - name: ndcBrand in: query schema: type: integer required: false description: starting row number in GBD table - name: offset in: query schema: type: integer required: false description: maximum number of rows to return - name: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJleUp3Y205MmFXUmxja2xFSWpvaVkzSmxaR1Z1ZEdsaGJITWlMQ0p3Y205MmFXUmxja3RsZVNJNkluUmxjM1JXVDFJaWZRPT0iLCJpc3MiOiJwbGF5LXNpbGhvdWV0dGUiLCJle***... in: query schema: type: integer required: false description: end section package code of a NDC responses: "200": description: OK content: application/json: schema: type: array items: $ref: "#/components/schemas/GreenbookDrug" put: operationId: updateGreenbookDrugs tags: [SAOR] summary: update GBD description: M requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/GreenbookDrug" responses: "200": description: Success, GreenbookDrug updated content: application/json: schema: type: object properties: case: $ref: "#/components/schemas/GreenbookDrug" "400": $ref: "#/components/responses/BadRequest" /api/admin/gbd/{ndc}: get: operationId: getGreenbookDrug tags: [SAOR] parameters: - name: ndc in: path schema: type: string required: true description: >- unique 10-digit, 3-segment number. labelerCode-productCode-packageCode example: 0061-4321-03 responses: "401": $ref: "#/components/responses/Unauthorized" /api/admin/ConfirmVOR: put: operationId: confirmVOR tags: [ALL_USERS] parameters: - name: sendEmail in: query schema: type: boolean default: true required: false responses: "200": description: User content: application/json: schema: type: object properties: vor: $ref: "#/components/schemas/User" "401": $ref: "#/components/responses/Unauthorized" /api/images: get: operationId: getImage tags: [ALL_USERS] parameters: - name: keywords in: query schema: type: array items: type: string - name: productId in: query schema: type: integer - name: dx in: query schema: type: integer - name: ex in: query schema: type: integer responses: "200": description: Image content: application/json: schema: type: object properties: image: $ref: "#/components/schemas/Image" "401": $ref: "#/components/responses/Unauthorized" post: operationId: saveImage tags: [VOR, MOR] summary: record an image description: REcords link for loading an image. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Image" responses: "200": description: Success – recorded Case content: application/json: schema: type: object properties: case: type: object properties: id: type: integer promises: type: integer doses: type: integer withhold: type: integer "400": $ref: "#/components/responses/BadRequest" /api/images/{id}: get: operationId: getImage tags: [ALL_USERS] parameters: - name: id required: true in: path schema: type: string responses: "200": description: Image content: application/json: schema: type: object properties: image: $ref: "#/components/schemas/Image" "401": $ref: "#/components/responses/Unauthorized" /api/imagekeywords: get: operationId: getImageKeywards tags: [ALL_USERS] responses: "200": description: Image content: application/json: schema: type: object properties: keywords: type: array items: type: string "401": $ref: "#/components/responses/Unauthorized" /api/imagestores: get: operationId: getImageStores tags: [ALL_USERS] responses: "200": description: ImageStores content: application/json: schema: type: object properties: stores: type: array items: $ref: "#/components/schemas/ImageStore" "401": $ref: "#/components/responses/Unauthorized" components: securitySchemes: apiKey: type: apiKey in: header name: X-APIKEY description: >- API key stored in request header. This identifies the application consuming the API. To request a free API key contact a site administrator. authToken: type: apiKey in: header name: X-Auth-Token description: JWT token stored in request header. responses: NoContent: #204 description: There is no content to send for this request. BadRequest: #400 description: The server can not understand the request due to invalid syntax. content: application/json: schema: $ref: "#/components/schemas/Error" text/html: schema: description: web page warning type: string format: html Unauthorized: #401 description: Authorization required content: application/json: schema: $ref: "#/components/schemas/Error" text/html: schema: description: web page warning type: string format: html Forbidden: #403 description: The user does not have access rights to the content. content: application/json: schema: $ref: "#/components/schemas/Error" text/html: schema: description: web page warning type: string format: html NotFound: #404 description: The server can not find the requested resource. content: application/json: schema: $ref: "#/components/schemas/Error" text/html: schema: description: web page warning type: string format: html Conflict: #409 description: request conflicts with the current state of the target resource. content: application/json: schema: $ref: "#/components/schemas/Error" text/html: schema: description: web page warning type: string format: html schemas: UserType: type: string description: > an ordered list of User types associated with privilege levels:
* SAOR: a system administrator with top level privileges * VOR: a veterinarian who may create and prescribe protocols * MOR: a farm manager to whom protocols may be prescribed, and who may create Cases in a protocol * TOR: a farm technician who may execute assigned protocols for assigned cases * FARM: an account aggregating MOR and TOR Users * CLINIC: an account aggregating multiple VOR Users who work together * UNCONFIRMED: an account that has been requested but not confirmed by the owner * UNVOR: a User who requests VOR status, with neither email or admin approval * UNMOR: a User who requests MOR status but email not yet confirmed * PREVOR: a confirmed User who requests VOR status but still lacks either email confirmation or approval by admin * REMOVED: the record of a User who is no longer active and may not log in enum: - SAOR - VOR - MOR - TOR - FARM - CLINIC - UNCONFIRMED - PREVOR - UNVOR - UNMOR - REMOVED example: VOR UserNumber: description: Long integer key to a User type: integer example: 99 User: description: a User of a `UserType` class type: object required: [uname, userType, firstname, lastname] properties: id: $ref: "#/components/schemas/UserNumber" uname: description: username type: string minLength: 7 example: exampleUser userType: $ref: "#/components/schemas/UserType" email: type: string format: email description: email address example: exampleUser@email.com firstname: type: string minLength: 2 description: first name example: Example lastname: type: string minLength: 2 description: last name example: User suffix: type: string description: degree or qualifier following the name example: DVM phone: type: string format: string description: phone number Profile: description: User data including Address and preferences type: object allOf: - $ref: "#/components/schemas/User" - $ref: "#/components/schemas/Address" - $ref: "#/components/schemas/UserPrefs" required: - id - uname - userType - email - firstname - lastname - suffix UserPrefs: description: values a user may set to customize performance type: object properties: userId: type: integer sandboxName: type: string emailTips: type: boolean emailNews: type: boolean rxHeader: type: string required: - userId - sandboxName - emailTips - emailNews - rxHeader Address: description: a mailing address type: object properties: userId: type: integer busName: description: business name, if appropriate type: string example: testVOR Clinic address1: description: first line or street address type: string example: 123 Main St. address2: description: second line of address, if needed type: string example: 123 Main St. town: description: town or city type: string example: Anytown state: description: state or province type: string example: Any State zip: type: string description: zip or postal code example: 12345-abcd country: type: string description: country example: USA required: - userId - address1 - address2 - town - state - zip Relationship: type: string description: > a link between two Users defining a relationship: - CLIENT: MOR User on right is a client of VOR User on left - EMPLOYEE: TOR User on right is an employee of MOR User on left - MEMBER: VOR User on right is a member of CLINIC on left, or MOR User on right is a manager of FARM on left enum: - CLIENT - EMPLOYEE - MEMBER example: CLIENT MessageMode: type: string description: > A mode of messaging another user enum: - EMAIL example: EMAIL default: EMAIL UserMessage: description: A message to another user, optionally including a response action oneOf: - $ref: "#/components/schemas/SimpleMessage" - $ref: "#/components/schemas/RenewRequest" discriminator: propertyName: _type mapping: models.SimpleMessage: "#/components/schemas/SimpleMessage" models.RenewRequest: "#/components/schemas/RenewRequest" example: { "_type": "models.SimpleMessage", "subject": "message from your vet", "message": "Hello world", "detail": "do not reply", } SimpleMessage: description: a simple message with no action from one user to another type: object required: [_type, from, to, subject, message] properties: _type: type: string description: identifies the UserMessage subtype example: models.SimpleMessage from: $ref: "#/components/schemas/UserNumber" to: $ref: "#/components/schemas/UserNumber" subject: type: string description: subject line for the message message: type: string format: html description: the message example: Hello world detail: type: string format: html RenewRequest: description: request renewal of a prescription that has expired or run out of refills (or may do so soon). required: [_type, subject, message, prescription] allOf: - $ref: "#/components/schemas/SimpleMessage" - properties: prescription: type: string description: identifier of prescription requested for renewal example: LhSWzi5HQ0JmZgR9 extend: type: string format: duration default: PT183D example: PT183D refill: type: integer description: number of refills requested default: 0 example: 3 Remedy: description: directions for a proposed solution to a problem oneOf: - $ref: "#/components/schemas/RestrictionRemedy" - $ref: "#/components/schemas/LinkRemedy" - $ref: "#/components/schemas/SubstituteLabelClaimRemedy" - $ref: "#/components/schemas/PromiseRemedy" - $ref: "#/components/schemas/JsonRemedy" discriminator: propertyName: _type mapping: models.RestrictionRemedy: "#/components/schemas/RestrictionRemedy" models.LinkRemedy: "#/components/schemas/LinkRemedy" models.SubstituteLabelClaimRemedy: "#/components/schemas/SubstituteLabelClaimRemedy" models.PromiseRemedy: "#/components/schemas/PromiseRemedy" models.JsonRemedy: "#/components/schemas/JsonRemedy" example: { "_type": "models.RestrictionRemedy", "title": "exCode", "message": "exMessage", "detail": "exDetail", } RemedyBase: description: the base data common to all the polymorphic Remedy subtypes type: object required: [_type, title, message] properties: _type: type: string description: >- identifies the Remedy subtype as shown in the Remedy discriminator mapping, like `models.RestrictionRemedy` title: type: string description: a short descriptive name of the Remedy message: type: string description: a longer description of the Remedy RestrictionRemedy: description: Adds `detail` to the protocol instructions in the `Restrictions` section. allOf: - $ref: "#/components/schemas/RemedyBase" - type: object required: [detail] properties: detail: type: string example: { "_type": "models.RestrictionRemedy", "title": "exCode", "message": "exMessage", "detail": "exDetail", } LinkRemedy: description: Adds `detail` to the protocol instructions in the `Restrictions` section. allOf: - $ref: "#/components/schemas/RemedyBase" - type: object required: [detail] properties: detail: type: string SubstituteLabelClaimRemedy: description: ?. allOf: - $ref: "#/components/schemas/RemedyBase" - type: object required: [substitutes] properties: substitutes: type: array items: type: integer PromiseRemedy: description: Adds Promise to the protocol. allOf: - $ref: "#/components/schemas/RemedyBase" - type: object required: [promise] properties: promise: $ref: "#/components/schemas/Promise" JsonRemedy: description: ?. allOf: - $ref: "#/components/schemas/RemedyBase" - type: object required: [detail] properties: detail: type: object SuccessfulLogin: description: User object and generated auth token type: object properties: user: $ref: "#/components/schemas/User" token: type: string description: >- add this token in X-Auth-Token header to authenticate future requests example: >- eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzMmFXUmxja2xFSWpvaVkzSmxaR1Z1ZEdsp3Y205MmFXUmxja3RsZVNJNkluUmxjM1JXVDFJaWZRPT0iLCJpc3MiOiJwbGF5LXNpbGhvdWV0dGUiLCJle***... filePolicy: type: string description: policy object for use in embedded image files, expires in 24 hr example: 3da8c83495cb00d21690d00de5611d9a fileSignature: type: string description: signature for file policy object example: eyJleHBpcnkiOjE1Nzg3NTY2MDIsIm1MDAwMDAwfQ== wsTicket: type: string description: token to set up a websocket connection example: eyJleHBpcnkiOjE2MDIsIm1heFNpemUiOjEwMDAwMDAwfQ== x-postman-variables: - type: save name: token path: .token Error: type: object description: error response per RFC 7807 required: [title, status] properties: errorType: type: string description: the type of error example: Duplicate entry 'testVOR2' for key 'userid.uname_idx' title: type: string description: A brief, human-readable message about the error example: Processing Error status: type: integer description: HTTP status code example: 400 detail: type: string description: a human-readable description of the specific error example: java.sql.SQLIntegrityConstraintViolationException instance: type: string description: a URI that identifies the specific occurrence of the error example: /login/log/abc123 ProtocolShare: description: share a protocol with another VOR User type: object properties: pxId: type: integer description: the `id` identifier of a Protocol example: 1 shareTo: type: integer description: ID f a VOR User who may use the Protocol identified by pxId example: 2 clonable: description: >- whether User identified by `shareTo` has permission to create a clone and modify the clone type: boolean default: false example: true ProtocolStatus: type: string description: > status markers for protocols, in order of normal usage flow: - UNKNOWN: initial status when a protocol is being designed - VALIDATED: currently not used, for use when a validation process is implemented - PRESCRIBED: after a protocol has been prescribed for at least one client - INITIATED: after a protocol has been initiated (i.e., has one or more Cases) - RECALLED: protocol may no longer be prescribed and existing prescriptions are recalled - DEPRECATED: protocol has been "deleted" by the owner enum: - PRESCRIBED - VALIDATED - INITIATED - DEPRECATED - RECALLED - DECLINED - UNKNOWN example: PRESCRIBED PrescriptionStatus: type: string description: > status markers for prescriptions, in order of normal usage flow: - UNKNOWN: initial status when a protocol is being designed - VALIDATED: currently not used, for use when a validation process is implemented - REQUESTED: - PRESCRIBED: after a protocol has been prescribed for at least one client - INITIATED: after a protocol has been initiated (i.e., has one or more Cases) - RECALLED: protocol may no longer be prescribed and existing prescriptions are recalled - DEPRECATED: protocol has been "deleted" by the owner enum: - REQUESTED - PRESCRIBED - VALIDATED - INITIATED - DEPRECATED - RECALLED - DECLINED - UNKNOWN example: PRESCRIBED Instructions: description: instructions to execute a protocol type: object properties: considerations: description: things to consider before choosing this protocol and in using it type: string format: html example:

This is just an example, not a real protocol.

restrictions: description: restrictions that apply to using this protocol type: string format: html example:

Not for use on real animals.

dothis: description: what to do in executing this protocol type: string format: html example:

Examinations to perform

recordthis: description: what to record when executing this protocol type: string format: html example:

record every step in your notebook.

success: description: what to expect if all goes well type: string format: html example:

All problems are gone

failure: description: what may indicate things are this protocol is not working type: string format: html example:

One or more problems remain

references: description: references for further information type: string format: html example: Wikipedia CaseDefinition: description: >- information used at the time of case selection to determine whether a particular protocol may be enrolled and the protocol initiated for a particular animal or group of animals (the Case). The Case may be enrolled with the Protocol **only** if the Case meets all requirements of the CaseDefinition and none of the prohibitions. Other information may be advisory, and used at the discretion of the person doing enrollment. type: object properties: pxId: type: number requireID: type: boolean description: the Case must include specific ID/s of animal/s to be enrolled default: false example: false requireMOR: type: boolean description: >- if true, the MOR enrolling the Case must be identified with a Signature default: false example: false contraindications: description: considerations that prohibit or suggest against use of this Protocol type: string format: html default: "" example:

prohibited in animals older than than 24 months

medical: description: medical considerations in selecting and implementing this Protocol type: string format: html example: if fever is present, consider Protocol 12345 instead. economic: description: economic considerations in selecting and implementing this Protocol type: string format: html default: "" example: >- culling should be considered as an alternative, as milk production is unlikely to return to normal after treatment note: description: optional note type: string format: html default: "" example:

overcrowding may be contributing to issues

Comment: type: object required: - comment properties: userId: description: set null or zero if User wishes to be anonymous type: integer example: 1 default: null public: description: if false, comment is private to site managers type: boolean example: false default: false comment: description: user's comment type: string example: some comment Degree: description: an academic degree qualifying a User as a veterinarian type: object required: - school - year properties: school: type: string description: institution granting the degree example: University of *** year: type: string description: year granted example: 1999 license: description: veterinary license number type: string example: 12345 license-state: type: string description: state or province granting the license example: Maine confirmVet: type: boolean description: confirm the user is a veterinarian default: false example: true FDASpecies: type: string description: >- a class of animals recognized by the FDA. In FDA literature this is called a "species", which conflicts with the typical usage of that word. "fdaSpecies" in the labeling domain usually corresponds with "Eligibility" in the Protocol domain. items: type: string enum: - BeefCattle - Calves, - CalvesNotVeal, - Cats, - Chickens, - ChickensBroilers, - ChickensNotLaying, - ChickensReplacements, - DairyCalves, - DairyHeifers, - DairyCattle, - DairyCattleNonLactating, - Dogs, - Fish, - Goats, - Horses, - Sheep, - Swine, - SwineBreeding, - Turkeys, - TurkeysGrowing, - TurkeysMeatProducing, - TurkeysNotLaying, - Catfish, - Gamebirds, - Llamas, - Salmon, - Emus, - Bison example: BeefCattle Eligibility: description: > A class of animal for which a protocol may be used. Normally the `name` field is all that is shown in the UI, but the `id` is used internally to identify each Eligibility, which should be treated as an immutable object. Changes to the array of Eligibilities in a Protocol are done by changing the array of `id` numbers. Changes to other fields will have no effect at the persistent layer. type: object required: [name, fdaSpecies] properties: id: description: Eligibility ID number type: integer example: 1 name: description: >- A type of animal which is eligible to be treated using a protocol having this Eligibility type: string example: Beef Cattle fdaSpecies: $ref: "#/components/schemas/FDASpecies" Dose: description: a single dose to be given at a specified time type: object required: - product - doseSize - time properties: id: description: ID of animal to be dosed type: string example: Y6768B752 product: description: product name type: string example: wip doseSize: $ref: "#/components/schemas/DrugQuantity" route: description: route of administration type: string example: wip time: type: string format: date-time example: 2020-01-10T22:20:39Z description: wip ISO-8601-formatted datetime added by the server when the dose is saved note: type: string format: html description: additional information aboutthe dose example: exceeding recommended dose can cause something example: >- {"id":"B-123","product":"MiracleMed","size":{"size":2,"unit":"ml"},"route":"intramuscular injection","time":"2020-01-10T10:30:37Z"} SeqSingleDose: description: a single dose required: - _type type: object properties: _type: type: string description: identifies class of SequenceFunction enum: - models.SeqSingleDose example: models.SeqSingleDose SeqPerDay: required: - _type - frequency - totalDoses description: >- a series of equally-spaced doses specified by the total number of doses and an integer number of doses per day type: object properties: _type: type: string description: identifies class of SequenceFunction enum: - models.SeqPerDay example: models.SeqPerDay frequency: type: integer description: how many doses per day default: 1 example: 2 totalDoses: type: integer description: total number of doses default: 1 example: 3 SeqPerDayRange: required: - _type - frequency - minDoses - maxDoses description: >- a series of equally-spaced doses specified by the total number of doses and an integer number of doses per day type: object properties: _type: description: identifies class of SequenceFunction type: string enum: - models.SeqPerDayRange example: models.SeqPerDayRange frequency: type: integer description: how many doses per day default: 1 example: 2 minDoses: type: integer description: minimum total number of doses default: 1 example: 3 maxDoses: type: integer description: maximum total number of doses default: 1 example: 9 SeqInterval: required: - _type - totalDoses - interval description: >- a series of equally-spaced doses specified by the total number of doses and time between sequential doses type: object properties: _type: description: identifies class of SequenceFunction type: string enum: - models.SeqInterval example: models.SeqInterval totalDoses: type: integer description: total number of doses default: 1 example: 3 interval: description: time interval between doses type: string format: duration default: PT8H example: PT8H SeqSeries: description: >- an ordered sequence of doses at times specified as time since initiation of the Protocol required: - _type - intervals type: object properties: _type: description: identifies class of SequenceFunction type: string enum: - models.SeqSeries example: models.SeqSeries intervals: type: array items: description: ISO-8601 duration from initiation or previous dose type: string format: duration example: - PT0S - PT3H - PT24H SequenceFunction: description: function to calculate times for a series of doses oneOf: - $ref: "#/components/schemas/SeqSingleDose" - $ref: "#/components/schemas/SeqPerDay" - $ref: "#/components/schemas/SeqPerDayRange" - $ref: "#/components/schemas/SeqInterval" - $ref: "#/components/schemas/SeqSeries" discriminator: propertyName: _type mapping: models.SeqSingleDose: "#/components/schemas/SeqSingleDose" models.SeqPerDay: "#/components/schemas/SeqPerDay" models.SeqPerDayRange: "#/components/schemas/SeqPerDayRange" models.SeqInterval: "#/components/schemas/SeqInterval" models.SeqSeries: "#/components/schemas/SeqSeries" MassUnit: description: unit of mass or weight type: string enum: - lb - t - dwt - gr - mg - mcg - oz - g - kg example: kg MassQuantity: type: object required: - value - symbol properties: dimension: type: string enum: - Mass description: must be Mass example: Mass value: type: number description: number of units default: 1 example: 50 symbol: $ref: "#/components/schemas/MassUnit" VolumeUnit: description: unit of Volume type: string example: ml enum: - pt - tbsp - µl - nl - oz - dl - ml - qt - L - gal - c - tsp VolumeQuantity: type: object required: - value - symbol properties: dimension: type: string description: must be Volume example: Volume enum: - Volume value: type: number description: number of units example: 3 symbol: $ref: "#/components/schemas/VolumeUnit" DimensionlessUnit: description: dimensionless unit (each) type: string enum: - ea - "%" - dz example: ea DimensionlessQuantity: type: object required: - value - symbol properties: dimension: type: string description: must be Dimensionless example: Dimensionless enum: - Dimensionless value: type: number description: number of units example: 3 symbol: $ref: "#/components/schemas/DimensionlessUnit" DrugQuantity: type: object required: - quantity properties: quantity: oneOf: - $ref: "#/components/schemas/MassQuantity" - $ref: "#/components/schemas/VolumeQuantity" - $ref: "#/components/schemas/DimensionlessQuantity" example: quantity: dimension: Mass value: 3 symbol: oz FixedDoseFunction: type: object description: a fixed quantity expressed in any available unit required: - _type - dose properties: _type: type: string description: class of Dose Function enum: - models.FixedDoseFunction example: models.FixedDoseFunction dose: $ref: "#/components/schemas/DrugQuantity" example: dose: quantity: dimension: Volume value: 3 symbol: ml _type: models.FixedDoseFunction DoseByWeightFunction: type: object description: dose is specified as a quantity per unit of animal weight required: - _type - dose - perUnit properties: _type: type: string description: class of Dose Function example: models.DoseByWeightFunction enum: - models.DoseByWeightFunction dose: $ref: "#/components/schemas/DrugQuantity" perUnit: $ref: "#/components/schemas/MassQuantity" example: dose: quantity: dimension: Volume value: 3 symbol: ml perUnit: dimension: Mass value: 1 symbol: kg _type: models.DoseByWeightFunction LoadingDoseByWeightFunction: type: object description: >- dose is specified as first (loading) dose and following doses per unit of animal weight required: - _type - firstDose - followDose - perUnit properties: _type: type: string description: class of Dose Function example: LoadingDoseByWeightFunction enum: - models.LoadingDoseByWeightFunction firstDose: $ref: "#/components/schemas/DrugQuantity" followDose: $ref: "#/components/schemas/DrugQuantity" perUnit: $ref: "#/components/schemas/MassQuantity" example: perUnit: dimension: mass value: 1 symbol: kg followDose: quantity: dimension: volume value: 3 symbol: ml _type: models.LoadingDoseByWeightFunction firstDose: quantity: dimension: volume value: 6 symbol: ml DrugQuantityRange: type: object required: - min - max properties: min: $ref: "#/components/schemas/DrugQuantity" max: $ref: "#/components/schemas/DrugQuantity" example: min: quantity: dimension: Volume value: 3 symbol: ml max: quantity: dimension: Volume value: 345 symbol: ml DoseRangeFunction: type: object description: >- a range of permissible dose size. The User may select any value within the range (inclusive). required: - _type - range properties: _type: type: string enum: - models.DoseRangeFunction description: class of Dose Function example: models.DoseRangeFunction range: $ref: "#/components/schemas/DrugQuantityRange" DoseRangeByWeightFunction: type: object description: >- dose is specified as a range per unit of animal weight. The User may select any value within the range (inclusive). required: - _type - range - perUnit properties: _type: type: string enum: - models.DoseRangeByWeightFunction description: class of Dose Function example: models.DoseRangeByWeightFunction range: $ref: "#/components/schemas/DrugQuantityRange" perUnit: $ref: "#/components/schemas/MassQuantity" example: perUnit: dimension: Mass value: 1 symbol: kg _type: models.DoseRangeByWeightFunction range: min: quantity: dimension: volume value: 3 symbol: ml max: quantity: dimension: volume value: 2 symbol: ml SizeFunction: description: function to calculate dose size oneOf: - $ref: "#/components/schemas/FixedDoseFunction" - $ref: "#/components/schemas/DoseByWeightFunction" - $ref: "#/components/schemas/LoadingDoseByWeightFunction" - $ref: "#/components/schemas/DoseRangeFunction" - $ref: "#/components/schemas/DoseRangeByWeightFunction" discriminator: propertyName: _type mapping: models.FixedDoseFunction: "#/components/schemas/FixedDoseFunction" models.DoseByWeightFunction: "#/components/schemas/DoseByWeightFunction" models.LoadingDoseByWeightFunction: "#/components/schemas/LoadingDoseByWeightFunction" models.DoseRangeFunction: "#/components/schemas/DoseRangeFunction" models.DoseRangeByWeightFunction: "#/components/schemas/SeqSeries" DoseFunctions: type: object properties: sequenceFunction: $ref: "#/components/schemas/SequenceFunction" sizeFunction: $ref: "#/components/schemas/SizeFunction" Tag: description: keyword or tag for classification type: object required: [id, color, name] properties: id: type: integer description: Tag ID number example: 8 color: type: string description: color code example: "#516cc6" name: type: string maxLength: 15 description: keyword code identifying tag fixes: type: array items: $ref: "#/components/schemas/Remedy" Image: description: Metadata for an image available in an ImageStore type: object required: [id, store, link, name] properties: id: type: integer example: 888 link: type: string thumbnail: type: string keywords: type: array items: type: string name: type: string maxLength: 80 description: description of image store: $ref: "#/components/schemas/ImageStore" ImageStore: description: An online source for images type: object required: [id, uri, name] properties: id: type: integer example: 888 uri: type: string name: type: string maxLength: 80 headers: type: array items: $ref: "#/components/schemas/Header" Header: description: An html header type: object required: [key, value] properties: key: type: string example: X-Auth-Token value: type: string AmducaClass: type: string enum: - ONLABEL - OFFLABEL - UNIDENTIFIED Treatment: description: >- describes a series of one or more doses of a single product in terms of a sizeFunction (which specifies dose quantity) and a SequenceFunction (which specifies when the doses should be given). These functions are polymorphic and may depend on additional data which only is available when a protocol is assigned to a specific Case. For example, the initiation time will likely be needed to calculate the dose sequence and animal weight or other data may be needed to calculate dose size. type: object required: - product - route - dosage - sequenceFunction - sizeFunction properties: id: description: >- key value created by the database. If `id` is null or not present, a new database record will be created. If 'id' matches an existing record in the db, that record will be updated instead. type: string example: B-123 ownerId: description: the `id` key of the VOR User who owns the treatment type: integer example: 0 labelId: description: the `id` key of the label type: integer example: 0 description: description: description of Treatment type: string example: 3.0 ml per kg repeat eligibilities: description: eligibility criteria for potential cases type: array items: $ref: "#/components/schemas/Eligibility" product: description: product name type: string example: MiracleMed _dose: description: transient string representation of `dosage` type: string example: 3.0 ml per kg repeat in 6 hours and again in 24 hours dosage: oneOf: - $ref: "#/components/schemas/DoseId" - $ref: "#/components/schemas/DoseFunctions" route: description: route of administration type: string example: wip sequenceFunction: $ref: "#/components/schemas/SequenceFunction" sizeFunction: $ref: "#/components/schemas/SizeFunction" wtNote: type: string description: withhold note wtMeatHrs: type: integer description: number of hours that must pass between exposure and slaughter example: wip wtMilkHrs: type: integer description: >- number of hours that must pass between exposure and extracting milk for consumption example: wip ndc: description: NADA or ANADA as specified by the FDA type: string example: wip tags: description: keywords for classification type: array items: $ref: "#/components/schemas/Tag" note: type: string format: html description: further information about the treatment example:

a free-form note

amduca: $ref: "#/components/schemas/AmducaClass" DoseId: type: object properties: doseId: type: integer description: key to a label dosage example: wip Diagnosis: description: > a medical diagnosis for which a Protocol may be used. Normally the `name` field is all that is shown in the UI, but the `id` is used internally to identify each Diagnosis, which should be treated as an immutable object. Changes to the array of Diagnoses in a Protocol are achieved by changing the array of `id` numbers. Changes to other fields will have no effect at the persistent layer. type: object properties: id: type: integer description: Diagnosis ID number example: 8 name: type: string maxLength: 255 description: free-form text description of the Diagnosis example: Pain/inflammation (musculoskeletal), treatment PromiseData: description: >- Data completing a Promise, typed according to the Promise _type field. type: object oneOf: - $ref: "#/components/schemas/SeqSingleDose" - $ref: "#/components/schemas/SeqPerDay" - $ref: "#/components/schemas/SeqPerDayRange" - $ref: "#/components/schemas/SeqInterval" - $ref: "#/components/schemas/SeqSeries" discriminator: propertyName: _type mapping: models.SeqSingleDose: "#/components/schemas/SeqSingleDose" models.SeqPerDay: "#/components/schemas/SeqPerDay" models.SeqPerDayRange: "#/components/schemas/SeqPerDayRange" models.SeqInterval: "#/components/schemas/SeqInterval" models.SeqSeries: "#/components/schemas/SeqSeries" required: - _type - promiseId properties: _type: description: Class of Promise type: string example: models.AffirmationPData enum: - models.AffirmationPData - models.BooleanPData - models.StringPData - models.MassPData - models.CategoryPData promiseId: description: id of Promise to which data refers type: integer example: 2345 Promise: description: >- An act which must be executed on or after enrollment of a Case to a Prescription type: object required: [_type, name, query, when] properties: _type: description: Class of Promise type: string example: models.AffirmationPromise enum: - models.AffirmationPromise - models.BooleanPromise - models.StringPromise - models.NumberPromise - models.MassPromise - models.CategoryPromise id: description: database primary key type: integer example: 2345 ownerId: description: id of VOR user with exclusive access to this Promise. If null, Promise is available to all users. type: integer default: null example: 123 name: description: a short name type: string minLength: 8 example: ID promise descrip: description: html description describing in detail what must be done to complete the Promise type: string format: html example: You must give ID for each case enrolled when: description: ISO-8601 duration from initiation when promise must be fulfilled type: string format: duration default: PT0H example: PT24H query: description: A question the user must answer. type: string format: html example: "What is the animal's name or ID?" StringPromise: description: a promise requiring a text response, which may include html allOf: - $ref: "#/components/schemas/Promise" - type: object properties: query: description: A specific question to be answered in completing the promise type: string minLength: 1 example: What is the animal's name or number? response: $ref: "#/components/schemas/PDataString" CategoryPromise: description: identification of animal is required to enroll a case type: object allOf: - $ref: "#/components/schemas/Promise" - type: object properties: query: description: A set of query choices $ref: "#/components/schemas/MapStringString" response: description: the key value referencing a mapped query string $ref: "#/components/schemas/PDataString" BooleanPromise: description: identification of animal is required to enroll a case type: object allOf: - $ref: "#/components/schemas/Promise" - type: object properties: query: description: A specific question to be answered in completing the promise type: string minLength: 1 example: What is the animal's name or number? response: $ref: "#/components/schemas/PDataBoolean" NumberPromise: description: identification of animal is required to enroll a case type: object allOf: - $ref: "#/components/schemas/Promise" - type: object properties: query: description: A specific question to be answered in completing the promise type: string minLength: 1 example: What is the animal's name or number? response: $ref: "#/components/schemas/PDataNumber" AffirmationPromise: description: identification of animal is required to enroll a case type: object allOf: - $ref: "#/components/schemas/Promise" - type: object properties: query: description: A specific question to be answered in completing the promise type: string minLength: 1 example: What is the animal's name or number? response: $ref: "#/components/schemas/PDataNone" MassPromise: description: identification of animal is required to enroll a case type: object allOf: - $ref: "#/components/schemas/Promise" - type: object properties: query: description: A specific question to be answered in completing the promise type: string minLength: 1 example: What is the animal's name or number? response: $ref: "#/components/schemas/PDataMass" Metadata: type: object description: (for future development) properties: key: type: string description: key identifying data example: popularity value: type: string description: value associated with key example: good 1.2 Px: description: >- the flattened subset of a Protocol which can be retrieved from the Px database table alone, without additional queries. type: object required: - ownerId - name - created - edited - status - shareAll properties: id: type: integer description: unique identifier for Protocol example: 0 ownerId: type: integer description: unique identifier for User that owns this Protocol example: 0 name: type: string description: user-friendly identifier for the Protocol example: example protocol shortname: type: string description: Short name for the Protocol example: EXamp created: type: string format: date-time description: ISO-8601 timestamp for Protocol creation example: 2020-01-10T22:20:39Z edited: type: string format: date-time description: ISO-8601 timestamp for Protocol update example: 2020-02-10T22:20:39Z status: $ref: "#/components/schemas/ProtocolStatus" vetNote: type: string description: note visible only to the prescribing vet example: consider prescribing protocol x instead wtMeatHrs: type: integer description: >- number of hours that meat may not be sold for food after last treatment example: 72 wtMilkHrs: type: integer description: >- number of hours that milk may not be sold for food after last treatment example: 72 wtNote: type: string description: note regarding withholding example: Not for use in horses intended for food. considerations: type: string format: html description: >- free-form text specifying special considerations in choosing or using a protocol example:

think first

restrictions: type: string format: html description: free-form text note specifying restrictions example:

not suitable in pregnancy

dothis: type: string format: html description: free-form text specifying actions to be completed example:

execute protocol

recordthis: type: string format: html description: free-form text specifying data to record example: case data success: type: string format: html description: describes a successful outcome of the protocol example:

good

failure: type: string format: html description: describes a failure of the protocol example:

bad

references: type: string format: html description: wip references related to the disease or treatment example: Wikipedia shareAll: type: boolean default: false example: true description: >- switch to determine whether this Protocol may be shared with all VOR users Protocol: description: a veterinary treatment protocol type: object required: - ownerId - name - status - instructions - ownerName properties: id: description: >- key value created by the database. If zero or null a new record will be created. type: integer format: int64 example: 12345 ownerId: description: the `id` key of the VOR User who owns the protocol. type: integer example: 1 ownerName: description: the name of the VOR User who owns the protocol. type: string example: 1 name: description: descriptive name of the protocol type: string example: wip shortname: description: short name for protocol type: string example: wip created: description: >- ISO-8601-formatted datetime added by the server when a Protocol is first saved type: string format: date-time example: 2020-01-10T10:30:37Z edited: description: >- ISO-8601-formatted datetime updated by the server whenever a Protocol is saved type: string format: date-time example: 2020-02-10T10:30:37Z status: $ref: "#/components/schemas/ProtocolStatus" vetNote: description: note visible only to the prescribing vet type: string example: consider prescribing protocol x instead wtMeatHrs: type: number example: 22 description: number of hours that must pass between exposure and slaughter wtMilkHrs: type: number example: 5 description: >- number of hours that must pass between exposure and extracting milk for consumption instructions: $ref: "#/components/schemas/Instructions" shareAll: description: share this protocol with all other vets using the system? type: boolean default: false example: true shareClonable: description: when shared to another vet, may the recipient create and alter a clone? type: boolean default: false example: true caseDefinition: $ref: "#/components/schemas/CaseDefinition" treatments: description: treatments used in this protocol type: array items: $ref: "#/components/schemas/Treatment" tags: description: keywords for classification type: array items: $ref: "#/components/schemas/Tag" diagnoses: description: diagnostic classifiers type: array items: $ref: "#/components/schemas/Diagnosis" eligibilities: description: eligibility criteria for potential cases type: array items: $ref: "#/components/schemas/Eligibility" promises: description: wip type: array items: $ref: "#/components/schemas/Promise" metadata: type: array items: $ref: "#/components/schemas/Metadata" Prescription: type: object required: - vorId - morId - protocol - status properties: user: $ref: "#/components/schemas/User" mor: $ref: "#/components/schemas/User" vor: $ref: "#/components/schemas/User" rxId: type: string description: prescription identifier example: gG3pBCR1GCMKm89c protocol: $ref: "#/components/schemas/Protocol" vorId: type: integer description: ID of VOR user who prescribed this example: 1 morId: type: integer description: ID of MOR this is prescribed for example: 2 refills: type: integer description: number of repeats for this prescription default: 0 example: 0 expiration: type: string format: date-time description: expiration date example: 2021-01-10T10:30:37Z created: type: string format: date-time description: >- description: timestamp when prescribed first saved example: 2021-08-10T10:30:37Z metadata: type: array items: $ref: "#/components/schemas/Metadata" status: $ref: "#/components/schemas/ProtocolStatus" PrescriptionRequest: type: object required: - morId - protocol properties: protocol: $ref: "#/components/schemas/Protocol" morId: type: integer description: ID of MOR this is prescribed for example: 2 refills: type: integer description: number of repeats for this prescription default: 0 example: 0 expiration: type: string format: date-time description: expiration date example: 2021-01-10T10:30:37Z emailToClient: type: boolean description: >- email PDF of prescription to client emailToVOR: type: boolean description: >- email PDF of prescription to precribing doctor metadata: type: array items: $ref: "#/components/schemas/Metadata" status: $ref: "#/components/schemas/PrescriptionStatus" RxWithCases: type: object allOf: - $ref: "#/components/schemas/Prescription" required: [cases] properties: cases: type: array items: $ref: "#/components/schemas/Case" Product: type: object required: [id, nada, name, companyId] properties: id: type: integer companyId: type: integer nada: type: string name: type: string imageURL: type: string insertURL: type: string Case: description: A **_Case_** records use of a **_Prescription_** on an individual animal or group type: object required: - id - rxId - animalId - initiationTime - caseData properties: id: description: Case ID number type: integer format: int64 default: null example: 123 rxId: type: string description: UUID identifying the prescription example: gG3pBCR1GCMKm89c animalId: type: string example: Bossie34 initiationTime: type: string format: date-time note: type: string morId: type: integer caseData: $ref: "#/components/schemas/CaseData" CaseHx: description: A Case History consisting of a Case plust the associated tasks allOf: - $ref: "#/components/schemas/Case" type: object required: - promiseTasks - doseTasks - animalId properties: doseTasks: type: array items: $ref: "#/components/schemas/DoseTask" promiseTasks: type: array items: $ref: "#/components/schemas/PTask" Withhold: $ref: "#/components/schemas/Withhold" TaskStatus: type: string description: task status enum: - REQUIRED - SUGGESTED - DUE - OPTIONAL - OVERDUE - CANCELLED - REJECTED - RECALLED - EXECUTED - UNKNOWN example: REQUIRED MapStringString: type: object description: maps a set of key names to corresponding string values additionalProperties: type: string minLength: 1 PDataNone: type: object required: [_type, promiseId] description: type used where no data is required in a response properties: _type: type: string description: identifies subtype of PData enum: - models.PdataNone example: models.PdataNone promiseId: description: ID of promise to which this data is attached type: integer default: null example: 123 PDataString: type: object required: - promiseId - dat properties: _type: type: string description: identifies subtype of PData enum: - models.PdataString example: models.PdataString promiseId: description: ID of promise to which this data is attached type: integer default: null example: 123 dat: type: string format: html description: data to fulfill the Promise example: full recovery PDataNumber: type: object required: - promiseId - dat properties: _type: type: string description: identifies subtype of PData enum: - models.PdataNumber example: models.PdataNumber promiseId: description: ID of promise to which this data is attached type: integer default: null example: 123 dat: type: number description: data to fulfill the Promise example: 42.3 PDataBoolean: type: object required: - promiseId - dat properties: _type: type: string description: identifies subtype of PData enum: - models.PDataBoolean example: models.PDataBoolean promiseId: description: ID of promise to which this data is attached type: integer default: null example: 123 dat: type: boolean description: data to fulfill the Promise example: true PDataMass: type: object required: - promiseId - dat properties: _type: type: string description: identifies subtype of PData enum: - models.PdataMass example: models.PdataMass promiseId: description: id number of Promise type: integer default: null example: 123 dat: $ref: "#/components/schemas/MassQuantity" PData: description: a task oneOf: - $ref: "#/components/schemas/PDataNone" - $ref: "#/components/schemas/PDataString" - $ref: "#/components/schemas/PDataNumber" - $ref: "#/components/schemas/PDataBoolean" - $ref: "#/components/schemas/PDataMass" discriminator: propertyName: _type mapping: models.PDataNone: "#/components/schemas/PDataNone" models.PDataString: "#/components/schemas/PDataString" models.PDataNumber: "#/components/schemas/PDataNumber" models.PDataBoolean: "#/components/schemas/PDataBoolean" models.PDataMass: "#/components/schemas/PDataMass" #{"id":0,"caseId":23,"vorId":1,"morId":2,"promId":1,"animalId":"Bossie","doAt":"2020-05-16T16:19:12Z","executor":2,"status":"REQUIRED","data":{"_type":"models.PDataString","promiseId":5,"dat":"promise response string"}} DoseByClass: description: dose calculated by class required: - _type - animalClasses type: object properties: _type: type: string description: class of Dose Function enum: - models.DoseByClass example: models.DoseByClass animalClasses: type: array items: $ref: "#/components/schemas/FixedDoseFunction" example: >- {"_type":"models.DoseByClass","animalClasses":[{"animalClass":"Jabberwocks","sizeFunction":{"unit":"mg","size":3.2,"_type":"models.DrugQuantity"}},{"animalClass":"Borogoves","sizeFunction":{"_type":"models.DoseRangeFunction","maxDose":{"size":20,"unit":"ml"},"minDose":{"size":10,"unit":"ml"}}}]} CaseData: description: data for an individual Case oneOf: - $ref: "#/components/schemas/NoData" - $ref: "#/components/schemas/WeightData" - $ref: "#/components/schemas/PreferredDoseData" - $ref: "#/components/schemas/PrefDoseRateData" - $ref: "#/components/schemas/AnimalClassData" discriminator: propertyName: _type mapping: models.NoData: "#/components/schemas/NoData" models.WeightData: "#/components/schemas/WeightData" models.PreferredDoseData: "#/components/schemas/PreferredDoseData" models.PrefDoseRateData: "#/components/schemas/PrefDoseRateData" models.AnimalClassData: "#/components/schemas/AnimalClassData" NoData: type: object description: empty data object properties: _type: type: string description: identifies subtype of CaseData enum: - models.NoData example: models.NoData PreferredDoseData: description: animal identity and preferred dose type: object required: [preferredDose] properties: _type: description: Class of CaseData type: string enum: - models.PreferredDoseData example: models.PrefDoseRateData preferredDose: $ref: "#/components/schemas/DrugQuantity" PrefDoseRateData: description: weight of animal and preferred dose type: object required: [preferredDose, weight] properties: _type: type: string description: identifies subtype of CaseData enum: - models.PrefDoseRateData example: models.PrefDoseRateData weight: $ref: "#/components/schemas/MassQuantity" preferredDose: $ref: "#/components/schemas/DrugQuantity" AnimalClassData: description: data for a class of animals type: object required: [animalClass] properties: _type: description: Class of CaseData type: string enum: - models.AnimalClassData example: models.AnimalClassData animalClass: $ref: "#/components/schemas/AnimalClass" AnimalClass: description: a class of animals and a SizeFunction for dosing that class type: object required: - animalClass - sizeFunction properties: animalClass: type: string description: descrip example: Jabberwocks sizeFunction: $ref: "#/components/schemas/SizeFunction" WeightData: type: object description: specifies animal's weight properties: _type: type: string description: identifies subtype of CaseData enum: - models.WeightData example: models.WeightData weight: $ref: "#/components/schemas/MassQuantity" Withhold: description: a time before which meat or milk may not be sold. type: object required: [id, caseId, animalId, initiated, wtMeatUntil, wtMilkUntil] properties: id: type: integer description: key for withhold caseId: type: integer description: key identifying Case animalId: type: string description: key identifying animal or group example: Bossie initiated: type: string format: date-time description: when the Withhold was initiated wtMeatUntil: type: string format: date-time description: when the Withhold ends for meat products wtMilkUntil: type: string format: date-time description: when the Withhold ends for milk wtNote: type: string description: note on withholding example: not for dairy animals note: type: string description: note AnimalTask: description: a task related to an animal or group of animals oneOf: - $ref: "#/components/schemas/PTask" - $ref: "#/components/schemas/DoseTask" discriminator: propertyName: _type mapping: models.PTask: "#/components/schemas/PTask" models.DoseTask: "#/components/schemas/DoseTask" TaskBase: description: the base data common to all the polymorphic AnimalTask subtypes type: object required: - _type - id - caseId - morId - vorId - doAt - status properties: _type: type: string description: >- identifies the task subtype as shown in the AnimalTask discriminator mapping, like ` models.DoseTask` example: models.Ptask id: description: PTask ID number type: integer format: int64 example: 123 caseId: description: ID number of Case that includes this task type: integer format: int64 example: 123 morId: description: ID of MOR user responsible for execution of this task type: integer format: int64 example: 123 vorId: description: ID of VOR prescribing the task type: integer format: int64 example: 123 animalId: type: string description: ID of animal to which the task applies example: this doAt: description: ISO-8601-formatted datetime when the task should be executed type: string format: date-time example: 2020-01-10T10:30:37Z executor: description: ID of Person who should execute the task type: integer format: int64 example: 123 status: $ref: "#/components/schemas/TaskStatus" PTask: description: A Task required to fulfill a Promise allOf: - $ref: "#/components/schemas/TaskBase" required: [promId] properties: promId: description: ID of Promise type: integer format: int64 example: 123 data: $ref: "#/components/schemas/PData" DoseTask: allOf: - $ref: "#/components/schemas/TaskBase" required: [product, route, dose] properties: product: description: product to be administered type: string example: Calcium gluconate 23% route: description: route of administration type: string example: IV dose: $ref: "#/components/schemas/DrugQuantity" LabelClaim: type: object required: - id - fdaSpecies - diagnosis - dxId - product - route - wtMeatHrs - wtMilkHrs - isRx properties: id: type: integer description: unique identifier for label example: 1 fdaSpecies: $ref: "#/components/schemas/FDAspecies" diagnosis: type: string description: label diagnosis example: pain (colic), symptomatic treatment dxId: type: integer description: id of label diagnosis example: 2002 product: type: string description: product trade name example: Prevail™ Flunixin Meglumine Injection productId: type: integer description: unique identifier for the product described example: 1315018 _dose: type: string description: free-form text note on dosage example: 3.0 ml per kg repeat in 6 hours and again in 24 hours route: type: string description: route of administration example: intr-corporeal sequenceFunction: $ref: "#/components/schemas/SequenceFunction" sizeFunction: $ref: "#/components/schemas/SizeFunction" doseNote: type: string format: html description: test note about dose example: THis can contain html tags wtMeatHrs: description: meat withholding in hours type: integer example: 22 wtMilkHrs: type: integer description: milk withholding in hours example: 5 wtNote: type: string description: note on withholding example: not for dairy animals ndc: type: string description: FDA NADA or ANADA number example: 200-308 generic: type: string description: generic name for product example: OXYTETRACYCLINE isRx: type: boolean description: Is this a prescription drug? default: true Login: type: object required: [userid, message] x-reviewed: JLE 2022/5/30 properties: userId: type: integer example: 1 default: null when: type: string format: date-time description: timestamp of login, entered example: 2020-01-10T10:30:37Z message: type: string example: some message FDAspecies: type: array description: >- a class of animals recognized by the FDA. In FDA literature this is called a "species", which conflicts with the typical usage of that word. "fdaSpecies" in the labeling domain usually corresponds with "Eligibility" in the Protocol domain. items: type: string enum: - BeefCattle - Calves - CalvesNotVeal - Cats - Chickens - ChickensBroilers - ChickensNotLaying - ChickensReplacements - DairyCalves - DairyHeifers - DairyCattle - DairyCattleNonLactating - Dogs - Fish - Goats - Horses - Sheep - Swine - SwineBreeding - Turkeys - TurkeysGrowing - TurkeysMeatProducing - TurkeysNotLaying - Catfish - Gamebirds - Llamas - Salmon - Emus - Bison - Other - Unidentified example: ChickensBroilers GreenbookDrug: required: - ndc - proprietary - nonProp - ingredients - labeler - productType - marketCat - appNumber - link - status - lastChanged type: object properties: ndc: type: string description: FDA NDC number example: 0010-3495 proprietary: type: string description: proprietary name example: Bio-Mycin 200 nonProp: description: generic name type: string example: OXYTETRACYCLINE ingredients: type: string description: ingredient or ingredients example: OXYTETRACYCLINE labeler: type: string description: name of labeler example: Boehringer Ingelheim Vetmedica, Inc. productType: type: string description: type of product example: OTC ANIMAL DRUG marketCat: type: string description: market category example: ANADA appNumber: type: string description: application number example: ANADA200008 link: type: string description: public link to fda label example: https://www.accessdata.fda.gov/spl/data/c9491ada-6813-4548-8872-57bb38a58feb/c9491ada-6813-4548-8872-57bb38a58feb.xml status: type: integer description: FDA status example: 0 lastChanged: type: string format: date-time description: date of last label change example: 2020-05-16T16:19:12Z HelpScreen: required: - key - msg type: object properties: key: type: string msg: description: the html message to display type: string format: html lang: type: string description: language code examples: prescription: value: '{"protocol":{"ownerId":1,"name":"example protocol","shortname":"EXamp","created":"2020-01-10T22:20:39Z","edited":"2020-01-10T22:20:39Z","status":"SAVED","wtMeatHrs":44,"wtMilkHrs":12,"withholdNote":"be sure to wt","instructions":{"considerations":"think first","restrictions":"always","dothis":"execute protocol","recordthis":"case data","success":"good","failure":"bad","references":"ref"},"shareAll":false,"shareClonable":false,"caseDefinition":{"pxId":0,"medical":"really sick","economic":"lotsa cash"},"treatments":[{"id":0,"ownerId":0,"description":"sample w 30d meat","note":"this is an off-label Treatment","eligibilities":[{"id":1,"name":"Beef Cattle","fdaSpecies":"BeefCattle"}],"tags":[{"id":-1,"color":"#516cc6","name":"EXAMPLE"}],"labelId":null,"product":"MiracleMed","_dose":"3.0 ml per kg starting at initiation, repeat in 6 hours and again in 1 day","route":"intr-corporeal","sequenceFunction":{"_type":"models.SeqSeries","intervals":["PT6H","PT24H"]},"sizeFunction":{"_type":"models.DoseByWeightFunction","dose":{"quantity":{"dimension":"Volume","value":3,"symbol":"ml"}},"perUnit":{"dimension":"Mass","value":1,"symbol":"kg"}},"wtMeatHrs":null,"wtMilkHrs":null,"wtNote":null}],"tags":[{"id":-1,"color":"#516cc6","name":"EXAMPLE"}],"diagnoses":[{"id":8,"name":"Pain/inflammation (musculoskeletal), treatment"}],"eligibility":{"id":1,"name":"Beef Cattle","fdaSpecies":"BeefCattle"},"promises":[]},"vorId":1,"morId":2,"refills":3,"status":"PRESCRIBED","metadata":[],"rxId":"gG3pBCR1GCMKm89c","created":"2020-01-10T10:30:37Z"}' summary: Rx.example 1/7/22 protocol: value: '{"ownerId":1,"name":"example protocol","shortname":"EXamp","created":"2020-01-10T22:20:39Z","edited":"2020-01-10T22:20:39Z","status":"SAVED","wtMeatHrs":44,"wtMilkHrs":12,"withholdNote":"be sure to wt","instructions":{"considerations":"think first","restrictions":"always","dothis":"execute protocol","recordthis":"case data","success":"good","failure":"bad","references":"ref"},"shareAll":false,"shareClonable":false,"caseDefinition":{"pxId":0,"medical":"really sick","economic":"lotsa cash"},"treatments":[{"id":0,"ownerId":0,"description":"sample w 30d meat","note":"this is an off-label Treatment","eligibilities":[{"id":1,"name":"Beef Cattle","fdaSpecies":"BeefCattle"}],"tags":[{"id":-1,"color":"#516cc6","name":"EXAMPLE"}],"labelId":null,"product":"MiracleMed","_dose":"3.0 ml per kg starting at initiation, repeat in 6 hours and again in 1 day","route":"intr-corporeal","sequenceFunction":{"_type":"models.SeqSeries","intervals":["PT6H","PT24H"]},"sizeFunction":{"_type":"models.DoseByWeightFunction","dose":{"quantity":{"dimension":"Volume","value":3,"symbol":"ml"}},"perUnit":{"dimension":"Mass","value":1,"symbol":"kg"}},"wtMeatHrs":null,"wtMilkHrs":null,"wtNote":null}],"tags":[{"id":-1,"color":"#516cc6","name":"EXAMPLE"}],"diagnoses":[{"id":8,"name":"Pain/inflammation (musculoskeletal), treatment"}],"eligibility":{"id":1,"name":"Beef Cattle","fdaSpecies":"BeefCattle"},"promises":[]}' summary: Protocol.example 1/7/22 comment: value: '{"userId":0,"public":false,"created":"2020-01-10T22:20:39Z","comment":"this is an anonymous private comment"}' summary: Comment.example 1/7/22 address: value: '{"userId":3,"busName":"Some Business","address1":"123 Main St.","town":"Anytown","state":"Any State","zip":"12345","country":"USA"}' summary: Address.example 1/7/22 user: value: '{"id":3,"uname":"testTOR","userType":"TOR","email":"testTOR@dairysight.com","firstname":"Test","lastname":"Tech"}' summary: User.example 1/7/22 dose: value: '{"product":"MiracleMed","dose":{"quantity":{"dimension":"Volume","value":3,"symbol":"ml"}},"route":"intramuscular injection","animalId":"Bossie","doAt":"2020-05-16T16:19:12Z","executor":2,"status":"REQUIRED"}' summary: Dose.example 1/7/22 treatment: value: '{"id":0,"ownerId":0,"description":"sample w 30d meat","note":"this is an off-label Treatment","eligibilities":[{"id":1,"name":"Beef Cattle","fdaSpecies":"BeefCattle"}],"tags":[{"id":-1,"color":"#516cc6","name":"EXAMPLE"}],"labelId":null,"product":"MiracleMed","_dose":"3.0 ml per kg starting at initiation, repeat in 6 hours and again in 1 day","route":"intr-corporeal","sequenceFunction":{"_type":"models.SeqSeries","intervals":["PT6H","PT24H"]},"sizeFunction":{"_type":"models.DoseByWeightFunction","dose":{"quantity":{"dimension":"Volume","value":3,"symbol":"ml"}},"perUnit":{"dimension":"Mass","value":1,"symbol":"kg"}},"wtMeatHrs":null,"wtMilkHrs":null,"wtNote":null}' summary: Treatment.example 1/7/22 volumeQ: value: '{"quantity":{"dimension":"Volume","value":3,"symbol":"ml"}}' summary: VolumeQ.example 1/7/22 massQ: value: '{"quantity":{"dimension":"Mass","value":3,"symbol":"oz"}}' summary: MassQ.example 1/7/22 dimensionlessQ: value: "" summary: DimensionlessQ.example 1/7/22