Skip to main content

Handling topics

In this section, we will learn how to manage Topics. A Topic is similar to a chat channel and establishes the link between the activeParticipants involved in the text exchange. A Topic can reference a Patient, one or more Observation(s) (optional), and/or one or more Condition(s) (optional).

Roles

There are 3 levels of roles available for participants of a Topic:

  • PARTICIPANT
  • ADMIN
  • OWNER

Participant

A PARTICIPANT is a user who has access to the Topic and can write messages. They can also read messages from other participants.

Admin

An ADMIN is a user who has access to the Topic and can write messages. They can also read messages from other participants. Additionally, they can add or remove participants to/from the Topic.

Owner

An OWNER is a user who has access to the Topic and can write messages. They can also read messages from other participants. Additionally, they can add or remove participants to/from the Topic and change the roles of other participants.

There is a special aspect to the OWNER role. The user who creates the Topic have to be assigned with the OWNER role. The OWNER is the only level of participant who cannot leave the Topic. They must assign the OWNER role to another participant in order to leave the Topic.

Creating a Topic

To create a Topic, you must use the create function. To do this, you will need to provide the following information:

  • participants, the participants of the Topic. Do not include the user creating the Topic in this list.
  • description, a description of the Topic. Can be considered as a title.
  • patient, the Patient related to the Topic. Optional.
  • observations, the Observations related to the Topic. Optional. You must provide the patient if you are providing observations.
  • conditions, the Conditions related to the Topic. Optional. You must provide the patient if you are providing conditions.
  • tags, the Tags related to the Topic. Optional.
  • codes, the Codes related to the Topic. Optional.
const participants = [
{
participant: user1DataOwnerId,
role: TopicRole.OWNER,
},
{
participant: user2DataOwnerId,
role: TopicRole.PARTICIPANT,
},
]

const patient = await newPatientInstance()
const condtition = await newConditionInstance(patient)
const observation = await newObservationInstance(patient)

const sharedPatient = await api.patientApi.giveAccessTo(patient, user2DataOwnerId)
const sharedCondition = await api.conditionApi.giveAccessTo(condtition, user2DataOwnerId)
const sharedObservation = await api.observationApi.giveAccessTo(observation, user2DataOwnerId)

const newTopic = await api.topicApi.create(
participants,
'Topic name',
sharedPatient,
new Set([sharedCondition]), // This could also be a Set of Condition ids
new Set([sharedObservation]), // This could also be a Set of Observation ids
undefined, // Tags
undefined, // Codes
)
newTopic
{
"id": "6f81d3bc-0de5-4263-9128-807611db6a6a",
"rev": "1-262100999a9357605e6475dc3c9b5321",
"created": 1700058626237,
"modified": 1700058626238,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic name",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"43d5599e-7f59-4411-b21a-8d814f0986dd"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "y9Rn7OL3ha+AZuPy5SjNeIvQCtEegBKTIioknvRmLannb2LxVB4rtusWVpEkPCrit2yavOUvpKq/5ON+KvOJSEb3Qnn2LKI2LHj/KPKmZk2ghvUmXDv+V3mT4fwkMLPDKNNdlLiruCnNirfnWMFWe6j41lVCAlBc0dbNKSPkm2ObN0VyzmILNQyOqW8UOndZFFgcFnSUdx1HvkZYWSDi3EeeQIJ9KN+KeB0kri7U80U=",
"tags": {}
}
}

Managing Participants

Adding a Participant

To add a participant to a Topic, you must use the addParticipant function. To do this, you'll need to provide the following information:

  • topic, a reference to the Topic to which you wish to add a participant.
  • participant, a reference to the participant you want to add to the Topic, along with their role.
// Initial context
const patient2: Patient = await newPatientInstance()
const condition2: Condition = await newConditionInstance(patient)
const observation2: Observation = await newObservationInstance(patient)

const topicToAddNewParticipant: Topic = await api.topicApi.create(
[
{
participant: user1DataOwnerId,
role: TopicRole.OWNER,
},
],
'Topic name',
patient2,
new Set([condition2]),
new Set([observation2]),
)

const newParticipant = {
ref: user2DataOwnerId,
role: TopicRole.PARTICIPANT,
}

const updatedTopicWithNewParticipant = await api.topicApi.addParticipant(
topicToAddNewParticipant,
newParticipant,
)
updatedTopicWithNewParticipant
{
"id": "a73d3aa4-b032-4757-b14d-ae1946abccd2",
"rev": "3-f10dc69438bbd6dd4a50493c586ca37f",
"created": 1700058626363,
"modified": 1700058626363,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic name",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"3a0f3dc0-d5c9-4aec-8574-4e5a13185632"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "zs9IxXeExCBrEKN88yN1V4d1fcGMlFAD+2aw0yKZ1ipAyun9I1HmASr3FPRWDp2ZBpxJLkwWNiVAdbMIceFMPeZSJ91vW/Fg+raaV2ouva7h/0H/ARAv3wtpu0keHiIOlth2dd9fYVdulgaX8EalII7S33iNqqyGXppV2MRUyKVTPyHRkavjZx0GNMJhOl41kZKnf9F6MoiwtIvOf+Zn9fWEzngfIF1i05+qvMIN3fQ=",
"tags": {}
}
}

You'll also need to manually share access to the different entities referenced in the Topic:

const updatedPatient = await api.patientApi.giveAccessTo(patient2, user2DataOwnerId)
const updatedCondition = await api.conditionApi.giveAccessTo(condition2, user2DataOwnerId)
const updatedObservation = await api.observationApi.giveAccessTo(observation2, user2DataOwnerId)

Removing a Participant

To remove a participant from a Topic, you must use the removeParticipant function. To do this, you'll need to provide the following information:

  • topic, a reference to the Topic from which you wish to remove a participant.
  • participant, a reference to the participant you want to remove from the Topic.
const participantToRemove = user2DataOwnerId

const updatedTopicWithRemovedParticipant = await api.topicApi.removeParticipant(
updatedTopicWithNewParticipant,
participantToRemove,
)
updatedTopicWithRemovedParticipant
{
"id": "a73d3aa4-b032-4757-b14d-ae1946abccd2",
"rev": "4-c300c551aa9473d133e575b0ab151478",
"created": 1700058626363,
"modified": 1700058626363,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic name",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"3a0f3dc0-d5c9-4aec-8574-4e5a13185632"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "zs9IxXeExCBrEKN88yN1V4d1fcGMlFAD+2aw0yKZ1ipAyun9I1HmASr3FPRWDp2ZBpxJLkwWNiVAdbMIceFMPeZSJ91vW/Fg+raaV2ouva7h/0H/ARAv3wtpu0keHiIOlth2dd9fYVdulgaX8EalII7S33iNqqyGXppV2MRUyKVTPyHRkavjZx0GNMJhOl41kZKnf9F6MoiwtIvOf+Zn9fWEzngfIF1i05+qvMIN3fQ=",
"tags": {}
}
}

Leaving a Topic

To leave a Topic, you can use the removeParticipant function. However, there's a shortcut through the leave function. To do this, you'll need to provide the following information:

  • topic, a reference to the Topic you wish to leave.
const topicThatWillBeLeft = await api.topicApi.create(participants, 'Topic that will be left')

const updatedTopicThatHaveBeenLeftByUser2 = await api2.topicApi.leave(topicThatWillBeLeft) // user2 leaves the topic
updatedTopicThatHaveBeenLeftByUser2
{
"id": "8910dfb8-8ed1-45a3-9985-c40940ecac18",
"rev": "2-634ee720a4ae421a49fa549be04c204f",
"created": 1700058626540,
"modified": 1700058626540,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic that will be left",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "uAZ3w98ffJP89VtMgx6pQs8vmxxYOHxRX9zFRaw7lQVoPVbKZyZOgkc/mJd1RjMMRJxbDh0dUPNttI6AyhrRHQ==",
"tags": {}
}
}
info

You'll still be able to read messages already received from the Topic after leaving it. However, new messages will no longer be accessible to you.

Managing Observations and Conditions Linked to a Topic

You can manage the Observations and Conditions linked to a Topic at any time. For this, you must use the addObservations, removeObservations, addConditions, and removeConditions functions.

Adding Observations

To add Observations to a Topic, you must use the addObservations function. You will need to provide the following information:

  • topic, a reference to the Topic to which you want to add Observations.
  • observations, a list of references to the Observations you want to add to the Topic.
const patient3: Patient = await newPatientInstance()

const topicToShareServices = await api.topicApi.create(
participants,
'Topic to share services',
patient3,
)

const observations = [await newObservationInstance(patient3)]

const sharedObservations = [
...(await Promise.all(
participants.map(async ({ participant: dataOwnerId }) => {
return await api.observationApi.giveAccessToMany(observations, dataOwnerId)
}),
)),
].flat()

const topicWithNewlySharedObs = await api.topicApi.addObservations(
topicToShareServices,
sharedObservations,
)
topicWithNewlySharedObs
{
"id": "0a51ce59-a7fe-445d-951c-f1c0ce3eabb8",
"rev": "2-7a3cc70244037dc80e3ce7552497f769",
"created": 1700058626624,
"modified": 1700058626624,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic to share services",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"cbb6f6eb-c0a1-4045-bf24-0c7c525c2b9f"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "n9//p7Ku83IleVOGrEAUSJeRswrrQhDar3VKFGK3F0iJ4VpQ204eE5uMot6CM1XKMdI5a6t2UchAWhjg/NUPq2i2cc4WrzbdRlVYkBgB0bxFxXjSAodOFN/qlphz9TN3GFobL6QAFaZlb5u8I8nsrDS67xhIz5RMi2/ddMC7uVGQ02EdXRoidO9ewTNW3kUAxTkdeLjfJC23Bosye2nXLKLe1JDasN7prtxhuMKkg+AjbVU2ctABFYdPNJUJdBw2",
"tags": {}
}
}

As you can see, you will need to manually share access to the Observations with the Topic participants before being able to add them to the Topic.

Removing Observations

To remove Observations from a Topic, you must use the removeObservations function. You will need to provide the following information:

  • topic, a reference to the Topic from which you want to remove Observations.
  • observations, a list of references to the Observations you want to remove from the Topic.
const topicWithRemovedObs = await api.topicApi.removeObservations(
topicWithNewlySharedObs,
sharedObservations,
)
topicWithRemovedObs
{
"id": "0a51ce59-a7fe-445d-951c-f1c0ce3eabb8",
"rev": "3-49d1e34da0699fd2a11a1a1753cae120",
"created": 1700058626624,
"modified": 1700058626624,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic to share services",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"cbb6f6eb-c0a1-4045-bf24-0c7c525c2b9f"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "wbgy8Zvrye1Y5FRY3JPdSmbU4USMn5A7o7oRJHomXCN3fRP9BSyx4Wvl34lKp6VxDfDp4OOxT9EYXqdDtEyu1uCoaZ1oMfvZ9vbrjKY4dyI7QEOW7KdcfDDTo7TvdYhNYz9y2fYkjFGMvzkraLfuzQ==",
"tags": {}
}
}
danger

The Observations are not deleted from the platform. They are simply unlinked from the Topic. However, the sharing of access to the Observations is not removed.

Adding Conditions

To add Conditions to a Topic, you must use the addConditions function. You will need to provide the following information:

  • topic, a reference to the Topic to which you want to add Conditions.
  • conditions, a list of references to the Conditions you want to add to the Topic.
const topicToShareHealthElements = await api.topicApi.create(
participants,
'Topic to share health elements',
patient, // Patient created on the create topic step
)

const condition3 = await newConditionInstance(patient)
const newlySharedCondition = await api.conditionApi.giveAccessTo(condition3, user2DataOwnerId)

const topicWithNewlySharedConditions = await api.topicApi.addConditions(
topicToShareHealthElements,
[newlySharedCondition],
)
topicWithNewlySharedConditions
{
"id": "b56ff426-bae6-4f3b-9499-9aecdf6ac547",
"rev": "2-64603d6a2a1e4137af2c048f2eb65393",
"created": 1700058626748,
"modified": 1700058626748,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic to share health elements",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"43d5599e-7f59-4411-b21a-8d814f0986dd"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "OEYIILKW9GVDjiXbxSNyAH/US5tfI6gEsO13KhHyYVQzwWKFm25D5c0Zue7QYgESvO+LH7rEA3yK6Sc1jAbvBGtsHycdofLpocLCSfbuv41w4pOuHyhFBYDfg5sfOkuSrXy/qV+K3Rricx8CxBX/ucRQPSidHXW7hry1qxSFbvhdaFkMzDON9xnLaSOqBxbwKqW6UJlbzFUxhYuLOiofzA==",
"tags": {}
}
}

As you can see, you will need to manually share access to the Conditions with the Topic participants before being able to add them to the Topic.

Removing Conditions

To remove Conditions from a Topic, you must use the removeConditions function. You will need to provide the following information:

  • topic, a reference to the Topic from which you want to remove Conditions.
  • conditions, a list of references to the Conditions you want to remove from the Topic.
const topicWithRemovedConditions = await api.topicApi.removeConditions(
topicWithNewlySharedConditions,
[newlySharedCondition],
)
topicWithRemovedConditions
{
"id": "b56ff426-bae6-4f3b-9499-9aecdf6ac547",
"rev": "3-2e9ff11298b13d8e41da99fdb6fea80f",
"created": 1700058626748,
"modified": 1700058626748,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic to share health elements",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"43d5599e-7f59-4411-b21a-8d814f0986dd"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "/9h1c0aXM1yf8ZmPVI7fQxU+KSEvF7+9uee8c2cEYmm/t07t6NnxKG/rHf7+Ur0NDwWpwC3ywNWIld5O/RFaQb2zYDSnoLBIYVangISTZx5C9gz9TZl5V4L+HFDz2tK4cxtxBoPj9igkKFouEUwYeA==",
"tags": {}
}
}
danger

The Conditions are not deleted from the platform. They are simply unlinked from the Topic. However, the sharing of access to the Conditions is not removed.

Retrieving Topics

Retrieve a Topic by Its ID

To retrieve a Topic by its ID, you must use the get function. For this, you will need to provide the following information:

  • id, the ID of the Topic you wish to retrieve.
const topicToBeFetched = await api.topicApi.create(participants, 'Topic to be fetched')

const topicId = topicToBeFetched.id!

const topicById = await api.topicApi.get(topicId)
topicById
{
"id": "cab70726-f2d3-4950-ac00-9bd991b8de67",
"rev": "1-3682a74da191b547eaa3f3a45cc73e25",
"created": 1700058626866,
"modified": 1700058626866,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic to be fetched",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Skogs4W6yC7w4NM+/rBzZyj4HqhHRNwlb+PbSz3A+y2kzKmg2+W9pVFIe7l/OOZt5lNFfzmsFV515jUGYO6u+w==",
"tags": {}
}
}

Filtering Topics

To filter Topics, you must use the filterBy function. For this, you will need to provide the following information:

  • filter, an object of type Filter<Topic> that will allow you to filter Topics based on various criteria.

You can use the TopicFilter builder to construct your filter.

const filter = await new TopicFilter(api).forSelf().byParticipant(user1DataOwnerId).build()

const paginatedList = await api.topicApi.filterBy(filter)
paginatedList
{
"rows": [
{
"id": "0a51ce59-a7fe-445d-951c-f1c0ce3eabb8",
"rev": "3-49d1e34da0699fd2a11a1a1753cae120",
"created": 1700058626624,
"modified": 1700058626624,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic to share services",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"cbb6f6eb-c0a1-4045-bf24-0c7c525c2b9f"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "wbgy8Zvrye1Y5FRY3JPdSmbU4USMn5A7o7oRJHomXCN3fRP9BSyx4Wvl34lKp6VxDfDp4OOxT9EYXqdDtEyu1uCoaZ1oMfvZ9vbrjKY4dyI7QEOW7KdcfDDTo7TvdYhNYz9y2fYkjFGMvzkraLfuzQ==",
"tags": {}
}
},
{
"id": "6f81d3bc-0de5-4263-9128-807611db6a6a",
"rev": "1-262100999a9357605e6475dc3c9b5321",
"created": 1700058626237,
"modified": 1700058626238,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic name",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"43d5599e-7f59-4411-b21a-8d814f0986dd"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "y9Rn7OL3ha+AZuPy5SjNeIvQCtEegBKTIioknvRmLannb2LxVB4rtusWVpEkPCrit2yavOUvpKq/5ON+KvOJSEb3Qnn2LKI2LHj/KPKmZk2ghvUmXDv+V3mT4fwkMLPDKNNdlLiruCnNirfnWMFWe6j41lVCAlBc0dbNKSPkm2ObN0VyzmILNQyOqW8UOndZFFgcFnSUdx1HvkZYWSDi3EeeQIJ9KN+KeB0kri7U80U=",
"tags": {}
}
},
{
"id": "8910dfb8-8ed1-45a3-9985-c40940ecac18",
"rev": "2-634ee720a4ae421a49fa549be04c204f",
"created": 1700058626540,
"modified": 1700058626540,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic that will be left",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "uAZ3w98ffJP89VtMgx6pQs8vmxxYOHxRX9zFRaw7lQVoPVbKZyZOgkc/mJd1RjMMRJxbDh0dUPNttI6AyhrRHQ==",
"tags": {}
}
},
{
"id": "a73d3aa4-b032-4757-b14d-ae1946abccd2",
"rev": "4-c300c551aa9473d133e575b0ab151478",
"created": 1700058626363,
"modified": 1700058626363,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic name",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"3a0f3dc0-d5c9-4aec-8574-4e5a13185632"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "zs9IxXeExCBrEKN88yN1V4d1fcGMlFAD+2aw0yKZ1ipAyun9I1HmASr3FPRWDp2ZBpxJLkwWNiVAdbMIceFMPeZSJ91vW/Fg+raaV2ouva7h/0H/ARAv3wtpu0keHiIOlth2dd9fYVdulgaX8EalII7S33iNqqyGXppV2MRUyKVTPyHRkavjZx0GNMJhOl41kZKnf9F6MoiwtIvOf+Zn9fWEzngfIF1i05+qvMIN3fQ=",
"tags": {}
}
},
{
"id": "b56ff426-bae6-4f3b-9499-9aecdf6ac547",
"rev": "3-2e9ff11298b13d8e41da99fdb6fea80f",
"created": 1700058626748,
"modified": 1700058626748,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic to share health elements",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [
"43d5599e-7f59-4411-b21a-8d814f0986dd"
],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "/9h1c0aXM1yf8ZmPVI7fQxU+KSEvF7+9uee8c2cEYmm/t07t6NnxKG/rHf7+Ur0NDwWpwC3ywNWIld5O/RFaQb2zYDSnoLBIYVangISTZx5C9gz9TZl5V4L+HFDz2tK4cxtxBoPj9igkKFouEUwYeA==",
"tags": {}
}
},
{
"id": "ca26a486-33e5-4199-80f2-f2c593aaa1a6",
"rev": "1-d174e550a7ebff55a318e650130a1b40",
"created": 1700058613018,
"modified": 1700058613018,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Planet Express Delivery Company",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "cKIY9uLsZd8rr/0TIbs6tZxfBWSzXDKWebmAeHNy9pZmEHKaViI0Yn+LB6LMG/69qnI5UdWmQ8yRKLbTIQsTamqnKyTrbelDOjs5KRBbqjc=",
"tags": {}
}
},
{
"id": "cab70726-f2d3-4950-ac00-9bd991b8de67",
"rev": "1-3682a74da191b547eaa3f3a45cc73e25",
"created": 1700058626866,
"modified": 1700058626866,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"tags": {},
"codes": {},
"descr": "Topic to be fetched",
"linkedHealthElements": {},
"linkedServices": {},
"activeParticipants": {},
"systemMetadata": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Skogs4W6yC7w4NM+/rBzZyj4HqhHRNwlb+PbSz3A+y2kzKmg2+W9pVFIe7l/OOZt5lNFfzmsFV515jUGYO6u+w==",
"tags": {}
}
}
]
}

Getting IDs of Filtered Topics

You can also just get the IDs by applying the same filter using a call to matchBy. For this, you will need to provide the following information:

  • filter, an object of type Filter<Topic> that will allow you to filter Topics based on various criteria.
const topicIds = await api.topicApi.matchBy(filter)
topicIds
[
"0a51ce59-a7fe-445d-951c-f1c0ce3eabb8",
"6f81d3bc-0de5-4263-9128-807611db6a6a",
"8910dfb8-8ed1-45a3-9985-c40940ecac18",
"a73d3aa4-b032-4757-b14d-ae1946abccd2",
"b56ff426-bae6-4f3b-9499-9aecdf6ac547",
"ca26a486-33e5-4199-80f2-f2c593aaa1a6",
"cab70726-f2d3-4950-ac00-9bd991b8de67"
]