Skip to content

Commit

Permalink
Merge pull request #420 from statisticsnorway/Barnevern_add_specs_fil…
Browse files Browse the repository at this point in the history
…edesc

Add Barnevern specs
  • Loading branch information
jonolehagemo authored Jan 9, 2024
2 parents 7721a15 + 71ee0ce commit 9f9a617
Show file tree
Hide file tree
Showing 9 changed files with 618 additions and 108 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
* Økonomisk sosialhjelp
* Kvalifiseringsstønad
* XML-baserte filvedlegg
* Barnevern
* [Barnevern](/specs/barnevern_15_specs.md)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ object IndividRules {
Individ12(),
Individ19(),

Lovhjemmel02(),
Lovhjemmel03(),
Lovhjemmel04(),

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class Tiltak02b : AbstractRule<KostraIndividType>(
override fun validate(context: KostraIndividType, arguments: KotlinArguments) = context.tiltak
.filter {
it.sluttDato?.let { sluttDato -> sluttDato.year != arguments.aargang.toInt() } ?: false
}.map { plan ->
}.map { tiltak ->
createValidationReportEntry(
contextId = plan.id,
messageText = "Tiltak (${plan.id}). Sluttdato (${plan.sluttDato}) er ikke " +
contextId = tiltak.id,
messageText = "Tiltak (${tiltak.id}). Sluttdato (${tiltak.sluttDato}) er ikke " +
"i rapporteringsåret (${arguments.aargang})"
)
}.ifEmpty { null }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import no.ssb.kostra.validation.rule.barnevern.extension.erOmsorgsTiltak

class Tiltak04 : AbstractRule<KostraIndividType>(
ruleName = IndividRuleId.TILTAK_04.title,
severity = Severity.WARNING
severity = Severity.ERROR
) {
override fun validate(context: KostraIndividType, arguments: KotlinArguments) = context.tiltak
.filter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BarnevernValidatorTest : BehaviorSpec({
severity = Severity.ERROR,
ruleName = IndividRuleId.INDIVID_06.title,
messageText = "Individet har ingen meldinger, planer eller tiltak i løpet av året"
), 56
), 55
),
row(
"invalid avgiver",
Expand All @@ -60,7 +60,7 @@ class BarnevernValidatorTest : BehaviorSpec({
severity = Severity.ERROR,
ruleName = AvgiverRuleId.AVGIVER_01.title,
messageText = "Klarer ikke å validere Avgiver mot filspesifikasjon"
), 52
), 51
),
row(
"invalid individ",
Expand All @@ -83,7 +83,7 @@ class BarnevernValidatorTest : BehaviorSpec({
ruleName = IndividRuleId.INDIVID_04.title,
journalId = "~journalnummer~",
messageText = "Fødselsnummeret i journalnummer ~journalnummer~ fins også i journalene ~journalnummer2~."
), 108
), 106
),
row(
"duplicate individ #2",
Expand All @@ -94,7 +94,7 @@ class BarnevernValidatorTest : BehaviorSpec({
severity = Severity.ERROR,
ruleName = IndividRuleId.INDIVID_05.title,
messageText = "Journalnummer ~journalnummer~ forekommer 2 ganger."
), 108
), 106
),
row(
"invalid XML",
Expand Down Expand Up @@ -125,7 +125,7 @@ class BarnevernValidatorTest : BehaviorSpec({
severity = Severity.WARNING,
ruleName = IndividRuleId.INDIVID_11.title,
messageText = "Individet har ufullstendig fødselsnummer. Korriger fødselsnummer."
), 56
), 55
)
) { description, avgiver, individList, destroyXml, expectedResult, expectedNumberOfControls ->

Expand Down Expand Up @@ -162,7 +162,7 @@ class BarnevernValidatorTest : BehaviorSpec({
ruleName = AvgiverRuleId.AVGIVER_00.title,
messageText = "Antall avgivere skal være 1, fant 0"
)
numberOfControls shouldBe 52
numberOfControls shouldBe 51
}
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Tiltak04Test : BehaviorSpec({
include(
validationRuleWithArgsTest(
sut = Tiltak04(),
expectedSeverity = Severity.WARNING,
expectedSeverity = Severity.ERROR,
expectedContextId = tiltakTypeInTest.id,
ForAllRowItem(
"individ without tiltak",
Expand Down
Loading

0 comments on commit 9f9a617

Please sign in to comment.