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.
- License 许可
- Apache-2.0
- 最近更新
- 2026-07-12
- Stars
- ★ 82
- Forks
- 18
01 前言 Front Matter
- name
- behandlingsresultat
- description
- 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.
02 资源文件 3
- 参考文档references/periods.md5.3 KB
- 参考文档references/result-types.md4.3 KB
- 参考文档references/trygdeavgift.md4.3 KB
03 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
| Attribute | Type | Description |
|---|---|---|
type |
Behandlingsresultattyper | IKKE_FASTSATT, FASTSATT_LOVVALGSLAND, MEDLEM_I_FOLKETRYGDEN, etc. |
behandlingsmåte |
Behandlingsmaate | AUTOMATISERT, MANUELT, DELVIS_AUTOMATISERT |
fastsattAvLand |
Land_iso2 | Country that determined the result |
vedtakMetadata |
VedtakMetadata | Decision date and appeal deadline |
begrunnelseFritekst |
String? | Free-text justification |
Result Types (Behandlingsresultattyper)
| Type | Description | Use Case |
|---|---|---|
IKKE_FASTSATT |
Not determined | Initial state |
FASTSATT_LOVVALGSLAND |
Law choice country set | EU/EEA lovvalg |
MEDLEM_I_FOLKETRYGDEN |
Member of Norwegian NI | FTRL membership |
UNNTATT_MEDLEMSKAP |
Exempt from membership | Non-member |
AVSLAG_SØKNAD |
Application denied | Rejection |
OPPHØRT |
Membership terminated | Termination |
ANMODNING_OM_UNNTAK |
Article 16 exception request | Sent to foreign authority |
REGISTRERT_UNNTAK |
Registered exception | Exception approved |
HENLEGGELSE |
Case dismissed | Dropped case |
FERDIGBEHANDLET |
Completed | Generic completion |
MEDHOLD |
Appeal upheld | Klage result |
OMGJORT |
Decision reversed | Klage result |
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
resultat.settVedtakMetadata(
vedtaksdato = Instant.now(),
vedtakKlagefrist = LocalDate.now().plusWeeks(6)
)
Clearing for Reprocessing
// Clear all periods and clarifications
behandlingsresultatService.tømBehandlingsresultat(resultat)
// Clear only membership periods
behandlingsresultatService.tømMedlemskapsperioder(resultat)
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()- Fetch by IDlagreNyttBehandlingsresultat()- Create (initial: IKKE_FASTSATT, MANUELT)oppdaterBehandlingsresultattype()- Update typetømBehandlingsresultat()- Clear for reprocessing
AngiBehandlingsresultatService
oppdaterBehandlingsresultattypeOgAvsluttFagsakOgBehandling()- 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.id = :behandlingId;
Find All Periods for a Result
-- Lovvalgsperioder
SELECT * FROM lovvalgsperiode WHERE behandlingsresultat_id = :id;
-- Medlemskapsperioder
SELECT * FROM medlemskapsperiode WHERE behandlingsresultat_id = :id;
-- Anmodningsperioder
SELECT * FROM anmodningsperiode WHERE behandlingsresultat_id = :id;
Find Results Without Decision
SELECT br.id, b.status
FROM behandlingsresultat br
JOIN behandling b ON b.id = br.id
LEFT JOIN vedtak_metadata vm ON vm.behandlingsresultat_id = br.id
WHERE vm.id IS NULL
AND br.type != 'IKKE_FASTSATT';
Find Results with Multiple Periods (potential issue)
SELECT br.id, COUNT(*) as period_count
FROM behandlingsresultat br
JOIN lovvalgsperiode lp ON lp.behandlingsresultat_id = br.id
GROUP BY br.id
HAVING COUNT(*) > 1;
Detailed Documentation
- Period Types: Deep dive into period types and their relationships
- Result Types: Complete result type reference
04 同仓库更多 Skills
로인장 (Roinjiang)
Activates when the user needs legal advice, contract review, insurance law consultation, startup legal support, or any legal/regulatory matter. She is a top-tier in-house lawyer with absolute loyalty to the CEO, specializing in insurance law, financial consumer protection, privacy, contracts, labor law, family law, civil and criminal matters.
zocdoc-doctor-finder
Use when a user needs to find a doctor, dentist, specialist, therapist, or healthcare provider — especially when they mention insurance, in-network, availability, location, appointments, or booking. Also use for browsing provider reviews, comparing doctors by specialty, or checking if a provider takes their insurance.
zenmux-context
Answers any question about ZenMux by reading the latest official documentation. Use this skill whenever the user asks about ZenMux product features, API usage, configuration, integration, pricing, models, providers, routing, fallback, streaming, multimodal, structured output, tool calling, reasoning, prompt caching, image generation, video generation, web search, long context, observability, logs, cost tracking, usage analytics, insurance, subscription, pay-as-you-go, invoices, best practices for tools like Claude Code, Cursor, Cline, CodeX, Gemini CLI, opencode, Cherry Studio, Obsidian, Sider, Open-WebUI, Dify, Neovate, GitHub Copilot, OpenClaw, CC-Switch, Immersive Translate, Studio Chat, architecture, benchmarks, FAQ, contact, privacy, terms of service, compliance, or any other ZenMux-related topic. Also trigger when the user writes in Chinese about ZenMux: 文档, 使用指南, 快速开始, API 参考, 最佳实践, 模型路由, 供应商路由, 订阅, 按量计费, 可观测性, 帮助, 常见问题, 接入指南, 配置. Trigger on phrases like "how to use ZenMux", "ZenMux docs", "ZenMux API", "ZenMux integration", "ZenMux 怎么用", "ZenMux 接入", "ZenMux 配置". Even if the user doesn't say "ZenMux" explicitly but asks about LLM API aggregation, model routing, provider fallback in a context where ZenMux is the project being worked on, this skill should activate.
workers-comp-guide
Guide workers compensation compliance and claims management. TRIGGERS - Use when user needs help with workers-comp-guide related tasks.
weekly-kpi-report
Generate McKinsey-style board presentation PPTs from weekly auto insurance data. Automatically calculates 16+ KPIs, creates executive-level slides with actionable insights, and supports week-over-week comparisons. Use when user uploads insurance cost data (Excel/CSV) and requests board report, weekly presentation, executive briefing, or mentions keywords like 董事会汇报, 周报PPT, 经营分析演示, McKinsey-style reports.
wealth-advisory
Wealth management and financial planning for HNW and UHNW clients. Activate when the user mentions wealth management, financial planning, retirement, estate planning, tax planning, GRAT, IDGT, trust, asset allocation, withdrawal rate, Monte Carlo simulation, goals-based investing, tax-loss harvesting, Roth conversion, insurance, annuity, mortgage strategy, concentrated stock, family office, direct indexing, 529 plan, charitable giving, donor-advised fund, private foundation, or asks about personal finance strategy, inheritance, long-term financial planning, or UHNW advisory.