Skip to content

Commit

Permalink
update common and rename FREMDATERT_MER_ENN_30_DAGER back to FREMDATERT
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasDev committed Oct 5, 2023
1 parent 2e52d3a commit 24a4098
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 21 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ graph TD
Periode
```mermaid
graph TD
root(FREMDATERT_MER_ENN_30_DAGER) -->|Yes| root_FREMDATERT_MER_ENN_30_DAGER_INVALID(INVALID):::invalid
root(FREMDATERT_MER_ENN_30_DAGER) -->|No| root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR(TILBAKEDATERT_MER_ENN_3_AR)
root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR(TILBAKEDATERT_MER_ENN_3_AR) -->|Yes| root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR_INVALID(INVALID):::invalid
root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR(TILBAKEDATERT_MER_ENN_3_AR) -->|No| root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR(TOTAL_VARIGHET_OVER_ETT_AAR)
root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR(TOTAL_VARIGHET_OVER_ETT_AAR) -->|Yes| root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR_INVALID(INVALID):::invalid
root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR(TOTAL_VARIGHET_OVER_ETT_AAR) -->|No| root_FREMDATERT_MER_ENN_30_DAGER_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR_OK(OK):::ok
root(FREMDATERT) -->|Yes| root_FREMDATERT_INVALID(INVALID):::invalid
root(FREMDATERT) -->|No| root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR(TILBAKEDATERT_MER_ENN_3_AR)
root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR(TILBAKEDATERT_MER_ENN_3_AR) -->|Yes| root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR_INVALID(INVALID):::invalid
root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR(TILBAKEDATERT_MER_ENN_3_AR) -->|No| root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR(TOTAL_VARIGHET_OVER_ETT_AAR)
root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR(TOTAL_VARIGHET_OVER_ETT_AAR) -->|Yes| root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR_INVALID(INVALID):::invalid
root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR(TOTAL_VARIGHET_OVER_ETT_AAR) -->|No| root_FREMDATERT_TILBAKEDATERT_MER_ENN_3_AR_TOTAL_VARIGHET_OVER_ETT_AAR_OK(OK):::ok
classDef ok fill:#c3ff91,stroke:#004a00,color: black;
classDef invalid fill:#ff7373,stroke:#ff0000,color: black;
classDef manuell fill:#ffe24f,stroke:#ffd500,color: #473c00;
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ val ktorVersion = "2.3.4"
val logbackVersion = "1.4.11"
val logstashEncoderVersion = "7.4"
val prometheusVersion = "0.16.0"
val smCommonVersion = "2.0.2"
val smCommonVersion = "2.0.3"
val kotestVersion = "5.7.2"
val mockkVersion = "1.13.8"
val kotlinVersion = "1.9.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class ArbeidsuforhetRulesExecution(
ledd = 1,
punktum = null,
bokstav = null,
rundskriv = "R08-00"
),
)
}
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/no/nav/syfo/rules/hpr/HPRRulesExecution.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class HPRRulesExecution(private val rootNode: HPRTreeNode = hprRuleTree) : RuleE
ledd = null,
punktum = null,
bokstav = null,
rundskriv = null
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import no.nav.syfo.model.Status
import no.nav.syfo.rules.common.RuleHit

enum class PeriodeRuleHit(val ruleHit: RuleHit) {
FREMDATERT_MER_ENN_30_DAGER(
FREMDATERT(
ruleHit =
RuleHit(
rule = "FREMDATERT",
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/no/nav/syfo/rules/periode/PeriodeRuleTree.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import no.nav.syfo.rules.periode.PeriodeRuleHit.*
import no.nav.syfo.rules.periodvalidering.PeriodLogicRuleHit

enum class PeriodeRules {
FREMDATERT_MER_ENN_30_DAGER,
FREMDATERT,
TILBAKEDATERT_MER_ENN_3_AR,
TOTAL_VARIGHET_OVER_ETT_AAR,
}

val periodeRuleTree =
tree<PeriodeRules, RuleResult>(PeriodeRules.FREMDATERT_MER_ENN_30_DAGER) {
yes(INVALID, FREMDATERT_MER_ENN_30_DAGER)
tree<PeriodeRules, RuleResult>(PeriodeRules.FREMDATERT) {
yes(INVALID, FREMDATERT)
no(PeriodeRules.TILBAKEDATERT_MER_ENN_3_AR) {
yes(INVALID, TILBAKEDATERT_MER_ENN_3_AR)
no(PeriodeRules.TOTAL_VARIGHET_OVER_ETT_AAR) {
Expand All @@ -43,7 +43,7 @@ internal fun RuleNode<PeriodeRules, RuleResult>.no(

fun getRule(rules: PeriodeRules): Rule<PeriodeRules> {
return when (rules) {
PeriodeRules.FREMDATERT_MER_ENN_30_DAGER -> fremdatertOver30Dager
PeriodeRules.FREMDATERT -> fremdatertOver30Dager
PeriodeRules.TILBAKEDATERT_MER_ENN_3_AR -> tilbakeDatertOver3Ar
PeriodeRules.TOTAL_VARIGHET_OVER_ETT_AAR -> varighetOver1AAr
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class PeriodeRulesExecution(
1,
null,
null,
null,
)
)

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/no/nav/syfo/rules/periode/Rules.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ val fremdatertOver30Dager: PeriodeRule = { sykmelding, ruleMetadata ->
"fom" to forsteFomDato,
"fremdatert" to fremdatert
),
rule = PeriodeRules.FREMDATERT_MER_ENN_30_DAGER,
rule = PeriodeRules.FREMDATERT,
ruleResult = fremdatert,
)
}
Expand Down
9 changes: 4 additions & 5 deletions src/test/kotlin/no/nav/syfo/rules/periode/PeriodeRulestest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PeriodeRulestest :
status.treeResult.status shouldBeEqual Status.OK
status.rulePath.map { it.rule to it.ruleResult } shouldBeEqualTo
listOf(
PeriodeRules.FREMDATERT_MER_ENN_30_DAGER to false,
PeriodeRules.FREMDATERT to false,
PeriodeRules.TILBAKEDATERT_MER_ENN_3_AR to false,
PeriodeRules.TOTAL_VARIGHET_OVER_ETT_AAR to false
)
Expand Down Expand Up @@ -60,7 +60,7 @@ class PeriodeRulestest :
status.treeResult.status shouldBeEqualTo Status.INVALID
status.rulePath.map { it.rule to it.ruleResult } shouldBeEqualTo
listOf(
PeriodeRules.FREMDATERT_MER_ENN_30_DAGER to true,
PeriodeRules.FREMDATERT to true,
)

mapOf(
Expand All @@ -69,8 +69,7 @@ class PeriodeRulestest :
"fremdatert" to true
) shouldBeEqualTo status.ruleInputs

status.treeResult.ruleHit shouldBeEqualTo
PeriodeRuleHit.FREMDATERT_MER_ENN_30_DAGER.ruleHit
status.treeResult.ruleHit shouldBeEqualTo PeriodeRuleHit.FREMDATERT.ruleHit
}

test("Varighet over 1 år, Status INVALID") {
Expand Down Expand Up @@ -98,7 +97,7 @@ class PeriodeRulestest :
status.treeResult.status shouldBeEqualTo Status.INVALID
status.rulePath.map { it.rule to it.ruleResult } shouldBeEqualTo
listOf(
PeriodeRules.FREMDATERT_MER_ENN_30_DAGER to false,
PeriodeRules.FREMDATERT to false,
PeriodeRules.TILBAKEDATERT_MER_ENN_3_AR to false,
PeriodeRules.TOTAL_VARIGHET_OVER_ETT_AAR to true,
)
Expand Down

0 comments on commit 24a4098

Please sign in to comment.