Skip to content

Commit 7a8af28

Browse files
authored
Add files via upload
1 parent d6eb69a commit 7a8af28

File tree

74 files changed

+14242
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+14242
-29
lines changed

__init__.py

+8-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
# Copyright 2018 IBM All Rights Reserved.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
1+
# *****************************************************************
2+
#
3+
# (C) Copyright Merative US L.P. and others 2018, 2023
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# *****************************************************************
148

15-
from .version import __version__
9+
from .version import __version__

annotator_for_clinical_data_v1.py

+9,364
Large diffs are not rendered by default.

common.py

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# *****************************************************************
2+
#
3+
# (C) Copyright Merative US L.P. and others 2019, 2023
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# *****************************************************************
8+
9+
"""
10+
This module provides common methods for use across all service modules.
11+
"""
12+
13+
import platform
14+
from .version import __version__
15+
16+
HEADER_NAME_USER_AGENT = 'User-Agent'
17+
SDK_NAME = 'whcs-python-sdk'
18+
19+
def get_system_info():
20+
"""
21+
Get information about the system to be inserted into the User-Agent header
22+
"""
23+
return '{0} {1} {2}'.format(platform.system(), # OS
24+
platform.release(), # OS version
25+
platform.python_version()) # Python version
26+
27+
28+
def get_user_agent():
29+
"""
30+
Get the value to be sent in the User-Agent header
31+
"""
32+
return USER_AGENT
33+
34+
35+
USER_AGENT = '{0}-{1} {2}'.format(SDK_NAME, __version__, get_system_info())
36+
37+
38+
def get_sdk_headers(service_name, service_version, operation_id):
39+
"""
40+
Get the request headers to be sent in requests by the SDK
41+
"""
42+
headers = {}
43+
headers[HEADER_NAME_USER_AGENT] = get_user_agent()
44+
return headers

config.ini

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# *****************************************************************
2+
#
3+
# (C) Copyright Merative US L.P. and others 2018, 2023
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# *****************************************************************
8+
9+
[settings]
10+
base_url =
11+
key =
12+
iam_url =
13+
version = 2021-08-27
14+
logging_level = ERROR
15+
disable_ssl = False
16+
flow = wh_acd.ibm_clinical_insights_v1.0_standard_flow
17+
profile = wh_acd.ibm_clinical_insights_v1.0_profile

pylint.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/bin/bash
2+
# *****************************************************************
3+
#
4+
# (C) Copyright Merative US L.P. and others 2018, 2023
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
# *****************************************************************
9+
210

311
python -m pylint ibm_whcs_sdk/annotator_for_clinical_data ibm_whcs_sdk/annotator_for_clinical_data/tests/unit ibm_whcs_sdk/annotator_for_clinical_data/tests/integration
412
python -m pylint ibm_whcs_sdk/insights_for_medical_literature ibm_whcs_sdk/insights_for_medical_literature/tests/unit ibm_whcs_sdk/insights_for_medical_literature/tests/integration

setup.py

+7-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
# coding: utf-8
2-
3-
# Copyright 2018 IBM All Rights Reserved.
4-
#
5-
# Licensed under the Apache License, Version 2.0 (the "License");
6-
# you may not use this file except in compliance with the License.
7-
# You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
1+
# *****************************************************************
2+
#
3+
# (C) Copyright Merative US L.P. and others 2018, 2023
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# *****************************************************************
168

179
from setuptools import setup, find_packages
1810
from setuptools.command.test import test as TestCommand

test_acd_acdflow_model.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# *****************************************************************
2+
#
3+
# (C) Copyright Merative US L.P. and others 2018, 2023
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# *****************************************************************
8+
9+
import ibm_whcs_sdk.annotator_for_clinical_data as wh
10+
11+
def test_AcdFlow_model():
12+
annotator_flows_list = wh.AnnotatorFlow(wh.Flow())
13+
model = wh.AcdFlow(id="id", name="name", description="describe", annotator_flows=[annotator_flows_list])
14+
assert model.__str__() is not None

test_acd_acdprofile_model.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# *****************************************************************
2+
#
3+
# (C) Copyright Merative US L.P. and others 2018, 2023
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# *****************************************************************
8+
9+
import ibm_whcs_sdk.annotator_for_clinical_data as wh
10+
11+
def test_AcdProfile_model():
12+
annotators_list = []
13+
model = wh.AcdProfile(id="id", name="name", description="very good", annotators=annotators_list)
14+
assert model.__str__() is not None

test_acd_allergy_medication_model.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# *****************************************************************
2+
#
3+
# (C) Copyright Merative US L.P. and others 2018, 2023
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# *****************************************************************
8+
9+
import ibm_whcs_sdk.annotator_for_clinical_data as wh
10+
11+
def test_AllergyMedication_model():
12+
medication_data = wh.MedicationAnnotation()
13+
model = wh.AllergyMedication(id="id", type="type", uid=1, begin=2, end=3, covered_text="covered", negated=False,
14+
hypothetical=False, section_normalized_name="snn", section_surface_form="ssf",
15+
medication=[medication_data])
16+
assert model.__str__() is not None

0 commit comments

Comments
 (0)