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-02-12 07:07:50
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30830/src/org/tolven/gen/util Modified Files: FamilyGenerator.java Log Message: Generate children Index: FamilyGenerator.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/util/FamilyGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FamilyGenerator.java 16 Jan 2007 06:12:48 -0000 1.1 --- FamilyGenerator.java 12 Feb 2007 07:07:45 -0000 1.2 *************** *** 37,96 **** 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; } --- 37,123 ---- return vPerson; } + /** * Create a family. + * If family name is non-null, then we'll take it as the family name of the family otherwise we'll + * use a random name. */ ! public FamilyUnit generateFamily( String familyName, Date now ) throws Exception { ! // Start a family ! FamilyUnit family = new FamilyUnit(); ! placeGenerator.generateZipCode(family); ! placeGenerator.generateAddress(family); ! String primaryGender = null; ! int primaryAge = 0; ! int genKids = 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; ! if (primaryAge < 50) genKids = 3; ! if (primaryAge < 30) genKids = 2; ! if (primaryAge < 20) genKids = 1; ! if (null!=familyName) { ! family.setFamilyName(familyName); ! } else { ! 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; ! } ! ! for (int k = 0; k < 100; k++) { ! if (genKids <= 0) break; ! VirtualPerson person = generatePerson(); ! // Ignore people not yet born ! if (person.getDob().after(now)) continue; ! int age = person.getAgeInYears( now ); ! // Assume kids over 18 take care of their own health care ! if (age > 18) continue; ! // put at least 18 years between mom and oldest kid ! if ((primaryAge-age) < 18 ) continue; ! genKids--; ! person.setLast(family.getFamilyName()); ! family.addMember( person, FamilyMemberRole.CHILD ); ! } return family; } |
From: John C. <jc...@us...> - 2007-02-12 07:07:29
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30806/src/org/tolven/gen/bean Modified Files: GenDriver.java GenControlAccount.java Added Files: GenControlPHRAccount.java GenControlCHRAccount.java Log Message: Modularize data generator around account type Index: GenControlAccount.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean/GenControlAccount.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenControlAccount.java 4 Dec 2006 08:57:38 -0000 1.1 --- GenControlAccount.java 12 Feb 2007 07:07:27 -0000 1.2 *************** *** 14,18 **** package org.tolven.gen.bean; - import java.io.Serializable; /** * Command object directing an MDB to generate patients for an account. Create a number of families and add them to --- 14,17 ---- *************** *** 22,47 **** * */ ! public class GenControlAccount extends GenControlBase implements Serializable { private static final long serialVersionUID = 1L; - private int count; - - public int getCount() { - return count; - } - public void setCount(int count) { - this.count = count; - } - - public String toString() { - StringBuffer sb = new StringBuffer( 200 ); - sb.append( "GenControl Account: "); - sb.append(getChrAccountId()); - sb.append(" Count: "); - sb.append(getCount()); - sb.append( " Now: "); - sb.append(getNow()); - return sb.toString(); - } } --- 21,27 ---- * */ ! public abstract class GenControlAccount extends GenControlBase { private static final long serialVersionUID = 1L; } --- NEW FILE: GenControlCHRAccount.java --- package org.tolven.gen.bean; import java.io.Serializable; public class GenControlCHRAccount extends GenControlAccount implements Serializable{ private int count; public int getCount() { return count; } public void setCount(int count) { this.count = count; } public String toString() { StringBuffer sb = new StringBuffer( 200 ); sb.append( "GenControl CHR Account: "); sb.append(getChrAccountId()); sb.append(" Count: "); sb.append(getCount()); sb.append( " Now: "); sb.append(getNow()); return sb.toString(); } } Index: GenDriver.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/gen/bean/GenDriver.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GenDriver.java 20 Jan 2007 19:23:18 -0000 1.4 --- GenDriver.java 12 Feb 2007 07:07:27 -0000 1.5 *************** *** 86,92 **** public void onMessage(Message msg) { try { ! // Generate families ! if (((ObjectMessage)msg).getObject() instanceof GenControlAccount ) { ! GenControlAccount control = (GenControlAccount) ((ObjectMessage)msg).getObject(); System.out.println("MsgID: " + msg.getJMSMessageID() + " "+ control); FamilyGenerator familyGen = new FamilyGenerator(); --- 86,92 ---- public void onMessage(Message msg) { try { ! // Generate a CHR account with many families ! if (((ObjectMessage)msg).getObject() instanceof GenControlCHRAccount ) { ! GenControlCHRAccount control = (GenControlCHRAccount) ((ObjectMessage)msg).getObject(); System.out.println("MsgID: " + msg.getJMSMessageID() + " "+ control); FamilyGenerator familyGen = new FamilyGenerator(); *************** *** 95,99 **** q.init(connectionFactory, genQueue); while (count < control.getCount()) { ! FamilyUnit family = familyGen.generateFamily(control.getNow()); GenControlFamily familyControl = new GenControlFamily(); familyControl.setFamilyUnit(family); --- 95,99 ---- q.init(connectionFactory, genQueue); while (count < control.getCount()) { ! FamilyUnit family = familyGen.generateFamily(null, control.getNow()); GenControlFamily familyControl = new GenControlFamily(); familyControl.setFamilyUnit(family); *************** *** 109,112 **** --- 109,131 ---- return; } + // Generate a PHR account with one family + if (((ObjectMessage)msg).getObject() instanceof GenControlPHRAccount ) { + GenControlPHRAccount control = (GenControlPHRAccount) ((ObjectMessage)msg).getObject(); + System.out.println("MsgID: " + msg.getJMSMessageID() + " "+ control); + FamilyGenerator familyGen = new FamilyGenerator(); + Queuer q = new Queuer(); + q.init(connectionFactory, genQueue); + FamilyUnit family = familyGen.generateFamily(control.getFamilyName(), control.getNow()); + GenControlFamily familyControl = new GenControlFamily(); + familyControl.setFamilyUnit(family); + familyControl.setChrAccountId(control.getChrAccountId()); + familyControl.setNow(control.getNow()); + familyControl.setUserId(control.getUserId()); + familyControl.setStartYear(control.getStartYear()); + q.send(familyControl); + q.close(); + System.out.println("***Done generating PHR family: " + family.getFamilyName()); + return; + } // Generate data for one family if (((ObjectMessage)msg).getObject() instanceof GenControlFamily ) { --- NEW FILE: GenControlPHRAccount.java --- package org.tolven.gen.bean; import java.io.Serializable; public class GenControlPHRAccount extends GenControlAccount implements Serializable { String familyName; public String getFamilyName() { return familyName; } public void setFamilyName(String familyName) { this.familyName = familyName; } public String toString() { StringBuffer sb = new StringBuffer( 200 ); sb.append( "GenControl PHR Account: "); sb.append(getChrAccountId()); sb.append(" Family Name: "); sb.append(getFamilyName()); sb.append( " Now: "); sb.append(getNow()); return sb.toString(); } } |
From: John C. <jc...@us...> - 2007-02-12 07:06:36
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30390/src/org/tolven/app/bean Modified Files: MenuBean.java Log Message: Fix Appointment and Diabetes registry Index: MenuBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuBean.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** MenuBean.java 10 Feb 2007 17:03:49 -0000 1.46 --- MenuBean.java 12 Feb 2007 07:06:35 -0000 1.47 *************** *** 69,73 **** return item; } catch (RuntimeException e) { ! throw new IllegalArgumentException( "Error finding path" + path + " in account " + accountId, e); } } --- 69,73 ---- return item; } catch (RuntimeException e) { ! throw new IllegalArgumentException( "Error finding path " + path + " in account " + accountId, e); } } *************** *** 327,335 **** root.getAccount(), patients, "dmpats.xhtml", null, 3, "dm", "Diabetes Registry", "true", "echr:patient", "list" ); 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) ); } --- 327,334 ---- root.getAccount(), patients, "dmpats.xhtml", null, 3, "dm", "Diabetes Registry", "true", "echr:patient", "list" ); em.persist( dmpats ); ! em.persist( new MSColumn( dmpats, 1, "Name", "reference", "%s, %s", "string01,string02") ); ! em.persist( new MSColumn( dmpats, 2, "Age", "date01", "age") ); ! em.persist( new MSColumn( dmpats, 3, "Sex", "string04", null) ); ! em.persist( new MSColumn( dmpats, 4, "Onset", "date02", "yyyy") ); } *************** *** 767,777 **** account, pers, "appointments.xhtml", null, 9, "appts", "Appointments", "true", root.getPath() + ":patient:appointment", "list" ); em.persist( appointments ); MenuStructure reminders = new MenuStructure( ! account, pers, "reminders.xhtml", null, 10, "reminders", "Reminders", "true", null, "list" ); em.persist( reminders ); MenuStructure hmaint = new MenuStructure( ! account, pers, "hmaint.xhtml", null, 11, "hmaint", "Health Maint", "true", null, "list" ); em.persist( hmaint ); --- 766,786 ---- account, pers, "appointments.xhtml", null, 9, "appts", "Appointments", "true", root.getPath() + ":patient:appointment", "list" ); em.persist( appointments ); + em.persist( new MSColumn( appointments, 1, "Date", "date01", "d MMM yyyy hh:mm") ); + em.persist( new MSColumn( appointments, 2, "Purpose", "string01", null) ); + em.persist( new MSColumn( appointments, 3, "With", "string02", "age") ); + + MenuStructure pastAppointments = new MenuStructure( + account, pers, "appointments.xhtml", null, 10, "past", "Past", "true", root.getPath() + ":patient:appointment", "list" ); + em.persist( pastAppointments ); + em.persist( new MSColumn( pastAppointments, 1, "Date", "date01", "d MMM yyyy hh:mm") ); + em.persist( new MSColumn( pastAppointments, 2, "Purpose", "string01", null) ); + em.persist( new MSColumn( pastAppointments, 3, "With", "string02", "age") ); MenuStructure reminders = new MenuStructure( ! account, pers, "reminders.xhtml", null, 11, "reminders", "Reminders", "true", null, "list" ); em.persist( reminders ); MenuStructure hmaint = new MenuStructure( ! account, pers, "hmaint.xhtml", null, 12, "hmaint", "Health Maint", "true", null, "list" ); em.persist( hmaint ); |
From: John C. <jc...@us...> - 2007-02-12 07:06:07
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30282/src/org/tolven/doc/bean Modified Files: Evaluator.java Added Files: EvaluateCCRClinical.java EvaluateCCR.java EvaluateCCRPersonal.java Log Message: Modularize evaluator Index: Evaluator.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/doc/bean/Evaluator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Evaluator.java 7 Feb 2007 01:37:50 -0000 1.6 --- Evaluator.java 12 Feb 2007 07:06:05 -0000 1.7 *************** *** 39,42 **** --- 39,44 ---- import org.tolven.ccr.ResultType; import org.tolven.ccr.TestType; + import org.tolven.core.AccountDAOLocal; + import org.tolven.core.entity.Account; import org.tolven.doc.DocumentLocal; import org.tolven.doc.XMLLocal; *************** *** 64,67 **** --- 66,70 ---- public class Evaluator implements MessageListener { + @EJB private AccountDAOLocal accountDAOLocal; @EJB private DocumentLocal documentLocal; @EJB private MenuLocal menuLocal; *************** *** 78,82 **** TolvenMessage tm = (TolvenMessage) ((ObjectMessage)msg).getObject(); // System.out.println( tm.getPayload()); ! if (CCRns.equals(tm.getXmlNS())) processCCR(tm); else if ( TRIMns.equals(tm.getXmlNS())) processTRIM( tm ); // System.out.println( docCCR.getPatientActor().getPerson().getName().getCurrentName().getFamilyString()); --- 81,96 ---- TolvenMessage tm = (TolvenMessage) ((ObjectMessage)msg).getObject(); // System.out.println( tm.getPayload()); ! if (CCRns.equals(tm.getXmlNS())) { ! Account account = accountDAOLocal.findAccount(tm.getAccountId()); ! EvaluateCCR evaluateCCR = null; ! if ("echr".equals(account.getAccountType().getKnownType())) { ! evaluateCCR = new EvaluateCCRClinical( documentLocal, menuLocal, xmlBean ); ! evaluateCCR.process( tm ); ! } ! else if ("ephr".equals(account.getAccountType().getKnownType())) { ! evaluateCCR = new EvaluateCCRPersonal( documentLocal, menuLocal, xmlBean ); ! evaluateCCR.process( tm ); ! } else throw new Exception( "Unknown Account type"); ! } else if ( TRIMns.equals(tm.getXmlNS())) processTRIM( tm ); // System.out.println( docCCR.getPatientActor().getPerson().getName().getCurrentName().getFamilyString()); *************** *** 120,365 **** workingMemory.fireAllRules(); workingMemory.dispose(); ! ! for (ActSlot act : trim.getActs()) { ! if (act instanceof Act ) { ! System.out.println( "TRIM Act: " + ((Act)act).getClassCode() + "-" + ((Act)act).getMoodCode()); ! } ! if (act instanceof ActInternal ) { ! System.out.println( "TRIM Act Internal: " + ((ActInternal)act).getInternalId()); ! } ! if (act instanceof ActNull ) { ! System.out.println( "TRIM Act null, flavor: " + ((ActNull)act).getFlavor()); ! } ! } } - /** - * Process a single CCR message. Verify the account and user - * @param tm A TolvenMessage - * @throws JAXBException - * @throws CCRException - * @throws ParseException - * @throws CCRException - * @throws IOException - * @throws IOException - */ - public void processCCR( TolvenMessage tm ) throws JAXBException, ParseException, CCRException, IOException { - System.out.println( "Processing CCR document for account: " + tm.getAccountId()); - DocCCR docCCR = documentLocal.createCCRDocument( tm.getAuthorId(), tm.getAccountId() ); - docCCR.setContent(tm.getPayload()); - documentLocal.finalizeDocument(docCCR); - // Get type of account - String accountType = docCCR.getAccount().getAccountType().getKnownType(); - if (!"echr".equals(accountType)) return; - ContinuityOfCareRecord ccr = (ContinuityOfCareRecord) xmlBean.unmarshal(tm.getXmlNS(), tm.getPayloadInputStream()); - // All of this will be entities (placeholders in MenuStructure-speak) 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()); - // OK, get started... - ActorType pat = ccr.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(), msPatient, "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 (independent of result) - 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(mdTest); - 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); - - // Extract Appointments - if (ccr.getBody()!=null && ccr.getBody().getEncounters()!=null) { - MenuStructure msAppointment = menuLocal.findDescendentMenuStructure(docCCR.getAccount().getId(), msPatient, "appointment"); - MenuStructure msAppointmentList = menuLocal.findDescendentMenuStructure(docCCR.getAccount().getId(), msPatient, "pers:appts"); - for (EncounterType encounter : ccr.getBody().getEncounters().getEncounter()) { - // Create the problem - MenuData mdAppointment = new MenuData(); - mdAppointment.setMenuStructure( msAppointment ); - mdAppointment.setDocumentId(docCCR.getId()); - mdAppointment.setAccount(docCCR.getAccount()); - mdAppointment.setParent01(mdPatient); - mdAppointment.setString01(encounter.getDescriptionText()); - mdAppointment.setDate01(encounter.getDateTimeType("Encounter DateTime").getDateValue()); - // mdAppointment.setString02(encounter.getStatusText()); - menuLocal.persistMenuData(mdAppointment); - // Add to patient's appointment list - MenuData mdAppointmentList = new MenuData(); - mdAppointmentList.setMenuStructure( msAppointmentList ); - mdAppointmentList.setDocumentId(docCCR.getId()); - mdAppointmentList.setAccount(docCCR.getAccount()); - mdAppointmentList.setParent01(mdPatient); - mdAppointmentList.setString01(encounter.getDescriptionText()); - mdAppointmentList.setDate01(encounter.getDateTimeType("Encounter DateTime").getDateValue()); - // mdAppointmentList.setString02(encounter.getStatusText()); - mdAppointmentList.setReference(mdAppointment); - menuLocal.persistMenuData(mdAppointmentList); - } - } - } } --- 134,151 ---- workingMemory.fireAllRules(); workingMemory.dispose(); ! // The rest is just debugging info ! // for (ActSlot act : trim.getActs()) { ! // if (act instanceof Act ) { ! // System.out.println( "TRIM Act: " + ((Act)act).getClassCode() + "-" + ((Act)act).getMoodCode()); ! // } ! // if (act instanceof ActInternal ) { ! // System.out.println( "TRIM Act Internal: " + ((ActInternal)act).getInternalId()); ! // } ! // if (act instanceof ActNull ) { ! // System.out.println( "TRIM Act null, flavor: " + ((ActNull)act).getFlavor()); ! // } ! // } } } --- NEW FILE: EvaluateCCRClinical.java --- package org.tolven.doc.bean; import java.io.IOException; import java.text.ParseException; import java.util.Date; 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.ContinuityOfCareRecord; import org.tolven.ccr.DateTimeType; import org.tolven.ccr.EncounterType; import org.tolven.ccr.PersonNameType; import org.tolven.ccr.ProblemType; import org.tolven.ccr.ResultType; import org.tolven.ccr.TestType; import org.tolven.core.entity.Account; import org.tolven.doc.DocumentLocal; import org.tolven.doc.XMLLocal; import org.tolven.doc.entity.CCRException; import org.tolven.doc.entity.DocCCR; public class EvaluateCCRClinical extends EvaluateCCR { public EvaluateCCRClinical(DocumentLocal documentLocal, MenuLocal menuLocal, XMLLocal xmlBean) { super(documentLocal, menuLocal, xmlBean); } @Override public void process(TolvenMessage tm) throws CCRException, Exception { System.out.println( "Processing CCR document for account: " + tm.getAccountId()); DocCCR docCCR = documentLocal.createCCRDocument( tm.getAuthorId(), tm.getAccountId() ); docCCR.setContent(tm.getPayload()); documentLocal.finalizeDocument(docCCR); // Get type of account // String accountType = docCCR.getAccount().getAccountType().getKnownType(); ContinuityOfCareRecord ccr = (ContinuityOfCareRecord) xmlBean.unmarshal(tm.getXmlNS(), tm.getPayloadInputStream()); processPatient( docCCR.getAccount(), docCCR.getId(), ccr); } /** * Process a single CCR message. Verify the account and user * @param tm A TolvenMessage * @throws JAXBException * @throws CCRException * @throws ParseException * @throws CCRException * @throws IOException * @throws IOException */ public void processPatient( Account account, long documentId, ContinuityOfCareRecord ccr ) throws JAXBException, ParseException, CCRException, IOException { MenuStructure msPatient = menuLocal.findMenuStructure(account.getId(), "echr:patient"); MenuData mdPatient = new MenuData(); mdPatient.setMenuStructure( msPatient ); mdPatient.setDocumentId(documentId); mdPatient.setAccount(account); // OK, get started... ActorType pat = ccr.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); // Put the patient on the "all patients" list MenuStructure msAllPatients = menuLocal.findMenuStructure(mdPatient.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); processProblems( mdPatient, documentId, ccr); processResults( mdPatient, documentId, ccr); processAppointments( mdPatient, documentId, ccr); } public void processProblems( MenuData mdPatient, long documentId, ContinuityOfCareRecord ccr ) throws JAXBException, ParseException, CCRException, IOException { if (ccr.getBody()==null) return; if (ccr.getBody().getProblems()==null) return; MenuStructure msProblem = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "problem"); MenuStructure msProblemList = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "hx:problems"); MenuStructure msProblemSumm = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "summary:probsum"); MenuStructure msPatientDisease = menuLocal.findMenuStructure(mdPatient.getAccount().getId(), "echr:patients:disease"); MenuStructure msPatientDiabetes = menuLocal.findMenuStructure(mdPatient.getAccount().getId(), "echr:patients:dm"); for (ProblemType problem : ccr.getBody().getProblems().getProblem()) { // Create the problem MenuData mdProblem = new MenuData(); mdProblem.setMenuStructure( msProblem ); mdProblem.setDocumentId(mdPatient.getAccount().getId()); mdProblem.setAccount(mdPatient.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(documentId); mdProblemList.setAccount(mdPatient.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(documentId); mdProblemSumm.setAccount(mdPatient.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(documentId); mdPatientDisease.setAccount(mdPatient.getAccount()); mdPatientDisease.setString01( mdPatient.getString01( )); mdPatientDisease.setString02( mdPatient.getString02( )); mdPatientDisease.setString03(problem.getDescriptionText()); mdPatientDisease.setString04(mdPatient.getString04()); 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(documentId); mdDiabetesList.setAccount(mdPatient.getAccount()); mdDiabetesList.setString01( mdPatient.getString01( )); mdDiabetesList.setString02( mdPatient.getString02( )); mdDiabetesList.setString03(problem.getDescriptionText()); mdDiabetesList.setString04(mdPatient.getString04()); mdDiabetesList.setDate01( mdPatient.getDate01( )); mdDiabetesList.setDate02(problem.getDateTimeType(ProblemType.DATE_OF_ONSET).getDateValue()); mdDiabetesList.setReference(mdPatient); menuLocal.persistMenuData(mdDiabetesList); } } } public void processResults( MenuData mdPatient, long documentId, ContinuityOfCareRecord ccr ) throws JAXBException, ParseException, CCRException, IOException { // Extract Results (in CCR, a ResultType can also be an observation) // We do results if (ccr.getBody()==null) return; if (ccr.getBody().getResults()==null) return; MenuStructure msResult = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "result"); MenuStructure msTest = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "test"); MenuStructure msResultsLab = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "results:lab"); for (ResultType result : ccr.getBody().getResults().getResult()) { // Create the result MenuData mdResult = new MenuData(); mdResult.setMenuStructure( msResult ); mdResult.setDocumentId(documentId); mdResult.setAccount(mdPatient.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 (independent of result) for (TestType test : result.getTest()) { MenuData mdTest = new MenuData(); mdTest.setMenuStructure( msTest ); mdTest.setDocumentId(documentId); mdTest.setAccount(mdPatient.getAccount()); mdTest.setParent01(mdPatient); mdTest.setParent02(mdTest); 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(documentId); mdResultsLab.setAccount(mdPatient.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); } } } public void processAppointments( MenuData mdPatient, long documentId, ContinuityOfCareRecord ccr ) throws JAXBException, ParseException, CCRException, IOException { if (ccr.getBody()==null) return ; if (ccr.getBody().getEncounters()==null) return; MenuStructure msAppointment = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "appointment"); MenuStructure msAppointmentList = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "pers:appts"); MenuStructure msPastAppointmentList = menuLocal.findDescendentMenuStructure(mdPatient.getAccount().getId(), mdPatient.getMenuStructure(), "pers:past"); Date current = new Date(); for (EncounterType encounter : ccr.getBody().getEncounters().getEncounter()) { Date apptDate = encounter.getDateTimeType("Encounter DateTime").getDateValue(); // Create the problem MenuData mdAppointment = new MenuData(); mdAppointment.setMenuStructure( msAppointment ); mdAppointment.setDocumentId(documentId); mdAppointment.setAccount(mdPatient.getAccount()); mdAppointment.setParent01(mdPatient); mdAppointment.setString01(encounter.getDescriptionText()); mdAppointment.setDate01(apptDate); // mdAppointment.setString02(encounter.getStatusText()); menuLocal.persistMenuData(mdAppointment); // Add to patient's appointment list MenuData mdAppointmentList = new MenuData(); if (apptDate.after(current)) { mdAppointmentList.setMenuStructure( msAppointmentList ); } else { mdAppointmentList.setMenuStructure( msPastAppointmentList ); } mdAppointmentList.setDocumentId(documentId); mdAppointmentList.setAccount(mdPatient.getAccount()); mdAppointmentList.setParent01(mdPatient); mdAppointmentList.setString01(encounter.getDescriptionText()); mdAppointmentList.setDate01(apptDate); // mdAppointmentList.setString02(encounter.getStatusText()); mdAppointmentList.setReference(mdAppointment); menuLocal.persistMenuData(mdAppointmentList); } } } --- NEW FILE: EvaluateCCR.java --- package org.tolven.doc.bean; import org.tolven.app.MenuLocal; import org.tolven.doc.DocumentLocal; import org.tolven.doc.XMLLocal; import org.tolven.doc.entity.CCRException; public abstract class EvaluateCCR { protected DocumentLocal documentLocal; protected MenuLocal menuLocal; protected XMLLocal xmlBean; public EvaluateCCR(DocumentLocal documentLocal, MenuLocal menuLocal, XMLLocal xmlBean ) { this.documentLocal = documentLocal; this.menuLocal = menuLocal; this.xmlBean = xmlBean; } public abstract void process( TolvenMessage tm ) throws Exception; } --- NEW FILE: EvaluateCCRPersonal.java --- package org.tolven.doc.bean; import org.tolven.app.MenuLocal; import org.tolven.doc.DocumentLocal; import org.tolven.doc.XMLLocal; public class EvaluateCCRPersonal extends EvaluateCCR { public EvaluateCCRPersonal(DocumentLocal documentLocal, MenuLocal menuLocal, XMLLocal xmlBean) { super(documentLocal, menuLocal, xmlBean); } @Override public void process(TolvenMessage tm) { } } |
From: Joseph I. <jos...@us...> - 2007-02-11 21:19:53
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/security/auth In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31427/src/org/tolven/security/auth Modified Files: KeyLoginModule.java Log Message: Removed an unused if clause Index: KeyLoginModule.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/auth/KeyLoginModule.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeyLoginModule.java 11 Feb 2007 05:55:04 -0000 1.2 --- KeyLoginModule.java 11 Feb 2007 21:19:50 -0000 1.3 *************** *** 105,111 **** group = null; } - if (group == null) { - } else { - } if (group == null) group = new TolvenGroup("Roles"); --- 105,108 ---- |
From: Joseph I. <jos...@us...> - 2007-02-11 05:55:06
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/security/auth In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14815/src/org/tolven/security/auth Modified Files: KeyLoginModule.java Log Message: Remove UserPublicKey from Subject's publicCredenials Index: KeyLoginModule.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/security/auth/KeyLoginModule.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** KeyLoginModule.java 28 Jan 2007 06:52:29 -0000 1.1 --- KeyLoginModule.java 11 Feb 2007 05:55:04 -0000 1.2 *************** *** 33,37 **** import javax.security.auth.spi.LoginModule; - import org.tolven.core.ActivationLocal; import org.tolven.security.LoginLocal; import org.tolven.security.TolvenPrincipal; --- 33,36 ---- *************** *** 191,195 **** } // Remove all UserPublicKey ! for (Iterator iter = subject.getPrivateCredentials(UserPublicKey.class).iterator(); iter.hasNext();) { iter.next(); iter.remove(); --- 190,194 ---- } // Remove all UserPublicKey ! for (Iterator iter = subject.getPublicCredentials(UserPublicKey.class).iterator(); iter.hasNext();) { iter.next(); iter.remove(); |
From: John C. <jc...@us...> - 2007-02-10 17:25:13
|
Update of /cvsroot/tolven/tolvenWEB/web/wizard In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12978/web/wizard Modified Files: wizTemplate.xhtml Log Message: Fix next/prev buttons Index: wizTemplate.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/wizard/wizTemplate.xhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wizTemplate.xhtml 7 Feb 2007 01:40:32 -0000 1.4 --- wizTemplate.xhtml 10 Feb 2007 17:25:05 -0000 1.5 *************** *** 80,85 **** <td align="center" > <input id="#{menu.elementLabel}stopButton" type="submit" value="Stop" style="display:none"/> ! <input id="#{menu.elementLabel}prevButton" type="submit" value="Previous" onclick="prevStep('#{menu.elementLabel}' );self.scrollTo(0, 0);"/> ! <input id="#{menu.elementLabel}nextButton" type="submit" value="Next" onclick="nextStep('#{menu.elementLabel}' );self.scrollTo(0, 0);"/> </td> </tr> --- 80,85 ---- <td align="center" > <input id="#{menu.elementLabel}stopButton" type="submit" value="Stop" style="display:none"/> ! <input id="#{menu.elementLabel}prevButton" type="submit" value="Previous" onclick="prevStep('#{menu.elementLabel}' );self.scrollTo(0, 0);return false;"/> ! <input id="#{menu.elementLabel}nextButton" type="submit" value="Next" onclick="nextStep('#{menu.elementLabel}' );self.scrollTo(0, 0);return false;"/> </td> </tr> |
From: John C. <jc...@us...> - 2007-02-10 17:03:53
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4092/src/org/tolven/app/bean Modified Files: MenuBean.java Log Message: cosmetic only Index: MenuBean.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuBean.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** MenuBean.java 7 Feb 2007 01:37:50 -0000 1.45 --- MenuBean.java 10 Feb 2007 17:03:49 -0000 1.46 *************** *** 14,24 **** package org.tolven.app.bean; - import java.io.ByteArrayInputStream; - import java.io.IOException; - import java.io.InputStream; import java.util.ArrayList; import java.util.List; - import javax.annotation.EJB; import javax.ejb.Local; import javax.ejb.Remote; --- 14,20 ---- *************** *** 34,41 **** import org.tolven.app.entity.MenuStructure; import org.tolven.core.entity.Account; - import org.tolven.doc.DocumentLocal; - import org.tolven.doc.XMLLocal; - import org.tolven.doc.entity.DocBase; - import org.tolven.trim.Trim; /** --- 30,33 ---- *************** *** 283,287 **** /** ! * See if there's a menu structure available for the specified user. * @param user * @return true if at least one item found for this account, otherwise false --- 275,279 ---- /** ! * See if there's a menu structure available for the specified account. * @param user * @return true if at least one item found for this account, otherwise false |
From: Joseph I. <jos...@us...> - 2007-02-08 08:29:31
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20741/src/org/tolven/web/security Modified Files: GeneralSecurityFilter.java Log Message: Removed an unnecessary System.out Index: GeneralSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/GeneralSecurityFilter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GeneralSecurityFilter.java 7 Feb 2007 08:28:45 -0000 1.3 --- GeneralSecurityFilter.java 8 Feb 2007 08:29:30 -0000 1.4 *************** *** 103,107 **** HttpSession session = request.getSession(); TopAction top = (TopAction) session.getAttribute(TOP); - System.out.println(getClass() + " :TOP=" + top); try { if (top == null) { --- 103,106 ---- |
From: Joseph I. <jos...@us...> - 2007-02-08 08:14:22
|
Update of /cvsroot/tolven/tolvenWEB/web/templates In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13844/web/templates Modified Files: portalTemplate.xhtml Log Message: When the SecurityFilters are activated, after a user enters an account, they are only able to create new accounts and select other accounts when they have supplied their login password. Index: portalTemplate.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/templates/portalTemplate.xhtml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** portalTemplate.xhtml 20 Jan 2007 19:43:54 -0000 1.17 --- portalTemplate.xhtml 8 Feb 2007 08:14:21 -0000 1.18 *************** *** 74,77 **** --- 74,80 ---- <li><a href="javascript:getRemoteContent(visiblePage);" >[Refresh]</a></li> </h:panelGroup> + <h:panelGroup rendered="#{top.canSelectAccounts}"> + <li><a href="../vestibule/selectAccount.jsf">Account Selection</a></li> + </h:panelGroup> </ul> </div> |
From: Joseph I. <jos...@us...> - 2007-02-08 08:14:22
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13844/src/org/tolven/web/security Modified Files: VestibuleSecurityFilter.java Log Message: When the SecurityFilters are activated, after a user enters an account, they are only able to create new accounts and select other accounts when they have supplied their login password. Index: VestibuleSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/VestibuleSecurityFilter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VestibuleSecurityFilter.java 7 Feb 2007 08:28:45 -0000 1.3 --- VestibuleSecurityFilter.java 8 Feb 2007 08:14:21 -0000 1.4 *************** *** 195,198 **** --- 195,200 ---- // If user has not been sent on there way by here, take away the user's AccountPrivateKey for the current account if one exists privateKeyRing.setAccountPrivateKey(null); + top.setAccountUser(null); + top.setAccountUserId(0); } catch (PolicyContextException ex) { ex.printStackTrace(); |
From: Joseph I. <jos...@us...> - 2007-02-08 08:14:22
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13844/src/org/tolven/web Modified Files: TopAction.java Log Message: When the SecurityFilters are activated, after a user enters an account, they are only able to create new accounts and select other accounts when they have supplied their login password. Index: TopAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/TopAction.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** TopAction.java 7 Feb 2007 08:28:44 -0000 1.38 --- TopAction.java 8 Feb 2007 08:14:20 -0000 1.39 *************** *** 76,80 **** private int dummyCount; ! /** Creates a new instance of TopAction * @throws NamingException */ --- 76,80 ---- private int dummyCount; ! /** Creates a new instance of TopAction * @throws NamingException */ *************** *** 214,220 **** public void setAccountUser(AccountUser accountUser) throws PolicyContextException, GeneralSecurityException { this.accountUser = accountUser; ! accountUserId = accountUser.getId(); ! // Ensure that this user has a menu structure setup ! menuLocal.createDefaultMenuStructure( accountUser.getAccount() ); } --- 214,224 ---- public void setAccountUser(AccountUser accountUser) throws PolicyContextException, GeneralSecurityException { this.accountUser = accountUser; ! if (accountUser == null) { ! setAccountUserId(0); ! } else { ! accountUserId = accountUser.getId(); ! // Ensure that this user has a menu structure setup ! menuLocal.createDefaultMenuStructure(accountUser.getAccount()); ! } } *************** *** 489,492 **** --- 493,499 ---- } + public boolean getCanSelectAccounts() { + return accountUserId != 0 && "true".equalsIgnoreCase(System.getProperty("tolven.security.filter.activate")); + } } |
From: Joseph I. <jos...@us...> - 2007-02-08 08:14:22
|
Update of /cvsroot/tolven/tolvenWEB/web/vestibule In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13844/web/vestibule Modified Files: password.xhtml Log Message: When the SecurityFilters are activated, after a user enters an account, they are only able to create new accounts and select other accounts when they have supplied their login password. Index: password.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/vestibule/password.xhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** password.xhtml 8 Feb 2007 05:35:23 -0000 1.4 --- password.xhtml 8 Feb 2007 08:14:20 -0000 1.5 *************** *** 8,12 **** <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Cache-Control" content="no-cache" /> ! <title>Logged out of Tolven</title> <link rel="stylesheet" href="#{facesContext.externalContext.request.contextPath}/styles/tolven6.css" --- 8,12 ---- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Cache-Control" content="no-cache" /> ! <title>Password Verification</title> <link rel="stylesheet" href="#{facesContext.externalContext.request.contextPath}/styles/tolven6.css" *************** *** 17,20 **** --- 17,26 ---- <div class="brandt"></div> </div> + <h:form id="logout"> + <h:outputText value="Logged in as #{top.tp.givenName} #{top.tp.sn} "/> + <h:commandLink action="#{top.logout}"> + <h:outputText styleClass="smallText" value="[Log out]" /> + </h:commandLink> + </h:form> <h1>Password Verification</h1> <div class="pane"> |
From: Joseph I. <jos...@us...> - 2007-02-08 05:35:24
|
Update of /cvsroot/tolven/tolvenWEB/web/vestibule In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10829/web/vestibule Modified Files: password.xhtml Log Message: A start for the password verfication page, for when the user requests entry to the createAccount/selectAccount area known as the vestibule. Index: password.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/vestibule/password.xhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** password.xhtml 7 Feb 2007 08:39:00 -0000 1.3 --- password.xhtml 8 Feb 2007 05:35:23 -0000 1.4 *************** *** 6,24 **** xmlns:c="http://java.sun.com/jstl/core"> <head> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Cache-Control" content="no-cache" /> ! <title>Verify Password</title> ! <link rel="stylesheet" ! href="#{facesContext.externalContext.request.contextPath}/styles/tolven6.css" ! type="text/css" /> </head> ! ! <body> ! <ui:composition template="../templates/portalTemplate.xhtml"> ! <ui:define name="content"> ! <h3>Enter Password</h3> ! <h:form id="verifyPassword"> <h:panelGrid columns="2"> ! <h:outputText value="Password"/> <h:panelGroup> <h:inputSecret id="oldUserPassword" value="#{reg.oldUserPassword}" size="50"/> --- 6,26 ---- xmlns:c="http://java.sun.com/jstl/core"> <head> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Cache-Control" content="no-cache" /> ! <title>Logged out of Tolven</title> ! <link rel="stylesheet" ! href="#{facesContext.externalContext.request.contextPath}/styles/tolven6.css" ! type="text/css" /> </head> ! <body> ! <div class="header"> ! <div class="brandt"></div> ! </div> ! <h1>Password Verification</h1> ! <div class="pane"> ! <h:form id="verifyPassword"> ! <h3>Please Enter Your Password</h3> <h:panelGrid columns="2"> ! <h:outputText value="Password:"/> <h:panelGroup> <h:inputSecret id="oldUserPassword" value="#{reg.oldUserPassword}" size="50"/> *************** *** 29,35 **** <h:commandButton action="#{reg.verifyPassword}" value="Submit"/> </h:panelGrid> ! </h:form> ! </ui:define> ! </ui:composition> ! </body> </html> --- 31,36 ---- <h:commandButton action="#{reg.verifyPassword}" value="Submit"/> </h:panelGrid> ! </h:form> ! </div> ! </body> </html> |
From: John C. <jc...@us...> - 2007-02-08 04:47:41
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23201/src/org/tolven/app Modified Files: MenuLocal.java MenuRemote.java Log Message: Add menudata creator methods to rules sandbox Index: MenuRemote.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/MenuRemote.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MenuRemote.java 4 Feb 2007 16:39:58 -0000 1.1 --- MenuRemote.java 8 Feb 2007 04:47:29 -0000 1.2 *************** *** 157,159 **** --- 157,166 ---- public MenuData instantiate( MenuStructure ms, MenuData parent ); + /** + * See if there's a menu structure available for the specified account. + * @param user + * @return true if at least one item found for this account, otherwise false + */ + public MenuStructure getRootMenuStructure( Account account ); + } Index: MenuLocal.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/MenuLocal.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MenuLocal.java 7 Feb 2007 01:37:50 -0000 1.16 --- MenuLocal.java 8 Feb 2007 04:47:29 -0000 1.17 *************** *** 190,192 **** --- 190,199 ---- public int removeReferencingMenuData( long accountId, long documentId); + /** + * See if there's a menu structure available for the specified account. + * @param user + * @return true if at least one item found for this account, otherwise false + */ + public MenuStructure getRootMenuStructure( Account account ); + } |
From: John C. <jc...@us...> - 2007-02-08 04:47:41
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23201/src/org/tolven/app/bean Modified Files: AppEvalAdaptor.java MenuQueryControl.java Log Message: Add menudata creator methods to rules sandbox Index: MenuQueryControl.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuQueryControl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MenuQueryControl.java 21 Aug 2006 00:26:30 -0000 1.5 --- MenuQueryControl.java 8 Feb 2007 04:47:29 -0000 1.6 *************** *** 17,21 **** /** ! * Specific QueryControl used for MenuData queries * @author John Churin * --- 17,21 ---- /** ! * Specific QueryControl used for MenuData queries. Most of the important attributes are in the base class, QueryControl. * @author John Churin * Index: AppEvalAdaptor.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/AppEvalAdaptor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AppEvalAdaptor.java 7 Feb 2007 01:37:50 -0000 1.2 --- AppEvalAdaptor.java 8 Feb 2007 04:47:29 -0000 1.3 *************** *** 23,32 **** private Account account; private MenuLocal menuBean; ! public MenuLocal getMenuBean() { return menuBean; } ! public void setMenuBean(MenuBean menuBean) { this.menuBean = menuBean; } --- 23,37 ---- private Account account; private MenuLocal menuBean; + private String rootName; ! /** ! * Provides access to the appropriate menu Bean to use when accessing data. ! * @return ! */ ! protected MenuLocal getMenuBean() { return menuBean; } ! protected void setMenuBean(MenuBean menuBean) { this.menuBean = menuBean; } *************** *** 57,61 **** * This will allow the rule engine to see facts from application metadata. * In this case, we can just assert all menuStructure objects for this account into WM. We'll let ! * metadata and new data meet up in the rule engine. */ protected void assertAll( WorkingMemory wm ) { --- 62,66 ---- * This will allow the rule engine to see facts from application metadata. * In this case, we can just assert all menuStructure objects for this account into WM. We'll let ! * metadata and new instance data meet up in the rule engine. */ protected void assertAll( WorkingMemory wm ) { *************** *** 68,72 **** } } ! public MenuData findMenuData( MenuStructure ms, String path ) { MenuQueryControl ctrl = new MenuQueryControl(); --- 73,84 ---- } } ! /** ! * Find the menuData item defined by the specified menuStructure and having the path as specified. ! * This method will throw an error if there is more than one MenuData item associated with this path. ! * Therefore, this method only useful for placeholders and perhaps trim items. ! * @param ms ! * @param path ! * @return ! */ public MenuData findMenuData( MenuStructure ms, String path ) { MenuQueryControl ctrl = new MenuQueryControl(); *************** *** 75,80 **** return menuBean.findMenuDataItem(ctrl); } /** ! * Remove all menuData items that reference this document. * @param docBase */ --- 87,95 ---- return menuBean.findMenuDataItem(ctrl); } + /** ! * Remove all menuData items that reference this document. This is usually done to remove traces of ! * the document when it was mutable, such as on to do lists. This function is usually called within the transaction that ! * creates the index items associated with the document in immutable form. * @param docBase */ *************** *** 82,91 **** menuBean.removeReferencingMenuData( getAccount().getId(), docBase.getId()); } ! public Account getAccount() { return account; } ! public void setAccount(Account account) { this.account = account; } --- 97,110 ---- menuBean.removeReferencingMenuData( getAccount().getId(), docBase.getId()); } ! ! /** ! * Return the account object associated with this running of the rules ! * @return ! */ public Account getAccount() { return account; } ! protected void setAccount(Account account) { this.account = account; } *************** *** 112,116 **** --- 131,185 ---- return this.getClass().getName() + " for account " + getAccount().getId(); } + /** + * Create a new menu data item given the menuStructure item + * @param ms + * @param documentId + * @return + */ + public MenuData createMenuData( MenuStructure ms, long documentId ) { + if (getAccount().getId()!=ms.getAccount().getId()) { + throw new IllegalArgumentException( "Illegal to create menu data in another account"); + } + MenuData md = new MenuData(); + md.setMenuStructure(ms); + md.setDocumentId(documentId); + md.setAccount(ms.getAccount()); + return md; + } + /** + * Create a new menu data item given a path name. + * @param path + * @param documentId The associated document or 0 if none. + * @return + */ + public MenuData createMenuData( String path, long documentId ) { + MenuStructure ms = getMenuBean().findMenuStructure(getAccount().getId(), path); + if (null==ms) throw new IllegalArgumentException( "Path " + path + " is not valid for account" + getAccount().getId()); + if (getAccount().getId()!=ms.getAccount().getId()) { + throw new IllegalArgumentException( "Illegal to create menu data in another account"); + } + return createMenuData( ms, documentId); + } + /** + * The root path is available to prepend to other paths when needed. For example, if a given rule is shared between ephr and echr, then + * the rule can simply call this method to get the appropriate root name, and prepend it, along with a colon + * to the rest of the path. + * @return A string containing the name of the root node for this account. eg echr. + */ + public String getRootName( ) { + if (rootName==null) { + rootName = getMenuBean().getRootMenuStructure(getAccount()).getNode(); + } + return rootName; + } + /** + * Save a new MenuData item in the database. It will be assigned a unique Id at this time. + * @param md + */ + public void persistMenuData( MenuData md) { + getMenuBean().persistMenuData(md); + + } } |
From: John C. <jc...@us...> - 2007-02-08 04:43:01
|
Update of /cvsroot/tolven/tolvenClient/src/org/tolven/client In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21155/src/org/tolven/client Modified Files: TolvenClient.java Log Message: Fix one of the hard-coded passwords. Index: TolvenClient.java =================================================================== RCS file: /cvsroot/tolven/tolvenClient/src/org/tolven/client/TolvenClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TolvenClient.java 7 Feb 2007 05:10:50 -0000 1.2 --- TolvenClient.java 8 Feb 2007 04:42:59 -0000 1.3 *************** *** 55,62 **** } ! protected void setupPrivateKeyRing(AccountUser accountUser, Subject subject, UserKeyRing userKeyRing) throws PolicyContextException, GeneralSecurityException, IOException { UserPrivateKey userPrivateKey = null; userPrivateKey = userKeyRing.getUserPrivateKey(); ! userPrivateKey.unlockPrivateKey("cal".toCharArray()); PrivateKeyRing privateKeyRing = new PrivateKeyRing(userPrivateKey); subject.getPrivateCredentials().add(privateKeyRing); --- 55,62 ---- } ! protected void setupPrivateKeyRing(String password, AccountUser accountUser, Subject subject, UserKeyRing userKeyRing) throws PolicyContextException, GeneralSecurityException, IOException { UserPrivateKey userPrivateKey = null; userPrivateKey = userKeyRing.getUserPrivateKey(); ! userPrivateKey.unlockPrivateKey(password.toCharArray()); PrivateKeyRing privateKeyRing = new PrivateKeyRing(userPrivateKey); subject.getPrivateCredentials().add(privateKeyRing); *************** *** 111,115 **** // This isn't actually used because we've commented the decryption below. // if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! // setupPrivateKeyRing( accountUser, lc.getSubject(), loginBean.findUserKeyRing(username) ); // } } --- 111,115 ---- // This isn't actually used because we've commented the decryption below. // if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! setupPrivateKeyRing( password, accountUser, lc.getSubject(), loginBean.findUserKeyRing(username) ); // } } |
From: John C. <jc...@us...> - 2007-02-07 21:06:13
|
Update of /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29494/src/org/tolven/app/bean Modified Files: MenuPath.java Log Message: Add comments Index: MenuPath.java =================================================================== RCS file: /cvsroot/tolven/tolvenEJB/src/org/tolven/app/bean/MenuPath.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MenuPath.java 17 Jan 2007 18:43:06 -0000 1.6 --- MenuPath.java 7 Feb 2007 21:06:08 -0000 1.7 *************** *** 16,20 **** import java.util.HashMap; import java.util.Map; ! public class MenuPath { String pathString; --- 16,38 ---- import java.util.HashMap; import java.util.Map; ! /** ! * <p>A MenuPath object parses and manipulates a single path element. The element can either be for ! * metadata: the "path" of a MenuStructure item, or for instance data: the path of a MenuData item.</p> ! * <p>A metadata path has no identifiers.</p> ! * <pre>echr:patient</pre> ! * <p>A MenuData (instance) item typically does have identifiers.</p> ! * <pre>echr:patient-123</pre> ! * <p>The decision is left to the caller as to how any particular MenuPath is used.</p> ! * <p>Each of the identifiers embedded in a MenuPath item is always a positive long integer (2**64-1) and always corresponds ! * to the surrogate key of a menuData item (in the app.menu_data table). When a path contains multiple ids, such as for a lab result:</p> ! * <pre>echr:patient-123:result-456</pre> ! * <p>Each of the ids can be used independently. In the example, the id 456 is the result and will independently have a parent pointing ! * to the patient 123. So, the ids are simply denormalized (duplicated) into the key to improve query time and to reduce the number of round trips ! * needed in the browser. For example, if the showPane javascipt method were called with the result example above, the patient ! * can also be determined and if not already loaded to the browser, the node can be used to query the patient, without having to ! * wait for the return of the result.</p> ! * @author John Churin ! * ! */ public class MenuPath { String pathString; |
From: Joseph I. <jos...@us...> - 2007-02-07 08:39:03
|
Update of /cvsroot/tolven/tolvenWEB/web/vestibule In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29664/web/vestibule Modified Files: password.xhtml Log Message: When filters are activated, the user now requires a password to enter the vestibule area, unless they have just logged in. Index: password.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/vestibule/password.xhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** password.xhtml 7 Feb 2007 08:38:41 -0000 1.2 --- password.xhtml 7 Feb 2007 08:39:00 -0000 1.3 *************** *** 15,19 **** <body> ! <ui:composition template="../templates/portalTemplage.xhtml"> <ui:define name="content"> <h3>Enter Password</h3> --- 15,19 ---- <body> ! <ui:composition template="../templates/portalTemplate.xhtml"> <ui:define name="content"> <h3>Enter Password</h3> |
From: Joseph I. <jos...@us...> - 2007-02-07 08:38:41
|
Update of /cvsroot/tolven/tolvenWEB/web/vestibule In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29639/web/vestibule Modified Files: password.xhtml Log Message: When filters are activated, the user now requires a password to enter the vestibule area, unless they have just logged in. Index: password.xhtml =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/web/vestibule/password.xhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** password.xhtml 7 Feb 2007 08:28:45 -0000 1.1 --- password.xhtml 7 Feb 2007 08:38:41 -0000 1.2 *************** *** 15,19 **** <body> ! <ui:composition template="../templates/userArea.xhtml"> <ui:define name="content"> <h3>Enter Password</h3> --- 15,19 ---- <body> ! <ui:composition template="../templates/portalTemplage.xhtml"> <ui:define name="content"> <h3>Enter Password</h3> |
From: Joseph I. <jos...@us...> - 2007-02-07 08:28:46
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25359/src/org/tolven/web/security Modified Files: VestibuleSecurityFilter.java GeneralSecurityFilter.java Log Message: When filters are activated, the user now requires a password to enter the vestibule area, unless they have just logged in. Index: VestibuleSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/VestibuleSecurityFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VestibuleSecurityFilter.java 6 Feb 2007 08:18:40 -0000 1.2 --- VestibuleSecurityFilter.java 7 Feb 2007 08:28:45 -0000 1.3 *************** *** 90,99 **** HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; ! System.out.println(getClass() + " :REQUEST=" + request.getRequestURL()); if (!request.isRequestedSessionIdValid()) { logout("INVALID SESSION", request, response); return; } ! Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); if (subject == null) { --- 90,99 ---- HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; ! //System.out.println(getClass() + " :REQUEST=" + request.getRequestURL()); if (!request.isRequestedSessionIdValid()) { logout("INVALID SESSION", request, response); return; } ! Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); if (subject == null) { *************** *** 116,120 **** } String principalName = principal.getName(); ! Set<PrivateKeyRing> privateCredentials = subject.getPrivateCredentials(PrivateKeyRing.class); if (privateCredentials.isEmpty()) { --- 116,120 ---- } String principalName = principal.getName(); ! Set<PrivateKeyRing> privateCredentials = subject.getPrivateCredentials(PrivateKeyRing.class); if (privateCredentials.isEmpty()) { *************** *** 123,127 **** } PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! // PHASE ONE: User Authentication HttpSession session = request.getSession(); --- 123,127 ---- } PrivateKeyRing privateKeyRing = (PrivateKeyRing) privateCredentials.iterator().next(); ! // PHASE ONE: User Authentication HttpSession session = request.getSession(); *************** *** 136,139 **** --- 136,140 ---- user = activation.loginUser(principalName, (Date) request.getAttribute(TOLVEN_NOW)); top.setUser(user); + session.setAttribute("pass", "true"); } if ((user == null || Status.NEW_LOGIN.value().equalsIgnoreCase(user.getStatus())) && request.getParameter(INVITATION_ID) != null) { *************** *** 162,166 **** addKeysToUser(user, subject); } ! // PHASE TWO: Account Authentication String accountUserIdString = request.getParameter(ACCOUNTUSER_ID); --- 163,175 ---- addKeysToUser(user, subject); } ! ! //If the user has a pass, they don't need to supply a password again ! if ("true".equals(session.getAttribute("pass")) || request.getRequestURL().indexOf("password.jsf") != -1) { ! // Let the user have the request ! } else { ! ((HttpServletResponse) servletResponse).sendRedirect("password.jsf"); ! return; ! } ! // PHASE TWO: Account Authentication String accountUserIdString = request.getParameter(ACCOUNTUSER_ID); *************** *** 180,183 **** --- 189,193 ---- privateKeyRing.setAccountPrivateKey(accountUser.getAccountPrivateKey()); top.setAccountUser(accountUser); + session.removeAttribute("pass"); ((HttpServletResponse) servletResponse).sendRedirect("../private/" + accountUser.getAccount().getAccountType().getHomePage()); return; *************** *** 185,193 **** // If user has not been sent on there way by here, take away the user's AccountPrivateKey for the current account if one exists privateKeyRing.setAccountPrivateKey(null); - if (justLoggedIn) { - // Allow through...No password is required - } else { - // sendRedirect to password page - } } catch (PolicyContextException ex) { ex.printStackTrace(); --- 195,198 ---- Index: GeneralSecurityFilter.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/security/GeneralSecurityFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GeneralSecurityFilter.java 6 Feb 2007 08:18:40 -0000 1.2 --- GeneralSecurityFilter.java 7 Feb 2007 08:28:45 -0000 1.3 *************** *** 64,68 **** HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; ! System.out.println(getClass() + " :REQUEST=" + request.getRequestURL()); if (!request.isRequestedSessionIdValid()) { logout("INVALID SESSION", request, response); --- 64,68 ---- HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; ! //System.out.println(getClass() + " :REQUEST=" + request.getRequestURL()); if (!request.isRequestedSessionIdValid()) { logout("INVALID SESSION", request, response); |
From: Joseph I. <jos...@us...> - 2007-02-07 08:28:46
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25359/src/org/tolven/web Modified Files: TopAction.java RegisterAction.java Log Message: When filters are activated, the user now requires a password to enter the vestibule area, unless they have just logged in. Index: TopAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/TopAction.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** TopAction.java 7 Feb 2007 01:51:32 -0000 1.37 --- TopAction.java 7 Feb 2007 08:28:44 -0000 1.38 *************** *** 252,257 **** public TolvenUser getUser() { if (null==user) { ! String principal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal().getName(); ! user = activation.findUser(principal); } return user; --- 252,259 ---- public TolvenUser getUser() { if (null==user) { ! //The VestibuleSecurityFilter calls this method to determine if the user has been set but fails when the call ! // is too early and Faces is not ready. ! //String principal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal().getName(); ! //user = activation.findUser(principal); } return user; Index: RegisterAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/RegisterAction.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** RegisterAction.java 7 Feb 2007 01:50:51 -0000 1.37 --- RegisterAction.java 7 Feb 2007 08:28:44 -0000 1.38 *************** *** 407,410 **** --- 407,431 ---- return "success"; } + + public String verifyPassword() throws Exception { + if (getOldUserPassword() == null || getOldUserPassword().trim().length() == 0) { + FacesContext.getCurrentInstance().addMessage("register:oldUserPassword", new FacesMessage("Password must be supplied")); + return "error"; + } + // Check the password + try { + LoginContext loginContext = new LoginContext("tolvenLDAP", new KeyLdapCallbackHandler(getTp().getUid(), getOldUserPassword().toCharArray())); + loginContext.login(); + loginContext.logout(); + } catch (LoginException ex) { + // Login failed + FacesContext.getCurrentInstance().addMessage("register:oldUserPassword", new FacesMessage("Incorrect password")); + return "error"; + } + HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false); + session.setAttribute("pass", "true"); + return "success"; + } + /** * Upload a photo |
From: Joseph I. <jos...@us...> - 2007-02-07 08:28:46
|
Update of /cvsroot/tolven/tolvenWEB/web/vestibule In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25359/web/vestibule Added Files: password.xhtml Log Message: When filters are activated, the user now requires a password to enter the vestibule area, unless they have just logged in. --- NEW FILE: password.xhtml --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Cache-Control" content="no-cache" /> <title>Verify Password</title> <link rel="stylesheet" href="#{facesContext.externalContext.request.contextPath}/styles/tolven6.css" type="text/css" /> </head> <body> <ui:composition template="../templates/userArea.xhtml"> <ui:define name="content"> <h3>Enter Password</h3> <h:form id="verifyPassword"> <h:panelGrid columns="2"> <h:outputText value="Password"/> <h:panelGroup> <h:inputSecret id="oldUserPassword" value="#{reg.oldUserPassword}" size="50"/> <h:message for="oldUserPassword" errorClass="errorMsg" infoClass="infoMsg" warnClass="warnMsg" fatalClass="fatalMsg"/> </h:panelGroup> </h:panelGrid> <h:panelGrid columns="1"> <h:commandButton action="#{reg.verifyPassword}" value="Submit"/> </h:panelGrid> </h:form> </ui:define> </ui:composition> </body> </html> |
From: John C. <jc...@us...> - 2007-02-07 05:10:51
|
Update of /cvsroot/tolven/tolvenClient/src/org/tolven/client In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8126/src/org/tolven/client Modified Files: TolvenClient.java TestLogin.java Log Message: Actually try to access something before declaring credentially good. Index: TestLogin.java =================================================================== RCS file: /cvsroot/tolven/tolvenClient/src/org/tolven/client/TestLogin.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestLogin.java 7 Feb 2007 01:35:46 -0000 1.1 --- TestLogin.java 7 Feb 2007 05:10:50 -0000 1.2 *************** *** 3,6 **** --- 3,8 ---- import javax.naming.NamingException; + import org.tolven.core.entity.TolvenUser; + public class TestLogin extends TolvenClient { public static final long accountId = 11800; Index: TolvenClient.java =================================================================== RCS file: /cvsroot/tolven/tolvenClient/src/org/tolven/client/TolvenClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TolvenClient.java 7 Feb 2007 01:35:46 -0000 1.1 --- TolvenClient.java 7 Feb 2007 05:10:50 -0000 1.2 *************** *** 21,24 **** --- 21,25 ---- import org.tolven.core.ActivationRemote; import org.tolven.core.entity.AccountUser; + import org.tolven.core.entity.TolvenUser; import org.tolven.doc.DocumentRemote; import org.tolven.security.LoginRemote; *************** *** 103,110 **** accountUser = accountBean.findAccountUser( username, accountId); System.out.println("AccountUser id: " + accountUser.getId()); ! System.out.println("User logged in as:" + lc.getSubject().getPrincipals()); // This isn't actually used because we've commented the decryption below. // if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! setupPrivateKeyRing( accountUser, lc.getSubject(), loginBean.findUserKeyRing(username) ); // } } --- 104,115 ---- accountUser = accountBean.findAccountUser( username, accountId); System.out.println("AccountUser id: " + accountUser.getId()); ! // The lc.login doesn't actually check anything. We need to do something on the server that requires ! // credentials. ! TolvenUser tolvenUser = activationBean.findUser(uid); ! // If we make it this far, the login is valid. ! System.out.println("User logged in as:" + tolvenUser.getLdapUID()); // This isn't actually used because we've commented the decryption below. // if ("true".equalsIgnoreCase(System.getProperty("tolven.security.keys.activate"))) { ! // setupPrivateKeyRing( accountUser, lc.getSubject(), loginBean.findUserKeyRing(username) ); // } } |
From: John C. <jc...@us...> - 2007-02-07 01:51:33
|
Update of /cvsroot/tolven/tolvenWEB/src/org/tolven/web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26629/src/org/tolven/web Modified Files: TopAction.java Log Message: Extra little safety margine in getUser might be useful. Index: TopAction.java =================================================================== RCS file: /cvsroot/tolven/tolvenWEB/src/org/tolven/web/TopAction.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** TopAction.java 6 Feb 2007 09:12:15 -0000 1.36 --- TopAction.java 7 Feb 2007 01:51:32 -0000 1.37 *************** *** 251,254 **** --- 251,258 ---- public TolvenUser getUser() { + if (null==user) { + String principal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal().getName(); + user = activation.findUser(principal); + } return user; } *************** *** 421,425 **** } else { return accountUser.getAccount().getId(); ! } } --- 425,429 ---- } else { return accountUser.getAccount().getId(); ! } } *************** *** 429,433 **** } else { return accountUser.getAccount().getTitle(); ! } } --- 433,437 ---- } else { return accountUser.getAccount().getTitle(); ! } } *************** *** 442,446 **** } else { return accountUser.isAccountPermission(); ! } } --- 446,450 ---- } else { return accountUser.isAccountPermission(); ! } } *************** *** 473,479 **** } else { return accountUser.getAccount().getTimeZone(); - } } ! public String getAccountType() { if(accountUser == null) { --- 477,482 ---- } else { return accountUser.getAccount().getTimeZone(); } ! } public String getAccountType() { if(accountUser == null) { *************** *** 481,485 **** } else { return accountUser.getAccount().getAccountType().getKnownType(); ! } } --- 484,488 ---- } else { return accountUser.getAccount().getAccountType().getKnownType(); ! } } |