본문으로 건너뛰기
cccskills
무료GitHub에 공개

behandlingsresultat

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(4)

  • SKILL.md10.2 KB
  • references/periods.md5.4 KB
  • references/result-types.md5.1 KB
  • references/trygdeavgift.md4.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Behandlingsresultat Domain

Behandlingsresultat captures the outcome of a Behandling, including which law applies, membership status, periods, decision metadata, and eligibility criteria results.

Quick Reference

Entity Structure

Behandling (1)
    ↓ OneToOne
Behandlingsresultat
    ├─ VedtakMetadata (decision date, appeal deadline)
    ├─ Lovvalgsperiode* (law choice periods)
    │   └─ Trygdeavgiftsperiode*
    ├─ Medlemskapsperiode* (membership periods)
    │   └─ Trygdeavgiftsperiode*
    ├─ Anmodningsperiode* (Article 16 request periods)
    │   └─ AnmodningsperiodeSvar
    ├─ Utpekingsperiode* (designation periods)
    ├─ Vilkaarsresultat* (eligibility criteria)
    ├─ Kontrollresultat* (verification results)
    ├─ Avklartefakta* (clarified facts)
    └─ HelseutgiftDekkesPeriode* (EEA pensioner health coverage)

Key Attributes

AttributeTypeDescription
typeBehandlingsresultattyperIKKE_FASTSATT, FASTSATT_LOVVALGSLAND, MEDLEM_I_FOLKETRYGDEN, etc.
behandlingsmåteBehandlingsmaateAUTOMATISERT, MANUELT, DELVIS_AUTOMATISERT
fastsattAvLandLand_iso2Country that determined the result
vedtakMetadataVedtakMetadataDecision date and appeal deadline
begrunnelseFritekstString?Free-text justification

Result Types (Behandlingsresultattyper)

TypeDescriptionUse Case
IKKE_FASTSATTNot determinedInitial state
FASTSATT_LOVVALGSLANDLaw choice country setEU/EEA lovvalg
FORELOEPIG_FASTSATT_LOVVALGSLANDProvisional law choice setBacks erUtpeking() and erInnvilgelse() (designation)
MEDLEM_I_FOLKETRYGDENMember of Norwegian NIFTRL membership
UNNTATT_MEDLEMSKAPExempt from membershipNon-member
AVSLAG_SØKNADApplication deniedRejection
OPPHØRTMembership terminatedTermination
ANMODNING_OM_UNNTAKArticle 16 exception requestSent to foreign authority
REGISTRERT_UNNTAKRegistered exceptionException approved
HENLEGGELSECase dismissedDropped case
FERDIGBEHANDLETCompletedGeneric completion
MEDHOLDAppeal upheldKlage result
OMGJORTDecision reversed (fvl § 35)NY_VURDERING result (no klage)

The enum has more values than shown here, e.g. FORELOEPIG_FASTSATT_LOVVALGSLAND, REGISTRERT_UNNTAK, DELVIS_GODKJENT_UNNTAK, UTPEKING_NORGE_AVVIST, AVSLAG_MANGLENDE_OPPL, ANNULLERT, AVBRUTT, DELVIS_OPPHØRT, FASTSATT_TRYGDEAVGIFT, HENLEGGELSE_BORTFALT. See Result Types for the validation rules.

Period Types

Lovvalgsperiode (Law Choice Period)

Determines which country's social security law applies.

lovvalgsperiode.lovvalgsland        // Land_iso2 - chosen country
lovvalgsperiode.bestemmelse         // LovvalgBestemmelse - regulation (Art. 11, 13, etc.)
lovvalgsperiode.innvilgelsesresultat // INNVILGET, AVSLAATT, OPPHØRT
lovvalgsperiode.medlemskapstype     // PLIKTIG, FRIVILLIG, UNNTATT
lovvalgsperiode.dekning             // Trygdedekninger

Medlemskapsperiode (Membership Period)

Membership in Norwegian National Insurance (folketrygden).

medlemskapsperiode.innvilgelsesresultat  // INNVILGET, AVSLAATT, OPPHØRT
medlemskapsperiode.medlemskapstype       // PLIKTIG, FRIVILLIG, UNNTATT
medlemskapsperiode.trygdedekning         // Coverage type
medlemskapsperiode.bestemmelse           // Membership-specific provision

Anmodningsperiode (Article 16 Request Period)

Request for exception under EU Regulation Article 16.

anmodningsperiode.sendtUtland           // Sent to foreign authority
anmodningsperiode.anmodetAv             // Requested by
anmodningsperiode.anmodningsperiodeSvar // Response from authority

Utpekingsperiode (Designation Period)

Provisional designation of applicable law (EU/EFTA).

Common Operations

Fetching Behandlingsresultat

// Basic fetch
val resultat = behandlingsresultatService.hentBehandlingsresultat(behandlingId)

// With specific relations loaded
val resultat = behandlingsresultatService.hentBehandlingsresultatMedAnmodningsperioder(behandlingId)
val resultat = behandlingsresultatService.hentResultatMedMedlemskapOgLovvalg(behandlingId)

Status Checks

resultat.erInnvilgelse()           // Is approval (lovvalg)
resultat.erAvslag()                // Is denial
resultat.erOpphørt()               // Is terminated
resultat.erAnmodningOmUnntak()     // Is Article 16 request
resultat.erUtpeking()              // Is designation
resultat.erAutomatisert()          // Was auto-processed
resultat.erRegistrertUnntak()      // Is registered exception

Period Access

// Single period (throws if multiple exist)
val lovvalg = resultat.hentLovvalgsperiode()
val anmodning = resultat.hentAnmodningsperiode()

// Optional access
val lovvalg: Optional<Lovvalgsperiode> = resultat.finnLovvalgsperiode()

// Validated period (any type)
val periode: PeriodeOmLovvalg? = resultat.finnValidertPeriodeOmLovvalg()

// Collections
val medlemsperioder = resultat.medlemskapsperioder  // Set<Medlemskapsperiode>

Trygdeavgift (Social Insurance Charges)

// Get all charge-liable periods
val avgiftsPerioder = resultat.finnAvgiftspliktigPerioder()

// Check overlap with tax year
resultat.harInnvilgetAvgiftspliktigPeriodeSomOverlapperMedÅr(2024)

// Get all charge periods
val trygdeavgift = resultat.trygdeavgiftsperioder

VedtakMetadata (Decision)

resultat.harVedtak()  // Has decision metadata

// Set decision (vedtaksdato is set internally to Instant.now())
resultat.settVedtakMetadata(klagefrist = LocalDate.now().plusWeeks(6))

// Or with an explicit Vedtakstyper
resultat.settVedtakMetadata(vedtakstype = Vedtakstyper.FØRSTEGANGSVEDTAK, klagefrist = LocalDate.now().plusWeeks(6))

Clearing for Reprocessing

// Clear all periods and clarifications (takes behandlingID: Long)
behandlingsresultatService.tømBehandlingsresultat(behandlingId)

// Clear only membership periods (takes behandlingID: Long)
behandlingsresultatService.tømMedlemskapsperioder(behandlingId)

Important Interfaces

PeriodeOmLovvalg

Implemented by: Lovvalgsperiode, Anmodningsperiode, Utpekingsperiode

interface PeriodeOmLovvalg {
    val lovvalgsland: Land_iso2
    val bestemmelse: LovvalgBestemmelse?
    // ...
}

AvgiftspliktigPeriode

Implemented by: Lovvalgsperiode, Medlemskapsperiode

interface AvgiftspliktigPeriode {
    val trygdeavgiftsperioder: Set<Trygdeavgiftsperiode>
    // ...
}

Key Services

BehandlingsresultatService

  • hentBehandlingsresultat(behandlingId) - Fetch by ID
  • lagreNyttBehandlingsresultat(behandling) - Create (initial: IKKE_FASTSATT, MANUELT)
  • oppdaterBehandlingsresultattype(id, behandlingsresultattype) - Update type
  • tømBehandlingsresultat(behandlingID) - Clear for reprocessing

AngiBehandlingsresultatService

  • oppdaterBehandlingsresultattypeOgAvsluttFagsakOgBehandling(behandlingID, behandlingsresultattype) - Set type with validation and close case
  • Validates result type against case type, theme, and treatment type

ReplikerBehandlingsresultatService

  • replikerBehandlingsresultat() - Clone result for replicated treatment
  • Deep clones all relationships, resets to IKKE_FASTSATT/MANUELT

Important Gotchas

1. Single Period Assumption

Some methods assume only one period of a type exists:

// Throws if multiple lovvalgsperioder exist
resultat.hentLovvalgsperiode()

// Safe alternative
resultat.finnLovvalgsperiode()  // Returns Optional

2. Type-Driven Logic

Business logic depends heavily on type and fagsak.erLovvalg():

// Different period collections based on case type
val perioder = if (fagsak.erLovvalg()) {
    resultat.lovvalgsperioder
} else {
    resultat.medlemskapsperioder
}

3. Cascade Deletion

All child entities use CascadeType.ALL with orphanRemoval = true. Removing a period from the collection deletes it from the database.

4. Conditional Eager Loading

Use specific service methods to optimize loading:

// Only loads anmodningsperioder
hentBehandlingsresultatMedAnmodningsperioder()

// Loads both membership and lovvalg
hentResultatMedMedlemskapOgLovvalg()

Debugging

Find Behandlingsresultat

SELECT br.* FROM behandlingsresultat br
WHERE br.behandling_id = :behandlingId;

Find All Periods for a Result

-- Lovvalgsperioder (table lovvalg_periode, FK beh_resultat_id)
SELECT * FROM lovvalg_periode WHERE beh_resultat_id = :id;

-- Medlemskapsperioder (FK behandlingsresultat_id)
SELECT * FROM medlemskapsperiode WHERE behandlingsresultat_id = :id;

-- Anmodningsperioder (FK beh_resultat_id)
SELECT * FROM anmodningsperiode WHERE beh_resultat_id = :id;

Find Results Without Decision

SELECT br.behandling_id, b.status
FROM behandlingsresultat br
JOIN behandling b ON b.id = br.behandling_id
LEFT JOIN vedtak_metadata vm ON vm.behandlingsresultat_id = br.behandling_id
WHERE vm.behandlingsresultat_id IS NULL
AND br.resultat_type != 'IKKE_FASTSATT';

Find Results with Multiple Periods (potential issue)

SELECT br.behandling_id, COUNT(*) as period_count
FROM behandlingsresultat br
JOIN lovvalg_periode lp ON lp.beh_resultat_id = br.behandling_id
GROUP BY br.behandling_id
HAVING COUNT(*) > 1;

Detailed Documentation

  • Period Types: Deep dive into period types and their relationships
  • Result Types: Complete result type reference
  • Trygdeavgift: Trygdeavgiftsperiode entities attached to result periods

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. 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 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일 업데이트

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의 스킬 모두 보기

이 스킬의 문제 신고