Changeset 455


Ignore:
Timestamp:
May 24, 2010, 11:48:40 PM (14 years ago)
Author:
keesvb
Message:

Reverting Subject optimization as it breaks the study create wizard on adding Subjects, added help texts to Bootstrap and icons to study create wizard, added new text to home, added help texts to study create wizard pages

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r454 r455  
    2222                // Ontologies must be connected to the templatefields in runtime
    2323                // because the Ontology.findByNcboId is not available otherwise
    24                 TemplateEntity.getField( Subject.domainFields, 'species' ).ontologies = [Ontology.findByNcboId(1132)]
     24                //TemplateEntity.getField( Subject.domainFields, 'species' ).ontologies = [Ontology.findByNcboId(1132)]
    2525                TemplateEntity.getField( Sample.domainFields, 'material' ).ontologies = [Ontology.findByNcboId(1005)]
    2626
     
    163163                        def genderField = new TemplateField(
    164164                                name: 'Gender',type: TemplateFieldType.STRINGLIST,
    165                                 listEntries: [new TemplateFieldListItem(name:'Male'),new TemplateFieldListItem(name: 'Female')])
     165                                listEntries: [new TemplateFieldListItem(name:'Male'),new TemplateFieldListItem(name: 'Female'),new TemplateFieldListItem(name: 'Unknown')])
    166166                        .with { if (!validate()) { errors.each { println it} } else save()}
    167167
    168168                        def ageField = new TemplateField(
    169                                 name: 'Age (years)',type: TemplateFieldType.INTEGER,unit: 'years')
     169                                name: 'Age',type: TemplateFieldType.INTEGER,unit: 'years',comment: 'Either include age at the start of the study or date of birth (if known)')
    170170                        .with { if (!validate()) { errors.each { println it} } else save()}
    171171
    172172                        def genotypeField = new TemplateField(
    173                                 name: 'Genotype', type: TemplateFieldType.ONTOLOGYTERM)
     173                                name: 'Genotype', type: TemplateFieldType.ONTOLOGYTERM,
     174                                comment: 'If present, indicate the genetic variance of the subject (the gene knock-out/in or transgene)')
    174175                        .with { if (!validate()) { errors.each { println it} } else save()}
    175176
     
    179180                                        new TemplateFieldListItem(name:'transgenic'),
    180181                                        new TemplateFieldListItem(name:'knock-out'),
    181                                         new TemplateFieldListItem(name:'knock-in')])
     182                                        new TemplateFieldListItem(name:'knock-in')],
     183                                comment: 'If a genotype was specified, please indicate here the type of the genotype') 
    182184                        .with { if (!validate()) { errors.each { println it} } else save()}
    183185
     
    188190                        def studyTemplate = new Template(
    189191                                name: 'Academic study', entity: dbnp.studycapturing.Study)
    190                                 .addToFields(new TemplateField(name: 'Description',type: TemplateFieldType.TEXT))
    191                                 .addToFields(new TemplateField(name: 'Study code',type: TemplateFieldType.STRING, preferredIdentifier:true))
    192                                 .addToFields(new TemplateField(name: 'Objectives',type: TemplateFieldType.TEXT))
    193                                 .addToFields(new TemplateField(name: 'Consortium',type: TemplateFieldType.STRING))
    194                                 .addToFields(new TemplateField(name: 'Cohort name',type: TemplateFieldType.STRING))
    195                                 .addToFields(new TemplateField(name: 'Time zone',type: TemplateFieldType.STRING))
    196                                 .addToFields(new TemplateField(name: 'Responsible scientist',type: TemplateFieldType.STRING))
    197                                 .addToFields(new TemplateField(name: 'Lab id',type: TemplateFieldType.STRING))
    198                                 .addToFields(new TemplateField(name: 'Institute',type: TemplateFieldType.STRING))
     192                                .addToFields(new TemplateField(name: 'Description',type: TemplateFieldType.TEXT,comment:'Describe here the type of subjects and the treatment, challenges and sampling.'))
     193                                .addToFields(new TemplateField(
     194                                        name: 'Study code',
     195                                        type: TemplateFieldType.STRING,
     196                                        preferredIdentifier:true,
     197                                        comment: 'Fill out the code by which many people will recognize your study'))
     198                                .addToFields(new TemplateField(name: 'Objectives',type: TemplateFieldType.TEXT,comment:'Fill out the aim or questions of the study'))
     199                                .addToFields(new TemplateField(name: 'Consortium',type: TemplateFieldType.STRING,comment:'If the study was performed within a consortium (e.g. NMC, NuGO), you can indicate this here'))
     200                                .addToFields(new TemplateField(name: 'Cohort name',type: TemplateFieldType.STRING,comment:'If a cohort was used the name or code of the cohort can be define here (define a cohort template)'))
     201                                //.addToFields(new TemplateField(name: 'Time zone',type: TemplateFieldType.STRING,comment:'In the database the local time will be stored. This field is essential to be able to generalize time.'))
     202                                .addToFields(new TemplateField(name: 'Responsible scientist',type: TemplateFieldType.STRING,comment:'Fill out the project leader of principle investigator of the study. (soon to be replaced with persons input)'))
     203                                .addToFields(new TemplateField(name: 'Lab id',type: TemplateFieldType.STRING,comment:'In which lab was the study performed; indicate the roomnumber.'))
     204                                .addToFields(new TemplateField(name: 'Institute',type: TemplateFieldType.STRING,comment:'In which institute was the study performed; indicate the full address information (to be replaced by persons-affiliations?)'))
    199205                        .with { if (!validate()) { errors.each { println it} } else save()}
    200206
     
    204210                                name: 'Mouse', entity: dbnp.studycapturing.Subject)
    205211                        .addToFields(new TemplateField(
    206                                 name: 'Strain', type: TemplateFieldType.ONTOLOGYTERM))
     212                                name: 'Strain', type: TemplateFieldType.ONTOLOGYTERM, ontologies: [nciOntology], comment: "This is an ontology term, if the right strain is not in the list please add it with 'add more'"))
    207213                        .addToFields(genotypeField)
    208214                        .addToFields(genotypeTypeField)
    209215                        .addToFields(genderField)
    210216                        .addToFields(new TemplateField(
    211                                 name: 'Age (weeks)', type: TemplateFieldType.INTEGER, unit: 'weeks'))
     217                                name: 'Age', type: TemplateFieldType.INTEGER, unit: 'weeks', comment: 'Age at start of study'))
    212218                        .addToFields(new TemplateField(
    213219                                name: 'Age type',type: TemplateFieldType.STRINGLIST,
    214220                                listEntries: [new TemplateFieldListItem(name:'postnatal'),new TemplateFieldListItem(name:'embryonal')]))
    215221                        .addToFields(new TemplateField(
    216                                 name: 'Cage',type: TemplateFieldType.STRING))
    217                         .addToFields(new TemplateField(
    218                                 name: '#Mice in cage',type: TemplateFieldType.INTEGER))
    219                         .addToFields(new TemplateField(
    220                                 name: 'Litter size',type: TemplateFieldType.INTEGER))
    221                         .addToFields(new TemplateField(
    222                                 name: 'Weight (g)', type: TemplateFieldType.DOUBLE, unit: 'gram'))
     222                                name: 'Cage',type: TemplateFieldType.STRING,comment:'Indicate the cage used for housing (type and/or size)'))
     223                        .addToFields(new TemplateField(
     224                                name: '#Mice in cage',type: TemplateFieldType.INTEGER,comment:'If known, indicate the number of mice per cage'))
     225                        .addToFields(new TemplateField(
     226                                name: 'Litter size',type: TemplateFieldType.INTEGER,comment:'If known, indicate the litter size of the litter from which the subject originates'))
     227                        .addToFields(new TemplateField(
     228                                name: 'Weight', type: TemplateFieldType.DOUBLE, unit: 'gram',comment:'If known indicate the weight of the subject in grams at the start of the study'))
    223229                        .with { if (!validate()) { errors.each { println it} } else save()}
    224230
     
    230236                        .addToFields(ageField)
    231237                        .addToFields(new TemplateField(
    232                                 name: 'DOB',type: TemplateFieldType.DATE))
     238                                name: 'DOB',type: TemplateFieldType.DATE,comment:'Date of birth'))
    233239                        .addToFields(new TemplateField(
    234240                                name: 'Height',type: TemplateFieldType.DOUBLE, unit: 'm'))
    235241                        .addToFields(new TemplateField(
    236                                 name: 'Weight (kg)',type: TemplateFieldType.DOUBLE, unit: 'kg'))
    237                         .addToFields(new TemplateField(
    238                                 name: 'BMI',type: TemplateFieldType.DOUBLE, unit: 'kg/m2'))
    239                         .addToFields(new TemplateField(
    240                                 name: 'Race',type: TemplateFieldType.STRING))
    241                         .addToFields(new TemplateField(
    242                                 name: 'Waist circumference',type: TemplateFieldType.FLOAT, unit: 'cm'))
    243                         .addToFields(new TemplateField(
    244                                 name: 'Hip circumference',type: TemplateFieldType.FLOAT, unit: 'cm'))
    245                         .addToFields(new TemplateField(
    246                                 name: 'Systolic blood pressure',type: TemplateFieldType.FLOAT, unit: 'mmHg'))
    247                         .addToFields(new TemplateField(
    248                                 name: 'Diastolic blood pressure',type: TemplateFieldType.FLOAT, unit: 'mmHg'))
    249                         .addToFields(new TemplateField(
    250                                 name: 'Heart rate',type: TemplateFieldType.FLOAT, unit: 'beats/min'))
    251                         .addToFields(new TemplateField(
    252                                 name: 'Run-in-food',type: TemplateFieldType.TEXT))
     242                                name: 'Weight',type: TemplateFieldType.DOUBLE, unit: 'kg'))
     243                        .addToFields(new TemplateField(
     244                                name: 'BMI',type: TemplateFieldType.DOUBLE, unit: 'kg/m2',comment:'Body-mass-index'))
     245                        .addToFields(new TemplateField(
     246                                name: 'Race',type: TemplateFieldType.STRING,comment:'If known and of interest the ethnic group can be indicated'))
     247                        .addToFields(new TemplateField(
     248                                name: 'Waist circumference',type: TemplateFieldType.FLOAT, unit: 'cm',comment:'The waist circumference is measured just above the hip bone. Indicate the measure at the start of the study.'))
     249                        .addToFields(new TemplateField(
     250                                name: 'Hip circumference',type: TemplateFieldType.FLOAT, unit: 'cm',comment:'The hip circumference is measured at the level of the two bony prominences front of the hips. Indicate the measure at the start of the study.'))
     251                        .addToFields(new TemplateField(
     252                                name: 'Systolic blood pressure',type: TemplateFieldType.FLOAT, unit: 'mmHg',comment:'Indicate the levels at the start of the study in mmHG'))
     253                        .addToFields(new TemplateField(
     254                                name: 'Diastolic blood pressure',type: TemplateFieldType.FLOAT, unit: 'mmHg',comment:'Indicate the levels at the start of the study in mmHG'))
     255                        .addToFields(new TemplateField(
     256                                name: 'Heart rate',type: TemplateFieldType.FLOAT, unit: 'beats/min',comment:'Indicate the heart rate at the start of in study in beats per minute'))
     257                        .addToFields(new TemplateField(
     258                                name: 'Run-in-food',type: TemplateFieldType.TEXT,comment:'If defined, give a short description of the food used before the measurements'))
    253259                        .with { if (!validate()) { errors.each { println it} } else save()}
    254260
     
    545551                                        .setFieldValue("Gender", "Male")
    546552                                        .setFieldValue("Genotype", c57bl6Term)
    547                                         .setFieldValue("Age (weeks)", 17)
     553                                        .setFieldValue("Age", 17)
    548554                                        .setFieldValue("Cage", "" + (int)(x/2))
    549555                                        .with { if (!validate()) { errors.each { println it} } else save(flush:true)}
     
    626632                                        .setFieldValue("Gender", (Math.random() > 0.5) ? "Male" : "Female")
    627633                                        .setFieldValue("DOB", new java.text.SimpleDateFormat("dd-mm-yy").parse("01-02-19" + (10 + (int) (Math.random() * 80))))
    628                                         .setFieldValue("Age (years)", 30)
     634                                        .setFieldValue("Age", 30)
    629635                                        .setFieldValue("Height", Math.random() * 2F)
    630                                         .setFieldValue("Weight (kg)", Math.random() * 150F)
     636                                        .setFieldValue("Weight", Math.random() * 150F)
    631637                                        .setFieldValue("BMI", 20 + Math.random() * 10F)
    632638                                        .with { if (!validate()) { errors.each { println it} } else save()}
  • trunk/grails-app/domain/dbnp/studycapturing/Study.groovy

    r453 r455  
    3030                        new TemplateField(
    3131                                name: 'startDate',
    32                                 type: TemplateFieldType.DATE)
     32                                type: TemplateFieldType.DATE,
     33                                comment: 'Fill out the official start date or date of first action')
    3334                ]
    3435
  • trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy

    r454 r455  
    2121         * @return List
    2222         */
    23         List<TemplateField> giveDomainFields() { return Subject.domainFields }
    24         static List<TemplateField> domainFields =
     23        List<TemplateField> giveDomainFields() {
    2524                [
    2625                        new TemplateField(
    2726                                name: 'name',
    2827                                type: TemplateFieldType.STRING,
    29                                 preferredIdentifier: true),
     28                                preferredIdentifier: true,
     29                                comment: 'Use the local subject name or the pre-defined name'),
    3030                        new TemplateField(
    3131                                name: 'species',
    32                                 type: TemplateFieldType.ONTOLOGYTERM)
     32                                type: TemplateFieldType.ONTOLOGYTERM,
     33                                ontologies: [Ontology.findByNcboId(1132)],
     34                                comment: "The species name is based on the NEWT ontology; if a species is missing, please add it to the ontology using 'add more'")
    3335                ]
     36        }
    3437}
  • trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy

    r446 r455  
    727727                        // render template fields
    728728                        entity.giveFields().each() {
    729                                 out << '<div class="' + attrs.get('class') + '">' + it.name + '</div>'
     729                                out << '<div class="' + attrs.get('class') + '">' + it.name + (it.unit ? " (${it.unit})" : '')
     730                                if (it.comment) {
     731                                        out << '<div class="helpIcon"></div>'
     732                                        out << '<div class="helpContent">' + it.comment + '</div>'
     733                                }
     734                                out << '</div>'
    730735                        }
    731736                }
     
    756761                def inputElement= null
    757762
     763                String helpText
     764
    758765                // got a template?
    759766                if (template) {
     
    761768                        entity.giveFields().each() {
    762769                                def fieldValue = entity.getFieldValue(it.name)
     770                                helpText = (it.comment && renderType == 'element') ? it.comment : ''
    763771
    764772                                // output column opening element?
     
    774782                                                        name: prependName + it.escapedName(),
    775783                                                        value: fieldValue
    776                                                 )
     784                                                ){helpText}
    777785                                                break
    778786                                        case 'STRINGLIST':
     
    784792                                                                from: it.listEntries,
    785793                                                                value: fieldValue
    786                                                         )
     794                                                        ){helpText}
    787795                                                } else {
    788796                                                        out << '<span class="warning">no values!!</span>'
     
    800808                                                                value           : fieldValue.toString(),
    801809                                                                ontologies      : it.ontologies
    802                                                         )
     810                                                        ){helpText}
    803811                                                } else {
    804812                                                        out << "$inputElement"(
     
    806814                                                                name            : prependName + it.escapedName(),
    807815                                                                value           : fieldValue.toString()
    808                                                         )
     816                                                        ){helpText}
    809817                                                }
    810818                                                break
     
    852860                                                        value: fieldValue,
    853861                                                        rel: 'date'
    854                                                 )
     862                                                ){helpText}
    855863                                                break
    856864                                        default:
     
    860868                                }
    861869
     870                                // Render comment, if any
     871                                //if (it.comment) {
     872                                //      out << {"$helpText"}
     873                                //}
     874
    862875                                // output column closing element?
    863876                                if (renderType == 'column') {
  • trunk/grails-app/views/home/index.gsp

    r359 r455  
    55    </head>
    66    <body>
    7       Welcome to the first prototype of GSCF, version <b>${meta(name: 'app.version')}</b>. At this moment, there are ${studyCount} studies in the database.
    8       <p><n:isNotLoggedIn>
    9         For this version it is not required to login, but if you login as administrator ( admin / admiN123! ) or user ( user / useR123! ) you can test user functionality.
     7                Welcome to the first prototype of GSCF, version <b>${meta(name: 'app.version')}</b>. At this moment, there are ${studyCount} studies in the database.
     8        <p>
     9        This application will facilitate systems biological research and collaboration between researchers at various locations. This application is a combined effort of NuGO (Nutritional Phenotype Database; van Ommen et al, 2010, Genes and Nutrition) and NMC (Data Support Platform), Eurreca, TNO and NBIC. This study capturing module can be easily linked to assay specific modules and therefore can be reused for new technologies.
     10                This application is built for the easy input/storage and retrieval of studies. Studies can be stored with high detail and the type for information being stored can be field (e.g. human, mouse, plant) specific. Complex designs like studies with multiple doses, sampling time points and challenge tests, can be stored in this system.
     11                Studies will only be accessible for people that are specified by the study owner.
     12    </p>
     13    <p><n:isNotLoggedIn>
     14            To be able to create, view or search studies, please log on or register at the right top corner of this page.
     15        NB: For this (test) version it is not required to login, but if you login as administrator ( admin / admiN123! ) or user ( user / useR123! ) you can test user functionality.
    1016      </n:isNotLoggedIn></p>
     17    Choose from the upper bar whether you would like to create, view or search studies
     18
    1119  </body>
    1220</html>
  • trunk/grails-app/views/wizard/pages/_events.gsp

    r451 r455  
    1818        <span class="info">
    1919                <span class="title">Define all events that occur in your study</span>
    20                 Bla bla bla we need a good help text here ;)
     20                An event is any change ‘forced’ upon a subject, such as treatment, challenge, sampling. Choose an event type an define the different parameters of the event.               
    2121        </span>
    2222
  • trunk/grails-app/views/wizard/pages/_start.gsp

    r359 r455  
    2323        <wizard:ajaxButton name="modify" class="bigbutton" value="Modify an existing study" alt="Modify an existing study" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" />
    2424
     25        <span class="info">
     26                <span class="title">Create a new study via the step-by-step interface</span>
     27                This web interface will guide you through the total incorporation of your study in several steps:
     28                <ul>
     29                        <li>Include all general study information</li>
     30                        <li>Include all subject specific information</li>
     31                        <li>Include all information on all variables of the study (treatment, challenges, sampling etc.)</li>
     32                        <li>Confirmation of all information</li>
     33                </ul>
     34                It is possible to go back and forth in the tool, without losing information. Definitive storage will only occur after the confirmation step.
     35                <span class="title">Create a new study via the spreadsheet importer</span>
     36                You can do this by choosing Studies > Import data in the menu.
     37                This part of the applications will help you to upload large studies. This import function can be used for all study components (study, subject and event information) at once.
     38            <span class="title">Modify an existing study</span>
     39                Only study owners can modify a their own studies. This part of the application can be used to extend the study information, for instance with new measurements.
     40        </span>
     41
    2542        <g:if env="development">
    2643        <span class="info">
  • trunk/grails-app/views/wizard/pages/_study.gsp

    r396 r455  
    1818        <span class="info">
    1919                <span class="title">Define the basic properties of your study</span>
     20                In this step of the step-by-step study capturing tool all the basic information of a study can be filled out.
     21                Keep in mind that the more and the more specific the information that is filled out, the more valuable the system will be.
     22                Only the fields with an asterisks are obligatory.
    2023                Pick the study template of choice (currently a fixed set) and define your study values. In this prototype the
    2124                templated fields (below the 'note' box) are not yet handled so you can leave them empty for now.
     
    2326       
    2427        <wizard:templateElement name="template" description="Template" value="${study?.template}" entity="${dbnp.studycapturing.Study}" addDummy="true" ajaxOnChange="switchTemplate" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" >
    25                 The template to use for this study
     28                Choose the type of study you would like to create.
     29                Depending on the chosen template specific fields can be filled out. If none of the templates contain all the necessary fields, a new template can be defined (based on other templates).
    2630        </wizard:templateElement>
    2731        <g:if test="${study}"><wizard:templateElements entity="${study}" /></g:if>
  • trunk/grails-app/views/wizard/pages/_subjects.gsp

    r399 r455  
    1818        <span class="info">
    1919                <span class="title">Add subjects to your study</span>
    20                 In this screen you can add subjects to your study based on a given template. Note that the 'species' select will probably
    21                 move to the template as an ontology reference and will not be asked anymore.<br/>
    22                 <i>Note that you can edit multiple subjects at once by selecting multpiple rows by either ctrl-clicking them or dragging a selection over them.</i>
     20                Describe the subjects studied with all details available. Use the template that contains the necessary fields. New templates can be defined (based on existing templates).
     21                To add subjects to the study, select the correct species and template, input the number of subjects you want to add, and click 'Add'. They will appear below the 'Add' button.
     22                As multiple species may be studied within one study, there is no hard link between the template and the species.
     23                <br/><i>Note that you can edit multiple subjects at once by selecting multiple rows by either ctrl-clicking them or dragging a selection over them in the space between the fields.</i>
     24                <br/><i>Note that depending on the size of your browser window and the template, additional fields can be reached by the slider at the bottom of the page.</i>         
    2325        </span>
    2426
     
    3032        </wizard:termElement>
    3133        <wizard:templateElement name="template" description="with template" value="" error="template" entity="${dbnp.studycapturing.Subject}" >
    32                 The template to use for this study
     34                The template to use for these subjects
    3335        </wizard:templateElement>
    3436        <wizard:ajaxButtonElement name="add" value="Add" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()">
  • trunk/web-app/css/wizard.css

    r452 r455  
    225225    line-height: 32px;
    226226    text-shadow: 0px 0px 1px #333;
     227}
     228
     229.wizard .header .helpIcon {
     230    display: inline-block;
     231    margin-top: 4px;
     232    background: url(../images/icons/famfamfam/help.png) no-repeat left top;
     233    width: 16px;
     234    height: 16px;
    227235}
    228236
Note: See TracChangeset for help on using the changeset viewer.