Client code for the generation and submission of AuditEvent resources in accordance with the Interweave auditing specification (https://interweavedigital.com/wp-content/uploads/2024/06/YHCR-Design-Paper-009.-Auditing-v1.3.pdf)
npm install @synanetics/interweave-audit-client@synanetics/interweave-audit-clientGenerates FHIR AuditEvents in line with the Interweave Specification
``typescript
import { HttpAuditEventClient } from '@synanetics/interweave-audit-client';
const client = new HttpAuditEventClient({
url: 'https://data-consumer.fhir.nhs.uk/AuditEvent',
odsCode: 'ABC01',
dataConsumer: {
name: 'ABC NHS Trust',
identifier: [{
code: 'participant01',
system: 'https://yhcr.nhs.uk/Id/participant-id',
}]
}
});
const jwt = {
sub: '...',
// other claims
}
const tokenResponse = await fetch('http://iam.server.com', { body: JSON.stringify(jwt) });
const auditEventResponse = await client.submitAuthenticationEvent({
response: tokenResponse,
jwt,
requestUrl: 'http://iam.server.com',
});
// auditEventResponse will be the result of submitting the AuditEvent to the server, usually an
// AuditEvent FHIR resource.
``
- When associating a Topic to a BigQuery Subscription and selecting the "use table schema" option, this will respect the required/nullable status of each of the columns, meaning you won't be able to leave out "LastUpdated", for example, from your BigQuery writes (they will silently fail). As such, the BigQuery schema should have any fields that need to be defaulted temporarily set to nullable whilst the Subscription is being created.
- "JSON" type BigQuery columns need to be stringified, otherwise inserts silently fail.