About:Pharmacopedia.ext: Difference between revisions
From Pharmacopedia
More actions
| [checked revision] | [checked revision] |
Terminology sweep (site-wide): drug/medication → medicine |
Terminology: medicine → med (shorter form per user preference) |
||
| Line 6: | Line 6: | ||
'''Source:''' <code>/var/www/mediawiki/extensions/Pharmacopedia/</code> | '''Source:''' <code>/var/www/mediawiki/extensions/Pharmacopedia/</code> | ||
The Pharmacopedia extension turns a MediaWiki install into a structured, community-edited | The Pharmacopedia extension turns a MediaWiki install into a structured, community-edited med reference. It adds parser tags, special pages, API modules, and a database schema that together support: | ||
* Structured | * Structured med pages via the <code>{{tlx|MedTemplate}}</code> template | ||
* Per-user rating, voting, and reporting on effects, indications, titration strategies, anecdotes, and interactions | * Per-user rating, voting, and reporting on effects, indications, titration strategies, anecdotes, and interactions | ||
* Two-perspective data capture (personal vs. provider) wherever clinically meaningful | * Two-perspective data capture (personal vs. provider) wherever clinically meaningful | ||
* Curated | * Curated med-class categories used as interaction endpoints | ||
* A verified-provider role with document-based verification | * A verified-provider role with document-based verification | ||
| Line 40: | Line 40: | ||
| <code><anecdote></code> || Personal or provider story with up/down vote || <code>AnecdoteTag</code> | | <code><anecdote></code> || Personal or provider story with up/down vote || <code>AnecdoteTag</code> | ||
|- | |- | ||
| <code><indication></code> || Condition the | | <code><indication></code> || Condition the med is used for, 0–5 likert rating || <code>IndicationTag</code> | ||
|- | |- | ||
| <code><pharmaInteractions/></code> || Self-closing; renders the Interactions section for the current page || <code>InteractionTag</code> | | <code><pharmaInteractions/></code> || Self-closing; renders the Interactions section for the current page || <code>InteractionTag</code> | ||
| Line 138: | Line 138: | ||
== Interactions feature == | == Interactions feature == | ||
The Interactions section is rendered by placing <code><pharmaInteractions/></code> anywhere in the wikitext of a | The Interactions section is rendered by placing <code><pharmaInteractions/></code> anywhere in the wikitext of a med article ('''NS_MAIN''') or a Category page ('''NS_CATEGORY'''). | ||
=== Entity model === | === Entity model === | ||
An interaction is an undirected edge between two endpoints. Each endpoint has a '''type''' (<code> | An interaction is an undirected edge between two endpoints. Each endpoint has a '''type''' (<code>med</code> or <code>category</code>) and a '''slug''' (DB-key form of the page title). | ||
Pairs are stored in canonical order: smaller <code>(type, slug)</code> tuple on the left. This collapses A↔B and B↔A into a single row. | Pairs are stored in canonical order: smaller <code>(type, slug)</code> tuple on the left. This collapses A↔B and B↔A into a single row. | ||
| Line 152: | Line 152: | ||
pi_id auto-increment | pi_id auto-increment | ||
pi_element_id FK -> pcp_votable_elements (reuse votes/comments infra) | pi_element_id FK -> pcp_votable_elements (reuse votes/comments infra) | ||
pi_left_type ' | pi_left_type 'med' | 'category' | ||
pi_left_slug VARBINARY(255) | pi_left_slug VARBINARY(255) | ||
pi_right_type ' | pi_right_type 'med' | 'category' | ||
pi_right_slug VARBINARY(255) | pi_right_slug VARBINARY(255) | ||
pi_created_user_id INT | pi_created_user_id INT | ||
| Line 174: | Line 174: | ||
=== Rendering rules === | === Rendering rules === | ||
* On a ''' | * On a '''med''' page M, list: | ||
** Direct edges: rows where M is one side. | ** Direct edges: rows where M is one side. | ||
** Transitive edges: rows where one side is a category C that M is itself a member of (via MW's <code>categorylinks</code>). | ** Transitive edges: rows where one side is a category C that M is itself a member of (via MW's <code>categorylinks</code>). | ||
| Line 186: | Line 186: | ||
Triggered by the <code>+ Add interaction</code> button at the bottom of the section. Two-stage UX: | Triggered by the <code>+ Add interaction</code> button at the bottom of the section. Two-stage UX: | ||
# Search input → results split into ''' | # Search input → results split into '''Meds''' (teal chip) and '''Categories''' (amber chip). | ||
# Click <code>Use</code> → confirm via <code>Add interaction</code> button → POST to <code>pharmacopediainteractionadd</code>. | # Click <code>Use</code> → confirm via <code>Add interaction</code> button → POST to <code>pharmacopediainteractionadd</code>. | ||