Medical::OPCS4 - OPCS4 Wrapper module
Version 0.01
Creates a new instance of the module.
my $O = Medical::OPCS4->new();
Parses the flat file containing the OPCS4 codes.
$O->parse( "/path/to/tsv/file/with/codes.txt" );
This method returns true on success and undef on failure.
my $Term = $O->get_term( 'A809' );
This method returns an Medical::OPCS4::Term object and undef on error.
my $ra_all_terms = $O->get_all_terms;
Returns a reference to an array of Medical::OPCS4::Term objects with all terms in the current file distribution.
This method returns undef on error.
my $rh_all_terms = $O->get_all_terms_hashref;
Returns a reference to a hash with all terms in the current file distribution. The keys of the hash are the OPCS4 terms and the values are the textual descriptions.
my $ParentTerm = $O->get_parent_term( 'A809' );
or
my $ParentTerm = $O->get_parent_term( $Term );
Returns the immediate parent term of a given term as an Medical::OPCS4::Term object. This method accepts both a scalar with the term name and a Medical::OPCS4::Term object as input
my $ParentTerm = $O->get_parent_term_string( 'A809' );
my $ParentTerm = $O->get_parent_term_string( $Term );
Returns the immediate parent term of a given term as a scalar. This method accepts both a scalar with the term name and a Medical::OPCS4::Term object as input.
my $ra_parent_terms = $O->get_parent_terms( 'A809' );
my $ra_parent_terms = $O->get_parent_terms( $Term );
Returns a reference to an array of Medical::OPCS4::Term objects of all parent terms of a given term. This method accepts both a scalar with the term name and a Medical::OPCS4::Term object as input.
my $ra_parent_terms = $O->get_parent_terms_string( 'A809' );
my $ra_parent_terms = $O->get_parent_terms_string( $Term );
Returns a reference to an array of scalars of all parent terms of a given term. This method accepts both a scalar with the term name and a Medical::OPCS4::Term object as input.
my $ra_child_terms = $O->get_child_terms( 'A809' );
my $ra_child_terms = $O->get_child_terms( $Term );
Returns a reference to an array of Medical::OPCS4::Term objects of all child terms of a given term. This method accepts both a scalar with the term name and a Medical::OPCS4::Term object as input.
my $ra_child_terms = $O->get_child_terms_string( 'A809' );
my $ra_child_terms = $O->get_child_terms_string( $Term );
Returns a reference to an array of scalars of all child terms of a given term. This method accepts both a scalar with the term name and a Medical::OPCS4::Term object as input.
Internal method used to format the output from different methods. Do not use this method directly.
To install Medical::OPCS4, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Medical::OPCS4
CPAN shell
perl -MCPAN -e shell install Medical::OPCS4
For more information on module installation, please visit the detailed CPAN module installation guide.