Template talk:Drugbox

From Wikipedia, the free encyclopedia

Contents

[edit] Support for transclusion

I've made significant modifications to this infobox template so it can support passed parameters, allowing a much simplified representation on pages into which it is transcluded. I believe in most cases the current usage has been via subst: inclusion. The first instance of using the new transcluded template is Atorvastatin. I did take pains to try and ensure that all current functionality is supported in the revised version. Courtland 12:25, 2 September 2005 (UTC)

Thanks Courtland. I have one problem: the image is not always under PAGENAME.png. Is there any way of automating this. Specifically, is there any way to let the template default to PAGENAME if no name is supplied? This may involve JavaScript, so I'm not sure... JFW | T@lk 20:27, 12 September 2005 (UTC)
I don't know of wikisyntax that would accomplish this, but I'll take a look around and see what I can find. Courtland 00:00, 13 September 2005 (UTC)
Similarly, I can't seem to use nested templates, such as {{carbon}}, {{sub}} etc. JFW | T@lk 09:19, 13 September 2005 (UTC)

Okay, seriously. This needs to be a template and it needs to take the variables. Currently,(as of September 9th, 2005, I think) it doesn't insert the variables, so there are a bunch of ? on the pages that use this as a template. Pages that copied and pasted the template in are going to get stale and I think the only way to find them will be a link to IUPAC_nomenclature. The template from months ago was working fine. Why was it changed away from variables? Peter Bailey

  • The confusion here is a matter of reversions to a state before the template was changed to support transclusion. I can understand someone coming along after months of not adding the template then finding that it has changed being caught by surprise. The pre-variable template was more boilerplate than template, which would be ok if it were labeled as such. Do you think that we should provide the old boilerplate below for use under certain circumstances? I think that User:Rmky87 should speak up here to talk to why the old version is superior to the new in his/her opinion before additional reversions. Courtland 13:52, 10 October 2005 (UTC) P.S. I've left a brief not on Rmky87's talk page asking that input be made here about what is superior about the previous version

If you are going to do what you are doing, could you at least make it look not-bizarre when not all the information is in there? The thing below this section looks much simpler and worked just fine when I copied-and-pasted it onto nordazepam (it's not just a metabolic intermediate anymore). Do we even have templates for CAS number, IUPAC name, ATC code, etc.? Because that's what the {{{blah_blah}}} would seem to imply.

[edit] Empty syntax

The following text can be copied into pages where transclusion of the template is desired.

{{drugbox |
| IUPAC_name = 
| image = {{PAGENAME}}.png
| CAS_number = 
| ATC_prefix = 
| ATC_suffix = 
| PubChem = 
| DrugBank = 
| chemical_formula = 
| molecular_weight = 
| bioavailability = 
| metabolism = 
| elimination_half-life = 
| excretion = 
| pregnancy_category = 
| legal_status = 
| routes_of_administration = 
}}

Courtland 12:25, 2 September 2005 (UTC)


This template is well done. I will produce a german template from it. Furthermore I changed the metabolism into a link, hope thats ok, -- E-Detailing 18:49, 3 December 2005 (UTC)

I have updated the template according to present use habbits. -- David Andel 12:16, 17 April 2006 (UTC)

[edit] Direct links

Over the last couple of days I've added links that allow the CAS number and IUPAC name to directly link to external sites. Are there any objections to this? From the pages I've looked at so far, the use of the ATC code field was inconsistent -- some pages linked to external sites, some linked to Wikipedia subpages, and some didn't have any link at all, so I wasn't sure what standard was emerging.

Also, I'd like to propose adding a couple more fields: specifically, links for PubChem and DrugBank codes. (Obviously PubChem is more established, but considering that congress is considering pulling the plug, it would be good to have a Canadian source as a backup. Thoughts? If anyone knows better databases, of course I'd support linking to those instead -- these were just the best I could find. --Arcadian 14:48, 14 December 2005 (UTC)

[edit] Fix image stretching?

What's the best way to go about fixing structure image stretching caused by images that are smaller than the 220px specified in the template? See the Tramadol article for an example of this. Will eliminating the width in the template break other pages? --Bk0 (Talk) 21:52, 18 December 2005 (UTC)

Some images are in a different size. Perhaps a variable should be introduced to control image scaling. JFW | T@lk 00:20, 19 December 2005 (UTC)

[edit] Recent changes

I've put in the following changes:

  • 1) Per "Fix image stretching?" above, I've added a new "width" parameter. See Tramadol for an example of how it works. It defaults to 220 when omitted.
  • 2) Per "Support for transclusion" above, I've added a new "image" parameter. See Melphalan for an example of how it works. (The person who uploaded the image used a "JPG" extension, so I used the parameter "image=Melphalan.jpg") It defaults to PAGENAME.PNG when omitted (so unless the parameter is used, it works like it used to.)
  • 3) Per "Direct links" above, I've added parameters for PubChem and DrugBank.
  • 4) I've directly linked the CAS number to an external source.
  • 5) I noticed that there was a lot of inconsistency on the linking of the ATC code. Some pages linked to an external source, some pages linked to an internal source, and some didn't link to anything at all. And all of the links were done by hand. So I split the ATC code into two parameters: "ATC_prefix" (for the first three characters) and "ATC_suffix" (for the last five) to support both internal and external linking through the template. I've updated the pages using the template (about 30) to reflect this change. There was one page that had more than one ATC code, so I split out the extra codes and made a note about it in the main text. --Arcadian 21:24, 20 December 2005 (UTC)

[edit] Proposed changes

I'm considering adding two more optional fields (they'd be set up so that if there was no parameter, the field would be absent, not just empty). They are:

  • Logo. The image in Atorvastatin looks clumsy, and it would be nice if those logos could be in the same box.
  • "Alternate codes". This could handle cases where there was more than one ATC number, or when there was a CAS for a closely related compound.

Any thoughts/suggestions/objections? --Arcadian 20:43, 22 December 2005 (UTC)

I have added a code, "ATC_supplemental", that allows more than one ATC code. An example of it in use is available at Heparin. --Arcadian 18:58, 28 December 2005 (UTC)

[edit] Issue with link

JFW says I should address this to you:

While attempting to edit the ribavirin and viramidine articles I've noticed a problem the standard drug template which includes external links for things like CAS number, Pubchem, chemID and so on. The ChemID works fine because it plugs back to the http://chem.sis.nlm.nih.gov/chemidplus/ database. However, the CAS# external links don't work because they attempt to plug the CAS# into the European ECB-ESIS database, and they naturally are not recognized. I think that the nih pubchem database would take CAS numbers, and would work fine if the link attempted that. So this CAS# external link needs to target to the NIH site. Sbharris 03:33, 6 January 2006 (UTC)

This should really be addressed to Arcadian (talk • contribs), who has modified the template to allow these functionalities. He may have more information on why the ECB-ESIS databank was chosed over Pubchem. JFW | T@lk 20:22, 8 January 2006 (UTC)

Thanks Sbharris 03:58, 13 January 2006 (UTC)

Here is the only change I made to the CAS number. As that time, the majority of fields using the Drugbox template included dashes in their CAS number (for example, "57-92-1" for Streptomycin.) The source you are recommending is an excellent one, but it requires CAS numbers that have zero-padding and are stripped of hyphens, as shown below:
http://chem.sis.nlm.nih.gov/chemidplus/ProxyServlet?objectHandle=DBMaint &actionHandle=default&nextPage=jsp/chemidheavy/ResultScreen.jsp &ROW_NUM=0&TXTSUPERLISTID=000057921
I don't know how to address your concern, so I have reverted that change so the field is exactly like it was when I first found it. (The database I had linked to previously was the only one I could find that accepted a CAS number in its hyphenated form. It was missing about a quarter of the compounds we referenced, but I felt it was better than nothing. However, I recognize now that this caused some confusion, so the best answer I have is to unlink the field. But if you or someone else has a better solution, I'd have no objection to the template being altered to support it. --Arcadian 04:41, 13 January 2006 (UTC)
I looked a little harder. The source you supplied was quite useful, and though we can't link to it directly, it provided other links that accept the CAS number in the URL. Sources include:
For comparison, the database that was used through yesterday is below:

While I have no way of knowing if any of those sources would be more exhaustive than the esis-pgm database, it would be relatively easy to switch to another source later if we so desired. Would you like any of these sources hooked up? --Arcadian 12:18, 13 January 2006 (UTC)


Yes. In absense of any knowledge about which of the above are most exhaustive, let's try the last one, the chemdb.niaid.nih.gov site:

which should be pretty complete for drug stuff. Link that up if it takes hyphenated CAS #'s, if you would. THANKS for the help! Sbharris 23:11, 14 January 2006 (UTC)

Apparently http://chemdb.niaid.nih.gov/struct_search/misc/url_search.asp?cas_no=57-92-1 is dead right now. If you'd like, I could hook it up to another source (try clicking on the URLs above -- most of them work for me know except the last one), or we could wait a bit and see if it's just a temporary outage. --Arcadian 03:01, 16 January 2006 (UTC)
I tried it again, and this time the database was up, but it didn't have entries for most of the first few I spot checked. So for now, I hooked it up to the MESH database, since it was very fast and had entries for most of the ones I used for testing. However, it doesn't do a great job of linking to other databases -- the only major benefit it provides is external confirmation that the CAS is correct. So, if you (or anyone else reading this) would rather put in a different source, I'd have no objection. --Arcadian 20:36, 18 January 2006 (UTC)

[edit] re extraneous blank line after 'ATC code'

Currently there is a blank line shown after 'ATC code' and the code number itself. There is a new line in the template code after the </br> mark-up, should this not be removed, from:

| '''[[ATC code]]''' <br />

[[ATC_code_{{{ATC_prefix}}}|{{{ATC_prefix}}}]][http://www.whocc.no/atcddd/indexdatabase/index.php?query={{{ATC_prefix}}}{{{ATC_suffix}}} {{{ATC_suffix}}}] {{{ATC_supplemental|}}}

to look like:

| '''[[ATC code]]''' <br /> [[ATC_code_{{{ATC_prefix}}}|{{{ATC_prefix}}}]][http://www.whocc.no/atcddd/indexdatabase/index.php?query={{{ATC_prefix}}}{{{ATC_suffix}}}

I'm tempted to do the edit myself, but have little (no) idea how templates work, and would hat eto mess things up over a large number of pages :-) David Ruben Talk 02:35, 19 February 2006 (UTC)

I've implemented this change (I think.) I spot-checked a few pages that used this template and they seemed okay, but if you see anything that looks messed up, feel free to revert. --Arcadian 14:26, 19 February 2006 (UTC)
Thank you. David Ruben Talk 16:25, 19 February 2006 (UTC)

[edit] Ambiguities

Copied from User talk:Fuzzform:

The bioavailability, half-life and even the metabolism and excretion will vary with the administration route and precise formulation. For example, in addition to i.v, midazolam may be swallowed as a syrup, held in the mouth to be absorbed via the buccal mucosa (largely avoiding digestion – though some may get swallowed) and even sprayed intranasally (PMID 11802661). For other drugs there are creams, suppositories, patches, soluble powders, tablets, enteric-coated capsules, etc, etc. I think that where there is a risk of confusion, the drug box should state e.g. "xx% (oral syrup)". If there is room for more than one entry in the table cell, then that would be good. Otherwise it could be moved out to be discussed in the article and the DrugBox left with "varies", or some such phrase --Colin 11:43, 21 February 2006 (UTC)

Yeah, that is a problem, one which I hadn't thought of. Bioavailability is by definition 100% when injected intravenously. I suppose I'll have to go through all the articles and differentiate. Fuzzform 01:25, 22 February 2006 (UTC)
As with all these pharmacokinetic parameters, they all have strict definitions, and the further you go into it, the more complex it becomes. In fact the bioavailability is defined as the percentage fraction of the drug that reaches the systemic circulation, incontrast to the absorption, which is the percentage reaching the portal circulation. I would suggest that bioavailability in the table should be taken to imply oral, since that is common usage and implicitly obvious where a drug is taken orally or iv (the iv is of course 100%), but where drugs are given by several routes, then that extra detail should be added. After all, i.m. BA is invariably taken to be equal to 100%, and there are few drugs given transdermally as well as oral (hyoscine, GTN, sex hormones spring to mind). So I would suggest that the table cell simply list the one value, with a comment if it has other routes. See the entry for Tramadol, which has the curious property that BA varies for repeated dosing - you could leave it to be discussed in the main article, but for quick reference, a few words in the table clarifies the detail without upsetting the conciseness of a quick reference table. bignoter
What about chloramphenicol? intravenous chloramphenicol achieves a concentration in blood that is only 70% of that achieved when the same dose is given orally. How do you report bioavailability then? --Gak 10:50, 20 May 2006 (UTC)

[edit] May 2006 update

I updated the drugbox for aesthetics and readability. Probably the only issue I can think of is abbreviation/contraction of entry names: molecular weight, chemical formula, pregnancy category and routes of administration. I found that it was necessary to fit these entries on a single line. I think that if people are in doubt they can always click on the name. As a bonus, the new format seems to partially alleviate the printing problem discussed on Wikiproject Drugs. Let me know if you have any problems with the new box. -Techelf 11:48, 26 May 2006 (UTC)

I appreciate use smaller font size to make the template box narrower (especially for long IUPAC names) and hence abbreviating the heading titles.
  • 'MW' seemed unecessarily short, as 'Mol.Weight' fits and will be more obvious (especially as many articles just give a number without including the units of g/mmol).
  • I liked the previous 2x2 arrangement of CAS, ATC, PubChem, DrugBank. Is there anyway to include these as just 2 rows in the table (i.e. reduce current 4 lines to 2) thus forshortening the length of what is quite a long overall template box ? David Ruben Talk 16:36, 26 May 2006 (UTC)
The 2x2 arrangement (which usually took up 4+ lines anyway) always seemed a little inconsistent to me, but the main reason I changed it to four separate rows was ease of coding and because drugboxes with more than two ATC codes were a little unwieldy under the old design. I did a quick comparison of a few pages and the new box seems to be around the same length (but looks longer because it's usuallly narrower). -Techelf 01:55, 27 May 2006 (UTC)
Ok then, I agree new arrangement looks smart & neat. As for the optical illusion, must check how long its been since my last eye check ... :-) David Ruben Talk 02:21, 27 May 2006 (UTC)
I like the new appearance. Now that DrugBank is on its own row, we now have the option of making it an optional parameter, so the line disappears when there is no value provided. Thoughts? --Arcadian 02:43, 27 May 2006 (UTC)
Yep, I like the idea. Might need your expertise on this one, Arcadian, because I don't know how to do this while keeping existing infoboxes compatible. -Techelf 09:24, 27 May 2006 (UTC)
  • Failled attempt - not all drugs have a DrugBank entry so just leaving the details blank might just imply that the article's creator forgot to provide the value (vs that there is no value that can be supplied). So making the whole line optional is sensible. See ParserFunctions#IF: which determines if a value exists and then shows expressions if it does Else if it does not (the Else expression is optional and any '|' within an expression must be enclosed within curly brackets if it is not to be seen as the parserfuction-#IF: separator for the 'else' expression or the end of function).
  • Thinking that some of the other Identifiers field require trudging around to find their values, I've used the same technique for their values (rather than the whole line for DrugBank). If the other identifer details are not provided then a '?' is shown or a link to the organisation's search page so that the details can be looked up.
  • The data in the other sections (Chemical data, Pharmacokinetic data,Therapeutic considerations) does exist, whether or not an editor can find the data and so I have not added optional '?' if the data is not supplied. But let me know if this seems inconsistant. David Ruben Talk 13:25, 27 May 2006 (UTC)
Miserable failure - I tried copying over technique from other templates, but clearly I don't understand this - for while template itself looked ok, a quick check on a drug article showed the {{|}} failled to be interpreted properly, not the rest of the conditional parameters. My past efforts in the history section will show what I was trying to achieve, but I'll leave it for someone better than I to implement correctly :-( David Ruben Talk 14:01, 27 May 2006 (UTC)

Techelf & David: it looks stunning. My compliments. A large improvement. JFW | T@lk 22:44, 27 May 2006 (UTC)

I have made DrugBank an optional field. --Arcadian 01:13, 29 May 2006 (UTC)

[edit] Vd and Protein Binding

I hope people do not object to the fact that I have added Volume of distribution and Protein Bound fraction to the template. These can be important considerations in the use of a drug and such information may be interesting to some readers. --Copperman 17:08, 28 May 2006 (UTC)

As a General Practitioner, I can just about recall the improtance of protein binding (low protein levels in the infirm/alcoholics will obviously have an effect), but what has volume of distribution have to do with any day-to-day decission I make about using a drug? And if I fail to see its relevance then wikipedia, as a general encyclopedia, can have little reason to include Vol.dist for the general reader (there are those lovely links to DrugBank, PubChem etc that can give pharmacological/physiological data).
Also such additional data needs be optional fields as per previous section. David Ruben Talk 17:17, 28 May 2006 (UTC)
Ah, you have a fair point there I guess with the optional fields...I guess if one starts to add such information one eventually runs out of space and arguments arise as to what info SHOULD be included. --Copperman 17:38, 28 May 2006 (UTC)

[edit] Second image & Optional fields

Some articles, such as Paracetamol, could not previously use this template as the articles used 2 images. I've added an extra optinal fields for image2. I would have prefered a more flexible system like the OMIM_mult field in template:DiseaseDisorder infobox.

With optional fields now in place, viewing the template itself will not show these options. I shall therefore try to place instructions on using this template up to the front page.David Ruben Talk 02:34, 30 May 2006 (UTC)

Very nicely done. I took a look at Paracetamol and noticed the boxes for "Physical properties" -- do you think we should extend the Drugbox template to accomodate those values as optional parameters? --Arcadian 13:04, 30 May 2006 (UTC)
As a general rule no - very few drugs for which such info useful - I suppose relevent for aspirin, and perhaps penicillin V vs penicillin G. However such info is difficult to add, as I had to force an extra table manually. Of course should this template's style change, then the manual table will also need to be hand-edited to match - the whole point of a template should be to make such tasks redundant.
So yes, as optional extra section yes would be helpful - BUT ONLY if the absence of data in all its extra parameters results in no display of the section (i.e. the section is hidden rather than single items such as DrugBank).
I'm not sure how the "hidden class" works (can it test multiple parameters and does it allow blanking of multiple lines). If not, then the newer #IF: system seems as if it might be more flexible (e.g. choice of side-by-side second image rather than vertical placement, and optional separate captions for images 1 & 2), however I failled to grasp how to code it correctly (see previous failled edit attempts in the edit history). David Ruben Talk 15:06, 30 May 2006 (UTC)


During BorisTM hard work at trying to ensure red-link not shown if no image either defined or already upload as PAGENAME.png, he included a separate width2 parameter for image2. I have added this to the live template, and ensured this takes priority if defined else, as for the first image, width is used if given with a default value of 220 otherwise used - description added to teh template page. David Ruben Talk 14:29, 16 July 2006 (UTC)

[edit] New fields

For now, so the old template could be replaced in the Testosterone article, I've added three new optional fields to the existing "Chemical data" section, for Melting point ("melting_point"), Specific rotation ("specific_rotation"), and Standard enthalpy change of combustion ("sec_combustion"). An example of what it looked like before the update is available here. However, I wouldn't object to moving them to their own section, if we were able to address the concerns David mentioned above. --Arcadian 21:12, 9 June 2006 (UTC)

[edit] Optional Physical data section

  • I contacted BorisTM and he kindly converted template from use of hiddenStructure class to hide specific parameters to the {{#if: test | then text | else text}} (see ParserFunctions#IF: and other such options).
  • With this he also added an optional Physical data section that only shows the section title if one or more of the parameters is definesd.
  • I have extended his demonstration of the technique to include some of the other (very optional) parameters previously mentioned.
  • I also added the optional parameters of Smiles and Synonyms which together with the Physical data section now allows the previous messy Aspirin and [[Paracetamol] to use Drugbox without having to mimic the template or use additional table appendages.
  • Too many articles already specify the units of molecular weight to have the article add this automatically - Anyone care to edit them or use some form of bot to do this ? But also note some articles provide various weights fo r the drugs different available forms, e.g. Clomifene.
  • For the new parameters, the density, melting & boiling points etc, the template will add units and convert the provided Celcius temperatures to Fahrenheit - see the template for the updated description of use David Ruben Talk 13:38, 12 June 2006 (UTC)

[edit] Legal Status

[edit] Standard Abbreviations?

On the Clomiphene page drugbox, under "legal status", it says "POD". What is that? Is there a set of standard abbrevations for legal status of pharaceuticals? If so, there should be a link to it from the Template:Drugbox page, and perhaps also it should always be linked to from an instance of one of those abbreviations used in a drugbox.

Perhaps it would also be nice if the Template:Drugbox documentation contained some hints as to how one can find out what the legal status is, and where to link to as a reference to that status.

Firstly, please sign comments and add new comments at the end of the comments page. Anyway, I had a look at the clomifene page and figured that "POD" probably stands for "prescription only drug". But I agree, there is a need for standardised abbreviations for legal status – I'll put my proposal under a separate subheading. Unfortunately, I can't tell you any easy sources (at least publicly-accesssible ones) that discuss the scheduling of medications – someone else might have a suggestion. -Techelf 08:39, 10 June 2006 (UTC)

[edit] Proposal for standard abbreviations

In response to User:KarlHeg's comment above, I'd like to propose the following set of standard abbreviations for discussion. I think that these should be listed in alphabetical order (by jurisdiction), separated by a comma, and with only the first instance of a country abbreviation in a drugbox wikilinked – e.g. clomifene.

Abbreviation Meaning
Australia
unscheduled (Au) Unscheduled/exempt
S2 (Au) Schedule 2 Pharmacy Medicine
S3 (Au) Schedule 3 Pharmacist Only Medicine
S4 (Au) Schedule 4 Prescription Only Medicine
S8 (Au) Schedule 8 Controlled Drug
United Kingdom
GSL (UK) General Sale List
P (UK) Pharmacy Medicine
POM (UK) Prescription Only Medicine
CD (UK) Controlled Drug
United States
OTC (U.S.) Over the counter
℞-only (U.S.) Prescription only

This is largely based on the standardised markings and abbreviations used widely amongst doctors and pharmacists (Australia) and/or on product packaging that I've encountered (UK and U.S.). I've already been using these, and hope that these will be useful as standardised abbreviations across the drugbox templates. -Techelf 08:39, 10 June 2006 (UTC)

Until now, I've always wikilinked the UK terms as [[prescription drug|POM]], [[Over-the-counter substance|OTC]] or [[controlled drug]]. I can, if thought useful, insert code in the template to autolink the terms.
In essence we would have parameters legal_status_Aus, legal_status_UK, legal_status_US which are defined as alternatives to the plain legal_status. The system could then be expanded if other areas wish to be included (e.g. Canada, Ireland, NZ +...). Each parameter may take values as abbreviated above and will then show the term suitably linked and with (Aus), (UK) or (US) as a suffix.
Hence legal_status_UK = OTC would result in OTC (UK) - have a think about this and let me know (I'll be on a wikibreak for next 10 days) David Ruben Talk 02:19, 17 June 2006 (UTC)
I've never been a great fan of wikilinking the data content directly in certain fields of the infobox, for example I don't understand the practice of wikilinking "g/mol" when the only people who would find this information useful would already be familiar units. In this instance, I think that the regulation of therapeutic goods page (wikilinked by the "legal status" title) is more useful for people than the individual over-the-counter substance or prescription only medicine pages. But I do like the idea of making scheduling parameters if they could be all placed in the same box (like the chemical formula parameters). In terms of the actual implementation, I think it'd be preferable to use <small> for the country code only, and that we should use wikilinked two-letter ISO country codes (ISO 3166-1) within the framework of WP:MOS (i.e. Au, Ca, Ie, NZ, UK, U.S., etc). -Techelf 08:10, 20 June 2006 (UTC)
Ok - I've had a go at this at the template sandbox Template:Add code (ignore all but the legal status items). See coding that takes optional legal_AU, legal_UK & legal_US parameters using values as listed in the table above (the coding is almost twice the length required, as it identifies values in both upper & lower case). An example of the outcome is shown at Template talk:Add code. Note if an unspecified value is attempted for a given country then an ? is shown indicating an error.
Any additional information (i.e. for countries not specified) may still be included in the current legal_status parameter that is appended to the end.
If people like this idea then I shall transfer it to the live template - but first please indicate preference for parameters names (UK as example):
  • legal_UK
  • legalUK
  • legalUK_GSL_P_POM_CD - this is veryhttp://en.wikipedia.org/w/index.php?title=Template_talk:Drugbox&action=edit&section=17 awkward I know, but clearly shows permitted values. Similar would be legalAU_Unscheduled_S2_S4_S8 and legalUS_OTC_Rx. The obvious problems would be remembering the parameter names (would have to be copied & pasted) and what happens if a country alters its license category names.
My preference is legal_UK style. David Ruben Talk 01:58, 12 July 2006 (UTC)
Hi Davidruben, I prefer the "legal_UK" style too. Just a minor point to consider when you incorporate the parameters into the main template – the U.S. equivalent of S4/POM is "℞-only", and also using the unicode prescription character "℞" (using Template:Unicode if necessary) would probably be better than "R<sub>x</sub>". Apart from that, it looks good. Cheers. -Techelf 10:41, 16 July 2006 (UTC)
Ok thanks - Having only MSIE I have had to copy & paste the [] character - for future editing purposes it would be better if I could use the actual Unicode number in the Template:Unicode - do you happen to know its value ? David Ruben Talk 12:29, 16 July 2006 (UTC)
Template so upgraded - is the accompanying description clear enough ?
See this edit as example of how I modified Metronidazole. However note that the template ensures only a single permitted option for specified countries, so multiple opitions, as seen in Ibuprofen, still need to be manually coded using legal_status. David Ruben Talk 14:21, 16 July 2006 (UTC)
I was about to suggest dumbing down my own additions to specifcally allow for multiple classifications per country (basic legal_XX accepts anything as valid free text and just appends (XX) to the end). But then I thought, the classification schemes in any given country are a step-wise degree of restriction and so only the most relaxed category need be specified. Hence Ibuprofen lists for UK as GSL/P/POM, but any GSL (general sales product for non-pharamcy stores) can be stocked by a Pharmacy, and similar a P drug (Pharmacy only) can be prescribed (separately in UK is whether NHS blacklists a product, eg Paracetamol allowed but not expensive Calpol brand, but legally are licensed the same and on private prescription Calpol is allowed). Think I'll therefore leave the drugbox template checking for valid values (ie not accept "Presc" for POM or "S3" in Australia) and just simplify the entry in Ibuprofen (as here). Sure there may be restrictions on quantities allowed to be sold (eg in UK 16 Paracetamol on GSL, upto 100 if a pharmacist feels special considerations, unlimited on doctor prescription) but these are specific for each drug & country and not generally approproate to include in this a general encyclopaedia. David Ruben Talk 15:28, 16 July 2006 (UTC)
Yeah, I just noticed that on the ibuprofen page. It's a bit problematic for the Australian situation, because the scheduling system works in a step-down manner such that ibuprofen is S4 (prescription only) unless a preparation meets certain requirements where it is permitted to be included in S2 (pharmacy medicine) or be unscheduled depending on pack size, tablet strength, labelling, etc. Because of this, technically it should be listed as S4 (rather than unscheduled), but this doesn't reflect the wide OTC availability of ibuprofen. Ditto for paracetamol and many other "over the counter" medications. Perhaps the original "unscheduled/S2/S4" was the best compromise, but does anyone have any suggestions? -Techelf 10:45, 18 July 2006 (UTC)
The choice is whether each country-specific parameter gets tested for a single valid categorisation level, or accepts free text (and just adds in the <small>([[CountryX|XX]])</small> coding). I prefer the former. Also, at least in UK, being an OTC (P or GSL) does not mean unlimited availability - pack sizes are (?always) restricted and, in case of P items, the pharmacist is restricted as to which indications they may so supply the item (eg hydrocortisone cream may not be supplied by a pharmacist for use on face or in pack size above 30g, yet on prescription no such restriction). So Simvastatin recently in UK gaining a P status from past POM, does not imply that all strengths are available OTC (only 10mg is) nor that other strengths do not remain POM (10mg 20 & 40mg). Describing the specifics for a particular drug is clearly too lengthy for inclusion in the sumarising table, and I would welcome in the main prose. I would though, for Simvastatin in the UK, now classify it in the table as P.
If other editors feel that non-medics will not interpret such simplification in the manner I do, then should we get the template to automatically mark up all additional levels, eg. legal_UK=P is converted into P/POM and legal_UK=GSL is converted into GSL/P/POM. the problem with this is that we will lose the compactness (currently Australia, UK & US categorisations can be fitted onto a single line, expanding will require 3 lines to look neat). David Ruben Talk 12:49, 18 July 2006 (UTC)
No worries, I see what you mean. I might adjust some of the Australian ones as necessary (particularly the special cases) as I come across them. Cheers. -Techelf 11:50, 19 July 2006 (UTC)
Another thought I had concerns a few pages where you've put it as a blanket "prescription only". I prefer the full "S4 (AU), POM (UK), ℞-only (US)" to avoid ambiguity, but I suppose it's okay because it simplifies things for the lay audience. On the other hand, drugs that are "over the counter" shouldn't be simplified as such since the term could mean unscheduled, S2 or S3 in Australia and GSL or P in the UK. -Techelf 10:45, 18 July 2006 (UTC)
Yes I was bold in allowing the blanket legal_status=Rx-only to be specially recognised and shown as ℞-Prescription only. It would remain true only until one country starts licensing as OTC (then the other countries would need be specifically declared as still remaining prescription-only items). I thought it might simplify things and would "give it a try", but I'll not object if other editors are unhappy at this option and wish it removed.David Ruben Talk 12:49, 18 July 2006 (UTC)
Nah, no problem with having "prescription only" as an option. But perhaps it doesn't need the ℞ character if "prescription" is already written out in full =). -Techelf 11:50, 19 July 2006 (UTC)
I totally agree with you re not trying to create a generalised simplified form of OTC as has various differing subdivisions between countires.David Ruben Talk 19:08, 18 July 2006 (UTC)

[edit] Same for Pregnancy status ?

Australia and US seem to have specific categorisations for drug safety in pregnancy - so would it be helpful to add pregnancy_AU and pregnancy_US. e.g. pregnancy_AU = B would show as B(AU). As for legal status, the template could ensure no rogue values are assigned (eg category = K) and automatically adds the 2-letter country code without editors manually using a variety of formats (eg US, U.S., United States, United States, (US), (US), (U.S.) etc).

There is no specific coding for UK - our British National Formulary in an appendix gives details on problem drugs, in which trimester and why (the wording tends to be a of number of set phrases with qualify explanation but there are a lot of individual specific comments. So any UK info that is not obvious from AU & US categories (eg Promethazine is generally advised to avoid unless benefit outweighs possible harm, yet it is our recommended drug of choice for excessive vomiting of pregnancy !) is all stuff better left as free text under current parameter pregnancy_category - which of course must be kept for backwards compatability for all those articles already using this parameter.

Let me have any thoughts and I can quickly implement this.David Ruben Talk 00:44, 17 July 2006 (UTC)

This seems like a good idea to me. I have personally never added UK-related pregnancy information to drugboxes anyway, mostly for the reasons you outlined above. Fvasconcellos 14:25, 17 July 2006 (UTC)
Yep, sounds like a good idea to me too. -Techelf 10:48, 18 July 2006 (UTC)
pregnancy_AU and pregnancy_US implemented - see template for discussion on how to use. I will ask User:Diberri to implement in his tool the additional country specific parameters. David Ruben Talk 19:09, 18 July 2006 (UTC)
I've added these to the template builder. Here's an example. --David Iberri (talk) 21:40, 18 July 2006 (UTC)
Great stuff - but its lost the | excretion = parameter line in standard & extended format. David Ruben Talk 22:03, 18 July 2006 (UTC)
Fixed. --David Iberri (talk) 02:55, 19 July 2006 (UTC)

[edit] Automated filling of drugboxes

Hi there! I've just created a tool for automating the process of filling out the drugbox template. Given a DataBank accession number (eg, APRD00109 for indomethacin), it pulls a DataBank card and produces a filled-out drugbox template. Try it out at http://diberri.dyndns.org/wikipedia/templates/?type=dbid. Cheers, David Iberri (talk) 17:06, 15 June 2006 (UTC)

Gosh - Brilliant stuff - well done ! Some quick thoughts:

  • Your tool is also automatically pulling out melting points & smiles, are they really necessary for the majority of drugs (useful where physical properties or synthesis details interesting in their own right eg aspirin, or chloroform) as I initially imaged these optional fields would only rarely be useful to the majority of readers - but thats just my own penny's worth view :-)
  • You used the chemical formula option, but a recent alternative was element definition added by user BorisTM. Is this either easer or better ? (I like the look, but am undecided whether this is necessarily easier in all cases)
  • Your tool produces a result on a single line, obvious advantage is more compact, would display on separate lines be easier for others to follow ? (I weakly prefer compactness to more expansive display). David Ruben Talk 18:32, 15 June 2006 (UTC)
Thanks! Let me see if I can reply to each of your points:
  • You're right -- not all fields are relevant to all drugs. I just assumed folks would remove the unnecessary ones manually. I suppose I could add a "minimal fields" option that would remove them automatically, but I don't like the arbitrary definition of "minimal".
  • How about "Standard" (vs "Extended"), given these other ones only existed in the last week since I added them ? David Ruben Talk 22:56, 15 June 2006 (UTC)
  • Element definition wouldn't be difficult to implement, but I can't think of a good reason to prefer it over specifying the formula longhand. The only advantage I can think of is that element definition avoids the <sub>s.
  • There's an option to "fill template vertically" that puts each parameter on its own line. Does that do the trick?
Cheers, David Iberri (talk) 22:41, 15 June 2006 (UTC)
  • Oh what an idiot I am - of course - yes, thanks. For drugbox only, could vertical be the default option ? :-) David Ruben Talk 22:56, 15 June 2006 (UTC)
This is wonderful - thank you so much for building this. One bit of feedback: I just tried it with Streptomycin and noticed that the ATC code(s) aren't populated (found at the bottom of the "Drug Category" field on the Drugbank page for Streptomycin). --Arcadian 11:54, 16 June 2006 (UTC)
I made the dumb assumption that because none of my test cases (eg indomethacin's) had complete ATC codes then no DrugBank card would have a complete ATC code. Thanks for telling me otherwise. What I've done is when ATC codes are complete (ie, 7 characters long), I've included them in the template; otherwise, I've left them out. Sound about right? --David Iberri (talk) 15:53, 16 June 2006 (UTC)
I just tried it at Aminosalicylic acid, and it worked great! --Arcadian 16:16, 16 June 2006 (UTC)
Also, for fields like "pregnancy_category", which appear by default even when unpopulated but aren't populated from DrugBank, I'd recommend including the field in the output, so that it is easier to fill in the field manually later. --Arcadian 12:02, 16 June 2006 (UTC)
Presently you can display all fields by checking the "display all template fields" box. As a more long-term solution, I'll be implementing the standard/extended fields idea that David mentioned above. --David Iberri (talk) 15:53, 16 June 2006 (UTC)
These standard/extended fields are now implemented with the addition of the "show extended fields" checkbox. --David Iberri (talk) 01:41, 17 June 2006 (UTC)
Thanks - can smiles and melting_point also be switched to extended only. Also "APRD00248" for amoxicillin seems to cause it to error: David Ruben Talk 01:54, 17 June 2006 (UTC)
(Error message snipped)
Thanks for the error report -- seems DrugBank's strict XHTML wasn't so strict after all. Should be fixed now that I've added some extra filtering. Also, "smiles" and "melting_point" are now shown only if you tick the "show extended fields" checkbox. Cheers, David Iberri (talk) 05:05, 17 June 2006 (UTC)

[edit] The names

Guys don't forget to check how the names look in Firefox or Netscape - they don't cut the long words the way Opera and Explorer do. -- Boris 01:21, 17 June 2006 (UTC)

Can you give general method of splitting to assist for those browsers (I've just got Internet Explorer which my machine just about copes with - any other software will completely seize me) - I can't compare appearances - next computer will I'm sure with suitable attached go-faster stripes :-) David Ruben Talk 01:40, 17 June 2006 (UTC)
I've had to manually add <br /> (line break) tags pretty empirically. I try to keep related chemical terms together and end lines at hyphens where possible (cf. irbesartan). Hope that helps. -Techelf 08:29, 20 June 2006 (UTC)

[edit] SVG preferred

I suggest you make SVG the preferred image type. SVG is the preferred image type on wikipedia for diagrams Nil Einne 21:51, 19 June 2006 (UTC)

Preferred, but the implementation still seems to be quite buggy – last time I tried uploading an SVG image that I'd made in Illustrator, I had to juggle the settings repeatedly until I gave up and just used PNG. Also, most people don't have access to software that can export in SVG format. But if you have any advice on easily getting SVG structures drawn with ChemDraw (and exported via Illustrator), it'd be much appreciated. -Techelf 07:50, 20 June 2006 (UTC)

[edit] Image

Just a little reminder to all users, it's image NOT Image. Since image defaults to {{pagename}}.png, I spent ages trying to work out why my update wasn't working. Trouble is it was Image (I didn't actually insert it, I just modified an existing tag) therefore my tag had no effect! Nil Einne 21:51, 19 June 2006 (UTC)

[edit] Changes to the template

People, if you want to test for how any new change is going to affect this template, or any template in general, use {{Add code}} to do so (i don't use that template for anything but for test grounds or "template sand-box" if you want to call it) - just replace its current code with the code for {{Drugbox}} and check the changes in the "Add code" talk page by calling the template there. It would be a good idea that after saving a change to write "Testing" in the "Edit summary" and after you done with using the template to write "Done", so by checking the edit history those who want to use the template will know if they can use it or they have to wait.
Don't make numerous little changes here because this template is being used by many and its going to be used by even more articles, and any change however little it is puts presure on the serveres (recashing, etc) - the bigger the number of the articles that use the template the higher the presure. -- Boris 02:06, 21 June 2006 (UTC)

I'm probably one of the culprits, so thanks for pointing out the Add_code template. Cheers. -Techelf 10:18, 21 June 2006 (UTC)

[edit] Table and image widths

Table's 280px, image's used to be 250px but Arcadian dropped it down to 220px. Why? What's the good of having smaller images and all that white space around them? -- Boris 23:37, 22 June 2006 (UTC)

To get closer to Wikipedia standards. For example, Template:Album infobox, Template:Infobox Book both default to 200px. I wouldn't object to making the table smaller, though. --Arcadian 02:21, 23 June 2006 (UTC)
A standart!?! Template:Album infobox sets 200px as default, Template:Infobox Book sets none, Template:Drugbox - 220px. What kind of wiki standart is that? And i don't think there is a "standart width" of the infobox image at all. Arcadian, if there is any "cross-infobox" standart that is the principles by which the templates work. The use of parser functions or standart wiki styles - is not mandatory, they just set a flexible frame for the different infobox templates, as soon as we try to make that frame rigid, say - standart image widht, the same style rules or whatever, then we got a problem because not everything will fit in that frame - the different infoboxes provide different information, and if one setup looks well for one infobox it won't look that well for a different one. I bet you know all that.
I would definately object making the table of drugbox smaller. -- Boris 05:21, 24 June 2006 (UTC)

[edit] New fields

I think I've now got most of the articles converted to the new template, at least for the drugs that have an ATC code. I've noticed that a lot of pages had ad-hoc rows added to the old manual template for indications, contraindications, and side-effects. Does anybody have an objection if I add optional fields to accomodate this information? (Currently, I've just sequestered this data into its own dedicated box, but in many cases that looks sloppy and inconsistent.) Other fields that might be useful could be "brand_name", "year_of_first_synthesis", "year_of_introduction", "medlineplus", "diseasesdb". Any thoughts? --Arcadian 14:39, 25 June 2006 (UTC)

I think that the drugbox should only contain concise data, and that content requiring further discussion (e.g. indications, contraindications, adverse effects) should go in the main text only. If we add too many things to the drugbox, it just becomes too long and unwieldy – it's already getting quite lengthy as it is. -Techelf 11:12, 27 June 2006 (UTC)
I generally concur with Techelf and feel side-effects. contraindications, years and disease links have no place in this infobox. I raise 3 points - please do add indented comments to each of these :-)
  • An abbreviated 'Indications' field after the 'Routes' would not be unreasonable
  • Similar for the purposes of classifing the drug, how about a 'Drug Class' field which would be used to specify the drug as a gluticorticoid, chemotherapy, antibiotic etc ?
  • As for length of the cuirrent template, can we save one line with the drug's name? The 'Systematic name' section only currently contains the 'IUPAC name' which occupies its own separate line. Would it not be simpler to merge this into the section title as 'Systematic IUPAC name' ? David Ruben Talk 22:47, 30 June 2006 (UTC)
I agree with merging "systematic name" and "IUPAC name" into a single line, but I propose that we use the label "IUPAC name" or "systematic name" (either of which would link to IUPAC name) instead of "systematic IUPAC name". All IUPAC names are systematic, thus "systematic IUPAC name" is redundant. --David Iberri (talk) 03:40, 1 July 2006 (UTC)

How about systematic (IUPAC) name? Copperman 14:01, 2 July 2006 (UTC)

Ooh, I think I like that. --David Iberri (talk) 22:34, 3 July 2006 (UTC)
Concur - and so changed :-) David Ruben Talk 23:23, 3 July 2006 (UTC)

[edit] Testing for image existance

I tried in last couple days to test whether image exists, as currently a red link is shown if it does not. I've reverted back and copied the code across to the template sandbox Template:Add code and displayed, as examples, the chloramphenicol & cyclophosphamide in the sandbox's talk page Template talk:Add code which shows that for some pages only image2 is shown. Nor does it seem to be exclusively whether the 1st image is derived from an explicit definition (image=X.png) or as a default (PAGENAME.png). I also seem to have a variable response on trying to locate images within wikipedia (typing Image:xxx into the search box) with some images being jumped to directly, and for others a search result page is shown indicating a single entry that I must then select as a two-part process - is this a related issue ?

I copy from my talk page a thread about this:

Hi David, you made some changes today to the drugbox template - getting rid of the red link if no image exists. This is great, but it has had the effect that some pages employing the use of the drugbox (e.g. aspirin) only show image2 and not image. Can you fix it? Cheers Ben 15:43, 12 July 2006 (UTC).
So it does - however I had used amoxycillin as my test page for 2 images and that works - will look into this further.David Ruben Talk 16:04, 12 July 2006 (UTC)
Ah Image.Aspirin-skeletal.svg does not exist, which explains why only the image2 is shown ! So not problem of the template but of image name chosen, phew :-) Now whatever happened to aspirin's line drawing ? I'll trawl back through the aspirin article's history... David Ruben Talk 16:07, 12 July 2006 (UTC)
Image:Aspirin-skeletal.svg exists! The same problem occurs at many drug pages (although not all - see cyclophosphamide for one not affected - I just checked chloramphenicol and there's a problem there.
Sorry if I've wrongly accused you! I just noticed this problem this afternoon. I thought you'd like to know either way. Ben 16:16, 12 July 2006 (UTC).
So it does (drats) - funny using the search box on each page acts differently for different images. For Image:Aspirin-skeletal.svg it fails to launch into the page, but offers a link to jump to it. Whereas searching for Image:Amoxicillin.png jumps directly there. Could you have a look at pages you tested to see if this is a problem with .svg files rather than .png ? David Ruben Talk 16:23, 12 July 2006 (UTC)
I've just had a look at chloramphenicol. Its first image is a PNG, so it doesn't seem that the SVG format is the root of the problem. Ben 16:44, 12 July 2006 (UTC).


So can anyone advise on my coding error at Template:Add code ? David Ruben Talk 17:01, 12 July 2006 (UTC)

The image that doesn't show up is on commons - of what i was able to grasp so far (i might be wrong thou) you can't use "ifexist" to check for that because the page actually does not exist on en.wiki, instead you have to use {{exists}}, according to the parser functions guide. I tried to find a solution in the small time span that i had before going to bed but i'm tired and i need to get flat. -- Boris 02:30, 13 July 2006 (UTC)

[edit] Colorized element symbols in formula

Is this really a good idea? Having colorized letters in a line of text is kind of distracting. It's especially bad that N is the same color as a hyperlink or wikilink and O is the same color as a dead wikilink. The only use I can see is to provide a color legend for the structural images, but from what I've seen, not many images used in the drugbox are colorized at all. DMacks 16:11, 28 July 2006 (UTC)

[edit] Abbreviations

Would it be OK to expand Mol. to Molecular and cat to category? Seems like they will both fit without wrapping. Rich Farmbrough 15:12 7 August 2006 (GMT).

[edit] "Formula" field

There seems to be a problem with the "Formula" field, the output is breaking awkwardly (see pancuronium, glibenclamide and paracetamol for examples). I have accessed several pages which use the extended form (ie, | C = | H = | N = etc.) on both Firefox and IE and they look the same. Fvasconcellos 21:26, 8 August 2006 (UTC)

Yeah I've also noticed a problem in Firefox and Safari, seemingly with the display of the oxygen character. -Techelf 09:59, 9 August 2006 (UTC)
Might be a stretch, but could it have something to do with this recent change to Template:OrganicBox atom? This could simply be ignorance on my part, as I know less than nothing about template syntax, but the time frame fits. Fvasconcellos 00:36, 10 August 2006 (UTC)
Could not see why interwiki link within noinclude tags should - and on quick test made no difference. Clearly something has changed - also seems not to do with oxygen, but new lines after nitrogen.David Ruben Talk 02:17, 10 August 2006 (UTC)
Seems fixed now. Maybe this did the trick? Fvasconcellos 23:00, 10 August 2006 (UTC)

[edit] Image optional

Could someone make the image optional, so there is no ugly red link at every newly created drug article?? I am not sure how to do this... --WS 15:30, 2 September 2006 (UTC)

Yes 1 tried misserably to do this previously, and User:BorisTM had a valient go too (see User talk:BorisTM#Template:Drugbox image and this attempt). The problem lies with the parse parameters, for which there are two, to look for existance of an article (in this case we presume an image). However images may both be in english wikipedia image space and commons wiki and each parse parameter behaves differently for the two spaces. This might not be a problem if only a specified image name were being searched for, however the template allows for the imagename not to have been specified at all, in which case a default of PAGENAME.png is to be used.
So that's 2 possible sets of names (specified by parameter or else default name) to be tested across engish and commons wikis - we ended up being able to test for existance in any single part of this 4-way test, but not all simultaneously. Canone care to have a further go, see Template:Add code sandbox area. David Ruben Talk 16:21, 2 September 2006 (UTC)
And what if the standard PAGENAME.png would be removed? So that people will be required to explicitly specify an image name? --WS 16:48, 2 September 2006 (UTC)
A good idea if we were introducing this template afresh. However how many articles already rely upon this default for images which do exist - i.e. if we remove the default option, how many drug articles suddenly stop displaying a valid image ? I suspect the testing coding just needs to be done less elegantly, i.e. nested tests with #if and #ifexists, with english and commons, with specified or default names (ie no attempt at image|{{PAGENAME}}.png) - ie 8-levels of testing - ughhh - perhaps when the migraine has settled I'll have another go, but meanwhile anyone care to offer a simpler approach to attempt ? David Ruben Talk 17:07, 2 September 2006 (UTC)
A bot could probably be used for the transition, to modify the drug articles which depend on the default image being there ?? --WS 18:26, 2 September 2006 (UTC)
Don't personally know much about bots, but if could be done then yes probably simpler. NB caveat: need someone with advanced knowledge of the parseparameters and English/Commons subtleties to guide us here (ie if this really is going to work).
  • It needs identify firstly articles using template:drugbox, select those that have no image parameter defined (either no "image =" with undefined value or no undefined parameter included at all), and then either:
  • Define the image (as { {PAGENAME} }.png) - but kind of messy as implies that such asn image has been uploaded
  • or search to see if a suitable image file can be located and if not then leave in place "image = " ready for the modified drugbox template to then ignore the blank parameter.
I would though seek advice of the likes of BorisTM (or anyone else we might know of) as to whether this is really going to work, i.e. confirm that coding really can be made to work for English/Commons testing, if default parameter value issue is eliminated - no point in lots of work if it ain't going to work :-) David Ruben Talk 01:08, 3 September 2006 (UTC)

[edit] New Licence field

I propose a new row in the drugbox table for the drug Licence. There are two major licensing authorities that I've found that make drug information easily accessible: The US Food and Drug Administration (FDA) and the European Medicines Agency (EMEA). Some examples:

Levetiracetam (Keppra): FDA EMEA

Trastuzumab (Herceptin): FDA EMEA

Pregabalin (Lyrica): FDA EMEA

Both sites contain a wide variety of information, some of which is very comprehensive. The FDA "Label Information" and the EMEA "Product Information", where available, are very detailed. There is material aimed at the professional and also plain-English consumer information. This is a excellent reliable source for article information but also contains much that makes it a worthwhile "External link" since there is no way you could include all the info. Both sites are kept up-to-date with the latest changes to prescribing/licensing practice.

I have found the EMEA site difficult to navigate using Firefox, though this may be due to my version of Java. It is OK on IE, and the individual drug page works fine on both browsers. Both sites work using of the brand name of the drug but the FDA site also allows searches with the generic name (active ingredient), which lists generic variants where they are licensed.

So I recommend that the parameter for the EMEA site be the brand name and the parameter for the FDA site be the generic name. The template code needs to allow the option for either or both to be missing.

Disadvantages: The EMEA is relatively new but is handling much of the new drug applications in the EU since it is cheaper/quicker than going to each country. The FDA have been around a while but old drugs aren't online. Only relatively new drugs have complete information. Both sites will, of course, improve with time.

BTW: The word "Licence" is the noun in British English, "License" is the verb.

Feedback on this proposal would be very welcome. Colin°Talk 13:38, 7 September 2006 (UTC)

I'd support it. Navigation in the FDA website is pretty convoluted, though – I personally found it easier to navigate around the EMEA pages. Fvasconcellos 16:25, 7 September 2006 (UTC)
Support. --Arcadian 23:21, 7 September 2006 (UTC)
Support - better a link to regulatory authorities than drug campany websites. David Ruben Talk 02:08, 8 September 2006 (UTC)

Ok- I've added licence_EU and licence_US parameters which each take just the search word to be sought - can people just check that this works with items that are not just a single word - i.e. will we need request that editors use underscore in place of any spaces ? David Ruben Talk 02:08, 8 September 2006 (UTC)

Before anyone gets too excited and starts applying the new parameters to loads of pages, have a look at how the coding currently formats for Levetiracetam following this edit. If people agree to styling and don't find fault on some testing ("Show Preview") in other articles, then ..... :-) David Ruben Talk 02:35, 8 September 2006 (UTC)
Many thanks, David, for implementing this. I realise now that my text was contradicted by my examples: I recommend using the generic name for the FDA search; the brand name is essential for the EMEA link. The only disadvantage to using the generic name is that the FDA info for the original-brand is likely to be much greater than for the generics - and the reader may be confused as to which link in the search results to pick. What do you think?
Regarding appearance: I think the word "data" is redundant and should be dropped - all the info in this table is data. I wonder if the RHS might be better with just EU US as the links. The reader can find out who the agencies are either by following the links or your wikilink for Licence. I would imagine that most folk don't recognise what the "EMEA" is. The advantage of country codes is that, should other authorities be found that are relevant, they can be added. It also makes it unnessary to include the codes in parenthesis.
Here's a two word link on the FDA site: Acyclovir Sodium. The underscore is needed for the template parameter and works fine. The EMEA site uses brand names so two words are rare. When they do occur, their url is composed of the adjoined words. For example: Infanrix Penta.
The easiest way to navigate the EMEA site, and the list of drugs, is from their SiteMap. For ease of reference:
Colin°Talk 08:46, 8 September 2006 (UTC)

[edit] Controlled drug status in legal fields

I've noticed editors adding specific controlled drug categorisations to some drugs eg Phenobarbital, rather than just leaving a 'Px_only' or 'CD'. Given then the need to link these classifications to the relevant article in Wikipedia explaining them, I've added the categorisations to the list of terms recognised by the drugbox template. See new description of recognised terms and the simplification this allows to Phenobartical (compare here) and Heroin (compare here).

Let me know if this needs any adjustment to the formating, or indeed to teh very principle enacted here :-) David Ruben Talk 19:10, 17 September 2006 (UTC)

re Canada
I've added legal_CA with link to Controlled Drugs and Substances Act for Schedule I-VIII. If anyone knows of their non-scheduled scheme of classification (i.e. OTC, Pharmacy or normal prescription-only) then let me know and I can add it to the template coding. David Ruben Talk 04:00, 18 September 2006 (UTC)

[edit] Superscript formatting

I see the <sup>3</sup> way of superscripting that we've always used just got changed to the unicode "superscripted 3" character. Is unicode the way we want to be doing scientific/mathematical exponent notation now? DMacks 13:02, 21 September 2006 (UTC)

Don't assume that bot edits (a) make sense (b) reflect consensus or (c) indicate anything other than the personal tastes of the bot user/author. Call me cynical. Colin°Talk 13:49, 21 September 2006 (UTC)
To be fair, you are being very cynical, unicode is by far the most common way of formatting units and is easier to understand for people who are not familiar with html syntax (i.e. most people). I'm sure we all agree having a mixture of different syntaxes is not optimal. Martin 15:26, 21 September 2006 (UTC)
If mixing is bad, then given that there are only unicode for superscript-1/2/3, chemistry articles should use the HTMLish form of sup/sub numbering exclusively.
Chemical formula C6H12O4
Density 1.18 g/cm³
looks pretty poor. DMacks 20:44, 21 September 2006 (UTC)
The unicode is almost always used for things like cm³, I am just cleaning up the relatively few articles that don't, I should make it clear that I am not converting all possible instances of superscipt to unicode, just things similar to cm³. Martin 08:03, 22 September 2006 (UTC)
Also, scanning the database shows that, of the occurances I was changing, the unicode is almost 10 times as as common as the equivalent sup markup (the copy of the database used pre-dates any changes I made). Martin 08:24, 22 September 2006 (UTC)
I have no problems with unicode in general, just with the blanket conversion of things like cm<sup>3</sup> in articles that are full of and other sup/sub formatting of numbers. Perhaps you're confusing me with the other commenter on the bot's talk page? DMacks 02:17, 25 September 2006 (UTC)
OK. To answer the original question: I'm not aware of unicode symbols for superscripts other than 123 (see the symbol list the bottom of the page when you edit an article). The Wikipedia:Manual of Style (mathematics) uses the HTML formatting for its symbols and I'm not aware of a change to the MOS in this regard. I'd be happier if bots could quote MOS guidelines in their edit summaries. Colin°Talk 18:56, 21 September 2006 (UTC)¹²³123

[edit] Molecular Mass vs. Molecular Weight

Why is it that molecular weight is used instead of molecular mass? Molecular mass is more common and more technically correct. Also, the wiki page on molecular weight redirects to molecular mass anyway. Doing a quick Google reveals there results:

molucular weight = 33 900 000 results
molecular mass = 30 600 000 results

But if you filter out results from Wikipedia (as I would assume would be the only way to recieve an unbiased result) you get:

molucular weight = 51 400 000 results
molecular mass = 54 300 000 results

I'm still not sure why there are more results for both when you discount Wikipedia, bu molecular mass is more ubiquitous regardless. Every reference I have ever seen in the circles of education has used molecular mass. After all, the gram is a unit of mass, not weight.

Zippanova 17:57, 24 September 2006 (UTC)

  • "molecular weight" -wikipedia -encyclopedia gives about 140,000,000 Google hits
  • "molecular mass" -wikipedia -encyclopedia gives about 34,100,000 Google hits

That's about what I would expect. While molecular mass might technically be more correct, molecular weight is the more commonly used term in labs. Cacycle 18:25, 24 September 2006 (UTC)

I agree we should use mass, not weight, regardless of what google dictates. As stated mass is more accurate, which is surely the over riding factor for an encyclopedia. Martin 22:33, 24 September 2006 (UTC)
In fact, I would insist we use mass, as even our own article is called Molecular mass to which Molecular weight redirects. Martin 22:35, 24 September 2006 (UTC)

[edit] #switch

Hey, I was just quickly looking at the code and there are a lot of nested #if statements, which should probably be changed over to #switch statements by someone who understands ParserFunctions and drugs, unlike me who only understands the former and would stuff it up somehow. For examples, see the source of Template:Infobox Australian Place right up the top for the {{{state}}} field. Notice also the display of an unknown value. Anyway, --TheJosh 11:23, 9 October 2006 (UTC)

Wow - thanks TheJosh for the suggestion. That proved so much easier to code and leaves the template much easier to maintain or to add in extra options (e.g. additional uppercase/lowercase variations). Seemed to work with pages I tested - but, of course, if anyone spots a problem - let me know :-) David Ruben Talk 02:05, 12 October 2006 (UTC)

[edit] Bug with melting point

It seems that if you give the template a range for the melting point it outputs some weird result for the Fahrenheit conversion. Example: Methaqualone. Maybe this is why the 3,4-methylenedioxyamphetamine page doesn't use the template? —The preceding unsigned comment was added by Aubilenon (talk • contribs).

There's no bug as such, the parameter just expects to receive a numeric value in centigrade. So "113" or "115" will work, but "113-115" is not a number but a text string specifying a range. I generally just use the onset of melting point, so in this case "113". Please do remind me what the range means here (is it just the start & end of melting points, or a different temp if one is heating a solid to liquid vs cooling a liquid to solid). If it is really important, then I could add additional melting_low and melting_high parameters. David Ruben Talk 23:06, 22 October 2006 (UTC)
Pure substances are supposed to melt and freeze at fixed temperatures. On the other hand, mixtures melt and freeze in temperature ranges. In practice even spectroscopically pure substances do not necessarily melt or freeze at a single temperature. Experimentally, melting and boiling points are always noted down as ranges rather than single points. --Rifleman 82 16:23, 4 January 2007 (UTC)
Also, there is a bug if one would like to make a note after the melting point value (eg: Asprin, on Jan 23, 07 - "boiling_point = 140 (decomposes)" gives "Boiling point: 140 (decomposes) °C (Expression error: Unexpected ( operator °F)."). This information may be important, so it should not simply be removed, but the parser should be modified. MadScientistVX 19:23, 23 January 2007 (UTC)
I agree. I have absolutely no idea how this should be done so I've kept away, but it definitely doesn't look good in its current form, especially on an article as important as aspirin. Fvasconcellos 21:35, 23 January 2007 (UTC)
Other than for chemists, I suspect giving a range is not important to the general readership (i.e. it is not notable). No one buying or taking aspirin for a headache is going to worry nor care about the width of the melting point range, whilst the point it starts to degrade perhaps is. I can see merit though in allowing for some free text commentary. None of the above ideas are hard to code and I'll happily do this, BUT this will need to be done "right" the first time (before too many articles start using parameters which then are changed or need recoding). So here are some proposals :-)
  1. If people really really feel we need to provide a range, then there are two possible methods:
    • Either create 2 new parameters of melting_low and melting_high (similar to Template:cite journal where either 'author' is used or 'last' & 'first' name parameters are used)
    • Alternatively melting_point is still used to provide the start of melting, and just one new parameter of melting_high is created to indicate that a range is being given.
    The first method is perhaps a little more self-explanatory, the second will need less editing of individual articles as the low limit parameter is already set, and only the upper end of the melting range needs be added.
  2. Might I suggest an optional parameter melting_notes, or some other suitable name, to allow insertion of free text. Presumably this needs to appear after the °C & °F values are displayed ?
  3. I presume boiling point is a single value. But again is a free text parameter of boiling_notes also needed ?
So those are my tuppence of thoughts, let me know yours (or 2cents if American) :-) Yours David Ruben Talk 01:36, 24 January 2007 (UTC)
I'd second the addition of melting_notes, in the vein of using both legal_XX and legal_status. Is there any way for the output to be changed only if melting_high is used, to give something like melting_lowmelting_high °C? Fvasconcellos 13:37, 24 January 2007 (UTC)
Indeed range only attempted to be displayed if melting_high defined and would also show the range of °F :-) David Ruben Talk 20:36, 24 January 2007 (UTC)
OK than, sounds excellent by me. Damn imperial units, forgot about them :) Fvasconcellos 20:56, 24 January 2007 (UTC)

OK so enacted, and see this adjustment to Aspirin which now shows melting range and has comment for the boiling point. Let me know if alternative names of the parameters should be used (eg "melting" and "boiling" for the comments), before we carry this through into too many articles. Yours :-) David Ruben Talk 02:12, 25 January 2007 (UTC)

[edit] Substructure search in eMolecules and PubChem added

I have added a SMILES based substructure search for eMolecules and PubChem. Please have a look at Cetirizine containing already SMILES code and this can been seen as an example.

Please comment on possible improvements. Things I considered

  • How to improve visualization for SMILES? Smaller font, truncating it?
  • Instead of search in should just use images for eMolecules and PubChem?
  • Undisplaying SMILES, but keeping the external substructure search option.

JKW 13:47, 27 January 2007 (UTC)

Hi there. Sorry to raise an objection, but wouldn't this clutter the template much? SMILES is rarely used as is, and wouldn't it really look bad on, say, large molecules such as paclitaxel or vancomycin :)? Fvasconcellos 14:10, 27 January 2007 (UTC)
Hi, the problem is bigger, the code breaks when there is a "]" or something like that in the SMILES, what occurs in some cases. I'd be interested in a solution, though. Just as a note, there is a discussion about moving all the 'chemboxes' to the new chembox new on the chemistry wikiproject, you might want to join that discussion. --Dirk Beetstra T C 14:14, 27 January 2007 (UTC)
I agree on both. First, SMILES is an option not a must and a workaround might be just having the link-out for the substructure search, but not displaying the SMILES for all entries. Second, breaking the Wiki-Code is a serious issue and can we not just add SMILES as raw data by using nowiki or pre tags? And in general a substructure search contains a lot of information, so I would like to keep it somehow. The same is also the case for InChI since this is indexed by Google as well. JKW 14:36, 27 January 2007 (UTC)
I tried a nowiki tag without success, because this blocked the template replacements. I need help here. The SMILES code was excluded, but the search in eMolecules and PubChem was kept. JKW 14:55, 27 January 2007 (UTC)
I have tried quite some things, but all seem to fail, or to just give an improperly encoded SMILES/InChI. I could code this for you (e.g. <smiles> </smiles>) which would create a proper link (I have done something like that for chemical formulae, see [1], chemistry part of that test-wiki). Might have a look tomorrow. Problem is going to be to convince Brion and Tim to enable these tags on en.wikipedia.org. See you around. --Dirk Beetstra T C 15:03, 27 January 2007 (UTC)
Thanks, that would be great and I am pretty sure that some people like Egon, Rich and me would be quite happy to vote for it ! Beside, I think this goes beyond SMILES and this is a general template replacement issue and it should (in theory) be easy to convince people about a nowikified-template replacement. JKW 17:56, 27 January 2007 (UTC)
Two more comments. First, if you check the Cetirizine example you will realize that the provided PubMed identifier is far from being unique, so we should definitely provide a SMILES substructure search link-out. Second, with respect for very large SMILES codes I am wondering if it is not possible to provide some dynamic HTML for allowing optional SMILES visualization. In general I think it should not be shown, but people should be able to copy it, if they really want. In fact, by executing the search at eMolecules and PubChem, they can copy the SMILES code from there. So, the actual solution is already very nice! JKW 18:32, 29 January 2007 (UTC)
Something I forgot, if we want that Wikipedia articles are indexed via Google providing InChI code than we should maybe just add InChI and (non-unique?) SMILES code to the bottom of each drug article? There a DOI or PMID analog link-out template might be really helpful. This template should then link-out to eMolecules and PubChem. JKW 18:45, 29 January 2007 (UTC)
I would like to see this wider, all chemicals. --Dirk Beetstra T C 18:47, 29 January 2007 (UTC)

(undent)You can make your trick to work, though I would like to see the actual smiles. But, as the code is now, it does break. For a compound like maltose the coding does break, see User:Beetstra/DrugBoxTest. You need an urlencode. --Dirk Beetstra T C 18:42, 29 January 2007 (UTC)

Thanks for providing this test, who should we contact about this technical issue? JKW 18:48, 29 January 2007 (UTC)
And you are right, for general chemicals we must provide substructure searches, no way that PubChem identifiers help us here since there are just too many flavours of chemical compounds. And caused by this also too many identifiers, e.g. salts, tautomers, protonation states, etc. JKW 18:51, 29 January 2007 (UTC)
Indeed, these do maybe not have a PubChem, but they do have a CAS, and some do have a PubChem as well.
I know how to solve the technical problems, you can have a look at [2], maltose is going correct there (it has been a testcase for long for me) .. but:
It runs again into another discussion. When linking to commercial sites, the answer is simple, that is a no go. But for government funded sites, or for whatever external site, the trouble is, when eMolecules gets the link, PubChem is not getting it, and when you do both, Ebi is not getting the link .. etc. etc. Some of these sites are payed by how many information they provide, so there is a bias there (though not as bad as when linking to one specific commercial supplier). I still think it has to be solved via a meta-page, not via a (maybe biased) single link in the 'chemboxes'. --Dirk Beetstra T C 18:59, 29 January 2007 (UTC)
An ideal collaborative resource would be designed for large-scale data mining, contain curated historical data, and have data standards and deposition tools that could constantly bring in data from the published literature. Nature article ... yes, but we are not there ... lets start with what we have ... or found a new organization !;-) JKW 20:04, 29 January 2007 (UTC)
Still, sometimes not starting is also a solution, one link may provoke another, and that is what spam is all about. I know it is convenient to have the links .. but as a strong defender against commercial-spam, I do believe I should also defend non-commercial institutes. Having said that, I repaired the links. --Dirk Beetstra T C 22:14, 29 January 2007 (UTC)

Do we have our own editable wikipedia chemical database thing, where we could search about anything and the results are going to be linked to our database pages? -- Boris 15:37, 30 January 2007 (UTC)

I've programmed something like that, it is not standard built into the software of a mediawiki. You can see a running example here. It works like the special:booksources, a similar special page that is available on wikipedia. --Dirk Beetstra T C 15:41, 30 January 2007 (UTC)
How about something this (which is very primitive at the moment, but eventually will allow for edits, just in like Wikipedia, and advanced search as well)? -- Boris 16:23, 30 January 2007 (UTC)
@Boris: too unflexible and not general enough.
@Dirk: The special chemistry page is a good idea and looks already quite advanced. And this does still not solve our problem. Who should be contacted and can those people also ensure nonwikified template replacements avoiding problems with brackets etc.
@ALL: I do not care which substructure search service is provided, but my feeling is that the proposed solution of Dirk or a very fancy template might do the trick. And after contacting some other people can they please provide us with some timelines and concrete persons taking repsponsibilities? I do not want to spend my time discussing things over-and-over again. JKW 17:54, 30 January 2007 (UTC)
Joerg, I already repaired the template, that is now working also with strange SMILES, just have a look. Don't expect a more extensive solution soon, except when you manage to poke Brion and Tim (who are 'those persons' you mention above) to activate the special:chemicalsources, what you can do in the meantime is just vote for the patch here. --Dirk Beetstra T C 18:57, 30 January 2007 (UTC)
Thanks, lets see if we reach the critical mass for this extension. I have posted a 'please vote' message to some relevant eMail distribution lists. JKW 22:03, 30 January 2007 (UTC)

[edit] Name parameters

User:The Right Honourable recently added code for all uses of this template to have sections for British Approved Name, International Nonproprietary Name and United Stated Approved Names. May we discuss this first please, particularly before this perhaps gets implemented into lots of articles.

  • Is this needed at all? Wikipedia:WikiProject Drugs/General/Naming of drug pages indicates that all drug articles should be named for the International Nonproprietary Name, so a "International Nonproprietary Name" parameter is surely merely duplication.
  • The article already displays the article's name as a caption to the picture section, for most articles this is therefore already a display of the INN.
  • Are there any drug articles not named for the INN ? If so, then do these articles need renaming to the INN ?
  • All British Approved Names should now be the same as the INN. The only exceptions are for Adrenaline, and even here the BAN allows for the INN as an alternative (unlike the European Name which is at odds on the INN in this single example - so not a reason for all uses of the Infobox to need this feature). The BAN parameter will therefore essentially always duplicate the INN.
  • Method of including former BAN and current USAN within an article's introduction are already standardised and described at Wikipedia:Manual of Style (medicine-related articles)#Drugs
    • Articles can mention previous or former BANs (before the INN was adopted) but this is better given in the text of the article, it certainly does not seem to be a currently active and thus relevant piece of information for inclusion within this Infobox.
    • The United States is perhaps unique in not generally adopting the INN. Articles currently seem to cover this well, so again is it really needed ? Remember wikipedia is worldwide, even if we restrict ourselves here in English Wikipedia as to our target audience, and for the vast majority of countries only the INN applies. The US then is just a minority isolated exception to this - albeit of course of worldwide importance (including drug development & usage) beyond "just" being a "minor" country :-)
  • However, if any of these parameters are thought worthwhile, then a few further thoughts:
    • Keep the parameter names brief, ie "USAN" & "INN"
    • Perhaps the USAN, if thought a parameter needing to be included in the Drugbox Infobox at all, would then be an optional subheading of the INN/Article name which currently appears under the images
    • Alternatively the INN/Article name and USAN could appear as a top header for the template (see Template:Infobox Hospital ?

Hence perhaps:

  • INN = {{Pagename}} <!-- used where the article name is not the same as the INN -->
  • USAN = <!-- generally not defined -->
Paracetamol USAN: Acetomorphine
Images
IUPAC name
and rest of current drugbox template

And in the case of Paracetamol:

  • INN = Paracetamol
  • USAN = Acetaminophen


I still doubt the need to specify INN/BAN, and invite thoughts as to why USAN is required ? David Ruben Talk 01:26, 29 January 2007 (UTC)

I, for one, initially oppose the addition of such parameters. How would we present bupropion, for instance, whose INN was "amfebutamone" from 1974 through 2001, when the then-USAN bupropion was adopted by the WHO? (see note 1 in the bupropion article) In my humble opinion alternate names (i.e. BAN/USAN) should be mentioned in the lead. I'm open to arguments in their favor :) Fvasconcellos 01:42, 29 January 2007 (UTC)

[edit] Needs to have "other names"

We need an "another names/commercial names" section, to show what it's called in the ol' commercial sector. James.Spudeman 14:50, 9 February 2007 (UTC)

  • No - drug official names (eg USAN) is one thing (and not enthusiastically sought in previous section), but list of brand names is not appropriate. For many drugs the list of country-specific brands gets to be very long, and in a narrow infobox this will cover screenfuls. This is best left in the article if any specific brands thought notable (and most are not as far as a worldwide encyclopaedia is concerned, other than 1st brand to market, or perhaps as this is English Wikipedia the 1st & leading brands in English-speaking countries). Even the list for paracetamol was too long for the article and now is a large full-width table at List of paracetamol brand names. David Ruben Talk 18:41, 9 February 2007 (UTC)

[edit] Recombinant proteins

There are a growing number of drugs that are actually recombinant proteins. IUPAC naming doesn't really make sense for these. In fact there are a number of articles with incorrect IUPAC names. I'm going to add a space to include the peptide sequence for these drugs. --Selket Talk 21:50, 17 February 2007 (UTC)

I'd support that. As for IUPAC names, I try to correct them when I find them :) Fvasconcellos 22:04, 17 February 2007 (UTC)

[edit] Chemical pages needing a structure drawing

Should {{drugbox}} be modified to add drug articles that don't have structural images to Category:Chemical pages needing a structure drawing the way that {{chembox new}} does? --Ed (Edgar181) 20:37, 20 February 2007 (UTC)

I'd support that. There's another really clever feature in that template I'd also support -- when you print a page, it knows not to print the URLs in the infobox. --Arcadian 21:03, 20 February 2007 (UTC)
Hear, hear. Dirk is aware—let's see what he can do ;) Fvasconcellos 21:17, 20 February 2007 (UTC)
I'll have a look. But beware, I might have to throw the whole code of the drugbox over to get certain things to work .. But I will make sure everything is backwards compatible. It may take some time, though, I want to try something first. --Dirk Beetstra T C 00:02, 21 February 2007 (UTC)
OK, I planned a revamp of the thing, but that seems to be too difficult, so I have decided to first tweak this template. Compounds without images are now automagically categorised (give those picture-drawers something to do!), and when no image is available, no redlinked picture shows up anymore (cleaner view). URLs are now plainlinked, so they will print nicely. Hope this helps. --Dirk Beetstra T C 14:31, 24 February 2007 (UTC)
Hmmm... bit of a problem here. Amsacrine, acenocoumarol, ertapenem, fomivirsen and ganirelix, now showing up in Category:Chemical pages needing a structure drawing, do have structures—I should know, I made them! :) Any idea why this is going on? Fvasconcellos 14:35, 24 February 2007 (UTC)
OK—actually, all skeletal formulae (i.e., everything going in the "Image" field) are gone. Only images on the "Image2" field are displaying (see Paracetamol). Fvasconcellos 14:39, 24 February 2007 (UTC)

(undent)Yes, I see. Actually, this is why I was not coding directly, I wanted to recode {{chembox new}} into a coloured chembox, depending on a 'box = drugbox' type parameter .. Aargh .. indeed all images are gone, image2s only work. I'll have look (don't think I deleted .. oh wait .. yes .. I did .. haha) .. --Dirk Beetstra T C 14:41, 24 February 2007 (UTC)

Seems to be OK now. That was that strange construct that was originally there, and which did not work with the new coding .. funny. Could you check if all is OK now? --Dirk Beetstra T C 14:49, 24 February 2007 (UTC)
LOL! Seems fixed now—at least a random sample of articles suggests so. Whew, I *almost* saw my 500-odd structures going down the drain there... :) Not that I don't car for the work of our other molecular artists ;) I am sorry to inform, however, that image2 is broken now! Fvasconcellos 14:51, 24 February 2007 (UTC)
Also, is there any way to "prefer" SVG over PNG? The template is now overriding SVG images with PNGs when they are available: see finasteride. Fvasconcellos 14:58, 24 February 2007 (UTC)

Both fields are now working normally: see posaconazole—thanks Dirk! Categorization is still a bit off, however... too many pages transcluding Drugbox are apparently being added to Category:Chemical pages needing a structure drawing. Fvasconcellos 15:37, 24 February 2007 (UTC)

The function is now similar to the {{chembox new}}, if image or image2 are supplied, those are used (even if they don't exist), when they are not supplied, it uses {{PAGENAME}}.png. If that one does not exist either, it is autocategorised. I may extend the code there a bit, for now I am clearing the pages transcluding the chembox carrying a "image = {{PAGENAME}}.png" (replacing with "image =") from the wikipedia, these thwart the autocategorisation, and are superfluous with this code (they were in the template-example, so were copy and pasted). Only 1440 to go. Enjoy the new drugbox! --Dirk Beetstra T C 16:18, 24 February 2007 (UTC)
Thanks! Can't a bot do that? Sounds troublesome :) Fvasconcellos 16:23, 24 February 2007 (UTC)
I am using WP:AWB for that, that is almost like running a bot-account, I only have to check when it makes a change, and press save (it is set to ignore pages that are unchanged). Down to 1366 already. --Dirk Beetstra T C 16:28, 24 February 2007 (UTC)
Ah, OK then. They're starting to pop up on my watchlist, heh. Thanks again! Fvasconcellos 16:30, 24 February 2007 (UTC)

How about testosterone and demecarium bromide listed on category:Chemical pages needing a structure drawing? They do have valid pictures but it seems to remain categorized thus. --Rifleman 82 18:38, 24 February 2007 (UTC)

I have observed the same problem. Would it perhaps be better to create a seperate category for drug articles requiring structure drawing? -Selket Talk 19:03, 24 February 2007 (UTC)
I am still tweaking a bit, and categories tend to be slow in updating on wikipedia. If you see the article you see that they are not categorised.
Re:own category, I think you will find that the most active chemical structure drawers are in the chemicals wikiproject, and I think this is a typical case of something that could be done in a mixed effort, in the end the category is supposed to be empty anyway. Hope this helps. --Dirk Beetstra T C 19:49, 24 February 2007 (UTC)
I like making them, happy to help. Should we at some point think about migrating to SVGs? -Selket Talk 19:59, 24 February 2007 (UTC)
That depends on what you are drawing, If I am correct, the line-drawings are best as svg, the ball-and-stick/spacefilling best as png (or was it the other way around). Ben Mills is very experienced with this. There are some upgrades possible to this template still, I might have a look later, it is working for now, the picture makers have some work to do. --Dirk Beetstra T C 20:04, 24 February 2007 (UTC)
SVG is indeed better for line models, and PNG for the others. I've always done SVGs—the smaller footprint is well worth the trouble. Ben's been doing some excellent SVGs lately as well; his "style" is my idea of a "standard", if we'd ever have one for structural formulae. Calvero and Ayacop also make theirs SVGs if I'm not mistaken. I'd dare say there is already a trend towards vector formulae :) Fvasconcellos 20:27, 24 February 2007 (UTC)

(undent)I have practically finished cleaning all the "image = {{PAGENAME}}.xxx"-parameters in the drugboxes (replace them with a filename if the image exists, removing them if the image does not exist. I tried to test for existence of images in the drugbox, but that seems to fail (I fail to understand why my {{#ifexist:Image:{{{image|}}}|true|false}} returns false while the image is there). I will continue to test that. That does result in some pages still not being categorised while there is no picture. So if you encounter a page with a redlinked picture, please either clear the image-parameter, or draw the picture. Checking them all is going to be a massive task on 1626 drugboxes, since I can not automate that easily with AWB (I have to check them all visually .. the task I am running can be done semi-automated. Hope this helps. --Dirk Beetstra T C 13:47, 25 February 2007 (UTC)

Anything to do with the fact that the images are on commons? Because I usually find the commons image or upload to commons when none is found. --Rifleman 82 14:28, 25 February 2007 (UTC)
Could be. Testing:
Ah .. OK .. so that is the trouble. Too bad, we cannot test for image existence in this way. That may even mean that in some cases the existence of {{PAGENAME}}.png gets tagged wrongly. In that case the image parameter has to be used, that will make it disappear from the category. Unless parserfunctions comes up with a solution. So be it. --Dirk Beetstra T C 14:49, 25 February 2007 (UTC)
Argh! I upload all my images to Commons, that's why some articles they are used in were showing up in the category. Too bad... Fvasconcellos 14:56, 25 February 2007 (UTC)

Update The category now seems to be updating correctly, and IMHO looks surprisingly manageable. Woo-hoo! Fvasconcellos 15:33, 26 February 2007 (UTC)

Forgot to say, I asked someone who is also developing the mediawiki software, and it is indeed impossible to check whether an image exists on the commons. It seems there is a patch underway, as soon as that gets implemented, I will use that function, makes it even better. There are now still redlinked images, so the actual number is bigger than now. Happy drawing! --Dirk Beetstra T C 15:50, 26 February 2007 (UTC)

[edit] New chemical formula style

I'm going to do the same thing (create a category) for pages that use the old chemical formula style. (Category:Drug pages needing formula fontification. -Selket Talk 19:42, 24 February 2007 (UTC)

That is excellent. I can't believe there are only 45, though. Fvasconcellos 19:47, 24 February 2007 (UTC)
Because the category is transcluded, it only gets added when the page is rendered. We need to wait until people view all of the pages in question. More are popping up. --Selket Talk 19:58, 24 February 2007 (UTC)
OK, thanks. I don't know whether you've noticed, but some extra whitespace is now being added to the top of articles using the new formula style. Might it have anything to do with the new category? Fvasconcellos 23:32, 24 February 2007 (UTC)
Yes it might. I'll take care of it. Also, I've begun fixing them with AWB, but I don't know what to do with the formulas that have congugated acids (e.g., Amiodarone: C25H29I2NO3 . HCl). Are we moving to a purely empirical formula for these, or should I leave them? What's the consensus? -Selket Talk 23:47, 24 February 2007 (UTC)
P.S. I have the same issue with ion. There is no way to add a charge to the current template. This seems fixable, though.
That didn't do it... Is this OK instead? It god rid of the whitespace for me. As for the formulae, I prefer free base whenever possible (drop the acid), but I don't think there is a consensus. Fvasconcellos 23:56, 24 February 2007 (UTC)
If it works, it works. I think I like the freebase too, but I'm going to continue ignoring them for now. --Selket Talk 00:21, 25 February 2007 (UTC)

I've seen the results, and I personally don't really like them. The different colors makes it look very mickey mouse. Over at wikiproject chemistry, we discussed this and I think quite a few were not in favor of linking chemical formulae. Does it really help improve accessibility to wikify bromine and nitrogen? If you don't know what it is already, reading the article probably won't help your understanding of the drug. --Rifleman 82 06:02, 25 February 2007 (UTC)

I think it's useful for people who know some chemistry but not too much. I think a lot of the people who care about the structures of various drugs fall into this category. Granted, it is unlikely that people are going to need the carbon link, but when I came across Gadodiamide (an MR contrast agent) for the first time I saw Gd in the formula and had no idea what that was. I knew it wasn't gold, bit that was about it. I ended up needing to google for a periodic table and then try to find Gd, then I went back to wikipedia to see what the deal was with Gadolinium. I do agree that the colors can be a bit much, but I think it can serve as a useful key for the renderings (see Gadodiamide again) provided that we color them consistantly. I have tried to use the same colors, but I can't speak for everyone. --Selket Talk 06:41, 25 February 2007 (UTC)
In the chemistry articles we try not to colour/link chemical formulae. I personally don't like the elements being linked in a formula because it is distracting. I think it is better to talk about the constituent elements in the text. It is mostly C, H, N, which I expect the majority of people to know what that means, and for the stranger elements I find it more convenient to link them in the text. "Mercuryoxide (HgO) is an oxide of mercury" (if you also put chemical formula into that sentence, people should have enough information). For the drugs it is similar, most elements are quite general, and the gadolinium in Gadodiamide should be named and explained in the text anyway (I think it even should be linked in the intro).
About the colouring, it gives a very, as it was described, Mickey Mousey feeling to see the colours in the pictures and the formulae, although I do understand that for people outside chemistry it does clarify. Maybe the medicine should get a section with a description of the molecule, synthesis and (bio)chemical function (where I mean a description of why it does what it does, for as far known). I think that explains more than colouring of the elements matching the picture. --Dirk Beetstra T C 11:27, 25 February 2007 (UTC)
I like the new format, because (1) it enforces rigor and consistency, which facilitates reuse and (2) it makes that line look different than the others, which makes it easier to orient the eye. But perhaps it would address the concern if the colors for the elements were less saturated. For example, instead of oxygen using "232 70 70" as it currently does, it could use something like "139 0 0". (A useful list of color codes is available at web colors.) --Arcadian 15:03, 25 February 2007 (UTC)

Unfortunately, there are several other templates for chemical elements. That said, the majority of pages written by members of chemistry wikiproject simply use super and subscripts. I have made my comments regarding the wikilinking of chemical formulae known already. To reiterate, it adds little or no value to the article to link to nitrogen or bromine, and if something unusual such as gadolinium is a part of the drug molecule, it should be discussed in text, per Beetstra.

[edit] SVG

Fvasconcellos, would you please share your method of making SVGs? I do agree they are superior, and that they should be used where possible. However, I'm not able to find a good way to export from ChemSketch to any svg editor, either through the clipboard or through EMF/WMFs.

That said, There are a lot of poor quality SVGs out there which have replaced better quality PNGs. Content is key, and not the format. --Rifleman 82 14:31, 25 February 2007 (UTC)

My method, despite (IMHO) good results, is not very efficient: I export as TIFF from ChemSketch at 600 dpi, import the file into Inkscape and trace the structure. I trace the structure manually, using the Path tool and angle constraints—this is very important, as the built-in automatic tracer gives low-quality results—and add atom labels as text. For 600 dpi TIFFs, I use the following Inkscape style settings:
  • 6 px line width for bonds
  • 82 pt Arial for atom labels
  • 65 pt Arial for subscript/superscript labels
Works for me :) If you have access to Adobe Illustrator, Ben Mills' cut-and-past method sounds far less troublesome—he outlines it on his Talk page. Fvasconcellos 15:29, 25 February 2007 (UTC)
Yes I have seen Ben's talk page prior. Like him, I'm not going to spend a bunch of money for Wikipedia.
I must say your work *is* excellent. But this method takes too much time for me. I feel that "good enough" is better than "perfect" later, and given my limited time, I'll stick with ChemSketch --> TIFF --> Irfanview --> PNG for now. It only takes a minute or so to draw a molecule and convert to PNG with this method. I think the results are wholly acceptable. --Rifleman 82 15:42, 25 February 2007 (UTC)

There is an alternative that is quicker and free but not so polished. BKchem is a simple freeware molecule editor. You can draw by hand or import from several import formats then export direct to SVG. There is a default 10px margin, which works well. For example, Dronedarone-2D.svg was created by entering the SMILES string from PubChem, rotating it and pressing Save. You can compare that with Fvasconcellos' version at Dronedarone.svg and Jfdwolff's PNG at Dronedarone.png. Oh, and if you want to know why there are three diagrams for one drug: Fvasconcellos and I both created versions on Commons and then discovered that Jfdwolff had beaten us to it. I really should get round to deleting mine, which certainly isn't the best of the three. For complex diagrams, like Sirolimus.svg, Fvasconcellos is the master! Colin°Talk 18:24, 25 February 2007 (UTC)

Thank you :) Fvasconcellos 15:33, 26 February 2007 (UTC)
Yeah, I tried that once, but didn't really like it. Perhaps I'm too accustomed to ChemSketch, but in the brief period I played with it, I couldn't really make it do what I needed to do/do nice structures with it. Still waiting for a way to copy directly into inkscape from ChemSketch through the clipboard. --Rifleman 82 18:49, 25 February 2007 (UTC)
To do it with ChemSketch, instead of exporting to TIFF, export to Windows Metafile (*.wmf). This can be imported into Inkscape as a vector object. It will not include the text lables, so you will have to add them in Inkscape but it gives very nice results. (See: Halometasone) --Selket Talk 16:52, 2 March 2007 (UTC)
I'm strangely unable to import WMFs to Inkscape. Wonder what could be wrong... Are you using an extension? Fvasconcellos 22:01, 3 March 2007 (UTC)
I'm using Inkscape 0.45, built Feb 5 2007 from Help->About on Windows XP. I was able to do it with either File-Open or File->Import. What version are you using? --Selket Talk 22:44, 3 March 2007 (UTC)
0.43, Nov 23 2005. Time for an update :) Fvasconcellos 22:55, 3 March 2007 (UTC)
OK—updated, and your method is officially approved! :) I still need to tweak the settings on both ChemSketch and Inkscape a bit, but, man, is that a time-saver. Thanks for sharing! Fvasconcellos 01:58, 4 March 2007 (UTC)

[edit] Bug with formulas using Cl atom! (and possibly other two lettered atoms)

I noticed a serious bug with this otherwise fine template. For some reason, it seems to change the place of Cl atom by putting it one off target in the formula.

Examples: Chloramphenicol formula is given as | C=11 | H=12 | N=2 | O=5 | Cl=2 but shown in DrugBox as C11H12N2Cl2O5

Clozapine formula is given as | C=18 | H=19 | Cl=1 | N=4 but shown in DrugBox as C18H19N4Cl

Ketamine formula is given as | C=13 | H=16 | Cl=1 | N=1 | O=1 but shown in DrugBox as C13H16NClO

Zopiclone formula is given as | C=17 | H=17 | Cl=1 | N=6 | O=3 but shown in DrugBox as C17H17N6ClO3

Sodium_thiopental formula is given as | C = 11 | H = 17 | N = 2 | Na = 1 | O = 2 | S = 1 but shown in DrugBox as C11H17N2O2SNa

Also:

Fluoxetine formula is given as | C=17|H=18|F=3|N=1|O=1 but shown in DrugBox as C17H18NF3O

I'm sure there are others as well. I don't know what's wrong with the last one, but the others seem to somehow originate from the number of letters (or so it seems).

In my opinion, this is a serious bug, because it changes the formula, making it impossible to use it as such, for instance, for Google searches. Hopefully somebody can easily fix this, as the DrugBox seems to be otherwise perfectly OK.—The preceding unsigned comment was added by 82.181.234.205 (talk • contribs).

The formulas in the infoboxes are sorted into a standard order (Hill system), but you are right, the order seems to be off here (though not in the way you expect if I read your comment correctly). Formula's should be sorted C first, H second, all other elements in alphabetical order, in which case
| C=11 | H=12 | N=2 | O=5 | Cl=2 should display as C18H19Cl2N2O5
I'll have a look and resort them, if others agree. --Dirk Beetstra T C 11:48, 27 February 2007 (UTC)
I see now... so the order of input is not even supposed to be the order shown in the box. It's a bit confusing, but if that's how it's supposed to work, then it's fine. I actually got confused when on some page (which I already forgot) the text showed the "usual" order, and the DrugBox showed another order which provided 0 Google hits. When I browsed the pages through quickly I made a wrong conclusion of that being somehow linked to two-lettered markings, which was because (by a random choise) I found that only two-lettered atoms were in the "wrong" places. When I found Fluoxetine, I thought maybe my original theory was not necessarily right, or maybe there were some other bug as well.
But if things are working as they have been planned to work, then everything is OK.
However I think this should be mentioned in Notes on use part. Now the example is actually showing that the order of input is also the order of output. Had there been some info about Hill arrangement, I wouldn't have suspected a bug. So a couple of lines to describe how it works would be a good help there. Just a suggestion...
Maybe there could be a way to mention this in the DrugBox also? Of course many databases are linked to the box, but just copy-pasting the formula might cause some problems... For instance, Zopiclone is in the DrugBox C17H17N6ClO3, but in PubChem it is C17H17ClN6O3. With PubChem this isn't a problem, because it is linked, but I hope everyone could see my point here. —The preceding unsigned comment was added by 82.181.234.205 (talk) 21:14, 27 February 2007 (UTC).
The order of entry of any of the parameters is not important (could place H=1 as 1st parameter, the drug name next and C=12 as the last parameter after pregancy details). I agree perhaps the notes should be ordered in the sequence that the various elements will be listed - just edit the /doc subpage :-) David Ruben Talk 20:44, 12 March 2007 (UTC)

[edit] Suggested updates for antibodies and recombinant proteins

There are a large number of drugs that are not small molecules. I would propose adapting this template to take a multiple choice "type" field that can account for this. For example, antibodies should probably not show up in Category:Chemical pages needing a structure drawing. I had previously proposed (but didn't get around to developing) a sequence field to replace IUPAC name on recombinant proteins. This is an example of the sort of thing that could be fixed with a "type" field. Any thoughts (objections)? --Selket Talk 02:53, 4 March 2007 (UTC)

How about a field such as | biological=yes/no? I don't know about the code required, though. Fvasconcellos 02:55, 4 March 2007 (UTC)
I can code it, I just wanted to clear major changes with the community first. If I do re-code it, I will make sure it is reverse compatible so that nothing has to be done to the old articles. --Selket Talk 03:10, 4 March 2007 (UTC)
I support the general idea, but let's not rush into implementation, since this will have a wide impact, and I could see some problems handling large peptides. What specific fields did you have in mind? --Arcadian 04:15, 4 March 2007 (UTC)
For peptides: sequence, protein from which derived; for antibodies: mono- vs. poly-clonal, source organism, target protein. Replace Category:Chemical pages needing a structure drawing with Category:Proteins needing image or some such category. Any other ideas? --Selket Talk 07:18, 4 March 2007 (UTC)
Just wanted to point out, that there is a {{protein}}. I think that box can do that part of the trick. --Dirk Beetstra T C 11:04, 4 March 2007 (UTC)
Whatever. I have just been bold, and added a tag to {{protein}}, and did a recat on {{chembox new}} and {{drugbox}}. They have now their own category, which is part of the master-category Category:Chemistry pages needing pictures. It will take some time to (re-)populate, but this cleans it out quite a bit. Hope this helps! --Dirk Beetstra T C 11:25, 4 March 2007 (UTC)
Just wanted to point out that WP:MCB have their own Image Request page, I think they should handle proteins and whatnot. Any thoughts? Recats did make things more manageable BTW, at least in my opinion. Fvasconcellos 14:03, 4 March 2007 (UTC)
I have been bold, and added a section to their image request with this category. I think this makes it indeed more manageable, though for the drugbox and chembox new the type of images requested is just the same. I guess people from the projects can now find their own image-requests, while the top-level category does neatly connect the projects and gives people a quick way of finding the people who are active in picture drawing in the other projects. --Dirk Beetstra T C 14:26, 4 March 2007 (UTC)
Thanks, Dirk. We should also think about what to do about images for the antibodies. Any ideas? --Selket Talk 03:43, 6 March 2007 (UTC)
There seems to be no objection to the general idea, Selket, so if you wanted to put those fields in, it would probably be okay. --Arcadian 19:55, 8 March 2007 (UTC)
Ok, its a major change, so I'm going to debug it pretty thoroughly in my user space first. It may be a day or two before I make the changes "go live". --Selket Talk 20:00, 8 March 2007 (UTC)
  • crazy idea warning* Why don't we have a "MabBox" or "Drugbox monoclonal antibody"? We do have something like 200 monoclonal antibody articles. (I do realize this contradicts my previous suggestion of a "field".) Fvasconcellos 22:09, 8 March 2007 (UTC)
So, I added at drugbox-mab template per, Fvasconcellos' suggestion. It's not as elegant as a flag but much easier to code. Feel free to add any other fields I didn't think of. --Selket Talk 03:15, 12 March 2007 (UTC)
P.S. check out Bevacizumab for sample usage --Selket Talk 03:32, 12 March 2007 (UTC)
Hi, resonable idea, but are formula, melting points etc relevant for a protein ? Would an optional parameter in Template:Drugbox (that is normally not specified but defaults to say "drug") that if set to "mab" turns off various parameters not be an alternative method of coding ? (I think an alternative parameter name is mentioned higher up in this discussion). Otherwise it will be harder maintaining the 2 drug infoboxes. David Ruben Talk 20:40, 12 March 2007 (UTC)

[edit] Dose

could someone add a dose thing please, i have no idea how to do it —The preceding unsigned comment was added by The Right Honourable (talkcontribs) 02:23, 17 March 2007.

WP:MEDMOS discourages the addition of such information to articles. How do you think it would be useful? Fvasconcellos 03:03, 17 March 2007 (UTC)