Publisert - 23.04.2026

Configuration of EDI 2.0

For detailed technical specifications, please refer to the Swagger documentation.

You can configure parts of how EDI 2.0 should behave as your message handler. One configuration is required per HER‑Id.

Configurations should be updated regularly. We recommend defining the desired configuration declaratively and submitting it on appliation startup.

Submit a configuration

PUT /mshconfigurations

Writes the supplied configurations.

Reserve a HER‑Id

Set the property ClientLocked to true if you want to be the only client that may use EDI 2.0 on behalf of the given HER‑Id.

When a HER‑Id is reserved, other clients attempting to fetch/send messages for that HER‑Id will be rejected with a 423 Locked status code. The same error is returned if you try to modify a configuration that is already reserved.

To release a reserved HER‑Id you must either submit a new configuration with ClientLocked set to false or use the DELETE endpoint.

How would you like to receive notifications about new messages?

Use the property receiveNotificationChannel. This list will be extended with additional possible values over time.

  • ApiPolling: You “poll” by calling the /notifications endpoint. (Read more on the page for notifications).
  • Kafka: You consume a Kafka topic. NOTE! Kafka topics are only available internally at NHN.

Want to be informed about messages addressed to you that were refused or could not be delivered because of errors?

Set the property receiveRefusedMessageNotices to true. Then you can retrieve information about messages that are addressed to your HER‑Id but will not be delivered further by EDI 2.0.

You can obtain information about refused and undelivered messages via the GET /notifications endpoint. Read more on the notifications endpoint page.

Do you want to reject certain messages?

Use the property rejectMessageFilters. Here you can provide keys (dictionary/key) that indicate which fields you want to filter on, and values (dictionary/value) that specify which values for those fields should be rejected. Currently only the MessageFunction filter is offered as a key:

  • MessageFunction – Provide codes from code standard 8279 – "Meldingens funksjon".
    • For a message received over traditional EDI, this is checked against the Action element in the EbXml envelope, which uses code set 8279 (specified in HIS1209:2018). Note that Action can technically be mis‑marked or missing; in such cases the message handler will not reject the message.
    • For a message received from another API user of EDI 2.0, the check is performed against the field in the clinical message where the message function is defined, which varies by message type. For messages that implement the message header standard ("Hodemelding", HIS80601:2006), this is located at MsgHead/MsgInfo/Type.

When EDI 2.0 rejects a message from an EDI sender, a negative transport acknowledgment (MessageError) with the error code NotSupported is sent. When EDI 2.0 rejects a message from a EDI 2.0 sender, the receiver status is set to Rejected.

Example of using rejectMessageFilters:

The example below specifies that we want to reject a number of values from code set 8279 that are used in the sector but lie outside the standard for Svarrapport version 1.4:

{
    MessageFunction: ["SVAR_KKL", "SVAR_CYT", "SVAR_MBIO", "SVAR_HIST", "SVAR_OBD", "IMTR", "SVAR_IMTR"]
}

Deleting Configurations

DELETE /mshconfigurations

Deletes the configurations for the provided HER-Ids. All the provided HER-Ids must have a stored configurations, and none of the provided HER-Ids may be reserved by another client.

Søk i Utviklerportalen

Søket er fullført!