Date: Fri, 29 Mar 2024 10:05:36 +0000 (UTC) Message-ID: <1212930006.57.1711706736793@8118b6ed74f9> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_56_4966592.1711706736793" ------=_Part_56_4966592.1711706736793 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Orderset rules to be applied to calculate the dosage that can vary from = implementation to implementation. To facilitate that, Rules engine is desig= ned with extensibility in mind. By default Bahmni provides two rules "mg/kg= " and "mg/m2" out of the box and these rules can also be configured with th= e help of csv file. Please check Using rules li= nk for further information.
Rules engine can be extended by writing appropriate groovy scripts and d= eploying at rules engine folder. Rules engine does nothing but transferring= calls to its appropriate dosage calculator rule. Dosage calculator rule sh= ould adhere to the following interface in order to pickup automatically by = the rules engine and apply the calculation.
public = interface DosageRule { Dose calculateDose(DosageRequest request) throws Exception ; }
The following groovy rule is only for illustration purpose. Write a groo= vy class implementing DosageRule interface and attribute the class with "Ru= leName" attribute to assign a name for this particular rule. Rule assigned = here will automatically populated at the drug order set creation Rules drop= down. If No rule name is assigned using "RuleName" attribute, then class na= me will be chosen as the rule name by default.
After writing the rule, the same has to be deployed in the appropriate p= lace for the rule engine to pickup automatically.
Rules location
All the new rules written in groovy language should be deployed at:
/opt/openmrs/bahmni_config/openmrs/rulesengine/rulesengineextension
After deploying the rules at the above location, restart openmrs for the= rules engine to pickup new rules.Existing default rules that are already p= art of rules engine should already be populated. System must be restarted o= nly for new groovy file based rules.