Skip to content

feat: add ClinicalImpression helper and enhance Observation categorization#194

Open
DinhLucent wants to merge 2 commits intodotimplement:mainfrom
DinhLucent:feat/clinical-impression-and-obs-category
Open

feat: add ClinicalImpression helper and enhance Observation categorization#194
DinhLucent wants to merge 2 commits intodotimplement:mainfrom
DinhLucent:feat/clinical-impression-and-obs-category

Conversation

@DinhLucent
Copy link
Copy Markdown

This PR introduces support for Clinical Reasoning outputs in the FHIR resource helpers:

  • ClinicalImpression Helper: Added create_clinical_impression and add_finding_to_clinical_impression to support AI agents recording diagnostic assessments.
    • Observation Categorization: Enhanced create_value_quantity_observation to support the category element, enabling better filtering (e.g. vital-signs, laboratory) and FHIR profile compliance.
    • Standard Compliance: Fixed timestamp formatting to use standard ISO 8601 with colon offsets for better Pydantic validator compatibility.
      These additions are crucial for building autonomous clinical agents that need to output structured evidence-based findings.

Copy link
Copy Markdown
Contributor

@adamkells adamkells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @DinhLucent , great work on this. Apologies for the delay in reviewing. I've added a few minor comments.

Additionally, it would be great to add some tests for this and also add these methods to healthchain/fhir/init.py.

Also, I'd be really interested to learn more about the use case that motivates these additions.

status: str = "completed",
description: Optional[str] = None,
date: Optional[str] = None,
version: Optional[Union["FHIRVersion", str]] = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Union isn't imported earlier in the file.

if not impression.finding:
impression.finding = []

impression.finding.append(finding)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are appending a raw dict, it would be better to import from Fhir.resources and use ClinicalImpressionFinding(**finding).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants