phenopackets / domain-analysis

The goal of this repository is to collect and develop domain analysis content for the phenotypic domain.
https://phenopackets-analysis.rtfd.io/
Apache License 2.0
2 stars 0 forks source link

Temporality #22

Open ShahimEssaid opened 3 years ago

ShahimEssaid commented 3 years ago

Discussion thread for page: https://phenopackets-analysis.readthedocs.io/en/latest/domain-entities/temporality.html

ShahimEssaid commented 3 years ago

@rrfreimuth @pnrobinson would FHIR SimpleQuantity and Range be enough to capture Phenopackets' Age and AgeRange? We'll convert from the original PP ISO8601 string based on the smallest unit in the string and make that unit the unit for FHIR Quantity. There is still some lossiness with this but we can also capture the original string with this general extension on the Quantity datatype, with or without a profile on the datatype.

ShahimEssaid commented 3 years ago

For example, the age example here can be represented as shown below if we do some rough conversion with 25x365.25 + 3x30 + 2 and make the unit days. And also capture the original string. We can profile Quantity (so we can have a page in the IG to document this and bind the extension) and use this Quantity profile wherever we need to capture Age. Same for AgeRange. We profile FHIR Range to use our Quantity profile.

    {
      "resource": {
        "resourceType": "Observation",
        "code": {
          "text": "Age of something"
        },
        "valueQuantity": {
          "unit": "Days",
          "value": 274029.5,
          "system": "http://someUnitSystem",
          "code": "SomeDayUnitCode",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/originalText",
              "valueString": "P25Y3M2D"
            }
          ]
        }
      }
    }
pnrobinson commented 3 years ago

In general, I do not think we should worry about FHIR elements capturing all nuances of a phenopacket -- there are few compelling uses cases where we would transform a protobuf phenopacket into FHIR, the vast majority of interesting use cases are in the other direction (IMO). If we accept this, then we should try to be able to transform any valid FHIR modality for representing Age into one of the phenopacket representations.

pnrobinson commented 3 years ago

For instance, we do not expect to get an Age range for an individual patient from FHIR (this is not the way we would represent Age in an EHR). Therefore, we do not need to worry about this.

ShahimEssaid commented 3 years ago

Relevant FHIR chat: https://chat.fhir.org/#narrow/stream/179256-Orders-and.20Observation.20WG/topic/Observation.20onset