Skip to content

Commit

Permalink
fix: fixes issues with v0.6.0
Browse files Browse the repository at this point in the history
* Corrects the description of the sample metadata
  `tumor_tissue_morphology` to be specified as a struct. Additionally,
  add the `icd_o_3` code as a named struct field so that it will be
  named in the wiki.
* Adds the `age_at_vital_status` subject metadata to
  `get_field_descriptions()` so that it will be included in the wiki
  page generation.
  • Loading branch information
claymcleod committed Jan 16, 2024
1 parent a046332 commit 36ddaf9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/ccdi-cde/src/v1/sample/tumor_tissue_morphology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ use crate::CDE;
/// <https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=11326261%20and%20ver_nr=1>
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, ToSchema, Introspect)]
#[schema(as = cde::v1::sample::TumorTissueMorphology)]
pub struct TumorTissueMorphology(
pub struct TumorTissueMorphology {
/// The ICD-O-3 code.
String,
);
icd_o_3: String,
}

impl From<String> for TumorTissueMorphology {
fn from(value: String) -> Self {
TumorTissueMorphology(value)
TumorTissueMorphology { icd_o_3: value }
}
}

impl CDE for TumorTissueMorphology {}

impl std::fmt::Display for TumorTissueMorphology {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
write!(f, "{}", self.icd_o_3)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl description::r#trait::Description for cde::v1::sample::TumorTissueMorpholog
let members = Self::members().unwrap();

description::Description::Harmonized(Harmonized::new(
Kind::Enum,
Kind::Struct,
String::from("tumor_tissue_morphology"),
entity.description().to_string(),
Url::try_from("https://github.com/CBIIT/ccdi-federation-api/wiki/Sample-Metadata-Fields#tumor_tissue_morphology").unwrap(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub fn get_field_descriptions() -> Vec<description::Description> {
cde::v2::subject::Ethnicity::description(),
cde::v1::subject::Identifier::description(),
cde::v1::subject::VitalStatus::description(),
crate::subject::metadata::AgeAtVitalStatus::description(),
]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ccdi-spec/src/utils/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fn write_variant_members(
// member in the `members` list is a [`Member::Variant`]. If the
// first element is a [`Member::Variant`], then all of them should
// be.
_ => unreachable!(),
v => unreachable!("{:?}", v),
};

// Write the row.
Expand Down

0 comments on commit 36ddaf9

Please sign in to comment.