Skip to content
cccskills
FreePublished on GitHub

person

Expert knowledge of Person data integration (PDL) in melosys-api. Use when: (1) Working with person data from PDL (Person Data Lake), (2) Understanding identity types (fnr, aktørID, NPID), (3) Working with addresses, family relations, or citizenship, (4) Debugging person data lookup issues, (5) Understanding the mapping between PDL and domain models.

The English summary is being prepared. Showing the original description.

See how to install

Files included (4)

  • SKILL.md8.9 KB
  • references/data-models.md7.4 KB
  • references/debugging.md6.9 KB
  • references/pdl-api.md9.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Person (PDL Integration) System

Melosys retrieves person data from PDL (Person Data Lake) via GraphQL. The system handles identity lookup, personal information, addresses, family relations, and citizenship data. Person data is used throughout the application for case processing and letter generation.

Quick Reference

Module Structure

integrasjon/pdl/
├── PDLClient.java                # Main interface for PDL operations
├── PDLClientImpl.java            # Implementation with WebClient
├── PDLClientProducer.java        # Bean configuration
├── PDLAuthFilterAzure.java       # Azure AD authentication
├── PDLFeilkode.java              # Error codes
└── dto/
    ├── identer/                  # Identity DTOs
    │   ├── Ident.java
    │   ├── IdentGruppe.java
    │   ├── Identliste.java
    │   └── Query.java
    └── person/                   # Person DTOs
        ├── Person.java           # Main person record
        ├── Navn.java
        ├── Statsborgerskap.java
        ├── Sivilstand.java
        ├── ForelderBarnRelasjon.java
        ├── Adressebeskyttelse.java
        ├── Query.java            # GraphQL queries
        └── adresse/              # Address types
            ├── Bostedsadresse.java
            ├── Kontaktadresse.java
            ├── Oppholdsadresse.java
            ├── Vegadresse.java
            └── UtenlandskAdresse.java

service/persondata/
├── PersondataService.java        # Main service facade
├── PersondataFasade.java         # Interface
└── mapping/                      # PDL → domain mappers (~13 mappers, representative subset)
    ├── PersonopplysningerOversetter.java
    ├── PersonMedHistorikkOversetter.java
    ├── NavnOversetter.java
    ├── StatsborgerskapOversetter.java
    ├── SivilstandOversetter.java
    ├── FamiliemedlemOversetter.java
    ├── ...                       # also Doedsfall/Foedsel/Kjoenn/Foreldreansvar/Folkeregister* Oversetter
    └── adresse/
        ├── BostedsadresseOversetter.java
        ├── KontaktadresseOversetter.java
        ├── OppholdsadresseOversetter.java
        └── PdlAdresseformatOversetter.java

service/persondata/familie/
├── FamiliemedlemService.java     # Family relations
└── medlem/
    └── EktefelleEllerPartnerFamiliemedlemFilter.java

Key Services

ServicePurpose
PDLClientGraphQL client for PDL queries
PersondataServiceMain facade for person data operations
FamiliemedlemServiceFetches and filters family members

Identity Types

TypeDescriptionExample
FOLKEREGISTERIDENTNorwegian national ID (fnr/dnr)12345678901
AKTORIDInternal NAV actor ID1000012345678
NPIDNAV person ID (for non-registered)01234567890

PDLClient Operations

Main Operations

// Fetch identities (fnr ↔ aktørID conversion)
val identliste = pdlClient.hentIdenter(ident)

// Fetch person data
val person = pdlClient.hentPerson(ident)

// Fetch person with address/citizenship history
val personMedHistorikk = pdlClient.hentPersonMedHistorikk(ident)

// Fetch family relations (the PDLClient interface also exposes
// hentBarn, hentForelder and hentEktefelleEllerPartner for targeted lookups)
val familierelasjoner = pdlClient.hentFamilierelasjoner(ident)
val barn = pdlClient.hentBarn(ident)
val forelder = pdlClient.hentForelder(ident)
val ektefelle = pdlClient.hentEktefelleEllerPartner(ident)

// Fetch specific data
val navn = pdlClient.hentNavn(ident)
val statsborgerskap = pdlClient.hentStatsborgerskap(ident)
val adressebeskyttelser = pdlClient.hentAdressebeskyttelser(ident)

PersondataService Operations

// Get aktørID from fnr (or vice versa)
val aktørId = persondataService.hentAktørIdForIdent(fnr)
val fnr = persondataService.hentFolkeregisterident(aktørId)

// Get person data
val persondata = persondataService.hentPerson(ident)
val persondataMedFamilie = persondataService.hentPerson(ident, Informasjonsbehov.MED_FAMILIERELASJONER)

// Get person with history (for saksbehandler view)
val personMedHistorikk = persondataService.hentPersonMedHistorikk(behandlingID)

// Get family members
val familiemedlemmer = persondataService.hentFamiliemedlemmerFraBehandlingID(behandlingID)

// Check address protection
val erBeskyttet = persondataService.harStrengtFortroligAdresse(ident)

Person Data Model

PDL Person Record

public record Person(
    Collection<Adressebeskyttelse> adressebeskyttelse,
    Collection<Bostedsadresse> bostedsadresse,
    Collection<Doedsfall> doedsfall,
    Collection<Foedested> foedested,
    Collection<Foedselsdato> foedselsdato,
    Collection<Folkeregisteridentifikator> folkeregisteridentifikator,
    Collection<Folkeregisterpersonstatus> folkeregisterpersonstatus,
    Collection<ForelderBarnRelasjon> forelderBarnRelasjon,
    Collection<Foreldreansvar> foreldreansvar,
    Collection<Kjoenn> kjoenn,
    Collection<Kontaktadresse> kontaktadresse,
    Collection<Navn> navn,
    Collection<Oppholdsadresse> oppholdsadresse,
    Collection<Sivilstand> sivilstand,
    Collection<Statsborgerskap> statsborgerskap,
    Collection<UtenlandskIdentifikasjonsnummer> utenlandskIdentifikasjonsnummer
)

Address Types

TypeDescriptionPriority
KontaktadresseMailing address (PDL/Freg)1 (highest)
OppholdsadresseResidence address2
BostedsadresseRegistered home address3 (lowest)

Address Protection (Adressebeskyttelse)

GraderingDescription
UGRADERTNo protection
FORTROLIGProtected (code 7)
STRENGT_FORTROLIGStrictly protected (code 6)
STRENGT_FORTROLIG_UTLANDStrictly protected abroad

Family Relations

Sivilstandstype

TypeDescription
GIFTMarried
REGISTRERT_PARTNERRegistered partner
SEPARERTSeparated (married)
SEPARERT_PARTNERSeparated (partner)
SKILTDivorced
SKILT_PARTNERDissolved partnership
ENKE_ELLER_ENKEMANNWidow/widower
UGIFTUnmarried

Familierelasjonsrolle

RoleDescription
MORMother
FARFather
MEDMORCo-mother
BARNChild

Data Mapping Flow

PDL GraphQL Response
    ↓
integrasjon/pdl/dto/person/Person.java (PDL DTOs)
    ↓
service/persondata/mapping/*Oversetter.java (Mappers)
    ↓
domain/person/Personopplysninger.kt (Domain model)
    ↓
Frontend API / Business logic

Caching

PersondataService uses caching for identity lookups:

@Cacheable("aktoerID")
public String hentAktørIdForIdent(String ident) { ... }

@Cacheable("folkeregisterIdent")
public Optional<String> finnFolkeregisterident(String ident) { ... }

Common Issues

Issue: Person Not Found

Symptom: IkkeFunnetException: "Fant ikke ident i PDL."

Causes:

  • Invalid/non-existent identity
  • Identity not in PDL (foreigner without registration)
  • Wrong identity type used

Check:

// Try both identity types
val identer = pdlClient.hentIdenter(ident)
log.info("Available identities: ${identer.identer()}")

Issue: Address Protection Blocking Access

Symptom: Empty address data or access denied

Check:

val adressebeskyttelser = pdlClient.hentAdressebeskyttelser(ident)
log.info("Protection levels: ${adressebeskyttelser.map { it.gradering() }}")

Issue: Missing Family Members

Symptom: Family relations not appearing

Causes:

  • Person is 18+ (parents not fetched)
  • Sivilstand doesn't qualify for spouse lookup
  • No valid relatertPersonsIdent

Key Code Locations

ComponentLocation
PDL Clientintegrasjon/.../pdl/PDLClient.java
PDL DTOsintegrasjon/.../pdl/dto/
GraphQL Queriesintegrasjon/.../pdl/dto/person/Query.java
PersondataServiceservice/.../persondata/PersondataService.java
Mappersservice/.../persondata/mapping/
Domain Modelsdomain/.../person/
Family Serviceservice/.../persondata/familie/FamiliemedlemService.java

Detailed Documentation

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

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.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

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.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

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".

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

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.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

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.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

brev

Free

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.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

See all skills by navikt

Report a problem with this skill