Example Web Service Calls for Developers

Example Web Service Calls for Developers

The VetView API Calls can be used in your own custom applications, beyond the examples VetView has provided.  These small projects can be developed in-house for special tasks, such as simplified UI input on a touchscreen in a clean room, or interfaces for outside machines not directly supported by VetView.

If you do not have a development team at your university capable of creating your web service application, contact VetView to discuss options for personalized development.

If you do have a development team in house, this page can serve as a brief tutorial for using our API service calls in your custom application.

The VetView API can be interacted with using cURL, a REST client (such as Postman), or through your own custom code.

cURL is available via Windows PowerShell, the macOS Terminal, and the Command Line for most Linux flavors.

API calls can be tested using the built-in Swagger documentation.

When testing a call the cURL is generated and shown.

Command Types

The VetView API accepts 4 commands for completing tasks.
These commands are GET, POST, PUT, & DELETE.

NOTE: All URL parameters must be encoded.

GET Commands

GET calls are used for retrieving information.

POST Commands

POST calls are used for creating or updating a record.
In the VetView API calls that include a body use POST.

PUT Commands

PUT calls are used to perform actions.

DELETE Commands

DELETE calls are used for deleting records.

Example calls

Example cURL command for GET

Get list of episodes

curl -X 'GET' \
  'http://127.0.0.1/VetView/api/hospital/episodes/list?patientId=225101&statuses=OPEN%2C%20ADMIT%2C%20DISCHARGE&max=30&offset=0&order=desc' \
  -H 'accept: application/json' \
  -H 'auth_token: authtoken'

Results consist of a number of records and a list of episodes

{
  "count": 1,
  "results": [
    {
      "reason": "Looks funny",
      "patientId": 225101,
      "attendingRole": null,
      "fieldServiceYN": "N",
      "animalsRisk": null,
      "asaq": false,
      "lastUpdated": "2019-12-07T13:23:12Z",
      "dateCreated": "2019-12-07T13:18:17Z",
      "ownerName": "Abe's",
      "referenceNumber": null,
      "avmaVisitYN": "N",
      "dischargeDate": null,
      "holdOnPatientList": false,
      "locationId": null,
      "unitId": null,
      "id": 847695,
      "clientIdList": null,
      "deficiencyNoticeSent": false,
      "admittingDvmId": null,
      "appointmentType": "Abe's",
      "lastUpdatedBy": "ABE",
      "patientName": "Taffrail Lord Plushbottom",
      "unitName": "Abe's Unit",
      "codedDate": null,
      "examineDate": null,
      "isDeficient": false,
      "appointmentTypeId": null,
      "apptDate": null,
      "version": 16,
      "attendingDVMId": null,
      "censusYN": "Y",
      "hospitalizedYN": "N",
      "closedDate": null,
      "admittingUnitId": null,
      "newPatientCaseNo": null,
      "admitDate": null,
      "animalsSeen": null,
      "patientDeceasedYN": "N",
      "typeId": null,
      "locationStartDate": "2019-12-07T13:23:11Z",
      "openDate": "2019-12-07T13:23:11Z",
      "status": {
        "enumType": "org.vetview.core.enums.HospitalEpisodeStatus",
        "name": "OPEN"
      }
    }
  ]
}

Example cURL command for POST

Adding alert to episode

curl -X 'POST' \
  'http://127.0.0.1/VetView/api/hospital/episodes/createAlert?id=847695&username=JOHN_DOE_1' \
  -H 'accept: application/json' \
  -H 'auth_token: authtoken' \
  -H 'Content-Type: application/json' \
  -d '{
  "episodeId": 847695,
  "commentMessage": "Alert me about this",
  "alertYN": "Y",
  "alertTypeId": 0,
  "createdBy": "creation user",
  "lastUpdatedBy": "update user"
}'

Results:

{
  "comments": null,
  "data": null,
  "id": 184923,
  "error": false,
  "message": "Successful Save",
  "version": 0,
  "statusCode": 200
}

Example cURL command for PUT

Admit episode

curl -X 'PUT' \
  'http://127.0.0.1/VetView/api/hospital/episodes/admitEpisode?id=847695&updateCensus=true&locationId=938&ignoreCreditStatusWarning=false&username=JOHN_DOE_1' \
  -H 'accept: application/json' \
  -H 'auth_token: authtoken'

Results:

{
  "comments": null,
  "data": null,
  "id": 847695,
  "error": false,
  "message": "Successful Save",
  "version": 19,
  "statusCode": 200
}

Example cURL command for DELETE

Deleting Client Link for episode

curl -X 'DELETE' \
  'http://127.0.0.1/VetView/api/hospital/episodes/deleteClientLink?id=4868048' \
  -H 'accept: application/json' \
  -H 'auth_token: authtoken'

Results:

{
  "comments": null,
  "data": null,
  "id": 4868048,
  "error": false,
  "message": "Successful Delete",
  "version": null,
  "statusCode": 200
}



 

VetView Wiki

Most recent releases of VetView:  Version 4.1.3 Hotfix (Released 2/16/2024)

Contents