Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sykmelding bistand duplikat #1619

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/data/personoppgave/types/PersonOppgave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface PersonOppgave {
behandletTidspunkt: Date | null;
behandletVeilederIdent: string | null;
opprettet: Date;
duplikatReferanseUuid: string | null;
}

export enum PersonOppgaveType {
Expand Down
1 change: 1 addition & 0 deletions src/mocks/ispersonoppgave/personoppgaveMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const personOppgaveUbehandletBehandlerBerOmBistand2 = {
type: "BEHANDLER_BER_OM_BISTAND",
uuid: "5f1e2625-061b-443d-ae1f-3c18e9574cd2",
referanseUuid: "222248ba-4c3c-4b3f-b7a3-385b7e7c927d",
duplikatReferanseUuid: "5555a750-7f39-4974-9a06-fa1775f987c9",
};

const personOppgaveUbehandletDialogmotesvar = {
Expand Down
52 changes: 41 additions & 11 deletions src/sider/sykmeldinger/VurderBistandsbehov.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
HelpText,
Link,
Panel,
Tag,
} from "@navikt/ds-react";
import {
PersonOppgave,
Expand All @@ -21,7 +22,10 @@ import { Link as RouterLink } from "react-router-dom";
const texts = {
header: "Vurder bistandsbehovet eller forslag til tiltak fra behandler:",
helptext: "Informasjon fra felter i sykmeldingen fra behandler.",
helptextDuplicate:
"Sykmeldingen har duplikate felter fra en tidligere sykmelding.",
link: "Gå til sykmeldingen",
linkDuplicate: "Gå til tidligere sykmelding med duplikate felter",
behandleOppgaveText: "Jeg har vurdert behovet, fjern oppgaven.",
};

Expand All @@ -36,22 +40,40 @@ const VurderBistandsbehov = ({ oppgave }: VurderBistandsbehovProps) => {
const sykmelding = sykmeldinger.find(
(sykmelding) => sykmelding.id === oppgave.referanseUuid
);
const sykmeldingDuplikat = sykmeldinger.find(
(sykmelding) => sykmelding.id === oppgave.duplikatReferanseUuid
);
const tiltakNav = sykmelding?.arbeidsevne.tiltakNAV;
const tiltakAndre = sykmelding?.arbeidsevne.tiltakAndre;
const bistandsbehov = sykmelding?.meldingTilNav.navBoerTaTakISakenBegrunnelse;
return !!sykmelding ? (
<Panel className={"mb-4"}>
<div className={"flex flex-row justify-between"}>
<Heading size="medium" level="2">
{texts.header}
</Heading>
<HelpText
title="Informasjon fra felter i sykmeldingen fra behandler"
placement="left"
>
{texts.helptext}
</HelpText>
</div>
{!!oppgave.duplikatReferanseUuid ? (
<div className={"flex flex-row justify-between"}>
<Heading size="medium" level="2">
{texts.header}
</Heading>
<Tag variant="warning-moderate">Mulig duplikat</Tag>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan evnt bytte ut med en "blekere" variant ved å bruke "warning".

<HelpText
placement="left"
title="Informasjon fra felter i sykmeldingen fra behandler"
>
{texts.helptextDuplicate}
</HelpText>
</div>
) : (
<div className={"flex flex-row justify-between"}>
<Heading size="medium" level="2">
{texts.header}
</Heading>
<HelpText
title="Informasjon fra felter i sykmeldingen fra behandler"
placement="left"
>
{texts.helptext}
</HelpText>
</div>
)}
<blockquote>
{tiltakNav && (
<BodyShort>
Expand All @@ -71,6 +93,14 @@ const VurderBistandsbehov = ({ oppgave }: VurderBistandsbehovProps) => {
<Link as={RouterLink} to={`/sykefravaer/sykmeldinger/${sykmelding.id}`}>
{texts.link}
</Link>
{sykmeldingDuplikat && (
<Link
as={RouterLink}
to={`/sykefravaer/sykmeldinger/${sykmeldingDuplikat.id}`}
>
{texts.linkDuplicate}
</Link>
)}
{!behandleOppgave.isSuccess ? (
<Button
variant="secondary"
Expand Down
1 change: 1 addition & 0 deletions test/oppfolgingsplaner/OppfolgingsplanerOversiktTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@ const createOppfolgingsplanLpsPersonoppgave = (
: null,
behandletVeilederIdent: behandlet ? "Veilederident" : null,
opprettet: new Date(),
duplikatReferanseUuid: null,
};
};