// Define some global attributes
include::_globattr.adoc[]

[[cd_drugner_ftp]]
Medication Annotation Functional Verification Test Plan
-------------------------------------------------------
Introduction;;

The ‘medication’ annotator (also referred to as drugner) provides functionality that complements well with existing annotators in {osp-short}. This annotator processes flat files or CDA (plain text wrapped with Clinical Document Architecture) documents to identify drugs and related attributes such as dosage, strength, route, etc. This annotator extracts data from both lists and narrative text.

Test Plan Purpose and Objectives
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Purpose
^^^^^^^
The purpose of this test plan is to verify the software component in combination with the latest {osp-short} pipeline works as architected. Accuracy of identifying drugs and their attributes is not part of this testing process. This test plan assumes that all the upstream annotators such as POS Tagger, Tokenizer, Sentence annotator in the {osp-short} pipeline function as expected.

Objectives
^^^^^^^^^^
Verify that DrugLookupWindow annotations are accurately generated
Verify Drug Annotator generates valid Drug Named Entities
Verify Drug Annotator generates valid attributes for Drug NE

 
[NOTE]
==============================================================================================================================================================
*Disclaimer*::
This should be considered a beta release of this annotator. Furthermore, this document was generated as a guideline for the testing process before the release of the annotator.
	See the 'Clinical Text Analysis and Knowledge Extraction System User Guide' documentation located in the {osp-short} *{inst-root-dir}/core/docs/userguide/{osp-short}_userguide.htm* for detailed install and setup information pertaining to all the {osp-short} components.  For additional, documentation pertaining to this annotator see  *{inst-root-dir}/drugner/doc/drugner.pdf* and *{inst-root-dir}/drugner/README* (for prerequisite and installation steps see *{inst-root-dir}/drugner/README*).
==============================================================================================================================================================

Reference Documents
^^^^^^^^^^^^^^^^^^^
The {osp-short} User Guide and the documentation pertaining to the annotator were used as reference in the prepration of this Test Plan.

Test Environment and Resource Requirements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Annotator testing will be performed using Eclipse Helios with Apache UIMA and JDK 1.5
- Data flow testing will include the use of nearly 1000 CDA documents
- Data generated will be compared with the original legacy component for accuracy

Test Cases
^^^^^^^^^^
The following annotators will be tested based on the steps described below. JUnit tests were not written for this process.

DrugLookupWindow Anotator
^^^^^^^^^^^^^^^^^^^^^^^^^
Verify that 'Drug Lookup Window' annotation span the text in the sections (referred to as 'list sections' in this document) 'Current Medications', 'Admission Medications', 'Dismissal Medication' which contain 'Drug Mentions' in list format. Furthermore, ensure that the 'NP type' chunks have 'Drug Lookup Window' and 'Lookup Window' annotations defined. The requirement here for the CDA documents is to have lookup window annotation to be defined for each of these sections.

* Test Case 1
** Select documents with one or more of the aforementioned sections
** Process the selected documents using the '{osp-short}' pipeline with 'Medication' module
** Ensure that the aforementioned sections have 'Drug Lookup Window' annotation

* Test Case 2
** Select documents with drug mentions in sections other than the ones mentioned above
** Process the selected documents using the '{osp-short}' pipeline with 'Medication' module
** Ensure that Drug Lookup Window annotation has been added to the spans containing drug mentions

Drug Annotator
^^^^^^^^^^^^^^
Verify that the 'Drug Mentions' in the Lookup Window and 'Drug Lookup Window' annotations generated in the previous test case are valid - based on the dictionaries used. Furthermore, ensure that attributes such as 'Dosage', 'Route', 'Frequency' and 'Frequency Unit' are annotated as designed.

* Test Case 1
** Select documents with one ore more 'Drug Mentions' outside the _list sections_ mentioned in the previous test case
** Process the selected documents using the '{osp-short}' pipeline with 'Medication' module
** Ensure that Drug Mention annotation has been added to the spans containing drug mentions

* Test Case 2
** Select documents with one ore more 'Drug Mentions' outside the _list sections_ mentioned in the previous test case
** Process the selected documents using the '{osp-short}' pipeline with 'Medication' module
** Ensure that Drug Mention annotation have appropriate attributes such as 'Dosage', 'Route', 'Frequency' and 'Frequency Unit' has been added as well 
