You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(141) |
Sep
(184) |
Oct
(159) |
Nov
(77) |
Dec
(114) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(212) |
Feb
(302) |
Mar
(323) |
Apr
(360) |
May
(302) |
Jun
(392) |
Jul
(299) |
Aug
(858) |
Sep
(499) |
Oct
(489) |
Nov
(324) |
Dec
(438) |
2008 |
Jan
(449) |
Feb
(388) |
Mar
(811) |
Apr
(583) |
May
(949) |
Jun
(1431) |
Jul
(943) |
Aug
(527) |
Sep
(576) |
Oct
(440) |
Nov
(1046) |
Dec
(658) |
2009 |
Jan
(259) |
Feb
(192) |
Mar
(495) |
Apr
(2322) |
May
(2023) |
Jun
(1387) |
Jul
(722) |
Aug
(771) |
Sep
(167) |
Oct
(142) |
Nov
(384) |
Dec
(884) |
2010 |
Jan
(344) |
Feb
(82) |
Mar
(248) |
Apr
(341) |
May
(389) |
Jun
(289) |
Jul
(19) |
Aug
(478) |
Sep
(274) |
Oct
(431) |
Nov
(322) |
Dec
(207) |
2011 |
Jan
(125) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John C. <jc...@us...> - 2007-03-10 04:12:09
|
Update of /cvsroot/tolven/tolvenWEB/web/five In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30563/web/five Modified Files: Tag: P_JC_DataEntry3 labSummary.xhtml obsLink.xhtml Log Message: Data entry and drilldown Index: labSummary.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/labSummary.xhtml,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** labSummary.xhtml 2 Oct 2006 05:29:59 -0000 1.6 --- labSummary.xhtml 10 Mar 2007 04:12:08 -0000 1.6.4.1 *************** *** 31,35 **** <h:outputText value="More..." style="COLOR: #333333; TEXT-DECORATION: none; FONT-SIZE: 75%;TEXT-ALIGN: right;"/> </h:outputLink> ! <h:outputText rendered="#{menu.menuDataCount==0}" value="No Lab Results" style="COLOR: #333333; FONT-SIZE: 75%;TEXT-ALIGN: center;"/> </ui:composition> </body> --- 31,35 ---- <h:outputText value="More..." style="COLOR: #333333; TEXT-DECORATION: none; FONT-SIZE: 75%;TEXT-ALIGN: right;"/> </h:outputLink> ! <h:outputText rendered="#{menu.menuDataCount==0}" value="No New Lab Results" style="COLOR: #333333; FONT-SIZE: 75%;TEXT-ALIGN: center;"/> </ui:composition> </body> Index: obsLink.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/five/obsLink.xhtml,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** obsLink.xhtml 16 Feb 2007 04:18:30 -0000 1.1 --- obsLink.xhtml 10 Mar 2007 04:12:08 -0000 1.1.4.1 *************** *** 11,15 **** <ui:composition> <h:outputText value="#{menu.menuDataItem.string01}"/> ! <h:outputText value=" (#{menu.menuDataItem.string02})"/> </ui:composition> </body> --- 11,15 ---- <ui:composition> <h:outputText value="#{menu.menuDataItem.string01}"/> ! <h:outputText value=" (#{menu.menuDataItem.status})"/> </ui:composition> </body> |
From: John C. <jc...@us...> - 2007-03-10 04:12:09
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30563/src/org/tolven/ajax Modified Files: Tag: P_JC_DataEntry3 InstantiateServlet.java Log Message: Data entry and drilldown Index: InstantiateServlet.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax/InstantiateServlet.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** InstantiateServlet.java 8 Mar 2007 17:03:43 -0000 1.3 --- InstantiateServlet.java 10 Mar 2007 04:12:08 -0000 1.3.2.1 *************** *** 32,35 **** --- 32,36 ---- import org.tolven.app.entity.MenuData; import org.tolven.core.entity.AccountUser; + import org.tolven.core.entity.Status; import org.tolven.doc.DocumentLocal; import org.tolven.gen.PersonGenerator; *************** *** 78,83 **** // writer.write( "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ); ! ! // Instantiation request from browser if (uri.endsWith("instantiate.ajaxi")) { // writer.write( "<element>" ); --- 79,119 ---- // writer.write( "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ); ! ! /** ! * We have the data, now just submit to make it actionable. ! */ ! if (uri.endsWith("wizSubmit.ajaxi")) { ! String element = req.getParameter( "element"); ! MenuData md = menuLocal.findMenuDataItem(accountUser.getAccount().getId(), element); ! if (md.getStatus()==Status.NEW) { ! creatorBean.submit(md); ! // Confirm by returning the path of the element we submitted. (path==element) ! writer.write(md.getPath()); ! } ! writer.close(); ! return; ! } ! ! /** ! * In this sense, cancel means to delete the in-process document - we can remove all traces ! * since the document was not yet actionable so no audit is needed. ! */ ! if (uri.endsWith("wizCancel.ajaxi")) { ! String element = req.getParameter( "element"); ! // MenuPath path = new MenuPath( element ); ! // System.out.println( "Milestone 1" ); ! MenuData md = menuLocal.findMenuDataItem(accountUser.getAccount().getId(), element); ! // System.out.println( "Milestone 2" ); ! if (md.getStatus()==Status.NEW) { ! menuLocal.removeReferencingMenuData( md.getAccount().getId(), md.getDocumentId()); ! } ! // System.out.println( "Milestone 3" ); ! // Confirm by returning the path of the element we deleted. (path==element) ! writer.write(md.getPath()); ! writer.close(); ! return; ! } ! ! // Instantiation request from browser if (uri.endsWith("instantiate.ajaxi")) { // writer.write( "<element>" ); *************** *** 93,97 **** // writer.write( "</element>" ); writer.close(); ! // ut.commit(); } } catch (JAXBException e) { --- 129,133 ---- // writer.write( "</element>" ); writer.close(); ! return; } } catch (JAXBException e) { |
From: John C. <jc...@us...> - 2007-03-10 04:12:09
|
Update of /cvsroot/tolven/tolvenWEB/web/wizard In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30563/web/wizard Modified Files: Tag: P_JC_DataEntry3 wizTemplate.xhtml observation.xhtml Added Files: Tag: P_JC_DataEntry3 weight.xhtml Log Message: Data entry and drilldown Index: observation.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/wizard/observation.xhtml,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** observation.xhtml 24 Feb 2007 08:13:56 -0000 1.2 --- observation.xhtml 10 Mar 2007 04:12:08 -0000 1.2.4.1 *************** *** 17,35 **** <ui:param name="subject" value="#{menu.menuDataItem.parent01.string02} #{menu.menuDataItem.parent01.string01}"/> <ui:define name="steps"> ! <div class="step" title="Getting Started" > ! <div class="pagesm"> ! <p>Observation test</p> ! <p>Click the next button when you're ready to begin.</p> ! Value <h:inputText value="#{menu.value}"/><br/> ! <h:commandButton id="#{menu.elementLabel}submit" action="#{menu.submit}" value="Submit"/> ! </div> ! <div class="help" id="#{menu.elementLabel}help1" style="display:none"> ! <h1>Submission</h1> ! <p>The Submit button remains disabled until all entered data is validated and has been stored on the server in your private holding area. ! The time field represents the time when the data was most recently captured on the server (not the time of the observation). Clicking the submit button will ! mark this document as complete, actionable, and immutable.</p> ! </div> ! </div> ! </ui:define> </ui:composition> --- 17,21 ---- <ui:param name="subject" value="#{menu.menuDataItem.parent01.string02} #{menu.menuDataItem.parent01.string01}"/> <ui:define name="steps"> ! <ui:include src="../wizard/#{trim.trim.page}"/> </ui:define> </ui:composition> Index: wizTemplate.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/wizard/wizTemplate.xhtml,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** wizTemplate.xhtml 24 Feb 2007 08:13:56 -0000 1.6 --- wizTemplate.xhtml 10 Mar 2007 04:12:08 -0000 1.6.4.1 *************** *** 76,88 **** <div class="navbar"> ! <table width="100%"> ! <tr> ! <td align="center" > ! <input id="#{menu.elementLabel}stopButton" type="submit" value="Stop" style="display:none"/> ! <input id="#{menu.elementLabel}prevButton" type="submit" value="Previous" onclick="prevStep('#{menu.elementLabel}' );self.scrollTo(0, 0);return false;"/> ! <input id="#{menu.elementLabel}nextButton" type="submit" value="Next" onclick="nextStep('#{menu.elementLabel}' );self.scrollTo(0, 0);return false;"/> ! </td> ! </tr> ! </table> </div> </h:form> --- 76,91 ---- <div class="navbar"> ! <c:if test="#{menu.menuDataItem.status=='NEW'}"> ! <table width="100%"> ! <tr> ! <td align="center"> ! <input id="#{menu.elementLabel}cancelButton" type="submit" value="Cancel" onclick="wizCancel('#{menu.element}');"/> ! <input id="#{menu.elementLabel}prevButton" type="submit" value="Previous" onclick="prevStep('#{menu.elementLabel}' );self.scrollTo(0, 0);return false;"/> ! <input id="#{menu.elementLabel}nextButton" type="submit" value="Next" onclick="nextStep('#{menu.elementLabel}' );self.scrollTo(0, 0);return false;"/> ! <input id="#{menu.elementLabel}submitButton" type="submit" value="Submit" onclick="wizSubmit('#{menu.element}');"/> ! </td> ! </tr> ! </table> ! </c:if> </div> </h:form> --- NEW FILE: weight.xhtml --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core"> <head> <title>Patient Weight</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <ui:composition> <c:if test="#{menu.menuDataItem.status=='NEW'}"> <div class="step" title="Getting Started" > <div class="pagesm"> <p>How to enter your weight</p> <p>In this form you will enter a value. But first, take your shoes off and have a piece of bread.</p> <p>Click the next button when you're ready to begin.</p> Page: #{trim.trim.page} </div> <div class="help" id="#{menu.elementLabel}help1" style="display:none"> <h1>getting Started</h1> <p>Help provides additional information about each page</p> <p>You can close this form by clicking the [x] above at any time. The form will remain in your list of new activity so that yuo can continue at any time later. If you want to completely cancel the form prior to submission, removing all traces of the form from the system, click the Cancel button. Once submitted, you will not be able to Cancel the form.</p> </div> </div> <div class="step" title="Enter Weight" > <div class="pagesm"> <p>Weight</p> Test: #{menu.menuDataItem.string01} <br/> Date: #{menu.menuDataItem.date01} <br/> Weight <h:inputText value="#{menu.value}"/> lbs<br/> </div> <div class="help" id="#{menu.elementLabel}help2" style="display:none"> <h1>Weight</h1> <p>Holding your breath doesn't help much.</p> </div> </div> </c:if> <div class="step" title="Finalize" > <div class="pagesm"> <p>NOTE: This summary step is always a reflection of what's on the server - in other words, submitting is always a matter of submitting what is already safely committed to the database. As such, this is the only sensible step to display on a post-submission drilldown.</p> Test: #{menu.menuDataItem.string01} <br/> Date: #{menu.menuDataItem.date01} <br/> Weight: #{menu.menuDataItem.pqStringVal01} #{menu.menuDataItem.pqUnits01} <br/> </div> <div class="help" id="#{menu.elementLabel}help3" style="display:none"> <h1>Finalize</h1> <p>The Submit button remains disabled until all entered data is validated and has been stored on the server in your private holding area. The time field represents the time when the data was most recently captured on the server (not the time of the observation). Clicking the submit button will mark this document as complete, actionable, and immutable.</p> <p>You may be asked to enter your password. This is necessary to digitally sign this document attesting the fact that only you could have submitted the form.</p> </div> </div> </ui:composition> </body> </html> |
From: John C. <jc...@us...> - 2007-03-10 04:12:09
|
Update of /cvsroot/tolven/tolvenWEB/web/invitation In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30563/web/invitation Added Files: Tag: P_JC_DataEntry3 newPatient.xhtml Log Message: Data entry and drilldown --- NEW FILE: newPatient.xhtml --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core"> <body> <ui:composition template="/templates/invitationTemplate.xhtml"> <ui:define name="invitationBody"> <p>X has requested to become a patient of Y. yes no + reason. </p> </ui:define> </ui:composition> </body> </html> |
From: John C. <jc...@us...> - 2007-03-10 04:12:09
|
Update of /cvsroot/tolven/tolvenWEB/web/scripts In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30563/web/scripts Modified Files: Tag: P_JC_DataEntry3 tolvenwiz.js Log Message: Data entry and drilldown Index: tolvenwiz.js =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/scripts/tolvenwiz.js,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** tolvenwiz.js 17 Feb 2007 01:04:59 -0000 1.6 --- tolvenwiz.js 10 Mar 2007 04:12:07 -0000 1.6.4.1 *************** *** 10,13 **** --- 10,47 ---- } + // Cancel and destroy the current wizard, first on the server, then on the browser. + function wizCancel( element ) { + // alert( "Cancel: " + element ); + var myAjax = new Ajax.Request( + 'wizCancel.ajaxi', + { + method: 'get', + parameters: 'element='+element, + onComplete: wizCancelDone + }); + } + + function wizCancelDone( request ) { + // alert( "response: " + request.responseText ); + closeTab(request.responseText); + } + + // Submit specified element + function wizSubmit( element ) { + // alert( "Submit: " + element ); + var myAjax = new Ajax.Request( + 'wizSubmit.ajaxi', + { + method: 'get', + parameters: 'element='+element, + onComplete: wizSubmitDone + }); + } + + function wizSubmitDone( request ) { + // alert( "response: " + request.responseText ); + closeTab(request.responseText); + } + // Setup steps function setupWizSteps(prefix, firstStep) { *************** *** 18,26 **** var stepHeadings = ""; var stepIcons = ""; ! for ( var s=0; s < steps.length; s++) { ! steps[s].id = prefix+ 'step' + (s+1); ! Element.hide(steps[s]); ! stepHeadings = stepHeadings + makeHeading( prefix, s+1, steps[s].title ); ! stepIcons = stepIcons + makeIcon( prefix, s+1, steps[s].title ); } $(prefix+'stepHeadings').innerHTML = stepHeadings; --- 52,62 ---- var stepHeadings = ""; var stepIcons = ""; ! if (steps.length > 1) { ! for ( var s=0; s < steps.length; s++) { ! steps[s].id = prefix+ 'step' + (s+1); ! Element.hide(steps[s]); ! stepHeadings = stepHeadings + makeHeading( prefix, s+1, steps[s].title ); ! stepIcons = stepIcons + makeIcon( prefix, s+1, steps[s].title ); ! } } $(prefix+'stepHeadings').innerHTML = stepHeadings; *************** *** 35,40 **** var lastStep = 1*root.getAttribute('lastStep'); if (stepNumber==currentStep) return; ! if (stepNumber==lastStep) $(prefix+'nextButton').disabled=true; ! else $(prefix+'nextButton').disabled=false; if (stepNumber==1) $(prefix+'prevButton').disabled=true; else $(prefix+'prevButton').disabled=false; --- 71,81 ---- var lastStep = 1*root.getAttribute('lastStep'); if (stepNumber==currentStep) return; ! if (stepNumber==lastStep) { ! $(prefix+'nextButton').disabled=true; ! $(prefix+'submitButton').disabled=false; ! } else { ! $(prefix+'nextButton').disabled=false; ! $(prefix+'submitButton').disabled=true; ! } if (stepNumber==1) $(prefix+'prevButton').disabled=true; else $(prefix+'prevButton').disabled=false; *************** *** 146,150 **** // Validate a text field function validate( field, value ) { - // Element.hide( "occList" ); var choices = choiceList[field.getAttribute("choices")]; if (choices==null) return; --- 187,190 ---- |
From: John C. <jc...@us...> - 2007-03-08 17:13:23
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12646/src/org/tolven/app/entity Added Files: TrimHeader.java TrimMenu.java Log Message: Add trim-based data entry support, in process. --- NEW FILE: TrimMenu.java --- package org.tolven.app.entity; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.tolven.core.entity.Account; /** * When a TRIM entry is created (in the template account), it contains zero or more * menus that it can appear on. The menu specification in TRIM indicates a * corresponding path in any real account. For example: echr:obsMenu means the trim item should * be included on the observation menu for clinical account. * @author John Churin * */ @Entity @Table(name = "TRIM_MENU", schema="app") public class TrimMenu implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.TABLE, generator="APP_SEQ_GEN") private long id; @ManyToOne(fetch = FetchType.LAZY) private TrimHeader trimHeader; @Column( name="MENU_PATH_NAME", length=255) private String menuPath; public TrimMenu() { super(); } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getMenuPath() { return menuPath; } public void setMenuPath(String menuPath) { this.menuPath = menuPath; } public TrimHeader getTrimHeader() { return trimHeader; } public void setTrimHeader(TrimHeader trimHeader) { this.trimHeader = trimHeader; } public boolean equals(Object obj) { if (!(obj instanceof TrimMenu)) return false; if (this.getId()==((TrimMenu)obj).getId()) return true; return false; } public int hashCode() { if (getId()==0) throw new IllegalStateException( "id not yet established"); return new Long( getId()).hashCode(); } } --- NEW FILE: TrimHeader.java --- package org.tolven.app.entity; import java.io.Serializable; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.OneToMany; import javax.persistence.Table; @Entity @Table(name = "TRIM_HEADER", schema="app") public class TrimHeader implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.TABLE, generator="APP_SEQ_GEN") private long id; @OneToMany(mappedBy = "trimHeader", cascade = CascadeType.ALL, fetch = FetchType.LAZY) protected Collection<TrimMenu> menus; @Column( name="NAME", length=50) private String name; @Column( name="STATUS") private String status; @Lob @Basic(fetch=FetchType.LAZY) @Column(name="TRIM") private byte[] trim; public TrimHeader() { } public void setMenus(Collection<TrimMenu> menus) { this.menus = menus; } public Collection<TrimMenu> getMenus() { return menus; } public boolean equals(Object obj) { if (!(obj instanceof TrimHeader)) return false; if (this.getId()==((TrimHeader)obj).getId()) return true; return false; } public int hashCode() { if (getId()==0) throw new IllegalStateException( "id not yet established"); return new Long( getId()).hashCode(); } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public byte[] getTrim() { return trim; } public void setTrim(byte[] trim) { this.trim = trim; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } } |
From: John C. <jc...@us...> - 2007-03-08 17:13:21
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12646/src/org/tolven/app/bean Modified Files: AppEvalAdaptor.java MenuBean.java CreatorBean.java Added Files: TrimBean.java Log Message: Add trim-based data entry support, in process. Index: MenuBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuBean.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** MenuBean.java 28 Feb 2007 06:59:49 -0000 1.49 --- MenuBean.java 8 Mar 2007 17:13:19 -0000 1.50 *************** *** 29,36 **** --- 29,39 ---- import org.tolven.app.MenuLocal; import org.tolven.app.MenuRemote; + import org.tolven.app.TrimLocal; import org.tolven.app.entity.MSColumn; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; + import org.tolven.core.AccountDAOLocal; import org.tolven.core.entity.Account; + import org.tolven.core.entity.AccountType; import org.tolven.doc.XMLLocal; import org.tolven.trim.Act; *************** *** 61,66 **** @PersistenceContext private EntityManager em; ! @EJB XMLLocal xmlBean; ! private static final String TRIMns = "urn:astm-org:trim:4.0"; /** * @see MenuLocal --- 64,70 ---- @PersistenceContext private EntityManager em; ! @EJB AccountDAOLocal accountBean; ! @EJB TrimLocal trimBean; ! /** * @see MenuLocal *************** *** 112,115 **** --- 116,131 ---- * @see MenuLocal */ + public MenuData findMenuDataItem( long accountId, String path ) { + Query query = em.createQuery( "SELECT md FROM MenuData md WHERE md.account.id = :accountId and md.path = :path" ); + query.setParameter( "accountId", accountId ); + query.setParameter( "path", path ); + List<MenuData> items = query.getResultList(); + if (items.size()==1) return items.get(0); + else return null; + } + + /** + * @see MenuLocal + */ public MenuData findMenuDataItem( MenuQueryControl ctrl ) { try { *************** *** 706,713 **** MenuStructure obsValues = new MenuStructure( ! account, obs, "obs.xhtml", null, 1, "values", "List", "true", root.getPath() +":patient:assessment", "list" ); em.persist( obsValues ); em.persist( new MSColumn( obsValues, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); ! em.persist( new MSColumn( obsValues, 2, "Test", "string01", null) ); em.persist( new MSColumn( obsValues, 3, "Value", "pqValue01", null) ); em.persist( new MSColumn( obsValues, 4, "Units", "pqUnits01", null) ); --- 722,729 ---- MenuStructure obsValues = new MenuStructure( ! account, obs, "obs.xhtml", null, 1, "values", "List", "true", root.getPath() +":patient:observation", "list" ); em.persist( obsValues ); em.persist( new MSColumn( obsValues, 1, "Date", "date01", "MMM-dd-yyyy hh:mm") ); ! em.persist( new MSColumn( obsValues, 2, "Test", "reference", "string01") ); em.persist( new MSColumn( obsValues, 3, "Value", "pqValue01", null) ); em.persist( new MSColumn( obsValues, 4, "Units", "pqUnits01", null) ); *************** *** 971,1015 **** } - /** ! * Load a TRIM XML to metadata for this account. ! * @param accountId ! * @param name Name of the node, which must include the full path, for example, echr:patient: ! * @throws JAXBException */ ! public void loadTRIM( long accountId, String name, byte[] trimXML ) throws JAXBException { ! Trim trim = (Trim) xmlBean.unmarshal(TRIMns, new ByteArrayInputStream( trimXML)); ! MenuStructure root = getRootMenuStructure( em.getReference(Account.class, accountId)); ! MenuStructure msTrim; ! try { ! msTrim = this.findDescendentMenuStructure(accountId, root, name); ! } catch( Exception e) { ! msTrim = new MenuStructure( ! root.getAccount(), root, trim.getPage(), null, 0, name, null, "true", null, "trim" ); ! } ! msTrim.setTrim(trimXML); ! em.merge( msTrim ); ! // Now see where this TRIM item should appear in menus, if anywhere. ! // Notice that this list is not qualified by patient so the page is a bit different than others. ! for ( String menuPath : trim.getMenus()) { ! MenuStructure msMenu = null; ! try { ! msMenu = this.findMenuStructure(accountId, menuPath); ! // System.out.println("Found " + msMenu.getPath()); ! MenuData mdMenu = new MenuData( ); ! mdMenu.setAccount(root.getAccount()); ! mdMenu.setMenuStructure(msMenu); ! Act act = (Act) trim.getAct(); ! // System.out.println("Act " + act.getTitle().getST().getValue()); ! mdMenu.setString01(act.getTitle().getST().getValue()); ! mdMenu.setString02(root.getNode() + ":" + name); ! persistMenuData(mdMenu); ! } catch( Exception e) { ! throw new RuntimeException("menuPath not found. Account: " + accountId + " Path: " + menuPath, e); ! } } ! System.out.println("Trim " + name + " loaded to account " + accountId); } ! /** * This is a shortcut, not appropriate for production. See the other instantiate method in Creator. --- 987,1002 ---- } /** ! * A special account that holds templates ! * @return */ ! public Account findRootTemplateAccount( ) { ! AccountType accountType = accountBean.findAccountTypebyKnownType("template"); ! if (accountType.getAccountTemplate()==null) { ! accountType.setAccountTemplate(accountBean.createAccount("template")); } ! return accountType.getAccountTemplate(); } ! /** * This is a shortcut, not appropriate for production. See the other instantiate method in Creator. *************** *** 1045,1049 **** return menuData; } ! public MenuStructure createDefaultMenuStructure( Account account ) { // System.out.println( "createDefaultMenuStructure, if needed, for account: " + account.getId()); --- 1032,1036 ---- return menuData; } ! public MenuStructure createDefaultMenuStructure( Account account ) { // System.out.println( "createDefaultMenuStructure, if needed, for account: " + account.getId()); *************** *** 1077,1081 **** addDemoTab( root ); } ! // MenuStructure photos = new MenuStructure( // account, gen, "test/photoUpload.xhtml", null, 3, "photos", "Photos", "true", null, "tab" ); --- 1064,1068 ---- addDemoTab( root ); } ! trimBean.populateTrimMenus(root); // MenuStructure photos = new MenuStructure( // account, gen, "test/photoUpload.xhtml", null, 3, "photos", "Photos", "true", null, "tab" ); Index: CreatorBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/CreatorBean.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CreatorBean.java 28 Feb 2007 06:58:18 -0000 1.4 --- CreatorBean.java 8 Mar 2007 17:13:19 -0000 1.5 *************** *** 206,209 **** --- 206,210 ---- } + /** * Instantiate a new document and new Menudata item pointing to it. *************** *** 217,224 **** public MenuData createTRIMInstance( long accountId, String trimPath, String context, Date now ) throws JAXBException, TRIMException { // Get the TRIM template as XML ! MenuStructure msTrim = menuBean.findMenuStructure(accountId, trimPath); ! if (!"trim".equals(msTrim.getRole())) throw new IllegalArgumentException( "Only TRIM metadata can be instantiated"); // Unmarshal the template to an object graph ! ByteArrayInputStream bs = new ByteArrayInputStream(msTrim.getTrim() ); Trim trim = (Trim) xmlBean.unmarshal(TRIM_NS, bs); // Trim tells us where to instantiate this template. eg: ephr:patient:observation --- 218,225 ---- public MenuData createTRIMInstance( long accountId, String trimPath, String context, Date now ) throws JAXBException, TRIMException { // Get the TRIM template as XML ! MenuData mdTrim = menuBean.findMenuDataItem(accountId, trimPath); ! if (mdTrim.getTrimHeader()==null) throw new IllegalArgumentException( "Only TRIM metadata can be instantiated"); // Unmarshal the template to an object graph ! ByteArrayInputStream bs = new ByteArrayInputStream(mdTrim.getTrimHeader().getTrim() ); Trim trim = (Trim) xmlBean.unmarshal(TRIM_NS, bs); // Trim tells us where to instantiate this template. eg: ephr:patient:observation *************** *** 268,271 **** --- 269,285 ---- md.setDocumentId(docXML.getId()); menuBean.persistMenuData(md); + + // Add item to the to do list as well. + MenuStructure msToDo = menuBean.findMenuStructure(accountId, "ephr:activity:all"); + MenuData mdToDo = new MenuData( ); + mdToDo.setMenuStructure(msToDo); + mdToDo.setReference(md); + mdToDo.setDate01(md.getDate01()); + mdToDo.setString01(md.getParent01().getString01()); + // mdToDo.setParent01(md.getParent01()); + mdToDo.setString02("Unfinished " + md.getString01()); + mdToDo.setString03(ejbContext.getCallerPrincipal().getName()); + mdToDo.setDocumentId(docXML.getId()); + menuBean.persistMenuData(mdToDo); return md; } --- NEW FILE: TrimBean.java --- package org.tolven.app.bean; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; import java.net.URL; import java.util.List; import javax.annotation.EJB; import javax.ejb.Local; import javax.ejb.Remote; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.xml.bind.JAXBException; import org.tolven.app.TrimLocal; import org.tolven.app.TrimRemote; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.app.entity.TrimHeader; import org.tolven.app.entity.TrimMenu; import org.tolven.core.AccountDAOLocal; import org.tolven.core.entity.Status; import org.tolven.doc.XMLLocal; import org.tolven.trim.Trim; @Local(TrimLocal.class) @Remote(TrimRemote.class) @Stateless public class TrimBean implements TrimLocal, TrimRemote { @PersistenceContext private EntityManager em; @EJB XMLLocal xmlBean; @EJB AccountDAOLocal accountBean; private static final String TRIMns = "urn:astm-org:trim:4.0"; /** * Look through TrimMenu items for templates that should be included in this account. Then create MenuData items * for these templates. Thus, like all other lists in the application, menus are also MenuData instances. * @param msRoot */ public void populateTrimMenus( MenuStructure msRoot ) { Query query = em.createQuery("SELECT tm FROM TrimMenu tm WHERE tm.menuPath like :rootPath ORDER BY tm.menuPath "); query.setParameter("rootPath", msRoot.getPath() + ":%" ); List<TrimMenu> items = query.getResultList(); // OK, this is the list of menu items we should consider although not all may match. And some may already be present. for (TrimMenu trimMenu : items) { System.out.println("processing Template " + trimMenu.getMenuPath() + " for " + trimMenu.getTrimHeader().getName() ); Query msQuery = em.createQuery("SELECT m FROM MenuStructure m WHERE m.account = :account and m.path = :path"); msQuery.setParameter("account", msRoot.getAccount() ); msQuery.setParameter("path", trimMenu.getMenuPath()); List<MenuStructure> msItems = msQuery.getResultList(); // Got a hit so we're free to look for a menuData item if (msItems.size()==1) { System.out.println("Found MenuStructure " + msItems.get(0).getPath() ); Query mdQuery = em.createQuery("SELECT md FROM MenuData md WHERE md.menuStructure = :menuStructure and md.trimHeader = :trimHeader"); mdQuery.setParameter("menuStructure", msItems.get(0) ); mdQuery.setParameter("trimHeader", trimMenu); List<MenuData> mdItems = mdQuery.getResultList(); if (mdItems.size()==0) { // Create a new MenuData item pointing to this template MenuData md = new MenuData( ); md.setMenuStructure(msItems.get(0)); md.setAccount(msRoot.getAccount()); md.setTrimHeader(trimMenu.getTrimHeader()); md.setString01(trimMenu.getTrimHeader().getName()); em.persist(md); System.out.println("Created MD" ); } } } } public TrimHeader findTrimHeader( String name ) { Query query = em.createQuery("SELECT t FROM TrimHeader t WHERE t.name = :name and t.status = :status"); query.setParameter("name", name ); query.setParameter("status", Status.ACTIVE.value()); List<TrimHeader> items = query.getResultList(); if (items.size()==1) return items.get(0); else return null; } /** * Load a TRIM XML to metadata, independent of account and account type. * @param name Name of the node, which must include the full path, for example, echr:patient: * @throws JAXBException */ public void loadTRIM( String name, byte[] trimXML ) throws JAXBException { Trim trim = (Trim) xmlBean.unmarshal(TRIMns, new ByteArrayInputStream( trimXML)); TrimHeader trimHeader; trimHeader = findTrimHeader(name); // Create a new one if not found if (trimHeader==null) { System.out.println("Loading trim " + name ); trimHeader = new TrimHeader(); trimHeader.setName(name); trimHeader.setStatus(Status.ACTIVE.value()); trimHeader.setTrim(trimXML); em.persist(trimHeader); } else { System.out.println("Reloading trim " + name ); // Remove any menu entries previously associated with this trim header Query delQuery = em.createQuery("DELETE FROM TrimMenu tm WHERE tm.trimHeader = :trimHeader"); delQuery.setParameter("trimHeader", trimHeader); delQuery.executeUpdate(); trimHeader.setTrim(trimXML); em.merge( trimHeader ); } // Persist the header // Now see where this TRIM item should appear in menus, if anywhere. // Notice that this list is not qualified by patient or account. for ( String menuPath : trim.getMenus()) { TrimMenu trimMenu = new TrimMenu( ); trimMenu.setTrimHeader(trimHeader); trimMenu.setMenuPath(menuPath); em.persist(trimMenu); } } private static String EXTENSION = ".trim"; static class TrimFilter implements FilenameFilter { public boolean accept(File dir, String name) { if (name.endsWith(EXTENSION)) return true; return false; } } /** * Load all trim objects found in the trim/ resource directory of the jar file. * @throws IOException, JAXBException */ public void loadTrim( URL url ) throws IOException, JAXBException { // System.out.println( "URL=" + url.getFile()); // try { // System.out.println( "URI=" + url.toURI().toString()); // } catch (URISyntaxException e1) { // // TODO Auto-generated catch block // e1.printStackTrace(); // } // // File dir = null; // dir = new File( url.getFile()); // File files[] = dir.listFiles(); // for (File file : files) { // System.out.println( "File=" + file.getPath() + " - " + file.getName()); // } //// File files[] = dir.listFiles(new TrimFilter()); // if (files==null) return; // If no files, forget it. // for (File file : files) { // InputStream input = new BufferedInputStream( new FileInputStream(file)); InputStream input = new BufferedInputStream( Thread.currentThread().getContextClassLoader().getResourceAsStream(("trim/weight.trim"))); ByteArrayOutputStream trimXML = new ByteArrayOutputStream( ); int b; while( (b = input.read()) >=0 ) { trimXML.write(b); } // String templateName = file.getName().substring(0, file.getName().length()-EXTENSION.length()); String templateName = "Weight"; loadTRIM( templateName, trimXML.toByteArray()); // } } } Index: AppEvalAdaptor.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/AppEvalAdaptor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AppEvalAdaptor.java 24 Feb 2007 07:58:30 -0000 1.4 --- AppEvalAdaptor.java 8 Mar 2007 17:13:19 -0000 1.5 *************** *** 1,4 **** --- 1,6 ---- package org.tolven.app.bean; + import java.io.ByteArrayOutputStream; + import java.util.ArrayList; import java.util.List; *************** *** 8,12 **** --- 10,19 ---- import org.tolven.app.entity.MenuStructure; import org.tolven.core.entity.Account; + import org.tolven.core.entity.TolvenUser; import org.tolven.doc.entity.DocBase; + import org.tolven.doc.entity.DocXML; + import org.tolven.trim.Act; + import org.tolven.trim.ActSlot; + import org.tolven.trim.Trim; /** *************** *** 24,27 **** --- 31,35 ---- private MenuLocal menuBean; private String rootName; + private DocBase document; /** *************** *** 152,155 **** --- 160,207 ---- /** + * Upon receiving a trim object, rules will probably want to create appropriate + * menuData placeholders (Trim instances). This method does the routine work in creating + * such a menudata object. + */ + public MenuData createPlaceholder( Act act, String path, MenuData mdParent01 ) { + MenuStructure msInstance = menuBean.findMenuStructure(getAccount().getId(), path); + // Scan for binding requirements in TRIM + // Create a menuData item to contain the new instance, at least until we submit. + MenuData md = new MenuData(); + md.setMenuStructure(msInstance); + md.setAccount(getAccount()); + md.setParent01(mdParent01); + + // md.setDate01(act.getEffectiveTime().getTS()); + md.setString01(act.getTitle().getST().getValue()); + // md.setString02( "new"); + md.setDocumentId(getDocument().getId()); + menuBean.persistMenuData(md); + System.out.println( "Created placeholder: " + md.getPath()); + return md; + } + + /** + * Create a reference to the specified menuData item + * @param mdReferenced The menu Item to be referenced + * @param path The path of the new item + * @param mdPatient + * @return + */ + public MenuData createReferenceMD( MenuData mdReferenced, String path, MenuData mdParent01 ) { + MenuStructure ms = menuBean.findMenuStructure(getAccount().getId(), path); + MenuData md = new MenuData(); + md.setMenuStructure(ms); + md.setAccount(getAccount()); + md.setReference(mdReferenced); + md.setParent01(mdParent01); + md.setString01(mdReferenced.getString01() ); + md.setDocumentId(mdReferenced.getDocumentId()); + menuBean.persistMenuData(md); + System.out.println( "Created reference: " + md.getPath() + " to " + md.getReference().getPath()); + return md; + } + + /** * Create a new menu data item given the menuStructure item * @param ms *************** *** 161,164 **** --- 213,217 ---- throw new IllegalArgumentException( "Illegal to create menu data in another account"); } + System.out.println( "Adding MenuData: " + ms.getPath() ); MenuData md = new MenuData(); md.setMenuStructure(ms); *************** *** 205,207 **** --- 258,268 ---- } + + public DocBase getDocument() { + return document; + } + + public void setDocument(DocBase document) { + this.document = document; + } } |
From: John C. <jc...@us...> - 2007-03-08 17:13:21
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12646/src/org/tolven/app Modified Files: MenuLocal.java MenuRemote.java Added Files: TrimRemote.java TrimLocal.java Log Message: Add trim-based data entry support, in process. --- NEW FILE: TrimRemote.java --- package org.tolven.app; import javax.xml.bind.JAXBException; public interface TrimRemote { /** * Look for a set of placeholders associated with this node and if found, load them up. * Don't complain if none are found. * @param root */ public void loadTRIM( String name, byte[] trimXML ) throws JAXBException; } Index: MenuRemote.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/MenuRemote.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MenuRemote.java 16 Feb 2007 04:02:33 -0000 1.3 --- MenuRemote.java 8 Mar 2007 17:13:19 -0000 1.4 *************** *** 141,151 **** /** - * Look for a set of placeholders associated with this node and if found, load them up. - * Don't complain if none are found. - * @param root - */ - public void loadTRIM( long accountId, String name, byte[] trimXML ) throws JAXBException; - - /** * Instantiate a new menuDataItem based on the supplied MenuStructure item must be (TRIM) * and optionally use the supplied "parent" MenuData item to qualify the new item. For example, a --- 141,144 ---- Index: MenuLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/MenuLocal.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MenuLocal.java 16 Feb 2007 04:02:33 -0000 1.18 --- MenuLocal.java 8 Mar 2007 17:13:19 -0000 1.19 *************** *** 98,101 **** --- 98,110 ---- /** + * <p>Find a menu data item - this is an exact-match although we just return null if not found (EJB spec says to thrown an error for a singleResult query). + * For security purposes, we include + * accountId in case someone tries to phish for a menudata item they don't own.</p> + * @param accountId The account id to search + * @param path The unique path of the menuData item + */ + public MenuData findMenuDataItem( long accountId, String path ); + + /** * <p>We're asked to add a menu item to one of the active menus for this user. * This is a persistence operation because we always know which menu items the user has available on the *************** *** 179,189 **** public MenuData instantiate( MenuStructure ms, MenuData parent ); - /** - * Look for a set of placeholders associated with this node and if found, load them up. - * Don't complain if none are found. - * @param root - */ - public void loadTRIM( long accountId, String name, byte[] trimXML ) throws JAXBException; - /** * Remove any menuData item that references the specified document. This is usually done when a new document is submitted to --- 188,191 ---- --- NEW FILE: TrimLocal.java --- package org.tolven.app; import java.io.IOException; import java.net.URL; import javax.xml.bind.JAXBException; import org.tolven.app.entity.MenuStructure; public interface TrimLocal { /** * Load a new (or reload an existing) trim item * @param name (templateId) * @param trimXML XML representaiton of the TRIM */ public void loadTRIM( String name, byte[] trimXML ) throws JAXBException; /** * Load all trim objects found in the trim/ resource directory of the jar file. * @param url base directory containing the trim content */ public void loadTrim( URL url ) throws IOException, JAXBException; /** * Look through TrimMenu items for templates that should be included in this account. Then create MenuData items * for these templates. Thus, like all other lists in the application, menus are also MenuData instances. * @param msRoot */ public void populateTrimMenus( MenuStructure msRoot ); } |
From: John C. <jc...@us...> - 2007-03-08 17:12:10
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11797/src/org/tolven/app/entity Modified Files: MenuData.java Log Message: Add status attribute (new, active, etc) Remove extra XML aatributes, only one is needed. Index: MenuData.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity/MenuData.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MenuData.java 28 Feb 2007 06:59:49 -0000 1.17 --- MenuData.java 8 Mar 2007 17:11:54 -0000 1.18 *************** *** 23,26 **** --- 23,28 ---- import javax.persistence.Column; import javax.persistence.Entity; + import javax.persistence.EnumType; + import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; *************** *** 36,39 **** --- 38,42 ---- import org.tolven.doc.entity.DocBase; import org.tolven.core.entity.Account; + import org.tolven.core.entity.Status; /** *************** *** 83,86 **** --- 86,96 ---- private long documentId; + @ManyToOne(fetch = FetchType.LAZY) + private TrimHeader trimHeader; + + @Column( name="STATUS") + @Enumerated(EnumType.STRING) + private Status status; + @Column( name="PARENT_PATH01") private String parentPath01; *************** *** 198,215 **** private byte[] xml01; ! @Lob ! @Basic(fetch=FetchType.LAZY) ! @Column(name="XML02") ! private byte[] xml02; ! ! @Lob ! @Basic(fetch=FetchType.LAZY) ! @Column(name="XML03") ! private byte[] xml03; ! ! @Lob ! @Basic(fetch=FetchType.LAZY) ! @Column(name="XML04") ! private byte[] xml04; public MenuData() { --- 208,225 ---- private byte[] xml01; ! // @Lob ! // @Basic(fetch=FetchType.LAZY) ! // @Column(name="XML02") ! // private byte[] xml02; ! // ! // @Lob ! // @Basic(fetch=FetchType.LAZY) ! // @Column(name="XML03") ! // private byte[] xml03; ! // ! // @Lob ! // @Basic(fetch=FetchType.LAZY) ! // @Column(name="XML04") ! // private byte[] xml04; public MenuData() { *************** *** 293,297 **** denormalizeParentPaths(); denormalizeReferencePath(); ! calculatePath(); } --- 303,307 ---- denormalizeParentPaths(); denormalizeReferencePath(); ! setPath(calculatePath()); } *************** *** 344,349 **** * <p>This path should look similar to the path attribute in MenuStructure except that it has the keys inserted where appropriate. * So, in the previous example, the menuStructure.getPath(): echr:patient:lab</p> */ ! protected void calculatePath() { Stack<MenuStructure> parents = new Stack<MenuStructure>(); MenuStructure p = getMenuStructure(); --- 354,362 ---- * <p>This path should look similar to the path attribute in MenuStructure except that it has the keys inserted where appropriate. * So, in the previous example, the menuStructure.getPath(): echr:patient:lab</p> + * This will not work at all unless this item is at least persisted so that it has an Id. + * @Return calculated path */ ! protected String calculatePath() { ! if (getId()==0) throw new IllegalArgumentException( "Path cannot be computed until the object has been assigned an ID"); Stack<MenuStructure> parents = new Stack<MenuStructure>(); MenuStructure p = getMenuStructure(); *************** *** 375,394 **** switch ( plevel ) { case 1: { ! if (null==getParent01()) throw new NullPointerException( "Parent01 missing in MenuData for " + getMenuStructure().getPath()); sb.append( getParent01().getId()); break; } case 2: { ! if (null==getParent02()) throw new NullPointerException( "Parent02 missing in MenuData for " + getMenuStructure().getPath()); sb.append( getParent02().getId()); break; } case 3: { ! if (null==getParent03()) throw new NullPointerException( "Parent03 missing in MenuData for " + getMenuStructure().getPath()); sb.append( getParent03().getId()); break; } case 4: { ! if (null==getParent04()) throw new NullPointerException( "Parent04 missing in MenuData for " + getMenuStructure().getPath()); sb.append( getParent04().getId()); break; --- 388,407 ---- switch ( plevel ) { case 1: { ! if (null==getParent01() || getParent01().getId()==0) throw new NullPointerException( "Parent01 missing in MenuData for " + getMenuStructure().getPath()); sb.append( getParent01().getId()); break; } case 2: { ! if (null==getParent02() || getParent02().getId()==0) throw new NullPointerException( "Parent02 missing in MenuData for " + getMenuStructure().getPath()); sb.append( getParent02().getId()); break; } case 3: { ! if (null==getParent03() || getParent03().getId()==0) throw new NullPointerException( "Parent03 missing in MenuData for " + getMenuStructure().getPath()); sb.append( getParent03().getId()); break; } case 4: { ! if (null==getParent04() || getParent04().getId()==0) throw new NullPointerException( "Parent04 missing in MenuData for " + getMenuStructure().getPath()); sb.append( getParent04().getId()); break; *************** *** 402,406 **** sb.append( "-" ); sb.append(this.getId()); ! setPath( sb.toString()); } --- 415,419 ---- sb.append( "-" ); sb.append(this.getId()); ! return sb.toString(); } *************** *** 729,755 **** } ! public byte[] getXml02() { ! return xml02; ! } ! ! public void setXml02(byte[] xml02) { ! this.xml02 = xml02; ! } ! ! public byte[] getXml03() { ! return xml03; ! } ! ! public void setXml03(byte[] xml03) { ! this.xml03 = xml03; ! } ! ! public byte[] getXml04() { ! return xml04; ! } ! ! public void setXml04(byte[] xml04) { ! this.xml04 = xml04; ! } /** --- 742,768 ---- } ! // public byte[] getXml02() { ! // return xml02; ! // } ! // ! // public void setXml02(byte[] xml02) { ! // this.xml02 = xml02; ! // } ! // ! // public byte[] getXml03() { ! // return xml03; ! // } ! // ! // public void setXml03(byte[] xml03) { ! // this.xml03 = xml03; ! // } ! // ! // public byte[] getXml04() { ! // return xml04; ! // } ! // ! // public void setXml04(byte[] xml04) { ! // this.xml04 = xml04; ! // } /** *************** *** 864,872 **** --- 877,888 ---- /** * Path is a denormalization of the hierarchical nodes collected into a single string. example: "echr:patient". + * If called before the path is calculated, we will calculate it now, however, the patch could change before persistence. * @return */ public String getPath() { + if (path==null) return calculatePath(); return path; } + public void setPath(String path) { this.path = path; *************** *** 915,918 **** --- 931,946 ---- this.pqStringVal04 = pqStringVal04; } + public TrimHeader getTrimHeader() { + return trimHeader; + } + public void setTrimHeader(TrimHeader trimHeader) { + this.trimHeader = trimHeader; + } + public Status getStatus() { + return status; + } + public void setStatus(Status status) { + this.status = status; + } } |
From: John C. <jc...@us...> - 2007-03-08 17:09:42
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10902/src/org/tolven/core Modified Files: AccountDAOLocal.java Log Message: Add a flag that indicates if an account type is creatable or not. Don't offer accountTypes that are not creatable. Index: AccountDAOLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/AccountDAOLocal.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AccountDAOLocal.java 17 Feb 2007 08:24:17 -0000 1.15 --- AccountDAOLocal.java 8 Mar 2007 17:09:41 -0000 1.16 *************** *** 138,142 **** * @return AccountType */ ! public AccountType createAccountType( String knownType, String homePage, String longDesc, boolean readOnly, String status ); /** * Update AccountType record --- 138,143 ---- * @return AccountType */ ! public AccountType createAccountType( String knownType, String homePage, ! String longDesc, boolean readOnly, String status, boolean userCanCreate ); /** * Update AccountType record |
From: John C. <jc...@us...> - 2007-03-08 17:09:08
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10551/src/org/tolven/doc/bean Modified Files: Evaluator.java Log Message: Move resources like rules and data generator files out or the top level folder of the tolvenEJB.jar file. Index: Evaluator.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean/Evaluator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Evaluator.java 16 Feb 2007 04:02:30 -0000 1.8 --- Evaluator.java 8 Mar 2007 17:09:03 -0000 1.9 *************** *** 14,17 **** --- 14,18 ---- package org.tolven.doc.bean; + import java.io.File; import java.io.IOException; import java.text.ParseException; *************** *** 123,130 **** String accountType = docXML.getAccount().getAccountType().getKnownType(); Trim trim = (Trim) xmlBean.unmarshal(tm.getXmlNS(), tm.getPayloadInputStream()); ! RuleBase ruleBase = ruleBaseFactory.open( accountType + ".drl"); //load up the rulebase WorkingMemory workingMemory = ruleBase.newWorkingMemory(); AppEvalAdaptor app = new AppEvalAdaptor( docXML.getAccount()); app.init(menuLocal, workingMemory); // Assert the document itself. --- 124,132 ---- String accountType = docXML.getAccount().getAccountType().getKnownType(); Trim trim = (Trim) xmlBean.unmarshal(tm.getXmlNS(), tm.getPayloadInputStream()); ! RuleBase ruleBase = ruleBaseFactory.open( "rules/" + accountType + ".drl"); //load up the rulebase WorkingMemory workingMemory = ruleBase.newWorkingMemory(); AppEvalAdaptor app = new AppEvalAdaptor( docXML.getAccount()); + app.setDocument( docXML); app.init(menuLocal, workingMemory); // Assert the document itself. |
From: John C. <jc...@us...> - 2007-03-08 17:08:25
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10462/src/org/tolven/doc/bean Modified Files: RulesBaseFactory.java Log Message: Move resources like rules and data generator files out or the top level folder of the tolvenEJB.jar file. Index: RulesBaseFactory.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean/RulesBaseFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RulesBaseFactory.java 16 Feb 2007 04:00:18 -0000 1.3 --- RulesBaseFactory.java 8 Mar 2007 17:08:23 -0000 1.4 *************** *** 29,72 **** public RuleBase open( String ruleFile) throws Exception { System.out.println( "Opening rule file: " + ruleFile); ! try { ! RuleBase ruleBase = ruleBases.get(ruleFile); ! if (ruleBase==null) { ! //read in the source ! ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); ! InputStream inputStream = classLoader.getResourceAsStream( ruleFile ); ! Reader source = new InputStreamReader( inputStream ); ! ! //optionally read in the DSL (if you are using it). ! //Reader dsl = new InputStreamReader( DroolsTest.class.getResourceAsStream( "/mylang.dsl" ) ); ! //Use package builder to build up a rule package. ! //An alternative lower level class called "DrlParser" can also be used... ! PackageBuilderConfiguration conf = new PackageBuilderConfiguration(); ! conf.setJavaLanguageLevel( "1.5" ); ! PackageBuilder builder = new PackageBuilder(conf); ! //this wil parse and compile in one step ! //NOTE: There are 2 methods here, the one argument one is for normal DRL. ! builder.addPackageFromDrl( source ); ! //Use the following instead of above if you are using a DSL: ! //builder.addPackageFromDrl( source, dsl ); ! ! //get the compiled package (which is serializable) ! Package pkg = builder.getPackage(); ! //add the package to a rulebase (deploy the rule package). ! ruleBase = RuleBaseFactory.newRuleBase(); ! ! ruleBase.addPackage( pkg ); ! // In any case, be sure we use equality, not identity for facts. ! System.setProperty(RuleBaseConfiguration.PROPERTY_ASSERT_BEHAVIOR, RuleBaseConfiguration.WM_BEHAVIOR_EQUALITY ); ! } ! return ruleBase; ! } catch (Exception e) { ! System.out.println( "Error opening RuleBase: " + ruleFile + " " + e.getMessage()); ! throw e; } } --- 29,68 ---- public RuleBase open( String ruleFile) throws Exception { System.out.println( "Opening rule file: " + ruleFile); ! RuleBase ruleBase = ruleBases.get(ruleFile); ! if (ruleBase==null) { ! //read in the source ! ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); ! InputStream inputStream = classLoader.getResourceAsStream( ruleFile ); ! if (inputStream==null) throw new IllegalArgumentException( "Rule file " + ruleFile + " cannot be opened "); ! Reader source = new InputStreamReader( inputStream ); ! ! //optionally read in the DSL (if you are using it). ! //Reader dsl = new InputStreamReader( DroolsTest.class.getResourceAsStream( "/mylang.dsl" ) ); ! //Use package builder to build up a rule package. ! //An alternative lower level class called "DrlParser" can also be used... ! PackageBuilderConfiguration conf = new PackageBuilderConfiguration(); ! conf.setJavaLanguageLevel( "1.5" ); ! PackageBuilder builder = new PackageBuilder(conf); ! //this wil parse and compile in one step ! //NOTE: There are 2 methods here, the one argument one is for normal DRL. ! builder.addPackageFromDrl( source ); ! //Use the following instead of above if you are using a DSL: ! //builder.addPackageFromDrl( source, dsl ); ! ! //get the compiled package (which is serializable) ! Package pkg = builder.getPackage(); ! //add the package to a rulebase (deploy the rule package). ! ruleBase = RuleBaseFactory.newRuleBase(); ! ! ruleBase.addPackage( pkg ); ! // In any case, be sure we use equality, not identity for facts. ! System.setProperty(RuleBaseConfiguration.PROPERTY_ASSERT_BEHAVIOR, RuleBaseConfiguration.WM_BEHAVIOR_EQUALITY ); } + return ruleBase; } |
From: John C. <jc...@us...> - 2007-03-08 17:08:08
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10117/src/org/tolven/gen/util Modified Files: GeneratorBase.java Log Message: Move resources like rules and data generator files out or the top level folder of the tolvenEJB.jar file. Index: GeneratorBase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/util/GeneratorBase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GeneratorBase.java 21 Aug 2006 00:26:30 -0000 1.2 --- GeneratorBase.java 8 Mar 2007 17:08:04 -0000 1.3 *************** *** 15,18 **** --- 15,19 ---- import java.io.BufferedReader; + import java.io.File; import java.io.IOException; import java.io.InputStream; *************** *** 38,42 **** BufferedReader getFileHandle( String fileName ) throws IOException { ! InputStream resourceStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); if (resourceStream==null) throw new IOException( "[Generator] Resource " + fileName + " not found"); return new BufferedReader(new InputStreamReader(resourceStream)); --- 39,43 ---- BufferedReader getFileHandle( String fileName ) throws IOException { ! InputStream resourceStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("gen/" + fileName); if (resourceStream==null) throw new IOException( "[Generator] Resource " + fileName + " not found"); return new BufferedReader(new InputStreamReader(resourceStream)); |
From: John C. <jc...@us...> - 2007-03-08 17:07:41
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10021/src/org/tolven/web Modified Files: SysAdmin.java RegisterAction.java TolvenContext.java Log Message: Add a flag that indicates if an account type is creatable or not. Don't offer accountTypes that are not creatable. Index: TolvenContext.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/TolvenContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TolvenContext.java 6 Nov 2006 07:41:30 -0000 1.1 --- TolvenContext.java 8 Mar 2007 17:07:23 -0000 1.2 *************** *** 1,9 **** --- 1,12 ---- package org.tolven.web; + import java.io.IOException; import java.util.List; import javax.naming.InitialContext; import javax.naming.NamingException; + import javax.xml.bind.JAXBException; + import org.tolven.app.TrimLocal; import org.tolven.core.AccountDAOLocal; import org.tolven.core.entity.AccountType; *************** *** 13,16 **** --- 16,21 ---- private List<AccountType> accountTypes; private AccountDAOLocal accountBean; + private TrimLocal trimBean; + private boolean initialized = false; *************** *** 20,23 **** --- 25,29 ---- InitialContext ctx = new InitialContext(); accountBean = (AccountDAOLocal) ctx.lookup("tolven/AccountDAOBean/local"); + trimBean = (TrimLocal) ctx.lookup("tolven/TrimBean/local"); } catch (NamingException e) *************** *** 53,58 **** System.out.println( "Creating seed account types"); // accountBean.createAccountType("admin", "admin/sysadmin.jsf", "SystemAdministrator", false, Status.ACTIVE.value()); ! accountBean.createAccountType("echr", "echr.jsf", "Clinical Account", false, Status.ACTIVE.value()); ! accountBean.createAccountType("ephr", "ephr.jsf", "Personal Account", false, Status.ACTIVE.value()); System.out.println( "Migrating accounts"); accountBean.accountTypeConversion(); --- 59,74 ---- System.out.println( "Creating seed account types"); // accountBean.createAccountType("admin", "admin/sysadmin.jsf", "SystemAdministrator", false, Status.ACTIVE.value()); ! if (accountBean.findAccountTypebyKnownType("template")==null) { ! System.out.println( "Create template account type"); ! accountBean.createAccountType("template", null, "Template Account", false, Status.ACTIVE.value(), false); ! } ! if (accountBean.findAccountTypebyKnownType("echr")==null) { ! System.out.println( "Create echr account type"); ! accountBean.createAccountType("echr", "echr.jsf", "Clinical Account", false, Status.ACTIVE.value(), true); ! } ! if (accountBean.findAccountTypebyKnownType("ephr")==null) { ! System.out.println( "Create ephr account type"); ! accountBean.createAccountType("ephr", "ephr.jsf", "Personal Account", false, Status.ACTIVE.value(), true); ! } System.out.println( "Migrating accounts"); accountBean.accountTypeConversion(); *************** *** 60,71 **** } /** * Do one-time initialization * */ ! public void initialize( ) { if (isInitialized()) return; System.out.println( "One Time Initialization"); ! if (getAccountTypes().size()==0 ) initializeAccountTypes(); initialized = true; } --- 76,91 ---- } + /** * Do one-time initialization + * @throws JAXBException + * @throws IOException * */ ! public void initialize( ) throws IOException, JAXBException { if (isInitialized()) return; System.out.println( "One Time Initialization"); ! initializeAccountTypes(); ! trimBean.loadTrim(Thread.currentThread().getContextClassLoader().getResource("trim")); initialized = true; } Index: RegisterAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/RegisterAction.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** RegisterAction.java 25 Feb 2007 21:57:53 -0000 1.45 --- RegisterAction.java 8 Mar 2007 17:07:23 -0000 1.46 *************** *** 669,673 **** accountDescs = new ArrayList<SelectItem>( count ); for (AccountType accountType : accountTypes ){ ! accountDescs.add(new SelectItem( Long.toString(accountType.getId()), accountType.getLongDesc() )); } } else { System.out.println("No account types defined"); } --- 669,675 ---- accountDescs = new ArrayList<SelectItem>( count ); for (AccountType accountType : accountTypes ){ ! if (accountType.isCreatable()) { ! accountDescs.add(new SelectItem( Long.toString(accountType.getId()), accountType.getLongDesc() )); ! } } } else { System.out.println("No account types defined"); } Index: SysAdmin.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/SysAdmin.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SysAdmin.java 6 Nov 2006 07:41:30 -0000 1.1 --- SysAdmin.java 8 Mar 2007 17:07:23 -0000 1.2 *************** *** 163,167 **** AccountType newAccountType = accountBean.createAccountType( this.getKnownType(),this.getHomePage(),this.getLongDesc(), ! this.getReadOnly(), this.getStatus() ); if (newAccountType == null) { System.out.println("AccountType not created"); --- 163,167 ---- AccountType newAccountType = accountBean.createAccountType( this.getKnownType(),this.getHomePage(),this.getLongDesc(), ! this.getReadOnly(), this.getStatus(), true ); if (newAccountType == null) { System.out.println("AccountType not created"); |
From: John C. <jc...@us...> - 2007-03-08 17:03:46
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8245/src/org/tolven/ajax Modified Files: InstantiateServlet.java AjaxServlet.java Log Message: 1. Let ajax servlet use the same transaction filer as everyone else. 2. Move one-time init to its own listenener (formerly in vestibulefilter init) Index: InstantiateServlet.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax/InstantiateServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InstantiateServlet.java 17 Feb 2007 01:02:33 -0000 1.2 --- InstantiateServlet.java 8 Mar 2007 17:03:43 -0000 1.3 *************** *** 84,89 **** --- 84,91 ---- // The MenuStructureItem to use String templateId = req.getParameter( "templateId"); + if (templateId == null ) throw new IllegalArgumentException( "Instantiation request has missing templateId"); // Where called from String context = req.getParameter( "context"); + if (context == null ) throw new IllegalArgumentException( "Instantiation request has missing context"); MenuData md; md = creatorBean.createTRIMInstance(accountUser.getAccount().getId(), templateId, context, now ); Index: AjaxServlet.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax/AjaxServlet.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** AjaxServlet.java 17 Feb 2007 21:14:00 -0000 1.21 --- AjaxServlet.java 8 Mar 2007 17:03:43 -0000 1.22 *************** *** 154,171 **** @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - InitialContext ctx; - UserTransaction ut = null; - try { - ctx = new InitialContext(); - ut = (UserTransaction) ctx.lookup("UserTransaction"); - ut.begin(); - } catch (Exception e) { - throw new ServletException("[AjaxServlet] Error setting up UserTransaction or starting a transaction", e); - } - - long beginNanoTime = 0; String uri = req.getRequestURI(); - // Keep track of transaction start time - beginNanoTime = System.nanoTime(); resp.setContentType("text/xml"); resp.setHeader("Cache-Control", "no-cache"); --- 154,158 ---- *************** *** 276,280 **** writer.write( "<a href=\"#\" onclick=\"showPane('" + ppath + "')\">" + desc + "</a>"); } else if (col.getInternal().equals("instantiate")) { ! String ppath = md.getString02(); // Contains name of Trim object String desc = ""; // Fancy mode using Java format specifier --- 263,267 ---- writer.write( "<a href=\"#\" onclick=\"showPane('" + ppath + "')\">" + desc + "</a>"); } else if (col.getInternal().equals("instantiate")) { ! String ppath = md.getPath(); // Contains path of the menu data item String desc = ""; // Fancy mode using Java format specifier *************** *** 473,496 **** writer.write( "</ajax-response>\n"); writer.close(); - double elapsed = System.nanoTime() - beginNanoTime; - // logger.info("Ajax Grid Query [" + req.getSession().getId() + "] "+ elapsed/1000000 + "ms for [" + req.getQueryString() + "]" ); - HttpSession sess = req.getSession(false); - if (sess!=null) { - LinkedList<RequestPerformanceItem> perf = (LinkedList<RequestPerformanceItem>) sess.getAttribute("perfhistory"); - if (perf==null) { - perf = new LinkedList<RequestPerformanceItem>(); - sess.setAttribute("perfhistory", perf); - } - // Keep the list trimmed - while (perf.size() > 100) perf.removeLast(); - // Reverse chron order (fifo) - perf.addFirst(new RequestPerformanceItem( new Date(), elapsed/1000000, req.getRequestURI(), req.getQueryString())); - } - // This module is all about read-only so rollback - try { - ut.rollback(); - } catch (Exception e) { - throw new ServletException( "[AjaxServlet] Rollback Exception", e ); - } } } --- 460,463 ---- |
From: John C. <jc...@us...> - 2007-03-08 17:03:46
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8245/src/org/tolven/web/security Modified Files: VestibuleSecurityFilter.java Log Message: 1. Let ajax servlet use the same transaction filer as everyone else. 2. Move one-time init to its own listenener (formerly in vestibulefilter init) Index: VestibuleSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/VestibuleSecurityFilter.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** VestibuleSecurityFilter.java 5 Mar 2007 08:38:22 -0000 1.18 --- VestibuleSecurityFilter.java 8 Mar 2007 17:03:41 -0000 1.19 *************** *** 68,72 **** private InvitationLocal invitationBean; private AccountDAOLocal accountBean; - private TolvenContext tolvenContext; public void init(FilterConfig config) throws ServletException { --- 68,71 ---- *************** *** 77,85 **** invitationBean = (InvitationLocal) ctx.lookup("tolven/InvitationBean/local"); accountBean = (AccountDAOLocal) ctx.lookup("tolven/AccountDAOBean/local"); - //TODO: This needs to be done once per deployment and thus may need to be moved - if (tolvenContext == null) { - tolvenContext = new TolvenContext(); - tolvenContext.initialize(); - } } catch (NamingException e) { throw new ServletException(e); --- 76,79 ---- |
From: John C. <jc...@us...> - 2007-03-08 17:03:45
|
Update of /cvsroot/tolven/tolvenWEB/web/WEB-INF In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8245/web/WEB-INF Modified Files: web.xml Log Message: 1. Let ajax servlet use the same transaction filer as everyone else. 2. Move one-time init to its own listenener (formerly in vestibulefilter init) Index: web.xml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/WEB-INF/web.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** web.xml 6 Mar 2007 17:00:55 -0000 1.24 --- web.xml 8 Mar 2007 17:03:43 -0000 1.25 *************** *** 83,92 **** <url-pattern>*.ajaxi</url-pattern> </filter-mapping> - <!-- listener> - <listener-class>com.sun.faces.config.ConfigureListener</listener-class> - </listener--> - <filter> <filter-name>VestibuleSecurityFilter</filter-name> --- 83,95 ---- <url-pattern>*.ajaxi</url-pattern> </filter-mapping> + <filter-mapping> + <filter-name>TransactionFilter</filter-name> + <url-pattern>*.ajax</url-pattern> + </filter-mapping> + <listener> + <listener-class>org.tolven.web.ConfigureListener</listener-class> + </listener> <filter> <filter-name>VestibuleSecurityFilter</filter-name> |
From: John C. <jc...@us...> - 2007-03-08 17:00:27
|
Update of /cvsroot/tolven/tolvenEJB/resources/rules In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7270/resources/rules Modified Files: ephr.drl Log Message: Move resources like rules and data generator files out or the top level folder of the tolvenEJB.jar file. Index: ephr.drl =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/resources/rules/ephr.drl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ephr.drl 16 Feb 2007 03:57:46 -0000 1.1 --- ephr.drl 8 Mar 2007 17:00:19 -0000 1.2 *************** *** 10,14 **** global org.tolven.app.bean.AppEvalAdaptor app; ! rule "Document rule" when $doc: DocXML() --- 10,14 ---- global org.tolven.app.bean.AppEvalAdaptor app; ! rule "Clear temporary menu data" when $doc: DocXML() *************** *** 22,26 **** * See what we can do with a TRIM object */ ! rule "trim" when $trim: Trim() --- 22,26 ---- * See what we can do with a TRIM object */ ! rule "Exract act from trim" when $trim: Trim() *************** *** 29,33 **** end ! rule "act rule" when $act: Act( $id : id, $effectiveTime : effectiveTime ) --- 29,33 ---- end ! rule "Extract participation from act" when $act: Act( $id : id, $effectiveTime : effectiveTime ) *************** *** 38,42 **** assert ( part ); } - System.out.println( "Act: " + $act ); end --- 38,41 ---- *************** *** 46,77 **** * a single facts since we manage facts by equality (not identity). */ ! rule "subject rule" when $subject: ActParticipation( typeCode == ParticipationType.SBJ ) then assert( $subject.getRole() ); ! System.out.println( "Got a subject" ); end /** * If we get a pointer to a patient, and there's metadata that cares about patient, ! * lookup the patient explicitly. We then bind to the menuData * thereafter. */ ! rule "Patient rule" when $pat: RoleInternal( classCode == RoleClass.PAT, $internalId : internalId ) ! $ms: MenuStructure( role == "placeholder", path == "echr:patient" ) then assert( app.findMenuData( $ms, $internalId ) ); ! System.out.println( "Got a patient id" + $internalId ); end /** * Really just to prove that we got the menuData item */ rule "Patient menuData rule" when ! $ms: MenuStructure( role == "placeholder", path == "echr:patient" ) $md: MenuData( menuStructure == $ms, $id : id, $path : path, $name : string01 ) then --- 45,113 ---- * a single facts since we manage facts by equality (not identity). */ ! rule "Extract subject from participation" when $subject: ActParticipation( typeCode == ParticipationType.SBJ ) then assert( $subject.getRole() ); ! System.out.println( "Got a subject: " + $subject.getRole() ); end /** * If we get a pointer to a patient, and there's metadata that cares about patient, ! * lookup the patient explicitly. We can then bind to the menuData * thereafter. */ ! rule "Match existing Patient" when $pat: RoleInternal( classCode == RoleClass.PAT, $internalId : internalId ) ! $ms: MenuStructure( role == "placeholder", path == "ephr:patient" ) then assert( app.findMenuData( $ms, $internalId ) ); ! System.out.println( "Got a patient: " + $internalId ); end /** + * If we have an Observation Act in Event mood, and a patient, then we create + * a placeholder in MenuData from which other interested lists can reference. + * In the application, it is the placeholder that holds the full (encrypted) content + * that the user can drill down to in order to display details. + */ + rule "Create observation placeholder" + when + $msPat: MenuStructure( role == "placeholder", path == "ephr:patient" ) + $mdPat: MenuData( menuStructure == $msPat, $patName : string01 ) + $act: Act( moodCode == ActMood.EVN, classCode == ActClass.OBS ) + then + System.out.println( "Create observation placeholder for " + $patName); + MenuData mdObs = app.createPlaceholder($act, "ephr:patient:observation", $mdPat); + assert( mdObs ); + end + + /** + * If we find a (new) observation placeholder, we'll want to add it to the observation list. + */ + rule "Place observation placeholder on observation list" + when + $msObservation: MenuStructure( role == "placeholder", path == "ephr:patient:observation" ) + $mdObservation: MenuData( menuStructure == $msObservation, $mdPat: parent01 ) + then + System.out.println( "Place observation on obs list"); + // Add act to patient's observation list + MenuData mdObsList = app.createReferenceMD( $mdObservation, "ephr:patient:doc:obs:values", $mdPat ); + // mdObsList.setPqStringVal01( ); + end + + + /** + * The following rules have no side effects - they just display trace messages. + * But may be useful as a starting point for additional rules. + */ + + /** * Really just to prove that we got the menuData item */ rule "Patient menuData rule" when ! $ms: MenuStructure( role == "placeholder", path == "ephr:patient" ) $md: MenuData( menuStructure == $ms, $id : id, $path : path, $name : string01 ) then *************** *** 93,103 **** end - rule "act is event observation rule" - when - $act: Act( moodCode == ActMood.EVN, classCode == ActClass.OBS ) - then - System.out.println( "Act: " + $act + " is an observation event" ); - end - rule "Display ID slot" when --- 129,132 ---- |
Update of /cvsroot/tolven/tolvenEJB/resources/trim In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7270/resources/trim Added Files: glucose.trim bodyMassIndex.trim temperature.trim weight.trim bloodPressure.trim pulse.trim rash.trim Log Message: Move resources like rules and data generator files out or the top level folder of the tolvenEJB.jar file. --- NEW FILE: pulse.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>glucose.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <menu>echr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C00000"/> </code> <title> <ST>Pulse</ST> </title> <effectiveTime> <TS>tbd</TS> </effectiveTime> <observation> <value> <PQ> <value>0.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: temperature.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>gcs.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <menu>echr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C0017594"/> </code> <title> <ST>Temperature</ST> </title> <effectiveTime> <TS>123</TS> </effectiveTime> <activityTime> <null>ASKU</null> </activityTime> <observation> <value> <PQ> <value>23.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: bloodPressure.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>gcs.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <menu>echr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C0017594"/> </code> <title> <ST>Blood Pressure</ST> </title> <effectiveTime> <TS>123</TS> </effectiveTime> <activityTime> <null>ASKU</null> </activityTime> <observation> <value> <PQ> <value>23.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: weight.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>weight.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <menu>echr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <id> <xxx>a</xxx> <II extension="abc"/> <II extension="abc"/> <II extension="abc"/> </id> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C0017594"/> </code> <title> <ST>Weight</ST> </title> <effectiveTime> <TS>123</TS> </effectiveTime> <activityTime> <null>ASKU</null> </activityTime> <priorityCode> <CE code="123"> <originalText> <ST>My origianl text</ST> </originalText> </CE> <CE code="123"/> </priorityCode> <languageCode> <CE code="en"/> </languageCode> <observation> <value> <PQ> <value>23.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: glucose.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>glucose.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <menu>echr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C00000"/> </code> <title> <ST>Serum Glucose</ST> </title> <effectiveTime> <TS>tbd</TS> </effectiveTime> <observation> <value> <PQ> <value>0.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: bodyMassIndex.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>glucose.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C00000"/> </code> <title> <ST>Body Mass Index</ST> </title> <effectiveTime> <TS>tbd</TS> </effectiveTime> <observation> <value> <PQ> <value>0.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> --- NEW FILE: rash.trim --- <?xml version="1.0" encoding="UTF-8"?> <trim xmlns="urn:tolven-org:trim:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tolven-org:trim:4.0 E:\tolvenWS\tolvenEJB\resources\xsd\trim4.xsd"> <page>glucose.xhtml</page> <instance>ephr:patient:observation</instance> <menu>ephr:obsMenu</menu> <menu>echr:obsMenu</menu> <act xsi:type="Act"> <!--templateId>urn:wikihit-org:PATIENT-ACT:0</templateId--> <classCode>OBS</classCode> <moodCode>EVN</moodCode> <code> <CD codeSystemName="UMLS" codeSystemVersion="2006AC" code="C00000"/> </code> <title> <ST>Rash</ST> </title> <effectiveTime> <TS>tbd</TS> </effectiveTime> <observation> <value> <PQ> <value>0.0</value> <unit>mg/dL</unit> </PQ> </value> </observation> <participation typeCode="SBJ"> <role xsi:type="RoleBind"> <classCode>PAT</classCode> <templateId>ephr:patient</templateId> </role> </participation> </act> </trim> |
From: John C. <jc...@us...> - 2007-03-08 17:00:12
|
Update of /cvsroot/tolven/tolvenEJB/resources/trim In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7245/resources/trim Log Message: Directory /cvsroot/tolven/tolvenEJB/resources/trim added to the repository |
From: John C. <jc...@us...> - 2007-03-08 16:59:13
|
Update of /cvsroot/tolven/tolvenEJB In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7141 Modified Files: build.xml Log Message: Move resources like rules and data generator files out or the top level folder of the tolvenEJB.jar file. Index: build.xml =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/build.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** build.xml 3 Feb 2007 18:51:12 -0000 1.16 --- build.xml 8 Mar 2007 16:59:12 -0000 1.17 *************** *** 81,86 **** <zipfileset dir="${tolvenEJB.location}/build/bin" includes="**/*.class"/> <zipfileset dir="${tolvenEJB.location}/conf" prefix="META-INF"/> ! <zipfileset dir="${tolvenEJB.location}/resources/gen"/> ! <zipfileset dir="${tolvenEJB.location}/resources/rules"/> </jar> <copy toDir="${tolvenEJB.location}/build" overwrite="true" preservelastmodified="true"> --- 81,85 ---- <zipfileset dir="${tolvenEJB.location}/build/bin" includes="**/*.class"/> <zipfileset dir="${tolvenEJB.location}/conf" prefix="META-INF"/> ! <zipfileset dir="${tolvenEJB.location}/resources/"/> </jar> <copy toDir="${tolvenEJB.location}/build" overwrite="true" preservelastmodified="true"> |
From: John C. <jc...@us...> - 2007-03-08 16:56:38
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5915/src/org/tolven/core/bean Modified Files: AccountDAOBean.java Log Message: Add a flag that indicates if an account type is creatable or not. Index: AccountDAOBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/bean/AccountDAOBean.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AccountDAOBean.java 17 Feb 2007 08:24:17 -0000 1.28 --- AccountDAOBean.java 8 Mar 2007 16:56:37 -0000 1.29 *************** *** 348,352 **** * @return */ ! public AccountType createAccountType( String knownType, String homePage, String longDesc, boolean readOnly, String status ) { AccountType accountType = new AccountType(); accountType.setKnownType( knownType ); --- 348,353 ---- * @return */ ! public AccountType createAccountType( String knownType, String homePage, String longDesc, ! boolean readOnly, String status, boolean userCanCreate ) { AccountType accountType = new AccountType(); accountType.setKnownType( knownType ); *************** *** 354,357 **** --- 355,359 ---- accountType.setLongDesc(longDesc ); accountType.setReadOnly(readOnly); + accountType.setCreatable(userCanCreate); String encodedStatus = Status.fromValue(status).value(); accountType.setStatus(encodedStatus); *************** *** 383,386 **** --- 385,392 ---- public void accountTypeConversion() { em.flush(); + // Make sure all account types have a "creatable" flag that is non-null + Query accountTypeFix = em.createNativeQuery("update core.account_type set user_can_create = true where user_can_create is null;"); + accountTypeFix.executeUpdate(); + Query q = em.createQuery("SELECT a FROM Account a WHERE a.accountType = null"); q.setMaxResults(1); |
From: John C. <jc...@us...> - 2007-03-08 16:55:54
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5492/src/org/tolven/core/entity Modified Files: AccountType.java Log Message: Add a flag that indicates if an account type is creatable or not. Index: AccountType.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/AccountType.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AccountType.java 16 Feb 2007 04:01:14 -0000 1.5 --- AccountType.java 8 Mar 2007 16:55:53 -0000 1.6 *************** *** 56,59 **** --- 56,62 ---- private boolean readOnly; + @Column( name="USER_CAN_CREATE") + private Boolean creatable; + @Column( name="LONG_DESC", length=255) private String longDesc; *************** *** 134,136 **** --- 137,148 ---- this.accountTemplate = accountTemplate; } + + public boolean isCreatable() { + return creatable; + } + + public void setCreatable(boolean creatable) { + this.creatable = creatable; + } + } |
From: John C. <jc...@us...> - 2007-03-08 16:55:09
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5044/src/org/tolven/core/entity Modified Files: Status.java Log Message: Cosmetic Index: Status.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/Status.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Status.java 28 Feb 2007 03:45:11 -0000 1.3 --- Status.java 8 Mar 2007 16:54:59 -0000 1.4 *************** *** 7,10 **** --- 7,13 ---- */ public enum Status { + NEW("new"), + NULLIFIED("nullified"), + OBSOLETE("obsolete"), ACTIVE("active"), OLD_ACTIVE("ACTIVE"), *************** *** 14,20 **** INACTIVE("inactive"), OLD_INACTIVE("INACTIVE"), - NEW("new"), - NULLIFIED("nullified"), - OBSOLETE("obsolete"), REGISTERED("registered"), USED("USED"); --- 17,20 ---- |
From: Joseph I. <jos...@us...> - 2007-03-08 04:18:51
|
Update of /cvsroot/tolven/tolven/jboss-config In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25471/jboss-config Modified Files: invitation-queue-service.xml gen-queue-service.xml rule-queue-service.xml Log Message: Removed unused roles. The default value of the create attribute is not clear. The create attribute is was not set on the individual queues, but is set to true in the DefaultSecurityConfig. So is this an override to false or a bleed through to true? I guess a test is required to find out, since it's not clear in the documentation either. Index: gen-queue-service.xml =================================================================== RCS file: /cvsroot/tolven/tolven/jboss-config/gen-queue-service.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gen-queue-service.xml 3 Dec 2006 08:32:13 -0000 1.1 --- gen-queue-service.xml 8 Mar 2007 04:18:49 -0000 1.2 *************** *** 11,16 **** <security> <role name="guest" read="true" write="true"/> - <role name="publisher" read="true" write="true" create="false"/> - <role name="noacc" read="false" write="false" create="false"/> </security> </attribute> --- 11,14 ---- Index: invitation-queue-service.xml =================================================================== RCS file: /cvsroot/tolven/tolven/jboss-config/invitation-queue-service.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** invitation-queue-service.xml 23 Jul 2006 06:21:18 -0000 1.1 --- invitation-queue-service.xml 8 Mar 2007 04:18:49 -0000 1.2 *************** *** 11,16 **** <security> <role name="guest" read="true" write="true"/> - <role name="publisher" read="true" write="true" create="false"/> - <role name="noacc" read="false" write="false" create="false"/> </security> </attribute> --- 11,14 ---- Index: rule-queue-service.xml =================================================================== RCS file: /cvsroot/tolven/tolven/jboss-config/rule-queue-service.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rule-queue-service.xml 23 Jul 2006 06:21:18 -0000 1.1 --- rule-queue-service.xml 8 Mar 2007 04:18:49 -0000 1.2 *************** *** 11,16 **** <security> <role name="guest" read="true" write="true"/> - <role name="publisher" read="true" write="true" create="false"/> - <role name="noacc" read="false" write="false" create="false"/> </security> </attribute> --- 11,14 ---- |