Widget:MedIDMaker: Difference between revisions

Jump to navigation Jump to search
Christopher Popma (talk | contribs)
Created page with "<includeonly> <script type = "text/javascript"> function ensureLoggedIn() { mw.loader.load('mediaWiki.user'); if ($.isEmptyObject(wgUserName)) { alert("Please ..."
 
Christopher Popma (talk | contribs)
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 25: Line 25:
             token : mw.user.tokens.get('editToken'),
             token : mw.user.tokens.get('editToken'),
             text : chapterText,
             text : chapterText,
             title : $("#drugName").val() + "/" + $("#microChapter").val(),
             title : $("#pillName").val(),
             format : 'json'
             format : 'json'
         })
         })
Line 31: Line 31:
             alert("Great success?");
             alert("Great success?");
             $('option:selected', 'select').removeAttr('selected').next('option').attr('selected', 'selected');
             $('option:selected', 'select').removeAttr('selected').next('option').attr('selected', 'selected');
             microChapterData();
             pageContent();
         });
         });
     }
     }
Line 50: Line 50:
         });
         });
     }
     }
     function microChapterData() {
     function pageContent() {
 
        if ($('#microChapter option:selected').text() === "Black Box Warning") {
             resetForm();
             resetForm();
             $("#chapterContent2").css("visibility", "visible");
             $("#chapterContent2").css("visibility", "visible");
Line 58: Line 56:
             $("#pend").val("|blackBoxWarningBody=");
             $("#pend").val("|blackBoxWarningBody=");
             $("#append").val("}}");
             $("#append").val("}}");
             $("#instructions").html("These are some instructions");
             $("#instructions").html("These are some instructions");      
        } else if ($('#microChapter option:selected').text() === "Adult Indications and Dosage") {
            resetForm();
            if ($('#headings option').length == 0) {
                addHeading(["FDA-Labeled Indications and Dosage Information (Adults)", "Off-Label Use and Dosage (Adults)"]);
                microChapterData();
                $("#instructions").html("These are some instructions");
            } else if ($('#headings option:selected').text() === "FDA-Labeled Indications and Dosage Information (Adults)") {
                alert("Hi");
                $('#headings option:selected').removeAttr('selected').next('option').attr('selected', 'selected');
            } else if ($('#headings option:selected').text() === "Off-Label Use and Dosage (Adults)") {
                alert("Clear!");
                resetForm();
            }
        } else if ($('#microChapter option:selected').text() === "Contraindications") {
            alert("Passed.");
        }
     }
     }
     function clearHeading() {
     function clearHeading() {
Line 104: Line 86:
$(document).ready(ensureLoggedIn);
$(document).ready(ensureLoggedIn);
</script>
</script>
Page Title: <input type="text" id="drugName" /><br />
<div id="instructions">
<div id="instructions">


</div>
</div>
Microchapter: <select id="microChapter">
Pill Image Name: <input type="text" id="pillName" /><br />
<option>Black Box Warning</option>
<br />
<option>Adult Indications and Dosage</option>
Please enter the name of the page to which this pill is associated: <input type="text" id="drugName" /><br />
<option>Contraindications</option>
 
<option>Warnings</option>
Pill Imprint: <input type="text" id="pillImprint" /><br />
<option>Adverse Reactions</option>
<br />
<option>Drug Interactions</option>
Pill Dosage: <input type="text" id="dosageValue" /> <select id="dosageUnit">
<option>Use In Specific Populations</option>
<option>kg</option>
<option>Routes and Preparations</option>
<option>uL</option>
<option>IV Compatibility</option>
<option>mL (cc)</option>
<option>Overdosage</option>
<option>dL</option>
<option>Pharmacology</option>
<option>L</option>
<option>Clinical Studies</option>
<option>gtt(s)</option>
<option>How Supplied</option>
<option>AU</option>
<option>Images</option>
<option>IU</option>
<option>Patient Information</option>
<option>umol</option>
<option>Combined Alcohol Use</option>
<option>mmol</option<
<option>Look-Alike Drug Names</option>
<option>U</option>
<option>Drug Shortage Status</option>
<option>Price</option>
</select><br />
</select><br />
If the dosage does not fit the above format, you may enter it here: <input type="text" id="dosageFreeText" /><br />
<br />
Pill Size: <input type="text" id="pillSize" /><br />
<br />
Pill Shape: <select id="pillShape">
<option>Round</option>
<option>Oval</option>
<option>Square</option>
<option>Rectangular</option>
<option>Triangular</option>
<option>Capsule</option>
<option>Pentagon</option>
<option>Hexagon</option>
<option>Diamond</option>
<option>Gear</option>
<option>DoubleCircle</option>
<option>Clover</option>
<option>TearDrop</option>
<option>Octagon</option>
<option>SemiCircle</option>
<option>Bullet</option>
<option>Trapezoid</option>
<option>Freeform</option>
</select><br />
<br />
Pill Color: <select id="pillColor">
<option>Brown</option>
<option>Red</option>
<option>Orange</option>
<option>Yellow</option>
<option>Green</option>
<option>Turquoise</option>
<option>Blue</option>
<option>Purple</option>
<option>Pink</option>
<option>Black</option>
<option>Grey</option>
<option>White</option>
</select><br />
<br />
Pill Scoring: <select id="pillScoring">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select><br />
<br />
Direct link to the Pill Image: <input type="text" id="pillImage" value="http://static.wikidoc.org/0/0e/No_image.jpg" />
<br />
<div id="headingDiv" style="visibility:hidden;">
<div id="headingDiv" style="visibility:hidden;">
Sub Headings: <select id="headings">
</select>
</div><br />
</div><br />



Latest revision as of 13:59, 27 March 2014