Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanSteinberg committed Aug 16, 2024
1 parent aa329ad commit 2a2ad6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ dataset_metadata = {
"etl_name": {"type": "string"},
"etl_version": {"type": "string"},
"meds_version": {"type": "string"},
"created_at": {"type": "string"},
"created_at": {"type": "string"}, # Should be ISO 8601
},
}

Expand All @@ -174,7 +174,7 @@ DatasetMetadata = TypedDict(
"etl_name": NotRequired[str],
"etl_version": NotRequired[str],
"meds_version": NotRequired[str],
"created_at": NotRequired[str],
"created_at": NotRequired[str], # Should be ISO 8601
},
total=False,
)
Expand All @@ -183,12 +183,21 @@ DatasetMetadata = TypedDict(
#### The code metadata schema.

```python
# Code metadata must contain at least one row for every unique code in the dataset
def code_metadata(custom_per_code_properties=[]):
return pa.schema(
[
("code", pa.string()),

("description", pa.string()),

("parent_codes", pa.list(pa.string()),
# parent_codes must be a list of strings, each string being a higher level
# code that represents a generalization of the provided code. Parent codes
# can use any structure, but is recommended that they reference OMOP concepts
# whenever possible, to enable use of more generic labeling functions and OHDSI tools.
# OMOP concepts are referenced in these strings via the format "$VOCABULARY_NAME/$CONCEPT_NAME".
# For example: "ICD9CM/487.0" would be a reference to ICD9 code 487.0
] + custom_per_code_properties
)

Expand Down
8 changes: 8 additions & 0 deletions src/meds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
DatasetMetadata,
Label,
birth_code,
code_field,
code_metadata_schema,
data_schema,
dataset_metadata_schema,
death_code,
held_out_split,
label_schema,
subject_id_dtype,
subject_id_field,
subject_split_schema,
time_field,
train_split,
tuning_split,
)
Expand All @@ -31,6 +35,10 @@
"DatasetMetadata": DatasetMetadata,
"birth_code": birth_code,
"death_code": death_code,
"subject_id_field": subject_id_field,
"time_field": time_field,
"code_field": code_field,
"subject_id_dtype": subject_id_dtype,
}

__all__ = list(_exported_objects.keys())

0 comments on commit 2a2ad6c

Please sign in to comment.