Skip to content

Commit

Permalink
Merge pull request #27 from ImageMarkup/add-fitzpatrick-skin-type
Browse files Browse the repository at this point in the history
  • Loading branch information
danlamanna authored Mar 5, 2024
2 parents 0123879 + c72a9ea commit f09c5af
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions isic_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Field:
"color_tint",
"patient_id",
"lesion_id",
"skin_type",
]:
FIELD_REGISTRY[field] = Field(
search=SearchConfig(
Expand Down
9 changes: 9 additions & 0 deletions isic_metadata/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,12 @@ class ColorTintEnum(str, Enum):
blue = "blue"
pink = "pink"
none = "none"


class SkinType(str, Enum):
type_i = "I"
type_ii = "II"
type_iii = "III"
type_iv = "IV"
type_v = "V"
type_vi = "VI"
2 changes: 2 additions & 0 deletions isic_metadata/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
MelThickMm,
MelTypeEnum,
NevusTypeEnum,
SkinType,
TBPTileTypeEnum,
)

Expand Down Expand Up @@ -159,6 +160,7 @@ class MetadataRow(BaseModel):
clin_size_long_diam_mm: (
Annotated[float, BeforeValidator(ClinSizeLongDiamMm.parse_measurement_str)] | None
) = None
skin_type: SkinType | None = None
melanocytic: bool | None = None
concomitant_biopsy: bool | None = None

Expand Down
4 changes: 4 additions & 0 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def test_age_special_case():
assert MetadataRow.model_validate({"age": "85+"}).age == 85


def test_skin_type():
MetadataRow.model_validate({"skin_type": "I"})


def test_benign_malignant():
MetadataRow.model_validate({"benign_malignant": "benign"})

Expand Down

0 comments on commit f09c5af

Please sign in to comment.