diff --git a/README.md b/README.md index 0c4b558..1d21654 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,8 @@ Built with Cogstack's [MedCAT](https://github.com/CogStack/MedCAT) package. 1. [Contributors](#Contributors) 2. [Installing](#Installing) 3. [Testing](#Testing) -4. [MIADE Notereader Debug Mode](#miade-notereader-debug-mode) -5. [Contributing](#Contributing) -6. [Licence](#Licence) +4. [Contributing](#Contributing) +5. [Licence](#Licence) ## Contributors @@ -44,98 +43,6 @@ pytest ./tests/* ``` > Remember, if using a virtual environment, to install pytest within your environment itself, otherwise you will be using the system python install of pytest, which will use system python and will not find your modules. -## MIADE Notereader Debug Mode -The debug mode allows control over the MIADE backend through the EPIC Notereader interface. -Specific pre-configured contents and models can be triggered by typing in keywords in the Notereader text box, allowing users to seamlessly -test and debug the MIADE integration with EPIC Notereader. - -There are 3 debug modes available, with varying degree of control over what concepts, models, and CDA specific content are returned to Notereader: -- ```PRESET```: bypasses the NLP model and returns a set of preloaded concepts -- ```CDA```: alters CDA specific content - -**TO BE DEVELOPED** -- ```MODEL```: allows control over which version of model MIADE runs, once version control is in place - -### Usage -The keywords to trigger the debug mode from Notereader are as follows: -``` -***DEBUG PRESET [code]*** -***DEBUG CDA [code]*** -***DEBUG MODEL [code]*** -``` -Note that the keywords can appear anywhere in the text. ```CDA``` mode can be used with either ```PRESET``` mode or on its own -. When used alone, ```CDA```mode will return MIADE NLP results as normal and only alter the CDA field contents. -Example uses: -``` -***DEBUG PRESET 0*** -***DEBUG CDA 3*** - -The patient is allergic to bee venom. This is an example note and none of the text entered here matters in preset mode. -``` -``` -***DEBUG CDA 2*** - -The patient is diagnosed with liver failure. The NLP results will be returned in the CDA, along with any CDA content customisations. -``` -### Configurations -Preloaded concepts and CDA customisation can be configured in [```configs/debug_configs.yml```](https://github.com/uclh-criu/miade/blob/master/src/miade/configs/debug_config.yml). An example config file is included as package data -with the MIADE module, but this can also be configured through the server. - -The format is as following: -```yaml -Preset: - [Code]: - [Concept Name]: - cui: [int] - ontologies: [str] - dosage: [Optional] - dose: - quantity: [int] - unit: [{ucum} unit] - duration: - low: [date string] - high: [date string] - frequency: - value: [float] - unit: [h/d/w/m/y] - route: - cui: [NCI Thesaurus code] - name: [str] - reaction: [Optional] - cui: [int] - name: [str] - ontologies: SNOMED CT - severity: - cui: [Act code] - name: [str] - ontologies: ActCode -CDA: - [Code]: - Problems: - [CDA field name]: [value to insert] - Medication: - Allergy: - -``` -The following CDA fields currently allow customisation for testing. More can be added as needed, but require changes to the CDA parser. -#### Problems -```yaml -statusCode: whether problem is an active concern to clinician -actEffectiveTimeHigh: time when the problem stop become a concern to clinician - there will always be a low (implicit) -observationEffectiveTimeLow: problem onset - can be a date in the past -observationEffectiveTimeHigh: problem resolve date - ``` -#### Medication -```yaml -consumableCodeSystemName: the code system name for medication - medication has separate blocks for name (NDC) and code (SNOMED CT) in test CDAs, maybe need experimentation? -consumableCodeSystemValue: template id of code system name -``` -#### Allergy -```yaml -allergySectionCodeName: either "Propensity to adverse reaction" or "Allergy to substance" - they both appear in test CDAs -allergySectionCodeValue: the SNOMED code for the allergy section code -``` - ## Contributing See [contributing](CONTRIBUTING.md) diff --git a/tests/conftest.py b/tests/conftest.py index 68b2939..cbe1e18 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,11 +15,6 @@ def model_directory_path() -> Path: return Path("./tests/data/models/") -@pytest.fixture(scope="function") -def debug_path() -> Path: - return Path("./tests/examples/example_debug_config.yml") - - @pytest.fixture(scope="function") def test_note() -> Note: return Note(text="Patient has liver failure and is taking paracetamol.") diff --git a/tests/examples/example_debug_config.yml b/tests/examples/example_debug_config.yml deleted file mode 100644 index fb63460..0000000 --- a/tests/examples/example_debug_config.yml +++ /dev/null @@ -1,56 +0,0 @@ -Presets: - 0: - Liver failure: - cui: 59927004 - ontologies: SNOMED CT - Paracetamol: - cui: 90332006 - ontologies: FDB - dosage: - dose: - value: 2 - unit: '{tbl}' - duration: - low: 20220606 - high: 20220620 - frequency: - value: 0.25 - unit: d - route: - value: C38288 - full_name: Oral - Penicillins: - cui: 84874 - ontologies: ELG - reaction: - cui: 74474003 - name: Gastrointestinal bleeding - ontologies: SNOMED CT - severity: - cui: M - name: Moderate - ontologies: SeverityObservation - -CDA: - 0: - Problems: - # whether problem is an active concern to clinician - statusCode: active - # time when the problem stop become a concern to clinician - there will always be a low (implicit) - actEffectiveTimeHigh: None - # problem onset - can be a date in the past - observationEffectiveTimeLow: 20200504 - # problem resolve date - observationEffectiveTimeHigh: 20210904 - Medication: - # the code system name for medication and template id to send back to the CDA - consumableCodeSystemName: RxNorm - consumableCodeSystemValue: 2.16.840.1.113883.6.88 - Allergy: - # the allergy section code to send back - either propensity to adverse reaction or allergy to substance - allergySectionCodeName: Propensity to adverse reaction - allergySectionCodeValue: 420134006 - -# model options - to be developed -Model: - modelId: 0 \ No newline at end of file