Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

This page describes best practices for developing solutions on top of the eHealth domain services.

The best practices and design guidelines are elaborated below.

Best practices

Take advantage of the opportunity for paging in the Infrastructure

The eHealth services provides support for paging of results.

That is, eHealth API users only need to request to amount of data that is actually needed, and the limiting of the results can be done at the server or database level.

API users can define a _offset parameter in the request which means that when combined with _count the paging is done on the database level.

(The eHealth infrastructure has a default page size (i.e. default _count if not given) and maximum page size (i.e. maximum value for the _count parameter).

Example URL to invoke this method for the first page (assuming page size of 10):

http://fhir.example.com/Patient?identifier=urn:foo|123&_count=10&_offset=0

Example URL to invoke this method for the second page:

http://fhir.example.com/Patient?identifier=urn:foo|123&_count=10&_offset=10

Limit the scope of context changes to what is necessary

(warning) Under construction.

Apply filtering to searches (a smaller and more accurate result)

(warning) Under construction.

Use the search APIs' counting options (Limiting results (_count))

eHealth infrastructure services supports count, to keep the load on clients, servers and the network minimized.

Count may be used to limit the number of resources fetched from the database or server.

Example URL to invoke this method:

http://fhir.example.com/Patient?identifier=urn:foo|123&_count=10

See also: Search - FHIR v4.0.1 (hl7.org)

Use time constraints in searches (a smaller and more accurate result)

(warning) Under construction

Optimize call pattern (call in parallel and do not retrieve data one row at a time)

(warning) Under construction

Retrieve data on-demand where possible

(warning) Under construction

Careful using chained resource references

The eHealth services has limited support for chained resource references.

FHIR has the concept of chained resource references. That is, references may also support a "chained" value. For example, you might want to search for DiagnosticReport resources by subject, but use the subject's last name instead of their resource ID. In this example, you are chaining "family" (the last name) to "subject" (the patient).

The net result in the query string would look like:

http://fhir.example.com/DiagnosticReport?subject.family=SMITH

What this query says is "fetch me all of the DiagnosticReport resources where the subject (Patient) of the report has the family (name) of 'SMITH'".

Due to the nature of eHealth microservices resources are split into separate services, and therefore limited support for chained resource references, and therefore be careful using these.

Design guidelines

Take advantage of the opportunity for caching

See https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/1034354702/Technical+Interactions+with+Services#Caching-on-Searching

Caching - eHealth Infrastructure Wiki - Confluence (atlassian.net)

Make the most of context choices (mainly the careteam context)

(warning) Under construction

Avoid unnecessary pre-fetching of data

(warning) Under construction

Make the task overview task / message-centric rather than a patient-centric

(warning) Under construction

Target the operation (and scope) of the user interfaces to the workflows

(warning) Under construction

Avoid unnecessary auto-updates of the user interface

(warning) Under construction

Take advantage of Infrastructure events (mq)

Take advantage of Infrastructure events (mq) for listening to resource changes and perform cache invalidation.

See https://ehealth-dk.atlassian.net/wiki/spaces/EDTW/pages/1177911316/Caching#Cache-invalidation-using-events for events.

Minimize the amount of data that the backend-for-frontend (BFF) has to calculate on

(warning) Under construction

  • No labels