Post Alert

The SCR API provides a create operation, Post Alert, to allow GP Systems to record TMS Event Service (TES) Alerts centrally.

Endpoint
https://[baseURL]/AuditEvent
Query
POST https://[baseUrl]/AuditEvent 
Payload
SCR-Alert-AuditEvent 

Post Alert sequence diagram

AuditEvent

Example Post Alert call

POST https://[baseUrl]/AuditEvent /HTTP/1

Example Post Alert call payload

{
    "resourceType": "AuditEvent",
    "id": "example",
    "extension":  [
        {
            "url": "https://fhir.nhs.uk/StructureDefinition/Extension-SCR-NotificationMessage",
            "valueString": "Alert: Permission to view override 1C03CF4F-D404-4D76-B192-4F81727059F6"
        }
    ],
    "type": {
        "system": "https://fhir.nhs.uk/CodeSystem/SCR-AlertType",
        "code": "1",
        "display": "Create LR (Self Claimed)"
    },
    "subtype":  [
        {
            "system": "https://fhir.nhs.uk/CodeSystem/SCR-AlertReason",
            "code": "1",
            "display": "Access made in the public interest"
        }
    ],
    "recorded": "2020-11-13T00:00:00+00:00",
    "agent":  [
        {
            "who": {
                "identifier": {
                    "system": "https://fhir.nhs.uk/Id/nhs-number",
                    "value": "9999999998"
                }
            },
            "requestor": false
        },
        {
            "who": {
                "identifier": {
                    "system": "https://fhir.nhs.uk/Id/ods-organization-code",
                    "value": "T10101"
                }
            },
            "requestor": false
        },
        {
            "role":  [
                {
                    "text": "General Practitioner"
                }
            ],
            "who": {
                "identifier": {
                    "system": "https://fhir.nhs.uk/Id/sds-user-id",
                    "value": "T10101"
                }
            },
            "requestor": false
        }
    ],
    "source": {
        "observer": {
            "identifier": {
                "system": "https://fhir.nhs.uk/Id/nhsSpineASID",
                "value": "227319907548"
            }
        }
    },
    "entity":  [
        {
            "what": {
                "identifier": {
                    "value": "1C03CF4F-D404-4D76-B192-4F81727059F6"
                }
            }
        }
    ]
}

Example Post Alert success response

Returns a minimal response, i.e. just the successful http status, on successful write to the repository.

HTTP/1.1 201 Created
Date: Tue, 24 Aug 2020 11:00:00 GMT
Content-Type: application/fhir+json

Example Post Alert failure response

Returns an operationOutcome on failure. Error handling is in line with Spine Error Codes II [NB: internal Confluence link].

HTTP/1.1 400 Bad Request
Date: Tue, 24 Aug 2020 11:00:00 GMT
Content-Type: application/fhir+json
{
  "resourceType": "OperationOutcome",
  "id": "27242108-f2ee-429c-a387-ace44bb87f40",
  "issue": [
    {
      "severity": "error",
      "code": "invalid",
      "details": {
        "text": "Bad Request"
      }
    }
  ]
}