OpenMRS Atomfeed Module & FHIR Module changes

  • There are placed the changes made by SolDevelo Team during working on Sync 2.0 Module.
  1. Implementation of Atomfeed Module. Relase v1.0.2
Details
  • It gives us possibility to fetch information about operation on the objects:

    • CREATED
    • UPDATED
    • RETIRED
    • UNRETIRED
    • VOIDED
    • UNVOIDED
    • DELETED
  • When the interceptor recognize operation on the database, it invokes AtomFeed module logic. The log for the object will be saved in the Atomfeed list. Atom feed list is consists of headers (Current, next and previous page links) and records. On the every Atomfeed page can be max 5 records. One record is one entry to the database. This entry consists of Operation name info and link templates to the concrete Object.

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>OpenMRS Feed Publisher for Sync2.0</title>
  <link rel="self" type="application/atom+xml" href="https://sync2.openmrs.org:443/openmrs/ws/atomfeed/patient/1" />
  <link rel="via" type="application/atom+xml" href="https://sync2.openmrs.org:443/openmrs/ws/atomfeed/patient/1" />
  <link rel="next-archive" type="application/atom+xml" href="https://sync2.openmrs.org:443/openmrs/ws/atomfeed/patient/2" />
  <author>
    <name>SolDevelo</name>
  </author>
  <id>a2ad93fd-8a7f-405f-bbc1-da4535e6d05c+1</id>
  <generator uri="https://github.com/ICT4H/atomfeed">OpenMRS Feed Publisher</generator>
  <updated>2018-01-22T10:07:23Z</updated>
  <entry>
    <title>Patient</title>
    <category term="CREATED" />
    <category term="patient" />
    <id>tag:atomfeed.ict4h.org:0987e727-7c72-419f-9a25-c3894087c572</id>
    <updated>2018-01-19T17:45:20Z</updated>
    <published>2018-01-19T17:45:20Z</published>
    <content type="application/vnd.atomfeed+xml"><![CDATA[{"rest":"/ws/rest/v1/patient/52e2f156-00c1-4dd0-ac49-d49a54946885?v=full","fhir":"/ws/fhir/Patient/52e2f156-00c1-4dd0-ac49-d49a54946885"}]]></content>
  </entry>
  <entry>
    <title>Patient</title>
    <category term="patient" />
    <category term="UPDATED" />
    <id>tag:atomfeed.ict4h.org:b972e29b-20d1-4a42-9345-bb403475de90</id>
    <updated>2018-01-19T17:46:55Z</updated>
    <published>2018-01-19T17:46:55Z</published>
    <content type="application/vnd.atomfeed+xml"><![CDATA[{"rest":"/ws/rest/v1/patient/52e2f156-00c1-4dd0-ac49-d49a54946885?v=full","fhir":"/ws/fhir/Patient/52e2f156-00c1-4dd0-ac49-d49a54946885"}]]></content>
  </entry>
  <entry>
    <title>Patient</title>
    <category term="CREATED" />
    <category term="patient" />
    <id>tag:atomfeed.ict4h.org:a7e1c93e-ed82-4fa3-9413-52d76a230eee</id>
    <updated>2018-01-22T09:44:56Z</updated>
    <published>2018-01-22T09:44:56Z</published>
    <content type="application/vnd.atomfeed+xml"><![CDATA[{"rest":"/ws/rest/v1/patient/1d8585ef-c6bf-483f-b856-6d9e5d542a9e?v=full","fhir":"/ws/fhir/Patient/1d8585ef-c6bf-483f-b856-6d9e5d542a9e"}]]></content>
  </entry>
  <entry>
    <title>Patient</title>
    <category term="patient" />
    <category term="UPDATED" />
    <id>tag:atomfeed.ict4h.org:c876e1e4-354e-44d3-b95c-223d302e402c</id>
    <updated>2018-01-22T10:04:35Z</updated>
    <published>2018-01-22T10:04:35Z</published>
    <content type="application/vnd.atomfeed+xml"><![CDATA[{"rest":"/ws/rest/v1/patient/1d8585ef-c6bf-483f-b856-6d9e5d542a9e?v=full","fhir":"/ws/fhir/Patient/1d8585ef-c6bf-483f-b856-6d9e5d542a9e"}]]></content>
  </entry>
  <entry>
    <title>Patient</title>
    <category term="patient" />
    <category term="UPDATED" />
    <id>tag:atomfeed.ict4h.org:41df3a33-37c3-47ec-878a-64c815ffd2be</id>
    <updated>2018-01-22T10:07:23Z</updated>
    <published>2018-01-22T10:07:23Z</published>
    <content type="application/vnd.atomfeed+xml"><![CDATA[{"rest":"/ws/rest/v1/patient/1d8585ef-c6bf-483f-b856-6d9e5d542a9e?v=full","fhir":"/ws/fhir/Patient/1d8585ef-c6bf-483f-b856-6d9e5d542a9e"}]]></content>
  </entry>
</feed>

There is possible to configure which objects should be fetched by Atomfeeds interceptors.

Example config is placed below:

[ {
  "openMrsClass" : "org.openmrs.Patient",
  "enabled" : true,
  "title" : "Patient",
  "category" : "patient",
  "linkTemplates" : {
    "rest" : "/ws/rest/v1/patient/{uuid}?v=full",
    "fhir" : "/ws/fhir/Patient/{uuid}"
  },
  "feedWriter" : null
}, {
  "openMrsClass" : "org.openmrs.Location",
  "enabled" : true,
  "title" : "Location",
  "category" : "location",
  "linkTemplates" : {
    "rest" : "/ws/rest/v1/location/{uuid}?v=full",
    "fhir" : "/ws/fhir/Location/{uuid}"
  },
  "feedWriter" : null
}]
  • openMrsClass - the class of OpenMRS object
  • enabled - when true, the interceptor will watch the DB operations on the concrete object.
  • title - the full name of the resource
  • category - the category path using to the create atomfeed URL path.
  • linkTemplates - REST and FHIR link templates to the full resource.
  • feedWriter - the logic class that is using to the getting full links to the resource based on the linkTemplates. When null, the default writer will be used.

The fetched atomfeeds are available via REST API. full path to the resource:

i.e.:

Github repository:

GitHub - openmrs/openmrs-module-atomfeed: More generic atom feed implementation

  1. Changes in the FHIR Module. Release v1.11.0
Details
  • Moved and improved services code to the default strategy:
    • RelatedPerson
    • Person
    • Patient
    • Observation
    • Location
  • Error handling for the RelatedPerson
  • FHIR Client for Sync 2.0

Github Repository:

GitHub - openmrs/openmrs-module-fhir: Implements REST and Java APIs to access OpenMRS via FHIR Specification.

CC: @dkayiwa, @mseaton, @darius, @jslawinski, @pgesek, @dserkowski

2 Likes

Thanks for this update.

(Fyi @mksd, @angshuonline. We should discuss this work from the perspective of leveraging it in Bahmni.)

Sure. While watching the progress with Sync 2.0 we were also wondering if it could be useful for the Hub & Spoke?

Cc @mksrom

In fact the soldevelo team started from the Bahmni Hub and spoke design when building sync 2.0.

I haven’t been able to follow the development as closely as I would have liked, but in theory we should be able to use this in Bahmni as well.