본문으로 건너뛰기
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 / 1,000자

이 양식은 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의 스킬 모두 보기

이 스킬의 문제 신고