本文へ移動
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(原文)

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

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

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

navikt のスキルをすべて見る

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