From 574302463ce69e93ad73d609836c24c03da5933b Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Thu, 9 Mar 2023 14:23:12 +0200 Subject: [PATCH 01/17] health insights sdk for net --- .vscode/cspell.json | 4 + eng/common/scripts/Test-SampleMetadata.ps1 | 2 + .../Azure.Health.Insights.CancerProfiling.sln | 37 ++ .../CHANGELOG.md | 12 + .../Directory.Build.props | 6 + .../README.md | 175 +++++ ...Insights.CancerProfiling.netstandard2.0.cs | 256 ++++++++ .../samples/README.md | 24 + .../samples/Sample_InferCancerProfile.md | 196 ++++++ ...ure.Health.Insights.CancerProfiling.csproj | 25 + .../src/Constants.cs | 12 + ...reHealthInsightsClientBuilderExtensions.cs | 37 ++ .../src/Generated/CancerProfilingClient.cs | 193 ++++++ .../Generated/CancerProfilingClientOptions.cs | 37 ++ .../ClinicalCodedElement.Serialization.cs | 84 +++ .../src/Generated/ClinicalCodedElement.cs | 51 ++ .../src/Generated/ClinicalDocumentType.cs | 69 ++ .../ClinicalNoteEvidence.Serialization.cs | 56 ++ .../src/Generated/ClinicalNoteEvidence.cs | 52 ++ .../Generated/Docs/CancerProfilingClient.xml | 335 ++++++++++ .../DocumentContent.Serialization.cs | 33 + .../src/Generated/DocumentContent.cs | 41 ++ .../Generated/DocumentContentSourceType.cs | 55 ++ .../src/Generated/DocumentType.cs | 57 ++ .../InferenceEvidence.Serialization.cs | 65 ++ .../src/Generated/InferenceEvidence.cs | 42 ++ .../src/Generated/JobStatus.cs | 60 ++ .../OncoPhenotypeData.Serialization.cs | 41 ++ .../src/Generated/OncoPhenotypeData.cs | 33 + .../OncoPhenotypeInference.Serialization.cs | 84 +++ .../src/Generated/OncoPhenotypeInference.cs | 61 ++ .../Generated/OncoPhenotypeInferenceType.cs | 69 ++ ...enotypeModelConfiguration.Serialization.cs | 75 +++ .../OncoPhenotypeModelConfiguration.cs | 35 + ...ncoPhenotypePatientResult.Serialization.cs | 50 ++ .../Generated/OncoPhenotypePatientResult.cs | 45 ++ .../OncoPhenotypeResult.Serialization.cs | 91 +++ .../src/Generated/OncoPhenotypeResult.cs | 59 ++ .../OncoPhenotypeResults.Serialization.cs | 50 ++ .../src/Generated/OncoPhenotypeResults.cs | 45 ++ .../PatientDocument.Serialization.cs | 64 ++ .../src/Generated/PatientDocument.cs | 44 ++ .../Generated/PatientInfo.Serialization.cs | 63 ++ .../src/Generated/PatientInfo.cs | 30 + .../src/Generated/PatientInfoSex.cs | 54 ++ .../Generated/PatientRecord.Serialization.cs | 46 ++ .../src/Generated/PatientRecord.cs | 35 + .../src/GlobalSuppressions.cs | 11 + .../src/Properties/AssemblyInfo.cs | 7 + .../test-resources.json | 73 +++ ...alth.Insights.CancerProfiling.Tests.csproj | 33 + .../tests/CancerProfilingClientLiveTests.cs | 68 ++ .../HealthInsightsLiveTestBase.cs | 51 ++ .../HealthInsightsTestEnvironment.cs | 19 + .../tests/Samples/README.md | 5 + .../Samples/Sample_InferCancerProfile.cs | 200 ++++++ .../GetResultsFromCreateJob.json | 614 ++++++++++++++++++ .../GetResultsFromCreateJobAsync.json | 614 ++++++++++++++++++ .../CancerProfilingClientTest.request.json | 24 + .../tests/test.runsettings | 12 + ...Azure.Health.Insights.ClinicalMatching.sln | 37 ++ .../CHANGELOG.md | 12 + .../Directory.Build.props | 6 + .../README.md | 167 +++++ ...nsights.ClinicalMatching.netstandard2.0.cs | 557 ++++++++++++++++ .../samples/README.md | 22 + .../samples/Sample_MatchTrials.md | 155 +++++ ...re.Health.Insights.ClinicalMatching.csproj | 25 + .../src/Constants.cs | 12 + .../Generated/AcceptedAge.Serialization.cs | 33 + .../src/Generated/AcceptedAge.cs | 27 + .../AcceptedAgeRange.Serialization.cs | 39 ++ .../src/Generated/AcceptedAgeRange.cs | 23 + .../src/Generated/AgeUnit.cs | 54 ++ .../Generated/AreaGeometry.Serialization.cs | 38 ++ .../src/Generated/AreaGeometry.cs | 41 ++ .../Generated/AreaProperties.Serialization.cs | 33 + .../src/Generated/AreaProperties.cs | 27 + ...reHealthInsightsClientBuilderExtensions.cs | 37 ++ .../ClinicalCodedElement.Serialization.cs | 84 +++ .../src/Generated/ClinicalCodedElement.cs | 51 ++ .../src/Generated/ClinicalDocumentType.cs | 69 ++ .../src/Generated/ClinicalMatchingClient.cs | 193 ++++++ .../ClinicalMatchingClientOptions.cs | 37 ++ .../ClinicalNoteEvidence.Serialization.cs | 56 ++ .../src/Generated/ClinicalNoteEvidence.cs | 52 ++ .../src/Generated/ClinicalTrialAcceptedSex.cs | 54 ++ ...ClinicalTrialDemographics.Serialization.cs | 46 ++ .../Generated/ClinicalTrialDemographics.cs | 23 + .../ClinicalTrialDetails.Serialization.cs | 43 ++ .../src/Generated/ClinicalTrialDetails.cs | 38 ++ .../ClinicalTrialMetadata.Serialization.cs | 215 ++++++ .../src/Generated/ClinicalTrialMetadata.cs | 72 ++ .../src/Generated/ClinicalTrialPhase.cs | 63 ++ .../src/Generated/ClinicalTrialPurpose.cs | 75 +++ .../ClinicalTrialRecruitmentStatus.cs | 57 ++ ...inicalTrialRegistryFilter.Serialization.cs | 139 ++++ .../Generated/ClinicalTrialRegistryFilter.cs | 88 +++ ...icalTrialResearchFacility.Serialization.cs | 84 +++ .../ClinicalTrialResearchFacility.cs | 51 ++ .../src/Generated/ClinicalTrialSource.cs | 51 ++ .../src/Generated/ClinicalTrialStudyType.cs | 57 ++ .../Generated/ClinicalTrials.Serialization.cs | 49 ++ .../src/Generated/ClinicalTrials.cs | 35 + .../Generated/ContactDetails.Serialization.cs | 79 +++ .../src/Generated/ContactDetails.cs | 36 + .../Generated/Docs/ClinicalMatchingClient.xml | 583 +++++++++++++++++ .../DocumentContent.Serialization.cs | 33 + .../src/Generated/DocumentContent.cs | 41 ++ .../Generated/DocumentContentSourceType.cs | 55 ++ .../src/Generated/DocumentType.cs | 57 ++ ...endedClinicalCodedElement.Serialization.cs | 68 ++ .../Generated/ExtendedClinicalCodedElement.cs | 59 ++ .../src/Generated/GeoJsonGeometryType.cs | 48 ++ .../src/Generated/GeoJsonPropertiesSubType.cs | 48 ++ .../src/Generated/GeoJsonType.cs | 48 ++ .../Generated/GeographicArea.Serialization.cs | 35 + .../src/Generated/GeographicArea.cs | 38 ++ .../GeographicLocation.Serialization.cs | 41 ++ .../src/Generated/GeographicLocation.cs | 38 ++ .../src/Generated/JobStatus.cs | 60 ++ .../PatientDocument.Serialization.cs | 64 ++ .../src/Generated/PatientDocument.cs | 44 ++ .../Generated/PatientInfo.Serialization.cs | 63 ++ .../src/Generated/PatientInfo.cs | 30 + .../src/Generated/PatientInfoSex.cs | 54 ++ .../Generated/PatientRecord.Serialization.cs | 46 ++ .../src/Generated/PatientRecord.cs | 35 + .../TrialMatcherData.Serialization.cs | 41 ++ .../src/Generated/TrialMatcherData.cs | 33 + .../TrialMatcherInference.Serialization.cs | 106 +++ .../src/Generated/TrialMatcherInference.cs | 69 ++ ...lMatcherInferenceEvidence.Serialization.cs | 71 ++ .../TrialMatcherInferenceEvidence.cs | 46 ++ .../Generated/TrialMatcherInferenceType.cs | 48 ++ ...MatcherModelConfiguration.Serialization.cs | 55 ++ .../TrialMatcherModelConfiguration.cs | 43 ++ ...TrialMatcherPatientResult.Serialization.cs | 66 ++ .../Generated/TrialMatcherPatientResult.cs | 50 ++ .../TrialMatcherResult.Serialization.cs | 91 +++ .../src/Generated/TrialMatcherResult.cs | 59 ++ .../TrialMatcherResults.Serialization.cs | 62 ++ .../src/Generated/TrialMatcherResults.cs | 49 ++ .../src/GlobalSuppressions.cs | 11 + .../src/Properties/AssemblyInfo.cs | 7 + .../test-resources.json | 73 +++ ...lth.Insights.ClinicalMatching.Tests.csproj | 33 + .../tests/ClinicalMatchingClientLiveTests.cs | 60 ++ .../HealthInsightsLiveTestBase.cs | 51 ++ .../HealthInsightsTestEnvironment.cs | 19 + .../tests/Samples/README.md | 5 + .../tests/Samples/Sample_MatchTrials.cs | 164 +++++ .../GetResultsFromCreateJob.json | 374 +++++++++++ .../GetResultsFromCreateJobAsync.json | 374 +++++++++++ .../ClinicalMatchingClientTest.request.json | 68 ++ .../tests/test.runsettings | 12 + sdk/healthinsights/ci.yml | 32 + 157 files changed, 11823 insertions(+) create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/Azure.Health.Insights.CancerProfiling.sln create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/CHANGELOG.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/Directory.Build.props create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/api/Azure.Health.Insights.CancerProfiling.netstandard2.0.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample_InferCancerProfile.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Azure.Health.Insights.CancerProfiling.csproj create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Constants.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/AzureHealthInsightsClientBuilderExtensions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClientOptions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalDocumentType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Docs/CancerProfilingClient.xml create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContent.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContent.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContentSourceType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/JobStatus.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeData.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeData.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeModelConfiguration.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeModelConfiguration.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfoSex.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/GlobalSuppressions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Properties/AssemblyInfo.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/test-resources.json create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Azure.Health.Insights.CancerProfiling.Tests.csproj create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/CancerProfilingClientLiveTests.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Infrastructure/HealthInsightsLiveTestBase.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Infrastructure/HealthInsightsTestEnvironment.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/README.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample_InferCancerProfile.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/SessionRecords/CancerProfilingClientLiveTests/GetResultsFromCreateJob.json create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/SessionRecords/CancerProfilingClientLiveTests/GetResultsFromCreateJobAsync.json create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/TestData/CancerProfilingClientTest.request.json create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/test.runsettings create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/Azure.Health.Insights.ClinicalMatching.sln create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/CHANGELOG.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/Directory.Build.props create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/api/Azure.Health.Insights.ClinicalMatching.netstandard2.0.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample_MatchTrials.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Azure.Health.Insights.ClinicalMatching.csproj create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Constants.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AgeUnit.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaGeometry.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaGeometry.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaProperties.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaProperties.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AzureHealthInsightsClientBuilderExtensions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalDocumentType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClientOptions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialAcceptedSex.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialPhase.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialPurpose.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRecruitmentStatus.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRegistryFilter.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRegistryFilter.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialSource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialStudyType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContent.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContent.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContentSourceType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonGeometryType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonPropertiesSubType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicArea.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicArea.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/JobStatus.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfoSex.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherData.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherData.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherModelConfiguration.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherModelConfiguration.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/GlobalSuppressions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Properties/AssemblyInfo.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/test-resources.json create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Azure.Health.Insights.ClinicalMatching.Tests.csproj create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/ClinicalMatchingClientLiveTests.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Infrastructure/HealthInsightsLiveTestBase.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Infrastructure/HealthInsightsTestEnvironment.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/README.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample_MatchTrials.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJob.json create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJobAsync.json create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/TestData/ClinicalMatchingClientTest.request.json create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/test.runsettings create mode 100644 sdk/healthinsights/ci.yml diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 5f29c07ab250..31ec9a699d92 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -60,20 +60,24 @@ "deserializable", "deserializes", "diagnoser", + "dicom", "dont", "dotnetcli", "dtmf", "epsg", "expando", + "fhir", "finalizer", "finalizers", "illumos", + "interventional", "ints", "kubernetes", "lucene", "mgmt", "nunit", "odata", + "onco", "otel", "overridden", "parallelization", diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index 71c8972a8a36..c9851ded03bd 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -202,6 +202,8 @@ begin { "azure-genomics", "azure-hdinsight", "azure-hdinsight-rserver", + "azure-health-insights-cancerprofiling", + "azure-health-insights-clinicalmatching", "azure-hpc-cache", "azure-immersive-reader", "azure-information-protection", diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/Azure.Health.Insights.CancerProfiling.sln b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/Azure.Health.Insights.CancerProfiling.sln new file mode 100644 index 000000000000..d843364e2cc8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/Azure.Health.Insights.CancerProfiling.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32929.385 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Health.Insights.CancerProfiling", "src\Azure.Health.Insights.CancerProfiling.csproj", "{2D88565D-163A-4BB6-B95C-1CA4A21D5537}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Health.Insights.CancerProfiling.Tests", "tests\Azure.Health.Insights.CancerProfiling.Tests.csproj", "{00E239E3-F439-47C2-85D1-1CEEC623FFE0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2D88565D-163A-4BB6-B95C-1CA4A21D5537}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D88565D-163A-4BB6-B95C-1CA4A21D5537}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D88565D-163A-4BB6-B95C-1CA4A21D5537}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D88565D-163A-4BB6-B95C-1CA4A21D5537}.Release|Any CPU.Build.0 = Release|Any CPU + {00E239E3-F439-47C2-85D1-1CEEC623FFE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00E239E3-F439-47C2-85D1-1CEEC623FFE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00E239E3-F439-47C2-85D1-1CEEC623FFE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00E239E3-F439-47C2-85D1-1CEEC623FFE0}.Release|Any CPU.Build.0 = Release|Any CPU + {2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/CHANGELOG.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/CHANGELOG.md new file mode 100644 index 000000000000..d2adfc9bb564 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/CHANGELOG.md @@ -0,0 +1,12 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added +- Initial preview of the Azure.Health.Insights.CancerProfiling client library. + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/Directory.Build.props b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md new file mode 100644 index 000000000000..6d75cf6b251d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md @@ -0,0 +1,175 @@ +# Azure Cognitive Services Health Insights Cancer Profiling client library for .NET + + + +[Health Insights] is an Azure Applied AI Service built with the Azure Cognitive Services Framework, that leverages multiple Cognitive Services, Healthcare API services and other Azure resources. +The [Cancer Profiling model] receives clinical records of oncology patients and outputs cancer staging, such as clinical stage TNM categories and pathologic stage TNM categories as well as tumor site, histology. + +## Getting started + +### Prerequisites + +- You need an [Azure subscription][azure_sub] to use this package. +- An existing Cognitive Services Health Insights instance. + +### Install the package + +Install the Azure Health Insights client Cancer Profiling library for .NET with [NuGet][nuget]: + +```dotnetcli +dotnet add package Azure.Health.Insights.CancerProfiling --prerelease +``` + +This table shows the relationship between SDK versions and supported API versions of the service: + +|SDK version|Supported API version of service | +|-------------|---------------| +|1.0.0b1 | 2023-03-01-preview| + +### Authenticate the client + +You can find the endpoint for your Health Insights service resource using the +[Azure Portal](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesHealthInsights) +or [Azure CLI](https://learn.microsoft.com/cli/azure/): + +```bash +# Get the endpoint for the Health Insights service resource +az cognitiveservices account show --name "resource-name" --resource-group "resource-group-name" --query "properties.endpoint" +``` + +#### Get the API Key + +You can get the **API Key** from the Health Insights service resource in the Azure Portal. +Alternatively, you can use **Azure CLI** snippet below to get the API key of your resource. + +```PowerShell +az cognitiveservices account keys list --resource-group --name +``` + +#### Create CancerProfilingClient with AzureKeyCredential + +Once you have the value for the API key, create an `AzureKeyCredential`. With the endpoint and key credential, you can create the [`CancerProfilingClient`][cancer_profiling_client_class]: + +```C# +string endpoint = ""; +string apiKey = ""; +var credential = new AzureKeyCredential(apiKey); +var client = new CancerProfilingClient(new Uri(endpoint), credential); +``` + +### Long-Running Operations + +For large documents which take a long time to execute, these operations are implemented as [**long-running operations**][dotnet_lro]. Long-running operations consist of an initial request sent to the service to start an operation, followed by polling the service at intervals to determine whether the operation has completed or failed, and if it has succeeded, to get the result. + +For long running operations in the Azure SDK, the client exposes a `Start` method that returns an `Operation` or a `PageableOperation`. You can use the extension method `WaitForCompletionAsync()` to wait for the operation to complete and obtain its result. A sample code snippet is provided to illustrate using long-running operations [below](#run-multiple-actions-asynchronously). + +## Key concepts +The Cancer Profiling model allows you to infer cancer attributes such as tumor site, histology, clinical stage TNM categories and pathologic stage TNM categories from unstructured clinical documents. + +## Examples + +- [Infer Cancer Profiling](#cancer-profiling) + +### Cancer Profiling + +```C# Snippet:HealthInsightsCancerProfilingClientInferCancerProfileAsync +OncoPhenotypeResult oncoPhenotypeResult = default; +try +{ + Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); + Response resp = operation.GetRawResponse(); + oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); +} +catch (Exception ex) +{ + Console.WriteLine(ex.ToString()); + return; +} +``` +```C# Snippet:HealthInsightsCancerProfilingInferCancerProfileAsyncViewResults +// View operation results +if (oncoPhenotypeResult.Status == JobStatus.Succeeded) +{ + OncoPhenotypeResults oncoResults = oncoPhenotypeResult.Results; + foreach (OncoPhenotypePatientResult patientResult in oncoResults.Patients) + { + Console.WriteLine($"\n==== Inferences of Patient {patientResult.Id} ===="); + foreach (OncoPhenotypeInference oncoInference in patientResult.Inferences) + { + Console.WriteLine($"\n=== Clinical Type: {oncoInference.Type.ToString()} Value: {oncoInference.Value} ConfidenceScore: {oncoInference.ConfidenceScore} ==="); + foreach (InferenceEvidence evidence in oncoInference.Evidence) + { + if (evidence.PatientDataEvidence != null) + { + var dataEvidence = evidence.PatientDataEvidence; + Console.WriteLine($"Evidence {dataEvidence.Id} {dataEvidence.Offset} {dataEvidence.Length} {dataEvidence.Text}"); + } + if (evidence.PatientInfoEvidence != null) + { + var infoEvidence = evidence.PatientInfoEvidence; + Console.WriteLine($"Evidence {infoEvidence.System} {infoEvidence.Code} {infoEvidence.Name} {infoEvidence.Value}"); + } + } + } + } +} +else +{ + IReadOnlyList oncoErrors = oncoPhenotypeResult.Errors; + foreach (ResponseError error in oncoErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } +} +``` + +## Troubleshooting + +### Setting up console logging + +The simplest way to see the logs is to enable the console logging. +To create an Azure SDK log listener that outputs messages to console use the AzureEventSourceListener.CreateConsoleLogger method. + +```C# +// Setup a listener to monitor logged events. +using AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger(); +``` + +To learn more about other logging mechanisms see [Diagnostics Samples][logging]. + +## Next steps + + + + +### Additional documentation + + + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla]. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + +[cancer_profiling_client_class]: + + +[DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md +[cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli +[logging]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/samples/Diagnostics.md +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/dotnet/ +[nuget]: https://www.nuget.org/ +[azure_portal]: https://portal.azure.com +[cla]: https://cla.microsoft.com +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/api/Azure.Health.Insights.CancerProfiling.netstandard2.0.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/api/Azure.Health.Insights.CancerProfiling.netstandard2.0.cs new file mode 100644 index 000000000000..2047c82c9fcc --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/api/Azure.Health.Insights.CancerProfiling.netstandard2.0.cs @@ -0,0 +1,256 @@ +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class CancerProfilingClient + { + protected CancerProfilingClient() { } + public CancerProfilingClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public CancerProfilingClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Health.Insights.CancerProfiling.CancerProfilingClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Operation InferCancerProfile(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string repeatabilityRequestId = null, System.DateTimeOffset? repeatabilityFirstSent = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation InferCancerProfile(Azure.WaitUntil waitUntil, Azure.Health.Insights.CancerProfiling.OncoPhenotypeData oncoPhenotypeData, string repeatabilityRequestId = null, System.DateTimeOffset? repeatabilityFirstSent = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InferCancerProfileAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string repeatabilityRequestId = null, System.DateTimeOffset? repeatabilityFirstSent = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> InferCancerProfileAsync(Azure.WaitUntil waitUntil, Azure.Health.Insights.CancerProfiling.OncoPhenotypeData oncoPhenotypeData, string repeatabilityRequestId = null, System.DateTimeOffset? repeatabilityFirstSent = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class CancerProfilingClientOptions : Azure.Core.ClientOptions + { + public CancerProfilingClientOptions(Azure.Health.Insights.CancerProfiling.CancerProfilingClientOptions.ServiceVersion version = Azure.Health.Insights.CancerProfiling.CancerProfilingClientOptions.ServiceVersion.V2023_03_01_Preview) { } + public enum ServiceVersion + { + V2023_03_01_Preview = 1, + } + } + public partial class ClinicalCodedElement + { + public ClinicalCodedElement(string system, string code) { } + public string Code { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string System { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ClinicalDocumentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ClinicalDocumentType(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType Consultation { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType DischargeSummary { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType HistoryAndPhysical { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType Imaging { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType Laboratory { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType Pathology { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType Procedure { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType Progress { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.ClinicalDocumentType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.CancerProfiling.ClinicalDocumentType left, Azure.Health.Insights.CancerProfiling.ClinicalDocumentType right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.ClinicalDocumentType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.ClinicalDocumentType left, Azure.Health.Insights.CancerProfiling.ClinicalDocumentType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ClinicalNoteEvidence + { + internal ClinicalNoteEvidence() { } + public string Id { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + public string Text { get { throw null; } } + } + public partial class DocumentContent + { + public DocumentContent(Azure.Health.Insights.CancerProfiling.DocumentContentSourceType sourceType, string value) { } + public Azure.Health.Insights.CancerProfiling.DocumentContentSourceType SourceType { get { throw null; } } + public string Value { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentContentSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentContentSourceType(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.DocumentContentSourceType Inline { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.DocumentContentSourceType Reference { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.DocumentContentSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.CancerProfiling.DocumentContentSourceType left, Azure.Health.Insights.CancerProfiling.DocumentContentSourceType right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.DocumentContentSourceType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.DocumentContentSourceType left, Azure.Health.Insights.CancerProfiling.DocumentContentSourceType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentType(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.DocumentType Dicom { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.DocumentType FhirBundle { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.DocumentType GenomicSequencing { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.DocumentType Note { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.DocumentType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.CancerProfiling.DocumentType left, Azure.Health.Insights.CancerProfiling.DocumentType right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.DocumentType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.DocumentType left, Azure.Health.Insights.CancerProfiling.DocumentType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class InferenceEvidence + { + internal InferenceEvidence() { } + public float? Importance { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.ClinicalNoteEvidence PatientDataEvidence { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.ClinicalCodedElement PatientInfoEvidence { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobStatus(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.JobStatus Failed { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.JobStatus NotStarted { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.JobStatus PartiallyCompleted { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.JobStatus Running { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.JobStatus Succeeded { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.JobStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.CancerProfiling.JobStatus left, Azure.Health.Insights.CancerProfiling.JobStatus right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.JobStatus (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.JobStatus left, Azure.Health.Insights.CancerProfiling.JobStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OncoPhenotypeData + { + public OncoPhenotypeData(System.Collections.Generic.IEnumerable patients) { } + public Azure.Health.Insights.CancerProfiling.OncoPhenotypeModelConfiguration Configuration { get { throw null; } set { } } + public System.Collections.Generic.IList Patients { get { throw null; } } + } + public partial class OncoPhenotypeInference + { + internal OncoPhenotypeInference() { } + public string CaseId { get { throw null; } } + public float? ConfidenceScore { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Evidence { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType Type { get { throw null; } } + public string Value { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OncoPhenotypeInferenceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OncoPhenotypeInferenceType(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType ClinicalStageM { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType ClinicalStageN { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType ClinicalStageT { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType Histology { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType PathologicStageM { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType PathologicStageN { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType PathologicStageT { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType TumorSite { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType left, Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType left, Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OncoPhenotypeModelConfiguration + { + public OncoPhenotypeModelConfiguration() { } + public bool? CheckForCancerCase { get { throw null; } set { } } + public bool? IncludeEvidence { get { throw null; } set { } } + public System.Collections.Generic.IList InferenceTypes { get { throw null; } } + public bool? Verbose { get { throw null; } set { } } + } + public partial class OncoPhenotypePatientResult + { + internal OncoPhenotypePatientResult() { } + public string Id { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Inferences { get { throw null; } } + } + public partial class OncoPhenotypeResult + { + internal OncoPhenotypeResult() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdateDateTime { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.OncoPhenotypeResults Results { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.JobStatus Status { get { throw null; } } + } + public partial class OncoPhenotypeResults + { + internal OncoPhenotypeResults() { } + public string ModelVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Patients { get { throw null; } } + } + public partial class PatientDocument + { + public PatientDocument(Azure.Health.Insights.CancerProfiling.DocumentType type, string id, Azure.Health.Insights.CancerProfiling.DocumentContent content) { } + public Azure.Health.Insights.CancerProfiling.ClinicalDocumentType? ClinicalType { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.DocumentContent Content { get { throw null; } } + public System.DateTimeOffset? CreatedDateTime { get { throw null; } set { } } + public string Id { get { throw null; } } + public string Language { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.DocumentType Type { get { throw null; } } + } + public partial class PatientInfo + { + public PatientInfo() { } + public System.DateTimeOffset? BirthDate { get { throw null; } set { } } + public System.Collections.Generic.IList ClinicalInfo { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.PatientInfoSex? Sex { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatientInfoSex : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatientInfoSex(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.PatientInfoSex Female { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.PatientInfoSex Male { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.PatientInfoSex Unspecified { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.PatientInfoSex other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.CancerProfiling.PatientInfoSex left, Azure.Health.Insights.CancerProfiling.PatientInfoSex right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.PatientInfoSex (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.PatientInfoSex left, Azure.Health.Insights.CancerProfiling.PatientInfoSex right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PatientRecord + { + public PatientRecord(string id) { } + public System.Collections.Generic.IList Data { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.PatientInfo Info { get { throw null; } set { } } + } +} +namespace Microsoft.Extensions.Azure +{ + public static partial class AzureHealthInsightsClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddCancerProfilingClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddCancerProfilingClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md new file mode 100644 index 000000000000..7057a5586ca9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md @@ -0,0 +1,24 @@ +--- +page_type: sample +languages: +- csharp +products: +- azure +- azure-cognitive-services +- azure-health-insights-cancerprofiling +name: Azure Health Insights - Cancer Profiling samples for .NET +description: Samples for the Azure.Health.Insights.CancerProfiling client library +--- + +# Azure Health Insights CancerProfiling client SDK Samples +These code samples show common scenario operations with the Azure Health Insights CancerProfiling client library. + +|**Sample Name**|**Description**| +|----------------|-------------| +|[Sample_InferCancerProfile][sample_get_the_inferred_cancer_staging_for_an_oncology_patient] |Get the inferred cancer staging for an oncology patient.| + + + + diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample_InferCancerProfile.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample_InferCancerProfile.md new file mode 100644 index 000000000000..81cd07b03273 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample_InferCancerProfile.md @@ -0,0 +1,196 @@ +# Get the inferred cancer staging for an oncology patient +This sample demonstrates how to get the inferred cancer staging, such as pTNM staging and histology codes, for an oncology patient, based on his/her clinical documents (medical records), and to review the clinical evidence for each inference, extracted from these documents. + +## Creating a `CancerProfilingClient` + +To create a new `CancerProfilingClient` to get the inferred cancer staging, you need a Cognitive Services endpoint and credentials. You can use the [DefaultAzureCredential][DefaultAzureCredential] to try a number of common authentication methods optimized for both running as a service and development. In the sample below, however, you'll use a AzureHealthInsights service API key credential by creating an `AzureKeyCredential` object, that if needed, will allow you to update the API key without creating a new client. + +You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. + +```C# Snippet:CreateCancerProfilingClient +// Read endpoint and apiKey +string endpoint = TestEnvironment.Endpoint; +string apiKey = TestEnvironment.ApiKey; + +var endpointUri = new Uri(endpoint); +var credential = new AzureKeyCredential(apiKey); + +// Create CancerProfilingClient +CancerProfilingClient client = new CancerProfilingClient(endpointUri, credential); +``` + +## Get the inferred pTNM staging and histology codes for an oncology patient + +To get the inferred pTNM staging and histology codes for an oncology patient, call `InferCancerProfileAsync` on an instance of `OncoPhenotypeData`. The result is a Long Running operation of type `OncoPhenotypeResult`. + +```C# Snippet:HealthInsightsOncoPhenotypeData +// Create Patient +PatientRecord patient1 = new PatientRecord("patient_id") +{ + Info = new PatientInfo + { + BirthDate = new System.DateTime(1979, 10, 08), + Sex = PatientInfoSex.Female + } +}; + +// Add imaging document +string docContent1 = @" + 15.8.2021 + Jane Doe 091175-8967 + 42 year old female, married with 3 children, works as a nurse. + Healthy, no medications taken on a regular basis. + PMHx is significant for migraines with aura, uses Mirena for contraception. + Smoking history of 10 pack years (has stopped and relapsed several times). + She is in c/o 2 weeks of productive cough and shortness of breath. + She has a fever of 37.8 and general weakness. + Denies night sweats and rash. She denies symptoms of rhinosinusitis, asthma, and heartburn. + On PE: + GENERAL: mild pallor, no cyanosis. Regular breathing rate. + LUNGS: decreased breath sounds on the base of the right lung. Vesicular breathing. + No crackles, rales, and wheezes. Resonant percussion. + PLAN: + Will be referred for a chest x-ray. + ====================================== + CXR showed mild nonspecific opacities in right lung base. + PLAN: + Findings are suggestive of a working diagnosis of pneumonia. The patient is referred to a follow-up CXR in 2 weeks."; + +PatientDocument patientDocument1 = new PatientDocument(DocumentType.Note, + "doc1", + new DocumentContent(DocumentContentSourceType.Inline, docContent1)) +{ + ClinicalType = ClinicalDocumentType.Imaging, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2021-08-15T00:00:00") +}; +patient1.Data.Add(patientDocument1); + +// Add Pathology documents +string docContent2 = @" + Oncology Clinic + 20.10.2021 + Jane Doe 091175-8967 + 42-year-old healthy female who works as a nurse in the ER of this hospital. + First menstruation at 11 years old. First delivery- 27 years old. She has 3 children. + Didn’t breastfeed. + Contraception- Mirena. + Smoking- 10 pack years. + Mother- Belarusian. Father- Georgian. + About 3 months prior to admission, she stated she had SOB and was febrile. + She did a CXR as an outpatient which showed a finding in the base of the right lung- possibly an infiltrate. + She was treated with antibiotics with partial response. + 6 weeks later a repeat CXR was performed- a few solid dense findings in the right lung. + Therefore, she was referred for a PET-CT which demonstrated increased uptake in the right breast, lymph nodes on the right a few areas in the lungs and liver. + On biopsy from the lesion in the right breast- triple negative adenocarcinoma. Genetic testing has not been done thus far. + Genetic counseling- the patient denies a family history of breast, ovary, uterus, and prostate cancer. Her mother has chronic lymphocytic leukemia (CLL). + She is planned to undergo genetic tests because the aggressive course of the disease, and her young age. + Impression: + Stage 4 triple negative breast adenocarcinoma. + Could benefit from biological therapy. + Different treatment options were explained- the patient wants to get a second opinion."; +PatientDocument patientDocument2 = new PatientDocument(DocumentType.Note, + "doc2", + new DocumentContent(DocumentContentSourceType.Inline, docContent2)) +{ + ClinicalType = ClinicalDocumentType.Pathology, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2021-10-20T22:00:00.00") +}; + +patient1.Data.Add(patientDocument2); + +string docContent3 = @" + PATHOLOGY REPORT + Clinical Information + Ultrasound-guided biopsy; A. 18 mm mass; most likely diagnosis based on imaging: IDC + Diagnosis + A. BREAST, LEFT AT 2:00 4 CM FN; ULTRASOUND-GUIDED NEEDLE CORE BIOPSIES: + - Invasive carcinoma of no special type (invasive ductal carcinoma), grade 1 + Nottingham histologic grade: 1/3 (tubules 2; nuclear grade 2; mitotic rate 1; total score; 5/9) + Fragments involved by invasive carcinoma: 2 + Largest measurement of invasive carcinoma on a single fragment: 7 mm + Ductal carcinoma in situ (DCIS): Present + Architectural pattern: Cribriform + Nuclear grade: 2- + -intermediate + Necrosis: Not identified + Fragments involved by DCIS: 1 + Largest measurement of DCIS on a single fragment: Span 2 mm + Microcalcifications: Present in benign breast tissue and invasive carcinoma + Blocks with invasive carcinoma: A1 + Special studies: Pending"; + +PatientDocument patientDocument3 = new PatientDocument(DocumentType.Note, + "doc3", + new DocumentContent(DocumentContentSourceType.Inline, docContent3)) +{ + ClinicalType = ClinicalDocumentType.Pathology, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2022-01-01T00:00:00") +}; +patient1.Data.Add(patientDocument3); + +// Set configuration to include evidence for the cancer staging inferences +var configuration = new OncoPhenotypeModelConfiguration() { IncludeEvidence = true }; + +// Create OncoPhenotypeData with patient and configration +var oncoPhenotypeData = new OncoPhenotypeData(new List { patient1 }) { Configuration = configuration }; +``` + +Call InferCancerProfileAsync to submit an Oncology async request and get the Onco-Phenotype result + + +```C# Snippet:HealthInsightsCancerProfilingClientInferCancerProfileAsync +OncoPhenotypeResult oncoPhenotypeResult = default; +try +{ + Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); + Response resp = operation.GetRawResponse(); + oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); +} +catch (Exception ex) +{ + Console.WriteLine(ex.ToString()); + return; +} +``` + +To view the oncology inferences: + +```C# Snippet:HealthInsightsCancerProfilingInferCancerProfileAsyncViewResults +// View operation results +if (oncoPhenotypeResult.Status == JobStatus.Succeeded) +{ + OncoPhenotypeResults oncoResults = oncoPhenotypeResult.Results; + foreach (OncoPhenotypePatientResult patientResult in oncoResults.Patients) + { + Console.WriteLine($"\n==== Inferences of Patient {patientResult.Id} ===="); + foreach (OncoPhenotypeInference oncoInference in patientResult.Inferences) + { + Console.WriteLine($"\n=== Clinical Type: {oncoInference.Type.ToString()} Value: {oncoInference.Value} ConfidenceScore: {oncoInference.ConfidenceScore} ==="); + foreach (InferenceEvidence evidence in oncoInference.Evidence) + { + if (evidence.PatientDataEvidence != null) + { + var dataEvidence = evidence.PatientDataEvidence; + Console.WriteLine($"Evidence {dataEvidence.Id} {dataEvidence.Offset} {dataEvidence.Length} {dataEvidence.Text}"); + } + if (evidence.PatientInfoEvidence != null) + { + var infoEvidence = evidence.PatientInfoEvidence; + Console.WriteLine($"Evidence {infoEvidence.System} {infoEvidence.Code} {infoEvidence.Name} {infoEvidence.Value}"); + } + } + } + } +} +else +{ + IReadOnlyList oncoErrors = oncoPhenotypeResult.Errors; + foreach (ResponseError error in oncoErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } +} +``` diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Azure.Health.Insights.CancerProfiling.csproj b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Azure.Health.Insights.CancerProfiling.csproj new file mode 100644 index 000000000000..447ff75e041f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Azure.Health.Insights.CancerProfiling.csproj @@ -0,0 +1,25 @@ + + + This is the Azure Health Insights CancerProfiling client library for developing .NET applications with rich experience. + Azure SDK Code Generation HealthInsights for Azure Data Plane + 1.0.0-beta.1 + Azure Health Insights + $(RequiredTargetFrameworks) + true + $(NoWarn);CS1591;AZC0012 + true + true + + + + + + + + + + + + + + diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Constants.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Constants.cs new file mode 100644 index 000000000000..79a5cd6ed0f5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Constants.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Health.Insights.CancerProfiling +{ + internal static class Constants + { + public const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + + public const string DefaultCognitiveScope = "https://cognitiveservices.azure.com/.default"; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/AzureHealthInsightsClientBuilderExtensions.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/AzureHealthInsightsClientBuilderExtensions.cs new file mode 100644 index 000000000000..637d37a69758 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/AzureHealthInsightsClientBuilderExtensions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core.Extensions; +using Azure.Health.Insights.CancerProfiling; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class AzureHealthInsightsClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddCancerProfilingClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new CancerProfilingClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddCancerProfilingClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs new file mode 100644 index 000000000000..3898a67d10ad --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Health.Insights.CancerProfiling +{ + // Data plane generated client. + /// The CancerProfiling service client. + public partial class CancerProfilingClient + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of CancerProfilingClient for mocking. + protected CancerProfilingClient() + { + } + + /// Initializes a new instance of CancerProfilingClient. + /// Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + /// A credential used to authenticate to an Azure Service. + /// or is null. + public CancerProfilingClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new CancerProfilingClientOptions()) + { + } + + /// Initializes a new instance of CancerProfilingClient. + /// Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public CancerProfilingClient(Uri endpoint, AzureKeyCredential credential, CancerProfilingClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new CancerProfilingClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Create Onco Phenotype job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The body of the Onco Phenotype request. + /// An opaque, globally-unique, client-generated string identifier for the request. + /// Specifies the date and time at which the request was first created. + /// The cancellation token to use. + /// is null. + /// Creates an Onco Phenotype job with the given request body. + public virtual async Task> InferCancerProfileAsync(WaitUntil waitUntil, OncoPhenotypeData oncoPhenotypeData, string repeatabilityRequestId = null, DateTimeOffset? repeatabilityFirstSent = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(oncoPhenotypeData, nameof(oncoPhenotypeData)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await InferCancerProfileAsync(waitUntil, oncoPhenotypeData.ToRequestContent(), repeatabilityRequestId, repeatabilityFirstSent, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, OncoPhenotypeResult.FromResponse, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile"); + } + + /// Create Onco Phenotype job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The body of the Onco Phenotype request. + /// An opaque, globally-unique, client-generated string identifier for the request. + /// Specifies the date and time at which the request was first created. + /// The cancellation token to use. + /// is null. + /// Creates an Onco Phenotype job with the given request body. + public virtual Operation InferCancerProfile(WaitUntil waitUntil, OncoPhenotypeData oncoPhenotypeData, string repeatabilityRequestId = null, DateTimeOffset? repeatabilityFirstSent = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(oncoPhenotypeData, nameof(oncoPhenotypeData)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = InferCancerProfile(waitUntil, oncoPhenotypeData.ToRequestContent(), repeatabilityRequestId, repeatabilityFirstSent, context); + return ProtocolOperationHelpers.Convert(response, OncoPhenotypeResult.FromResponse, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile"); + } + + /// Create Onco Phenotype job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content to send as the body of the request. Details of the request body schema are in the Remarks section below. + /// An opaque, globally-unique, client-generated string identifier for the request. + /// Specifies the date and time at which the request was first created. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service that will contain a object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. + /// + public virtual async Task> InferCancerProfileAsync(WaitUntil waitUntil, RequestContent content, string repeatabilityRequestId = null, DateTimeOffset? repeatabilityFirstSent = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("CancerProfilingClient.InferCancerProfile"); + scope.Start(); + try + { + using HttpMessage message = CreateInferCancerProfileRequest(content, repeatabilityRequestId, repeatabilityFirstSent, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Onco Phenotype job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content to send as the body of the request. Details of the request body schema are in the Remarks section below. + /// An opaque, globally-unique, client-generated string identifier for the request. + /// Specifies the date and time at which the request was first created. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service that will contain a object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. + /// + public virtual Operation InferCancerProfile(WaitUntil waitUntil, RequestContent content, string repeatabilityRequestId = null, DateTimeOffset? repeatabilityFirstSent = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("CancerProfilingClient.InferCancerProfile"); + scope.Start(); + try + { + using HttpMessage message = CreateInferCancerProfileRequest(content, repeatabilityRequestId, repeatabilityFirstSent, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile", OperationFinalStateVia.Location, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateInferCancerProfileRequest(RequestContent content, string repeatabilityRequestId, DateTimeOffset? repeatabilityFirstSent, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/healthinsights", false); + uri.AppendPath("/oncophenotype/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (repeatabilityRequestId != null) + { + request.Headers.Add("Repeatability-Request-ID", repeatabilityRequestId); + } + if (repeatabilityFirstSent != null) + { + request.Headers.Add("Repeatability-First-Sent", repeatabilityFirstSent.Value, "O"); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200202; + private static ResponseClassifier ResponseClassifier200202 => _responseClassifier200202 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 202 }); + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClientOptions.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClientOptions.cs new file mode 100644 index 000000000000..689615bab2c8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// Client options for CancerProfilingClient. + public partial class CancerProfilingClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2023_03_01_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-03-01-preview". + V2023_03_01_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of CancerProfilingClientOptions. + public CancerProfilingClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_03_01_Preview => "2023-03-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.Serialization.cs new file mode 100644 index 000000000000..60d4a2b34584 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class ClinicalCodedElement : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + writer.WriteEndObject(); + } + + internal static ClinicalCodedElement DeserializeClinicalCodedElement(JsonElement element) + { + string system = default; + string code = default; + Optional name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + } + return new ClinicalCodedElement(system, code, name, value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ClinicalCodedElement FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeClinicalCodedElement(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.cs new file mode 100644 index 000000000000..9bdf6c1439e3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// A piece of clinical information, expressed as a code in a clinical coding system. + public partial class ClinicalCodedElement + { + /// Initializes a new instance of ClinicalCodedElement. + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + /// The code within the given clinical coding system. + /// or is null. + public ClinicalCodedElement(string system, string code) + { + Argument.AssertNotNull(system, nameof(system)); + Argument.AssertNotNull(code, nameof(code)); + + System = system; + Code = code; + } + + /// Initializes a new instance of ClinicalCodedElement. + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + /// The code within the given clinical coding system. + /// The name of this coded concept in the coding system. + /// A value associated with the code within the given clinical coding system. + internal ClinicalCodedElement(string system, string code, string name, string value) + { + System = system; + Code = code; + Name = name; + Value = value; + } + + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + public string System { get; set; } + /// The code within the given clinical coding system. + public string Code { get; set; } + /// The name of this coded concept in the coding system. + public string Name { get; set; } + /// A value associated with the code within the given clinical coding system. + public string Value { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalDocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalDocumentType.cs new file mode 100644 index 000000000000..7bfe9c484b2a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalDocumentType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The type of the clinical document. + public readonly partial struct ClinicalDocumentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClinicalDocumentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConsultationValue = "consultation"; + private const string DischargeSummaryValue = "dischargeSummary"; + private const string HistoryAndPhysicalValue = "historyAndPhysical"; + private const string ProcedureValue = "procedure"; + private const string ProgressValue = "progress"; + private const string ImagingValue = "imaging"; + private const string LaboratoryValue = "laboratory"; + private const string PathologyValue = "pathology"; + + /// consultation. + public static ClinicalDocumentType Consultation { get; } = new ClinicalDocumentType(ConsultationValue); + /// dischargeSummary. + public static ClinicalDocumentType DischargeSummary { get; } = new ClinicalDocumentType(DischargeSummaryValue); + /// historyAndPhysical. + public static ClinicalDocumentType HistoryAndPhysical { get; } = new ClinicalDocumentType(HistoryAndPhysicalValue); + /// procedure. + public static ClinicalDocumentType Procedure { get; } = new ClinicalDocumentType(ProcedureValue); + /// progress. + public static ClinicalDocumentType Progress { get; } = new ClinicalDocumentType(ProgressValue); + /// imaging. + public static ClinicalDocumentType Imaging { get; } = new ClinicalDocumentType(ImagingValue); + /// laboratory. + public static ClinicalDocumentType Laboratory { get; } = new ClinicalDocumentType(LaboratoryValue); + /// pathology. + public static ClinicalDocumentType Pathology { get; } = new ClinicalDocumentType(PathologyValue); + /// Determines if two values are the same. + public static bool operator ==(ClinicalDocumentType left, ClinicalDocumentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClinicalDocumentType left, ClinicalDocumentType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ClinicalDocumentType(string value) => new ClinicalDocumentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalDocumentType other && Equals(other); + /// + public bool Equals(ClinicalDocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.Serialization.cs new file mode 100644 index 000000000000..5e3f80cd2b2e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class ClinicalNoteEvidence + { + internal static ClinicalNoteEvidence DeserializeClinicalNoteEvidence(JsonElement element) + { + string id = default; + Optional text = default; + int offset = default; + int length = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + } + return new ClinicalNoteEvidence(id, text, offset, length); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ClinicalNoteEvidence FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeClinicalNoteEvidence(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.cs new file mode 100644 index 000000000000..7aecd7b2bb0f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// A piece of evidence from a clinical note (text document). + public partial class ClinicalNoteEvidence + { + /// Initializes a new instance of ClinicalNoteEvidence. + /// The identifier of the document containing the evidence. + /// The start index of the evidence text span in the document (0 based). + /// The length of the evidence text span. + /// is null. + internal ClinicalNoteEvidence(string id, int offset, int length) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of ClinicalNoteEvidence. + /// The identifier of the document containing the evidence. + /// The actual text span which is evidence for the inference. + /// The start index of the evidence text span in the document (0 based). + /// The length of the evidence text span. + internal ClinicalNoteEvidence(string id, string text, int offset, int length) + { + Id = id; + Text = text; + Offset = offset; + Length = length; + } + + /// The identifier of the document containing the evidence. + public string Id { get; } + /// The actual text span which is evidence for the inference. + public string Text { get; } + /// The start index of the evidence text span in the document (0 based). + public int Offset { get; } + /// The length of the evidence text span. + public int Length { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Docs/CancerProfilingClient.xml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Docs/CancerProfilingClient.xml new file mode 100644 index 000000000000..809a9150abe4 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Docs/CancerProfilingClient.xml @@ -0,0 +1,335 @@ + + + + + +This sample shows how to call InferCancerProfileAsync with required parameters and request content, and how to parse the result. +"); +var endpoint = new Uri(""); +var client = new CancerProfilingClient(endpoint, credential); + +var data = new { + patients = new[] { + new { + id = "", + } + }, +}; + +var operation = await client.InferCancerProfileAsync(WaitUntil.Completed, RequestContent.Create(data)); + +BinaryData data = operation.Value; +JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call InferCancerProfileAsync with all parameters and request content, and how to parse the result. +"); +var endpoint = new Uri(""); +var client = new CancerProfilingClient(endpoint, credential); + +var data = new { + patients = new[] { + new { + id = "", + info = new { + sex = "female", + birthDate = "2022-05-10", + clinicalInfo = new[] { + new { + system = "", + code = "", + name = "", + value = "", + } + }, + }, + data = new[] { + new { + type = "note", + clinicalType = "consultation", + id = "", + language = "", + createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + content = new { + sourceType = "inline", + value = "", + }, + } + }, + } + }, + configuration = new { + verbose = true, + includeEvidence = true, + inferenceTypes = new[] { + "tumorSite" + }, + checkForCancerCase = true, + }, +}; + +var operation = await client.InferCancerProfileAsync(WaitUntil.Completed, RequestContent.Create(data), "", DateTimeOffset.UtcNow); + +BinaryData data = operation.Value; +JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("modelVersion").ToString()); +]]> + + +Creates an Onco Phenotype job with the given request body. + +Below is the JSON schema for the request and response payloads. + +Request Body: + +Schema for OncoPhenotypeData: +{ + patients: [ + { + id: string, # Required. A given identifier for the patient. Has to be unique across all patients in a single request. + info: { + sex: "female" | "male" | "unspecified", # Optional. The patient's sex. + birthDate: string (date), # Optional. The patient's date of birth. + clinicalInfo: [ClinicalCodedElement], # Optional. Known clinical information for the patient, structured. + }, # Optional. Patient structured information, including demographics and known structured clinical information. + data: [PatientDocument], # Optional. Patient unstructured clinical data, given as documents. + } + ], # Required. The list of patients, including their clinical information and data. + configuration: { + verbose: boolean, # Optional. An indication whether the model should produce verbose output. + includeEvidence: boolean, # Optional. An indication whether the model's output should include evidence for the inferences. + inferenceTypes: ["tumorSite" | "histology" | "clinicalStageT" | "clinicalStageN" | "clinicalStageM" | "pathologicStageT" | "pathologicStageN" | "pathologicStageM"], # Optional. A list of inference types to be inferred for the current request. +This could be used if only part of the Onco Phenotype inferences are required. +If this list is omitted or empty, the model will return all the inference types. + checkForCancerCase: boolean, # Optional. An indication whether to perform a preliminary step on the patient's documents to determine whether they relate to a Cancer case. + }, # Optional. Configuration affecting the Onco Phenotype model's inference. +} + + +Response Body: + +Schema for OncoPhenotypeResult: +{ + jobId: string, # Required. A processing job identifier. + createdDateTime: string (date & time), # Required. The date and time when the processing job was created. + expirationDateTime: string (date & time), # Required. The date and time when the processing job is set to expire. + lastUpdateDateTime: string (date & time), # Required. The date and time when the processing job was last updated. + status: "notStarted" | "running" | "succeeded" | "failed" | "partiallyCompleted", # Required. The status of the processing job. + errors: [ + { + code: string, # Required. One of a server-defined set of error codes. + message: string, # Required. A human-readable representation of the error. + target: string, # Optional. The target of the error. + details: [Error], # Required. An array of details about specific errors that led to this reported error. + innererror: { + code: string, # Required. One of a server-defined set of error codes. + innererror: InnerError, # Optional. Inner error. + }, # Optional. An object containing more specific information than the current object about the error. + } + ], # Optional. An array of errors, if any errors occurred during the processing job. + results: { + patients: [OncoPhenotypePatientResult], # Required. Results for the patients given in the request. + modelVersion: string, # Required. The version of the model used for inference, expressed as the model date. + }, # Optional. The inference results for the Onco Phenotype request. +} + + + + + + +This sample shows how to call InferCancerProfile with required parameters and request content, and how to parse the result. +"); +var endpoint = new Uri(""); +var client = new CancerProfilingClient(endpoint, credential); + +var data = new { + patients = new[] { + new { + id = "", + } + }, +}; + +var operation = client.InferCancerProfile(WaitUntil.Completed, RequestContent.Create(data)); + +BinaryData data = operation.Value; +JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call InferCancerProfile with all parameters and request content, and how to parse the result. +"); +var endpoint = new Uri(""); +var client = new CancerProfilingClient(endpoint, credential); + +var data = new { + patients = new[] { + new { + id = "", + info = new { + sex = "female", + birthDate = "2022-05-10", + clinicalInfo = new[] { + new { + system = "", + code = "", + name = "", + value = "", + } + }, + }, + data = new[] { + new { + type = "note", + clinicalType = "consultation", + id = "", + language = "", + createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + content = new { + sourceType = "inline", + value = "", + }, + } + }, + } + }, + configuration = new { + verbose = true, + includeEvidence = true, + inferenceTypes = new[] { + "tumorSite" + }, + checkForCancerCase = true, + }, +}; + +var operation = client.InferCancerProfile(WaitUntil.Completed, RequestContent.Create(data), "", DateTimeOffset.UtcNow); + +BinaryData data = operation.Value; +JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("modelVersion").ToString()); +]]> + + +Creates an Onco Phenotype job with the given request body. + +Below is the JSON schema for the request and response payloads. + +Request Body: + +Schema for OncoPhenotypeData: +{ + patients: [ + { + id: string, # Required. A given identifier for the patient. Has to be unique across all patients in a single request. + info: { + sex: "female" | "male" | "unspecified", # Optional. The patient's sex. + birthDate: string (date), # Optional. The patient's date of birth. + clinicalInfo: [ClinicalCodedElement], # Optional. Known clinical information for the patient, structured. + }, # Optional. Patient structured information, including demographics and known structured clinical information. + data: [PatientDocument], # Optional. Patient unstructured clinical data, given as documents. + } + ], # Required. The list of patients, including their clinical information and data. + configuration: { + verbose: boolean, # Optional. An indication whether the model should produce verbose output. + includeEvidence: boolean, # Optional. An indication whether the model's output should include evidence for the inferences. + inferenceTypes: ["tumorSite" | "histology" | "clinicalStageT" | "clinicalStageN" | "clinicalStageM" | "pathologicStageT" | "pathologicStageN" | "pathologicStageM"], # Optional. A list of inference types to be inferred for the current request. +This could be used if only part of the Onco Phenotype inferences are required. +If this list is omitted or empty, the model will return all the inference types. + checkForCancerCase: boolean, # Optional. An indication whether to perform a preliminary step on the patient's documents to determine whether they relate to a Cancer case. + }, # Optional. Configuration affecting the Onco Phenotype model's inference. +} + + +Response Body: + +Schema for OncoPhenotypeResult: +{ + jobId: string, # Required. A processing job identifier. + createdDateTime: string (date & time), # Required. The date and time when the processing job was created. + expirationDateTime: string (date & time), # Required. The date and time when the processing job is set to expire. + lastUpdateDateTime: string (date & time), # Required. The date and time when the processing job was last updated. + status: "notStarted" | "running" | "succeeded" | "failed" | "partiallyCompleted", # Required. The status of the processing job. + errors: [ + { + code: string, # Required. One of a server-defined set of error codes. + message: string, # Required. A human-readable representation of the error. + target: string, # Optional. The target of the error. + details: [Error], # Required. An array of details about specific errors that led to this reported error. + innererror: { + code: string, # Required. One of a server-defined set of error codes. + innererror: InnerError, # Optional. Inner error. + }, # Optional. An object containing more specific information than the current object about the error. + } + ], # Optional. An array of errors, if any errors occurred during the processing job. + results: { + patients: [OncoPhenotypePatientResult], # Required. Results for the patients given in the request. + modelVersion: string, # Required. The version of the model used for inference, expressed as the model date. + }, # Optional. The inference results for the Onco Phenotype request. +} + + + + + + \ No newline at end of file diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContent.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContent.Serialization.cs new file mode 100644 index 000000000000..1c5a4774174c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContent.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class DocumentContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("sourceType"u8); + writer.WriteStringValue(SourceType.ToString()); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContent.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContent.cs new file mode 100644 index 000000000000..c94daa106621 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContent.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The content of the patient document. + public partial class DocumentContent + { + /// Initializes a new instance of DocumentContent. + /// + /// The type of the content's source. + /// In case the source type is 'inline', the content is given as a string (for instance, text). + /// In case the source type is 'reference', the content is given as a URI. + /// + /// The content of the document, given either inline (as a string) or as a reference (URI). + /// is null. + public DocumentContent(DocumentContentSourceType sourceType, string value) + { + Argument.AssertNotNull(value, nameof(value)); + + SourceType = sourceType; + Value = value; + } + + /// + /// The type of the content's source. + /// In case the source type is 'inline', the content is given as a string (for instance, text). + /// In case the source type is 'reference', the content is given as a URI. + /// + public DocumentContentSourceType SourceType { get; } + /// The content of the document, given either inline (as a string) or as a reference (URI). + public string Value { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContentSourceType.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContentSourceType.cs new file mode 100644 index 000000000000..fc3cd9062079 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContentSourceType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// + /// The type of the content's source. + /// In case the source type is 'inline', the content is given as a string (for instance, text). + /// In case the source type is 'reference', the content is given as a URI. + /// + public readonly partial struct DocumentContentSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentContentSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InlineValue = "inline"; + private const string ReferenceValue = "reference"; + + /// inline. + public static DocumentContentSourceType Inline { get; } = new DocumentContentSourceType(InlineValue); + /// reference. + public static DocumentContentSourceType Reference { get; } = new DocumentContentSourceType(ReferenceValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentContentSourceType left, DocumentContentSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentContentSourceType left, DocumentContentSourceType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DocumentContentSourceType(string value) => new DocumentContentSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentContentSourceType other && Equals(other); + /// + public bool Equals(DocumentContentSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentType.cs new file mode 100644 index 000000000000..2a0ddc3896bd --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). + public readonly partial struct DocumentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoteValue = "note"; + private const string FhirBundleValue = "fhirBundle"; + private const string DicomValue = "dicom"; + private const string GenomicSequencingValue = "genomicSequencing"; + + /// note. + public static DocumentType Note { get; } = new DocumentType(NoteValue); + /// fhirBundle. + public static DocumentType FhirBundle { get; } = new DocumentType(FhirBundleValue); + /// dicom. + public static DocumentType Dicom { get; } = new DocumentType(DicomValue); + /// genomicSequencing. + public static DocumentType GenomicSequencing { get; } = new DocumentType(GenomicSequencingValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentType left, DocumentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentType left, DocumentType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DocumentType(string value) => new DocumentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentType other && Equals(other); + /// + public bool Equals(DocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.Serialization.cs new file mode 100644 index 000000000000..96423ad35c1b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.Serialization.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class InferenceEvidence + { + internal static InferenceEvidence DeserializeInferenceEvidence(JsonElement element) + { + Optional patientDataEvidence = default; + Optional patientInfoEvidence = default; + Optional importance = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patientDataEvidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + patientDataEvidence = ClinicalNoteEvidence.DeserializeClinicalNoteEvidence(property.Value); + continue; + } + if (property.NameEquals("patientInfoEvidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + patientInfoEvidence = ClinicalCodedElement.DeserializeClinicalCodedElement(property.Value); + continue; + } + if (property.NameEquals("importance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + importance = null; + continue; + } + importance = property.Value.GetSingle(); + continue; + } + } + return new InferenceEvidence(patientDataEvidence, patientInfoEvidence, Optional.ToNullable(importance)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InferenceEvidence FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInferenceEvidence(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.cs new file mode 100644 index 000000000000..50903b888a09 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Health.Insights.CancerProfiling +{ + /// A piece of evidence corresponding to an inference. + public partial class InferenceEvidence + { + /// Initializes a new instance of InferenceEvidence. + internal InferenceEvidence() + { + } + + /// Initializes a new instance of InferenceEvidence. + /// A piece of evidence from a clinical note (text document). + /// + /// A piece of clinical information, expressed as a code in a clinical coding + /// system. + /// + /// A value indicating how important this piece of evidence is for the inference. + internal InferenceEvidence(ClinicalNoteEvidence patientDataEvidence, ClinicalCodedElement patientInfoEvidence, float? importance) + { + PatientDataEvidence = patientDataEvidence; + PatientInfoEvidence = patientInfoEvidence; + Importance = importance; + } + + /// A piece of evidence from a clinical note (text document). + public ClinicalNoteEvidence PatientDataEvidence { get; } + /// + /// A piece of clinical information, expressed as a code in a clinical coding + /// system. + /// + public ClinicalCodedElement PatientInfoEvidence { get; } + /// A value indicating how important this piece of evidence is for the inference. + public float? Importance { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/JobStatus.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/JobStatus.cs new file mode 100644 index 000000000000..87c6c8734cbf --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/JobStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The status of the processing job. + public readonly partial struct JobStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "notStarted"; + private const string RunningValue = "running"; + private const string SucceededValue = "succeeded"; + private const string FailedValue = "failed"; + private const string PartiallyCompletedValue = "partiallyCompleted"; + + /// notStarted. + public static JobStatus NotStarted { get; } = new JobStatus(NotStartedValue); + /// running. + public static JobStatus Running { get; } = new JobStatus(RunningValue); + /// succeeded. + public static JobStatus Succeeded { get; } = new JobStatus(SucceededValue); + /// failed. + public static JobStatus Failed { get; } = new JobStatus(FailedValue); + /// partiallyCompleted. + public static JobStatus PartiallyCompleted { get; } = new JobStatus(PartiallyCompletedValue); + /// Determines if two values are the same. + public static bool operator ==(JobStatus left, JobStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobStatus left, JobStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator JobStatus(string value) => new JobStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobStatus other && Equals(other); + /// + public bool Equals(JobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeData.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeData.Serialization.cs new file mode 100644 index 000000000000..8b4b90b24a17 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeData.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class OncoPhenotypeData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("patients"u8); + writer.WriteStartArray(); + foreach (var item in Patients) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeData.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeData.cs new file mode 100644 index 000000000000..00ef628b3e58 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeData.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The body of the Onco Phenotype request. + public partial class OncoPhenotypeData + { + /// Initializes a new instance of OncoPhenotypeData. + /// The list of patients, including their clinical information and data. + /// is null. + public OncoPhenotypeData(IEnumerable patients) + { + Argument.AssertNotNull(patients, nameof(patients)); + + Patients = patients.ToList(); + } + + /// The list of patients, including their clinical information and data. + public IList Patients { get; } + /// Configuration affecting the Onco Phenotype model's inference. + public OncoPhenotypeModelConfiguration Configuration { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.Serialization.cs new file mode 100644 index 000000000000..ff280da04946 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class OncoPhenotypeInference + { + internal static OncoPhenotypeInference DeserializeOncoPhenotypeInference(JsonElement element) + { + OncoPhenotypeInferenceType type = default; + string value = default; + Optional description = default; + Optional confidenceScore = default; + Optional> evidence = default; + Optional caseId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new OncoPhenotypeInferenceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("confidenceScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + confidenceScore = null; + continue; + } + confidenceScore = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("evidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InferenceEvidence.DeserializeInferenceEvidence(item)); + } + evidence = array; + continue; + } + if (property.NameEquals("caseId"u8)) + { + caseId = property.Value.GetString(); + continue; + } + } + return new OncoPhenotypeInference(type, value, description, Optional.ToNullable(confidenceScore), Optional.ToList(evidence), caseId); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OncoPhenotypeInference FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOncoPhenotypeInference(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.cs new file mode 100644 index 000000000000..5d4b9e0a40e7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// An inference made by the Onco Phenotype model regarding a patient. + public partial class OncoPhenotypeInference + { + /// Initializes a new instance of OncoPhenotypeInference. + /// The type of the Onco Phenotype inference. + /// The value of the inference, as relevant for the given inference type. + /// is null. + internal OncoPhenotypeInference(OncoPhenotypeInferenceType type, string value) + { + Argument.AssertNotNull(value, nameof(value)); + + Type = type; + Value = value; + Evidence = new ChangeTrackingList(); + } + + /// Initializes a new instance of OncoPhenotypeInference. + /// The type of the Onco Phenotype inference. + /// The value of the inference, as relevant for the given inference type. + /// The description corresponding to the inference value. + /// Confidence score for this inference. + /// The evidence corresponding to the inference value. + /// An identifier for a clinical case, if there are multiple clinical cases regarding the same patient. + internal OncoPhenotypeInference(OncoPhenotypeInferenceType type, string value, string description, float? confidenceScore, IReadOnlyList evidence, string caseId) + { + Type = type; + Value = value; + Description = description; + ConfidenceScore = confidenceScore; + Evidence = evidence.ToList(); + CaseId = caseId; + } + + /// The type of the Onco Phenotype inference. + public OncoPhenotypeInferenceType Type { get; } + /// The value of the inference, as relevant for the given inference type. + public string Value { get; } + /// The description corresponding to the inference value. + public string Description { get; } + /// Confidence score for this inference. + public float? ConfidenceScore { get; } + /// The evidence corresponding to the inference value. + public IReadOnlyList Evidence { get; } + /// An identifier for a clinical case, if there are multiple clinical cases regarding the same patient. + public string CaseId { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceType.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceType.cs new file mode 100644 index 000000000000..1fc7fa940fd4 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The type of the Onco Phenotype inference. + public readonly partial struct OncoPhenotypeInferenceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OncoPhenotypeInferenceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TumorSiteValue = "tumorSite"; + private const string HistologyValue = "histology"; + private const string ClinicalStageTValue = "clinicalStageT"; + private const string ClinicalStageNValue = "clinicalStageN"; + private const string ClinicalStageMValue = "clinicalStageM"; + private const string PathologicStageTValue = "pathologicStageT"; + private const string PathologicStageNValue = "pathologicStageN"; + private const string PathologicStageMValue = "pathologicStageM"; + + /// tumorSite. + public static OncoPhenotypeInferenceType TumorSite { get; } = new OncoPhenotypeInferenceType(TumorSiteValue); + /// histology. + public static OncoPhenotypeInferenceType Histology { get; } = new OncoPhenotypeInferenceType(HistologyValue); + /// clinicalStageT. + public static OncoPhenotypeInferenceType ClinicalStageT { get; } = new OncoPhenotypeInferenceType(ClinicalStageTValue); + /// clinicalStageN. + public static OncoPhenotypeInferenceType ClinicalStageN { get; } = new OncoPhenotypeInferenceType(ClinicalStageNValue); + /// clinicalStageM. + public static OncoPhenotypeInferenceType ClinicalStageM { get; } = new OncoPhenotypeInferenceType(ClinicalStageMValue); + /// pathologicStageT. + public static OncoPhenotypeInferenceType PathologicStageT { get; } = new OncoPhenotypeInferenceType(PathologicStageTValue); + /// pathologicStageN. + public static OncoPhenotypeInferenceType PathologicStageN { get; } = new OncoPhenotypeInferenceType(PathologicStageNValue); + /// pathologicStageM. + public static OncoPhenotypeInferenceType PathologicStageM { get; } = new OncoPhenotypeInferenceType(PathologicStageMValue); + /// Determines if two values are the same. + public static bool operator ==(OncoPhenotypeInferenceType left, OncoPhenotypeInferenceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OncoPhenotypeInferenceType left, OncoPhenotypeInferenceType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator OncoPhenotypeInferenceType(string value) => new OncoPhenotypeInferenceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OncoPhenotypeInferenceType other && Equals(other); + /// + public bool Equals(OncoPhenotypeInferenceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeModelConfiguration.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeModelConfiguration.Serialization.cs new file mode 100644 index 000000000000..9b56c207b125 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeModelConfiguration.Serialization.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class OncoPhenotypeModelConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Verbose)) + { + if (Verbose != null) + { + writer.WritePropertyName("verbose"u8); + writer.WriteBooleanValue(Verbose.Value); + } + else + { + writer.WriteNull("verbose"); + } + } + if (Optional.IsDefined(IncludeEvidence)) + { + if (IncludeEvidence != null) + { + writer.WritePropertyName("includeEvidence"u8); + writer.WriteBooleanValue(IncludeEvidence.Value); + } + else + { + writer.WriteNull("includeEvidence"); + } + } + if (Optional.IsCollectionDefined(InferenceTypes)) + { + writer.WritePropertyName("inferenceTypes"u8); + writer.WriteStartArray(); + foreach (var item in InferenceTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CheckForCancerCase)) + { + if (CheckForCancerCase != null) + { + writer.WritePropertyName("checkForCancerCase"u8); + writer.WriteBooleanValue(CheckForCancerCase.Value); + } + else + { + writer.WriteNull("checkForCancerCase"); + } + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeModelConfiguration.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeModelConfiguration.cs new file mode 100644 index 000000000000..efb3c3b66bf9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeModelConfiguration.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// Configuration affecting the Onco Phenotype model's inference. + public partial class OncoPhenotypeModelConfiguration + { + /// Initializes a new instance of OncoPhenotypeModelConfiguration. + public OncoPhenotypeModelConfiguration() + { + InferenceTypes = new ChangeTrackingList(); + } + + /// An indication whether the model should produce verbose output. + public bool? Verbose { get; set; } + /// An indication whether the model's output should include evidence for the inferences. + public bool? IncludeEvidence { get; set; } + /// + /// A list of inference types to be inferred for the current request. + /// This could be used if only part of the Onco Phenotype inferences are required. + /// If this list is omitted or empty, the model will return all the inference types. + /// + public IList InferenceTypes { get; } + /// An indication whether to perform a preliminary step on the patient's documents to determine whether they relate to a Cancer case. + public bool? CheckForCancerCase { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.Serialization.cs new file mode 100644 index 000000000000..40c687b40580 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class OncoPhenotypePatientResult + { + internal static OncoPhenotypePatientResult DeserializeOncoPhenotypePatientResult(JsonElement element) + { + string id = default; + IReadOnlyList inferences = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("inferences"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OncoPhenotypeInference.DeserializeOncoPhenotypeInference(item)); + } + inferences = array; + continue; + } + } + return new OncoPhenotypePatientResult(id, inferences); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OncoPhenotypePatientResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOncoPhenotypePatientResult(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.cs new file mode 100644 index 000000000000..782855194193 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The results of the model's work for a single patient. + public partial class OncoPhenotypePatientResult + { + /// Initializes a new instance of OncoPhenotypePatientResult. + /// The identifier given for the patient in the request. + /// The model's inferences for the given patient. + /// or is null. + internal OncoPhenotypePatientResult(string id, IEnumerable inferences) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(inferences, nameof(inferences)); + + Id = id; + Inferences = inferences.ToList(); + } + + /// Initializes a new instance of OncoPhenotypePatientResult. + /// The identifier given for the patient in the request. + /// The model's inferences for the given patient. + internal OncoPhenotypePatientResult(string id, IReadOnlyList inferences) + { + Id = id; + Inferences = inferences.ToList(); + } + + /// The identifier given for the patient in the request. + public string Id { get; } + /// The model's inferences for the given patient. + public IReadOnlyList Inferences { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.Serialization.cs new file mode 100644 index 000000000000..380085799c9a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.Serialization.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class OncoPhenotypeResult + { + internal static OncoPhenotypeResult DeserializeOncoPhenotypeResult(JsonElement element) + { + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset expirationDateTime = default; + DateTimeOffset lastUpdateDateTime = default; + JobStatus status = default; + Optional> errors = default; + Optional results = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdateDateTime"u8)) + { + lastUpdateDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + errors = array; + continue; + } + if (property.NameEquals("results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + results = OncoPhenotypeResults.DeserializeOncoPhenotypeResults(property.Value); + continue; + } + } + return new OncoPhenotypeResult(jobId, createdDateTime, expirationDateTime, lastUpdateDateTime, status, Optional.ToList(errors), results); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OncoPhenotypeResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOncoPhenotypeResult(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.cs new file mode 100644 index 000000000000..0bb7475ca786 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The response for the Onco Phenotype request. + public partial class OncoPhenotypeResult + { + /// Initializes a new instance of OncoPhenotypeResult. + internal OncoPhenotypeResult() + { + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of OncoPhenotypeResult. + /// A processing job identifier. + /// The date and time when the processing job was created. + /// The date and time when the processing job is set to expire. + /// The date and time when the processing job was last updated. + /// The status of the processing job. + /// An array of errors, if any errors occurred during the processing job. + /// The inference results for the Onco Phenotype request. + internal OncoPhenotypeResult(string jobId, DateTimeOffset createdDateTime, DateTimeOffset expirationDateTime, DateTimeOffset lastUpdateDateTime, JobStatus status, IReadOnlyList errors, OncoPhenotypeResults results) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + ExpirationDateTime = expirationDateTime; + LastUpdateDateTime = lastUpdateDateTime; + Status = status; + Errors = errors.ToList(); + Results = results; + } + + /// A processing job identifier. + public string JobId { get; } + /// The date and time when the processing job was created. + public DateTimeOffset CreatedDateTime { get; } + /// The date and time when the processing job is set to expire. + public DateTimeOffset ExpirationDateTime { get; } + /// The date and time when the processing job was last updated. + public DateTimeOffset LastUpdateDateTime { get; } + /// The status of the processing job. + public JobStatus Status { get; } + /// An array of errors, if any errors occurred during the processing job. + public IReadOnlyList Errors { get; } + /// The inference results for the Onco Phenotype request. + public OncoPhenotypeResults Results { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs new file mode 100644 index 000000000000..52d3dd834c83 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class OncoPhenotypeResults + { + internal static OncoPhenotypeResults DeserializeOncoPhenotypeResults(JsonElement element) + { + IReadOnlyList patients = default; + string modelVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patients"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OncoPhenotypePatientResult.DeserializeOncoPhenotypePatientResult(item)); + } + patients = array; + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + } + return new OncoPhenotypeResults(patients, modelVersion); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OncoPhenotypeResults FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOncoPhenotypeResults(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.cs new file mode 100644 index 000000000000..9cefd4678be3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The inference results for the Onco Phenotype request. + public partial class OncoPhenotypeResults + { + /// Initializes a new instance of OncoPhenotypeResults. + /// Results for the patients given in the request. + /// The version of the model used for inference, expressed as the model date. + /// or is null. + internal OncoPhenotypeResults(IEnumerable patients, string modelVersion) + { + Argument.AssertNotNull(patients, nameof(patients)); + Argument.AssertNotNull(modelVersion, nameof(modelVersion)); + + Patients = patients.ToList(); + ModelVersion = modelVersion; + } + + /// Initializes a new instance of OncoPhenotypeResults. + /// Results for the patients given in the request. + /// The version of the model used for inference, expressed as the model date. + internal OncoPhenotypeResults(IReadOnlyList patients, string modelVersion) + { + Patients = patients.ToList(); + ModelVersion = modelVersion; + } + + /// Results for the patients given in the request. + public IReadOnlyList Patients { get; } + /// The version of the model used for inference, expressed as the model date. + public string ModelVersion { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.Serialization.cs new file mode 100644 index 000000000000..6ae6cf9fc1b7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class PatientDocument : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(ClinicalType)) + { + if (ClinicalType != null) + { + writer.WritePropertyName("clinicalType"u8); + writer.WriteStringValue(ClinicalType.Value.ToString()); + } + else + { + writer.WriteNull("clinicalType"); + } + } + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(CreatedDateTime)) + { + if (CreatedDateTime != null) + { + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime.Value, "O"); + } + else + { + writer.WriteNull("createdDateTime"); + } + } + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.cs new file mode 100644 index 000000000000..3bbbbfb8f5ff --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// A clinical document related to a patient. Document here is in the wide sense - not just a text document (note). + public partial class PatientDocument + { + /// Initializes a new instance of PatientDocument. + /// The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). + /// A given identifier for the document. Has to be unique across all documents for a single patient. + /// The content of the patient document. + /// or is null. + public PatientDocument(DocumentType type, string id, DocumentContent content) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(content, nameof(content)); + + Type = type; + Id = id; + Content = content; + } + + /// The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). + public DocumentType Type { get; } + /// The type of the clinical document. + public ClinicalDocumentType? ClinicalType { get; set; } + /// A given identifier for the document. Has to be unique across all documents for a single patient. + public string Id { get; } + /// A 2 letter ISO 639-1 representation of the language of the document. + public string Language { get; set; } + /// The date and time when the document was created. + public DateTimeOffset? CreatedDateTime { get; set; } + /// The content of the patient document. + public DocumentContent Content { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.Serialization.cs new file mode 100644 index 000000000000..3f43e1987997 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class PatientInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Sex)) + { + if (Sex != null) + { + writer.WritePropertyName("sex"u8); + writer.WriteStringValue(Sex.Value.ToString()); + } + else + { + writer.WriteNull("sex"); + } + } + if (Optional.IsDefined(BirthDate)) + { + if (BirthDate != null) + { + writer.WritePropertyName("birthDate"u8); + writer.WriteStringValue(BirthDate.Value, "D"); + } + else + { + writer.WriteNull("birthDate"); + } + } + if (Optional.IsCollectionDefined(ClinicalInfo)) + { + writer.WritePropertyName("clinicalInfo"u8); + writer.WriteStartArray(); + foreach (var item in ClinicalInfo) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.cs new file mode 100644 index 000000000000..4cf5b680ece9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// Patient structured information, including demographics and known structured clinical information. + public partial class PatientInfo + { + /// Initializes a new instance of PatientInfo. + public PatientInfo() + { + ClinicalInfo = new ChangeTrackingList(); + } + + /// The patient's sex. + public PatientInfoSex? Sex { get; set; } + /// The patient's date of birth. + public DateTimeOffset? BirthDate { get; set; } + /// Known clinical information for the patient, structured. + public IList ClinicalInfo { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfoSex.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfoSex.cs new file mode 100644 index 000000000000..57fb30f829da --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfoSex.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// The patient's sex. + public readonly partial struct PatientInfoSex : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatientInfoSex(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FemaleValue = "female"; + private const string MaleValue = "male"; + private const string UnspecifiedValue = "unspecified"; + + /// female. + public static PatientInfoSex Female { get; } = new PatientInfoSex(FemaleValue); + /// male. + public static PatientInfoSex Male { get; } = new PatientInfoSex(MaleValue); + /// unspecified. + public static PatientInfoSex Unspecified { get; } = new PatientInfoSex(UnspecifiedValue); + /// Determines if two values are the same. + public static bool operator ==(PatientInfoSex left, PatientInfoSex right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatientInfoSex left, PatientInfoSex right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatientInfoSex(string value) => new PatientInfoSex(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatientInfoSex other && Equals(other); + /// + public bool Equals(PatientInfoSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.Serialization.cs new file mode 100644 index 000000000000..092eded2bfe6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class PatientRecord : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Info)) + { + writer.WritePropertyName("info"u8); + writer.WriteObjectValue(Info); + } + if (Optional.IsCollectionDefined(Data)) + { + writer.WritePropertyName("data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.cs new file mode 100644 index 000000000000..556ca799f260 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// A patient record, including their clinical information and data. + public partial class PatientRecord + { + /// Initializes a new instance of PatientRecord. + /// A given identifier for the patient. Has to be unique across all patients in a single request. + /// is null. + public PatientRecord(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Data = new ChangeTrackingList(); + } + + /// A given identifier for the patient. Has to be unique across all patients in a single request. + public string Id { get; } + /// Patient structured information, including demographics and known structured clinical information. + public PatientInfo Info { get; set; } + /// Patient unstructured clinical data, given as documents. + public IList Data { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/GlobalSuppressions.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..9946d48402a7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/GlobalSuppressions.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0001:Use one of the following pre-approved namespace groups (https://azure.github.io/azure-sdk/registered_namespaces.html): Azure.AI, Azure.Analytics, Azure.Communication, Azure.Containers, Azure.Core.Expressions, Azure.Data, Azure.DigitalTwins, Azure.Identity, Azure.IoT, Azure.Learn, Azure.Management, Azure.Media, Azure.Messaging, Azure.MixedReality, Azure.Monitor, Azure.ResourceManager, Azure.Search, Azure.Security, Azure.Storage, Azure.Template, Microsoft.Extensions.Azure", Justification = "", Scope = "namespace", Target = "~N:Azure.Health.Insights.CancerProfiling")] diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Properties/AssemblyInfo.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..59472cc88e7d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Health.Insights.CancerProfiling.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.CognitiveServices")] diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/test-resources.json b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/test-resources.json new file mode 100644 index 000000000000..2f2647f298d5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/test-resources.json @@ -0,0 +1,73 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } + }, + "endpointPrefix": { + "defaultValue": "healthinsights", + "type": "string" + }, + "cognitiveServicesEndpointSuffix": { + "defaultValue": ".cognitiveservices.azure.com", + "type": "string" + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The principal to assign the role to. This is application object id." + } + } + }, + "variables": { + "roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/a97b65f3-24c7-4388-baec-2e87135dc908')]", + "uniqueSubDomainName": "[format('{0}-{1}', parameters('baseName'), parameters('endpointPrefix'))]", + "endpointValue": "[format('https://{0}-{1}{2}', parameters('baseName'), parameters('endpointPrefix'), parameters('cognitiveServicesEndpointSuffix'))]" + }, + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts", + "apiVersion": "2017-04-18", + "name": "[variables('uniqueSubDomainName')]", + "location":"[parameters('location')]", + "sku": { + "name": "S0" + }, + "kind": "AzureHealthInsights", + "properties": { + "customSubDomainName": "[variables('uniqueSubDomainName')]" + } + }, + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2018-09-01-preview", + "name": "[guid(resourceGroup().id)]", + "properties": { + "roleDefinitionId": "[variables('roleDefinitionId')]", + "principalId": "[parameters('testApplicationOid')]" + } + } + ], + "outputs": { + "AZURE_HEALTH_INSIGHTS_API_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts',variables('uniqueSubDomainName')), '2017-04-18').key1]" + }, + "AZURE_HEALTH_INSIGHTS_ENDPOINT": { + "type": "string", + "value": "[variables('endpointValue')]" + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Azure.Health.Insights.CancerProfiling.Tests.csproj b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Azure.Health.Insights.CancerProfiling.Tests.csproj new file mode 100644 index 000000000000..ee7783c69d99 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Azure.Health.Insights.CancerProfiling.Tests.csproj @@ -0,0 +1,33 @@ + + + $(RequiredTargetFrameworks) + + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + + + + + + + $(MSBuildProjectDirectory)\test.runsettings + + + + + + \ No newline at end of file diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/CancerProfilingClientLiveTests.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/CancerProfilingClientLiveTests.cs new file mode 100644 index 000000000000..4a9f6f49db77 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/CancerProfilingClientLiveTests.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using NUnit.Framework; +using System.IO; +using System.Reflection; +using Azure.Core; +using System.Net; +using Azure.Core.TestFramework; +using Azure.Health.Insights.CancerProfiling.Tests.Infrastructure; +using Azure.Health.Insights.CancerProfiling; +using System; + +namespace Azure.Health.Insights.CancerProfiling.Tests +{ + /// + /// The suite of tests for the class. + /// + /// + /// These tests have a dependency on live Azure services and may incur costs for the associated + /// Azure subscription. + /// + public class CancerProfilingClientLiveTests : HealthInsightsLiveTestBase + { + /// + /// Initializes a new instance of the class. + /// + /// A flag used by the Azure Core Test Framework to differentiate between tests for asynchronous and synchronous methods. + public CancerProfilingClientLiveTests(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task GetResultsFromCreateJob() + { + var client = CreateCancerProfilingClient(); + + var request = GetRequestContent("CancerProfilingClientTest.request.json"); + try + { + var operation = await client.InferCancerProfileAsync(WaitUntil.Completed, request); + Assert.IsNotNull(operation); + Response response = operation.GetRawResponse(); + Assert.IsNotNull(response); + Assert.IsTrue(response.Status == (int)HttpStatusCode.OK); + OncoPhenotypeResult oncoResponse = OncoPhenotypeResult.FromResponse(response); + Assert.IsNotEmpty(oncoResponse.Results.Patients); + var patient = oncoResponse.Results.Patients[0]; + Assert.IsNotEmpty(patient.Inferences); + } + catch (System.Exception ex) + { + Console.WriteLine(ex); + throw; + } + } + + private RequestContent GetRequestContent(string resourceName) + { + Assembly assembly = Assembly.GetAssembly(this.GetType()); + Stream content = assembly.GetManifestResourceStream($"Azure.Health.Insights.CancerProfiling.Tests.TestData.{resourceName}"); + using StreamReader reader = new StreamReader(content); + string data = reader.ReadToEnd(); + return RequestContent.Create(data); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Infrastructure/HealthInsightsLiveTestBase.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Infrastructure/HealthInsightsLiveTestBase.cs new file mode 100644 index 000000000000..48c271c2ee5e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Infrastructure/HealthInsightsLiveTestBase.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.Health.Insights.CancerProfiling; + +namespace Azure.Health.Insights.CancerProfiling.Tests.Infrastructure +{ + public class HealthInsightsLiveTestBase : RecordedTestBase + { + public HealthInsightsLiveTestBase(bool isAsync) : base(isAsync) + { + JsonPathSanitizers.Add("$..accessToken"); + JsonPathSanitizers.Add("$..source"); + SanitizedHeaders.Add(Constants.AuthorizationHeader); + } + + /// + /// Creates a with the endpoint and API key provided via environment + /// variables and instruments it to make use of the Azure Core Test Framework functionalities. + /// + /// Whether or not to use a to authenticate. An is used by default. + /// The API key to use for authentication. Defaults to . + /// Whether or not instrumenting should be skipped. Avoid skipping it as much as possible. + /// The instrumented . + public CancerProfilingClient CreateCancerProfilingClient(bool useTokenCredential = false, string apiKey = default, bool skipInstrumenting = false) + { + var endpoint = new Uri(TestEnvironment.Endpoint); + var options = InstrumentClientOptions(new CancerProfilingClientOptions()); + CancerProfilingClient client; + + if (useTokenCredential) + { + AzureKeyCredential credential = new AzureKeyCredential(TestEnvironment.Credential.ToString()); + client = new CancerProfilingClient(endpoint, credential, options); + } + else + { + var credential = new AzureKeyCredential(apiKey ?? TestEnvironment.ApiKey); + client = new CancerProfilingClient(endpoint, credential, options); + } + + return skipInstrumenting ? client : InstrumentClient(client); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Infrastructure/HealthInsightsTestEnvironment.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Infrastructure/HealthInsightsTestEnvironment.cs new file mode 100644 index 000000000000..8485a43fc374 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Infrastructure/HealthInsightsTestEnvironment.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.Health.Insights.CancerProfiling.Tests.Infrastructure +{ + public class HealthInsightsTestEnvironment : TestEnvironment + { + /// The name of the environment variable from which the Health Insights resource's endpoint will be extracted for the live tests. + internal const string EndpointEnvironmentVariableName = "AZURE_HEALTH_INSIGHTS_ENDPOINT"; + + /// The name of the environment variable from which the Health Insights resource's API key will be extracted for the live tests. + internal const string ApiKeyEnvironmentVariableName = "AZURE_HEALTH_INSIGHTS_API_KEY"; + + public string ApiKey => GetRecordedVariable(ApiKeyEnvironmentVariableName, options => options.IsSecret()); + public string Endpoint => GetRecordedVariable(EndpointEnvironmentVariableName); + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/README.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/README.md new file mode 100644 index 000000000000..88cb16ba26db --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/README.md @@ -0,0 +1,5 @@ +Source files in this directory are written as tests from which samples are extracted. +They are not intended to be viewed directly and help ensure our samples compile and work correctly. + \ No newline at end of file diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample_InferCancerProfile.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample_InferCancerProfile.cs new file mode 100644 index 000000000000..2181500552b3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample_InferCancerProfile.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.Health.Insights.CancerProfiling.Tests.Infrastructure; +using NUnit.Framework; + +namespace Azure.Health.Insights.CancerProfiling.Tests.Samples +{ + public partial class HealthInsightsSamples : SamplesBase + { + [Test] + public async Task InferCancerProfileAsync() + { + #region Snippet:CreateCancerProfilingClient + + // Read endpoint and apiKey + string endpoint = TestEnvironment.Endpoint; + string apiKey = TestEnvironment.ApiKey; + + var endpointUri = new Uri(endpoint); + var credential = new AzureKeyCredential(apiKey); + + // Create CancerProfilingClient + CancerProfilingClient client = new CancerProfilingClient(endpointUri, credential); + + #endregion + + #region Snippet:HealthInsightsOncoPhenotypeData + // Create Patient + PatientRecord patient1 = new PatientRecord("patient_id") + { + Info = new PatientInfo + { + BirthDate = new System.DateTime(1979, 10, 08), + Sex = PatientInfoSex.Female + } + }; + + // Add imaging document + string docContent1 = @" + 15.8.2021 + Jane Doe 091175-8967 + 42 year old female, married with 3 children, works as a nurse. + Healthy, no medications taken on a regular basis. + PMHx is significant for migraines with aura, uses Mirena for contraception. + Smoking history of 10 pack years (has stopped and relapsed several times). + She is in c/o 2 weeks of productive cough and shortness of breath. + She has a fever of 37.8 and general weakness. + Denies night sweats and rash. She denies symptoms of rhinosinusitis, asthma, and heartburn. + On PE: + GENERAL: mild pallor, no cyanosis. Regular breathing rate. + LUNGS: decreased breath sounds on the base of the right lung. Vesicular breathing. + No crackles, rales, and wheezes. Resonant percussion. + PLAN: + Will be referred for a chest x-ray. + ====================================== + CXR showed mild nonspecific opacities in right lung base. + PLAN: + Findings are suggestive of a working diagnosis of pneumonia. The patient is referred to a follow-up CXR in 2 weeks."; + + PatientDocument patientDocument1 = new PatientDocument(DocumentType.Note, + "doc1", + new DocumentContent(DocumentContentSourceType.Inline, docContent1)) + { + ClinicalType = ClinicalDocumentType.Imaging, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2021-08-15T00:00:00") + }; + patient1.Data.Add(patientDocument1); + + // Add Pathology documents + string docContent2 = @" + Oncology Clinic + 20.10.2021 + Jane Doe 091175-8967 + 42-year-old healthy female who works as a nurse in the ER of this hospital. + First menstruation at 11 years old. First delivery- 27 years old. She has 3 children. + Didn’t breastfeed. + Contraception- Mirena. + Smoking- 10 pack years. + Mother- Belarusian. Father- Georgian. + About 3 months prior to admission, she stated she had SOB and was febrile. + She did a CXR as an outpatient which showed a finding in the base of the right lung- possibly an infiltrate. + She was treated with antibiotics with partial response. + 6 weeks later a repeat CXR was performed- a few solid dense findings in the right lung. + Therefore, she was referred for a PET-CT which demonstrated increased uptake in the right breast, lymph nodes on the right a few areas in the lungs and liver. + On biopsy from the lesion in the right breast- triple negative adenocarcinoma. Genetic testing has not been done thus far. + Genetic counseling- the patient denies a family history of breast, ovary, uterus, and prostate cancer. Her mother has chronic lymphocytic leukemia (CLL). + She is planned to undergo genetic tests because the aggressive course of the disease, and her young age. + Impression: + Stage 4 triple negative breast adenocarcinoma. + Could benefit from biological therapy. + Different treatment options were explained- the patient wants to get a second opinion."; + PatientDocument patientDocument2 = new PatientDocument(DocumentType.Note, + "doc2", + new DocumentContent(DocumentContentSourceType.Inline, docContent2)) + { + ClinicalType = ClinicalDocumentType.Pathology, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2021-10-20T22:00:00.00") + }; + + patient1.Data.Add(patientDocument2); + + string docContent3 = @" + PATHOLOGY REPORT + Clinical Information + Ultrasound-guided biopsy; A. 18 mm mass; most likely diagnosis based on imaging: IDC + Diagnosis + A. BREAST, LEFT AT 2:00 4 CM FN; ULTRASOUND-GUIDED NEEDLE CORE BIOPSIES: + - Invasive carcinoma of no special type (invasive ductal carcinoma), grade 1 + Nottingham histologic grade: 1/3 (tubules 2; nuclear grade 2; mitotic rate 1; total score; 5/9) + Fragments involved by invasive carcinoma: 2 + Largest measurement of invasive carcinoma on a single fragment: 7 mm + Ductal carcinoma in situ (DCIS): Present + Architectural pattern: Cribriform + Nuclear grade: 2- + -intermediate + Necrosis: Not identified + Fragments involved by DCIS: 1 + Largest measurement of DCIS on a single fragment: Span 2 mm + Microcalcifications: Present in benign breast tissue and invasive carcinoma + Blocks with invasive carcinoma: A1 + Special studies: Pending"; + + PatientDocument patientDocument3 = new PatientDocument(DocumentType.Note, + "doc3", + new DocumentContent(DocumentContentSourceType.Inline, docContent3)) + { + ClinicalType = ClinicalDocumentType.Pathology, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2022-01-01T00:00:00") + }; + patient1.Data.Add(patientDocument3); + + // Set configuration to include evidence for the cancer staging inferences + var configuration = new OncoPhenotypeModelConfiguration() { IncludeEvidence = true }; + + // Create OncoPhenotypeData with patient and configration + var oncoPhenotypeData = new OncoPhenotypeData(new List { patient1 }) { Configuration = configuration }; + #endregion + #region Snippet:HealthInsightsCancerProfilingClientInferCancerProfileAsync + OncoPhenotypeResult oncoPhenotypeResult = default; + try + { + Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); + Response resp = operation.GetRawResponse(); + oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + return; + } + #endregion + + #region Snippet:HealthInsightsCancerProfilingInferCancerProfileAsyncViewResults + // View operation results + if (oncoPhenotypeResult.Status == JobStatus.Succeeded) + { + OncoPhenotypeResults oncoResults = oncoPhenotypeResult.Results; + foreach (OncoPhenotypePatientResult patientResult in oncoResults.Patients) + { + Console.WriteLine($"\n==== Inferences of Patient {patientResult.Id} ===="); + foreach (OncoPhenotypeInference oncoInference in patientResult.Inferences) + { + Console.WriteLine($"\n=== Clinical Type: {oncoInference.Type.ToString()} Value: {oncoInference.Value} ConfidenceScore: {oncoInference.ConfidenceScore} ==="); + foreach (InferenceEvidence evidence in oncoInference.Evidence) + { + if (evidence.PatientDataEvidence != null) + { + var dataEvidence = evidence.PatientDataEvidence; + Console.WriteLine($"Evidence {dataEvidence.Id} {dataEvidence.Offset} {dataEvidence.Length} {dataEvidence.Text}"); + } + if (evidence.PatientInfoEvidence != null) + { + var infoEvidence = evidence.PatientInfoEvidence; + Console.WriteLine($"Evidence {infoEvidence.System} {infoEvidence.Code} {infoEvidence.Name} {infoEvidence.Value}"); + } + } + } + } + } + else + { + IReadOnlyList oncoErrors = oncoPhenotypeResult.Errors; + foreach (ResponseError error in oncoErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } + } + + #endregion + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/SessionRecords/CancerProfilingClientLiveTests/GetResultsFromCreateJob.json b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/SessionRecords/CancerProfilingClientLiveTests/GetResultsFromCreateJob.json new file mode 100644 index 000000000000..83f01afeda10 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/SessionRecords/CancerProfilingClientLiveTests/GetResultsFromCreateJob.json @@ -0,0 +1,614 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/oncophenotype/jobs?api-version=2023-03-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "1048", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-28e42bf227d63e00a6d9cc031117c37f-703058def7b3ae57-00", + "User-Agent": "azsdk-net-Health.Insights.CancerProfiling/1.0.0-alpha.20230306.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "bde6f932e3bd8ba966d5c6e6e8201526", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "configuration": { + "checkForCancerCase": true, + "includeEvidence": true + }, + "patients": [ + { + "id": "patient1", + "data": [ + { + "clinicalType": "pathology", + "content": { + "sourceType": "inline", + "value": "Laterality: Left \n Tumor type present: Invasive duct carcinoma; duct carcinoma in situ \n Tumor site: Upper inner quadrant \n Invasive carcinoma \n Histologic type: Ductal \n Size of invasive component: 0.9 cm \n Histologic Grade - Nottingham combined histologic score: 1 out of 3 \n In situ carcinoma (DCIS) \n Histologic type of DCIS: Cribriform and solid \n Necrosis in DCIS: Yes \n DCIS component of invasive carcinoma: Extensive \n" + }, + "createdDateTime": "2022-01-01T00:00:00", + "id": "document1", + "kind": "note", + "language": "en" + } + ] + } + ] + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "7ecc6c49-0fcb-4d64-a79a-cac7734a0724", + "Content-Length": "0", + "Date": "Mon, 06 Mar 2023 09:10:35 GMT", + "Operation-Location": "https://sanitized.azure-api.net/healthinsights/oncophenotype/jobs/7c76e45b-fb37-4b7f-aa0c-e7bb0734aecc?api-version=2023-03-01-preview", + "Retry-After": "5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/oncophenotype/jobs/7c76e45b-fb37-4b7f-aa0c-e7bb0734aecc?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-28e42bf227d63e00a6d9cc031117c37f-5ce6f45bb60a201a-00", + "User-Agent": "azsdk-net-Health.Insights.CancerProfiling/1.0.0-alpha.20230306.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "0c3e350c34489b80bd2a13d7407f99fa", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "b5994a1b-0c78-4d59-9954-45f4c582115f", + "Content-Length": "199", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:10:35 GMT", + "Retry-After": "5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "7c76e45b-fb37-4b7f-aa0c-e7bb0734aecc", + "createdDateTime": "2023-03-06T09:10:35Z", + "expirationDateTime": "2023-03-06T09:27:15Z", + "lastUpdateDateTime": "2023-03-06T09:10:35Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/oncophenotype/jobs/7c76e45b-fb37-4b7f-aa0c-e7bb0734aecc?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-28e42bf227d63e00a6d9cc031117c37f-44839a4aebf26a89-00", + "User-Agent": "azsdk-net-Health.Insights.CancerProfiling/1.0.0-alpha.20230306.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "423ec87a7a0144311368b503db9068fe", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "0fd99f75-7326-4d97-9d6d-7ed5b4e9e478", + "Content-Length": "6279", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:10:41 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "results": { + "patients": [ + { + "id": "patient1", + "inferences": [ + { + "type": "tumorSite", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Upper inner", + "offset": 101, + "length": 11 + }, + "importance": 0.5563 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "duct", + "offset": 64, + "length": 4 + }, + "importance": 0.0156 + } + ], + "value": "C50.2", + "description": "BREAST", + "confidenceScore": 0.9214 + }, + { + "type": "histology", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Ductal", + "offset": 162, + "length": 6 + }, + "importance": 0.2937 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct", + "offset": 39, + "length": 13 + }, + "importance": 0.2439 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 179, + "length": 8 + }, + "importance": 0.1588 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "duct", + "offset": 64, + "length": 4 + }, + "importance": 0.1483 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "solid", + "offset": 345, + "length": 5 + }, + "importance": 0.0694 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Cribriform", + "offset": 330, + "length": 10 + }, + "importance": 0.043 + } + ], + "value": "8500", + "confidenceScore": 0.9973 + }, + { + "type": "clinicalStageT", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct carcinoma; duct", + "offset": 39, + "length": 29 + }, + "importance": 0.2613 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 179, + "length": 8 + }, + "importance": 0.1341 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Laterality: Left", + "offset": 0, + "length": 16 + }, + "importance": 0.0874 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive", + "offset": 124, + "length": 8 + }, + "importance": 0.0722 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "situ", + "offset": 82, + "length": 4 + }, + "importance": 0.0651 + } + ], + "value": "T1", + "confidenceScore": 0.9956 + }, + { + "type": "clinicalStageN", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct carcinoma; duct carcinoma in situ \n Tumor", + "offset": 39, + "length": 55 + }, + "importance": 0.1529 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive carcinoma: Extensive", + "offset": 395, + "length": 29 + }, + "importance": 0.0782 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive", + "offset": 124, + "length": 8 + }, + "importance": 0.0715 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Left \n Tumor", + "offset": 12, + "length": 12 + }, + "importance": 0.0325 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Histologic", + "offset": 145, + "length": 10 + }, + "importance": 0.0066 + } + ], + "value": "N0", + "confidenceScore": 0.9931 + }, + { + "type": "clinicalStageM", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Laterality: Left \n Tumor", + "offset": 0, + "length": 24 + }, + "importance": 0.1579 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct", + "offset": 39, + "length": 13 + }, + "importance": 0.1493 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Histologic Grade - Nottingham", + "offset": 208, + "length": 29 + }, + "importance": 0.1038 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive", + "offset": 124, + "length": 8 + }, + "importance": 0.089 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "duct carcinoma", + "offset": 64, + "length": 14 + }, + "importance": 0.0807 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 395, + "length": 8 + }, + "importance": 0.057 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Extensive", + "offset": 415, + "length": 9 + }, + "importance": 0.0494 + } + ], + "value": "None", + "confidenceScore": 0.5217 + }, + { + "type": "pathologicStageT", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct", + "offset": 39, + "length": 13 + }, + "importance": 0.3125 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Left \n Tumor", + "offset": 12, + "length": 12 + }, + "importance": 0.201 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 179, + "length": 8 + }, + "importance": 0.1244 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 395, + "length": 8 + }, + "importance": 0.0961 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive", + "offset": 124, + "length": 8 + }, + "importance": 0.0623 + } + ], + "value": "T1", + "confidenceScore": 0.9477 + }, + { + "type": "pathologicStageN", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive component:", + "offset": 179, + "length": 19 + }, + "importance": 0.1402 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Nottingham combined histologic score:", + "offset": 227, + "length": 37 + }, + "importance": 0.1096 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive carcinoma \n Histologic", + "offset": 124, + "length": 31 + }, + "importance": 0.1067 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Ductal", + "offset": 162, + "length": 6 + }, + "importance": 0.0896 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct carcinoma;", + "offset": 39, + "length": 24 + }, + "importance": 0.0831 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "in situ", + "offset": 79, + "length": 7 + }, + "importance": 0.042 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Tumor", + "offset": 19, + "length": 5 + }, + "importance": 0.0092 + } + ], + "value": "N0", + "confidenceScore": 0.7927 + }, + { + "type": "pathologicStageM", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "In situ carcinoma (DCIS)", + "offset": 278, + "length": 24 + }, + "importance": 0.1111 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Nottingham combined histologic", + "offset": 227, + "length": 30 + }, + "importance": 0.0999 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive carcinoma:", + "offset": 395, + "length": 19 + }, + "importance": 0.0787 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 179, + "length": 8 + }, + "importance": 0.0617 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct carcinoma;", + "offset": 39, + "length": 24 + }, + "importance": 0.0594 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Tumor", + "offset": 19, + "length": 5 + }, + "importance": 0.0579 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "of DCIS:", + "offset": 321, + "length": 8 + }, + "importance": 0.0483 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Laterality:", + "offset": 0, + "length": 11 + }, + "importance": 0.0324 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive carcinoma", + "offset": 124, + "length": 18 + }, + "importance": 0.0269 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "carcinoma in", + "offset": 69, + "length": 12 + }, + "importance": 0.0202 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Tumor", + "offset": 89, + "length": 5 + }, + "importance": 0.0112 + } + ], + "value": "M0", + "confidenceScore": 0.9208 + } + ] + } + ], + "modelVersion": "2022-01-01-preview" + }, + "jobId": "7c76e45b-fb37-4b7f-aa0c-e7bb0734aecc", + "createdDateTime": "2023-03-06T09:10:35Z", + "expirationDateTime": "2023-03-06T09:27:15Z", + "lastUpdateDateTime": "2023-03-06T09:10:36Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_HEALTH_INSIGHTS_API_KEY": "Sanitized", + "AZURE_HEALTH_INSIGHTS_ENDPOINT": "https://sanitized.azure-api.net/", + "RandomSeed": "1312474858" + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/SessionRecords/CancerProfilingClientLiveTests/GetResultsFromCreateJobAsync.json b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/SessionRecords/CancerProfilingClientLiveTests/GetResultsFromCreateJobAsync.json new file mode 100644 index 000000000000..30779255a427 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/SessionRecords/CancerProfilingClientLiveTests/GetResultsFromCreateJobAsync.json @@ -0,0 +1,614 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/oncophenotype/jobs?api-version=2023-03-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "1048", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-743c4fd3cb9746df91c3f01ad075ffe2-e177dbac61684a26-00", + "User-Agent": "azsdk-net-Health.Insights.CancerProfiling/1.0.0-alpha.20230306.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "0b293a0acc67c3e87e25d31ed0d74c74", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "configuration": { + "checkForCancerCase": true, + "includeEvidence": true + }, + "patients": [ + { + "id": "patient1", + "data": [ + { + "clinicalType": "pathology", + "content": { + "sourceType": "inline", + "value": "Laterality: Left \n Tumor type present: Invasive duct carcinoma; duct carcinoma in situ \n Tumor site: Upper inner quadrant \n Invasive carcinoma \n Histologic type: Ductal \n Size of invasive component: 0.9 cm \n Histologic Grade - Nottingham combined histologic score: 1 out of 3 \n In situ carcinoma (DCIS) \n Histologic type of DCIS: Cribriform and solid \n Necrosis in DCIS: Yes \n DCIS component of invasive carcinoma: Extensive \n" + }, + "createdDateTime": "2022-01-01T00:00:00", + "id": "document1", + "kind": "note", + "language": "en" + } + ] + } + ] + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "236c6e72-e7b3-4eb8-9a15-7c91d97a7eeb", + "Content-Length": "0", + "Date": "Mon, 06 Mar 2023 09:11:26 GMT", + "Operation-Location": "https://sanitized.azure-api.net/healthinsights/oncophenotype/jobs/31148113-3fe3-4e0e-9bee-efcd7d6abdf9?api-version=2023-03-01-preview", + "Retry-After": "5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/oncophenotype/jobs/31148113-3fe3-4e0e-9bee-efcd7d6abdf9?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-743c4fd3cb9746df91c3f01ad075ffe2-b1e2d45fa391482b-00", + "User-Agent": "azsdk-net-Health.Insights.CancerProfiling/1.0.0-alpha.20230306.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "0e5a432d9b3883ff5350ffbb05e9e12e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "4d11f0b8-e821-4cf0-b26f-12cb42a5ccda", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:11:26 GMT", + "Retry-After": "3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "31148113-3fe3-4e0e-9bee-efcd7d6abdf9", + "createdDateTime": "2023-03-06T09:11:26Z", + "expirationDateTime": "2023-03-06T09:28:06Z", + "lastUpdateDateTime": "2023-03-06T09:11:26Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/oncophenotype/jobs/31148113-3fe3-4e0e-9bee-efcd7d6abdf9?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-743c4fd3cb9746df91c3f01ad075ffe2-e6b9a31d35d9c000-00", + "User-Agent": "azsdk-net-Health.Insights.CancerProfiling/1.0.0-alpha.20230306.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "acf37c393d2d66cfa45f7276cdec4717", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "a7fdc9f4-5283-4530-82ea-1f3bd77418c1", + "Content-Length": "6279", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:11:30 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "results": { + "patients": [ + { + "id": "patient1", + "inferences": [ + { + "type": "tumorSite", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Upper inner", + "offset": 101, + "length": 11 + }, + "importance": 0.5563 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "duct", + "offset": 64, + "length": 4 + }, + "importance": 0.0156 + } + ], + "value": "C50.2", + "description": "BREAST", + "confidenceScore": 0.9214 + }, + { + "type": "histology", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Ductal", + "offset": 162, + "length": 6 + }, + "importance": 0.2937 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct", + "offset": 39, + "length": 13 + }, + "importance": 0.2439 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 179, + "length": 8 + }, + "importance": 0.1588 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "duct", + "offset": 64, + "length": 4 + }, + "importance": 0.1483 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "solid", + "offset": 345, + "length": 5 + }, + "importance": 0.0694 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Cribriform", + "offset": 330, + "length": 10 + }, + "importance": 0.043 + } + ], + "value": "8500", + "confidenceScore": 0.9973 + }, + { + "type": "clinicalStageT", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct carcinoma; duct", + "offset": 39, + "length": 29 + }, + "importance": 0.2613 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 179, + "length": 8 + }, + "importance": 0.1341 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Laterality: Left", + "offset": 0, + "length": 16 + }, + "importance": 0.0874 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive", + "offset": 124, + "length": 8 + }, + "importance": 0.0722 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "situ", + "offset": 82, + "length": 4 + }, + "importance": 0.0651 + } + ], + "value": "T1", + "confidenceScore": 0.9956 + }, + { + "type": "clinicalStageN", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct carcinoma; duct carcinoma in situ \n Tumor", + "offset": 39, + "length": 55 + }, + "importance": 0.1529 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive carcinoma: Extensive", + "offset": 395, + "length": 29 + }, + "importance": 0.0782 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive", + "offset": 124, + "length": 8 + }, + "importance": 0.0715 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Left \n Tumor", + "offset": 12, + "length": 12 + }, + "importance": 0.0325 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Histologic", + "offset": 145, + "length": 10 + }, + "importance": 0.0066 + } + ], + "value": "N0", + "confidenceScore": 0.9931 + }, + { + "type": "clinicalStageM", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Laterality: Left \n Tumor", + "offset": 0, + "length": 24 + }, + "importance": 0.1579 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct", + "offset": 39, + "length": 13 + }, + "importance": 0.1493 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Histologic Grade - Nottingham", + "offset": 208, + "length": 29 + }, + "importance": 0.1038 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive", + "offset": 124, + "length": 8 + }, + "importance": 0.089 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "duct carcinoma", + "offset": 64, + "length": 14 + }, + "importance": 0.0807 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 395, + "length": 8 + }, + "importance": 0.057 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Extensive", + "offset": 415, + "length": 9 + }, + "importance": 0.0494 + } + ], + "value": "None", + "confidenceScore": 0.5217 + }, + { + "type": "pathologicStageT", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct", + "offset": 39, + "length": 13 + }, + "importance": 0.3125 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Left \n Tumor", + "offset": 12, + "length": 12 + }, + "importance": 0.201 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 179, + "length": 8 + }, + "importance": 0.1244 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 395, + "length": 8 + }, + "importance": 0.0961 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive", + "offset": 124, + "length": 8 + }, + "importance": 0.0623 + } + ], + "value": "T1", + "confidenceScore": 0.9477 + }, + { + "type": "pathologicStageN", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive component:", + "offset": 179, + "length": 19 + }, + "importance": 0.1402 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Nottingham combined histologic score:", + "offset": 227, + "length": 37 + }, + "importance": 0.1096 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive carcinoma \n Histologic", + "offset": 124, + "length": 31 + }, + "importance": 0.1067 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Ductal", + "offset": 162, + "length": 6 + }, + "importance": 0.0896 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct carcinoma;", + "offset": 39, + "length": 24 + }, + "importance": 0.0831 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "in situ", + "offset": 79, + "length": 7 + }, + "importance": 0.042 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Tumor", + "offset": 19, + "length": 5 + }, + "importance": 0.0092 + } + ], + "value": "N0", + "confidenceScore": 0.7927 + }, + { + "type": "pathologicStageM", + "evidence": [ + { + "patientDataEvidence": { + "id": "document1", + "text": "In situ carcinoma (DCIS)", + "offset": 278, + "length": 24 + }, + "importance": 0.1111 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Nottingham combined histologic", + "offset": 227, + "length": 30 + }, + "importance": 0.0999 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive carcinoma:", + "offset": 395, + "length": 19 + }, + "importance": 0.0787 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "invasive", + "offset": 179, + "length": 8 + }, + "importance": 0.0617 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive duct carcinoma;", + "offset": 39, + "length": 24 + }, + "importance": 0.0594 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Tumor", + "offset": 19, + "length": 5 + }, + "importance": 0.0579 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "of DCIS:", + "offset": 321, + "length": 8 + }, + "importance": 0.0483 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Laterality:", + "offset": 0, + "length": 11 + }, + "importance": 0.0324 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Invasive carcinoma", + "offset": 124, + "length": 18 + }, + "importance": 0.0269 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "carcinoma in", + "offset": 69, + "length": 12 + }, + "importance": 0.0202 + }, + { + "patientDataEvidence": { + "id": "document1", + "text": "Tumor", + "offset": 89, + "length": 5 + }, + "importance": 0.0112 + } + ], + "value": "M0", + "confidenceScore": 0.9208 + } + ] + } + ], + "modelVersion": "2022-01-01-preview" + }, + "jobId": "31148113-3fe3-4e0e-9bee-efcd7d6abdf9", + "createdDateTime": "2023-03-06T09:11:26Z", + "expirationDateTime": "2023-03-06T09:28:06Z", + "lastUpdateDateTime": "2023-03-06T09:11:27Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_HEALTH_INSIGHTS_API_KEY": "Sanitized", + "AZURE_HEALTH_INSIGHTS_ENDPOINT": "https://sanitized.azure-api.net/", + "RandomSeed": "564752262" + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/TestData/CancerProfilingClientTest.request.json b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/TestData/CancerProfilingClientTest.request.json new file mode 100644 index 000000000000..a6344d248045 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/TestData/CancerProfilingClientTest.request.json @@ -0,0 +1,24 @@ +{ + "configuration": { + "checkForCancerCase": true, + "includeEvidence": true + }, + "patients": [ + { + "id": "patient1", + "data": [ + { + "clinicalType": "pathology", + "content": { + "sourceType": "inline", + "value": "Laterality: Left \n Tumor type present: Invasive duct carcinoma; duct carcinoma in situ \n Tumor site: Upper inner quadrant \n Invasive carcinoma \n Histologic type: Ductal \n Size of invasive component: 0.9 cm \n Histologic Grade - Nottingham combined histologic score: 1 out of 3 \n In situ carcinoma (DCIS) \n Histologic type of DCIS: Cribriform and solid \n Necrosis in DCIS: Yes \n DCIS component of invasive carcinoma: Extensive \n" + }, + "createdDateTime": "2022-01-01T00:00:00", + "id": "document1", + "kind": "note", + "language": "en" + } + ] + } + ] +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/test.runsettings b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/test.runsettings new file mode 100644 index 000000000000..4e652e41867a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/test.runsettings @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/Azure.Health.Insights.ClinicalMatching.sln b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/Azure.Health.Insights.ClinicalMatching.sln new file mode 100644 index 000000000000..ef5d5fcfbece --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/Azure.Health.Insights.ClinicalMatching.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32929.385 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Health.Insights.ClinicalMatching", "src\Azure.Health.Insights.ClinicalMatching.csproj", "{2D88565D-163A-4BB6-B95C-1CA4A21D5537}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Health.Insights.ClinicalMatching.Tests", "tests\Azure.Health.Insights.ClinicalMatching.Tests.csproj", "{00E239E3-F439-47C2-85D1-1CEEC623FFE0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2D88565D-163A-4BB6-B95C-1CA4A21D5537}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D88565D-163A-4BB6-B95C-1CA4A21D5537}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D88565D-163A-4BB6-B95C-1CA4A21D5537}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D88565D-163A-4BB6-B95C-1CA4A21D5537}.Release|Any CPU.Build.0 = Release|Any CPU + {00E239E3-F439-47C2-85D1-1CEEC623FFE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00E239E3-F439-47C2-85D1-1CEEC623FFE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00E239E3-F439-47C2-85D1-1CEEC623FFE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00E239E3-F439-47C2-85D1-1CEEC623FFE0}.Release|Any CPU.Build.0 = Release|Any CPU + {2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FA6BF22-3400-4581-B5E7-2F9A7E4D6D2C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/CHANGELOG.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/CHANGELOG.md new file mode 100644 index 000000000000..bf2b61e5eda9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/CHANGELOG.md @@ -0,0 +1,12 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added +- Initial preview of the Azure.Health.Insights.ClinicalMatching client library. + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/Directory.Build.props b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md new file mode 100644 index 000000000000..3d7e2e8f5b22 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md @@ -0,0 +1,167 @@ +# Azure Cognitive Services Health Insights Clinical Matching client library for .NET + + +[Health Insights] is an Azure Applied AI Service built with the Azure Cognitive Services Framework, that leverages multiple Cognitive Services, Healthcare API services and other Azure resources. +The [Clinical Matching model] receives patients data and clinical trials protocols, and provides relevant clinical trials based on eligibility criteria. + +## Getting started + +### Prerequisites + +- You need an [Azure subscription][azure_sub] to use this package. +- An existing Cognitive Services Health Insights instance. + +### Install the package + +Install the Azure Health Insights client Clinical Matchinglibrary for .NET with [NuGet][nuget]: + +```dotnetcli +dotnet add package Azure.Health.Insights.ClinicalMatching --prerelease +``` + +This table shows the relationship between SDK versions and supported API versions of the service: + +|SDK version|Supported API version of service | +|-------------|---------------| +|1.0.0b1 | 2023-03-01-preview| + +### Authenticate the client + +You can find the endpoint for your Health Insights service resource using the +[Azure Portal](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesHealthInsights) +or [Azure CLI](https://learn.microsoft.com/cli/azure/): + +```bash +# Get the endpoint for the Health Insights service resource +az cognitiveservices account show --name "resource-name" --resource-group "resource-group-name" --query "properties.endpoint" +``` + +#### Get the API Key + +You can get the **API Key** from the Health Insights service resource in the Azure Portal. +Alternatively, you can use **Azure CLI** snippet below to get the API key of your resource. + +```PowerShell +az cognitiveservices account keys list --resource-group --name +``` + +#### Create ClinicalMatchingClient with AzureKeyCredential + +Once you have the value for the API key, create an `AzureKeyCredential`. With the endpoint and key credential, you can create the [`ClinicalMatchingClient`][clinical_matching_client_class]: + +```C# +string endpoint = ""; +string apiKey = ""; +var credential = new AzureKeyCredential(apiKey); +var client = new ClinicalMatchingClient(new Uri(endpoint), credential); +``` + +### Long-Running Operations + +For large documents which take a long time to execute, these operations are implemented as [**long-running operations**][dotnet_lro]. Long-running operations consist of an initial request sent to the service to start an operation, followed by polling the service at intervals to determine whether the operation has completed or failed, and if it has succeeded, to get the result. + +For long running operations in the Azure SDK, the client exposes a `Start` method that returns an `Operation` or a `PageableOperation`. You can use the extension method `WaitForCompletionAsync()` to wait for the operation to complete and obtain its result. A sample code snippet is provided to illustrate using long-running operations [below](#run-multiple-actions-asynchronously). + +## Key concepts +Trial Matcher provides the user of the services two main modes of operation: patients centric and clinical trial centric. + +- On patient centric mode, the Trial Matcher model bases the patient matching on the clinical condition, location, priorities, eligibility criteria, and other criteria that the patient and/or service users may choose to prioritize. The model helps narrow down and prioritize the set of relevant clinical trials to a smaller set of trials to start with, that the specific patient appears to be qualified for. +- On clinical trial centric, the Trial Matcher is finding a group of patients potentially eligible to a clinical trial. The Trial Matcher narrows down the patients, first filtered on clinical condition and selected clinical observations, and then focuses on those patients who met the baseline criteria, to find the group of patients that appears to be eligible patients to a trial. + +## Examples + +- [Match Trials](#match-trials) + +### Match Trials + +```C# Snippet:HealthInsightsClinicalMatchingMatchTrialsAsync +TrialMatcherResult trialMatcherResult = default; +try +{ + // Using ClinicalMatchingClient + MatchTrialsAsync + Operation operation = await clinicalMatchingClient.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); + Response resp = operation.GetRawResponse(); + trialMatcherResult = TrialMatcherResult.FromResponse(resp); +} +catch (Exception ex) +{ + Console.WriteLine(ex.ToString()); + return; +} +``` +```C# Snippet:HealthInsightsTrialMatcherMatchTrialsAsyncViewResults +// View the match trials (eligible/ineligible) +if (trialMatcherResult.Status == JobStatus.Succeeded) +{ + TrialMatcherResults matcherResults = trialMatcherResult.Results; + foreach (TrialMatcherPatientResult patientResult in matcherResults.Patients) + { + Console.WriteLine($"Inferences of Patient {patientResult.Id}"); + foreach (TrialMatcherInference tmInferences in patientResult.Inferences) + { + Console.WriteLine($"Trial Id {tmInferences.Id}"); + Console.WriteLine($"Type: {tmInferences.Type.ToString()} Value: {tmInferences.Value}"); + Console.WriteLine($"Description {tmInferences.Description}"); + } + } +} +else +{ + IReadOnlyList matcherErrors = trialMatcherResult.Errors; + foreach (ResponseError error in matcherErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } +} +``` + +## Troubleshooting + +### Setting up console logging + +The simplest way to see the logs is to enable the console logging. +To create an Azure SDK log listener that outputs messages to console use the AzureEventSourceListener.CreateConsoleLogger method. + +```C# +// Setup a listener to monitor logged events. +using AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger(); +``` + +To learn more about other logging mechanisms see [Diagnostics Samples][logging]. + +## Next steps + + + + +### Additional documentation + + + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla]. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + +[clinical_matching_client_class]: + + +[DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md +[cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli +[logging]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/samples/Diagnostics.md +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/dotnet/ +[nuget]: https://www.nuget.org/ +[azure_portal]: https://portal.azure.com +[cla]: https://cla.microsoft.com +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com --> diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/api/Azure.Health.Insights.ClinicalMatching.netstandard2.0.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/api/Azure.Health.Insights.ClinicalMatching.netstandard2.0.cs new file mode 100644 index 000000000000..e44c8d5a00d5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/api/Azure.Health.Insights.ClinicalMatching.netstandard2.0.cs @@ -0,0 +1,557 @@ +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class AcceptedAge + { + public AcceptedAge(Azure.Health.Insights.ClinicalMatching.AgeUnit unit, float value) { } + public Azure.Health.Insights.ClinicalMatching.AgeUnit Unit { get { throw null; } } + public float Value { get { throw null; } } + } + public partial class AcceptedAgeRange + { + public AcceptedAgeRange() { } + public Azure.Health.Insights.ClinicalMatching.AcceptedAge MaximumAge { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.AcceptedAge MinimumAge { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AgeUnit : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AgeUnit(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.AgeUnit Days { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.AgeUnit Months { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.AgeUnit Years { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.AgeUnit other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.AgeUnit left, Azure.Health.Insights.ClinicalMatching.AgeUnit right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.AgeUnit (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.AgeUnit left, Azure.Health.Insights.ClinicalMatching.AgeUnit right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AreaGeometry + { + public AreaGeometry(Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType type, System.Collections.Generic.IEnumerable coordinates) { } + public System.Collections.Generic.IList Coordinates { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType Type { get { throw null; } } + } + public partial class AreaProperties + { + public AreaProperties(Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType subType, double radius) { } + public double Radius { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType SubType { get { throw null; } } + } + public partial class ClinicalCodedElement + { + public ClinicalCodedElement(string system, string code) { } + public string Code { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string System { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ClinicalDocumentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ClinicalDocumentType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType Consultation { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType DischargeSummary { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType HistoryAndPhysical { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType Imaging { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType Laboratory { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType Pathology { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType Procedure { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType Progress { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType left, Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType left, Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ClinicalMatchingClient + { + protected ClinicalMatchingClient() { } + public ClinicalMatchingClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public ClinicalMatchingClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Health.Insights.ClinicalMatching.ClinicalMatchingClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Operation MatchTrials(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string repeatabilityRequestId = null, System.DateTimeOffset? repeatabilityFirstSent = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation MatchTrials(Azure.WaitUntil waitUntil, Azure.Health.Insights.ClinicalMatching.TrialMatcherData trialMatcherData, string repeatabilityRequestId = null, System.DateTimeOffset? repeatabilityFirstSent = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> MatchTrialsAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, string repeatabilityRequestId = null, System.DateTimeOffset? repeatabilityFirstSent = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> MatchTrialsAsync(Azure.WaitUntil waitUntil, Azure.Health.Insights.ClinicalMatching.TrialMatcherData trialMatcherData, string repeatabilityRequestId = null, System.DateTimeOffset? repeatabilityFirstSent = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ClinicalMatchingClientOptions : Azure.Core.ClientOptions + { + public ClinicalMatchingClientOptions(Azure.Health.Insights.ClinicalMatching.ClinicalMatchingClientOptions.ServiceVersion version = Azure.Health.Insights.ClinicalMatching.ClinicalMatchingClientOptions.ServiceVersion.V2023_03_01_Preview) { } + public enum ServiceVersion + { + V2023_03_01_Preview = 1, + } + } + public partial class ClinicalNoteEvidence + { + internal ClinicalNoteEvidence() { } + public string Id { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + public string Text { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ClinicalTrialAcceptedSex : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ClinicalTrialAcceptedSex(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex All { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex Female { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex Male { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ClinicalTrialDemographics + { + public ClinicalTrialDemographics() { } + public Azure.Health.Insights.ClinicalMatching.AcceptedAgeRange AcceptedAgeRange { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex? AcceptedSex { get { throw null; } set { } } + } + public partial class ClinicalTrialDetails + { + public ClinicalTrialDetails(string id, Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata metadata) { } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialDemographics Demographics { get { throw null; } set { } } + public string EligibilityCriteriaText { get { throw null; } set { } } + public string Id { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata Metadata { get { throw null; } } + } + public partial class ClinicalTrialMetadata + { + public ClinicalTrialMetadata(System.Collections.Generic.IEnumerable conditions) { } + public System.Collections.Generic.IList Conditions { get { throw null; } } + public System.Collections.Generic.IList Contacts { get { throw null; } } + public System.Collections.Generic.IList Facilities { get { throw null; } } + public System.Collections.Generic.IList Phases { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus? RecruitmentStatus { get { throw null; } set { } } + public System.Collections.Generic.IList Sponsors { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType? StudyType { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ClinicalTrialPhase : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ClinicalTrialPhase(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase EarlyPhase1 { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase NotApplicable { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase Phase1 { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase Phase2 { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase Phase3 { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase Phase4 { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialPhase right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ClinicalTrialPurpose : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ClinicalTrialPurpose(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose BasicScience { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose DeviceFeasibility { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose Diagnostic { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose HealthServicesResearch { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose NotApplicable { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose Other { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose Prevention { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose Screening { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose SupportiveCare { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose Treatment { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialPurpose right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ClinicalTrialRecruitmentStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ClinicalTrialRecruitmentStatus(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus EnrollingByInvitation { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus NotYetRecruiting { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus Recruiting { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus UnknownStatus { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ClinicalTrialRegistryFilter + { + public ClinicalTrialRegistryFilter() { } + public System.Collections.Generic.IList Conditions { get { throw null; } } + public System.Collections.Generic.IList FacilityAreas { get { throw null; } } + public System.Collections.Generic.IList FacilityLocations { get { throw null; } } + public System.Collections.Generic.IList FacilityNames { get { throw null; } } + public System.Collections.Generic.IList Ids { get { throw null; } } + public System.Collections.Generic.IList Phases { get { throw null; } } + public System.Collections.Generic.IList Purposes { get { throw null; } } + public System.Collections.Generic.IList RecruitmentStatuses { get { throw null; } } + public System.Collections.Generic.IList Sources { get { throw null; } } + public System.Collections.Generic.IList Sponsors { get { throw null; } } + public System.Collections.Generic.IList StudyTypes { get { throw null; } } + } + public partial class ClinicalTrialResearchFacility + { + public ClinicalTrialResearchFacility(string name, string country) { } + public string City { get { throw null; } set { } } + public string Country { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string State { get { throw null; } set { } } + } + public partial class ClinicalTrials + { + public ClinicalTrials() { } + public System.Collections.Generic.IList CustomTrials { get { throw null; } } + public System.Collections.Generic.IList RegistryFilters { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ClinicalTrialSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ClinicalTrialSource(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource ClinicaltrialsGov { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource Custom { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ClinicalTrialStudyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ClinicalTrialStudyType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType ExpandedAccess { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType Interventional { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType Observational { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType PatientRegistries { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType left, Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContactDetails + { + public ContactDetails() { } + public string Email { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Phone { get { throw null; } set { } } + } + public partial class DocumentContent + { + public DocumentContent(Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType sourceType, string value) { } + public Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType SourceType { get { throw null; } } + public string Value { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentContentSourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentContentSourceType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType Inline { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType Reference { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType left, Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType left, Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.DocumentType Dicom { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.DocumentType FhirBundle { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.DocumentType GenomicSequencing { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.DocumentType Note { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.DocumentType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.DocumentType left, Azure.Health.Insights.ClinicalMatching.DocumentType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.DocumentType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.DocumentType left, Azure.Health.Insights.ClinicalMatching.DocumentType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ExtendedClinicalCodedElement + { + internal ExtendedClinicalCodedElement() { } + public string Category { get { throw null; } } + public string Code { get { throw null; } } + public string Name { get { throw null; } } + public string SemanticType { get { throw null; } } + public string System { get { throw null; } } + public string Value { get { throw null; } } + } + public partial class GeographicArea + { + public GeographicArea(Azure.Health.Insights.ClinicalMatching.GeoJsonType type, Azure.Health.Insights.ClinicalMatching.AreaGeometry geometry, Azure.Health.Insights.ClinicalMatching.AreaProperties properties) { } + public Azure.Health.Insights.ClinicalMatching.AreaGeometry Geometry { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.AreaProperties Properties { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.GeoJsonType Type { get { throw null; } } + } + public partial class GeographicLocation + { + public GeographicLocation(string country) { } + public string City { get { throw null; } set { } } + public string Country { get { throw null; } } + public string State { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct GeoJsonGeometryType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public GeoJsonGeometryType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType Point { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType left, Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType left, Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct GeoJsonPropertiesSubType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public GeoJsonPropertiesSubType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType Circle { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType left, Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType left, Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSubType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct GeoJsonType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public GeoJsonType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.GeoJsonType Feature { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.GeoJsonType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.GeoJsonType left, Azure.Health.Insights.ClinicalMatching.GeoJsonType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.GeoJsonType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.GeoJsonType left, Azure.Health.Insights.ClinicalMatching.GeoJsonType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobStatus(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.JobStatus Failed { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.JobStatus NotStarted { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.JobStatus PartiallyCompleted { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.JobStatus Running { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.JobStatus Succeeded { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.JobStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.JobStatus left, Azure.Health.Insights.ClinicalMatching.JobStatus right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.JobStatus (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.JobStatus left, Azure.Health.Insights.ClinicalMatching.JobStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PatientDocument + { + public PatientDocument(Azure.Health.Insights.ClinicalMatching.DocumentType type, string id, Azure.Health.Insights.ClinicalMatching.DocumentContent content) { } + public Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType? ClinicalType { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.DocumentContent Content { get { throw null; } } + public System.DateTimeOffset? CreatedDateTime { get { throw null; } set { } } + public string Id { get { throw null; } } + public string Language { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.DocumentType Type { get { throw null; } } + } + public partial class PatientInfo + { + public PatientInfo() { } + public System.DateTimeOffset? BirthDate { get { throw null; } set { } } + public System.Collections.Generic.IList ClinicalInfo { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.PatientInfoSex? Sex { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatientInfoSex : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatientInfoSex(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.PatientInfoSex Female { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.PatientInfoSex Male { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.PatientInfoSex Unspecified { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.PatientInfoSex other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.PatientInfoSex left, Azure.Health.Insights.ClinicalMatching.PatientInfoSex right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.PatientInfoSex (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.PatientInfoSex left, Azure.Health.Insights.ClinicalMatching.PatientInfoSex right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PatientRecord + { + public PatientRecord(string id) { } + public System.Collections.Generic.IList Data { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.PatientInfo Info { get { throw null; } set { } } + } + public partial class TrialMatcherData + { + public TrialMatcherData(System.Collections.Generic.IEnumerable patients) { } + public Azure.Health.Insights.ClinicalMatching.TrialMatcherModelConfiguration Configuration { get { throw null; } set { } } + public System.Collections.Generic.IList Patients { get { throw null; } } + } + public partial class TrialMatcherInference + { + internal TrialMatcherInference() { } + public float? ConfidenceScore { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Evidence { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata Metadata { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource? Source { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType Type { get { throw null; } } + public string Value { get { throw null; } } + } + public partial class TrialMatcherInferenceEvidence + { + internal TrialMatcherInferenceEvidence() { } + public string EligibilityCriteriaEvidence { get { throw null; } } + public float? Importance { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalNoteEvidence PatientDataEvidence { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalCodedElement PatientInfoEvidence { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TrialMatcherInferenceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TrialMatcherInferenceType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType TrialEligibility { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType left, Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType left, Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TrialMatcherModelConfiguration + { + public TrialMatcherModelConfiguration(Azure.Health.Insights.ClinicalMatching.ClinicalTrials clinicalTrials) { } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrials ClinicalTrials { get { throw null; } } + public bool? IncludeEvidence { get { throw null; } set { } } + public bool? Verbose { get { throw null; } set { } } + } + public partial class TrialMatcherPatientResult + { + internal TrialMatcherPatientResult() { } + public string Id { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Inferences { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NeededClinicalInfo { get { throw null; } } + } + public partial class TrialMatcherResult + { + internal TrialMatcherResult() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdateDateTime { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.TrialMatcherResults Results { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.JobStatus Status { get { throw null; } } + } + public partial class TrialMatcherResults + { + internal TrialMatcherResults() { } + public System.DateTimeOffset? KnowledgeGraphLastUpdateDate { get { throw null; } } + public string ModelVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Patients { get { throw null; } } + } +} +namespace Microsoft.Extensions.Azure +{ + public static partial class AzureHealthInsightsClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddClinicalMatchingClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddClinicalMatchingClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md new file mode 100644 index 000000000000..81b2f4bdacb1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md @@ -0,0 +1,22 @@ +--- +page_type: sample +languages: +- csharp +products: +- azure +- azure-cognitive-services +- azure-health-insights-clinicalmatching +name: Azure Health Insights - Clinical Matching samples for .NET +description: Samples for the Azure.Health.Insights.ClinicalMatching client library +--- + +# Azure Health Insights ClinicalMatching client SDK Samples +These code samples show common scenario operations with the Azure Health Insights ClinicalMatching client library. + +|**Sample Name**|**Description**| +|----------------|-------------| +|[Sample_MatchTrials][sample_get_all_matching_clinical_trials_for_a_specific_patient] |Get all matching clinical trials for a specific patient.| + + diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample_MatchTrials.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample_MatchTrials.md new file mode 100644 index 000000000000..c680dff420cc --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample_MatchTrials.md @@ -0,0 +1,155 @@ +# Get all matching clinical trials for a specific patient +This sample demonstrates how to get all matching clinical trials for a specific patient, together with the associated evidence, based on the given patient's clinical condition and a public clinical trial registry. Trial list should be refined by a certain set of properties, as specified by the user (like trial phase and trial recruitment status). + +## Creating a `ClinicalMatchingClient` + +To create a new `ClinicalMatchingClient` to get all matching clinical trials for a specific patient, you need a Cognitive Services or HealthInsights service endpoint and credentials. You can use the [DefaultAzureCredential][DefaultAzureCredential] to try a number of common authentication methods optimized for both running as a service and development. In the sample below, however, you'll use a AzureHealthInsights service API key credential by creating an `AzureKeyCredential` object, that if needed, will allow you to update the API key without creating a new client. + +You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. + +```C# Snippet:CreateClinicalMatchingClient +// Read endpoint and apiKey +string endpoint = TestEnvironment.Endpoint; +string apiKey = TestEnvironment.ApiKey; + +var endpointUri = new Uri(endpoint); +var credential = new AzureKeyCredential(apiKey); + +// Create ClinicalMatchingClient +ClinicalMatchingClient clinicalMatchingClient = new ClinicalMatchingClient(endpointUri, credential); +``` + +## Get matching clinical trials for a patient + +To get matching clinical trials for a patient, call `MatchTrialsAsync` on an instance of `TrialMatcherData`. The result is a Long Running operation of type `TrialMatcherResult`. + +```C# Snippet:HealthInsightsTrialMatcherCreateTrialMatcherData +// Create patient +PatientRecord patient1 = new PatientRecord("patient_id") +{ + Info = new PatientInfo + { + BirthDate = new System.DateTime(1965, 12, 26), + Sex = PatientInfoSex.Male + } +}; + +// Attach clinical info to the patient +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0006826") +{ + Name = "Malignant Neoplasms", + Value = "true" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1522449") +{ + Name = "Therapeutic radiology procedure", + Value = "true" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "METASTATIC") +{ + Name = "metastatic", + Value = "true" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1512162") +{ + Name = "Eastern Cooperative Oncology Group", + Value = "1" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019693") +{ + Name = "HIV Infections", + Value = "false" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1300072") +{ + Name = "Tumor stage", + Value = "2" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019163") +{ + Name = "Hepatitis B", + Value = "false" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0018802") +{ + Name = "Congestive heart failure", + Value = "true" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019196") +{ + Name = "Hepatitis C", + Value = "false" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0220650") +{ + Name = "Metastatic malignant neoplasm to brain", + Value = "true" +}); + +// Create registry filter +var registryFilters = new ClinicalTrialRegistryFilter(); +// Limit the trial to a specific patient condition ("Non-small cell lung cancer") +registryFilters.Conditions.Add("Non-small cell lung cancer"); +// Limit the clinical trial to a certain phase, phase 1 +registryFilters.Phases.Add(ClinicalTrialPhase.Phase1); +// Specify the clinical trial registry source as ClinicalTrials.Gov +registryFilters.Sources.Add(ClinicalTrialSource.ClinicaltrialsGov); +// Limit the clinical trial to a certain location, in this case California, USA +registryFilters.FacilityLocations.Add(new GeographicLocation("United States") { State = "Arizona" , City = "Gilbert" }); +// Limit the trial to a specific study type, interventional +registryFilters.StudyTypes.Add(ClinicalTrialStudyType.Interventional); + +// Create ClinicalTrial instance and attach the registry filter to it. +var clinicalTrials = new ClinicalTrials(); +clinicalTrials.RegistryFilters.Add(registryFilters); + +// Create TrialMatcherData with patient and configuration +var Configuration = new TrialMatcherModelConfiguration(clinicalTrials); +var trialMatcherData = new TrialMatcherData(new List { patient1 }) { Configuration = Configuration }; +``` + +Call MatchTrialsAsync to submit a trial matching request and get the matching trials response + +```C# Snippet:HealthInsightsClinicalMatchingMatchTrialsAsync +TrialMatcherResult trialMatcherResult = default; +try +{ + // Using ClinicalMatchingClient + MatchTrialsAsync + Operation operation = await clinicalMatchingClient.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); + Response resp = operation.GetRawResponse(); + trialMatcherResult = TrialMatcherResult.FromResponse(resp); +} +catch (Exception ex) +{ + Console.WriteLine(ex.ToString()); + return; +} +``` + +To view the final results: + +```C# Snippet:HealthInsightsTrialMatcherMatchTrialsAsyncViewResults +// View the match trials (eligible/ineligible) +if (trialMatcherResult.Status == JobStatus.Succeeded) +{ + TrialMatcherResults matcherResults = trialMatcherResult.Results; + foreach (TrialMatcherPatientResult patientResult in matcherResults.Patients) + { + Console.WriteLine($"Inferences of Patient {patientResult.Id}"); + foreach (TrialMatcherInference tmInferences in patientResult.Inferences) + { + Console.WriteLine($"Trial Id {tmInferences.Id}"); + Console.WriteLine($"Type: {tmInferences.Type.ToString()} Value: {tmInferences.Value}"); + Console.WriteLine($"Description {tmInferences.Description}"); + } + } +} +else +{ + IReadOnlyList matcherErrors = trialMatcherResult.Errors; + foreach (ResponseError error in matcherErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } +} +``` diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Azure.Health.Insights.ClinicalMatching.csproj b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Azure.Health.Insights.ClinicalMatching.csproj new file mode 100644 index 000000000000..cf42750a6cc4 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Azure.Health.Insights.ClinicalMatching.csproj @@ -0,0 +1,25 @@ + + + This is the Azure Health Insights ClinicalMatching client library for developing .NET applications with rich experience. + Azure SDK Code Generation HealthInsights for Azure Data Plane + 1.0.0-beta.1 + Azure Health Insights + $(RequiredTargetFrameworks) + true + $(NoWarn);CS1591;AZC0012 + true + true + + + + + + + + + + + + + + diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Constants.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Constants.cs new file mode 100644 index 000000000000..27c0ec91fbb7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Constants.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Health.Insights.ClinicalMatching +{ + internal static class Constants + { + public const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + + public const string DefaultCognitiveScope = "https://cognitiveservices.azure.com/.default"; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.Serialization.cs new file mode 100644 index 000000000000..7d0b6fb5dcba --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class AcceptedAge : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("unit"u8); + writer.WriteStringValue(Unit.ToString()); + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.cs new file mode 100644 index 000000000000..98e58416f26c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A person's age, given as a number (value) and a unit (e.g. years, months). + public partial class AcceptedAge + { + /// Initializes a new instance of AcceptedAge. + /// Possible units for a person's age. + /// The number of years/months/days that represents the person's age. + public AcceptedAge(AgeUnit unit, float value) + { + Unit = unit; + Value = value; + } + + /// Possible units for a person's age. + public AgeUnit Unit { get; } + /// The number of years/months/days that represents the person's age. + public float Value { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.Serialization.cs new file mode 100644 index 000000000000..0952e9235090 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class AcceptedAgeRange : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(MinimumAge)) + { + writer.WritePropertyName("minimumAge"u8); + writer.WriteObjectValue(MinimumAge); + } + if (Optional.IsDefined(MaximumAge)) + { + writer.WritePropertyName("maximumAge"u8); + writer.WriteObjectValue(MaximumAge); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.cs new file mode 100644 index 000000000000..512ef2941c9d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A definition of the range of ages accepted by a clinical trial. Contains a minimum age and/or a maximum age. + public partial class AcceptedAgeRange + { + /// Initializes a new instance of AcceptedAgeRange. + public AcceptedAgeRange() + { + } + + /// A person's age, given as a number (value) and a unit (e.g. years, months). + public AcceptedAge MinimumAge { get; set; } + /// A person's age, given as a number (value) and a unit (e.g. years, months). + public AcceptedAge MaximumAge { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AgeUnit.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AgeUnit.cs new file mode 100644 index 000000000000..0fe84b951dce --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AgeUnit.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Possible units for a person's age. + public readonly partial struct AgeUnit : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AgeUnit(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string YearsValue = "years"; + private const string MonthsValue = "months"; + private const string DaysValue = "days"; + + /// years. + public static AgeUnit Years { get; } = new AgeUnit(YearsValue); + /// months. + public static AgeUnit Months { get; } = new AgeUnit(MonthsValue); + /// days. + public static AgeUnit Days { get; } = new AgeUnit(DaysValue); + /// Determines if two values are the same. + public static bool operator ==(AgeUnit left, AgeUnit right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AgeUnit left, AgeUnit right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AgeUnit(string value) => new AgeUnit(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AgeUnit other && Equals(other); + /// + public bool Equals(AgeUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaGeometry.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaGeometry.Serialization.cs new file mode 100644 index 000000000000..a0288e05d90d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaGeometry.Serialization.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class AreaGeometry : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + writer.WritePropertyName("coordinates"u8); + writer.WriteStartArray(); + foreach (var item in Coordinates) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaGeometry.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaGeometry.cs new file mode 100644 index 000000000000..2f5a543534e3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaGeometry.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// `GeoJSON` geometry, representing the area circle's center. + public partial class AreaGeometry + { + /// Initializes a new instance of AreaGeometry. + /// `GeoJSON` geometry type. + /// + /// Coordinates of the area circle's center, represented according to the `GeoJSON` standard. + /// This is an array of 2 decimal numbers, longitude and latitude (precisely in this order). + /// + /// is null. + public AreaGeometry(GeoJsonGeometryType type, IEnumerable coordinates) + { + Argument.AssertNotNull(coordinates, nameof(coordinates)); + + Type = type; + Coordinates = coordinates.ToList(); + } + + /// `GeoJSON` geometry type. + public GeoJsonGeometryType Type { get; } + /// + /// Coordinates of the area circle's center, represented according to the `GeoJSON` standard. + /// This is an array of 2 decimal numbers, longitude and latitude (precisely in this order). + /// + public IList Coordinates { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaProperties.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaProperties.Serialization.cs new file mode 100644 index 000000000000..0add5d93b77d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaProperties.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class AreaProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("subType"u8); + writer.WriteStringValue(SubType.ToString()); + writer.WritePropertyName("radius"u8); + writer.WriteNumberValue(Radius); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaProperties.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaProperties.cs new file mode 100644 index 000000000000..a5485ee19e55 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AreaProperties.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// `GeoJSON` object properties. + public partial class AreaProperties + { + /// Initializes a new instance of AreaProperties. + /// `GeoJSON` object sub-type. + /// The radius of the area's circle, in meters. + public AreaProperties(GeoJsonPropertiesSubType subType, double radius) + { + SubType = subType; + Radius = radius; + } + + /// `GeoJSON` object sub-type. + public GeoJsonPropertiesSubType SubType { get; } + /// The radius of the area's circle, in meters. + public double Radius { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AzureHealthInsightsClientBuilderExtensions.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AzureHealthInsightsClientBuilderExtensions.cs new file mode 100644 index 000000000000..3772dd96ab34 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AzureHealthInsightsClientBuilderExtensions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core.Extensions; +using Azure.Health.Insights.ClinicalMatching; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class AzureHealthInsightsClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddClinicalMatchingClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new ClinicalMatchingClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddClinicalMatchingClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.Serialization.cs new file mode 100644 index 000000000000..2e1bcc74da7f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ClinicalCodedElement : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + writer.WriteEndObject(); + } + + internal static ClinicalCodedElement DeserializeClinicalCodedElement(JsonElement element) + { + string system = default; + string code = default; + Optional name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + } + return new ClinicalCodedElement(system, code, name, value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ClinicalCodedElement FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeClinicalCodedElement(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.cs new file mode 100644 index 000000000000..91684cbffd86 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A piece of clinical information, expressed as a code in a clinical coding system. + public partial class ClinicalCodedElement + { + /// Initializes a new instance of ClinicalCodedElement. + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + /// The code within the given clinical coding system. + /// or is null. + public ClinicalCodedElement(string system, string code) + { + Argument.AssertNotNull(system, nameof(system)); + Argument.AssertNotNull(code, nameof(code)); + + System = system; + Code = code; + } + + /// Initializes a new instance of ClinicalCodedElement. + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + /// The code within the given clinical coding system. + /// The name of this coded concept in the coding system. + /// A value associated with the code within the given clinical coding system. + internal ClinicalCodedElement(string system, string code, string name, string value) + { + System = system; + Code = code; + Name = name; + Value = value; + } + + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + public string System { get; set; } + /// The code within the given clinical coding system. + public string Code { get; set; } + /// The name of this coded concept in the coding system. + public string Name { get; set; } + /// A value associated with the code within the given clinical coding system. + public string Value { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalDocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalDocumentType.cs new file mode 100644 index 000000000000..191b1d6a4317 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalDocumentType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The type of the clinical document. + public readonly partial struct ClinicalDocumentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClinicalDocumentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConsultationValue = "consultation"; + private const string DischargeSummaryValue = "dischargeSummary"; + private const string HistoryAndPhysicalValue = "historyAndPhysical"; + private const string ProcedureValue = "procedure"; + private const string ProgressValue = "progress"; + private const string ImagingValue = "imaging"; + private const string LaboratoryValue = "laboratory"; + private const string PathologyValue = "pathology"; + + /// consultation. + public static ClinicalDocumentType Consultation { get; } = new ClinicalDocumentType(ConsultationValue); + /// dischargeSummary. + public static ClinicalDocumentType DischargeSummary { get; } = new ClinicalDocumentType(DischargeSummaryValue); + /// historyAndPhysical. + public static ClinicalDocumentType HistoryAndPhysical { get; } = new ClinicalDocumentType(HistoryAndPhysicalValue); + /// procedure. + public static ClinicalDocumentType Procedure { get; } = new ClinicalDocumentType(ProcedureValue); + /// progress. + public static ClinicalDocumentType Progress { get; } = new ClinicalDocumentType(ProgressValue); + /// imaging. + public static ClinicalDocumentType Imaging { get; } = new ClinicalDocumentType(ImagingValue); + /// laboratory. + public static ClinicalDocumentType Laboratory { get; } = new ClinicalDocumentType(LaboratoryValue); + /// pathology. + public static ClinicalDocumentType Pathology { get; } = new ClinicalDocumentType(PathologyValue); + /// Determines if two values are the same. + public static bool operator ==(ClinicalDocumentType left, ClinicalDocumentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClinicalDocumentType left, ClinicalDocumentType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ClinicalDocumentType(string value) => new ClinicalDocumentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalDocumentType other && Equals(other); + /// + public bool Equals(ClinicalDocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs new file mode 100644 index 000000000000..e9c36965a804 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Health.Insights.ClinicalMatching +{ + // Data plane generated client. + /// The ClinicalMatching service client. + public partial class ClinicalMatchingClient + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ClinicalMatchingClient for mocking. + protected ClinicalMatchingClient() + { + } + + /// Initializes a new instance of ClinicalMatchingClient. + /// Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ClinicalMatchingClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new ClinicalMatchingClientOptions()) + { + } + + /// Initializes a new instance of ClinicalMatchingClient. + /// Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ClinicalMatchingClient(Uri endpoint, AzureKeyCredential credential, ClinicalMatchingClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new ClinicalMatchingClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Create Trial Matcher job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The body of the Trial Matcher request. + /// An opaque, globally-unique, client-generated string identifier for the request. + /// Specifies the date and time at which the request was first created. + /// The cancellation token to use. + /// is null. + /// Creates a Trial Matcher job with the given request body. + public virtual async Task> MatchTrialsAsync(WaitUntil waitUntil, TrialMatcherData trialMatcherData, string repeatabilityRequestId = null, DateTimeOffset? repeatabilityFirstSent = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(trialMatcherData, nameof(trialMatcherData)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await MatchTrialsAsync(waitUntil, trialMatcherData.ToRequestContent(), repeatabilityRequestId, repeatabilityFirstSent, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, TrialMatcherResult.FromResponse, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials"); + } + + /// Create Trial Matcher job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The body of the Trial Matcher request. + /// An opaque, globally-unique, client-generated string identifier for the request. + /// Specifies the date and time at which the request was first created. + /// The cancellation token to use. + /// is null. + /// Creates a Trial Matcher job with the given request body. + public virtual Operation MatchTrials(WaitUntil waitUntil, TrialMatcherData trialMatcherData, string repeatabilityRequestId = null, DateTimeOffset? repeatabilityFirstSent = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(trialMatcherData, nameof(trialMatcherData)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = MatchTrials(waitUntil, trialMatcherData.ToRequestContent(), repeatabilityRequestId, repeatabilityFirstSent, context); + return ProtocolOperationHelpers.Convert(response, TrialMatcherResult.FromResponse, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials"); + } + + /// Create Trial Matcher job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content to send as the body of the request. Details of the request body schema are in the Remarks section below. + /// An opaque, globally-unique, client-generated string identifier for the request. + /// Specifies the date and time at which the request was first created. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service that will contain a object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. + /// + public virtual async Task> MatchTrialsAsync(WaitUntil waitUntil, RequestContent content, string repeatabilityRequestId = null, DateTimeOffset? repeatabilityFirstSent = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ClinicalMatchingClient.MatchTrials"); + scope.Start(); + try + { + using HttpMessage message = CreateMatchTrialsRequest(content, repeatabilityRequestId, repeatabilityFirstSent, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create Trial Matcher job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content to send as the body of the request. Details of the request body schema are in the Remarks section below. + /// An opaque, globally-unique, client-generated string identifier for the request. + /// Specifies the date and time at which the request was first created. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service that will contain a object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. + /// + public virtual Operation MatchTrials(WaitUntil waitUntil, RequestContent content, string repeatabilityRequestId = null, DateTimeOffset? repeatabilityFirstSent = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ClinicalMatchingClient.MatchTrials"); + scope.Start(); + try + { + using HttpMessage message = CreateMatchTrialsRequest(content, repeatabilityRequestId, repeatabilityFirstSent, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials", OperationFinalStateVia.Location, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateMatchTrialsRequest(RequestContent content, string repeatabilityRequestId, DateTimeOffset? repeatabilityFirstSent, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/healthinsights", false); + uri.AppendPath("/trialmatcher/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (repeatabilityRequestId != null) + { + request.Headers.Add("Repeatability-Request-ID", repeatabilityRequestId); + } + if (repeatabilityFirstSent != null) + { + request.Headers.Add("Repeatability-First-Sent", repeatabilityFirstSent.Value, "O"); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200202; + private static ResponseClassifier ResponseClassifier200202 => _responseClassifier200202 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 202 }); + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClientOptions.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClientOptions.cs new file mode 100644 index 000000000000..aee7822e8c4b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Client options for ClinicalMatchingClient. + public partial class ClinicalMatchingClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2023_03_01_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-03-01-preview". + V2023_03_01_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of ClinicalMatchingClientOptions. + public ClinicalMatchingClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_03_01_Preview => "2023-03-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.Serialization.cs new file mode 100644 index 000000000000..78d99a65f76c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ClinicalNoteEvidence + { + internal static ClinicalNoteEvidence DeserializeClinicalNoteEvidence(JsonElement element) + { + string id = default; + Optional text = default; + int offset = default; + int length = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + } + return new ClinicalNoteEvidence(id, text, offset, length); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ClinicalNoteEvidence FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeClinicalNoteEvidence(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.cs new file mode 100644 index 000000000000..8765b936855f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A piece of evidence from a clinical note (text document). + public partial class ClinicalNoteEvidence + { + /// Initializes a new instance of ClinicalNoteEvidence. + /// The identifier of the document containing the evidence. + /// The start index of the evidence text span in the document (0 based). + /// The length of the evidence text span. + /// is null. + internal ClinicalNoteEvidence(string id, int offset, int length) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of ClinicalNoteEvidence. + /// The identifier of the document containing the evidence. + /// The actual text span which is evidence for the inference. + /// The start index of the evidence text span in the document (0 based). + /// The length of the evidence text span. + internal ClinicalNoteEvidence(string id, string text, int offset, int length) + { + Id = id; + Text = text; + Offset = offset; + Length = length; + } + + /// The identifier of the document containing the evidence. + public string Id { get; } + /// The actual text span which is evidence for the inference. + public string Text { get; } + /// The start index of the evidence text span in the document (0 based). + public int Offset { get; } + /// The length of the evidence text span. + public int Length { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialAcceptedSex.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialAcceptedSex.cs new file mode 100644 index 000000000000..2828de5a8924 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialAcceptedSex.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Possible values for the Sex eligibility criterion as accepted by clinical trials, which indicates the sex of people who may participate in a clinical study. + public readonly partial struct ClinicalTrialAcceptedSex : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClinicalTrialAcceptedSex(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AllValue = "all"; + private const string FemaleValue = "female"; + private const string MaleValue = "male"; + + /// all. + public static ClinicalTrialAcceptedSex All { get; } = new ClinicalTrialAcceptedSex(AllValue); + /// female. + public static ClinicalTrialAcceptedSex Female { get; } = new ClinicalTrialAcceptedSex(FemaleValue); + /// male. + public static ClinicalTrialAcceptedSex Male { get; } = new ClinicalTrialAcceptedSex(MaleValue); + /// Determines if two values are the same. + public static bool operator ==(ClinicalTrialAcceptedSex left, ClinicalTrialAcceptedSex right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClinicalTrialAcceptedSex left, ClinicalTrialAcceptedSex right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ClinicalTrialAcceptedSex(string value) => new ClinicalTrialAcceptedSex(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalTrialAcceptedSex other && Equals(other); + /// + public bool Equals(ClinicalTrialAcceptedSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.Serialization.cs new file mode 100644 index 000000000000..43fa8c274531 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ClinicalTrialDemographics : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(AcceptedSex)) + { + if (AcceptedSex != null) + { + writer.WritePropertyName("acceptedSex"u8); + writer.WriteStringValue(AcceptedSex.Value.ToString()); + } + else + { + writer.WriteNull("acceptedSex"); + } + } + if (Optional.IsDefined(AcceptedAgeRange)) + { + writer.WritePropertyName("acceptedAgeRange"u8); + writer.WriteObjectValue(AcceptedAgeRange); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.cs new file mode 100644 index 000000000000..baa9284bb3ac --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Demographic criteria for a clinical trial. + public partial class ClinicalTrialDemographics + { + /// Initializes a new instance of ClinicalTrialDemographics. + public ClinicalTrialDemographics() + { + } + + /// Indication of the sex of people who may participate in the clinical trial. + public ClinicalTrialAcceptedSex? AcceptedSex { get; set; } + /// A definition of the range of ages accepted by a clinical trial. Contains a minimum age and/or a maximum age. + public AcceptedAgeRange AcceptedAgeRange { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.Serialization.cs new file mode 100644 index 000000000000..805d901af00d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ClinicalTrialDetails : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(EligibilityCriteriaText)) + { + writer.WritePropertyName("eligibilityCriteriaText"u8); + writer.WriteStringValue(EligibilityCriteriaText); + } + if (Optional.IsDefined(Demographics)) + { + writer.WritePropertyName("demographics"u8); + writer.WriteObjectValue(Demographics); + } + writer.WritePropertyName("metadata"u8); + writer.WriteObjectValue(Metadata); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.cs new file mode 100644 index 000000000000..3250ec549103 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A description of a clinical trial. + public partial class ClinicalTrialDetails + { + /// Initializes a new instance of ClinicalTrialDetails. + /// A given identifier for the clinical trial. Has to be unique within a list of clinical trials. + /// Trial data which is of interest to the potential participant. + /// or is null. + public ClinicalTrialDetails(string id, ClinicalTrialMetadata metadata) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(metadata, nameof(metadata)); + + Id = id; + Metadata = metadata; + } + + /// A given identifier for the clinical trial. Has to be unique within a list of clinical trials. + public string Id { get; } + /// The eligibility criteria of the clinical trial (inclusion and exclusion), given as text. + public string EligibilityCriteriaText { get; set; } + /// Demographic criteria for a clinical trial. + public ClinicalTrialDemographics Demographics { get; set; } + /// Trial data which is of interest to the potential participant. + public ClinicalTrialMetadata Metadata { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.Serialization.cs new file mode 100644 index 000000000000..5d664c68daf6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ClinicalTrialMetadata : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Phases)) + { + writer.WritePropertyName("phases"u8); + writer.WriteStartArray(); + foreach (var item in Phases) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(StudyType)) + { + if (StudyType != null) + { + writer.WritePropertyName("studyType"u8); + writer.WriteStringValue(StudyType.Value.ToString()); + } + else + { + writer.WriteNull("studyType"); + } + } + if (Optional.IsDefined(RecruitmentStatus)) + { + if (RecruitmentStatus != null) + { + writer.WritePropertyName("recruitmentStatus"u8); + writer.WriteStringValue(RecruitmentStatus.Value.ToString()); + } + else + { + writer.WriteNull("recruitmentStatus"); + } + } + writer.WritePropertyName("conditions"u8); + writer.WriteStartArray(); + foreach (var item in Conditions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(Sponsors)) + { + writer.WritePropertyName("sponsors"u8); + writer.WriteStartArray(); + foreach (var item in Sponsors) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Contacts)) + { + writer.WritePropertyName("contacts"u8); + writer.WriteStartArray(); + foreach (var item in Contacts) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Facilities)) + { + writer.WritePropertyName("facilities"u8); + writer.WriteStartArray(); + foreach (var item in Facilities) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static ClinicalTrialMetadata DeserializeClinicalTrialMetadata(JsonElement element) + { + Optional> phases = default; + Optional studyType = default; + Optional recruitmentStatus = default; + IList conditions = default; + Optional> sponsors = default; + Optional> contacts = default; + Optional> facilities = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("phases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new ClinicalTrialPhase(item.GetString())); + } + phases = array; + continue; + } + if (property.NameEquals("studyType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + studyType = null; + continue; + } + studyType = new ClinicalTrialStudyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("recruitmentStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + recruitmentStatus = null; + continue; + } + recruitmentStatus = new ClinicalTrialRecruitmentStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("conditions"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + conditions = array; + continue; + } + if (property.NameEquals("sponsors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sponsors = array; + continue; + } + if (property.NameEquals("contacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContactDetails.DeserializeContactDetails(item)); + } + contacts = array; + continue; + } + if (property.NameEquals("facilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ClinicalTrialResearchFacility.DeserializeClinicalTrialResearchFacility(item)); + } + facilities = array; + continue; + } + } + return new ClinicalTrialMetadata(Optional.ToList(phases), Optional.ToNullable(studyType), Optional.ToNullable(recruitmentStatus), conditions, Optional.ToList(sponsors), Optional.ToList(contacts), Optional.ToList(facilities)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ClinicalTrialMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeClinicalTrialMetadata(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.cs new file mode 100644 index 000000000000..3a6aab96ea5e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Trial data which is of interest to the potential participant. + public partial class ClinicalTrialMetadata + { + /// Initializes a new instance of ClinicalTrialMetadata. + /// Medical conditions and their synonyms which are relevant for the clinical trial, given as strings. + /// is null. + public ClinicalTrialMetadata(IEnumerable conditions) + { + Argument.AssertNotNull(conditions, nameof(conditions)); + + Phases = new ChangeTrackingList(); + Conditions = conditions.ToList(); + Sponsors = new ChangeTrackingList(); + Contacts = new ChangeTrackingList(); + Facilities = new ChangeTrackingList(); + } + + /// Initializes a new instance of ClinicalTrialMetadata. + /// + /// Phases which are relevant for the clinical trial. + /// Each clinical trial can be in a certain phase or in multiple phases. + /// + /// Possible study types of a clinical trial. + /// Possible recruitment status of a clinical trial. + /// Medical conditions and their synonyms which are relevant for the clinical trial, given as strings. + /// Sponsors/collaborators involved with the trial. + /// Contact details of the trial administrators, for patients that want to participate in the trial. + /// Research facilities where the clinical trial is conducted. + internal ClinicalTrialMetadata(IList phases, ClinicalTrialStudyType? studyType, ClinicalTrialRecruitmentStatus? recruitmentStatus, IList conditions, IList sponsors, IList contacts, IList facilities) + { + Phases = phases.ToList(); + StudyType = studyType; + RecruitmentStatus = recruitmentStatus; + Conditions = conditions.ToList(); + Sponsors = sponsors.ToList(); + Contacts = contacts.ToList(); + Facilities = facilities.ToList(); + } + + /// + /// Phases which are relevant for the clinical trial. + /// Each clinical trial can be in a certain phase or in multiple phases. + /// + public IList Phases { get; } + /// Possible study types of a clinical trial. + public ClinicalTrialStudyType? StudyType { get; set; } + /// Possible recruitment status of a clinical trial. + public ClinicalTrialRecruitmentStatus? RecruitmentStatus { get; set; } + /// Medical conditions and their synonyms which are relevant for the clinical trial, given as strings. + public IList Conditions { get; } + /// Sponsors/collaborators involved with the trial. + public IList Sponsors { get; } + /// Contact details of the trial administrators, for patients that want to participate in the trial. + public IList Contacts { get; } + /// Research facilities where the clinical trial is conducted. + public IList Facilities { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialPhase.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialPhase.cs new file mode 100644 index 000000000000..e594f3dd77e5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialPhase.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Possible phases of a clinical trial. + public readonly partial struct ClinicalTrialPhase : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClinicalTrialPhase(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotApplicableValue = "notApplicable"; + private const string EarlyPhase1Value = "earlyPhase1"; + private const string Phase1Value = "phase1"; + private const string Phase2Value = "phase2"; + private const string Phase3Value = "phase3"; + private const string Phase4Value = "phase4"; + + /// notApplicable. + public static ClinicalTrialPhase NotApplicable { get; } = new ClinicalTrialPhase(NotApplicableValue); + /// earlyPhase1. + public static ClinicalTrialPhase EarlyPhase1 { get; } = new ClinicalTrialPhase(EarlyPhase1Value); + /// phase1. + public static ClinicalTrialPhase Phase1 { get; } = new ClinicalTrialPhase(Phase1Value); + /// phase2. + public static ClinicalTrialPhase Phase2 { get; } = new ClinicalTrialPhase(Phase2Value); + /// phase3. + public static ClinicalTrialPhase Phase3 { get; } = new ClinicalTrialPhase(Phase3Value); + /// phase4. + public static ClinicalTrialPhase Phase4 { get; } = new ClinicalTrialPhase(Phase4Value); + /// Determines if two values are the same. + public static bool operator ==(ClinicalTrialPhase left, ClinicalTrialPhase right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClinicalTrialPhase left, ClinicalTrialPhase right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ClinicalTrialPhase(string value) => new ClinicalTrialPhase(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalTrialPhase other && Equals(other); + /// + public bool Equals(ClinicalTrialPhase other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialPurpose.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialPurpose.cs new file mode 100644 index 000000000000..845e4e065f04 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialPurpose.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Possible purposes of a clinical trial. + public readonly partial struct ClinicalTrialPurpose : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClinicalTrialPurpose(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotApplicableValue = "notApplicable"; + private const string ScreeningValue = "screening"; + private const string DiagnosticValue = "diagnostic"; + private const string PreventionValue = "prevention"; + private const string HealthServicesResearchValue = "healthServicesResearch"; + private const string TreatmentValue = "treatment"; + private const string DeviceFeasibilityValue = "deviceFeasibility"; + private const string SupportiveCareValue = "supportiveCare"; + private const string BasicScienceValue = "basicScience"; + private const string OtherValue = "other"; + + /// notApplicable. + public static ClinicalTrialPurpose NotApplicable { get; } = new ClinicalTrialPurpose(NotApplicableValue); + /// screening. + public static ClinicalTrialPurpose Screening { get; } = new ClinicalTrialPurpose(ScreeningValue); + /// diagnostic. + public static ClinicalTrialPurpose Diagnostic { get; } = new ClinicalTrialPurpose(DiagnosticValue); + /// prevention. + public static ClinicalTrialPurpose Prevention { get; } = new ClinicalTrialPurpose(PreventionValue); + /// healthServicesResearch. + public static ClinicalTrialPurpose HealthServicesResearch { get; } = new ClinicalTrialPurpose(HealthServicesResearchValue); + /// treatment. + public static ClinicalTrialPurpose Treatment { get; } = new ClinicalTrialPurpose(TreatmentValue); + /// deviceFeasibility. + public static ClinicalTrialPurpose DeviceFeasibility { get; } = new ClinicalTrialPurpose(DeviceFeasibilityValue); + /// supportiveCare. + public static ClinicalTrialPurpose SupportiveCare { get; } = new ClinicalTrialPurpose(SupportiveCareValue); + /// basicScience. + public static ClinicalTrialPurpose BasicScience { get; } = new ClinicalTrialPurpose(BasicScienceValue); + /// other. + public static ClinicalTrialPurpose Other { get; } = new ClinicalTrialPurpose(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(ClinicalTrialPurpose left, ClinicalTrialPurpose right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClinicalTrialPurpose left, ClinicalTrialPurpose right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ClinicalTrialPurpose(string value) => new ClinicalTrialPurpose(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalTrialPurpose other && Equals(other); + /// + public bool Equals(ClinicalTrialPurpose other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRecruitmentStatus.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRecruitmentStatus.cs new file mode 100644 index 000000000000..c27261466d07 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRecruitmentStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Possible recruitment status of a clinical trial. + public readonly partial struct ClinicalTrialRecruitmentStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClinicalTrialRecruitmentStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownStatusValue = "unknownStatus"; + private const string NotYetRecruitingValue = "notYetRecruiting"; + private const string RecruitingValue = "recruiting"; + private const string EnrollingByInvitationValue = "enrollingByInvitation"; + + /// unknownStatus. + public static ClinicalTrialRecruitmentStatus UnknownStatus { get; } = new ClinicalTrialRecruitmentStatus(UnknownStatusValue); + /// notYetRecruiting. + public static ClinicalTrialRecruitmentStatus NotYetRecruiting { get; } = new ClinicalTrialRecruitmentStatus(NotYetRecruitingValue); + /// recruiting. + public static ClinicalTrialRecruitmentStatus Recruiting { get; } = new ClinicalTrialRecruitmentStatus(RecruitingValue); + /// enrollingByInvitation. + public static ClinicalTrialRecruitmentStatus EnrollingByInvitation { get; } = new ClinicalTrialRecruitmentStatus(EnrollingByInvitationValue); + /// Determines if two values are the same. + public static bool operator ==(ClinicalTrialRecruitmentStatus left, ClinicalTrialRecruitmentStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClinicalTrialRecruitmentStatus left, ClinicalTrialRecruitmentStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ClinicalTrialRecruitmentStatus(string value) => new ClinicalTrialRecruitmentStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalTrialRecruitmentStatus other && Equals(other); + /// + public bool Equals(ClinicalTrialRecruitmentStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRegistryFilter.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRegistryFilter.Serialization.cs new file mode 100644 index 000000000000..ef2722906ac1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRegistryFilter.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ClinicalTrialRegistryFilter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Conditions)) + { + writer.WritePropertyName("conditions"u8); + writer.WriteStartArray(); + foreach (var item in Conditions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(StudyTypes)) + { + writer.WritePropertyName("studyTypes"u8); + writer.WriteStartArray(); + foreach (var item in StudyTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(RecruitmentStatuses)) + { + writer.WritePropertyName("recruitmentStatuses"u8); + writer.WriteStartArray(); + foreach (var item in RecruitmentStatuses) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Sponsors)) + { + writer.WritePropertyName("sponsors"u8); + writer.WriteStartArray(); + foreach (var item in Sponsors) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Phases)) + { + writer.WritePropertyName("phases"u8); + writer.WriteStartArray(); + foreach (var item in Phases) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Purposes)) + { + writer.WritePropertyName("purposes"u8); + writer.WriteStartArray(); + foreach (var item in Purposes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Ids)) + { + writer.WritePropertyName("ids"u8); + writer.WriteStartArray(); + foreach (var item in Ids) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Sources)) + { + writer.WritePropertyName("sources"u8); + writer.WriteStartArray(); + foreach (var item in Sources) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(FacilityNames)) + { + writer.WritePropertyName("facilityNames"u8); + writer.WriteStartArray(); + foreach (var item in FacilityNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(FacilityLocations)) + { + writer.WritePropertyName("facilityLocations"u8); + writer.WriteStartArray(); + foreach (var item in FacilityLocations) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(FacilityAreas)) + { + writer.WritePropertyName("facilityAreas"u8); + writer.WriteStartArray(); + foreach (var item in FacilityAreas) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRegistryFilter.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRegistryFilter.cs new file mode 100644 index 000000000000..8270b9ddcbf5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialRegistryFilter.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A filter defining a subset of clinical trials from a given clinical trial registry (e.g. clinicaltrials.gov). + public partial class ClinicalTrialRegistryFilter + { + /// Initializes a new instance of ClinicalTrialRegistryFilter. + public ClinicalTrialRegistryFilter() + { + Conditions = new ChangeTrackingList(); + StudyTypes = new ChangeTrackingList(); + RecruitmentStatuses = new ChangeTrackingList(); + Sponsors = new ChangeTrackingList(); + Phases = new ChangeTrackingList(); + Purposes = new ChangeTrackingList(); + Ids = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + FacilityNames = new ChangeTrackingList(); + FacilityLocations = new ChangeTrackingList(); + FacilityAreas = new ChangeTrackingList(); + } + + /// + /// Trials with any of the given medical conditions will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the medical conditions. + /// + public IList Conditions { get; } + /// + /// Trials with any of the given study types will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the study types. + /// + public IList StudyTypes { get; } + /// + /// Trials with any of the given recruitment statuses will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the recruitment statuses. + /// + public IList RecruitmentStatuses { get; } + /// + /// Trials with any of the given sponsors will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the sponsors. + /// + public IList Sponsors { get; } + /// + /// Trials with any of the given phases will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the phases. + /// + public IList Phases { get; } + /// + /// Trials with any of the given purposes will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the purposes. + /// + public IList Purposes { get; } + /// + /// Trials with any of the given identifiers will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the trial identifiers. + /// + public IList Ids { get; } + /// + /// Trials with any of the given sources will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the sources. + /// + public IList Sources { get; } + /// + /// Trials with any of the given facility names will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the trial facility names. + /// + public IList FacilityNames { get; } + /// + /// Trials with any of the given facility locations will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the trial facility locations. + /// + public IList FacilityLocations { get; } + /// + /// Trials with any of the given facility area boundaries will be included in the selection (provided that other limitations are satisfied). + /// Leaving this list empty will not limit the trial facility area boundaries. + /// + public IList FacilityAreas { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.Serialization.cs new file mode 100644 index 000000000000..a71585902030 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ClinicalTrialResearchFacility : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(City)) + { + writer.WritePropertyName("city"u8); + writer.WriteStringValue(City); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State); + } + writer.WritePropertyName("country"u8); + writer.WriteStringValue(Country); + writer.WriteEndObject(); + } + + internal static ClinicalTrialResearchFacility DeserializeClinicalTrialResearchFacility(JsonElement element) + { + string name = default; + Optional city = default; + Optional state = default; + string country = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("city"u8)) + { + city = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("country"u8)) + { + country = property.Value.GetString(); + continue; + } + } + return new ClinicalTrialResearchFacility(name, city, state, country); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ClinicalTrialResearchFacility FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeClinicalTrialResearchFacility(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs new file mode 100644 index 000000000000..6f024be5541f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Details of a research facility where a clinical trial is conducted. + public partial class ClinicalTrialResearchFacility + { + /// Initializes a new instance of ClinicalTrialResearchFacility. + /// The facility's name. + /// Country name. + /// or is null. + public ClinicalTrialResearchFacility(string name, string country) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(country, nameof(country)); + + Name = name; + Country = country; + } + + /// Initializes a new instance of ClinicalTrialResearchFacility. + /// The facility's name. + /// City name. + /// State name. + /// Country name. + internal ClinicalTrialResearchFacility(string name, string city, string state, string country) + { + Name = name; + City = city; + State = state; + Country = country; + } + + /// The facility's name. + public string Name { get; set; } + /// City name. + public string City { get; set; } + /// State name. + public string State { get; set; } + /// Country name. + public string Country { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialSource.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialSource.cs new file mode 100644 index 000000000000..bcdf64476eef --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialSource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Possible sources of a clinical trial. + public readonly partial struct ClinicalTrialSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClinicalTrialSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CustomValue = "custom"; + private const string ClinicaltrialsGovValue = "clinicaltrials.gov"; + + /// custom. + public static ClinicalTrialSource Custom { get; } = new ClinicalTrialSource(CustomValue); + /// clinicaltrials.gov. + public static ClinicalTrialSource ClinicaltrialsGov { get; } = new ClinicalTrialSource(ClinicaltrialsGovValue); + /// Determines if two values are the same. + public static bool operator ==(ClinicalTrialSource left, ClinicalTrialSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClinicalTrialSource left, ClinicalTrialSource right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ClinicalTrialSource(string value) => new ClinicalTrialSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalTrialSource other && Equals(other); + /// + public bool Equals(ClinicalTrialSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialStudyType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialStudyType.cs new file mode 100644 index 000000000000..8212277d04aa --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialStudyType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Possible study types of a clinical trial. + public readonly partial struct ClinicalTrialStudyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClinicalTrialStudyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InterventionalValue = "interventional"; + private const string ObservationalValue = "observational"; + private const string ExpandedAccessValue = "expandedAccess"; + private const string PatientRegistriesValue = "patientRegistries"; + + /// interventional. + public static ClinicalTrialStudyType Interventional { get; } = new ClinicalTrialStudyType(InterventionalValue); + /// observational. + public static ClinicalTrialStudyType Observational { get; } = new ClinicalTrialStudyType(ObservationalValue); + /// expandedAccess. + public static ClinicalTrialStudyType ExpandedAccess { get; } = new ClinicalTrialStudyType(ExpandedAccessValue); + /// patientRegistries. + public static ClinicalTrialStudyType PatientRegistries { get; } = new ClinicalTrialStudyType(PatientRegistriesValue); + /// Determines if two values are the same. + public static bool operator ==(ClinicalTrialStudyType left, ClinicalTrialStudyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClinicalTrialStudyType left, ClinicalTrialStudyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ClinicalTrialStudyType(string value) => new ClinicalTrialStudyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalTrialStudyType other && Equals(other); + /// + public bool Equals(ClinicalTrialStudyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.Serialization.cs new file mode 100644 index 000000000000..7226d5bb4582 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ClinicalTrials : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(CustomTrials)) + { + writer.WritePropertyName("customTrials"u8); + writer.WriteStartArray(); + foreach (var item in CustomTrials) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(RegistryFilters)) + { + writer.WritePropertyName("registryFilters"u8); + writer.WriteStartArray(); + foreach (var item in RegistryFilters) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.cs new file mode 100644 index 000000000000..0047f69a1264 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// + /// The clinical trials that the patient(s) should be matched to. + /// The trial selection can be given as a list of custom clinical trials and/or a list of filters to known clinical trial registries. + /// In case both are given, the resulting trial set is a union of the two sets. + /// + public partial class ClinicalTrials + { + /// Initializes a new instance of ClinicalTrials. + public ClinicalTrials() + { + CustomTrials = new ChangeTrackingList(); + RegistryFilters = new ChangeTrackingList(); + } + + /// A list of clinical trials. + public IList CustomTrials { get; } + /// + /// A list of filters, each one creating a selection of trials from a given + /// clinical trial registry. + /// + public IList RegistryFilters { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.Serialization.cs new file mode 100644 index 000000000000..e56d6284fe70 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ContactDetails : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Email)) + { + writer.WritePropertyName("email"u8); + writer.WriteStringValue(Email); + } + if (Optional.IsDefined(Phone)) + { + writer.WritePropertyName("phone"u8); + writer.WriteStringValue(Phone); + } + writer.WriteEndObject(); + } + + internal static ContactDetails DeserializeContactDetails(JsonElement element) + { + Optional name = default; + Optional email = default; + Optional phone = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("email"u8)) + { + email = property.Value.GetString(); + continue; + } + if (property.NameEquals("phone"u8)) + { + phone = property.Value.GetString(); + continue; + } + } + return new ContactDetails(name, email, phone); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContactDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContactDetails(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.cs new file mode 100644 index 000000000000..ae0677b8e2fb --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A person's contact details. + public partial class ContactDetails + { + /// Initializes a new instance of ContactDetails. + public ContactDetails() + { + } + + /// Initializes a new instance of ContactDetails. + /// The person's name. + /// The person's email. + /// A person's phone number. + internal ContactDetails(string name, string email, string phone) + { + Name = name; + Email = email; + Phone = phone; + } + + /// The person's name. + public string Name { get; set; } + /// The person's email. + public string Email { get; set; } + /// A person's phone number. + public string Phone { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml new file mode 100644 index 000000000000..ae6118273b2f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml @@ -0,0 +1,583 @@ + + + + + +This sample shows how to call MatchTrialsAsync with required parameters and request content, and how to parse the result. +"); +var endpoint = new Uri(""); +var client = new ClinicalMatchingClient(endpoint, credential); + +var data = new { + patients = new[] { + new { + id = "", + } + }, +}; + +var operation = await client.MatchTrialsAsync(WaitUntil.Completed, RequestContent.Create(data)); + +BinaryData data = operation.Value; +JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call MatchTrialsAsync with all parameters and request content, and how to parse the result. +"); +var endpoint = new Uri(""); +var client = new ClinicalMatchingClient(endpoint, credential); + +var data = new { + patients = new[] { + new { + id = "", + info = new { + sex = "female", + birthDate = "2022-05-10", + clinicalInfo = new[] { + new { + system = "", + code = "", + name = "", + value = "", + } + }, + }, + data = new[] { + new { + type = "note", + clinicalType = "consultation", + id = "", + language = "", + createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + content = new { + sourceType = "inline", + value = "", + }, + } + }, + } + }, + configuration = new { + verbose = true, + includeEvidence = true, + clinicalTrials = new { + customTrials = new[] { + new { + id = "", + eligibilityCriteriaText = "", + demographics = new { + acceptedSex = "all", + acceptedAgeRange = new { + minimumAge = new { + unit = "years", + value = 123.45f, + }, + maximumAge = new { + unit = "years", + value = 123.45f, + }, + }, + }, + metadata = new { + phases = new[] { + "notApplicable" + }, + studyType = "interventional", + recruitmentStatus = "unknownStatus", + conditions = new[] { + "" + }, + sponsors = new[] { + "" + }, + contacts = new[] { + new { + name = "", + email = "", + phone = "", + } + }, + facilities = new[] { + new { + name = "", + city = "", + state = "", + country = "", + } + }, + }, + } + }, + registryFilters = new[] { + new { + conditions = new[] { + "" + }, + studyTypes = new[] { + "interventional" + }, + recruitmentStatuses = new[] { + "unknownStatus" + }, + sponsors = new[] { + "" + }, + phases = new[] { + "notApplicable" + }, + purposes = new[] { + "notApplicable" + }, + ids = new[] { + "" + }, + sources = new[] { + "custom" + }, + facilityNames = new[] { + "" + }, + facilityLocations = new[] { + new { + city = "", + state = "", + country = "", + } + }, + facilityAreas = new[] { + new { + type = "Feature", + geometry = new { + type = "Point", + coordinates = new[] { + 123.45f + }, + }, + properties = new { + subType = "Circle", + radius = 123.45d, + }, + } + }, + } + }, + }, + }, +}; + +var operation = await client.MatchTrialsAsync(WaitUntil.Completed, RequestContent.Create(data), "", DateTimeOffset.UtcNow); + +BinaryData data = operation.Value; +JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("country").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("modelVersion").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("knowledgeGraphLastUpdateDate").ToString()); +]]> + + +Creates a Trial Matcher job with the given request body. + +Below is the JSON schema for the request and response payloads. + +Request Body: + +Schema for TrialMatcherData: +{ + patients: [ + { + id: string, # Required. A given identifier for the patient. Has to be unique across all patients in a single request. + info: { + sex: "female" | "male" | "unspecified", # Optional. The patient's sex. + birthDate: string (date), # Optional. The patient's date of birth. + clinicalInfo: [ClinicalCodedElement], # Optional. Known clinical information for the patient, structured. + }, # Optional. Patient structured information, including demographics and known structured clinical information. + data: [PatientDocument], # Optional. Patient unstructured clinical data, given as documents. + } + ], # Required. The list of patients, including their clinical information and data. + configuration: { + verbose: boolean, # Optional. An indication whether the model should produce verbose output. + includeEvidence: boolean, # Optional. An indication whether the model's output should include evidence for the inferences. + clinicalTrials: { + customTrials: [ClinicalTrialDetails], # Optional. A list of clinical trials. + registryFilters: [ClinicalTrialRegistryFilter], # Optional. A list of filters, each one creating a selection of trials from a given +clinical trial registry. + }, # Required. The clinical trials that the patient(s) should be matched to. <br />The trial +selection can be given as a list of custom clinical trials and/or a list of +filters to known clinical trial registries. In case both are given, the +resulting trial set is a union of the two sets. + }, # Optional. Configuration affecting the Trial Matcher model's inference. +} + + +Response Body: + +Schema for TrialMatcherResult: +{ + jobId: string, # Required. A processing job identifier. + createdDateTime: string (date & time), # Required. The date and time when the processing job was created. + expirationDateTime: string (date & time), # Required. The date and time when the processing job is set to expire. + lastUpdateDateTime: string (date & time), # Required. The date and time when the processing job was last updated. + status: "notStarted" | "running" | "succeeded" | "failed" | "partiallyCompleted", # Required. The status of the processing job. + errors: [ + { + code: string, # Required. One of a server-defined set of error codes. + message: string, # Required. A human-readable representation of the error. + target: string, # Optional. The target of the error. + details: [Error], # Required. An array of details about specific errors that led to this reported error. + innererror: { + code: string, # Required. One of a server-defined set of error codes. + innererror: InnerError, # Optional. Inner error. + }, # Optional. An object containing more specific information than the current object about the error. + } + ], # Optional. An array of errors, if any errors occurred during the processing job. + results: { + patients: [TrialMatcherPatientResult], # Required. Results for the patients given in the request. + modelVersion: string, # Required. The version of the model used for inference, expressed as the model date. + knowledgeGraphLastUpdateDate: string (date), # Optional. The date when the clinical trials knowledge graph was last updated. + }, # Optional. The inference results for the Trial Matcher request. +} + + + + + + +This sample shows how to call MatchTrials with required parameters and request content, and how to parse the result. +"); +var endpoint = new Uri(""); +var client = new ClinicalMatchingClient(endpoint, credential); + +var data = new { + patients = new[] { + new { + id = "", + } + }, +}; + +var operation = client.MatchTrials(WaitUntil.Completed, RequestContent.Create(data)); + +BinaryData data = operation.Value; +JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call MatchTrials with all parameters and request content, and how to parse the result. +"); +var endpoint = new Uri(""); +var client = new ClinicalMatchingClient(endpoint, credential); + +var data = new { + patients = new[] { + new { + id = "", + info = new { + sex = "female", + birthDate = "2022-05-10", + clinicalInfo = new[] { + new { + system = "", + code = "", + name = "", + value = "", + } + }, + }, + data = new[] { + new { + type = "note", + clinicalType = "consultation", + id = "", + language = "", + createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + content = new { + sourceType = "inline", + value = "", + }, + } + }, + } + }, + configuration = new { + verbose = true, + includeEvidence = true, + clinicalTrials = new { + customTrials = new[] { + new { + id = "", + eligibilityCriteriaText = "", + demographics = new { + acceptedSex = "all", + acceptedAgeRange = new { + minimumAge = new { + unit = "years", + value = 123.45f, + }, + maximumAge = new { + unit = "years", + value = 123.45f, + }, + }, + }, + metadata = new { + phases = new[] { + "notApplicable" + }, + studyType = "interventional", + recruitmentStatus = "unknownStatus", + conditions = new[] { + "" + }, + sponsors = new[] { + "" + }, + contacts = new[] { + new { + name = "", + email = "", + phone = "", + } + }, + facilities = new[] { + new { + name = "", + city = "", + state = "", + country = "", + } + }, + }, + } + }, + registryFilters = new[] { + new { + conditions = new[] { + "" + }, + studyTypes = new[] { + "interventional" + }, + recruitmentStatuses = new[] { + "unknownStatus" + }, + sponsors = new[] { + "" + }, + phases = new[] { + "notApplicable" + }, + purposes = new[] { + "notApplicable" + }, + ids = new[] { + "" + }, + sources = new[] { + "custom" + }, + facilityNames = new[] { + "" + }, + facilityLocations = new[] { + new { + city = "", + state = "", + country = "", + } + }, + facilityAreas = new[] { + new { + type = "Feature", + geometry = new { + type = "Point", + coordinates = new[] { + 123.45f + }, + }, + properties = new { + subType = "Circle", + radius = 123.45d, + }, + } + }, + } + }, + }, + }, +}; + +var operation = client.MatchTrials(WaitUntil.Completed, RequestContent.Create(data), "", DateTimeOffset.UtcNow); + +BinaryData data = operation.Value; +JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdateDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("country").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("modelVersion").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("knowledgeGraphLastUpdateDate").ToString()); +]]> + + +Creates a Trial Matcher job with the given request body. + +Below is the JSON schema for the request and response payloads. + +Request Body: + +Schema for TrialMatcherData: +{ + patients: [ + { + id: string, # Required. A given identifier for the patient. Has to be unique across all patients in a single request. + info: { + sex: "female" | "male" | "unspecified", # Optional. The patient's sex. + birthDate: string (date), # Optional. The patient's date of birth. + clinicalInfo: [ClinicalCodedElement], # Optional. Known clinical information for the patient, structured. + }, # Optional. Patient structured information, including demographics and known structured clinical information. + data: [PatientDocument], # Optional. Patient unstructured clinical data, given as documents. + } + ], # Required. The list of patients, including their clinical information and data. + configuration: { + verbose: boolean, # Optional. An indication whether the model should produce verbose output. + includeEvidence: boolean, # Optional. An indication whether the model's output should include evidence for the inferences. + clinicalTrials: { + customTrials: [ClinicalTrialDetails], # Optional. A list of clinical trials. + registryFilters: [ClinicalTrialRegistryFilter], # Optional. A list of filters, each one creating a selection of trials from a given +clinical trial registry. + }, # Required. The clinical trials that the patient(s) should be matched to. <br />The trial +selection can be given as a list of custom clinical trials and/or a list of +filters to known clinical trial registries. In case both are given, the +resulting trial set is a union of the two sets. + }, # Optional. Configuration affecting the Trial Matcher model's inference. +} + + +Response Body: + +Schema for TrialMatcherResult: +{ + jobId: string, # Required. A processing job identifier. + createdDateTime: string (date & time), # Required. The date and time when the processing job was created. + expirationDateTime: string (date & time), # Required. The date and time when the processing job is set to expire. + lastUpdateDateTime: string (date & time), # Required. The date and time when the processing job was last updated. + status: "notStarted" | "running" | "succeeded" | "failed" | "partiallyCompleted", # Required. The status of the processing job. + errors: [ + { + code: string, # Required. One of a server-defined set of error codes. + message: string, # Required. A human-readable representation of the error. + target: string, # Optional. The target of the error. + details: [Error], # Required. An array of details about specific errors that led to this reported error. + innererror: { + code: string, # Required. One of a server-defined set of error codes. + innererror: InnerError, # Optional. Inner error. + }, # Optional. An object containing more specific information than the current object about the error. + } + ], # Optional. An array of errors, if any errors occurred during the processing job. + results: { + patients: [TrialMatcherPatientResult], # Required. Results for the patients given in the request. + modelVersion: string, # Required. The version of the model used for inference, expressed as the model date. + knowledgeGraphLastUpdateDate: string (date), # Optional. The date when the clinical trials knowledge graph was last updated. + }, # Optional. The inference results for the Trial Matcher request. +} + + + + + + \ No newline at end of file diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContent.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContent.Serialization.cs new file mode 100644 index 000000000000..7e946231b049 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContent.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class DocumentContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("sourceType"u8); + writer.WriteStringValue(SourceType.ToString()); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContent.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContent.cs new file mode 100644 index 000000000000..38d4190d0203 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContent.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The content of the patient document. + public partial class DocumentContent + { + /// Initializes a new instance of DocumentContent. + /// + /// The type of the content's source. + /// In case the source type is 'inline', the content is given as a string (for instance, text). + /// In case the source type is 'reference', the content is given as a URI. + /// + /// The content of the document, given either inline (as a string) or as a reference (URI). + /// is null. + public DocumentContent(DocumentContentSourceType sourceType, string value) + { + Argument.AssertNotNull(value, nameof(value)); + + SourceType = sourceType; + Value = value; + } + + /// + /// The type of the content's source. + /// In case the source type is 'inline', the content is given as a string (for instance, text). + /// In case the source type is 'reference', the content is given as a URI. + /// + public DocumentContentSourceType SourceType { get; } + /// The content of the document, given either inline (as a string) or as a reference (URI). + public string Value { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContentSourceType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContentSourceType.cs new file mode 100644 index 000000000000..6e8a77af80d6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContentSourceType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// + /// The type of the content's source. + /// In case the source type is 'inline', the content is given as a string (for instance, text). + /// In case the source type is 'reference', the content is given as a URI. + /// + public readonly partial struct DocumentContentSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentContentSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InlineValue = "inline"; + private const string ReferenceValue = "reference"; + + /// inline. + public static DocumentContentSourceType Inline { get; } = new DocumentContentSourceType(InlineValue); + /// reference. + public static DocumentContentSourceType Reference { get; } = new DocumentContentSourceType(ReferenceValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentContentSourceType left, DocumentContentSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentContentSourceType left, DocumentContentSourceType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DocumentContentSourceType(string value) => new DocumentContentSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentContentSourceType other && Equals(other); + /// + public bool Equals(DocumentContentSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentType.cs new file mode 100644 index 000000000000..1b35f0d93e3b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). + public readonly partial struct DocumentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoteValue = "note"; + private const string FhirBundleValue = "fhirBundle"; + private const string DicomValue = "dicom"; + private const string GenomicSequencingValue = "genomicSequencing"; + + /// note. + public static DocumentType Note { get; } = new DocumentType(NoteValue); + /// fhirBundle. + public static DocumentType FhirBundle { get; } = new DocumentType(FhirBundleValue); + /// dicom. + public static DocumentType Dicom { get; } = new DocumentType(DicomValue); + /// genomicSequencing. + public static DocumentType GenomicSequencing { get; } = new DocumentType(GenomicSequencingValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentType left, DocumentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentType left, DocumentType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DocumentType(string value) => new DocumentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentType other && Equals(other); + /// + public bool Equals(DocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.Serialization.cs new file mode 100644 index 000000000000..7ccd00bdb3c6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.Serialization.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ExtendedClinicalCodedElement + { + internal static ExtendedClinicalCodedElement DeserializeExtendedClinicalCodedElement(JsonElement element) + { + string system = default; + string code = default; + Optional name = default; + Optional value = default; + Optional semanticType = default; + Optional category = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("semanticType"u8)) + { + semanticType = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + } + return new ExtendedClinicalCodedElement(system, code, name, value, semanticType, category); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExtendedClinicalCodedElement FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExtendedClinicalCodedElement(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.cs new file mode 100644 index 000000000000..ed0dff73530e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A piece of clinical information, expressed as a code in a clinical coding system, extended by semantic information. + public partial class ExtendedClinicalCodedElement + { + /// Initializes a new instance of ExtendedClinicalCodedElement. + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + /// The code within the given clinical coding system. + /// or is null. + internal ExtendedClinicalCodedElement(string system, string code) + { + Argument.AssertNotNull(system, nameof(system)); + Argument.AssertNotNull(code, nameof(code)); + + System = system; + Code = code; + } + + /// Initializes a new instance of ExtendedClinicalCodedElement. + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + /// The code within the given clinical coding system. + /// The name of this coded concept in the coding system. + /// A value associated with the code within the given clinical coding system. + /// The [UMLS semantic type](https://www.nlm.nih.gov/research/umls/META3_current_semantic_types.html) associated with the coded concept. + /// The bio-medical category related to the coded concept, e.g. Diagnosis, Symptom, Medication, Examination. + internal ExtendedClinicalCodedElement(string system, string code, string name, string value, string semanticType, string category) + { + System = system; + Code = code; + Name = name; + Value = value; + SemanticType = semanticType; + Category = category; + } + + /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. + public string System { get; } + /// The code within the given clinical coding system. + public string Code { get; } + /// The name of this coded concept in the coding system. + public string Name { get; } + /// A value associated with the code within the given clinical coding system. + public string Value { get; } + /// The [UMLS semantic type](https://www.nlm.nih.gov/research/umls/META3_current_semantic_types.html) associated with the coded concept. + public string SemanticType { get; } + /// The bio-medical category related to the coded concept, e.g. Diagnosis, Symptom, Medication, Examination. + public string Category { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonGeometryType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonGeometryType.cs new file mode 100644 index 000000000000..3230b1351abe --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonGeometryType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// `GeoJSON` geometry type. + public readonly partial struct GeoJsonGeometryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GeoJsonGeometryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PointValue = "Point"; + + /// Point. + public static GeoJsonGeometryType Point { get; } = new GeoJsonGeometryType(PointValue); + /// Determines if two values are the same. + public static bool operator ==(GeoJsonGeometryType left, GeoJsonGeometryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GeoJsonGeometryType left, GeoJsonGeometryType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator GeoJsonGeometryType(string value) => new GeoJsonGeometryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GeoJsonGeometryType other && Equals(other); + /// + public bool Equals(GeoJsonGeometryType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonPropertiesSubType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonPropertiesSubType.cs new file mode 100644 index 000000000000..f097ce18c803 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonPropertiesSubType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// `GeoJSON` object sub-type. + public readonly partial struct GeoJsonPropertiesSubType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GeoJsonPropertiesSubType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CircleValue = "Circle"; + + /// Circle. + public static GeoJsonPropertiesSubType Circle { get; } = new GeoJsonPropertiesSubType(CircleValue); + /// Determines if two values are the same. + public static bool operator ==(GeoJsonPropertiesSubType left, GeoJsonPropertiesSubType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GeoJsonPropertiesSubType left, GeoJsonPropertiesSubType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator GeoJsonPropertiesSubType(string value) => new GeoJsonPropertiesSubType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GeoJsonPropertiesSubType other && Equals(other); + /// + public bool Equals(GeoJsonPropertiesSubType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonType.cs new file mode 100644 index 000000000000..71ed176d3b04 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeoJsonType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// `GeoJSON` type. + public readonly partial struct GeoJsonType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GeoJsonType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FeatureValue = "Feature"; + + /// Feature. + public static GeoJsonType Feature { get; } = new GeoJsonType(FeatureValue); + /// Determines if two values are the same. + public static bool operator ==(GeoJsonType left, GeoJsonType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GeoJsonType left, GeoJsonType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator GeoJsonType(string value) => new GeoJsonType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GeoJsonType other && Equals(other); + /// + public bool Equals(GeoJsonType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicArea.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicArea.Serialization.cs new file mode 100644 index 000000000000..e4206fc8e912 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicArea.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class GeographicArea : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + writer.WritePropertyName("geometry"u8); + writer.WriteObjectValue(Geometry); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicArea.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicArea.cs new file mode 100644 index 000000000000..9a55582131ed --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicArea.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A geographic area, expressed as a `Circle` geometry represented using a `GeoJSON Feature` (see [GeoJSON spec](https://tools.ietf.org/html/rfc7946)). + public partial class GeographicArea + { + /// Initializes a new instance of GeographicArea. + /// `GeoJSON` type. + /// `GeoJSON` geometry, representing the area circle's center. + /// `GeoJSON` object properties. + /// or is null. + public GeographicArea(GeoJsonType type, AreaGeometry geometry, AreaProperties properties) + { + Argument.AssertNotNull(geometry, nameof(geometry)); + Argument.AssertNotNull(properties, nameof(properties)); + + Type = type; + Geometry = geometry; + Properties = properties; + } + + /// `GeoJSON` type. + public GeoJsonType Type { get; } + /// `GeoJSON` geometry, representing the area circle's center. + public AreaGeometry Geometry { get; } + /// `GeoJSON` object properties. + public AreaProperties Properties { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.Serialization.cs new file mode 100644 index 000000000000..e298f27be59b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class GeographicLocation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(City)) + { + writer.WritePropertyName("city"u8); + writer.WriteStringValue(City); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State); + } + writer.WritePropertyName("country"u8); + writer.WriteStringValue(Country); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.cs new file mode 100644 index 000000000000..ca1c3e1d27b7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// + /// A location given as a combination of city/state/country. It could specify a + /// city, a state or a country.
In case a city is specified, either state + + /// country or country (for countries where there are no states) should be added. + /// In case a state is specified (without a city), country should be added. + ///
+ public partial class GeographicLocation + { + /// Initializes a new instance of GeographicLocation. + /// Country name. + /// is null. + public GeographicLocation(string country) + { + Argument.AssertNotNull(country, nameof(country)); + + Country = country; + } + + /// City name. + public string City { get; set; } + /// State name. + public string State { get; set; } + /// Country name. + public string Country { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/JobStatus.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/JobStatus.cs new file mode 100644 index 000000000000..1d614dda7790 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/JobStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The status of the processing job. + public readonly partial struct JobStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "notStarted"; + private const string RunningValue = "running"; + private const string SucceededValue = "succeeded"; + private const string FailedValue = "failed"; + private const string PartiallyCompletedValue = "partiallyCompleted"; + + /// notStarted. + public static JobStatus NotStarted { get; } = new JobStatus(NotStartedValue); + /// running. + public static JobStatus Running { get; } = new JobStatus(RunningValue); + /// succeeded. + public static JobStatus Succeeded { get; } = new JobStatus(SucceededValue); + /// failed. + public static JobStatus Failed { get; } = new JobStatus(FailedValue); + /// partiallyCompleted. + public static JobStatus PartiallyCompleted { get; } = new JobStatus(PartiallyCompletedValue); + /// Determines if two values are the same. + public static bool operator ==(JobStatus left, JobStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobStatus left, JobStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator JobStatus(string value) => new JobStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobStatus other && Equals(other); + /// + public bool Equals(JobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.Serialization.cs new file mode 100644 index 000000000000..669efa608d45 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class PatientDocument : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(ClinicalType)) + { + if (ClinicalType != null) + { + writer.WritePropertyName("clinicalType"u8); + writer.WriteStringValue(ClinicalType.Value.ToString()); + } + else + { + writer.WriteNull("clinicalType"); + } + } + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(CreatedDateTime)) + { + if (CreatedDateTime != null) + { + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime.Value, "O"); + } + else + { + writer.WriteNull("createdDateTime"); + } + } + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.cs new file mode 100644 index 000000000000..1213d0fe7cbd --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A clinical document related to a patient. Document here is in the wide sense - not just a text document (note). + public partial class PatientDocument + { + /// Initializes a new instance of PatientDocument. + /// The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). + /// A given identifier for the document. Has to be unique across all documents for a single patient. + /// The content of the patient document. + /// or is null. + public PatientDocument(DocumentType type, string id, DocumentContent content) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(content, nameof(content)); + + Type = type; + Id = id; + Content = content; + } + + /// The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). + public DocumentType Type { get; } + /// The type of the clinical document. + public ClinicalDocumentType? ClinicalType { get; set; } + /// A given identifier for the document. Has to be unique across all documents for a single patient. + public string Id { get; } + /// A 2 letter ISO 639-1 representation of the language of the document. + public string Language { get; set; } + /// The date and time when the document was created. + public DateTimeOffset? CreatedDateTime { get; set; } + /// The content of the patient document. + public DocumentContent Content { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.Serialization.cs new file mode 100644 index 000000000000..dcc5df4738e7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class PatientInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Sex)) + { + if (Sex != null) + { + writer.WritePropertyName("sex"u8); + writer.WriteStringValue(Sex.Value.ToString()); + } + else + { + writer.WriteNull("sex"); + } + } + if (Optional.IsDefined(BirthDate)) + { + if (BirthDate != null) + { + writer.WritePropertyName("birthDate"u8); + writer.WriteStringValue(BirthDate.Value, "D"); + } + else + { + writer.WriteNull("birthDate"); + } + } + if (Optional.IsCollectionDefined(ClinicalInfo)) + { + writer.WritePropertyName("clinicalInfo"u8); + writer.WriteStartArray(); + foreach (var item in ClinicalInfo) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.cs new file mode 100644 index 000000000000..b3bb9d062949 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Patient structured information, including demographics and known structured clinical information. + public partial class PatientInfo + { + /// Initializes a new instance of PatientInfo. + public PatientInfo() + { + ClinicalInfo = new ChangeTrackingList(); + } + + /// The patient's sex. + public PatientInfoSex? Sex { get; set; } + /// The patient's date of birth. + public DateTimeOffset? BirthDate { get; set; } + /// Known clinical information for the patient, structured. + public IList ClinicalInfo { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfoSex.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfoSex.cs new file mode 100644 index 000000000000..95f7b4f73e10 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfoSex.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The patient's sex. + public readonly partial struct PatientInfoSex : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatientInfoSex(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FemaleValue = "female"; + private const string MaleValue = "male"; + private const string UnspecifiedValue = "unspecified"; + + /// female. + public static PatientInfoSex Female { get; } = new PatientInfoSex(FemaleValue); + /// male. + public static PatientInfoSex Male { get; } = new PatientInfoSex(MaleValue); + /// unspecified. + public static PatientInfoSex Unspecified { get; } = new PatientInfoSex(UnspecifiedValue); + /// Determines if two values are the same. + public static bool operator ==(PatientInfoSex left, PatientInfoSex right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatientInfoSex left, PatientInfoSex right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatientInfoSex(string value) => new PatientInfoSex(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatientInfoSex other && Equals(other); + /// + public bool Equals(PatientInfoSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.Serialization.cs new file mode 100644 index 000000000000..bda61a432c73 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class PatientRecord : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Info)) + { + writer.WritePropertyName("info"u8); + writer.WriteObjectValue(Info); + } + if (Optional.IsCollectionDefined(Data)) + { + writer.WritePropertyName("data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.cs new file mode 100644 index 000000000000..65e3c4e77811 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A patient record, including their clinical information and data. + public partial class PatientRecord + { + /// Initializes a new instance of PatientRecord. + /// A given identifier for the patient. Has to be unique across all patients in a single request. + /// is null. + public PatientRecord(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Data = new ChangeTrackingList(); + } + + /// A given identifier for the patient. Has to be unique across all patients in a single request. + public string Id { get; } + /// Patient structured information, including demographics and known structured clinical information. + public PatientInfo Info { get; set; } + /// Patient unstructured clinical data, given as documents. + public IList Data { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherData.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherData.Serialization.cs new file mode 100644 index 000000000000..7819581e6058 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherData.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class TrialMatcherData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("patients"u8); + writer.WriteStartArray(); + foreach (var item in Patients) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherData.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherData.cs new file mode 100644 index 000000000000..40d1a67a1e9c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherData.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The body of the Trial Matcher request. + public partial class TrialMatcherData + { + /// Initializes a new instance of TrialMatcherData. + /// The list of patients, including their clinical information and data. + /// is null. + public TrialMatcherData(IEnumerable patients) + { + Argument.AssertNotNull(patients, nameof(patients)); + + Patients = patients.ToList(); + } + + /// The list of patients, including their clinical information and data. + public IList Patients { get; } + /// Configuration affecting the Trial Matcher model's inference. + public TrialMatcherModelConfiguration Configuration { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.Serialization.cs new file mode 100644 index 000000000000..94452050ca93 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class TrialMatcherInference + { + internal static TrialMatcherInference DeserializeTrialMatcherInference(JsonElement element) + { + TrialMatcherInferenceType type = default; + string value = default; + Optional description = default; + Optional confidenceScore = default; + Optional> evidence = default; + Optional id = default; + Optional source = default; + Optional metadata = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new TrialMatcherInferenceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("confidenceScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + confidenceScore = null; + continue; + } + confidenceScore = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("evidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TrialMatcherInferenceEvidence.DeserializeTrialMatcherInferenceEvidence(item)); + } + evidence = array; + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + source = null; + continue; + } + source = new ClinicalTrialSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + metadata = ClinicalTrialMetadata.DeserializeClinicalTrialMetadata(property.Value); + continue; + } + } + return new TrialMatcherInference(type, value, description, Optional.ToNullable(confidenceScore), Optional.ToList(evidence), id, Optional.ToNullable(source), metadata); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrialMatcherInference FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrialMatcherInference(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.cs new file mode 100644 index 000000000000..7ba52e636608 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// An inference made by the Trial Matcher model regarding a patient. + public partial class TrialMatcherInference + { + /// Initializes a new instance of TrialMatcherInference. + /// The type of the Trial Matcher inference. + /// The value of the inference, as relevant for the given inference type. + /// is null. + internal TrialMatcherInference(TrialMatcherInferenceType type, string value) + { + Argument.AssertNotNull(value, nameof(value)); + + Type = type; + Value = value; + Evidence = new ChangeTrackingList(); + } + + /// Initializes a new instance of TrialMatcherInference. + /// The type of the Trial Matcher inference. + /// The value of the inference, as relevant for the given inference type. + /// The description corresponding to the inference value. + /// Confidence score for this inference. + /// The evidence corresponding to the inference value. + /// The identifier of the clinical trial. + /// Possible sources of a clinical trial. + /// Trial data which is of interest to the potential participant. + internal TrialMatcherInference(TrialMatcherInferenceType type, string value, string description, float? confidenceScore, IReadOnlyList evidence, string id, ClinicalTrialSource? source, ClinicalTrialMetadata metadata) + { + Type = type; + Value = value; + Description = description; + ConfidenceScore = confidenceScore; + Evidence = evidence.ToList(); + Id = id; + Source = source; + Metadata = metadata; + } + + /// The type of the Trial Matcher inference. + public TrialMatcherInferenceType Type { get; } + /// The value of the inference, as relevant for the given inference type. + public string Value { get; } + /// The description corresponding to the inference value. + public string Description { get; } + /// Confidence score for this inference. + public float? ConfidenceScore { get; } + /// The evidence corresponding to the inference value. + public IReadOnlyList Evidence { get; } + /// The identifier of the clinical trial. + public string Id { get; } + /// Possible sources of a clinical trial. + public ClinicalTrialSource? Source { get; } + /// Trial data which is of interest to the potential participant. + public ClinicalTrialMetadata Metadata { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.Serialization.cs new file mode 100644 index 000000000000..6cb8504ffa5a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class TrialMatcherInferenceEvidence + { + internal static TrialMatcherInferenceEvidence DeserializeTrialMatcherInferenceEvidence(JsonElement element) + { + Optional eligibilityCriteriaEvidence = default; + Optional patientDataEvidence = default; + Optional patientInfoEvidence = default; + Optional importance = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eligibilityCriteriaEvidence"u8)) + { + eligibilityCriteriaEvidence = property.Value.GetString(); + continue; + } + if (property.NameEquals("patientDataEvidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + patientDataEvidence = ClinicalNoteEvidence.DeserializeClinicalNoteEvidence(property.Value); + continue; + } + if (property.NameEquals("patientInfoEvidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + patientInfoEvidence = ClinicalCodedElement.DeserializeClinicalCodedElement(property.Value); + continue; + } + if (property.NameEquals("importance"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + importance = null; + continue; + } + importance = property.Value.GetSingle(); + continue; + } + } + return new TrialMatcherInferenceEvidence(eligibilityCriteriaEvidence, patientDataEvidence, patientInfoEvidence, Optional.ToNullable(importance)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrialMatcherInferenceEvidence FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrialMatcherInferenceEvidence(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.cs new file mode 100644 index 000000000000..cceb99f70548 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// A piece of evidence corresponding to a Trial Matcher inference. + public partial class TrialMatcherInferenceEvidence + { + /// Initializes a new instance of TrialMatcherInferenceEvidence. + internal TrialMatcherInferenceEvidence() + { + } + + /// Initializes a new instance of TrialMatcherInferenceEvidence. + /// A piece of evidence from the eligibility criteria text of a clinical trial. + /// A piece of evidence from a clinical note (text document). + /// + /// A piece of clinical information, expressed as a code in a clinical coding + /// system. + /// + /// A value indicating how important this piece of evidence is for the inference. + internal TrialMatcherInferenceEvidence(string eligibilityCriteriaEvidence, ClinicalNoteEvidence patientDataEvidence, ClinicalCodedElement patientInfoEvidence, float? importance) + { + EligibilityCriteriaEvidence = eligibilityCriteriaEvidence; + PatientDataEvidence = patientDataEvidence; + PatientInfoEvidence = patientInfoEvidence; + Importance = importance; + } + + /// A piece of evidence from the eligibility criteria text of a clinical trial. + public string EligibilityCriteriaEvidence { get; } + /// A piece of evidence from a clinical note (text document). + public ClinicalNoteEvidence PatientDataEvidence { get; } + /// + /// A piece of clinical information, expressed as a code in a clinical coding + /// system. + /// + public ClinicalCodedElement PatientInfoEvidence { get; } + /// A value indicating how important this piece of evidence is for the inference. + public float? Importance { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceType.cs new file mode 100644 index 000000000000..dddb604377dc --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The type of the Trial Matcher inference. + public readonly partial struct TrialMatcherInferenceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TrialMatcherInferenceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrialEligibilityValue = "trialEligibility"; + + /// trialEligibility. + public static TrialMatcherInferenceType TrialEligibility { get; } = new TrialMatcherInferenceType(TrialEligibilityValue); + /// Determines if two values are the same. + public static bool operator ==(TrialMatcherInferenceType left, TrialMatcherInferenceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TrialMatcherInferenceType left, TrialMatcherInferenceType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TrialMatcherInferenceType(string value) => new TrialMatcherInferenceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TrialMatcherInferenceType other && Equals(other); + /// + public bool Equals(TrialMatcherInferenceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherModelConfiguration.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherModelConfiguration.Serialization.cs new file mode 100644 index 000000000000..4711b6ed9a82 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherModelConfiguration.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class TrialMatcherModelConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Verbose)) + { + if (Verbose != null) + { + writer.WritePropertyName("verbose"u8); + writer.WriteBooleanValue(Verbose.Value); + } + else + { + writer.WriteNull("verbose"); + } + } + if (Optional.IsDefined(IncludeEvidence)) + { + if (IncludeEvidence != null) + { + writer.WritePropertyName("includeEvidence"u8); + writer.WriteBooleanValue(IncludeEvidence.Value); + } + else + { + writer.WriteNull("includeEvidence"); + } + } + writer.WritePropertyName("clinicalTrials"u8); + writer.WriteObjectValue(ClinicalTrials); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherModelConfiguration.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherModelConfiguration.cs new file mode 100644 index 000000000000..dea6d1b9113b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherModelConfiguration.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// Configuration affecting the Trial Matcher model's inference. + public partial class TrialMatcherModelConfiguration + { + /// Initializes a new instance of TrialMatcherModelConfiguration. + /// + /// The clinical trials that the patient(s) should be matched to. <br />The trial + /// selection can be given as a list of custom clinical trials and/or a list of + /// filters to known clinical trial registries. In case both are given, the + /// resulting trial set is a union of the two sets. + /// + /// is null. + public TrialMatcherModelConfiguration(ClinicalTrials clinicalTrials) + { + Argument.AssertNotNull(clinicalTrials, nameof(clinicalTrials)); + + ClinicalTrials = clinicalTrials; + } + + /// An indication whether the model should produce verbose output. + public bool? Verbose { get; set; } + /// An indication whether the model's output should include evidence for the inferences. + public bool? IncludeEvidence { get; set; } + /// + /// The clinical trials that the patient(s) should be matched to. <br />The trial + /// selection can be given as a list of custom clinical trials and/or a list of + /// filters to known clinical trial registries. In case both are given, the + /// resulting trial set is a union of the two sets. + /// + public ClinicalTrials ClinicalTrials { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.Serialization.cs new file mode 100644 index 000000000000..14001b4f78fd --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.Serialization.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class TrialMatcherPatientResult + { + internal static TrialMatcherPatientResult DeserializeTrialMatcherPatientResult(JsonElement element) + { + string id = default; + IReadOnlyList inferences = default; + Optional> neededClinicalInfo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("inferences"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TrialMatcherInference.DeserializeTrialMatcherInference(item)); + } + inferences = array; + continue; + } + if (property.NameEquals("neededClinicalInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExtendedClinicalCodedElement.DeserializeExtendedClinicalCodedElement(item)); + } + neededClinicalInfo = array; + continue; + } + } + return new TrialMatcherPatientResult(id, inferences, Optional.ToList(neededClinicalInfo)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrialMatcherPatientResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrialMatcherPatientResult(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.cs new file mode 100644 index 000000000000..f545ff7ff1d1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The results of the model's work for a single patient. + public partial class TrialMatcherPatientResult + { + /// Initializes a new instance of TrialMatcherPatientResult. + /// The identifier given for the patient in the request. + /// The model's inferences for the given patient. + /// or is null. + internal TrialMatcherPatientResult(string id, IEnumerable inferences) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(inferences, nameof(inferences)); + + Id = id; + Inferences = inferences.ToList(); + NeededClinicalInfo = new ChangeTrackingList(); + } + + /// Initializes a new instance of TrialMatcherPatientResult. + /// The identifier given for the patient in the request. + /// The model's inferences for the given patient. + /// Clinical information which is needed to provide better trial matching results for the patient. + internal TrialMatcherPatientResult(string id, IReadOnlyList inferences, IReadOnlyList neededClinicalInfo) + { + Id = id; + Inferences = inferences.ToList(); + NeededClinicalInfo = neededClinicalInfo.ToList(); + } + + /// The identifier given for the patient in the request. + public string Id { get; } + /// The model's inferences for the given patient. + public IReadOnlyList Inferences { get; } + /// Clinical information which is needed to provide better trial matching results for the patient. + public IReadOnlyList NeededClinicalInfo { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.Serialization.cs new file mode 100644 index 000000000000..5f394a7e21b6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.Serialization.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class TrialMatcherResult + { + internal static TrialMatcherResult DeserializeTrialMatcherResult(JsonElement element) + { + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset expirationDateTime = default; + DateTimeOffset lastUpdateDateTime = default; + JobStatus status = default; + Optional> errors = default; + Optional results = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdateDateTime"u8)) + { + lastUpdateDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + errors = array; + continue; + } + if (property.NameEquals("results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + results = TrialMatcherResults.DeserializeTrialMatcherResults(property.Value); + continue; + } + } + return new TrialMatcherResult(jobId, createdDateTime, expirationDateTime, lastUpdateDateTime, status, Optional.ToList(errors), results); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrialMatcherResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrialMatcherResult(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.cs new file mode 100644 index 000000000000..aeb05e64de74 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The response for the Trial Matcher request. + public partial class TrialMatcherResult + { + /// Initializes a new instance of TrialMatcherResult. + internal TrialMatcherResult() + { + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of TrialMatcherResult. + /// A processing job identifier. + /// The date and time when the processing job was created. + /// The date and time when the processing job is set to expire. + /// The date and time when the processing job was last updated. + /// The status of the processing job. + /// An array of errors, if any errors occurred during the processing job. + /// The inference results for the Trial Matcher request. + internal TrialMatcherResult(string jobId, DateTimeOffset createdDateTime, DateTimeOffset expirationDateTime, DateTimeOffset lastUpdateDateTime, JobStatus status, IReadOnlyList errors, TrialMatcherResults results) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + ExpirationDateTime = expirationDateTime; + LastUpdateDateTime = lastUpdateDateTime; + Status = status; + Errors = errors.ToList(); + Results = results; + } + + /// A processing job identifier. + public string JobId { get; } + /// The date and time when the processing job was created. + public DateTimeOffset CreatedDateTime { get; } + /// The date and time when the processing job is set to expire. + public DateTimeOffset ExpirationDateTime { get; } + /// The date and time when the processing job was last updated. + public DateTimeOffset LastUpdateDateTime { get; } + /// The status of the processing job. + public JobStatus Status { get; } + /// An array of errors, if any errors occurred during the processing job. + public IReadOnlyList Errors { get; } + /// The inference results for the Trial Matcher request. + public TrialMatcherResults Results { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs new file mode 100644 index 000000000000..f6254046d6a9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class TrialMatcherResults + { + internal static TrialMatcherResults DeserializeTrialMatcherResults(JsonElement element) + { + IReadOnlyList patients = default; + string modelVersion = default; + Optional knowledgeGraphLastUpdateDate = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patients"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TrialMatcherPatientResult.DeserializeTrialMatcherPatientResult(item)); + } + patients = array; + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("knowledgeGraphLastUpdateDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + knowledgeGraphLastUpdateDate = null; + continue; + } + knowledgeGraphLastUpdateDate = property.Value.GetDateTimeOffset("D"); + continue; + } + } + return new TrialMatcherResults(patients, modelVersion, Optional.ToNullable(knowledgeGraphLastUpdateDate)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrialMatcherResults FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrialMatcherResults(document.RootElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.cs new file mode 100644 index 000000000000..cd5a07325679 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// The inference results for the Trial Matcher request. + public partial class TrialMatcherResults + { + /// Initializes a new instance of TrialMatcherResults. + /// Results for the patients given in the request. + /// The version of the model used for inference, expressed as the model date. + /// or is null. + internal TrialMatcherResults(IEnumerable patients, string modelVersion) + { + Argument.AssertNotNull(patients, nameof(patients)); + Argument.AssertNotNull(modelVersion, nameof(modelVersion)); + + Patients = patients.ToList(); + ModelVersion = modelVersion; + } + + /// Initializes a new instance of TrialMatcherResults. + /// Results for the patients given in the request. + /// The version of the model used for inference, expressed as the model date. + /// The date when the clinical trials knowledge graph was last updated. + internal TrialMatcherResults(IReadOnlyList patients, string modelVersion, DateTimeOffset? knowledgeGraphLastUpdateDate) + { + Patients = patients.ToList(); + ModelVersion = modelVersion; + KnowledgeGraphLastUpdateDate = knowledgeGraphLastUpdateDate; + } + + /// Results for the patients given in the request. + public IReadOnlyList Patients { get; } + /// The version of the model used for inference, expressed as the model date. + public string ModelVersion { get; } + /// The date when the clinical trials knowledge graph was last updated. + public DateTimeOffset? KnowledgeGraphLastUpdateDate { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/GlobalSuppressions.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..f7ed94978a8e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/GlobalSuppressions.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0001:Use one of the following pre-approved namespace groups (https://azure.github.io/azure-sdk/registered_namespaces.html): Azure.AI, Azure.Analytics, Azure.Communication, Azure.Containers, Azure.Core.Expressions, Azure.Data, Azure.DigitalTwins, Azure.Identity, Azure.IoT, Azure.Learn, Azure.Management, Azure.Media, Azure.Messaging, Azure.MixedReality, Azure.Monitor, Azure.ResourceManager, Azure.Search, Azure.Security, Azure.Storage, Azure.Template, Microsoft.Extensions.Azure", Justification = "", Scope = "namespace", Target = "~N:Azure.Health.Insights.ClinicalMatching")] diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Properties/AssemblyInfo.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..aa7d4079bf4a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Health.Insights.ClinicalMatching.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.CognitiveServices")] diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/test-resources.json b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/test-resources.json new file mode 100644 index 000000000000..2f2647f298d5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/test-resources.json @@ -0,0 +1,73 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } + }, + "endpointPrefix": { + "defaultValue": "healthinsights", + "type": "string" + }, + "cognitiveServicesEndpointSuffix": { + "defaultValue": ".cognitiveservices.azure.com", + "type": "string" + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The principal to assign the role to. This is application object id." + } + } + }, + "variables": { + "roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/a97b65f3-24c7-4388-baec-2e87135dc908')]", + "uniqueSubDomainName": "[format('{0}-{1}', parameters('baseName'), parameters('endpointPrefix'))]", + "endpointValue": "[format('https://{0}-{1}{2}', parameters('baseName'), parameters('endpointPrefix'), parameters('cognitiveServicesEndpointSuffix'))]" + }, + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts", + "apiVersion": "2017-04-18", + "name": "[variables('uniqueSubDomainName')]", + "location":"[parameters('location')]", + "sku": { + "name": "S0" + }, + "kind": "AzureHealthInsights", + "properties": { + "customSubDomainName": "[variables('uniqueSubDomainName')]" + } + }, + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2018-09-01-preview", + "name": "[guid(resourceGroup().id)]", + "properties": { + "roleDefinitionId": "[variables('roleDefinitionId')]", + "principalId": "[parameters('testApplicationOid')]" + } + } + ], + "outputs": { + "AZURE_HEALTH_INSIGHTS_API_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts',variables('uniqueSubDomainName')), '2017-04-18').key1]" + }, + "AZURE_HEALTH_INSIGHTS_ENDPOINT": { + "type": "string", + "value": "[variables('endpointValue')]" + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Azure.Health.Insights.ClinicalMatching.Tests.csproj b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Azure.Health.Insights.ClinicalMatching.Tests.csproj new file mode 100644 index 000000000000..c5192167484e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Azure.Health.Insights.ClinicalMatching.Tests.csproj @@ -0,0 +1,33 @@ + + + $(RequiredTargetFrameworks) + + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + + + + + + + $(MSBuildProjectDirectory)\test.runsettings + + + + + + \ No newline at end of file diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/ClinicalMatchingClientLiveTests.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/ClinicalMatchingClientLiveTests.cs new file mode 100644 index 000000000000..4c85dc6a52bd --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/ClinicalMatchingClientLiveTests.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using NUnit.Framework; +using System.IO; +using System.Reflection; +using Azure.Core; +using System.Net; +using Azure.Core.TestFramework; +using Azure.Health.Insights.ClinicalMatching.Tests.Infrastructure; +using Azure.Health.Insights.ClinicalMatching; + +namespace Azure.Health.Insights.ClinicalMatching.Tests +{ + /// + /// The suite of tests for the class. + /// + /// + /// These tests have a dependency on live Azure services and may incur costs for the associated + /// Azure subscription. + /// + public class ClinicalMatchingClientLiveTests : HealthInsightsLiveTestBase + { + /// + /// Initializes a new instance of the class. + /// + /// A flag used by the Azure Core Test Framework to differentiate between tests for asynchronous and synchronous methods. + public ClinicalMatchingClientLiveTests(bool isAsync) : base(isAsync) + { + } + + [RecordedTest] + public async Task GetResultsFromCreateJob() + { + var client = CreateClinicalMatchingClient(); + + var request = GetRequestContent("ClinicalMatchingClientTest.request.json"); + var operation = await client.MatchTrialsAsync(WaitUntil.Completed, request); + + Assert.IsNotNull(operation); + Response response = operation.GetRawResponse(); + Assert.IsNotNull(response); + Assert.IsTrue(response.Status == (int)HttpStatusCode.OK); + TrialMatcherResult matcherResponse = TrialMatcherResult.FromResponse(response); + Assert.IsNotEmpty(matcherResponse.Results.Patients); + var patient = matcherResponse.Results.Patients[0]; + Assert.IsNotEmpty(patient.Inferences); + } + + private RequestContent GetRequestContent(string resourceName) + { + Assembly assembly = Assembly.GetAssembly(this.GetType()); + Stream content = assembly.GetManifestResourceStream($"Azure.Health.Insights.ClinicalMatching.Tests.TestData.{resourceName}"); + using StreamReader reader = new StreamReader(content); + string data = reader.ReadToEnd(); + return RequestContent.Create(data); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Infrastructure/HealthInsightsLiveTestBase.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Infrastructure/HealthInsightsLiveTestBase.cs new file mode 100644 index 000000000000..e694271c8806 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Infrastructure/HealthInsightsLiveTestBase.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.Health.Insights.ClinicalMatching; + +namespace Azure.Health.Insights.ClinicalMatching.Tests.Infrastructure +{ + public class HealthInsightsLiveTestBase : RecordedTestBase + { + public HealthInsightsLiveTestBase(bool isAsync) : base(isAsync) + { + JsonPathSanitizers.Add("$..accessToken"); + JsonPathSanitizers.Add("$..source"); + SanitizedHeaders.Add(Constants.AuthorizationHeader); + } + + /// + /// Creates a with the endpoint and API key provided via environment + /// variables and instruments it to make use of the Azure Core Test Framework functionalities. + /// + /// Whether or not to use a to authenticate. An is used by default. + /// The API key to use for authentication. Defaults to . + /// Whether or not instrumenting should be skipped. Avoid skipping it as much as possible. + /// The instrumented . + public ClinicalMatchingClient CreateClinicalMatchingClient(bool useTokenCredential = false, string apiKey = default, bool skipInstrumenting = false) + { + var endpoint = new Uri(TestEnvironment.Endpoint); + var options = InstrumentClientOptions(new ClinicalMatchingClientOptions()); + ClinicalMatchingClient client; + + if (useTokenCredential) + { + AzureKeyCredential credential = new AzureKeyCredential(TestEnvironment.Credential.ToString()); + client = new ClinicalMatchingClient(endpoint, credential, options); + } + else + { + var credential = new AzureKeyCredential(apiKey ?? TestEnvironment.ApiKey); + client = new ClinicalMatchingClient(endpoint, credential, options); + } + + return skipInstrumenting ? client : InstrumentClient(client); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Infrastructure/HealthInsightsTestEnvironment.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Infrastructure/HealthInsightsTestEnvironment.cs new file mode 100644 index 000000000000..0eee08d0e59e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Infrastructure/HealthInsightsTestEnvironment.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.Health.Insights.ClinicalMatching.Tests.Infrastructure +{ + public class HealthInsightsTestEnvironment : TestEnvironment + { + /// The name of the environment variable from which the Health Insights resource's endpoint will be extracted for the live tests. + internal const string EndpointEnvironmentVariableName = "AZURE_HEALTH_INSIGHTS_ENDPOINT"; + + /// The name of the environment variable from which the Health Insights resource's API key will be extracted for the live tests. + internal const string ApiKeyEnvironmentVariableName = "AZURE_HEALTH_INSIGHTS_API_KEY"; + + public string ApiKey => GetRecordedVariable(ApiKeyEnvironmentVariableName, options => options.IsSecret()); + public string Endpoint => GetRecordedVariable(EndpointEnvironmentVariableName); + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/README.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/README.md new file mode 100644 index 000000000000..512f270883c0 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/README.md @@ -0,0 +1,5 @@ +Source files in this directory are written as tests from which samples are extracted. +They are not intended to be viewed directly and help ensure our samples compile and work correctly. + \ No newline at end of file diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample_MatchTrials.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample_MatchTrials.cs new file mode 100644 index 000000000000..1e3b6892284a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample_MatchTrials.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Health.Insights.ClinicalMatching; +using Azure.Health.Insights.ClinicalMatching.Tests.Infrastructure; +using Azure.Core; +using Azure.Core.TestFramework; +using Microsoft.Extensions.ObjectPool; +using NUnit.Framework; + +namespace Azure.Health.Insights.ClinicalMatching.Tests.Samples +{ + public partial class HealthInsightsSamples : SamplesBase + { + [Test] + public async Task CreateTrialMatcherJob() + { + #region Snippet:CreateClinicalMatchingClient + + // Read endpoint and apiKey + string endpoint = TestEnvironment.Endpoint; + string apiKey = TestEnvironment.ApiKey; + + var endpointUri = new Uri(endpoint); + var credential = new AzureKeyCredential(apiKey); + + // Create ClinicalMatchingClient + ClinicalMatchingClient clinicalMatchingClient = new ClinicalMatchingClient(endpointUri, credential); + + #endregion + + #region Snippet:HealthInsightsTrialMatcherCreateTrialMatcherData + // Create patient + PatientRecord patient1 = new PatientRecord("patient_id") + { + Info = new PatientInfo + { + BirthDate = new System.DateTime(1965, 12, 26), + Sex = PatientInfoSex.Male + } + }; + + // Attach clinical info to the patient + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0006826") + { + Name = "Malignant Neoplasms", + Value = "true" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1522449") + { + Name = "Therapeutic radiology procedure", + Value = "true" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "METASTATIC") + { + Name = "metastatic", + Value = "true" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1512162") + { + Name = "Eastern Cooperative Oncology Group", + Value = "1" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019693") + { + Name = "HIV Infections", + Value = "false" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1300072") + { + Name = "Tumor stage", + Value = "2" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019163") + { + Name = "Hepatitis B", + Value = "false" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0018802") + { + Name = "Congestive heart failure", + Value = "true" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019196") + { + Name = "Hepatitis C", + Value = "false" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0220650") + { + Name = "Metastatic malignant neoplasm to brain", + Value = "true" + }); + + // Create registry filter + var registryFilters = new ClinicalTrialRegistryFilter(); + // Limit the trial to a specific patient condition ("Non-small cell lung cancer") + registryFilters.Conditions.Add("Non-small cell lung cancer"); + // Limit the clinical trial to a certain phase, phase 1 + registryFilters.Phases.Add(ClinicalTrialPhase.Phase1); + // Specify the clinical trial registry source as ClinicalTrials.Gov + registryFilters.Sources.Add(ClinicalTrialSource.ClinicaltrialsGov); + // Limit the clinical trial to a certain location, in this case California, USA + registryFilters.FacilityLocations.Add(new GeographicLocation("United States") { State = "Arizona" , City = "Gilbert" }); + // Limit the trial to a specific study type, interventional + registryFilters.StudyTypes.Add(ClinicalTrialStudyType.Interventional); + + // Create ClinicalTrial instance and attach the registry filter to it. + var clinicalTrials = new ClinicalTrials(); + clinicalTrials.RegistryFilters.Add(registryFilters); + + // Create TrialMatcherData with patient and configuration + var Configuration = new TrialMatcherModelConfiguration(clinicalTrials); + var trialMatcherData = new TrialMatcherData(new List { patient1 }) { Configuration = Configuration }; + #endregion + + #region Snippet:HealthInsightsClinicalMatchingMatchTrialsAsync + TrialMatcherResult trialMatcherResult = default; + try + { + // Using ClinicalMatchingClient + MatchTrialsAsync + Operation operation = await clinicalMatchingClient.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); + Response resp = operation.GetRawResponse(); + trialMatcherResult = TrialMatcherResult.FromResponse(resp); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + return; + } + #endregion + + #region Snippet:HealthInsightsTrialMatcherMatchTrialsAsyncViewResults + // View the match trials (eligible/ineligible) + if (trialMatcherResult.Status == JobStatus.Succeeded) + { + TrialMatcherResults matcherResults = trialMatcherResult.Results; + foreach (TrialMatcherPatientResult patientResult in matcherResults.Patients) + { + Console.WriteLine($"Inferences of Patient {patientResult.Id}"); + foreach (TrialMatcherInference tmInferences in patientResult.Inferences) + { + Console.WriteLine($"Trial Id {tmInferences.Id}"); + Console.WriteLine($"Type: {tmInferences.Type.ToString()} Value: {tmInferences.Value}"); + Console.WriteLine($"Description {tmInferences.Description}"); + } + } + } + else + { + IReadOnlyList matcherErrors = trialMatcherResult.Errors; + foreach (ResponseError error in matcherErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } + } + + #endregion + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJob.json b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJob.json new file mode 100644 index 000000000000..e131c8d71c00 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJob.json @@ -0,0 +1,374 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs?api-version=2023-03-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "2328", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-213b7d144a1833db-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5a437bb7afeafcab70224541a69468bd", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "configuration": { + "clinicalTrials": { + "registryFilters": [ + { + "conditions": [ + "non small cell lung cancer (nsclc)" + ], + "sources": [ + "clinicaltrials_gov" + ], + "recruitmentStatuses": [ + "recruiting" + ], + "facilityLocations": [ + { + "city": "gilbert", + "state": "arizona", + "country": "United States" + } + ] + } + ] + }, + "includeEvidence": true + }, + "patients": [ + { + "id": "patient1", + "info": { + "sex": "male", + "birthDate": "1961-04-25", + "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" + } + ] + } + } + ] + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "97ab65ca-831d-45f1-9e95-4610590b1515", + "Content-Length": "0", + "Date": "Mon, 06 Mar 2023 09:41:06 GMT", + "Operation-Location": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-0f1b14b624eaa1c0-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "ff28bc63ead29a419507bfb40162487c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "0c421456-f993-4f0f-b3bc-af2051851d90", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:06 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "2a785274-5256-46a0-b0f3-d04f3c5b4bbf", + "createdDateTime": "2023-03-06T09:41:06Z", + "expirationDateTime": "2023-03-06T10:41:06Z", + "lastUpdateDateTime": "2023-03-06T09:41:06Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-33e954a816bf0d63-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b4593f773ab1aa4f1e8222cc6624bb4c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "fc3846e4-edc2-4e72-baf3-46230ee1e61a", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:08 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "2a785274-5256-46a0-b0f3-d04f3c5b4bbf", + "createdDateTime": "2023-03-06T09:41:06Z", + "expirationDateTime": "2023-03-06T10:41:06Z", + "lastUpdateDateTime": "2023-03-06T09:41:06Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-3e056ec17a0e09c8-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "837eaf832a77cdf73aa9c4e3f0f7fa0e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "88c444a3-88dd-49c7-aad2-63c42742c3fe", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:09 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "2a785274-5256-46a0-b0f3-d04f3c5b4bbf", + "createdDateTime": "2023-03-06T09:41:06Z", + "expirationDateTime": "2023-03-06T10:41:06Z", + "lastUpdateDateTime": "2023-03-06T09:41:06Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-069581f214057443-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "67cac9dab33b280c6c7ee050c7753471", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "b65b1627-aeaf-4106-952e-ad5368426913", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:11 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "2a785274-5256-46a0-b0f3-d04f3c5b4bbf", + "createdDateTime": "2023-03-06T09:41:06Z", + "expirationDateTime": "2023-03-06T10:41:06Z", + "lastUpdateDateTime": "2023-03-06T09:41:06Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-937d90d5c1bc1c81-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "5130724bc4e34c05488b7907756cb927", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "787f7d2e-f167-4f3e-8aa8-c6c39f2ffcbf", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:12 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "2a785274-5256-46a0-b0f3-d04f3c5b4bbf", + "createdDateTime": "2023-03-06T09:41:06Z", + "expirationDateTime": "2023-03-06T10:41:06Z", + "lastUpdateDateTime": "2023-03-06T09:41:06Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-c96ccbd6691cd449-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "9df21487545ad010a35617f849a705c5", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "824fdee7-7b8f-47c7-b72b-537de0a322b9", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:13 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "2a785274-5256-46a0-b0f3-d04f3c5b4bbf", + "createdDateTime": "2023-03-06T09:41:06Z", + "expirationDateTime": "2023-03-06T10:41:06Z", + "lastUpdateDateTime": "2023-03-06T09:41:06Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-d0471e86ca508b99-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "7d985375a9c7152bc37d1faf3904b200", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "fee97603-a27a-444a-9bba-a287d10c78e8", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:15 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "2a785274-5256-46a0-b0f3-d04f3c5b4bbf", + "createdDateTime": "2023-03-06T09:41:06Z", + "expirationDateTime": "2023-03-06T10:41:06Z", + "lastUpdateDateTime": "2023-03-06T09:41:06Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/2a785274-5256-46a0-b0f3-d04f3c5b4bbf?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-9f8b153b5906dad6236c6a3081ca2bda-34f1cc7f49c0e53f-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "b2c8b9c59683f7176260ad8cad0d02a1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "908280ab-75c2-46da-aa28-63970f96b4f0", + "Content-Length": "1029", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:16 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "results": { + "patients": [ + { + "id": "patient1", + "inferences": [ + { + "type": "trialEligibility", + "evidence": [ + { + "eligibilityCriteriaEvidence": "Inclusion: Has a radiation therapy plan approved by the central radiation therapy quality assurance vendor", + "patientInfoEvidence": { + "system": "http://www.nlm.nih.gov/research/umls", + "code": "C1522449", + "name": "Radiotherapy", + "value": "false" + }, + "importance": 0.0 + }, + { + "eligibilityCriteriaEvidence": "Inclusion: Is able to receive SBRT and does not have an ultra-centrally located tumor", + "patientInfoEvidence": { + "system": "http://www.nlm.nih.gov/research/umls", + "code": "C1522449", + "name": "Radiotherapy", + "value": "false" + }, + "importance": 0.0 + } + ], + "id": "NCT03924869", + "source": "Sanitized", + "value": "Ineligible", + "confidenceScore": 0.0 + } + ], + "neededClinicalInfo": [] + } + ], + "modelVersion": "2023.130.1.0", + "knowledgeGraphLastUpdateDate": "01/11/2023" + }, + "jobId": "2a785274-5256-46a0-b0f3-d04f3c5b4bbf", + "createdDateTime": "2023-03-06T09:41:06Z", + "expirationDateTime": "2023-03-06T10:41:06Z", + "lastUpdateDateTime": "2023-03-06T09:41:15Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_HEALTH_INSIGHTS_API_KEY": "Sanitized", + "AZURE_HEALTH_INSIGHTS_ENDPOINT": "https://sanitized.azure-api.net/", + "RandomSeed": "2077978177" + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJobAsync.json b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJobAsync.json new file mode 100644 index 000000000000..6bc925ab651b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJobAsync.json @@ -0,0 +1,374 @@ +{ + "Entries": [ + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs?api-version=2023-03-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "2328", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-3bdeeb7d0a7d4cea-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "03d0f2729283dd282b7a20a125af49f1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "configuration": { + "clinicalTrials": { + "registryFilters": [ + { + "conditions": [ + "non small cell lung cancer (nsclc)" + ], + "sources": [ + "clinicaltrials_gov" + ], + "recruitmentStatuses": [ + "recruiting" + ], + "facilityLocations": [ + { + "city": "gilbert", + "state": "arizona", + "country": "United States" + } + ] + } + ] + }, + "includeEvidence": true + }, + "patients": [ + { + "id": "patient1", + "info": { + "sex": "male", + "birthDate": "1961-04-25", + "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" + } + ] + } + } + ] + }, + "StatusCode": 202, + "ResponseHeaders": { + "apim-request-id": "0e5092fb-964e-4c91-96a8-f131e6299252", + "Content-Length": "0", + "Date": "Mon, 06 Mar 2023 09:41:21 GMT", + "Operation-Location": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-6ef98d69d4be270b-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "69bca8efc1e7b48e32fdefdadda70174", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "96ad52e7-1401-417c-8203-797af0fee2a2", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:21 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "f91a9b0f-f6db-4f7d-af96-76ef29c951c1", + "createdDateTime": "2023-03-06T09:41:21Z", + "expirationDateTime": "2023-03-06T10:41:21Z", + "lastUpdateDateTime": "2023-03-06T09:41:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-d7d1e7255d1f4d9f-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "1563dc5f8652fc6003be299073b5fdf1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "335850dd-7faf-493e-9d4a-823b84a53394", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:23 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "f91a9b0f-f6db-4f7d-af96-76ef29c951c1", + "createdDateTime": "2023-03-06T09:41:21Z", + "expirationDateTime": "2023-03-06T10:41:21Z", + "lastUpdateDateTime": "2023-03-06T09:41:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-299212fc45af51ce-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "9f87e1d8c6f5b09d641bd086a24dff83", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "4b13402d-10dd-48b6-86ea-9bf003a59869", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:24 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "f91a9b0f-f6db-4f7d-af96-76ef29c951c1", + "createdDateTime": "2023-03-06T09:41:21Z", + "expirationDateTime": "2023-03-06T10:41:21Z", + "lastUpdateDateTime": "2023-03-06T09:41:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-67f86904c7f7a342-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "4841ac78334b689e47bf652898fd417d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "7bda5f52-8e4c-4865-9112-f9f5b9481df2", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:25 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "f91a9b0f-f6db-4f7d-af96-76ef29c951c1", + "createdDateTime": "2023-03-06T09:41:21Z", + "expirationDateTime": "2023-03-06T10:41:21Z", + "lastUpdateDateTime": "2023-03-06T09:41:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-95bc5d819115e224-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "fb02feff6220997e3fb2b137b5da5ab6", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "2495bf2a-29ab-4c68-bac7-4a152f9f5c93", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:27 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "f91a9b0f-f6db-4f7d-af96-76ef29c951c1", + "createdDateTime": "2023-03-06T09:41:21Z", + "expirationDateTime": "2023-03-06T10:41:21Z", + "lastUpdateDateTime": "2023-03-06T09:41:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-798f97e79d9e2320-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "c618a5beb473a4a5431e573660741767", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "2e493738-9f7c-468f-b689-b2a051013556", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:28 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "f91a9b0f-f6db-4f7d-af96-76ef29c951c1", + "createdDateTime": "2023-03-06T09:41:21Z", + "expirationDateTime": "2023-03-06T10:41:21Z", + "lastUpdateDateTime": "2023-03-06T09:41:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-2247a9f48e26b75a-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "a38652da044b15632ea809988267b26d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "aefa6d6e-2f15-458a-b346-597a69a6cd90", + "Content-Length": "196", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:29 GMT", + "Retry-After": "1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "jobId": "f91a9b0f-f6db-4f7d-af96-76ef29c951c1", + "createdDateTime": "2023-03-06T09:41:21Z", + "expirationDateTime": "2023-03-06T10:41:21Z", + "lastUpdateDateTime": "2023-03-06T09:41:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://sanitized.azure-api.net/healthinsights/trialmatcher/jobs/f91a9b0f-f6db-4f7d-af96-76ef29c951c1?api-version=2023-03-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "traceparent": "00-b5753b3715abc1be5cd6d493821ac8c8-a94aae3aec7548a4-00", + "User-Agent": "azsdk-net-Health.Insights.ClinicalMatching/1.0.0-alpha.20230302.1 (.NET 6.0.14; Microsoft Windows 10.0.22621)", + "x-ms-client-request-id": "f26aaf657ae44a0a595db8010b4838cb", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "apim-request-id": "dcb1a529-22fd-4968-b255-624fc898ce90", + "Content-Length": "1029", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 06 Mar 2023 09:41:31 GMT", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "results": { + "patients": [ + { + "id": "patient1", + "inferences": [ + { + "type": "trialEligibility", + "evidence": [ + { + "eligibilityCriteriaEvidence": "Inclusion: Has a radiation therapy plan approved by the central radiation therapy quality assurance vendor", + "patientInfoEvidence": { + "system": "http://www.nlm.nih.gov/research/umls", + "code": "C1522449", + "name": "Radiotherapy", + "value": "false" + }, + "importance": 0.0 + }, + { + "eligibilityCriteriaEvidence": "Inclusion: Is able to receive SBRT and does not have an ultra-centrally located tumor", + "patientInfoEvidence": { + "system": "http://www.nlm.nih.gov/research/umls", + "code": "C1522449", + "name": "Radiotherapy", + "value": "false" + }, + "importance": 0.0 + } + ], + "id": "NCT03924869", + "source": "Sanitized", + "value": "Ineligible", + "confidenceScore": 0.0 + } + ], + "neededClinicalInfo": [] + } + ], + "modelVersion": "2023.130.1.0", + "knowledgeGraphLastUpdateDate": "01/11/2023" + }, + "jobId": "f91a9b0f-f6db-4f7d-af96-76ef29c951c1", + "createdDateTime": "2023-03-06T09:41:21Z", + "expirationDateTime": "2023-03-06T10:41:21Z", + "lastUpdateDateTime": "2023-03-06T09:41:30Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_HEALTH_INSIGHTS_API_KEY": "Sanitized", + "AZURE_HEALTH_INSIGHTS_ENDPOINT": "https://sanitized.azure-api.net/", + "RandomSeed": "1727651881" + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/TestData/ClinicalMatchingClientTest.request.json b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/TestData/ClinicalMatchingClientTest.request.json new file mode 100644 index 000000000000..9befc6451d11 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/TestData/ClinicalMatchingClientTest.request.json @@ -0,0 +1,68 @@ +{ + "configuration": { + "clinicalTrials": { + "registryFilters": [ + { + "conditions": [ + "non small cell lung cancer (nsclc)" + ], + "sources": [ + "clinicaltrials_gov" + ], + "recruitmentStatuses": [ + "recruiting" + ], + "facilityLocations": [ + { + "city": "gilbert", + "state": "arizona", + "country": "United States" + } + ] + } + ] + }, + "includeEvidence": true + }, + "patients": [ + { + "id": "patient1", + "info": { + "sex": "male", + "birthDate": "1961-04-25", + "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" + } + ] + } + } + ] +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/test.runsettings b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/test.runsettings new file mode 100644 index 000000000000..94286941c810 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/test.runsettings @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/sdk/healthinsights/ci.yml b/sdk/healthinsights/ci.yml new file mode 100644 index 000000000000..53f2b11c347e --- /dev/null +++ b/sdk/healthinsights/ci.yml @@ -0,0 +1,32 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/healthinsights/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthinsights/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: healthinsights + ArtifactName: packages + Artifacts: + - name: Azure.Health.Insights.ClinicalMatching + safeName: AzureHealthInsightsClinicalMatching + - name: Azure.Health.Insights.CancerProfiling + safeName: AzureHealthInsightsCancerProfiling \ No newline at end of file From 222f91ae9a0690809151b81e6c98099f74807b34 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Tue, 14 Mar 2023 10:59:56 +0200 Subject: [PATCH 02/17] rename Country to CountryOrRegion --- .../ClinicalCodedElement.Serialization.cs | 4 ++++ .../ClinicalNoteEvidence.Serialization.cs | 4 ++++ .../InferenceEvidence.Serialization.cs | 4 ++++ .../OncoPhenotypeInference.Serialization.cs | 4 ++++ ...ncoPhenotypePatientResult.Serialization.cs | 4 ++++ .../OncoPhenotypeResult.Serialization.cs | 4 ++++ .../OncoPhenotypeResults.Serialization.cs | 4 ++++ ...nsights.ClinicalMatching.netstandard2.0.cs | 8 +++---- .../ClinicalCodedElement.Serialization.cs | 4 ++++ .../ClinicalNoteEvidence.Serialization.cs | 4 ++++ .../ClinicalTrialMetadata.Serialization.cs | 4 ++++ ...icalTrialResearchFacility.Serialization.cs | 16 ++++++++------ .../ClinicalTrialResearchFacility.cs | 20 +++++++++--------- .../Generated/ContactDetails.Serialization.cs | 4 ++++ .../Generated/Docs/ClinicalMatchingClient.xml | 12 +++++------ ...endedClinicalCodedElement.Serialization.cs | 4 ++++ .../GeographicLocation.Serialization.cs | 4 ++-- .../src/Generated/GeographicLocation.cs | 21 +++++++++---------- .../TrialMatcherInference.Serialization.cs | 4 ++++ ...lMatcherInferenceEvidence.Serialization.cs | 4 ++++ ...TrialMatcherPatientResult.Serialization.cs | 4 ++++ .../TrialMatcherResult.Serialization.cs | 4 ++++ .../TrialMatcherResults.Serialization.cs | 4 ++++ .../ClinicalMatchingClientTest.request.json | 2 +- 24 files changed, 111 insertions(+), 40 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.Serialization.cs index 60d4a2b34584..0e77fa205628 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.Serialization.cs @@ -35,6 +35,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ClinicalCodedElement DeserializeClinicalCodedElement(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string system = default; string code = default; Optional name = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.Serialization.cs index 5e3f80cd2b2e..351956fa57ba 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalNoteEvidence.Serialization.cs @@ -15,6 +15,10 @@ public partial class ClinicalNoteEvidence { internal static ClinicalNoteEvidence DeserializeClinicalNoteEvidence(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string id = default; Optional text = default; int offset = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.Serialization.cs index 96423ad35c1b..ba86fd4b55f9 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/InferenceEvidence.Serialization.cs @@ -15,6 +15,10 @@ public partial class InferenceEvidence { internal static InferenceEvidence DeserializeInferenceEvidence(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } Optional patientDataEvidence = default; Optional patientInfoEvidence = default; Optional importance = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.Serialization.cs index ff280da04946..0701933286bd 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInference.Serialization.cs @@ -16,6 +16,10 @@ public partial class OncoPhenotypeInference { internal static OncoPhenotypeInference DeserializeOncoPhenotypeInference(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } OncoPhenotypeInferenceType type = default; string value = default; Optional description = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.Serialization.cs index 40c687b40580..df070187e6d5 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.Serialization.cs @@ -16,6 +16,10 @@ public partial class OncoPhenotypePatientResult { internal static OncoPhenotypePatientResult DeserializeOncoPhenotypePatientResult(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string id = default; IReadOnlyList inferences = default; foreach (var property in element.EnumerateObject()) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.Serialization.cs index 380085799c9a..9e68fbb7a608 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResult.Serialization.cs @@ -17,6 +17,10 @@ public partial class OncoPhenotypeResult { internal static OncoPhenotypeResult DeserializeOncoPhenotypeResult(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string jobId = default; DateTimeOffset createdDateTime = default; DateTimeOffset expirationDateTime = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs index 52d3dd834c83..0d5757829648 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs @@ -16,6 +16,10 @@ public partial class OncoPhenotypeResults { internal static OncoPhenotypeResults DeserializeOncoPhenotypeResults(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } IReadOnlyList patients = default; string modelVersion = default; foreach (var property in element.EnumerateObject()) diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/api/Azure.Health.Insights.ClinicalMatching.netstandard2.0.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/api/Azure.Health.Insights.ClinicalMatching.netstandard2.0.cs index e44c8d5a00d5..612a803f229f 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/api/Azure.Health.Insights.ClinicalMatching.netstandard2.0.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/api/Azure.Health.Insights.ClinicalMatching.netstandard2.0.cs @@ -231,9 +231,9 @@ public ClinicalTrialRegistryFilter() { } } public partial class ClinicalTrialResearchFacility { - public ClinicalTrialResearchFacility(string name, string country) { } + public ClinicalTrialResearchFacility(string name, string countryOrRegion) { } public string City { get { throw null; } set { } } - public string Country { get { throw null; } set { } } + public string CountryOrRegion { get { throw null; } set { } } public string Name { get { throw null; } set { } } public string State { get { throw null; } set { } } } @@ -351,9 +351,9 @@ public GeographicArea(Azure.Health.Insights.ClinicalMatching.GeoJsonType type, A } public partial class GeographicLocation { - public GeographicLocation(string country) { } + public GeographicLocation(string countryOrRegion) { } public string City { get { throw null; } set { } } - public string Country { get { throw null; } } + public string CountryOrRegion { get { throw null; } } public string State { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.Serialization.cs index 2e1bcc74da7f..5a7e4f19e051 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.Serialization.cs @@ -35,6 +35,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ClinicalCodedElement DeserializeClinicalCodedElement(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string system = default; string code = default; Optional name = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.Serialization.cs index 78d99a65f76c..91b80e30eac0 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalNoteEvidence.Serialization.cs @@ -15,6 +15,10 @@ public partial class ClinicalNoteEvidence { internal static ClinicalNoteEvidence DeserializeClinicalNoteEvidence(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string id = default; Optional text = default; int offset = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.Serialization.cs index 5d664c68daf6..3d1c9fc79db9 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.Serialization.cs @@ -93,6 +93,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ClinicalTrialMetadata DeserializeClinicalTrialMetadata(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } Optional> phases = default; Optional studyType = default; Optional recruitmentStatus = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.Serialization.cs index a71585902030..7f23ad0e2c9e 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.Serialization.cs @@ -28,17 +28,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("state"u8); writer.WriteStringValue(State); } - writer.WritePropertyName("country"u8); - writer.WriteStringValue(Country); + writer.WritePropertyName("countryOrRegion"u8); + writer.WriteStringValue(CountryOrRegion); writer.WriteEndObject(); } internal static ClinicalTrialResearchFacility DeserializeClinicalTrialResearchFacility(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string name = default; Optional city = default; Optional state = default; - string country = default; + string countryOrRegion = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name"u8)) @@ -56,13 +60,13 @@ internal static ClinicalTrialResearchFacility DeserializeClinicalTrialResearchFa state = property.Value.GetString(); continue; } - if (property.NameEquals("country"u8)) + if (property.NameEquals("countryOrRegion"u8)) { - country = property.Value.GetString(); + countryOrRegion = property.Value.GetString(); continue; } } - return new ClinicalTrialResearchFacility(name, city, state, country); + return new ClinicalTrialResearchFacility(name, city, state, countryOrRegion); } /// Deserializes the model from a raw response. diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs index 6f024be5541f..9b26a5cf6ba5 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs @@ -15,28 +15,28 @@ public partial class ClinicalTrialResearchFacility { /// Initializes a new instance of ClinicalTrialResearchFacility. /// The facility's name. - /// Country name. - /// or is null. - public ClinicalTrialResearchFacility(string name, string country) + /// Country/region name. + /// or is null. + public ClinicalTrialResearchFacility(string name, string countryOrRegion) { Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(country, nameof(country)); + Argument.AssertNotNull(countryOrRegion, nameof(countryOrRegion)); Name = name; - Country = country; + CountryOrRegion = countryOrRegion; } /// Initializes a new instance of ClinicalTrialResearchFacility. /// The facility's name. /// City name. /// State name. - /// Country name. - internal ClinicalTrialResearchFacility(string name, string city, string state, string country) + /// Country/region name. + internal ClinicalTrialResearchFacility(string name, string city, string state, string countryOrRegion) { Name = name; City = city; State = state; - Country = country; + CountryOrRegion = countryOrRegion; } /// The facility's name. @@ -45,7 +45,7 @@ internal ClinicalTrialResearchFacility(string name, string city, string state, s public string City { get; set; } /// State name. public string State { get; set; } - /// Country name. - public string Country { get; set; } + /// Country/region name. + public string CountryOrRegion { get; set; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.Serialization.cs index e56d6284fe70..e027debbba0c 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.Serialization.cs @@ -36,6 +36,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ContactDetails DeserializeContactDetails(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } Optional name = default; Optional email = default; Optional phone = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml index ae6118273b2f..cd7c0a580fb7 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml @@ -109,7 +109,7 @@ var data = new { name = "", city = "", state = "", - country = "", + countryOrRegion = "", } }, }, @@ -148,7 +148,7 @@ var data = new { new { city = "", state = "", - country = "", + countryOrRegion = "", } }, facilityAreas = new[] { @@ -213,7 +213,7 @@ Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetPr Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("country").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); @@ -398,7 +398,7 @@ var data = new { name = "", city = "", state = "", - country = "", + countryOrRegion = "", } }, }, @@ -437,7 +437,7 @@ var data = new { new { city = "", state = "", - country = "", + countryOrRegion = "", } }, facilityAreas = new[] { @@ -502,7 +502,7 @@ Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetPr Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("country").ToString()); +Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); Console.WriteLine(result.GetProperty("results").GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.Serialization.cs index 7ccd00bdb3c6..4e457f106dfe 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ExtendedClinicalCodedElement.Serialization.cs @@ -15,6 +15,10 @@ public partial class ExtendedClinicalCodedElement { internal static ExtendedClinicalCodedElement DeserializeExtendedClinicalCodedElement(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string system = default; string code = default; Optional name = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.Serialization.cs index e298f27be59b..46894136cf24 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.Serialization.cs @@ -25,8 +25,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("state"u8); writer.WriteStringValue(State); } - writer.WritePropertyName("country"u8); - writer.WriteStringValue(Country); + writer.WritePropertyName("countryOrRegion"u8); + writer.WriteStringValue(CountryOrRegion); writer.WriteEndObject(); } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.cs index ca1c3e1d27b7..67ae76a1bff2 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/GeographicLocation.cs @@ -11,28 +11,27 @@ namespace Azure.Health.Insights.ClinicalMatching { /// - /// A location given as a combination of city/state/country. It could specify a - /// city, a state or a country.
In case a city is specified, either state + - /// country or country (for countries where there are no states) should be added. - /// In case a state is specified (without a city), country should be added. + /// A location given as a combination of city, state and country/region. It could specify a city, a state or a country/region. + /// In case a city is specified, either state +country/region or country/region (for countries/regions where there are no states) should be added. + /// In case a state is specified (without a city), country/region should be added. ///
public partial class GeographicLocation { /// Initializes a new instance of GeographicLocation. - /// Country name. - /// is null. - public GeographicLocation(string country) + /// Country/region name. + /// is null. + public GeographicLocation(string countryOrRegion) { - Argument.AssertNotNull(country, nameof(country)); + Argument.AssertNotNull(countryOrRegion, nameof(countryOrRegion)); - Country = country; + CountryOrRegion = countryOrRegion; } /// City name. public string City { get; set; } /// State name. public string State { get; set; } - /// Country name. - public string Country { get; } + /// Country/region name. + public string CountryOrRegion { get; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.Serialization.cs index 94452050ca93..84f9ae72878b 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.Serialization.cs @@ -16,6 +16,10 @@ public partial class TrialMatcherInference { internal static TrialMatcherInference DeserializeTrialMatcherInference(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } TrialMatcherInferenceType type = default; string value = default; Optional description = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.Serialization.cs index 6cb8504ffa5a..ac06b80dc3ff 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceEvidence.Serialization.cs @@ -15,6 +15,10 @@ public partial class TrialMatcherInferenceEvidence { internal static TrialMatcherInferenceEvidence DeserializeTrialMatcherInferenceEvidence(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } Optional eligibilityCriteriaEvidence = default; Optional patientDataEvidence = default; Optional patientInfoEvidence = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.Serialization.cs index 14001b4f78fd..d36e538b40ca 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.Serialization.cs @@ -16,6 +16,10 @@ public partial class TrialMatcherPatientResult { internal static TrialMatcherPatientResult DeserializeTrialMatcherPatientResult(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string id = default; IReadOnlyList inferences = default; Optional> neededClinicalInfo = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.Serialization.cs index 5f394a7e21b6..00ed16ee8624 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResult.Serialization.cs @@ -17,6 +17,10 @@ public partial class TrialMatcherResult { internal static TrialMatcherResult DeserializeTrialMatcherResult(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } string jobId = default; DateTimeOffset createdDateTime = default; DateTimeOffset expirationDateTime = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs index f6254046d6a9..317a804d9998 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs @@ -17,6 +17,10 @@ public partial class TrialMatcherResults { internal static TrialMatcherResults DeserializeTrialMatcherResults(JsonElement element) { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } IReadOnlyList patients = default; string modelVersion = default; Optional knowledgeGraphLastUpdateDate = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/TestData/ClinicalMatchingClientTest.request.json b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/TestData/ClinicalMatchingClientTest.request.json index 9befc6451d11..cc2d4413eb36 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/TestData/ClinicalMatchingClientTest.request.json +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/TestData/ClinicalMatchingClientTest.request.json @@ -16,7 +16,7 @@ { "city": "gilbert", "state": "arizona", - "country": "United States" + "countryOrRegion": "United States" } ] } From d16ffcce9171d4d56372ea43a9b7204f8fb15057 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Tue, 14 Mar 2023 12:19:46 +0200 Subject: [PATCH 03/17] add cadl-location --- .../cadl-location.yaml | 3 + .../cadl-location.yaml | 3 + .../test-resources.json | 73 ------------------- .../test-resources.json | 0 4 files changed, 6 insertions(+), 73 deletions(-) create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml delete mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/test-resources.json rename sdk/healthinsights/{Azure.Health.Insights.CancerProfiling => }/test-resources.json (100%) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml new file mode 100644 index 000000000000..2ad479e114c7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml @@ -0,0 +1,3 @@ +directory: specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/ +commit: 7ecc7d7d636976bbe19020a1edd01ce288df734b +repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml new file mode 100644 index 000000000000..64c1c992f8f7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml @@ -0,0 +1,3 @@ +directory: specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher/ +commit: 7ecc7d7d636976bbe19020a1edd01ce288df734b +repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/test-resources.json b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/test-resources.json deleted file mode 100644 index 2f2647f298d5..000000000000 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/test-resources.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "baseName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "The base resource name." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "The location of the resource. By default, this is the same as the resource group." - } - }, - "endpointPrefix": { - "defaultValue": "healthinsights", - "type": "string" - }, - "cognitiveServicesEndpointSuffix": { - "defaultValue": ".cognitiveservices.azure.com", - "type": "string" - }, - "testApplicationOid": { - "type": "string", - "metadata": { - "description": "The principal to assign the role to. This is application object id." - } - } - }, - "variables": { - "roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/a97b65f3-24c7-4388-baec-2e87135dc908')]", - "uniqueSubDomainName": "[format('{0}-{1}', parameters('baseName'), parameters('endpointPrefix'))]", - "endpointValue": "[format('https://{0}-{1}{2}', parameters('baseName'), parameters('endpointPrefix'), parameters('cognitiveServicesEndpointSuffix'))]" - }, - "resources": [ - { - "type": "Microsoft.CognitiveServices/accounts", - "apiVersion": "2017-04-18", - "name": "[variables('uniqueSubDomainName')]", - "location":"[parameters('location')]", - "sku": { - "name": "S0" - }, - "kind": "AzureHealthInsights", - "properties": { - "customSubDomainName": "[variables('uniqueSubDomainName')]" - } - }, - { - "type": "Microsoft.Authorization/roleAssignments", - "apiVersion": "2018-09-01-preview", - "name": "[guid(resourceGroup().id)]", - "properties": { - "roleDefinitionId": "[variables('roleDefinitionId')]", - "principalId": "[parameters('testApplicationOid')]" - } - } - ], - "outputs": { - "AZURE_HEALTH_INSIGHTS_API_KEY": { - "type": "string", - "value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts',variables('uniqueSubDomainName')), '2017-04-18').key1]" - }, - "AZURE_HEALTH_INSIGHTS_ENDPOINT": { - "type": "string", - "value": "[variables('endpointValue')]" - } - } -} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/test-resources.json b/sdk/healthinsights/test-resources.json similarity index 100% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/test-resources.json rename to sdk/healthinsights/test-resources.json From ca374967c8de7d919287a16050765cf2f6f1707a Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Tue, 14 Mar 2023 12:30:44 +0200 Subject: [PATCH 04/17] add test.yml --- sdk/healthinsights/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sdk/healthinsights/tests.yml diff --git a/sdk/healthinsights/tests.yml b/sdk/healthinsights/tests.yml new file mode 100644 index 000000000000..a76b53a2e316 --- /dev/null +++ b/sdk/healthinsights/tests.yml @@ -0,0 +1,6 @@ +trigger: none + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + ServiceDirectory: healthinsights From 1d743f466f585581a412e408532ff9fef707c7e7 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Tue, 14 Mar 2023 15:25:56 +0200 Subject: [PATCH 05/17] update country to countryOrRegion --- .../GetResultsFromCreateJob.json | 2 +- .../GetResultsFromCreateJobAsync.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJob.json b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJob.json index e131c8d71c00..75c4e3dec6dc 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJob.json +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJob.json @@ -31,7 +31,7 @@ { "city": "gilbert", "state": "arizona", - "country": "United States" + "countryOrRegion": "United States" } ] } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJobAsync.json b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJobAsync.json index 6bc925ab651b..cf3823b3f2c3 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJobAsync.json +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/SessionRecords/ClinicalMatchingClientLiveTests/GetResultsFromCreateJobAsync.json @@ -31,7 +31,7 @@ { "city": "gilbert", "state": "arizona", - "country": "United States" + "countryOrRegion": "United States" } ] } From 0890d97ff27936fbd3cb8f02dcfed0054392cd77 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Tue, 14 Mar 2023 16:04:41 +0200 Subject: [PATCH 06/17] remove healthinsights from Test-SampleMetadata --- eng/common/scripts/Test-SampleMetadata.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index c9851ded03bd..71c8972a8a36 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -202,8 +202,6 @@ begin { "azure-genomics", "azure-hdinsight", "azure-hdinsight-rserver", - "azure-health-insights-cancerprofiling", - "azure-health-insights-clinicalmatching", "azure-hpc-cache", "azure-immersive-reader", "azure-information-protection", From 431f6d48399d20aa2a8d0f1ff000f310a6595cd7 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Wed, 15 Mar 2023 12:21:09 +0200 Subject: [PATCH 07/17] update product name to azure-health-insights --- .../Azure.Health.Insights.CancerProfiling/samples/README.md | 2 +- .../Azure.Health.Insights.ClinicalMatching/samples/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md index 7057a5586ca9..c20b5973a34f 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md @@ -5,7 +5,7 @@ languages: products: - azure - azure-cognitive-services -- azure-health-insights-cancerprofiling +- azure-health-insights name: Azure Health Insights - Cancer Profiling samples for .NET description: Samples for the Azure.Health.Insights.CancerProfiling client library --- diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md index 81b2f4bdacb1..8d83fb65fc5d 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md @@ -5,7 +5,7 @@ languages: products: - azure - azure-cognitive-services -- azure-health-insights-clinicalmatching +- azure-health-insights name: Azure Health Insights - Clinical Matching samples for .NET description: Samples for the Azure.Health.Insights.ClinicalMatching client library --- From 262a4c9fdfbc8959402659fdb58e16b475ce6881 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Thu, 16 Mar 2023 09:52:38 +0200 Subject: [PATCH 08/17] update cadl-location with additional directories --- .../Azure.Health.Insights.CancerProfiling/cadl-location.yaml | 3 +++ .../Azure.Health.Insights.ClinicalMatching/cadl-location.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml index 2ad479e114c7..31a9eb619590 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml @@ -1,3 +1,6 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/ +additionalDirectories: + - specification/cognitiveservices/HealthInsights/healthinsights.autorest/ + - specification/cognitiveservices/HealthInsights/healthinsights.common/ commit: 7ecc7d7d636976bbe19020a1edd01ce288df734b repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml index 64c1c992f8f7..061caa543597 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml @@ -1,3 +1,6 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher/ +additionalDirectories: + - specification/cognitiveservices/HealthInsights/healthinsights.autorest/ + - specification/cognitiveservices/HealthInsights/healthinsights.common/ commit: 7ecc7d7d636976bbe19020a1edd01ce288df734b repo: asaflevi-ms/azure-rest-api-specs From dce135a6c275ebc75bcdcec38dfbc5f599fe2fb8 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Sun, 19 Mar 2023 09:39:51 +0200 Subject: [PATCH 09/17] convert to typespec --- .../{cadl-location.yaml => tsp-location.yaml} | 4 ++-- .../{cadl-location.yaml => tsp-location.yaml} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename sdk/healthinsights/Azure.Health.Insights.CancerProfiling/{cadl-location.yaml => tsp-location.yaml} (82%) rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/{cadl-location.yaml => tsp-location.yaml} (82%) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml similarity index 82% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml index 31a9eb619590..62adb6748c3b 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/cadl-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml @@ -1,6 +1,6 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/ additionalDirectories: - - specification/cognitiveservices/HealthInsights/healthinsights.autorest/ + - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 7ecc7d7d636976bbe19020a1edd01ce288df734b +commit: 0b1da3430818cf2c19e8e93f9e13b2dbb5ba9f0f repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml similarity index 82% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml index 061caa543597..9acf1ba7cb92 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/cadl-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml @@ -1,6 +1,6 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher/ additionalDirectories: - - specification/cognitiveservices/HealthInsights/healthinsights.autorest/ + - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 7ecc7d7d636976bbe19020a1edd01ce288df734b +commit: 0b1da3430818cf2c19e8e93f9e13b2dbb5ba9f0f repo: asaflevi-ms/azure-rest-api-specs From 71878722c4d4c732f04e9a9811b12fd736a45074 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Sun, 19 Mar 2023 11:03:47 +0200 Subject: [PATCH 10/17] update tsp-location --- .../Azure.Health.Insights.CancerProfiling/tsp-location.yaml | 3 ++- .../Azure.Health.Insights.ClinicalMatching/tsp-location.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml index 62adb6748c3b..1b38a3284ee4 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml @@ -2,5 +2,6 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.oncophe additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 0b1da3430818cf2c19e8e93f9e13b2dbb5ba9f0f + - specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher/ +commit: 13cd3e3933da5bdc63a4e745a044c5135a3280b0 repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml index 9acf1ba7cb92..f5b729cba894 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml @@ -2,5 +2,6 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.trialma additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 0b1da3430818cf2c19e8e93f9e13b2dbb5ba9f0f + - specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/ +commit: 13cd3e3933da5bdc63a4e745a044c5135a3280b0 repo: asaflevi-ms/azure-rest-api-specs From 191cbeef04d54c548bea22fd7161b3d7eadd1ba8 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Sun, 19 Mar 2023 11:26:26 +0200 Subject: [PATCH 11/17] update commit-id in tsp-location --- .../Azure.Health.Insights.CancerProfiling/tsp-location.yaml | 2 +- .../Azure.Health.Insights.ClinicalMatching/tsp-location.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml index 1b38a3284ee4..f38f8bf8a8ef 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml @@ -3,5 +3,5 @@ additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ - specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher/ -commit: 13cd3e3933da5bdc63a4e745a044c5135a3280b0 +commit: 1e06017929fcc6a8be72c489a2bc50510dfb3633 repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml index f5b729cba894..e0ffb752afd7 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml @@ -3,5 +3,5 @@ additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ - specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/ -commit: 13cd3e3933da5bdc63a4e745a044c5135a3280b0 +commit: 1e06017929fcc6a8be72c489a2bc50510dfb3633 repo: asaflevi-ms/azure-rest-api-specs From aae8d9adc4975f89089740a284cc59cf45411265 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Sun, 19 Mar 2023 14:39:37 +0200 Subject: [PATCH 12/17] update commit-id in tsp-location --- .../Azure.Health.Insights.CancerProfiling/tsp-location.yaml | 3 +-- .../Azure.Health.Insights.ClinicalMatching/tsp-location.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml index f38f8bf8a8ef..d4534484a35d 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml @@ -2,6 +2,5 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.oncophe additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ - - specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher/ -commit: 1e06017929fcc6a8be72c489a2bc50510dfb3633 +commit: 37456eff00c37125efbbfb118a1e6c9a2a2deb68 repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml index e0ffb752afd7..b7e450d7bc62 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml @@ -2,6 +2,5 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.trialma additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ - - specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype/ -commit: 1e06017929fcc6a8be72c489a2bc50510dfb3633 +commit: 37456eff00c37125efbbfb118a1e6c9a2a2deb68 repo: asaflevi-ms/azure-rest-api-specs From 656d99490d723e16a0e98adaf4bb07b86d365b49 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Sun, 19 Mar 2023 15:17:10 +0200 Subject: [PATCH 13/17] update tsp-location --- .../Azure.Health.Insights.CancerProfiling/tsp-location.yaml | 2 +- .../Azure.Health.Insights.ClinicalMatching/tsp-location.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml index d4534484a35d..bebe38027563 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml @@ -2,5 +2,5 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.oncophe additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 37456eff00c37125efbbfb118a1e6c9a2a2deb68 +commit: 425b28b4e69ab9a87479db5eb4410c0865f791c0 repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml index b7e450d7bc62..e68dc5dcae3b 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml @@ -2,5 +2,5 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.trialma additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 37456eff00c37125efbbfb118a1e6c9a2a2deb68 +commit: 425b28b4e69ab9a87479db5eb4410c0865f791c0 repo: asaflevi-ms/azure-rest-api-specs From aab6469d00c59403204247c0e1a77059f93a3d76 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Sun, 19 Mar 2023 16:00:48 +0200 Subject: [PATCH 14/17] update commit-id in tsp-location --- .../Azure.Health.Insights.CancerProfiling/tsp-location.yaml | 2 +- .../Azure.Health.Insights.ClinicalMatching/tsp-location.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml index bebe38027563..78b9f7d677c3 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml @@ -2,5 +2,5 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.oncophe additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 425b28b4e69ab9a87479db5eb4410c0865f791c0 +commit: 257253bba159129afb9c82387bcc3ae0805e19e6 repo: asaflevi-ms/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml index e68dc5dcae3b..8b23e5e332a5 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml @@ -2,5 +2,5 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.trialma additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 425b28b4e69ab9a87479db5eb4410c0865f791c0 +commit: 257253bba159129afb9c82387bcc3ae0805e19e6 repo: asaflevi-ms/azure-rest-api-specs From d97b3d79466f357c6b0b2fe618bf7aa375fc9ee8 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Wed, 22 Mar 2023 13:58:07 +0200 Subject: [PATCH 15/17] samples scenarios sync/async --- .../samples/README.md | 6 +- .../samples/Sample01_InferCancerProfile.md | 196 +++++++++++++++++ ...md => Sample01_InferCancerProfileAsync.md} | 0 .../Samples/Sample01_InferCancerProfile.cs | 200 ++++++++++++++++++ ...cs => Sample01_InferCancerProfileAsync.cs} | 0 .../samples/README.md | 7 +- .../samples/Sample01_MatchTrials.md | 155 ++++++++++++++ ...Trials.md => Sample01_MatchTrialsAsync.md} | 2 +- .../tests/Samples/Sample01_MatchTrials.cs | 164 ++++++++++++++ ...Trials.cs => Sample01_MatchTrialsAsync.cs} | 2 +- 10 files changed, 725 insertions(+), 7 deletions(-) create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md rename sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/{Sample_InferCancerProfile.md => Sample01_InferCancerProfileAsync.md} (100%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfile.cs rename sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/{Sample_InferCancerProfile.cs => Sample01_InferCancerProfileAsync.cs} (100%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrials.md rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/{Sample_MatchTrials.md => Sample01_MatchTrialsAsync.md} (98%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrials.cs rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/{Sample_MatchTrials.cs => Sample01_MatchTrialsAsync.cs} (99%) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md index c20b5973a34f..229a2500bc43 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/README.md @@ -15,10 +15,12 @@ These code samples show common scenario operations with the Azure Health Insight |**Sample Name**|**Description**| |----------------|-------------| -|[Sample_InferCancerProfile][sample_get_the_inferred_cancer_staging_for_an_oncology_patient] |Get the inferred cancer staging for an oncology patient.| +|[Sample01_InferCancerProfile][sample_get_the_inferred_cancer_staging_for_an_oncology_patient] |Get the inferred cancer staging for an oncology patient (Sync).| +|[Sample01_InferCancerProfileAsync][sample_get_the_inferred_cancer_staging_for_an_oncology_patient_async] |Get the inferred cancer staging for an oncology patient (Async).| diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md new file mode 100644 index 000000000000..3e9f878be61e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md @@ -0,0 +1,196 @@ +# Get the inferred cancer staging for an oncology patient +This sample demonstrates how to get the inferred cancer staging, such as pTNM staging and histology codes, for an oncology patient, based on his/her clinical documents (medical records), and to review the clinical evidence for each inference, extracted from these documents. + +## Creating a `CancerProfilingClient` + +To create a new `CancerProfilingClient` to get the inferred cancer staging, you need a Cognitive Services endpoint and credentials. You can use the [DefaultAzureCredential][DefaultAzureCredential] to try a number of common authentication methods optimized for both running as a service and development. In the sample below, however, you'll use a AzureHealthInsights service API key credential by creating an `AzureKeyCredential` object, that if needed, will allow you to update the API key without creating a new client. + +You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. + +```C# Snippet:CreateCancerProfilingClient +// Read endpoint and apiKey +string endpoint = TestEnvironment.Endpoint; +string apiKey = TestEnvironment.ApiKey; + +var endpointUri = new Uri(endpoint); +var credential = new AzureKeyCredential(apiKey); + +// Create CancerProfilingClient +CancerProfilingClient client = new CancerProfilingClient(endpointUri, credential); +``` + +## Get the inferred pTNM staging and histology codes for an oncology patient + +To get the inferred pTNM staging and histology codes for an oncology patient, call `InferCancerProfile` on an instance of `OncoPhenotypeData`. The result is a Long Running operation of type `OncoPhenotypeResult`. + +```C# Snippet:HealthInsightsOncoPhenotypeData +// Create Patient +PatientRecord patient1 = new PatientRecord("patient_id") +{ + Info = new PatientInfo + { + BirthDate = new System.DateTime(1979, 10, 08), + Sex = PatientInfoSex.Female + } +}; + +// Add imaging document +string docContent1 = @" + 15.8.2021 + Jane Doe 091175-8967 + 42 year old female, married with 3 children, works as a nurse. + Healthy, no medications taken on a regular basis. + PMHx is significant for migraines with aura, uses Mirena for contraception. + Smoking history of 10 pack years (has stopped and relapsed several times). + She is in c/o 2 weeks of productive cough and shortness of breath. + She has a fever of 37.8 and general weakness. + Denies night sweats and rash. She denies symptoms of rhinosinusitis, asthma, and heartburn. + On PE: + GENERAL: mild pallor, no cyanosis. Regular breathing rate. + LUNGS: decreased breath sounds on the base of the right lung. Vesicular breathing. + No crackles, rales, and wheezes. Resonant percussion. + PLAN: + Will be referred for a chest x-ray. + ====================================== + CXR showed mild nonspecific opacities in right lung base. + PLAN: + Findings are suggestive of a working diagnosis of pneumonia. The patient is referred to a follow-up CXR in 2 weeks."; + +PatientDocument patientDocument1 = new PatientDocument(DocumentType.Note, + "doc1", + new DocumentContent(DocumentContentSourceType.Inline, docContent1)) +{ + ClinicalType = ClinicalDocumentType.Imaging, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2021-08-15T00:00:00") +}; +patient1.Data.Add(patientDocument1); + +// Add Pathology documents +string docContent2 = @" + Oncology Clinic + 20.10.2021 + Jane Doe 091175-8967 + 42-year-old healthy female who works as a nurse in the ER of this hospital. + First menstruation at 11 years old. First delivery- 27 years old. She has 3 children. + Didn’t breastfeed. + Contraception- Mirena. + Smoking- 10 pack years. + Mother- Belarusian. Father- Georgian. + About 3 months prior to admission, she stated she had SOB and was febrile. + She did a CXR as an outpatient which showed a finding in the base of the right lung- possibly an infiltrate. + She was treated with antibiotics with partial response. + 6 weeks later a repeat CXR was performed- a few solid dense findings in the right lung. + Therefore, she was referred for a PET-CT which demonstrated increased uptake in the right breast, lymph nodes on the right a few areas in the lungs and liver. + On biopsy from the lesion in the right breast- triple negative adenocarcinoma. Genetic testing has not been done thus far. + Genetic counseling- the patient denies a family history of breast, ovary, uterus, and prostate cancer. Her mother has chronic lymphocytic leukemia (CLL). + She is planned to undergo genetic tests because the aggressive course of the disease, and her young age. + Impression: + Stage 4 triple negative breast adenocarcinoma. + Could benefit from biological therapy. + Different treatment options were explained- the patient wants to get a second opinion."; +PatientDocument patientDocument2 = new PatientDocument(DocumentType.Note, + "doc2", + new DocumentContent(DocumentContentSourceType.Inline, docContent2)) +{ + ClinicalType = ClinicalDocumentType.Pathology, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2021-10-20T22:00:00.00") +}; + +patient1.Data.Add(patientDocument2); + +string docContent3 = @" + PATHOLOGY REPORT + Clinical Information + Ultrasound-guided biopsy; A. 18 mm mass; most likely diagnosis based on imaging: IDC + Diagnosis + A. BREAST, LEFT AT 2:00 4 CM FN; ULTRASOUND-GUIDED NEEDLE CORE BIOPSIES: + - Invasive carcinoma of no special type (invasive ductal carcinoma), grade 1 + Nottingham histologic grade: 1/3 (tubules 2; nuclear grade 2; mitotic rate 1; total score; 5/9) + Fragments involved by invasive carcinoma: 2 + Largest measurement of invasive carcinoma on a single fragment: 7 mm + Ductal carcinoma in situ (DCIS): Present + Architectural pattern: Cribriform + Nuclear grade: 2- + -intermediate + Necrosis: Not identified + Fragments involved by DCIS: 1 + Largest measurement of DCIS on a single fragment: Span 2 mm + Microcalcifications: Present in benign breast tissue and invasive carcinoma + Blocks with invasive carcinoma: A1 + Special studies: Pending"; + +PatientDocument patientDocument3 = new PatientDocument(DocumentType.Note, + "doc3", + new DocumentContent(DocumentContentSourceType.Inline, docContent3)) +{ + ClinicalType = ClinicalDocumentType.Pathology, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2022-01-01T00:00:00") +}; +patient1.Data.Add(patientDocument3); + +// Set configuration to include evidence for the cancer staging inferences +var configuration = new OncoPhenotypeModelConfiguration() { IncludeEvidence = true }; + +// Create OncoPhenotypeData with patient and configration +var oncoPhenotypeData = new OncoPhenotypeData(new List { patient1 }) { Configuration = configuration }; +``` + +Call InferCancerProfile to submit an Oncology request and get the Onco-Phenotype result + + +```C# Snippet:HealthInsightsCancerProfilingClientInferCancerProfile +OncoPhenotypeResult oncoPhenotypeResult = default; +try +{ + Operation operation = await client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); + Response resp = operation.GetRawResponse(); + oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); +} +catch (Exception ex) +{ + Console.WriteLine(ex.ToString()); + return; +} +``` + +To view the oncology inferences: + +```C# Snippet:HealthInsightsCancerProfilingInferCancerProfileViewResults +// View operation results +if (oncoPhenotypeResult.Status == JobStatus.Succeeded) +{ + OncoPhenotypeResults oncoResults = oncoPhenotypeResult.Results; + foreach (OncoPhenotypePatientResult patientResult in oncoResults.Patients) + { + Console.WriteLine($"\n==== Inferences of Patient {patientResult.Id} ===="); + foreach (OncoPhenotypeInference oncoInference in patientResult.Inferences) + { + Console.WriteLine($"\n=== Clinical Type: {oncoInference.Type.ToString()} Value: {oncoInference.Value} ConfidenceScore: {oncoInference.ConfidenceScore} ==="); + foreach (InferenceEvidence evidence in oncoInference.Evidence) + { + if (evidence.PatientDataEvidence != null) + { + var dataEvidence = evidence.PatientDataEvidence; + Console.WriteLine($"Evidence {dataEvidence.Id} {dataEvidence.Offset} {dataEvidence.Length} {dataEvidence.Text}"); + } + if (evidence.PatientInfoEvidence != null) + { + var infoEvidence = evidence.PatientInfoEvidence; + Console.WriteLine($"Evidence {infoEvidence.System} {infoEvidence.Code} {infoEvidence.Name} {infoEvidence.Value}"); + } + } + } + } +} +else +{ + IReadOnlyList oncoErrors = oncoPhenotypeResult.Errors; + foreach (ResponseError error in oncoErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } +} +``` diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample_InferCancerProfile.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md similarity index 100% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample_InferCancerProfile.md rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfile.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfile.cs new file mode 100644 index 000000000000..1c1e46907a43 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfile.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.Health.Insights.CancerProfiling.Tests.Infrastructure; +using NUnit.Framework; + +namespace Azure.Health.Insights.CancerProfiling.Tests.Samples +{ + public partial class HealthInsightsSamples : SamplesBase + { + [Test] + public void InferCancerProfile() + { + #region Snippet:CreateCancerProfilingClient + + // Read endpoint and apiKey + string endpoint = TestEnvironment.Endpoint; + string apiKey = TestEnvironment.ApiKey; + + var endpointUri = new Uri(endpoint); + var credential = new AzureKeyCredential(apiKey); + + // Create CancerProfilingClient + CancerProfilingClient client = new CancerProfilingClient(endpointUri, credential); + + #endregion + + #region Snippet:HealthInsightsOncoPhenotypeData + // Create Patient + PatientRecord patient1 = new PatientRecord("patient_id") + { + Info = new PatientInfo + { + BirthDate = new System.DateTime(1979, 10, 08), + Sex = PatientInfoSex.Female + } + }; + + // Add imaging document + string docContent1 = @" + 15.8.2021 + Jane Doe 091175-8967 + 42 year old female, married with 3 children, works as a nurse. + Healthy, no medications taken on a regular basis. + PMHx is significant for migraines with aura, uses Mirena for contraception. + Smoking history of 10 pack years (has stopped and relapsed several times). + She is in c/o 2 weeks of productive cough and shortness of breath. + She has a fever of 37.8 and general weakness. + Denies night sweats and rash. She denies symptoms of rhinosinusitis, asthma, and heartburn. + On PE: + GENERAL: mild pallor, no cyanosis. Regular breathing rate. + LUNGS: decreased breath sounds on the base of the right lung. Vesicular breathing. + No crackles, rales, and wheezes. Resonant percussion. + PLAN: + Will be referred for a chest x-ray. + ====================================== + CXR showed mild nonspecific opacities in right lung base. + PLAN: + Findings are suggestive of a working diagnosis of pneumonia. The patient is referred to a follow-up CXR in 2 weeks."; + + PatientDocument patientDocument1 = new PatientDocument(DocumentType.Note, + "doc1", + new DocumentContent(DocumentContentSourceType.Inline, docContent1)) + { + ClinicalType = ClinicalDocumentType.Imaging, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2021-08-15T00:00:00") + }; + patient1.Data.Add(patientDocument1); + + // Add Pathology documents + string docContent2 = @" + Oncology Clinic + 20.10.2021 + Jane Doe 091175-8967 + 42-year-old healthy female who works as a nurse in the ER of this hospital. + First menstruation at 11 years old. First delivery- 27 years old. She has 3 children. + Didn’t breastfeed. + Contraception- Mirena. + Smoking- 10 pack years. + Mother- Belarusian. Father- Georgian. + About 3 months prior to admission, she stated she had SOB and was febrile. + She did a CXR as an outpatient which showed a finding in the base of the right lung- possibly an infiltrate. + She was treated with antibiotics with partial response. + 6 weeks later a repeat CXR was performed- a few solid dense findings in the right lung. + Therefore, she was referred for a PET-CT which demonstrated increased uptake in the right breast, lymph nodes on the right a few areas in the lungs and liver. + On biopsy from the lesion in the right breast- triple negative adenocarcinoma. Genetic testing has not been done thus far. + Genetic counseling- the patient denies a family history of breast, ovary, uterus, and prostate cancer. Her mother has chronic lymphocytic leukemia (CLL). + She is planned to undergo genetic tests because the aggressive course of the disease, and her young age. + Impression: + Stage 4 triple negative breast adenocarcinoma. + Could benefit from biological therapy. + Different treatment options were explained- the patient wants to get a second opinion."; + PatientDocument patientDocument2 = new PatientDocument(DocumentType.Note, + "doc2", + new DocumentContent(DocumentContentSourceType.Inline, docContent2)) + { + ClinicalType = ClinicalDocumentType.Pathology, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2021-10-20T22:00:00.00") + }; + + patient1.Data.Add(patientDocument2); + + string docContent3 = @" + PATHOLOGY REPORT + Clinical Information + Ultrasound-guided biopsy; A. 18 mm mass; most likely diagnosis based on imaging: IDC + Diagnosis + A. BREAST, LEFT AT 2:00 4 CM FN; ULTRASOUND-GUIDED NEEDLE CORE BIOPSIES: + - Invasive carcinoma of no special type (invasive ductal carcinoma), grade 1 + Nottingham histologic grade: 1/3 (tubules 2; nuclear grade 2; mitotic rate 1; total score; 5/9) + Fragments involved by invasive carcinoma: 2 + Largest measurement of invasive carcinoma on a single fragment: 7 mm + Ductal carcinoma in situ (DCIS): Present + Architectural pattern: Cribriform + Nuclear grade: 2- + -intermediate + Necrosis: Not identified + Fragments involved by DCIS: 1 + Largest measurement of DCIS on a single fragment: Span 2 mm + Microcalcifications: Present in benign breast tissue and invasive carcinoma + Blocks with invasive carcinoma: A1 + Special studies: Pending"; + + PatientDocument patientDocument3 = new PatientDocument(DocumentType.Note, + "doc3", + new DocumentContent(DocumentContentSourceType.Inline, docContent3)) + { + ClinicalType = ClinicalDocumentType.Pathology, + Language = "en", + CreatedDateTime = DateTimeOffset.Parse("2022-01-01T00:00:00") + }; + patient1.Data.Add(patientDocument3); + + // Set configuration to include evidence for the cancer staging inferences + var configuration = new OncoPhenotypeModelConfiguration() { IncludeEvidence = true }; + + // Create OncoPhenotypeData with patient and configration + var oncoPhenotypeData = new OncoPhenotypeData(new List { patient1 }) { Configuration = configuration }; + #endregion + #region Snippet:HealthInsightsCancerProfilingClientInferCancerProfile + OncoPhenotypeResult oncoPhenotypeResult = default; + try + { + Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); + Response resp = operation.GetRawResponse(); + oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + return; + } + #endregion + + #region Snippet:HealthInsightsCancerProfilingInferCancerProfileViewResults + // View operation results + if (oncoPhenotypeResult.Status == JobStatus.Succeeded) + { + OncoPhenotypeResults oncoResults = oncoPhenotypeResult.Results; + foreach (OncoPhenotypePatientResult patientResult in oncoResults.Patients) + { + Console.WriteLine($"\n==== Inferences of Patient {patientResult.Id} ===="); + foreach (OncoPhenotypeInference oncoInference in patientResult.Inferences) + { + Console.WriteLine($"\n=== Clinical Type: {oncoInference.Type.ToString()} Value: {oncoInference.Value} ConfidenceScore: {oncoInference.ConfidenceScore} ==="); + foreach (InferenceEvidence evidence in oncoInference.Evidence) + { + if (evidence.PatientDataEvidence != null) + { + var dataEvidence = evidence.PatientDataEvidence; + Console.WriteLine($"Evidence {dataEvidence.Id} {dataEvidence.Offset} {dataEvidence.Length} {dataEvidence.Text}"); + } + if (evidence.PatientInfoEvidence != null) + { + var infoEvidence = evidence.PatientInfoEvidence; + Console.WriteLine($"Evidence {infoEvidence.System} {infoEvidence.Code} {infoEvidence.Name} {infoEvidence.Value}"); + } + } + } + } + } + else + { + IReadOnlyList oncoErrors = oncoPhenotypeResult.Errors; + foreach (ResponseError error in oncoErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } + } + + #endregion + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample_InferCancerProfile.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs similarity index 100% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample_InferCancerProfile.cs rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md index 8d83fb65fc5d..7bfe4315f651 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/README.md @@ -15,8 +15,9 @@ These code samples show common scenario operations with the Azure Health Insight |**Sample Name**|**Description**| |----------------|-------------| -|[Sample_MatchTrials][sample_get_all_matching_clinical_trials_for_a_specific_patient] |Get all matching clinical trials for a specific patient.| - +|[Sample01_MatchTrials][sample_get_all_matching_clinical_trials_for_a_specific_patient] |Get all matching clinical trials for a specific patient. (sync)| +|[Sample01_MatchTrialsAsync][sample_get_all_matching_clinical_trials_for_a_specific_patient_async] |Get all matching clinical trials for a specific patient. (async)| diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrials.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrials.md new file mode 100644 index 000000000000..f01064483471 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrials.md @@ -0,0 +1,155 @@ +# Get all matching clinical trials for a specific patient +This sample demonstrates how to get all matching clinical trials for a specific patient, together with the associated evidence, based on the given patient's clinical condition and a public clinical trial registry. Trial list should be refined by a certain set of properties, as specified by the user (like trial phase and trial recruitment status). + +## Creating a `ClinicalMatchingClient` + +To create a new `ClinicalMatchingClient` to get all matching clinical trials for a specific patient, you need a Cognitive Services or HealthInsights service endpoint and credentials. You can use the [DefaultAzureCredential][DefaultAzureCredential] to try a number of common authentication methods optimized for both running as a service and development. In the sample below, however, you'll use a AzureHealthInsights service API key credential by creating an `AzureKeyCredential` object, that if needed, will allow you to update the API key without creating a new client. + +You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. + +```C# Snippet:CreateClinicalMatchingClient +// Read endpoint and apiKey +string endpoint = TestEnvironment.Endpoint; +string apiKey = TestEnvironment.ApiKey; + +var endpointUri = new Uri(endpoint); +var credential = new AzureKeyCredential(apiKey); + +// Create ClinicalMatchingClient +ClinicalMatchingClient clinicalMatchingClient = new ClinicalMatchingClient(endpointUri, credential); +``` + +## Get matching clinical trials for a patient + +To get matching clinical trials for a patient, call `MatchTrials` on an instance of `TrialMatcherData`. The result is a Long Running operation of type `TrialMatcherResult`. + +```C# Snippet:HealthInsightsTrialMatcherCreateTrialMatcherData +// Create patient +PatientRecord patient1 = new PatientRecord("patient_id") +{ + Info = new PatientInfo + { + BirthDate = new System.DateTime(1965, 12, 26), + Sex = PatientInfoSex.Male + } +}; + +// Attach clinical info to the patient +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0006826") +{ + Name = "Malignant Neoplasms", + Value = "true" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1522449") +{ + Name = "Therapeutic radiology procedure", + Value = "true" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "METASTATIC") +{ + Name = "metastatic", + Value = "true" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1512162") +{ + Name = "Eastern Cooperative Oncology Group", + Value = "1" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019693") +{ + Name = "HIV Infections", + Value = "false" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1300072") +{ + Name = "Tumor stage", + Value = "2" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019163") +{ + Name = "Hepatitis B", + Value = "false" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0018802") +{ + Name = "Congestive heart failure", + Value = "true" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019196") +{ + Name = "Hepatitis C", + Value = "false" +}); +patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0220650") +{ + Name = "Metastatic malignant neoplasm to brain", + Value = "true" +}); + +// Create registry filter +var registryFilters = new ClinicalTrialRegistryFilter(); +// Limit the trial to a specific patient condition ("Non-small cell lung cancer") +registryFilters.Conditions.Add("Non-small cell lung cancer"); +// Limit the clinical trial to a certain phase, phase 1 +registryFilters.Phases.Add(ClinicalTrialPhase.Phase1); +// Specify the clinical trial registry source as ClinicalTrials.Gov +registryFilters.Sources.Add(ClinicalTrialSource.ClinicaltrialsGov); +// Limit the clinical trial to a certain location, in this case California, USA +registryFilters.FacilityLocations.Add(new GeographicLocation("United States") { State = "Arizona" , City = "Gilbert" }); +// Limit the trial to a specific study type, interventional +registryFilters.StudyTypes.Add(ClinicalTrialStudyType.Interventional); + +// Create ClinicalTrial instance and attach the registry filter to it. +var clinicalTrials = new ClinicalTrials(); +clinicalTrials.RegistryFilters.Add(registryFilters); + +// Create TrialMatcherData with patient and configuration +var Configuration = new TrialMatcherModelConfiguration(clinicalTrials); +var trialMatcherData = new TrialMatcherData(new List { patient1 }) { Configuration = Configuration }; +``` + +Call MatchTrials to submit a trial matching request and get the matching trials response + +```C# Snippet:HealthInsightsClinicalMatchingMatchTrials +TrialMatcherResult trialMatcherResult = default; +try +{ + // Using ClinicalMatchingClient + MatchTrials + Operation operation = clinicalMatchingClient.MatchTrials(WaitUntil.Completed, trialMatcherData); + Response resp = operation.GetRawResponse(); + trialMatcherResult = TrialMatcherResult.FromResponse(resp); +} +catch (Exception ex) +{ + Console.WriteLine(ex.ToString()); + return; +} +``` + +To view the final results: + +```C# Snippet:HealthInsightsTrialMatcherMatchTrialsViewResults +// View the match trials (eligible/ineligible) +if (trialMatcherResult.Status == JobStatus.Succeeded) +{ + TrialMatcherResults matcherResults = trialMatcherResult.Results; + foreach (TrialMatcherPatientResult patientResult in matcherResults.Patients) + { + Console.WriteLine($"Inferences of Patient {patientResult.Id}"); + foreach (TrialMatcherInference tmInferences in patientResult.Inferences) + { + Console.WriteLine($"Trial Id {tmInferences.Id}"); + Console.WriteLine($"Type: {tmInferences.Type.ToString()} Value: {tmInferences.Value}"); + Console.WriteLine($"Description {tmInferences.Description}"); + } + } +} +else +{ + IReadOnlyList matcherErrors = trialMatcherResult.Errors; + foreach (ResponseError error in matcherErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } +} +``` diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample_MatchTrials.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrialsAsync.md similarity index 98% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample_MatchTrials.md rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrialsAsync.md index c680dff420cc..e7656a908988 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample_MatchTrials.md +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/samples/Sample01_MatchTrialsAsync.md @@ -108,7 +108,7 @@ var Configuration = new TrialMatcherModelConfiguration(clinicalTrials); var trialMatcherData = new TrialMatcherData(new List { patient1 }) { Configuration = Configuration }; ``` -Call MatchTrialsAsync to submit a trial matching request and get the matching trials response +Call MatchTrialsAsync to submit a trial matching async request and get the matching trials response ```C# Snippet:HealthInsightsClinicalMatchingMatchTrialsAsync TrialMatcherResult trialMatcherResult = default; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrials.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrials.cs new file mode 100644 index 000000000000..35363c3a96d8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrials.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Health.Insights.ClinicalMatching; +using Azure.Health.Insights.ClinicalMatching.Tests.Infrastructure; +using Azure.Core; +using Azure.Core.TestFramework; +using Microsoft.Extensions.ObjectPool; +using NUnit.Framework; + +namespace Azure.Health.Insights.ClinicalMatching.Tests.Samples +{ + public partial class HealthInsightsSamples : SamplesBase + { + [Test] + public void MatchTrials() + { + #region Snippet:CreateClinicalMatchingClient + + // Read endpoint and apiKey + string endpoint = TestEnvironment.Endpoint; + string apiKey = TestEnvironment.ApiKey; + + var endpointUri = new Uri(endpoint); + var credential = new AzureKeyCredential(apiKey); + + // Create ClinicalMatchingClient + ClinicalMatchingClient clinicalMatchingClient = new ClinicalMatchingClient(endpointUri, credential); + + #endregion + + #region Snippet:HealthInsightsTrialMatcherCreateTrialMatcherData + // Create patient + PatientRecord patient1 = new PatientRecord("patient_id") + { + Info = new PatientInfo + { + BirthDate = new System.DateTime(1965, 12, 26), + Sex = PatientInfoSex.Male + } + }; + + // Attach clinical info to the patient + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0006826") + { + Name = "Malignant Neoplasms", + Value = "true" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1522449") + { + Name = "Therapeutic radiology procedure", + Value = "true" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "METASTATIC") + { + Name = "metastatic", + Value = "true" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1512162") + { + Name = "Eastern Cooperative Oncology Group", + Value = "1" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019693") + { + Name = "HIV Infections", + Value = "false" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C1300072") + { + Name = "Tumor stage", + Value = "2" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019163") + { + Name = "Hepatitis B", + Value = "false" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0018802") + { + Name = "Congestive heart failure", + Value = "true" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0019196") + { + Name = "Hepatitis C", + Value = "false" + }); + patient1.Info.ClinicalInfo.Add(new ClinicalCodedElement("http://www.nlm.nih.gov/research/umls", "C0220650") + { + Name = "Metastatic malignant neoplasm to brain", + Value = "true" + }); + + // Create registry filter + var registryFilters = new ClinicalTrialRegistryFilter(); + // Limit the trial to a specific patient condition ("Non-small cell lung cancer") + registryFilters.Conditions.Add("Non-small cell lung cancer"); + // Limit the clinical trial to a certain phase, phase 1 + registryFilters.Phases.Add(ClinicalTrialPhase.Phase1); + // Specify the clinical trial registry source as ClinicalTrials.Gov + registryFilters.Sources.Add(ClinicalTrialSource.ClinicaltrialsGov); + // Limit the clinical trial to a certain location, in this case California, USA + registryFilters.FacilityLocations.Add(new GeographicLocation("United States") { State = "Arizona" , City = "Gilbert" }); + // Limit the trial to a specific study type, interventional + registryFilters.StudyTypes.Add(ClinicalTrialStudyType.Interventional); + + // Create ClinicalTrial instance and attach the registry filter to it. + var clinicalTrials = new ClinicalTrials(); + clinicalTrials.RegistryFilters.Add(registryFilters); + + // Create TrialMatcherData with patient and configuration + var Configuration = new TrialMatcherModelConfiguration(clinicalTrials); + var trialMatcherData = new TrialMatcherData(new List { patient1 }) { Configuration = Configuration }; + #endregion + + #region Snippet:HealthInsightsClinicalMatchingMatchTrials + TrialMatcherResult trialMatcherResult = default; + try + { + // Using ClinicalMatchingClient + MatchTrials + Operation operation = clinicalMatchingClient.MatchTrials(WaitUntil.Completed, trialMatcherData); + Response resp = operation.GetRawResponse(); + trialMatcherResult = TrialMatcherResult.FromResponse(resp); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + return; + } + #endregion + + #region Snippet:HealthInsightsTrialMatcherMatchTrialsViewResults + // View the match trials (eligible/ineligible) + if (trialMatcherResult.Status == JobStatus.Succeeded) + { + TrialMatcherResults matcherResults = trialMatcherResult.Results; + foreach (TrialMatcherPatientResult patientResult in matcherResults.Patients) + { + Console.WriteLine($"Inferences of Patient {patientResult.Id}"); + foreach (TrialMatcherInference tmInferences in patientResult.Inferences) + { + Console.WriteLine($"Trial Id {tmInferences.Id}"); + Console.WriteLine($"Type: {tmInferences.Type.ToString()} Value: {tmInferences.Value}"); + Console.WriteLine($"Description {tmInferences.Description}"); + } + } + } + else + { + IReadOnlyList matcherErrors = trialMatcherResult.Errors; + foreach (ResponseError error in matcherErrors) + { + Console.WriteLine($"{error.Code} : {error.Message}"); + } + } + + #endregion + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample_MatchTrials.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrialsAsync.cs similarity index 99% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample_MatchTrials.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrialsAsync.cs index 1e3b6892284a..9061dc5f6f24 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample_MatchTrials.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Samples/Sample01_MatchTrialsAsync.cs @@ -16,7 +16,7 @@ namespace Azure.Health.Insights.ClinicalMatching.Tests.Samples public partial class HealthInsightsSamples : SamplesBase { [Test] - public async Task CreateTrialMatcherJob() + public async Task MatchTrialsAsync() { #region Snippet:CreateClinicalMatchingClient From 9ca0320a41b020e82440c6b73b138b1d9c8139a1 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Wed, 22 Mar 2023 14:05:35 +0200 Subject: [PATCH 16/17] update tsp-location.yaml --- .../Azure.Health.Insights.CancerProfiling/tsp-location.yaml | 4 ++-- .../Azure.Health.Insights.ClinicalMatching/tsp-location.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml index 78b9f7d677c3..5a9aaca5ab3b 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml @@ -2,5 +2,5 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.oncophe additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 257253bba159129afb9c82387bcc3ae0805e19e6 -repo: asaflevi-ms/azure-rest-api-specs +commit: aa3618d1bd4b18cdbd308b1572c68393beaca9a6 +repo: azure/azure-rest-api-specs diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml index 8b23e5e332a5..105f1ef60ee8 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml @@ -2,5 +2,5 @@ directory: specification/cognitiveservices/HealthInsights/healthinsights.trialma additionalDirectories: - specification/cognitiveservices/HealthInsights/healthinsights.openapi/ - specification/cognitiveservices/HealthInsights/healthinsights.common/ -commit: 257253bba159129afb9c82387bcc3ae0805e19e6 -repo: asaflevi-ms/azure-rest-api-specs +commit: aa3618d1bd4b18cdbd308b1572c68393beaca9a6 +repo: azure/azure-rest-api-specs From 45161af992ffdb6bdeeb5e2a1a986ad2ed89dab3 Mon Sep 17 00:00:00 2001 From: Asaf Levi Date: Wed, 22 Mar 2023 14:43:21 +0200 Subject: [PATCH 17/17] update snippets --- .../samples/Sample01_InferCancerProfile.md | 2 +- .../samples/Sample01_InferCancerProfileAsync.md | 4 ++-- .../tests/Samples/Sample01_InferCancerProfileAsync.cs | 4 ++-- .../samples/Sample01_MatchTrialsAsync.md | 4 ++-- .../tests/Samples/Sample01_MatchTrialsAsync.cs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md index 3e9f878be61e..9cdcd574a98a 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfile.md @@ -145,7 +145,7 @@ Call InferCancerProfile to submit an Oncology request and get the Onco-Phenotype OncoPhenotypeResult oncoPhenotypeResult = default; try { - Operation operation = await client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); + Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); Response resp = operation.GetRawResponse(); oncoPhenotypeResult = OncoPhenotypeResult.FromResponse(resp); } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md index 81cd07b03273..9002fbe44e77 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples/Sample01_InferCancerProfileAsync.md @@ -7,7 +7,7 @@ To create a new `CancerProfilingClient` to get the inferred cancer staging, you You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. -```C# Snippet:CreateCancerProfilingClient +```C# Snippet:CreateCancerProfilingClientAsync // Read endpoint and apiKey string endpoint = TestEnvironment.Endpoint; string apiKey = TestEnvironment.ApiKey; @@ -23,7 +23,7 @@ CancerProfilingClient client = new CancerProfilingClient(endpointUri, credential To get the inferred pTNM staging and histology codes for an oncology patient, call `InferCancerProfileAsync` on an instance of `OncoPhenotypeData`. The result is a Long Running operation of type `OncoPhenotypeResult`. -```C# Snippet:HealthInsightsOncoPhenotypeData +```C# Snippet:HealthInsightsOncoPhenotypeDataAsync // Create Patient PatientRecord patient1 = new PatientRecord("patient_id") { diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs index 2181500552b3..b48471867890 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Samples/Sample01_InferCancerProfileAsync.cs @@ -15,7 +15,7 @@ public partial class HealthInsightsSamples : SamplesBase