<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ship It Anyway]]></title><description><![CDATA[Ship It Anyway]]></description><link>https://smarter.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 06:49:35 GMT</lastBuildDate><atom:link href="https://smarter.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Decoding Doctor’s Handwriting: How I Built SmartRx to Read & Translate Prescriptions with AI]]></title><description><![CDATA[Ever squinted at a doctor’s handwriting, trying to decode what to buy from the pharmacy? 😮‍💨
You’re not alone……. medical prescriptions are famously hard to read, and even harder to understand if they’re packed with technical jargon or written in a ...]]></description><link>https://smarter.hashnode.dev/decoding-doctors-handwriting-how-i-built-smartrx-to-read-and-translate-prescriptions-with-ai</link><guid isPermaLink="true">https://smarter.hashnode.dev/decoding-doctors-handwriting-how-i-built-smartrx-to-read-and-translate-prescriptions-with-ai</guid><category><![CDATA[AI]]></category><category><![CDATA[#ai-tools]]></category><category><![CDATA[agentic AI]]></category><category><![CDATA[GPT 4]]></category><category><![CDATA[openai]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Katasani Keerthana Reddy]]></dc:creator><pubDate>Sat, 19 Jul 2025 04:08:14 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-ever-squinted-at-a-doctors-handwriting-trying-to-decode-what-to-buy-from-the-pharmacy">Ever squinted at a doctor’s handwriting, trying to decode what to buy from the pharmacy? 😮‍💨</h2>
<p>You’re not alone……. medical prescriptions are famously hard to read, and even harder to understand if they’re packed with technical jargon or written in a language you’re not comfortable with.</p>
<p><a target="_blank" href="https://github.com/Keerthanareddy17/SmartRx"><strong>SmartRx</strong></a> is my tiny attempt to fix that. It’s a simple AI-powered tool that reads handwritten or printed prescriptions, extracts the key details, summarizes them in plain language, and even translates them to your local language, all in a few seconds, right from your browser.</p>
<p>Whether you’re a patient, a caregiver, or a busy pharmacist, SmartRx aims to turn messy scribbles into clear, shareable instructions, and bring a little more peace of mind when dealing with your health.</p>
<h2 id="heading-what-problem-does-smartrx-exactly-solve">What Problem Does SmartRx “exactly” Solve? 👀</h2>
<p>If you’ve ever stood at a pharmacy counter, second-guessing what’s scribbled on that piece of paper, you know the struggle:</p>
<ul>
<li><p><strong>Unreadable handwriting:</strong> Many prescriptions are handwritten in a rush, and can be tough to decode, even for pharmacists.</p>
</li>
<li><p><strong>Medical jargon:</strong> Dosages, frequencies, and medicine names can confuse patients and caregivers who aren’t from a medical background.</p>
</li>
<li><p><strong>Language barriers:</strong> Not everyone reads or speaks the language the prescription is written in, especially in multilingual places like India.</p>
</li>
<li><p><strong>No easy way to share:</strong> Sharing instructions with family members or caretakers often means rewriting or explaining details again and again.</p>
</li>
</ul>
<p><strong>SmartRx</strong> tackles all these by turning messy notes into clear, simple summaries, plus translations, so anyone can understand and share them easily.</p>
<h2 id="heading-how-smartrx-works">How SmartRx Works ? 🧠</h2>
<p>I kept <strong>SmartRx</strong> as simple (and friendly) as possible……. here’s what happens behind the scenes:</p>
<ol>
<li><p><strong>Snap &amp; Upload:</strong> Take a quick photo of your prescription or pharmacy bill and upload it on the web app.</p>
</li>
<li><p><strong>AI Steps In:</strong> Behind the scenes, <code>GPT-4o</code> reads the image, picks out details like patient name, doctor’s info, date, and the full list of medicines with dosage instructions.</p>
</li>
<li><p><strong>No Medical Jargon:</strong> It cleans up the extracted info and turns it into a short, plain-English summary, no complicated words, just what you really need to know.</p>
</li>
<li><p><strong>Speak Your Language:</strong> Want it in your local language? SmartRx can translate the summary into Indian or global languages with a single click. (50+ languages ✌️)</p>
</li>
<li><p><strong>Share &amp; Save:</strong> Download the text, or share it straight to WhatsApp, no more sending blurry photos to confused family members.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752896370072/b3a0b3fc-a4c8-468d-9f4d-35e62ec69701.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<h2 id="heading-behind-the-scenes-how-i-built-smartrx">Behind the Scenes: How I Built SmartRx ⛓️</h2>
<p>Building SmartRx was a fun mix of tinkering with AI, keeping things simple for users, and gluing everything together with Streamlit.</p>
<p>Here’s the gist of how it works under the hood:</p>
<ul>
<li><p><strong>Image to Text:</strong> When you upload a photo, it’s converted to <code>base64</code> and sent to <code>GPT-4o</code>. A carefully crafted prompt tells the model exactly what to extract : patient details, doctor’s name, date, medicine list, dosage, and more.</p>
<pre><code class="lang-python">  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">image_to_base64</span>(<span class="hljs-params">image_bytes</span>):</span>
      <span class="hljs-string">"""Convert image bytes to base64 string."""</span>
      <span class="hljs-keyword">return</span> base64.b64encode(image_bytes).decode(<span class="hljs-string">"utf-8"</span>)

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">extract_prescription</span>(<span class="hljs-params">image_bytes</span>):</span>
      <span class="hljs-string">"""Send image + prompt to GPT-4o and return structured JSON content."""</span>
      base64_image = image_to_base64(image_bytes)
</code></pre>
</li>
<li><p><strong>Clean JSON Output:</strong> GPT returns the prescription details in a structured <code>JSON</code> format. This makes it easy to parse and display without messy text.</p>
</li>
<li><p><strong>Summarize &amp; Translate:</strong> The same model creates a short summary in simple language. If you pick a local language, GPT translates it for you right away. And again, it works with 50+ languages across the world :)</p>
<pre><code class="lang-python">  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">translate_summary</span>(<span class="hljs-params">text, target_language</span>):</span>
      prompt = <span class="hljs-string">f"""
  Translate the following text into <span class="hljs-subst">{target_language}</span>:

  <span class="hljs-subst">{text}</span>
      """</span>
      response = client.chat.completions.create(
          model=deployment_name,
          messages=[
              {<span class="hljs-string">"role"</span>: <span class="hljs-string">"user"</span>, <span class="hljs-string">"content"</span>: prompt}
          ],
          temperature=<span class="hljs-number">0.3</span>
      )
      <span class="hljs-keyword">return</span> response.choices[<span class="hljs-number">0</span>].message.content.strip()
</code></pre>
</li>
<li><p><strong>Streamlit UI:</strong> I built the whole user interface with <code>Streamlit</code> it’s clean, fast, and easy for anyone to use, no technical skills needed.</p>
</li>
<li><p><strong>WhatsApp Automation:</strong> For fun (and practicality!), I plugged in <code>pywhatkit</code> so you can send the final summary directly to a WhatsApp number…….. no more retyping.</p>
<pre><code class="lang-python">  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">send_whatsapp_message</span>(<span class="hljs-params">receiver_number: str, message: str</span>):</span>
      <span class="hljs-string">"""
      Sends a WhatsApp message using pywhatkit.
      Requires WhatsApp Web login.
      """</span>
      <span class="hljs-keyword">try</span>:
          print(<span class="hljs-string">f"Sending message to <span class="hljs-subst">{receiver_number}</span>..."</span>)
          pywhatkit.sendwhatmsg_instantly(receiver_number, message, wait_time=<span class="hljs-number">10</span>, tab_close=<span class="hljs-literal">True</span>)
          time.sleep(<span class="hljs-number">5</span>)  
          <span class="hljs-keyword">return</span> <span class="hljs-literal">True</span>
      <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
          print(<span class="hljs-string">f" Failed to send message: <span class="hljs-subst">{e}</span>"</span>)
          <span class="hljs-keyword">return</span> <span class="hljs-literal">False</span>
</code></pre>
</li>
<li><p><strong>Safe &amp; Lightweight:</strong> No heavy backend or complicated hosting, just environment variables for config (<code>dotenv</code>), and a few Python tools (<code>pandas</code>, <code>json</code>, <code>re</code>) to handle the data neatly.</p>
</li>
</ul>
<p><strong>In short:</strong> SmartRx is basically a good and smart AI brain, and a simple UI wrapped together……. so that the tech stays hidden, and you just get clear answers.</p>
<p>For detailed code, you can checkout the whole repository <a target="_blank" href="https://github.com/Keerthanareddy17/SmartRx">here</a>!!</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Frontend &amp; UI</strong></td><td><a target="_blank" href="https://streamlit.io/">Streamlit</a></td></tr>
</thead>
<tbody>
<tr>
<td><strong>AI Processing</strong></td><td>OpenAI <a target="_blank" href="https://openai.com/index/hello-gpt-4o/">GPT-4o</a></td></tr>
<tr>
<td><strong>Environment Management</strong></td><td><a target="_blank" href="https://pypi.org/project/python-dotenv/">dotenv</a></td></tr>
<tr>
<td><strong>Translation</strong></td><td>GPT-4o</td></tr>
<tr>
<td><strong>WhatsApp Automation</strong></td><td><a target="_blank" href="https://pypi.org/project/pywhatkit/">pywhatkit</a></td></tr>
<tr>
<td><strong>Data Handling</strong></td><td><a target="_blank" href="https://pypi.org/project/pandas/">pandas</a>, <a target="_blank" href="https://docs.python.org/3/library/json.html">json</a>, re</td></tr>
</tbody>
</table>
</div><h2 id="heading-a-few-snapshots-of-smartrx">A Few Snapshots of SmartRx 📸</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752897059019/f7c529ce-09ad-433e-98d8-447c23bdebcc.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1752897100752/26b83a6c-c7cf-41af-a6a1-e825e720ef17.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-whats-next-for-smartrx">What’s Next for SmartRx? 🌱</h2>
<p>SmartRx is just getting started and of course there’s so much more it can do! I’d love to add:</p>
<ul>
<li><p>📄 Support for PDF uploads and multi-page prescriptions</p>
</li>
<li><p>🔍 Better OCR fallback for messy handwriting</p>
</li>
<li><p>🗂️ User accounts to save past prescriptions securely</p>
</li>
<li><p>🔊 Voice summaries……. super handy for elderly users</p>
</li>
<li><p>🔒 Stronger privacy and secure storage (with user consent, of course)</p>
</li>
</ul>
<p>If you’ve got ideas or want to build on this with me, I’d genuinely love to hear from you!</p>
<p>Here’s the Github repo of this project : <a target="_blank" href="https://github.com/Keerthanareddy17/SmartRx">SmartRx</a></p>
<p>Thanks for reading, and If you’d like to chat, share ideas, or improve it together, my inbox is always open :)(Here’s my <a target="_blank" href="http://www.linkedin.com/in/keerthana-reddy-katasani-b07238268">Linkedin</a>)</p>
]]></content:encoded></item></channel></rss>