Changeset 3460


Ignore:
Timestamp:
09/03/10 18:10:06 (17 months ago)
Author:
rwagner
Message:
 
Location:
molgenis_projects/col7a1
Files:
1 added
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/HelpPlugin.ftl

    r2659 r3460  
    2626<#--begin your plugin-->         
    2727 
    28 Create your plugin layout code here. 
     28I need help! 
    2929<#--<input name="myinput" value="${screen.getMyValue()}"> 
    3030<input type="submit" value="Change name" onclick="__action.value='do_myaction';return true;"/--> 
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/search/SearchPlugin.ftl

    r3421 r3460  
    7777         
    7878        <#include "mutations.ftl"> 
     79         
     80<#elseif screen.action == "showAllMutations"> 
     81 
     82        <#assign mutationSummaryVOs = screen.mutationSummaryVOs> 
     83        <#include "mutations.ftl"> 
     84 
     85<#elseif screen.action == "showAllPatients"> 
     86 
     87        <#assign patientSummaryVOs = screen.patientSummaryVOs> 
     88        <#include "patients.ftl"> 
     89 
    7990</#if> 
    8091 
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/search/SearchPlugin.java

    r3421 r3460  
    1818import org.molgenis.framework.ui.ScreenMessage; 
    1919import org.molgenis.framework.ui.ScreenModel; 
     20import org.molgenis.framework.ui.html.HiddenInput; 
     21import org.molgenis.framework.ui.html.StringInput; 
    2022import org.molgenis.util.Tuple; 
    2123 
     
    6466        private PatientSummaryVO patientSummaryVO; 
    6567         
     68        private SimpleSearch simpleSearch; 
     69         
    6670        public SearchPlugin(String name, ScreenModel parent) 
    6771        { 
     
    8690        { 
    8791                this.exonService     = ExonService.getInstance(db); 
     92                 
    8893                this.mutationService = MutationService.getInstance(db); 
    8994                this.patientService  = PatientService.getInstance(db); 
     
    96101                        this.action      = request.getAction(); 
    97102 
     103                        if (StringUtils.isEmpty(this.action) || this.action.equals("simpleSearch")) 
     104                                this.populateSimpleSearch(); 
     105 
    98106                        this.queryParametersVO.init(); 
    99107                        this.exonSearchCriteriaVO     = new ExonSearchCriteriaVO(); 
     
    101109 
    102110                        if (StringUtils.isNotBlank(request.getString("expertSearch"))) 
    103                         if (request.getString("expertSearch").equals("1")) 
    104                                 this.queryParametersVO.setExpertSearch(true); 
    105                         else 
    106                                 this.queryParametersVO.setExpertSearch(false); 
     111                                if (request.getString("expertSearch").equals("1")) 
     112                                        this.queryParametersVO.setExpertSearch(true); 
     113                                else 
     114                                        this.queryParametersVO.setExpertSearch(false); 
    107115 
    108116                        if (StringUtils.isNotEmpty(request.getString("snpbool"))) 
    109                         if (request.getString("snpbool").equals("show")) 
    110                                 this.queryParametersVO.setShowSNP(true); 
    111                         else if (request.getString("snpbool").equals("hide")) 
    112                         { 
    113                                 this.queryParametersVO.setShowSNP(false); 
    114                                 this.exonSearchCriteriaVO.setIsIntron(false); 
    115                         } 
     117                                if (request.getString("snpbool").equals("show")) 
     118                                        this.queryParametersVO.setShowSNP(true); 
     119                                else if (request.getString("snpbool").equals("hide")) 
     120                                { 
     121                                        this.queryParametersVO.setShowSNP(false); 
     122                                        this.exonSearchCriteriaVO.setIsIntron(false); 
     123                                } 
    116124 
    117125                        if (StringUtils.isNotEmpty(request.getString("showIntrons"))) 
    118                         if (request.getString("showIntrons").equals("show")) 
    119                         { 
    120                                 this.queryParametersVO.setShowIntrons(true); 
    121                                 this.exonSearchCriteriaVO.setIsIntron(null); 
    122                         } 
    123                         else if (request.getString("showIntrons").equals("hide")) 
    124                         { 
    125                                 this.queryParametersVO.setShowIntrons(false); 
    126                                 this.exonSearchCriteriaVO.setIsIntron(false); 
    127                         } 
    128                          
     126                                if (request.getString("showIntrons").equals("show")) 
     127                                { 
     128                                        this.queryParametersVO.setShowIntrons(true); 
     129                                        this.exonSearchCriteriaVO.setIsIntron(null); 
     130                                } 
     131                                else if (request.getString("showIntrons").equals("hide")) 
     132                                { 
     133                                        this.queryParametersVO.setShowIntrons(false); 
     134                                        this.exonSearchCriteriaVO.setIsIntron(false); 
     135                                } 
     136 
    129137                        if (StringUtils.isNotEmpty(request.getString("showNames"))) 
    130                         if (request.getString("showNames").equals("show")) 
    131                                 this.queryParametersVO.setShowNames(true); 
    132                         else if (request.getString("showNames").equals("hide")) 
    133                                 this.queryParametersVO.setShowNames(false); 
    134                          
     138                                if (request.getString("showNames").equals("show")) 
     139                                        this.queryParametersVO.setShowNames(true); 
     140                                else if (request.getString("showNames").equals("hide")) 
     141                                        this.queryParametersVO.setShowNames(false); 
     142 
    135143                        if (StringUtils.isNotEmpty(request.getString("showNumbering"))) 
    136                         if (request.getString("showNumbering").equals("show")) 
    137                                 this.queryParametersVO.setShowNumbering(true); 
    138                         else if (request.getString("showNumbering").equals("hide")) 
    139                                 this.queryParametersVO.setShowNumbering(false); 
    140                          
     144                                if (request.getString("showNumbering").equals("show")) 
     145                                        this.queryParametersVO.setShowNumbering(true); 
     146                                else if (request.getString("showNumbering").equals("hide")) 
     147                                        this.queryParametersVO.setShowNumbering(false); 
     148 
    141149                        if (StringUtils.isNotEmpty(request.getString("showMutations"))) 
    142                         if (request.getString("showMutations").equals("show")) 
    143                                 this.queryParametersVO.setShowMutations(true); 
    144                         else if (request.getString("showMutations").equals("hide")) 
    145                                 this.queryParametersVO.setShowMutations(false); 
     150                                if (request.getString("showMutations").equals("show")) 
     151                                        this.queryParametersVO.setShowMutations(true); 
     152                                else if (request.getString("showMutations").equals("hide")) 
     153                                        this.queryParametersVO.setShowMutations(false); 
    146154 
    147155                        if (this.action.equals("findMutationsByTerm")) 
    148156                        { 
    149                                 //TODO: Make a real OR query out of it 
    150157                                if (StringUtils.isNotEmpty(request.getString("term"))) 
    151158                                        this.mutationSearchCriteriaVO.setSearchTerm(request.getString("term")); 
     159 
    152160                                if (StringUtils.isNotEmpty(request.getString("snpbool"))) 
    153161                                        if (request.getString("snpbool").equals("hide")) 
     
    221229                                                this.mutationSearchCriteriaVO.setReportedAsSNP(false); 
    222230 
    223                                 logger.debug("exonSearchCriteriaVO==" + this.exonSearchCriteriaVO.toString()); 
    224231                                this.exonSummaryVO = this.exonService.findExons(exonSearchCriteriaVO).get(0); 
    225                                 logger.debug("exonId==" + this.exonSummaryVO.getExon().getId()); 
    226232 
    227233                                ExonSearchCriteriaVO prevExonCriteria = new ExonSearchCriteriaVO(); 
     
    273279                this.domainService         = ProteinDomainService.getInstance(db); 
    274280 
    275                 try { 
     281                try 
     282                { 
    276283                        this.mutationList      = this.mutationService.getAllMutations(); 
    277284                        this.exonList          = this.exonService.getAllExons(); 
     
    279286                        this.proteinDomainList = this.domainService.getAllProteinDomains(); 
    280287                } catch (Exception e) { 
    281                         // TODO Auto-generated catch block 
    282288                        e.printStackTrace(); 
    283289                } 
     
    293299        } 
    294300         
     301        private void populateSimpleSearch() 
     302        { 
     303                this.simpleSearch = new SimpleSearch(); 
     304                 
     305                simpleSearch.setAction(new HiddenInput("__action", "findMutationsByTerm")); 
     306                simpleSearch.setTarget(new HiddenInput("__target", this.getName())); 
     307                 
     308                StringInput term = new StringInput("term"); 
     309                term.setSize(10); 
     310                simpleSearch.setTerm(term); 
     311        } 
     312 
     313        public SimpleSearch getSimpleSearch() 
     314        { 
     315                return this.simpleSearch; 
     316        } 
     317 
    295318        public String getAction() 
    296319        { 
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/search/mutations.ftl

    r3421 r3460  
    33<p> 
    44<table class="listtable" cellpadding="4"> <!-- border="1" --> 
    5 <tr> 
    6 <th class="tableheader">No</th> 
    7 <th class="tableheader">cDNA</th> 
    8 <th class="tableheader">Codon change</td> 
    9 <th class="tableheader">Protein</td> 
    10 <th class="tableheader">Exon</td> 
    11 <th class="tableheader">Consequence</td> 
    12 <th class="tableheader">Dominant or recessive</td> 
    13 <th class="tableheader">Protein domain</td> 
    14 <th class="tableheader">Reported as SNP</td> 
    15 <th class="tableheader">Details</td> 
     5<tr class="tableheader"> 
     6<th>No</th> 
     7<th>cDNA</th> 
     8<th>Codon change</td> 
     9<th>Protein</td> 
     10<th>Exon</td> 
     11<th>Consequence</td> 
     12<th>Dominant or recessive</td> 
     13<th>Protein domain</td> 
     14<th>Reported as SNP</td> 
     15<th>Details</td> 
    1616</tr> 
    1717<#list mutationSummaryVOs as mutationSummaryVO> 
    18 <tr class="form_listrow0"> 
     18<tr class="form_listrow1"> 
    1919<td>${mutationSummaryVOs?seq_index_of(mutationSummaryVO) + 1}</td> 
    2020<td>${mutationSummaryVO.mutation.cdna_notation}</td> 
     
    2828<td><a href="molgenis.do?__target=${screen.name}&__action=showMutation&mutation_id=${mutationSummaryVO.mutation.id?c}"><img src="generated-res/img/filter.png"></a></td> 
    2929</tr> 
    30 <tr class="form_listrow1"> 
     30<tr class="form_listrow0"> 
    3131<td></td> 
    3232<td colspan="11"> 
     
    4242<table class="listtable" cellpadding="4"> <!-- border="1" --> 
    4343<tr class="tableheader"> 
    44 <th class="tableheader">No</th> 
    45 <th class="tableheader">cDNA</th> 
    46 <th class="tableheader">Protein</th> 
    47 <th class="tableheader">Exon</th> 
    48 <th class="tableheader">Consequence</th> 
    49 <th class="tableheader">Dominant or recessive</th> 
    50 <th class="tableheader">Associated phenotype</th> 
    51 <th class="tableheader">References</th> 
    52 <th class="tableheader">Details</th> 
     44<th>No</th> 
     45<th>cDNA</th> 
     46<th>Protein</th> 
     47<th>Exon</th> 
     48<th>Consequence</th> 
     49<th>Dominant or recessive</th> 
     50<th>Associated phenotype</th> 
     51<th>References</th> 
     52<th>Details</th> 
    5353</tr> 
    5454<#list mutationSummaryVO.patients as patientSummaryVO> 
     
    6262        </#if> 
    6363</#if> 
    64 <tr class="form_listrow0"> 
     64<tr class="form_listrow1"> 
    6565<td>${mutationSummaryVO.patients?seq_index_of(patientSummaryVO) + 1}</td> 
    6666<td><#if secondMutation??>${secondMutation.cdna_notation}</#if></td> 
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/search/searchForm.ftl

    r3409 r3460  
    22<#if !queryParametersVO.expertSearch> 
    33<tr> 
    4         <td>Search term: <form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutationsByTerm"/><input type="text" name="term" size="10"></form></td> 
     4        <td>Search term: <form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutationsByTerm"/><input type="text" name="term" size="10"></form></td> 
    55        <td><a href="molgenis.do?__target=${screen.name}&__action=init&expertSearch=1">Expert search</a></td> 
    66</tr> 
     
    1313</tr> 
    1414<tr> 
    15         <td>Variation: <form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><input type="text" name="variation" size="10"/></form></td> 
    16         <td>or <form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><select name="mutation_id" size="1" onchange="submit()"/><option value="">Select mutations</option><#list screen.mutationList as mutation><option value="${mutation.id?c}">${mutation.cdna_notation}</option></#list></select></form></td> 
     15        <td>Variation: <form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><input type="text" name="variation" size="10"/></form></td> 
     16        <td>or <form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><select name="mutation_id" size="1" onchange="submit()"/><option value="">Select mutations</option><#list screen.mutationList as mutation><option value="${mutation.id?c}">${mutation.cdna_notation}</option></#list></select></form></td> 
    1717        <td><a href="molgenis.do?__target=${screen.name}&__action=init&expertSearch=0">Simple search</a></td> 
    1818        <td colspan="1"><!--GenBank Acc No. <input type="text" name="genbankid" value="${queryParametersVO.genbankAccNo}"/>--></td> 
    1919</tr> 
    2020<tr> 
    21         <td>Nucleotide No: <form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><input type="text" name="nuclno" size="3"/></form></td> 
     21        <td>Nucleotide No: <form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><input type="text" name="nuclno" size="3"/></form></td> 
    2222        <td colspan="3">&nbsp;</td> 
    2323</tr> 
    2424<tr> 
    25         <td>Amino Acid No: <form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><input type="text" name="aano" size="10"/></form></td> 
     25        <td>Amino Acid No: <form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><input type="text" name="aano" size="10"/></form></td> 
    2626        <td colspan="3">&nbsp;</td> 
    2727</tr> 
     
    3030</tr> 
    3131<tr> 
    32         <td>Exon/Intron: <form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><input type="text" name="exon" size="3"/></form></td> 
    33         <td>or <form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="showExon"/><select name="exon_id" size="1" onchange="submit()"/><option value="">Select exon/intron</option><#list screen.exonList as exon><option value="${exon.id?c}">${exon.name}</option></#list></select></form></td> 
     32        <td>Exon/Intron: <form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><input type="text" name="exon" size="3"/></form></td> 
     33        <td>or <form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="showExon"/><select name="exon_id" size="1" onchange="submit()"/><option value="">Select exon/intron</option><#list screen.exonList as exon><option value="${exon.id?c}">${exon.name}</option></#list></select></form></td> 
    3434        <td colspan="2">&nbsp;</td> 
    3535</tr> 
    3636<tr> 
    37         <td><form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><select name="type" size="1" onchange="submit()"><option value="">Select mutation type</option><#list screen.mutationTypeList as type><option value="${type}">${type}</option></#list></select></form></td> 
     37        <td><form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="findMutations"/><select name="type" size="1" onchange="submit()"><option value="">Select mutation type</option><#list screen.mutationTypeList as type><option value="${type}">${type}</option></#list></select></form></td> 
    3838        <td colspan="3">&nbsp;</td> 
    3939</tr> 
    4040<tr> 
    41         <td><form method="get" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="showProteinDomain"/><select name="domain_id" size="1" onchange="submit()"/><option value="">Select protein domain</option><#list screen.proteinDomainList as proteinDomainSummaryVO><option value="${proteinDomainSummaryVO.proteinDomain.id?c}">${proteinDomainSummaryVO.proteinDomain.name}</option></#list></select></form></td> 
     41        <td><form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="showProteinDomain"/><select name="domain_id" size="1" onchange="submit()"/><option value="">Select protein domain</option><#list screen.proteinDomainList as proteinDomainSummaryVO><option value="${proteinDomainSummaryVO.proteinDomain.id?c}">${proteinDomainSummaryVO.proteinDomain.name}</option></#list></select></form></td> 
     42        <td colspan="3">&nbsp;</td> 
     43</tr> 
     44<tr> 
     45        <th colspan="4" align="left">List all</th> 
     46</tr> 
     47<tr> 
     48        <td><form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="showAllMutations"/><input type="submit" value="Mutations"/></form><form method="post" enctype="multipart/form-data"><input type="hidden" name="__target" value="${screen.name}" /><input type="hidden" name="__action" value="showAllPatients"/><input type="submit" value="Patients"/></form></td> 
    4249        <td colspan="3">&nbsp;</td> 
    4350</tr> 
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/upload/UploadPlugin.java

    r3421 r3460  
    99 
    1010import java.io.File; 
    11 import java.io.IOException; 
    12 import java.text.ParseException; 
    1311import java.util.ArrayList; 
    1412import java.util.List; 
    1513import java.util.Vector; 
    1614 
    17 import jxl.Workbook; 
    18 import jxl.read.biff.BiffException; 
    19  
    2015import org.apache.commons.lang.StringUtils; 
    2116import org.apache.log4j.Logger; 
    22 import org.apache.regexp.RESyntaxException; 
    2317import org.molgenis.framework.db.Database; 
    24 import org.molgenis.framework.db.Database.DatabaseAction; 
    2518import org.molgenis.framework.db.DatabaseException; 
    2619import org.molgenis.framework.ui.ScreenMessage; 
    2720import org.molgenis.framework.ui.ScreenModel; 
    2821import org.molgenis.framework.ui.PluginModel; 
    29 import org.molgenis.framework.ui.html.CheckboxInput; 
    30 import org.molgenis.framework.ui.html.IntInput; 
    3122import org.molgenis.framework.ui.html.SelectInput; 
    32 import org.molgenis.framework.ui.html.StringInput; 
    33 import org.molgenis.framework.ui.html.TextInput; 
    34 import org.molgenis.util.SimpleTuple; 
    3523import org.molgenis.util.Tuple; 
    3624import org.molgenis.util.ValueLabel; 
     
    4331import vo.PatientSummaryVO; 
    4432 
    45 import col7a1.E_M; 
    4633import col7a1.Exon; 
    4734import col7a1.Gene; 
    48 import col7a1.I_F; 
    4935import col7a1.Mutation; 
    50 import col7a1.Patient; 
    5136import col7a1.Phenotype; 
    5237import col7a1.Publication; 
    53 import col7a1.excel.UploadBatchExcelReader; 
    5438 
    5539public class UploadPlugin extends PluginModel 
     
    6549        private int referer ; // referer for patient.mutation{1,2} => 1 or 2, 0 initially 
    6650         
    67         private UploadPatient uploadPatient = new UploadPatient(); 
     51        private PatientForm patientForm    = new PatientForm(); 
     52//      private UploadPatient uploadPatient = new UploadPatient(); 
    6853 
    6954        public UploadPlugin(String name, ScreenModel parent) 
     
    135120                if (this.action.equals("checkBatch")) 
    136121                { 
    137                          
     122                        // TODO: implement check screen 
    138123                } 
    139124                else if (this.action.equals("insertBatch")) 
     
    153138                if (this.action.equals("newPatient")) 
    154139                { 
    155                         // populate input form 
     140                        // populate patient form 
    156141                        List<ValueLabel> mutationOptions  = new ArrayList<ValueLabel>(); 
    157142                        for (Mutation mutation : this.mutationService.getAllMutations()) 
     
    162147                                phenotypeOptions.add(new ValueLabel(phenotype.getId(), phenotype.getName())); 
    163148 
    164                         Vector<ValueLabel> aliveOptions   = new Vector<ValueLabel>(); 
    165                         aliveOptions.add(new ValueLabel("alive", "alive")); 
    166  
    167149                        Vector<String> aliveValue         = new Vector<String>(); 
    168150                        aliveValue.add(this.patientSummaryVO.getPatient().getAlive() ? "alive" : ""); 
    169151                         
    170                         this.uploadPatient.setAge(new StringInput("age", this.patientSummaryVO.getPatient().getAge())); 
    171                         this.uploadPatient.setAlive(new CheckboxInput("alive", "", "Is patient still alive?", aliveOptions, aliveValue)); 
    172                         this.uploadPatient.setConsent(new CheckboxInput("consent", "", "Did patient give consent to publish data?", new Vector<ValueLabel>(), new Vector<String>())); 
    173                         this.uploadPatient.setIdentifier(new StringInput("identifier", this.patientSummaryVO.getPatient().getIdentifier())); 
    174                         this.uploadPatient.setMutation1(new SelectInput("mutation1", this.patientSummaryVO.getMutation1().getId())); 
    175                         this.uploadPatient.getMutation1().setOptions(mutationOptions); 
    176                         this.uploadPatient.setMutation2(new SelectInput("mutation2", this.patientSummaryVO.getMutation2().getId())); 
    177                         this.uploadPatient.getMutation2().setOptions(mutationOptions); 
    178                         this.uploadPatient.setNumber_(new IntInput("number", this.patientSummaryVO.getPatient().getNumber_())); 
    179                         this.uploadPatient.setPdf(new StringInput("pdf", this.patientSummaryVO.getPublication().getPdf())); 
    180                         this.uploadPatient.setPhenotype(new SelectInput("phenotype", this.patientSummaryVO.getPhenotype().getId())); 
    181                         this.uploadPatient.getPhenotype().setOptions(phenotypeOptions); 
    182                         this.uploadPatient.setPubmed(new StringInput("pubmed", this.patientSummaryVO.getPublication().getPubmed())); 
     152                        this.patientForm.get("age").setValue(this.patientSummaryVO.getPatient().getAge()); 
     153                        this.patientForm.get("alive").setValue(aliveValue); 
     154                        this.patientForm.get("identifier").setValue(this.patientSummaryVO.getPatient().getIdentifier()); 
     155                        ((SelectInput) this.patientForm.get("mutation1")).setOptions(mutationOptions); 
     156                        this.patientForm.get("mutation1").setValue(this.patientSummaryVO.getMutation1().getId()); 
     157                        ((SelectInput) this.patientForm.get("mutation2")).setOptions(mutationOptions); 
     158                        this.patientForm.get("mutation2").setValue(this.patientSummaryVO.getMutation2().getId()); 
     159                        this.patientForm.get("number").setValue(this.patientSummaryVO.getPatient().getNumber_()); 
     160                        this.patientForm.get("pdf").setValue(this.patientSummaryVO.getPublication().getPdf()); 
     161                        ((SelectInput) this.patientForm.get("phenotype")).setOptions(phenotypeOptions); 
     162                        this.patientForm.get("phenotype").setValue(this.patientSummaryVO.getPhenotype().getId()); 
     163                        this.patientForm.get("pubmed").setValue(this.patientSummaryVO.getPublication().getPubmed()); 
    183164                } 
    184165                else if (this.action.equals("insertPatient")) 
     
    190171        } 
    191172 
     173        public PatientForm getPatientForm() 
     174        { 
     175                return this.patientForm; 
     176        } 
     177 
    192178        private void handleMutation(Database db, Tuple request) throws Exception 
    193179        { 
     
    196182                if (this.action.equals("assignMutation")) 
    197183                { 
    198                         //logger.debug(">>> assignMutation"); 
    199184                        this.mutationService.assignValuesFromPosition(this.mutationUploadVO); 
    200185                } 
    201186                else if (this.action.equals("checkMutation")) 
    202187                { 
    203                          
     188                        // TODO: implement check screen 
    204189                } 
    205190                else if (this.action.equals("insertMutation")) 
    206191                { 
    207192                        this.mutationService.insert(this.mutationUploadVO); 
    208 //                      db.beginTx(); 
    209 //                      Mutation mutation = this.mutationUploadVO.toMutation(); 
    210 //                      db.update(mutation); 
    211 //                      mutation = db.findByExample(mutation).get(0); // must return exactly one object if no exception was thrown 
    212 //                      logger.debug(">>> insertMutation: mutation.id==" + mutation.getId()); 
     193 
    213194                        if (this.referer == 1) 
    214195                                this.patientSummaryVO.setMutation1(this.mutationUploadVO.getMutation()); 
    215196                        else if (this.referer == 2) 
    216197                                this.patientSummaryVO.setMutation2(this.mutationUploadVO.getMutation()); 
    217 //                      db.commitTx(); 
     198 
    218199                        this.getMessages().add(new ScreenMessage("Mutation successfully inserted", true)); 
    219200                        this.initMutation(); 
     
    232213                if (StringUtils.isNotEmpty(request.getString("mutation1"))) 
    233214                { 
    234                         Mutation mutation1 = this.mutationService.findMutation(request.getInt("mutation1")); 
    235                         this.patientSummaryVO.getPatient().setMutation1(mutation1); 
     215//                      Mutation mutation1 = this.mutationService.findMutation(request.getInt("mutation1")); 
     216//                      this.patientSummaryVO.getPatient().setMutation1(mutation1); 
     217                        this.patientSummaryVO.getPatient().setMutation1(request.getInt("mutation1")); 
    236218                } 
    237219 
    238220                if (StringUtils.isNotEmpty(request.getString("mutation2"))) 
    239221                { 
    240                         Mutation mutation2 = this.mutationService.findMutation(request.getInt("mutation2")); 
    241                         this.patientSummaryVO.getPatient().setMutation2(mutation2); 
     222//                      Mutation mutation2 = this.mutationService.findMutation(request.getInt("mutation2")); 
     223//                      this.patientSummaryVO.getPatient().setMutation2(mutation2); 
     224                        this.patientSummaryVO.getPatient().setMutation2(request.getInt("mutation2")); 
    242225                } 
    243226 
    244227                if (StringUtils.isNotEmpty(request.getString("phenotype"))) 
    245228                { 
    246                         Phenotype phenotype = this.phenotypeService.findPhenotypeById(request.getInt("phenotype")); 
    247                         this.patientSummaryVO.getPatient().setPhenotype(phenotype); 
     229//                      logger.debug(">>> Finding phenotype with id==" + request.getInt("phenotype")); 
     230//                      Phenotype phenotype = this.phenotypeService.findPhenotypeById(request.getInt("phenotype")); 
     231//                      logger.debug(">>> Found phenotype with id==" + phenotype.getId() + ", name==" + phenotype.getName()); 
     232//                      this.patientSummaryVO.getPatient().setPhenotype(phenotype); 
     233//                      logger.debug(">>> Set phenotype with id==" + this.patientSummaryVO.getPatient().getPhenotype()); 
     234                        this.patientSummaryVO.getPatient().setPhenotype(request.getInt("phenotype")); 
    248235                } 
    249236 
     
    423410        } 
    424411 
    425         public UploadPatient getUploadPatient() 
    426         { 
    427                 return this.uploadPatient; 
    428         } 
     412//      public UploadPatient getUploadPatient() 
     413//      { 
     414//              return this.uploadPatient; 
     415//      } 
    429416 
    430417        public MutationUploadVO getMutationUploadVO() 
  • molgenis_projects/col7a1/handwritten/java/plugin/ui/upload/uploadPatient.ftl

    r3416 r3460  
    1 <#assign patient = screen.uploadPatient> 
     1<#assign form = screen.patientForm> 
    22<table border="0" cellpadding="4" cellspacing="4"> 
    3 <tr><td>Patient No</td><td>${patient.number_.toHtml()}</td><td>Patient ID</td><td>${patient.identifier.toHtml()}</td><td><a href="molgenis.do?__target=${screen.name}&__action=newBatch">Batch Upload</a></td></tr> 
    4 <tr><td>Mutation 1</td><td>${patient.mutation1.toHtml()} <a href="molgenis.do?__target=${screen.name}&__action=newMutation&referer=1">Add</a></td><td>Mutation 2</td><td>${patient.mutation2.toHtml()} <a href="molgenis.do?__target=${screen.name}&__action=newMutation&referer=2">Add</a></td></tr> 
    5 <tr><td>Phenotype</td><td>${patient.phenotype.toHtml()}</td><td></td><td></td></tr> 
    6 <tr><td>PubMed ID</td><td>${patient.pubmed.toHtml()}</td><td>Link to Article</td><td>${patient.pdf.toHtml()}</td></tr> 
    7 <tr><td>Age</td><td>${patient.age.toHtml()}</td><td>Alive?</td><td>${patient.alive.toHtml()}</td></tr> 
    8 <tr><td>Consent</td><td>${patient.consent.toHtml()}</td><td></td><td></td></tr> 
     3<tr><td>Patient No</td><td>${form.number}</td><td>Patient ID</td><td>${form.identifier}</td><td><a href="molgenis.do?__target=${screen.name}&__action=newBatch">Batch Upload</a></td></tr> 
     4<tr><td>Mutation 1</td><td>${form.mutation1} <a href="molgenis.do?__target=${screen.name}&__action=newMutation&referer=1">Add</a></td><td>Mutation 2</td><td>${form.mutation2} <a href="molgenis.do?__target=${screen.name}&__action=newMutation&referer=2">Add</a></td></tr> 
     5<tr><td>Phenotype</td><td>${form.phenotype}</td><td></td><td></td></tr> 
     6<tr><td>PubMed ID</td><td>${form.pubmed}</td><td>Link to Article</td><td>${form.pdf}</td></tr> 
     7<tr><td>Age</td><td>${form.age}</td><td>Alive?</td><td>${form.alive}</td></tr> 
     8<tr><td>Consent</td><td>${form.consent}</td><td></td><td></td></tr> 
    99<tr><td colspan="4"><hr/></td></tr> 
    1010<tr><td></td><td></td><td></td><td align="right"><input type="submit" value="Proceed" onclick="__action.value='insertPatient';return true;"/></td></tr> 
    1111</table> 
    12 <#-- 
    13 <#assign patientSummaryVO = screen.patientSummaryVO> 
    14 <table border="0" cellpadding="4" cellspacing="4"> 
    15 <tr><td>Patient No</td><td><input type="text" name="number" value="<#if patientSummaryVO.patient.number_??>${patientSummaryVO.patient.number_?c}</#if>"/></td><td>Patient ID</td><td><input type="text" name="identifier" value="<#if patientSummaryVO.patient.identifier??>${patientSummaryVO.patient.identifier}</#if>"/></td><td><a href="molgenis.do?__target=${screen.name}&__action=newBatch">Batch Upload</a></td></tr> 
    16 <tr><td>Mutation 1</td><td><select name="mutation1"><option value=""></option><#list screen.mutations as mutation><option value="${mutation.id?c}"<#if patientSummaryVO.mutation1??><#if patientSummaryVO.mutation1.id == mutation.id> selected="selected"</#if></#if>>${mutation.cdna_notation}</option></#list></select> <a href="molgenis.do?__target=${screen.name}&__action=newMutation&referer=1">Add</a></td><td>Mutation 2</td><td><select name="mutation2"><option value=""></option><#list screen.mutations as mutation><option value="${mutation.id?c}"<#if patientSummaryVO.mutation2??><#if patientSummaryVO.mutation2.id == mutation.id> selected="selected"</#if></#if>>${mutation.cdna_notation}</option></#list></select> <a href="molgenis.do?__target=${screen.name}&__action=newMutation&referer=2">Add</a></td></tr> 
    17 <tr><td>Phenotype</td><td><select name="phenotype"><#list screen.phenotypes as phenotype><option value="${phenotype.id}"<#if patientSummaryVO.phenotype??><#if patientSummaryVO.phenotype.id == phenotype.id> selected="selected"</#if></#if>>${phenotype.name}</option></#list></select></td><td></td><td></td></tr> 
    18 <tr><td>PubMed ID</td><td><input type="text" name="pubmed" value=""/></td><td>Link to Article</td><td><input type="text" name="pdf" value=""/></td></tr> 
    19 <tr><td>Age</td><td><input type="text" name="age" value="<#if patientSummaryVO.patient.age??>${patientSummaryVO.patient.age}</#if>"/></td><td>Alive?</td><td><input type="checkbox" name="alive" value="alive"<#if patientSummaryVO.patient.alive?? && patientSummaryVO.patient.alive> checked="checked"</#if>/></td></tr> 
    20 <tr><td>Consent</td><td><input type="checkbox" name="consent" value="consent"/></td><td></td><td></td></tr> 
    21 <tr><td colspan="4"><hr/></td></tr> 
    22 <tr><td></td><td></td><td></td><td align="right"><input type="submit" value="Proceed" onclick="__action.value='insertPatient';return true;"/></td></tr> 
    23 </table> 
    24 --> 
  • molgenis_projects/col7a1/handwritten/java/service/PatientService.java

    r3421 r3460  
    6969        } 
    7070 
     71        public List<Patient> getAllPatients() throws DatabaseException, ParseException 
     72        { 
     73                return this.db.query(Patient.class).find(); 
     74        } 
     75 
    7176        /** 
    7277         * Find the highest patient number 
     
    121126                        db.beginTx(); 
    122127 
    123                         // Add mutation1 and link to patient 
    124  
    125                         logger.debug(">>> insert: mutation1==" + patientSummaryVO.getMutation1().toString()); 
     128                        // If patientSummaryVO.mutation1 is existent, add it and link to patient 
     129 
    126130                        if (StringUtils.isNotEmpty(patientSummaryVO.getMutation1().getCdna_notation())) 
    127131                        { 
     
    133137                        } 
    134138 
    135                         // Add mutation2 and link to patient 
    136  
    137                         logger.debug(">>> insert: mutation2==" + patientSummaryVO.getMutation2().toString()); 
     139                        // If patientSummaryVO.mutation2 is existent, add it and link to patient 
     140 
    138141                        if (StringUtils.isNotEmpty(patientSummaryVO.getMutation2().getCdna_notation())) 
    139142                        { 
     
    145148                        } 
    146149 
    147                         // Phenotypes are never added via patients, just select 
    148                         List<Phenotype> phenotypes = this.db.findByExample(patientSummaryVO.getPhenotype()); 
    149                         if (phenotypes.size() == 1) 
    150                                 patientSummaryVO.getPatient().setPhenotype(phenotypes.get(0)); 
    151                         else 
    152                         { 
    153                                 Phenotype phenotype = new Phenotype(); 
    154                                 phenotype.setName("DEB-u"); 
    155                                 List<Phenotype> phenotypes2 = this.db.findByExample(phenotype); 
    156                                 patientSummaryVO.getPatient().setPhenotype(phenotypes2.get(0)); 
    157                         } 
    158  
    159                         // Publications are currently not added via patients, just select 
    160                         List<Publication> publications = this.db.findByExample(patientSummaryVO.getPublication()); 
    161                         if (publications.size() == 1) 
    162                                 patientSummaryVO.getPatient().setPublication(publications.get(0)); 
     150//                      // Phenotypes are never added via patients, just select 
     151//                      List<Phenotype> phenotypes = this.db.findByExample(patientSummaryVO.getPhenotype()); 
     152//                      logger.debug(">>> phenotypes==" + phenotypes.size()); 
     153//                      if (phenotypes.size() == 1) 
     154//                              patientSummaryVO.getPatient().setPhenotype(phenotypes.get(0)); 
     155//                      else 
     156//                      { 
     157//                              Phenotype phenotype = new Phenotype(); 
     158//                              phenotype.setName("DEB-u"); 
     159//                              List<Phenotype> phenotypes2 = this.db.findByExample(phenotype); 
     160//                              patientSummaryVO.getPatient().setPhenotype(phenotypes2.get(0)); 
     161//                      } 
     162 
     163//                      // Publications are currently not added via patients, just select 
     164//                      List<Publication> publications = this.db.findByExample(patientSummaryVO.getPublication()); 
     165//                      if (publications.size() == 1) 
     166//                              patientSummaryVO.getPatient().setPublication(publications.get(0)); 
    163167 
    164168                        // Insert patient and set primary key 
  • molgenis_projects/col7a1/molgenis_db.xml

    r3409 r3460  
    3535                <unique fields="name"></unique> 
    3636        </entity> 
    37         <entity name="Publication"> 
     37        <entity name="Publication" decorator="decorator.PublicationDecorator"> 
    3838                <description>A publication in a scientific journal.</description> 
    3939                <field name="id" type="autoid" hidden="true" description="Primary key."/> 
     40                <field name="authors" description="Authors of publications." label="Author(s)"/> 
    4041                <field name="title" description="Title." label="Title"/> 
    41                 <field name="authors" description="Authors of publications." label="Authors"/> 
    4242                <field name="journal" description="The journal the publication appeared." label="Journal"/> 
     43                <field name="year" type="number" description="Publication year." label="Year"/> 
    4344                <field name="volume" description="Volume the publication appeared." label="Volume"/> 
    4445                <field name="issue" description="Issue the publication appeared." label="Issue"/> 
    4546                <field name="startPage" description="Start page." label="Start page"/> 
    4647                <field name="endPage" description="End page." label="End page"/> 
    47                 <field name="year" type="number" description="Publication year." label="Year"/> 
    4848                <field name="pubmed" description="PubMed id." label="PubMed ID"/> 
    49                 <field name="pdf" description="URL to PDF." label="PDF"/> 
     49                <field name="pdf" description="URL to PDF." nillable="true" label="" hidden="false"/> 
    5050                <unique fields="title,pubmed"></unique> 
    5151        </entity> 
     
    6868        <entity name="Patient"> 
    6969                <field name="id" type="autoid" hidden="true" description="Primary key."/> 
    70                 <field name="number_" type="number" description="Number of patient." label="Number"/> 
    71                 <field name="identifier" description="Identifier of patient." label="Identifier"/> 
     70                <field name="number_" type="number" description="Number of patient." label="Patient No"/> 
     71                <field name="identifier" description="Identifier of patient." label="Patient ID"/> 
    7272                <field name="age" description="Age of patient in years." label="Age"/> 
     73                <field name="alive" type="bool" default="true" description="Is patient still alive?" label="Alive?"/> 
    7374                <field name="phenotype" type="xref" xref_field="Phenotype.id" xref_label="name" label="Phenotype"/> 
    74                 <field name="alive" type="bool" default="true" description="Is patient still alive?" label="Alive?"/> 
    75                 <field name="mutation1" type="xref" xref_field="Mutation.id" xref_label="cdna_notation" nillable="true" label="Mutation1"/> 
    76                 <field name="mutation2" type="xref" xref_field="Mutation.id" xref_label="cdna_notation" nillable="true" label="Mutation2"/> 
    77                 <field name="publication" type="xref" xref_field="Publication.id" xref_label="title" nillable="true" label="Publication"/> 
     75                <field name="mutation1" type="xref" xref_field="Mutation.id" xref_label="cdna_notation" nillable="true" label="First Mutation"/> 
     76                <field name="mutation2" type="xref" xref_field="Mutation.id" xref_label="cdna_notation" nillable="true" label="Second Mutation"/> 
     77                <field name="publication" type="xref" xref_field="Publication.id" xref_label="pubmed" nillable="true" label="PubMed ID"/> 
    7878                <unique fields="number_"></unique> 
    7979        </entity> 
     
    104104                <description>Part of an exon that has its codon changed.</description> 
    105105                <field name="id" type="autoid" hidden="true" description="Primary key."/> 
    106                 <field name="position" description="Position of the mutation including intron positions, e.g. 1234+5" label="Postition"/> 
    107                 <field name="cdna_position" type="number" description="Position in bp inside of the cDNA sequence." label="cDNA Position"/> 
    108                 <field name="gdna_position" type="number" description="Position in bp inside of the gDNA sequence." label="gDNA Position"/> 
    109                 <field name="aa_position" type="number" description="Position in codon numbers of the changed amino acid" nillable="true" label="Amino acid position"/> 
     106                <field name="position" hidden="true" default="0" description="Position of the mutation including intron positions, e.g. 1234+5" label="Postition"/> 
     107                <field name="cdna_position" hidden="true" type="number" default="0" description="Position in bp inside of the cDNA sequence." label="cDNA Position"/> 
     108                <field name="gdna_position" hidden="true" type="number" default="0" description="Position in bp inside of the gDNA sequence." label="gDNA Position"/> 
     109                <field name="aa_position" hidden="true" type="number" default="0" description="Position in codon numbers of the changed amino acid" label="Amino acid position"/> 
    110110                <field name="length_" type="number" description="Length of the mutation." label="Length"/> 
    111                 <field name="event" type="enum" enum_options="[deletion,duplication,exception,indel,insertion,substitution,NA]" default="NA" label="Event"/> 
     111                <field name="event" hidden="true" type="enum" enum_options="[deletion,duplication,exception,indel,insertion,substitution,NA]" default="NA" label="Event"/> 
    112112                <field name="type_" type="enum" enum_options="[missenseMutation, nonsenseMutation, smallDeletion, smallInsertion, smallDuplication, indel, largeDeletion, largeDuplication, spliceSiteMutation, NA]" nillable="true" label="Type"/> 
    113113                <field name="ntchange" description="Changed nucleotide(s) at given position." label="Nt change"/> 
     
    124124                <field name="founderMutation" type="bool" description="Founder mutation?" nillable="true" label="Founder mutation?"/> 
    125125                <field name="population" description="Population if founder mutation." nillable="true" label="Population"/> 
    126                 <field name="gene" type="xref" xref_field="Gene.id" xref_label="name" label="Gene"/> 
     126                <field name="gene" hidden="true" type="xref" xref_field="Gene.id" xref_label="name" nillable="true" label="Gene"/> 
    127127                <unique fields="gene,cdna_notation"></unique> 
    128128        </entity><!-- 
  • molgenis_projects/col7a1/molgenis_ui.xml

    r3335 r3460  
    2121                        </menu> 
    2222                        --> 
    23                         <plugin name="Contact" type="plugin.ui.ContactPlugin"/> 
    24                         <plugin name="PublicationPlugin" type="plugin.ui.PublicationPlugin" label="References"/> 
    25                         <plugin name="Background" type="plugin.ui.BackgroundPlugin"/> 
    26                         <plugin name="Help" type="plugin.ui.HelpPlugin"/> 
    27                         <plugin name="Login" type="plugin.ui.LoginPlugin"/> 
     23                        <form name="ListAllMutations" entity="Mutation" label="List all Mutations" readonly="true"/> 
     24                        <form name="ListAllPatients" entity="Patient" label="List all Patients" readonly="true"/> 
     25                        <plugin name="Contact" type="plugin.ui.ContactPlugin" label="Contact"/> 
     26                        <form name="Publications" entity="Publication" label="References" readonly="true"/> 
     27                        <!--<plugin name="PublicationPlugin" type="plugin.ui.PublicationPlugin" label="References"/>--> 
     28                        <plugin name="Background" type="plugin.ui.BackgroundPlugin" label="Background"/> 
     29                        <plugin name="Help" type="plugin.ui.HelpPlugin" label="Help"/> 
     30                        <!--<plugin name="Login" type="plugin.ui.LoginPlugin" label="Login"/>--> 
    2831                        <menu name="Management" position="left" label="Management"> 
    2932                                <form name="Gene" entity="Gene"/> 
Note: See TracChangeset for help on using the changeset viewer.