Actions4
- Patient Actions
Overview
This node integrates with the Gravity API to perform operations on healthcare-related resources. Specifically, for the Patient Patch operation, it updates existing patient records by sending partial data changes to the API. This is useful in scenarios where you need to modify patient information such as name, birth date, contact details, or metadata without replacing the entire patient record.
Practical examples include:
- Updating a patient's address or phone number after they move or change contact info.
- Correcting or adding missing demographic details like middle name or gender.
- Adding tags or metadata to patient records for categorization or filtering.
Properties
| Name | Meaning |
|---|---|
| Tenant | Identifier for the tenant or organization under which the patient record exists. |
| Id | Unique identifier of the patient record to be patched (updated). |
| First Name | Patient's first name. |
| Last Name | Patient's last name. |
| Middle Name | Patient's middle name. |
| Birth Date | Patient's date of birth (string format). |
| Gender | Patient's gender. |
| Address | Patient's physical address. |
| Generated At | Timestamp or date string indicating when the patient record was generated. |
| Language | Patient's preferred language. |
| Link | JSON array representing links related to the patient (e.g., related records or external refs). |
| Tag | Tags associated with the patient for categorization or filtering. |
| Telecom | JSON array containing telecom/contact details such as phone numbers or emails. |
| Metadata | JSON object holding additional metadata about the patient. |
| Identifiers | JSON array of identifiers related to the patient (e.g., medical record numbers). |
| Do Not Contact | Boolean flag indicating if the patient should not be contacted. |
| Updated | Timestamp or date string indicating when the patient record was last updated. |
| Updated By | Identifier or name of the user who last updated the patient record. |
Output
The node outputs a JSON object representing the updated patient record as returned by the Gravity API after the patch operation. The structure reflects the patient resource with all fields that were patched and any additional data returned by the API.
If an error occurs during the API call, the output will contain an error field with details about the failure.
No binary data output is involved in this operation.
Dependencies
- Requires an API key credential for authenticating requests to the Gravity API.
- Uses AWS Signature Version 4 signing for request authentication.
- The base URL for the API is
https://api.dev.jit.care. - Axios HTTP client is used for making requests.
- The node expects proper configuration of credentials within n8n to access the Gravity API securely.
Troubleshooting
Common issues:
- Missing or invalid API credentials will cause authentication failures.
- Providing an incorrect patient ID will result in "not found" errors from the API.
- Malformed JSON input for properties like
link,telecom,metadata, oridentifierscan cause parsing errors. - Attempting to patch with unsupported or empty fields may lead to API validation errors.
Error messages:
- Errors returned from the API are passed through in the output's
errorfield. - Network or connectivity issues will throw exceptions caught and returned similarly.
- Unsupported HTTP methods or misconfigured operations will raise application errors internally.
- Errors returned from the API are passed through in the output's
To resolve these:
- Verify API credentials and permissions.
- Ensure patient IDs exist and are correct.
- Validate JSON inputs before passing them to the node.
- Check network connectivity and API endpoint availability.
Links and References
- Gravity API Documentation (assumed base URL)
- AWS Signature Version 4 Signing Process
- Axios HTTP Client