wso2healthcare/health.ccdatojson

0.1.0
CCDA to Flat JSON Transformer

This package provides implementation for converting Clinical Document Architecture (CCDA) XML documents to a flattened JSON structure. It supports parsing and transforming various types of clinical documents into a standardized JSON format.

Supported Document Types

The transformer currently supports the following CCDA document types:

  • Continuity of Care Document (CCD)
  • Progress Notes
  • Procedure Notes (TODO)
  • Care Plans (TODO)
  • Consultation Notes (TODO)
  • Operative Notes (TODO)
  • Referral Notes (TODO)
  • Discharge Summaries (TODO)

Features

The transformer extracts and maps the following sections from CCDA documents:

Document Information

  • Document type and code
  • Author information
  • Creation date
  • Document ID

Demographics

  • Patient information
  • Race and ethnicity
  • Language communication preferences
  • Guardian information
  • Birthplace details

Clinical Information

  • Allergies
  • Vital signs
  • Immunizations
  • Medications
  • Procedures
  • Problems/Diagnoses
  • Lab results
  • Assessment and plan
  • Plan of treatment
  • Instructions
  • Progress notes
  • Reason for visit
  • Care team information

Encounter Information

  • Encounter type
  • Encounter time (start/end)
  • Location details
  • Care team members

Usage

The transformer provides a main function getCCDSummaries that accepts an array of CCDA XML documents and returns an array of transformed summaries. The output is a flattened JSON structure that can be easily processed and integrated into other systems.

Output Structure

The transformed JSON includes the following main sections:

Copy
{
  "documentInfo": [...],
  "demographics": [...],
  "encounter": [...],
  "allergies": [...],
  "vitalSigns": [...],
  "immunizations": [...],
  "medications": [...],
  "procedures": [...],
  "problems": [...],
  "results": [...],
  "notes": [...],
  "reasonForVisits": [...],
  "assessmentAndPlans": [...],
  "planOfTreatments": [...],
  "instructions": [...],
  "assessments": [...],
  "careTeam": [...]
}

Implementation Details

The transformer uses Ballerina's CCDA parsing capabilities to process CCDA documents and maps the Record structure to a custom JSON format. It handles various CCDA sections and their specific data types, including:

  • Codes and code systems (LOINC, SNOMED CT, etc.)
  • Dates and time ranges
  • Measurements and units
  • References and relationships between sections
  • Text content and narrative blocks

Import

import wso2healthcare/health.ccdatojson;Copy

Metadata

Released date: 8 days ago

Version: 0.1.0


Compatibility

Platform: any

Ballerina version: 2201.12.3

GraalVM compatible: Yes


Pull count

Total: 16

Current verison: 16


Weekly downloads


Other versions

0.1.0