General Concepts

This section gives an overview of the general concept and object used in creating the Empego’s event framework.

Wrapper

Event schema

{
  "id": "UUID",
  "createdAt": "UTC_TIMESTAMP",
  "eventType": "STRING",
  "operation": "STRING",
  "tenantKey": "UUID",
  "data": {} // JSON OBJECT
}

Description

Field Type Description
id UUID This is the event identifier. Should be used for idempotency.
createdAt UTC Timestamp Timestamp of when the event was created. The format of the timestamp is yyyy-MM-dd HH:mm:ss.SSS and is always in UTC.
eventType String The event type that is sent. This can be, as an example, consultation, follow-up, patient, etc. The event types are described below.
operation String Type of operation that created the event. As an example was it a newly created resource or an updated resource. Currently, Empego only supports create and update.
tenantKey UUID The Empego tenant identifier.
data JSON Object JSON Object representing the resource that the event was created for:

Event type:

Example

{
    "id": "3f0af711-c5e6-488a-a4bc-91f6e5009d79",
    "createdAt": "2024-03-22 20:41:57.750",
    "eventType": "followup",
    "operation": "update",
    "tenantKey": "11f81012-9519-11ee-XXXX-0244cd4cfa84",
    "data": {...}
}

External Patient Key

Patients can have multiple external keys depending on the subsystem. Empego supports this in the event by providing a list of the sub-system and the keys. This external key is not something that Empego manages, it stores it in the way that is provided to us by the sub-system.

[
  {
    "subSystem": "STRING",
    "key": "STRING"
  }
]
Field Type Description
subSystem String The subsystem where the patient key comes from.
key String The key from the subsystem that is associated with Empego’s patient

Example:

[
  {
    "subSystem": "Drugstore Inc.",
    "key": "ae0461f6-e2ab-XXXX-96915f8df40d"
  }
]

Identifiable Localized Object

An object that is used when we have an internal enum for state generation. Empego will provide the localized values used throughout the Empego frontend services.

{
  "id": "STRING",
  "en": "ENGLISH_STRING",
  "fr": "FRENCH_STRING"
}
{
  "id": "STRING",
  "en": "ENGLISH_STRING",
  "fr": "FRENCH_STRING"
}
Field Type Description
id String Empego’s internal state
en String English localized string
fr String French localized string

Example

{
  "id": "ASSISTED",
  "en": "Patient was assisted",
  "fr": "Suivi assisté avec un employé"
}

Localized Object

An object for localized information.

{
  "en": "ENGLISH_STRING",
  "fr": "FRENCH_STRING"
}
Field Type Description
en String English localized string
fr String French localized string

Example

{
  "en": "Hypertension (HTN)",
  "fr": "Hypertension artérielle (HTA)"
}

Follow-up reminder data

An object that shows on which date the follow-up reminder is sent

{
  "followUpReminderSentAt": "YYYY-MM-DD HH:MM:SS.mmm"
}
Field Type Description
followUpReminderSentAt UTC Timestamp Date at which the follow-up reminder wassent