getODS: getODS

Description Usage Arguments Value Notes See Also Examples

View source: R/getODS.R

Description

Extracts summary ODS data for multiple organisations from the NHS Digital ODS ORD API into a data frame.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
getODS(
  Name = "All",
  PostCode = "All",
  LastChangeDate = "All",
  Status = "All",
  PrimaryRoleId = "All",
  NonPrimaryRoleId = "All",
  OrgRecordClass = "All",
  UseProxy = FALSE
)

Arguments

Name

Search organisations based on name. Organisations that contain the argument string in their name are returned.; quoted string; default "All" applies no filter

PostCode

Search organisations based on postcode. Organisations that contain the argument string in their postcode are returned.; quoted string; default "All" applies no filter

LastChangeDate

Search for organisations based on their last changed date. Date must be in format "YYYY-MM-DD". The search is greater than or equal to. Dates are restricted to 185 days from present.; quoted string; default "All" applies no filter

Status

Search for organisations based on their active status. Arguments can be "Active" or "Inactive".; quoted string; default "All" applies no filter

PrimaryRoleId

Search for organisations based on their primary role codes.; quoted string; default "All" applies no filter

NonPrimaryRoleId

Search for organisations based on their non primary role codes.; quoted string; default "All" applies no filter

OrgRecordClass

Search for organisations based on their record class. Arguments can be "RC1" or "RC2".; quoted string; default "All" applies no filter

UseProxy

Whether to use proxy settings to connect to the directory.spineservices.nhs.uk/ODSAPISuite API. If TRUE, the function will look for a UseProxy.csv file in the package library extdata directory. The file must contain a single row of comma separated headers (url, port, username, password, auth) and a second row specifying the values to be passed to each of these httr::use_proxy() function arguments. All Argument headers must be present, leave values blank if not required. Quoted string, default FALSE

Value

returns a data.frame containing the following details for the organisations that meet the filter specifications: Name, Organisation ID, Status, Organisation Record Class, Postcode, Last Change Date, Primary Role ID, Non primary Role ID, Primary Role Description, Organisation Link (API endpoint URL for full organisation record)

Notes

View the NHS Digital ODS API Implementation Guide at https://developer.nhs.uk/library/identifiers/ods-ord-api-implementation-guide/

View the NHS Digital ODS API Suite at https://directory.spineservices.nhs.uk/ODSAPISuite

See Also

Other odsR package functions: OrgRelLkpGP(), OrgRelLkpNHSTrust(), addorgname(), getODSfull()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# return summary organisation data for all organisations with 'Woodseats' in their name
getODS(Name="Woodseats")

# return summary organisation data for all organisations
# with 'Woodseats Medical Centre' in their name - two options to handle spaces:
getODS(Name="Woodseats_Medical_Centre")
getODS(Name="Woodseats Medical Centre")

# return summary organisation data for all currently active GP practices:
# commented out as takes too long to run with package build
# getODS(Status="Active", PrimaryRoleId = "RO177", NonPrimaryRoleId = "RO76")

PublicHealthEngland/odsR documentation built on March 4, 2021, 1:57 a.m.