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

behandling

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.

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

インストール方法を見る

含まれるファイル(3)

  • SKILL.md7.7 KB
  • references/debugging.md9.7 KB
  • references/kodeverk.md6.6 KB

SKILL.md(原文)

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

Behandling Domain

Behandling (case treatment) is the core domain entity in melosys-api representing an individual processing instance within a Fagsak (case). Each behandling tracks the lifecycle of one decision-making process from creation through to closure.

Quick Reference

Domain Model Hierarchy

Fagsak (Case)
├── saksnummer: String (PK — no numeric id)
├── type: Sakstyper (EU_EOS, FTRL, TRYGDEAVTALE)
├── tema: Sakstemaer
├── status: Saksstatuser
└── behandlinger: List<Behandling>  (linked via saksnummer FK)

    Behandling (Treatment)
    ├── id: Long
    ├── status: Behandlingsstatus
    ├── type: Behandlingstyper
    ├── tema: Behandlingstema
    ├── behandlingsfrist: LocalDate
    ├── registrertDato / endretDato: Instant
    └── behandlingsresultat: Behandlingsresultat

        Behandlingsresultat  (PK is behandling_id — no separate id)
        ├── type: Behandlingsresultattyper
        ├── medlemskapsperioder: List<Medlemskapsperiode>
        ├── lovvalgsperioder: List<Lovvalgsperiode>
        └── vedtakMetadata: VedtakMetadata

Key Enums

EnumValuesDescription
BehandlingsstatusOPPRETTET, UNDER_BEHANDLING, AVSLUTTET, IVERKSETTER_VEDTAK, MIDLERTIDIG_LOVVALGSBESLUTNING, AVVENT_DOK_UTL, AVVENT_DOK_PARTCurrent processing state
BehandlingstyperFØRSTEGANG, NY_VURDERING, HENVENDELSE, KLAGE, ENDRET_PERIODE, MANGLENDE_INNBETALING_TRYGDEAVGIFT, ÅRSAVREGNING, SATSENDRINGType of processing
BehandlingstemaYRKESAKTIV, IKKE_YRKESAKTIV, PENSJONIST, UTSENDT_ARBEIDSTAKER, ARBEID_FLERE_LAND, etc.Subject matter

Behandling Lifecycle

OPPRETTET → UNDER_BEHANDLING → IVERKSETTER_VEDTAK → AVSLUTTET
                   │                                    ↑
                   ├── AVVENT_DOK_UTL ─────────────────┤
                   ├── AVVENT_DOK_PART ────────────────┤
                   └── MIDLERTIDIG_LOVVALGSBESLUTNING

MIDLERTIDIG_LOVVALGSBESLUTNING counts as INACTIVE (erInaktiv()) and is
not editable; it does not flow straight to AVSLUTTET like the AVVENT_* states.

Behandling Creation Paths

1. Journalføring (Document Registration)

// JFR_NY_SAK_BRUKER saga
prosessinstansService.opprettProsessinstansJournalføringNySakBruker(journalpostId, ...)
// Creates: Fagsak + Behandling + Oppgave

2. SED Reception (EESSI)

// REGISTRERING_UNNTAK_NY_SAK, ARBEID_FLERE_LAND_NY_SAK, etc.
sedMottakOpprettFagsakOgBehandling.utfør(prosessinstans)
// Creates behandling from incoming SED

3. Ny Vurdering (Re-evaluation)

// From journalføring/digital søknad to an existing sak.
// opprettNyVurdering is a private helper inside the saksflyt step
// HåndterEksisterendeSakDigitalSøknad; it ultimately calls
// BehandlingService.nyBehandling(fagsak, status, type, tema, ...).

4. Automatic Creation

// OPPRETT_NY_BEHANDLING_MANGLENDE_INNBETALING
// OPPRETT_NY_BEHANDLING_AARSAVREGNING
prosessinstansService.opprettProsessinstansNyBehandlingManglendeInnbetaling(...)

Status Transitions

Legal Transitions

FromToTrigger
OPPRETTETUNDER_BEHANDLINGSaksbehandler opens case
UNDER_BEHANDLINGIVERKSETTER_VEDTAKfattVedtak() called
UNDER_BEHANDLINGAVVENT_DOK_UTLWaiting for foreign authority
UNDER_BEHANDLINGAVVENT_DOK_PARTWaiting for user documents
UNDER_BEHANDLINGMIDLERTIDIG_LOVVALGSBESLUTNINGArt. 13 provisional decision
IVERKSETTER_VEDTAKAVSLUTTETVedtak saga completes
AVVENT_*UNDER_BEHANDLINGDocuments received
Any activeAVSLUTTETManual close via behandlingsmeny

Status Helper Methods

behandling.erInaktiv()      // AVSLUTTET or MIDLERTIDIG_LOVVALGSBESLUTNING
behandling.erAktiv()        // !erInaktiv() (everything except those two)
behandling.erAvsluttet()    // AVSLUTTET
behandling.erRedigerbar()   // erAktiv() && status != IVERKSETTER_VEDTAK
                            //   && !(ANMODNING_UNNTAK_SENDT && tema != IKKE_YRKESAKTIV)
behandling.erVenterForDokumentasjon()  // AVVENT_DOK_PART, AVVENT_DOK_UTL, ANMODNING_UNNTAK_SENDT

Service Layer

BehandlingService

Location: service/src/main/java/no/nav/melosys/service/behandling/BehandlingService.java

Key operations:

  • hentBehandling(behandlingId) - Get by ID
  • nyBehandling(fagsak, status, type, tema, ...) - Create a new behandling
  • endreStatus(behandling, status) / endreStatus(behandlingID, status) - Change status
  • endreBehandling(behandlingID, nyType, nyTema, nyStatus, nyMottaksdato) - Edit type/tema/status/frist
  • avsluttBehandling(behandlingId) / avsluttBehandling(behandlingId, behandlingsresultattype: Behandlingsresultattyper) - Close treatment

BehandlingsresultatService

Location: service/src/main/kotlin/no/nav/melosys/service/behandling/BehandlingsresultatService.kt

Key operations:

  • hentBehandlingsresultat(behandlingsid) - Get result
  • lagre(resultat) - Save result
  • lagreNyttBehandlingsresultat(behandling) - Create a fresh (IKKE_FASTSATT) result for a behandling
  • oppdaterBehandlingsresultattype(id, type) - Set the result type

Debugging Queries

Find Behandling by ID

SELECT b.*, f.saksnummer
FROM behandling b
JOIN fagsak f ON b.saksnummer = f.saksnummer
WHERE b.id = :behandlingId;

Find Active Behandlinger for Person

-- behandling links to fagsak via saksnummer; the actor (aktoer_id) lives in aktoer
SELECT b.*, f.saksnummer
FROM behandling b
JOIN fagsak f ON b.saksnummer = f.saksnummer
JOIN aktoer a ON a.saksnummer = f.saksnummer AND a.rolle = 'BRUKER'
WHERE a.aktoer_id = :aktorId
AND b.status NOT IN ('AVSLUTTET');

Find Stuck Behandlinger

SELECT b.id, b.status, b.endret_dato, f.saksnummer
FROM behandling b
JOIN fagsak f ON b.saksnummer = f.saksnummer
WHERE b.status = 'IVERKSETTER_VEDTAK'
AND b.endret_dato < SYSDATE - INTERVAL '2' HOUR;

Check Behandling with Prosessinstans

-- saga progress is tracked via prosessinstans.status + sist_fullfort_steg
SELECT b.id, b.status, p.prosess_type, p.status as prosess_status, p.sist_fullfort_steg
FROM behandling b
LEFT JOIN prosessinstans p ON p.behandling_id = b.id
WHERE b.id = :behandlingId
ORDER BY p.registrert_dato DESC;

Common Issues

IssueSymptomsInvestigation
Stuck in IVERKSETTER_VEDTAKCan't edit behandlingCheck prosessinstans status / sist_fullfort_steg
Wrong behandlingstypeValidation errorsCheck journalføring logic
Missing behandlingsresultatNullPointerCheck saga completed successfully
Can't create ny vurderingFunksjonellExceptionCheck fagsak.status and existing active behandling
Status not updatingStale data in UICheck audit trail, version conflicts

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 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日 更新

database

無料

Expert knowledge of the melosys-api Oracle database schema. Use when: (1) Writing SQL queries against the melosys database, (2) Understanding table relationships and foreign keys, (3) Debugging data issues by querying the database, (4) Understanding what data is stored where, (5) Creating or modifying Flyway migrations, (6) Mapping domain entities to database tables. Triggers: SQL against melosys DB, table/column lookup, FK relationships, "where is X stored", "what column stores X", "why is data missing", beh_resultat_id, behandlingsresultat_id, saksnummer, schema.

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

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

navikt のスキルをすべて見る

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