Configure NilRead as a FHIR patient resource service
NilRead can be configured as a FHIR patient resource service. This allows authorized NilRead users to query or update patient information using FHIR. NilRead provides a token endpoint for authorization and authentication. NilRead users must have the FhirAccess privilege to obtain an access token to query the patient information and the FhirUpdate privilege to use the access token to update patient information.
NilRead FHIR service configuration requires the following steps.
- Enable and configure the NilRead FHIR service.
- Grant the FhirAccess and FhirUpdate privileges to users that need access to the NilRead FHIR token and patient endpoints.
Enable and configure NilRead FHIR service settings
You can configure general settings for the token endpoint and patient resource endpoint. Note that the FhirConfig privilege is required to access the FHIR settings page.
- Select Settings. Under Devices, select FHIR.
- In the FHIR Services area, select Enable.
- Enter information in the following sections, then select Save.
Token
- Address Token endpoint provided by NilRead.
- Authentication:
- Authorization grant type NilRead uses the Client Credentials grant type.
- Client authentication type Authentication method.
- Access token life span Length of authentication period in minutes.
Patient
- Address Patient resource endpoint provided by NilRead.
- Search:
- Max number of results Maximum number of patient records to return.
- Default patient identifier assigner Value to return if the patient record does not contain a patient identifier assigner.
- Overwrite patient ID issuer Overwrite the existing patient identifier issuer with the value specified for the Default patient identifier assigner.
- When update patient, delete original studies Whether to delete the patient’s original studies after the patient information is updated.
Grant users access to the NilRead FHIR service
Assign the following privileges to each user that is allowed to access the NilRead FHIR service. For details on assigning privileges, see Manage users.
- FhirAccess Acquire access tokens from the NilRead token endpoint and query patient information on the patient endpoint.
- FhirUpdate Modify patient information using the patient endpoint with the access token.
Example of a client application with the NilRead FHIR service
The following code shows a simplified example of updating patient information in NilRead using the FHIR-Net-API library. For more information, see the FHIR specification and the FHIR-Net-API documentation.
var client = new FhirClient("[NilRead base URL]/fhir");
var pat = client.Read<Patient>("Patient/1");
pat.Resource.Name.Add(HumanName.ForFamily("John").WithGiven("Doe"));
client.Update<Patient>(pat);