Skip to content

Commit

Permalink
Refactor constrains for non-sensical smoking fields combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
arschat committed Sep 5, 2024
1 parent 1735684 commit 2ce72eb
Showing 1 changed file with 35 additions and 30 deletions.
65 changes: 35 additions & 30 deletions json_schema/module/biomaterial/medical_history.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,37 +80,42 @@
"example": "Patient treated with antibiotics for a urinary tract infection; Patient treated with chemotherapy (Epirubicin, cisplatin, capecitabine) to treat stomach cancer"
}
},
"if": {
"properties": {
"smoking_status": {
"const": "active"
}
}
},
"then": {
"properties": {
"years_since_smoking_cessation": {
"maximum": 0
}
}
},
"else": {
"if": {
"properties": {
"smoking_status": {
"const": "never"
}
}
},
"then": {
"properties": {
"years_since_smoking_cessation": {
"type": "null"
"allOf":
[
{
"if": {
"properties": {
"smoking_status": {
"const": "active"
}
}
},
"smoking_pack_years": {
"maximum": 0
"then": {
"properties": {
"years_since_smoking_cessation": {
"maximum": 0
}
}
}
},
{
"if": {
"properties": {
"smoking_status": {
"const": "never"
}
}
},
"then": {
"properties": {
"years_since_smoking_cessation": {
"type": "null"
},
"smoking_pack_years": {
"maximum": 0
}
}
}
}
}
}
]
}

0 comments on commit 2ce72eb

Please sign in to comment.