跳到正文
cccskills
免费在 GitHub 公开

journalforing

Expert knowledge of Journalføring (document archiving) in melosys-api. Use when: (1) Creating/updating journalposts (Joark API), (2) Retrieving documents from SAF (GraphQL), (3) Understanding document workflows, (4) Debugging journalpost issues, (5) Mapping document types and categories. Triggers: "journalpost", "journalføring", "Joark", "dokarkiv", "SAF", "dokumentoversikt", "hentDokument", "ferdigstill journalpost", "Variantformat".

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(4)

  • SKILL.md7.4 KB
  • references/debugging.md6.1 KB
  • references/joark-api.md5.2 KB
  • references/saf.md6.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Journalføring System

Journalføring handles document archiving through Joark (create/update) and SAF (read/query). All documents in melosys are archived as journalposts linked to a fagsak.

Quick Reference

Module Structure

integrasjon/joark/
├── JoarkService.java              # Main service (creates, updates, finalizes)
├── JoarkFasade.java               # Interface for service layer
├── JournalpostOppdatering.java    # Update request builder
├── JournalpostRequestValidator.java
├── DokumentKategoriKode.java      # Document category codes
├── Variantformat.java             # ARKIV, ORIGINAL
├── journalpostapi/                # Joark REST API
│   └── dto/                       # Request/response DTOs
└── saf/                           # SAF GraphQL API
    ├── SafClient.java             # GraphQL client
    └── dto/                       # Response DTOs
        └── journalpost/           # Journalpost domain objects

saksflyt/steg/jfr/
└── OppdaterOgFerdigstillJournalpost.kt  # Saga step

domain/arkiv/
├── Journalposttype.kt             # INN, UT, NOTAT
├── ArkivDokument.kt               # Document domain model
├── FysiskDokument.kt              # Physical document
├── Vedlegg.kt                     # Attachments
└── DokumentReferanse.kt           # Document reference

Core Concepts

Two APIs:

APIPurposeProtocol
Joark (dokarkiv)Create, update, finalize journalpostsREST
SAFQuery, read documentsGraphQL

Journalpost Types:

TypeCodeDescription
INNIIncoming document (søknad, brev fra bruker)
UTUOutgoing document (vedtak, brev til bruker)
NOTATNInternal note

Journalpost Status Flow:

MOTTATT → UNDER_ARBEID → JOURNALFOERT → FERDIGSTILT → EKSPEDERT
                                    ↘ UTGAAR (if expired)
                                    ↘ FEILREGISTRERT (if error)

Key Operations

Create Journalpost (Outgoing Document)

// Entry point: JoarkService.opprettJournalpost(OpprettJournalpost, forsøkEndeligJfr)
// Build the domain OpprettJournalpost (tittel, tema "MED", journalposttype "U",
// bruker, sak (fagsaksystem "MELOSYS"), dokumenter), then:
val journalpostId: String = joarkService.opprettJournalpost(opprettJournalpost, forsøkEndeligJfr)
// JoarkService maps to OpprettJournalpostRequest.av(...) and calls
// journalpostapiClient.opprettJournalpost(request, forsøkEndeligJfr),
// returning OpprettJournalpostResponse.journalpostId.

Finalize Journalpost (Incoming)

// After attaching to case, finalize
joarkService.oppdaterOgFerdigstillJournalpost(
    journalpostId = "12345",
    oppdatering = JournalpostOppdatering.Builder()
        .medSaksnummer(saksnummer)
        .medBrukerID(fnr)
        .medTema("MED")
        .medTittel("Søknad om A1")
        .build()
)

Query Documents from SAF

// GraphQL query for documents linked to case
val dokumenter = safClient.hentDokumentoversikt(saksnummer)

// Get specific journalpost
val journalpost = safClient.hentJournalpost(journalpostId)

// Download document content (always ARKIV variant; no variantformat arg)
val bytes = safClient.hentDokument(journalpostId, dokumentInfoId)

Saga Step: Finalize After Behandling

// OppdaterOgFerdigstillJournalpost.utfør()
// Reads from ProsessDataKey:
// - JOURNALPOST_ID, DOKUMENT_ID
// - BRUKER_ID, AVSENDER_ID, AVSENDER_NAVN
// - MOTTATT_DATO, HOVEDDOKUMENT_TITTEL
// - FYSISKE_VEDLEGG, LOGISKE_VEDLEGG_TITLER

Document Categories

DokumentKategoriKode values:

CodeDescription
SOKSøknad
VBVedtaksbrev
BBrev
SEDStructured Electronic Document (EU)
SYS_SEDSystem-generated SED
KAKlage eller anke
ESElektronisk skjema
EPE-post
IBInfobrev
FORVALTNINGSNOTATInternal note
PUBL_BLANKETT_EOSEU form

Variant Formats

FormatDescription
ARKIVArchived version (PDF/PDFA)
ORIGINALOriginal format (XML/JSON metadata)

Integration Flow

Incoming Document (Søknad)

1. Document received (MOTTATT)
2. JoarkService.hentJournalpost() - fetch metadata
3. Create behandling, link to fagsak
4. JoarkService.oppdaterOgFerdigstillJournalpost()
   - Updates: bruker, sak, tema, tittel, avsender
   - Status: MOTTATT → FERDIGSTILT

Outgoing Document (Vedtak)

1. DokumentService produces document
2. JoarkService.opprettJournalpost()
   - Creates with status FERDIGSTILT
   - Returns journalpostId, dokumentInfoId
3. Distribution to recipient

Common Issues

Issue: Journalpost Not Found

Symptom: IkkeFunnetException when fetching journalpost

Causes:

  • Wrong journalpostId
  • Journalpost in different environment
  • Access denied (tema mismatch)

Debug:

val jp = safClient.hentJournalpost(journalpostId)
log.info("Status: ${jp?.journalstatus}, Tema: ${jp?.tema}")

Issue: Cannot Finalize

Symptom: Error when calling ferdigstillJournalføring

Check:

  1. Journalpost already finalized (FERDIGSTILT)?
  2. Missing required fields (bruker, sak)?
  3. Wrong tema for the case type?

Issue: Missing Document Content

Symptom: Empty bytes from hentDokument

Check:

  • Document exists in journalpost (correct dokumentInfoId)
  • ARKIV variant is present (hentDokument only fetches the ARKIV variant)
  • Access permissions (saksbehandlerHarTilgang)

SQL Queries

Check Journalpost on Behandling

-- Journalposts are NOT stored as a saksopplysning. The journalpost reference
-- is carried in the saga's prosessinstans data (JOURNALPOST_ID, DOKUMENT_ID).
SELECT pi.data
FROM prosessinstans pi
WHERE pi.behandling_id = :behandlingId
AND pi.data LIKE '%JOURNALPOST_ID%';
-- To list documents for a case, query SAF instead (see below).

Find Documents by Saksnummer

-- Via SAF GraphQL, not local DB
-- Use: safClient.hentDokumentoversikt(saksnummer)

Key Code Locations

ComponentLocation
Main Serviceintegrasjon/.../joark/JoarkService.java
Facade Interfaceintegrasjon/.../joark/JoarkFasade.java
Joark write clientintegrasjon/.../joark/journalpostapi/JournalpostapiClient.kt
SAF Clientintegrasjon/.../joark/saf/SafClient.java
Saga Stepsaksflyt/.../steg/jfr/OppdaterOgFerdigstillJournalpost.kt
Document Domaindomain/.../arkiv/*.kt
Category Codesintegrasjon/.../joark/DokumentKategoriKode.java

Detailed Documentation

  • Joark API: Creating and updating journalposts
  • SAF API: Querying and reading documents
  • Debugging: Common journalføring issues, log patterns, and SQL

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。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月22日 更新

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

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

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

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

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

查看 navikt 的全部技能

报告此技能的问题