Assigning a Home Facility
When using the Disconnected Gateway, dCDR Android or dCDR Windows/Linux applications, you can optionally append the "home facility" or "registering facility" to the patient being registered.
This pattern works for assigning any relationships you like (for example, automatically assigning birthplace on a birth notification).
Create a new Business Rules File
Create a new JavaScript file in the rules/ folder of your applet / plugin for SanteMPI. The basic structure of this file should be:
Write Assignment Code
Next, you'll want to write some code that looks up the configured facility where the dCDR is running and appends that information to the patient if not already done so.
Attach the Business Rule
Finally, add the business rule to the BeforeInsert method on the patient.
Last updated