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-01-16 06:37:00
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22866/src/org/tolven/web Modified Files: TopAction.java Log Message: Eliminate the need for accountId in session (use top instead) Index: TopAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/TopAction.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** TopAction.java 15 Jan 2007 10:15:12 -0000 1.29 --- TopAction.java 16 Jan 2007 06:36:58 -0000 1.30 *************** *** 40,44 **** import org.tolven.core.entity.Status; import org.tolven.core.entity.TolvenUser; - import org.tolven.gen.CHRGenerator; import org.tolven.security.LoginLocal; import org.tolven.security.TolvenPerson; --- 40,43 ---- *************** *** 64,73 **** private MenuLocal menuLocal; // @EJB - private CHRGenerator chrGen; - // @EJB private LoginLocal loginLocal; - private boolean genDemoData; private String startPage; private String accountTitle; --- 63,69 ---- *************** *** 114,118 **** invitationBean = (InvitationLocal) ctx.lookup("tolven/InvitationBean/local"); propertyBean = (TolvenPropertiesLocal) ctx.lookup("tolven/TolvenProperties/local"); - chrGen = (CHRGenerator) ctx.lookup("tolven/CHRGeneratorBean/local"); loginLocal = (LoginLocal) ctx.lookup("tolven/LoginBean/local"); } --- 110,113 ---- *************** *** 153,171 **** */ public String postLogin() throws Exception{ ! // Initialize tolven here ! Map<String,Object> appMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap(); ! TolvenContext tolven = (TolvenContext) appMap.get("tolven"); ! if (tolven==null) { ! tolven = new TolvenContext(); ! appMap.put("tolven", tolven); ! } ! tolven.initialize(); ! AccountUser accountUser = null; ! if (accountUserId!=0) { ! accountUser = activation.findAccountUser(accountUserId ); ! accountType = accountUser.getAccount().getAccountType().getKnownType(); ! setPostLoginAction(accountUser.getAccount().getAccountType().getHomePage()); ! return "dispatch"; ! } info = "Login Processing: " + getTp().getUid(); // Get the TolvenUser --- 148,166 ---- */ public String postLogin() throws Exception{ ! // Initialize tolven here ! Map<String,Object> appMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap(); ! TolvenContext tolven = (TolvenContext) appMap.get("tolven"); ! if (tolven==null) { ! tolven = new TolvenContext(); ! appMap.put("tolven", tolven); ! } ! tolven.initialize(); ! AccountUser accountUser = null; ! if (accountUserId!=0) { ! accountUser = activation.findAccountUser(accountUserId ); ! accountType = accountUser.getAccount().getAccountType().getKnownType(); ! setPostLoginAction(accountUser.getAccount().getAccountType().getHomePage()); ! return "dispatch"; ! } info = "Login Processing: " + getTp().getUid(); // Get the TolvenUser *************** *** 174,209 **** // If the user object is missing but we have an invitation, see if it might get the user all the way logged in. if ((getUser()==null || Status.NEW_LOGIN.value().equalsIgnoreCase(getUser().getStatus())) && getInvitationId()!=0) { ! // Since we have no user yet, we'll try executing an activation invitation (if it works) ! if (!activation.activate(getTp().getUid(), getInvitationId(), getNow())) { ! return dispatchingLogout("invalidInvitation"); ! } ! // try TolvenUser again setUser( activation.loginUser( getTp().getUid(), getNow() ) ); ! if (getUser()==null) return dispatchingLogout("waitingActivation"); ! // Now we can complete the activation ! invitationBean.executeInvitation( getInvitationId(), getNow()); } // If user still not logged in, send them packing, we've got a problem if (getUser()==null) { ! // It appears that Faces doesn't allow a message to persist beyond a session invalidate so, instead, ! // we'll just go to a page specific to describe the problem for the user. ! // FacesContext.getCurrentInstance().addMessage( null, new FacesMessage("Internal Error: LDAP valid, missing UserObject")); return dispatchingLogout("missingUserObject"); } ! accountUserId = getRequestParameterAsLong( "accountUserId" ); // Otherwise, we dispatch based on the defaultAccount or the one the user selected. ! if (accountUserId!=0) { ! accountUser = activation.findAccountUser(accountUserId ); ! // SAFETY CHECK HERE - Don't trust the accountUserId alone, it must match user. ! if (accountUser.getUser().getId() != getUser().getId()) { ! return dispatchingLogout("invalidInvitation"); ! } ! if (this.isRememberDefault()) { ! accountUser.setDefaultAccount(true); ! activation.updateAccountUser(accountUser); ! } ! } if (accountUser==null && !this.isIgnoreDefault()) { ! accountUser = activation.findDefaultAccountUser(getUser()); } // If still null, because there's no default or maybe because the user has no account yet, ask user what to do --- 169,206 ---- // If the user object is missing but we have an invitation, see if it might get the user all the way logged in. if ((getUser()==null || Status.NEW_LOGIN.value().equalsIgnoreCase(getUser().getStatus())) && getInvitationId()!=0) { ! // Since we have no user yet, we'll try executing an activation invitation (if it works) ! if (!activation.activate(getTp().getUid(), getInvitationId(), getNow())) { ! return dispatchingLogout("invalidInvitation"); ! } ! // try TolvenUser again setUser( activation.loginUser( getTp().getUid(), getNow() ) ); ! if (getUser()==null) return dispatchingLogout("waitingActivation"); ! // Now we can complete the activation ! invitationBean.executeInvitation( getInvitationId(), getNow()); } + // If user still not logged in, send them packing, we've got a problem if (getUser()==null) { ! // It appears that Faces doesn't allow a message to persist beyond a session invalidate so, instead, ! // we'll just go to a page specific to describe the problem for the user. ! // FacesContext.getCurrentInstance().addMessage( null, new FacesMessage("Internal Error: LDAP valid, missing UserObject")); return dispatchingLogout("missingUserObject"); } ! ! accountUserId = getRequestParameterAsLong( "accountUserId" ); // Otherwise, we dispatch based on the defaultAccount or the one the user selected. ! if (accountUserId!=0) { ! accountUser = activation.findAccountUser(accountUserId ); ! // SAFETY CHECK HERE - Don't trust the accountUserId alone, it must match user. ! if (accountUser.getUser().getId() != getUser().getId()) { ! return dispatchingLogout("invalidInvitation"); ! } ! if (this.isRememberDefault()) { ! accountUser.setDefaultAccount(true); ! activation.updateAccountUser(accountUser); ! } ! } if (accountUser==null && !this.isIgnoreDefault()) { ! accountUser = activation.findDefaultAccountUser(getUser()); } // If still null, because there's no default or maybe because the user has no account yet, ask user what to do *************** *** 211,241 **** if (accountUser==null) { if (activation.countUserAccounts( getUser() ) > 0 ) { ! postLoginAction = "selectAccount.jsf"; } else { ! postLoginAction = "createAccount.jsf"; } ! return "dispatch"; } if (System.getProperty("tolven.security.keys.activate") != null) updatePrivateKeyRing(); ! accountUserId = accountUser.getId(); ! // Save the account Id - we'll need it in subsequent requests ! accountId = accountUser.getAccount().getId(); ! setAccountTitle( accountUser.getAccount().getTitle()); ! setAccountTimeZone( accountUser.getAccount().getTimeZone()); ! accountType = accountUser.getAccount().getAccountType().getKnownType(); // Ensure that this user has a menu structure setup menuLocal.createDefaultMenuStructure( accountUser.getAccount() ); // Before we get started, we need to tuck away the accountId in the session context since we'll need it // during non-Faces interactions, notably AjaxServlet.java ! HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false); ! session.setAttribute("accountId", accountId); accountAdmin = accountUser.isAccountPermission(); - if (this.isGenDemoData()) { - chrGen.createPatients( accountUser.getUser(), accountUser.getAccount(), 100, getTop().getNow(), 1996 ); - } ! setPostLoginAction(accountUser.getAccount().getAccountType().getHomePage()); ! return "dispatch"; } --- 208,235 ---- if (accountUser==null) { if (activation.countUserAccounts( getUser() ) > 0 ) { ! postLoginAction = "selectAccount.jsf"; } else { ! postLoginAction = "createAccount.jsf"; } ! return "dispatch"; } if (System.getProperty("tolven.security.keys.activate") != null) updatePrivateKeyRing(); ! accountUserId = accountUser.getId(); ! // Save the account Id - we'll need it in subsequent requests ! accountId = accountUser.getAccount().getId(); ! setAccountTitle( accountUser.getAccount().getTitle()); ! setAccountTimeZone( accountUser.getAccount().getTimeZone()); ! accountType = accountUser.getAccount().getAccountType().getKnownType(); // Ensure that this user has a menu structure setup menuLocal.createDefaultMenuStructure( accountUser.getAccount() ); // Before we get started, we need to tuck away the accountId in the session context since we'll need it // during non-Faces interactions, notably AjaxServlet.java ! // HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false); ! // session.setAttribute("accountId", accountId); // no longer needed - using top instead. accountAdmin = accountUser.isAccountPermission(); ! setPostLoginAction(accountUser.getAccount().getAccountType().getHomePage()); ! return "dispatch"; } *************** *** 533,542 **** this.accountTimeZone = accountTimeZone; } - public boolean isGenDemoData() { - return genDemoData; - } - public void setGenDemoData(boolean genDemoData) { - this.genDemoData = genDemoData; - } public String getAccountType() { return accountType; --- 527,530 ---- |
From: John C. <jc...@us...> - 2007-01-16 06:36:09
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22755/src/org/tolven/web Modified Files: RegisterAction.java Log Message: Call new data generator via queue Index: RegisterAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/RegisterAction.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** RegisterAction.java 10 Jan 2007 08:52:00 -0000 1.33 --- RegisterAction.java 16 Jan 2007 06:36:07 -0000 1.34 *************** *** 43,47 **** import org.tolven.core.entity.TolvenUser; import org.tolven.doc.DocumentLocal; ! import org.tolven.gen.CHRGenerator; import org.tolven.security.TolvenPerson; import org.tolven.web.security.auth.KeyLdapCallbackHandler; --- 43,48 ---- import org.tolven.core.entity.TolvenUser; import org.tolven.doc.DocumentLocal; ! import org.tolven.gen.Generator; ! import org.tolven.gen.bean.GenControlAccount; import org.tolven.security.TolvenPerson; import org.tolven.web.security.auth.KeyLdapCallbackHandler; *************** *** 70,74 **** private AccountDAOLocal accountBean; // @EJB ! private CHRGenerator chrGen; --- 71,75 ---- private AccountDAOLocal accountBean; // @EJB ! private Generator chrGen; *************** *** 135,139 **** menu = (MenuLocal) ctx.lookup("tolven/MenuBean/local"); doc = (DocumentLocal) ctx.lookup("tolven/DocumentBean/local"); ! chrGen = (CHRGenerator) ctx.lookup("tolven/CHRGeneratorBean/local"); } catch (NamingException e) --- 136,140 ---- menu = (MenuLocal) ctx.lookup("tolven/MenuBean/local"); doc = (DocumentLocal) ctx.lookup("tolven/DocumentBean/local"); ! chrGen = (Generator) ctx.lookup("tolven/GeneratorBean/local"); } catch (NamingException e) *************** *** 150,166 **** Account account = accountBean.createAccount2( this.getNewAccountTitle(), getNewTimeZone(), getNewAccountType() ); System.out.println( "Created account: " + account.getId() + ", acct type " + account.getAccountType().getKnownType()); ! // Note, the user automatically gets account permission because they are the only user on that new account. accountBean.addAccountUser( account, getTop().getUser(), getNow(), true); accountUsers = null; menu.createDefaultMenuStructure( account ); if (this.isGenDemoData()) { if (account.getAccountType().getKnownType().equals("ephr")) { ! chrGen.createFamily( getTop().getUser(), account, getTop().getNow(), 1999 ); System.out.println("created family"); } if (account.getAccountType().getKnownType().equals("echr")) { ! chrGen.createPatients( getTop().getUser(), account, 50, getTop().getNow(), 1996 ); ! System.out.println("created patients"); } } --- 151,176 ---- Account account = accountBean.createAccount2( this.getNewAccountTitle(), getNewTimeZone(), getNewAccountType() ); System.out.println( "Created account: " + account.getId() + ", acct type " + account.getAccountType().getKnownType()); ! // Note, the user automatically gets administrator permission because they are the only user on that new account. accountBean.addAccountUser( account, getTop().getUser(), getNow(), true); accountUsers = null; menu.createDefaultMenuStructure( account ); if (this.isGenDemoData()) { + // Crank up the data generator + GenControlAccount control = new GenControlAccount(); + control.setUserId( getTop().getUser().getId()); + control.setChrAccountId(account.getId()); + control.setNow(getTop().getNow()); + control.setStartYear( 1996 ); if (account.getAccountType().getKnownType().equals("ephr")) { ! control.setCount( 1 ); ! // chrGen.createFamily( getTop().getUser(), account, getTop().getNow(), 1999 ); System.out.println("created family"); } if (account.getAccountType().getKnownType().equals("echr")) { ! control.setCount( 100 ); ! // chrGen.createPatients( getTop().getUser(), account, 50, getTop().getNow(), 1996 ); } + // Now go. If a family, this should be done by the time the user logs in for the first time + chrGen.queueGeneration(control); } |
From: John C. <jc...@us...> - 2007-01-16 06:35:15
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22375/src/org/tolven/web Modified Files: MenuAction.java Log Message: Document is now fetched from menu data in separate query rather than "navigationally" using eager loading (lazy loading simply doesn't work with subclassed documents). This change results in the MenuData object storing a documentId (long) rather than a DocBase pointer. Index: MenuAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/MenuAction.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** MenuAction.java 4 Dec 2006 08:58:30 -0000 1.27 --- MenuAction.java 16 Jan 2007 06:35:13 -0000 1.28 *************** *** 44,47 **** --- 44,48 ---- import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; + import org.tolven.doc.DocumentLocal; import org.tolven.doc.entity.DocBase; import org.tolven.doc.entity.DocCCR; *************** *** 63,66 **** --- 64,68 ---- private MenuData menuDataItem = null; private Long menuDataCount = null; + private DocumentLocal documentLocal; private List<MenuStructure> menus = null; *************** *** 73,76 **** --- 75,79 ---- // J2EE 1.5 has not yet defined exact XML <ejb-ref> syntax for EJB3 menuLocal = (MenuLocal) ctx.lookup("tolven/MenuBean/local"); + documentLocal = (DocumentLocal) ctx.lookup("tolven/DocumentBean/local"); } catch (NamingException e) *************** *** 290,305 **** } public DocCCR getDocCCR( ) throws Exception { MenuData md = getDrilldownItem(); // System.out.println( "[getDocCCR] MD.id=" + md.getId()); ! DocBase doc = md.getDocument(); if (doc==null) { ! // System.out.println( "No Document in MD"); ! return null; } - // Note: instanceof doesn't work in Hibernate lazy loading if (!(doc instanceof DocCCR)) { ! System.out.println( "Document is not CCR " + doc.getId() + " Class: " + doc.getClass().getName()); ! return null; } return (DocCCR) doc; --- 293,319 ---- } + /** + * This method is needed because menuData only contains documentId, a separate query is needed + * to get the document itself. + * @return + * @throws Exception + */ + public DocBase getDrilldownItemDoc() throws Exception { + MenuData md = getDrilldownItem(); + DocBase doc = documentLocal.findDocument(md.getDocumentId()); + return doc; + } + public DocCCR getDocCCR( ) throws Exception { MenuData md = getDrilldownItem(); // System.out.println( "[getDocCCR] MD.id=" + md.getId()); ! if (md.getDocumentId()==0) return null; ! DocBase doc = documentLocal.findDocument(md.getDocumentId()); if (doc==null) { ! throw new RuntimeException( "Document id invalid in MD " + md.getId()); } if (!(doc instanceof DocCCR)) { ! System.out.println( ); ! throw new RuntimeException( "Document is not CCR " + doc.getId() + " Class: " + doc.getClass().getName()); } return (DocCCR) doc; *************** *** 351,358 **** --- 365,374 ---- // Adjust the path to make this work MenuStructure msLab = menuLocal.findMenuStructure(getAccountId(), path); + if (msLab==null) throw new IllegalArgumentException( "Path not valid for this account"); // Create a new path based on the matching id(s) from the called path // for example, if patient were specified in the input nodeValues and the new path has a patient node, then // it's pulled. MenuPath mdPath = new MenuPath(msLab.getPath(), getTargetMenuPath() ); + // System.out.println("dataset: Query from " + msLab.getPath() + " for requested path: " + getTargetMenuPath()); MenuQueryControl ctrl = new MenuQueryControl(); ctrl.setLimit( 5000 ); // TODO: This is a hard coded hard query limit that should be in a property or something *************** *** 381,385 **** sx.addOrUpdate(m, md.getPqValue01()); } - System.out.println("Preparing Dataset"); TimeSeriesCollection dataset = new TimeSeriesCollection(); dataset.addSeries(s1); --- 397,400 ---- *************** *** 423,428 **** if (patient==null) throw new RuntimeException( "Patient not found "); MenuData ass = new MenuData(); // Find the assessment MS ! MenuStructure msa = menuLocal.findDescendentMenuStructure(patientMS.getAccount().getId(), patientMS, "assessment"); ass.setMenuStructure(msa); ass.setAccount(patientMS.getAccount()); --- 438,444 ---- if (patient==null) throw new RuntimeException( "Patient not found "); MenuData ass = new MenuData(); + // Find the assessment MS ! MenuStructure msa = menuLocal.findDescendentMenuStructure(getAccountId(), patientMS, "assessment"); ass.setMenuStructure(msa); ass.setAccount(patientMS.getAccount()); *************** *** 432,437 **** --- 448,467 ---- ass.setString02( "new"); menuLocal.persistMenuData(ass); + // Note the elementId of this new item menuDataItem = ass; + + // Add the item to activity for this user/patient + MenuData newActivity = new MenuData(); + MenuStructure msNA = menuLocal.findMenuStructure(getAccountId(), getTop().getAccountType() + ":activity:all"); + newActivity.setMenuStructure(msNA); + newActivity.setAccount(msNA.getAccount()); + newActivity.setParent01(patient); + newActivity.setDate01(getNow()); + newActivity.setString01(patient.getString01() + ", " + patient.getString02()); + newActivity.setString02( "Glasgow Coma Scale in process"); + newActivity.setReference(ass); + menuLocal.persistMenuData(newActivity); + // That should be it for an assessment but since we don't have reflexive queries // done yet, we have to manually add this assessment to the list of assessments |
From: John C. <jc...@us...> - 2007-01-16 06:29:20
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19727/src/org/tolven/web Modified Files: DocAction.java Log Message: Creating a document now requires user as well as account. Index: DocAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/DocAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DocAction.java 28 Sep 2006 19:12:08 -0000 1.8 --- DocAction.java 16 Jan 2007 06:29:18 -0000 1.9 *************** *** 71,75 **** doc.setMediaType( "text/plain" ); doc.setContentString( content ); ! docBean.createDocument( doc ); return "success"; } --- 71,75 ---- doc.setMediaType( "text/plain" ); doc.setContentString( content ); ! docBean.createDocument( doc, getTop().getUser().getId(), getTop().getAccountId() ); return "success"; } *************** *** 237,239 **** --- 237,246 ---- } + public long getDocumentCount( ) { + return docBean.countDocuments( getTop().getAccountId()); + } + + public long getXMLDocumentCount( ) { + return docBean.countXMLDocuments( getTop().getUser().getId()); + } } |
From: John C. <jc...@us...> - 2007-01-16 06:28:23
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/ccr In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19313/src/org/tolven/web/ccr Modified Files: CCRAction.java Log Message: Add new path display, disable submit from here - no longer a sensible test. Index: CCRAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/ccr/CCRAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CCRAction.java 28 Sep 2006 19:12:08 -0000 1.1 --- CCRAction.java 16 Jan 2007 06:28:22 -0000 1.2 *************** *** 86,89 **** --- 86,90 ---- addCCRPath( "#{ccr.CCR.actors.actor[0].address[0].country}" ); addCCRPath( "#{ccr.patientActor[0].address[0].county}" ); + addCCRPath( "#{ccr.CCR.body.problems.problem[0].description.text}"); } return ccrPathItems; *************** *** 104,107 **** --- 105,109 ---- System.out.println( "...created id " + getDoc().getId()); docBean.persistCCRDocument(docCCR, false); + // docBean.submitDocument(docCCR); return "success"; } *************** *** 111,114 **** --- 113,117 ---- System.out.println( "Patient added to " + getDocCCR().getId()); docBean.persistCCRDocument(getDocCCR(), false); + // docBean.submitDocument(getDocCCR()); return "success"; } |
From: John C. <jc...@us...> - 2007-01-16 06:26:20
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18499/src/org/tolven/ajax Modified Files: DocServlet.java Log Message: Eliminate the need for accountId in session (use top instead) Index: DocServlet.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax/DocServlet.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DocServlet.java 31 Aug 2006 05:19:11 -0000 1.6 --- DocServlet.java 16 Jan 2007 06:26:19 -0000 1.7 *************** *** 17,20 **** --- 17,21 ---- import java.io.Writer; import java.util.List; + import java.util.TimeZone; import javax.naming.InitialContext; *************** *** 33,36 **** --- 34,38 ---- import org.tolven.doc.entity.DocBase; import org.tolven.doc.entity.DocImage; + import org.tolven.web.TopAction; public class DocServlet extends HttpServlet { *************** *** 81,84 **** --- 83,94 ---- // String uri = request.getRequestURI(); // Parse the request + TopAction top = null; + Object topObj = request.getSession(false).getAttribute("top"); + if (topObj==null) { + throw new IllegalStateException( "[docServlet] Top Obj is null - how can that be"); + } + if (topObj instanceof TopAction) { + top = (org.tolven.web.TopAction)topObj; + } String returnTo = null; try { *************** *** 109,114 **** } // Get the logged in user and set as the author ! long accountId = (Long) request.getSession(false).getAttribute("accountId"); ! id = docBean.createImage( doc, accountId ); } // writer.write( "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<html>\n" + --- 119,125 ---- } // Get the logged in user and set as the author ! long accountId = top.getAccountId(); ! long userId = top.getUser().getId(); ! id = docBean.createImage( doc, userId, accountId ); } // writer.write( "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<html>\n" + *************** *** 141,145 **** // loaded before we proceed. long docId = Long.parseLong( req.getParameter( "docId")); ! long accountId = (Long) req.getSession(false).getAttribute("accountId"); // Calculate the target width and height based on scaling to the smallest of the two dimensions int targetWidth = Integer.parseInt(req.getParameter("width")); --- 152,164 ---- // loaded before we proceed. long docId = Long.parseLong( req.getParameter( "docId")); ! TopAction top = null; ! Object topObj = req.getSession(false).getAttribute("top"); ! if (topObj==null) { ! throw new IllegalStateException( "[docServlet] Top Obj is null - how can that be"); ! } ! if (topObj instanceof TopAction) { ! top = (org.tolven.web.TopAction)topObj; ! } ! long accountId = (Long) top.getAccountId(); // Calculate the target width and height based on scaling to the smallest of the two dimensions int targetWidth = Integer.parseInt(req.getParameter("width")); |
From: John C. <jc...@us...> - 2007-01-16 06:25:42
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18095/src/org/tolven/ajax Modified Files: AjaxServlet.java Log Message: Eliminate the need for accountId in session (use top instead) Index: AjaxServlet.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/ajax/AjaxServlet.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AjaxServlet.java 14 Jan 2007 06:26:29 -0000 1.17 --- AjaxServlet.java 16 Jan 2007 06:25:40 -0000 1.18 *************** *** 167,185 **** String sortCol = req.getParameter( "sort_col"); String sortDir = req.getParameter( "sort_dir"); ! // Figure out timeZone ! TimeZone timeZone; ! Object topObj = req.getSession(false).getAttribute("top"); if (topObj==null) { ! System.out.println( "[AjaxServlet] Top Obj is null - how can that be"); ! timeZone = TimeZone.getDefault(); } ! else if (topObj instanceof TopAction) { ! TopAction top = (org.tolven.web.TopAction)topObj; ! timeZone = TimeZone.getTimeZone(top.getTimeZone()); ! } else { ! timeZone = TimeZone.getDefault(); ! System.out.println( "[AjaxServlet] Top class is " + topObj.getClass().getName() + " - how can that be"); } ! if (sortDir==null) { sortDir = "ASC"; } --- 167,183 ---- String sortCol = req.getParameter( "sort_col"); String sortDir = req.getParameter( "sort_dir"); ! TopAction top = null; ! Object topObj = req.getSession(false).getAttribute("top"); if (topObj==null) { ! throw new IllegalStateException( "[docServlet] Top Obj is null - how can that be"); } ! if (topObj instanceof TopAction) { ! top = (org.tolven.web.TopAction)topObj; } ! ! // Figure out timeZone ! TimeZone timeZone = TimeZone.getTimeZone(top.getTimeZone()); ! ! if (sortDir==null) { sortDir = "ASC"; } *************** *** 192,196 **** String element = req.getParameter( "element"); MenuPath path = new MenuPath( element ); ! long accountId = (Long) req.getSession(false).getAttribute("accountId"); MenuStructure ms = menuLocal.findMenuStructure( accountId, path.getPath() ); String repeatingBase = ms.getRepeating(); --- 190,194 ---- String element = req.getParameter( "element"); MenuPath path = new MenuPath( element ); ! long accountId = top.getAccountId(); MenuStructure ms = menuLocal.findMenuStructure( accountId, path.getPath() ); String repeatingBase = ms.getRepeating(); *************** *** 362,372 **** for (DocXML d : rows) { line++; writer.write( "<tr>" ); writer.write( "<td> <a href=\"#\" onclick=\"showPane(containerId(this)+':detail-" + d.getId()+ "')\">"+ d.getId() + "</a> </td>"); // writer.write( "<td> " + d.getId() + "</td>"); writer.write( "<td> " + d.getBindingContext() + "</td>"); ! writer.write( "<td> " + d.getAuthor().getLdapUID() + "</td>"); writer.write( "<td> " + d.getStatus() + "</td>"); ! writer.write( "<td> " + d.getAccount().getTitle() + "</td>"); writer.write( "</tr>\n"); --- 360,374 ---- for (DocXML d : rows) { line++; + String uid = "-"; + if (d.getAuthor()!=null) { + uid = d.getAuthor().getLdapUID(); + } writer.write( "<tr>" ); writer.write( "<td> <a href=\"#\" onclick=\"showPane(containerId(this)+':detail-" + d.getId()+ "')\">"+ d.getId() + "</a> </td>"); // writer.write( "<td> " + d.getId() + "</td>"); writer.write( "<td> " + d.getBindingContext() + "</td>"); ! writer.write( "<td> " + uid + "</td>"); writer.write( "<td> " + d.getStatus() + "</td>"); ! writer.write( "<td> " + d.getAccount().getId() + " " + d.getAccount().getTitle() + "</td>"); writer.write( "</tr>\n"); |
From: John C. <jc...@us...> - 2007-01-16 06:22:26
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16844/src/org/tolven/core/entity Modified Files: AccountType.java Account.java AccountUser.java Log Message: Performance improvements - caching small cardinality, often used tables Index: AccountType.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/AccountType.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AccountType.java 6 Nov 2006 07:41:24 -0000 1.3 --- AccountType.java 16 Jan 2007 06:22:24 -0000 1.4 *************** *** 22,25 **** --- 22,28 ---- import javax.persistence.Table; + import org.hibernate.annotations.Cache; + import org.hibernate.annotations.CacheConcurrencyStrategy; + /** * AccountType.java *************** *** 32,35 **** --- 35,39 ---- */ @Entity + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Table(name = "ACCOUNT_TYPE", schema="core") public class AccountType implements Serializable { Index: AccountUser.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/AccountUser.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AccountUser.java 25 Dec 2006 06:34:40 -0000 1.8 --- AccountUser.java 16 Jan 2007 06:22:24 -0000 1.9 *************** *** 27,30 **** --- 27,33 ---- import javax.persistence.Temporal; import javax.persistence.TemporalType; + + import org.hibernate.annotations.Cache; + import org.hibernate.annotations.CacheConcurrencyStrategy; import org.tolven.doc.entity.DocBase; *************** *** 38,41 **** --- 41,45 ---- */ @Entity + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Table(name = "ACCOUNT_USER", schema="core") public class AccountUser implements Serializable { *************** *** 75,79 **** @Embedded private AccountPrivateKey accountPrivateKey; - /** --- 79,82 ---- *************** *** 192,196 **** this.status = status; } ! public AccountPrivateKey getAccountPrivateKey() { return accountPrivateKey; --- 195,199 ---- this.status = status; } ! public AccountPrivateKey getAccountPrivateKey() { return accountPrivateKey; Index: Account.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/core/entity/Account.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Account.java 1 Jan 2007 10:04:21 -0000 1.15 --- Account.java 16 Jan 2007 06:22:24 -0000 1.16 *************** *** 32,35 **** --- 32,36 ---- import org.tolven.security.key.AccountPublicKey; + import org.hibernate.annotations.*; /** * Maintains a collection of HealthRecords and related information. An account has one or more account administrators that generally *************** *** 39,42 **** --- 40,44 ---- */ @Entity + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Table(name = "ACCOUNT", schema="core") public class Account implements Serializable { *************** *** 74,78 **** private AccountPublicKey accountPublicKey; - /** * Construct an empty Account or Sub-account. A sub-account should have a non-null Parent Account. Account trees cannot have circular references. --- 76,79 ---- *************** *** 225,227 **** --- 226,229 ---- } + } |
From: John C. <jc...@us...> - 2007-01-16 06:20:58
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16367/src/org/tolven/core/util Added Files: Queuer.java Log Message: Changes associated with new DataGenerator --- NEW FILE: Queuer.java --- package org.tolven.core.util; import java.io.Serializable; import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageProducer; import javax.jms.ObjectMessage; import javax.jms.Queue; public class Queuer { private Connection connection = null; private javax.jms.Session session = null; private MessageProducer messageProducer = null; public void init(ConnectionFactory connectionFactory, Queue queue) { try { // System.out.println("************INIT*********************"); connection = connectionFactory.createConnection(); session = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); messageProducer = session.createProducer(queue); } catch (Exception e) { throw new RuntimeException( "Error creating connection to generator queue", e); } } public void close() { try { messageProducer.close(); connection.close(); } catch (Exception e) { throw new RuntimeException( "Error closing connection to generator queue", e); } } public void send( Serializable payload ) throws Exception { ObjectMessage message = session.createObjectMessage(payload); messageProducer.send(message); } } |
From: John C. <jc...@us...> - 2007-01-16 06:20:55
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/core/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16347/src/org/tolven/core/util Log Message: Directory /cvsroot/tolven/tolvenEJB/src/org/tolven/core/util added to the repository |
From: John C. <jc...@us...> - 2007-01-16 06:20:32
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16302/src/org/tolven/doc/bean Added Files: Evaluator.java TolvenMessage.java Log Message: Changes associated with new DataGenerator --- NEW FILE: Evaluator.java --- /* * Copyright (C) 2007 Tolven Inc * * This library is free software; you can redistribute it and/or modify it under the terms of * the GNU Lesser General Public License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Contact: in...@to... */ package org.tolven.doc.bean; import java.io.IOException; import java.text.ParseException; import javax.annotation.EJB; import javax.annotation.Resource; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.ejb.MessageDrivenContext; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.ObjectMessage; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.xml.bind.JAXBException; import org.tolven.app.MenuLocal; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.ccr.ActorType; import org.tolven.ccr.CodedDescriptionType; import org.tolven.ccr.ContinuityOfCareRecord; import org.tolven.ccr.ProblemType; import org.tolven.ccr.DateTimeType; import org.tolven.ccr.PersonNameType; import org.tolven.ccr.ResultType; import org.tolven.ccr.TestType; import org.tolven.doc.DocumentLocal; import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocBase; import org.tolven.doc.entity.DocCCR; /** * Evaluate new documents that have arrived. We do this after a document is safely stored and in the * active state. In most cases, we simple create/update indexes be we can do other things like create new documents. * However, in most cases, we must limit what a document affects to the account in which the document lives. * @author John Churin */ @MessageDriven(activationConfig = { // We essentially single-thread this queue so we don't clobber user performance. @ActivationConfigProperty(propertyName="maxPoolSize", propertyValue="1"), @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue="queue/rule") }) public class Evaluator implements MessageListener { @EJB private DocumentLocal documentLocal; @EJB private MenuLocal menuLocal; @Resource private MessageDrivenContext ctx; public void onMessage(Message msg) { String msgId = "<tbd>"; try { msgId = msg.getJMSMessageID(); TolvenMessage tm = (TolvenMessage) ((ObjectMessage)msg).getObject(); // System.out.println( tm.getPayload()); DocCCR docCCR = documentLocal.persistMessage(tm); processCCR(docCCR); // System.out.println( docCCR.getPatientActor().getPerson().getName().getCurrentName().getFamilyString()); } catch (JMSException e) { System.out.println( "Msg Failed: " + msgId); e.printStackTrace(); } catch (JAXBException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (CCRException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * Process a single CCR message * @param docCCR * @throws JAXBException * @throws CCRException * @throws ParseException */ public void processCCR( DocCCR docCCR ) throws JAXBException, CCRException, ParseException { // Get type of account String accountType = docCCR.getAccount().getAccountType().getKnownType(); if (!"echr".equals(accountType)) return; ContinuityOfCareRecord ccr = docCCR.getCCR(); // All of this will be placeholders in the first pass. // Start with patient MenuStructure msPatient = menuLocal.findMenuStructure(docCCR.getAccount().getId(), "echr:patient"); MenuData mdPatient = new MenuData(); mdPatient.setMenuStructure( msPatient ); mdPatient.setDocumentId(docCCR.getId()); mdPatient.setAccount(docCCR.getAccount()); ActorType pat = docCCR.getPatientActor(); DateTimeType dob = pat.getPerson().getDateOfBirth(); if (dob.getExactDateTime()!=null) { mdPatient.setDate01( dob.getDateValue()); } PersonNameType name = pat.getPerson().getName().getCurrentName(); if ( name!=null ) { mdPatient.setString01(name.getFamilyString()); mdPatient.setString02(name.getGivenString()); mdPatient.setString03(name.getMiddleString()); } mdPatient.setString04(pat.getPerson().getGender().getText()); menuLocal.persistMenuData(mdPatient); // Extract Problems if (ccr.getBody()!=null && ccr.getBody().getProblems()!=null) { MenuStructure msProblem = menuLocal.findDescendentMenuStructure(docCCR.getAccount().getId(), msPatient, "problem"); MenuStructure msProblemList = menuLocal.findDescendentMenuStructure(docCCR.getAccount().getId(), msPatient, "hx:problems"); MenuStructure msProblemSumm = menuLocal.findDescendentMenuStructure(docCCR.getAccount().getId(), msPatient, "summary:probsum"); MenuStructure msPatientDisease = menuLocal.findMenuStructure(docCCR.getAccount().getId(), "echr:patients:disease"); MenuStructure msPatientDiabetes = menuLocal.findMenuStructure(docCCR.getAccount().getId(), "echr:patients:dm"); for (ProblemType problem : ccr.getBody().getProblems().getProblem()) { // Create the problem MenuData mdProblem = new MenuData(); mdProblem.setMenuStructure( msProblem ); mdProblem.setDocumentId(docCCR.getId()); mdProblem.setAccount(docCCR.getAccount()); mdProblem.setParent01(mdPatient); mdProblem.setString01(problem.getDescriptionText()); mdProblem.setDate01(problem.getDateTimeType(ProblemType.DATE_OF_ONSET).getDateValue()); mdProblem.setString02(problem.getStatusText()); menuLocal.persistMenuData(mdProblem); // Add to patient's problem list MenuData mdProblemList = new MenuData(); mdProblemList.setMenuStructure( msProblemList ); mdProblemList.setDocumentId(docCCR.getId()); mdProblemList.setAccount(docCCR.getAccount()); mdProblemList.setParent01(mdPatient); mdProblemList.setString01(problem.getDescriptionText()); mdProblemList.setDate01(problem.getDateTimeType(ProblemType.DATE_OF_ONSET).getDateValue()); mdProblemList.setString02(problem.getStatusText()); mdProblemList.setReference(mdProblem); menuLocal.persistMenuData(mdProblemList); // Add to patient's problem summary MenuData mdProblemSumm = new MenuData(); mdProblemSumm.setMenuStructure( msProblemSumm ); mdProblemSumm.setDocumentId(docCCR.getId()); mdProblemSumm.setAccount(docCCR.getAccount()); mdProblemSumm.setParent01(mdPatient); mdProblemSumm.setString01(problem.getDescriptionText()); mdProblemSumm.setDate01(problem.getDateTimeType(ProblemType.DATE_OF_ONSET).getDateValue()); mdProblemSumm.setString02(problem.getStatusText()); mdProblemSumm.setReference(mdProblem); menuLocal.persistMenuData(mdProblemSumm); // Add to patients by disease list MenuData mdPatientDisease = new MenuData(); mdPatientDisease.setMenuStructure( msPatientDisease ); mdPatientDisease.setDocumentId(docCCR.getId()); mdPatientDisease.setAccount(docCCR.getAccount()); mdPatientDisease.setString01( mdPatient.getString01( )); mdPatientDisease.setString02( mdPatient.getString02( )); mdPatientDisease.setString03(problem.getDescriptionText()); mdPatientDisease.setString04(pat.getPerson().getGender().getText()); mdPatientDisease.setDate01( mdPatient.getDate01( )); mdPatientDisease.setDate02(problem.getDateTimeType(ProblemType.DATE_OF_ONSET).getDateValue()); mdPatientDisease.setReference(mdPatient); menuLocal.persistMenuData(mdPatientDisease); // Add to patients with diabetes list if (problem.getDescriptionText().startsWith("Diabetes")) { MenuData mdDiabetesList = new MenuData(); mdDiabetesList.setMenuStructure( msPatientDiabetes ); mdDiabetesList.setDocumentId(docCCR.getId()); mdDiabetesList.setAccount(docCCR.getAccount()); mdDiabetesList.setString01( mdPatient.getString01( )); mdDiabetesList.setString02( mdPatient.getString02( )); mdDiabetesList.setString03(problem.getDescriptionText()); mdDiabetesList.setString04(pat.getPerson().getGender().getText()); mdDiabetesList.setDate01( mdPatient.getDate01( )); mdDiabetesList.setDate02(problem.getDateTimeType(ProblemType.DATE_OF_ONSET).getDateValue()); mdDiabetesList.setReference(mdPatient); menuLocal.persistMenuData(mdDiabetesList); } } } // Extract Results (in CCR, a ResultType can also be an observation) // We do results if (ccr.getBody()!=null && ccr.getBody().getResults()!=null) { MenuStructure msResult = menuLocal.findDescendentMenuStructure(docCCR.getAccount().getId(), msPatient, "result"); MenuStructure msTest = menuLocal.findDescendentMenuStructure(docCCR.getAccount().getId(), msResult, "test"); MenuStructure msResultsLab = menuLocal.findDescendentMenuStructure(docCCR.getAccount().getId(), msPatient, "results:lab"); for (ResultType result : ccr.getBody().getResults().getResult()) { // Create the result MenuData mdResult = new MenuData(); mdResult.setMenuStructure( msResult ); mdResult.setDocumentId(docCCR.getId()); mdResult.setAccount(docCCR.getAccount()); mdResult.setParent01(mdPatient); mdResult.setString01(result.getDescriptionText()); mdResult.setDate01(result.getDateTimeType(ResultType.COLLECTION_DATE).getDateValue()); mdResult.setString02(result.getStatusText()); menuLocal.persistMenuData(mdResult); // We also need to represent individual test results for (TestType test : result.getTest()) { MenuData mdTest = new MenuData(); mdTest.setMenuStructure( msTest ); mdTest.setDocumentId(docCCR.getId()); mdTest.setAccount(docCCR.getAccount()); mdTest.setParent01(mdPatient); mdTest.setParent02(mdResult); mdTest.setString01(test.getDescriptionText()); // Note date is copied from the result (parent), not the test (child) mdTest.setDate01(result.getDateTimeType(ResultType.COLLECTION_DATE).getDateValue()); // Value+units if (test.getTestResult()!=null && test.getTestResult().getValue()!=null) { // System.out.println( "Test " + test.getDescriptionText() + ": "+ test.getTestResult().getValue() + " " + test.getTestResult().getUnits().getUnit()); mdTest.setPqValue01(Double.parseDouble(test.getTestResult().getValue())); mdTest.setPqStringVal01(test.getTestResult().getValue()); mdTest.setPqUnits01(test.getTestResult().getUnits().getUnit()); // ------------------------------------------------------------------------- // Add results to lab results list MenuData mdResultsLab = new MenuData(); mdResultsLab.setMenuStructure( msResultsLab ); mdResultsLab.setDocumentId(docCCR.getId()); mdResultsLab.setAccount(docCCR.getAccount()); mdResultsLab.setParent01(mdPatient); mdResultsLab.setString01(result.getDescriptionText()); mdResultsLab.setString02(test.getDescriptionText()); // Note date is copied from the result (parent), not the test (child) mdResultsLab.setDate01(result.getDateTimeType(ResultType.COLLECTION_DATE).getDateValue()); mdResultsLab.setString04(result.getStatusText()); mdResultsLab.setPqValue01(Double.parseDouble(test.getTestResult().getValue())); mdResultsLab.setPqStringVal01(test.getTestResult().getValue()); mdResultsLab.setPqUnits01(test.getTestResult().getUnits().getUnit()); //Reference the whole result, not just the test mdResultsLab.setReference(mdResult); menuLocal.persistMenuData(mdResultsLab); // If result is fairly new, add to new results list } // Report - Descriptions (appended into String02 with \n in between) // NO NO NO - Require drilldown to read the report // if (test.getTestResult()!=null && test.getTestResult().getDescription().size() > 0) { // StringBuffer sb = new StringBuffer(1000); // for (CodedDescriptionType desc: test.getTestResult().getDescription()) { // if (sb.length() > 0 ) sb.append( "\n"); // sb.append( desc.getText()); // } // mdTest.setString02(sb.toString()); // } // TODO: Need <flag> here as well (interpretation/panic) // Status copied from result mdTest.setString02(result.getStatusText()); menuLocal.persistMenuData(mdTest); } } } // Put the patient on the "all patients" list MenuStructure msAllPatients = menuLocal.findMenuStructure(docCCR.getAccount().getId(), "echr:patients:all"); MenuData mdAllPatients = new MenuData(); mdAllPatients.setMenuStructure( msAllPatients ); mdAllPatients.setDocumentId(mdPatient.getDocumentId()); mdAllPatients.setAccount( mdPatient.getAccount()); mdAllPatients.setDate01( mdPatient.getDate01( )); mdAllPatients.setString01( mdPatient.getString01( )); mdAllPatients.setString02( mdPatient.getString02( )); mdAllPatients.setString03( mdPatient.getString03( )); mdAllPatients.setString04( mdPatient.getString04( )); mdAllPatients.setReference( mdPatient ); menuLocal.persistMenuData(mdAllPatients); } } --- NEW FILE: TolvenMessage.java --- package org.tolven.doc.bean; import java.io.Serializable; public class TolvenMessage implements Serializable { private static final long serialVersionUID = 1L; private String payload; private String xmlNS; private String xmlName; private long accountId; private long authorId; public long getAccountId() { return accountId; } public void setAccountId(long accountId) { this.accountId = accountId; } public String getPayload() { return payload; } public void setPayload(String payload) { this.payload = payload; } public String getXmlName() { return xmlName; } public void setXmlName(String xmlName) { this.xmlName = xmlName; } public String getXmlNS() { return xmlNS; } public void setXmlNS(String xmlNS) { this.xmlNS = xmlNS; } public long getAuthorId() { return authorId; } public void setAuthorId(long authorId) { this.authorId = authorId; } } |
From: John C. <jc...@us...> - 2007-01-16 06:20:32
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16302/src/org/tolven/doc Modified Files: DocumentLocal.java Log Message: Changes associated with new DataGenerator Index: DocumentLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/DocumentLocal.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DocumentLocal.java 14 Jan 2007 06:26:24 -0000 1.8 --- DocumentLocal.java 16 Jan 2007 06:20:30 -0000 1.9 *************** *** 18,21 **** --- 18,23 ---- import java.util.List; + import javax.jms.JMSException; + import javax.persistence.Query; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; *************** *** 25,28 **** --- 27,31 ---- import org.tolven.admin.AdministrativeDetail; import org.tolven.admin.Details; + import org.tolven.doc.bean.TolvenMessage; import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocBase; *************** *** 36,45 **** */ public interface DocumentLocal { - /** - * Persist a new document and return it's ID - * @param doc - * @return the id assigned to the new document. - */ - public long createDocument( DocBase doc ); /** --- 39,42 ---- *************** *** 47,53 **** * @param doc * @param userId of the author * @return the id assigned to the new document. */ ! public long createDocument( DocBase doc, long userId ); /** --- 44,51 ---- * @param doc * @param userId of the author + * @param accountId of the account that owns the document * @return the id assigned to the new document. */ ! public long createDocument( DocBase doc, long userId, long accountId ); /** *************** *** 68,71 **** --- 66,77 ---- */ public void persistCCRDocument( DocCCR doc, boolean validate ) throws JAXBException, IOException, CCRException; + + /** + * When we get a new tolven message, persist it as a document. + * @param tm + * @return + */ + public DocCCR persistMessage( TolvenMessage tm ); + /** * Not a very practical method but we'll use it for testing. *************** *** 81,90 **** public DocBase findDocument( long docId ); ! /** ! * Return XML documents for the specified account ! */ ! public List<DocXML> findXMLDocuments(long accountId, int pageSize, int offset, String sortAttribute, String sortDir ); ! /** * Return XML documents for the specified user */ --- 87,96 ---- public DocBase findDocument( long docId ); ! /** ! * Return XML documents for the specified account ! */ ! public List<DocXML> findXMLDocuments(long accountId, int pageSize, int offset, String sortAttribute, String sortDir ); ! /** * Return XML documents for the specified user */ *************** *** 100,104 **** public DocImage findImage( long docId, long accountId ); ! /** * Count of all photo-documents owned by this account. */ --- 106,120 ---- public DocImage findImage( long docId, long accountId ); ! /** ! * Count of all documents owned by this account. ! */ ! public long countDocuments( long accountId ); ! ! /** ! * Count of all documents owned by this user (ignoring account) - for demo use only. ! */ ! public long countXMLDocuments( long userId ); ! ! /** * Count of all photo-documents owned by this account. */ *************** *** 121,125 **** * @return the id assigned to the new document. */ ! public long createImage( DocImage doc, long accountId ); /** --- 137,141 ---- * @return the id assigned to the new document. */ ! public long createImage( DocImage doc, long userId, long accountId ); /** |
From: John C. <jc...@us...> - 2007-01-16 06:19:24
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15875/src/org/tolven/doc/bean Modified Files: DocumentBean.java Log Message: 1. Status changed to lower case. 2. Added corresponding count method for findallXMLdocuments Index: DocumentBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean/DocumentBean.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** DocumentBean.java 14 Jan 2007 06:26:24 -0000 1.15 --- DocumentBean.java 16 Jan 2007 06:19:23 -0000 1.16 *************** *** 21,24 **** --- 21,26 ---- import javax.annotation.EJB; import javax.annotation.PostConstruct; + import javax.annotation.PreDestroy; + import javax.annotation.Resource; import javax.ejb.Local; import javax.ejb.Stateless; *************** *** 55,68 **** */ @Stateless() ! @Local(DocumentLocal.class) public class DocumentBean implements DocumentLocal { @PersistenceContext private EntityManager em; ! @EJB private TolvenPropertiesLocal propertyBean; ! JAXBContext jc = null; ! /** * Get a document by its internal ID --- 57,70 ---- */ @Stateless() ! @Local(DocumentLocal.class) public class DocumentBean implements DocumentLocal { @PersistenceContext private EntityManager em; ! @EJB private TolvenPropertiesLocal propertyBean; ! private JAXBContext jc = null; ! /** * Get a document by its internal ID *************** *** 75,88 **** } - /** - * Persist a new document and return it's ID - * @param doc - * @return the id assigned to the new document. - */ - public long createDocument( DocBase doc ) { - em.persist( doc ); - return doc.getId(); - } - /** * The document is immediately persisted (with no XML in it). This gives us the ID we'll need --- 77,80 ---- *************** *** 96,102 **** public DocCCR createCCRDocument( long userId, long accountId ) throws IOException, CCRException { DocCCR doc = new DocCCR(); ! doc.setAuthor(em.getReference( TolvenUser.class, userId )); ! doc.setAccount(em.getReference( Account.class, accountId )); ! createDocument( doc ); String oid = propertyBean.getProperties().getProperty("tolven.repository.oid"); doc.createCCR(oid); --- 88,95 ---- public DocCCR createCCRDocument( long userId, long accountId ) throws IOException, CCRException { DocCCR doc = new DocCCR(); ! // doc.setAuthor(em.getReference( TolvenUser.class, userId )); ! // doc.setAccount(em.getReference( Account.class, accountId )); ! // em.persist( doc ); ! createDocument( doc, userId, accountId ); String oid = propertyBean.getProperties().getProperty("tolven.repository.oid"); doc.createCCR(oid); *************** *** 106,110 **** /** * We've actually persisted the document already, this performs an update containing ! * the validated XML content. * @param doc * @throws CCRException --- 99,103 ---- /** * We've actually persisted the document already, this performs an update containing ! * the validated XML content. And the status is changed to active if the validate flag is true. * @param doc * @throws CCRException *************** *** 114,129 **** public void persistCCRDocument( DocCCR doc, boolean validate ) throws JAXBException, IOException, CCRException { doc.marshallXML(validate); em.merge(doc); } /** ! * Persist a new document and return it's ID * @param doc * @param userId of the author * @return the id assigned to the new document. */ ! public long createDocument( DocBase doc, long userId ) { doc.setAuthor(em.getReference( TolvenUser.class, userId )); ! return createDocument( doc ); } --- 107,144 ---- public void persistCCRDocument( DocCCR doc, boolean validate ) throws JAXBException, IOException, CCRException { doc.marshallXML(validate); + if (validate) doc.setStatus("active"); em.merge(doc); } /** ! * When we get a new tolven message, persist it as a document. ! * @param tm ! * @return ! */ ! public DocCCR persistMessage( TolvenMessage tm ) { ! DocCCR docCCR = new DocCCR(); ! docCCR.setContentString(tm.getPayload()); ! docCCR.setAccount(em.getReference(Account.class, tm.getAccountId())); ! docCCR.setAuthor(em.getReference(TolvenUser.class, tm.getAuthorId())); ! docCCR.setStatus("active"); ! docCCR.setMediaType("text/xml"); ! em.persist(docCCR); ! return docCCR; ! } ! ! /** ! * Persist a new document and return it's ID. This is not a final submission. ! * At this point the document is persisted by not actionable. It can still be edited. ! * When the document is ready for submission, the submitDocument method should be called. * @param doc * @param userId of the author * @return the id assigned to the new document. */ ! public long createDocument( DocBase doc, long userId, long accountId ) { ! doc.setStatus("new"); doc.setAuthor(em.getReference( TolvenUser.class, userId )); ! doc.setAccount(em.getReference( Account.class, accountId )); ! em.persist( doc ); ! return doc.getId(); } *************** *** 151,156 **** } ! /** ! * Return XML documents for the specified user */ public List<DocXML> findAllXMLDocuments(long userId, int pageSize, int offset, String sortAttribute, String sortDir ) { --- 166,173 ---- } ! /** ! * Return all XML documents owned by any account the specified user is a member of (for demo use only). ! * This is otherwise a security violation but is used to demonstrate that even if documents are returned ! * that the user doesn't currently have access to, they will remain encrypted. */ public List<DocXML> findAllXMLDocuments(long userId, int pageSize, int offset, String sortAttribute, String sortDir ) { *************** *** 162,165 **** --- 179,191 ---- return items; } + /** + * Count of all XML documents owned by any account the specified user is a member of (for demo use only). This is otherwise a security violation. + */ + public long countXMLDocuments( long userId ) { + Query query = em.createQuery( "SELECT COUNT(d) FROM DocCCR d, AccountUser au WHERE au.user.id = :userId AND d.account.id = au.account.id"); + query.setParameter("userId", userId); + Long rslt = (Long) query.getSingleResult(); + return rslt.longValue(); + } /** *************** *** 174,177 **** --- 200,213 ---- /** + * Count of all documents owned by this account. + */ + public long countDocuments( long accountId ) { + Query query = em.createQuery( "SELECT COUNT(d) FROM DocBase d where account.id=:account"); + query.setParameter("account", accountId); + Long rslt = (Long) query.getSingleResult(); + return rslt.longValue(); + } + + /** * Count of all photo-documents owned by this account. */ *************** *** 212,220 **** * @param doc * @param accountId of the author - * @return the id assigned to the new document. */ ! public long createImage( DocImage doc, long accountId ) { doc.setAccount(em.getReference( Account.class, accountId )); ! return createDocument( doc ); } --- 248,255 ---- * @param doc * @param accountId of the author */ ! public long createImage( DocImage doc, long userId, long accountId ) { doc.setAccount(em.getReference( Account.class, accountId )); ! return createDocument( doc, userId, accountId ); } *************** *** 231,235 **** public JAXBContext setupJAXBContext() throws JAXBException { if (jc==null) { ! System.out.println( " **************** [DocumentBean]setupJAXBContext **********"); jc = JAXBContext.newInstance( "org.tolven.admin", DocBase.class.getClassLoader() ); } --- 266,270 ---- public JAXBContext setupJAXBContext() throws JAXBException { if (jc==null) { ! // System.out.println( " **************** [DocumentBean]setupJAXBContext **********"); jc = JAXBContext.newInstance( "org.tolven.admin", DocBase.class.getClassLoader() ); } *************** *** 266,270 **** */ public List<AdministrativeDetail> getDetails(DocBase doc) throws JAXBException, IOException { ! System.out.println( "[DocumentBean.getDetails]: " + doc.getContentString()); // Now unmarshal back to an object graph JAXBContext jc = setupJAXBContext(); --- 301,305 ---- */ public List<AdministrativeDetail> getDetails(DocBase doc) throws JAXBException, IOException { ! // System.out.println( "[DocumentBean.getDetails]: " + doc.getContentString()); // Now unmarshal back to an object graph JAXBContext jc = setupJAXBContext(); |
From: John C. <jc...@us...> - 2007-01-16 06:17:10
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15437/src/org/tolven/doc/entity Modified Files: DocCCR.java DocBase.java Log Message: document status changed to lower case Index: DocBase.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity/DocBase.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** DocBase.java 15 Jan 2007 10:15:09 -0000 1.15 --- DocBase.java 16 Jan 2007 06:17:09 -0000 1.16 *************** *** 90,94 **** @Column(name="CONTENT") private byte[] content; ! @Embedded --- 90,94 ---- @Column(name="CONTENT") private byte[] content; ! @Embedded *************** *** 166,173 **** return getDecryptedContent(content); } else { ! return content; ! } } ! /** * Currently assumes all content is encrypted and only the authorized loggedInUser will succeed in getting the readable content --- 166,173 ---- return getDecryptedContent(content); } else { ! return content; } ! } ! /** * Currently assumes all content is encrypted and only the authorized loggedInUser will succeed in getting the readable content *************** *** 218,228 **** return new String(getContent()); } - public void setContent(byte[] content) { if (System.getProperty("tolven.security.keys.activate") != null) { this.content = getEncryptedContent(content); } else { ! this.content = content; ! } } --- 218,227 ---- return new String(getContent()); } public void setContent(byte[] content) { if (System.getProperty("tolven.security.keys.activate") != null) { this.content = getEncryptedContent(content); } else { ! this.content = content; ! } } *************** *** 276,280 **** } /** ! * Either "NEW" or "ACTIVE". * @return */ --- 275,279 ---- } /** ! * Either "new" or "active". * @return */ *************** *** 286,292 **** this.status = status; } ! public boolean isEditable() { ! return ("NEW".equals(getStatus())); } --- 285,294 ---- this.status = status; } ! /** ! * If the status is new, then the document is editable ! * @return ! */ public boolean isEditable() { ! return ("new".equals(getStatus())); } Index: DocCCR.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/entity/DocCCR.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DocCCR.java 3 Oct 2006 03:14:43 -0000 1.3 --- DocCCR.java 16 Jan 2007 06:17:09 -0000 1.4 *************** *** 116,120 **** return newCCR; } - System.out.println( "Returning CCR Binding root: " + getId()); return (ContinuityOfCareRecord)getBinding(); } --- 116,119 ---- *************** *** 156,160 **** */ public void createCCR( String OID ) throws CCRException { - if (getStatus()==null) setStatus("NEW"); checkEditable(); newCCR = new ContinuityOfCareRecord(); --- 155,158 ---- |
From: John C. <jc...@us...> - 2007-01-16 06:14:27
|
Update of /cvsroot/tolven/tolvenEJB In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14969 Modified Files: build.xml Log Message: Add jboss-rules to build. Index: build.xml =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/build.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** build.xml 10 Jan 2007 08:51:56 -0000 1.13 --- build.xml 16 Jan 2007 06:14:26 -0000 1.14 *************** *** 21,24 **** --- 21,30 ---- <include name="*.jar"/> </fileset> + <fileset dir="${jboss-rules.location}"> + <include name="*.jar"/> + </fileset> + <fileset dir="${jboss-rules.location}"> + <include name="lib/*.jar"/> + </fileset> <fileset dir="${httpcore.location}"> <include name="lib/*.jar"/> *************** *** 90,93 **** --- 96,110 ---- </fileset> </copy> + <copy toDir="${tolvenEJB.location}/build/lib" overwrite="true" preservelastmodified="true"> + <fileset dir="${jboss-rules.location}" > + <include name="*.jar"/> + <include name="lib/*.jar"/> + </fileset> + </copy> + <copy toDir="${tolvenEJB.location}/build/lib" overwrite="true" preservelastmodified="true"> + <fileset dir="${jboss-rules.location}/lib" > + <include name="*.jar"/> + </fileset> + </copy> </target> |
From: John C. <jc...@us...> - 2007-01-16 06:13:37
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/ccr In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14577/src/test/org/tolven/ccr Modified Files: Demog.java Log Message: New unit tests Index: Demog.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/test/org/tolven/ccr/Demog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Demog.java 28 Aug 2006 19:37:36 -0000 1.3 --- Demog.java 16 Jan 2007 06:13:35 -0000 1.4 *************** *** 12,18 **** import org.tolven.ccr.*; - import org.tolven.ccr.ObjectFactory; ! import test.org.tolven.rim.ControlActTests; public class Demog extends TestCase { --- 12,17 ---- import org.tolven.ccr.*; ! import test.org.tolven.rim.xml.ControlActTests; public class Demog extends TestCase { *************** *** 41,45 **** public static ContinuityOfCareRecord createCCR() { ! ObjectFactory factory = new ObjectFactory(); ContinuityOfCareRecord ccr = factory.createContinuityOfCareRecord(); ContinuityOfCareRecord.Body body = factory.createContinuityOfCareRecordBody(); --- 40,44 ---- public static ContinuityOfCareRecord createCCR() { ! ObjectFactory factory = ObjectFactory.getInstance(); ContinuityOfCareRecord ccr = factory.createContinuityOfCareRecord(); ContinuityOfCareRecord.Body body = factory.createContinuityOfCareRecordBody(); |
From: John C. <jc...@us...> - 2007-01-16 06:13:37
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/rim/xml In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14577/src/test/org/tolven/rim/xml Added Files: ControlActTests.java XMLTestBase.java STTest.java Log Message: New unit tests --- NEW FILE: XMLTestBase.java --- package test.org.tolven.rim.xml; import java.io.IOException; import java.io.StringWriter; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import org.tolven.rim.ControlAct; import org.tolven.rim.ObjectFactory; import org.tolven.rim.PQ; import org.tolven.rim.SLISTPQ; import junit.framework.TestCase; public abstract class XMLTestBase extends TestCase{ private static JAXBContext jc; public static final String BINDING = "org.tolven.rim"; public JAXBContext setupJAXBContext() throws JAXBException { if (jc==null) { System.out.println( "loading " + BINDING ); jc = JAXBContext.newInstance( BINDING, ControlActTests.class.getClassLoader() ); } return jc; } public String marshal( JAXBElement top) throws JAXBException, IOException { JAXBContext jc = setupJAXBContext(); Marshaller m = jc.createMarshaller(); m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE ); m.setProperty( Marshaller.JAXB_FRAGMENT, Boolean.TRUE ); // m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://xxx" ); StringWriter result = new StringWriter( 1000 ); m.marshal( top, result ); result.close(); return result.toString(); } } --- NEW FILE: ControlActTests.java --- /* * Copyright (C) 2006 Tolven Inc * * This library is free software; you can redistribute it and/or modify it under the terms of * the GNU Lesser General Public License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Contact: in...@to... */ package test.org.tolven.rim.xml; import java.io.IOException; import java.io.PrintWriter; import java.io.StringReader; import java.io.StringWriter; import java.math.BigInteger; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import org.apache.commons.codec.binary.Base64; import org.tolven.rim.*; import junit.framework.TestCase; import javax.xml.namespace.QName; import javax.xml.transform.stream.StreamSource; public class ControlActTests extends XMLTestBase { public String marshalControlAct(ControlAct cact ) throws JAXBException, IOException { JAXBContext jc = setupJAXBContext(); JAXBElement<ControlAct> top = (new ObjectFactory()).createControlAct(cact); Marshaller m = jc.createMarshaller(); m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE ); // m.setProperty( Marshaller.JAXB_FRAGMENT, Boolean.TRUE ); // m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://xxx" ); StringWriter result = new StringWriter( 1000 ); m.marshal( top, result ); result.close(); return result.toString(); } static String controlActControl = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<controlAct moodCode=\"EVN\" classCode=\"CACT\" xmlns=\"urn:tolven-org:rim:1.0\">\n" + " <participation typeCode=\"AUT\">\n" + " <noteText representation=\"TXT\" mediaType=\"text/plain\">This is a note</noteText>\n" + " <role statusCode=\"active\" classCode=\"IDENT\"/>\n" + " </participation>\n" + "</controlAct>\n\n"; public String addControlActAndMarshal(Act act ) throws JAXBException, IOException { ControlAct cact = new ControlAct(); cact.setClassCode( ActClass.CACT ); cact.setMoodCode( ActMood.EVN); OutboundActRelationship ar = new OutboundActRelationship(); ar.setTypeCode(ActRelationshipType.SUBJ); ar.setTarget( act ); cact.getOutboundRelationship().add(ar); String rslt = marshalControlAct( cact ); return rslt; } /** * This test is quite strict - it depends on the exact format of the marshalled XML string but at least it will alert us * to a potential problem. * @throws JAXBException * @throws IOException */ public void testControlActXML() throws JAXBException, IOException { ControlAct cact = new ControlAct(); cact.setClassCode( ActClass.CACT ); cact.setMoodCode( ActMood.EVN) ; Role role = new Role(); role.setClassCode( RoleClass.IDENT); role.setStatusCode( RoleStatus.ACTIVE ); ActParticipation p = new ActParticipation(); p.setTypeCode(ParticipationType.AUT); p.setRole( role ); ED note = new ED(); note.setMediaType("text/plain"); note.getContent().add("This is a note"); note.setRepresentation(BinaryDataEncoding.TXT); p.setNoteText(note); cact.getParticipation().add(p); String rslt = marshalControlAct( cact ); System.out.println(rslt); assertTrue(controlActControl.equals( rslt )); } static byte [] someBinaryData = "1234abcdefXYZ--<<12345\"67890987654321".getBytes(); public void testObservation() throws JAXBException, IOException { Observation obs = new Observation(); obs.setClassCode( ActClass.OBS ); obs.setMoodCode( ActMood.EVN) ; obs.setCloneName( "testObs" ); CE icode = new CE(); icode.setCode("NORMAL"); icode.setCodeSystem("LOINC"); obs.getInterpretationCode().add( icode ); ST stvalue = new ST(); stvalue.setContent("This is the value of this observation as a string"); obs.getValue().add(stvalue); INT intvalue = new INT(); intvalue.setValue(BigInteger.valueOf(12345)); obs.getValue().add(intvalue); // Binary attribute. ED edvalue = new ED(); edvalue.setRepresentation(BinaryDataEncoding.B_64); byte[] b64str = Base64.encodeBase64(someBinaryData); edvalue.getContent().add( new String(b64str) ); obs.getValue().add( edvalue ); // Create a patient role and add participation to patient to act. Role role = new Patient(); role.setClassCode( RoleClass.PAT); role.setStatusCode( RoleStatus.ACTIVE ); ActParticipation p = new ActParticipation(); p.setTypeCode(ParticipationType.SBJ); p.setRole( role ); // Annotate the participation ED note = new ED(); note.setMediaType("text/plain"); note.getContent().add("This is a note"); note.setRepresentation(BinaryDataEncoding.TXT); p.setNoteText(note); // Add the Role and partifcipation to the act. obs.getParticipation().add(p); String xml = addControlActAndMarshal(obs); System.out.println(xml); { // Now unmarshal back to an object graph JAXBContext jc = setupJAXBContext(); Unmarshaller u = jc.createUnmarshaller(); JAXBElement<ControlAct> o = (JAXBElement<ControlAct>) u.unmarshal( new StreamSource( new StringReader( xml ) ) ); // Dig down and get the binary value of the observation and see if it comes back same as we put in. ControlAct cact2 = o.getValue(); OutboundActRelationship ar2 = cact2.getOutboundRelationship().get(0); Observation obs2 = (Observation) ar2.getTarget(); for (Object v : obs2.getValue()) { if (v instanceof ED) { String content2 = ((ED)v).getContent().get(0).toString(); byte[] edvalue2b = Base64.decodeBase64(content2.getBytes()); assertTrue( edvalue2b.length==someBinaryData.length); for( int x = 0;x < edvalue2b.length; x++ ) assertTrue( edvalue2b[x]==someBinaryData[x]); } } } } } --- NEW FILE: STTest.java --- package test.org.tolven.rim.xml; import java.io.IOException; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.namespace.QName; import org.tolven.rim.ST; public class STTest extends XMLTestBase { // For testing only private final static QName _ST_QNAME = new QName("ST"); public void testSTxml1( ) throws JAXBException, IOException { ST st = new ST(); st.setContent("A Sample string1"); JAXBElement top = new JAXBElement<ST>(_ST_QNAME, ST.class, st); String rslt = marshal( top ); System.out.println( "ST xml: " + rslt); } public void testSTxml2( ) throws JAXBException, IOException { ST st = new ST(); st.setContent("A Sample string2"); st.setMediaType("text/plain"); JAXBElement top = new JAXBElement<ST>(_ST_QNAME, ST.class, st); String rslt = marshal( top ); System.out.println( "ST xml: " + rslt); } public void testSTxml3( ) throws JAXBException, IOException { ST st = new ST(); st.setContent("A Sample string3"); st.setMediaType("text/plain"); st.setLanguage("en"); JAXBElement top = new JAXBElement<ST>(_ST_QNAME, ST.class, st); String rslt = marshal( top ); System.out.println( "ST xml: " + rslt); } } |
From: John C. <jc...@us...> - 2007-01-16 06:13:37
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/rim In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14577/src/test/org/tolven/rim Removed Files: ControlActTests.java Log Message: New unit tests --- ControlActTests.java DELETED --- |
From: John C. <jc...@us...> - 2007-01-16 06:13:33
|
Update of /cvsroot/tolven/tolvenEJB/src/test/org/tolven/rim/xml In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14566/src/test/org/tolven/rim/xml Log Message: Directory /cvsroot/tolven/tolvenEJB/src/test/org/tolven/rim/xml added to the repository |
From: John C. <jc...@us...> - 2007-01-16 06:12:50
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14465/src/org/tolven/app/bean Modified Files: ECHRBean.java MenuBean.java Added Files: MenuDataWrapper.java MenuDataFactory.java Log Message: Changes associated with new DataGenerator --- NEW FILE: MenuDataFactory.java --- package org.tolven.app.bean; import javax.annotation.EJB; import javax.ejb.Local; import javax.ejb.Stateless; import org.tolven.app.MenuDataFactoryLocal; import org.tolven.app.MenuLocal; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.core.entity.Account; import org.tolven.doc.DocumentLocal; import org.tolven.doc.entity.DocBase; /** * Factory that creates MenuDataWrapper instances either for new MenuData items or to * wrap existing MenuDataItems fetched from the database. * MenuData items are generic. MenuDataWrappers are specific to a purpose. * For example, a Patient object. * <p>This bean uses MenuBean for all persistence and query operations.</p> * @author John Churin */ @Stateless public class MenuDataFactory implements MenuDataFactoryLocal { @EJB DocumentLocal docBean; @EJB MenuLocal menuBean; /** * Simple get instance method * @return */ public static MenuDataFactory getInstance() { return new MenuDataFactory(); } /** * This method makes the document behind a menuDataItem, if any, accessible via the * menuDataWrapper. * @return The unlocked document */ public DocBase UnlockDocument( MenuDataWrapper menuDataWrapper) { if (menuDataWrapper==null) throw new IllegalArgumentException( "Missing MenuData"); // If already unlocked, we're done if (menuDataWrapper.isDocumentUnlocked()) return menuDataWrapper.getUnlockedDocument(); // Even if there is no document, note that we've unlocked it menuDataWrapper.setDocumentUnlocked(true); long documentId = menuDataWrapper.getMenuData().getDocumentId(); if (documentId==0) return null; menuDataWrapper.setUnlockedDocument(docBean.findDocument(documentId)); return menuDataWrapper.getUnlockedDocument(); } /** * Create a MenuDataWrapper for a new MenuDataItem. * @param account * @throws ClassNotFoundException * @throws IllegalAccessException * @throws InstantiationException */ public MenuDataWrapper create( Account account, String path) throws InstantiationException, IllegalAccessException, ClassNotFoundException { if (account==null) throw new IllegalArgumentException( "Null Account"); MenuStructure ms = menuBean.findMenuStructure(account.getId(), path); // If the metadata says we have a class, use it. Otherwise, create a generic // wrapper. String className = null; // ms.getClassName(); if ("echr:patient".equals(path)) { className = "org.tolven.app.emr.CHRPatient"; } else if ("ephr:patient".equals(path)) { className = "org.tolven.app.emr.PHRPatient"; } Class clazz; // if (className==null) { // clazz = MDGeneric.class; // } else { clazz = Class.forName(className); // } return create( ms, clazz); } /** * Create a MenuDataWrapper for a new MenuDataItem. * @param account * @throws ClassNotFoundException * @throws IllegalAccessException * @throws InstantiationException */ public MenuDataWrapper create( MenuStructure ms, Class clazz) throws InstantiationException, IllegalAccessException, ClassNotFoundException { MenuDataWrapper mdw; mdw = (MenuDataWrapper) clazz.newInstance(); MenuData md = new MenuData(); md.setAccount(ms.getAccount()); md.setMenuStructure(ms); mdw.setMenuData(md); return mdw; } /** * Starting from an existing wrapper, create a new child object. The specified path must be relative to the parent. For example, * if the parent MenuDataWrapper is the patient, a child might be: "hx:problems" * @param parent * @param path * @return * @throws ClassNotFoundException * @throws IllegalAccessException * @throws InstantiationException */ public MenuDataWrapper createChild( MenuDataWrapper parent, String path ) throws InstantiationException, IllegalAccessException, ClassNotFoundException { MenuData parentMS = parent.getMenuData(); if (parentMS==null) throw new NullPointerException( "Parent does not have MenuData"); MenuStructure ms = menuBean.findDescendentMenuStructure( parentMS.getAccount().getId(), parentMS.getMenuStructure(), path ); // If the metadata says we have a specific wrapper class, use it. Otherwise, create a generic // wrapper. String className = null; // ms.getClassName(); Class clazz; // if (className==null) { // clazz = MDGeneric.class; // } else { clazz = Class.forName(className); // } MenuDataWrapper mdw = create( ms, clazz); // if (className==null) { // mdw = new MDGeneric(); // } else { mdw = (MenuDataWrapper) Class.forName(className).newInstance(); // } MenuData md = new MenuData(); md.setAccount(parent.getMenuData().getAccount()); md.setMenuStructure(ms); mdw.setMenuData(md); return mdw; } /** * Create a MenuDataWrapper based on an existing MenuData item * @param menuData * @throws ClassNotFoundException * @throws IllegalAccessException * @throws InstantiationException */ public MenuDataWrapper wrap( MenuData menuData ) throws InstantiationException, IllegalAccessException, ClassNotFoundException { if (menuData==null) throw new IllegalArgumentException( "Null MenuData item"); MenuStructure ms = menuData.getMenuStructure(); if (ms==null) throw new NullPointerException( "MenuData does not have MenuStructure"); String className = null; // ms.getClassName(); MenuDataWrapper mdw; // if (className==null) { // mdw = new MDGeneric(); // } else { mdw = (MenuDataWrapper) Class.forName(className).newInstance(); // } mdw.setMenuData(menuData); return mdw; } } Index: MenuBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuBean.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** MenuBean.java 4 Dec 2006 08:57:01 -0000 1.39 --- MenuBean.java 16 Jan 2007 06:12:47 -0000 1.40 *************** *** 29,32 **** --- 29,33 ---- import org.tolven.app.entity.MenuStructure; import org.tolven.core.entity.Account; + import org.tolven.doc.DocumentLocal; import org.tolven.doc.entity.DocBase; *************** *** 54,57 **** --- 55,59 ---- private EntityManager em; + /** * @see MenuLocal *************** *** 94,98 **** query.setParameter( "id", id ); query.setParameter( "accountId", ctrl.getMenuStructure().getAccount().getId() ); ! System.out.println( "[MenuBean] Looking for menuDataItem with key: " + id + " for account: " + id ); query.setMaxResults(2); List<MenuData> items = query.getResultList(); --- 96,100 ---- query.setParameter( "id", id ); query.setParameter( "accountId", ctrl.getMenuStructure().getAccount().getId() ); ! System.out.println( "[MenuBean] Looking for menuDataItem with key: " + id + " for account: " + ctrl.getMenuStructure().getAccount().getId() ); query.setMaxResults(2); List<MenuData> items = query.getResultList(); *************** *** 141,146 **** if ( !(value instanceof String) ) throw new IllegalArgumentException( "Filter value of " + col.getHeading() + " must be a string"); if (((String)value).length() > 0) { ! qs.append( " AND lower(md." + colName + ") LIKE :fltr" + filterValues.size() ); ! filterValues.add( ((String)value).trim().toLowerCase()+"%" ); } } --- 143,151 ---- if ( !(value instanceof String) ) throw new IllegalArgumentException( "Filter value of " + col.getHeading() + " must be a string"); if (((String)value).length() > 0) { ! qs.append( " AND lower(md." + colName + ") BETWEEN :fltr" + filterValues.size() + " AND :fltr" + (filterValues.size()+1) ); ! filterValues.add( ((String)value).trim().toLowerCase() ); ! filterValues.add( ((String)value).trim().toLowerCase() + "zzzzzzzzzzzzzzzzzzzzzzzzzzzz" ); ! // qs.append( " AND lower(md." + colName + ") LIKE :fltr" + filterValues.size() ); ! // filterValues.add( ((String)value).trim().toLowerCase()+"%" ); } } *************** *** 158,162 **** // System.out.println( "Alternate column name=" + colName); } ! qs.append(colName); qs.append(" "); qs.append(ctrl.getSortDirection()); --- 163,171 ---- // System.out.println( "Alternate column name=" + colName); } ! if (colName.startsWith("string")) { ! qs.append("lower(");qs.append(colName);qs.append(")"); ! } else { ! qs.append(colName); ! } qs.append(" "); qs.append(ctrl.getSortDirection()); *************** *** 271,275 **** em.persist( new MSColumn( activity, 1, "Date", "date01", "d MMM yyyy") ); em.persist( new MSColumn( activity, 2, "For", "parent01", "string01") ); ! em.persist( new MSColumn( activity, 3, "Action", "string02", null) ); em.persist( new MSColumn( activity, 4, "RequestedBy", "string03", null) ); em.persist( new MSColumn( activity, 5, "Priority", "long01", null) ); --- 280,284 ---- em.persist( new MSColumn( activity, 1, "Date", "date01", "d MMM yyyy") ); em.persist( new MSColumn( activity, 2, "For", "parent01", "string01") ); ! em.persist( new MSColumn( activity, 3, "Action", "reference", "string02") ); em.persist( new MSColumn( activity, 4, "RequestedBy", "string03", null) ); em.persist( new MSColumn( activity, 5, "Priority", "long01", null) ); *************** *** 304,313 **** root.getAccount(), patients, "dmpats.xhtml", null, 3, "dm", "Diabetes Registry", "true", "echr:patient", "tab" ); em.persist( dmpats ); ! em.persist( new MSColumn( dmpats, 1, "Diagnosis", "reference", "string03") ); ! em.persist( new MSColumn( dmpats, 2, "Last", "string01", null) ); ! em.persist( new MSColumn( dmpats, 3, "First", "string02", null) ); ! em.persist( new MSColumn( dmpats, 4, "Onset", "date02", "yyyy") ); ! em.persist( new MSColumn( dmpats, 5, "Age", "date01", "age") ); ! em.persist( new MSColumn( dmpats, 6, "Sex", "string04", null) ); } --- 313,321 ---- root.getAccount(), patients, "dmpats.xhtml", null, 3, "dm", "Diabetes Registry", "true", "echr:patient", "tab" ); em.persist( dmpats ); ! em.persist( new MSColumn( dmpats, 1, "Last", "reference", "string01") ); ! em.persist( new MSColumn( dmpats, 2, "First", "string02", null) ); ! em.persist( new MSColumn( dmpats, 3, "Onset", "date02", "yyyy") ); ! em.persist( new MSColumn( dmpats, 4, "Age", "date01", "age") ); ! em.persist( new MSColumn( dmpats, 5, "Sex", "string04", null) ); } *************** *** 366,370 **** em.persist( new MSColumn( all, 1, "Date", "date01", "d MMM yyyy") ); em.persist( new MSColumn( all, 2, "For", "parent01", "string01") ); ! em.persist( new MSColumn( all, 3, "Action", "string02", null) ); em.persist( new MSColumn( all, 4, "RequestedBy", "string03", null) ); em.persist( new MSColumn( all, 5, "Priority", "long01", null) ); --- 374,378 ---- em.persist( new MSColumn( all, 1, "Date", "date01", "d MMM yyyy") ); em.persist( new MSColumn( all, 2, "For", "parent01", "string01") ); ! em.persist( new MSColumn( all, 3, "Action", "reference", "string02") ); em.persist( new MSColumn( all, 4, "RequestedBy", "string03", null) ); em.persist( new MSColumn( all, 5, "Priority", "long01", null) ); *************** *** 487,491 **** public void addPatientTab ( MenuStructure root ) { Account account = root.getAccount(); ! // Individual patient tab(s) MenuStructure patient = new MenuStructure( account, root, "patient.xhtml", "chartLink.xhtml", 3, "patient", "Patient", "false", "patient", "placeholder" ); --- 495,499 ---- public void addPatientTab ( MenuStructure root ) { Account account = root.getAccount(); ! // Individual patients MenuStructure patient = new MenuStructure( account, root, "patient.xhtml", "chartLink.xhtml", 3, "patient", "Patient", "false", "patient", "placeholder" ); *************** *** 495,499 **** --- 503,517 ---- account, patient, "assessment.xhtml", "assLink.xhtml", -1, "assessment", "Assessment", "false", "assessment", "placeholder" ); em.persist( assessment ); + + MenuStructure problem = new MenuStructure( + account, patient, "problem.xhtml", "probLink.xhtml", -1, "problem", "Problem", "false", "problem", "placeholder" ); + em.persist( problem ); + MenuStructure result = new MenuStructure( + account, patient, "result.xhtml", "resultLink.xhtml", -1, "result", "Result", "false", "result", "placeholder" ); + em.persist( result ); + MenuStructure test = new MenuStructure( + account, result, "test.xhtml", "testLink.xhtml", -1, "test", "Test", "false", "test", "placeholder" ); + em.persist( test ); MenuStructure summary = new MenuStructure( *************** *** 748,771 **** em.persist( demo ); ! MenuStructure gen = new MenuStructure( ! root.getAccount(), demo, "bar2.xhtml", null, 1, "gen", "Generate Data", "true", null, "tab" ); ! em.persist( gen ); ! ! MenuStructure familyHx = new MenuStructure( ! root.getAccount(), gen, "test/testFamily.xhtml", null, 1, "fam", "Families", "true", null, "tab" ); ! em.persist( familyHx ); ! ! MenuStructure familyDetail = new MenuStructure( ! root.getAccount(), familyHx, "test/familyDetail.xhtml", null, 3, "detail", "Family detail", "true", null, "detail" ); ! em.persist( familyDetail ); ! ! MenuStructure people = new MenuStructure( ! root.getAccount(), gen, "test/genPerson.xhtml", null, 2, "people", "People", "true", null, "tab" ); ! em.persist( people ); ! ! MenuStructure patgen = new MenuStructure( ! root.getAccount(), gen, "test/patientGen.xhtml", null, 1, "patgen", "Patients", "true", null, "tab" ); ! em.persist( patgen ); ! MenuStructure perf = new MenuStructure( root.getAccount(), demo, "bar2.xhtml", null, 2, "perf", "Performance", "true", null, "tab" ); --- 766,789 ---- em.persist( demo ); ! // MenuStructure gen = new MenuStructure( ! // root.getAccount(), demo, "bar2.xhtml", null, 1, "gen", "Generate Data", "true", null, "tab" ); ! // em.persist( gen ); ! // ! // MenuStructure familyHx = new MenuStructure( ! // root.getAccount(), gen, "test/testFamily.xhtml", null, 1, "fam", "Families", "true", null, "tab" ); ! // em.persist( familyHx ); ! // ! // MenuStructure familyDetail = new MenuStructure( ! // root.getAccount(), familyHx, "test/familyDetail.xhtml", null, 3, "detail", "Family detail", "true", null, "detail" ); ! // em.persist( familyDetail ); ! // ! // MenuStructure people = new MenuStructure( ! // root.getAccount(), gen, "test/genPerson.xhtml", null, 2, "people", "People", "true", null, "tab" ); ! // em.persist( people ); ! // ! // MenuStructure patgen = new MenuStructure( ! // root.getAccount(), gen, "test/patientGen.xhtml", null, 1, "patgen", "Patients", "true", null, "tab" ); ! // em.persist( patgen ); ! // MenuStructure perf = new MenuStructure( root.getAccount(), demo, "bar2.xhtml", null, 2, "perf", "Performance", "true", null, "tab" ); --- NEW FILE: MenuDataWrapper.java --- package org.tolven.app.bean; import org.tolven.app.MenuLocal; import org.tolven.app.entity.MenuData; import org.tolven.app.entity.MenuStructure; import org.tolven.core.entity.Account; import org.tolven.doc.entity.DocBase; import org.tolven.doc.entity.DocCCR; /** * <p>Instances of this class wrap a MenuData item while in memory providing a context-specific personality to the data index data and the underlying document. * This wrapper is typically used when creating and manipulating MenuData items. Usually not used in * AJAX lists which map directly to the MenuData object and for read only. The only exception is * when drilling down to a specific object since this is the way we get to the encrypted document * underlying the MenuData item.</p> * <p>A subclass must ensure that the wrapper contains no data that can't be recreated from the underlying * MenuData item or the document, if any, underlying the MenuData item.</p> * @author John Churin * */ public abstract class MenuDataWrapper { private transient MenuData menuData; private transient DocBase unlockedDocument; private transient boolean documentUnlocked = false; /** * Get the generic path to the MenuStructure defining this MenuDataItem. This method is not sufficient to get a particular instance of a menu data item. * @return A path such as "echr:patient" */ public abstract String getMSPath(); public MenuData getMenuData() { return menuData; } protected void setMenuData(MenuData menuData) { this.menuData = menuData; } /** * Get the unlocked document associated with this MenuData item. * @return * @throws IllegalArgumentException if the document has not been unlocked. */ protected DocBase getUnlockedDocument() { if (!isDocumentUnlocked()) throw new IllegalArgumentException( "Document is not unlocked"); return unlockedDocument; } protected void setUnlockedDocument(DocBase unlockedDocument) { this.unlockedDocument = unlockedDocument; } protected boolean isDocumentUnlocked() { return documentUnlocked; } protected void setDocumentUnlocked(boolean documentUnlocked) { this.documentUnlocked = documentUnlocked; } /** * Get the current CCR document or null if it isn't CCR * @return */ protected DocCCR getCCR( ) { DocBase doc = getUnlockedDocument(); if (doc instanceof DocCCR) return (DocCCR) doc; return null; } } Index: ECHRBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/ECHRBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ECHRBean.java 15 Nov 2006 07:00:11 -0000 1.2 --- ECHRBean.java 16 Jan 2007 06:12:47 -0000 1.3 *************** *** 19,23 **** import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocCCR; ! import org.tolven.gen.CHRGenerator; /** --- 19,23 ---- import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocCCR; ! import org.tolven.gen.Generator; /** *************** *** 49,53 **** MenuData mdpat = new MenuData(); mdpat.setMenuStructure( mspat ); ! mdpat.setDocument(ccrDoc); ContinuityOfCareRecord ccr = ccrDoc.getCCR(); ActorType pat = ccrDoc.getPatientActor(); --- 49,53 ---- MenuData mdpat = new MenuData(); mdpat.setMenuStructure( mspat ); ! mdpat.setDocumentId(ccrDoc.getId()); ContinuityOfCareRecord ccr = ccrDoc.getCCR(); ActorType pat = ccrDoc.getPatientActor(); |
From: John C. <jc...@us...> - 2007-01-16 06:12:50
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14465/src/org/tolven/gen/util Added Files: FamilyGenerator.java Log Message: Changes associated with new DataGenerator --- NEW FILE: FamilyGenerator.java --- package org.tolven.gen.util; import java.util.Date; import java.util.Random; import org.tolven.gen.entity.FamilyMember; import org.tolven.gen.entity.FamilyUnit; import org.tolven.gen.entity.VirtualPerson; import org.tolven.gen.entity.FamilyMember.FamilyMemberRole; public class FamilyGenerator { private RandomNameGenerator nameGenerator; private LifeSpan lifeSpan; private GeneratePlace placeGenerator; private GenerateCauseOfDeath grimReaper; private Random rng; public FamilyGenerator() { nameGenerator = new RandomNameGenerator(); lifeSpan = new LifeSpan(); placeGenerator = new GeneratePlace(); grimReaper = new GenerateCauseOfDeath(); rng = new Random(); } public VirtualPerson generatePerson( ) throws Exception { // if (!ctx.isCallerInRole("gen")) { // throw new SecurityException( "User [" + ctx.getCallerPrincipal() + "] must be in gen role to call GeneratePerson"); // } // A virtual person object VirtualPerson vPerson = new VirtualPerson(); nameGenerator.generateNewName(vPerson); grimReaper.generateCauseOfDeath( vPerson ); lifeSpan.setLifeSpan( vPerson ); return vPerson; } /** * Create a family. */ public FamilyUnit generateFamily( Date now ) throws Exception { // Start a family FamilyUnit family = new FamilyUnit(); placeGenerator.generateZipCode(family); placeGenerator.generateAddress(family); String primaryGender = null; int primaryAge = 0; // Start with a primary person (we should find a suitable mom or dad in 100 tries) for (int c = 0; c < 100; c++) { VirtualPerson person = generatePerson(); primaryAge = person.getAgeInYears(now); if ( primaryAge < 18 ) continue; family.setFamilyName(person.getLast()); primaryGender = person.getGender(); FamilyMemberRole role; if ("F".equals(person.getGender())) { role = FamilyMember.FamilyMemberRole.MOTHER; } else { role = FamilyMember.FamilyMemberRole.FATHER; } family.addMember( person, role ); break; } // Look for a second person (we may not find one in 10 tries - meaning a single person) for (int c = 0; c < 10; c++) { VirtualPerson person = generatePerson(); int age = person.getAgeInYears( now ); if ( age < 18 ) { // System.out.println( "Rejecting spouse - too young"); continue; } if (primaryGender.equals(person.getGender())) { // System.out.println( "Rejecting spouse - gender"); continue; } int ageDifference = person.getAgeInYears( now )-primaryAge; // If too far apart in age, forget it if (Math.abs( ageDifference) > 10 ) { // System.out.println( "Rejecting spouse - Difference of " + ageDifference + " years"); continue; } // Same last name, add to family person.setLast(family.getFamilyName()); FamilyMemberRole role; if ("F".equals(person.getGender())) { role = FamilyMember.FamilyMemberRole.MOTHER; } else { role = FamilyMember.FamilyMemberRole.FATHER; } family.addMember( person, role ); // System.out.println( "Found suitable spouse (" + family.getFamilyName() + ") after " + c + " failed attempts"); break; } return family; } } |
From: John C. <jc...@us...> - 2007-01-16 06:12:50
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14465/src/org/tolven/app Modified Files: MenuLocal.java Added Files: MenuDataFactoryLocal.java Log Message: Changes associated with new DataGenerator --- NEW FILE: MenuDataFactoryLocal.java --- package org.tolven.app; import org.tolven.app.bean.MenuDataWrapper; import org.tolven.app.entity.MenuData; import org.tolven.core.entity.Account; import org.tolven.doc.entity.DocBase; public interface MenuDataFactoryLocal { /** * This method makes the document behind a menuDataItem, if any, accessible via the * menuDataWrapper. * @return The unlocked document */ public DocBase UnlockDocument( MenuDataWrapper menuDataWrapper); /** * Create a MenuDataWrapper for a new MenuDataItem. * @param account * @throws ClassNotFoundException * @throws IllegalAccessException * @throws InstantiationException */ public MenuDataWrapper create( Account account, String path) throws InstantiationException, IllegalAccessException, ClassNotFoundException; /** * Starting from an existing wrapper, create a new child object. The specified path must be relative to the parent. For example, * if the parent MenuDataWrapper is the patient, a child might be: "hx:problems" * @param parent * @param path * @return * @throws ClassNotFoundException * @throws IllegalAccessException * @throws InstantiationException */ public MenuDataWrapper createChild( MenuDataWrapper parent, String path ) throws InstantiationException, IllegalAccessException, ClassNotFoundException; /** * Create a MenuDataWrapper based on an existing MenuData item * @param menuData * @throws ClassNotFoundException * @throws IllegalAccessException * @throws InstantiationException */ public MenuDataWrapper wrap( MenuData menuData ) throws InstantiationException, IllegalAccessException, ClassNotFoundException; } Index: MenuLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/MenuLocal.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MenuLocal.java 2 Oct 2006 05:30:08 -0000 1.13 --- MenuLocal.java 16 Jan 2007 06:12:48 -0000 1.14 *************** *** 21,24 **** --- 21,25 ---- import java.util.List; + import org.tolven.app.bean.MenuDataWrapper; import org.tolven.app.bean.MenuQueryControl; import org.tolven.app.entity.MenuData; *************** *** 32,35 **** --- 33,37 ---- */ public interface MenuLocal { + /** * Given a Tolven accountId and the path to a menu item, return the corresponding menustructure object. |
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/ccr In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14465/src/org/tolven/ccr Modified Files: ProblemType.java ResultType.java CCRCodedDataObjectType.java DateTimeType.java ObjectFactory.java TestType.java StructuredProductType.java Added Files: MedicationType.java MedicalEquipmentType.java PatientType.java VitalSignType.java StructuredProductTypeWrapper.java ActorReferenceTypeWrapper.java ImmunizationType.java ProviderType.java SupportProviderType.java Log Message: Changes associated with new DataGenerator --- NEW FILE: SupportProviderType.java --- package org.tolven.ccr; public class SupportProviderType extends ActorReferenceTypeWrapper { public SupportProviderType( ContinuityOfCareRecord ccr, ActorReferenceType actorRef ) { super( ccr, actorRef); } } Index: ResultType.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/ccr/ResultType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ResultType.java 20 Jun 2006 16:40:17 -0000 1.1 --- ResultType.java 16 Jan 2007 06:12:47 -0000 1.2 *************** *** 30,34 **** extends CCRCodedDataObjectType { ! @XmlElement(name = "Procedure", namespace = "urn:astm-org:CCR", required = true) protected List<ProcedureType> procedure; --- 30,51 ---- extends CCRCodedDataObjectType { ! public final static String COLLECTION_DATE = "Collection Date"; ! ! public final static String HEMATOLOGY_TYPE = "Hematology"; ! public final static String CHEMISTRY_TYPE = "Chemistry"; ! public final static String SEROLOGY_TYPE = "Serology"; ! public final static String VIROLOGY_TYPE = "Virology"; ! public final static String TOXICOLOGY_TYPE = "Toxicology"; ! public final static String MICROBIOLOGY_TYPE = "Microbology"; ! public final static String PATHOLOGY_TYPE = "Pathology"; ! public final static String IMAGING_X_RAY_TYPE = "Imaging X-ray"; ! public final static String ULTRASOUND_TYPE = "Ultrasound"; ! public final static String CT_TYPE = "CT"; ! public final static String MRI_TYPE = "MRI"; ! public final static String ANGIOGRAPHY_TYPE = "Angiography"; ! public final static String CARDIAC_ECHO_TYPE = "Cardiac Echo"; ! public final static String NUCLEAR_MEDICINE_TYPE = "Nuclear Medicine"; ! public final static String PROCEDURE_TYPE = "Procedure"; ! @XmlElement(name = "Procedure", namespace = "urn:astm-org:CCR", required = true) protected List<ProcedureType> procedure; --- NEW FILE: ProviderType.java --- package org.tolven.ccr; public class ProviderType extends ActorReferenceTypeWrapper { public ProviderType( ContinuityOfCareRecord ccr, ActorReferenceType actorRef ) { super( ccr, actorRef); } } --- NEW FILE: MedicalEquipmentType.java --- package org.tolven.ccr; /** * Simple wrapper class used in rules to distinguish a MedicalEquipment from other objects that also use the StructuredProductType * @author John Churin * */ public class MedicalEquipmentType extends StructuredProductTypeWrapper { public MedicalEquipmentType() { super( ); } public MedicalEquipmentType(StructuredProductType structuredProductType) { super( structuredProductType); } } Index: CCRCodedDataObjectType.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/ccr/CCRCodedDataObjectType.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CCRCodedDataObjectType.java 30 Dec 2006 06:01:31 -0000 1.4 --- CCRCodedDataObjectType.java 16 Jan 2007 06:12:47 -0000 1.5 *************** *** 10,13 **** --- 10,14 ---- import java.util.ArrayList; + import java.util.Date; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; *************** *** 116,119 **** --- 117,200 ---- /** + * Helper to set the object type + */ + public void setTypeText( String type ) { + org.tolven.ccr.CodedDescriptionType tt = ObjectFactory.getInstance().createCodedDescriptionType(); + tt.setText(type); + setType(tt); + + } + /** + * Helper to get the Object type + */ + public String getTypeText() { + org.tolven.ccr.CodedDescriptionType tt = getType(); + if (tt==null) return null; + return tt.getText(); + } + + /** + * This helper function returns only the DataTypeType with a specific type + * @return return the first or only DateType matching the specified type or null if not found + */ + public DateTimeType getDateTimeType(String type) { + for (DateTimeType dtt : getDateTime()) { + if (type.equals( dtt.getType().getText())) return dtt; + } + return null; + } + + /** + * Set the specified type of date time value. + * Duplicates (previos dates of this type) are eliminated. + */ + public void setDateTimeType( String type, Date date) { + while (removeDateTimeType( type )!=null); // Remove existing dates of that type. + DateTimeType dtt = ObjectFactory.getInstance().createDateTimeType(); + dtt.setDateValue(date); + CodedDescriptionType dateTimeTypeType = ObjectFactory.getInstance().createCodedDescriptionType(); + dateTimeTypeType.setText(type); + dtt.setType(dateTimeTypeType); + getDateTime().add(dtt); + } + + /** + * Remove the first instance of the specified DateTime or null if it doesn't exist. + * @param type + * @return the item removed + */ + public DateTimeType removeDateTimeType( String type) { + int x = 0; + for (DateTimeType dtt : getDateTime()) { + if (type.equals( dtt.getType().getText())) + { + getDateTime().remove(x); + return dtt; + } + } + return null; + + } + /** + * Helper to set the status text + * @param status + */ + public void setStatusText( String status ) { + org.tolven.ccr.CodedDescriptionType statusField = ObjectFactory.getInstance().createCodedDescriptionType(); + statusField.setText(status); + setStatus(statusField); + } + + /** + * Helper to get the status text + * + */ + public String getStatusText( ) { + org.tolven.ccr.CodedDescriptionType status = getStatus(); + if (status==null) return null; + return status.getText(); + } + + /** * Gets the value of the iDs property. * *************** *** 193,196 **** --- 274,296 ---- /** + * Helper method to get Description text + */ + public String getDescriptionText( ) { + org.tolven.ccr.CodedDescriptionType description = getDescription(); + if (description==null) return null; + return description.getText(); + } + + /** + * Helper method to set description text + */ + public void setDescriptionText( String description ) { + org.tolven.ccr.CodedDescriptionType descriptionField = ObjectFactory.getInstance().createCodedDescriptionType(); + descriptionField.setText(description); + setDescription(descriptionField); + + } + + /** * Gets the value of the status property. * --- NEW FILE: ImmunizationType.java --- package org.tolven.ccr; /** * Simple wrapper class used in rules to distinguish a immunizations from other objects that also use the StructuredProductType * @author John Churin * */ public class ImmunizationType extends StructuredProductTypeWrapper { public ImmunizationType() { super( ); } public ImmunizationType(StructuredProductType structuredProductType) { super( structuredProductType); } } --- NEW FILE: StructuredProductTypeWrapper.java --- package org.tolven.ccr; /** * Simple wrapper class used in rules to distinguish objects that use the StructuredProductType * @author John Churin * */ public abstract class StructuredProductTypeWrapper { private StructuredProductType structuredProductType; public StructuredProductTypeWrapper() { } public StructuredProductTypeWrapper( StructuredProductType structuredProductType) { this.structuredProductType = structuredProductType; } public StructuredProductType getStructuredProductType() { return structuredProductType; } public void setStructuredProductType(StructuredProductType structuredProductType) { this.structuredProductType = structuredProductType; } } --- NEW FILE: PatientType.java --- package org.tolven.ccr; /** * This class is used in Rules to wrap a patient including the actor which * represents that patient. * @author John Churin */ public class PatientType { ActorType actor; public ActorType getActor() { return actor; } public void setActor(ActorType actor) { this.actor = actor; } public PatientType( ContinuityOfCareRecord ccr ) { for (ContinuityOfCareRecord.Patient patient : ccr.getPatient()) { for (ActorType actor : ccr.getActors().getActor()) { if (actor.getActorObjectID().equals(patient.getActorID())) { this.actor = actor; break; } } } } } --- NEW FILE: ActorReferenceTypeWrapper.java --- package org.tolven.ccr; import java.util.List; /** * A wrapper class used in rules to encapsulate an ActorReference. The constructor of this class * derefences the Actor by prividing a directly link to ActorType. It also stores the * a pointer to the actorRoles defined in the ActorReferenceTypes for convenience. * Subclasses of this class indicate which specific type of ActorReference is being described. * @author John Churin */ public abstract class ActorReferenceTypeWrapper { private ActorType actor; private List<CodedDescriptionType> actorRoles; public ActorReferenceTypeWrapper( ContinuityOfCareRecord ccr, ActorReferenceType actorRef ) { if (ccr.getActors()==null) throw new IllegalArgumentException("[ccr] Reference to an actor requires at least one actor"); this.actorRoles = actorRef.getActorRole(); actorRef.getActorID(); for (ActorType actor : ccr.getActors().getActor()) { if (actor.getActorObjectID().equals(actorRef.getActorID())) { this.actor = actor; break; } } } public ActorType getActor() { return actor; } public void setActor(ActorType actor) { this.actor = actor; } public List<CodedDescriptionType> getActorRoles() { return actorRoles; } public void setActorRoles(List<CodedDescriptionType> actorRoles) { this.actorRoles = actorRoles; } } --- NEW FILE: VitalSignType.java --- package org.tolven.ccr; public class VitalSignType { private ResultType result; public VitalSignType( ResultType result) { this.result = result; } public ResultType getResult() { return result; } public void setResult(ResultType result) { this.result = result; } } Index: StructuredProductType.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/ccr/StructuredProductType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StructuredProductType.java 21 Jun 2006 02:29:54 -0000 1.2 --- StructuredProductType.java 16 Jan 2007 06:12:47 -0000 1.3 *************** *** 12,31 **** import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - import org.tolven.ccr.StructuredProductType.FulfillmentHistory; - import org.tolven.ccr.StructuredProductType.FulfillmentInstructions; - import org.tolven.ccr.StructuredProductType.PatientInstructions; - import org.tolven.ccr.StructuredProductType.Product; - import org.tolven.ccr.StructuredProductType.Product.Concentration; - import org.tolven.ccr.StructuredProductType.Product.Form; - import org.tolven.ccr.StructuredProductType.Product.Size; - import org.tolven.ccr.StructuredProductType.Product.Size.Dimensions; - import org.tolven.ccr.StructuredProductType.Product.Size.Dimensions.Dimension; - import org.tolven.ccr.StructuredProductType.Product.Strength; - import org.tolven.ccr.StructuredProductType.Refills; - import org.tolven.ccr.StructuredProductType.Refills.Refill; --- 12,20 ---- import java.util.ArrayList; import java.util.List; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; Index: TestType.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/ccr/TestType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestType.java 21 Jun 2006 02:29:54 -0000 1.2 --- TestType.java 16 Jan 2007 06:12:47 -0000 1.3 *************** *** 35,38 **** --- 35,40 ---- extends CCRCodedDataObjectType { + public final static String RESULT_TYPE = "Result"; + public final static String OBSERVATION_TYPE = "Observation"; @XmlElement(name = "Method", namespace = "urn:astm-org:CCR", required = true) Index: ProblemType.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/ccr/ProblemType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProblemType.java 20 Jun 2006 16:40:16 -0000 1.1 --- ProblemType.java 16 Jan 2007 06:12:47 -0000 1.2 *************** *** 28,31 **** --- 28,39 ---- extends CCRCodedDataObjectType { + public final static String DATE_OF_ONSET = "Date of Onset"; + public final static String PROBLEM_TYPE = "Problem"; + public final static String CONDITION_TYPE = "Condition"; + public final static String DIAGNOSIS_TYPE = "Diagnosis"; + public final static String SYMPTOM_TYPE = "Symptom"; + public final static String FINDING_TYPE = "Finding"; + public final static String COMPLAINT_TYPE = "Complaint"; + public final static String FUNCTIONAL_LIMITATION_TYPE = "Functional Limitation"; @XmlElement(name = "Episodes", namespace = "urn:astm-org:CCR") Index: DateTimeType.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/ccr/DateTimeType.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DateTimeType.java 30 Dec 2006 06:20:54 -0000 1.7 --- DateTimeType.java 16 Jan 2007 06:12:47 -0000 1.8 *************** *** 16,27 **** import java.util.GregorianCalendar; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; ! import org.tolven.ccr.DateTimeType.DateTimeRange; ! import org.tolven.ccr.DateTimeType.DateTimeRange.BeginRange; ! import org.tolven.ccr.DateTimeType.DateTimeRange.EndRange; ! import org.apache.commons.lang.time.*; /** --- 16,27 ---- import java.util.GregorianCalendar; import java.util.List; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; + import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; ! ! import org.apache.commons.lang.time.DateFormatUtils; /** *************** *** 51,56 **** protected List<DateTimeRange> dateTimeRange; ! private transient SimpleDateFormat iso8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZZ"); ! private transient SimpleDateFormat iso8601d = new SimpleDateFormat("yyyy-MM-dd"); /** --- 51,58 ---- protected List<DateTimeRange> dateTimeRange; ! @XmlTransient ! private SimpleDateFormat iso8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZZ"); ! @XmlTransient ! private SimpleDateFormat iso8601d = new SimpleDateFormat("yyyy-MM-dd"); /** --- NEW FILE: MedicationType.java --- package org.tolven.ccr; /** * Simple wrapper class used in rules to distinguish a medication from other objects that also use the StructuredProductType * @author John Churin * */ public class MedicationType extends StructuredProductTypeWrapper { public MedicationType() { super( ); } public MedicationType(StructuredProductType structuredProductType) { super( structuredProductType); } } Index: ObjectFactory.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/ccr/ObjectFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ObjectFactory.java 20 Jun 2006 16:40:17 -0000 1.1 --- ObjectFactory.java 16 Jan 2007 06:12:47 -0000 1.2 *************** *** 111,117 **** * */ ! public ObjectFactory() { } - /** * Create an instance of {@link Authorizations } --- 111,123 ---- * */ ! private ObjectFactory() { ! } ! /** ! * Nothing fancey at this point but this allows us to expand capabaility later. ! * @return ! */ ! public static ObjectFactory getInstance() { ! return new ObjectFactory(); } /** * Create an instance of {@link Authorizations } |
From: John C. <jc...@us...> - 2007-01-16 06:12:49
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14465/src/org/tolven/app/entity Modified Files: MenuStructure.java MenuData.java Log Message: Changes associated with new DataGenerator Index: MenuStructure.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity/MenuStructure.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MenuStructure.java 17 Nov 2006 03:17:36 -0000 1.9 --- MenuStructure.java 16 Jan 2007 06:12:47 -0000 1.10 *************** *** 35,38 **** --- 35,40 ---- import javax.persistence.Table; + import org.hibernate.annotations.Cache; + import org.hibernate.annotations.CacheConcurrencyStrategy; import org.tolven.core.entity.Account; *************** *** 76,79 **** --- 78,82 ---- */ @Entity + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Table(name = "MENU_STRUCTURE", schema="app") public class MenuStructure implements Serializable { Index: MenuData.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/entity/MenuData.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MenuData.java 28 Aug 2006 19:37:36 -0000 1.12 --- MenuData.java 16 Jan 2007 06:12:47 -0000 1.13 *************** *** 78,83 **** private Account account; ! @ManyToOne ! private DocBase document; @Column( name="PARENT_PATH01") --- 78,83 ---- private Account account; ! @Column( name="DOCUMENT_ID") ! private long documentId; @Column( name="PARENT_PATH01") *************** *** 233,237 **** sb.append( " MenuData ID: "); sb.append(getId()); sb.append( " MenuStructure: "); sb.append(getMenuStructure().getId()); - if (getDocument()!=null) {sb.append( " document: "); sb.append(getDocument().getId());} if (getParent01()!=null) {sb.append( " Parent01: "); sb.append(getParent01().toString());} if (getParent02()!=null) {sb.append( " Parent02: "); sb.append(getParent02().toString());} --- 233,236 ---- *************** *** 385,396 **** * One document may affect many MenuData items. For example, a single CBC lab result might have separate * MenuData items for each test value (RBC, WBC, HCT, HGB, etc).</p> ! * @return */ ! public DocBase getDocument() { ! return document; } ! public void setDocument(DocBase document) { ! this.document = document; } --- 384,395 ---- * One document may affect many MenuData items. For example, a single CBC lab result might have separate * MenuData items for each test value (RBC, WBC, HCT, HGB, etc).</p> ! * @return ID of document or zero if no document */ ! public long getDocumentId() { ! return documentId; } ! public void setDocumentId(long documentId) { ! this.documentId = documentId; } |
From: John C. <jc...@us...> - 2007-01-16 06:12:49
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14465/src/org/tolven/gen Modified Files: PersonGeneratorRemote.java PersonGenerator.java Added Files: Generator.java Removed Files: CHRGenerator.java Log Message: Changes associated with new DataGenerator Index: PersonGenerator.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/PersonGenerator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PersonGenerator.java 4 Dec 2006 08:57:38 -0000 1.5 --- PersonGenerator.java 16 Jan 2007 06:12:47 -0000 1.6 *************** *** 48,66 **** */ public void generateAddress( FamilyUnit family) throws IOException; - /** - * Generate a family - * @param now - * @return - * @throws Exception - */ - public FamilyUnit generateFamily( Date now ) throws Exception; ! /** ! * Add members of a family to our account, but only those that have been born. ! * TODO: Add unborn people to the scheduler to be added on the day of the blessed event! ! */ ! public void adoptFamily( long familyId, long accountId, String path, Date now ); ! ! /** * Return a count of the number of virtual persons are in the database. */ --- 48,53 ---- */ public void generateAddress( FamilyUnit family) throws IOException; ! /** * Return a count of the number of virtual persons are in the database. */ Index: PersonGeneratorRemote.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/PersonGeneratorRemote.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PersonGeneratorRemote.java 28 Sep 2006 19:13:28 -0000 1.1 --- PersonGeneratorRemote.java 16 Jan 2007 06:12:47 -0000 1.2 *************** *** 14,22 **** package org.tolven.gen; - import java.util.Date; - import java.util.List; - - import org.tolven.gen.entity.FamilyMember; - import org.tolven.gen.entity.FamilyUnit; import org.tolven.gen.entity.VirtualPerson; --- 14,17 ---- --- NEW FILE: Generator.java --- /* * Copyright (C) 2006 Tolven Inc * * This library is free software; you can redistribute it and/or modify it under the terms of * the GNU Lesser General Public License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Contact: in...@to... */ package org.tolven.gen; import javax.jms.JMSException; import org.tolven.gen.bean.GenControlBase; public interface Generator { /** * Queue the generation of one or more clinical data events * @param invitation * @throws JMSException */ public void queueGeneration(GenControlBase control) throws JMSException; } --- CHRGenerator.java DELETED --- |