The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Medical::OPCS4 - OPCS4 Wrapper module

VERSION

Version 0.01

SYNOPSIS

METHODS

new

Creates a new instance of the module.

   my $O = Medical::OPCS4->new();

parse

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.

get_term

   my $Term = $O->get_term( 'A809' );

This method returns an Medical::OPCS4::Term object and undef on error.

get_all_terms

   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.

get_all_terms_hashref

   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.

This method returns undef on error.

get_parent_term

   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

This method returns undef on error.

get_parent_term_string

   my $ParentTerm = $O->get_parent_term_string( 'A809' );
   

or

   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.

This method returns undef on error.

get_parent_terms

   my $ra_parent_terms = $O->get_parent_terms( 'A809' );
   

or

   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.

This method returns undef on error.

get_parent_terms_string

   my $ra_parent_terms = $O->get_parent_terms_string( 'A809' );
   

or

   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.

This method returns undef on error.

get_child_terms

   my $ra_child_terms = $O->get_child_terms( 'A809' );
   

or

   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.

This method returns undef on error.

get_child_terms_string

   my $ra_child_terms = $O->get_child_terms_string( 'A809' );
   

or

   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.

This method returns undef on error.

_format_output

Internal method used to format the output from different methods. Do not use this method directly.