Difference between revisions of "Prescribing Module"

From OpenEMR Project Wiki
m (32 revisions: Prescribing_Module)
 
(31 intermediate revisions by the same user not shown)
Line 1: Line 1:
Vital files:
=Proposal to clean up and add additional functionality=
#Change interface/patient_file/summary/rx_frameset.php to only show one frame (remove interface/patient_file/summary/rx_left.php)
#*Will need to add a 'Add New' prescription to templates/prescription/general_list.html first.
#Migrate all stuff from templates/prescription/general_send.html to templates/prescription/general_list.html
#*Then can remove templates/prescription/general_send.html
#Now the templates/prescription/general_list.html will be the central Rx page, and can place all functionality such as relaying, refills, on this page; could do anything here using javascript, php etc..
#To add a new function to this templates/prescription/general_list.html page, recommend placing the function in controllers/C_Prescription.class.php and then calling it.
#*For example a function 'relay' would be labeled relay_action in controllers/C_Prescription.class.php, and called as so:
#**<pre>http://opensourceemr.com/openemr/controller.php?prescription&relay&(variables here)</pre>
#*'''If you follow this then you will ensure it won't break connections to other places in OpenEMR (ie. the drug dispensary module, mapping to drug dosages etc. stored in database, reports); because of all these inter-relationships, I've concluded that rebuilding from scratch is a bad idea.'''
#Could do same to add interactions, lookups, allergy checks in templates/prescription/general_edit.html


*'''openemr/controllers/C_Prescription.class.php'''
=Files=
**Contains all the vital functions
==Main Functions==
**Contains the class C_Prescription extends Controller
===controllers/C_Prescription.class.php===
**is called via /openemr/controller.php
*Contains all the vital functions
***Included functions:
*is called via /openemr/controller.php
****C_Prescription (constructor)
*Contains the class C_Prescription extends Controller
****default_action
**Included functions:
*****'''This calls the edit template screen at openemr/templates/prescription/general_edit.html'''
***C_Prescription (constructor)
****edit_action
***default_action
*****'''This redirects to default_action'''
****'''This calls the edit template screen at templates/prescription/general_edit.html'''
****list_action
***edit_action
****block_action
****'''This redirects to default_action'''
****lookup_action
***list_action
****edit_action_process
****'''This calls the edit template screen at templates/prescription/general_list.html'''
****send_action
***block_action
****multiprintfax_header
***lookup_action
****multiprint_header
****'''This calls library/classes/RXList.class.php to look up drug online'''
****multiprintcss_header
***edit_action_process
****multiprintcss_preheader
***send_action
****multiprintfax_footer
****'''This saves a prescription and calls the templates/prescription/general_send.html template screen'''
****multiprint_footer
***multiprintfax_header
****multiprintcss_footer
***multiprint_header
****multiprintcss_postfooter
***multiprintcss_header
****get_prescription_body_text
***multiprintcss_preheader
****multiprintfax_body
***multiprintfax_footer
****multiprint_body
***multiprint_footer
****multiprintfax_action
***multiprintcss_footer
****multiprint_action
***multiprintcss_postfooter
****multiprintcss_action
***get_prescription_body_text
****send_action_process
***multiprintfax_body
****_print_prescription
***multiprint_body
****_print_prescription_old
***multiprintfax_action
****_email_prescription
***multiprint_action
****do_lookup
***multiprintcss_action
****_fax_prescription
***send_action_process
***_print_prescription
***_print_prescription_old
***_email_prescription
***do_lookup
***_fax_prescription


==Main Class==
===library/classes/Prescription.class.php===
*This is the container for each prescription
*Contains the class Prescription extends ORDataObject
**This container is what is passed around (ie. one for each prescription)
**Important functions:
***Prescription (constructor)
***get_prescription_display
***A whole bunch of others, check out the file


*'''library/classes/Prescription.class.php'''
==Smarty Templates==
**This is the container for each prescription
===templates/prescription/general_list.html===
**Contains the class Prescription extends ORDataObject
*Main window that list prescription and allows printing of script(s) (right frame of Rx window)
***Important functions:
**'''Clicking on a prescription calls edit_action function in controllers/C_Prescription.class.php'''
****Prescription (constructor)
****get_prescription_display
****A whole bunch of others, check out the file


*
===templates/prescription/general_edit.html===
*This is where user types in data for a new prescription or edits an old prescription
**'''Clicking 'drug lookup' calls lookup_action function in controllers/C_Prescription.class.php'''
**'''Clicking 'save' calls send_action function in controllers/C_Prescription.class.php'''


===templates/prescription/general_send.html===
*This is what user see after clicking save in '''templates/prescription/general_edit.html'''
**Options here to print, email, fax the single script


*'''library/classes/RXList.class.php'''
==Miscellaneous==
**This is for online lookup of prescriptions
===interface/patient_file/summary/rx_frameset.php===
*Sets up the Rx window
**'''Left frame with interface/patient_file/summary/rx_left.php'''
**'''Right frame with templates/prescription/general_list.html via call to list_action function in controllers/C_Prescription.class.php'''
 
===interface/patient_file/summary/rx_left.php===
*Simple window with two links taking up left frame of Rx window
**List Prescriptions
***'''Calls list_action function in controllers/C_Prescription.class.php'''
**Add Prescriptions
***'''Calls edit_action function in controllers/C_Prescription.class.php'''
 
===library/classes/RXList.class.php===
*This is for online lookup of prescriptions
 
=Database=
===prescriptions table===
 
 
[[Category:Developer Guide]]

Latest revision as of 19:41, 24 April 2012

Proposal to clean up and add additional functionality

  1. Change interface/patient_file/summary/rx_frameset.php to only show one frame (remove interface/patient_file/summary/rx_left.php)
    • Will need to add a 'Add New' prescription to templates/prescription/general_list.html first.
  2. Migrate all stuff from templates/prescription/general_send.html to templates/prescription/general_list.html
    • Then can remove templates/prescription/general_send.html
  3. Now the templates/prescription/general_list.html will be the central Rx page, and can place all functionality such as relaying, refills, on this page; could do anything here using javascript, php etc..
  4. To add a new function to this templates/prescription/general_list.html page, recommend placing the function in controllers/C_Prescription.class.php and then calling it.
    • For example a function 'relay' would be labeled relay_action in controllers/C_Prescription.class.php, and called as so:
      • http://opensourceemr.com/openemr/controller.php?prescription&relay&(variables here)
    • If you follow this then you will ensure it won't break connections to other places in OpenEMR (ie. the drug dispensary module, mapping to drug dosages etc. stored in database, reports); because of all these inter-relationships, I've concluded that rebuilding from scratch is a bad idea.
  5. Could do same to add interactions, lookups, allergy checks in templates/prescription/general_edit.html

Files

Main Functions

controllers/C_Prescription.class.php

  • Contains all the vital functions
  • is called via /openemr/controller.php
  • Contains the class C_Prescription extends Controller
    • Included functions:
      • C_Prescription (constructor)
      • default_action
        • This calls the edit template screen at templates/prescription/general_edit.html
      • edit_action
        • This redirects to default_action
      • list_action
        • This calls the edit template screen at templates/prescription/general_list.html
      • block_action
      • lookup_action
        • This calls library/classes/RXList.class.php to look up drug online
      • edit_action_process
      • send_action
        • This saves a prescription and calls the templates/prescription/general_send.html template screen
      • multiprintfax_header
      • multiprint_header
      • multiprintcss_header
      • multiprintcss_preheader
      • multiprintfax_footer
      • multiprint_footer
      • multiprintcss_footer
      • multiprintcss_postfooter
      • get_prescription_body_text
      • multiprintfax_body
      • multiprint_body
      • multiprintfax_action
      • multiprint_action
      • multiprintcss_action
      • send_action_process
      • _print_prescription
      • _print_prescription_old
      • _email_prescription
      • do_lookup
      • _fax_prescription

Main Class

library/classes/Prescription.class.php

  • This is the container for each prescription
  • Contains the class Prescription extends ORDataObject
    • This container is what is passed around (ie. one for each prescription)
    • Important functions:
      • Prescription (constructor)
      • get_prescription_display
      • A whole bunch of others, check out the file

Smarty Templates

templates/prescription/general_list.html

  • Main window that list prescription and allows printing of script(s) (right frame of Rx window)
    • Clicking on a prescription calls edit_action function in controllers/C_Prescription.class.php

templates/prescription/general_edit.html

  • This is where user types in data for a new prescription or edits an old prescription
    • Clicking 'drug lookup' calls lookup_action function in controllers/C_Prescription.class.php
    • Clicking 'save' calls send_action function in controllers/C_Prescription.class.php

templates/prescription/general_send.html

  • This is what user see after clicking save in templates/prescription/general_edit.html
    • Options here to print, email, fax the single script

Miscellaneous

interface/patient_file/summary/rx_frameset.php

  • Sets up the Rx window
    • Left frame with interface/patient_file/summary/rx_left.php
    • Right frame with templates/prescription/general_list.html via call to list_action function in controllers/C_Prescription.class.php

interface/patient_file/summary/rx_left.php

  • Simple window with two links taking up left frame of Rx window
    • List Prescriptions
      • Calls list_action function in controllers/C_Prescription.class.php
    • Add Prescriptions
      • Calls edit_action function in controllers/C_Prescription.class.php

library/classes/RXList.class.php

  • This is for online lookup of prescriptions

Database

prescriptions table