1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
import functools
import json
import pytest
from azure.core.credentials import AzureKeyCredential
from azure.healthinsights.clinicalmatching import ClinicalMatchingClient
from devtools_testutils import (
AzureRecordedTestCase,
PowerShellPreparer,
recorded_by_proxy,
)
HealthInsightsEnvPreparer = functools.partial(
PowerShellPreparer,
"healthinsights",
healthinsights_endpoint="https://fake_ad_resource.cognitiveservices.azure.com",
healthinsights_key="00000000000000000000000000000000",
)
class TestMatchTrials(AzureRecordedTestCase):
@pytest.mark.skip
@HealthInsightsEnvPreparer()
@recorded_by_proxy
def test_match_trials(self, healthinsights_endpoint, healthinsights_key):
clinical_matching_client = ClinicalMatchingClient(healthinsights_endpoint,
AzureKeyCredential(healthinsights_key))
assert clinical_matching_client is not None
data = {
"configuration": {
"clinicalTrials": {
"registryFilters": [
{
"conditions": [
"non small cell lung cancer (nsclc)"
],
"sources": [
"clinicaltrials_gov"
],
"recruitmentStatuses": [
"recruiting"
],
"facilityLocations": [
{
"city": "gilbert",
"state": "arizona",
"countryOrRegion": "United States"
}
]
}
]
},
"includeEvidence": True
},
"patients": [
{
"id": "patient1",
"info": {
"sex": "male",
"birthDate": "1961-04-25T09:54:29.5210127+00:00",
"clinicalInfo": [{
"system": "http://www.nlm.nih.gov/research/umls",
"code": "C0032181",
"name": "Platelet count",
"value": "250000"
},
{
"system": "http://www.nlm.nih.gov/research/umls",
"code": "C0002965",
"name": "Unstable Angina",
"value": "true"
},
{
"system": "http://www.nlm.nih.gov/research/umls",
"code": "C1522449",
"name": "Radiotherapy",
"value": "false"
},
{
"system": "http://www.nlm.nih.gov/research/umls",
"code": "C0242957",
"name": "GeneOrProtein-Expression",
"value": "Negative;EntityType:GENEORPROTEIN-EXPRESSION"
},
{
"system": "http://www.nlm.nih.gov/research/umls",
"code": "C1300072",
"name": "cancer stage",
"value": "2"
}]
}
}
]
}
poller = clinical_matching_client.begin_match_trials(data)
result = poller.result()
assert len(result.results.patients[0].inferences) is not 0
|