Building an AI-Powered Preconception Health Guide: My Journey Through Shanghai's Medical System

Dev.to / 3/31/2026

💬 OpinionIdeas & Deep AnalysisTools & Practical Usage

Key Points

  • The article describes the authors’ struggle to navigate Shanghai’s complex preconception healthcare system, including many hospitals, overlapping screening packages, confusing terminology, and conflicting advice.
  • It explains the motivation for building “Health Agent,” an AI-powered guide designed specifically to make sense of the preconception planning phase rather than focusing only on after conception.
  • Health Agent is positioned as a tailored AI system that recommends appropriate preconception screening packages based on user profile details like age, medical history, and concerns.
  • The authors emphasize that their approach aims to reduce anxiety and overwhelm by translating the “medical maze” into clearer, more personalized next steps aligned with Shanghai’s ecosystem.

Building an AI-Powered Preconception Health Guide: My Journey Through Shanghai's Medical System

Honestly, when my partner and I decided to start trying for a baby, I thought it would be as simple as "stop using birth control and let nature take its course." Oh, how naive I was. What followed was three months of medical appointments, confusing terminology, overwhelming choices, and enough paperwork to make anyone reconsider parenthood entirely.

This is the story behind Health Agent - our attempt to tame the chaos of preconception healthcare in China's megacity, using AI to make sense of it all.

The Problem: Navigating Shanghai's Medical Maze

Shanghai has world-class medical facilities, but trying to understand the preconception landscape felt like drinking from a firehose. There were:

  • Hundreds of hospitals with varying specialties
  • Dozens of preconception screening packages at different price points
  • Medical terminology that could make a medical student pause
  • Conflicting advice from friends, family, and online forums

I remember sitting in our apartment surrounded by brochures, laptop open with multiple tabs, phone buzzing with WhatsApp messages from well-meaning relatives. "Have you checked the Peking University hospital?" "What about United Family?" "My cousin said you need the platinum package!"

The stress was almost defeating what we were trying to achieve.

The Spark: "There Has to Be a Better Way"

It was during one particularly overwhelming evening that I had the "aha" moment. I'm a developer by trade, and my partner works in healthcare analytics. We looked at each other and said: "Why hasn't someone built this yet?"

Most pregnancy apps focus on after conception. But the preparation phase - the preconception screening, the lifestyle optimization, the medical consultations - is where so much anxiety lives.

So we started Health Agent.

What Health Agent Actually Does

At its core, Health Agent is an AI-driven preconception health guide specifically tailored for Shanghai's medical ecosystem. Here are the key features:

1. Smart Package Recommendation

The system analyzes your age, medical history, and specific concerns to recommend the most appropriate screening packages. Unlike generic recommendations that might suggest the most expensive option, our AI considers:

// Simplified package recommendation logic
const recommendPackage = (userProfile, availablePackages) => {
  // Score packages based on relevance
  const scoredPackages = availablePackages.map(pkg => {
    let score = 0;

    // Age-based recommendations
    if (userProfile.age >= 35 && pkg.includesAdvancedAgeScreening) {
      score += 30;
    }

    // Medical history matching
    userProfile.healthConditions.forEach(condition => {
      if (pkg.coveredConditions.includes(condition)) {
        score += 20;
      }
    });

    // Budget considerations
    if (userProfile.budget.max >= pkg.price && pkg.price >= userProfile.budget.min) {
      score += 15;
    }

    return { ...pkg, score };
  });

  return scoredPackages.sort((a, b) => b.score - a.score)[0];
};

2. Hospital Comparison Engine

We scraped and standardized data from over 50 hospitals in Shanghai, comparing them on multiple dimensions:

  • Specialization in women's health
  • English language capabilities
  • Location and accessibility
  • Average wait times
  • Insurance acceptance

3. Medical Terminology Decoder

One of the biggest stress points was not understanding the medical terminology. Our AI system:

  • Explains complex medical terms in plain language
  • Provides context for why certain tests are important
  • Offers visual aids and analogies to understand procedures

4. AI Health Consultant

Perhaps the most valuable feature is our AI consultant that answers questions 24/7. It's trained on:

  • Official medical guidelines
  • Trusted medical literature
  • Real questions from users
  • Cultural context specific to Shanghai

The Technical Challenge: Building Trust in AI Healthcare

Building an AI for healthcare is... complicated. We learned this the hard way.

Data Quality Issues

Our first attempt failed miserably because we used web-scraped data without proper validation. The AI was confidently recommending outdated screening protocols because it found an old hospital webpage.

Lesson learned: Never trust random internet data for healthcare decisions. We now source all medical guidelines directly from official health organizations and manually verify every piece of information.

The "Black Box" Problem

Patients need to understand why the AI makes certain recommendations. We implemented explainability features:

class HealthRecommendationEngine:
    def explain_recommendation(self, user_profile, recommendation):
        explanation = {
            "recommendation": recommendation.test_name,
            "reason": [],
            "confidence": 0.0,
            "evidence": []
        }

        # Explain based on age
        if user_profile.age >= 35:
            explanation["reason"].append(f"Advanced maternal age increases risk for {recommendation.risk_factor}")
            explanation["confidence"] += 0.4

        # Explain based on medical history
        if user_profile.has_history_of(recommendation.indicator):
            explanation["reason"].append(f"Your history of {recommendation.indicator} makes this test particularly relevant")
            explanation["confidence"] += 0.3

        # Explain based on guidelines
        explanation["evidence"].append(recommendation.citation)

        return explanation

Cultural Context Matters

A system that works in New York doesn't necessarily work in Shanghai. We had to adapt for:

  • Family involvement patterns (extended family often has significant input)
  • Dietary considerations (traditional beliefs about pregnancy preparation)
  • Healthcare access patterns (mix of public and private systems)
  • Language nuances (medical English vs conversational English)

What We Got Right (The Pros)

1. Real User Impact

After six months of testing, we've helped over 500 couples navigate their preconception journey. The feedback has been incredible:

"I was so overwhelmed before finding Health Agent. The AI explained everything in a way that made sense, and I actually felt prepared for my appointments instead of terrified." - Sarah, 32

2. Time Savings

Users report saving an average of 15 hours of research time. No more endless Google searches, no more confusing spreadsheets, no more trying to compare hospital websites that use completely different formats.

3. Reduced Anxiety

The AI provides clear, step-by-step guidance, which significantly reduces the decision fatigue that comes with healthcare planning.

4. Personalization

Generic health apps are just that - generic. Health Agent adapts to your specific situation, whether you're 25 and healthy or 40 with existing conditions.

Where We Still Struggle (The Cons)

1. Medical Disclaimer Nightmare

Getting the legal language right has been a constant challenge. We have to balance being helpful with not overstepping into medical advice territory. This means sometimes the AI is overly cautious.

2. Keeping Information Current

Medical guidelines change, hospitals update their services, new research emerges. Maintaining accurate, up-to-date information is a full-time job in itself.

3. The "Human Touch" Gap

No matter how sophisticated the AI, there are moments when you just need to talk to another human. We're working on hybrid AI-human consultation models, but it's complex to scale.

4. Data Privacy Concerns

Health data is incredibly sensitive. We've had to implement security measures that would make a bank blush - encrypted data, strict access controls, regular audits.

The Hard Lessons: What I Learned the Hard Way

1. Building AI for Healthcare is Not Like Building a Regular App

The stakes are infinitely higher. A spelling mistake in a shopping app is annoying. A mistake in medical guidance can have serious consequences. We triple-check everything.

2. User Education is Part of the Product

We assumed people would understand how to use an AI health assistant. Wrong. We had to build extensive onboarding and education materials to help users understand both the capabilities and limitations.

3. Regulatory Compliance is Non-Negotiable

China's healthcare regulations are strict, for good reason. We've spent countless hours ensuring compliance while still providing useful functionality.

4. Patience is Essential

Healthcare moves at glacial speed compared to tech. What might take a week to build in a regular app takes months to validate and implement in healthcare.

Looking Forward: What's Next?

We're working on some exciting features:

  • Integration with wearable devices to track health metrics
  • Telemedicine consultations through the platform
  • Post-conception support to continue the journey
  • Expanded to other major Chinese cities

But our core mission remains the same: to make the preconception journey less overwhelming and more empowering.

The Big Question

As we continue to build and iterate, I'm constantly asking myself: How can we maintain the balance between AI efficiency and human empathy in healthcare?

Technology can provide information, recommendations, and efficiency. But healthcare is fundamentally human. How do we ensure that as we scale, we don't lose that human touch?

I'd love to hear your thoughts. Have you used AI for healthcare decisions? What worked well, and where did it fall short? What features would you want to see in a health AI assistant?

Let's continue the conversation in the comments!