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

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 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?

1 Like

Hi @bgevam,

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.

1 Like

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:

    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.

    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:

    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.

1 Like