本文へ移動
cccskills
無料GitHub で公開

sed

Expert knowledge of SED/EESSI integration in melosys-api. Use when: (1) Understanding SED document types (A001, A003, H-series, X008), (2) Debugging SED sending/receiving flows and RINA integration, (3) Working with BUC (Business Use Case) creation and management, (4) Understanding saga steps for SED handling (SEND_VEDTAK_UTLAND, SED_MOTTAK_RUTING), (5) Troubleshooting mottakerinstitusjoner (recipient institutions) issues.

日本語の概要は準備中です。原文の説明を表示しています。

インストール方法を見る

含まれるファイル(4)

  • SKILL.md12.2 KB
  • references/buc-types.md6.3 KB
  • references/debugging.md8.5 KB
  • references/sed-types.md5.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

SED/EESSI Integration

SED (Structured Electronic Document) is the EU standard for exchanging social security information. EESSI (Electronic Exchange of Social Security Information) is the system that handles this exchange. Melosys integrates via melosys-eessi service which communicates with RINA.

Quick Reference

Module Structure

integrasjon/eessi/
├── EessiClient.kt              # WebClient REST collaborator (calls melosys-eessi)
├── EessiClientConfig.kt        # WebClient/token config
└── dto/                        # Request/response DTOs

service/dokument/sed/
├── EessiService.java           # Main business logic (orchestrates EessiClient)
├── bygger/
│   └── SedDataBygger.java      # Constructs SedDataDto from treatment
├── SedTypeTilBehandlingstemaMapper.java
└── SedDataGrunnlagFactory.java

domain/eessi/
├── SedType.kt                  # 46 SED type definitions
├── BucType.kt                  # BUC types with bestemmelse mapping
└── melding/
    └── MelosysEessiMelding.kt  # Incoming message wrapper

saksflyt/steg/sed/
├── SendVedtakUtland.java       # Send decision abroad
├── SendAnmodningOmUnntak.java  # Send exception request
├── OpprettSedGrunnlag.java     # Map SED to mottatteopplysninger
└── mottak/
    └── SedMottakRuting.java    # Route incoming SEDs

Key SED Types

A-Series (Applicable Legislation):

SEDPurposeWhen Used
A001Request for exception (Søknad/anmodning om unntak)Anmodning om unntak (Art. 16), starts LA_BUC_01
A003Decision on applicable legislation (A1)Vedtak utland (A1)
A004Refusal of A003 decision (Avslag)Sent in LA_BUC_02
A009Posting notification (Melding om utstasjonering, Art. 12)LA_BUC_04
A011Approval of exception request (Innvilgelse av søknad om unntak)Positive response to A001 in LA_BUC_01
A012Change to decision (Endringsmelding)Update to a sent A003

H-Series (Healthcare):

SEDPurpose
H001Request for healthcare coverage
H003Healthcare entitlement certificate
H020Insurance period statement
H121Healthcare cost claim

X-Series (Administrative):

SEDPurpose
X008Invalidation/cancellation
X009Reminder/follow-up

BUC Types (Business Use Cases)

BUC groups related SEDs into a case workflow:

BUCPurposeCommon SEDs
LA_BUC_01Søknad om unntak (exception request, Art. 16)A001, A002, A011
LA_BUC_02Beslutning om lovvalg / arbeid i flere land (Art. 13)A003, A004
LA_BUC_04Melding om utstasjonering (posting notification, Art. 12)A009
LA_BUC_05Lovvalg etter hovedregel (Art. 11)A003
LA_BUC_06Forespørsel om mer informasjonA005, A006
H_BUC_01Healthcare coordination (handled in melosys-eessi)H001, H003
UB_BUC_01Unilateral benefitsVarious

Sending SEDs

Flow Overview

┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌──────┐
│ Behandling  │───►│ EessiService│───►│melosys-eessi│───►│ RINA │
│ (vedtak)    │    │ (build SED) │    │ (REST call) │    │      │
└─────────────┘    └─────────────┘    └─────────────┘    └──────┘

Key Operations

Create BUC and Send SED (EessiService.java):

// Takes behandlingID + BucType (not a Behandling/SedType).
// The SED type is derived from the behandling's resultat/periode inside the service.
String rinaUrl = eessiService.opprettBucOgSed(
    behandlingID,                 // long
    BucType.LA_BUC_02,            // BucType
    List.of("SE:FK"),            // mottakerInstitusjoner
    dokumentReferanser            // Collection<DokumentReferanse>
);

Send SED on an existing BUC: EessiService exposes purpose-specific methods (e.g. sendGodkjenningArbeidFlereLand, sendAnmodningUnntakSvar, sendAvslagUtpekingSvar). These internally call eessiClient.sendSedPåEksisterendeBuc(sedDataDto, rinaSaksnummer, sedType) — note sendSedPåEksisterendeBuc lives on EessiClient, not on EessiService.

eessiService.sendGodkjenningArbeidFlereLand(behandlingID, ytterligereInformasjon); // sends A012

Get Recipient Institutions (note: method takes bucType name + a collection of landkoder):

List<Institusjon> institusjoner = eessiService.hentEessiMottakerinstitusjoner(
    BucType.LA_BUC_01.name(),     // String bucType
    Set.of("SE")                  // Collection<String> landkoder
);

SedDataBygger

Constructs the SED payload (SedDataDto) from treatment data. The input is a SedDataGrunnlag produced by SedDataGrunnlagFactory.av(behandling):

// SedDataBygger.lag(...) builds the full SedDataDto; lagUtkast(...) builds a draft
SedDataGrunnlag grunnlag = dataGrunnlagFactory.av(behandling);
SedDataDto sedData = sedDataBygger.lag(grunnlag, behandlingsresultat, periodeType);

// Contains:
// - Bruker (person info)
// - Adresser (contact, residence, temporary)
// - Arbeidssted/Virksomhet (workplace/company)
// - Lovvalgsperiode (law choice period)
// - VedtakDto (decision)

Receiving SEDs

Flow Overview

┌──────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│ RINA │───►│ Journalpost │───►│ Saga Steps  │───►│ Behandling  │
│      │    │ (EESSI)     │    │ (routing)   │    │ (created)   │
└──────┘    └─────────────┘    └─────────────┘    └─────────────┘

Saga Steps for Receiving

StepPurpose
SED_MOTTAK_RUTINGDetermine handling strategy
OPPRETT_SED_GRUNNLAGMap SED to mottatteopplysninger
OPPRETT_SEDDOKUMENTStore SED reference
SED_MOTTAK_OPPRETT_FAGSAK_OG_BEHCreate case if new
SED_MOTTAK_OPPRETT_NY_BEHANDLINGCreate new treatment
BESTEM_BEHANDLINGMÅTE_SEDDetermine next steps

SED Type → Treatment Topic Mapping

Only A001/A003/A009/A010 map to a behandlingstema; every other SED type (including the H-series) returns empty. There is no Behandlingstema.HELSE — H-series healthcare flows are not driven through this mapper in melosys-api.

// SedTypeTilBehandlingstemaMapper.finnBehandlingstemaForSedType(sedType, lovvalgsland)
A001 → Behandlingstema.ANMODNING_OM_UNNTAK_HOVEDREGEL
A003 → BESLUTNING_LOVVALG_NORGE | BESLUTNING_LOVVALG_ANNET_LAND  // depends on lovvalgsland
A009 → Behandlingstema.REGISTRERING_UNNTAK_NORSK_TRYGD_UTSTASJONERING
A010 → Behandlingstema.REGISTRERING_UNNTAK_NORSK_TRYGD_ØVRIGE
// all other SED types → Optional.empty()

RINA Integration

Saksrelasjon (Case Relationship)

Links the archive case (arkivsakID) to a RINA case. The third argument is the bucType (as a String), not a SED type:

eessiService.lagreSaksrelasjon(
    arkivsakID,                   // Long
    rinaSaksnummer,               // String
    BucType.LA_BUC_02.name()      // String bucType
);

BUC Status Checks

// Check if the BUC for an arkivsak is open (takes the long arkivsakID, not a rinaSaksnummer)
boolean erÅpen = eessiService.erBucAapen(arkivsakID);

// Check whether a specific SED type can be created on a BUC (returns boolean)
boolean kanOpprettes = eessiService.kanOppretteSedTyperPåBuc(rinaSaksnummer, SedType.A012);

// Get related BUCs (statuser filter; empty list = all)
List<BucInformasjon> bucer = eessiService.hentTilknyttedeBucer(arkivsakID, List.of());

LåsReferanse for Concurrency

Prosessinstans.låsReferanse is a plain String (DB column sed_laas_referanse). For SEDs it has the form rinaSaksnummer_sedID_sedVersjon. LåsReferanseFactory.lagLåsReferanse(..) parses it into a SedLåsReferanse, whose gruppePrefiks is the RINA saksnummer. Prosessinstanser that share a gruppePrefiks (same RINA case) are serialised, so concurrent operations on the same RINA case are queued rather than run in parallel.

val ref = LåsReferanseFactory.lagLåsReferanse(prosessinstans.hentLåsReferanse) // -> SedLåsReferanse
ref.gruppePrefiks // == rinaSaksnummer

Common Issues

1. Missing Mottakerinstitusjoner

Symptom: FunksjonellException: "Fant ingen mottakerinstitusjoner for ..."

Cause: Country not EESSI-ready or wrong BUC type

Investigation:

List<Institusjon> institusjoner = eessiService.hentEessiMottakerinstitusjoner(bucType.name(), Set.of(landkode));
// Empty list = country not configured / not EESSI-ready

2. Invalid SED Type for BUC

Symptom: Cannot create SED on existing BUC

Investigation:

boolean kanOpprettes = eessiService.kanOppretteSedTyperPåBuc(rinaSaksnummer, ønsketSedType);
// false = the desired SED type cannot be created (Create action) on this BUC

3. GB/EFTA Convention Special Handling

Symptom: Wrong BUC type or text for UK cases

Note: UK uses EFTA convention after Brexit, requires special mapping:

  • Different BUC types
  • Special text in SED content

4. PDF Generation Failure

Symptom: SED created but no PDF

Cause: Incomplete data in SedDataDto

Investigation: Check SedDataBygger for required fields

Saga Steps Reference

Sending Steps

StepDescription
SEND_VEDTAK_UTLANDSend A003 decision abroad
SEND_ANMODNING_OM_UNNTAKSend A001 exception request
SEND_SVAR_ANMODNING_UNNTAKSend A011/A004 response
VIDERESEND_SØKNADForward application
UTPEKING_SEND_AVSLAGSend designation refusal
SEND_GODKJENNING_REGISTRERING_UNNTAKSend approval

Receiving Steps

StepDescription
SED_MOTTAK_RUTINGRoute incoming SED
OPPRETT_SED_GRUNNLAGCreate data from SED
OPPRETT_SEDDOKUMENTStore SED reference
SED_MOTTAK_OPPRETT_FAGSAK_OG_BEHCreate new case
BESTEM_BEHANDLINGMÅTE_SEDDetermine automation

Debugging

Find RINA Case for Behandling

The RINA saksnummer is not stored as a saksopplysning row with opplysningstype = 'RINA_SAKSNUMMER' (that string only exists in test code) and there is no seddokument/sed_dokument table. SED data is a SED-opplysning in the saksopplysning table (opplysning_type = 'SEDOPPL'), serialized as XML in dokument; the RINA saksnummer lives inside that XML (domain type SedDokument). It is also the prefix of the saga lock reference (prosessinstans.sed_laas_referanse, see below).

SELECT s.id, s.registrert_dato, s.dokument
FROM saksopplysning s
WHERE s.behandling_id = :behandlingId
AND s.opplysning_type = 'SEDOPPL'
ORDER BY s.registrert_dato DESC;

Check SED Sending History

-- prosessinstans columns: prosess_type, sist_fullfort_steg, status, registrert_dato
SELECT pi.uuid, pi.prosess_type, pi.sist_fullfort_steg, pi.status
FROM prosessinstans pi
WHERE pi.behandling_id = :behandlingId
AND (pi.prosess_type LIKE '%SED%' OR pi.sist_fullfort_steg LIKE '%SED%')
ORDER BY pi.registrert_dato DESC;

Check Saksrelasjon

-- Via melosys-eessi service
-- Links GSAK to RINA cases

Detailed Documentation

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Expert knowledge of Altinn A1 application processing for posted workers in melosys-api. Use when: (1) Understanding Altinn søknad/skjema processing, (2) Debugging MedlemskapArbeidEOS form mapping, (3) Understanding SoeknadMapper transformations, (4) Investigating posted worker application issues, (5) Understanding the MOTTAK_SOKNAD_ALTINN saga flow.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

Expert knowledge of Employer/Employment integration (EREG/AAREG) in melosys-api. Use when: (1) Working with organization data from EREG (Enhetsregisteret), (2) Working with employment data from AAREG (Arbeidsforhold), (3) Understanding employer/organization lookup, (4) Debugging employer or employment issues, (5) Understanding the mapping between register data and domain models. Triggers: orgnummer, arbeidsforhold, EREG, AAREG, Enhetsregisteret, registeropplysninger, ansettelsesperiode, saksopplysning.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

Modular monolith architecture overview for melosys-api. Use when needing to understand module structure, dependencies between modules, where to place new code, or when changes in one module might affect others. Triggers: "architecture", "module dependencies", "where should I put", "which modules", "dependency graph".

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

Expert knowledge of Behandling (case treatment) domain in melosys-api. Use when: (1) Understanding the behandling lifecycle and status transitions, (2) Debugging issues with behandling creation, status changes, or closure, (3) Understanding relationships between Fagsak, Behandling, and Behandlingsresultat, (4) Investigating why a behandling is stuck or has wrong status, (5) Understanding Behandlingstyper, Behandlingstema, Behandlingsstatus enums, (6) Debugging journalføring or SED-triggered behandling creation, (7) Understanding behandling creation via saksflyt sagas.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

Expert knowledge of Behandlingsresultat (treatment result) domain in melosys-api. Use when: (1) Understanding result types and their meaning (FASTSATT_LOVVALGSLAND, MEDLEM_I_FOLKETRYGDEN, etc.), (2) Working with periods - Lovvalgsperiode, Medlemskapsperiode, Anmodningsperiode, Utpekingsperiode, (3) Debugging vedtak/decision metadata, criteria evaluation, or social insurance charges, (4) Understanding EU/EEA coordination logic and Article 16 exception handling, (5) Working with trygdeavgift (social insurance charge) calculations.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

brev

無料

Expert knowledge of Brev (letter generation) in melosys-api. Use when: (1) Producing letters and decision documents (vedtaksbrev), (2) Understanding Dokgen templates and mapping, (3) Configuring letter recipients and distribution, (4) Debugging letter generation issues, (5) Adding new letter types or templates.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

navikt のスキルをすべて見る

このスキルの問題を報告する