Changeset 455
- Timestamp:
- May 24, 2010, 11:48:40 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r454 r455 22 22 // Ontologies must be connected to the templatefields in runtime 23 23 // 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)] 25 25 TemplateEntity.getField( Sample.domainFields, 'material' ).ontologies = [Ontology.findByNcboId(1005)] 26 26 … … 163 163 def genderField = new TemplateField( 164 164 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')]) 166 166 .with { if (!validate()) { errors.each { println it} } else save()} 167 167 168 168 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)') 170 170 .with { if (!validate()) { errors.each { println it} } else save()} 171 171 172 172 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)') 174 175 .with { if (!validate()) { errors.each { println it} } else save()} 175 176 … … 179 180 new TemplateFieldListItem(name:'transgenic'), 180 181 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') 182 184 .with { if (!validate()) { errors.each { println it} } else save()} 183 185 … … 188 190 def studyTemplate = new Template( 189 191 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?)')) 199 205 .with { if (!validate()) { errors.each { println it} } else save()} 200 206 … … 204 210 name: 'Mouse', entity: dbnp.studycapturing.Subject) 205 211 .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'")) 207 213 .addToFields(genotypeField) 208 214 .addToFields(genotypeTypeField) 209 215 .addToFields(genderField) 210 216 .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')) 212 218 .addToFields(new TemplateField( 213 219 name: 'Age type',type: TemplateFieldType.STRINGLIST, 214 220 listEntries: [new TemplateFieldListItem(name:'postnatal'),new TemplateFieldListItem(name:'embryonal')])) 215 221 .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')) 223 229 .with { if (!validate()) { errors.each { println it} } else save()} 224 230 … … 230 236 .addToFields(ageField) 231 237 .addToFields(new TemplateField( 232 name: 'DOB',type: TemplateFieldType.DATE ))238 name: 'DOB',type: TemplateFieldType.DATE,comment:'Date of birth')) 233 239 .addToFields(new TemplateField( 234 240 name: 'Height',type: TemplateFieldType.DOUBLE, unit: 'm')) 235 241 .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')) 253 259 .with { if (!validate()) { errors.each { println it} } else save()} 254 260 … … 545 551 .setFieldValue("Gender", "Male") 546 552 .setFieldValue("Genotype", c57bl6Term) 547 .setFieldValue("Age (weeks)", 17)553 .setFieldValue("Age", 17) 548 554 .setFieldValue("Cage", "" + (int)(x/2)) 549 555 .with { if (!validate()) { errors.each { println it} } else save(flush:true)} … … 626 632 .setFieldValue("Gender", (Math.random() > 0.5) ? "Male" : "Female") 627 633 .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) 629 635 .setFieldValue("Height", Math.random() * 2F) 630 .setFieldValue("Weight (kg)", Math.random() * 150F)636 .setFieldValue("Weight", Math.random() * 150F) 631 637 .setFieldValue("BMI", 20 + Math.random() * 10F) 632 638 .with { if (!validate()) { errors.each { println it} } else save()} -
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r453 r455 30 30 new TemplateField( 31 31 name: 'startDate', 32 type: TemplateFieldType.DATE) 32 type: TemplateFieldType.DATE, 33 comment: 'Fill out the official start date or date of first action') 33 34 ] 34 35 -
trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy
r454 r455 21 21 * @return List 22 22 */ 23 List<TemplateField> giveDomainFields() { return Subject.domainFields } 24 static List<TemplateField> domainFields = 23 List<TemplateField> giveDomainFields() { 25 24 [ 26 25 new TemplateField( 27 26 name: 'name', 28 27 type: TemplateFieldType.STRING, 29 preferredIdentifier: true), 28 preferredIdentifier: true, 29 comment: 'Use the local subject name or the pre-defined name'), 30 30 new TemplateField( 31 31 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'") 33 35 ] 36 } 34 37 } -
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r446 r455 727 727 // render template fields 728 728 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>' 730 735 } 731 736 } … … 756 761 def inputElement= null 757 762 763 String helpText 764 758 765 // got a template? 759 766 if (template) { … … 761 768 entity.giveFields().each() { 762 769 def fieldValue = entity.getFieldValue(it.name) 770 helpText = (it.comment && renderType == 'element') ? it.comment : '' 763 771 764 772 // output column opening element? … … 774 782 name: prependName + it.escapedName(), 775 783 value: fieldValue 776 ) 784 ){helpText} 777 785 break 778 786 case 'STRINGLIST': … … 784 792 from: it.listEntries, 785 793 value: fieldValue 786 ) 794 ){helpText} 787 795 } else { 788 796 out << '<span class="warning">no values!!</span>' … … 800 808 value : fieldValue.toString(), 801 809 ontologies : it.ontologies 802 ) 810 ){helpText} 803 811 } else { 804 812 out << "$inputElement"( … … 806 814 name : prependName + it.escapedName(), 807 815 value : fieldValue.toString() 808 ) 816 ){helpText} 809 817 } 810 818 break … … 852 860 value: fieldValue, 853 861 rel: 'date' 854 ) 862 ){helpText} 855 863 break 856 864 default: … … 860 868 } 861 869 870 // Render comment, if any 871 //if (it.comment) { 872 // out << {"$helpText"} 873 //} 874 862 875 // output column closing element? 863 876 if (renderType == 'column') { -
trunk/grails-app/views/home/index.gsp
r359 r455 5 5 </head> 6 6 <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. 10 16 </n:isNotLoggedIn></p> 17 Choose from the upper bar whether you would like to create, view or search studies 18 11 19 </body> 12 20 </html> -
trunk/grails-app/views/wizard/pages/_events.gsp
r451 r455 18 18 <span class="info"> 19 19 <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. 21 21 </span> 22 22 -
trunk/grails-app/views/wizard/pages/_start.gsp
r359 r455 23 23 <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()" /> 24 24 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 25 42 <g:if env="development"> 26 43 <span class="info"> -
trunk/grails-app/views/wizard/pages/_study.gsp
r396 r455 18 18 <span class="info"> 19 19 <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. 20 23 Pick the study template of choice (currently a fixed set) and define your study values. In this prototype the 21 24 templated fields (below the 'note' box) are not yet handled so you can leave them empty for now. … … 23 26 24 27 <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). 26 30 </wizard:templateElement> 27 31 <g:if test="${study}"><wizard:templateElements entity="${study}" /></g:if> -
trunk/grails-app/views/wizard/pages/_subjects.gsp
r399 r455 18 18 <span class="info"> 19 19 <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> 23 25 </span> 24 26 … … 30 32 </wizard:termElement> 31 33 <wizard:templateElement name="template" description="with template" value="" error="template" entity="${dbnp.studycapturing.Subject}" > 32 The template to use for th is study34 The template to use for these subjects 33 35 </wizard:templateElement> 34 36 <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 225 225 line-height: 32px; 226 226 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; 227 235 } 228 236
Note: See TracChangeset
for help on using the changeset viewer.