epostrx system architecture presented by advancenet health solutions, inc. john strecker –...

40
ePostRx System Architecture ePostRx System Architecture Presented by AdvanceNet Health Solutions, Presented by AdvanceNet Health Solutions, Inc. Inc. John Strecker – founder, architect and President John Strecker – founder, architect and President July, 2006 July, 2006

Upload: iris-norah-stokes

Post on 26-Dec-2015

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

ePostRx System ArchitectureePostRx System Architecture

Presented by AdvanceNet Health Solutions, Inc.Presented by AdvanceNet Health Solutions, Inc.John Strecker – founder, architect and PresidentJohn Strecker – founder, architect and President

July, 2006July, 2006

Page 2: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

AgendaAgenda

Technology advantageTechnology advantageSource treeSource treeBinary PackagingBinary PackagingXML Configuration MapsXML Configuration MapsDBView BeansDBView BeansFormBean PersistenceFormBean PersistenceData Access LayerData Access LayerMVC Framework (Console)MVC Framework (Console)B2B Framework (B2B)B2B Framework (B2B)Workflow Framework Workflow Framework SOAP (Web Services)SOAP (Web Services)ConclusionConclusion

Page 3: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

The ePostRx Technology AdvantageThe ePostRx Technology Advantage

Developed using the latest web and Developed using the latest web and enterprise technologies that allow open enterprise technologies that allow open integration and avoid vendor lock:integration and avoid vendor lock:– Transaction/Workflow EngineTransaction/Workflow Engine

J2EE, EJB and XSL and XMLJ2EE, EJB and XSL and XML

– Thin Client User Interface (Web Browser)Thin Client User Interface (Web Browser)JSP, JSTL, Javascript, Servlets, MVC architectureJSP, JSTL, Javascript, Servlets, MVC architecture

– Software Development kitSoftware Development kitJava, XML, Thinlet, JNI, Crypto (Bouncy Castle)Java, XML, Thinlet, JNI, Crypto (Bouncy Castle)

– Relational Database Management SystemRelational Database Management SystemCurrently supports MS-SQL 2000+. Support for Currently supports MS-SQL 2000+. Support for Oracle and open-source projects MySql and Oracle and open-source projects MySql and PostgreSql forthcoming.PostgreSql forthcoming.

Page 4: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

ePostRx Tiered ArchitectureePostRx Tiered Architecturedrives consistency across enterprisedrives consistency across enterprise

Page 5: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

ePostRx Source treeePostRx Source tree

Project team utilizes IntelliJ as primary development tool.Project team utilizes IntelliJ as primary development tool.Software package layout:Software package layout:– com - common helper classes, startup servlets and JSP taglibs com - common helper classes, startup servlets and JSP taglibs – dtds - EJB dtds dtds - EJB dtds – lib - contains all external jars that support ePostRx. lib - contains all external jars that support ePostRx. – projects - projects - – ansHealthB2B** - contains all the business logic ansHealthB2B** - contains all the business logic – ansHealthConsole** - contains all the Console UI logic. ansHealthConsole** - contains all the Console UI logic. – ansHealthLib - common web shared files ansHealthLib - common web shared files – ansHealthUtil - common Utility helper files ansHealthUtil - common Utility helper files – ansHealthToolkit** - contains all the toolkit files ansHealthToolkit** - contains all the toolkit files – ansHealthReports - files that process web Reports ansHealthReports - files that process web Reports – ansHealthRDBMS - contains the schema, generated Java ansHealthRDBMS - contains the schema, generated Java

Views,buildload scripts, XML SQL maps etc.. Views,buildload scripts, XML SQL maps etc..

** build-able project** build-able project

Page 6: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Building ePostRxBuilding ePostRx

ePostRx uses Jakarta ANT1.6+ to build the ePostRx uses Jakarta ANT1.6+ to build the source files. Run ANT targets in build.bat files source files. Run ANT targets in build.bat files in each directory listed below to build the in each directory listed below to build the appropriate deployable components:appropriate deployable components:

– AnsHealthB2B/build  - builds the JBoss EAR file AnsHealthB2B/build  - builds the JBoss EAR file – ansHealthConsole/build - Builds the Console Web ansHealthConsole/build - Builds the Console Web

WAR file WAR file – ansHealthToolkit/build - builds the toolkit.zip file ansHealthToolkit/build - builds the toolkit.zip file

Page 7: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Deploying ePostRxDeploying ePostRx

Once built, epostrx is deployed as:Once built, epostrx is deployed as:– EAR file (B2B Transaction Server) EAR file (B2B Transaction Server) – WAR file (contains precompiled or non WAR file (contains precompiled or non

precompiled JSPs) precompiled JSPs) – Toolkit (Zip file install. **Only if you need to Toolkit (Zip file install. **Only if you need to

send NCPDP scripts to the server) send NCPDP scripts to the server)

Page 8: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Deploying ePostRx(cont’d)Deploying ePostRx(cont’d)

EAR and WAR files can be co-located on EAR and WAR files can be co-located on same application server. same application server.

EAR and WAR files can be decoupled on EAR and WAR files can be decoupled on separate servers and communicate via separate servers and communicate via JNDI.JNDI.

Building separate EAR and WAR files Building separate EAR and WAR files offers flexibility for network topologyoffers flexibility for network topology

Page 9: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

XML Configuration MapsXML Configuration MapsThere are many XML configuration files that support a single user There are many XML configuration files that support a single user

transaction:transaction:

Transaction XML MapTransaction XML Map contains all the Transaction definitions and contains all the Transaction definitions and their associated Reason For Calls (RFC). In addition, all HELP their associated Reason For Calls (RFC). In addition, all HELP context files are defined for each transaction, as well as the JSP context files are defined for each transaction, as well as the JSP form bean used for presentation persistence.form bean used for presentation persistence.– Note: Any TXN can have multiple RFCsNote: Any TXN can have multiple RFCsSQL XML MapSQL XML Map contains all the SQL mappings for each Transaction. contains all the SQL mappings for each Transaction. The SQL is dynamically loaded by the JDBC classes and mapped The SQL is dynamically loaded by the JDBC classes and mapped to JDBC Prepared Statements to process a JDBC call.to JDBC Prepared Statements to process a JDBC call.Context XML MapContext XML Map contains default user group screen context used contains default user group screen context used for permission processing.for permission processing.

Page 10: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

XML Configuration Maps (Con’t)XML Configuration Maps (Con’t)

ButtonMappings XML MapButtonMappings XML Map contains button contains button definitions that are defined in the definitions that are defined in the Transaction Transaction XML MapXML Map attributes. Provides a standardized attributes. Provides a standardized way to centralize all button definitions and their way to centralize all button definitions and their functionality.functionality.Txn, Context and ButtonTxn, Context and Button maps are located under maps are located under ANSHealth Console projectANSHealth Console projectSQL mapsSQL maps are located under ANSHealthRDBMS are located under ANSHealthRDBMS project.project.All Maps are loaded and parsed at system All Maps are loaded and parsed at system startup and persisted in memorystartup and persisted in memory

Page 11: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

XML Configuration MapsXML Configuration MapsTransaction Map ExampleTransaction Map Example

<txn-rfc><txn-rfc> <txn-rfc-name>NEW</txn-rfc-name><txn-rfc-name>NEW</txn-rfc-name>

<parameter key="request"<parameter key="request"pid="console.server.handlers.account.AccountGeneralHandler"pid="console.server.handlers.account.AccountGeneralHandler"

ptype="JCLASS"/>ptype="JCLASS"/><parameter key="response"<parameter key="response"

pid="/htmljsp/account/account_general.jsp"pid="/htmljsp/account/account_general.jsp"ptype="JSPPAGE"ptype="JSPPAGE"template="yes"template="yes"buttongroup="NEW"/>buttongroup="NEW"/>

<parameter key="error"<parameter key="error"buttongroup="NEW"buttongroup="NEW"ptype="JSPPAGE"ptype="JSPPAGE"template="yes"template="yes"pid="/htmljsp/account/account_general.jsp"/>pid="/htmljsp/account/account_general.jsp"/>

</txn-rfc></txn-rfc><txn-rfc><txn-rfc>

PTYPE attribute defines the resource type as JSP, EJB, JAVA, SERVLET,JSPTEMPLATE, HTML etc. PTYPE attribute defines the resource type as JSP, EJB, JAVA, SERVLET,JSPTEMPLATE, HTML etc. BUTTONGROUP attribute defines the RESPONSE or ERROR buttons to be displayed to the user. These BUTTONGROUP attribute defines the RESPONSE or ERROR buttons to be displayed to the user. These attributes are defined in the ButtonMappings.xml file to standardized button functionality. attributes are defined in the ButtonMappings.xml file to standardized button functionality. TEMPLATE attribute defines whether the response is a template HTML or JSP page (with JSP includes) or a TEMPLATE attribute defines whether the response is a template HTML or JSP page (with JSP includes) or a single JSP or HTML page. Transactions with a TEMPLATE attribute of ‘yes’ requires the single JSP or HTML page. Transactions with a TEMPLATE attribute of ‘yes’ requires the ProcessHandlerProcessHandler to load to load the response JSP page into the template to be included at run-time.the response JSP page into the template to be included at run-time.

Page 12: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

XML Configuration MapsXML Configuration MapsSQL Map ExampleSQL Map Example

<sql-map><sql-map> <sql-txn-name>UPDATE_DOCTOR_IDENTIFIERS</sql-txn-name><sql-txn-name>UPDATE_DOCTOR_IDENTIFIERS</sql-txn-name> <sql-stmt>UPDATE DOCTOR_IDENTIFIERS SET<sql-stmt>UPDATE DOCTOR_IDENTIFIERS SET doctor_id_type_code=?,trading_partner_num=?,doctor_identifier=?,state_num=? doctor_id_type_code=?,trading_partner_num=?,doctor_identifier=?,state_num=? WHEREWHERE doctor_identifier_num=?</sql-stmt>doctor_identifier_num=?</sql-stmt> <sql-attributes><sql-attributes> <sql-column-attribute column-name="doctor_id_type_code" column-<sql-column-attribute column-name="doctor_id_type_code" column-type="AN"/>type="AN"/> <sql-column-attribute column-name="trading_partner_num" column-<sql-column-attribute column-name="trading_partner_num" column-type="N"/>type="N"/> <sql-column-attribute column-name="doctor_identifier" column-type="AN"/><sql-column-attribute column-name="doctor_identifier" column-type="AN"/> <sql-column-attribute column-name="state_num" column-type="N"/><sql-column-attribute column-name="state_num" column-type="N"/>

<sql-where-attribute column-name="doctor_identifier_num" column-<sql-where-attribute column-name="doctor_identifier_num" column-type="N"/>type="N"/>

</sql-attributes></sql-attributes>

Page 13: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

XML Configuration Maps (Con’t)XML Configuration Maps (Con’t)Context(Permissions) Map ExampleContext(Permissions) Map Example

<context><context> <usergroup name="EPOSTRXDEMOUSER" displayname="Demo User"><usergroup name="EPOSTRXDEMOUSER" displayname="Demo User"> <categorygroup name="MAIN_MENU_GROUP" displayname="Main Menu" <categorygroup name="MAIN_MENU_GROUP" displayname="Main Menu"

permission="READWRITE">permission="READWRITE"> <category name="MYEPOSTRX" displayname="myEpostRx"><category name="MYEPOSTRX" displayname="myEpostRx"> <subcategory><subcategory> <name>WELCOME</name><name>WELCOME</name> <displayname>Welcome</displayname><displayname>Welcome</displayname> <permission>READWRITE</permission><permission>READWRITE</permission> <defaultrfc>READ</defaultrfc><defaultrfc>READ</defaultrfc> <type>TAB</type><type>TAB</type> </subcategory></subcategory> <subcategory><subcategory> <name>QUICKSEARCH</name><name>QUICKSEARCH</name> <displayname>QuickSearch</displayname><displayname>QuickSearch</displayname> <permission>READWRITE</permission><permission>READWRITE</permission> <defaultrfc>NONE</defaultrfc><defaultrfc>NONE</defaultrfc> <type>SYSTEM</type><type>SYSTEM</type></catagorygroup></catagorygroup></usergroup></usergroup></context></context>

Page 14: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

XML Configuration Maps(Con’t)XML Configuration Maps(Con’t)Button Map ExampleButton Map Example

<button-map><button-map> <button-group>LIST</button-group><button-group>LIST</button-group> <button-group-attributes display-required-fields="no"><button-group-attributes display-required-fields="no"> <parameter name="NEW" event="onclick" <parameter name="NEW" event="onclick" function="processNew()" readonly="yes" function="processNew()" readonly="yes" shortcutname="NEW(Ctrl+Z)"shortcutname="NEW(Ctrl+Z)" shortcutcode="90"/>shortcutcode="90"/> <parameter name="REFRESH" event="onclick" <parameter name="REFRESH" event="onclick" function="processListOK()" readonly="yes"function="processListOK()" readonly="yes" shortcutname="REFRESH(Ctrl+J)" shortcutname="REFRESH(Ctrl+J)" shortcutcode="74"/>shortcutcode="74"/> </button-group-attributes></button-group-attributes> </button-map></button-map> <button-map><button-map>

Page 15: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

DBView BeanDBView Bean

To provide uniformity and ease of SQL access for all resources that To provide uniformity and ease of SQL access for all resources that require specific presentation or database table data, an abstract require specific presentation or database table data, an abstract interface class– interface class– DBViewBeanDBViewBean was created. was created. The The DBViewBeanDBViewBean provides many common SQL methods necessary provides many common SQL methods necessary to access the underlining ePostRx JDBC classes. to access the underlining ePostRx JDBC classes. A presentation view object is then created which maps uniquely to a A presentation view object is then created which maps uniquely to a SQL query. For example:SQL query. For example:– AccountAddressView extends DBViewBean.AccountAddressView extends DBViewBean.– TXNID = ACCOUNT_ADDRESSTXNID = ACCOUNT_ADDRESS– RFC may be READ, INSERT, NEW, UPDATE, LIST or DELETERFC may be READ, INSERT, NEW, UPDATE, LIST or DELETE– SQL map contains query for each RFC and TXNID (i.e. SQL map contains query for each RFC and TXNID (i.e.

READ_ACCOUNT_ADDRESS)READ_ACCOUNT_ADDRESS)– TXN Map contains entry called ACCOUNT_ADDRESS with RFC of TXN Map contains entry called ACCOUNT_ADDRESS with RFC of

READREAD

Page 16: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

DBViewBean (Con’t)DBViewBean (Con’t)

Approach allows maximum encapsulation Approach allows maximum encapsulation of specific database table or JSP of specific database table or JSP presentation view. These objects then can presentation view. These objects then can be re-used in other processing to query be re-used in other processing to query persisted data.persisted data.

Each DBViewBean is mapped to a SQL Each DBViewBean is mapped to a SQL TXNID ID defined in the SQL Maps.TXNID ID defined in the SQL Maps.

Contained inContained in com.generic.jdbc com.generic.jdbc package package

Page 17: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

DBViewBean (Con’t)DBViewBean (Con’t)

Code Example: List all account address Code Example: List all account address for given accountfor given account

AccountAddressViewBean avb = new AccountAddressViewBean();AccountAddressViewBean avb = new AccountAddressViewBean();avb.setWhereKey(“account_num”, account_num);avb.setWhereKey(“account_num”, account_num);avb.ListView();avb.ListView();if(avb.isResultSet()){if(avb.isResultSet()){

// iterate through resultset collection// iterate through resultset collectionfor (int i=0; i< avb.getResultSetRowCount(); i++){for (int i=0; i< avb.getResultSetRowCount(); i++){

avb.setRow(i);avb.setRow(i);System.out.println(“Dump record” + System.out.println(“Dump record” +

avb.getRow(i));avb.getRow(i));}}

}}

Page 18: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

FormBean PersistenceFormBean Persistence

Similar to Struts, the ePostRx Framework has Similar to Struts, the ePostRx Framework has implemented the FormBean persistence model. implemented the FormBean persistence model. All JSP presentation attributes are defined as Java Bean All JSP presentation attributes are defined as Java Bean accessors (Setters/Getters) within a unique java class. accessors (Setters/Getters) within a unique java class. Each class supports a unique JSP or View. Each class supports a unique JSP or View. Bean attributes are updated using the Java Reflection Bean attributes are updated using the Java Reflection API upon a URL POST. API upon a URL POST. If an error occurs in a Request Handler, the data on the If an error occurs in a Request Handler, the data on the screen is captured and redisplayed to the user. screen is captured and redisplayed to the user. Located in ANSHealthConsole project/serversLocated in ANSHealthConsole project/servers

Page 19: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Data Access Layer Data Access Layer

Contained inContained in com.generic.jdbc com.generic.jdbc package packageResponsible for the JDBC SQL execution of Responsible for the JDBC SQL execution of DBViewBean(s).DBViewBean(s).Manages DB Connection pooling for each SQL request.Manages DB Connection pooling for each SQL request.Specifics:Specifics:– Retrieves the associated SQL Map from memory using the Retrieves the associated SQL Map from memory using the

DBViewBean’s TXNID.DBViewBean’s TXNID.– All SQL statements use JDBC Prepare Statements. SQL maps All SQL statements use JDBC Prepare Statements. SQL maps

contain all column and where attributes for each Txn query.contain all column and where attributes for each Txn query.– Maps user entered input to column and where attributes prior to Maps user entered input to column and where attributes prior to

SQL execution.SQL execution.– Executes both single and batched SQL transaction(s).Executes both single and batched SQL transaction(s).– Builds Resultset of epostrx EntityObjects to return to caller for Builds Resultset of epostrx EntityObjects to return to caller for

post-processing.post-processing.

Page 20: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Data Access Layer (Con’t)Data Access Layer (Con’t)

EntityObject is the primary SQL resultset data EntityObject is the primary SQL resultset data container. Each EntityObject represents a SQL container. Each EntityObject represents a SQL resultset row.resultset row.

For a given row, EntityObject contains HashMap For a given row, EntityObject contains HashMap which contains result set columns.which contains result set columns.

Various support methods to manipulate data.Various support methods to manipulate data.

SQL READS return Collection of EntityObjects.SQL READS return Collection of EntityObjects.

SQL INSERT or UPDATEs pass collection of SQL INSERT or UPDATEs pass collection of EntityObjects to insert/update.EntityObjects to insert/update.

Page 21: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Data Access Layer (Con’t)Data Access Layer (Con’t)

Code Example. Code Example.

AccountAddressViewBean avb = new AccountAddressViewBean();AccountAddressViewBean avb = new AccountAddressViewBean();avb.setWhereKey(“account_num”, account_num);avb.setWhereKey(“account_num”, account_num);avb.ListView();avb.ListView();if(avb.isResultSet()){if(avb.isResultSet()){

// iterate through resultset collection// iterate through resultset collection for (int i=0; i< avb.getResultSetRowCount(); i++){for (int i=0; i< avb.getResultSetRowCount(); i++){

EntityObject row = avb.getRow(i);EntityObject row = avb.getRow(i);System.out.println(“Account Address1 + row.getString(“account_address1”));System.out.println(“Account Address1 + row.getString(“account_address1”));System.out.println(“Account Address2 + row.getString(“account_address2”));System.out.println(“Account Address2 + row.getString(“account_address2”));System.out.println(“Dump entire record” + row.toString());System.out.println(“Dump entire record” + row.toString());

}} }}

Page 22: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

MVC FrameworkMVC FrameworkThe Model 2 architecture, shown below, is a hybrid approach for serving The Model 2 architecture, shown below, is a hybrid approach for serving dynamic content, since it combines the use of both servlets and JSP. dynamic content, since it combines the use of both servlets and JSP. It takes advantage of the predominant strengths of both technologies, It takes advantage of the predominant strengths of both technologies, using JSP to generate the presentation layer and servlets to perform using JSP to generate the presentation layer and servlets to perform process-intensive tasks. process-intensive tasks.

Page 23: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

MVC Framework (Con’t)MVC Framework (Con’t)

Upon review of Upon review of Struts and Java Pet-Store(JPS)Struts and Java Pet-Store(JPS) technologies, it technologies, it was determined that although these technologies provided very was determined that although these technologies provided very robust and open-source solutions, they lacked the essence of true robust and open-source solutions, they lacked the essence of true transactional processing as detailed below.transactional processing as detailed below.– Both Struts and JPS do not provide a means of triggering events Both Struts and JPS do not provide a means of triggering events

through transactions. All events are triggered through URL maps. These through transactions. All events are triggered through URL maps. These can become very cumbersome when integrating client side links to can become very cumbersome when integrating client side links to buttons, navigation links, permissions etc.buttons, navigation links, permissions etc.

– Because there is no centralized transaction model, the ability to govern Because there is no centralized transaction model, the ability to govern user actions and selection of screen functions through permissions user actions and selection of screen functions through permissions grows in complexity. Need to wrap each link with a permission check. grows in complexity. Need to wrap each link with a permission check. Ugh!Ugh!

– Because there is no transaction engine, a single transaction cannot be Because there is no transaction engine, a single transaction cannot be mapped seamlessly to an SQL CRUD event such as UPDATE or mapped seamlessly to an SQL CRUD event such as UPDATE or INSERT for the user selected transaction. Therefore, you need to add INSERT for the user selected transaction. Therefore, you need to add custom and complex code to each request handler to perform your custom and complex code to each request handler to perform your queries.queries.

Page 24: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

MVC Framework (con’t)MVC Framework (con’t)Transaction ModelTransaction Model

ANSHealth Transaction Model Approach can be ANSHealth Transaction Model Approach can be linked to SQL XML maps removing need to linked to SQL XML maps removing need to embed SQL in application code and providing embed SQL in application code and providing centralized repository for future database centralized repository for future database schema migrations. schema migrations.

Additionally, SQL queries can be become more Additionally, SQL queries can be become more dynamic and abstract to the request handler dynamic and abstract to the request handler because your providing real-time lookup based because your providing real-time lookup based upon user transaction. The transaction provides upon user transaction. The transaction provides the link to any and all processing required!the link to any and all processing required!

Page 25: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

MVC Framework (Con’t)MVC Framework (Con’t)TxnJobHandlerTxnJobHandler

In keeping with a MVC model 2, the ePostRx Framework handles In keeping with a MVC model 2, the ePostRx Framework handles client POST requests through the single servlet – the client POST requests through the single servlet – the TxnJobHandlerTxnJobHandler as follows: as follows:

<form method=’POST’ action = ‘/anshealthConsole/ans’><form method=’POST’ action = ‘/anshealthConsole/ans’>Embedded in each client URL request are transaction attributes Embedded in each client URL request are transaction attributes defined as Name/Value pairs such as:defined as Name/Value pairs such as:TXN – name of transaction to process requestTXN – name of transaction to process requestRFC - reason for call (UPDATE, DELETE, READ, NEW, REPAINT RFC - reason for call (UPDATE, DELETE, READ, NEW, REPAINT etc.)etc.)Upon receipt of the URL POST request, the Upon receipt of the URL POST request, the TxnJobHandlerTxnJobHandler servlet servlet validates the user request against the Transaction XML maps. If the validates the user request against the Transaction XML maps. If the Transaction exists, the servlet calls the support class Transaction exists, the servlet calls the support class ProcessHandler ProcessHandler which further processes the request in detail. If the which further processes the request in detail. If the requested transaction is not found, requested transaction is not found, TxnJobHandlerTxnJobHandler returns an error returns an error to the caller.to the caller.

Page 26: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

MVC Framework (Con’t)MVC Framework (Con’t)ProcessHandlerProcessHandler

ProcessHandlerProcessHandler controls the transaction job request processing as controls the transaction job request processing as determined by the Transaction XML maps. It provides the three critical determined by the Transaction XML maps. It provides the three critical functions:functions:Session ManagementSession Management – creates user session objects and updates – creates user session objects and updates accordingly with pertinent information necessary for client side processing.accordingly with pertinent information necessary for client side processing.Security Management – Security Management – validates all user requests based on user’s validates all user requests based on user’s permission profile to ensure they have access to the requested functional permission profile to ensure they have access to the requested functional area.area. Dispatch Management – Dispatch Management – dispatches the appropriate Java class, HTML, dispatches the appropriate Java class, HTML, JSP, JSP template, JAR, Servlet or EJB resource to process the user JSP, JSP template, JAR, Servlet or EJB resource to process the user request. request. ProcessHandlerProcessHandler categorizes a single user request into two actions: categorizes a single user request into two actions:– PreRequestPreRequest is used to process the request before the intended response. is used to process the request before the intended response. – PostRequestPostRequest is used to process the intended response to the client. is used to process the intended response to the client.

Page 27: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

MVC Framework (con’t)MVC Framework (con’t)Interprocess CommunicationInterprocess Communication

When a process is dispatch by the When a process is dispatch by the ProcessHandlerProcessHandler, a , a message interface is implemented by all Request message interface is implemented by all Request Handlers to standardize message attributes across all Handlers to standardize message attributes across all requests. requests. The base Message Object is comprised of a Header The base Message Object is comprised of a Header object and Body Object, each possessing their own object and Body Object, each possessing their own attributes too numerous to mention here. Together, the attributes too numerous to mention here. Together, the Header and Body Objects comprise the following run-Header and Body Objects comprise the following run-time messages:time messages:

– MSGRequest is sent to all request handlers to process the MSGRequest is sent to all request handlers to process the request.request.

– MSGResponse is returned by all request handlers containing MSGResponse is returned by all request handlers containing process run-time information.process run-time information.

Page 28: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

MVC Framework (Con’t)MVC Framework (Con’t)RequestHandlersRequestHandlers

The Request HandlersThe Request Handlers are Java classes that are are Java classes that are dispatched by the dispatched by the ProcessHandlerProcessHandler that process that process the Validate, Request and Response. the Validate, Request and Response. Similar to Similar to Struts Action classes.Struts Action classes.For example, a Request action might be to For example, a Request action might be to execute a SQL query required for the response execute a SQL query required for the response JSP page. Each client request is mapped JSP page. Each client request is mapped uniquely to a handler through the Transaction uniquely to a handler through the Transaction XML map, PID attribute. The PARAMETER XML map, PID attribute. The PARAMETER attribute defines the REQUEST, RESPONSE attribute defines the REQUEST, RESPONSE and ERROR.and ERROR.

Page 29: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

MVC Framework (Con’t)MVC Framework (Con’t)Piecing it all togetherPiecing it all together

Hybrid framework similar to Struts and PetStoreHybrid framework similar to Struts and PetStore

TxnJobHandlerServletHTTP

XML maps in memory

ProcessHandlerProcess RequestAnd Response

Txn MapsSql MapsContext Maps

Data Access Layer

Database

Request Handlers

B2B Processing

Handlers may call EJB classes for support

POST request

JSP returned

Interprocess communication

Page 30: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

B2B FrameworkB2B Framework

B2B framework was originally architected to handle asynchronous B2B framework was originally architected to handle asynchronous SCRIPT events from client toolkit.SCRIPT events from client toolkit.Evolved over time to package and process business logic that Evolved over time to package and process business logic that could be “extended” to accommodate additional external requests could be “extended” to accommodate additional external requests other than UI. other than UI. If specific to UI, stayed in UI handler classes!If specific to UI, stayed in UI handler classes!Uses Session Bean (EJB) architecture. All session beans use Bean Uses Session Bean (EJB) architecture. All session beans use Bean Manage Persistence (BMP) to leverage existing helper classes and Manage Persistence (BMP) to leverage existing helper classes and Data Access Layer.Data Access Layer.All beans accessible via Session Bean lookup via JNDI.All beans accessible via Session Bean lookup via JNDI.ANSHealthConsole (UI) calls beans via lookup class for specific ANSHealthConsole (UI) calls beans via lookup class for specific events such as pricing, drug checks, drug lookups etc..events such as pricing, drug checks, drug lookups etc..Processing that is thread oriented are developed as Message Processing that is thread oriented are developed as Message Driven Beans (MDB)Driven Beans (MDB)

Page 31: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Workflow FrameworkWorkflow Framework

There are many open-source workflow frameworks There are many open-source workflow frameworks available such as:available such as:– OS Workflow - OS Workflow - http://www.opensymphony.com/osworkflow– Open For Business -Open For Business - http://www.ofbiz.org

These solutions were investigated. Although robust and These solutions were investigated. Although robust and open-source(free), without additional custom changes, open-source(free), without additional custom changes, these solutions did not provide the granularity to trigger these solutions did not provide the granularity to trigger on custom messages like SCRIPT as well as provide on custom messages like SCRIPT as well as provide static and dynamic routing of messages within the static and dynamic routing of messages within the ePostRx framework. Therefore, to provide greater ePostRx framework. Therefore, to provide greater flexibility and embedded application control, the option of flexibility and embedded application control, the option of developing a home-grown solution was selected.developing a home-grown solution was selected.

Page 32: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Workflow Framework (Con’t)Workflow Framework (Con’t)

Rules Rules are the basic building blocks of the ePostRx are the basic building blocks of the ePostRx Rules Engine. Rules allow users to build criteria for Rules Engine. Rules allow users to build criteria for workflow event triggering. Each rule is comprised of workflow event triggering. Each rule is comprised of two (2) distinct parts:two (2) distinct parts:

– ActionAction defines what type of action to perform such as validate defines what type of action to perform such as validate specific EDI data elements, or call functions. specific EDI data elements, or call functions.

There are various actions the user can define to trigger events. There are various actions the user can define to trigger events.

– ResponseResponse defines the post event to perform after the initial defines the post event to perform after the initial action is successful. action is successful.

There are various response the user can define to trigger events.There are various response the user can define to trigger events.

Page 33: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Workflow Framework (Con’t)Workflow Framework (Con’t)

Each trading partner can have multiple, unique Each trading partner can have multiple, unique workflow types assigned, with each workflow workflow types assigned, with each workflow containing multiple assigned rules.containing multiple assigned rules.Event driven model:Event driven model:– Unlike the traditional single-daemon process where Unlike the traditional single-daemon process where

users “drop” transactions into a processing bucket users “drop” transactions into a processing bucket and external threads poll for specific events, this and external threads poll for specific events, this model provides greater scalability and management model provides greater scalability and management of transactions.of transactions.

– Each thread owns an instance of the Rule-Workflow Each thread owns an instance of the Rule-Workflow Object and can control the functionality necessary to Object and can control the functionality necessary to process a message or order request until completion. process a message or order request until completion.

Page 34: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Each trading partner (location) can have multiple, unique Each trading partner (location) can have multiple, unique workflow types assigned, with each workflow containing workflow types assigned, with each workflow containing

multiple assigned rulesmultiple assigned rules

Page 35: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Example ‘Dispense’ Workflow RulesExample ‘Dispense’ Workflow Rules

Page 36: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Workflow Framework (Con’t)Workflow Framework (Con’t)

Workflow EngineWorkflow EngineItem B to be Scrubbed by Workflow YY

Each item to be processed is bound to a Rule Workflow Object. All rule actions/responses are executed against the item. Depending upon each rule configuration, processing is TOP DOWN and may continue or stop if and error occurs. Rule Execution State is maintained in the database.

Rule1Rule2Rule3….

Item A to be Scrubbed by Workflow XX

Rule1Rule2Rule3….

WorkflowManager, RulesManager and ActionManager classes comprise workflow processing

Page 37: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Workflow Framework (Con’t)Workflow Framework (Con’t)

Specific transactions can be synchronous Specific transactions can be synchronous which the user waits for a response. Other which the user waits for a response. Other transactions will be asynchronous and transactions will be asynchronous and continue background processing continue background processing independent of the user’s initial request. independent of the user’s initial request.

Asynchronous requests will be handled by Asynchronous requests will be handled by Message Driven Beans (MDB) within the Message Driven Beans (MDB) within the Application Server (AS) Container.Application Server (AS) Container.

Page 38: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

Workflow Framework (Con’t)Workflow Framework (Con’t)

All workflow state is persisted in database All workflow state is persisted in database tables.tables.All Rule Engine transactions are applied to an All Rule Engine transactions are applied to an item of processing (i.e. Order line, SCRIPT item of processing (i.e. Order line, SCRIPT message)..message)..Once a Rule Action is found to be TRUE, the Once a Rule Action is found to be TRUE, the corresponding Rule Response is invoked and corresponding Rule Response is invoked and the engine is released for the associated the engine is released for the associated execution thread.execution thread.Rule business logic contained in java objects. Rule business logic contained in java objects. Common interface to access rule objects from Common interface to access rule objects from framework via ClassForName call.framework via ClassForName call.

Page 39: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

SOAP (Web Services)SOAP (Web Services)

Contained in the B2B processing are various SOAP(Web Contained in the B2B processing are various SOAP(Web Service) processor calls.Service) processor calls.

Epostrx uses XFIRE for SOAP services which is built on a an Epostrx uses XFIRE for SOAP services which is built on a an XML messaging layer made up of Transports which provide XML messaging layer made up of Transports which provide Channels for communication.Channels for communication.

HTTP Transport A standard SOAP over HTTP transport. A standard SOAP over HTTP transport. JMS Transport Ultra reliable, fast, asynchronous messaging Ultra reliable, fast, asynchronous messaging via JMS. via JMS. XMPP/Jabber Transport XMPP is an asynchronous XMPP is an asynchronous messaging protocol which can be used for SOAP. messaging protocol which can be used for SOAP.

Page 40: EPostRx System Architecture Presented by AdvanceNet Health Solutions, Inc. John Strecker – founder, architect and President July, 2006

ConclusionConclusion

Download the epostrx source code and Download the epostrx source code and start to explore and learn.start to explore and learn.

Having a good IDE such as Intellj makes Having a good IDE such as Intellj makes all the difference in exploring!all the difference in exploring!

Get on the ePostRx forum and ask Get on the ePostRx forum and ask questions (www.anshealth.com).questions (www.anshealth.com).