Changeset 3460
- Timestamp:
- 09/03/10 18:10:06 (17 months ago)
- Location:
- molgenis_projects/col7a1
- Files:
-
- 1 added
- 1 deleted
- 10 edited
-
handwritten/java/plugin/ui/HelpPlugin.ftl (modified) (1 diff)
-
handwritten/java/plugin/ui/search/SearchPlugin.ftl (modified) (1 diff)
-
handwritten/java/plugin/ui/search/SearchPlugin.java (modified) (9 diffs)
-
handwritten/java/plugin/ui/search/mutations.ftl (modified) (4 diffs)
-
handwritten/java/plugin/ui/search/searchForm.ftl (modified) (3 diffs)
-
handwritten/java/plugin/ui/upload/PatientForm.java (added)
-
handwritten/java/plugin/ui/upload/UploadPatient.java (deleted)
-
handwritten/java/plugin/ui/upload/UploadPlugin.java (modified) (10 diffs)
-
handwritten/java/plugin/ui/upload/uploadPatient.ftl (modified) (1 diff)
-
handwritten/java/service/PatientService.java (modified) (4 diffs)
-
molgenis_db.xml (modified) (4 diffs)
-
molgenis_ui.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molgenis_projects/col7a1/handwritten/java/plugin/ui/HelpPlugin.ftl
r2659 r3460 26 26 <#--begin your plugin--> 27 27 28 Create your plugin layout code here. 28 I need help! 29 29 <#--<input name="myinput" value="${screen.getMyValue()}"> 30 30 <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 77 77 78 78 <#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 79 90 </#if> 80 91 -
molgenis_projects/col7a1/handwritten/java/plugin/ui/search/SearchPlugin.java
r3421 r3460 18 18 import org.molgenis.framework.ui.ScreenMessage; 19 19 import org.molgenis.framework.ui.ScreenModel; 20 import org.molgenis.framework.ui.html.HiddenInput; 21 import org.molgenis.framework.ui.html.StringInput; 20 22 import org.molgenis.util.Tuple; 21 23 … … 64 66 private PatientSummaryVO patientSummaryVO; 65 67 68 private SimpleSearch simpleSearch; 69 66 70 public SearchPlugin(String name, ScreenModel parent) 67 71 { … … 86 90 { 87 91 this.exonService = ExonService.getInstance(db); 92 88 93 this.mutationService = MutationService.getInstance(db); 89 94 this.patientService = PatientService.getInstance(db); … … 96 101 this.action = request.getAction(); 97 102 103 if (StringUtils.isEmpty(this.action) || this.action.equals("simpleSearch")) 104 this.populateSimpleSearch(); 105 98 106 this.queryParametersVO.init(); 99 107 this.exonSearchCriteriaVO = new ExonSearchCriteriaVO(); … … 101 109 102 110 if (StringUtils.isNotBlank(request.getString("expertSearch"))) 103 if (request.getString("expertSearch").equals("1"))104 this.queryParametersVO.setExpertSearch(true);105 else106 this.queryParametersVO.setExpertSearch(false);111 if (request.getString("expertSearch").equals("1")) 112 this.queryParametersVO.setExpertSearch(true); 113 else 114 this.queryParametersVO.setExpertSearch(false); 107 115 108 116 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 } 116 124 117 125 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 129 137 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 135 143 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 141 149 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); 146 154 147 155 if (this.action.equals("findMutationsByTerm")) 148 156 { 149 //TODO: Make a real OR query out of it150 157 if (StringUtils.isNotEmpty(request.getString("term"))) 151 158 this.mutationSearchCriteriaVO.setSearchTerm(request.getString("term")); 159 152 160 if (StringUtils.isNotEmpty(request.getString("snpbool"))) 153 161 if (request.getString("snpbool").equals("hide")) … … 221 229 this.mutationSearchCriteriaVO.setReportedAsSNP(false); 222 230 223 logger.debug("exonSearchCriteriaVO==" + this.exonSearchCriteriaVO.toString());224 231 this.exonSummaryVO = this.exonService.findExons(exonSearchCriteriaVO).get(0); 225 logger.debug("exonId==" + this.exonSummaryVO.getExon().getId());226 232 227 233 ExonSearchCriteriaVO prevExonCriteria = new ExonSearchCriteriaVO(); … … 273 279 this.domainService = ProteinDomainService.getInstance(db); 274 280 275 try { 281 try 282 { 276 283 this.mutationList = this.mutationService.getAllMutations(); 277 284 this.exonList = this.exonService.getAllExons(); … … 279 286 this.proteinDomainList = this.domainService.getAllProteinDomains(); 280 287 } catch (Exception e) { 281 // TODO Auto-generated catch block282 288 e.printStackTrace(); 283 289 } … … 293 299 } 294 300 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 295 318 public String getAction() 296 319 { -
molgenis_projects/col7a1/handwritten/java/plugin/ui/search/mutations.ftl
r3421 r3460 3 3 <p> 4 4 <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> 16 16 </tr> 17 17 <#list mutationSummaryVOs as mutationSummaryVO> 18 <tr class="form_listrow 0">18 <tr class="form_listrow1"> 19 19 <td>${mutationSummaryVOs?seq_index_of(mutationSummaryVO) + 1}</td> 20 20 <td>${mutationSummaryVO.mutation.cdna_notation}</td> … … 28 28 <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> 29 29 </tr> 30 <tr class="form_listrow 1">30 <tr class="form_listrow0"> 31 31 <td></td> 32 32 <td colspan="11"> … … 42 42 <table class="listtable" cellpadding="4"> <!-- border="1" --> 43 43 <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> 53 53 </tr> 54 54 <#list mutationSummaryVO.patients as patientSummaryVO> … … 62 62 </#if> 63 63 </#if> 64 <tr class="form_listrow 0">64 <tr class="form_listrow1"> 65 65 <td>${mutationSummaryVO.patients?seq_index_of(patientSummaryVO) + 1}</td> 66 66 <td><#if secondMutation??>${secondMutation.cdna_notation}</#if></td> -
molgenis_projects/col7a1/handwritten/java/plugin/ui/search/searchForm.ftl
r3409 r3460 2 2 <#if !queryParametersVO.expertSearch> 3 3 <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> 5 5 <td><a href="molgenis.do?__target=${screen.name}&__action=init&expertSearch=1">Expert search</a></td> 6 6 </tr> … … 13 13 </tr> 14 14 <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> 17 17 <td><a href="molgenis.do?__target=${screen.name}&__action=init&expertSearch=0">Simple search</a></td> 18 18 <td colspan="1"><!--GenBank Acc No. <input type="text" name="genbankid" value="${queryParametersVO.genbankAccNo}"/>--></td> 19 19 </tr> 20 20 <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> 22 22 <td colspan="3"> </td> 23 23 </tr> 24 24 <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> 26 26 <td colspan="3"> </td> 27 27 </tr> … … 30 30 </tr> 31 31 <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> 34 34 <td colspan="2"> </td> 35 35 </tr> 36 36 <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> 38 38 <td colspan="3"> </td> 39 39 </tr> 40 40 <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"> </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> 42 49 <td colspan="3"> </td> 43 50 </tr> -
molgenis_projects/col7a1/handwritten/java/plugin/ui/upload/UploadPlugin.java
r3421 r3460 9 9 10 10 import java.io.File; 11 import java.io.IOException;12 import java.text.ParseException;13 11 import java.util.ArrayList; 14 12 import java.util.List; 15 13 import java.util.Vector; 16 14 17 import jxl.Workbook;18 import jxl.read.biff.BiffException;19 20 15 import org.apache.commons.lang.StringUtils; 21 16 import org.apache.log4j.Logger; 22 import org.apache.regexp.RESyntaxException;23 17 import org.molgenis.framework.db.Database; 24 import org.molgenis.framework.db.Database.DatabaseAction;25 18 import org.molgenis.framework.db.DatabaseException; 26 19 import org.molgenis.framework.ui.ScreenMessage; 27 20 import org.molgenis.framework.ui.ScreenModel; 28 21 import org.molgenis.framework.ui.PluginModel; 29 import org.molgenis.framework.ui.html.CheckboxInput;30 import org.molgenis.framework.ui.html.IntInput;31 22 import 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;35 23 import org.molgenis.util.Tuple; 36 24 import org.molgenis.util.ValueLabel; … … 43 31 import vo.PatientSummaryVO; 44 32 45 import col7a1.E_M;46 33 import col7a1.Exon; 47 34 import col7a1.Gene; 48 import col7a1.I_F;49 35 import col7a1.Mutation; 50 import col7a1.Patient;51 36 import col7a1.Phenotype; 52 37 import col7a1.Publication; 53 import col7a1.excel.UploadBatchExcelReader;54 38 55 39 public class UploadPlugin extends PluginModel … … 65 49 private int referer ; // referer for patient.mutation{1,2} => 1 or 2, 0 initially 66 50 67 private UploadPatient uploadPatient = new UploadPatient(); 51 private PatientForm patientForm = new PatientForm(); 52 // private UploadPatient uploadPatient = new UploadPatient(); 68 53 69 54 public UploadPlugin(String name, ScreenModel parent) … … 135 120 if (this.action.equals("checkBatch")) 136 121 { 137 122 // TODO: implement check screen 138 123 } 139 124 else if (this.action.equals("insertBatch")) … … 153 138 if (this.action.equals("newPatient")) 154 139 { 155 // populate input form140 // populate patient form 156 141 List<ValueLabel> mutationOptions = new ArrayList<ValueLabel>(); 157 142 for (Mutation mutation : this.mutationService.getAllMutations()) … … 162 147 phenotypeOptions.add(new ValueLabel(phenotype.getId(), phenotype.getName())); 163 148 164 Vector<ValueLabel> aliveOptions = new Vector<ValueLabel>();165 aliveOptions.add(new ValueLabel("alive", "alive"));166 167 149 Vector<String> aliveValue = new Vector<String>(); 168 150 aliveValue.add(this.patientSummaryVO.getPatient().getAlive() ? "alive" : ""); 169 151 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()); 183 164 } 184 165 else if (this.action.equals("insertPatient")) … … 190 171 } 191 172 173 public PatientForm getPatientForm() 174 { 175 return this.patientForm; 176 } 177 192 178 private void handleMutation(Database db, Tuple request) throws Exception 193 179 { … … 196 182 if (this.action.equals("assignMutation")) 197 183 { 198 //logger.debug(">>> assignMutation");199 184 this.mutationService.assignValuesFromPosition(this.mutationUploadVO); 200 185 } 201 186 else if (this.action.equals("checkMutation")) 202 187 { 203 188 // TODO: implement check screen 204 189 } 205 190 else if (this.action.equals("insertMutation")) 206 191 { 207 192 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 213 194 if (this.referer == 1) 214 195 this.patientSummaryVO.setMutation1(this.mutationUploadVO.getMutation()); 215 196 else if (this.referer == 2) 216 197 this.patientSummaryVO.setMutation2(this.mutationUploadVO.getMutation()); 217 // db.commitTx(); 198 218 199 this.getMessages().add(new ScreenMessage("Mutation successfully inserted", true)); 219 200 this.initMutation(); … … 232 213 if (StringUtils.isNotEmpty(request.getString("mutation1"))) 233 214 { 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")); 236 218 } 237 219 238 220 if (StringUtils.isNotEmpty(request.getString("mutation2"))) 239 221 { 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")); 242 225 } 243 226 244 227 if (StringUtils.isNotEmpty(request.getString("phenotype"))) 245 228 { 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")); 248 235 } 249 236 … … 423 410 } 424 411 425 public UploadPatient getUploadPatient()426 {427 return this.uploadPatient;428 }412 // public UploadPatient getUploadPatient() 413 // { 414 // return this.uploadPatient; 415 // } 429 416 430 417 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> 2 2 <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> 9 9 <tr><td colspan="4"><hr/></td></tr> 10 10 <tr><td></td><td></td><td></td><td align="right"><input type="submit" value="Proceed" onclick="__action.value='insertPatient';return true;"/></td></tr> 11 11 </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 69 69 } 70 70 71 public List<Patient> getAllPatients() throws DatabaseException, ParseException 72 { 73 return this.db.query(Patient.class).find(); 74 } 75 71 76 /** 72 77 * Find the highest patient number … … 121 126 db.beginTx(); 122 127 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 126 130 if (StringUtils.isNotEmpty(patientSummaryVO.getMutation1().getCdna_notation())) 127 131 { … … 133 137 } 134 138 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 138 141 if (StringUtils.isNotEmpty(patientSummaryVO.getMutation2().getCdna_notation())) 139 142 { … … 145 148 } 146 149 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)); 163 167 164 168 // Insert patient and set primary key -
molgenis_projects/col7a1/molgenis_db.xml
r3409 r3460 35 35 <unique fields="name"></unique> 36 36 </entity> 37 <entity name="Publication" >37 <entity name="Publication" decorator="decorator.PublicationDecorator"> 38 38 <description>A publication in a scientific journal.</description> 39 39 <field name="id" type="autoid" hidden="true" description="Primary key."/> 40 <field name="authors" description="Authors of publications." label="Author(s)"/> 40 41 <field name="title" description="Title." label="Title"/> 41 <field name="authors" description="Authors of publications." label="Authors"/>42 42 <field name="journal" description="The journal the publication appeared." label="Journal"/> 43 <field name="year" type="number" description="Publication year." label="Year"/> 43 44 <field name="volume" description="Volume the publication appeared." label="Volume"/> 44 45 <field name="issue" description="Issue the publication appeared." label="Issue"/> 45 46 <field name="startPage" description="Start page." label="Start page"/> 46 47 <field name="endPage" description="End page." label="End page"/> 47 <field name="year" type="number" description="Publication year." label="Year"/>48 48 <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"/> 50 50 <unique fields="title,pubmed"></unique> 51 51 </entity> … … 68 68 <entity name="Patient"> 69 69 <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"/> 72 72 <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?"/> 73 74 <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"/> 78 78 <unique fields="number_"></unique> 79 79 </entity> … … 104 104 <description>Part of an exon that has its codon changed.</description> 105 105 <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"/> 110 110 <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"/> 112 112 <field name="type_" type="enum" enum_options="[missenseMutation, nonsenseMutation, smallDeletion, smallInsertion, smallDuplication, indel, largeDeletion, largeDuplication, spliceSiteMutation, NA]" nillable="true" label="Type"/> 113 113 <field name="ntchange" description="Changed nucleotide(s) at given position." label="Nt change"/> … … 124 124 <field name="founderMutation" type="bool" description="Founder mutation?" nillable="true" label="Founder mutation?"/> 125 125 <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"/> 127 127 <unique fields="gene,cdna_notation"></unique> 128 128 </entity><!-- -
molgenis_projects/col7a1/molgenis_ui.xml
r3335 r3460 21 21 </menu> 22 22 --> 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"/>--> 28 31 <menu name="Management" position="left" label="Management"> 29 32 <form name="Gene" entity="Gene"/>
Note: See TracChangeset
for help on using the changeset viewer.