Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…missions into dev
  • Loading branch information
vvcb committed Mar 8, 2023
2 parents 311340b + d1642a7 commit c6edcd3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
8 changes: 5 additions & 3 deletions avoidable_admissions/data/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,19 @@ class Config:
AdmittedCareEpisodeSchema: pa.DataFrameSchema = (
AdmittedCareEpisodeSchema.to_schema().add_columns(
{
"diag_[0-9]{2}": pa.Column(
"diag_[0-9]{2}$": pa.Column(
str,
nullable=True,
regex=True,
# Modified from https://medium.com/@manabu.torii/regex-pattern-for-icd-10-cm-codes-5763bd66e26d and includes string match for 'nan'
checks=pa.Check.str_matches(r'^(?i:[A-Z][0-9][0-9AB](?:[0-9A-KXZ](?:[0-9A-EXYZ](?:[0-9A-HX][0-59A-HJKMNP-S]?)?)?)?|^\bnan\b$)$')
),
"opertn_[0-9]{2}": pa.Column(
"opertn_[0-9]{2}$": pa.Column(
str,
nullable=True,
regex=True,
),
"opdate_[0-9]{2}": pa.Column(
"opdate_[0-9]{2}$": pa.Column(
datetime,
nullable=True,
regex=True,
Expand Down
22 changes: 11 additions & 11 deletions docs/admitted_care_pipeline_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -1147,9 +1147,9 @@ HTML(out)
</tr>
<tr>
<th>Indeterminate</th>
<td>4</td>
<td>4###</td>
<td>3#.##</td>
<td>9</td>
<td>9###</td>
<td>6#.##</td>
<td>1###</td>
</tr>
Expand Down Expand Up @@ -1214,11 +1214,11 @@ HTML(out)
</tr>
<tr>
<th>Not known</th>
<td>0</td>
<td>1###</td>
<td>0#.##</td>
<td>1</td>
<td>1###</td>
<td>1#.##</td>
<td>1</td>
<td>1###</td>
</tr>
<tr>
<th>Not stated</th>
Expand Down Expand Up @@ -1348,7 +1348,7 @@ HTML(out)
<tr>
<th rowspan="6" valign="top">Admission Source</th>
<th>Care Home</th>
<td>2</td>
<td>2###</td>
<td>1#.##</td>
<td>1###</td>
<td>8#.##</td>
Expand All @@ -1364,9 +1364,9 @@ HTML(out)
</tr>
<tr>
<th>Penal</th>
<td>5</td>
<td>5###</td>
<td>5#.##</td>
<td>5</td>
<td>5###</td>
<td>5#.##</td>
<td>1###</td>
</tr>
Expand Down Expand Up @@ -1616,7 +1616,7 @@ HTML(out)
</tr>
<tr>
<th>Penal</th>
<td>3</td>
<td>3###</td>
<td>1#.##</td>
<td>2###</td>
<td>8#.##</td>
Expand Down Expand Up @@ -1683,15 +1683,15 @@ HTML(out)
</tr>
<tr>
<th>Not Applicable</th>
<td>0</td>
<td>1###</td>
<td>0#.##</td>
<td>1###</td>
<td>1#.##</td>
<td>1###</td>
</tr>
<tr>
<th>Unknown</th>
<td>0</td>
<td>1###</td>
<td>0#.##</td>
<td>1###</td>
<td>1#.##</td>
Expand Down

0 comments on commit c6edcd3

Please sign in to comment.