Animals
DataVet holds a central list of animals. You must submit an animal from this list when adding medical records. It is recommended you cache this list within your app and update periodorically.
Requests on this page assume you are sending the "Authorization" header.
For each of the requests below, you'll need to specify:
- Farm ID replacing :farmId with the farms' id in the methods below
Fetch
GET /api/farms/:farmId/animals
This returns all the animals for a particlular farm, paged by the default value of 20.
Get a Specific Animal
GET /api/farms/:farmId/animals/:animalId
Replacing :animalId with the animal id.
Advanced Search
POST /api/farms/:farmId/animals/search
{
"identification_numer": "UK123456725729"
}
This returns all matching animals, paged by the default value of 20.
Create
At present, you cannot create animals as Datavet should hold all registered animals for your farms.
Update
PUT /api/farms/:farmId/animals/:animalId
You are able to send partial data - i.e. just sending the defra_breed_code would only update the defra_breed_code.
Special notes: reproductive_state, milk_yield_level and diet_intesity cannot be set - you can only push new values onto the array. The most recent value is displayed by the API.
Delete
At present, you cannot delete animals.
Data
Field Name | Type | Notes |
---|---|---|
_id | A unique identifier for the animal | |
date_joined_farm | Date | The date the animal joined the farm, if blank assumed since DOB |
date_left_farm | Date | The date the animal left the farm, if blank assumed still on the farm |
date_of_birth | Date | The animals date of birth |
species | String | Term e.g. Cattle, Pig, Sheep, Chicken, Turkey |
defra_breed_code | String | Defra Breed Code |
gender | String | Male/Female |
age | String | Age of animal |
reproductive_state | [Object] | |
- name | String | If Female: heifer, In-calf heifer, early lactation (with lactation number here and elsewhere), peak lactation, mid lactation, lactating in calf, mixed lactations, dry, finishing for meat as heifer, cull for meat. If Male: Castrated, Entire |
- date | Date | The date of this reproductive status, if empty we assume today's date. |
milk_yield_level | String | |
- name | String | Low, Medium, High |
- date | Date | The date of this milk yeild level, if empty we assume today's date. |
diet_intensity | String | |
- name | String | Extensive Grazing, Intensive Grazing, Maximum intensity concentrates etc. |
- date | Date | The date of this diet intesity status, if empty we assume today's date. |
herd_id | Number | ID of stock group, if any |
stock_id | Number | ID if herd or flock group being treated and managed as one |
identification_number | String | The ear tag of the animal |
deceased_record | Object | (If the animal is deceased, this holds the reason for death) |
- created_at | Date | Defaults to time of creation |
- updated_at | Date | Defaults to last time of edit |
- date_of_death | Date | Date of the animals death |
- cull_reason | String | Reason for cull |
- cull_fate | String | Fate of the cull |
- mortality_reason | [String] | An array of causes for the animals death |