Difference between revisions of "MediaWiki:PatientCalculators/anatomy.js"
From WikiAnesthesia
Chris Rishel (talk | contribs) |
Chris Rishel (talk | contribs) |
||
Line 1: | Line 1: | ||
( function ( $, mw ) { | ( function ( $, mw ) { | ||
mw.patientCalculators. | mw.patientCalculators.addCalculations( 'anatomy', { | ||
bmi: { | bmi: { | ||
name: 'Body mass index', | name: 'Body mass index', | ||
abbreviation: 'BMI', | abbreviation: 'BMI', | ||
requiredData: [ 'height', 'weight' ], | requiredData: [ 'height', 'weight' ], | ||
calculate: function( | calculate: function( data ) { | ||
console.log( 'Calculating BMI!' ); | console.log( 'Calculating BMI!' ); | ||
console.log( this.units ); | console.log( this.units ); | ||
Line 11: | Line 11: | ||
units: 'kg/m^2' | units: 'kg/m^2' | ||
} | } | ||
} | } ); | ||
}( jQuery, mediaWiki ) ); | }( jQuery, mediaWiki ) ); |
Revision as of 14:30, 1 July 2021
( function ( $, mw ) { mw.patientCalculators.addCalculations( 'anatomy', { bmi: { name: 'Body mass index', abbreviation: 'BMI', requiredData: [ 'height', 'weight' ], calculate: function( data ) { console.log( 'Calculating BMI!' ); console.log( this.units ); }, units: 'kg/m^2' } } ); }( jQuery, mediaWiki ) );