<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: RX PILL TAB</title>
    <description>The latest articles on DEV Community by RX PILL TAB (@rx_pilltab_3c2ada10623bb).</description>
    <link>https://dev.to/rx_pilltab_3c2ada10623bb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4204320%2F86ffeef4-c019-41c1-a0bc-819842950e26.png</url>
      <title>DEV Community: RX PILL TAB</title>
      <link>https://dev.to/rx_pilltab_3c2ada10623bb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rx_pilltab_3c2ada10623bb"/>
    <language>en</language>
    <item>
      <title>How We Structured a Medicine Comparison Table for Patients (and What We Learned About Generic Naming)</title>
      <dc:creator>RX PILL TAB</dc:creator>
      <pubDate>Sat, 24 Oct 2026 15:17:36 +0000</pubDate>
      <link>https://dev.to/rx_pilltab_3c2ada10623bb/how-we-structured-a-medicine-comparison-table-for-patients-and-what-we-learned-about-generic-2gb0</link>
      <guid>https://dev.to/rx_pilltab_3c2ada10623bb/how-we-structured-a-medicine-comparison-table-for-patients-and-what-we-learned-about-generic-2gb0</guid>
      <description>&lt;p&gt;Comparison tables look like the easiest component on any product site. Rows, columns, done. Then you try to build one for medicines and discover that the data model is the hard part, not the CSS.&lt;/p&gt;

&lt;p&gt;We work on the catalogue for a supplier of generic medicines that ships to the US, UK, Europe and Canada against a valid prescription. Many of the products are the same active ingredient sold under several generic brand names. Patients arrive knowing one name, usually the original Western brand, and need to understand what they are actually looking at. Here is what we changed along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Lead with the generic name, not the brand
&lt;/h2&gt;

&lt;p&gt;Our first draft put the brand in column one, because that is how the products were stored. Usability-wise this was backwards. A patient comparing options cares first about &lt;strong&gt;what the medicine is&lt;/strong&gt;, then about who makes it.&lt;/p&gt;

&lt;p&gt;So the first column became the active ingredient using its international non-proprietary name (INN), for example &lt;code&gt;tadalafil&lt;/code&gt; or &lt;code&gt;sildenafil&lt;/code&gt;. The brand moved to the second column. That small swap made the table scannable: identical ingredients group together visually even when brand names look completely unrelated.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Model strength as a number plus a unit
&lt;/h2&gt;

&lt;p&gt;Strings like "20mg", "20 mg" and "20 MG" were all in the source data. We split strength into two fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ingredient"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tadalafil"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"brand"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Tadacip 20"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"strength_value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"strength_unit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"form"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tablet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"units_per_strip"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"strips_per_pack"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Numeric strength allows sorting and filtering, and it stops the table from implying that "20mg" and "20 mg" are different products. It also forced a useful question: what does the number refer to?&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Be explicit about the salt
&lt;/h2&gt;

&lt;p&gt;Many tablets contain a salt of the active ingredient, such as sildenafil citrate. On most generic packs the labelled strength normally refers to the amount of the base ingredient, not the salt. We added a short "labelled as" note in the detail view rather than cluttering the table. Showing the raw salt weight in a table would have confused people far more than it helped.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Pack size is two numbers, not one
&lt;/h2&gt;

&lt;p&gt;Generic tablets are usually sold in blister strips. "Pack of 10" can mean one strip of ten or ten strips of one, depending on who typed it. We now store &lt;code&gt;units_per_strip&lt;/code&gt; and &lt;code&gt;strips_per_pack&lt;/code&gt; separately and render them as &lt;strong&gt;"1 strip × 4 tablets"&lt;/strong&gt;. A computed total sits next to it. It answers "how many tablets am I getting" before anyone has to ask.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Never let the table imply a dose
&lt;/h2&gt;

&lt;p&gt;A table of strengths can accidentally read like a menu of doses. We added a single line above every comparison: the strength shown is what each unit contains, and the dose is whatever the prescriber has written. For context, tadalafil for erectile dysfunction is licensed up to 20 mg in a day and sildenafil up to 100 mg in 24 hours, so we do not list strengths above those. The table is for identifying products, not choosing treatment.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Avoid "equivalent to" language
&lt;/h2&gt;

&lt;p&gt;It is tempting to add a column saying "same as Brand X". We dropped it. Stating the shared active ingredient and strength is factual. Claims of equivalence are a judgement for prescribers and pharmacists, and the table should not make that call for them.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Tables break on mobile, so plan for cards
&lt;/h2&gt;

&lt;p&gt;Many readers are on phones. Below 640px, each row turns into a card. The ingredient is the card heading, the brand is a subtitle, and strength, form and pack size become a short definition list. The DOM order matches the visual order, so screen readers announce the same hierarchy sighted users see.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;640px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;.med-table&lt;/span&gt; &lt;span class="nt"&gt;thead&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.med-table&lt;/span&gt; &lt;span class="nt"&gt;tr&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.med-table&lt;/span&gt; &lt;span class="nt"&gt;td&lt;/span&gt;&lt;span class="nd"&gt;::before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;attr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data-label&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;600&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What we would tell another team
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Decide the canonical name first. Everything else hangs off it.&lt;/li&gt;
&lt;li&gt;Store numbers as numbers and units as units.&lt;/li&gt;
&lt;li&gt;Treat pack size as structured data, not free text.&lt;/li&gt;
&lt;li&gt;Keep the table descriptive; leave clinical choices to prescribers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to see how the naming problem plays out in practice, our write-up on &lt;a href="https://www.rxpilltab.com/2026/10/generic-viagra-brands/" rel="noopener noreferrer"&gt;generic Viagra brands&lt;/a&gt; walks through one active ingredient sold under several labels. The wider catalogue lives at &lt;a href="https://www.rxpilltab.com/" rel="noopener noreferrer"&gt;rxpilltab.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Modelled product data where one thing has five names? Tell me how in the comments.&lt;/p&gt;

</description>
      <category>ux</category>
      <category>webdev</category>
      <category>datamodeling</category>
      <category>healthtech</category>
    </item>
  </channel>
</rss>
