Publisert - 20.11.2026

Indications

The SFM Indicator API can be used to retrieve a list of patients whose medication lists have been changed locally in SFM since a specified date/time. This is useful, for example, in a nursing home when a doctor updates SFM locally and the nurse needs to be alerted to update the medication list in the administration module before dispensing.

The indicator is primarily intended to ensure that all patients' medication lists are up to date before medication is dispensed. Accordingly, it is expected to be called at medication-dispensing times (e.g., up to six times per day).

Endpoint

The endpoint is accessed via:

GET /fhir/Basic?_tag=indicator

Purpose

An Indicator represents a flag, notification, or reminder that some noteworthy change has occurred to a patient's data—requiring attention, awareness, or review by clinicians or external systems.

Indicators are stored locally in a dedicated Indicators table and exposed via a FHIR-compatible API, allowing for efficient integration with user-facing systems or decision-support tools.

Each Indicator is created when an event occurs and stored with:

  • OccurredOnUtc – when the event actually happened.
  • CreatedOnUtc – when the event was saved in the database.
  • PatientId
  • EventType - Ex: ReseptRenewal, TreatmentCreated

The API filters Indicators using CreatedOnUtc to make sure no events are missed, even if they were processed later.

Query Parameters

(Source wording and required markers match the IG.)

Parameter Type Required Description
_tag=indicator string ✅ Required to specify the resource type. Always set to indicator.
identifier string Optional Patient identifier(s) in FHIR format (e.g., urn:oid:...).
from string Optional Start date for filtering indicator events (format: yyyy-MM-dd or yyyy-MM-ddTHH:mm:ss). Defaults to today if omitted.
type string Optional One of Simplified (default) or Verbose. Dictates the result detail level.

Profile

Primary resource profile: sfm-Indicator (http://ehelse.no/fhir/StructureDefinition/sfm-indicator) — specialization of FHIR Basic.

The IG embeds the full differential/snapshot (tree table on Simplifier). The table below preserves the same element coverage as that snapshot so implementers still have cardinality and obligation hints when browsing Git-hosted Markdown offline.

Profile element snapshot (from IG tree)

Notation: S = Must Support; Σ = in summaries; ?! = modifier where applicable.

Element (path) Card. Flags Meaning / binding (short)
SfmIndicator (Basic) — profile Indicator as a FHIR Basic resource
Basic.id 0..1 Σ Logical id of this artefact
Basic.meta 0..1 Σ Metadata about the resource
Basic.implicitRules 0..1 Σ, ?! Rules under which content was created
Basic.language 0..1 Language of narrative
Basic.text 0..1 Human-readable narrative
Basic.contained 0..* Inline contained resources
Basic.extension 0..* sliced open Extensions; see slices below
Basic.extension:patientPid 0..1 S URL http://ehelse.no/fhir/StructureDefinition/sfm-indicator-patient-pid-extension — Patient identifier with change: PID whose medication data changed
Basic.extension:events 0..* URL http://ehelse.no/fhir/StructureDefinition/sfm-indicator-events-extension — Indicator event types; multiple events per indicator allowed
Basic.modifierExtension 0..* ?! Standard modifier extensions
Basic.identifier 0..* Σ Business identifier(s)
Basic.code 1..1 S, Σ, ?! Fixed coding containing code Indicator (defines resource subtype for Basic profile)
Basic.subject 0..1 Σ Subject reference (Patient, etc.), when used
Basic.created 0..1 Σ When resource was created (date)
Basic.author 0..1 Σ References Organization | Patient | Practitioner | PractitionerRole | RelatedPerson

For FHIR datatype definitions and full constraint prose, open the IG page above (tree table retains the authoritative detail).

Retrieval on Datashare

The actual retrieval of indicator data is performed using a named query on Basic. Parameters may include patient identifiers and a date filter:

GET [base]/Basic?_tag=indicator&from=2024-01-01
POST [base]/Basic/_search
_query=Indicator&type=Simplified&from=2024-01-01&identifier=urn:oid:2.16.578.1.12.4.1.4.1|31126711509

Note that SFM will return all matching entries based on the given parameters, and the number of items may grow during a typical session.

Example Request

Simplified view

Note that the use of _search is allowed so patient identifiers are not logged anywhere.

Example 1 – Multiple Patients
POST [base]/Basic/_search
_query=Indicator&type=Simplified&from=2024-01-01&identifier=urn:oid:2.16.578.1.12.4.1.4.1|31126711509,urn:oid:2.16.578.1.12.4.1.4.2|58129218310

Fetches simplified indicators for patients 31126711509 and 58129218310 from 2024-01-01 onward.

Example 2 – Single Patient
POST [base]/Basic/_search
_query=Indicator&type=Simplified&from=2024-01-01&identifier=urn:oid:2.16.578.1.12.4.1.4.1|31126711509

Fetches simplified indicators for patient 31126711509 starting from 2024-01-01.

Verbose view

Example 1 – Multiple Patients
POST [base]/Basic/_search
_query=Indicator&type=Verbose&from=2023-11-01&identifier=urn:oid:2.16.578.1.12.4.1.4.1|31126711509,urn:oid:2.16.578.1.12.4.1.4.2|58129218310

Returns detailed (verbose) indicator data for the listed patients since 2023-11-01.

Example 2 – Single Patient
POST [base]/Basic/_search
_query=Indicator&type=Verbose&from=2023-11-01&identifier=urn:oid:2.16.578.1.12.4.1.4.1|31126711509

Returns detailed indicator data for patient 31126711509 since 2023-11-01.

All requests require appropriate authorization headers:

Host: (host)
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer (token)

Supported Identifiers

You can use the following identifier formats:

Identifier Type Example
FNR urn:oid:2.16.578.1.12.4.1.4.1
DNR urn:oid:2.16.578.1.12.4.1.4.2
XXXID urn:oid:2.16.578.1.12.4.1.4.14

Multiple identifiers can be sent:

identifier=urn:oid:...|12345678901,urn:oid:...|98765432109

Example Response

{
  "resourceType": "Bundle",
  "id": "41b9819f-9444-40f1-8d02-e5f2d011dcd6",
  "meta": {
    "lastUpdated": "2025-06-02T17:40:07.5973486+00:00"
  },
  "type": "searchset",
  "total": 1,
  "entry": [
    {
      "fullUrl": "http://datashare.dev1.forskrivning.no/Basic/ec38e3ab-bfd8-4ca5-87bf-5a93f5f07985",
      "resource": {
        "resourceType": "Basic",
        "id": "a224eff3-94ac-462c-bcf8-f54293386c74",
        "meta": {
          "profile": [
            "http://ehelse.no/fhir/StructureDefinition/sfm-indicator"
          ]
        },
        "extension": [
          {
            "url": "http://ehelse.no/fhir/StructureDefinition/sfm-indicator-patient-pid-extension",
            "valueString": "31126711509"
          }
        ],
        "code": {
          "coding": [
            {
              "code": "Indicator"
            }
          ]
        },
        "created": "2025-06-02"
      }
    }
  ]
}

Usage Examples

Search by Date Only

POST /fhir/Basic/_search
_query=Indicator&type=Simplified&from=2024-01-01

Search by Single Patient Identifier

POST /fhir/Basic/_search
_query=Indicator&type=Simplified&from=2024-01-01&identifier=urn:oid:2.16.578.1.12.4.1.4.1|31126711509

Search by Multiple Patient Identifiers

POST /fhir/Basic/_search
_query=Indicator&type=Simplified&from=2024-01-01&identifier=urn:oid:2.16.578.1.12.4.1.4.1|31126711509,urn:oid:2.16.578.1.12.4.1.4.2|58129218310

Search with Verbose View

POST /fhir/Basic/_search
_query=Indicator&type=Verbose&from=2024-01-01&identifier=urn:oid:2.16.578.1.12.4.1.4.1|31126711509

All requests require appropriate authorization headers:

Host: (host)
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer (token)

Behavior Notes

  • If no identifier is provided → all indicator records are returned.
  • If identifiers don't match any patients → response is 404 Not Found.
  • If from is missing or invalid → defaults to today's date.
  • If type is not Verbose → default is Simplified.
  • Filtering always uses CreatedOnUtc to ensure no delayed events are missed.

EPJ could make use of the lastUpdate datetime to make the next request so that no event is lost. Or, they can simply save the request time from their side.

Søk i Utviklerportalen

Søket er fullført!