Digital Health Platform

    Scripted Healthcare Platform

    A comprehensive digital health platform connecting pharmacies, clinics, doctors, and patients with integrated Healthcare Conformance Service support for seamless healthcare delivery across Australia.

    HI Conformance
    IHI Search & Verification
    Audit Trail Compliant

    Software Product Name

    Scripted

    Version

    2.0.0

    Product Description

    Scripted is a comprehensive digital health platform designed to streamline healthcare delivery across Australia. The platform consists of two interconnected applications:

    • High-Level Application (Scripted V2): A centralized management portal for pharmacies, clinic administrators, and super administrators to manage treatments, prescriptions, orders, and inventory across multiple healthcare organizations.
    • Low-Level Application (Scripted Clinic V2): A patient-facing and doctor-facing application that provides individual clinic portals with features for patient management, consultations, prescriptions, and direct healthcare delivery.

    The platform integrates with the Healthcare Conformance Service to support Individual Healthcare Identifier (IHI) search, verification, and management, ensuring compliance with Australian healthcare regulations.

    Loading architecture diagram...

    Shared Database

    PostgreSQL database hosted on Supabase, shared between high-level and low-level applications for data consistency.

    Authentication

    Clerk authentication with role-based access control for pharmacyAdmin, clinicAdmin, doctor, and patient roles.

    Real-time Communication

    Convex for real-time messaging between doctors and patients with LiveKit integration for video consultations.

    HI Service

    AWS-hosted HI Service proxy for IHI search, verification, and batch revalidation with full audit trail.

    The high-level application serves as the administrative backbone of the Scripted platform, providing centralized management capabilities for pharmacies and clinic administrators.

    Pharmacy Portal

    • • Treatment/Medicine management
    • • Stock & inventory control
    • • Order processing
    • • Prescription dispensing
    • • Starshipit shipping integration
    • • Clinic allocation management

    Clinic Admin Portal

    • • Patient management
    • • IHI search & verification
    • • Doctor management
    • • Prescription oversight
    • • Order tracking
    • • Refund management

    Super Admin Portal

    • • Platform-wide oversight
    • • Organization management
    • • User role management
    • • System configuration
    • • Audit log access
    • • HI Service monitoring

    Key Features

    Multi-tenant organization support
    Treatment catalog management
    Prescription workflow automation
    Order lifecycle management
    Stock level monitoring with alerts
    Shipping integration (Starshipit)
    Payment processing (Till Payments, Stripe)
    HI Service integration for IHI lookup
    Comprehensive audit logging
    Rich text medicine information
    Batch import/export (Excel)
    Real-time notifications

    The low-level application provides individual clinic portals with patient-facing and doctor-facing interfaces. Each clinic operates under their own subdomain with customizable branding and workflows.

    Patient Portal

    • • Self-registration & onboarding
    • • Consultation booking (Calendly)
    • • Video consultations (LiveKit)
    • • Prescription viewing & ordering
    • • Order tracking
    • • Medical history uploads
    • • Secure messaging with doctors
    • • Payment processing

    Doctor Portal

    • • Patient consultation management
    • • E-prescription creation
    • • Patient medical records
    • • Consultation notes (templates)
    • • Calendar integration
    • • Video call initiation
    • • Secure patient messaging
    • • Prescription history

    Medical Product System

    Specialized workflow for products requiring pathology testing before consultation.

    • • Pathology flag on products
    • • Waiting room for results
    • • Template-based checkout
    • • Cart-based purchasing

    Dynamic Clinic Routing

    // URL Structure for clinic-specific portals
    /[clinicSlug]/patient/dashboard    → Patient Dashboard
    /[clinicSlug]/doctor/dashboard     → Doctor Dashboard
    /[clinicSlug]/admin                → Clinic Admin
    
    // Example URLs:
    /scripted-clinic/patient/dashboard
    /wellness-centre/doctor/dashboard

    Healthcare Identifiers (HI) Service Integration: The platform has built-in conformance with the HI Service for healthcare identifier management, ensuring compliance with Australian digital health standards.

    Supported HI Service Operations

    IHI Search

    Search for Individual Healthcare Identifiers using demographic information including Medicare number, name, date of birth, and sex.

    IHI Verification

    Verify and validate IHI numbers against the HI Service with automatic status tracking (Active, Deceased, Retired).

    Batch IHI Revalidation

    Bulk revalidation of existing IHI records to ensure currency and accuracy of patient identifiers.

    Error Logging

    Comprehensive logging of all HI Service errors including error codes, messages, timestamps, and auto-resolution tracking.

    Audit Trail

    7-year retention audit trail for all healthcare identifiers disclosed by the HI Service, compliant with regulations.

    Patient Merge

    IHI-verified patient record merging with full audit logging.

    HI Service API Integration

    // IHI Search Request Format
    POST /api/hi/search
    {
      "familyName": "SMITH",
      "givenName": "JOHN",
      "dateOfBirth": "1990-01-15",
      "sex": "Male",
      "medicareCardNumber": "1234567890",
      "medicareIRN": "1"
    }
    
    // Response includes:
    // - ihiNumber: 16-digit IHI
    // - ihiStatus: Active, Deceased, Retired
    // - ihiRecordStatus: Verified, Unverified, Provisional

    Healthcare Identifiers Stored

    IdentifierEntityFields Stored
    IHIPatientihiNumber, ihiStatus, ihiRecordStatus, ihiVerifiedAt
    HPI-IDoctorhpiiNumber, hpiiStatus, hpiiRecordStatus, hpiiVerifiedAt
    HPI-OOrganizationhpioNumber, hpioData, hpioUpdatedAt

    Scripted is committed to ongoing conformance with Australian digital health standards. Below is our roadmap for conformance initiatives:

    HI Service Conformance

    Completed

    Full integration with Healthcare Identifiers Service for IHI search, verification, batch revalidation, error logging, and audit trail compliance.

    Electronic Prescription (eRx)

    Planned

    Integration with the Electronic Prescription Service for digital prescription creation, token generation, and prescription exchange.

    Dispensing Conformance

    Future

    Full dispensing workflow integration including prescription claiming, supply records, and integration with pharmacy dispensing systems.

    The platform uses Prisma ORM with PostgreSQL (Supabase) as the primary database. Key entities and their relationships are outlined below.

    Patient
    • Demographics
    • Medicare/DVA
    • IHI fields
    • Medical history
    • Consent records
    • Merge tracking
    Doctor
    • Profile & credentials
    • HPI-I fields
    • Provider numbers
    • Calendly integration
    • Prescriptions
    Prescription
    • Medication details
    • Dosage & repeats
    • Course type (SNOMED CT-AU)
    • eRx token
    • Expiry tracking
    Order / PrescriptionOrder
    • Order items
    • Payment status
    • Shipping details
    • Starshipit integration
    • Tracking
    Treatment / ClinicTreatment
    • Medicine catalog
    • Pricing
    • Stock levels
    • Drug class
    • Pharmacy allocation
    HI Service Logs
    • HIServiceErrorLog
    • HIServiceAuditLog
    • PatientMergeLog
    • 7-year retention

    Authentication

    Clerk-based authentication with multi-factor authentication support and session management.

    Authorization

    Role-based access control (RBAC) with organization-level permissions for pharmacyAdmin, clinicAdmin, doctor, and patient roles.

    Data Protection

    Encrypted data at rest and in transit. PostgreSQL Row Level Security (RLS) policies via Supabase.

    Audit Logging

    Comprehensive change logs for all data modifications. HI Service audit trail with 7-year retention.

    Compliance Features

    • HI Service error logging with full error tracking
    • Healthcare identifier audit trail (7-year retention)
    • Patient merge audit logging
    • Consent management for health records disclosure
    • SNOMED CT-AU course type reference set for prescriptions
    • Medicare/DVA number validation

    Frontend

    • • Next.js 14 (App Router)
    • • React 18
    • • TypeScript 5
    • • Tailwind CSS
    • • Radix UI Components
    • • Framer Motion
    • • TanStack Query (React Query)
    • • Zustand (State Management)

    Backend & Database

    • • Next.js API Routes
    • • Prisma ORM 6.7
    • • PostgreSQL (Supabase)
    • • Convex (Real-time)
    • • AWS (HI Service Proxy)

    Integrations

    • • Clerk (Authentication)
    • • Stripe / Till Payments
    • • Starshipit (Shipping)
    • • Calendly (Scheduling)
    • • LiveKit (Video Calls)
    • • Twilio (SMS)
    • • OpenAI (AI Summary)
    • • Resend (Email)

    Deployment

    • • Vercel (Frontend hosting)
    • • AWS ECR/ECS (HI Service)
    • • Supabase (Database)
    • • Convex Cloud

    Ready to Get Started?

    For detailed onboarding instructions and setup guides, please refer to our comprehensive onboarding documentation.

    View Onboarding Guide