# How to find out the correct setup for atom feed markers in pacs-integration.

**URL:** <https://talk.openmrs.org/t/how-to-find-out-the-correct-setup-for-atom-feed-markers-in-pacs-integration/13695>\
**Category:** Bahmni\
**Tags:** pacs, bahmni\
**Created:** [October 10, 2017, 9:01am UTC](https://talk.openmrs.org/t/how-to-find-out-the-correct-setup-for-atom-feed-markers-in-pacs-integration/13695 "2017-10-10T09:01:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgevam](https://talk.openmrs.org/letter_avatar/bgevam/32/5_5575768a8748004e209b776fc1b2916d.png) [@bgevam](https://talk.openmrs.org/u/bgevam)\
**Post date:** [October 10, 2017, 9:01am UTC](https://talk.openmrs.org/t/how-to-find-out-the-correct-setup-for-atom-feed-markers-in-pacs-integration/13695/1 "2017-10-10T09:01:09Z")

</div>

Hi.

I have trouble setting up the pacs-integration module on one of my servers. When it comes to setup of the markers, the [guide](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/36700254/Setup+PACS+Integration+module) is not very specific:

> markers table should be set with the latest markers and feed details to avoid it reading from the start. A sample query for the same would look like

Please enter the right values for last\_read\_entry\_id and feed\_uri\_for\_last\_read\_entry.

Now my question:

How do I find out the right values for the two above mentioned columns?

---

<div class="post-metadata">

**Author:** ![binduak](https://talk.openmrs.org/letter_avatar/binduak/32/5_5575768a8748004e209b776fc1b2916d.png) [@binduak](https://talk.openmrs.org/u/binduak)\
**Post date:** [October 11, 2017, 4:48am UTC](https://talk.openmrs.org/t/how-to-find-out-the-correct-setup-for-atom-feed-markers-in-pacs-integration/13695/2 "2017-10-11T04:48:53Z")

</div>

Hi @bgevam,

> [@bgevam](#):
>
> markers table should be set with the latest markers and feed details to avoid it reading from the start

Imagine in a production box where you have lot of patients with radiology orders in OpenMRS database, and then you configure pacs and you start the pacs server. Then markers will start reading all the entires from beginning, which will take a lot of time. In that case we can add the last entry from OpenMRS event\_records table to Pacs markers table as mentioned in the wiki (comparing the `last_read_entry_id` and `feed_uri_for_last_read_entry` from openelis markers table and openmrs events\_tables would give you an idea of the exact values). That way we can avoid reading from the beginning.

If you don’t have too many patients with radiology orders in OpenMRS then you can ignore this step.

---

<div class="post-metadata">

**Author:** ![bgevam](https://talk.openmrs.org/letter_avatar/bgevam/32/5_5575768a8748004e209b776fc1b2916d.png) [@bgevam](https://talk.openmrs.org/u/bgevam)\
**Post date:** [October 11, 2017, 7:50am UTC](https://talk.openmrs.org/t/how-to-find-out-the-correct-setup-for-atom-feed-markers-in-pacs-integration/13695/3 "2017-10-11T07:50:07Z")

</div>

Thank you @binduak, that was quite helpful. The OpenELIS solution is very good. Unfortunatley, OpenELIS is not always part of the planned installation.

I still have problems finding the correct **feed\_uri\_for\_last\_read\_entry**. Would you consider the following practice correct:

```auto
    SELECT max(id), uuid, object FROM event_records;
    +------+--------------------------------------+-----------------------------------------------------------------------------------------------------+
    | id | uuid | object |
    +------+--------------------------------------+-----------------------------------------------------------------------------------------------------+
    | 2136 | 475f91b8-a52d-4572-9ed8-18f46d4a3953 | /openmrs/ws/rest/v1/bahmnicore/bahmniencounter/94a152fe-f371-4172-a426-e02ec974eea2?includeAll=true |
    +------+--------------------------------------+-----------------------------------------------------------------------------------------------------+

```

The value for the **last\_read\_entry\_id** can be found in the uuid column of the last entry it is **475f91b8-a52d-4572-9ed8-18f46d4a3953**.

Now the **FIRST** encounter for the corresponding patient of the **object uuid** must be found.

```sql
    SELECT patient_id FROM encounter WHERE uuid='94a152fe-f371-4172-a426-e02ec974eea2';
    +------------+
    | patient_id |
    +------------+
    | 74 |
    +------------+
    SELECT min(encounter_id) FROM encounter WHERE patient_id=74;
    +--------------+
    | encounter_id |
    +--------------+
    | 24 |
    +--------------+

```

The value for the **feed\_uri\_for\_last\_read\_entry** is **24**. The following query inserts the marker:

```sql
    INSERT INTO markers (feed_uri,last_read_entry_id, feed_uri_for_last_read_entry) VALUES ('http://localhost:8050/openmrs/ws/atomfeed/encounter/recent', 'tag:atomfeed.ict4h.org:475f91b8-a52d-4572-9ed8-18f46d4a3953','http://localhost:8050/openmrs/ws/atomfeed/encounter/24');

```

This would result in the exact same values as the OpenELIS database provides in my test setup.
