OrgRelLkpGP: OrgRelLkp

Description Usage Arguments Value Notes See Also Examples

View source: R/OrgRelLkp_GPPrac.R

Description

Generates an organisational lookup table from the NHS Digital ODS ORD API based on organisational relationship data.

Usage

1
2
3
4
5
6
7
8
OrgRelLkpGP(
  PrimaryRole,
  NonPrimaryRole = "All",
  RelTypes = "None",
  RelPrimaryRoles = "None",
  FromDate,
  UseProxy = FALSE
)

Arguments

PrimaryRole

The Primary Role code for organisations to be included in the lookup; quoted string, no default

NonPrimaryRole

The Non Primary Role code for organisations to be included in the lookup, or 'All' to include all Non Primary Role Codes; quoted string, default = "All"

RelTypes

The Named Relationship Types for related organisations to be included in the lookup, or 'None' to exclude Relationships from output; character vector, default = "None"

RelPrimaryRoles

The Primary Role Ids for related organisations to be included in the lookup, or 'None' to exclude relationships from output; character vector, default = "None"

FromDate

The effective date from which to include Organisations operational on or after; character string in the format "yyyy-mm-dd", no default

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 of Organisation codes, names, start dates and end dates plus the start and end dates that the organisation was in the specified role and related organisation codes & names and associated start and end dates for the relationship.

Notes

This function is experimental and has only been thoroughly QAd for use with the arguments presented in the first example in order to generate GP Practice to CCG lookup tables.

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: OrgRelLkpNHSTrust(), addorgname(), getODSfull(), getODS()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# return basic NHS Trust lookup without relationships to other organisation types
## Not run: 
#' OrgRelLkp(PrimaryRole = "RO197",FromDate="2013-04-01")

## End(Not run)

# return GP Practice to CCG Lookup to include all organisations effective on or after 01-04-2013
## Not run: 
OrgRelLkpGP(PrimaryRole    = "RO177",
          NonPrimaryRole = "RO76",
          RelTypes       = "RE4",
          RelPrimaryRoles = "RO98",
          FromDate       = "2013-04-01")

## End(Not run)

# return GP practice to CCG/PCT Lookup to include all organisations effective on or after 01-04-2012
## Not run: 
OrgRelLkpGP("RO177","RO76","RE4",c("RO98","RO179"),"2012-04-01")

## End(Not run)

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