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.