Apple & iOS
AuraScore 83/100

Clinical ResearchKit and HealthKit Pipeline Architecture Framework

Design an end-to-end iOS data collection framework for decentralized clinical trials using HealthKit and ResearchKit.

Use this template when planning clinical trial data acquisition on iOS devices. It establishes a structured blueprint for sensor data extraction, participant consent verification, and secure payload transport.

Template

Role: Principal iOS Healthcare Solutions Architect specializing in decentralized clinical trial systems.

Context

  • Clinical Trial Program: {{clinical_trial_name}}
  • Primary Clinical Metrics: {{target_health_metrics}}
  • Minimum iOS Target: {{ios_deployment_target}}
  • Regulatory Compliance Standard: {{compliance_standard}}
  • Telemetry Sync Schedule: {{sync_frequency}}
  • Encryption Standard: {{encryption_standard}}

Task

Synthesize an architectural data pipeline framework that guides development teams in capturing {{target_health_metrics}} via HealthKit and ResearchKit for {{clinical_trial_name}} while upholding {{compliance_standard}} requirements.

Method

  1. Define the HealthKit permission acquisition sequence, isolating explicit granular permissions for {{target_health_metrics}}.
  2. Map ResearchKit dynamic informed consent workflows, including electronic signature capture and PDF document archival.
  3. Formulate background query triggers (HKObserverQuery and HKAnchoredObjectQuery) tuned to {{sync_frequency}}.
  4. Design the on-device CoreData/SQLite staging schema with {{encryption_standard}} at-rest safeguards.
  5. Structure the payload normalization layer converting HealthKit samples into HL7 FHIR Observation resources.
  6. Establish transient network retry logic and circuit-breaking protocols for low-connectivity environments.
  7. Detail participant audit trail logging mechanisms that avoid persisting Protected Health Information (PHI) in system logs.

Constraints

  • MUST restrict all HealthKit queries to background-safe, anchor-based batch APIs.
  • MUST enforce zero unencrypted intermediate caches on the local iOS file system.
  • MUST NOT request write permissions for health metrics unless explicitly required by the study protocol.
  • Do not include proprietary third-party SDK dependencies outside native Apple frameworks and standard FHIR parsers.

Output format

Provide the architecture framework organized into these distinct sections:

  1. Pipeline Topology Diagram (ASCII or clear structured schema)
  2. Framework Component Specifications (HealthKit Querying, ResearchKit Consent, FHIR Serialization)
  3. Failure Mode and Recovery Matrix (4 common clinical edge cases)
  4. Security and Storage Policy (addressing {{encryption_standard}} and {{compliance_standard}})

Self-review

  • Confirm all 6 method steps directly reference {{target_health_metrics}} and {{sync_frequency}}.
  • Verify that both MUST and MUST NOT constraint rules are cleanly reflected in the final output specification.
  • Ensure no placeholder text or generic boilerplate remains in the delivered framework.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-apple
healthcare-life-sciences
healthkit
researchkit
clinical-trials