[bug 2714]
[bioperl-live.git] / Bio / Biblio / MedlineArticle.pm
blob94a8301e4187f8a50a56df159d7e7361c16dc97f
1 # $Id$
3 # BioPerl module for Bio::Biblio::MedlineArticle
5 # Cared for by Martin Senger <senger@ebi.ac.uk>
6 # For copyright and disclaimer see below.
8 # POD documentation - main docs before the code
10 =head1 NAME
12 Bio::Biblio::MedlineArticle - Representation of a MEDLINE article
14 =head1 SYNOPSIS
16 $obj = Bio::Biblio::MedlineArticle->new(-mesh_headings =>
17 #array ref of hashes
20 # how are Mesh terms stored:
21 use Data::Dumper;
22 print Data::Dumper->Dump ( [$obj->mesh_headings], ['MeshHeadings']);
24 #It produces (something like) this:
25 #'MeshHeadings' => [
26 # { 'descriptorName' => 'Adult' },
27 # { 'descriptorName' => 'Cardiovascular Diseases',
28 # 'subHeadings' => [ { 'subHeading' => 'etiology' },
29 # { 'majorTopic' => 'Y',
30 # 'subHeading' => 'mortality' } ] },
31 # { 'descriptorName' => 'Child Development',
32 # 'subHeadings' => [ { 'majorTopic' => 'Y',
33 # 'subHeading' => 'physiology' } ] },
34 # { 'descriptorName' => 'Human' },
35 # ]
37 =head1 DESCRIPTION
39 A storage object for a MEDLINE article.
40 See its place in the class hierarchy in
41 http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif
43 =head2 Attributes
45 The following attributes are specific to this class
46 (however, you can also set and get all attributes defined in the parent classes):
48 affiliation
49 chemicals type: array ref of hashes
50 citation_owner
51 comment_ins type: array ref of hashes
52 comment_ons type: array ref of hashes
53 date_of_electronic_publication
54 erratum_fors type: array ref of hashes
55 erratum_in type: array ref of hashes
56 gene_symbols
57 general_notes type: array ref of hashes
58 grant_list_complete
59 grants type: array ref of hashes
60 medline_date
61 medline_id
62 medline_page
63 mesh_headings type: array ref of hashes
64 number_of_references
65 original_report_ins type: array ref of hashes
66 other_abstracts type: array ref of hashes
67 other_ids type: array ref of hashes
68 other_languages
69 pmid
70 republished_froms type: array ref of hashes
71 republished_ins type: array ref of hashes
72 retraction_ins type: array ref of hashes
73 retraction_ofs type: array ref of hashes
74 season
75 status
76 summary_for_patients_ins type: array ref of hashes
77 update_ins type: array ref of hashes
78 update_ofs type: array ref of hashes
79 vernacular_title
81 =head1 SEE ALSO
83 =over 4
85 =item *
87 OpenBQS home page: http://www.ebi.ac.uk/~senger/openbqs/
89 =item *
91 Comments to the Perl client: http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html
93 =back
95 =head1 FEEDBACK
97 =head2 Mailing Lists
99 User feedback is an integral part of the evolution of this and other
100 Bioperl modules. Send your comments and suggestions preferably to
101 the Bioperl mailing list. Your participation is much appreciated.
103 bioperl-l@bioperl.org - General discussion
104 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
106 =head2 Reporting Bugs
108 Report bugs to the Bioperl bug tracking system to help us keep track
109 of the bugs and their resolution. Bug reports can be submitted via the
110 web:
112 http://bugzilla.open-bio.org/
114 =head1 AUTHORS
116 Heikki Lehvaslaiho (heikki-at-bioperl-dot-org),
117 Martin Senger (senger@ebi.ac.uk)
119 =head1 COPYRIGHT
121 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
123 This module is free software; you can redistribute it and/or modify
124 it under the same terms as Perl itself.
126 =head1 DISCLAIMER
128 This software is provided "as is" without warranty of any kind.
130 =cut
133 # Let the code begin...
136 package Bio::Biblio::MedlineArticle;
137 use strict;
140 use base qw(Bio::Biblio::Article);
143 # a closure with a list of allowed attribute names (these names
144 # correspond with the allowed 'get' and 'set' methods); each name also
145 # keep what type the attribute should be (use 'undef' if it is a
146 # simple scalar)
149 my %_allowed =
151 _affiliation => undef,
152 _chemicals => 'ARRAY',
153 _citation_owner => undef,
154 _comment_ins => 'ARRAY',
155 _comment_ons => 'ARRAY',
156 _date_of_electronic_publication => undef,
157 _erratum_fors => 'ARRAY',
158 _erratum_ins => 'ARRAY',
159 _gene_symbols => undef,
160 _general_notes => 'ARRAY',
161 _grant_list_complete => undef,
162 _grants => 'ARRAY',
163 _medline_date => undef,
164 _medline_id => undef,
165 _medline_page => undef,
166 _mesh_headings => 'ARRAY',
167 _number_of_references => undef,
168 _original_report_ins => 'ARRAY',
169 _other_abstracts => 'ARRAY',
170 _other_ids => 'ARRAY',
171 _other_languages => undef,
172 _pmid => undef,
173 _republished_froms => 'ARRAY',
174 _republished_ins => 'ARRAY',
175 _retraction_ins => 'ARRAY',
176 _retraction_ofs => 'ARRAY',
177 _season => undef,
178 _status => undef,
179 _summary_for_patients_ins => 'ARRAY',
180 _update_ins => 'ARRAY',
181 _update_ofs => 'ARRAY',
182 _vernacular_title => undef,
185 # return 1 if $attr is allowed to be set/get in this class
186 sub _accessible {
187 my ($self, $attr) = @_;
188 exists $_allowed{$attr} or $self->SUPER::_accessible ($attr);
191 # return an expected type of given $attr
192 sub _attr_type {
193 my ($self, $attr) = @_;
194 if (exists $_allowed{$attr}) {
195 return $_allowed{$attr};
196 } else {
197 return $self->SUPER::_attr_type ($attr);
204 __END__