Ignore:
Timestamp:
Feb 1, 2011, 1:54:18 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #291: Personal information registration

Implemented first step with input fields for Case name and Personal number. The personal number is validated and when everything seems ok the second step with patient information is displayed. Existing patient information should be verified and for new patients some information needs to be entered. Functions for validating and going to the next step are not yet implemented.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
10 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/build.xml

    r1282 r1283  
    5454      <fileset dir="." includes="README,LICENSE,RELEASE,build.xml" />
    5555      <fileset dir="." includes="src/**,resources/**,META-INF/**" />
    56       <fileset dir="." includes="lib/compile/*" />
     56      <fileset dir="." includes="lib/reggie/*" />
    5757      <fileset file="${jar.name}" />
    5858    </copy>
     
    9292    >
    9393    <fail unless="base.home" message="base.home is not set to the path of BASE installation." />
    94     <copy todir="${base.home}/www/WEB-INF/extensions" file="${jar.name}" />
     94    <copy todir="${base.home}/www/WEB-INF/extensions">
     95      <fileset dir="." includes="lib/reggie/*" />
     96      <fileset file="${jar.name}" />
     97    </copy>
     98   
    9599  </target>
    96100 
     
    113117      <compilerarg value="${javac.arg}" />
    114118    </javac>
    115     <copy todir="${build}">
    116       <fileset dir="." includes="META-INF/*" />
    117       <fileset dir="." includes="resources/**" />
    118     </copy>
    119119    <jar
    120120      jarfile="${jar.name}"
    121       basedir="${build}"
     121      manifest="META-INF/MANIFEST.MF"
    122122      >
     123      <fileset dir="${build}" />
     124      <fileset dir="." includes="META-INF/**" />
     125      <fileset dir="." includes="resources/**" />
    123126    </jar>
    124127  </target>
  • extensions/net.sf.basedb.reggie/trunk/resources/index.jsp

    r1282 r1283  
    2727<base:body>
    2828
    29     <p:path>
    30       <p:pathelement title="Reggie" />
    31     </p:path>
     29  <p:path>
     30    <p:pathelement title="Reggie" />
     31  </p:path>
     32
     33  <table border="0" cellspacing="0" cellpadding="0" width="100%">
     34  <tr valign="top">
     35    <td width="50%">
     36 
     37    <h3 class="light">Reggie wizards</h3>
     38    <div class="boxedbottom">
     39      <ul>
     40      <li><a href="persinfo.jsp?ID=<%=ID%>">Personal information registration</a>
     41      </ul>
     42   
     43    </div>
     44    </td>
     45    <td width="50%">
     46    </td>
     47  </tr>
     48  </table>
    3249
    3350
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/Reggie.java

    r1282 r1283  
    11package net.sf.basedb.reggie;
     2
     3import java.util.List;
     4
     5import net.sf.basedb.core.Annotatable;
     6import net.sf.basedb.core.AnnotationSet;
     7import net.sf.basedb.core.AnnotationType;
     8import net.sf.basedb.core.DbControl;
     9import net.sf.basedb.core.Include;
     10import net.sf.basedb.core.InvalidDataException;
     11import net.sf.basedb.core.Item;
     12import net.sf.basedb.core.ItemNotFoundException;
     13import net.sf.basedb.core.ItemQuery;
     14import net.sf.basedb.core.Type;
     15import net.sf.basedb.core.query.Expressions;
     16import net.sf.basedb.core.query.Hql;
     17import net.sf.basedb.core.query.Restrictions;
    218
    319/**
     
    824{
    925
     26  /**
     27    The name of the "Personal number" annotation type, used
     28    to store 12-digit personal number for biosources. The
     29    number should be unique and is stored as a string.
     30  */
     31  public static final String PERSONAL_NUMBER = "PersonalNumber";
     32 
     33  public static final String FAMILY_NAME = "FamilyName";
     34 
     35  public static final String ALL_FIRST_NAMES = "AllFirstNames";
     36 
     37  public static final String GENDER = "Gender";
     38 
     39  public static final String DATE_OF_BIRTH = "DateOfBirth";
     40 
     41  public static final String LATERALITY = "Laterality";
     42 
     43 
     44  public static AnnotationType findAnnotationType(DbControl dc, Item itemType, String name)
     45  {
     46    ItemQuery<AnnotationType> query = AnnotationType.getQuery(itemType);
     47    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.parameter("name", name, Type.STRING)));
     48    query.include(Include.ALL);
     49    List<AnnotationType> result = query.list(dc);
     50    if (result.size() == 0)
     51    {
     52      throw new ItemNotFoundException("AnnotationType["+name+"]");
     53    }
     54    else if (result.size() > 1)
     55    {
     56      throw new InvalidDataException("Found > 1 AnnotationType["+name+"]");
     57    }
     58    return result.get(0);
     59  }
     60 
     61  public static Object getAnnotationValue(Annotatable item, AnnotationType at)
     62  {
     63    if (!item.isAnnotated()) return null;
     64    AnnotationSet as = item.getAnnotationSet();
     65    if (!as.hasAnnotation(at)) return null;
     66    return as.getAnnotation(at).getValues().get(0);
     67  }
     68 
    1069}
Note: See TracChangeset for help on using the changeset viewer.