# 10 Point Wound Assessment Import Script

This Python script imports the 10 Point Wound Assessment data from the DMT JSON file into Firebase, structuring it exactly as the WPA Builder would create it.

## Prerequisites

1. Python 3.7 or higher
2. Firebase Admin SDK credentials
3. The assessment JSON file

## Setup

1. Install the required dependencies:
   ```bash
   pip install -r requirements.txt
   ```

2. Ensure your Firebase service account key file is in the project root:
   ```
   logit-learning-firebase-adminsdk-fbsvc-3162c5d079.json
   ```

3. Ensure the assessment JSON file exists:
   ```
   assets/data/dmt/10_point_wound_assessment.json
   ```

## Usage

Run the script from the project root directory:

```bash
python import_wound_assessment.py
```

## What the Script Does

The script performs the following actions:

1. **Loads the original DMT assessment data** from the JSON file
2. **Maps the data to WPA Builder format**:
   - Creates main assessment document with proper metadata
   - Converts wound assessment points to WPA criteria
   - Extracts detailed guidance into "what to look for" lists
   - Preserves all original assessment information
3. **Imports to Firebase**:
   - Creates the assessment in the `assessments` collection
   - Adds criteria as subcollection documents
   - Uses proper Firebase timestamps and data types

## Data Mapping

The script maps the DMT assessment structure to WPA Builder format:

- `assessment_info` → Main assessment metadata
- `wound_assessment_points` → WPA criteria with detailed guidance
- `grading` → Assessment grading configuration
- `additional_requirements` → Assessment settings
- `key_learning_points` → Included in instruction text

## Output

After successful execution, the assessment will be available in:
- Firebase Firestore under `/assessments/{assessment_id}`
- WPA Management Screen in the Flutter app
- DMT Assessment Viewer (maintains compatibility)

## Assessment Details

- **Assessment ID**: Uses original DMT assessment ID
- **Assessment Code**: `WPA-WOUND-10PT`
- **Type**: `practical_skills`
- **Criteria Count**: 10 (one for each wound assessment point)
- **Data Source**: `dmt_import`

The imported assessment maintains full compatibility with both the WPA Builder interface and the existing DMT viewer functionality.
