Practitioner-relationship-instance questions

I’m working on using the APIs to get the content of the egpcur file.

I’m using the practitioner and practitioner-relationship-instance codesystems which I think is the best way to do it?

The results I’m getting from practitioner-relationship-instance include practitioner codes in a few different formats. Some examples are:

98I2980E
82A3657E
ZW821700
G6368744

I think those starting with G are GP codes and others relate to other job roles?

Does the API allow filtering so that it only returns GP codes? It’s not a problem, if not, I can just filter the results after download. Apologies if I missed it in the documentation. My current api request is as follows:

{
“resourceType”: “Parameters”,
“parameter”: [
{
“name”: “valueSet”,
“resource”: {
“resourceType”: “ValueSet”,
“compose”: {
“inactive”: true,
“include”: [
{
“system”: “https://digital.nhs.uk/services/organisation-data-service/CodeSystem/practitioner-relationship-instance”
}
]
}
}
},
{
“name”: “activeOnly”,
“valueBoolean”: false
},
{
“name”: “property”,
“valueString”: “*”
},
{
“name”: “count”,
“valueInteger”: 100
}
]
}

Also does the practitioner-relationship-instance support requesting records that have been updated since a certain date?

Thanks

Hi
You can limit the practitioner records returned using the practitioner type code of ‘PGP’ and use the Last Change Date parameter to return only amended records since a specific date.

The parent practice code is available from the practitioner codesystem, you only need the practitioner-relationship-instance codesystem if you need join/left dates. Further info here:
Organisation Data Service : Practitioner Membership

For example:

Post: https://sandbox.api.service.nhs.uk/organisation-data-terminology-api/fhir/ValueSet/$expand
Body:
{
“resourceType”: “Parameters”,
“parameter”: [
{
“name”: “valueSet”,
“resource”: {
“resourceType”: “ValueSet”,
“compose”: {
“inactive”: false,
“include”: [
{
“system”: “https://digital.nhs.uk/services/organisation-data-service/CodeSystem/practitioner”,
“filter”: [
{
“property”: “type”,
“op”: “=”,
“value”: “PGP”
},
{
“property”: “ME1”,
“op”: “=”,
“value”: “L83016”
},
{
“property”: “lastChangeDate”,
“op”: “=”,
“value”: “gt2026-01-01”
}

                        ]
                    }
                ]
            }
        }
    },
    {
        "name": "activeOnly",
        "valueBoolean": true
    },
    {
        "name": "property",
        "valueString": "*"
    }
]

}

Thanks, Laura

Thanks for your help.

I am trying to get the join/left dates. If a practitioner-relationship-instance record changes does the lastupdated field on the associated practitioner record get updated?

Yes, if any part of the practitioner record is changed (name, parent affiliation etc) the LastChangeDate will be updated.

Thanks for your help.

Thanks for your help with this so far. Apologies, I have another question.

I’m using this call to get the startdate for the practitioner:

{
“resourceType”: “Parameters”,
“parameter”: [
{
“name”: “valueSet”,
“resource”: {
“resourceType”: “ValueSet”,
“compose”: {
“inactive”: true,
“include”: [
{
“system”: “https://digital.nhs.uk/services/organisation-data-service/CodeSystem/practitioner-additional-attribute”,
“filter”:[
{
“property”: “practitionerID”,
“op”: “=”,
“value”: “G3505742”
}
]
}
]
}
}
},
{
“name”: “activeOnly”,
“valueBoolean”: false
},
{
“name”: “property”,
“valueString”: “*”
},
{
“name”: “count”,
“valueInteger”: 1
}
]
}

I think that’s the correct field for the ‘open date’ column from the EGPCur report?

For some practitionerIDs, including G3505742, I get a startdate in the API response and it looks to match the EGPCUR report exported from https://www.odsdatasearchandexport.nhs.uk/

For some records, for example practitionerID G3505766, there doesn’t look to be a start date in the API response but there is a date in the EGPCUR report.

Can you advise what I’m doing wrong?

Thanks

Hi
The GP practitioner start date (as per egpcur) is taken from the GNC (additional attribute) start date. You will need to set an additional parameter as well as practitionerID:

“property”: “practitionerAttributeID”,
“op”: “=”,
“value”: “1”

Organisation Data Service : General Practitioners