Skip to content

feat: add Huawei Health Kit connector schemas and specification - #423

Merged
yatharthranjan merged 14 commits into
devfrom
huawei_schemas
Jun 30, 2026
Merged

feat: add Huawei Health Kit connector schemas and specification#423
yatharthranjan merged 14 commits into
devfrom
huawei_schemas

Conversation

@yatharthranjan

@yatharthranjan yatharthranjan commented May 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds Avro schemas for Huawei Health Kit data types under commons/connector/huawei/
  • Adds connector specification specifications/connector/radar-huawei-connector-1.0.0.yml mapping Kafka topics (prefixed connect_huawei_) to their schemas
  • Covers instantaneous samples, continuous/aggregate statistics, health records, activity records, daily summaries, and women's health data types
  • All measurement fields are nullable with default: null; each record includes required time and timeReceived fields (epoch seconds)
  • Excludes GPS/location, height/weight, and sport-achievement data types by design
  • Merge main back to dev

Adds 87 Avro schemas covering the full Huawei Health Kit data surface
(instantaneous samples, continuous statistics, health records, activity
records, and women's health types) alongside the connector specification
mapping each type to a Kafka topic under the connect_huawei_* prefix.
- HuaweiVo2max -> HuaweiVo2Max, HuaweiVo2maxStatistics -> HuaweiVo2MaxStatistics
  (record name pattern requires each word segment to start uppercase)
- planID -> planId (consecutive uppercase fails lowerCamelCase field pattern)
Replace generic 'Value of Huawei field x' placeholders with meaningful
descriptions drawn from Huawei Health SDK (v6.16.0) Dart source and
HMS Core reference docs. 344 fields updated across 85 schemas, covering
units, value ranges, and enum meanings for all measurement types.
…r schema

- Rename huawei_vo2max.avsc -> huawei_vo2_max.avsc and
  huawei_vo2max_statistics.avsc -> huawei_vo2_max_statistics.avsc so
  snakeToCamelCase produces HuaweiVo2Max, matching the record name and
  preventing a Java filename/classname mismatch in code generation
- Rewrite three ventilator field docs that started with '95th-percentile'
  (a digit) to start with a capital letter as required by the validator
"default": null
},
{
"name": "activitySummary",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

check the actual props in this (likely not string)

…th Kit schemas

Replace generic placeholder docs ('Huawei Health Kit REST data for com.huawei.x.y.z.
See Huawei HMS Core Health Kit RESTful data type documentation.') with meaningful
descriptions covering what each data type measures and what fields it contains.
"null",
"int"
],
"doc": "Emotion status code detected by the device.",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

meaning of the code?

"null",
"string"
],
"doc": "Extended data field stored as a JSON string.",

@yatharthranjan yatharthranjan May 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

do these need to be a map or more typed record?

…n-time types

Schema consolidations (88 → 69 schemas):
- Remove active_hours_statistics: spec topic → HuaweiActiveHours
- Remove cgm_blood_glucose_statistics: merge avg/max/min/last into HuaweiCgmBloodGlucose
- Remove continuous_activity_fragment: spec topic → HuaweiContinuousActivityStatistics
- Remove body_temperature_rest_statistics + instantaneous_body_temperature_rest:
  spec topics → HuaweiContinuousBodyTemperatureStatistics / HuaweiInstantaneousBodyTemperature
- Remove continuous_calories_consumed: spec topic → HuaweiContinuousCaloriesBurnt
- Remove continuous_exercise_intensity_statistics: merge span field into HuaweiContinuousExerciseIntensity
- Remove health_record_ventilator schema and spec entry
- Remove instantaneous_exercise_heart_rate: spec topic → HuaweiInstantaneousHeartRate
- Unify instantaneous_activity_sample topic → HuaweiInstantaneousActivitySamples
- Create HuaweiStatistics (avg/max/min/last double) replacing 10 identical simple-stats schemas:
  body_temperature, skin_temperature, exercise_heart_rate, speed, steps_rate, stroke_rate,
  power, body_fat_rate, calories_bmr, heart_rate statistics + resting_heart_rate_statistics

endTime removed from 32 point-in-time schemas (all instantaneous.* non-stats types, plus
heart_rate_variability, emotion, vo2_max, cgm_blood_glucose, sleep_on_off_bed_record)
… and lab schemas

Remove 11 schemas outside the intended data collection scope:
cervical_mucus, cervical_status, menstrual_flow, nutrition_facts,
nutrition_facts_statistics, uric_acid, urine_routine_bilirubin,
urine_routine_glucose, urine_routine_nitrite, urine_routine_urobilinogen,
vaginal_speckle — and their corresponding spec entries.

69 → 58 schemas.
"null",
"string"
],
"doc": "Exercise intensity zone distribution stored as a JSON map.",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

again probably needs to be typed

"null",
"int"
],
"doc": "Menstrual cycle phase status code.",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

meaning of codes should be documented

"null",
"int"
],
"doc": "Menstrual cycle sub-status code providing additional phase detail.",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

meaning of codes should be documented

"null",
"int"
],
"doc": "Sleep respiratory measurement type code.",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

documentation of the codes is needed

… spec units

Schema consolidations (topics preserved, shared schemas):
- Merge bradycardia + tachycardia → HuaweiHealthRecordHeartRateAlert
- Merge instantaneous_resting_heart_rate → HuaweiInstantaneousHeartRate
- Merge instantaneous_skin_temperature → HuaweiInstantaneousBodyTemperature
- Merge instantaneous_activity_samples → HuaweiInstantaneousActivitySample
- Merge vo2_max_statistics → HuaweiStatistics (int cast to double)
- Merge instantaneous_stress_statistics → HuaweiStatistics (uses count field)
- Fix instantaneous_activity_sample: add typeOfActivity field
- Add count field to HuaweiStatistics (nullable, null for non-counting topics)

Removals (out of scope or redundant):
- dysmenorrhoea, instantaneous_hydrate, instantaneous_ovulation_detection,
  physical_symptoms

Spec improvements:
- Add measurement units to doc strings for all relevant topics
  (bpm, m/s, kcal, °C, %, mmol/L, mmHg, mL/(kg·min), ms, steps/min, etc.)

58 → 48 schemas.
@yatharthranjan
yatharthranjan changed the base branch from master to dev June 5, 2026 10:29
…umentation

- activity_record: expand activitySummary string → 5 typed sub-fields
  (avgPace, bestPace, paceMap, dataSummary, sectionSummary)
- emotion: document emotionStatus codes (1=bad … 5=excellent)
- exercise_intensity_v2_statistics: expand intensityMap string → 5 typed
  heart-rate zone duration fields (zone1Duration–zone5Duration, in seconds)
- health_record_menstrual_cycle: document status (1–4 cycle phases) and
  substatus codes
- sleep_respiratory_detail: document type codes (1=breathing rate,
  2=SpO2, 3=snore index) and value unit
- health_record_dynamic_bp: improve extendData doc with ABPM context
SNYK-JAVA-ORGAPACHELOGGINGLOG4J-15967769 and -15967804
(Improper Encoding or Escaping of Output, high severity)
SNYK-JAVA-COMFASTERXMLJACKSONCORE-15365924 and -15907551 require
jackson-core 2.21.x but jackson-module-kotlin 2.21.x requires Kotlin v2,
and this project is pinned to Kotlin 1.9.x. Ignoring until Kotlin is upgraded.
@yatharthranjan
yatharthranjan marked this pull request as ready for review June 5, 2026 12:26
@yatharthranjan
yatharthranjan merged commit 8f61c9b into dev Jun 30, 2026
2 of 3 checks passed
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.

1 participant