- 
                Notifications
    You must be signed in to change notification settings 
- Fork 24
Open
Labels
good first issueGood for newcomersGood for newcomershacktoberfestIssues suitable for hacktoberfestIssues suitable for hacktoberfest
Description
The codebase has helper functions for creating various FHIR resources (e.g., create_condition, create_document_reference), but is missing a helper for creating DocumentReferenceContent objects. This makes it harder to build DocumentReference resources with content.
File: healthchain/fhir/helpers.py
Current TODO:
# TODO: create a function that creates a DocumentReferenceContent to add to the DocumentReferenceGoal:
Create a create_document_reference_content() helper function following the existing patterns in helpers.py.
Acceptance Criteria:
-  Function signature follows existing helper patterns (see create_condition, etc.)
- Supports common content types (at minimum: text/plain, text/html, application/pdf)
-  Returns a properly structured DocumentReferenceContentobject
- Includes comprehensive docstring with examples
-  Add unit tests in tests/fhir/test_helpers.py
-  Export function in healthchain/fhir/__init__.py
Suggested API:
def create_document_reference_content(
    attachment_data: str,
    content_type: str = "text/plain",
    language: str = "en-US",
    title: Optional[str] = None,
    **kwargs
) -> DocumentReferenceContent:
    """Create a FHIR DocumentReferenceContent object.
    
    Args:
        attachment_data: The content data (text or base64 encoded)
        content_type: MIME type (e.g., 'text/plain', 'application/pdf')
        language: Language code
        title: Optional title for the content
        **kwargs: Additional DocumentReferenceContent fields
    
    Returns:
        DocumentReferenceContent: A FHIR DocumentReferenceContent object
        
    Example:
        >>> content = create_document_reference_content(
        ...     "Patient presents with fever...",
        ...     content_type="text/plain",
        ...     title="Clinical Note"
        ... )
    """Resources:
- FHIR DocumentReference docs
- Study existing helpers in healthchain/fhir/helpers.pyfor patterns
- fhir.resourceslibrary documentation for DocumentReferenceContent
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershacktoberfestIssues suitable for hacktoberfestIssues suitable for hacktoberfest
Type
Projects
Status
Todo