From f3b5cde1945d93dfc28285730df2bc0fdf64065f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 31 Jan 2024 21:29:46 +0000 Subject: [PATCH] CodeGen from PR 27223 in Azure/azure-rest-api-specs Merge 9e1bfd77f38df200b8347ea9a62bbadd03ac7892 into f3cd6922dbe117d78b4f719bbf8b03db46b30808 --- ...Insights.CancerProfiling.netstandard2.0.cs | 402 +++++- .../src/Generated/CancerProfilingClient.cs | 24 +- .../Generated/CancerProfilingClientOptions.cs | 8 +- .../src/Generated/ClinicalCodedElement.cs | 10 +- .../src/Generated/ClinicalDocumentType.cs | 12 +- .../Generated/Docs/CancerProfilingClient.xml | 548 +++++++- ...entAdministrativeMetadata.Serialization.cs | 164 +++ .../DocumentAdministrativeMetadata.cs | 71 + .../Generated/DocumentAuthor.Serialization.cs | 150 ++ .../src/Generated/DocumentAuthor.cs | 69 + .../Generated/DocumentContentSourceType.cs | 4 +- .../src/Generated/Encounter.Serialization.cs} | 80 +- .../src/Generated/Encounter.cs | 90 ++ .../src/Generated/EncounterClass.cs | 63 + .../FhirR4CodeableConcept.Serialization.cs | 200 +++ .../src/Generated/FhirR4CodeableConcept.cs | 43 + .../Generated/FhirR4Coding.Serialization.cs | 208 +++ .../src/Generated/FhirR4Coding.cs | 49 + .../Generated/FhirR4Element.Serialization.cs | 164 +++ .../src/Generated/FhirR4Element.cs | 74 + .../FhirR4Extendible.Serialization.cs | 179 +++ .../src/Generated/FhirR4Extendible.cs | 75 + .../FhirR4Extension.Serialization.cs | 344 +++++ .../src/Generated/FhirR4Extension.cs | 96 ++ .../FhirR4Identifier.Serialization.cs | 242 ++++ .../src/Generated/FhirR4Identifier.cs | 57 + .../src/Generated/FhirR4Meta.Serialization.cs | 236 ++++ .../src/Generated/FhirR4Meta.cs | 92 ++ .../Generated/FhirR4Period.Serialization.cs | 186 +++ .../src/Generated/FhirR4Period.cs | 41 + .../Generated/FhirR4Quantity.Serialization.cs | 223 +++ .../src/Generated/FhirR4Quantity.cs | 53 + .../Generated/FhirR4Range.Serialization.cs | 194 +++ .../src/Generated/FhirR4Range.cs | 41 + .../Generated/FhirR4Ratio.Serialization.cs | 194 +++ .../src/Generated/FhirR4Ratio.cs | 41 + .../FhirR4Reference.Serialization.cs | 212 +++ .../src/Generated/FhirR4Reference.cs | 49 + .../Generated/FhirR4Resource.Serialization.cs | 178 +++ .../src/Generated/FhirR4Resource.cs | 95 ++ .../FhirR4SampledData.Serialization.cs | 244 ++++ .../src/Generated/FhirR4SampledData.cs | 76 + ...althInsightsCancerProfilingModelFactory.cs | 245 +++- ...PhenotypeInferenceResult.Serialization.cs} | 52 +- ...lts.cs => OncoPhenotypeInferenceResult.cs} | 28 +- .../Generated/OncoPhenotypeInferenceType.cs | 3 + ...ncoPhenotypePatientResult.Serialization.cs | 12 +- .../Generated/OncoPhenotypePatientResult.cs | 18 +- ...ion.cs => PatientDetails.Serialization.cs} | 52 +- .../{PatientInfo.cs => PatientDetails.cs} | 16 +- .../PatientDocument.Serialization.cs | 57 +- .../src/Generated/PatientDocument.cs | 15 +- .../Generated/PatientRecord.Serialization.cs | 43 +- .../src/Generated/PatientRecord.cs | 17 +- .../{PatientInfoSex.cs => PatientSex.cs} | 28 +- .../src/Generated/SpecialtyType.cs | 51 + .../src/Generated/TimePeriod.Serialization.cs | 158 +++ .../src/Generated/TimePeriod.cs | 69 + .../Samples/Samples_CancerProfilingClient.cs | 537 ++++++- .../tsp-location.yaml | 11 +- ...nsights.ClinicalMatching.netstandard2.0.cs | 729 +++++++--- .../src/Generated/AgeUnit.cs | 54 - .../src/Generated/ClinicalCodedElement.cs | 10 +- .../src/Generated/ClinicalDocumentType.cs | 12 +- .../src/Generated/ClinicalMatchingClient.cs | 24 +- .../ClinicalMatchingClientOptions.cs | 8 +- .../src/Generated/ClinicalTrialAcceptedSex.cs | 54 - .../src/Generated/ClinicalTrialDetails.cs | 91 -- .../ClinicalTrialMetadata.Serialization.cs | 10 +- .../src/Generated/ClinicalTrialMetadata.cs | 18 +- .../ClinicalTrialResearchFacility.cs | 10 +- .../Generated/ClinicalTrials.Serialization.cs | 6 +- .../src/Generated/ClinicalTrials.cs | 6 +- .../src/Generated/ContactDetails.cs | 8 +- .../src/Generated/ContactPointSystem.cs | 69 + .../src/Generated/ContactPointUse.cs | 63 + .../Generated/Docs/ClinicalMatchingClient.xml | 1058 +++++++++++--- ...entAdministrativeMetadata.Serialization.cs | 164 +++ .../DocumentAdministrativeMetadata.cs | 71 + .../Generated/DocumentAuthor.Serialization.cs | 150 ++ ...{AcceptedAgeRange.cs => DocumentAuthor.cs} | 28 +- .../Generated/DocumentContentSourceType.cs | 4 +- ...lization.cs => Encounter.Serialization.cs} | 74 +- .../src/Generated/Encounter.cs | 90 ++ .../src/Generated/EncounterClass.cs | 63 + .../FhirR4Annotation.Serialization.cs | 194 +++ .../src/Generated/FhirR4Annotation.cs | 56 + .../FhirR4CodeableConcept.Serialization.cs | 200 +++ .../src/Generated/FhirR4CodeableConcept.cs | 43 + .../Generated/FhirR4Coding.Serialization.cs | 208 +++ .../src/Generated/FhirR4Coding.cs | 49 + .../FhirR4ContactDetail.Serialization.cs | 200 +++ .../src/Generated/FhirR4ContactDetail.cs | 40 + .../FhirR4ContactPoint.Serialization.cs | 199 +++ .../src/Generated/FhirR4ContactPoint.cs | 84 ++ .../FhirR4DomainResource.Serialization.cs | 179 +++ .../src/Generated/FhirR4DomainResource.cs | 67 + .../Generated/FhirR4Element.Serialization.cs | 164 +++ .../src/Generated/FhirR4Element.cs | 74 + .../FhirR4Extendible.Serialization.cs | 179 +++ .../src/Generated/FhirR4Extendible.cs | 75 + .../FhirR4Extension.Serialization.cs | 344 +++++ .../src/Generated/FhirR4Extension.cs | 96 ++ .../FhirR4Identifier.Serialization.cs | 242 ++++ .../src/Generated/FhirR4Identifier.cs | 57 + .../src/Generated/FhirR4Meta.Serialization.cs | 236 ++++ .../src/Generated/FhirR4Meta.cs | 92 ++ .../FhirR4Narrative.Serialization.cs | 180 +++ .../src/Generated/FhirR4Narrative.cs | 55 + .../Generated/FhirR4Period.Serialization.cs | 186 +++ .../src/Generated/FhirR4Period.cs | 41 + .../Generated/FhirR4Quantity.Serialization.cs | 223 +++ .../src/Generated/FhirR4Quantity.cs | 53 + .../Generated/FhirR4Range.Serialization.cs | 194 +++ .../src/Generated/FhirR4Range.cs | 41 + .../Generated/FhirR4Ratio.Serialization.cs | 194 +++ .../src/Generated/FhirR4Ratio.cs | 41 + .../FhirR4Reference.Serialization.cs | 212 +++ .../src/Generated/FhirR4Reference.cs | 49 + .../FhirR4ResearchStudy.Serialization.cs | 738 ++++++++++ .../src/Generated/FhirR4ResearchStudy.cs | 154 ++ .../Generated/FhirR4Resource.Serialization.cs | 178 +++ .../src/Generated/FhirR4Resource.cs | 95 ++ .../FhirR4SampledData.Serialization.cs | 244 ++++ .../src/Generated/FhirR4SampledData.cs | 76 + ...lthInsightsClinicalMatchingModelFactory.cs | 442 +++++- ...ion.cs => PatientDetails.Serialization.cs} | 52 +- .../{PatientInfo.cs => PatientDetails.cs} | 16 +- .../PatientDocument.Serialization.cs | 57 +- .../src/Generated/PatientDocument.cs | 15 +- .../Generated/PatientRecord.Serialization.cs | 43 +- .../src/Generated/PatientRecord.cs | 17 +- .../{PatientInfoSex.cs => PatientSex.cs} | 28 +- ...n.cs => ResearchStudyArm.Serialization.cs} | 78 +- .../src/Generated/ResearchStudyArm.cs | 84 ++ .../ResearchStudyObjective.Serialization.cs | 151 ++ ...ceptedAge.cs => ResearchStudyObjective.cs} | 42 +- .../Generated/ResearchStudyStatusCodeType.cs | 78 ++ .../src/Generated/SpecialtyType.cs | 51 + .../src/Generated/TimePeriod.Serialization.cs | 158 +++ ...icalTrialDemographics.cs => TimePeriod.cs} | 28 +- .../TrialMatcherInference.Serialization.cs | 14 +- .../src/Generated/TrialMatcherInference.cs | 8 +- ...alMatcherInferenceResult.Serialization.cs} | 52 +- ...ults.cs => TrialMatcherInferenceResult.cs} | 28 +- ...TrialMatcherPatientResult.Serialization.cs | 12 +- .../Generated/TrialMatcherPatientResult.cs | 24 +- ...knownFhirR4DomainResource.Serialization.cs | 268 ++++ .../Generated/UnknownFhirR4DomainResource.cs | 36 + .../Samples/Samples_ClinicalMatchingClient.cs | 995 ++++++++++--- .../tsp-location.yaml | 11 +- .../Azure.Health.Insights.PatientTimeline.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 86 ++ ...ure.Health.Insights.PatientTimeline.csproj | 21 + .../src/Generated/ClinicalDocumentType.cs | 69 + .../Generated/Docs/PatientTimelineClient.xml | 1141 +++++++++++++++ ...entAdministrativeMetadata.Serialization.cs | 164 +++ .../DocumentAdministrativeMetadata.cs | 71 + .../Generated/DocumentAuthor.Serialization.cs | 150 ++ .../src/Generated/DocumentAuthor.cs | 69 + .../DocumentContent.Serialization.cs} | 60 +- .../src/Generated/DocumentContent.cs | 94 ++ .../Generated/DocumentContentSourceType.cs | 55 + .../src/Generated/DocumentType.cs | 57 + .../src/Generated/Encounter.Serialization.cs | 166 +++ .../src/Generated/Encounter.cs | 90 ++ .../src/Generated/EncounterClass.cs | 63 + .../FhirR4CodeableConcept.Serialization.cs | 200 +++ .../src/Generated/FhirR4CodeableConcept.cs | 43 + .../Generated/FhirR4Coding.Serialization.cs | 208 +++ .../src/Generated/FhirR4Coding.cs | 49 + .../Generated/FhirR4Element.Serialization.cs | 164 +++ .../src/Generated/FhirR4Element.cs | 74 + .../FhirR4Extendible.Serialization.cs | 179 +++ .../src/Generated/FhirR4Extendible.cs | 75 + .../FhirR4Extension.Serialization.cs | 344 +++++ .../src/Generated/FhirR4Extension.cs | 96 ++ .../FhirR4Identifier.Serialization.cs | 242 ++++ .../src/Generated/FhirR4Identifier.cs | 57 + .../src/Generated/FhirR4Meta.Serialization.cs | 236 ++++ .../src/Generated/FhirR4Meta.cs | 92 ++ .../Generated/FhirR4Period.Serialization.cs | 186 +++ .../src/Generated/FhirR4Period.cs | 41 + .../Generated/FhirR4Quantity.Serialization.cs | 223 +++ .../src/Generated/FhirR4Quantity.cs | 53 + .../Generated/FhirR4Range.Serialization.cs | 194 +++ .../src/Generated/FhirR4Range.cs | 41 + .../Generated/FhirR4Ratio.Serialization.cs | 194 +++ .../src/Generated/FhirR4Ratio.cs | 41 + .../FhirR4Reference.Serialization.cs | 212 +++ .../src/Generated/FhirR4Reference.cs | 49 + .../Generated/FhirR4Resource.Serialization.cs | 178 +++ .../src/Generated/FhirR4Resource.cs | 95 ++ .../FhirR4SampledData.Serialization.cs | 244 ++++ .../src/Generated/FhirR4SampledData.cs | 76 + ...sPatientTimelineClientBuilderExtensions.cs | 37 + ...althInsightsPatientTimelineModelFactory.cs | 254 ++++ .../Generated/PatientDetails.Serialization.cs | 183 +++ .../src/Generated/PatientDetails.cs | 75 + .../PatientDocument.Serialization.cs | 248 ++++ .../src/Generated/PatientDocument.cs | 114 ++ .../Generated/PatientRecord.Serialization.cs | 201 +++ .../src/Generated/PatientRecord.cs | 90 ++ .../src/Generated/PatientSex.cs | 54 + .../src/Generated/PatientTimelineClient.cs | 218 +++ .../Generated/PatientTimelineClientOptions.cs | 37 + .../PatientTimelineData.Serialization.cs | 161 +++ .../src/Generated/PatientTimelineData.cs | 81 ++ ...ntTimelineInferenceResult.Serialization.cs | 154 ++ .../PatientTimelineInferenceResult.cs | 84 ++ ...imelineModelConfiguration.Serialization.cs | 158 +++ .../PatientTimelineModelConfiguration.cs | 69 + ...ientTimelinePatientResult.Serialization.cs | 154 ++ .../Generated/PatientTimelinePatientResult.cs | 84 ++ .../src/Generated/SpecialtyType.cs | 51 + .../src/Generated/TimePeriod.Serialization.cs | 158 +++ .../src/Generated/TimePeriod.cs | 69 + .../src/Properties/AssemblyInfo.cs | 11 + ...alth.Insights.PatientTimeline.Tests.csproj | 20 + .../Samples/Samples_PatientTimelineClient.cs | 1170 ++++++++++++++++ .../tsp-location.yaml | 7 + ...zure.Health.Insights.RadiologyInsights.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 86 ++ ...e.Health.Insights.RadiologyInsights.csproj | 21 + .../src/Generated/ClinicalDocumentType.cs | 69 + .../Docs/RadiologyInsightsClient.xml | 1207 ++++++++++++++++ ...entAdministrativeMetadata.Serialization.cs | 164 +++ .../DocumentAdministrativeMetadata.cs | 71 + .../Generated/DocumentAuthor.Serialization.cs | 150 ++ .../src/Generated/DocumentAuthor.cs | 69 + .../DocumentContent.Serialization.cs | 144 ++ .../src/Generated/DocumentContent.cs | 94 ++ .../Generated/DocumentContentSourceType.cs | 55 + .../src/Generated/DocumentType.cs | 57 + .../src/Generated/Encounter.Serialization.cs | 166 +++ .../src/Generated/Encounter.cs | 90 ++ .../src/Generated/EncounterClass.cs | 63 + .../FhirR4Annotation.Serialization.cs | 194 +++ .../src/Generated/FhirR4Annotation.cs | 56 + .../FhirR4CodeableConcept.Serialization.cs | 200 +++ .../src/Generated/FhirR4CodeableConcept.cs | 43 + .../Generated/FhirR4Coding.Serialization.cs | 208 +++ .../src/Generated/FhirR4Coding.cs | 49 + .../FhirR4DomainResource.Serialization.cs | 179 +++ .../src/Generated/FhirR4DomainResource.cs | 67 + .../Generated/FhirR4Element.Serialization.cs | 164 +++ .../src/Generated/FhirR4Element.cs | 74 + .../FhirR4Extendible.Serialization.cs | 179 +++ .../src/Generated/FhirR4Extendible.cs | 75 + .../FhirR4Extension.Serialization.cs | 344 +++++ .../src/Generated/FhirR4Extension.cs | 96 ++ .../FhirR4Identifier.Serialization.cs | 242 ++++ .../src/Generated/FhirR4Identifier.cs | 57 + .../src/Generated/FhirR4Meta.Serialization.cs | 236 ++++ .../src/Generated/FhirR4Meta.cs | 92 ++ .../FhirR4Narrative.Serialization.cs | 180 +++ .../src/Generated/FhirR4Narrative.cs | 55 + .../FhirR4Observation.Serialization.cs | 764 ++++++++++ .../src/Generated/FhirR4Observation.cs | 181 +++ ...hirR4ObservationComponent.Serialization.cs | 409 ++++++ .../Generated/FhirR4ObservationComponent.cs | 110 ++ ...ObservationReferenceRange.Serialization.cs | 224 +++ .../FhirR4ObservationReferenceRange.cs | 90 ++ .../Generated/FhirR4Period.Serialization.cs | 186 +++ .../src/Generated/FhirR4Period.cs | 41 + .../Generated/FhirR4Quantity.Serialization.cs | 223 +++ .../src/Generated/FhirR4Quantity.cs | 53 + .../Generated/FhirR4Range.Serialization.cs | 194 +++ .../src/Generated/FhirR4Range.cs | 41 + .../Generated/FhirR4Ratio.Serialization.cs | 194 +++ .../src/Generated/FhirR4Ratio.cs | 41 + .../FhirR4Reference.Serialization.cs | 212 +++ .../src/Generated/FhirR4Reference.cs | 49 + .../Generated/FhirR4Resource.Serialization.cs | 178 +++ .../src/Generated/FhirR4Resource.cs | 95 ++ .../FhirR4SampledData.Serialization.cs | 244 ++++ .../src/Generated/FhirR4SampledData.cs | 76 + .../Generated/FindingOptions.Serialization.cs | 143 ++ .../src/Generated/FindingOptions.cs | 65 + ...owupRecommendationOptions.Serialization.cs | 173 +++ .../FollowupRecommendationOptions.cs | 73 + ...icProcedureRecommendation.Serialization.cs | 155 +++ .../GenericProcedureRecommendation.cs | 49 + ...adiologyInsightsClientBuilderExtensions.cs | 37 + ...thInsightsRadiologyInsightsModelFactory.cs | 254 ++++ .../ImagingProcedure.Serialization.cs | 189 +++ .../src/Generated/ImagingProcedure.cs | 95 ++ ...ngProcedureRecommendation.Serialization.cs | 179 +++ .../ImagingProcedureRecommendation.cs | 51 + .../Generated/ObservationStatusCodeType.cs | 72 + .../Generated/PatientDetails.Serialization.cs | 183 +++ .../src/Generated/PatientDetails.cs | 75 + .../PatientDocument.Serialization.cs | 248 ++++ .../src/Generated/PatientDocument.cs | 114 ++ .../Generated/PatientRecord.Serialization.cs | 201 +++ .../src/Generated/PatientRecord.cs | 90 ++ .../src/Generated/PatientSex.cs | 54 + .../ProcedureRecommendation.Serialization.cs | 128 ++ .../src/Generated/ProcedureRecommendation.cs | 69 + .../RadiologyCodeWithTypes.Serialization.cs | 154 ++ .../src/Generated/RadiologyCodeWithTypes.cs | 84 ++ .../src/Generated/RadiologyInsightsClient.cs | 218 +++ .../RadiologyInsightsClientOptions.cs | 37 + .../RadiologyInsightsData.Serialization.cs | 161 +++ .../src/Generated/RadiologyInsightsData.cs | 81 ++ ...yInsightsInferenceOptions.Serialization.cs | 158 +++ .../RadiologyInsightsInferenceOptions.cs | 69 + ...gyInsightsInferenceResult.Serialization.cs | 154 ++ .../RadiologyInsightsInferenceResult.cs | 84 ++ .../RadiologyInsightsInferenceType.cs | 75 + ...nsightsModelConfiguration.Serialization.cs | 209 +++ .../RadiologyInsightsModelConfiguration.cs | 83 ++ ...logyInsightsPatientResult.Serialization.cs | 154 ++ .../RadiologyInsightsPatientResult.cs | 84 ++ .../src/Generated/SpecialtyType.cs | 51 + .../src/Generated/TimePeriod.Serialization.cs | 158 +++ .../src/Generated/TimePeriod.cs | 69 + ...knownFhirR4DomainResource.Serialization.cs | 268 ++++ .../Generated/UnknownFhirR4DomainResource.cs | 36 + ...wnProcedureRecommendation.Serialization.cs | 136 ++ .../UnknownProcedureRecommendation.cs | 28 + .../src/Properties/AssemblyInfo.cs | 11 + ...th.Insights.RadiologyInsights.Tests.csproj | 20 + .../Samples_RadiologyInsightsClient.cs | 1236 +++++++++++++++++ .../tsp-location.yaml | 7 + 329 files changed, 42896 insertions(+), 1544 deletions(-) create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAdministrativeMetadata.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAdministrativeMetadata.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAuthor.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAuthor.cs rename sdk/healthinsights/{Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.Serialization.cs => Azure.Health.Insights.CancerProfiling/src/Generated/Encounter.Serialization.cs} (54%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Encounter.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/EncounterClass.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4CodeableConcept.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4CodeableConcept.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Coding.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Coding.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Element.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Element.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extendible.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extendible.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extension.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extension.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Identifier.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Identifier.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Meta.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Meta.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Period.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Period.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Quantity.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Quantity.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Range.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Range.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Ratio.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Ratio.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Reference.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Reference.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Resource.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Resource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4SampledData.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4SampledData.cs rename sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/{OncoPhenotypeResults.Serialization.cs => OncoPhenotypeInferenceResult.Serialization.cs} (64%) rename sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/{OncoPhenotypeResults.cs => OncoPhenotypeInferenceResult.cs} (74%) rename sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/{PatientInfo.Serialization.cs => PatientDetails.Serialization.cs} (71%) rename sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/{PatientInfo.cs => PatientDetails.cs} (84%) rename sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/{PatientInfoSex.cs => PatientSex.cs} (52%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/SpecialtyType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/TimePeriod.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/TimePeriod.cs delete mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AgeUnit.cs delete mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialAcceptedSex.cs delete mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactPointSystem.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactPointUse.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAdministrativeMetadata.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAdministrativeMetadata.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAuthor.Serialization.cs rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{AcceptedAgeRange.cs => DocumentAuthor.cs} (61%) rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{ClinicalTrialDemographics.Serialization.cs => Encounter.Serialization.cs} (56%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Encounter.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/EncounterClass.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Annotation.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Annotation.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4CodeableConcept.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4CodeableConcept.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Coding.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Coding.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactDetail.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactDetail.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactPoint.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactPoint.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4DomainResource.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4DomainResource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Element.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Element.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extendible.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extendible.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extension.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extension.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Identifier.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Identifier.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Meta.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Meta.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Narrative.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Narrative.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Period.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Period.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Quantity.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Quantity.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Range.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Range.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Ratio.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Ratio.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Reference.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Reference.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ResearchStudy.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ResearchStudy.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Resource.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Resource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4SampledData.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4SampledData.cs rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{PatientInfo.Serialization.cs => PatientDetails.Serialization.cs} (71%) rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{PatientInfo.cs => PatientDetails.cs} (84%) rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{PatientInfoSex.cs => PatientSex.cs} (52%) rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{AcceptedAgeRange.Serialization.cs => ResearchStudyArm.Serialization.cs} (61%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyArm.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyObjective.Serialization.cs rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{AcceptedAge.cs => ResearchStudyObjective.cs} (58%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyStatusCodeType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/SpecialtyType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TimePeriod.Serialization.cs rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{ClinicalTrialDemographics.cs => TimePeriod.cs} (58%) rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{TrialMatcherResults.Serialization.cs => TrialMatcherInferenceResult.Serialization.cs} (67%) rename sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/{TrialMatcherResults.cs => TrialMatcherInferenceResult.cs} (74%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/UnknownFhirR4DomainResource.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/UnknownFhirR4DomainResource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/Azure.Health.Insights.PatientTimeline.sln create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/CHANGELOG.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/Directory.Build.props create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/README.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Azure.Health.Insights.PatientTimeline.csproj create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/ClinicalDocumentType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Docs/PatientTimelineClient.xml create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAdministrativeMetadata.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAdministrativeMetadata.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAuthor.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAuthor.cs rename sdk/healthinsights/{Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.Serialization.cs => Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContent.Serialization.cs} (59%) create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContent.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContentSourceType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Encounter.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Encounter.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/EncounterClass.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4CodeableConcept.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4CodeableConcept.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Coding.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Coding.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Element.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Element.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extendible.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extendible.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extension.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extension.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Identifier.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Identifier.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Meta.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Meta.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Period.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Period.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Quantity.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Quantity.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Range.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Range.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Ratio.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Ratio.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Reference.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Reference.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Resource.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Resource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4SampledData.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4SampledData.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/HealthInsightsPatientTimelineClientBuilderExtensions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/HealthInsightsPatientTimelineModelFactory.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDetails.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDetails.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDocument.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDocument.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientRecord.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientRecord.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientSex.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineClient.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineClientOptions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineData.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineData.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineInferenceResult.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineInferenceResult.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineModelConfiguration.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineModelConfiguration.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelinePatientResult.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelinePatientResult.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/SpecialtyType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/TimePeriod.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/TimePeriod.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Properties/AssemblyInfo.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tests/Azure.Health.Insights.PatientTimeline.Tests.csproj create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tests/Generated/Samples/Samples_PatientTimelineClient.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tsp-location.yaml create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/Azure.Health.Insights.RadiologyInsights.sln create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/CHANGELOG.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/Directory.Build.props create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.md create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Azure.Health.Insights.RadiologyInsights.csproj create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ClinicalDocumentType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Docs/RadiologyInsightsClient.xml create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAdministrativeMetadata.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAdministrativeMetadata.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAuthor.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAuthor.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContent.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContent.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContentSourceType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Encounter.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Encounter.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/EncounterClass.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Annotation.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Annotation.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4CodeableConcept.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4CodeableConcept.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Coding.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Coding.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4DomainResource.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4DomainResource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Element.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Element.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extendible.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extendible.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extension.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extension.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Identifier.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Identifier.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Meta.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Meta.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Narrative.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Narrative.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Observation.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Observation.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationComponent.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationComponent.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationReferenceRange.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationReferenceRange.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Period.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Period.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Quantity.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Quantity.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Range.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Range.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Ratio.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Ratio.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Reference.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Reference.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Resource.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Resource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4SampledData.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4SampledData.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FindingOptions.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FindingOptions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FollowupRecommendationOptions.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FollowupRecommendationOptions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/GenericProcedureRecommendation.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/GenericProcedureRecommendation.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/HealthInsightsRadiologyInsightsClientBuilderExtensions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/HealthInsightsRadiologyInsightsModelFactory.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedure.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedure.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedureRecommendation.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedureRecommendation.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ObservationStatusCodeType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDetails.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDetails.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDocument.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDocument.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientRecord.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientRecord.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientSex.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ProcedureRecommendation.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ProcedureRecommendation.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyCodeWithTypes.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyCodeWithTypes.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsClient.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsClientOptions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsData.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsData.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceOptions.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceOptions.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceResult.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceResult.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsModelConfiguration.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsModelConfiguration.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsPatientResult.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsPatientResult.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/SpecialtyType.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/TimePeriod.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/TimePeriod.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownFhirR4DomainResource.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownFhirR4DomainResource.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownProcedureRecommendation.Serialization.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownProcedureRecommendation.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Properties/AssemblyInfo.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tests/Azure.Health.Insights.RadiologyInsights.Tests.csproj create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tests/Generated/Samples/Samples_RadiologyInsightsClient.cs create mode 100644 sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tsp-location.yaml 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 index 027353afb4d86..7b05656ecd858 100644 --- 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 @@ -7,25 +7,25 @@ public CancerProfilingClient(System.Uri endpoint, Azure.AzureKeyCredential crede 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, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation InferCancerProfile(Azure.WaitUntil waitUntil, Azure.Health.Insights.CancerProfiling.OncoPhenotypeData oncoPhenotypeData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation InferCancerProfile(Azure.WaitUntil waitUntil, Azure.Health.Insights.CancerProfiling.OncoPhenotypeData oncoPhenotypeData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> InferCancerProfileAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> InferCancerProfileAsync(Azure.WaitUntil waitUntil, Azure.Health.Insights.CancerProfiling.OncoPhenotypeData oncoPhenotypeData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InferCancerProfileAsync(Azure.WaitUntil waitUntil, Azure.Health.Insights.CancerProfiling.OncoPhenotypeData oncoPhenotypeData, 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 CancerProfilingClientOptions(Azure.Health.Insights.CancerProfiling.CancerProfilingClientOptions.ServiceVersion version = Azure.Health.Insights.CancerProfiling.CancerProfilingClientOptions.ServiceVersion.V2023_09_01_Preview) { } public enum ServiceVersion { - V2023_03_01_Preview = 1, + V2023_09_01_Preview = 1, } } public partial class ClinicalCodedElement : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - 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 { } } + internal ClinicalCodedElement() { } + public string Code { get { throw null; } } + public string Name { get { throw null; } } + public string System { get { throw null; } } + public string Value { get { throw null; } } Azure.Health.Insights.CancerProfiling.ClinicalCodedElement System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Insights.CancerProfiling.ClinicalCodedElement System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -41,11 +41,11 @@ public ClinicalCodedElement(string system, string code) { } 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 PathologyReport { 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 static Azure.Health.Insights.CancerProfiling.ClinicalDocumentType RadiologyReport { 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; } @@ -69,6 +69,28 @@ internal ClinicalNoteEvidence() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DocumentAdministrativeMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentAdministrativeMetadata() { } + public string EncounterId { get { throw null; } set { } } + public System.Collections.Generic.IList OrderedProcedures { get { throw null; } } + Azure.Health.Insights.CancerProfiling.DocumentAdministrativeMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.DocumentAdministrativeMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentAuthor : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentAuthor() { } + public string FullName { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.DocumentAuthor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.DocumentAuthor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DocumentContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DocumentContent(Azure.Health.Insights.CancerProfiling.DocumentContentSourceType sourceType, string value) { } @@ -118,15 +140,253 @@ public DocumentContent(Azure.Health.Insights.CancerProfiling.DocumentContentSour 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 Encounter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Encounter(string id) { } + public Azure.Health.Insights.CancerProfiling.EncounterClass? Class { get { throw null; } set { } } + public string Id { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.TimePeriod Period { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.Encounter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.Encounter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EncounterClass : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EncounterClass(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.EncounterClass Ambulatory { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.EncounterClass Emergency { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.EncounterClass HealthHome { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.EncounterClass InPatient { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.EncounterClass Observation { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.EncounterClass Virtual { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.EncounterClass 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.EncounterClass left, Azure.Health.Insights.CancerProfiling.EncounterClass right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.EncounterClass (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.EncounterClass left, Azure.Health.Insights.CancerProfiling.EncounterClass right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FhirR4CodeableConcept : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4CodeableConcept() { } + public System.Collections.Generic.IList Coding { get { throw null; } } + public string Text { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4CodeableConcept System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4CodeableConcept System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Coding : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Coding() { } + public string Code { get { throw null; } set { } } + public string Display { get { throw null; } set { } } + public string System { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Coding System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Coding System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Element : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FhirR4Element() { } + public System.Collections.Generic.IReadOnlyList Extension { get { throw null; } } + public string Id { get { throw null; } } + Azure.Health.Insights.CancerProfiling.FhirR4Element System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Element System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Extendible : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Extendible() { } + public Azure.Health.Insights.CancerProfiling.FhirR4CodeableConcept Code { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList Extension { get { throw null; } } + Azure.Health.Insights.CancerProfiling.FhirR4Extendible System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Extendible System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Extension : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Extension(string url) { } + public string Url { get { throw null; } } + public bool? ValueBoolean { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4CodeableConcept ValueCodeableConcept { get { throw null; } set { } } + public string ValueDateTime { get { throw null; } set { } } + public int? ValueInteger { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Period ValuePeriod { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Quantity ValueQuantity { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Range ValueRange { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Ratio ValueRatio { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Reference ValueReference { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4SampledData ValueSampledData { get { throw null; } set { } } + public string ValueString { get { throw null; } set { } } + public System.TimeSpan? ValueTime { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Extension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Extension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Identifier : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Identifier() { } + public Azure.Health.Insights.CancerProfiling.FhirR4Reference Assigner { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Period Period { get { throw null; } set { } } + public string System { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4CodeableConcept Type { get { throw null; } set { } } + public string Use { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Identifier System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Identifier System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Meta : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Meta() { } + public string LastUpdated { get { throw null; } set { } } + public System.Collections.Generic.IList Profile { get { throw null; } } + public System.Collections.Generic.IList Security { get { throw null; } } + public string Source { get { throw null; } set { } } + public System.Collections.Generic.IList Tag { get { throw null; } } + public string VersionId { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Meta System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Meta System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Period : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Period() { } + public string End { get { throw null; } set { } } + public string Start { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Period System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Period System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Quantity : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Quantity() { } + public string Code { get { throw null; } set { } } + public string Comparator { get { throw null; } set { } } + public string System { get { throw null; } set { } } + public string Unit { get { throw null; } set { } } + public double? Value { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Quantity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Quantity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Range : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Range() { } + public Azure.Health.Insights.CancerProfiling.FhirR4Quantity High { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Quantity Low { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Range System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Range System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Ratio : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Ratio() { } + public Azure.Health.Insights.CancerProfiling.FhirR4Quantity Denominator { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Quantity Numerator { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Ratio System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Ratio System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Reference : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Reference() { } + public string Display { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Identifier Identifier { get { throw null; } set { } } + public string Reference { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4Reference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Reference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Resource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Resource(string resourceType) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public string Id { get { throw null; } set { } } + public string ImplicitRules { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Meta Meta { get { throw null; } set { } } + public string ResourceType { get { throw null; } } + Azure.Health.Insights.CancerProfiling.FhirR4Resource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4Resource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4SampledData : Azure.Health.Insights.CancerProfiling.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4SampledData(Azure.Health.Insights.CancerProfiling.FhirR4Quantity origin, double period, int dimensions) { } + public string Data { get { throw null; } set { } } + public int Dimensions { get { throw null; } } + public double? Factor { get { throw null; } set { } } + public double? LowerLimit { get { throw null; } set { } } + public Azure.Health.Insights.CancerProfiling.FhirR4Quantity Origin { get { throw null; } } + public double Period { get { throw null; } } + public double? UpperLimit { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.FhirR4SampledData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.FhirR4SampledData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class HealthInsightsCancerProfilingModelFactory { + public static Azure.Health.Insights.CancerProfiling.ClinicalCodedElement ClinicalCodedElement(string system = null, string code = null, string name = null, string value = null) { throw null; } public static Azure.Health.Insights.CancerProfiling.ClinicalNoteEvidence ClinicalNoteEvidence(string id = null, string text = null, int offset = 0, int length = 0) { throw null; } + public static Azure.Health.Insights.CancerProfiling.Encounter Encounter(string id = null, Azure.Health.Insights.CancerProfiling.TimePeriod period = null, Azure.Health.Insights.CancerProfiling.EncounterClass? @class = default(Azure.Health.Insights.CancerProfiling.EncounterClass?)) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4CodeableConcept FhirR4CodeableConcept(string id = null, System.Collections.Generic.IEnumerable extension = null, System.Collections.Generic.IEnumerable coding = null, string text = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Coding FhirR4Coding(string id = null, System.Collections.Generic.IEnumerable extension = null, string system = null, string version = null, string code = null, string display = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Element FhirR4Element(string id = null, System.Collections.Generic.IEnumerable extension = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Extension FhirR4Extension(string id = null, System.Collections.Generic.IEnumerable extension = null, string url = null, Azure.Health.Insights.CancerProfiling.FhirR4Quantity valueQuantity = null, Azure.Health.Insights.CancerProfiling.FhirR4CodeableConcept valueCodeableConcept = null, string valueString = null, bool? valueBoolean = default(bool?), int? valueInteger = default(int?), Azure.Health.Insights.CancerProfiling.FhirR4Range valueRange = null, Azure.Health.Insights.CancerProfiling.FhirR4Ratio valueRatio = null, Azure.Health.Insights.CancerProfiling.FhirR4SampledData valueSampledData = null, System.TimeSpan? valueTime = default(System.TimeSpan?), string valueDateTime = null, Azure.Health.Insights.CancerProfiling.FhirR4Period valuePeriod = null, Azure.Health.Insights.CancerProfiling.FhirR4Reference valueReference = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Identifier FhirR4Identifier(string id = null, System.Collections.Generic.IEnumerable extension = null, string use = null, Azure.Health.Insights.CancerProfiling.FhirR4CodeableConcept type = null, string system = null, string value = null, Azure.Health.Insights.CancerProfiling.FhirR4Period period = null, Azure.Health.Insights.CancerProfiling.FhirR4Reference assigner = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Period FhirR4Period(string id = null, System.Collections.Generic.IEnumerable extension = null, string start = null, string end = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Quantity FhirR4Quantity(string id = null, System.Collections.Generic.IEnumerable extension = null, double? value = default(double?), string comparator = null, string unit = null, string system = null, string code = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Range FhirR4Range(string id = null, System.Collections.Generic.IEnumerable extension = null, Azure.Health.Insights.CancerProfiling.FhirR4Quantity low = null, Azure.Health.Insights.CancerProfiling.FhirR4Quantity high = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Ratio FhirR4Ratio(string id = null, System.Collections.Generic.IEnumerable extension = null, Azure.Health.Insights.CancerProfiling.FhirR4Quantity numerator = null, Azure.Health.Insights.CancerProfiling.FhirR4Quantity denominator = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Reference FhirR4Reference(string id = null, System.Collections.Generic.IEnumerable extension = null, string reference = null, string type = null, Azure.Health.Insights.CancerProfiling.FhirR4Identifier identifier = null, string display = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4Resource FhirR4Resource(string resourceType = null, string id = null, Azure.Health.Insights.CancerProfiling.FhirR4Meta meta = null, string implicitRules = null, string language = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.FhirR4SampledData FhirR4SampledData(string id = null, System.Collections.Generic.IEnumerable extension = null, Azure.Health.Insights.CancerProfiling.FhirR4Quantity origin = null, double period = 0, double? factor = default(double?), double? lowerLimit = default(double?), double? upperLimit = default(double?), int dimensions = 0, string data = null) { throw null; } public static Azure.Health.Insights.CancerProfiling.InferenceEvidence InferenceEvidence(Azure.Health.Insights.CancerProfiling.ClinicalNoteEvidence patientDataEvidence = null, Azure.Health.Insights.CancerProfiling.ClinicalCodedElement patientInfoEvidence = null, float? importance = default(float?)) { throw null; } public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInference OncoPhenotypeInference(Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType type = default(Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceType), string value = null, string description = null, float? confidenceScore = default(float?), System.Collections.Generic.IEnumerable evidence = null, string caseId = null) { throw null; } - public static Azure.Health.Insights.CancerProfiling.OncoPhenotypePatientResult OncoPhenotypePatientResult(string id = null, System.Collections.Generic.IEnumerable inferences = null) { throw null; } - public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeResults OncoPhenotypeResults(System.Collections.Generic.IEnumerable patients = null, string modelVersion = null) { throw null; } - public static Azure.Health.Insights.CancerProfiling.PatientDocument PatientDocument(Azure.Health.Insights.CancerProfiling.DocumentType type = default(Azure.Health.Insights.CancerProfiling.DocumentType), Azure.Health.Insights.CancerProfiling.ClinicalDocumentType? clinicalType = default(Azure.Health.Insights.CancerProfiling.ClinicalDocumentType?), string id = null, string language = null, System.DateTimeOffset? createdDateTime = default(System.DateTimeOffset?), Azure.Health.Insights.CancerProfiling.DocumentContent content = null) { throw null; } - public static Azure.Health.Insights.CancerProfiling.PatientRecord PatientRecord(string id = null, Azure.Health.Insights.CancerProfiling.PatientInfo info = null, System.Collections.Generic.IEnumerable data = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceResult OncoPhenotypeInferenceResult(System.Collections.Generic.IEnumerable patientResults = null, string modelVersion = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.OncoPhenotypePatientResult OncoPhenotypePatientResult(string patientId = null, System.Collections.Generic.IEnumerable inferences = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.PatientDocument PatientDocument(Azure.Health.Insights.CancerProfiling.DocumentType type = default(Azure.Health.Insights.CancerProfiling.DocumentType), Azure.Health.Insights.CancerProfiling.ClinicalDocumentType? clinicalType = default(Azure.Health.Insights.CancerProfiling.ClinicalDocumentType?), string id = null, string language = null, System.DateTimeOffset? createdDateTime = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable authors = null, Azure.Health.Insights.CancerProfiling.SpecialtyType? specialtyType = default(Azure.Health.Insights.CancerProfiling.SpecialtyType?), Azure.Health.Insights.CancerProfiling.DocumentAdministrativeMetadata administrativeMetadata = null, Azure.Health.Insights.CancerProfiling.DocumentContent content = null) { throw null; } + public static Azure.Health.Insights.CancerProfiling.PatientRecord PatientRecord(string id = null, Azure.Health.Insights.CancerProfiling.PatientDetails info = null, System.Collections.Generic.IEnumerable encounters = null, System.Collections.Generic.IEnumerable patientDocuments = null) { throw null; } } public partial class InferenceEvidence : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -166,6 +426,17 @@ internal OncoPhenotypeInference() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class OncoPhenotypeInferenceResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OncoPhenotypeInferenceResult() { } + public string ModelVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PatientResults { get { throw null; } } + Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.OncoPhenotypeInferenceResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct OncoPhenotypeInferenceType : System.IEquatable { @@ -175,6 +446,7 @@ internal OncoPhenotypeInference() { } 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 DiagnosisDate { 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; } } @@ -206,33 +478,37 @@ public OncoPhenotypeModelConfiguration() { } public partial class OncoPhenotypePatientResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal OncoPhenotypePatientResult() { } - public string Id { get { throw null; } } public System.Collections.Generic.IReadOnlyList Inferences { get { throw null; } } + public string PatientId { get { throw null; } } Azure.Health.Insights.CancerProfiling.OncoPhenotypePatientResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Insights.CancerProfiling.OncoPhenotypePatientResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class OncoPhenotypeResults : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PatientDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal OncoPhenotypeResults() { } - public string ModelVersion { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Patients { get { throw null; } } - Azure.Health.Insights.CancerProfiling.OncoPhenotypeResults System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.CancerProfiling.OncoPhenotypeResults System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public PatientDetails() { } + public System.DateTimeOffset? BirthDate { get { throw null; } set { } } + public System.Collections.Generic.IList ClinicalInfo { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.PatientSex? Sex { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.PatientDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.PatientDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class PatientDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PatientDocument(Azure.Health.Insights.CancerProfiling.DocumentType type, string id, Azure.Health.Insights.CancerProfiling.DocumentContent content) { } + public Azure.Health.Insights.CancerProfiling.DocumentAdministrativeMetadata AdministrativeMetadata { get { throw null; } set { } } + public System.Collections.Generic.IList Authors { get { throw null; } } 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.SpecialtyType? SpecialtyType { get { throw null; } set { } } public Azure.Health.Insights.CancerProfiling.DocumentType Type { get { throw null; } } Azure.Health.Insights.CancerProfiling.PatientDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -240,48 +516,66 @@ public PatientDocument(Azure.Health.Insights.CancerProfiling.DocumentType type, string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class PatientInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PatientRecord : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - 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 { } } - Azure.Health.Insights.CancerProfiling.PatientInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.CancerProfiling.PatientInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public PatientRecord(string id) { } + public System.Collections.Generic.IList Encounters { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Health.Insights.CancerProfiling.PatientDetails Info { get { throw null; } set { } } + public System.Collections.Generic.IList PatientDocuments { get { throw null; } } + Azure.Health.Insights.CancerProfiling.PatientRecord System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.PatientRecord System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct PatientInfoSex : System.IEquatable + public readonly partial struct PatientSex : 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; } + public PatientSex(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.PatientSex Female { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.PatientSex Male { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.PatientSex Unspecified { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.PatientSex 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 static bool operator ==(Azure.Health.Insights.CancerProfiling.PatientSex left, Azure.Health.Insights.CancerProfiling.PatientSex right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.PatientSex (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.PatientSex left, Azure.Health.Insights.CancerProfiling.PatientSex right) { throw null; } public override string ToString() { throw null; } } - public partial class PatientRecord : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SpecialtyType : System.IEquatable { - 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 { } } - Azure.Health.Insights.CancerProfiling.PatientRecord System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.CancerProfiling.PatientRecord System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SpecialtyType(string value) { throw null; } + public static Azure.Health.Insights.CancerProfiling.SpecialtyType Pathology { get { throw null; } } + public static Azure.Health.Insights.CancerProfiling.SpecialtyType Radiology { get { throw null; } } + public bool Equals(Azure.Health.Insights.CancerProfiling.SpecialtyType 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.SpecialtyType left, Azure.Health.Insights.CancerProfiling.SpecialtyType right) { throw null; } + public static implicit operator Azure.Health.Insights.CancerProfiling.SpecialtyType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.CancerProfiling.SpecialtyType left, Azure.Health.Insights.CancerProfiling.SpecialtyType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TimePeriod : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TimePeriod() { } + public System.DateTimeOffset? End { get { throw null; } set { } } + public System.DateTimeOffset? Start { get { throw null; } set { } } + Azure.Health.Insights.CancerProfiling.TimePeriod System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.CancerProfiling.TimePeriod System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } } namespace Microsoft.Extensions.Azure diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs index 2181bb4c29fd6..78718b901b5c6 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs @@ -69,14 +69,14 @@ public CancerProfilingClient(Uri endpoint, AzureKeyCredential credential, Cancer /// is null. /// Creates an Onco Phenotype job with the given request body. /// - public virtual async Task> InferCancerProfileAsync(WaitUntil waitUntil, OncoPhenotypeData oncoPhenotypeData, CancellationToken cancellationToken = default) + public virtual async Task> InferCancerProfileAsync(WaitUntil waitUntil, OncoPhenotypeData oncoPhenotypeData, CancellationToken cancellationToken = default) { Argument.AssertNotNull(oncoPhenotypeData, nameof(oncoPhenotypeData)); RequestContext context = FromCancellationToken(cancellationToken); using RequestContent content = oncoPhenotypeData.ToRequestContent(); Operation response = await InferCancerProfileAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchOncoPhenotypeResultsFromOncoPhenotypeResult, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile"); + return ProtocolOperationHelpers.Convert(response, FetchOncoPhenotypeInferenceResultFromOncoPhenotypeResult, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile"); } /// Create Onco Phenotype job. @@ -86,14 +86,14 @@ public virtual async Task> InferCancerProfileAsy /// is null. /// Creates an Onco Phenotype job with the given request body. /// - public virtual Operation InferCancerProfile(WaitUntil waitUntil, OncoPhenotypeData oncoPhenotypeData, CancellationToken cancellationToken = default) + public virtual Operation InferCancerProfile(WaitUntil waitUntil, OncoPhenotypeData oncoPhenotypeData, CancellationToken cancellationToken = default) { Argument.AssertNotNull(oncoPhenotypeData, nameof(oncoPhenotypeData)); RequestContext context = FromCancellationToken(cancellationToken); using RequestContent content = oncoPhenotypeData.ToRequestContent(); Operation response = InferCancerProfile(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, FetchOncoPhenotypeResultsFromOncoPhenotypeResult, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile"); + return ProtocolOperationHelpers.Convert(response, FetchOncoPhenotypeInferenceResultFromOncoPhenotypeResult, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile"); } /// @@ -178,13 +178,13 @@ public virtual Operation InferCancerProfile(WaitUntil waitUntil, Req internal HttpMessage CreateInferCancerProfileRequest(RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(context, ResponseClassifier200202); + var message = _pipeline.CreateMessage(context, ResponseClassifier202); 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.AppendRaw("/health-insights", false); + uri.AppendPath("/onco-phenotype/jobs", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -206,13 +206,13 @@ internal static RequestContext FromCancellationToken(CancellationToken cancellat return new RequestContext() { CancellationToken = cancellationToken }; } - private static ResponseClassifier _responseClassifier200202; - private static ResponseClassifier ResponseClassifier200202 => _responseClassifier200202 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 202 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); - private OncoPhenotypeResults FetchOncoPhenotypeResultsFromOncoPhenotypeResult(Response response) + private OncoPhenotypeInferenceResult FetchOncoPhenotypeInferenceResultFromOncoPhenotypeResult(Response response) { - var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("results"); - return OncoPhenotypeResults.DeserializeOncoPhenotypeResults(resultJsonElement); + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return OncoPhenotypeInferenceResult.DeserializeOncoPhenotypeInferenceResult(resultJsonElement); } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClientOptions.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClientOptions.cs index 689615bab2c89..10105c0d0eeac 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClientOptions.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClientOptions.cs @@ -13,13 +13,13 @@ namespace Azure.Health.Insights.CancerProfiling /// Client options for CancerProfilingClient. public partial class CancerProfilingClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2023_03_01_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2023_09_01_Preview; /// The version of the service to use. public enum ServiceVersion { - /// Service version "2023-03-01-preview". - V2023_03_01_Preview = 1, + /// Service version "2023-09-01-preview". + V2023_09_01_Preview = 1, } internal string Version { get; } @@ -29,7 +29,7 @@ public CancerProfilingClientOptions(ServiceVersion version = LatestVersion) { Version = version switch { - ServiceVersion.V2023_03_01_Preview => "2023-03-01-preview", + ServiceVersion.V2023_09_01_Preview => "2023-09-01-preview", _ => throw new NotSupportedException() }; } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.cs index 077ca4b455555..a1c8cb32bd33b 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalCodedElement.cs @@ -50,7 +50,7 @@ public partial class 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) + internal ClinicalCodedElement(string system, string code) { Argument.AssertNotNull(system, nameof(system)); Argument.AssertNotNull(code, nameof(code)); @@ -80,12 +80,12 @@ internal ClinicalCodedElement() } /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. - public string System { get; set; } + public string System { get; } /// The code within the given clinical coding system. - public string Code { get; set; } + public string Code { get; } /// The name of this coded concept in the coding system. - public string Name { get; set; } + public string Name { get; } /// A value associated with the code within the given clinical coding system. - public string Value { get; set; } + public string Value { get; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalDocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalDocumentType.cs index 7bfe9c484b2a8..5b5092b656223 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalDocumentType.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/ClinicalDocumentType.cs @@ -25,11 +25,11 @@ public ClinicalDocumentType(string value) private const string ConsultationValue = "consultation"; private const string DischargeSummaryValue = "dischargeSummary"; private const string HistoryAndPhysicalValue = "historyAndPhysical"; + private const string RadiologyReportValue = "radiologyReport"; 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"; + private const string PathologyReportValue = "pathologyReport"; /// consultation. public static ClinicalDocumentType Consultation { get; } = new ClinicalDocumentType(ConsultationValue); @@ -37,16 +37,16 @@ public ClinicalDocumentType(string value) public static ClinicalDocumentType DischargeSummary { get; } = new ClinicalDocumentType(DischargeSummaryValue); /// historyAndPhysical. public static ClinicalDocumentType HistoryAndPhysical { get; } = new ClinicalDocumentType(HistoryAndPhysicalValue); + /// radiologyReport. + public static ClinicalDocumentType RadiologyReport { get; } = new ClinicalDocumentType(RadiologyReportValue); /// 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); + /// pathologyReport. + public static ClinicalDocumentType PathologyReport { get; } = new ClinicalDocumentType(PathologyReportValue); /// 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. 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 index 9415eb65542cf..c3571f78a9a99 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Docs/CancerProfilingClient.xml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Docs/CancerProfilingClient.xml @@ -13,8 +13,8 @@ OncoPhenotypeData oncoPhenotypeData = new OncoPhenotypeData(new PatientRecord[] { new PatientRecord("") }); -Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); -OncoPhenotypeResults responseData = operation.Value; +Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); +OncoPhenotypeInferenceResult responseData = operation.Value; ]]> This sample shows how to call InferCancerProfileAsync with all parameters. ") { - Info = new PatientInfo + Info = new PatientDetails { - Sex = PatientInfoSex.Female, + Sex = PatientSex.Female, BirthDate = DateTimeOffset.Parse("2022-05-10"), - ClinicalInfo = {new ClinicalCodedElement("", "") + ClinicalInfo = {new FhirR4Resource("") { - Name = "", - Value = "", + Id = "", + Meta = new FhirR4Meta + { + VersionId = "", + LastUpdated = "", + Source = "", + Profile = {""}, + Security = {new FhirR4Coding + { + System = "", + Version = "", + Code = "", + Display = "", + }}, + Tag = {default}, + }, + ImplicitRules = "", + Language = "", }}, }, - Data = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) + Encounters = {new Encounter("") + { + Period = new TimePeriod + { + Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + }, + Class = EncounterClass.InPatient, + }}, + PatientDocuments = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) { ClinicalType = ClinicalDocumentType.Consultation, Language = "", CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + Authors = {new DocumentAuthor + { + Id = "", + FullName = "", + }}, + SpecialtyType = SpecialtyType.Pathology, + AdministrativeMetadata = new DocumentAdministrativeMetadata + { + OrderedProcedures = {new FhirR4Extendible + { + Extension = {default}, + Code = default, + Description = "", + }}, + EncounterId = "", + }, }}, } }) @@ -53,8 +94,8 @@ OncoPhenotypeData oncoPhenotypeData = new OncoPhenotypeData(new PatientRecord[] CheckForCancerCase = true, }, }; -Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); -OncoPhenotypeResults responseData = operation.Value; +Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); +OncoPhenotypeInferenceResult responseData = operation.Value; ]]> @@ -69,8 +110,8 @@ OncoPhenotypeData oncoPhenotypeData = new OncoPhenotypeData(new PatientRecord[] { new PatientRecord("") }); -Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); -OncoPhenotypeResults responseData = operation.Value; +Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); +OncoPhenotypeInferenceResult responseData = operation.Value; ]]> This sample shows how to call InferCancerProfile with all parameters. ") { - Info = new PatientInfo + Info = new PatientDetails { - Sex = PatientInfoSex.Female, + Sex = PatientSex.Female, BirthDate = DateTimeOffset.Parse("2022-05-10"), - ClinicalInfo = {new ClinicalCodedElement("", "") + ClinicalInfo = {new FhirR4Resource("") { - Name = "", - Value = "", + Id = "", + Meta = new FhirR4Meta + { + VersionId = "", + LastUpdated = "", + Source = "", + Profile = {""}, + Security = {new FhirR4Coding + { + System = "", + Version = "", + Code = "", + Display = "", + }}, + Tag = {default}, + }, + ImplicitRules = "", + Language = "", }}, }, - Data = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) + Encounters = {new Encounter("") + { + Period = new TimePeriod + { + Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + }, + Class = EncounterClass.InPatient, + }}, + PatientDocuments = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) { ClinicalType = ClinicalDocumentType.Consultation, Language = "", CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + Authors = {new DocumentAuthor + { + Id = "", + FullName = "", + }}, + SpecialtyType = SpecialtyType.Pathology, + AdministrativeMetadata = new DocumentAdministrativeMetadata + { + OrderedProcedures = {new FhirR4Extendible + { + Extension = {default}, + Code = default, + Description = "", + }}, + EncounterId = "", + }, }}, } }) @@ -109,8 +191,8 @@ OncoPhenotypeData oncoPhenotypeData = new OncoPhenotypeData(new PatientRecord[] CheckForCancerCase = true, }, }; -Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); -OncoPhenotypeResults responseData = operation.Value; +Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); +OncoPhenotypeInferenceResult responseData = operation.Value; ]]> @@ -135,9 +217,9 @@ Operation operation = await client.InferCancerProfileAsync(WaitUntil BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); ]]> This sample shows how to call InferCancerProfileAsync with all parameters and request content and parse the result. @@ -161,14 +243,157 @@ using RequestContent content = RequestContent.Create(new { new { - system = "", - code = "", - name = "", - value = "", + resourceType = "", + id = "", + meta = new + { + versionId = "", + lastUpdated = "", + source = "", + profile = new object[] + { + "" + }, + security = new object[] + { + new + { + system = "", + version = "", + code = "", + display = "", + id = "", + extension = new object[] + { + new + { + url = "", + valueQuantity = new + { + value = 123.45, + comparator = "", + unit = "", + system = "", + code = "", + id = "", + extension = new object[] + { + null + }, + }, + valueCodeableConcept = new + { + coding = new object[] + { + null + }, + text = "", + id = "", + extension = new object[] + { + null + }, + }, + valueString = "", + valueBoolean = true, + valueInteger = 1234, + valueRange = new + { + id = "", + extension = new object[] + { + null + }, + }, + valueRatio = new + { + id = "", + extension = new object[] + { + null + }, + }, + valueSampledData = new + { + period = 123.45, + factor = 123.45, + lowerLimit = 123.45, + upperLimit = 123.45, + dimensions = 1234, + data = "", + id = "", + extension = new object[] + { + null + }, + }, + valueTime = "01:23:45", + valueDateTime = "", + valuePeriod = new + { + start = "", + end = "", + id = "", + extension = new object[] + { + null + }, + }, + valueReference = new + { + reference = "", + type = "", + identifier = new + { + use = "", + system = "", + value = "", + id = "", + extension = new object[] + { + null + }, + }, + display = "", + id = "", + extension = new object[] + { + null + }, + }, + id = "", + extension = new object[] + { + null + }, + } + }, + } + }, + tag = new object[] + { + null + }, + }, + implicitRules = "", + language = "", } }, }, - data = new object[] + encounters = new object[] + { + new Dictionary + { + ["id"] = "", + ["period"] = new + { + start = "2022-05-10T14:57:31.2311892-04:00", + end = "2022-05-10T14:57:31.2311892-04:00", + }, + ["class"] = "inpatient" + } + }, + patientDocuments = new object[] { new { @@ -177,6 +402,30 @@ using RequestContent content = RequestContent.Create(new id = "", language = "", createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + authors = new object[] + { + new + { + id = "", + fullName = "", + } + }, + specialtyType = "pathology", + administrativeMetadata = new + { + orderedProcedures = new object[] + { + new + { + extension = new object[] + { + null + }, + description = "", + } + }, + encounterId = "", + }, content = new { sourceType = "inline", @@ -201,21 +450,21 @@ Operation operation = await client.InferCancerProfileAsync(WaitUntil BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); ]]> @@ -241,9 +490,9 @@ Operation operation = client.InferCancerProfile(WaitUntil.Completed, BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); ]]> This sample shows how to call InferCancerProfile with all parameters and request content and parse the result. @@ -267,14 +516,157 @@ using RequestContent content = RequestContent.Create(new { new { - system = "", - code = "", - name = "", - value = "", + resourceType = "", + id = "", + meta = new + { + versionId = "", + lastUpdated = "", + source = "", + profile = new object[] + { + "" + }, + security = new object[] + { + new + { + system = "", + version = "", + code = "", + display = "", + id = "", + extension = new object[] + { + new + { + url = "", + valueQuantity = new + { + value = 123.45, + comparator = "", + unit = "", + system = "", + code = "", + id = "", + extension = new object[] + { + null + }, + }, + valueCodeableConcept = new + { + coding = new object[] + { + null + }, + text = "", + id = "", + extension = new object[] + { + null + }, + }, + valueString = "", + valueBoolean = true, + valueInteger = 1234, + valueRange = new + { + id = "", + extension = new object[] + { + null + }, + }, + valueRatio = new + { + id = "", + extension = new object[] + { + null + }, + }, + valueSampledData = new + { + period = 123.45, + factor = 123.45, + lowerLimit = 123.45, + upperLimit = 123.45, + dimensions = 1234, + data = "", + id = "", + extension = new object[] + { + null + }, + }, + valueTime = "01:23:45", + valueDateTime = "", + valuePeriod = new + { + start = "", + end = "", + id = "", + extension = new object[] + { + null + }, + }, + valueReference = new + { + reference = "", + type = "", + identifier = new + { + use = "", + system = "", + value = "", + id = "", + extension = new object[] + { + null + }, + }, + display = "", + id = "", + extension = new object[] + { + null + }, + }, + id = "", + extension = new object[] + { + null + }, + } + }, + } + }, + tag = new object[] + { + null + }, + }, + implicitRules = "", + language = "", } }, }, - data = new object[] + encounters = new object[] + { + new Dictionary + { + ["id"] = "", + ["period"] = new + { + start = "2022-05-10T14:57:31.2311892-04:00", + end = "2022-05-10T14:57:31.2311892-04:00", + }, + ["class"] = "inpatient" + } + }, + patientDocuments = new object[] { new { @@ -283,6 +675,30 @@ using RequestContent content = RequestContent.Create(new id = "", language = "", createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + authors = new object[] + { + new + { + id = "", + fullName = "", + } + }, + specialtyType = "pathology", + administrativeMetadata = new + { + orderedProcedures = new object[] + { + new + { + extension = new object[] + { + null + }, + description = "", + } + }, + encounterId = "", + }, content = new { sourceType = "inline", @@ -307,21 +723,21 @@ Operation operation = client.InferCancerProfile(WaitUntil.Completed, BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); ]]> diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAdministrativeMetadata.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAdministrativeMetadata.Serialization.cs new file mode 100644 index 0000000000000..e1487b6e42327 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAdministrativeMetadata.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class DocumentAdministrativeMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(OrderedProcedures)) + { + writer.WritePropertyName("orderedProcedures"u8); + writer.WriteStartArray(); + foreach (var item in OrderedProcedures) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EncounterId)) + { + writer.WritePropertyName("encounterId"u8); + writer.WriteStringValue(EncounterId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentAdministrativeMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentAdministrativeMetadata(document.RootElement, options); + } + + internal static DocumentAdministrativeMetadata DeserializeDocumentAdministrativeMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> orderedProcedures = default; + Optional encounterId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("orderedProcedures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extendible.DeserializeFhirR4Extendible(item)); + } + orderedProcedures = array; + continue; + } + if (property.NameEquals("encounterId"u8)) + { + encounterId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentAdministrativeMetadata(Optional.ToList(orderedProcedures), encounterId.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{options.Format}' format."); + } + } + + DocumentAdministrativeMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentAdministrativeMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentAdministrativeMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentAdministrativeMetadata(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/DocumentAdministrativeMetadata.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAdministrativeMetadata.cs new file mode 100644 index 0000000000000..d451587ce314c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAdministrativeMetadata.cs @@ -0,0 +1,71 @@ +// 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 +{ + /// Document administrative metadata. + public partial class DocumentAdministrativeMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DocumentAdministrativeMetadata() + { + OrderedProcedures = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of procedure information associated with the document. + /// Reference to the encounter associated with the document. + /// Keeps track of any properties unknown to the library. + internal DocumentAdministrativeMetadata(IList orderedProcedures, string encounterId, IDictionary serializedAdditionalRawData) + { + OrderedProcedures = orderedProcedures; + EncounterId = encounterId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of procedure information associated with the document. + public IList OrderedProcedures { get; } + /// Reference to the encounter associated with the document. + public string EncounterId { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAuthor.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAuthor.Serialization.cs new file mode 100644 index 0000000000000..64e8493b8419a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAuthor.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class DocumentAuthor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(FullName)) + { + writer.WritePropertyName("fullName"u8); + writer.WriteStringValue(FullName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentAuthor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentAuthor(document.RootElement, options); + } + + internal static DocumentAuthor DeserializeDocumentAuthor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional fullName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("fullName"u8)) + { + fullName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentAuthor(id.Value, fullName.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{options.Format}' format."); + } + } + + DocumentAuthor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentAuthor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentAuthor FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentAuthor(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/DocumentAuthor.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAuthor.cs new file mode 100644 index 0000000000000..59b15f861bda9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentAuthor.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; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// Document author. + public partial class DocumentAuthor + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DocumentAuthor() + { + } + + /// Initializes a new instance of . + /// author id. + /// Text representation of the full name. + /// Keeps track of any properties unknown to the library. + internal DocumentAuthor(string id, string fullName, IDictionary serializedAdditionalRawData) + { + Id = id; + FullName = fullName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// author id. + public string Id { get; set; } + /// Text representation of the full name. + public string FullName { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContentSourceType.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContentSourceType.cs index f6705b269f513..dc699c848b8bc 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContentSourceType.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/DocumentContentSourceType.cs @@ -29,9 +29,9 @@ public DocumentContentSourceType(string value) private const string InlineValue = "inline"; private const string ReferenceValue = "reference"; - /// inline. + /// The content is given as a string (for instance, text). public static DocumentContentSourceType Inline { get; } = new DocumentContentSourceType(InlineValue); - /// reference. + /// The content is given as a URI. 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); diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Encounter.Serialization.cs similarity index 54% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.Serialization.cs rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Encounter.Serialization.cs index 6c48b6c60d47e..a4ca011451ae0 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Encounter.Serialization.cs @@ -12,35 +12,33 @@ using Azure; using Azure.Core; -namespace Azure.Health.Insights.ClinicalMatching +namespace Azure.Health.Insights.CancerProfiling { - public partial class ClinicalTrialDetails : IUtf8JsonSerializable, IJsonModel + public partial class Encounter : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ClinicalTrialDetails)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(Encounter)} does not support '{format}' format."); } writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); - if (Optional.IsDefined(EligibilityCriteriaText)) + if (Optional.IsDefined(Period)) { - writer.WritePropertyName("eligibilityCriteriaText"u8); - writer.WriteStringValue(EligibilityCriteriaText); + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); } - if (Optional.IsDefined(Demographics)) + if (Optional.IsDefined(Class)) { - writer.WritePropertyName("demographics"u8); - writer.WriteObjectValue(Demographics); + writer.WritePropertyName("class"u8); + writer.WriteStringValue(Class.Value.ToString()); } - writer.WritePropertyName("metadata"u8); - writer.WriteObjectValue(Metadata); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -59,19 +57,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } - ClinicalTrialDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + Encounter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ClinicalTrialDetails)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(Encounter)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeClinicalTrialDetails(document.RootElement, options); + return DeserializeEncounter(document.RootElement, options); } - internal static ClinicalTrialDetails DeserializeClinicalTrialDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static Encounter DeserializeEncounter(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -80,9 +78,8 @@ internal static ClinicalTrialDetails DeserializeClinicalTrialDetails(JsonElement return null; } string id = default; - Optional eligibilityCriteriaText = default; - Optional demographics = default; - ClinicalTrialMetadata metadata = default; + Optional period = default; + Optional @class = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,23 +89,22 @@ internal static ClinicalTrialDetails DeserializeClinicalTrialDetails(JsonElement id = property.Value.GetString(); continue; } - if (property.NameEquals("eligibilityCriteriaText"u8)) - { - eligibilityCriteriaText = property.Value.GetString(); - continue; - } - if (property.NameEquals("demographics"u8)) + if (property.NameEquals("period"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - demographics = ClinicalTrialDemographics.DeserializeClinicalTrialDemographics(property.Value); + period = TimePeriod.DeserializeTimePeriod(property.Value); continue; } - if (property.NameEquals("metadata"u8)) + if (property.NameEquals("class"u8)) { - metadata = ClinicalTrialMetadata.DeserializeClinicalTrialMetadata(property.Value); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @class = new EncounterClass(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,46 +113,46 @@ internal static ClinicalTrialDetails DeserializeClinicalTrialDetails(JsonElement } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ClinicalTrialDetails(id, eligibilityCriteriaText.Value, demographics.Value, metadata, serializedAdditionalRawData); + return new Encounter(id, period.Value, Optional.ToNullable(@class), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ClinicalTrialDetails)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(Encounter)} does not support '{options.Format}' format."); } } - ClinicalTrialDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + Encounter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeClinicalTrialDetails(document.RootElement, options); + return DeserializeEncounter(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ClinicalTrialDetails)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(Encounter)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ClinicalTrialDetails FromResponse(Response response) + internal static Encounter FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeClinicalTrialDetails(document.RootElement); + return DeserializeEncounter(document.RootElement); } /// Convert into a Utf8JsonRequestContent. diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Encounter.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Encounter.cs new file mode 100644 index 0000000000000..e9e58da7cd3f4 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/Encounter.cs @@ -0,0 +1,90 @@ +// 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 +{ + /// visit/encounter information. + public partial class Encounter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The id of the visit. + /// is null. + public Encounter(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + } + + /// Initializes a new instance of . + /// The id of the visit. + /// + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// + /// The class of the encounter. + /// Keeps track of any properties unknown to the library. + internal Encounter(string id, TimePeriod period, EncounterClass? @class, IDictionary serializedAdditionalRawData) + { + Id = id; + Period = period; + Class = @class; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Encounter() + { + } + + /// The id of the visit. + public string Id { get; } + /// + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// + public TimePeriod Period { get; set; } + /// The class of the encounter. + public EncounterClass? Class { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/EncounterClass.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/EncounterClass.cs new file mode 100644 index 0000000000000..d7dc010de69ce --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/EncounterClass.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.CancerProfiling +{ + /// Known values codes that can be used to indicate the class of encounter (TODO://Based on FHIR value set--http://....). + public readonly partial struct EncounterClass : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EncounterClass(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InPatientValue = "inpatient"; + private const string AmbulatoryValue = "ambulatory"; + private const string ObservationValue = "observation"; + private const string EmergencyValue = "emergency"; + private const string VirtualValue = "virtual"; + private const string HealthHomeValue = "healthHome"; + + /// A patient encounter where a patient is admitted by a hospital or equivalent facility, assigned to a location where patients generally stay at least overnight and provided with room, board, and continuous nursing service. + public static EncounterClass InPatient { get; } = new EncounterClass(InPatientValue); + /// The term ambulatory usually implies that the patient has come to the location and is not assigned to a bed. Sometimes referred to as an outpatient encounter. + public static EncounterClass Ambulatory { get; } = new EncounterClass(AmbulatoryValue); + /// An encounter where the patient usually will start in different encounter, such as one in the emergency department but then transition to this type of encounter because they require a significant period of treatment and monitoring to determine whether or not their condition warrants an inpatient admission or discharge. + public static EncounterClass Observation { get; } = new EncounterClass(ObservationValue); + /// A patient encounter that takes place at a dedicated healthcare service delivery location where the patient receives immediate evaluation and treatment, provided until the patient can be discharged or responsibility for the patient's care is transferred elsewhere (for example, the patient could be admitted as an inpatient or transferred to another facility. + public static EncounterClass Emergency { get; } = new EncounterClass(EmergencyValue); + /// A patient encounter where the patient is not physically present for the encounter, such as in a telehealth encounter, phone call, or electronic communication. + public static EncounterClass Virtual { get; } = new EncounterClass(VirtualValue); + /// Healthcare encounter that takes place in the residence of the patient or a designee. + public static EncounterClass HealthHome { get; } = new EncounterClass(HealthHomeValue); + /// Determines if two values are the same. + public static bool operator ==(EncounterClass left, EncounterClass right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EncounterClass left, EncounterClass right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EncounterClass(string value) => new EncounterClass(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EncounterClass other && Equals(other); + /// + public bool Equals(EncounterClass 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/FhirR4CodeableConcept.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4CodeableConcept.Serialization.cs new file mode 100644 index 0000000000000..0d9844ee060b1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4CodeableConcept.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4CodeableConcept : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Coding)) + { + writer.WritePropertyName("coding"u8); + writer.WriteStartArray(); + foreach (var item in Coding) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4CodeableConcept IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4CodeableConcept(document.RootElement, options); + } + + internal static FhirR4CodeableConcept DeserializeFhirR4CodeableConcept(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> coding = default; + Optional text = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("coding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + coding = array; + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4CodeableConcept(id.Value, Optional.ToList(extension), serializedAdditionalRawData, Optional.ToList(coding), text.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{options.Format}' format."); + } + } + + FhirR4CodeableConcept IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4CodeableConcept(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4CodeableConcept FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4CodeableConcept(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4CodeableConcept.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4CodeableConcept.cs new file mode 100644 index 0000000000000..7f76687fd776f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4CodeableConcept.cs @@ -0,0 +1,43 @@ +// 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 +{ + /// + /// Concept - reference to a terminology or just text + /// Based on [FHIR CodeableConcept](https://www.hl7.org/fhir/R4/datatypes.html#CodeableConcept) + /// + public partial class FhirR4CodeableConcept : FhirR4Element + { + /// Initializes a new instance of . + public FhirR4CodeableConcept() + { + Coding = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Code defined by a terminology system. + /// Plain text representation of the concept. + internal FhirR4CodeableConcept(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, IList coding, string text) : base(id, extension, serializedAdditionalRawData) + { + Coding = coding; + Text = text; + } + + /// Code defined by a terminology system. + public IList Coding { get; } + /// Plain text representation of the concept. + public string Text { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Coding.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Coding.Serialization.cs new file mode 100644 index 0000000000000..25658e61374f2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Coding.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Coding : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Coding IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Coding(document.RootElement, options); + } + + internal static FhirR4Coding DeserializeFhirR4Coding(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional system = default; + Optional version = default; + Optional code = default; + Optional display = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("display"u8)) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Coding(id.Value, Optional.ToList(extension), serializedAdditionalRawData, system.Value, version.Value, code.Value, display.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{options.Format}' format."); + } + } + + FhirR4Coding IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Coding(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4Coding FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Coding(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Coding.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Coding.cs new file mode 100644 index 0000000000000..b1378535a5fd8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Coding.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; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// + /// A Coding is a representation of a defined concept using a symbol from a defined "code system". + /// Based on [FHIR Coding](https://www.hl7.org/fhir/R4/datatypes.html#Coding) + /// + public partial class FhirR4Coding : FhirR4Element + { + /// Initializes a new instance of . + public FhirR4Coding() + { + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Identity of the terminology system. + /// Version of the system - if relevant. + /// Symbol in syntax defined by the system. + /// Representation defined by the system. + internal FhirR4Coding(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, string system, string version, string code, string display) : base(id, extension, serializedAdditionalRawData) + { + System = system; + Version = version; + Code = code; + Display = display; + } + + /// Identity of the terminology system. + public string System { get; set; } + /// Version of the system - if relevant. + public string Version { get; set; } + /// Symbol in syntax defined by the system. + public string Code { get; set; } + /// Representation defined by the system. + public string Display { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Element.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Element.Serialization.cs new file mode 100644 index 0000000000000..282d6b2900fc8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Element.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Element : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Element IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Element(document.RootElement, options); + } + + internal static FhirR4Element DeserializeFhirR4Element(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Element(id.Value, Optional.ToList(extension), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{options.Format}' format."); + } + } + + FhirR4Element IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Element(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FhirR4Element FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Element(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/FhirR4Element.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Element.cs new file mode 100644 index 0000000000000..cbddd11a161e8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Element.cs @@ -0,0 +1,74 @@ +// 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 +{ + /// + /// The base definition for all elements contained inside a resource. + /// Based on [FHIR Element](https://www.hl7.org/fhir/R4/element.html) + /// + public partial class FhirR4Element + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FhirR4Element() + { + Extension = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + internal FhirR4Element(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData) + { + Id = id; + Extension = extension; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique id for inter-element referencing. + public string Id { get; } + /// Additional Content defined by implementations. + public IReadOnlyList Extension { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extendible.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extendible.Serialization.cs new file mode 100644 index 0000000000000..98fc6d5767274 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extendible.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Extendible : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteObjectValue(Code); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Extendible IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Extendible(document.RootElement, options); + } + + internal static FhirR4Extendible DeserializeFhirR4Extendible(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> extension = default; + Optional code = default; + Optional description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Extendible(Optional.ToList(extension), code.Value, description.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{options.Format}' format."); + } + } + + FhirR4Extendible IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Extendible(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FhirR4Extendible FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Extendible(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/FhirR4Extendible.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extendible.cs new file mode 100644 index 0000000000000..44d2ce82734af --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extendible.cs @@ -0,0 +1,75 @@ +// 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 +{ + /// Procedure information. + public partial class FhirR4Extendible + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FhirR4Extendible() + { + Extension = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Additional Content defined by implementations. + /// Procedure code. + /// Procedure description. + /// Keeps track of any properties unknown to the library. + internal FhirR4Extendible(IList extension, FhirR4CodeableConcept code, string description, IDictionary serializedAdditionalRawData) + { + Extension = extension; + Code = code; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Additional Content defined by implementations. + public IList Extension { get; } + /// Procedure code. + public FhirR4CodeableConcept Code { get; set; } + /// Procedure description. + public string Description { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extension.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extension.Serialization.cs new file mode 100644 index 0000000000000..13e51bf1d91fc --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extension.Serialization.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Extension : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url); + if (Optional.IsDefined(ValueQuantity)) + { + writer.WritePropertyName("valueQuantity"u8); + writer.WriteObjectValue(ValueQuantity); + } + if (Optional.IsDefined(ValueCodeableConcept)) + { + writer.WritePropertyName("valueCodeableConcept"u8); + writer.WriteObjectValue(ValueCodeableConcept); + } + if (Optional.IsDefined(ValueString)) + { + writer.WritePropertyName("valueString"u8); + writer.WriteStringValue(ValueString); + } + if (Optional.IsDefined(ValueBoolean)) + { + writer.WritePropertyName("valueBoolean"u8); + writer.WriteBooleanValue(ValueBoolean.Value); + } + if (Optional.IsDefined(ValueInteger)) + { + writer.WritePropertyName("valueInteger"u8); + writer.WriteNumberValue(ValueInteger.Value); + } + if (Optional.IsDefined(ValueRange)) + { + writer.WritePropertyName("valueRange"u8); + writer.WriteObjectValue(ValueRange); + } + if (Optional.IsDefined(ValueRatio)) + { + writer.WritePropertyName("valueRatio"u8); + writer.WriteObjectValue(ValueRatio); + } + if (Optional.IsDefined(ValueSampledData)) + { + writer.WritePropertyName("valueSampledData"u8); + writer.WriteObjectValue(ValueSampledData); + } + if (Optional.IsDefined(ValueTime)) + { + writer.WritePropertyName("valueTime"u8); + writer.WriteStringValue(ValueTime.Value, "T"); + } + if (Optional.IsDefined(ValueDateTime)) + { + writer.WritePropertyName("valueDateTime"u8); + writer.WriteStringValue(ValueDateTime); + } + if (Optional.IsDefined(ValuePeriod)) + { + writer.WritePropertyName("valuePeriod"u8); + writer.WriteObjectValue(ValuePeriod); + } + if (Optional.IsDefined(ValueReference)) + { + writer.WritePropertyName("valueReference"u8); + writer.WriteObjectValue(ValueReference); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Extension IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Extension(document.RootElement, options); + } + + internal static FhirR4Extension DeserializeFhirR4Extension(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + Optional valueQuantity = default; + Optional valueCodeableConcept = default; + Optional valueString = default; + Optional valueBoolean = default; + Optional valueInteger = default; + Optional valueRange = default; + Optional valueRatio = default; + Optional valueSampledData = default; + Optional valueTime = default; + Optional valueDateTime = default; + Optional valuePeriod = default; + Optional valueReference = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueQuantity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueQuantity = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("valueCodeableConcept"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueCodeableConcept = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("valueString"u8)) + { + valueString = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueBoolean"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueBoolean = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("valueInteger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueInteger = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("valueRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRange = FhirR4Range.DeserializeFhirR4Range(property.Value); + continue; + } + if (property.NameEquals("valueRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRatio = FhirR4Ratio.DeserializeFhirR4Ratio(property.Value); + continue; + } + if (property.NameEquals("valueSampledData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueSampledData = FhirR4SampledData.DeserializeFhirR4SampledData(property.Value); + continue; + } + if (property.NameEquals("valueTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueTime = property.Value.GetTimeSpan("T"); + continue; + } + if (property.NameEquals("valueDateTime"u8)) + { + valueDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("valuePeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valuePeriod = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("valueReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueReference = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Extension(id.Value, Optional.ToList(extension), serializedAdditionalRawData, url, valueQuantity.Value, valueCodeableConcept.Value, valueString.Value, Optional.ToNullable(valueBoolean), Optional.ToNullable(valueInteger), valueRange.Value, valueRatio.Value, valueSampledData.Value, Optional.ToNullable(valueTime), valueDateTime.Value, valuePeriod.Value, valueReference.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{options.Format}' format."); + } + } + + FhirR4Extension IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Extension(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4Extension FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Extension(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extension.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extension.cs new file mode 100644 index 0000000000000..b8b6b49860003 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Extension.cs @@ -0,0 +1,96 @@ +// 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 +{ + /// + /// Base for all elements + /// Based on [FHIR Element](https://www.hl7.org/fhir/datatypes.html#Element) + /// + public partial class FhirR4Extension : FhirR4Element + { + /// Initializes a new instance of . + /// Source of the definition for the extension code - a logical name or a URL. + /// is null. + public FhirR4Extension(string url) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Source of the definition for the extension code - a logical name or a URL. + /// Value as Quantity. + /// Value as CodeableConcept. + /// Value as string. + /// Value as boolean. + /// Value as integer. + /// Value as Range. + /// Value as Ratio. + /// Value as SampledData. + /// Value as time (hh:mm:ss). + /// Value as dateTime. + /// Value as Period. + /// Value as reference. + internal FhirR4Extension(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, string url, FhirR4Quantity valueQuantity, FhirR4CodeableConcept valueCodeableConcept, string valueString, bool? valueBoolean, int? valueInteger, FhirR4Range valueRange, FhirR4Ratio valueRatio, FhirR4SampledData valueSampledData, TimeSpan? valueTime, string valueDateTime, FhirR4Period valuePeriod, FhirR4Reference valueReference) : base(id, extension, serializedAdditionalRawData) + { + Url = url; + ValueQuantity = valueQuantity; + ValueCodeableConcept = valueCodeableConcept; + ValueString = valueString; + ValueBoolean = valueBoolean; + ValueInteger = valueInteger; + ValueRange = valueRange; + ValueRatio = valueRatio; + ValueSampledData = valueSampledData; + ValueTime = valueTime; + ValueDateTime = valueDateTime; + ValuePeriod = valuePeriod; + ValueReference = valueReference; + } + + /// Initializes a new instance of for deserialization. + internal FhirR4Extension() + { + } + + /// Source of the definition for the extension code - a logical name or a URL. + public string Url { get; } + /// Value as Quantity. + public FhirR4Quantity ValueQuantity { get; set; } + /// Value as CodeableConcept. + public FhirR4CodeableConcept ValueCodeableConcept { get; set; } + /// Value as string. + public string ValueString { get; set; } + /// Value as boolean. + public bool? ValueBoolean { get; set; } + /// Value as integer. + public int? ValueInteger { get; set; } + /// Value as Range. + public FhirR4Range ValueRange { get; set; } + /// Value as Ratio. + public FhirR4Ratio ValueRatio { get; set; } + /// Value as SampledData. + public FhirR4SampledData ValueSampledData { get; set; } + /// Value as time (hh:mm:ss). + public TimeSpan? ValueTime { get; set; } + /// Value as dateTime. + public string ValueDateTime { get; set; } + /// Value as Period. + public FhirR4Period ValuePeriod { get; set; } + /// Value as reference. + public FhirR4Reference ValueReference { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Identifier.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Identifier.Serialization.cs new file mode 100644 index 0000000000000..2d7d97a3d8a10 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Identifier.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Identifier : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Use)) + { + writer.WritePropertyName("use"u8); + writer.WriteStringValue(Use); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteObjectValue(Type); + } + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(Period)) + { + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); + } + if (Optional.IsDefined(Assigner)) + { + writer.WritePropertyName("assigner"u8); + writer.WriteObjectValue(Assigner); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Identifier IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Identifier(document.RootElement, options); + } + + internal static FhirR4Identifier DeserializeFhirR4Identifier(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional use = default; + Optional type = default; + Optional system = default; + Optional value = default; + Optional period = default; + Optional assigner = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("use"u8)) + { + use = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("period"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + period = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("assigner"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assigner = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Identifier(id.Value, Optional.ToList(extension), serializedAdditionalRawData, use.Value, type.Value, system.Value, value.Value, period.Value, assigner.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{options.Format}' format."); + } + } + + FhirR4Identifier IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Identifier(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4Identifier FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Identifier(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Identifier.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Identifier.cs new file mode 100644 index 0000000000000..4b13b216aaebf --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Identifier.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// + /// An identifier intended for computation + /// Based on [FHIR Identifier](https://www.hl7.org/fhir/R4/identifier.html) + /// + public partial class FhirR4Identifier : FhirR4Element + { + /// Initializes a new instance of . + public FhirR4Identifier() + { + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// usual | official | temp | secondary | old (If known). + /// Description of identifier. + /// The namespace for the identifier value. + /// The value that is unique. + /// Time period when id is/was valid for use. + /// Organization that issued id (may be just text). + internal FhirR4Identifier(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, string use, FhirR4CodeableConcept type, string system, string value, FhirR4Period period, FhirR4Reference assigner) : base(id, extension, serializedAdditionalRawData) + { + Use = use; + Type = type; + System = system; + Value = value; + Period = period; + Assigner = assigner; + } + + /// usual | official | temp | secondary | old (If known). + public string Use { get; set; } + /// Description of identifier. + public FhirR4CodeableConcept Type { get; set; } + /// The namespace for the identifier value. + public string System { get; set; } + /// The value that is unique. + public string Value { get; set; } + /// Time period when id is/was valid for use. + public FhirR4Period Period { get; set; } + /// Organization that issued id (may be just text). + public FhirR4Reference Assigner { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Meta.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Meta.Serialization.cs new file mode 100644 index 0000000000000..78e2a95b861b8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Meta.Serialization.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Meta : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(VersionId)) + { + writer.WritePropertyName("versionId"u8); + writer.WriteStringValue(VersionId); + } + if (Optional.IsDefined(LastUpdated)) + { + writer.WritePropertyName("lastUpdated"u8); + writer.WriteStringValue(LastUpdated); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsCollectionDefined(Profile)) + { + writer.WritePropertyName("profile"u8); + writer.WriteStartArray(); + foreach (var item in Profile) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Security)) + { + writer.WritePropertyName("security"u8); + writer.WriteStartArray(); + foreach (var item in Security) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Tag)) + { + writer.WritePropertyName("tag"u8); + writer.WriteStartArray(); + foreach (var item in Tag) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Meta IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Meta(document.RootElement, options); + } + + internal static FhirR4Meta DeserializeFhirR4Meta(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional versionId = default; + Optional lastUpdated = default; + Optional source = default; + Optional> profile = default; + Optional> security = default; + Optional> tag = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("versionId"u8)) + { + versionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastUpdated"u8)) + { + lastUpdated = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("profile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + profile = array; + continue; + } + if (property.NameEquals("security"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + security = array; + continue; + } + if (property.NameEquals("tag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + tag = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Meta(versionId.Value, lastUpdated.Value, source.Value, Optional.ToList(profile), Optional.ToList(security), Optional.ToList(tag), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{options.Format}' format."); + } + } + + FhirR4Meta IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Meta(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FhirR4Meta FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Meta(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/FhirR4Meta.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Meta.cs new file mode 100644 index 0000000000000..a7099bd6fa61d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Meta.cs @@ -0,0 +1,92 @@ +// 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 +{ + /// + /// Metadata about a resource + /// Based on [FHIR Meta](https://www.hl7.org/fhir/R4/resource.html#Meta) + /// + public partial class FhirR4Meta + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FhirR4Meta() + { + Profile = new ChangeTrackingList(); + Security = new ChangeTrackingList(); + Tag = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. + /// When the resource last changed - e.g. when the version changed. + /// A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. + /// A list of profiles (references to [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). + /// Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. + /// Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. + /// Keeps track of any properties unknown to the library. + internal FhirR4Meta(string versionId, string lastUpdated, string source, IList profile, IList security, IList tag, IDictionary serializedAdditionalRawData) + { + VersionId = versionId; + LastUpdated = lastUpdated; + Source = source; + Profile = profile; + Security = security; + Tag = tag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. + public string VersionId { get; set; } + /// When the resource last changed - e.g. when the version changed. + public string LastUpdated { get; set; } + /// A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. + public string Source { get; set; } + /// A list of profiles (references to [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). + public IList Profile { get; } + /// Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. + public IList Security { get; } + /// Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. + public IList Tag { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Period.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Period.Serialization.cs new file mode 100644 index 0000000000000..7e157043821cd --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Period.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Period : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start); + } + if (Optional.IsDefined(End)) + { + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Period IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Period(document.RootElement, options); + } + + internal static FhirR4Period DeserializeFhirR4Period(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional start = default; + Optional end = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + start = property.Value.GetString(); + continue; + } + if (property.NameEquals("end"u8)) + { + end = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Period(id.Value, Optional.ToList(extension), serializedAdditionalRawData, start.Value, end.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{options.Format}' format."); + } + } + + FhirR4Period IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Period(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4Period FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Period(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Period.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Period.cs new file mode 100644 index 0000000000000..7f055c0e79c62 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Period.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; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// + /// A time period defined by a start and end date and optionally time + /// Based on [FHIR Period](https://www.hl7.org/fhir/R4/datatypes.html#Period) + /// + public partial class FhirR4Period : FhirR4Element + { + /// Initializes a new instance of . + public FhirR4Period() + { + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Starting time with inclusive boundary. + /// End time with inclusive boundary, if not ongoing. + internal FhirR4Period(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, string start, string end) : base(id, extension, serializedAdditionalRawData) + { + Start = start; + End = end; + } + + /// Starting time with inclusive boundary. + public string Start { get; set; } + /// End time with inclusive boundary, if not ongoing. + public string End { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Quantity.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Quantity.Serialization.cs new file mode 100644 index 0000000000000..aa21eca091fa5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Quantity.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Quantity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.Value); + } + if (Optional.IsDefined(Comparator)) + { + writer.WritePropertyName("comparator"u8); + writer.WriteStringValue(Comparator); + } + if (Optional.IsDefined(Unit)) + { + writer.WritePropertyName("unit"u8); + writer.WriteStringValue(Unit); + } + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Quantity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Quantity(document.RootElement, options); + } + + internal static FhirR4Quantity DeserializeFhirR4Quantity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional value = default; + Optional comparator = default; + Optional unit = default; + Optional system = default; + Optional code = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("comparator"u8)) + { + comparator = property.Value.GetString(); + continue; + } + if (property.NameEquals("unit"u8)) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Quantity(id.Value, Optional.ToList(extension), serializedAdditionalRawData, Optional.ToNullable(value), comparator.Value, unit.Value, system.Value, code.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{options.Format}' format."); + } + } + + FhirR4Quantity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Quantity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4Quantity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Quantity(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Quantity.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Quantity.cs new file mode 100644 index 0000000000000..c233089a2ed9c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Quantity.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// + /// A measured or measurable amount + /// Based on [FHIR Quantity](https://www.hl7.org/fhir/R4/datatypes.html#Quantity) + /// + public partial class FhirR4Quantity : FhirR4Element + { + /// Initializes a new instance of . + public FhirR4Quantity() + { + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Numerical value (with implicit precision). + /// < | <= | >= | > - how to understand the value. + /// Unit representation. + /// System that defines coded unit form. + /// Coded form of the unit. + internal FhirR4Quantity(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, double? value, string comparator, string unit, string system, string code) : base(id, extension, serializedAdditionalRawData) + { + Value = value; + Comparator = comparator; + Unit = unit; + System = system; + Code = code; + } + + /// Numerical value (with implicit precision). + public double? Value { get; set; } + /// < | <= | >= | > - how to understand the value. + public string Comparator { get; set; } + /// Unit representation. + public string Unit { get; set; } + /// System that defines coded unit form. + public string System { get; set; } + /// Coded form of the unit. + public string Code { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Range.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Range.Serialization.cs new file mode 100644 index 0000000000000..9d43251933d57 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Range.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Range : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Low)) + { + writer.WritePropertyName("low"u8); + writer.WriteObjectValue(Low); + } + if (Optional.IsDefined(High)) + { + writer.WritePropertyName("high"u8); + writer.WriteObjectValue(High); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Range IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Range(document.RootElement, options); + } + + internal static FhirR4Range DeserializeFhirR4Range(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional low = default; + Optional high = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("low"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + low = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("high"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + high = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Range(id.Value, Optional.ToList(extension), serializedAdditionalRawData, low.Value, high.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{options.Format}' format."); + } + } + + FhirR4Range IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Range(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4Range FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Range(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Range.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Range.cs new file mode 100644 index 0000000000000..261a7d669e5ec --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Range.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; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// + /// A set of ordered Quantities defined by a low and high limit + /// Based on [FHIR Range](https://www.hl7.org/fhir/R4/datatypes.html#Range) + /// + public partial class FhirR4Range : FhirR4Element + { + /// Initializes a new instance of . + public FhirR4Range() + { + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Low limit. + /// High limit. + internal FhirR4Range(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, FhirR4Quantity low, FhirR4Quantity high) : base(id, extension, serializedAdditionalRawData) + { + Low = low; + High = high; + } + + /// Low limit. + public FhirR4Quantity Low { get; set; } + /// High limit. + public FhirR4Quantity High { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Ratio.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Ratio.Serialization.cs new file mode 100644 index 0000000000000..ae44b2379be2e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Ratio.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Ratio : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Numerator)) + { + writer.WritePropertyName("numerator"u8); + writer.WriteObjectValue(Numerator); + } + if (Optional.IsDefined(Denominator)) + { + writer.WritePropertyName("denominator"u8); + writer.WriteObjectValue(Denominator); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Ratio IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Ratio(document.RootElement, options); + } + + internal static FhirR4Ratio DeserializeFhirR4Ratio(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional numerator = default; + Optional denominator = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numerator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numerator = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("denominator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + denominator = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Ratio(id.Value, Optional.ToList(extension), serializedAdditionalRawData, numerator.Value, denominator.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{options.Format}' format."); + } + } + + FhirR4Ratio IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Ratio(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4Ratio FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Ratio(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Ratio.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Ratio.cs new file mode 100644 index 0000000000000..988573fb81ba7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Ratio.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; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// + /// A ratio of two Quantity values - a numerator and a denominator + /// Based on [FHIR Ratio](https://www.hl7.org/fhir/R4/datatypes.html#Ratio) + /// + public partial class FhirR4Ratio : FhirR4Element + { + /// Initializes a new instance of . + public FhirR4Ratio() + { + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Numerator value. + /// Denominator value. + internal FhirR4Ratio(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, FhirR4Quantity numerator, FhirR4Quantity denominator) : base(id, extension, serializedAdditionalRawData) + { + Numerator = numerator; + Denominator = denominator; + } + + /// Numerator value. + public FhirR4Quantity Numerator { get; set; } + /// Denominator value. + public FhirR4Quantity Denominator { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Reference.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Reference.Serialization.cs new file mode 100644 index 0000000000000..92feee2d2ddd5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Reference.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Reference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Reference)) + { + writer.WritePropertyName("reference"u8); + writer.WriteStringValue(Reference); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (Optional.IsDefined(Identifier)) + { + writer.WritePropertyName("identifier"u8); + writer.WriteObjectValue(Identifier); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Reference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Reference(document.RootElement, options); + } + + internal static FhirR4Reference DeserializeFhirR4Reference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional reference = default; + Optional type = default; + Optional identifier = default; + Optional display = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reference"u8)) + { + reference = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("identifier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identifier = FhirR4Identifier.DeserializeFhirR4Identifier(property.Value); + continue; + } + if (property.NameEquals("display"u8)) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Reference(id.Value, Optional.ToList(extension), serializedAdditionalRawData, reference.Value, type.Value, identifier.Value, display.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{options.Format}' format."); + } + } + + FhirR4Reference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Reference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4Reference FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Reference(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Reference.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Reference.cs new file mode 100644 index 0000000000000..42cb87188d071 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Reference.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; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// + /// A reference from one resource to another + /// Based on [FHIR Reference](https://www.hl7.org/fhir/R4/references.html) + /// + public partial class FhirR4Reference : FhirR4Element + { + /// Initializes a new instance of . + public FhirR4Reference() + { + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Literal reference, Relative, internal or absolute URL. + /// Type the reference refers to (e.g. "Patient"). + /// Logical reference, when literal reference is not known. + /// Text alternative for the resource. + internal FhirR4Reference(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, string reference, string type, FhirR4Identifier identifier, string display) : base(id, extension, serializedAdditionalRawData) + { + Reference = reference; + Type = type; + Identifier = identifier; + Display = display; + } + + /// Literal reference, Relative, internal or absolute URL. + public string Reference { get; set; } + /// Type the reference refers to (e.g. "Patient"). + public string Type { get; set; } + /// Logical reference, when literal reference is not known. + public FhirR4Identifier Identifier { get; set; } + /// Text alternative for the resource. + public string Display { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Resource.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Resource.Serialization.cs new file mode 100644 index 0000000000000..6e9394ba9d937 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Resource.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4Resource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4Resource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Resource(document.RootElement, options); + } + + internal static FhirR4Resource DeserializeFhirR4Resource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceType = default; + Optional id = default; + Optional meta = default; + Optional implicitRules = default; + Optional language = default; + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("meta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + meta = FhirR4Meta.DeserializeFhirR4Meta(property.Value); + continue; + } + if (property.NameEquals("implicitRules"u8)) + { + implicitRules = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new FhirR4Resource(resourceType, id.Value, meta.Value, implicitRules.Value, language.Value, additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{options.Format}' format."); + } + } + + FhirR4Resource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Resource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FhirR4Resource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Resource(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/FhirR4Resource.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Resource.cs new file mode 100644 index 0000000000000..77be8e5025454 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4Resource.cs @@ -0,0 +1,95 @@ +// 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 +{ + /// + /// Resource is the ancestor of DomainResource from which most resources are derived. Bundle, Parameters, and Binary extend Resource directly. + /// Based on [FHIR Resource](https://www.hl7.org/fhir/r4/resource.html + /// + public partial class FhirR4Resource + { + /// Initializes a new instance of . + /// The type of resource. + /// is null. + public FhirR4Resource(string resourceType) + { + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + ResourceType = resourceType; + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of resource. + /// Resource Id. + /// Metadata about the resource. + /// A set of rules under which this content was created. + /// Language of the resource content. + /// Additional Properties. + internal FhirR4Resource(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary additionalProperties) + { + ResourceType = resourceType; + Id = id; + Meta = meta; + ImplicitRules = implicitRules; + Language = language; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal FhirR4Resource() + { + } + + /// The type of resource. + public string ResourceType { get; } + /// Resource Id. + public string Id { get; set; } + /// Metadata about the resource. + public FhirR4Meta Meta { get; set; } + /// A set of rules under which this content was created. + public string ImplicitRules { get; set; } + /// Language of the resource content. + public string Language { get; set; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4SampledData.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4SampledData.Serialization.cs new file mode 100644 index 0000000000000..a90c6fa6d04a3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4SampledData.Serialization.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class FhirR4SampledData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("origin"u8); + writer.WriteObjectValue(Origin); + writer.WritePropertyName("period"u8); + writer.WriteNumberValue(Period); + if (Optional.IsDefined(Factor)) + { + writer.WritePropertyName("factor"u8); + writer.WriteNumberValue(Factor.Value); + } + if (Optional.IsDefined(LowerLimit)) + { + writer.WritePropertyName("lowerLimit"u8); + writer.WriteNumberValue(LowerLimit.Value); + } + if (Optional.IsDefined(UpperLimit)) + { + writer.WritePropertyName("upperLimit"u8); + writer.WriteNumberValue(UpperLimit.Value); + } + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions); + if (Optional.IsDefined(Data)) + { + writer.WritePropertyName("data"u8); + writer.WriteStringValue(Data); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4SampledData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4SampledData(document.RootElement, options); + } + + internal static FhirR4SampledData DeserializeFhirR4SampledData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FhirR4Quantity origin = default; + double period = default; + Optional factor = default; + Optional lowerLimit = default; + Optional upperLimit = default; + int dimensions = default; + Optional data = default; + Optional id = default; + Optional> extension = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("origin"u8)) + { + origin = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("period"u8)) + { + period = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("factor"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + factor = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("lowerLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lowerLimit = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("upperLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upperLimit = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("data"u8)) + { + data = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4SampledData(id.Value, Optional.ToList(extension), serializedAdditionalRawData, origin, period, Optional.ToNullable(factor), Optional.ToNullable(lowerLimit), Optional.ToNullable(upperLimit), dimensions, data.Value); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{options.Format}' format."); + } + } + + FhirR4SampledData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4SampledData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new FhirR4SampledData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4SampledData(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4SampledData.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4SampledData.cs new file mode 100644 index 0000000000000..d17e9be78085c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/FhirR4SampledData.cs @@ -0,0 +1,76 @@ +// 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 series of measurements taken by a device + /// Based on [FHIR SampledData](https://www.hl7.org/fhir/R4/datatypes.html#SampledData) + /// + public partial class FhirR4SampledData : FhirR4Element + { + /// Initializes a new instance of . + /// Zero value and units. + /// Number of milliseconds between samples. + /// Number of sample points at each time point. + /// is null. + public FhirR4SampledData(FhirR4Quantity origin, double period, int dimensions) + { + Argument.AssertNotNull(origin, nameof(origin)); + + Origin = origin; + Period = period; + Dimensions = dimensions; + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Keeps track of any properties unknown to the library. + /// Zero value and units. + /// Number of milliseconds between samples. + /// Multiply data by this before adding to origin. + /// Lower limit of detection. + /// Upper limit of detection. + /// Number of sample points at each time point. + /// Decimal values with spaces, or "E" | "U" | "L". + internal FhirR4SampledData(string id, IReadOnlyList extension, IDictionary serializedAdditionalRawData, FhirR4Quantity origin, double period, double? factor, double? lowerLimit, double? upperLimit, int dimensions, string data) : base(id, extension, serializedAdditionalRawData) + { + Origin = origin; + Period = period; + Factor = factor; + LowerLimit = lowerLimit; + UpperLimit = upperLimit; + Dimensions = dimensions; + Data = data; + } + + /// Initializes a new instance of for deserialization. + internal FhirR4SampledData() + { + } + + /// Zero value and units. + public FhirR4Quantity Origin { get; } + /// Number of milliseconds between samples. + public double Period { get; } + /// Multiply data by this before adding to origin. + public double? Factor { get; set; } + /// Lower limit of detection. + public double? LowerLimit { get; set; } + /// Upper limit of detection. + public double? UpperLimit { get; set; } + /// Number of sample points at each time point. + public int Dimensions { get; } + /// Decimal values with spaces, or "E" | "U" | "L". + public string Data { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/HealthInsightsCancerProfilingModelFactory.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/HealthInsightsCancerProfilingModelFactory.cs index 926ffada9f564..02a9e8fd64a32 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/HealthInsightsCancerProfilingModelFactory.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/HealthInsightsCancerProfilingModelFactory.cs @@ -18,13 +18,212 @@ public static partial class HealthInsightsCancerProfilingModelFactory /// Initializes a new instance of . /// A given identifier for the patient. Has to be unique across all patients in a single request. /// Patient structured information, including demographics and known structured clinical information. - /// Patient unstructured clinical data, given as documents. + /// Patient encounters/visits. + /// Patient unstructured clinical data, given as documents. /// A new instance for mocking. - public static PatientRecord PatientRecord(string id = null, PatientInfo info = null, IEnumerable data = null) + public static PatientRecord PatientRecord(string id = null, PatientDetails info = null, IEnumerable encounters = null, IEnumerable patientDocuments = null) { - data ??= new List(); + encounters ??= new List(); + patientDocuments ??= new List(); - return new PatientRecord(id, info, data?.ToList(), serializedAdditionalRawData: null); + return new PatientRecord(id, info, encounters?.ToList(), patientDocuments?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of resource. + /// Resource Id. + /// Metadata about the resource. + /// A set of rules under which this content was created. + /// Language of the resource content. + /// Additional Properties. + /// A new instance for mocking. + public static FhirR4Resource FhirR4Resource(string resourceType = null, string id = null, FhirR4Meta meta = null, string implicitRules = null, string language = null, IDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new FhirR4Resource(resourceType, id, meta, implicitRules, language, additionalProperties); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// A new instance for mocking. + public static FhirR4Element FhirR4Element(string id = null, IEnumerable extension = null) + { + extension ??= new List(); + + return new FhirR4Element(id, extension?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Source of the definition for the extension code - a logical name or a URL. + /// Value as Quantity. + /// Value as CodeableConcept. + /// Value as string. + /// Value as boolean. + /// Value as integer. + /// Value as Range. + /// Value as Ratio. + /// Value as SampledData. + /// Value as time (hh:mm:ss). + /// Value as dateTime. + /// Value as Period. + /// Value as reference. + /// A new instance for mocking. + public static FhirR4Extension FhirR4Extension(string id = null, IEnumerable extension = null, string url = null, FhirR4Quantity valueQuantity = null, FhirR4CodeableConcept valueCodeableConcept = null, string valueString = null, bool? valueBoolean = null, int? valueInteger = null, FhirR4Range valueRange = null, FhirR4Ratio valueRatio = null, FhirR4SampledData valueSampledData = null, TimeSpan? valueTime = null, string valueDateTime = null, FhirR4Period valuePeriod = null, FhirR4Reference valueReference = null) + { + extension ??= new List(); + + return new FhirR4Extension(id, extension?.ToList(), serializedAdditionalRawData: null, url, valueQuantity, valueCodeableConcept, valueString, valueBoolean, valueInteger, valueRange, valueRatio, valueSampledData, valueTime, valueDateTime, valuePeriod, valueReference); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Numerical value (with implicit precision). + /// < | <= | >= | > - how to understand the value. + /// Unit representation. + /// System that defines coded unit form. + /// Coded form of the unit. + /// A new instance for mocking. + public static FhirR4Quantity FhirR4Quantity(string id = null, IEnumerable extension = null, double? value = null, string comparator = null, string unit = null, string system = null, string code = null) + { + extension ??= new List(); + + return new FhirR4Quantity(id, extension?.ToList(), serializedAdditionalRawData: null, value, comparator, unit, system, code); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Code defined by a terminology system. + /// Plain text representation of the concept. + /// A new instance for mocking. + public static FhirR4CodeableConcept FhirR4CodeableConcept(string id = null, IEnumerable extension = null, IEnumerable coding = null, string text = null) + { + extension ??= new List(); + coding ??= new List(); + + return new FhirR4CodeableConcept(id, extension?.ToList(), serializedAdditionalRawData: null, coding?.ToList(), text); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Identity of the terminology system. + /// Version of the system - if relevant. + /// Symbol in syntax defined by the system. + /// Representation defined by the system. + /// A new instance for mocking. + public static FhirR4Coding FhirR4Coding(string id = null, IEnumerable extension = null, string system = null, string version = null, string code = null, string display = null) + { + extension ??= new List(); + + return new FhirR4Coding(id, extension?.ToList(), serializedAdditionalRawData: null, system, version, code, display); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Low limit. + /// High limit. + /// A new instance for mocking. + public static FhirR4Range FhirR4Range(string id = null, IEnumerable extension = null, FhirR4Quantity low = null, FhirR4Quantity high = null) + { + extension ??= new List(); + + return new FhirR4Range(id, extension?.ToList(), serializedAdditionalRawData: null, low, high); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Numerator value. + /// Denominator value. + /// A new instance for mocking. + public static FhirR4Ratio FhirR4Ratio(string id = null, IEnumerable extension = null, FhirR4Quantity numerator = null, FhirR4Quantity denominator = null) + { + extension ??= new List(); + + return new FhirR4Ratio(id, extension?.ToList(), serializedAdditionalRawData: null, numerator, denominator); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Zero value and units. + /// Number of milliseconds between samples. + /// Multiply data by this before adding to origin. + /// Lower limit of detection. + /// Upper limit of detection. + /// Number of sample points at each time point. + /// Decimal values with spaces, or "E" | "U" | "L". + /// A new instance for mocking. + public static FhirR4SampledData FhirR4SampledData(string id = null, IEnumerable extension = null, FhirR4Quantity origin = null, double period = default, double? factor = null, double? lowerLimit = null, double? upperLimit = null, int dimensions = default, string data = null) + { + extension ??= new List(); + + return new FhirR4SampledData(id, extension?.ToList(), serializedAdditionalRawData: null, origin, period, factor, lowerLimit, upperLimit, dimensions, data); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Starting time with inclusive boundary. + /// End time with inclusive boundary, if not ongoing. + /// A new instance for mocking. + public static FhirR4Period FhirR4Period(string id = null, IEnumerable extension = null, string start = null, string end = null) + { + extension ??= new List(); + + return new FhirR4Period(id, extension?.ToList(), serializedAdditionalRawData: null, start, end); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// Literal reference, Relative, internal or absolute URL. + /// Type the reference refers to (e.g. "Patient"). + /// Logical reference, when literal reference is not known. + /// Text alternative for the resource. + /// A new instance for mocking. + public static FhirR4Reference FhirR4Reference(string id = null, IEnumerable extension = null, string reference = null, string type = null, FhirR4Identifier identifier = null, string display = null) + { + extension ??= new List(); + + return new FhirR4Reference(id, extension?.ToList(), serializedAdditionalRawData: null, reference, type, identifier, display); + } + + /// Initializes a new instance of . + /// Unique id for inter-element referencing. + /// Additional Content defined by implementations. + /// usual | official | temp | secondary | old (If known). + /// Description of identifier. + /// The namespace for the identifier value. + /// The value that is unique. + /// Time period when id is/was valid for use. + /// Organization that issued id (may be just text). + /// A new instance for mocking. + public static FhirR4Identifier FhirR4Identifier(string id = null, IEnumerable extension = null, string use = null, FhirR4CodeableConcept type = null, string system = null, string value = null, FhirR4Period period = null, FhirR4Reference assigner = null) + { + extension ??= new List(); + + return new FhirR4Identifier(id, extension?.ToList(), serializedAdditionalRawData: null, use, type, system, value, period, assigner); + } + + /// Initializes a new instance of . + /// The id of the visit. + /// + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// + /// The class of the encounter. + /// A new instance for mocking. + public static Encounter Encounter(string id = null, TimePeriod period = null, EncounterClass? @class = null) + { + return new Encounter(id, period, @class, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -33,33 +232,38 @@ public static PatientRecord PatientRecord(string id = null, PatientInfo info = n /// A given identifier for the document. Has to be unique across all documents for a single patient. /// A 2 letter ISO 639-1 representation of the language of the document. /// The date and time when the document was created. + /// Document author(s). + /// specialty type the document. + /// Administrative metadata for the document. /// The content of the patient document. /// A new instance for mocking. - public static PatientDocument PatientDocument(DocumentType type = default, ClinicalDocumentType? clinicalType = null, string id = null, string language = null, DateTimeOffset? createdDateTime = null, DocumentContent content = null) + public static PatientDocument PatientDocument(DocumentType type = default, ClinicalDocumentType? clinicalType = null, string id = null, string language = null, DateTimeOffset? createdDateTime = null, IEnumerable authors = null, SpecialtyType? specialtyType = null, DocumentAdministrativeMetadata administrativeMetadata = null, DocumentContent content = null) { - return new PatientDocument(type, clinicalType, id, language, createdDateTime, content, serializedAdditionalRawData: null); + authors ??= new List(); + + return new PatientDocument(type, clinicalType, id, language, createdDateTime, authors?.ToList(), specialtyType, administrativeMetadata, content, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Results for the patients given in the request. + /// Initializes a new instance of . + /// Results for the patients given in the request. /// The version of the model used for inference, expressed as the model date. - /// A new instance for mocking. - public static OncoPhenotypeResults OncoPhenotypeResults(IEnumerable patients = null, string modelVersion = null) + /// A new instance for mocking. + public static OncoPhenotypeInferenceResult OncoPhenotypeInferenceResult(IEnumerable patientResults = null, string modelVersion = null) { - patients ??= new List(); + patientResults ??= new List(); - return new OncoPhenotypeResults(patients?.ToList(), modelVersion, serializedAdditionalRawData: null); + return new OncoPhenotypeInferenceResult(patientResults?.ToList(), modelVersion, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// The identifier given for the patient in the request. + /// The identifier given for the patient in the request. /// The model's inferences for the given patient. /// A new instance for mocking. - public static OncoPhenotypePatientResult OncoPhenotypePatientResult(string id = null, IEnumerable inferences = null) + public static OncoPhenotypePatientResult OncoPhenotypePatientResult(string patientId = null, IEnumerable inferences = null) { inferences ??= new List(); - return new OncoPhenotypePatientResult(id, inferences?.ToList(), serializedAdditionalRawData: null); + return new OncoPhenotypePatientResult(patientId, inferences?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -100,5 +304,16 @@ public static ClinicalNoteEvidence ClinicalNoteEvidence(string id = null, string { return new ClinicalNoteEvidence(id, text, offset, length, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// 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. + /// A new instance for mocking. + public static ClinicalCodedElement ClinicalCodedElement(string system = null, string code = null, string name = null, string value = null) + { + return new ClinicalCodedElement(system, code, name, value, serializedAdditionalRawData: null); + } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceResult.Serialization.cs similarity index 64% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceResult.Serialization.cs index 172886ba206f3..0a7917dfed8dd 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceResult.Serialization.cs @@ -14,22 +14,22 @@ namespace Azure.Health.Insights.CancerProfiling { - public partial class OncoPhenotypeResults : IUtf8JsonSerializable, IJsonModel + public partial class OncoPhenotypeInferenceResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OncoPhenotypeResults)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(OncoPhenotypeInferenceResult)} does not support '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("patients"u8); + writer.WritePropertyName("patientResults"u8); writer.WriteStartArray(); - foreach (var item in Patients) + foreach (var item in PatientResults) { writer.WriteObjectValue(item); } @@ -54,19 +54,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } - OncoPhenotypeResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + OncoPhenotypeInferenceResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OncoPhenotypeResults)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(OncoPhenotypeInferenceResult)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOncoPhenotypeResults(document.RootElement, options); + return DeserializeOncoPhenotypeInferenceResult(document.RootElement, options); } - internal static OncoPhenotypeResults DeserializeOncoPhenotypeResults(JsonElement element, ModelReaderWriterOptions options = null) + internal static OncoPhenotypeInferenceResult DeserializeOncoPhenotypeInferenceResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -74,20 +74,20 @@ internal static OncoPhenotypeResults DeserializeOncoPhenotypeResults(JsonElement { return null; } - IReadOnlyList patients = default; + IReadOnlyList patientResults = default; string modelVersion = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("patients"u8)) + if (property.NameEquals("patientResults"u8)) { List array = new List(); foreach (var item in property.Value.EnumerateArray()) { array.Add(OncoPhenotypePatientResult.DeserializeOncoPhenotypePatientResult(item)); } - patients = array; + patientResults = array; continue; } if (property.NameEquals("modelVersion"u8)) @@ -101,46 +101,46 @@ internal static OncoPhenotypeResults DeserializeOncoPhenotypeResults(JsonElement } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new OncoPhenotypeResults(patients, modelVersion, serializedAdditionalRawData); + return new OncoPhenotypeInferenceResult(patientResults, modelVersion, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(OncoPhenotypeResults)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(OncoPhenotypeInferenceResult)} does not support '{options.Format}' format."); } } - OncoPhenotypeResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + OncoPhenotypeInferenceResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOncoPhenotypeResults(document.RootElement, options); + return DeserializeOncoPhenotypeInferenceResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OncoPhenotypeResults)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(OncoPhenotypeInferenceResult)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static OncoPhenotypeResults FromResponse(Response response) + internal static OncoPhenotypeInferenceResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeOncoPhenotypeResults(document.RootElement); + return DeserializeOncoPhenotypeInferenceResult(document.RootElement); } /// Convert into a Utf8JsonRequestContent. diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceResult.cs similarity index 74% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.cs rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceResult.cs index 0eef8b1bde6a8..464f40cf8eb2c 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeResults.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceResult.cs @@ -13,7 +13,7 @@ namespace Azure.Health.Insights.CancerProfiling { /// The inference results for the Onco Phenotype request. - public partial class OncoPhenotypeResults + public partial class OncoPhenotypeInferenceResult { /// /// Keeps track of any properties unknown to the library. @@ -47,37 +47,37 @@ public partial class OncoPhenotypeResults /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Results for the patients given in the request. + /// Initializes a new instance of . + /// 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) + /// or is null. + internal OncoPhenotypeInferenceResult(IEnumerable patientResults, string modelVersion) { - Argument.AssertNotNull(patients, nameof(patients)); + Argument.AssertNotNull(patientResults, nameof(patientResults)); Argument.AssertNotNull(modelVersion, nameof(modelVersion)); - Patients = patients.ToList(); + PatientResults = patientResults.ToList(); ModelVersion = modelVersion; } - /// Initializes a new instance of . - /// Results for the patients given in the request. + /// Initializes a new instance of . + /// Results for the patients given in the request. /// The version of the model used for inference, expressed as the model date. /// Keeps track of any properties unknown to the library. - internal OncoPhenotypeResults(IReadOnlyList patients, string modelVersion, IDictionary serializedAdditionalRawData) + internal OncoPhenotypeInferenceResult(IReadOnlyList patientResults, string modelVersion, IDictionary serializedAdditionalRawData) { - Patients = patients; + PatientResults = patientResults; ModelVersion = modelVersion; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal OncoPhenotypeResults() + /// Initializes a new instance of for deserialization. + internal OncoPhenotypeInferenceResult() { } /// Results for the patients given in the request. - public IReadOnlyList Patients { get; } + public IReadOnlyList PatientResults { 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/OncoPhenotypeInferenceType.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceType.cs index 1fc7fa940fd47..38ebfb1fdaac7 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceType.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypeInferenceType.cs @@ -30,6 +30,7 @@ public OncoPhenotypeInferenceType(string value) private const string PathologicStageTValue = "pathologicStageT"; private const string PathologicStageNValue = "pathologicStageN"; private const string PathologicStageMValue = "pathologicStageM"; + private const string DiagnosisDateValue = "diagnosisDate"; /// tumorSite. public static OncoPhenotypeInferenceType TumorSite { get; } = new OncoPhenotypeInferenceType(TumorSiteValue); @@ -47,6 +48,8 @@ public OncoPhenotypeInferenceType(string value) public static OncoPhenotypeInferenceType PathologicStageN { get; } = new OncoPhenotypeInferenceType(PathologicStageNValue); /// pathologicStageM. public static OncoPhenotypeInferenceType PathologicStageM { get; } = new OncoPhenotypeInferenceType(PathologicStageMValue); + /// diagnosisDate. + public static OncoPhenotypeInferenceType DiagnosisDate { get; } = new OncoPhenotypeInferenceType(DiagnosisDateValue); /// 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. 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 98f9658d58235..f2cfb15ad93ce 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 @@ -27,8 +27,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); + writer.WritePropertyName("patientId"u8); + writer.WriteStringValue(PatientId); writer.WritePropertyName("inferences"u8); writer.WriteStartArray(); foreach (var item in Inferences) @@ -74,15 +74,15 @@ internal static OncoPhenotypePatientResult DeserializeOncoPhenotypePatientResult { return null; } - string id = default; + string patientId = default; IReadOnlyList inferences = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (property.NameEquals("patientId"u8)) { - id = property.Value.GetString(); + patientId = property.Value.GetString(); continue; } if (property.NameEquals("inferences"u8)) @@ -101,7 +101,7 @@ internal static OncoPhenotypePatientResult DeserializeOncoPhenotypePatientResult } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new OncoPhenotypePatientResult(id, inferences, serializedAdditionalRawData); + return new OncoPhenotypePatientResult(patientId, inferences, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.cs index c907db7b085e9..1ad647908ce59 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/OncoPhenotypePatientResult.cs @@ -48,25 +48,25 @@ public partial class OncoPhenotypePatientResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The identifier given for the patient in the request. + /// 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) + /// or is null. + internal OncoPhenotypePatientResult(string patientId, IEnumerable inferences) { - Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(patientId, nameof(patientId)); Argument.AssertNotNull(inferences, nameof(inferences)); - Id = id; + PatientId = patientId; Inferences = inferences.ToList(); } /// Initializes a new instance of . - /// The identifier given for the patient in the request. + /// The identifier given for the patient in the request. /// The model's inferences for the given patient. /// Keeps track of any properties unknown to the library. - internal OncoPhenotypePatientResult(string id, IReadOnlyList inferences, IDictionary serializedAdditionalRawData) + internal OncoPhenotypePatientResult(string patientId, IReadOnlyList inferences, IDictionary serializedAdditionalRawData) { - Id = id; + PatientId = patientId; Inferences = inferences; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -77,7 +77,7 @@ internal OncoPhenotypePatientResult() } /// The identifier given for the patient in the request. - public string Id { get; } + public string PatientId { get; } /// The model's inferences for the given patient. public IReadOnlyList Inferences { get; } } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDetails.Serialization.cs similarity index 71% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.Serialization.cs rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDetails.Serialization.cs index 6aebb9738cbfa..7885042733fe6 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDetails.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.Health.Insights.CancerProfiling { - public partial class PatientInfo : IUtf8JsonSerializable, IJsonModel + public partial class PatientDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PatientInfo)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{format}' format."); } writer.WriteStartObject(); @@ -65,19 +65,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio writer.WriteEndObject(); } - PatientInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PatientDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PatientInfo)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePatientInfo(document.RootElement, options); + return DeserializePatientDetails(document.RootElement, options); } - internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelReaderWriterOptions options = null) + internal static PatientDetails DeserializePatientDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -85,9 +85,9 @@ internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelRea { return null; } - Optional sex = default; + Optional sex = default; Optional birthDate = default; - Optional> clinicalInfo = default; + Optional> clinicalInfo = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -98,7 +98,7 @@ internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelRea { continue; } - sex = new PatientInfoSex(property.Value.GetString()); + sex = new PatientSex(property.Value.GetString()); continue; } if (property.NameEquals("birthDate"u8)) @@ -116,10 +116,10 @@ internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelRea { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ClinicalCodedElement.DeserializeClinicalCodedElement(item)); + array.Add(FhirR4Resource.DeserializeFhirR4Resource(item)); } clinicalInfo = array; continue; @@ -130,46 +130,46 @@ internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelRea } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new PatientInfo(Optional.ToNullable(sex), Optional.ToNullable(birthDate), Optional.ToList(clinicalInfo), serializedAdditionalRawData); + return new PatientDetails(Optional.ToNullable(sex), Optional.ToNullable(birthDate), Optional.ToList(clinicalInfo), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PatientInfo)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{options.Format}' format."); } } - PatientInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PatientDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePatientInfo(document.RootElement, options); + return DeserializePatientDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PatientInfo)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static PatientInfo FromResponse(Response response) + internal static PatientDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializePatientInfo(document.RootElement); + return DeserializePatientDetails(document.RootElement); } /// Convert into a Utf8JsonRequestContent. diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDetails.cs similarity index 84% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.cs rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDetails.cs index 500e75e534429..28cb430c1ba88 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfo.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDetails.cs @@ -12,7 +12,7 @@ namespace Azure.Health.Insights.CancerProfiling { /// Patient structured information, including demographics and known structured clinical information. - public partial class PatientInfo + public partial class PatientDetails { /// /// Keeps track of any properties unknown to the library. @@ -46,18 +46,18 @@ public partial class PatientInfo /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public PatientInfo() + /// Initializes a new instance of . + public PatientDetails() { - ClinicalInfo = new ChangeTrackingList(); + ClinicalInfo = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The patient's sex. /// The patient's date of birth. /// Known clinical information for the patient, structured. /// Keeps track of any properties unknown to the library. - internal PatientInfo(PatientInfoSex? sex, DateTimeOffset? birthDate, IList clinicalInfo, IDictionary serializedAdditionalRawData) + internal PatientDetails(PatientSex? sex, DateTimeOffset? birthDate, IList clinicalInfo, IDictionary serializedAdditionalRawData) { Sex = sex; BirthDate = birthDate; @@ -66,10 +66,10 @@ internal PatientInfo(PatientInfoSex? sex, DateTimeOffset? birthDate, IList The patient's sex. - public PatientInfoSex? Sex { get; set; } + public PatientSex? 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; } + public IList ClinicalInfo { 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 index 92f82b02f49ce..d9efe07ddf038 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.Serialization.cs @@ -46,6 +46,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WritePropertyName("createdDateTime"u8); writer.WriteStringValue(CreatedDateTime.Value, "O"); } + if (Optional.IsCollectionDefined(Authors)) + { + writer.WritePropertyName("authors"u8); + writer.WriteStartArray(); + foreach (var item in Authors) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SpecialtyType)) + { + writer.WritePropertyName("specialtyType"u8); + writer.WriteStringValue(SpecialtyType.Value.ToString()); + } + if (Optional.IsDefined(AdministrativeMetadata)) + { + writer.WritePropertyName("administrativeMetadata"u8); + writer.WriteObjectValue(AdministrativeMetadata); + } writer.WritePropertyName("content"u8); writer.WriteObjectValue(Content); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -91,6 +111,9 @@ internal static PatientDocument DeserializePatientDocument(JsonElement element, string id = default; Optional language = default; Optional createdDateTime = default; + Optional> authors = default; + Optional specialtyType = default; + Optional administrativeMetadata = default; DocumentContent content = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); @@ -129,6 +152,38 @@ internal static PatientDocument DeserializePatientDocument(JsonElement element, createdDateTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("authors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentAuthor.DeserializeDocumentAuthor(item)); + } + authors = array; + continue; + } + if (property.NameEquals("specialtyType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + specialtyType = new SpecialtyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeMetadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeMetadata = DocumentAdministrativeMetadata.DeserializeDocumentAdministrativeMetadata(property.Value); + continue; + } if (property.NameEquals("content"u8)) { content = DocumentContent.DeserializeDocumentContent(property.Value); @@ -140,7 +195,7 @@ internal static PatientDocument DeserializePatientDocument(JsonElement element, } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new PatientDocument(type, Optional.ToNullable(clinicalType), id, language.Value, Optional.ToNullable(createdDateTime), content, serializedAdditionalRawData); + return new PatientDocument(type, Optional.ToNullable(clinicalType), id, language.Value, Optional.ToNullable(createdDateTime), Optional.ToList(authors), Optional.ToNullable(specialtyType), administrativeMetadata.Value, content, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.cs index 7b3993fe88b9c..76d42f9d9c63f 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientDocument.cs @@ -58,6 +58,7 @@ public PatientDocument(DocumentType type, string id, DocumentContent content) Type = type; Id = id; + Authors = new ChangeTrackingList(); Content = content; } @@ -67,15 +68,21 @@ public PatientDocument(DocumentType type, string id, DocumentContent content) /// A given identifier for the document. Has to be unique across all documents for a single patient. /// A 2 letter ISO 639-1 representation of the language of the document. /// The date and time when the document was created. + /// Document author(s). + /// specialty type the document. + /// Administrative metadata for the document. /// The content of the patient document. /// Keeps track of any properties unknown to the library. - internal PatientDocument(DocumentType type, ClinicalDocumentType? clinicalType, string id, string language, DateTimeOffset? createdDateTime, DocumentContent content, IDictionary serializedAdditionalRawData) + internal PatientDocument(DocumentType type, ClinicalDocumentType? clinicalType, string id, string language, DateTimeOffset? createdDateTime, IList authors, SpecialtyType? specialtyType, DocumentAdministrativeMetadata administrativeMetadata, DocumentContent content, IDictionary serializedAdditionalRawData) { Type = type; ClinicalType = clinicalType; Id = id; Language = language; CreatedDateTime = createdDateTime; + Authors = authors; + SpecialtyType = specialtyType; + AdministrativeMetadata = administrativeMetadata; Content = content; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -95,6 +102,12 @@ internal PatientDocument() public string Language { get; set; } /// The date and time when the document was created. public DateTimeOffset? CreatedDateTime { get; set; } + /// Document author(s). + public IList Authors { get; } + /// specialty type the document. + public SpecialtyType? SpecialtyType { get; set; } + /// Administrative metadata for the document. + public DocumentAdministrativeMetadata AdministrativeMetadata { get; set; } /// The content of the patient document. public DocumentContent Content { get; } } 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 index c370dd3bdbadd..3c8f97186f970 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.Serialization.cs @@ -34,11 +34,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt writer.WritePropertyName("info"u8); writer.WriteObjectValue(Info); } - if (Optional.IsCollectionDefined(Data)) + if (Optional.IsCollectionDefined(Encounters)) { - writer.WritePropertyName("data"u8); + writer.WritePropertyName("encounters"u8); writer.WriteStartArray(); - foreach (var item in Data) + foreach (var item in Encounters) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PatientDocuments)) + { + writer.WritePropertyName("patientDocuments"u8); + writer.WriteStartArray(); + foreach (var item in PatientDocuments) { writer.WriteObjectValue(item); } @@ -83,8 +93,9 @@ internal static PatientRecord DeserializePatientRecord(JsonElement element, Mode return null; } string id = default; - Optional info = default; - Optional> data = default; + Optional info = default; + Optional> encounters = default; + Optional> patientDocuments = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -100,10 +111,24 @@ internal static PatientRecord DeserializePatientRecord(JsonElement element, Mode { continue; } - info = PatientInfo.DeserializePatientInfo(property.Value); + info = PatientDetails.DeserializePatientDetails(property.Value); + continue; + } + if (property.NameEquals("encounters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Encounter.DeserializeEncounter(item)); + } + encounters = array; continue; } - if (property.NameEquals("data"u8)) + if (property.NameEquals("patientDocuments"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { @@ -114,7 +139,7 @@ internal static PatientRecord DeserializePatientRecord(JsonElement element, Mode { array.Add(PatientDocument.DeserializePatientDocument(item)); } - data = array; + patientDocuments = array; continue; } if (options.Format != "W") @@ -123,7 +148,7 @@ internal static PatientRecord DeserializePatientRecord(JsonElement element, Mode } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new PatientRecord(id, info.Value, Optional.ToList(data), serializedAdditionalRawData); + return new PatientRecord(id, info.Value, Optional.ToList(encounters), Optional.ToList(patientDocuments), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.cs index 3d3dc86da5e60..8897b0e5cae39 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientRecord.cs @@ -54,19 +54,22 @@ public PatientRecord(string id) Argument.AssertNotNull(id, nameof(id)); Id = id; - Data = new ChangeTrackingList(); + Encounters = new ChangeTrackingList(); + PatientDocuments = new ChangeTrackingList(); } /// Initializes a new instance of . /// A given identifier for the patient. Has to be unique across all patients in a single request. /// Patient structured information, including demographics and known structured clinical information. - /// Patient unstructured clinical data, given as documents. + /// Patient encounters/visits. + /// Patient unstructured clinical data, given as documents. /// Keeps track of any properties unknown to the library. - internal PatientRecord(string id, PatientInfo info, IList data, IDictionary serializedAdditionalRawData) + internal PatientRecord(string id, PatientDetails info, IList encounters, IList patientDocuments, IDictionary serializedAdditionalRawData) { Id = id; Info = info; - Data = data; + Encounters = encounters; + PatientDocuments = patientDocuments; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -78,8 +81,10 @@ internal PatientRecord() /// 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; } + public PatientDetails Info { get; set; } + /// Patient encounters/visits. + public IList Encounters { get; } /// Patient unstructured clinical data, given as documents. - public IList Data { get; } + public IList PatientDocuments { get; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfoSex.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientSex.cs similarity index 52% rename from sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfoSex.cs rename to sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientSex.cs index 57fb30f829da5..20919f5ea3986 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientInfoSex.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/PatientSex.cs @@ -11,13 +11,13 @@ namespace Azure.Health.Insights.CancerProfiling { /// The patient's sex. - public readonly partial struct PatientInfoSex : IEquatable + public readonly partial struct PatientSex : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public PatientInfoSex(string value) + public PatientSex(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -27,23 +27,23 @@ public PatientInfoSex(string value) private const string UnspecifiedValue = "unspecified"; /// female. - public static PatientInfoSex Female { get; } = new PatientInfoSex(FemaleValue); + public static PatientSex Female { get; } = new PatientSex(FemaleValue); /// male. - public static PatientInfoSex Male { get; } = new PatientInfoSex(MaleValue); + public static PatientSex Male { get; } = new PatientSex(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); + public static PatientSex Unspecified { get; } = new PatientSex(UnspecifiedValue); + /// Determines if two values are the same. + public static bool operator ==(PatientSex left, PatientSex right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatientSex left, PatientSex right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatientSex(string value) => new PatientSex(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PatientInfoSex other && Equals(other); + public override bool Equals(object obj) => obj is PatientSex other && Equals(other); /// - public bool Equals(PatientInfoSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(PatientSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/SpecialtyType.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/SpecialtyType.cs new file mode 100644 index 0000000000000..85894166b8303 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/SpecialtyType.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.CancerProfiling +{ + /// Known values codes that can be used to indicate the type of the Specialty. + public readonly partial struct SpecialtyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SpecialtyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PathologyValue = "pathology"; + private const string RadiologyValue = "radiology"; + + /// pathology. + public static SpecialtyType Pathology { get; } = new SpecialtyType(PathologyValue); + /// radiology. + public static SpecialtyType Radiology { get; } = new SpecialtyType(RadiologyValue); + /// Determines if two values are the same. + public static bool operator ==(SpecialtyType left, SpecialtyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SpecialtyType left, SpecialtyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SpecialtyType(string value) => new SpecialtyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SpecialtyType other && Equals(other); + /// + public bool Equals(SpecialtyType 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/TimePeriod.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/TimePeriod.Serialization.cs new file mode 100644 index 0000000000000..65609fffaccd1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/TimePeriod.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.CancerProfiling +{ + public partial class TimePeriod : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start.Value, "O"); + } + if (Optional.IsDefined(End)) + { + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TimePeriod IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTimePeriod(document.RootElement, options); + } + + internal static TimePeriod DeserializeTimePeriod(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional start = default; + Optional end = default; + IDictionary serializedAdditionalRawData = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + start = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("end"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + end = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new TimePeriod(Optional.ToNullable(start), Optional.ToNullable(end), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{options.Format}' format."); + } + } + + TimePeriod IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTimePeriod(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TimePeriod FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTimePeriod(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/TimePeriod.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/TimePeriod.cs new file mode 100644 index 0000000000000..c839a11044bdb --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/TimePeriod.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; + +namespace Azure.Health.Insights.CancerProfiling +{ + /// A duration of time during which an event is happening. + public partial class TimePeriod + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public TimePeriod() + { + } + + /// Initializes a new instance of . + /// Starting time with inclusive boundary. + /// End time with inclusive boundary, if not ongoing. + /// Keeps track of any properties unknown to the library. + internal TimePeriod(DateTimeOffset? start, DateTimeOffset? end, IDictionary serializedAdditionalRawData) + { + Start = start; + End = end; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Starting time with inclusive boundary. + public DateTimeOffset? Start { get; set; } + /// End time with inclusive boundary, if not ongoing. + public DateTimeOffset? End { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Generated/Samples/Samples_CancerProfilingClient.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Generated/Samples/Samples_CancerProfilingClient.cs index f6f0887483a11..cc8d06fde8abc 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Generated/Samples/Samples_CancerProfilingClient.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tests/Generated/Samples/Samples_CancerProfilingClient.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.Text.Json; using System.Threading.Tasks; using Azure; @@ -40,9 +41,9 @@ public void Example_CancerProfilingClient_InferCancerProfile_ShortVersion() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); } @@ -68,9 +69,9 @@ public async Task Example_CancerProfilingClient_InferCancerProfile_ShortVersion_ BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); } @@ -86,8 +87,8 @@ public void Example_CancerProfilingClient_InferCancerProfile_ShortVersion_Conven { new PatientRecord("") }); - Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); - OncoPhenotypeResults responseData = operation.Value; + Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); + OncoPhenotypeInferenceResult responseData = operation.Value; } [Test] @@ -102,8 +103,8 @@ public async Task Example_CancerProfilingClient_InferCancerProfile_ShortVersion_ { new PatientRecord("") }); - Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); - OncoPhenotypeResults responseData = operation.Value; + Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); + OncoPhenotypeInferenceResult responseData = operation.Value; } [Test] @@ -129,14 +130,157 @@ public void Example_CancerProfilingClient_InferCancerProfile_AllParameters() { new { +resourceType = "", +id = "", +meta = new +{ +versionId = "", +lastUpdated = "", +source = "", +profile = new object[] +{ +"" +}, +security = new object[] +{ +new +{ +system = "", +version = "", +code = "", +display = "", +id = "", +extension = new object[] +{ +new +{ +url = "", +valueQuantity = new +{ +value = 123.45, +comparator = "", +unit = "", system = "", code = "", -name = "", +id = "", +extension = new object[] +{ +null +}, +}, +valueCodeableConcept = new +{ +coding = new object[] +{ +null +}, +text = "", +id = "", +extension = new object[] +{ +null +}, +}, +valueString = "", +valueBoolean = true, +valueInteger = 1234, +valueRange = new +{ +id = "", +extension = new object[] +{ +null +}, +}, +valueRatio = new +{ +id = "", +extension = new object[] +{ +null +}, +}, +valueSampledData = new +{ +period = 123.45, +factor = 123.45, +lowerLimit = 123.45, +upperLimit = 123.45, +dimensions = 1234, +data = "", +id = "", +extension = new object[] +{ +null +}, +}, +valueTime = "01:23:45", +valueDateTime = "", +valuePeriod = new +{ +start = "", +end = "", +id = "", +extension = new object[] +{ +null +}, +}, +valueReference = new +{ +reference = "", +type = "", +identifier = new +{ +use = "", +system = "", value = "", +id = "", +extension = new object[] +{ +null +}, +}, +display = "", +id = "", +extension = new object[] +{ +null +}, +}, +id = "", +extension = new object[] +{ +null +}, +} +}, +} +}, +tag = new object[] +{ +null +}, +}, +implicitRules = "", +language = "", } }, }, -data = new object[] +encounters = new object[] +{ +new Dictionary +{ +["id"] = "", +["period"] = new +{ +start = "2022-05-10T14:57:31.2311892-04:00", +end = "2022-05-10T14:57:31.2311892-04:00", +}, +["class"] = "inpatient" +} +}, +patientDocuments = new object[] { new { @@ -145,6 +289,30 @@ public void Example_CancerProfilingClient_InferCancerProfile_AllParameters() id = "", language = "", createdDateTime = "2022-05-10T14:57:31.2311892-04:00", +authors = new object[] +{ +new +{ +id = "", +fullName = "", +} +}, +specialtyType = "pathology", +administrativeMetadata = new +{ +orderedProcedures = new object[] +{ +new +{ +extension = new object[] +{ +null +}, +description = "", +} +}, +encounterId = "", +}, content = new { sourceType = "inline", @@ -169,21 +337,21 @@ public void Example_CancerProfilingClient_InferCancerProfile_AllParameters() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); } @@ -210,14 +378,157 @@ public async Task Example_CancerProfilingClient_InferCancerProfile_AllParameters { new { +resourceType = "", +id = "", +meta = new +{ +versionId = "", +lastUpdated = "", +source = "", +profile = new object[] +{ +"" +}, +security = new object[] +{ +new +{ +system = "", +version = "", +code = "", +display = "", +id = "", +extension = new object[] +{ +new +{ +url = "", +valueQuantity = new +{ +value = 123.45, +comparator = "", +unit = "", system = "", code = "", -name = "", +id = "", +extension = new object[] +{ +null +}, +}, +valueCodeableConcept = new +{ +coding = new object[] +{ +null +}, +text = "", +id = "", +extension = new object[] +{ +null +}, +}, +valueString = "", +valueBoolean = true, +valueInteger = 1234, +valueRange = new +{ +id = "", +extension = new object[] +{ +null +}, +}, +valueRatio = new +{ +id = "", +extension = new object[] +{ +null +}, +}, +valueSampledData = new +{ +period = 123.45, +factor = 123.45, +lowerLimit = 123.45, +upperLimit = 123.45, +dimensions = 1234, +data = "", +id = "", +extension = new object[] +{ +null +}, +}, +valueTime = "01:23:45", +valueDateTime = "", +valuePeriod = new +{ +start = "", +end = "", +id = "", +extension = new object[] +{ +null +}, +}, +valueReference = new +{ +reference = "", +type = "", +identifier = new +{ +use = "", +system = "", value = "", +id = "", +extension = new object[] +{ +null +}, +}, +display = "", +id = "", +extension = new object[] +{ +null +}, +}, +id = "", +extension = new object[] +{ +null +}, +} +}, +} +}, +tag = new object[] +{ +null +}, +}, +implicitRules = "", +language = "", } }, }, -data = new object[] +encounters = new object[] +{ +new Dictionary +{ +["id"] = "", +["period"] = new +{ +start = "2022-05-10T14:57:31.2311892-04:00", +end = "2022-05-10T14:57:31.2311892-04:00", +}, +["class"] = "inpatient" +} +}, +patientDocuments = new object[] { new { @@ -226,6 +537,30 @@ public async Task Example_CancerProfilingClient_InferCancerProfile_AllParameters id = "", language = "", createdDateTime = "2022-05-10T14:57:31.2311892-04:00", +authors = new object[] +{ +new +{ +id = "", +fullName = "", +} +}, +specialtyType = "pathology", +administrativeMetadata = new +{ +orderedProcedures = new object[] +{ +new +{ +extension = new object[] +{ +null +}, +description = "", +} +}, +encounterId = "", +}, content = new { sourceType = "inline", @@ -250,21 +585,21 @@ public async Task Example_CancerProfilingClient_InferCancerProfile_AllParameters BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("caseId").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); } @@ -280,21 +615,62 @@ public void Example_CancerProfilingClient_InferCancerProfile_AllParameters_Conve { new PatientRecord("") { -Info = new PatientInfo +Info = new PatientDetails { -Sex = PatientInfoSex.Female, +Sex = PatientSex.Female, BirthDate = DateTimeOffset.Parse("2022-05-10"), -ClinicalInfo = {new ClinicalCodedElement("", "") +ClinicalInfo = {new FhirR4Resource("") +{ +Id = "", +Meta = new FhirR4Meta +{ +VersionId = "", +LastUpdated = "", +Source = "", +Profile = {""}, +Security = {new FhirR4Coding { -Name = "", -Value = "", +System = "", +Version = "", +Code = "", +Display = "", +}}, +Tag = {default}, +}, +ImplicitRules = "", +Language = "", }}, }, -Data = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) +Encounters = {new Encounter("") +{ +Period = new TimePeriod +{ +Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +}, +Class = EncounterClass.InPatient, +}}, +PatientDocuments = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) { ClinicalType = ClinicalDocumentType.Consultation, Language = "", CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +Authors = {new DocumentAuthor +{ +Id = "", +FullName = "", +}}, +SpecialtyType = SpecialtyType.Pathology, +AdministrativeMetadata = new DocumentAdministrativeMetadata +{ +OrderedProcedures = {new FhirR4Extendible +{ +Extension = {default}, +Code = default, +Description = "", +}}, +EncounterId = "", +}, }}, } }) @@ -307,8 +683,8 @@ public void Example_CancerProfilingClient_InferCancerProfile_AllParameters_Conve CheckForCancerCase = true, }, }; - Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); - OncoPhenotypeResults responseData = operation.Value; + Operation operation = client.InferCancerProfile(WaitUntil.Completed, oncoPhenotypeData); + OncoPhenotypeInferenceResult responseData = operation.Value; } [Test] @@ -323,21 +699,62 @@ public async Task Example_CancerProfilingClient_InferCancerProfile_AllParameters { new PatientRecord("") { -Info = new PatientInfo +Info = new PatientDetails { -Sex = PatientInfoSex.Female, +Sex = PatientSex.Female, BirthDate = DateTimeOffset.Parse("2022-05-10"), -ClinicalInfo = {new ClinicalCodedElement("", "") +ClinicalInfo = {new FhirR4Resource("") { -Name = "", -Value = "", +Id = "", +Meta = new FhirR4Meta +{ +VersionId = "", +LastUpdated = "", +Source = "", +Profile = {""}, +Security = {new FhirR4Coding +{ +System = "", +Version = "", +Code = "", +Display = "", }}, +Tag = {default}, }, -Data = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) +ImplicitRules = "", +Language = "", +}}, +}, +Encounters = {new Encounter("") +{ +Period = new TimePeriod +{ +Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +}, +Class = EncounterClass.InPatient, +}}, +PatientDocuments = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) { ClinicalType = ClinicalDocumentType.Consultation, Language = "", CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +Authors = {new DocumentAuthor +{ +Id = "", +FullName = "", +}}, +SpecialtyType = SpecialtyType.Pathology, +AdministrativeMetadata = new DocumentAdministrativeMetadata +{ +OrderedProcedures = {new FhirR4Extendible +{ +Extension = {default}, +Code = default, +Description = "", +}}, +EncounterId = "", +}, }}, } }) @@ -350,8 +767,8 @@ public async Task Example_CancerProfilingClient_InferCancerProfile_AllParameters CheckForCancerCase = true, }, }; - Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); - OncoPhenotypeResults responseData = operation.Value; + Operation operation = await client.InferCancerProfileAsync(WaitUntil.Completed, oncoPhenotypeData); + OncoPhenotypeInferenceResult responseData = operation.Value; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml index b828e244579db..5fde8160aaa43 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/tsp-location.yaml @@ -1,6 +1,7 @@ -directory: specification/ai/HealthInsights/HealthInsights.OncoPhenotype/ +directory: specification/ai/HealthInsights/HealthInsights.OncoPhenotype additionalDirectories: - - specification/ai/HealthInsights/HealthInsights.OpenAPI/ - - specification/ai/HealthInsights/HealthInsights.Common/ -commit: 5e0c86b469be528174996420da94388ac12ce127 -repo: azure/azure-rest-api-specs +- specification/ai/HealthInsights/HealthInsights.Common/ +- specification/ai/HealthInsights/HealthInsights.OpenAPI/ +repo: Azure/azure-rest-api-specs +commit: 0b86423a8256b66c84c4e0e0d7d52e75105bb4bb + 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 e81ce2952bab1..3ec1e46e855c9 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 @@ -1,46 +1,5 @@ namespace Azure.Health.Insights.ClinicalMatching { - public partial class AcceptedAge : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - 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; } } - Azure.Health.Insights.ClinicalMatching.AcceptedAge System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.ClinicalMatching.AcceptedAge System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class AcceptedAgeRange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public AcceptedAgeRange() { } - public Azure.Health.Insights.ClinicalMatching.AcceptedAge MaximumAge { get { throw null; } set { } } - public Azure.Health.Insights.ClinicalMatching.AcceptedAge MinimumAge { get { throw null; } set { } } - Azure.Health.Insights.ClinicalMatching.AcceptedAgeRange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.ClinicalMatching.AcceptedAgeRange System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AreaGeometry(Azure.Health.Insights.ClinicalMatching.GeoJsonGeometryType type, System.Collections.Generic.IEnumerable coordinates) { } @@ -65,11 +24,11 @@ public AreaProperties(Azure.Health.Insights.ClinicalMatching.GeoJsonPropertiesSu } public partial class ClinicalCodedElement : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - 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 { } } + internal ClinicalCodedElement() { } + public string Code { get { throw null; } } + public string Name { get { throw null; } } + public string System { get { throw null; } } + public string Value { get { throw null; } } Azure.Health.Insights.ClinicalMatching.ClinicalCodedElement System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Insights.ClinicalMatching.ClinicalCodedElement System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -85,11 +44,11 @@ public ClinicalCodedElement(string system, string code) { } 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 PathologyReport { 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 static Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType RadiologyReport { 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; } @@ -107,16 +66,16 @@ public ClinicalMatchingClient(System.Uri endpoint, Azure.AzureKeyCredential cred 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, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation MatchTrials(Azure.WaitUntil waitUntil, Azure.Health.Insights.ClinicalMatching.TrialMatcherData trialMatcherData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation MatchTrials(Azure.WaitUntil waitUntil, Azure.Health.Insights.ClinicalMatching.TrialMatcherData trialMatcherData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> MatchTrialsAsync(Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> MatchTrialsAsync(Azure.WaitUntil waitUntil, Azure.Health.Insights.ClinicalMatching.TrialMatcherData trialMatcherData, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> MatchTrialsAsync(Azure.WaitUntil waitUntil, Azure.Health.Insights.ClinicalMatching.TrialMatcherData trialMatcherData, 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 ClinicalMatchingClientOptions(Azure.Health.Insights.ClinicalMatching.ClinicalMatchingClientOptions.ServiceVersion version = Azure.Health.Insights.ClinicalMatching.ClinicalMatchingClientOptions.ServiceVersion.V2023_09_01_Preview) { } public enum ServiceVersion { - V2023_03_01_Preview = 1, + V2023_09_01_Preview = 1, } } public partial class ClinicalNoteEvidence : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -132,59 +91,16 @@ internal ClinicalNoteEvidence() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ClinicalTrialDemographics() { } - public Azure.Health.Insights.ClinicalMatching.AcceptedAgeRange AcceptedAgeRange { get { throw null; } set { } } - public Azure.Health.Insights.ClinicalMatching.ClinicalTrialAcceptedSex? AcceptedSex { get { throw null; } set { } } - Azure.Health.Insights.ClinicalMatching.ClinicalTrialDemographics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.ClinicalMatching.ClinicalTrialDemographics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ClinicalTrialDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - 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; } } - Azure.Health.Insights.ClinicalMatching.ClinicalTrialDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.ClinicalMatching.ClinicalTrialDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class ClinicalTrialMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - 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 { } } + internal ClinicalTrialMetadata() { } + public System.Collections.Generic.IReadOnlyList Conditions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Contacts { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Facilities { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Phases { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus? RecruitmentStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Sponsors { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType? StudyType { get { throw null; } } Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -281,11 +197,11 @@ public ClinicalTrialRegistryFilter() { } } public partial class ClinicalTrialResearchFacility : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ClinicalTrialResearchFacility(string name, string countryOrRegion) { } - public string City { 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 { } } + internal ClinicalTrialResearchFacility() { } + public string City { get { throw null; } } + public string CountryOrRegion { get { throw null; } } + public string Name { get { throw null; } } + public string State { get { throw null; } } Azure.Health.Insights.ClinicalMatching.ClinicalTrialResearchFacility System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Insights.ClinicalMatching.ClinicalTrialResearchFacility System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -295,7 +211,7 @@ public ClinicalTrialResearchFacility(string name, string countryOrRegion) { } public partial class ClinicalTrials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ClinicalTrials() { } - public System.Collections.Generic.IList CustomTrials { get { throw null; } } + public System.Collections.Generic.IList CustomTrials { get { throw null; } } public System.Collections.Generic.IList RegistryFilters { get { throw null; } } Azure.Health.Insights.ClinicalMatching.ClinicalTrials System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -343,16 +259,82 @@ public ClinicalTrials() { } } public partial class ContactDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ContactDetails() { } - public string Email { get { throw null; } set { } } - public string Name { get { throw null; } set { } } - public string Phone { get { throw null; } set { } } + internal ContactDetails() { } + public string Email { get { throw null; } } + public string Name { get { throw null; } } + public string Phone { get { throw null; } } Azure.Health.Insights.ClinicalMatching.ContactDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Insights.ClinicalMatching.ContactDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContactPointSystem : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContactPointSystem(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ContactPointSystem Email { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointSystem Fax { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointSystem Other { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointSystem Pager { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointSystem Phone { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointSystem Sms { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointSystem Url { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ContactPointSystem 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.ContactPointSystem left, Azure.Health.Insights.ClinicalMatching.ContactPointSystem right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ContactPointSystem (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ContactPointSystem left, Azure.Health.Insights.ClinicalMatching.ContactPointSystem right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContactPointUse : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContactPointUse(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ContactPointUse Home { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointUse Mobile { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointUse Old { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointUse Temp { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ContactPointUse Work { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ContactPointUse 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.ContactPointUse left, Azure.Health.Insights.ClinicalMatching.ContactPointUse right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ContactPointUse (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ContactPointUse left, Azure.Health.Insights.ClinicalMatching.ContactPointUse right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DocumentAdministrativeMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentAdministrativeMetadata() { } + public string EncounterId { get { throw null; } set { } } + public System.Collections.Generic.IList OrderedProcedures { get { throw null; } } + Azure.Health.Insights.ClinicalMatching.DocumentAdministrativeMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.DocumentAdministrativeMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentAuthor : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DocumentAuthor() { } + public string FullName { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.DocumentAuthor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.DocumentAuthor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DocumentContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DocumentContent(Azure.Health.Insights.ClinicalMatching.DocumentContentSourceType sourceType, string value) { } @@ -402,6 +384,40 @@ public DocumentContent(Azure.Health.Insights.ClinicalMatching.DocumentContentSou 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 Encounter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Encounter(string id) { } + public Azure.Health.Insights.ClinicalMatching.EncounterClass? Class { get { throw null; } set { } } + public string Id { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.TimePeriod Period { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.Encounter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.Encounter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EncounterClass : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EncounterClass(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.EncounterClass Ambulatory { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.EncounterClass Emergency { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.EncounterClass HealthHome { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.EncounterClass InPatient { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.EncounterClass Observation { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.EncounterClass Virtual { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.EncounterClass 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.EncounterClass left, Azure.Health.Insights.ClinicalMatching.EncounterClass right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.EncounterClass (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.EncounterClass left, Azure.Health.Insights.ClinicalMatching.EncounterClass right) { throw null; } + public override string ToString() { throw null; } + } public partial class ExtendedClinicalCodedElement : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ExtendedClinicalCodedElement() { } @@ -417,6 +433,289 @@ internal ExtendedClinicalCodedElement() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class FhirR4Annotation : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Annotation(string text) { } + public string AuthorString { get { throw null; } set { } } + public string Text { get { throw null; } } + public string Time { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Annotation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Annotation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4CodeableConcept : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4CodeableConcept() { } + public System.Collections.Generic.IList Coding { get { throw null; } } + public string Text { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Coding : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Coding() { } + public string Code { get { throw null; } set { } } + public string Display { get { throw null; } set { } } + public string System { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Coding System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Coding System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4ContactDetail : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4ContactDetail() { } + public string Name { get { throw null; } set { } } + public System.Collections.Generic.IList Telecom { get { throw null; } } + Azure.Health.Insights.ClinicalMatching.FhirR4ContactDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4ContactDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4ContactPoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4ContactPoint() { } + public Azure.Health.Insights.ClinicalMatching.FhirR4Period Period { get { throw null; } set { } } + public int? Rank { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.ContactPointSystem? System { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.ContactPointUse? Use { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4ContactPoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4ContactPoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class FhirR4DomainResource : Azure.Health.Insights.ClinicalMatching.FhirR4Resource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected FhirR4DomainResource(string resourceType) : base (default(string)) { } + public System.Collections.Generic.IList Contained { get { throw null; } } + public System.Collections.Generic.IList Extension { get { throw null; } } + public System.Collections.Generic.IList ModifierExtension { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Narrative Text { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4DomainResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4DomainResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Element : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FhirR4Element() { } + public System.Collections.Generic.IReadOnlyList Extension { get { throw null; } } + public string Id { get { throw null; } } + Azure.Health.Insights.ClinicalMatching.FhirR4Element System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Element System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Extendible : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Extendible() { } + public Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept Code { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList Extension { get { throw null; } } + Azure.Health.Insights.ClinicalMatching.FhirR4Extendible System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Extendible System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Extension : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Extension(string url) { } + public string Url { get { throw null; } } + public bool? ValueBoolean { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept ValueCodeableConcept { get { throw null; } set { } } + public string ValueDateTime { get { throw null; } set { } } + public int? ValueInteger { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Period ValuePeriod { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Quantity ValueQuantity { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Range ValueRange { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Ratio ValueRatio { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Reference ValueReference { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4SampledData ValueSampledData { get { throw null; } set { } } + public string ValueString { get { throw null; } set { } } + public System.TimeSpan? ValueTime { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Extension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Extension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Identifier : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Identifier() { } + public Azure.Health.Insights.ClinicalMatching.FhirR4Reference Assigner { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Period Period { get { throw null; } set { } } + public string System { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept Type { get { throw null; } set { } } + public string Use { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Identifier System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Identifier System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Meta : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Meta() { } + public string LastUpdated { get { throw null; } set { } } + public System.Collections.Generic.IList Profile { get { throw null; } } + public System.Collections.Generic.IList Security { get { throw null; } } + public string Source { get { throw null; } set { } } + public System.Collections.Generic.IList Tag { get { throw null; } } + public string VersionId { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Meta System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Meta System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Narrative : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Narrative(string status, string div) { } + public string Div { get { throw null; } } + public string Status { get { throw null; } } + Azure.Health.Insights.ClinicalMatching.FhirR4Narrative System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Narrative System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Period : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Period() { } + public string End { get { throw null; } set { } } + public string Start { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Period System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Period System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Quantity : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Quantity() { } + public string Code { get { throw null; } set { } } + public string Comparator { get { throw null; } set { } } + public string System { get { throw null; } set { } } + public string Unit { get { throw null; } set { } } + public double? Value { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Quantity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Quantity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Range : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Range() { } + public Azure.Health.Insights.ClinicalMatching.FhirR4Quantity High { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Quantity Low { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Range System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Range System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Ratio : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Ratio() { } + public Azure.Health.Insights.ClinicalMatching.FhirR4Quantity Denominator { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Quantity Numerator { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Ratio System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Ratio System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Reference : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Reference() { } + public string Display { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Identifier Identifier { get { throw null; } set { } } + public string Reference { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4Reference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Reference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4ResearchStudy : Azure.Health.Insights.ClinicalMatching.FhirR4DomainResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4ResearchStudy(Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType status) : base (default(string)) { } + public System.Collections.Generic.IList Arm { get { throw null; } } + public System.Collections.Generic.IList Category { get { throw null; } } + public System.Collections.Generic.IList Condition { get { throw null; } } + public System.Collections.Generic.IList Contact { get { throw null; } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList Enrollment { get { throw null; } } + public System.Collections.Generic.IList Focus { get { throw null; } } + public System.Collections.Generic.IList Identifier { get { throw null; } } + public System.Collections.Generic.IList Keyword { get { throw null; } } + public System.Collections.Generic.IList Location { get { throw null; } } + public System.Collections.Generic.IList Note { get { throw null; } } + public System.Collections.Generic.IList Objective { get { throw null; } } + public System.Collections.Generic.IList PartOf { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Period Period { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept Phase { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept PrimaryPurposeType { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Reference PrincipalInvestigator { get { throw null; } set { } } + public System.Collections.Generic.IList Protocol { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept ReasonStopped { get { throw null; } set { } } + public System.Collections.Generic.IList Site { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Reference Sponsor { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType Status { get { throw null; } } + public string Title { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4ResearchStudy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4ResearchStudy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4Resource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4Resource(string resourceType) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public string Id { get { throw null; } set { } } + public string ImplicitRules { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Meta Meta { get { throw null; } set { } } + public string ResourceType { get { throw null; } } + Azure.Health.Insights.ClinicalMatching.FhirR4Resource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4Resource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FhirR4SampledData : Azure.Health.Insights.ClinicalMatching.FhirR4Element, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FhirR4SampledData(Azure.Health.Insights.ClinicalMatching.FhirR4Quantity origin, double period, int dimensions) { } + public string Data { get { throw null; } set { } } + public int Dimensions { get { throw null; } } + public double? Factor { get { throw null; } set { } } + public double? LowerLimit { get { throw null; } set { } } + public Azure.Health.Insights.ClinicalMatching.FhirR4Quantity Origin { get { throw null; } } + public double Period { get { throw null; } } + public double? UpperLimit { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.FhirR4SampledData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.FhirR4SampledData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class GeographicArea : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GeographicArea(Azure.Health.Insights.ClinicalMatching.GeoJsonType type, Azure.Health.Insights.ClinicalMatching.AreaGeometry geometry, Azure.Health.Insights.ClinicalMatching.AreaProperties properties) { } @@ -494,26 +793,64 @@ public GeographicLocation(string countryOrRegion) { } } public static partial class HealthInsightsClinicalMatchingModelFactory { + public static Azure.Health.Insights.ClinicalMatching.ClinicalCodedElement ClinicalCodedElement(string system = null, string code = null, string name = null, string value = null) { throw null; } public static Azure.Health.Insights.ClinicalMatching.ClinicalNoteEvidence ClinicalNoteEvidence(string id = null, string text = null, int offset = 0, int length = 0) { throw null; } - public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialDetails ClinicalTrialDetails(string id = null, string eligibilityCriteriaText = null, Azure.Health.Insights.ClinicalMatching.ClinicalTrialDemographics demographics = null, Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata metadata = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata ClinicalTrialMetadata(System.Collections.Generic.IEnumerable phases = null, Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType? studyType = default(Azure.Health.Insights.ClinicalMatching.ClinicalTrialStudyType?), Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus? recruitmentStatus = default(Azure.Health.Insights.ClinicalMatching.ClinicalTrialRecruitmentStatus?), System.Collections.Generic.IEnumerable conditions = null, System.Collections.Generic.IEnumerable sponsors = null, System.Collections.Generic.IEnumerable contacts = null, System.Collections.Generic.IEnumerable facilities = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ClinicalTrialResearchFacility ClinicalTrialResearchFacility(string name = null, string city = null, string state = null, string countryOrRegion = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ContactDetails ContactDetails(string name = null, string email = null, string phone = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.Encounter Encounter(string id = null, Azure.Health.Insights.ClinicalMatching.TimePeriod period = null, Azure.Health.Insights.ClinicalMatching.EncounterClass? @class = default(Azure.Health.Insights.ClinicalMatching.EncounterClass?)) { throw null; } public static Azure.Health.Insights.ClinicalMatching.ExtendedClinicalCodedElement ExtendedClinicalCodedElement(string system = null, string code = null, string name = null, string value = null, string semanticType = null, string category = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Annotation FhirR4Annotation(string id = null, System.Collections.Generic.IEnumerable extension = null, string authorString = null, string time = null, string text = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept FhirR4CodeableConcept(string id = null, System.Collections.Generic.IEnumerable extension = null, System.Collections.Generic.IEnumerable coding = null, string text = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Coding FhirR4Coding(string id = null, System.Collections.Generic.IEnumerable extension = null, string system = null, string version = null, string code = null, string display = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4ContactDetail FhirR4ContactDetail(string id = null, System.Collections.Generic.IEnumerable extension = null, string name = null, System.Collections.Generic.IEnumerable telecom = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4DomainResource FhirR4DomainResource(string resourceType = null, string id = null, Azure.Health.Insights.ClinicalMatching.FhirR4Meta meta = null, string implicitRules = null, string language = null, System.Collections.Generic.IDictionary additionalProperties = null, Azure.Health.Insights.ClinicalMatching.FhirR4Narrative text = null, System.Collections.Generic.IEnumerable contained = null, System.Collections.Generic.IEnumerable extension = null, System.Collections.Generic.IEnumerable modifierExtension = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Element FhirR4Element(string id = null, System.Collections.Generic.IEnumerable extension = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Extension FhirR4Extension(string id = null, System.Collections.Generic.IEnumerable extension = null, string url = null, Azure.Health.Insights.ClinicalMatching.FhirR4Quantity valueQuantity = null, Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept valueCodeableConcept = null, string valueString = null, bool? valueBoolean = default(bool?), int? valueInteger = default(int?), Azure.Health.Insights.ClinicalMatching.FhirR4Range valueRange = null, Azure.Health.Insights.ClinicalMatching.FhirR4Ratio valueRatio = null, Azure.Health.Insights.ClinicalMatching.FhirR4SampledData valueSampledData = null, System.TimeSpan? valueTime = default(System.TimeSpan?), string valueDateTime = null, Azure.Health.Insights.ClinicalMatching.FhirR4Period valuePeriod = null, Azure.Health.Insights.ClinicalMatching.FhirR4Reference valueReference = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Identifier FhirR4Identifier(string id = null, System.Collections.Generic.IEnumerable extension = null, string use = null, Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept type = null, string system = null, string value = null, Azure.Health.Insights.ClinicalMatching.FhirR4Period period = null, Azure.Health.Insights.ClinicalMatching.FhirR4Reference assigner = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Narrative FhirR4Narrative(string id = null, System.Collections.Generic.IEnumerable extension = null, string status = null, string div = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Period FhirR4Period(string id = null, System.Collections.Generic.IEnumerable extension = null, string start = null, string end = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Quantity FhirR4Quantity(string id = null, System.Collections.Generic.IEnumerable extension = null, double? value = default(double?), string comparator = null, string unit = null, string system = null, string code = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Range FhirR4Range(string id = null, System.Collections.Generic.IEnumerable extension = null, Azure.Health.Insights.ClinicalMatching.FhirR4Quantity low = null, Azure.Health.Insights.ClinicalMatching.FhirR4Quantity high = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Ratio FhirR4Ratio(string id = null, System.Collections.Generic.IEnumerable extension = null, Azure.Health.Insights.ClinicalMatching.FhirR4Quantity numerator = null, Azure.Health.Insights.ClinicalMatching.FhirR4Quantity denominator = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Reference FhirR4Reference(string id = null, System.Collections.Generic.IEnumerable extension = null, string reference = null, string type = null, Azure.Health.Insights.ClinicalMatching.FhirR4Identifier identifier = null, string display = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4ResearchStudy FhirR4ResearchStudy(string id = null, Azure.Health.Insights.ClinicalMatching.FhirR4Meta meta = null, string implicitRules = null, string language = null, System.Collections.Generic.IDictionary additionalProperties = null, Azure.Health.Insights.ClinicalMatching.FhirR4Narrative text = null, System.Collections.Generic.IEnumerable contained = null, System.Collections.Generic.IEnumerable extension = null, System.Collections.Generic.IEnumerable modifierExtension = null, System.Collections.Generic.IEnumerable identifier = null, string title = null, System.Collections.Generic.IEnumerable protocol = null, System.Collections.Generic.IEnumerable partOf = null, Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType status = default(Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType), Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept primaryPurposeType = null, Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept phase = null, System.Collections.Generic.IEnumerable category = null, System.Collections.Generic.IEnumerable focus = null, System.Collections.Generic.IEnumerable condition = null, System.Collections.Generic.IEnumerable contact = null, System.Collections.Generic.IEnumerable keyword = null, System.Collections.Generic.IEnumerable location = null, string description = null, System.Collections.Generic.IEnumerable enrollment = null, Azure.Health.Insights.ClinicalMatching.FhirR4Period period = null, Azure.Health.Insights.ClinicalMatching.FhirR4Reference sponsor = null, Azure.Health.Insights.ClinicalMatching.FhirR4Reference principalInvestigator = null, System.Collections.Generic.IEnumerable site = null, Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept reasonStopped = null, System.Collections.Generic.IEnumerable note = null, System.Collections.Generic.IEnumerable arm = null, System.Collections.Generic.IEnumerable objective = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4Resource FhirR4Resource(string resourceType = null, string id = null, Azure.Health.Insights.ClinicalMatching.FhirR4Meta meta = null, string implicitRules = null, string language = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.FhirR4SampledData FhirR4SampledData(string id = null, System.Collections.Generic.IEnumerable extension = null, Azure.Health.Insights.ClinicalMatching.FhirR4Quantity origin = null, double period = 0, double? factor = default(double?), double? lowerLimit = default(double?), double? upperLimit = default(double?), int dimensions = 0, string data = null) { throw null; } public static Azure.Health.Insights.ClinicalMatching.GeographicLocation GeographicLocation(string city = null, string state = null, string countryOrRegion = null) { throw null; } - public static Azure.Health.Insights.ClinicalMatching.PatientDocument PatientDocument(Azure.Health.Insights.ClinicalMatching.DocumentType type = default(Azure.Health.Insights.ClinicalMatching.DocumentType), Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType? clinicalType = default(Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType?), string id = null, string language = null, System.DateTimeOffset? createdDateTime = default(System.DateTimeOffset?), Azure.Health.Insights.ClinicalMatching.DocumentContent content = null) { throw null; } - public static Azure.Health.Insights.ClinicalMatching.PatientRecord PatientRecord(string id = null, Azure.Health.Insights.ClinicalMatching.PatientInfo info = null, System.Collections.Generic.IEnumerable data = null) { throw null; } - public static Azure.Health.Insights.ClinicalMatching.TrialMatcherInference TrialMatcherInference(Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType type = default(Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType), string value = null, string description = null, float? confidenceScore = default(float?), System.Collections.Generic.IEnumerable evidence = null, string id = null, Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource? source = default(Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource?), Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata metadata = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.PatientDocument PatientDocument(Azure.Health.Insights.ClinicalMatching.DocumentType type = default(Azure.Health.Insights.ClinicalMatching.DocumentType), Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType? clinicalType = default(Azure.Health.Insights.ClinicalMatching.ClinicalDocumentType?), string id = null, string language = null, System.DateTimeOffset? createdDateTime = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable authors = null, Azure.Health.Insights.ClinicalMatching.SpecialtyType? specialtyType = default(Azure.Health.Insights.ClinicalMatching.SpecialtyType?), Azure.Health.Insights.ClinicalMatching.DocumentAdministrativeMetadata administrativeMetadata = null, Azure.Health.Insights.ClinicalMatching.DocumentContent content = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.PatientRecord PatientRecord(string id = null, Azure.Health.Insights.ClinicalMatching.PatientDetails info = null, System.Collections.Generic.IEnumerable encounters = null, System.Collections.Generic.IEnumerable patientDocuments = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyArm ResearchStudyArm(string name = null, Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept type = null, string description = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyObjective ResearchStudyObjective(string name = null, Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept type = null) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.TrialMatcherInference TrialMatcherInference(Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType type = default(Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceType), string value = null, string description = null, float? confidenceScore = default(float?), System.Collections.Generic.IEnumerable evidence = null, string clinicalTrialId = null, Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource? source = default(Azure.Health.Insights.ClinicalMatching.ClinicalTrialSource?), Azure.Health.Insights.ClinicalMatching.ClinicalTrialMetadata metadata = null) { throw null; } public static Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceEvidence TrialMatcherInferenceEvidence(string eligibilityCriteriaEvidence = null, Azure.Health.Insights.ClinicalMatching.ClinicalNoteEvidence patientDataEvidence = null, Azure.Health.Insights.ClinicalMatching.ClinicalCodedElement patientInfoEvidence = null, float? importance = default(float?)) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceResult TrialMatcherInferenceResult(System.Collections.Generic.IEnumerable patientResults = null, string modelVersion = null, System.DateTimeOffset? knowledgeGraphLastUpdateDate = default(System.DateTimeOffset?)) { throw null; } public static Azure.Health.Insights.ClinicalMatching.TrialMatcherModelConfiguration TrialMatcherModelConfiguration(bool? verbose = default(bool?), bool? includeEvidence = default(bool?), Azure.Health.Insights.ClinicalMatching.ClinicalTrials clinicalTrials = null) { throw null; } - public static Azure.Health.Insights.ClinicalMatching.TrialMatcherPatientResult TrialMatcherPatientResult(string id = null, System.Collections.Generic.IEnumerable inferences = null, System.Collections.Generic.IEnumerable neededClinicalInfo = null) { throw null; } - public static Azure.Health.Insights.ClinicalMatching.TrialMatcherResults TrialMatcherResults(System.Collections.Generic.IEnumerable patients = null, string modelVersion = null, System.DateTimeOffset? knowledgeGraphLastUpdateDate = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.TrialMatcherPatientResult TrialMatcherPatientResult(string patientId = null, System.Collections.Generic.IEnumerable inferences = null, System.Collections.Generic.IEnumerable neededClinicalInfo = null) { throw null; } + } + public partial class PatientDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PatientDetails() { } + public System.DateTimeOffset? BirthDate { get { throw null; } set { } } + public System.Collections.Generic.IList ClinicalInfo { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.PatientSex? Sex { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.PatientDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.PatientDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class PatientDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PatientDocument(Azure.Health.Insights.ClinicalMatching.DocumentType type, string id, Azure.Health.Insights.ClinicalMatching.DocumentContent content) { } + public Azure.Health.Insights.ClinicalMatching.DocumentAdministrativeMetadata AdministrativeMetadata { get { throw null; } set { } } + public System.Collections.Generic.IList Authors { get { throw null; } } 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.SpecialtyType? SpecialtyType { get { throw null; } set { } } public Azure.Health.Insights.ClinicalMatching.DocumentType Type { get { throw null; } } Azure.Health.Insights.ClinicalMatching.PatientDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -521,48 +858,116 @@ public PatientDocument(Azure.Health.Insights.ClinicalMatching.DocumentType type, string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class PatientInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PatientRecord : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - 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 { } } - Azure.Health.Insights.ClinicalMatching.PatientInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.ClinicalMatching.PatientInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public PatientRecord(string id) { } + public System.Collections.Generic.IList Encounters { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.PatientDetails Info { get { throw null; } set { } } + public System.Collections.Generic.IList PatientDocuments { get { throw null; } } + Azure.Health.Insights.ClinicalMatching.PatientRecord System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.PatientRecord System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct PatientInfoSex : System.IEquatable + public readonly partial struct PatientSex : 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; } + public PatientSex(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.PatientSex Female { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.PatientSex Male { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.PatientSex Unspecified { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.PatientSex 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 static bool operator ==(Azure.Health.Insights.ClinicalMatching.PatientSex left, Azure.Health.Insights.ClinicalMatching.PatientSex right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.PatientSex (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.PatientSex left, Azure.Health.Insights.ClinicalMatching.PatientSex right) { throw null; } public override string ToString() { throw null; } } - public partial class PatientRecord : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ResearchStudyArm : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - 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 { } } - Azure.Health.Insights.ClinicalMatching.PatientRecord System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.ClinicalMatching.PatientRecord System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public ResearchStudyArm(string name) { } + public string Description { get { throw null; } set { } } + public string Name { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept Type { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.ResearchStudyArm System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.ResearchStudyArm System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResearchStudyObjective : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResearchStudyObjective(string name) { } + public string Name { get { throw null; } } + public Azure.Health.Insights.ClinicalMatching.FhirR4CodeableConcept Type { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.ResearchStudyObjective System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.ResearchStudyObjective System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResearchStudyStatusCodeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResearchStudyStatusCodeType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType Active { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType AdministrativelyCompleted { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType Approved { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType ClosedToAccrual { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType ClosedToAccrualAndIntervention { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType Completed { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType Disapproved { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType InReview { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType TemporarilyClosedToAccrual { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType TemporarilyClosedToAccrualAndIntervention { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType Withdrawn { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType 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.ResearchStudyStatusCodeType left, Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType left, Azure.Health.Insights.ClinicalMatching.ResearchStudyStatusCodeType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SpecialtyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SpecialtyType(string value) { throw null; } + public static Azure.Health.Insights.ClinicalMatching.SpecialtyType Pathology { get { throw null; } } + public static Azure.Health.Insights.ClinicalMatching.SpecialtyType Radiology { get { throw null; } } + public bool Equals(Azure.Health.Insights.ClinicalMatching.SpecialtyType 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.SpecialtyType left, Azure.Health.Insights.ClinicalMatching.SpecialtyType right) { throw null; } + public static implicit operator Azure.Health.Insights.ClinicalMatching.SpecialtyType (string value) { throw null; } + public static bool operator !=(Azure.Health.Insights.ClinicalMatching.SpecialtyType left, Azure.Health.Insights.ClinicalMatching.SpecialtyType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TimePeriod : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TimePeriod() { } + public System.DateTimeOffset? End { get { throw null; } set { } } + public System.DateTimeOffset? Start { get { throw null; } set { } } + Azure.Health.Insights.ClinicalMatching.TimePeriod System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.TimePeriod System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class TrialMatcherData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -578,10 +983,10 @@ public TrialMatcherData(System.Collections.Generic.IEnumerable, System.ClientModel.Primitives.IPersistableModel { internal TrialMatcherInference() { } + public string ClinicalTrialId { 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 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; } } @@ -605,6 +1010,18 @@ internal TrialMatcherInferenceEvidence() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class TrialMatcherInferenceResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrialMatcherInferenceResult() { } + public System.DateTimeOffset? KnowledgeGraphLastUpdateDate { get { throw null; } } + public string ModelVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PatientResults { get { throw null; } } + Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Health.Insights.ClinicalMatching.TrialMatcherInferenceResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct TrialMatcherInferenceType : System.IEquatable { @@ -637,27 +1054,15 @@ public TrialMatcherModelConfiguration(Azure.Health.Insights.ClinicalMatching.Cli public partial class TrialMatcherPatientResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { 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 string PatientId { get { throw null; } } Azure.Health.Insights.ClinicalMatching.TrialMatcherPatientResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Health.Insights.ClinicalMatching.TrialMatcherPatientResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class TrialMatcherResults : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal TrialMatcherResults() { } - public System.DateTimeOffset? KnowledgeGraphLastUpdateDate { get { throw null; } } - public string ModelVersion { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Patients { get { throw null; } } - Azure.Health.Insights.ClinicalMatching.TrialMatcherResults System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Health.Insights.ClinicalMatching.TrialMatcherResults System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } } namespace Microsoft.Extensions.Azure { diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AgeUnit.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AgeUnit.cs deleted file mode 100644 index 0fe84b951dce6..0000000000000 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AgeUnit.cs +++ /dev/null @@ -1,54 +0,0 @@ -// 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/ClinicalCodedElement.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.cs index d9ae974ce62b0..f52849d5b8e44 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalCodedElement.cs @@ -50,7 +50,7 @@ public partial class 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) + internal ClinicalCodedElement(string system, string code) { Argument.AssertNotNull(system, nameof(system)); Argument.AssertNotNull(code, nameof(code)); @@ -80,12 +80,12 @@ internal ClinicalCodedElement() } /// The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. - public string System { get; set; } + public string System { get; } /// The code within the given clinical coding system. - public string Code { get; set; } + public string Code { get; } /// The name of this coded concept in the coding system. - public string Name { get; set; } + public string Name { get; } /// A value associated with the code within the given clinical coding system. - public string Value { get; set; } + public string Value { get; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalDocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalDocumentType.cs index 191b1d6a43171..dfc6ea273b9da 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalDocumentType.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalDocumentType.cs @@ -25,11 +25,11 @@ public ClinicalDocumentType(string value) private const string ConsultationValue = "consultation"; private const string DischargeSummaryValue = "dischargeSummary"; private const string HistoryAndPhysicalValue = "historyAndPhysical"; + private const string RadiologyReportValue = "radiologyReport"; 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"; + private const string PathologyReportValue = "pathologyReport"; /// consultation. public static ClinicalDocumentType Consultation { get; } = new ClinicalDocumentType(ConsultationValue); @@ -37,16 +37,16 @@ public ClinicalDocumentType(string value) public static ClinicalDocumentType DischargeSummary { get; } = new ClinicalDocumentType(DischargeSummaryValue); /// historyAndPhysical. public static ClinicalDocumentType HistoryAndPhysical { get; } = new ClinicalDocumentType(HistoryAndPhysicalValue); + /// radiologyReport. + public static ClinicalDocumentType RadiologyReport { get; } = new ClinicalDocumentType(RadiologyReportValue); /// 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); + /// pathologyReport. + public static ClinicalDocumentType PathologyReport { get; } = new ClinicalDocumentType(PathologyReportValue); /// 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. diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs index db8a132ce7e33..74baa3e2ed11e 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs @@ -69,14 +69,14 @@ public ClinicalMatchingClient(Uri endpoint, AzureKeyCredential credential, Clini /// is null. /// Creates a Trial Matcher job with the given request body. /// - public virtual async Task> MatchTrialsAsync(WaitUntil waitUntil, TrialMatcherData trialMatcherData, CancellationToken cancellationToken = default) + public virtual async Task> MatchTrialsAsync(WaitUntil waitUntil, TrialMatcherData trialMatcherData, CancellationToken cancellationToken = default) { Argument.AssertNotNull(trialMatcherData, nameof(trialMatcherData)); RequestContext context = FromCancellationToken(cancellationToken); using RequestContent content = trialMatcherData.ToRequestContent(); Operation response = await MatchTrialsAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchTrialMatcherResultsFromTrialMatcherResult, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials"); + return ProtocolOperationHelpers.Convert(response, FetchTrialMatcherInferenceResultFromTrialMatcherResult, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials"); } /// Create Trial Matcher job. @@ -86,14 +86,14 @@ public virtual async Task> MatchTrialsAsync(WaitU /// is null. /// Creates a Trial Matcher job with the given request body. /// - public virtual Operation MatchTrials(WaitUntil waitUntil, TrialMatcherData trialMatcherData, CancellationToken cancellationToken = default) + public virtual Operation MatchTrials(WaitUntil waitUntil, TrialMatcherData trialMatcherData, CancellationToken cancellationToken = default) { Argument.AssertNotNull(trialMatcherData, nameof(trialMatcherData)); RequestContext context = FromCancellationToken(cancellationToken); using RequestContent content = trialMatcherData.ToRequestContent(); Operation response = MatchTrials(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, FetchTrialMatcherResultsFromTrialMatcherResult, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials"); + return ProtocolOperationHelpers.Convert(response, FetchTrialMatcherInferenceResultFromTrialMatcherResult, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials"); } /// @@ -178,13 +178,13 @@ public virtual Operation MatchTrials(WaitUntil waitUntil, RequestCon internal HttpMessage CreateMatchTrialsRequest(RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(context, ResponseClassifier200202); + var message = _pipeline.CreateMessage(context, ResponseClassifier202); 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.AppendRaw("/health-insights", false); + uri.AppendPath("/trial-matcher/jobs", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -206,13 +206,13 @@ internal static RequestContext FromCancellationToken(CancellationToken cancellat return new RequestContext() { CancellationToken = cancellationToken }; } - private static ResponseClassifier _responseClassifier200202; - private static ResponseClassifier ResponseClassifier200202 => _responseClassifier200202 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 202 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); - private TrialMatcherResults FetchTrialMatcherResultsFromTrialMatcherResult(Response response) + private TrialMatcherInferenceResult FetchTrialMatcherInferenceResultFromTrialMatcherResult(Response response) { - var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("results"); - return TrialMatcherResults.DeserializeTrialMatcherResults(resultJsonElement); + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return TrialMatcherInferenceResult.DeserializeTrialMatcherInferenceResult(resultJsonElement); } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClientOptions.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClientOptions.cs index aee7822e8c4b5..19f2ab3d99545 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClientOptions.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClientOptions.cs @@ -13,13 +13,13 @@ namespace Azure.Health.Insights.ClinicalMatching /// Client options for ClinicalMatchingClient. public partial class ClinicalMatchingClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2023_03_01_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2023_09_01_Preview; /// The version of the service to use. public enum ServiceVersion { - /// Service version "2023-03-01-preview". - V2023_03_01_Preview = 1, + /// Service version "2023-09-01-preview". + V2023_09_01_Preview = 1, } internal string Version { get; } @@ -29,7 +29,7 @@ public ClinicalMatchingClientOptions(ServiceVersion version = LatestVersion) { Version = version switch { - ServiceVersion.V2023_03_01_Preview => "2023-03-01-preview", + ServiceVersion.V2023_09_01_Preview => "2023-09-01-preview", _ => throw new NotSupportedException() }; } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialAcceptedSex.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialAcceptedSex.cs deleted file mode 100644 index 2828de5a8924f..0000000000000 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialAcceptedSex.cs +++ /dev/null @@ -1,54 +0,0 @@ -// 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/ClinicalTrialDetails.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.cs deleted file mode 100644 index 1a0a257cc2c14..0000000000000 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDetails.cs +++ /dev/null @@ -1,91 +0,0 @@ -// 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 description of a clinical trial. - public partial class ClinicalTrialDetails - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// 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; - } - - /// Initializes a new instance of . - /// A given identifier for the clinical trial. Has to be unique within a list of clinical trials. - /// The eligibility criteria of the clinical trial (inclusion and exclusion), given as text. - /// Demographic criteria for a clinical trial. - /// Trial data which is of interest to the potential participant. - /// Keeps track of any properties unknown to the library. - internal ClinicalTrialDetails(string id, string eligibilityCriteriaText, ClinicalTrialDemographics demographics, ClinicalTrialMetadata metadata, IDictionary serializedAdditionalRawData) - { - Id = id; - EligibilityCriteriaText = eligibilityCriteriaText; - Demographics = demographics; - Metadata = metadata; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ClinicalTrialDetails() - { - } - - /// 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 index d29d861095fc4..48c628360f75c 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 @@ -122,13 +122,13 @@ internal static ClinicalTrialMetadata DeserializeClinicalTrialMetadata(JsonEleme { return null; } - Optional> phases = default; + Optional> phases = default; Optional studyType = default; Optional recruitmentStatus = default; - IList conditions = default; - Optional> sponsors = default; - Optional> contacts = default; - Optional> facilities = default; + IReadOnlyList conditions = default; + Optional> sponsors = default; + Optional> contacts = default; + Optional> facilities = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.cs index f9b62b83410aa..15c7621210918 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialMetadata.cs @@ -50,7 +50,7 @@ public partial class ClinicalTrialMetadata /// Initializes a new instance of . /// Medical conditions and their synonyms which are relevant for the clinical trial, given as strings. /// is null. - public ClinicalTrialMetadata(IEnumerable conditions) + internal ClinicalTrialMetadata(IEnumerable conditions) { Argument.AssertNotNull(conditions, nameof(conditions)); @@ -73,7 +73,7 @@ public ClinicalTrialMetadata(IEnumerable conditions) /// Contact details of the trial administrators, for patients that want to participate in the trial. /// Research facilities where the clinical trial is conducted. /// Keeps track of any properties unknown to the library. - internal ClinicalTrialMetadata(IList phases, ClinicalTrialStudyType? studyType, ClinicalTrialRecruitmentStatus? recruitmentStatus, IList conditions, IList sponsors, IList contacts, IList facilities, IDictionary serializedAdditionalRawData) + internal ClinicalTrialMetadata(IReadOnlyList phases, ClinicalTrialStudyType? studyType, ClinicalTrialRecruitmentStatus? recruitmentStatus, IReadOnlyList conditions, IReadOnlyList sponsors, IReadOnlyList contacts, IReadOnlyList facilities, IDictionary serializedAdditionalRawData) { Phases = phases; StudyType = studyType; @@ -94,18 +94,18 @@ internal ClinicalTrialMetadata() /// 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; } + public IReadOnlyList Phases { get; } /// Possible study types of a clinical trial. - public ClinicalTrialStudyType? StudyType { get; set; } + public ClinicalTrialStudyType? StudyType { get; } /// Possible recruitment status of a clinical trial. - public ClinicalTrialRecruitmentStatus? RecruitmentStatus { get; set; } + public ClinicalTrialRecruitmentStatus? RecruitmentStatus { get; } /// Medical conditions and their synonyms which are relevant for the clinical trial, given as strings. - public IList Conditions { get; } + public IReadOnlyList Conditions { get; } /// Sponsors/collaborators involved with the trial. - public IList Sponsors { get; } + public IReadOnlyList Sponsors { get; } /// Contact details of the trial administrators, for patients that want to participate in the trial. - public IList Contacts { get; } + public IReadOnlyList Contacts { get; } /// Research facilities where the clinical trial is conducted. - public IList Facilities { get; } + public IReadOnlyList Facilities { get; } } } 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 8bebaf6d1be4a..72c040a2b5c6e 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialResearchFacility.cs @@ -50,7 +50,7 @@ public partial class ClinicalTrialResearchFacility /// The facility's name. /// Country/region name. /// or is null. - public ClinicalTrialResearchFacility(string name, string countryOrRegion) + internal ClinicalTrialResearchFacility(string name, string countryOrRegion) { Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(countryOrRegion, nameof(countryOrRegion)); @@ -80,12 +80,12 @@ internal ClinicalTrialResearchFacility() } /// The facility's name. - public string Name { get; set; } + public string Name { get; } /// City name. - public string City { get; set; } + public string City { get; } /// State name. - public string State { get; set; } + public string State { get; } /// Country/region name. - public string CountryOrRegion { get; set; } + public string CountryOrRegion { get; } } } 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 index 7b51ac5646c02..58a9ea0c4e6b4 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.Serialization.cs @@ -85,7 +85,7 @@ internal static ClinicalTrials DeserializeClinicalTrials(JsonElement element, Mo { return null; } - Optional> customTrials = default; + Optional> customTrials = default; Optional> registryFilters = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); @@ -97,10 +97,10 @@ internal static ClinicalTrials DeserializeClinicalTrials(JsonElement element, Mo { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ClinicalTrialDetails.DeserializeClinicalTrialDetails(item)); + array.Add(FhirR4ResearchStudy.DeserializeFhirR4ResearchStudy(item)); } customTrials = array; continue; diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.cs index fabf40cd016ee..4cda38acb940e 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrials.cs @@ -53,7 +53,7 @@ public partial class ClinicalTrials /// Initializes a new instance of . public ClinicalTrials() { - CustomTrials = new ChangeTrackingList(); + CustomTrials = new ChangeTrackingList(); RegistryFilters = new ChangeTrackingList(); } @@ -64,7 +64,7 @@ public ClinicalTrials() /// clinical trial registry. /// /// Keeps track of any properties unknown to the library. - internal ClinicalTrials(IList customTrials, IList registryFilters, IDictionary serializedAdditionalRawData) + internal ClinicalTrials(IList customTrials, IList registryFilters, IDictionary serializedAdditionalRawData) { CustomTrials = customTrials; RegistryFilters = registryFilters; @@ -72,7 +72,7 @@ internal ClinicalTrials(IList customTrials, IList A list of clinical trials. - public IList CustomTrials { get; } + public IList CustomTrials { get; } /// /// A list of filters, each one creating a selection of trials from a given /// clinical trial registry. diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.cs index d905dc188d709..25f2ee24e4527 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactDetails.cs @@ -46,7 +46,7 @@ public partial class ContactDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public ContactDetails() + internal ContactDetails() { } @@ -64,10 +64,10 @@ internal ContactDetails(string name, string email, string phone, IDictionary The person's name. - public string Name { get; set; } + public string Name { get; } /// The person's email. - public string Email { get; set; } + public string Email { get; } /// A person's phone number. - public string Phone { get; set; } + public string Phone { get; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactPointSystem.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactPointSystem.cs new file mode 100644 index 0000000000000..c750ee1002476 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactPointSystem.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 +{ + /// + /// Contact Point System + /// see https://www.hl7.org/fhir/R4/valueset-contact-point-system.html + /// + public readonly partial struct ContactPointSystem : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContactPointSystem(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PhoneValue = "phone"; + private const string FaxValue = "fax"; + private const string EmailValue = "email"; + private const string PagerValue = "pager"; + private const string UrlValue = "url"; + private const string SmsValue = "sms"; + private const string OtherValue = "other"; + + /// Phone. + public static ContactPointSystem Phone { get; } = new ContactPointSystem(PhoneValue); + /// Fax. + public static ContactPointSystem Fax { get; } = new ContactPointSystem(FaxValue); + /// Email. + public static ContactPointSystem Email { get; } = new ContactPointSystem(EmailValue); + /// Pager. + public static ContactPointSystem Pager { get; } = new ContactPointSystem(PagerValue); + /// Url. + public static ContactPointSystem Url { get; } = new ContactPointSystem(UrlValue); + /// Sms. + public static ContactPointSystem Sms { get; } = new ContactPointSystem(SmsValue); + /// Other. + public static ContactPointSystem Other { get; } = new ContactPointSystem(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(ContactPointSystem left, ContactPointSystem right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContactPointSystem left, ContactPointSystem right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ContactPointSystem(string value) => new ContactPointSystem(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContactPointSystem other && Equals(other); + /// + public bool Equals(ContactPointSystem 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/ContactPointUse.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactPointUse.cs new file mode 100644 index 0000000000000..1c58c6024a1ef --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ContactPointUse.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 +{ + /// + /// Contact Point Use + /// See: http://hl7.org/fhir/ValueSet/contact-point-use + /// + public readonly partial struct ContactPointUse : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContactPointUse(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HomeValue = "home"; + private const string WorkValue = "work"; + private const string TempValue = "temp"; + private const string OldValue = "old"; + private const string MobileValue = "mobile"; + + /// Home. + public static ContactPointUse Home { get; } = new ContactPointUse(HomeValue); + /// Work. + public static ContactPointUse Work { get; } = new ContactPointUse(WorkValue); + /// Temp. + public static ContactPointUse Temp { get; } = new ContactPointUse(TempValue); + /// Old. + public static ContactPointUse Old { get; } = new ContactPointUse(OldValue); + /// Mobile. + public static ContactPointUse Mobile { get; } = new ContactPointUse(MobileValue); + /// Determines if two values are the same. + public static bool operator ==(ContactPointUse left, ContactPointUse right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContactPointUse left, ContactPointUse right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ContactPointUse(string value) => new ContactPointUse(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContactPointUse other && Equals(other); + /// + public bool Equals(ContactPointUse 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/Docs/ClinicalMatchingClient.xml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Docs/ClinicalMatchingClient.xml index 7593c6ea374a8..e89d0963e72ed 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 @@ -13,8 +13,8 @@ TrialMatcherData trialMatcherData = new TrialMatcherData(new PatientRecord[] { new PatientRecord("") }); -Operation operation = await client.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); -TrialMatcherResults responseData = operation.Value; +Operation operation = await client.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); +TrialMatcherInferenceResult responseData = operation.Value; ]]> This sample shows how to call MatchTrialsAsync with all parameters. ") { - Info = new PatientInfo + Info = new PatientDetails { - Sex = PatientInfoSex.Female, + Sex = PatientSex.Female, BirthDate = DateTimeOffset.Parse("2022-05-10"), - ClinicalInfo = {new ClinicalCodedElement("", "") + ClinicalInfo = {new FhirR4Resource("") { - Name = "", - Value = "", + Id = "", + Meta = new FhirR4Meta + { + VersionId = "", + LastUpdated = "", + Source = "", + Profile = {""}, + Security = {new FhirR4Coding + { + System = "", + Version = "", + Code = "", + Display = "", + }}, + Tag = {default}, + }, + ImplicitRules = "", + Language = "", }}, }, - Data = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) + Encounters = {new Encounter("") + { + Period = new TimePeriod + { + Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + }, + Class = EncounterClass.InPatient, + }}, + PatientDocuments = {new PatientDocument(DocumentType.Note, "", new DocumentContent(DocumentContentSourceType.Inline, "")) { ClinicalType = ClinicalDocumentType.Consultation, Language = "", CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + Authors = {new DocumentAuthor + { + Id = "", + FullName = "", + }}, + SpecialtyType = SpecialtyType.Pathology, + AdministrativeMetadata = new DocumentAdministrativeMetadata + { + OrderedProcedures = {new FhirR4Extendible + { + Extension = {default}, + Code = default, + Description = "", + }}, + EncounterId = "", + }, }}, } }) { Configuration = new TrialMatcherModelConfiguration(new ClinicalTrials { - CustomTrials = {new ClinicalTrialDetails("", new ClinicalTrialMetadata(new string[]{""}) + CustomTrials = {new FhirR4ResearchStudy(ResearchStudyStatusCodeType.Active) { - Phases = {ClinicalTrialPhase.NotApplicable}, - StudyType = ClinicalTrialStudyType.Interventional, - RecruitmentStatus = ClinicalTrialRecruitmentStatus.UnknownStatus, - Sponsors = {""}, - Contacts = {new ContactDetails + Identifier = {default}, + Title = "", + Protocol = {default}, + PartOf = {default}, + PrimaryPurposeType = default, + Phase = default, + Category = {default}, + Focus = {default}, + Condition = {default}, + Contact = {new FhirR4ContactDetail { Name = "<name>", - Email = "<email>", - Phone = "<phone>", + Telecom = {new FhirR4ContactPoint + { + System = ContactPointSystem.Phone, + Value = "<value>", + Use = ContactPointUse.Home, + Rank = 1234, + Period = default, + }}, }}, - Facilities = {new ClinicalTrialResearchFacility("<name>", "<countryOrRegion>") + Keyword = {default}, + Location = {default}, + Description = "<description>", + Enrollment = {default}, + Period = default, + Sponsor = default, + PrincipalInvestigator = default, + Site = {default}, + ReasonStopped = default, + Note = {new FhirR4Annotation("<text>") { - City = "<city>", - State = "<state>", + AuthorString = "<authorString>", + Time = "<time>", }}, - }) - { - EligibilityCriteriaText = "<eligibilityCriteriaText>", - Demographics = new ClinicalTrialDemographics + Arm = {new ResearchStudyArm("<name>") { - AcceptedSex = ClinicalTrialAcceptedSex.All, - AcceptedAgeRange = new AcceptedAgeRange - { - MinimumAge = new AcceptedAge(AgeUnit.Years, 123.45F), - MaximumAge = default, - }, - }, + Type = default, + Description = "<description>", + }}, + Objective = {new ResearchStudyObjective("<name>") + { + Type = default, + }}, + Text = new FhirR4Narrative("<status>", "<div>"), + Contained = {default}, + Extension = {default}, + ModifierExtension = {default}, + Id = "<id>", + Meta = default, + ImplicitRules = "<implicitRules>", + Language = "<language>", }}, RegistryFilters = {new ClinicalTrialRegistryFilter { @@ -101,8 +167,8 @@ TrialMatcherData trialMatcherData = new TrialMatcherData(new PatientRecord[] IncludeEvidence = true, }, }; -Operation<TrialMatcherResults> operation = await client.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); -TrialMatcherResults responseData = operation.Value; +Operation<TrialMatcherInferenceResult> operation = await client.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); +TrialMatcherInferenceResult responseData = operation.Value; ]]></code></example> </member> <member name="MatchTrials(WaitUntil,TrialMatcherData,CancellationToken)"> @@ -117,8 +183,8 @@ TrialMatcherData trialMatcherData = new TrialMatcherData(new PatientRecord[] { new PatientRecord("<id>") }); -Operation<TrialMatcherResults> operation = client.MatchTrials(WaitUntil.Completed, trialMatcherData); -TrialMatcherResults responseData = operation.Value; +Operation<TrialMatcherInferenceResult> operation = client.MatchTrials(WaitUntil.Completed, trialMatcherData); +TrialMatcherInferenceResult responseData = operation.Value; ]]></code> This sample shows how to call MatchTrials with all parameters. <code><![CDATA[ @@ -130,56 +196,122 @@ TrialMatcherData trialMatcherData = new TrialMatcherData(new PatientRecord[] { new PatientRecord("<id>") { - Info = new PatientInfo + Info = new PatientDetails { - Sex = PatientInfoSex.Female, + Sex = PatientSex.Female, BirthDate = DateTimeOffset.Parse("2022-05-10"), - ClinicalInfo = {new ClinicalCodedElement("<system>", "<code>") + ClinicalInfo = {new FhirR4Resource("<resourceType>") { - Name = "<name>", - Value = "<value>", + Id = "<id>", + Meta = new FhirR4Meta + { + VersionId = "<versionId>", + LastUpdated = "<lastUpdated>", + Source = "<source>", + Profile = {"<profile>"}, + Security = {new FhirR4Coding + { + System = "<system>", + Version = "<version>", + Code = "<code>", + Display = "<display>", + }}, + Tag = {default}, + }, + ImplicitRules = "<implicitRules>", + Language = "<language>", }}, }, - Data = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) + Encounters = {new Encounter("<id>") + { + Period = new TimePeriod + { + Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + }, + Class = EncounterClass.InPatient, + }}, + PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) { ClinicalType = ClinicalDocumentType.Consultation, Language = "<language>", CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + Authors = {new DocumentAuthor + { + Id = "<id>", + FullName = "<fullName>", + }}, + SpecialtyType = SpecialtyType.Pathology, + AdministrativeMetadata = new DocumentAdministrativeMetadata + { + OrderedProcedures = {new FhirR4Extendible + { + Extension = {default}, + Code = default, + Description = "<description>", + }}, + EncounterId = "<encounterId>", + }, }}, } }) { Configuration = new TrialMatcherModelConfiguration(new ClinicalTrials { - CustomTrials = {new ClinicalTrialDetails("<id>", new ClinicalTrialMetadata(new string[]{"<conditions>"}) + CustomTrials = {new FhirR4ResearchStudy(ResearchStudyStatusCodeType.Active) { - Phases = {ClinicalTrialPhase.NotApplicable}, - StudyType = ClinicalTrialStudyType.Interventional, - RecruitmentStatus = ClinicalTrialRecruitmentStatus.UnknownStatus, - Sponsors = {"<sponsors>"}, - Contacts = {new ContactDetails + Identifier = {default}, + Title = "<title>", + Protocol = {default}, + PartOf = {default}, + PrimaryPurposeType = default, + Phase = default, + Category = {default}, + Focus = {default}, + Condition = {default}, + Contact = {new FhirR4ContactDetail { Name = "<name>", - Email = "<email>", - Phone = "<phone>", + Telecom = {new FhirR4ContactPoint + { + System = ContactPointSystem.Phone, + Value = "<value>", + Use = ContactPointUse.Home, + Rank = 1234, + Period = default, + }}, }}, - Facilities = {new ClinicalTrialResearchFacility("<name>", "<countryOrRegion>") + Keyword = {default}, + Location = {default}, + Description = "<description>", + Enrollment = {default}, + Period = default, + Sponsor = default, + PrincipalInvestigator = default, + Site = {default}, + ReasonStopped = default, + Note = {new FhirR4Annotation("<text>") { - City = "<city>", - State = "<state>", + AuthorString = "<authorString>", + Time = "<time>", }}, - }) - { - EligibilityCriteriaText = "<eligibilityCriteriaText>", - Demographics = new ClinicalTrialDemographics + Arm = {new ResearchStudyArm("<name>") { - AcceptedSex = ClinicalTrialAcceptedSex.All, - AcceptedAgeRange = new AcceptedAgeRange - { - MinimumAge = new AcceptedAge(AgeUnit.Years, 123.45F), - MaximumAge = default, - }, - }, + Type = default, + Description = "<description>", + }}, + Objective = {new ResearchStudyObjective("<name>") + { + Type = default, + }}, + Text = new FhirR4Narrative("<status>", "<div>"), + Contained = {default}, + Extension = {default}, + ModifierExtension = {default}, + Id = "<id>", + Meta = default, + ImplicitRules = "<implicitRules>", + Language = "<language>", }}, RegistryFilters = {new ClinicalTrialRegistryFilter { @@ -205,8 +337,8 @@ TrialMatcherData trialMatcherData = new TrialMatcherData(new PatientRecord[] IncludeEvidence = true, }, }; -Operation<TrialMatcherResults> operation = client.MatchTrials(WaitUntil.Completed, trialMatcherData); -TrialMatcherResults responseData = operation.Value; +Operation<TrialMatcherInferenceResult> operation = client.MatchTrials(WaitUntil.Completed, trialMatcherData); +TrialMatcherInferenceResult responseData = operation.Value; ]]></code></example> </member> <member name="MatchTrialsAsync(WaitUntil,RequestContent,RequestContext)"> @@ -231,9 +363,9 @@ Operation<BinaryData> operation = await client.MatchTrialsAsync(WaitUntil.Comple BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); ]]></code> This sample shows how to call MatchTrialsAsync with all parameters and request content and parse the result. @@ -257,14 +389,157 @@ using RequestContent content = RequestContent.Create(new { new { - system = "<system>", - code = "<code>", - name = "<name>", - value = "<value>", + resourceType = "<resourceType>", + id = "<id>", + meta = new + { + versionId = "<versionId>", + lastUpdated = "<lastUpdated>", + source = "<source>", + profile = new object[] + { + "<profile>" + }, + security = new object[] + { + new + { + system = "<system>", + version = "<version>", + code = "<code>", + display = "<display>", + id = "<id>", + extension = new object[] + { + new + { + url = "<url>", + valueQuantity = new + { + value = 123.45, + comparator = "<comparator>", + unit = "<unit>", + system = "<system>", + code = "<code>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueCodeableConcept = new + { + coding = new object[] + { + null + }, + text = "<text>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueString = "<valueString>", + valueBoolean = true, + valueInteger = 1234, + valueRange = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueRatio = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueSampledData = new + { + period = 123.45, + factor = 123.45, + lowerLimit = 123.45, + upperLimit = 123.45, + dimensions = 1234, + data = "<data>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueTime = "01:23:45", + valueDateTime = "<valueDateTime>", + valuePeriod = new + { + start = "<start>", + end = "<end>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueReference = new + { + reference = "<reference>", + type = "<type>", + identifier = new + { + use = "<use>", + system = "<system>", + value = "<value>", + id = "<id>", + extension = new object[] + { + null + }, + }, + display = "<display>", + id = "<id>", + extension = new object[] + { + null + }, + }, + id = "<id>", + extension = new object[] + { + null + }, + } + }, + } + }, + tag = new object[] + { + null + }, + }, + implicitRules = "<implicitRules>", + language = "<language>", } }, }, - data = new object[] + encounters = new object[] + { + new Dictionary<string, object> + { + ["id"] = "<id>", + ["period"] = new + { + start = "2022-05-10T14:57:31.2311892-04:00", + end = "2022-05-10T14:57:31.2311892-04:00", + }, + ["class"] = "inpatient" + } + }, + patientDocuments = new object[] { new { @@ -273,6 +548,30 @@ using RequestContent content = RequestContent.Create(new id = "<id>", language = "<language>", createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + authors = new object[] + { + new + { + id = "<id>", + fullName = "<fullName>", + } + }, + specialtyType = "pathology", + administrativeMetadata = new + { + orderedProcedures = new object[] + { + new + { + extension = new object[] + { + null + }, + description = "<description>", + } + }, + encounterId = "<encounterId>", + }, content = new { sourceType = "inline", @@ -292,56 +591,126 @@ using RequestContent content = RequestContent.Create(new { new { - id = "<id>", - eligibilityCriteriaText = "<eligibilityCriteriaText>", - demographics = new + identifier = new object[] + { + null + }, + title = "<title>", + protocol = new object[] + { + null + }, + partOf = new object[] { - acceptedSex = "all", - acceptedAgeRange = new + null + }, + status = "active", + category = new object[] + { + null + }, + focus = new object[] + { + null + }, + condition = new object[] + { + null + }, + contact = new object[] + { + new { - minimumAge = new + name = "<name>", + telecom = new object[] { - unit = "years", - value = 123.45F, + new + { + system = "phone", + value = "<value>", + use = "home", + rank = 1234, + } }, - }, + id = "<id>", + extension = new object[] + { + null + }, + } }, - metadata = new + keyword = new object[] { - phases = new object[] - { - "notApplicable" - }, - studyType = "interventional", - recruitmentStatus = "unknownStatus", - conditions = new object[] + null + }, + location = new object[] + { + null + }, + description = "<description>", + enrollment = new object[] + { + null + }, + site = new object[] + { + null + }, + note = new object[] + { + new { - "<conditions>" - }, - sponsors = new object[] + authorString = "<authorString>", + time = "<time>", + text = "<text>", + id = "<id>", + extension = new object[] + { + null + }, + } + }, + arm = new object[] + { + new { - "<sponsors>" - }, - contacts = new object[] + name = "<name>", + description = "<description>", + } + }, + objective = new object[] + { + new { - new - { - name = "<name>", - email = "<email>", - phone = "<phone>", - } - }, - facilities = new object[] + name = "<name>", + } + }, + resourceType = "ResearchStudy", + text = new + { + status = "<status>", + div = "<div>", + id = "<id>", + extension = new object[] { - new - { - name = "<name>", - city = "<city>", - state = "<state>", - countryOrRegion = "<countryOrRegion>", - } + null }, }, + contained = new object[] + { + null + }, + extension = new object[] + { + null + }, + modifierExtension = new object[] + { + null + }, + id = "<id>", + implicitRules = "<implicitRules>", + language = "<language>", } }, registryFilters = new object[] @@ -422,41 +791,41 @@ Operation<BinaryData> operation = await client.MatchTrialsAsync(WaitUntil.Comple BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("clinicalTrialId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); Console.WriteLine(result.GetProperty("knowledgeGraphLastUpdateDate").ToString()); ]]></code></example> @@ -483,9 +852,9 @@ Operation<BinaryData> operation = client.MatchTrials(WaitUntil.Completed, conten BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); ]]></code> This sample shows how to call MatchTrials with all parameters and request content and parse the result. @@ -509,14 +878,157 @@ using RequestContent content = RequestContent.Create(new { new { - system = "<system>", - code = "<code>", - name = "<name>", - value = "<value>", + resourceType = "<resourceType>", + id = "<id>", + meta = new + { + versionId = "<versionId>", + lastUpdated = "<lastUpdated>", + source = "<source>", + profile = new object[] + { + "<profile>" + }, + security = new object[] + { + new + { + system = "<system>", + version = "<version>", + code = "<code>", + display = "<display>", + id = "<id>", + extension = new object[] + { + new + { + url = "<url>", + valueQuantity = new + { + value = 123.45, + comparator = "<comparator>", + unit = "<unit>", + system = "<system>", + code = "<code>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueCodeableConcept = new + { + coding = new object[] + { + null + }, + text = "<text>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueString = "<valueString>", + valueBoolean = true, + valueInteger = 1234, + valueRange = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueRatio = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueSampledData = new + { + period = 123.45, + factor = 123.45, + lowerLimit = 123.45, + upperLimit = 123.45, + dimensions = 1234, + data = "<data>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueTime = "01:23:45", + valueDateTime = "<valueDateTime>", + valuePeriod = new + { + start = "<start>", + end = "<end>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueReference = new + { + reference = "<reference>", + type = "<type>", + identifier = new + { + use = "<use>", + system = "<system>", + value = "<value>", + id = "<id>", + extension = new object[] + { + null + }, + }, + display = "<display>", + id = "<id>", + extension = new object[] + { + null + }, + }, + id = "<id>", + extension = new object[] + { + null + }, + } + }, + } + }, + tag = new object[] + { + null + }, + }, + implicitRules = "<implicitRules>", + language = "<language>", } }, }, - data = new object[] + encounters = new object[] + { + new Dictionary<string, object> + { + ["id"] = "<id>", + ["period"] = new + { + start = "2022-05-10T14:57:31.2311892-04:00", + end = "2022-05-10T14:57:31.2311892-04:00", + }, + ["class"] = "inpatient" + } + }, + patientDocuments = new object[] { new { @@ -525,6 +1037,30 @@ using RequestContent content = RequestContent.Create(new id = "<id>", language = "<language>", createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + authors = new object[] + { + new + { + id = "<id>", + fullName = "<fullName>", + } + }, + specialtyType = "pathology", + administrativeMetadata = new + { + orderedProcedures = new object[] + { + new + { + extension = new object[] + { + null + }, + description = "<description>", + } + }, + encounterId = "<encounterId>", + }, content = new { sourceType = "inline", @@ -544,56 +1080,126 @@ using RequestContent content = RequestContent.Create(new { new { - id = "<id>", - eligibilityCriteriaText = "<eligibilityCriteriaText>", - demographics = new + identifier = new object[] + { + null + }, + title = "<title>", + protocol = new object[] + { + null + }, + partOf = new object[] + { + null + }, + status = "active", + category = new object[] + { + null + }, + focus = new object[] { - acceptedSex = "all", - acceptedAgeRange = new + null + }, + condition = new object[] + { + null + }, + contact = new object[] + { + new { - minimumAge = new + name = "<name>", + telecom = new object[] { - unit = "years", - value = 123.45F, + new + { + system = "phone", + value = "<value>", + use = "home", + rank = 1234, + } }, - }, + id = "<id>", + extension = new object[] + { + null + }, + } }, - metadata = new + keyword = new object[] { - phases = new object[] - { - "notApplicable" - }, - studyType = "interventional", - recruitmentStatus = "unknownStatus", - conditions = new object[] + null + }, + location = new object[] + { + null + }, + description = "<description>", + enrollment = new object[] + { + null + }, + site = new object[] + { + null + }, + note = new object[] + { + new { - "<conditions>" - }, - sponsors = new object[] + authorString = "<authorString>", + time = "<time>", + text = "<text>", + id = "<id>", + extension = new object[] + { + null + }, + } + }, + arm = new object[] + { + new { - "<sponsors>" - }, - contacts = new object[] + name = "<name>", + description = "<description>", + } + }, + objective = new object[] + { + new { - new - { - name = "<name>", - email = "<email>", - phone = "<phone>", - } - }, - facilities = new object[] + name = "<name>", + } + }, + resourceType = "ResearchStudy", + text = new + { + status = "<status>", + div = "<div>", + id = "<id>", + extension = new object[] { - new - { - name = "<name>", - city = "<city>", - state = "<state>", - countryOrRegion = "<countryOrRegion>", - } + null }, }, + contained = new object[] + { + null + }, + extension = new object[] + { + null + }, + modifierExtension = new object[] + { + null + }, + id = "<id>", + implicitRules = "<implicitRules>", + language = "<language>", } }, registryFilters = new object[] @@ -674,41 +1280,41 @@ Operation<BinaryData> operation = client.MatchTrials(WaitUntil.Completed, conten BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); -Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("clinicalTrialId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); Console.WriteLine(result.GetProperty("knowledgeGraphLastUpdateDate").ToString()); ]]></code></example> diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAdministrativeMetadata.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAdministrativeMetadata.Serialization.cs new file mode 100644 index 0000000000000..52c6b962e1a9b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAdministrativeMetadata.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class DocumentAdministrativeMetadata : IUtf8JsonSerializable, IJsonModel<DocumentAdministrativeMetadata> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<DocumentAdministrativeMetadata>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<DocumentAdministrativeMetadata>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(OrderedProcedures)) + { + writer.WritePropertyName("orderedProcedures"u8); + writer.WriteStartArray(); + foreach (var item in OrderedProcedures) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EncounterId)) + { + writer.WritePropertyName("encounterId"u8); + writer.WriteStringValue(EncounterId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentAdministrativeMetadata IJsonModel<DocumentAdministrativeMetadata>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentAdministrativeMetadata(document.RootElement, options); + } + + internal static DocumentAdministrativeMetadata DeserializeDocumentAdministrativeMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Extendible>> orderedProcedures = default; + Optional<string> encounterId = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("orderedProcedures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extendible> array = new List<FhirR4Extendible>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extendible.DeserializeFhirR4Extendible(item)); + } + orderedProcedures = array; + continue; + } + if (property.NameEquals("encounterId"u8)) + { + encounterId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentAdministrativeMetadata(Optional.ToList(orderedProcedures), encounterId.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<DocumentAdministrativeMetadata>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{options.Format}' format."); + } + } + + DocumentAdministrativeMetadata IPersistableModel<DocumentAdministrativeMetadata>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentAdministrativeMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<DocumentAdministrativeMetadata>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static DocumentAdministrativeMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentAdministrativeMetadata(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/DocumentAdministrativeMetadata.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAdministrativeMetadata.cs new file mode 100644 index 0000000000000..dfcd1332f9283 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAdministrativeMetadata.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> Document administrative metadata. </summary> + public partial class DocumentAdministrativeMetadata + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="DocumentAdministrativeMetadata"/>. </summary> + public DocumentAdministrativeMetadata() + { + OrderedProcedures = new ChangeTrackingList<FhirR4Extendible>(); + } + + /// <summary> Initializes a new instance of <see cref="DocumentAdministrativeMetadata"/>. </summary> + /// <param name="orderedProcedures"> List of procedure information associated with the document. </param> + /// <param name="encounterId"> Reference to the encounter associated with the document. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal DocumentAdministrativeMetadata(IList<FhirR4Extendible> orderedProcedures, string encounterId, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + OrderedProcedures = orderedProcedures; + EncounterId = encounterId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> List of procedure information associated with the document. </summary> + public IList<FhirR4Extendible> OrderedProcedures { get; } + /// <summary> Reference to the encounter associated with the document. </summary> + public string EncounterId { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAuthor.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAuthor.Serialization.cs new file mode 100644 index 0000000000000..0eab940d0f217 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAuthor.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class DocumentAuthor : IUtf8JsonSerializable, IJsonModel<DocumentAuthor> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<DocumentAuthor>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<DocumentAuthor>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(FullName)) + { + writer.WritePropertyName("fullName"u8); + writer.WriteStringValue(FullName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentAuthor IJsonModel<DocumentAuthor>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentAuthor(document.RootElement, options); + } + + internal static DocumentAuthor DeserializeDocumentAuthor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> id = default; + Optional<string> fullName = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("fullName"u8)) + { + fullName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentAuthor(id.Value, fullName.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<DocumentAuthor>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{options.Format}' format."); + } + } + + DocumentAuthor IPersistableModel<DocumentAuthor>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentAuthor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<DocumentAuthor>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static DocumentAuthor FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentAuthor(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/DocumentAuthor.cs similarity index 61% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAuthor.cs index dd91f3a9df887..6d67ebd7606d7 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentAuthor.cs @@ -10,8 +10,8 @@ namespace Azure.Health.Insights.ClinicalMatching { - /// <summary> A definition of the range of ages accepted by a clinical trial. Contains a minimum age and/or a maximum age. </summary> - public partial class AcceptedAgeRange + /// <summary> Document author. </summary> + public partial class DocumentAuthor { /// <summary> /// Keeps track of any properties unknown to the library. @@ -45,25 +45,25 @@ public partial class AcceptedAgeRange /// </summary> private IDictionary<string, BinaryData> _serializedAdditionalRawData; - /// <summary> Initializes a new instance of <see cref="AcceptedAgeRange"/>. </summary> - public AcceptedAgeRange() + /// <summary> Initializes a new instance of <see cref="DocumentAuthor"/>. </summary> + public DocumentAuthor() { } - /// <summary> Initializes a new instance of <see cref="AcceptedAgeRange"/>. </summary> - /// <param name="minimumAge"> A person's age, given as a number (value) and a unit (e.g. years, months). </param> - /// <param name="maximumAge"> A person's age, given as a number (value) and a unit (e.g. years, months). </param> + /// <summary> Initializes a new instance of <see cref="DocumentAuthor"/>. </summary> + /// <param name="id"> author id. </param> + /// <param name="fullName"> Text representation of the full name. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal AcceptedAgeRange(AcceptedAge minimumAge, AcceptedAge maximumAge, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal DocumentAuthor(string id, string fullName, IDictionary<string, BinaryData> serializedAdditionalRawData) { - MinimumAge = minimumAge; - MaximumAge = maximumAge; + Id = id; + FullName = fullName; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// <summary> A person's age, given as a number (value) and a unit (e.g. years, months). </summary> - public AcceptedAge MinimumAge { get; set; } - /// <summary> A person's age, given as a number (value) and a unit (e.g. years, months). </summary> - public AcceptedAge MaximumAge { get; set; } + /// <summary> author id. </summary> + public string Id { get; set; } + /// <summary> Text representation of the full name. </summary> + public string FullName { get; set; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContentSourceType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContentSourceType.cs index 466298d460dc8..49d38e2955210 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContentSourceType.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/DocumentContentSourceType.cs @@ -29,9 +29,9 @@ public DocumentContentSourceType(string value) private const string InlineValue = "inline"; private const string ReferenceValue = "reference"; - /// <summary> inline. </summary> + /// <summary> The content is given as a string (for instance, text). </summary> public static DocumentContentSourceType Inline { get; } = new DocumentContentSourceType(InlineValue); - /// <summary> reference. </summary> + /// <summary> The content is given as a URI. </summary> public static DocumentContentSourceType Reference { get; } = new DocumentContentSourceType(ReferenceValue); /// <summary> Determines if two <see cref="DocumentContentSourceType"/> values are the same. </summary> public static bool operator ==(DocumentContentSourceType left, DocumentContentSourceType right) => left.Equals(right); diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Encounter.Serialization.cs similarity index 56% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.Serialization.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Encounter.Serialization.cs index 47b1a1ed0025a..2a92da9ef5907 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Encounter.Serialization.cs @@ -14,28 +14,30 @@ namespace Azure.Health.Insights.ClinicalMatching { - public partial class ClinicalTrialDemographics : IUtf8JsonSerializable, IJsonModel<ClinicalTrialDemographics> + public partial class Encounter : IUtf8JsonSerializable, IJsonModel<Encounter> { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<ClinicalTrialDemographics>)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<Encounter>)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel<ClinicalTrialDemographics>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel<Encounter>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<ClinicalTrialDemographics>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ClinicalTrialDemographics)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(Encounter)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(AcceptedSex)) + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Period)) { - writer.WritePropertyName("acceptedSex"u8); - writer.WriteStringValue(AcceptedSex.Value.ToString()); + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); } - if (Optional.IsDefined(AcceptedAgeRange)) + if (Optional.IsDefined(Class)) { - writer.WritePropertyName("acceptedAgeRange"u8); - writer.WriteObjectValue(AcceptedAgeRange); + writer.WritePropertyName("class"u8); + writer.WriteStringValue(Class.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -55,19 +57,19 @@ void IJsonModel<ClinicalTrialDemographics>.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - ClinicalTrialDemographics IJsonModel<ClinicalTrialDemographics>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + Encounter IJsonModel<Encounter>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<ClinicalTrialDemographics>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ClinicalTrialDemographics)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(Encounter)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeClinicalTrialDemographics(document.RootElement, options); + return DeserializeEncounter(document.RootElement, options); } - internal static ClinicalTrialDemographics DeserializeClinicalTrialDemographics(JsonElement element, ModelReaderWriterOptions options = null) + internal static Encounter DeserializeEncounter(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -75,28 +77,34 @@ internal static ClinicalTrialDemographics DeserializeClinicalTrialDemographics(J { return null; } - Optional<ClinicalTrialAcceptedSex> acceptedSex = default; - Optional<AcceptedAgeRange> acceptedAgeRange = default; + string id = default; + Optional<TimePeriod> period = default; + Optional<EncounterClass> @class = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("acceptedSex"u8)) + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("period"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - acceptedSex = new ClinicalTrialAcceptedSex(property.Value.GetString()); + period = TimePeriod.DeserializeTimePeriod(property.Value); continue; } - if (property.NameEquals("acceptedAgeRange"u8)) + if (property.NameEquals("class"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - acceptedAgeRange = AcceptedAgeRange.DeserializeAcceptedAgeRange(property.Value); + @class = new EncounterClass(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,46 +113,46 @@ internal static ClinicalTrialDemographics DeserializeClinicalTrialDemographics(J } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new ClinicalTrialDemographics(Optional.ToNullable(acceptedSex), acceptedAgeRange.Value, serializedAdditionalRawData); + return new Encounter(id, period.Value, Optional.ToNullable(@class), serializedAdditionalRawData); } - BinaryData IPersistableModel<ClinicalTrialDemographics>.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel<Encounter>.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<ClinicalTrialDemographics>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ClinicalTrialDemographics)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(Encounter)} does not support '{options.Format}' format."); } } - ClinicalTrialDemographics IPersistableModel<ClinicalTrialDemographics>.Create(BinaryData data, ModelReaderWriterOptions options) + Encounter IPersistableModel<Encounter>.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<ClinicalTrialDemographics>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeClinicalTrialDemographics(document.RootElement, options); + return DeserializeEncounter(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ClinicalTrialDemographics)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(Encounter)} does not support '{options.Format}' format."); } } - string IPersistableModel<ClinicalTrialDemographics>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel<Encounter>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// <summary> Deserializes the model from a raw response. </summary> /// <param name="response"> The response to deserialize the model from. </param> - internal static ClinicalTrialDemographics FromResponse(Response response) + internal static Encounter FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeClinicalTrialDemographics(document.RootElement); + return DeserializeEncounter(document.RootElement); } /// <summary> Convert into a Utf8JsonRequestContent. </summary> diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Encounter.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Encounter.cs new file mode 100644 index 0000000000000..198b7d67409ba --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/Encounter.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> visit/encounter information. </summary> + public partial class Encounter + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <exception cref="ArgumentNullException"> <paramref name="id"/> is null. </exception> + public Encounter(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + } + + /// <summary> Initializes a new instance of <see cref="Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <param name="period"> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </param> + /// <param name="class"> The class of the encounter. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal Encounter(string id, TimePeriod period, EncounterClass? @class, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + Period = period; + Class = @class; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="Encounter"/> for deserialization. </summary> + internal Encounter() + { + } + + /// <summary> The id of the visit. </summary> + public string Id { get; } + /// <summary> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </summary> + public TimePeriod Period { get; set; } + /// <summary> The class of the encounter. </summary> + public EncounterClass? Class { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/EncounterClass.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/EncounterClass.cs new file mode 100644 index 0000000000000..3f60c5487c291 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/EncounterClass.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> Known values codes that can be used to indicate the class of encounter (TODO://Based on FHIR value set--http://....). </summary> + public readonly partial struct EncounterClass : IEquatable<EncounterClass> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="EncounterClass"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public EncounterClass(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InPatientValue = "inpatient"; + private const string AmbulatoryValue = "ambulatory"; + private const string ObservationValue = "observation"; + private const string EmergencyValue = "emergency"; + private const string VirtualValue = "virtual"; + private const string HealthHomeValue = "healthHome"; + + /// <summary> A patient encounter where a patient is admitted by a hospital or equivalent facility, assigned to a location where patients generally stay at least overnight and provided with room, board, and continuous nursing service. </summary> + public static EncounterClass InPatient { get; } = new EncounterClass(InPatientValue); + /// <summary> The term ambulatory usually implies that the patient has come to the location and is not assigned to a bed. Sometimes referred to as an outpatient encounter. </summary> + public static EncounterClass Ambulatory { get; } = new EncounterClass(AmbulatoryValue); + /// <summary> An encounter where the patient usually will start in different encounter, such as one in the emergency department but then transition to this type of encounter because they require a significant period of treatment and monitoring to determine whether or not their condition warrants an inpatient admission or discharge. </summary> + public static EncounterClass Observation { get; } = new EncounterClass(ObservationValue); + /// <summary> A patient encounter that takes place at a dedicated healthcare service delivery location where the patient receives immediate evaluation and treatment, provided until the patient can be discharged or responsibility for the patient's care is transferred elsewhere (for example, the patient could be admitted as an inpatient or transferred to another facility. </summary> + public static EncounterClass Emergency { get; } = new EncounterClass(EmergencyValue); + /// <summary> A patient encounter where the patient is not physically present for the encounter, such as in a telehealth encounter, phone call, or electronic communication. </summary> + public static EncounterClass Virtual { get; } = new EncounterClass(VirtualValue); + /// <summary> Healthcare encounter that takes place in the residence of the patient or a designee. </summary> + public static EncounterClass HealthHome { get; } = new EncounterClass(HealthHomeValue); + /// <summary> Determines if two <see cref="EncounterClass"/> values are the same. </summary> + public static bool operator ==(EncounterClass left, EncounterClass right) => left.Equals(right); + /// <summary> Determines if two <see cref="EncounterClass"/> values are not the same. </summary> + public static bool operator !=(EncounterClass left, EncounterClass right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="EncounterClass"/>. </summary> + public static implicit operator EncounterClass(string value) => new EncounterClass(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EncounterClass other && Equals(other); + /// <inheritdoc /> + public bool Equals(EncounterClass other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Annotation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Annotation.Serialization.cs new file mode 100644 index 0000000000000..2d43205b20c45 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Annotation.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Annotation : IUtf8JsonSerializable, IJsonModel<FhirR4Annotation> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Annotation>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Annotation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Annotation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Annotation)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthorString)) + { + writer.WritePropertyName("authorString"u8); + writer.WriteStringValue(AuthorString); + } + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time); + } + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Annotation IJsonModel<FhirR4Annotation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Annotation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Annotation)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Annotation(document.RootElement, options); + } + + internal static FhirR4Annotation DeserializeFhirR4Annotation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> authorString = default; + Optional<string> time = default; + string text = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authorString"u8)) + { + authorString = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + time = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Annotation(id.Value, Optional.ToList(extension), serializedAdditionalRawData, authorString.Value, time.Value, text); + } + + BinaryData IPersistableModel<FhirR4Annotation>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Annotation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Annotation)} does not support '{options.Format}' format."); + } + } + + FhirR4Annotation IPersistableModel<FhirR4Annotation>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Annotation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Annotation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Annotation)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Annotation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Annotation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Annotation(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Annotation.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Annotation.cs new file mode 100644 index 0000000000000..57ca08b29cac1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Annotation.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A text note which also contains information about who made the statement and when + /// Based on [FHIR Annotation](https://www.hl7.org/fhir/R4/datatypes.html#Annotation) + /// </summary> + public partial class FhirR4Annotation : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Annotation"/>. </summary> + /// <param name="text"> The annotation - text content (as markdown). </param> + /// <exception cref="ArgumentNullException"> <paramref name="text"/> is null. </exception> + public FhirR4Annotation(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Annotation"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="authorString"> Individual responsible for the annotation. </param> + /// <param name="time"> When the annotation was made. </param> + /// <param name="text"> The annotation - text content (as markdown). </param> + internal FhirR4Annotation(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string authorString, string time, string text) : base(id, extension, serializedAdditionalRawData) + { + AuthorString = authorString; + Time = time; + Text = text; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Annotation"/> for deserialization. </summary> + internal FhirR4Annotation() + { + } + + /// <summary> Individual responsible for the annotation. </summary> + public string AuthorString { get; set; } + /// <summary> When the annotation was made. </summary> + public string Time { get; set; } + /// <summary> The annotation - text content (as markdown). </summary> + public string Text { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4CodeableConcept.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4CodeableConcept.Serialization.cs new file mode 100644 index 0000000000000..ac898bdf75e38 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4CodeableConcept.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4CodeableConcept : IUtf8JsonSerializable, IJsonModel<FhirR4CodeableConcept> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4CodeableConcept>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4CodeableConcept>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Coding)) + { + writer.WritePropertyName("coding"u8); + writer.WriteStartArray(); + foreach (var item in Coding) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4CodeableConcept IJsonModel<FhirR4CodeableConcept>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4CodeableConcept(document.RootElement, options); + } + + internal static FhirR4CodeableConcept DeserializeFhirR4CodeableConcept(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Coding>> coding = default; + Optional<string> text = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("coding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + coding = array; + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4CodeableConcept(id.Value, Optional.ToList(extension), serializedAdditionalRawData, Optional.ToList(coding), text.Value); + } + + BinaryData IPersistableModel<FhirR4CodeableConcept>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{options.Format}' format."); + } + } + + FhirR4CodeableConcept IPersistableModel<FhirR4CodeableConcept>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4CodeableConcept(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4CodeableConcept>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4CodeableConcept FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4CodeableConcept(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4CodeableConcept.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4CodeableConcept.cs new file mode 100644 index 0000000000000..902b5b846126a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4CodeableConcept.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// Concept - reference to a terminology or just text + /// Based on [FHIR CodeableConcept](https://www.hl7.org/fhir/R4/datatypes.html#CodeableConcept) + /// </summary> + public partial class FhirR4CodeableConcept : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4CodeableConcept"/>. </summary> + public FhirR4CodeableConcept() + { + Coding = new ChangeTrackingList<FhirR4Coding>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4CodeableConcept"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="coding"> Code defined by a terminology system. </param> + /// <param name="text"> Plain text representation of the concept. </param> + internal FhirR4CodeableConcept(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, IList<FhirR4Coding> coding, string text) : base(id, extension, serializedAdditionalRawData) + { + Coding = coding; + Text = text; + } + + /// <summary> Code defined by a terminology system. </summary> + public IList<FhirR4Coding> Coding { get; } + /// <summary> Plain text representation of the concept. </summary> + public string Text { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Coding.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Coding.Serialization.cs new file mode 100644 index 0000000000000..dbf8a0efb7214 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Coding.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Coding : IUtf8JsonSerializable, IJsonModel<FhirR4Coding> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Coding>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Coding>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Coding IJsonModel<FhirR4Coding>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Coding(document.RootElement, options); + } + + internal static FhirR4Coding DeserializeFhirR4Coding(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> system = default; + Optional<string> version = default; + Optional<string> code = default; + Optional<string> display = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("display"u8)) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Coding(id.Value, Optional.ToList(extension), serializedAdditionalRawData, system.Value, version.Value, code.Value, display.Value); + } + + BinaryData IPersistableModel<FhirR4Coding>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{options.Format}' format."); + } + } + + FhirR4Coding IPersistableModel<FhirR4Coding>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Coding(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Coding>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Coding FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Coding(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Coding.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Coding.cs new file mode 100644 index 0000000000000..c8c0f64b19bec --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Coding.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A Coding is a representation of a defined concept using a symbol from a defined "code system". + /// Based on [FHIR Coding](https://www.hl7.org/fhir/R4/datatypes.html#Coding) + /// </summary> + public partial class FhirR4Coding : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Coding"/>. </summary> + public FhirR4Coding() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Coding"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="system"> Identity of the terminology system. </param> + /// <param name="version"> Version of the system - if relevant. </param> + /// <param name="code"> Symbol in syntax defined by the system. </param> + /// <param name="display"> Representation defined by the system. </param> + internal FhirR4Coding(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string system, string version, string code, string display) : base(id, extension, serializedAdditionalRawData) + { + System = system; + Version = version; + Code = code; + Display = display; + } + + /// <summary> Identity of the terminology system. </summary> + public string System { get; set; } + /// <summary> Version of the system - if relevant. </summary> + public string Version { get; set; } + /// <summary> Symbol in syntax defined by the system. </summary> + public string Code { get; set; } + /// <summary> Representation defined by the system. </summary> + public string Display { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactDetail.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactDetail.Serialization.cs new file mode 100644 index 0000000000000..6447bb5e0a345 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactDetail.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4ContactDetail : IUtf8JsonSerializable, IJsonModel<FhirR4ContactDetail> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4ContactDetail>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4ContactDetail>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ContactDetail>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ContactDetail)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Telecom)) + { + writer.WritePropertyName("telecom"u8); + writer.WriteStartArray(); + foreach (var item in Telecom) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4ContactDetail IJsonModel<FhirR4ContactDetail>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ContactDetail>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ContactDetail)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4ContactDetail(document.RootElement, options); + } + + internal static FhirR4ContactDetail DeserializeFhirR4ContactDetail(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> name = default; + Optional<IList<FhirR4ContactPoint>> telecom = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("telecom"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4ContactPoint> array = new List<FhirR4ContactPoint>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4ContactPoint.DeserializeFhirR4ContactPoint(item)); + } + telecom = array; + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4ContactDetail(id.Value, Optional.ToList(extension), serializedAdditionalRawData, name.Value, Optional.ToList(telecom)); + } + + BinaryData IPersistableModel<FhirR4ContactDetail>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ContactDetail>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4ContactDetail)} does not support '{options.Format}' format."); + } + } + + FhirR4ContactDetail IPersistableModel<FhirR4ContactDetail>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ContactDetail>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4ContactDetail(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4ContactDetail)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4ContactDetail>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4ContactDetail FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4ContactDetail(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactDetail.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactDetail.cs new file mode 100644 index 0000000000000..29cde1bcb880a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactDetail.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> Contact details (See: https://www.hl7.org/fhir/R4/metadatatypes.html#ContactDetail). </summary> + public partial class FhirR4ContactDetail : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4ContactDetail"/>. </summary> + public FhirR4ContactDetail() + { + Telecom = new ChangeTrackingList<FhirR4ContactPoint>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4ContactDetail"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="name"> Name of an individual to contact. </param> + /// <param name="telecom"> Contact details for individual or organization. </param> + internal FhirR4ContactDetail(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string name, IList<FhirR4ContactPoint> telecom) : base(id, extension, serializedAdditionalRawData) + { + Name = name; + Telecom = telecom; + } + + /// <summary> Name of an individual to contact. </summary> + public string Name { get; set; } + /// <summary> Contact details for individual or organization. </summary> + public IList<FhirR4ContactPoint> Telecom { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactPoint.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactPoint.Serialization.cs new file mode 100644 index 0000000000000..514160625f376 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactPoint.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4ContactPoint : IUtf8JsonSerializable, IJsonModel<FhirR4ContactPoint> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4ContactPoint>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4ContactPoint>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ContactPoint>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ContactPoint)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System.Value.ToString()); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(Use)) + { + writer.WritePropertyName("use"u8); + writer.WriteStringValue(Use.Value.ToString()); + } + if (Optional.IsDefined(Rank)) + { + writer.WritePropertyName("rank"u8); + writer.WriteNumberValue(Rank.Value); + } + if (Optional.IsDefined(Period)) + { + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4ContactPoint IJsonModel<FhirR4ContactPoint>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ContactPoint>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ContactPoint)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4ContactPoint(document.RootElement, options); + } + + internal static FhirR4ContactPoint DeserializeFhirR4ContactPoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<ContactPointSystem> system = default; + Optional<string> value = default; + Optional<ContactPointUse> use = default; + Optional<int> rank = default; + Optional<FhirR4Period> period = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("system"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + system = new ContactPointSystem(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("use"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + use = new ContactPointUse(property.Value.GetString()); + continue; + } + if (property.NameEquals("rank"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rank = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("period"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + period = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4ContactPoint(Optional.ToNullable(system), value.Value, Optional.ToNullable(use), Optional.ToNullable(rank), period.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4ContactPoint>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ContactPoint>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4ContactPoint)} does not support '{options.Format}' format."); + } + } + + FhirR4ContactPoint IPersistableModel<FhirR4ContactPoint>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ContactPoint>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4ContactPoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4ContactPoint)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4ContactPoint>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4ContactPoint FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4ContactPoint(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/FhirR4ContactPoint.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactPoint.cs new file mode 100644 index 0000000000000..9e21cb0e337f7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ContactPoint.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + /// See https://www.hl7.org/fhir/R4/datatypes.html#ContactPoint + /// </summary> + public partial class FhirR4ContactPoint + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4ContactPoint"/>. </summary> + public FhirR4ContactPoint() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4ContactPoint"/>. </summary> + /// <param name="system"> phone | fax | email | pager | url | sms | other. </param> + /// <param name="value"> The actual contact point details. </param> + /// <param name="use"> home | work | temp | old | mobile - purpose of this contact point. </param> + /// <param name="rank"> Specify preferred order of use (1 = highest). </param> + /// <param name="period"> Time period when the contact point was/is in use. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4ContactPoint(ContactPointSystem? system, string value, ContactPointUse? use, int? rank, FhirR4Period period, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + System = system; + Value = value; + Use = use; + Rank = rank; + Period = period; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> phone | fax | email | pager | url | sms | other. </summary> + public ContactPointSystem? System { get; set; } + /// <summary> The actual contact point details. </summary> + public string Value { get; set; } + /// <summary> home | work | temp | old | mobile - purpose of this contact point. </summary> + public ContactPointUse? Use { get; set; } + /// <summary> Specify preferred order of use (1 = highest). </summary> + public int? Rank { get; set; } + /// <summary> Time period when the contact point was/is in use. </summary> + public FhirR4Period Period { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4DomainResource.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4DomainResource.Serialization.cs new file mode 100644 index 0000000000000..0b73bdd09799d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4DomainResource.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + [PersistableModelProxy(typeof(UnknownFhirR4DomainResource))] + public partial class FhirR4DomainResource : IUtf8JsonSerializable, IJsonModel<FhirR4DomainResource> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4DomainResource>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4DomainResource>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteObjectValue(Text); + } + if (Optional.IsCollectionDefined(Contained)) + { + writer.WritePropertyName("contained"u8); + writer.WriteStartArray(); + foreach (var item in Contained) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ModifierExtension)) + { + writer.WritePropertyName("modifierExtension"u8); + writer.WriteStartArray(); + foreach (var item in ModifierExtension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4DomainResource IJsonModel<FhirR4DomainResource>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4DomainResource(document.RootElement, options); + } + + internal static FhirR4DomainResource DeserializeFhirR4DomainResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("resourceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "ResearchStudy": return FhirR4ResearchStudy.DeserializeFhirR4ResearchStudy(element); + } + } + return UnknownFhirR4DomainResource.DeserializeUnknownFhirR4DomainResource(element); + } + + BinaryData IPersistableModel<FhirR4DomainResource>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{options.Format}' format."); + } + } + + FhirR4DomainResource IPersistableModel<FhirR4DomainResource>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4DomainResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4DomainResource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4DomainResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4DomainResource(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4DomainResource.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4DomainResource.cs new file mode 100644 index 0000000000000..e0e3ec55ab0d1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4DomainResource.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A resource with narrative, extensions, and contained resources + /// Based on [FHIR DomainResource](https://www.hl7.org/fhir/domainresource.html) + /// Please note <see cref="FhirR4DomainResource"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include <see cref="FhirR4ResearchStudy"/>. + /// </summary> + public abstract partial class FhirR4DomainResource : FhirR4Resource + { + /// <summary> Initializes a new instance of <see cref="FhirR4DomainResource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <exception cref="ArgumentNullException"> <paramref name="resourceType"/> is null. </exception> + protected FhirR4DomainResource(string resourceType) : base(resourceType) + { + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + Contained = new ChangeTrackingList<FhirR4Resource>(); + Extension = new ChangeTrackingList<FhirR4Extension>(); + ModifierExtension = new ChangeTrackingList<FhirR4Extension>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4DomainResource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <param name="text"> Text summary of the resource, for human interpretation. </param> + /// <param name="contained"> Contained, inline Resources. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="modifierExtension"> Extensions that cannot be ignored. </param> + internal FhirR4DomainResource(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties, FhirR4Narrative text, IList<FhirR4Resource> contained, IList<FhirR4Extension> extension, IList<FhirR4Extension> modifierExtension) : base(resourceType, id, meta, implicitRules, language, additionalProperties) + { + Text = text; + Contained = contained; + Extension = extension; + ModifierExtension = modifierExtension; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4DomainResource"/> for deserialization. </summary> + internal FhirR4DomainResource() + { + } + + /// <summary> Text summary of the resource, for human interpretation. </summary> + public FhirR4Narrative Text { get; set; } + /// <summary> Contained, inline Resources. </summary> + public IList<FhirR4Resource> Contained { get; } + /// <summary> Additional Content defined by implementations. </summary> + public IList<FhirR4Extension> Extension { get; } + /// <summary> Extensions that cannot be ignored. </summary> + public IList<FhirR4Extension> ModifierExtension { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Element.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Element.Serialization.cs new file mode 100644 index 0000000000000..98af184495a6a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Element.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Element : IUtf8JsonSerializable, IJsonModel<FhirR4Element> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Element>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Element>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Element IJsonModel<FhirR4Element>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Element(document.RootElement, options); + } + + internal static FhirR4Element DeserializeFhirR4Element(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Element(id.Value, Optional.ToList(extension), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Element>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{options.Format}' format."); + } + } + + FhirR4Element IPersistableModel<FhirR4Element>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Element(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Element>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Element FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Element(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/FhirR4Element.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Element.cs new file mode 100644 index 0000000000000..c434d159b52b7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Element.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// The base definition for all elements contained inside a resource. + /// Based on [FHIR Element](https://www.hl7.org/fhir/R4/element.html) + /// </summary> + public partial class FhirR4Element + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private protected IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Element"/>. </summary> + internal FhirR4Element() + { + Extension = new ChangeTrackingList<FhirR4Extension>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Element"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Element(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + Extension = extension; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Unique id for inter-element referencing. </summary> + public string Id { get; } + /// <summary> Additional Content defined by implementations. </summary> + public IReadOnlyList<FhirR4Extension> Extension { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extendible.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extendible.Serialization.cs new file mode 100644 index 0000000000000..056d1686a65ec --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extendible.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Extendible : IUtf8JsonSerializable, IJsonModel<FhirR4Extendible> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Extendible>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Extendible>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteObjectValue(Code); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Extendible IJsonModel<FhirR4Extendible>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Extendible(document.RootElement, options); + } + + internal static FhirR4Extendible DeserializeFhirR4Extendible(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Extension>> extension = default; + Optional<FhirR4CodeableConcept> code = default; + Optional<string> description = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Extendible(Optional.ToList(extension), code.Value, description.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Extendible>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{options.Format}' format."); + } + } + + FhirR4Extendible IPersistableModel<FhirR4Extendible>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Extendible(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Extendible>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Extendible FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Extendible(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/FhirR4Extendible.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extendible.cs new file mode 100644 index 0000000000000..5e3986ed094c2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extendible.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> Procedure information. </summary> + public partial class FhirR4Extendible + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Extendible"/>. </summary> + public FhirR4Extendible() + { + Extension = new ChangeTrackingList<FhirR4Extension>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extendible"/>. </summary> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="code"> Procedure code. </param> + /// <param name="description"> Procedure description. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Extendible(IList<FhirR4Extension> extension, FhirR4CodeableConcept code, string description, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Extension = extension; + Code = code; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Additional Content defined by implementations. </summary> + public IList<FhirR4Extension> Extension { get; } + /// <summary> Procedure code. </summary> + public FhirR4CodeableConcept Code { get; set; } + /// <summary> Procedure description. </summary> + public string Description { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extension.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extension.Serialization.cs new file mode 100644 index 0000000000000..17ac2b9ef4699 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extension.Serialization.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Extension : IUtf8JsonSerializable, IJsonModel<FhirR4Extension> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Extension>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Extension>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url); + if (Optional.IsDefined(ValueQuantity)) + { + writer.WritePropertyName("valueQuantity"u8); + writer.WriteObjectValue(ValueQuantity); + } + if (Optional.IsDefined(ValueCodeableConcept)) + { + writer.WritePropertyName("valueCodeableConcept"u8); + writer.WriteObjectValue(ValueCodeableConcept); + } + if (Optional.IsDefined(ValueString)) + { + writer.WritePropertyName("valueString"u8); + writer.WriteStringValue(ValueString); + } + if (Optional.IsDefined(ValueBoolean)) + { + writer.WritePropertyName("valueBoolean"u8); + writer.WriteBooleanValue(ValueBoolean.Value); + } + if (Optional.IsDefined(ValueInteger)) + { + writer.WritePropertyName("valueInteger"u8); + writer.WriteNumberValue(ValueInteger.Value); + } + if (Optional.IsDefined(ValueRange)) + { + writer.WritePropertyName("valueRange"u8); + writer.WriteObjectValue(ValueRange); + } + if (Optional.IsDefined(ValueRatio)) + { + writer.WritePropertyName("valueRatio"u8); + writer.WriteObjectValue(ValueRatio); + } + if (Optional.IsDefined(ValueSampledData)) + { + writer.WritePropertyName("valueSampledData"u8); + writer.WriteObjectValue(ValueSampledData); + } + if (Optional.IsDefined(ValueTime)) + { + writer.WritePropertyName("valueTime"u8); + writer.WriteStringValue(ValueTime.Value, "T"); + } + if (Optional.IsDefined(ValueDateTime)) + { + writer.WritePropertyName("valueDateTime"u8); + writer.WriteStringValue(ValueDateTime); + } + if (Optional.IsDefined(ValuePeriod)) + { + writer.WritePropertyName("valuePeriod"u8); + writer.WriteObjectValue(ValuePeriod); + } + if (Optional.IsDefined(ValueReference)) + { + writer.WritePropertyName("valueReference"u8); + writer.WriteObjectValue(ValueReference); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Extension IJsonModel<FhirR4Extension>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Extension(document.RootElement, options); + } + + internal static FhirR4Extension DeserializeFhirR4Extension(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + Optional<FhirR4Quantity> valueQuantity = default; + Optional<FhirR4CodeableConcept> valueCodeableConcept = default; + Optional<string> valueString = default; + Optional<bool> valueBoolean = default; + Optional<int> valueInteger = default; + Optional<FhirR4Range> valueRange = default; + Optional<FhirR4Ratio> valueRatio = default; + Optional<FhirR4SampledData> valueSampledData = default; + Optional<TimeSpan> valueTime = default; + Optional<string> valueDateTime = default; + Optional<FhirR4Period> valuePeriod = default; + Optional<FhirR4Reference> valueReference = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueQuantity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueQuantity = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("valueCodeableConcept"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueCodeableConcept = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("valueString"u8)) + { + valueString = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueBoolean"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueBoolean = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("valueInteger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueInteger = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("valueRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRange = FhirR4Range.DeserializeFhirR4Range(property.Value); + continue; + } + if (property.NameEquals("valueRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRatio = FhirR4Ratio.DeserializeFhirR4Ratio(property.Value); + continue; + } + if (property.NameEquals("valueSampledData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueSampledData = FhirR4SampledData.DeserializeFhirR4SampledData(property.Value); + continue; + } + if (property.NameEquals("valueTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueTime = property.Value.GetTimeSpan("T"); + continue; + } + if (property.NameEquals("valueDateTime"u8)) + { + valueDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("valuePeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valuePeriod = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("valueReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueReference = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Extension(id.Value, Optional.ToList(extension), serializedAdditionalRawData, url, valueQuantity.Value, valueCodeableConcept.Value, valueString.Value, Optional.ToNullable(valueBoolean), Optional.ToNullable(valueInteger), valueRange.Value, valueRatio.Value, valueSampledData.Value, Optional.ToNullable(valueTime), valueDateTime.Value, valuePeriod.Value, valueReference.Value); + } + + BinaryData IPersistableModel<FhirR4Extension>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{options.Format}' format."); + } + } + + FhirR4Extension IPersistableModel<FhirR4Extension>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Extension(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Extension>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Extension FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Extension(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extension.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extension.cs new file mode 100644 index 0000000000000..72ae310addb2a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Extension.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// Base for all elements + /// Based on [FHIR Element](https://www.hl7.org/fhir/datatypes.html#Element) + /// </summary> + public partial class FhirR4Extension : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/>. </summary> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <exception cref="ArgumentNullException"> <paramref name="url"/> is null. </exception> + public FhirR4Extension(string url) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <param name="valueQuantity"> Value as Quantity. </param> + /// <param name="valueCodeableConcept"> Value as CodeableConcept. </param> + /// <param name="valueString"> Value as string. </param> + /// <param name="valueBoolean"> Value as boolean. </param> + /// <param name="valueInteger"> Value as integer. </param> + /// <param name="valueRange"> Value as Range. </param> + /// <param name="valueRatio"> Value as Ratio. </param> + /// <param name="valueSampledData"> Value as SampledData. </param> + /// <param name="valueTime"> Value as time (hh:mm:ss). </param> + /// <param name="valueDateTime"> Value as dateTime. </param> + /// <param name="valuePeriod"> Value as Period. </param> + /// <param name="valueReference"> Value as reference. </param> + internal FhirR4Extension(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string url, FhirR4Quantity valueQuantity, FhirR4CodeableConcept valueCodeableConcept, string valueString, bool? valueBoolean, int? valueInteger, FhirR4Range valueRange, FhirR4Ratio valueRatio, FhirR4SampledData valueSampledData, TimeSpan? valueTime, string valueDateTime, FhirR4Period valuePeriod, FhirR4Reference valueReference) : base(id, extension, serializedAdditionalRawData) + { + Url = url; + ValueQuantity = valueQuantity; + ValueCodeableConcept = valueCodeableConcept; + ValueString = valueString; + ValueBoolean = valueBoolean; + ValueInteger = valueInteger; + ValueRange = valueRange; + ValueRatio = valueRatio; + ValueSampledData = valueSampledData; + ValueTime = valueTime; + ValueDateTime = valueDateTime; + ValuePeriod = valuePeriod; + ValueReference = valueReference; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/> for deserialization. </summary> + internal FhirR4Extension() + { + } + + /// <summary> Source of the definition for the extension code - a logical name or a URL. </summary> + public string Url { get; } + /// <summary> Value as Quantity. </summary> + public FhirR4Quantity ValueQuantity { get; set; } + /// <summary> Value as CodeableConcept. </summary> + public FhirR4CodeableConcept ValueCodeableConcept { get; set; } + /// <summary> Value as string. </summary> + public string ValueString { get; set; } + /// <summary> Value as boolean. </summary> + public bool? ValueBoolean { get; set; } + /// <summary> Value as integer. </summary> + public int? ValueInteger { get; set; } + /// <summary> Value as Range. </summary> + public FhirR4Range ValueRange { get; set; } + /// <summary> Value as Ratio. </summary> + public FhirR4Ratio ValueRatio { get; set; } + /// <summary> Value as SampledData. </summary> + public FhirR4SampledData ValueSampledData { get; set; } + /// <summary> Value as time (hh:mm:ss). </summary> + public TimeSpan? ValueTime { get; set; } + /// <summary> Value as dateTime. </summary> + public string ValueDateTime { get; set; } + /// <summary> Value as Period. </summary> + public FhirR4Period ValuePeriod { get; set; } + /// <summary> Value as reference. </summary> + public FhirR4Reference ValueReference { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Identifier.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Identifier.Serialization.cs new file mode 100644 index 0000000000000..4f0a5decc4e6c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Identifier.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Identifier : IUtf8JsonSerializable, IJsonModel<FhirR4Identifier> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Identifier>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Identifier>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Use)) + { + writer.WritePropertyName("use"u8); + writer.WriteStringValue(Use); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteObjectValue(Type); + } + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(Period)) + { + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); + } + if (Optional.IsDefined(Assigner)) + { + writer.WritePropertyName("assigner"u8); + writer.WriteObjectValue(Assigner); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Identifier IJsonModel<FhirR4Identifier>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Identifier(document.RootElement, options); + } + + internal static FhirR4Identifier DeserializeFhirR4Identifier(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> use = default; + Optional<FhirR4CodeableConcept> type = default; + Optional<string> system = default; + Optional<string> value = default; + Optional<FhirR4Period> period = default; + Optional<FhirR4Reference> assigner = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("use"u8)) + { + use = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("period"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + period = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("assigner"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assigner = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Identifier(id.Value, Optional.ToList(extension), serializedAdditionalRawData, use.Value, type.Value, system.Value, value.Value, period.Value, assigner.Value); + } + + BinaryData IPersistableModel<FhirR4Identifier>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{options.Format}' format."); + } + } + + FhirR4Identifier IPersistableModel<FhirR4Identifier>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Identifier(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Identifier>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Identifier FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Identifier(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Identifier.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Identifier.cs new file mode 100644 index 0000000000000..67c24c8a14bad --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Identifier.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// An identifier intended for computation + /// Based on [FHIR Identifier](https://www.hl7.org/fhir/R4/identifier.html) + /// </summary> + public partial class FhirR4Identifier : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Identifier"/>. </summary> + public FhirR4Identifier() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Identifier"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="use"> usual | official | temp | secondary | old (If known). </param> + /// <param name="type"> Description of identifier. </param> + /// <param name="system"> The namespace for the identifier value. </param> + /// <param name="value"> The value that is unique. </param> + /// <param name="period"> Time period when id is/was valid for use. </param> + /// <param name="assigner"> Organization that issued id (may be just text). </param> + internal FhirR4Identifier(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string use, FhirR4CodeableConcept type, string system, string value, FhirR4Period period, FhirR4Reference assigner) : base(id, extension, serializedAdditionalRawData) + { + Use = use; + Type = type; + System = system; + Value = value; + Period = period; + Assigner = assigner; + } + + /// <summary> usual | official | temp | secondary | old (If known). </summary> + public string Use { get; set; } + /// <summary> Description of identifier. </summary> + public FhirR4CodeableConcept Type { get; set; } + /// <summary> The namespace for the identifier value. </summary> + public string System { get; set; } + /// <summary> The value that is unique. </summary> + public string Value { get; set; } + /// <summary> Time period when id is/was valid for use. </summary> + public FhirR4Period Period { get; set; } + /// <summary> Organization that issued id (may be just text). </summary> + public FhirR4Reference Assigner { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Meta.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Meta.Serialization.cs new file mode 100644 index 0000000000000..57b555f92c46e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Meta.Serialization.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Meta : IUtf8JsonSerializable, IJsonModel<FhirR4Meta> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Meta>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Meta>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(VersionId)) + { + writer.WritePropertyName("versionId"u8); + writer.WriteStringValue(VersionId); + } + if (Optional.IsDefined(LastUpdated)) + { + writer.WritePropertyName("lastUpdated"u8); + writer.WriteStringValue(LastUpdated); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsCollectionDefined(Profile)) + { + writer.WritePropertyName("profile"u8); + writer.WriteStartArray(); + foreach (var item in Profile) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Security)) + { + writer.WritePropertyName("security"u8); + writer.WriteStartArray(); + foreach (var item in Security) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Tag)) + { + writer.WritePropertyName("tag"u8); + writer.WriteStartArray(); + foreach (var item in Tag) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Meta IJsonModel<FhirR4Meta>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Meta(document.RootElement, options); + } + + internal static FhirR4Meta DeserializeFhirR4Meta(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> versionId = default; + Optional<string> lastUpdated = default; + Optional<string> source = default; + Optional<IList<string>> profile = default; + Optional<IList<FhirR4Coding>> security = default; + Optional<IList<FhirR4Coding>> tag = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("versionId"u8)) + { + versionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastUpdated"u8)) + { + lastUpdated = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("profile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<string> array = new List<string>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + profile = array; + continue; + } + if (property.NameEquals("security"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + security = array; + continue; + } + if (property.NameEquals("tag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + tag = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Meta(versionId.Value, lastUpdated.Value, source.Value, Optional.ToList(profile), Optional.ToList(security), Optional.ToList(tag), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Meta>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{options.Format}' format."); + } + } + + FhirR4Meta IPersistableModel<FhirR4Meta>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Meta(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Meta>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Meta FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Meta(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/FhirR4Meta.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Meta.cs new file mode 100644 index 0000000000000..ab8ff99833251 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Meta.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// Metadata about a resource + /// Based on [FHIR Meta](https://www.hl7.org/fhir/R4/resource.html#Meta) + /// </summary> + public partial class FhirR4Meta + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Meta"/>. </summary> + public FhirR4Meta() + { + Profile = new ChangeTrackingList<string>(); + Security = new ChangeTrackingList<FhirR4Coding>(); + Tag = new ChangeTrackingList<FhirR4Coding>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Meta"/>. </summary> + /// <param name="versionId"> The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. </param> + /// <param name="lastUpdated"> When the resource last changed - e.g. when the version changed. </param> + /// <param name="source"> A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. </param> + /// <param name="profile"> A list of profiles (references to [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). </param> + /// <param name="security"> Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. </param> + /// <param name="tag"> Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Meta(string versionId, string lastUpdated, string source, IList<string> profile, IList<FhirR4Coding> security, IList<FhirR4Coding> tag, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + VersionId = versionId; + LastUpdated = lastUpdated; + Source = source; + Profile = profile; + Security = security; + Tag = tag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. </summary> + public string VersionId { get; set; } + /// <summary> When the resource last changed - e.g. when the version changed. </summary> + public string LastUpdated { get; set; } + /// <summary> A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. </summary> + public string Source { get; set; } + /// <summary> A list of profiles (references to [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). </summary> + public IList<string> Profile { get; } + /// <summary> Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. </summary> + public IList<FhirR4Coding> Security { get; } + /// <summary> Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. </summary> + public IList<FhirR4Coding> Tag { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Narrative.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Narrative.Serialization.cs new file mode 100644 index 0000000000000..e64698f596ccc --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Narrative.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Narrative : IUtf8JsonSerializable, IJsonModel<FhirR4Narrative> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Narrative>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Narrative>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Narrative>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Narrative)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + writer.WritePropertyName("div"u8); + writer.WriteStringValue(Div); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Narrative IJsonModel<FhirR4Narrative>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Narrative>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Narrative)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Narrative(document.RootElement, options); + } + + internal static FhirR4Narrative DeserializeFhirR4Narrative(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string status = default; + string div = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("div"u8)) + { + div = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Narrative(id.Value, Optional.ToList(extension), serializedAdditionalRawData, status, div); + } + + BinaryData IPersistableModel<FhirR4Narrative>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Narrative>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Narrative)} does not support '{options.Format}' format."); + } + } + + FhirR4Narrative IPersistableModel<FhirR4Narrative>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Narrative>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Narrative(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Narrative)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Narrative>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Narrative FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Narrative(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Narrative.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Narrative.cs new file mode 100644 index 0000000000000..0144e3e71ae30 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Narrative.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// Any resource that is a [DomainResource](https://www.hl7.org/fhir/domainresource.html) may include a human-readable narrative that contains a summary of the resource and may be used to represent the content of the resource to a human. + /// Based on [FHIR Narrative](https://www.hl7.org/fhir/R4/narrative.html#Narrative) + /// </summary> + public partial class FhirR4Narrative : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Narrative"/>. </summary> + /// <param name="status"> generated, extensions, additional, empty. </param> + /// <param name="div"> xhtml. </param> + /// <exception cref="ArgumentNullException"> <paramref name="status"/> or <paramref name="div"/> is null. </exception> + public FhirR4Narrative(string status, string div) + { + Argument.AssertNotNull(status, nameof(status)); + Argument.AssertNotNull(div, nameof(div)); + + Status = status; + Div = div; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Narrative"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="status"> generated, extensions, additional, empty. </param> + /// <param name="div"> xhtml. </param> + internal FhirR4Narrative(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string status, string div) : base(id, extension, serializedAdditionalRawData) + { + Status = status; + Div = div; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Narrative"/> for deserialization. </summary> + internal FhirR4Narrative() + { + } + + /// <summary> generated, extensions, additional, empty. </summary> + public string Status { get; } + /// <summary> xhtml. </summary> + public string Div { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Period.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Period.Serialization.cs new file mode 100644 index 0000000000000..45c3d5e887e0f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Period.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Period : IUtf8JsonSerializable, IJsonModel<FhirR4Period> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Period>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Period>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start); + } + if (Optional.IsDefined(End)) + { + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Period IJsonModel<FhirR4Period>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Period(document.RootElement, options); + } + + internal static FhirR4Period DeserializeFhirR4Period(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> start = default; + Optional<string> end = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + start = property.Value.GetString(); + continue; + } + if (property.NameEquals("end"u8)) + { + end = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Period(id.Value, Optional.ToList(extension), serializedAdditionalRawData, start.Value, end.Value); + } + + BinaryData IPersistableModel<FhirR4Period>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{options.Format}' format."); + } + } + + FhirR4Period IPersistableModel<FhirR4Period>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Period(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Period>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Period FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Period(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Period.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Period.cs new file mode 100644 index 0000000000000..db61f6e946f7f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Period.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A time period defined by a start and end date and optionally time + /// Based on [FHIR Period](https://www.hl7.org/fhir/R4/datatypes.html#Period) + /// </summary> + public partial class FhirR4Period : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Period"/>. </summary> + public FhirR4Period() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Period"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> + internal FhirR4Period(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string start, string end) : base(id, extension, serializedAdditionalRawData) + { + Start = start; + End = end; + } + + /// <summary> Starting time with inclusive boundary. </summary> + public string Start { get; set; } + /// <summary> End time with inclusive boundary, if not ongoing. </summary> + public string End { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Quantity.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Quantity.Serialization.cs new file mode 100644 index 0000000000000..0b52d60948a09 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Quantity.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Quantity : IUtf8JsonSerializable, IJsonModel<FhirR4Quantity> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Quantity>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Quantity>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.Value); + } + if (Optional.IsDefined(Comparator)) + { + writer.WritePropertyName("comparator"u8); + writer.WriteStringValue(Comparator); + } + if (Optional.IsDefined(Unit)) + { + writer.WritePropertyName("unit"u8); + writer.WriteStringValue(Unit); + } + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Quantity IJsonModel<FhirR4Quantity>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Quantity(document.RootElement, options); + } + + internal static FhirR4Quantity DeserializeFhirR4Quantity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<double> value = default; + Optional<string> comparator = default; + Optional<string> unit = default; + Optional<string> system = default; + Optional<string> code = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("comparator"u8)) + { + comparator = property.Value.GetString(); + continue; + } + if (property.NameEquals("unit"u8)) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Quantity(id.Value, Optional.ToList(extension), serializedAdditionalRawData, Optional.ToNullable(value), comparator.Value, unit.Value, system.Value, code.Value); + } + + BinaryData IPersistableModel<FhirR4Quantity>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{options.Format}' format."); + } + } + + FhirR4Quantity IPersistableModel<FhirR4Quantity>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Quantity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Quantity>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Quantity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Quantity(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Quantity.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Quantity.cs new file mode 100644 index 0000000000000..19dbe4b3f2246 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Quantity.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A measured or measurable amount + /// Based on [FHIR Quantity](https://www.hl7.org/fhir/R4/datatypes.html#Quantity) + /// </summary> + public partial class FhirR4Quantity : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Quantity"/>. </summary> + public FhirR4Quantity() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Quantity"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="value"> Numerical value (with implicit precision). </param> + /// <param name="comparator"> < | <= | >= | > - how to understand the value. </param> + /// <param name="unit"> Unit representation. </param> + /// <param name="system"> System that defines coded unit form. </param> + /// <param name="code"> Coded form of the unit. </param> + internal FhirR4Quantity(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, double? value, string comparator, string unit, string system, string code) : base(id, extension, serializedAdditionalRawData) + { + Value = value; + Comparator = comparator; + Unit = unit; + System = system; + Code = code; + } + + /// <summary> Numerical value (with implicit precision). </summary> + public double? Value { get; set; } + /// <summary> < | <= | >= | > - how to understand the value. </summary> + public string Comparator { get; set; } + /// <summary> Unit representation. </summary> + public string Unit { get; set; } + /// <summary> System that defines coded unit form. </summary> + public string System { get; set; } + /// <summary> Coded form of the unit. </summary> + public string Code { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Range.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Range.Serialization.cs new file mode 100644 index 0000000000000..c20004b118b8b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Range.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Range : IUtf8JsonSerializable, IJsonModel<FhirR4Range> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Range>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Range>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Low)) + { + writer.WritePropertyName("low"u8); + writer.WriteObjectValue(Low); + } + if (Optional.IsDefined(High)) + { + writer.WritePropertyName("high"u8); + writer.WriteObjectValue(High); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Range IJsonModel<FhirR4Range>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Range(document.RootElement, options); + } + + internal static FhirR4Range DeserializeFhirR4Range(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Quantity> low = default; + Optional<FhirR4Quantity> high = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("low"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + low = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("high"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + high = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Range(id.Value, Optional.ToList(extension), serializedAdditionalRawData, low.Value, high.Value); + } + + BinaryData IPersistableModel<FhirR4Range>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{options.Format}' format."); + } + } + + FhirR4Range IPersistableModel<FhirR4Range>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Range(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Range>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Range FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Range(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Range.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Range.cs new file mode 100644 index 0000000000000..50e21635989d9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Range.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A set of ordered Quantities defined by a low and high limit + /// Based on [FHIR Range](https://www.hl7.org/fhir/R4/datatypes.html#Range) + /// </summary> + public partial class FhirR4Range : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Range"/>. </summary> + public FhirR4Range() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Range"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="low"> Low limit. </param> + /// <param name="high"> High limit. </param> + internal FhirR4Range(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity low, FhirR4Quantity high) : base(id, extension, serializedAdditionalRawData) + { + Low = low; + High = high; + } + + /// <summary> Low limit. </summary> + public FhirR4Quantity Low { get; set; } + /// <summary> High limit. </summary> + public FhirR4Quantity High { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Ratio.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Ratio.Serialization.cs new file mode 100644 index 0000000000000..11cdf7dbcddc3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Ratio.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Ratio : IUtf8JsonSerializable, IJsonModel<FhirR4Ratio> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Ratio>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Ratio>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Numerator)) + { + writer.WritePropertyName("numerator"u8); + writer.WriteObjectValue(Numerator); + } + if (Optional.IsDefined(Denominator)) + { + writer.WritePropertyName("denominator"u8); + writer.WriteObjectValue(Denominator); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Ratio IJsonModel<FhirR4Ratio>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Ratio(document.RootElement, options); + } + + internal static FhirR4Ratio DeserializeFhirR4Ratio(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Quantity> numerator = default; + Optional<FhirR4Quantity> denominator = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numerator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numerator = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("denominator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + denominator = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Ratio(id.Value, Optional.ToList(extension), serializedAdditionalRawData, numerator.Value, denominator.Value); + } + + BinaryData IPersistableModel<FhirR4Ratio>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{options.Format}' format."); + } + } + + FhirR4Ratio IPersistableModel<FhirR4Ratio>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Ratio(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Ratio>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Ratio FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Ratio(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Ratio.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Ratio.cs new file mode 100644 index 0000000000000..30e76f5e6dcb9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Ratio.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A ratio of two Quantity values - a numerator and a denominator + /// Based on [FHIR Ratio](https://www.hl7.org/fhir/R4/datatypes.html#Ratio) + /// </summary> + public partial class FhirR4Ratio : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Ratio"/>. </summary> + public FhirR4Ratio() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Ratio"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="numerator"> Numerator value. </param> + /// <param name="denominator"> Denominator value. </param> + internal FhirR4Ratio(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity numerator, FhirR4Quantity denominator) : base(id, extension, serializedAdditionalRawData) + { + Numerator = numerator; + Denominator = denominator; + } + + /// <summary> Numerator value. </summary> + public FhirR4Quantity Numerator { get; set; } + /// <summary> Denominator value. </summary> + public FhirR4Quantity Denominator { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Reference.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Reference.Serialization.cs new file mode 100644 index 0000000000000..30e033eb2c661 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Reference.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Reference : IUtf8JsonSerializable, IJsonModel<FhirR4Reference> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Reference>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Reference>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Reference)) + { + writer.WritePropertyName("reference"u8); + writer.WriteStringValue(Reference); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (Optional.IsDefined(Identifier)) + { + writer.WritePropertyName("identifier"u8); + writer.WriteObjectValue(Identifier); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Reference IJsonModel<FhirR4Reference>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Reference(document.RootElement, options); + } + + internal static FhirR4Reference DeserializeFhirR4Reference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> reference = default; + Optional<string> type = default; + Optional<FhirR4Identifier> identifier = default; + Optional<string> display = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reference"u8)) + { + reference = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("identifier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identifier = FhirR4Identifier.DeserializeFhirR4Identifier(property.Value); + continue; + } + if (property.NameEquals("display"u8)) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Reference(id.Value, Optional.ToList(extension), serializedAdditionalRawData, reference.Value, type.Value, identifier.Value, display.Value); + } + + BinaryData IPersistableModel<FhirR4Reference>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{options.Format}' format."); + } + } + + FhirR4Reference IPersistableModel<FhirR4Reference>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Reference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Reference>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Reference FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Reference(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Reference.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Reference.cs new file mode 100644 index 0000000000000..4aac5045348ba --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Reference.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A reference from one resource to another + /// Based on [FHIR Reference](https://www.hl7.org/fhir/R4/references.html) + /// </summary> + public partial class FhirR4Reference : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Reference"/>. </summary> + public FhirR4Reference() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Reference"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="reference"> Literal reference, Relative, internal or absolute URL. </param> + /// <param name="type"> Type the reference refers to (e.g. "Patient"). </param> + /// <param name="identifier"> Logical reference, when literal reference is not known. </param> + /// <param name="display"> Text alternative for the resource. </param> + internal FhirR4Reference(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string reference, string type, FhirR4Identifier identifier, string display) : base(id, extension, serializedAdditionalRawData) + { + Reference = reference; + Type = type; + Identifier = identifier; + Display = display; + } + + /// <summary> Literal reference, Relative, internal or absolute URL. </summary> + public string Reference { get; set; } + /// <summary> Type the reference refers to (e.g. "Patient"). </summary> + public string Type { get; set; } + /// <summary> Logical reference, when literal reference is not known. </summary> + public FhirR4Identifier Identifier { get; set; } + /// <summary> Text alternative for the resource. </summary> + public string Display { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ResearchStudy.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ResearchStudy.Serialization.cs new file mode 100644 index 0000000000000..ccc5e14413ef1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ResearchStudy.Serialization.cs @@ -0,0 +1,738 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4ResearchStudy : IUtf8JsonSerializable, IJsonModel<FhirR4ResearchStudy> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4ResearchStudy>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4ResearchStudy>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ResearchStudy>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ResearchStudy)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Identifier)) + { + writer.WritePropertyName("identifier"u8); + writer.WriteStartArray(); + foreach (var item in Identifier) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Title)) + { + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + } + if (Optional.IsCollectionDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStartArray(); + foreach (var item in Protocol) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PartOf)) + { + writer.WritePropertyName("partOf"u8); + writer.WriteStartArray(); + foreach (var item in PartOf) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(PrimaryPurposeType)) + { + writer.WritePropertyName("primaryPurposeType"u8); + writer.WriteObjectValue(PrimaryPurposeType); + } + if (Optional.IsDefined(Phase)) + { + writer.WritePropertyName("phase"u8); + writer.WriteObjectValue(Phase); + } + if (Optional.IsCollectionDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStartArray(); + foreach (var item in Category) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Focus)) + { + writer.WritePropertyName("focus"u8); + writer.WriteStartArray(); + foreach (var item in Focus) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Condition)) + { + writer.WritePropertyName("condition"u8); + writer.WriteStartArray(); + foreach (var item in Condition) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Contact)) + { + writer.WritePropertyName("contact"u8); + writer.WriteStartArray(); + foreach (var item in Contact) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Keyword)) + { + writer.WritePropertyName("keyword"u8); + writer.WriteStartArray(); + foreach (var item in Keyword) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStartArray(); + foreach (var item in Location) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(Enrollment)) + { + writer.WritePropertyName("enrollment"u8); + writer.WriteStartArray(); + foreach (var item in Enrollment) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Period)) + { + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); + } + if (Optional.IsDefined(Sponsor)) + { + writer.WritePropertyName("sponsor"u8); + writer.WriteObjectValue(Sponsor); + } + if (Optional.IsDefined(PrincipalInvestigator)) + { + writer.WritePropertyName("principalInvestigator"u8); + writer.WriteObjectValue(PrincipalInvestigator); + } + if (Optional.IsCollectionDefined(Site)) + { + writer.WritePropertyName("site"u8); + writer.WriteStartArray(); + foreach (var item in Site) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ReasonStopped)) + { + writer.WritePropertyName("reasonStopped"u8); + writer.WriteObjectValue(ReasonStopped); + } + if (Optional.IsCollectionDefined(Note)) + { + writer.WritePropertyName("note"u8); + writer.WriteStartArray(); + foreach (var item in Note) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Arm)) + { + writer.WritePropertyName("arm"u8); + writer.WriteStartArray(); + foreach (var item in Arm) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Objective)) + { + writer.WritePropertyName("objective"u8); + writer.WriteStartArray(); + foreach (var item in Objective) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteObjectValue(Text); + } + if (Optional.IsCollectionDefined(Contained)) + { + writer.WritePropertyName("contained"u8); + writer.WriteStartArray(); + foreach (var item in Contained) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ModifierExtension)) + { + writer.WritePropertyName("modifierExtension"u8); + writer.WriteStartArray(); + foreach (var item in ModifierExtension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4ResearchStudy IJsonModel<FhirR4ResearchStudy>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ResearchStudy>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ResearchStudy)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4ResearchStudy(document.RootElement, options); + } + + internal static FhirR4ResearchStudy DeserializeFhirR4ResearchStudy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Identifier>> identifier = default; + Optional<string> title = default; + Optional<IList<FhirR4Reference>> protocol = default; + Optional<IList<FhirR4Reference>> partOf = default; + ResearchStudyStatusCodeType status = default; + Optional<FhirR4CodeableConcept> primaryPurposeType = default; + Optional<FhirR4CodeableConcept> phase = default; + Optional<IList<FhirR4CodeableConcept>> category = default; + Optional<IList<FhirR4CodeableConcept>> focus = default; + Optional<IList<FhirR4CodeableConcept>> condition = default; + Optional<IList<FhirR4ContactDetail>> contact = default; + Optional<IList<FhirR4CodeableConcept>> keyword = default; + Optional<IList<FhirR4CodeableConcept>> location = default; + Optional<string> description = default; + Optional<IList<FhirR4Reference>> enrollment = default; + Optional<FhirR4Period> period = default; + Optional<FhirR4Reference> sponsor = default; + Optional<FhirR4Reference> principalInvestigator = default; + Optional<IList<FhirR4Reference>> site = default; + Optional<FhirR4CodeableConcept> reasonStopped = default; + Optional<IList<FhirR4Annotation>> note = default; + Optional<IList<ResearchStudyArm>> arm = default; + Optional<IList<ResearchStudyObjective>> objective = default; + Optional<FhirR4Narrative> text = default; + Optional<IList<FhirR4Resource>> contained = default; + Optional<IList<FhirR4Extension>> extension = default; + Optional<IList<FhirR4Extension>> modifierExtension = default; + string resourceType = default; + Optional<string> id = default; + Optional<FhirR4Meta> meta = default; + Optional<string> implicitRules = default; + Optional<string> language = default; + IDictionary<string, BinaryData> additionalProperties = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identifier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Identifier> array = new List<FhirR4Identifier>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Identifier.DeserializeFhirR4Identifier(item)); + } + identifier = array; + continue; + } + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Reference> array = new List<FhirR4Reference>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Reference.DeserializeFhirR4Reference(item)); + } + protocol = array; + continue; + } + if (property.NameEquals("partOf"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Reference> array = new List<FhirR4Reference>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Reference.DeserializeFhirR4Reference(item)); + } + partOf = array; + continue; + } + if (property.NameEquals("status"u8)) + { + status = new ResearchStudyStatusCodeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("primaryPurposeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + primaryPurposeType = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("phase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + phase = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + category = array; + continue; + } + if (property.NameEquals("focus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + focus = array; + continue; + } + if (property.NameEquals("condition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + condition = array; + continue; + } + if (property.NameEquals("contact"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4ContactDetail> array = new List<FhirR4ContactDetail>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4ContactDetail.DeserializeFhirR4ContactDetail(item)); + } + contact = array; + continue; + } + if (property.NameEquals("keyword"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + keyword = array; + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + location = array; + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("enrollment"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Reference> array = new List<FhirR4Reference>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Reference.DeserializeFhirR4Reference(item)); + } + enrollment = array; + continue; + } + if (property.NameEquals("period"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + period = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("sponsor"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sponsor = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("principalInvestigator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalInvestigator = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("site"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Reference> array = new List<FhirR4Reference>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Reference.DeserializeFhirR4Reference(item)); + } + site = array; + continue; + } + if (property.NameEquals("reasonStopped"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reasonStopped = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("note"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Annotation> array = new List<FhirR4Annotation>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Annotation.DeserializeFhirR4Annotation(item)); + } + note = array; + continue; + } + if (property.NameEquals("arm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<ResearchStudyArm> array = new List<ResearchStudyArm>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResearchStudyArm.DeserializeResearchStudyArm(item)); + } + arm = array; + continue; + } + if (property.NameEquals("objective"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<ResearchStudyObjective> array = new List<ResearchStudyObjective>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResearchStudyObjective.DeserializeResearchStudyObjective(item)); + } + objective = array; + continue; + } + if (property.NameEquals("text"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + text = FhirR4Narrative.DeserializeFhirR4Narrative(property.Value); + continue; + } + if (property.NameEquals("contained"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Resource> array = new List<FhirR4Resource>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeFhirR4Resource(item)); + } + contained = array; + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (property.NameEquals("modifierExtension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + modifierExtension = array; + continue; + } + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("meta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + meta = FhirR4Meta.DeserializeFhirR4Meta(property.Value); + continue; + } + if (property.NameEquals("implicitRules"u8)) + { + implicitRules = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new FhirR4ResearchStudy(resourceType, id.Value, meta.Value, implicitRules.Value, language.Value, additionalProperties, text.Value, Optional.ToList(contained), Optional.ToList(extension), Optional.ToList(modifierExtension), Optional.ToList(identifier), title.Value, Optional.ToList(protocol), Optional.ToList(partOf), status, primaryPurposeType.Value, phase.Value, Optional.ToList(category), Optional.ToList(focus), Optional.ToList(condition), Optional.ToList(contact), Optional.ToList(keyword), Optional.ToList(location), description.Value, Optional.ToList(enrollment), period.Value, sponsor.Value, principalInvestigator.Value, Optional.ToList(site), reasonStopped.Value, Optional.ToList(note), Optional.ToList(arm), Optional.ToList(objective)); + } + + BinaryData IPersistableModel<FhirR4ResearchStudy>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ResearchStudy>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4ResearchStudy)} does not support '{options.Format}' format."); + } + } + + FhirR4ResearchStudy IPersistableModel<FhirR4ResearchStudy>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ResearchStudy>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4ResearchStudy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4ResearchStudy)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4ResearchStudy>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4ResearchStudy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4ResearchStudy(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ResearchStudy.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ResearchStudy.cs new file mode 100644 index 0000000000000..1bcb51d72663b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4ResearchStudy.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// Detailed information about Research Study + /// Based on [FHIR ResearchStudy](https://www.hl7.org/fhir/R4/researchstudy.html) + /// </summary> + public partial class FhirR4ResearchStudy : FhirR4DomainResource + { + /// <summary> Initializes a new instance of <see cref="FhirR4ResearchStudy"/>. </summary> + /// <param name="status"> active | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | in-review | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | withdrawn. </param> + public FhirR4ResearchStudy(ResearchStudyStatusCodeType status) : base("ResearchStudy") + { + Identifier = new ChangeTrackingList<FhirR4Identifier>(); + Protocol = new ChangeTrackingList<FhirR4Reference>(); + PartOf = new ChangeTrackingList<FhirR4Reference>(); + Status = status; + Category = new ChangeTrackingList<FhirR4CodeableConcept>(); + Focus = new ChangeTrackingList<FhirR4CodeableConcept>(); + Condition = new ChangeTrackingList<FhirR4CodeableConcept>(); + Contact = new ChangeTrackingList<FhirR4ContactDetail>(); + Keyword = new ChangeTrackingList<FhirR4CodeableConcept>(); + Location = new ChangeTrackingList<FhirR4CodeableConcept>(); + Enrollment = new ChangeTrackingList<FhirR4Reference>(); + Site = new ChangeTrackingList<FhirR4Reference>(); + Note = new ChangeTrackingList<FhirR4Annotation>(); + Arm = new ChangeTrackingList<ResearchStudyArm>(); + Objective = new ChangeTrackingList<ResearchStudyObjective>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4ResearchStudy"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <param name="text"> Text summary of the resource, for human interpretation. </param> + /// <param name="contained"> Contained, inline Resources. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="modifierExtension"> Extensions that cannot be ignored. </param> + /// <param name="identifier"> Business Identifier for study. </param> + /// <param name="title"> Name for this study. </param> + /// <param name="protocol"> Steps followed in executing study. </param> + /// <param name="partOf"> Part of larger study. </param> + /// <param name="status"> active | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | in-review | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | withdrawn. </param> + /// <param name="primaryPurposeType"> treatment | prevention | diagnostic | supportive-care | screening | health-services-research | basic-science | device-feasibility. </param> + /// <param name="phase"> n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | phase-2-phase-3 | phase-3 | phase-4. </param> + /// <param name="category"> Classifications for the study. </param> + /// <param name="focus"> Drugs, devices, etc. under study. </param> + /// <param name="condition"> Condition being studied. </param> + /// <param name="contact"> Contact details for the study. </param> + /// <param name="keyword"> Used to search for the study. </param> + /// <param name="location"> Geographic region(s) for study. </param> + /// <param name="description"> What this is study doing. </param> + /// <param name="enrollment"> Inclusion & exclusion criteria. </param> + /// <param name="period"> When the study began and ended. </param> + /// <param name="sponsor"> Organization that initiates and is legally responsible for the study. </param> + /// <param name="principalInvestigator"> Researcher who oversees multiple aspects of the study. </param> + /// <param name="site"> Facility where study activities are conducted. </param> + /// <param name="reasonStopped"> accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-study-progress | temporarily-closed-per-study-design. </param> + /// <param name="note"> Comments made about the study. </param> + /// <param name="arm"> Defined path through the study for a subject. </param> + /// <param name="objective"> A goal for the study. </param> + internal FhirR4ResearchStudy(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties, FhirR4Narrative text, IList<FhirR4Resource> contained, IList<FhirR4Extension> extension, IList<FhirR4Extension> modifierExtension, IList<FhirR4Identifier> identifier, string title, IList<FhirR4Reference> protocol, IList<FhirR4Reference> partOf, ResearchStudyStatusCodeType status, FhirR4CodeableConcept primaryPurposeType, FhirR4CodeableConcept phase, IList<FhirR4CodeableConcept> category, IList<FhirR4CodeableConcept> focus, IList<FhirR4CodeableConcept> condition, IList<FhirR4ContactDetail> contact, IList<FhirR4CodeableConcept> keyword, IList<FhirR4CodeableConcept> location, string description, IList<FhirR4Reference> enrollment, FhirR4Period period, FhirR4Reference sponsor, FhirR4Reference principalInvestigator, IList<FhirR4Reference> site, FhirR4CodeableConcept reasonStopped, IList<FhirR4Annotation> note, IList<ResearchStudyArm> arm, IList<ResearchStudyObjective> objective) : base(resourceType, id, meta, implicitRules, language, additionalProperties, text, contained, extension, modifierExtension) + { + Identifier = identifier; + Title = title; + Protocol = protocol; + PartOf = partOf; + Status = status; + PrimaryPurposeType = primaryPurposeType; + Phase = phase; + Category = category; + Focus = focus; + Condition = condition; + Contact = contact; + Keyword = keyword; + Location = location; + Description = description; + Enrollment = enrollment; + Period = period; + Sponsor = sponsor; + PrincipalInvestigator = principalInvestigator; + Site = site; + ReasonStopped = reasonStopped; + Note = note; + Arm = arm; + Objective = objective; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4ResearchStudy"/> for deserialization. </summary> + internal FhirR4ResearchStudy() + { + } + + /// <summary> Business Identifier for study. </summary> + public IList<FhirR4Identifier> Identifier { get; } + /// <summary> Name for this study. </summary> + public string Title { get; set; } + /// <summary> Steps followed in executing study. </summary> + public IList<FhirR4Reference> Protocol { get; } + /// <summary> Part of larger study. </summary> + public IList<FhirR4Reference> PartOf { get; } + /// <summary> active | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | in-review | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | withdrawn. </summary> + public ResearchStudyStatusCodeType Status { get; } + /// <summary> treatment | prevention | diagnostic | supportive-care | screening | health-services-research | basic-science | device-feasibility. </summary> + public FhirR4CodeableConcept PrimaryPurposeType { get; set; } + /// <summary> n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | phase-2-phase-3 | phase-3 | phase-4. </summary> + public FhirR4CodeableConcept Phase { get; set; } + /// <summary> Classifications for the study. </summary> + public IList<FhirR4CodeableConcept> Category { get; } + /// <summary> Drugs, devices, etc. under study. </summary> + public IList<FhirR4CodeableConcept> Focus { get; } + /// <summary> Condition being studied. </summary> + public IList<FhirR4CodeableConcept> Condition { get; } + /// <summary> Contact details for the study. </summary> + public IList<FhirR4ContactDetail> Contact { get; } + /// <summary> Used to search for the study. </summary> + public IList<FhirR4CodeableConcept> Keyword { get; } + /// <summary> Geographic region(s) for study. </summary> + public IList<FhirR4CodeableConcept> Location { get; } + /// <summary> What this is study doing. </summary> + public string Description { get; set; } + /// <summary> Inclusion & exclusion criteria. </summary> + public IList<FhirR4Reference> Enrollment { get; } + /// <summary> When the study began and ended. </summary> + public FhirR4Period Period { get; set; } + /// <summary> Organization that initiates and is legally responsible for the study. </summary> + public FhirR4Reference Sponsor { get; set; } + /// <summary> Researcher who oversees multiple aspects of the study. </summary> + public FhirR4Reference PrincipalInvestigator { get; set; } + /// <summary> Facility where study activities are conducted. </summary> + public IList<FhirR4Reference> Site { get; } + /// <summary> accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-study-progress | temporarily-closed-per-study-design. </summary> + public FhirR4CodeableConcept ReasonStopped { get; set; } + /// <summary> Comments made about the study. </summary> + public IList<FhirR4Annotation> Note { get; } + /// <summary> Defined path through the study for a subject. </summary> + public IList<ResearchStudyArm> Arm { get; } + /// <summary> A goal for the study. </summary> + public IList<ResearchStudyObjective> Objective { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Resource.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Resource.Serialization.cs new file mode 100644 index 0000000000000..bbc05e9e8421c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Resource.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4Resource : IUtf8JsonSerializable, IJsonModel<FhirR4Resource> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Resource>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Resource>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4Resource IJsonModel<FhirR4Resource>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Resource(document.RootElement, options); + } + + internal static FhirR4Resource DeserializeFhirR4Resource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceType = default; + Optional<string> id = default; + Optional<FhirR4Meta> meta = default; + Optional<string> implicitRules = default; + Optional<string> language = default; + IDictionary<string, BinaryData> additionalProperties = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("meta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + meta = FhirR4Meta.DeserializeFhirR4Meta(property.Value); + continue; + } + if (property.NameEquals("implicitRules"u8)) + { + implicitRules = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new FhirR4Resource(resourceType, id.Value, meta.Value, implicitRules.Value, language.Value, additionalProperties); + } + + BinaryData IPersistableModel<FhirR4Resource>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{options.Format}' format."); + } + } + + FhirR4Resource IPersistableModel<FhirR4Resource>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Resource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Resource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Resource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Resource(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/FhirR4Resource.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Resource.cs new file mode 100644 index 0000000000000..f8d73a8e40ef6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4Resource.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// Resource is the ancestor of DomainResource from which most resources are derived. Bundle, Parameters, and Binary extend Resource directly. + /// Based on [FHIR Resource](https://www.hl7.org/fhir/r4/resource.html + /// </summary> + public partial class FhirR4Resource + { + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <exception cref="ArgumentNullException"> <paramref name="resourceType"/> is null. </exception> + public FhirR4Resource(string resourceType) + { + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + ResourceType = resourceType; + AdditionalProperties = new ChangeTrackingDictionary<string, BinaryData>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + internal FhirR4Resource(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties) + { + ResourceType = resourceType; + Id = id; + Meta = meta; + ImplicitRules = implicitRules; + Language = language; + AdditionalProperties = additionalProperties; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/> for deserialization. </summary> + internal FhirR4Resource() + { + } + + /// <summary> The type of resource. </summary> + public string ResourceType { get; } + /// <summary> Resource Id. </summary> + public string Id { get; set; } + /// <summary> Metadata about the resource. </summary> + public FhirR4Meta Meta { get; set; } + /// <summary> A set of rules under which this content was created. </summary> + public string ImplicitRules { get; set; } + /// <summary> Language of the resource content. </summary> + public string Language { get; set; } + /// <summary> + /// Additional Properties + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + public IDictionary<string, BinaryData> AdditionalProperties { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4SampledData.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4SampledData.Serialization.cs new file mode 100644 index 0000000000000..869d2345a6097 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4SampledData.Serialization.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class FhirR4SampledData : IUtf8JsonSerializable, IJsonModel<FhirR4SampledData> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4SampledData>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4SampledData>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("origin"u8); + writer.WriteObjectValue(Origin); + writer.WritePropertyName("period"u8); + writer.WriteNumberValue(Period); + if (Optional.IsDefined(Factor)) + { + writer.WritePropertyName("factor"u8); + writer.WriteNumberValue(Factor.Value); + } + if (Optional.IsDefined(LowerLimit)) + { + writer.WritePropertyName("lowerLimit"u8); + writer.WriteNumberValue(LowerLimit.Value); + } + if (Optional.IsDefined(UpperLimit)) + { + writer.WritePropertyName("upperLimit"u8); + writer.WriteNumberValue(UpperLimit.Value); + } + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions); + if (Optional.IsDefined(Data)) + { + writer.WritePropertyName("data"u8); + writer.WriteStringValue(Data); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4SampledData IJsonModel<FhirR4SampledData>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4SampledData(document.RootElement, options); + } + + internal static FhirR4SampledData DeserializeFhirR4SampledData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FhirR4Quantity origin = default; + double period = default; + Optional<double> factor = default; + Optional<double> lowerLimit = default; + Optional<double> upperLimit = default; + int dimensions = default; + Optional<string> data = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("origin"u8)) + { + origin = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("period"u8)) + { + period = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("factor"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + factor = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("lowerLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lowerLimit = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("upperLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upperLimit = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("data"u8)) + { + data = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4SampledData(id.Value, Optional.ToList(extension), serializedAdditionalRawData, origin, period, Optional.ToNullable(factor), Optional.ToNullable(lowerLimit), Optional.ToNullable(upperLimit), dimensions, data.Value); + } + + BinaryData IPersistableModel<FhirR4SampledData>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{options.Format}' format."); + } + } + + FhirR4SampledData IPersistableModel<FhirR4SampledData>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4SampledData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4SampledData>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4SampledData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4SampledData(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4SampledData.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4SampledData.cs new file mode 100644 index 0000000000000..a362713d09959 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/FhirR4SampledData.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> + /// A series of measurements taken by a device + /// Based on [FHIR SampledData](https://www.hl7.org/fhir/R4/datatypes.html#SampledData) + /// </summary> + public partial class FhirR4SampledData : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/>. </summary> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <exception cref="ArgumentNullException"> <paramref name="origin"/> is null. </exception> + public FhirR4SampledData(FhirR4Quantity origin, double period, int dimensions) + { + Argument.AssertNotNull(origin, nameof(origin)); + + Origin = origin; + Period = period; + Dimensions = dimensions; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="factor"> Multiply data by this before adding to origin. </param> + /// <param name="lowerLimit"> Lower limit of detection. </param> + /// <param name="upperLimit"> Upper limit of detection. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <param name="data"> Decimal values with spaces, or "E" | "U" | "L". </param> + internal FhirR4SampledData(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity origin, double period, double? factor, double? lowerLimit, double? upperLimit, int dimensions, string data) : base(id, extension, serializedAdditionalRawData) + { + Origin = origin; + Period = period; + Factor = factor; + LowerLimit = lowerLimit; + UpperLimit = upperLimit; + Dimensions = dimensions; + Data = data; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/> for deserialization. </summary> + internal FhirR4SampledData() + { + } + + /// <summary> Zero value and units. </summary> + public FhirR4Quantity Origin { get; } + /// <summary> Number of milliseconds between samples. </summary> + public double Period { get; } + /// <summary> Multiply data by this before adding to origin. </summary> + public double? Factor { get; set; } + /// <summary> Lower limit of detection. </summary> + public double? LowerLimit { get; set; } + /// <summary> Upper limit of detection. </summary> + public double? UpperLimit { get; set; } + /// <summary> Number of sample points at each time point. </summary> + public int Dimensions { get; } + /// <summary> Decimal values with spaces, or "E" | "U" | "L". </summary> + public string Data { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/HealthInsightsClinicalMatchingModelFactory.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/HealthInsightsClinicalMatchingModelFactory.cs index 6495a126dcdf0..c16ecc4cb6b98 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/HealthInsightsClinicalMatchingModelFactory.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/HealthInsightsClinicalMatchingModelFactory.cs @@ -18,13 +18,212 @@ public static partial class HealthInsightsClinicalMatchingModelFactory /// <summary> Initializes a new instance of <see cref="ClinicalMatching.PatientRecord"/>. </summary> /// <param name="id"> A given identifier for the patient. Has to be unique across all patients in a single request. </param> /// <param name="info"> Patient structured information, including demographics and known structured clinical information. </param> - /// <param name="data"> Patient unstructured clinical data, given as documents. </param> + /// <param name="encounters"> Patient encounters/visits. </param> + /// <param name="patientDocuments"> Patient unstructured clinical data, given as documents. </param> /// <returns> A new <see cref="ClinicalMatching.PatientRecord"/> instance for mocking. </returns> - public static PatientRecord PatientRecord(string id = null, PatientInfo info = null, IEnumerable<PatientDocument> data = null) + public static PatientRecord PatientRecord(string id = null, PatientDetails info = null, IEnumerable<Encounter> encounters = null, IEnumerable<PatientDocument> patientDocuments = null) { - data ??= new List<PatientDocument>(); + encounters ??= new List<Encounter>(); + patientDocuments ??= new List<PatientDocument>(); - return new PatientRecord(id, info, data?.ToList(), serializedAdditionalRawData: null); + return new PatientRecord(id, info, encounters?.ToList(), patientDocuments?.ToList(), serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Resource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Resource"/> instance for mocking. </returns> + public static FhirR4Resource FhirR4Resource(string resourceType = null, string id = null, FhirR4Meta meta = null, string implicitRules = null, string language = null, IDictionary<string, BinaryData> additionalProperties = null) + { + additionalProperties ??= new Dictionary<string, BinaryData>(); + + return new FhirR4Resource(resourceType, id, meta, implicitRules, language, additionalProperties); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Element"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Element"/> instance for mocking. </returns> + public static FhirR4Element FhirR4Element(string id = null, IEnumerable<FhirR4Extension> extension = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Element(id, extension?.ToList(), serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Extension"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <param name="valueQuantity"> Value as Quantity. </param> + /// <param name="valueCodeableConcept"> Value as CodeableConcept. </param> + /// <param name="valueString"> Value as string. </param> + /// <param name="valueBoolean"> Value as boolean. </param> + /// <param name="valueInteger"> Value as integer. </param> + /// <param name="valueRange"> Value as Range. </param> + /// <param name="valueRatio"> Value as Ratio. </param> + /// <param name="valueSampledData"> Value as SampledData. </param> + /// <param name="valueTime"> Value as time (hh:mm:ss). </param> + /// <param name="valueDateTime"> Value as dateTime. </param> + /// <param name="valuePeriod"> Value as Period. </param> + /// <param name="valueReference"> Value as reference. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Extension"/> instance for mocking. </returns> + public static FhirR4Extension FhirR4Extension(string id = null, IEnumerable<FhirR4Extension> extension = null, string url = null, FhirR4Quantity valueQuantity = null, FhirR4CodeableConcept valueCodeableConcept = null, string valueString = null, bool? valueBoolean = null, int? valueInteger = null, FhirR4Range valueRange = null, FhirR4Ratio valueRatio = null, FhirR4SampledData valueSampledData = null, TimeSpan? valueTime = null, string valueDateTime = null, FhirR4Period valuePeriod = null, FhirR4Reference valueReference = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Extension(id, extension?.ToList(), serializedAdditionalRawData: null, url, valueQuantity, valueCodeableConcept, valueString, valueBoolean, valueInteger, valueRange, valueRatio, valueSampledData, valueTime, valueDateTime, valuePeriod, valueReference); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Quantity"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="value"> Numerical value (with implicit precision). </param> + /// <param name="comparator"> < | <= | >= | > - how to understand the value. </param> + /// <param name="unit"> Unit representation. </param> + /// <param name="system"> System that defines coded unit form. </param> + /// <param name="code"> Coded form of the unit. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Quantity"/> instance for mocking. </returns> + public static FhirR4Quantity FhirR4Quantity(string id = null, IEnumerable<FhirR4Extension> extension = null, double? value = null, string comparator = null, string unit = null, string system = null, string code = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Quantity(id, extension?.ToList(), serializedAdditionalRawData: null, value, comparator, unit, system, code); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4CodeableConcept"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="coding"> Code defined by a terminology system. </param> + /// <param name="text"> Plain text representation of the concept. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4CodeableConcept"/> instance for mocking. </returns> + public static FhirR4CodeableConcept FhirR4CodeableConcept(string id = null, IEnumerable<FhirR4Extension> extension = null, IEnumerable<FhirR4Coding> coding = null, string text = null) + { + extension ??= new List<FhirR4Extension>(); + coding ??= new List<FhirR4Coding>(); + + return new FhirR4CodeableConcept(id, extension?.ToList(), serializedAdditionalRawData: null, coding?.ToList(), text); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Coding"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="system"> Identity of the terminology system. </param> + /// <param name="version"> Version of the system - if relevant. </param> + /// <param name="code"> Symbol in syntax defined by the system. </param> + /// <param name="display"> Representation defined by the system. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Coding"/> instance for mocking. </returns> + public static FhirR4Coding FhirR4Coding(string id = null, IEnumerable<FhirR4Extension> extension = null, string system = null, string version = null, string code = null, string display = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Coding(id, extension?.ToList(), serializedAdditionalRawData: null, system, version, code, display); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Range"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="low"> Low limit. </param> + /// <param name="high"> High limit. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Range"/> instance for mocking. </returns> + public static FhirR4Range FhirR4Range(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity low = null, FhirR4Quantity high = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Range(id, extension?.ToList(), serializedAdditionalRawData: null, low, high); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Ratio"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="numerator"> Numerator value. </param> + /// <param name="denominator"> Denominator value. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Ratio"/> instance for mocking. </returns> + public static FhirR4Ratio FhirR4Ratio(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity numerator = null, FhirR4Quantity denominator = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Ratio(id, extension?.ToList(), serializedAdditionalRawData: null, numerator, denominator); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4SampledData"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="factor"> Multiply data by this before adding to origin. </param> + /// <param name="lowerLimit"> Lower limit of detection. </param> + /// <param name="upperLimit"> Upper limit of detection. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <param name="data"> Decimal values with spaces, or "E" | "U" | "L". </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4SampledData"/> instance for mocking. </returns> + public static FhirR4SampledData FhirR4SampledData(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity origin = null, double period = default, double? factor = null, double? lowerLimit = null, double? upperLimit = null, int dimensions = default, string data = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4SampledData(id, extension?.ToList(), serializedAdditionalRawData: null, origin, period, factor, lowerLimit, upperLimit, dimensions, data); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Period"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Period"/> instance for mocking. </returns> + public static FhirR4Period FhirR4Period(string id = null, IEnumerable<FhirR4Extension> extension = null, string start = null, string end = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Period(id, extension?.ToList(), serializedAdditionalRawData: null, start, end); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Reference"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="reference"> Literal reference, Relative, internal or absolute URL. </param> + /// <param name="type"> Type the reference refers to (e.g. "Patient"). </param> + /// <param name="identifier"> Logical reference, when literal reference is not known. </param> + /// <param name="display"> Text alternative for the resource. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Reference"/> instance for mocking. </returns> + public static FhirR4Reference FhirR4Reference(string id = null, IEnumerable<FhirR4Extension> extension = null, string reference = null, string type = null, FhirR4Identifier identifier = null, string display = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Reference(id, extension?.ToList(), serializedAdditionalRawData: null, reference, type, identifier, display); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Identifier"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="use"> usual | official | temp | secondary | old (If known). </param> + /// <param name="type"> Description of identifier. </param> + /// <param name="system"> The namespace for the identifier value. </param> + /// <param name="value"> The value that is unique. </param> + /// <param name="period"> Time period when id is/was valid for use. </param> + /// <param name="assigner"> Organization that issued id (may be just text). </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Identifier"/> instance for mocking. </returns> + public static FhirR4Identifier FhirR4Identifier(string id = null, IEnumerable<FhirR4Extension> extension = null, string use = null, FhirR4CodeableConcept type = null, string system = null, string value = null, FhirR4Period period = null, FhirR4Reference assigner = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Identifier(id, extension?.ToList(), serializedAdditionalRawData: null, use, type, system, value, period, assigner); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <param name="period"> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </param> + /// <param name="class"> The class of the encounter. </param> + /// <returns> A new <see cref="ClinicalMatching.Encounter"/> instance for mocking. </returns> + public static Encounter Encounter(string id = null, TimePeriod period = null, EncounterClass? @class = null) + { + return new Encounter(id, period, @class, serializedAdditionalRawData: null); } /// <summary> Initializes a new instance of <see cref="ClinicalMatching.PatientDocument"/>. </summary> @@ -33,11 +232,16 @@ public static PatientRecord PatientRecord(string id = null, PatientInfo info = n /// <param name="id"> A given identifier for the document. Has to be unique across all documents for a single patient. </param> /// <param name="language"> A 2 letter ISO 639-1 representation of the language of the document. </param> /// <param name="createdDateTime"> The date and time when the document was created. </param> + /// <param name="authors"> Document author(s). </param> + /// <param name="specialtyType"> specialty type the document. </param> + /// <param name="administrativeMetadata"> Administrative metadata for the document. </param> /// <param name="content"> The content of the patient document. </param> /// <returns> A new <see cref="ClinicalMatching.PatientDocument"/> instance for mocking. </returns> - public static PatientDocument PatientDocument(DocumentType type = default, ClinicalDocumentType? clinicalType = null, string id = null, string language = null, DateTimeOffset? createdDateTime = null, DocumentContent content = null) + public static PatientDocument PatientDocument(DocumentType type = default, ClinicalDocumentType? clinicalType = null, string id = null, string language = null, DateTimeOffset? createdDateTime = null, IEnumerable<DocumentAuthor> authors = null, SpecialtyType? specialtyType = null, DocumentAdministrativeMetadata administrativeMetadata = null, DocumentContent content = null) { - return new PatientDocument(type, clinicalType, id, language, createdDateTime, content, serializedAdditionalRawData: null); + authors ??= new List<DocumentAuthor>(); + + return new PatientDocument(type, clinicalType, id, language, createdDateTime, authors?.ToList(), specialtyType, administrativeMetadata, content, serializedAdditionalRawData: null); } /// <summary> Initializes a new instance of <see cref="ClinicalMatching.TrialMatcherModelConfiguration"/>. </summary> @@ -55,15 +259,144 @@ public static TrialMatcherModelConfiguration TrialMatcherModelConfiguration(bool return new TrialMatcherModelConfiguration(verbose, includeEvidence, clinicalTrials, serializedAdditionalRawData: null); } - /// <summary> Initializes a new instance of <see cref="ClinicalMatching.ClinicalTrialDetails"/>. </summary> - /// <param name="id"> A given identifier for the clinical trial. Has to be unique within a list of clinical trials. </param> - /// <param name="eligibilityCriteriaText"> The eligibility criteria of the clinical trial (inclusion and exclusion), given as text. </param> - /// <param name="demographics"> Demographic criteria for a clinical trial. </param> - /// <param name="metadata"> Trial data which is of interest to the potential participant. </param> - /// <returns> A new <see cref="ClinicalMatching.ClinicalTrialDetails"/> instance for mocking. </returns> - public static ClinicalTrialDetails ClinicalTrialDetails(string id = null, string eligibilityCriteriaText = null, ClinicalTrialDemographics demographics = null, ClinicalTrialMetadata metadata = null) + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4DomainResource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <param name="text"> Text summary of the resource, for human interpretation. </param> + /// <param name="contained"> Contained, inline Resources. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="modifierExtension"> Extensions that cannot be ignored. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4DomainResource"/> instance for mocking. </returns> + public static FhirR4DomainResource FhirR4DomainResource(string resourceType = null, string id = null, FhirR4Meta meta = null, string implicitRules = null, string language = null, IDictionary<string, BinaryData> additionalProperties = null, FhirR4Narrative text = null, IEnumerable<FhirR4Resource> contained = null, IEnumerable<FhirR4Extension> extension = null, IEnumerable<FhirR4Extension> modifierExtension = null) + { + additionalProperties ??= new Dictionary<string, BinaryData>(); + contained ??= new List<FhirR4Resource>(); + extension ??= new List<FhirR4Extension>(); + modifierExtension ??= new List<FhirR4Extension>(); + + return new UnknownFhirR4DomainResource(resourceType, id, meta, implicitRules, language, additionalProperties, text, contained?.ToList(), extension?.ToList(), modifierExtension?.ToList()); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Narrative"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="status"> generated, extensions, additional, empty. </param> + /// <param name="div"> xhtml. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Narrative"/> instance for mocking. </returns> + public static FhirR4Narrative FhirR4Narrative(string id = null, IEnumerable<FhirR4Extension> extension = null, string status = null, string div = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Narrative(id, extension?.ToList(), serializedAdditionalRawData: null, status, div); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4ResearchStudy"/>. </summary> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <param name="text"> Text summary of the resource, for human interpretation. </param> + /// <param name="contained"> Contained, inline Resources. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="modifierExtension"> Extensions that cannot be ignored. </param> + /// <param name="identifier"> Business Identifier for study. </param> + /// <param name="title"> Name for this study. </param> + /// <param name="protocol"> Steps followed in executing study. </param> + /// <param name="partOf"> Part of larger study. </param> + /// <param name="status"> active | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | in-review | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | withdrawn. </param> + /// <param name="primaryPurposeType"> treatment | prevention | diagnostic | supportive-care | screening | health-services-research | basic-science | device-feasibility. </param> + /// <param name="phase"> n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | phase-2-phase-3 | phase-3 | phase-4. </param> + /// <param name="category"> Classifications for the study. </param> + /// <param name="focus"> Drugs, devices, etc. under study. </param> + /// <param name="condition"> Condition being studied. </param> + /// <param name="contact"> Contact details for the study. </param> + /// <param name="keyword"> Used to search for the study. </param> + /// <param name="location"> Geographic region(s) for study. </param> + /// <param name="description"> What this is study doing. </param> + /// <param name="enrollment"> Inclusion & exclusion criteria. </param> + /// <param name="period"> When the study began and ended. </param> + /// <param name="sponsor"> Organization that initiates and is legally responsible for the study. </param> + /// <param name="principalInvestigator"> Researcher who oversees multiple aspects of the study. </param> + /// <param name="site"> Facility where study activities are conducted. </param> + /// <param name="reasonStopped"> accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-study-progress | temporarily-closed-per-study-design. </param> + /// <param name="note"> Comments made about the study. </param> + /// <param name="arm"> Defined path through the study for a subject. </param> + /// <param name="objective"> A goal for the study. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4ResearchStudy"/> instance for mocking. </returns> + public static FhirR4ResearchStudy FhirR4ResearchStudy(string id = null, FhirR4Meta meta = null, string implicitRules = null, string language = null, IDictionary<string, BinaryData> additionalProperties = null, FhirR4Narrative text = null, IEnumerable<FhirR4Resource> contained = null, IEnumerable<FhirR4Extension> extension = null, IEnumerable<FhirR4Extension> modifierExtension = null, IEnumerable<FhirR4Identifier> identifier = null, string title = null, IEnumerable<FhirR4Reference> protocol = null, IEnumerable<FhirR4Reference> partOf = null, ResearchStudyStatusCodeType status = default, FhirR4CodeableConcept primaryPurposeType = null, FhirR4CodeableConcept phase = null, IEnumerable<FhirR4CodeableConcept> category = null, IEnumerable<FhirR4CodeableConcept> focus = null, IEnumerable<FhirR4CodeableConcept> condition = null, IEnumerable<FhirR4ContactDetail> contact = null, IEnumerable<FhirR4CodeableConcept> keyword = null, IEnumerable<FhirR4CodeableConcept> location = null, string description = null, IEnumerable<FhirR4Reference> enrollment = null, FhirR4Period period = null, FhirR4Reference sponsor = null, FhirR4Reference principalInvestigator = null, IEnumerable<FhirR4Reference> site = null, FhirR4CodeableConcept reasonStopped = null, IEnumerable<FhirR4Annotation> note = null, IEnumerable<ResearchStudyArm> arm = null, IEnumerable<ResearchStudyObjective> objective = null) + { + additionalProperties ??= new Dictionary<string, BinaryData>(); + contained ??= new List<FhirR4Resource>(); + extension ??= new List<FhirR4Extension>(); + modifierExtension ??= new List<FhirR4Extension>(); + identifier ??= new List<FhirR4Identifier>(); + protocol ??= new List<FhirR4Reference>(); + partOf ??= new List<FhirR4Reference>(); + category ??= new List<FhirR4CodeableConcept>(); + focus ??= new List<FhirR4CodeableConcept>(); + condition ??= new List<FhirR4CodeableConcept>(); + contact ??= new List<FhirR4ContactDetail>(); + keyword ??= new List<FhirR4CodeableConcept>(); + location ??= new List<FhirR4CodeableConcept>(); + enrollment ??= new List<FhirR4Reference>(); + site ??= new List<FhirR4Reference>(); + note ??= new List<FhirR4Annotation>(); + arm ??= new List<ResearchStudyArm>(); + objective ??= new List<ResearchStudyObjective>(); + + return new FhirR4ResearchStudy("ResearchStudy", id, meta, implicitRules, language, additionalProperties, text, contained?.ToList(), extension?.ToList(), modifierExtension?.ToList(), identifier?.ToList(), title, protocol?.ToList(), partOf?.ToList(), status, primaryPurposeType, phase, category?.ToList(), focus?.ToList(), condition?.ToList(), contact?.ToList(), keyword?.ToList(), location?.ToList(), description, enrollment?.ToList(), period, sponsor, principalInvestigator, site?.ToList(), reasonStopped, note?.ToList(), arm?.ToList(), objective?.ToList()); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4ContactDetail"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="name"> Name of an individual to contact. </param> + /// <param name="telecom"> Contact details for individual or organization. </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4ContactDetail"/> instance for mocking. </returns> + public static FhirR4ContactDetail FhirR4ContactDetail(string id = null, IEnumerable<FhirR4Extension> extension = null, string name = null, IEnumerable<FhirR4ContactPoint> telecom = null) + { + extension ??= new List<FhirR4Extension>(); + telecom ??= new List<FhirR4ContactPoint>(); + + return new FhirR4ContactDetail(id, extension?.ToList(), serializedAdditionalRawData: null, name, telecom?.ToList()); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.FhirR4Annotation"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="authorString"> Individual responsible for the annotation. </param> + /// <param name="time"> When the annotation was made. </param> + /// <param name="text"> The annotation - text content (as markdown). </param> + /// <returns> A new <see cref="ClinicalMatching.FhirR4Annotation"/> instance for mocking. </returns> + public static FhirR4Annotation FhirR4Annotation(string id = null, IEnumerable<FhirR4Extension> extension = null, string authorString = null, string time = null, string text = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Annotation(id, extension?.ToList(), serializedAdditionalRawData: null, authorString, time, text); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.ResearchStudyArm"/>. </summary> + /// <param name="name"> Label for study arm. </param> + /// <param name="type"> Categorization of study arm. </param> + /// <param name="description"> Short explanation of study path. </param> + /// <returns> A new <see cref="ClinicalMatching.ResearchStudyArm"/> instance for mocking. </returns> + public static ResearchStudyArm ResearchStudyArm(string name = null, FhirR4CodeableConcept type = null, string description = null) { - return new ClinicalTrialDetails(id, eligibilityCriteriaText, demographics, metadata, serializedAdditionalRawData: null); + return new ResearchStudyArm(name, type, description, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.ResearchStudyObjective"/>. </summary> + /// <param name="name"> Label for the objective. </param> + /// <param name="type"> primary | secondary | exploratory. </param> + /// <returns> A new <see cref="ClinicalMatching.ResearchStudyObjective"/> instance for mocking. </returns> + public static ResearchStudyObjective ResearchStudyObjective(string name = null, FhirR4CodeableConcept type = null) + { + return new ResearchStudyObjective(name, type, serializedAdditionalRawData: null); } /// <summary> Initializes a new instance of <see cref="ClinicalMatching.GeographicLocation"/>. </summary> @@ -76,29 +409,29 @@ public static GeographicLocation GeographicLocation(string city = null, string s return new GeographicLocation(city, state, countryOrRegion, serializedAdditionalRawData: null); } - /// <summary> Initializes a new instance of <see cref="ClinicalMatching.TrialMatcherResults"/>. </summary> - /// <param name="patients"> Results for the patients given in the request. </param> + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.TrialMatcherInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> /// <param name="knowledgeGraphLastUpdateDate"> The date when the clinical trials knowledge graph was last updated. </param> - /// <returns> A new <see cref="ClinicalMatching.TrialMatcherResults"/> instance for mocking. </returns> - public static TrialMatcherResults TrialMatcherResults(IEnumerable<TrialMatcherPatientResult> patients = null, string modelVersion = null, DateTimeOffset? knowledgeGraphLastUpdateDate = null) + /// <returns> A new <see cref="ClinicalMatching.TrialMatcherInferenceResult"/> instance for mocking. </returns> + public static TrialMatcherInferenceResult TrialMatcherInferenceResult(IEnumerable<TrialMatcherPatientResult> patientResults = null, string modelVersion = null, DateTimeOffset? knowledgeGraphLastUpdateDate = null) { - patients ??= new List<TrialMatcherPatientResult>(); + patientResults ??= new List<TrialMatcherPatientResult>(); - return new TrialMatcherResults(patients?.ToList(), modelVersion, knowledgeGraphLastUpdateDate, serializedAdditionalRawData: null); + return new TrialMatcherInferenceResult(patientResults?.ToList(), modelVersion, knowledgeGraphLastUpdateDate, serializedAdditionalRawData: null); } /// <summary> Initializes a new instance of <see cref="ClinicalMatching.TrialMatcherPatientResult"/>. </summary> - /// <param name="id"> The identifier given for the patient in the request. </param> - /// <param name="inferences"> The model's inferences for the given patient. </param> + /// <param name="patientId"> The identifier given for the patient in the request. </param> + /// <param name="inferences"> The inference results for the patient. </param> /// <param name="neededClinicalInfo"> Clinical information which is needed to provide better trial matching results for the patient. </param> /// <returns> A new <see cref="ClinicalMatching.TrialMatcherPatientResult"/> instance for mocking. </returns> - public static TrialMatcherPatientResult TrialMatcherPatientResult(string id = null, IEnumerable<TrialMatcherInference> inferences = null, IEnumerable<ExtendedClinicalCodedElement> neededClinicalInfo = null) + public static TrialMatcherPatientResult TrialMatcherPatientResult(string patientId = null, IEnumerable<TrialMatcherInference> inferences = null, IEnumerable<ExtendedClinicalCodedElement> neededClinicalInfo = null) { inferences ??= new List<TrialMatcherInference>(); neededClinicalInfo ??= new List<ExtendedClinicalCodedElement>(); - return new TrialMatcherPatientResult(id, inferences?.ToList(), neededClinicalInfo?.ToList(), serializedAdditionalRawData: null); + return new TrialMatcherPatientResult(patientId, inferences?.ToList(), neededClinicalInfo?.ToList(), serializedAdditionalRawData: null); } /// <summary> Initializes a new instance of <see cref="ClinicalMatching.TrialMatcherInference"/>. </summary> @@ -107,15 +440,15 @@ public static TrialMatcherPatientResult TrialMatcherPatientResult(string id = nu /// <param name="description"> The description corresponding to the inference value. </param> /// <param name="confidenceScore"> Confidence score for this inference. </param> /// <param name="evidence"> The evidence corresponding to the inference value. </param> - /// <param name="id"> The identifier of the clinical trial. </param> + /// <param name="clinicalTrialId"> The identifier of the clinical trial. </param> /// <param name="source"> Possible sources of a clinical trial. </param> /// <param name="metadata"> Trial data which is of interest to the potential participant. </param> /// <returns> A new <see cref="ClinicalMatching.TrialMatcherInference"/> instance for mocking. </returns> - public static TrialMatcherInference TrialMatcherInference(TrialMatcherInferenceType type = default, string value = null, string description = null, float? confidenceScore = null, IEnumerable<TrialMatcherInferenceEvidence> evidence = null, string id = null, ClinicalTrialSource? source = null, ClinicalTrialMetadata metadata = null) + public static TrialMatcherInference TrialMatcherInference(TrialMatcherInferenceType type = default, string value = null, string description = null, float? confidenceScore = null, IEnumerable<TrialMatcherInferenceEvidence> evidence = null, string clinicalTrialId = null, ClinicalTrialSource? source = null, ClinicalTrialMetadata metadata = null) { evidence ??= new List<TrialMatcherInferenceEvidence>(); - return new TrialMatcherInference(type, value, description, confidenceScore, evidence?.ToList(), id, source, metadata, serializedAdditionalRawData: null); + return new TrialMatcherInference(type, value, description, confidenceScore, evidence?.ToList(), clinicalTrialId, source, metadata, serializedAdditionalRawData: null); } /// <summary> Initializes a new instance of <see cref="ClinicalMatching.TrialMatcherInferenceEvidence"/>. </summary> @@ -143,6 +476,61 @@ public static ClinicalNoteEvidence ClinicalNoteEvidence(string id = null, string return new ClinicalNoteEvidence(id, text, offset, length, serializedAdditionalRawData: null); } + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.ClinicalCodedElement"/>. </summary> + /// <param name="system"> The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. </param> + /// <param name="code"> The code within the given clinical coding system. </param> + /// <param name="name"> The name of this coded concept in the coding system. </param> + /// <param name="value"> A value associated with the code within the given clinical coding system. </param> + /// <returns> A new <see cref="ClinicalMatching.ClinicalCodedElement"/> instance for mocking. </returns> + public static ClinicalCodedElement ClinicalCodedElement(string system = null, string code = null, string name = null, string value = null) + { + return new ClinicalCodedElement(system, code, name, value, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.ClinicalTrialMetadata"/>. </summary> + /// <param name="phases"> + /// Phases which are relevant for the clinical trial. + /// Each clinical trial can be in a certain phase or in multiple phases. + /// </param> + /// <param name="studyType"> Possible study types of a clinical trial. </param> + /// <param name="recruitmentStatus"> Possible recruitment status of a clinical trial. </param> + /// <param name="conditions"> Medical conditions and their synonyms which are relevant for the clinical trial, given as strings. </param> + /// <param name="sponsors"> Sponsors/collaborators involved with the trial. </param> + /// <param name="contacts"> Contact details of the trial administrators, for patients that want to participate in the trial. </param> + /// <param name="facilities"> Research facilities where the clinical trial is conducted. </param> + /// <returns> A new <see cref="ClinicalMatching.ClinicalTrialMetadata"/> instance for mocking. </returns> + public static ClinicalTrialMetadata ClinicalTrialMetadata(IEnumerable<ClinicalTrialPhase> phases = null, ClinicalTrialStudyType? studyType = null, ClinicalTrialRecruitmentStatus? recruitmentStatus = null, IEnumerable<string> conditions = null, IEnumerable<string> sponsors = null, IEnumerable<ContactDetails> contacts = null, IEnumerable<ClinicalTrialResearchFacility> facilities = null) + { + phases ??= new List<ClinicalTrialPhase>(); + conditions ??= new List<string>(); + sponsors ??= new List<string>(); + contacts ??= new List<ContactDetails>(); + facilities ??= new List<ClinicalTrialResearchFacility>(); + + return new ClinicalTrialMetadata(phases?.ToList(), studyType, recruitmentStatus, conditions?.ToList(), sponsors?.ToList(), contacts?.ToList(), facilities?.ToList(), serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.ContactDetails"/>. </summary> + /// <param name="name"> The person's name. </param> + /// <param name="email"> The person's email. </param> + /// <param name="phone"> A person's phone number. </param> + /// <returns> A new <see cref="ClinicalMatching.ContactDetails"/> instance for mocking. </returns> + public static ContactDetails ContactDetails(string name = null, string email = null, string phone = null) + { + return new ContactDetails(name, email, phone, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.ClinicalTrialResearchFacility"/>. </summary> + /// <param name="name"> The facility's name. </param> + /// <param name="city"> City name. </param> + /// <param name="state"> State name. </param> + /// <param name="countryOrRegion"> Country/region name. </param> + /// <returns> A new <see cref="ClinicalMatching.ClinicalTrialResearchFacility"/> instance for mocking. </returns> + public static ClinicalTrialResearchFacility ClinicalTrialResearchFacility(string name = null, string city = null, string state = null, string countryOrRegion = null) + { + return new ClinicalTrialResearchFacility(name, city, state, countryOrRegion, serializedAdditionalRawData: null); + } + /// <summary> Initializes a new instance of <see cref="ClinicalMatching.ExtendedClinicalCodedElement"/>. </summary> /// <param name="system"> The clinical coding system, e.g. ICD-10, SNOMED-CT, UMLS. </param> /// <param name="code"> The code within the given clinical coding system. </param> diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDetails.Serialization.cs similarity index 71% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.Serialization.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDetails.Serialization.cs index 541e2510526e7..d26a033763922 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDetails.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.Health.Insights.ClinicalMatching { - public partial class PatientInfo : IUtf8JsonSerializable, IJsonModel<PatientInfo> + public partial class PatientDetails : IUtf8JsonSerializable, IJsonModel<PatientDetails> { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientInfo>)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientDetails>)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel<PatientInfo>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel<PatientDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<PatientInfo>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PatientInfo)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{format}' format."); } writer.WriteStartObject(); @@ -65,19 +65,19 @@ void IJsonModel<PatientInfo>.Write(Utf8JsonWriter writer, ModelReaderWriterOptio writer.WriteEndObject(); } - PatientInfo IJsonModel<PatientInfo>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PatientDetails IJsonModel<PatientDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<PatientInfo>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PatientInfo)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePatientInfo(document.RootElement, options); + return DeserializePatientDetails(document.RootElement, options); } - internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelReaderWriterOptions options = null) + internal static PatientDetails DeserializePatientDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -85,9 +85,9 @@ internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelRea { return null; } - Optional<PatientInfoSex> sex = default; + Optional<PatientSex> sex = default; Optional<DateTimeOffset> birthDate = default; - Optional<IList<ClinicalCodedElement>> clinicalInfo = default; + Optional<IList<FhirR4Resource>> clinicalInfo = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); foreach (var property in element.EnumerateObject()) @@ -98,7 +98,7 @@ internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelRea { continue; } - sex = new PatientInfoSex(property.Value.GetString()); + sex = new PatientSex(property.Value.GetString()); continue; } if (property.NameEquals("birthDate"u8)) @@ -116,10 +116,10 @@ internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelRea { continue; } - List<ClinicalCodedElement> array = new List<ClinicalCodedElement>(); + List<FhirR4Resource> array = new List<FhirR4Resource>(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ClinicalCodedElement.DeserializeClinicalCodedElement(item)); + array.Add(FhirR4Resource.DeserializeFhirR4Resource(item)); } clinicalInfo = array; continue; @@ -130,46 +130,46 @@ internal static PatientInfo DeserializePatientInfo(JsonElement element, ModelRea } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new PatientInfo(Optional.ToNullable(sex), Optional.ToNullable(birthDate), Optional.ToList(clinicalInfo), serializedAdditionalRawData); + return new PatientDetails(Optional.ToNullable(sex), Optional.ToNullable(birthDate), Optional.ToList(clinicalInfo), serializedAdditionalRawData); } - BinaryData IPersistableModel<PatientInfo>.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel<PatientDetails>.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<PatientInfo>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PatientInfo)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{options.Format}' format."); } } - PatientInfo IPersistableModel<PatientInfo>.Create(BinaryData data, ModelReaderWriterOptions options) + PatientDetails IPersistableModel<PatientDetails>.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<PatientInfo>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePatientInfo(document.RootElement, options); + return DeserializePatientDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PatientInfo)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{options.Format}' format."); } } - string IPersistableModel<PatientInfo>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel<PatientDetails>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// <summary> Deserializes the model from a raw response. </summary> /// <param name="response"> The response to deserialize the model from. </param> - internal static PatientInfo FromResponse(Response response) + internal static PatientDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializePatientInfo(document.RootElement); + return DeserializePatientDetails(document.RootElement); } /// <summary> Convert into a Utf8JsonRequestContent. </summary> diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDetails.cs similarity index 84% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDetails.cs index 2710b5f3edaae..114106ca2cda2 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfo.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDetails.cs @@ -12,7 +12,7 @@ namespace Azure.Health.Insights.ClinicalMatching { /// <summary> Patient structured information, including demographics and known structured clinical information. </summary> - public partial class PatientInfo + public partial class PatientDetails { /// <summary> /// Keeps track of any properties unknown to the library. @@ -46,18 +46,18 @@ public partial class PatientInfo /// </summary> private IDictionary<string, BinaryData> _serializedAdditionalRawData; - /// <summary> Initializes a new instance of <see cref="PatientInfo"/>. </summary> - public PatientInfo() + /// <summary> Initializes a new instance of <see cref="PatientDetails"/>. </summary> + public PatientDetails() { - ClinicalInfo = new ChangeTrackingList<ClinicalCodedElement>(); + ClinicalInfo = new ChangeTrackingList<FhirR4Resource>(); } - /// <summary> Initializes a new instance of <see cref="PatientInfo"/>. </summary> + /// <summary> Initializes a new instance of <see cref="PatientDetails"/>. </summary> /// <param name="sex"> The patient's sex. </param> /// <param name="birthDate"> The patient's date of birth. </param> /// <param name="clinicalInfo"> Known clinical information for the patient, structured. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal PatientInfo(PatientInfoSex? sex, DateTimeOffset? birthDate, IList<ClinicalCodedElement> clinicalInfo, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal PatientDetails(PatientSex? sex, DateTimeOffset? birthDate, IList<FhirR4Resource> clinicalInfo, IDictionary<string, BinaryData> serializedAdditionalRawData) { Sex = sex; BirthDate = birthDate; @@ -66,10 +66,10 @@ internal PatientInfo(PatientInfoSex? sex, DateTimeOffset? birthDate, IList<Clini } /// <summary> The patient's sex. </summary> - public PatientInfoSex? Sex { get; set; } + public PatientSex? Sex { get; set; } /// <summary> The patient's date of birth. </summary> public DateTimeOffset? BirthDate { get; set; } /// <summary> Known clinical information for the patient, structured. </summary> - public IList<ClinicalCodedElement> ClinicalInfo { get; } + public IList<FhirR4Resource> ClinicalInfo { get; } } } 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 index 1a929b0489169..fc1ccf3a09355 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.Serialization.cs @@ -46,6 +46,26 @@ void IJsonModel<PatientDocument>.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WritePropertyName("createdDateTime"u8); writer.WriteStringValue(CreatedDateTime.Value, "O"); } + if (Optional.IsCollectionDefined(Authors)) + { + writer.WritePropertyName("authors"u8); + writer.WriteStartArray(); + foreach (var item in Authors) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SpecialtyType)) + { + writer.WritePropertyName("specialtyType"u8); + writer.WriteStringValue(SpecialtyType.Value.ToString()); + } + if (Optional.IsDefined(AdministrativeMetadata)) + { + writer.WritePropertyName("administrativeMetadata"u8); + writer.WriteObjectValue(AdministrativeMetadata); + } writer.WritePropertyName("content"u8); writer.WriteObjectValue(Content); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -91,6 +111,9 @@ internal static PatientDocument DeserializePatientDocument(JsonElement element, string id = default; Optional<string> language = default; Optional<DateTimeOffset> createdDateTime = default; + Optional<IList<DocumentAuthor>> authors = default; + Optional<SpecialtyType> specialtyType = default; + Optional<DocumentAdministrativeMetadata> administrativeMetadata = default; DocumentContent content = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); @@ -129,6 +152,38 @@ internal static PatientDocument DeserializePatientDocument(JsonElement element, createdDateTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("authors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<DocumentAuthor> array = new List<DocumentAuthor>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentAuthor.DeserializeDocumentAuthor(item)); + } + authors = array; + continue; + } + if (property.NameEquals("specialtyType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + specialtyType = new SpecialtyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeMetadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeMetadata = DocumentAdministrativeMetadata.DeserializeDocumentAdministrativeMetadata(property.Value); + continue; + } if (property.NameEquals("content"u8)) { content = DocumentContent.DeserializeDocumentContent(property.Value); @@ -140,7 +195,7 @@ internal static PatientDocument DeserializePatientDocument(JsonElement element, } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new PatientDocument(type, Optional.ToNullable(clinicalType), id, language.Value, Optional.ToNullable(createdDateTime), content, serializedAdditionalRawData); + return new PatientDocument(type, Optional.ToNullable(clinicalType), id, language.Value, Optional.ToNullable(createdDateTime), Optional.ToList(authors), Optional.ToNullable(specialtyType), administrativeMetadata.Value, content, serializedAdditionalRawData); } BinaryData IPersistableModel<PatientDocument>.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.cs index 97809bb3434e4..6b8332b30330c 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientDocument.cs @@ -58,6 +58,7 @@ public PatientDocument(DocumentType type, string id, DocumentContent content) Type = type; Id = id; + Authors = new ChangeTrackingList<DocumentAuthor>(); Content = content; } @@ -67,15 +68,21 @@ public PatientDocument(DocumentType type, string id, DocumentContent content) /// <param name="id"> A given identifier for the document. Has to be unique across all documents for a single patient. </param> /// <param name="language"> A 2 letter ISO 639-1 representation of the language of the document. </param> /// <param name="createdDateTime"> The date and time when the document was created. </param> + /// <param name="authors"> Document author(s). </param> + /// <param name="specialtyType"> specialty type the document. </param> + /// <param name="administrativeMetadata"> Administrative metadata for the document. </param> /// <param name="content"> The content of the patient document. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal PatientDocument(DocumentType type, ClinicalDocumentType? clinicalType, string id, string language, DateTimeOffset? createdDateTime, DocumentContent content, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal PatientDocument(DocumentType type, ClinicalDocumentType? clinicalType, string id, string language, DateTimeOffset? createdDateTime, IList<DocumentAuthor> authors, SpecialtyType? specialtyType, DocumentAdministrativeMetadata administrativeMetadata, DocumentContent content, IDictionary<string, BinaryData> serializedAdditionalRawData) { Type = type; ClinicalType = clinicalType; Id = id; Language = language; CreatedDateTime = createdDateTime; + Authors = authors; + SpecialtyType = specialtyType; + AdministrativeMetadata = administrativeMetadata; Content = content; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -95,6 +102,12 @@ internal PatientDocument() public string Language { get; set; } /// <summary> The date and time when the document was created. </summary> public DateTimeOffset? CreatedDateTime { get; set; } + /// <summary> Document author(s). </summary> + public IList<DocumentAuthor> Authors { get; } + /// <summary> specialty type the document. </summary> + public SpecialtyType? SpecialtyType { get; set; } + /// <summary> Administrative metadata for the document. </summary> + public DocumentAdministrativeMetadata AdministrativeMetadata { get; set; } /// <summary> The content of the patient document. </summary> public DocumentContent Content { get; } } 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 index 1cac926debd53..6d130f782923e 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.Serialization.cs @@ -34,11 +34,21 @@ void IJsonModel<PatientRecord>.Write(Utf8JsonWriter writer, ModelReaderWriterOpt writer.WritePropertyName("info"u8); writer.WriteObjectValue(Info); } - if (Optional.IsCollectionDefined(Data)) + if (Optional.IsCollectionDefined(Encounters)) { - writer.WritePropertyName("data"u8); + writer.WritePropertyName("encounters"u8); writer.WriteStartArray(); - foreach (var item in Data) + foreach (var item in Encounters) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PatientDocuments)) + { + writer.WritePropertyName("patientDocuments"u8); + writer.WriteStartArray(); + foreach (var item in PatientDocuments) { writer.WriteObjectValue(item); } @@ -83,8 +93,9 @@ internal static PatientRecord DeserializePatientRecord(JsonElement element, Mode return null; } string id = default; - Optional<PatientInfo> info = default; - Optional<IList<PatientDocument>> data = default; + Optional<PatientDetails> info = default; + Optional<IList<Encounter>> encounters = default; + Optional<IList<PatientDocument>> patientDocuments = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); foreach (var property in element.EnumerateObject()) @@ -100,10 +111,24 @@ internal static PatientRecord DeserializePatientRecord(JsonElement element, Mode { continue; } - info = PatientInfo.DeserializePatientInfo(property.Value); + info = PatientDetails.DeserializePatientDetails(property.Value); + continue; + } + if (property.NameEquals("encounters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<Encounter> array = new List<Encounter>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Encounter.DeserializeEncounter(item)); + } + encounters = array; continue; } - if (property.NameEquals("data"u8)) + if (property.NameEquals("patientDocuments"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { @@ -114,7 +139,7 @@ internal static PatientRecord DeserializePatientRecord(JsonElement element, Mode { array.Add(PatientDocument.DeserializePatientDocument(item)); } - data = array; + patientDocuments = array; continue; } if (options.Format != "W") @@ -123,7 +148,7 @@ internal static PatientRecord DeserializePatientRecord(JsonElement element, Mode } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new PatientRecord(id, info.Value, Optional.ToList(data), serializedAdditionalRawData); + return new PatientRecord(id, info.Value, Optional.ToList(encounters), Optional.ToList(patientDocuments), serializedAdditionalRawData); } BinaryData IPersistableModel<PatientRecord>.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.cs index e0463627f273a..01cda5a59fda7 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientRecord.cs @@ -54,19 +54,22 @@ public PatientRecord(string id) Argument.AssertNotNull(id, nameof(id)); Id = id; - Data = new ChangeTrackingList<PatientDocument>(); + Encounters = new ChangeTrackingList<Encounter>(); + PatientDocuments = new ChangeTrackingList<PatientDocument>(); } /// <summary> Initializes a new instance of <see cref="PatientRecord"/>. </summary> /// <param name="id"> A given identifier for the patient. Has to be unique across all patients in a single request. </param> /// <param name="info"> Patient structured information, including demographics and known structured clinical information. </param> - /// <param name="data"> Patient unstructured clinical data, given as documents. </param> + /// <param name="encounters"> Patient encounters/visits. </param> + /// <param name="patientDocuments"> Patient unstructured clinical data, given as documents. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal PatientRecord(string id, PatientInfo info, IList<PatientDocument> data, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal PatientRecord(string id, PatientDetails info, IList<Encounter> encounters, IList<PatientDocument> patientDocuments, IDictionary<string, BinaryData> serializedAdditionalRawData) { Id = id; Info = info; - Data = data; + Encounters = encounters; + PatientDocuments = patientDocuments; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -78,8 +81,10 @@ internal PatientRecord() /// <summary> A given identifier for the patient. Has to be unique across all patients in a single request. </summary> public string Id { get; } /// <summary> Patient structured information, including demographics and known structured clinical information. </summary> - public PatientInfo Info { get; set; } + public PatientDetails Info { get; set; } + /// <summary> Patient encounters/visits. </summary> + public IList<Encounter> Encounters { get; } /// <summary> Patient unstructured clinical data, given as documents. </summary> - public IList<PatientDocument> Data { get; } + public IList<PatientDocument> PatientDocuments { get; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfoSex.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientSex.cs similarity index 52% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfoSex.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientSex.cs index 95f7b4f73e103..cb705981dfe78 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientInfoSex.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/PatientSex.cs @@ -11,13 +11,13 @@ namespace Azure.Health.Insights.ClinicalMatching { /// <summary> The patient's sex. </summary> - public readonly partial struct PatientInfoSex : IEquatable<PatientInfoSex> + public readonly partial struct PatientSex : IEquatable<PatientSex> { private readonly string _value; - /// <summary> Initializes a new instance of <see cref="PatientInfoSex"/>. </summary> + /// <summary> Initializes a new instance of <see cref="PatientSex"/>. </summary> /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> - public PatientInfoSex(string value) + public PatientSex(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -27,23 +27,23 @@ public PatientInfoSex(string value) private const string UnspecifiedValue = "unspecified"; /// <summary> female. </summary> - public static PatientInfoSex Female { get; } = new PatientInfoSex(FemaleValue); + public static PatientSex Female { get; } = new PatientSex(FemaleValue); /// <summary> male. </summary> - public static PatientInfoSex Male { get; } = new PatientInfoSex(MaleValue); + public static PatientSex Male { get; } = new PatientSex(MaleValue); /// <summary> unspecified. </summary> - public static PatientInfoSex Unspecified { get; } = new PatientInfoSex(UnspecifiedValue); - /// <summary> Determines if two <see cref="PatientInfoSex"/> values are the same. </summary> - public static bool operator ==(PatientInfoSex left, PatientInfoSex right) => left.Equals(right); - /// <summary> Determines if two <see cref="PatientInfoSex"/> values are not the same. </summary> - public static bool operator !=(PatientInfoSex left, PatientInfoSex right) => !left.Equals(right); - /// <summary> Converts a string to a <see cref="PatientInfoSex"/>. </summary> - public static implicit operator PatientInfoSex(string value) => new PatientInfoSex(value); + public static PatientSex Unspecified { get; } = new PatientSex(UnspecifiedValue); + /// <summary> Determines if two <see cref="PatientSex"/> values are the same. </summary> + public static bool operator ==(PatientSex left, PatientSex right) => left.Equals(right); + /// <summary> Determines if two <see cref="PatientSex"/> values are not the same. </summary> + public static bool operator !=(PatientSex left, PatientSex right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="PatientSex"/>. </summary> + public static implicit operator PatientSex(string value) => new PatientSex(value); /// <inheritdoc /> [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PatientInfoSex other && Equals(other); + public override bool Equals(object obj) => obj is PatientSex other && Equals(other); /// <inheritdoc /> - public bool Equals(PatientInfoSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(PatientSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// <inheritdoc /> [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyArm.Serialization.cs similarity index 61% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.Serialization.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyArm.Serialization.cs index e3b33fb9d127d..605d89ba15db0 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAgeRange.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyArm.Serialization.cs @@ -14,28 +14,30 @@ namespace Azure.Health.Insights.ClinicalMatching { - public partial class AcceptedAgeRange : IUtf8JsonSerializable, IJsonModel<AcceptedAgeRange> + public partial class ResearchStudyArm : IUtf8JsonSerializable, IJsonModel<ResearchStudyArm> { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<AcceptedAgeRange>)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<ResearchStudyArm>)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel<AcceptedAgeRange>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel<ResearchStudyArm>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<AcceptedAgeRange>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<ResearchStudyArm>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AcceptedAgeRange)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ResearchStudyArm)} does not support '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(MinimumAge)) + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Type)) { - writer.WritePropertyName("minimumAge"u8); - writer.WriteObjectValue(MinimumAge); + writer.WritePropertyName("type"u8); + writer.WriteObjectValue(Type); } - if (Optional.IsDefined(MaximumAge)) + if (Optional.IsDefined(Description)) { - writer.WritePropertyName("maximumAge"u8); - writer.WriteObjectValue(MaximumAge); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -55,19 +57,19 @@ void IJsonModel<AcceptedAgeRange>.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteEndObject(); } - AcceptedAgeRange IJsonModel<AcceptedAgeRange>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ResearchStudyArm IJsonModel<ResearchStudyArm>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<AcceptedAgeRange>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<ResearchStudyArm>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AcceptedAgeRange)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(ResearchStudyArm)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAcceptedAgeRange(document.RootElement, options); + return DeserializeResearchStudyArm(document.RootElement, options); } - internal static AcceptedAgeRange DeserializeAcceptedAgeRange(JsonElement element, ModelReaderWriterOptions options = null) + internal static ResearchStudyArm DeserializeResearchStudyArm(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -75,28 +77,30 @@ internal static AcceptedAgeRange DeserializeAcceptedAgeRange(JsonElement element { return null; } - Optional<AcceptedAge> minimumAge = default; - Optional<AcceptedAge> maximumAge = default; + string name = default; + Optional<FhirR4CodeableConcept> type = default; + Optional<string> description = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("minimumAge"u8)) + if (property.NameEquals("name"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - minimumAge = AcceptedAge.DeserializeAcceptedAge(property.Value); + name = property.Value.GetString(); continue; } - if (property.NameEquals("maximumAge"u8)) + if (property.NameEquals("type"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - maximumAge = AcceptedAge.DeserializeAcceptedAge(property.Value); + type = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); continue; } if (options.Format != "W") @@ -105,46 +109,46 @@ internal static AcceptedAgeRange DeserializeAcceptedAgeRange(JsonElement element } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new AcceptedAgeRange(minimumAge.Value, maximumAge.Value, serializedAdditionalRawData); + return new ResearchStudyArm(name, type.Value, description.Value, serializedAdditionalRawData); } - BinaryData IPersistableModel<AcceptedAgeRange>.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel<ResearchStudyArm>.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<AcceptedAgeRange>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<ResearchStudyArm>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AcceptedAgeRange)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ResearchStudyArm)} does not support '{options.Format}' format."); } } - AcceptedAgeRange IPersistableModel<AcceptedAgeRange>.Create(BinaryData data, ModelReaderWriterOptions options) + ResearchStudyArm IPersistableModel<ResearchStudyArm>.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<AcceptedAgeRange>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<ResearchStudyArm>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAcceptedAgeRange(document.RootElement, options); + return DeserializeResearchStudyArm(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AcceptedAgeRange)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(ResearchStudyArm)} does not support '{options.Format}' format."); } } - string IPersistableModel<AcceptedAgeRange>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel<ResearchStudyArm>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// <summary> Deserializes the model from a raw response. </summary> /// <param name="response"> The response to deserialize the model from. </param> - internal static AcceptedAgeRange FromResponse(Response response) + internal static ResearchStudyArm FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAcceptedAgeRange(document.RootElement); + return DeserializeResearchStudyArm(document.RootElement); } /// <summary> Convert into a Utf8JsonRequestContent. </summary> diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyArm.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyArm.cs new file mode 100644 index 0000000000000..85b739b1852fe --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyArm.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> The ResearchStudyArm. </summary> + public partial class ResearchStudyArm + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="ResearchStudyArm"/>. </summary> + /// <param name="name"> Label for study arm. </param> + /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception> + public ResearchStudyArm(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// <summary> Initializes a new instance of <see cref="ResearchStudyArm"/>. </summary> + /// <param name="name"> Label for study arm. </param> + /// <param name="type"> Categorization of study arm. </param> + /// <param name="description"> Short explanation of study path. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal ResearchStudyArm(string name, FhirR4CodeableConcept type, string description, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Name = name; + Type = type; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="ResearchStudyArm"/> for deserialization. </summary> + internal ResearchStudyArm() + { + } + + /// <summary> Label for study arm. </summary> + public string Name { get; } + /// <summary> Categorization of study arm. </summary> + public FhirR4CodeableConcept Type { get; set; } + /// <summary> Short explanation of study path. </summary> + public string Description { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyObjective.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyObjective.Serialization.cs new file mode 100644 index 0000000000000..e71958c7c1a93 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyObjective.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class ResearchStudyObjective : IUtf8JsonSerializable, IJsonModel<ResearchStudyObjective> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<ResearchStudyObjective>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<ResearchStudyObjective>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ResearchStudyObjective>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResearchStudyObjective)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteObjectValue(Type); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ResearchStudyObjective IJsonModel<ResearchStudyObjective>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ResearchStudyObjective>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResearchStudyObjective)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResearchStudyObjective(document.RootElement, options); + } + + internal static ResearchStudyObjective DeserializeResearchStudyObjective(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + Optional<FhirR4CodeableConcept> type = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new ResearchStudyObjective(name, type.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<ResearchStudyObjective>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ResearchStudyObjective>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResearchStudyObjective)} does not support '{options.Format}' format."); + } + } + + ResearchStudyObjective IPersistableModel<ResearchStudyObjective>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ResearchStudyObjective>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResearchStudyObjective(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResearchStudyObjective)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<ResearchStudyObjective>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static ResearchStudyObjective FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeResearchStudyObjective(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/ResearchStudyObjective.cs similarity index 58% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyObjective.cs index baf5b895b4120..dcf13d9e19d42 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyObjective.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.Health.Insights.ClinicalMatching { - /// <summary> A person's age, given as a number (value) and a unit (e.g. years, months). </summary> - public partial class AcceptedAge + /// <summary> The ResearchStudyObjective. </summary> + public partial class ResearchStudyObjective { /// <summary> /// Keeps track of any properties unknown to the library. @@ -45,34 +46,35 @@ public partial class AcceptedAge /// </summary> private IDictionary<string, BinaryData> _serializedAdditionalRawData; - /// <summary> Initializes a new instance of <see cref="AcceptedAge"/>. </summary> - /// <param name="unit"> Possible units for a person's age. </param> - /// <param name="value"> The number of years/months/days that represents the person's age. </param> - public AcceptedAge(AgeUnit unit, float value) + /// <summary> Initializes a new instance of <see cref="ResearchStudyObjective"/>. </summary> + /// <param name="name"> Label for the objective. </param> + /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception> + public ResearchStudyObjective(string name) { - Unit = unit; - Value = value; + Argument.AssertNotNull(name, nameof(name)); + + Name = name; } - /// <summary> Initializes a new instance of <see cref="AcceptedAge"/>. </summary> - /// <param name="unit"> Possible units for a person's age. </param> - /// <param name="value"> The number of years/months/days that represents the person's age. </param> + /// <summary> Initializes a new instance of <see cref="ResearchStudyObjective"/>. </summary> + /// <param name="name"> Label for the objective. </param> + /// <param name="type"> primary | secondary | exploratory. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal AcceptedAge(AgeUnit unit, float value, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal ResearchStudyObjective(string name, FhirR4CodeableConcept type, IDictionary<string, BinaryData> serializedAdditionalRawData) { - Unit = unit; - Value = value; + Name = name; + Type = type; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// <summary> Initializes a new instance of <see cref="AcceptedAge"/> for deserialization. </summary> - internal AcceptedAge() + /// <summary> Initializes a new instance of <see cref="ResearchStudyObjective"/> for deserialization. </summary> + internal ResearchStudyObjective() { } - /// <summary> Possible units for a person's age. </summary> - public AgeUnit Unit { get; } - /// <summary> The number of years/months/days that represents the person's age. </summary> - public float Value { get; } + /// <summary> Label for the objective. </summary> + public string Name { get; } + /// <summary> primary | secondary | exploratory. </summary> + public FhirR4CodeableConcept Type { get; set; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyStatusCodeType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyStatusCodeType.cs new file mode 100644 index 0000000000000..7f81b8e845274 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ResearchStudyStatusCodeType.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> https://www.hl7.org/fhir/R4/codesystem-research-study-status.html. </summary> + public readonly partial struct ResearchStudyStatusCodeType : IEquatable<ResearchStudyStatusCodeType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="ResearchStudyStatusCodeType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public ResearchStudyStatusCodeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "active"; + private const string AdministrativelyCompletedValue = "administratively-completed"; + private const string ApprovedValue = "approved"; + private const string ClosedToAccrualValue = "closed-to-accrual"; + private const string ClosedToAccrualAndInterventionValue = "closed-to-accrual-and-intervention"; + private const string CompletedValue = "completed"; + private const string DisapprovedValue = "disapproved"; + private const string InReviewValue = "in-review"; + private const string TemporarilyClosedToAccrualValue = "temporarily-closed-to-accrual"; + private const string TemporarilyClosedToAccrualAndInterventionValue = "temporarily-closed-to-accrual-and-intervention"; + private const string WithdrawnValue = "withdrawn"; + + /// <summary> The study is open for accrual. </summary> + public static ResearchStudyStatusCodeType Active { get; } = new ResearchStudyStatusCodeType(ActiveValue); + /// <summary> Study is completed prematurely and will not resume; patients are no longer examined nor treated. </summary> + public static ResearchStudyStatusCodeType AdministrativelyCompleted { get; } = new ResearchStudyStatusCodeType(AdministrativelyCompletedValue); + /// <summary> Protocol is approved by the review board. </summary> + public static ResearchStudyStatusCodeType Approved { get; } = new ResearchStudyStatusCodeType(ApprovedValue); + /// <summary> Study is closed for accrual; patients can be examined and treated. </summary> + public static ResearchStudyStatusCodeType ClosedToAccrual { get; } = new ResearchStudyStatusCodeType(ClosedToAccrualValue); + /// <summary> The study is closed to accrual and intervention, i.e. the study is closed to enrollment, all study subjects have completed treatment or intervention but are still being followed according to the primary objective of the study. </summary> + public static ResearchStudyStatusCodeType ClosedToAccrualAndIntervention { get; } = new ResearchStudyStatusCodeType(ClosedToAccrualAndInterventionValue); + /// <summary> Study is closed to accrual and intervention, i.e. the study is closed to enrollment, all study subjects have completed treatment or intervention but are still being followed according to the primary objective of the study. </summary> + public static ResearchStudyStatusCodeType Completed { get; } = new ResearchStudyStatusCodeType(CompletedValue); + /// <summary> Protocol was disapproved by the review board. </summary> + public static ResearchStudyStatusCodeType Disapproved { get; } = new ResearchStudyStatusCodeType(DisapprovedValue); + /// <summary> Protocol is submitted to the review board for approval. </summary> + public static ResearchStudyStatusCodeType InReview { get; } = new ResearchStudyStatusCodeType(InReviewValue); + /// <summary> The study is temporarily closed to accrual; a pause in accrual while study is reviewed, but is expected to resume. </summary> + public static ResearchStudyStatusCodeType TemporarilyClosedToAccrual { get; } = new ResearchStudyStatusCodeType(TemporarilyClosedToAccrualValue); + /// <summary> Study is temporarily closed for accrual; can be potentially resumed in the future. </summary> + public static ResearchStudyStatusCodeType TemporarilyClosedToAccrualAndIntervention { get; } = new ResearchStudyStatusCodeType(TemporarilyClosedToAccrualAndInterventionValue); + /// <summary> Protocol was withdrawn by the lead organization. </summary> + public static ResearchStudyStatusCodeType Withdrawn { get; } = new ResearchStudyStatusCodeType(WithdrawnValue); + /// <summary> Determines if two <see cref="ResearchStudyStatusCodeType"/> values are the same. </summary> + public static bool operator ==(ResearchStudyStatusCodeType left, ResearchStudyStatusCodeType right) => left.Equals(right); + /// <summary> Determines if two <see cref="ResearchStudyStatusCodeType"/> values are not the same. </summary> + public static bool operator !=(ResearchStudyStatusCodeType left, ResearchStudyStatusCodeType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="ResearchStudyStatusCodeType"/>. </summary> + public static implicit operator ResearchStudyStatusCodeType(string value) => new ResearchStudyStatusCodeType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResearchStudyStatusCodeType other && Equals(other); + /// <inheritdoc /> + public bool Equals(ResearchStudyStatusCodeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/SpecialtyType.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/SpecialtyType.cs new file mode 100644 index 0000000000000..b0dd910e86260 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/SpecialtyType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> Known values codes that can be used to indicate the type of the Specialty. </summary> + public readonly partial struct SpecialtyType : IEquatable<SpecialtyType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="SpecialtyType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public SpecialtyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PathologyValue = "pathology"; + private const string RadiologyValue = "radiology"; + + /// <summary> pathology. </summary> + public static SpecialtyType Pathology { get; } = new SpecialtyType(PathologyValue); + /// <summary> radiology. </summary> + public static SpecialtyType Radiology { get; } = new SpecialtyType(RadiologyValue); + /// <summary> Determines if two <see cref="SpecialtyType"/> values are the same. </summary> + public static bool operator ==(SpecialtyType left, SpecialtyType right) => left.Equals(right); + /// <summary> Determines if two <see cref="SpecialtyType"/> values are not the same. </summary> + public static bool operator !=(SpecialtyType left, SpecialtyType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="SpecialtyType"/>. </summary> + public static implicit operator SpecialtyType(string value) => new SpecialtyType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SpecialtyType other && Equals(other); + /// <inheritdoc /> + public bool Equals(SpecialtyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TimePeriod.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TimePeriod.Serialization.cs new file mode 100644 index 0000000000000..890febadbe2e6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TimePeriod.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + public partial class TimePeriod : IUtf8JsonSerializable, IJsonModel<TimePeriod> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<TimePeriod>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<TimePeriod>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start.Value, "O"); + } + if (Optional.IsDefined(End)) + { + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TimePeriod IJsonModel<TimePeriod>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTimePeriod(document.RootElement, options); + } + + internal static TimePeriod DeserializeTimePeriod(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<DateTimeOffset> start = default; + Optional<DateTimeOffset> end = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + start = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("end"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + end = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new TimePeriod(Optional.ToNullable(start), Optional.ToNullable(end), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<TimePeriod>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{options.Format}' format."); + } + } + + TimePeriod IPersistableModel<TimePeriod>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTimePeriod(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<TimePeriod>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static TimePeriod FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTimePeriod(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + 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/TimePeriod.cs similarity index 58% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TimePeriod.cs index 00a5002095134..e8afe38cbb863 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalTrialDemographics.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TimePeriod.cs @@ -10,8 +10,8 @@ namespace Azure.Health.Insights.ClinicalMatching { - /// <summary> Demographic criteria for a clinical trial. </summary> - public partial class ClinicalTrialDemographics + /// <summary> A duration of time during which an event is happening. </summary> + public partial class TimePeriod { /// <summary> /// Keeps track of any properties unknown to the library. @@ -45,25 +45,25 @@ public partial class ClinicalTrialDemographics /// </summary> private IDictionary<string, BinaryData> _serializedAdditionalRawData; - /// <summary> Initializes a new instance of <see cref="ClinicalTrialDemographics"/>. </summary> - public ClinicalTrialDemographics() + /// <summary> Initializes a new instance of <see cref="TimePeriod"/>. </summary> + public TimePeriod() { } - /// <summary> Initializes a new instance of <see cref="ClinicalTrialDemographics"/>. </summary> - /// <param name="acceptedSex"> Indication of the sex of people who may participate in the clinical trial. </param> - /// <param name="acceptedAgeRange"> A definition of the range of ages accepted by a clinical trial. Contains a minimum age and/or a maximum age. </param> + /// <summary> Initializes a new instance of <see cref="TimePeriod"/>. </summary> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal ClinicalTrialDemographics(ClinicalTrialAcceptedSex? acceptedSex, AcceptedAgeRange acceptedAgeRange, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal TimePeriod(DateTimeOffset? start, DateTimeOffset? end, IDictionary<string, BinaryData> serializedAdditionalRawData) { - AcceptedSex = acceptedSex; - AcceptedAgeRange = acceptedAgeRange; + Start = start; + End = end; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// <summary> Indication of the sex of people who may participate in the clinical trial. </summary> - public ClinicalTrialAcceptedSex? AcceptedSex { get; set; } - /// <summary> A definition of the range of ages accepted by a clinical trial. Contains a minimum age and/or a maximum age. </summary> - public AcceptedAgeRange AcceptedAgeRange { get; set; } + /// <summary> Starting time with inclusive boundary. </summary> + public DateTimeOffset? Start { get; set; } + /// <summary> End time with inclusive boundary, if not ongoing. </summary> + public DateTimeOffset? End { 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 index 045b005d7df07..484aa8f0261a1 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 @@ -51,10 +51,10 @@ void IJsonModel<TrialMatcherInference>.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteEndArray(); } - if (Optional.IsDefined(Id)) + if (Optional.IsDefined(ClinicalTrialId)) { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); + writer.WritePropertyName("clinicalTrialId"u8); + writer.WriteStringValue(ClinicalTrialId); } if (Optional.IsDefined(Source)) { @@ -109,7 +109,7 @@ internal static TrialMatcherInference DeserializeTrialMatcherInference(JsonEleme Optional<string> description = default; Optional<float> confidenceScore = default; Optional<IReadOnlyList<TrialMatcherInferenceEvidence>> evidence = default; - Optional<string> id = default; + Optional<string> clinicalTrialId = default; Optional<ClinicalTrialSource> source = default; Optional<ClinicalTrialMetadata> metadata = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; @@ -154,9 +154,9 @@ internal static TrialMatcherInference DeserializeTrialMatcherInference(JsonEleme evidence = array; continue; } - if (property.NameEquals("id"u8)) + if (property.NameEquals("clinicalTrialId"u8)) { - id = property.Value.GetString(); + clinicalTrialId = property.Value.GetString(); continue; } if (property.NameEquals("source"u8)) @@ -183,7 +183,7 @@ internal static TrialMatcherInference DeserializeTrialMatcherInference(JsonEleme } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new TrialMatcherInference(type, value, description.Value, Optional.ToNullable(confidenceScore), Optional.ToList(evidence), id.Value, Optional.ToNullable(source), metadata.Value, serializedAdditionalRawData); + return new TrialMatcherInference(type, value, description.Value, Optional.ToNullable(confidenceScore), Optional.ToList(evidence), clinicalTrialId.Value, Optional.ToNullable(source), metadata.Value, serializedAdditionalRawData); } BinaryData IPersistableModel<TrialMatcherInference>.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.cs index 66b1f582c692a..16c84a9b527fc 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInference.cs @@ -65,18 +65,18 @@ internal TrialMatcherInference(TrialMatcherInferenceType type, string value) /// <param name="description"> The description corresponding to the inference value. </param> /// <param name="confidenceScore"> Confidence score for this inference. </param> /// <param name="evidence"> The evidence corresponding to the inference value. </param> - /// <param name="id"> The identifier of the clinical trial. </param> + /// <param name="clinicalTrialId"> The identifier of the clinical trial. </param> /// <param name="source"> Possible sources of a clinical trial. </param> /// <param name="metadata"> Trial data which is of interest to the potential participant. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal TrialMatcherInference(TrialMatcherInferenceType type, string value, string description, float? confidenceScore, IReadOnlyList<TrialMatcherInferenceEvidence> evidence, string id, ClinicalTrialSource? source, ClinicalTrialMetadata metadata, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal TrialMatcherInference(TrialMatcherInferenceType type, string value, string description, float? confidenceScore, IReadOnlyList<TrialMatcherInferenceEvidence> evidence, string clinicalTrialId, ClinicalTrialSource? source, ClinicalTrialMetadata metadata, IDictionary<string, BinaryData> serializedAdditionalRawData) { Type = type; Value = value; Description = description; ConfidenceScore = confidenceScore; Evidence = evidence; - Id = id; + ClinicalTrialId = clinicalTrialId; Source = source; Metadata = metadata; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -98,7 +98,7 @@ internal TrialMatcherInference() /// <summary> The evidence corresponding to the inference value. </summary> public IReadOnlyList<TrialMatcherInferenceEvidence> Evidence { get; } /// <summary> The identifier of the clinical trial. </summary> - public string Id { get; } + public string ClinicalTrialId { get; } /// <summary> Possible sources of a clinical trial. </summary> public ClinicalTrialSource? Source { get; } /// <summary> Trial data which is of interest to the potential participant. </summary> diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceResult.Serialization.cs similarity index 67% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceResult.Serialization.cs index 11cc218d1f33d..bc90aa8805166 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceResult.Serialization.cs @@ -14,22 +14,22 @@ namespace Azure.Health.Insights.ClinicalMatching { - public partial class TrialMatcherResults : IUtf8JsonSerializable, IJsonModel<TrialMatcherResults> + public partial class TrialMatcherInferenceResult : IUtf8JsonSerializable, IJsonModel<TrialMatcherInferenceResult> { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<TrialMatcherResults>)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<TrialMatcherInferenceResult>)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel<TrialMatcherResults>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel<TrialMatcherInferenceResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<TrialMatcherResults>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<TrialMatcherInferenceResult>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrialMatcherResults)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(TrialMatcherInferenceResult)} does not support '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("patients"u8); + writer.WritePropertyName("patientResults"u8); writer.WriteStartArray(); - foreach (var item in Patients) + foreach (var item in PatientResults) { writer.WriteObjectValue(item); } @@ -59,19 +59,19 @@ void IJsonModel<TrialMatcherResults>.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - TrialMatcherResults IJsonModel<TrialMatcherResults>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TrialMatcherInferenceResult IJsonModel<TrialMatcherInferenceResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<TrialMatcherResults>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<TrialMatcherInferenceResult>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrialMatcherResults)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(TrialMatcherInferenceResult)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrialMatcherResults(document.RootElement, options); + return DeserializeTrialMatcherInferenceResult(document.RootElement, options); } - internal static TrialMatcherResults DeserializeTrialMatcherResults(JsonElement element, ModelReaderWriterOptions options = null) + internal static TrialMatcherInferenceResult DeserializeTrialMatcherInferenceResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -79,21 +79,21 @@ internal static TrialMatcherResults DeserializeTrialMatcherResults(JsonElement e { return null; } - IReadOnlyList<TrialMatcherPatientResult> patients = default; + IReadOnlyList<TrialMatcherPatientResult> patientResults = default; string modelVersion = default; Optional<DateTimeOffset> knowledgeGraphLastUpdateDate = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("patients"u8)) + if (property.NameEquals("patientResults"u8)) { List<TrialMatcherPatientResult> array = new List<TrialMatcherPatientResult>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(TrialMatcherPatientResult.DeserializeTrialMatcherPatientResult(item)); } - patients = array; + patientResults = array; continue; } if (property.NameEquals("modelVersion"u8)) @@ -116,46 +116,46 @@ internal static TrialMatcherResults DeserializeTrialMatcherResults(JsonElement e } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new TrialMatcherResults(patients, modelVersion, Optional.ToNullable(knowledgeGraphLastUpdateDate), serializedAdditionalRawData); + return new TrialMatcherInferenceResult(patientResults, modelVersion, Optional.ToNullable(knowledgeGraphLastUpdateDate), serializedAdditionalRawData); } - BinaryData IPersistableModel<TrialMatcherResults>.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel<TrialMatcherInferenceResult>.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<TrialMatcherResults>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<TrialMatcherInferenceResult>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TrialMatcherResults)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(TrialMatcherInferenceResult)} does not support '{options.Format}' format."); } } - TrialMatcherResults IPersistableModel<TrialMatcherResults>.Create(BinaryData data, ModelReaderWriterOptions options) + TrialMatcherInferenceResult IPersistableModel<TrialMatcherInferenceResult>.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<TrialMatcherResults>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<TrialMatcherInferenceResult>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrialMatcherResults(document.RootElement, options); + return DeserializeTrialMatcherInferenceResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TrialMatcherResults)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(TrialMatcherInferenceResult)} does not support '{options.Format}' format."); } } - string IPersistableModel<TrialMatcherResults>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel<TrialMatcherInferenceResult>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// <summary> Deserializes the model from a raw response. </summary> /// <param name="response"> The response to deserialize the model from. </param> - internal static TrialMatcherResults FromResponse(Response response) + internal static TrialMatcherInferenceResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTrialMatcherResults(document.RootElement); + return DeserializeTrialMatcherInferenceResult(document.RootElement); } /// <summary> Convert into a Utf8JsonRequestContent. </summary> diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceResult.cs similarity index 74% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.cs rename to sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceResult.cs index bb44889cdbc90..e674e96769ec5 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherResults.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherInferenceResult.cs @@ -13,7 +13,7 @@ namespace Azure.Health.Insights.ClinicalMatching { /// <summary> The inference results for the Trial Matcher request. </summary> - public partial class TrialMatcherResults + public partial class TrialMatcherInferenceResult { /// <summary> /// Keeps track of any properties unknown to the library. @@ -47,39 +47,39 @@ public partial class TrialMatcherResults /// </summary> private IDictionary<string, BinaryData> _serializedAdditionalRawData; - /// <summary> Initializes a new instance of <see cref="TrialMatcherResults"/>. </summary> - /// <param name="patients"> Results for the patients given in the request. </param> + /// <summary> Initializes a new instance of <see cref="TrialMatcherInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> - /// <exception cref="ArgumentNullException"> <paramref name="patients"/> or <paramref name="modelVersion"/> is null. </exception> - internal TrialMatcherResults(IEnumerable<TrialMatcherPatientResult> patients, string modelVersion) + /// <exception cref="ArgumentNullException"> <paramref name="patientResults"/> or <paramref name="modelVersion"/> is null. </exception> + internal TrialMatcherInferenceResult(IEnumerable<TrialMatcherPatientResult> patientResults, string modelVersion) { - Argument.AssertNotNull(patients, nameof(patients)); + Argument.AssertNotNull(patientResults, nameof(patientResults)); Argument.AssertNotNull(modelVersion, nameof(modelVersion)); - Patients = patients.ToList(); + PatientResults = patientResults.ToList(); ModelVersion = modelVersion; } - /// <summary> Initializes a new instance of <see cref="TrialMatcherResults"/>. </summary> - /// <param name="patients"> Results for the patients given in the request. </param> + /// <summary> Initializes a new instance of <see cref="TrialMatcherInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> /// <param name="knowledgeGraphLastUpdateDate"> The date when the clinical trials knowledge graph was last updated. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal TrialMatcherResults(IReadOnlyList<TrialMatcherPatientResult> patients, string modelVersion, DateTimeOffset? knowledgeGraphLastUpdateDate, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal TrialMatcherInferenceResult(IReadOnlyList<TrialMatcherPatientResult> patientResults, string modelVersion, DateTimeOffset? knowledgeGraphLastUpdateDate, IDictionary<string, BinaryData> serializedAdditionalRawData) { - Patients = patients; + PatientResults = patientResults; ModelVersion = modelVersion; KnowledgeGraphLastUpdateDate = knowledgeGraphLastUpdateDate; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// <summary> Initializes a new instance of <see cref="TrialMatcherResults"/> for deserialization. </summary> - internal TrialMatcherResults() + /// <summary> Initializes a new instance of <see cref="TrialMatcherInferenceResult"/> for deserialization. </summary> + internal TrialMatcherInferenceResult() { } /// <summary> Results for the patients given in the request. </summary> - public IReadOnlyList<TrialMatcherPatientResult> Patients { get; } + public IReadOnlyList<TrialMatcherPatientResult> PatientResults { get; } /// <summary> The version of the model used for inference, expressed as the model date. </summary> public string ModelVersion { get; } /// <summary> The date when the clinical trials knowledge graph was last updated. </summary> 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 d5565e235db2e..955fae6b4abfe 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 @@ -27,8 +27,8 @@ void IJsonModel<TrialMatcherPatientResult>.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); + writer.WritePropertyName("patientId"u8); + writer.WriteStringValue(PatientId); writer.WritePropertyName("inferences"u8); writer.WriteStartArray(); foreach (var item in Inferences) @@ -84,16 +84,16 @@ internal static TrialMatcherPatientResult DeserializeTrialMatcherPatientResult(J { return null; } - string id = default; + string patientId = default; IReadOnlyList<TrialMatcherInference> inferences = default; Optional<IReadOnlyList<ExtendedClinicalCodedElement>> neededClinicalInfo = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (property.NameEquals("patientId"u8)) { - id = property.Value.GetString(); + patientId = property.Value.GetString(); continue; } if (property.NameEquals("inferences"u8)) @@ -126,7 +126,7 @@ internal static TrialMatcherPatientResult DeserializeTrialMatcherPatientResult(J } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new TrialMatcherPatientResult(id, inferences, Optional.ToList(neededClinicalInfo), serializedAdditionalRawData); + return new TrialMatcherPatientResult(patientId, inferences, Optional.ToList(neededClinicalInfo), serializedAdditionalRawData); } BinaryData IPersistableModel<TrialMatcherPatientResult>.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.cs index f24dd827790f5..28081dfcf94a1 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/TrialMatcherPatientResult.cs @@ -48,27 +48,27 @@ public partial class TrialMatcherPatientResult private IDictionary<string, BinaryData> _serializedAdditionalRawData; /// <summary> Initializes a new instance of <see cref="TrialMatcherPatientResult"/>. </summary> - /// <param name="id"> The identifier given for the patient in the request. </param> - /// <param name="inferences"> The model's inferences for the given patient. </param> - /// <exception cref="ArgumentNullException"> <paramref name="id"/> or <paramref name="inferences"/> is null. </exception> - internal TrialMatcherPatientResult(string id, IEnumerable<TrialMatcherInference> inferences) + /// <param name="patientId"> The identifier given for the patient in the request. </param> + /// <param name="inferences"> The inference results for the patient. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patientId"/> or <paramref name="inferences"/> is null. </exception> + internal TrialMatcherPatientResult(string patientId, IEnumerable<TrialMatcherInference> inferences) { - Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(patientId, nameof(patientId)); Argument.AssertNotNull(inferences, nameof(inferences)); - Id = id; + PatientId = patientId; Inferences = inferences.ToList(); NeededClinicalInfo = new ChangeTrackingList<ExtendedClinicalCodedElement>(); } /// <summary> Initializes a new instance of <see cref="TrialMatcherPatientResult"/>. </summary> - /// <param name="id"> The identifier given for the patient in the request. </param> - /// <param name="inferences"> The model's inferences for the given patient. </param> + /// <param name="patientId"> The identifier given for the patient in the request. </param> + /// <param name="inferences"> The inference results for the patient. </param> /// <param name="neededClinicalInfo"> Clinical information which is needed to provide better trial matching results for the patient. </param> /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> - internal TrialMatcherPatientResult(string id, IReadOnlyList<TrialMatcherInference> inferences, IReadOnlyList<ExtendedClinicalCodedElement> neededClinicalInfo, IDictionary<string, BinaryData> serializedAdditionalRawData) + internal TrialMatcherPatientResult(string patientId, IReadOnlyList<TrialMatcherInference> inferences, IReadOnlyList<ExtendedClinicalCodedElement> neededClinicalInfo, IDictionary<string, BinaryData> serializedAdditionalRawData) { - Id = id; + PatientId = patientId; Inferences = inferences; NeededClinicalInfo = neededClinicalInfo; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -80,8 +80,8 @@ internal TrialMatcherPatientResult() } /// <summary> The identifier given for the patient in the request. </summary> - public string Id { get; } - /// <summary> The model's inferences for the given patient. </summary> + public string PatientId { get; } + /// <summary> The inference results for the patient. </summary> public IReadOnlyList<TrialMatcherInference> Inferences { get; } /// <summary> Clinical information which is needed to provide better trial matching results for the patient. </summary> public IReadOnlyList<ExtendedClinicalCodedElement> NeededClinicalInfo { get; } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/UnknownFhirR4DomainResource.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/UnknownFhirR4DomainResource.Serialization.cs new file mode 100644 index 0000000000000..faabd38910727 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/UnknownFhirR4DomainResource.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.ClinicalMatching +{ + internal partial class UnknownFhirR4DomainResource : IUtf8JsonSerializable, IJsonModel<FhirR4DomainResource> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4DomainResource>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4DomainResource>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteObjectValue(Text); + } + if (Optional.IsCollectionDefined(Contained)) + { + writer.WritePropertyName("contained"u8); + writer.WriteStartArray(); + foreach (var item in Contained) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ModifierExtension)) + { + writer.WritePropertyName("modifierExtension"u8); + writer.WriteStartArray(); + foreach (var item in ModifierExtension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4DomainResource IJsonModel<FhirR4DomainResource>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnknownFhirR4DomainResource(document.RootElement, options); + } + + internal static UnknownFhirR4DomainResource DeserializeUnknownFhirR4DomainResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Narrative> text = default; + Optional<IList<FhirR4Resource>> contained = default; + Optional<IList<FhirR4Extension>> extension = default; + Optional<IList<FhirR4Extension>> modifierExtension = default; + string resourceType = "Unknown"; + Optional<string> id = default; + Optional<FhirR4Meta> meta = default; + Optional<string> implicitRules = default; + Optional<string> language = default; + IDictionary<string, BinaryData> additionalProperties = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + text = FhirR4Narrative.DeserializeFhirR4Narrative(property.Value); + continue; + } + if (property.NameEquals("contained"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Resource> array = new List<FhirR4Resource>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeFhirR4Resource(item)); + } + contained = array; + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (property.NameEquals("modifierExtension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + modifierExtension = array; + continue; + } + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("meta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + meta = FhirR4Meta.DeserializeFhirR4Meta(property.Value); + continue; + } + if (property.NameEquals("implicitRules"u8)) + { + implicitRules = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new UnknownFhirR4DomainResource(resourceType, id.Value, meta.Value, implicitRules.Value, language.Value, additionalProperties, text.Value, Optional.ToList(contained), Optional.ToList(extension), Optional.ToList(modifierExtension)); + } + + BinaryData IPersistableModel<FhirR4DomainResource>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{options.Format}' format."); + } + } + + FhirR4DomainResource IPersistableModel<FhirR4DomainResource>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUnknownFhirR4DomainResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4DomainResource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new UnknownFhirR4DomainResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownFhirR4DomainResource(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/UnknownFhirR4DomainResource.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/UnknownFhirR4DomainResource.cs new file mode 100644 index 0000000000000..0246175888394 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/UnknownFhirR4DomainResource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.ClinicalMatching +{ + /// <summary> Unknown version of Fhir_R4_DomainResource. </summary> + internal partial class UnknownFhirR4DomainResource : FhirR4DomainResource + { + /// <summary> Initializes a new instance of <see cref="UnknownFhirR4DomainResource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <param name="text"> Text summary of the resource, for human interpretation. </param> + /// <param name="contained"> Contained, inline Resources. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="modifierExtension"> Extensions that cannot be ignored. </param> + internal UnknownFhirR4DomainResource(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties, FhirR4Narrative text, IList<FhirR4Resource> contained, IList<FhirR4Extension> extension, IList<FhirR4Extension> modifierExtension) : base(resourceType, id, meta, implicitRules, language, additionalProperties, text, contained, extension, modifierExtension) + { + } + + /// <summary> Initializes a new instance of <see cref="UnknownFhirR4DomainResource"/> for deserialization. </summary> + internal UnknownFhirR4DomainResource() + { + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Generated/Samples/Samples_ClinicalMatchingClient.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Generated/Samples/Samples_ClinicalMatchingClient.cs index dd35383a47b16..58af4ec066b43 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Generated/Samples/Samples_ClinicalMatchingClient.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tests/Generated/Samples/Samples_ClinicalMatchingClient.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.Text.Json; using System.Threading.Tasks; using Azure; @@ -40,9 +41,9 @@ public void Example_ClinicalMatchingClient_MatchTrials_ShortVersion() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); } @@ -68,9 +69,9 @@ public async Task Example_ClinicalMatchingClient_MatchTrials_ShortVersion_Async( BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); } @@ -86,8 +87,8 @@ public void Example_ClinicalMatchingClient_MatchTrials_ShortVersion_Convenience( { new PatientRecord("<id>") }); - Operation<TrialMatcherResults> operation = client.MatchTrials(WaitUntil.Completed, trialMatcherData); - TrialMatcherResults responseData = operation.Value; + Operation<TrialMatcherInferenceResult> operation = client.MatchTrials(WaitUntil.Completed, trialMatcherData); + TrialMatcherInferenceResult responseData = operation.Value; } [Test] @@ -102,8 +103,8 @@ public async Task Example_ClinicalMatchingClient_MatchTrials_ShortVersion_Conven { new PatientRecord("<id>") }); - Operation<TrialMatcherResults> operation = await client.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); - TrialMatcherResults responseData = operation.Value; + Operation<TrialMatcherInferenceResult> operation = await client.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); + TrialMatcherInferenceResult responseData = operation.Value; } [Test] @@ -129,14 +130,157 @@ public void Example_ClinicalMatchingClient_MatchTrials_AllParameters() { new { +resourceType = "<resourceType>", +id = "<id>", +meta = new +{ +versionId = "<versionId>", +lastUpdated = "<lastUpdated>", +source = "<source>", +profile = new object[] +{ +"<profile>" +}, +security = new object[] +{ +new +{ system = "<system>", +version = "<version>", code = "<code>", -name = "<name>", +display = "<display>", +id = "<id>", +extension = new object[] +{ +new +{ +url = "<url>", +valueQuantity = new +{ +value = 123.45, +comparator = "<comparator>", +unit = "<unit>", +system = "<system>", +code = "<code>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueCodeableConcept = new +{ +coding = new object[] +{ +null +}, +text = "<text>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueString = "<valueString>", +valueBoolean = true, +valueInteger = 1234, +valueRange = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueRatio = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueSampledData = new +{ +period = 123.45, +factor = 123.45, +lowerLimit = 123.45, +upperLimit = 123.45, +dimensions = 1234, +data = "<data>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueTime = "01:23:45", +valueDateTime = "<valueDateTime>", +valuePeriod = new +{ +start = "<start>", +end = "<end>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueReference = new +{ +reference = "<reference>", +type = "<type>", +identifier = new +{ +use = "<use>", +system = "<system>", value = "<value>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +display = "<display>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +id = "<id>", +extension = new object[] +{ +null +}, } }, +} }, -data = new object[] +tag = new object[] +{ +null +}, +}, +implicitRules = "<implicitRules>", +language = "<language>", +} +}, +}, +encounters = new object[] +{ +new Dictionary<string, object> +{ +["id"] = "<id>", +["period"] = new +{ +start = "2022-05-10T14:57:31.2311892-04:00", +end = "2022-05-10T14:57:31.2311892-04:00", +}, +["class"] = "inpatient" +} +}, +patientDocuments = new object[] { new { @@ -145,6 +289,30 @@ public void Example_ClinicalMatchingClient_MatchTrials_AllParameters() id = "<id>", language = "<language>", createdDateTime = "2022-05-10T14:57:31.2311892-04:00", +authors = new object[] +{ +new +{ +id = "<id>", +fullName = "<fullName>", +} +}, +specialtyType = "pathology", +administrativeMetadata = new +{ +orderedProcedures = new object[] +{ +new +{ +extension = new object[] +{ +null +}, +description = "<description>", +} +}, +encounterId = "<encounterId>", +}, content = new { sourceType = "inline", @@ -164,56 +332,126 @@ public void Example_ClinicalMatchingClient_MatchTrials_AllParameters() { new { -id = "<id>", -eligibilityCriteriaText = "<eligibilityCriteriaText>", -demographics = new +identifier = new object[] { -acceptedSex = "all", -acceptedAgeRange = new +null +}, +title = "<title>", +protocol = new object[] { -minimumAge = new +null +}, +partOf = new object[] { -unit = "years", -value = 123.45F, +null }, +status = "active", +category = new object[] +{ +null }, +focus = new object[] +{ +null }, -metadata = new +condition = new object[] { -phases = new object[] +null +}, +contact = new object[] { -"notApplicable" +new +{ +name = "<name>", +telecom = new object[] +{ +new +{ +system = "phone", +value = "<value>", +use = "home", +rank = 1234, +} }, -studyType = "interventional", -recruitmentStatus = "unknownStatus", -conditions = new object[] +id = "<id>", +extension = new object[] { -"<conditions>" +null }, -sponsors = new object[] +} +}, +keyword = new object[] { -"<sponsors>" +null }, -contacts = new object[] +location = new object[] +{ +null +}, +description = "<description>", +enrollment = new object[] +{ +null +}, +site = new object[] +{ +null +}, +note = new object[] +{ +new +{ +authorString = "<authorString>", +time = "<time>", +text = "<text>", +id = "<id>", +extension = new object[] +{ +null +}, +} +}, +arm = new object[] { new { name = "<name>", -email = "<email>", -phone = "<phone>", +description = "<description>", } }, -facilities = new object[] +objective = new object[] { new { name = "<name>", -city = "<city>", -state = "<state>", -countryOrRegion = "<countryOrRegion>", } }, +resourceType = "ResearchStudy", +text = new +{ +status = "<status>", +div = "<div>", +id = "<id>", +extension = new object[] +{ +null +}, }, +contained = new object[] +{ +null +}, +extension = new object[] +{ +null +}, +modifierExtension = new object[] +{ +null +}, +id = "<id>", +implicitRules = "<implicitRules>", +language = "<language>", } }, registryFilters = new object[] @@ -294,41 +532,41 @@ public void Example_ClinicalMatchingClient_MatchTrials_AllParameters() BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("clinicalTrialId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); Console.WriteLine(result.GetProperty("knowledgeGraphLastUpdateDate").ToString()); } @@ -356,14 +594,157 @@ public async Task Example_ClinicalMatchingClient_MatchTrials_AllParameters_Async { new { +resourceType = "<resourceType>", +id = "<id>", +meta = new +{ +versionId = "<versionId>", +lastUpdated = "<lastUpdated>", +source = "<source>", +profile = new object[] +{ +"<profile>" +}, +security = new object[] +{ +new +{ system = "<system>", +version = "<version>", code = "<code>", -name = "<name>", +display = "<display>", +id = "<id>", +extension = new object[] +{ +new +{ +url = "<url>", +valueQuantity = new +{ +value = 123.45, +comparator = "<comparator>", +unit = "<unit>", +system = "<system>", +code = "<code>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueCodeableConcept = new +{ +coding = new object[] +{ +null +}, +text = "<text>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueString = "<valueString>", +valueBoolean = true, +valueInteger = 1234, +valueRange = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueRatio = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueSampledData = new +{ +period = 123.45, +factor = 123.45, +lowerLimit = 123.45, +upperLimit = 123.45, +dimensions = 1234, +data = "<data>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueTime = "01:23:45", +valueDateTime = "<valueDateTime>", +valuePeriod = new +{ +start = "<start>", +end = "<end>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueReference = new +{ +reference = "<reference>", +type = "<type>", +identifier = new +{ +use = "<use>", +system = "<system>", value = "<value>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +display = "<display>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +id = "<id>", +extension = new object[] +{ +null +}, } }, +} }, -data = new object[] +tag = new object[] +{ +null +}, +}, +implicitRules = "<implicitRules>", +language = "<language>", +} +}, +}, +encounters = new object[] +{ +new Dictionary<string, object> +{ +["id"] = "<id>", +["period"] = new +{ +start = "2022-05-10T14:57:31.2311892-04:00", +end = "2022-05-10T14:57:31.2311892-04:00", +}, +["class"] = "inpatient" +} +}, +patientDocuments = new object[] { new { @@ -372,6 +753,30 @@ public async Task Example_ClinicalMatchingClient_MatchTrials_AllParameters_Async id = "<id>", language = "<language>", createdDateTime = "2022-05-10T14:57:31.2311892-04:00", +authors = new object[] +{ +new +{ +id = "<id>", +fullName = "<fullName>", +} +}, +specialtyType = "pathology", +administrativeMetadata = new +{ +orderedProcedures = new object[] +{ +new +{ +extension = new object[] +{ +null +}, +description = "<description>", +} +}, +encounterId = "<encounterId>", +}, content = new { sourceType = "inline", @@ -391,56 +796,126 @@ public async Task Example_ClinicalMatchingClient_MatchTrials_AllParameters_Async { new { -id = "<id>", -eligibilityCriteriaText = "<eligibilityCriteriaText>", -demographics = new +identifier = new object[] { -acceptedSex = "all", -acceptedAgeRange = new +null +}, +title = "<title>", +protocol = new object[] { -minimumAge = new +null +}, +partOf = new object[] { -unit = "years", -value = 123.45F, +null }, +status = "active", +category = new object[] +{ +null }, +focus = new object[] +{ +null }, -metadata = new +condition = new object[] { -phases = new object[] +null +}, +contact = new object[] { -"notApplicable" +new +{ +name = "<name>", +telecom = new object[] +{ +new +{ +system = "phone", +value = "<value>", +use = "home", +rank = 1234, +} }, -studyType = "interventional", -recruitmentStatus = "unknownStatus", -conditions = new object[] +id = "<id>", +extension = new object[] { -"<conditions>" +null }, -sponsors = new object[] +} +}, +keyword = new object[] { -"<sponsors>" +null +}, +location = new object[] +{ +null +}, +description = "<description>", +enrollment = new object[] +{ +null +}, +site = new object[] +{ +null +}, +note = new object[] +{ +new +{ +authorString = "<authorString>", +time = "<time>", +text = "<text>", +id = "<id>", +extension = new object[] +{ +null }, -contacts = new object[] +} +}, +arm = new object[] { new { name = "<name>", -email = "<email>", -phone = "<phone>", +description = "<description>", } }, -facilities = new object[] +objective = new object[] { new { name = "<name>", -city = "<city>", -state = "<state>", -countryOrRegion = "<countryOrRegion>", } }, +resourceType = "ResearchStudy", +text = new +{ +status = "<status>", +div = "<div>", +id = "<id>", +extension = new object[] +{ +null +}, }, +contained = new object[] +{ +null +}, +extension = new object[] +{ +null +}, +modifierExtension = new object[] +{ +null +}, +id = "<id>", +implicitRules = "<implicitRules>", +language = "<language>", } }, registryFilters = new object[] @@ -521,41 +996,41 @@ public async Task Example_ClinicalMatchingClient_MatchTrials_AllParameters_Async BinaryData responseData = operation.Value; JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); - Console.WriteLine(result.GetProperty("patients")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("confidenceScore").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("eligibilityCriteriaEvidence").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientDataEvidence").GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("patientInfoEvidence").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("evidence")[0].GetProperty("importance").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("clinicalTrialId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("source").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("phases")[0].ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("studyType").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("recruitmentStatus").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("conditions")[0].ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("sponsors")[0].ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("contacts")[0].GetProperty("phone").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("city").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("metadata").GetProperty("facilities")[0].GetProperty("countryOrRegion").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("semanticType").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("neededClinicalInfo")[0].GetProperty("category").ToString()); Console.WriteLine(result.GetProperty("modelVersion").ToString()); Console.WriteLine(result.GetProperty("knowledgeGraphLastUpdateDate").ToString()); } @@ -572,56 +1047,122 @@ public void Example_ClinicalMatchingClient_MatchTrials_AllParameters_Convenience { new PatientRecord("<id>") { -Info = new PatientInfo +Info = new PatientDetails { -Sex = PatientInfoSex.Female, +Sex = PatientSex.Female, BirthDate = DateTimeOffset.Parse("2022-05-10"), -ClinicalInfo = {new ClinicalCodedElement("<system>", "<code>") +ClinicalInfo = {new FhirR4Resource("<resourceType>") { -Name = "<name>", -Value = "<value>", +Id = "<id>", +Meta = new FhirR4Meta +{ +VersionId = "<versionId>", +LastUpdated = "<lastUpdated>", +Source = "<source>", +Profile = {"<profile>"}, +Security = {new FhirR4Coding +{ +System = "<system>", +Version = "<version>", +Code = "<code>", +Display = "<display>", }}, +Tag = {default}, }, -Data = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) +ImplicitRules = "<implicitRules>", +Language = "<language>", +}}, +}, +Encounters = {new Encounter("<id>") +{ +Period = new TimePeriod +{ +Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +}, +Class = EncounterClass.InPatient, +}}, +PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) { ClinicalType = ClinicalDocumentType.Consultation, Language = "<language>", CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +Authors = {new DocumentAuthor +{ +Id = "<id>", +FullName = "<fullName>", +}}, +SpecialtyType = SpecialtyType.Pathology, +AdministrativeMetadata = new DocumentAdministrativeMetadata +{ +OrderedProcedures = {new FhirR4Extendible +{ +Extension = {default}, +Code = default, +Description = "<description>", +}}, +EncounterId = "<encounterId>", +}, }}, } }) { Configuration = new TrialMatcherModelConfiguration(new ClinicalTrials { - CustomTrials = {new ClinicalTrialDetails("<id>", new ClinicalTrialMetadata(new string[]{"<conditions>"}) -{ -Phases = {ClinicalTrialPhase.NotApplicable}, -StudyType = ClinicalTrialStudyType.Interventional, -RecruitmentStatus = ClinicalTrialRecruitmentStatus.UnknownStatus, -Sponsors = {"<sponsors>"}, -Contacts = {new ContactDetails + CustomTrials = {new FhirR4ResearchStudy(ResearchStudyStatusCodeType.Active) +{ +Identifier = {default}, +Title = "<title>", +Protocol = {default}, +PartOf = {default}, +PrimaryPurposeType = default, +Phase = default, +Category = {default}, +Focus = {default}, +Condition = {default}, +Contact = {new FhirR4ContactDetail { Name = "<name>", -Email = "<email>", -Phone = "<phone>", -}}, -Facilities = {new ClinicalTrialResearchFacility("<name>", "<countryOrRegion>") +Telecom = {new FhirR4ContactPoint { -City = "<city>", -State = "<state>", +System = ContactPointSystem.Phone, +Value = "<value>", +Use = ContactPointUse.Home, +Rank = 1234, +Period = default, }}, -}) -{ -EligibilityCriteriaText = "<eligibilityCriteriaText>", -Demographics = new ClinicalTrialDemographics +}}, +Keyword = {default}, +Location = {default}, +Description = "<description>", +Enrollment = {default}, +Period = default, +Sponsor = default, +PrincipalInvestigator = default, +Site = {default}, +ReasonStopped = default, +Note = {new FhirR4Annotation("<text>") +{ +AuthorString = "<authorString>", +Time = "<time>", +}}, +Arm = {new ResearchStudyArm("<name>") { -AcceptedSex = ClinicalTrialAcceptedSex.All, -AcceptedAgeRange = new AcceptedAgeRange +Type = default, +Description = "<description>", +}}, +Objective = {new ResearchStudyObjective("<name>") { -MinimumAge = new AcceptedAge(AgeUnit.Years, 123.45F), -MaximumAge = default, -}, -}, +Type = default, +}}, +Text = new FhirR4Narrative("<status>", "<div>"), +Contained = {default}, +Extension = {default}, +ModifierExtension = {default}, +Id = "<id>", +Meta = default, +ImplicitRules = "<implicitRules>", +Language = "<language>", }}, RegistryFilters = {new ClinicalTrialRegistryFilter { @@ -647,8 +1188,8 @@ public void Example_ClinicalMatchingClient_MatchTrials_AllParameters_Convenience IncludeEvidence = true, }, }; - Operation<TrialMatcherResults> operation = client.MatchTrials(WaitUntil.Completed, trialMatcherData); - TrialMatcherResults responseData = operation.Value; + Operation<TrialMatcherInferenceResult> operation = client.MatchTrials(WaitUntil.Completed, trialMatcherData); + TrialMatcherInferenceResult responseData = operation.Value; } [Test] @@ -663,56 +1204,122 @@ public async Task Example_ClinicalMatchingClient_MatchTrials_AllParameters_Conve { new PatientRecord("<id>") { -Info = new PatientInfo +Info = new PatientDetails { -Sex = PatientInfoSex.Female, +Sex = PatientSex.Female, BirthDate = DateTimeOffset.Parse("2022-05-10"), -ClinicalInfo = {new ClinicalCodedElement("<system>", "<code>") +ClinicalInfo = {new FhirR4Resource("<resourceType>") { -Name = "<name>", -Value = "<value>", +Id = "<id>", +Meta = new FhirR4Meta +{ +VersionId = "<versionId>", +LastUpdated = "<lastUpdated>", +Source = "<source>", +Profile = {"<profile>"}, +Security = {new FhirR4Coding +{ +System = "<system>", +Version = "<version>", +Code = "<code>", +Display = "<display>", }}, +Tag = {default}, }, -Data = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) +ImplicitRules = "<implicitRules>", +Language = "<language>", +}}, +}, +Encounters = {new Encounter("<id>") +{ +Period = new TimePeriod +{ +Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +}, +Class = EncounterClass.InPatient, +}}, +PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) { ClinicalType = ClinicalDocumentType.Consultation, Language = "<language>", CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +Authors = {new DocumentAuthor +{ +Id = "<id>", +FullName = "<fullName>", +}}, +SpecialtyType = SpecialtyType.Pathology, +AdministrativeMetadata = new DocumentAdministrativeMetadata +{ +OrderedProcedures = {new FhirR4Extendible +{ +Extension = {default}, +Code = default, +Description = "<description>", +}}, +EncounterId = "<encounterId>", +}, }}, } }) { Configuration = new TrialMatcherModelConfiguration(new ClinicalTrials { - CustomTrials = {new ClinicalTrialDetails("<id>", new ClinicalTrialMetadata(new string[]{"<conditions>"}) -{ -Phases = {ClinicalTrialPhase.NotApplicable}, -StudyType = ClinicalTrialStudyType.Interventional, -RecruitmentStatus = ClinicalTrialRecruitmentStatus.UnknownStatus, -Sponsors = {"<sponsors>"}, -Contacts = {new ContactDetails + CustomTrials = {new FhirR4ResearchStudy(ResearchStudyStatusCodeType.Active) +{ +Identifier = {default}, +Title = "<title>", +Protocol = {default}, +PartOf = {default}, +PrimaryPurposeType = default, +Phase = default, +Category = {default}, +Focus = {default}, +Condition = {default}, +Contact = {new FhirR4ContactDetail { Name = "<name>", -Email = "<email>", -Phone = "<phone>", -}}, -Facilities = {new ClinicalTrialResearchFacility("<name>", "<countryOrRegion>") +Telecom = {new FhirR4ContactPoint { -City = "<city>", -State = "<state>", +System = ContactPointSystem.Phone, +Value = "<value>", +Use = ContactPointUse.Home, +Rank = 1234, +Period = default, }}, -}) -{ -EligibilityCriteriaText = "<eligibilityCriteriaText>", -Demographics = new ClinicalTrialDemographics +}}, +Keyword = {default}, +Location = {default}, +Description = "<description>", +Enrollment = {default}, +Period = default, +Sponsor = default, +PrincipalInvestigator = default, +Site = {default}, +ReasonStopped = default, +Note = {new FhirR4Annotation("<text>") +{ +AuthorString = "<authorString>", +Time = "<time>", +}}, +Arm = {new ResearchStudyArm("<name>") { -AcceptedSex = ClinicalTrialAcceptedSex.All, -AcceptedAgeRange = new AcceptedAgeRange +Type = default, +Description = "<description>", +}}, +Objective = {new ResearchStudyObjective("<name>") { -MinimumAge = new AcceptedAge(AgeUnit.Years, 123.45F), -MaximumAge = default, -}, -}, +Type = default, +}}, +Text = new FhirR4Narrative("<status>", "<div>"), +Contained = {default}, +Extension = {default}, +ModifierExtension = {default}, +Id = "<id>", +Meta = default, +ImplicitRules = "<implicitRules>", +Language = "<language>", }}, RegistryFilters = {new ClinicalTrialRegistryFilter { @@ -738,8 +1345,8 @@ public async Task Example_ClinicalMatchingClient_MatchTrials_AllParameters_Conve IncludeEvidence = true, }, }; - Operation<TrialMatcherResults> operation = await client.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); - TrialMatcherResults responseData = operation.Value; + Operation<TrialMatcherInferenceResult> operation = await client.MatchTrialsAsync(WaitUntil.Completed, trialMatcherData); + TrialMatcherInferenceResult responseData = operation.Value; } } } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml index 5090e5d21c9f1..b8148bc2e184e 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/tsp-location.yaml @@ -1,6 +1,7 @@ -directory: specification/ai/HealthInsights/HealthInsights.TrialMatcher/ +directory: specification/ai/HealthInsights/HealthInsights.TrialMatcher additionalDirectories: - - specification/ai/HealthInsights/HealthInsights.OpenAPI/ - - specification/ai/HealthInsights/HealthInsights.Common/ -commit: 5e0c86b469be528174996420da94388ac12ce127 -repo: azure/azure-rest-api-specs +- specification/ai/HealthInsights/HealthInsights.Common/ +- specification/ai/HealthInsights/HealthInsights.OpenAPI/ +repo: Azure/azure-rest-api-specs +commit: 0b86423a8256b66c84c4e0e0d7d52e75105bb4bb + diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/Azure.Health.Insights.PatientTimeline.sln b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/Azure.Health.Insights.PatientTimeline.sln new file mode 100644 index 0000000000000..4ece5bfe7b4c7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/Azure.Health.Insights.PatientTimeline.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Health.Insights.PatientTimeline", "src\Azure.Health.Insights.PatientTimeline.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Health.Insights.PatientTimeline.Tests", "tests\Azure.Health.Insights.PatientTimeline.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.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.PatientTimeline/CHANGELOG.md b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/CHANGELOG.md new file mode 100644 index 0000000000000..13dd08af78abe --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/Directory.Build.props b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/Directory.Build.props new file mode 100644 index 0000000000000..63bd836ad44b7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/Directory.Build.props @@ -0,0 +1,6 @@ +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- + Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props + --> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" /> +</Project> diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/README.md b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/README.md new file mode 100644 index 0000000000000..e58950b9d1568 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/README.md @@ -0,0 +1,86 @@ +# Azure.Health.Insights.PatientTimeline client library for .NET + +Azure.Health.Insights.PatientTimeline is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Health.Insights.PatientTimeline --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts +<!-- CLIENT COMMON BAR --> +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) +<!-- CLIENT COMMON BAR --> + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + +<!-- LINKS --> +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/README.png) diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Azure.Health.Insights.PatientTimeline.csproj b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Azure.Health.Insights.PatientTimeline.csproj new file mode 100644 index 0000000000000..fc21de0a31fad --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Azure.Health.Insights.PatientTimeline.csproj @@ -0,0 +1,21 @@ +<Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <Description>This is the Azure.Health.Insights.PatientTimeline client library for developing .NET applications with rich experience.</Description> + <AssemblyTitle>Azure SDK Code Generation Azure.Health.Insights.PatientTimeline for Azure Data Plane</AssemblyTitle> + <Version>1.0.0-beta.1</Version> + <PackageTags>Azure.Health.Insights.PatientTimeline</PackageTags> + <TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks> + <IncludeOperationsSharedSource>true</IncludeOperationsSharedSource> + </PropertyGroup> + + <ItemGroup> + <Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared/Core" /> + <Compile Include="$(AzureCoreSharedSources)AzureKeyCredentialPolicy.cs" LinkBase="Shared/Core" /> + </ItemGroup> + + <ItemGroup> + <PackageReference Include="Azure.Core" /> + <PackageReference Include="System.Text.Json" /> + <PackageReference Include="System.ClientModel" /> + </ItemGroup> +</Project> diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/ClinicalDocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/ClinicalDocumentType.cs new file mode 100644 index 0000000000000..da7de4d27c387 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/ClinicalDocumentType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> The type of the clinical document. </summary> + public readonly partial struct ClinicalDocumentType : IEquatable<ClinicalDocumentType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="ClinicalDocumentType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + 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 RadiologyReportValue = "radiologyReport"; + private const string ProcedureValue = "procedure"; + private const string ProgressValue = "progress"; + private const string LaboratoryValue = "laboratory"; + private const string PathologyReportValue = "pathologyReport"; + + /// <summary> consultation. </summary> + public static ClinicalDocumentType Consultation { get; } = new ClinicalDocumentType(ConsultationValue); + /// <summary> dischargeSummary. </summary> + public static ClinicalDocumentType DischargeSummary { get; } = new ClinicalDocumentType(DischargeSummaryValue); + /// <summary> historyAndPhysical. </summary> + public static ClinicalDocumentType HistoryAndPhysical { get; } = new ClinicalDocumentType(HistoryAndPhysicalValue); + /// <summary> radiologyReport. </summary> + public static ClinicalDocumentType RadiologyReport { get; } = new ClinicalDocumentType(RadiologyReportValue); + /// <summary> procedure. </summary> + public static ClinicalDocumentType Procedure { get; } = new ClinicalDocumentType(ProcedureValue); + /// <summary> progress. </summary> + public static ClinicalDocumentType Progress { get; } = new ClinicalDocumentType(ProgressValue); + /// <summary> laboratory. </summary> + public static ClinicalDocumentType Laboratory { get; } = new ClinicalDocumentType(LaboratoryValue); + /// <summary> pathologyReport. </summary> + public static ClinicalDocumentType PathologyReport { get; } = new ClinicalDocumentType(PathologyReportValue); + /// <summary> Determines if two <see cref="ClinicalDocumentType"/> values are the same. </summary> + public static bool operator ==(ClinicalDocumentType left, ClinicalDocumentType right) => left.Equals(right); + /// <summary> Determines if two <see cref="ClinicalDocumentType"/> values are not the same. </summary> + public static bool operator !=(ClinicalDocumentType left, ClinicalDocumentType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="ClinicalDocumentType"/>. </summary> + public static implicit operator ClinicalDocumentType(string value) => new ClinicalDocumentType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalDocumentType other && Equals(other); + /// <inheritdoc /> + public bool Equals(ClinicalDocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Docs/PatientTimelineClient.xml b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Docs/PatientTimelineClient.xml new file mode 100644 index 0000000000000..80daa96c02bef --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Docs/PatientTimelineClient.xml @@ -0,0 +1,1141 @@ +<?xml version="1.0" encoding="utf-8"?> +<doc> + <members> + <member name="InferPatientTimelineAsync(WaitUntil,PatientTimelineData,CancellationToken)"> + <example> +This sample shows how to call InferPatientTimelineAsync. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + +PatientTimelineData patientTimelineData = new PatientTimelineData(new PatientRecord[] +{ + new PatientRecord("<id>") +}); +Operation<PatientTimelineInferenceResult> operation = await client.InferPatientTimelineAsync(WaitUntil.Completed, patientTimelineData); +PatientTimelineInferenceResult responseData = operation.Value; +]]></code> +This sample shows how to call InferPatientTimelineAsync with all parameters. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + +PatientTimelineData patientTimelineData = new PatientTimelineData(new PatientRecord[] +{ + new PatientRecord("<id>") + { + Info = new PatientDetails + { + Sex = PatientSex.Female, + BirthDate = DateTimeOffset.Parse("2022-05-10"), + ClinicalInfo = {new FhirR4Resource("<resourceType>") + { + Id = "<id>", + Meta = new FhirR4Meta + { + VersionId = "<versionId>", + LastUpdated = "<lastUpdated>", + Source = "<source>", + Profile = {"<profile>"}, + Security = {new FhirR4Coding + { + System = "<system>", + Version = "<version>", + Code = "<code>", + Display = "<display>", + }}, + Tag = {default}, + }, + ImplicitRules = "<implicitRules>", + Language = "<language>", + }}, + }, + Encounters = {new Encounter("<id>") + { + Period = new TimePeriod + { + Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + }, + Class = EncounterClass.InPatient, + }}, + PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) + { + ClinicalType = ClinicalDocumentType.Consultation, + Language = "<language>", + CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + Authors = {new DocumentAuthor + { + Id = "<id>", + FullName = "<fullName>", + }}, + SpecialtyType = SpecialtyType.Pathology, + AdministrativeMetadata = new DocumentAdministrativeMetadata + { + OrderedProcedures = {new FhirR4Extendible + { + Extension = {default}, + Code = default, + Description = "<description>", + }}, + EncounterId = "<encounterId>", + }, + }}, + } +}) +{ + Configuration = new PatientTimelineModelConfiguration + { + Verbose = true, + IncludeEvidence = true, + }, +}; +Operation<PatientTimelineInferenceResult> operation = await client.InferPatientTimelineAsync(WaitUntil.Completed, patientTimelineData); +PatientTimelineInferenceResult responseData = operation.Value; +]]></code></example> + </member> + <member name="InferPatientTimeline(WaitUntil,PatientTimelineData,CancellationToken)"> + <example> +This sample shows how to call InferPatientTimeline. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + +PatientTimelineData patientTimelineData = new PatientTimelineData(new PatientRecord[] +{ + new PatientRecord("<id>") +}); +Operation<PatientTimelineInferenceResult> operation = client.InferPatientTimeline(WaitUntil.Completed, patientTimelineData); +PatientTimelineInferenceResult responseData = operation.Value; +]]></code> +This sample shows how to call InferPatientTimeline with all parameters. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + +PatientTimelineData patientTimelineData = new PatientTimelineData(new PatientRecord[] +{ + new PatientRecord("<id>") + { + Info = new PatientDetails + { + Sex = PatientSex.Female, + BirthDate = DateTimeOffset.Parse("2022-05-10"), + ClinicalInfo = {new FhirR4Resource("<resourceType>") + { + Id = "<id>", + Meta = new FhirR4Meta + { + VersionId = "<versionId>", + LastUpdated = "<lastUpdated>", + Source = "<source>", + Profile = {"<profile>"}, + Security = {new FhirR4Coding + { + System = "<system>", + Version = "<version>", + Code = "<code>", + Display = "<display>", + }}, + Tag = {default}, + }, + ImplicitRules = "<implicitRules>", + Language = "<language>", + }}, + }, + Encounters = {new Encounter("<id>") + { + Period = new TimePeriod + { + Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + }, + Class = EncounterClass.InPatient, + }}, + PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) + { + ClinicalType = ClinicalDocumentType.Consultation, + Language = "<language>", + CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + Authors = {new DocumentAuthor + { + Id = "<id>", + FullName = "<fullName>", + }}, + SpecialtyType = SpecialtyType.Pathology, + AdministrativeMetadata = new DocumentAdministrativeMetadata + { + OrderedProcedures = {new FhirR4Extendible + { + Extension = {default}, + Code = default, + Description = "<description>", + }}, + EncounterId = "<encounterId>", + }, + }}, + } +}) +{ + Configuration = new PatientTimelineModelConfiguration + { + Verbose = true, + IncludeEvidence = true, + }, +}; +Operation<PatientTimelineInferenceResult> operation = client.InferPatientTimeline(WaitUntil.Completed, patientTimelineData); +PatientTimelineInferenceResult responseData = operation.Value; +]]></code></example> + </member> + <member name="InferPatientTimelineAsync(WaitUntil,RequestContent,RequestContext)"> + <example> +This sample shows how to call InferPatientTimelineAsync and parse the result. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + patients = new object[] + { + new + { + id = "<id>", + } + }, +}); +Operation<BinaryData> operation = await client.InferPatientTimelineAsync(WaitUntil.Completed, content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].ToString()); +Console.WriteLine(result.GetProperty("modelVersion").ToString()); +]]></code> +This sample shows how to call InferPatientTimelineAsync with all parameters and request content and parse the result. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + patients = new object[] + { + new + { + id = "<id>", + info = new + { + sex = "female", + birthDate = "2022-05-10", + clinicalInfo = new object[] + { + new + { + resourceType = "<resourceType>", + id = "<id>", + meta = new + { + versionId = "<versionId>", + lastUpdated = "<lastUpdated>", + source = "<source>", + profile = new object[] + { + "<profile>" + }, + security = new object[] + { + new + { + system = "<system>", + version = "<version>", + code = "<code>", + display = "<display>", + id = "<id>", + extension = new object[] + { + new + { + url = "<url>", + valueQuantity = new + { + value = 123.45, + comparator = "<comparator>", + unit = "<unit>", + system = "<system>", + code = "<code>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueCodeableConcept = new + { + coding = new object[] + { + null + }, + text = "<text>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueString = "<valueString>", + valueBoolean = true, + valueInteger = 1234, + valueRange = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueRatio = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueSampledData = new + { + period = 123.45, + factor = 123.45, + lowerLimit = 123.45, + upperLimit = 123.45, + dimensions = 1234, + data = "<data>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueTime = "01:23:45", + valueDateTime = "<valueDateTime>", + valuePeriod = new + { + start = "<start>", + end = "<end>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueReference = new + { + reference = "<reference>", + type = "<type>", + identifier = new + { + use = "<use>", + system = "<system>", + value = "<value>", + id = "<id>", + extension = new object[] + { + null + }, + }, + display = "<display>", + id = "<id>", + extension = new object[] + { + null + }, + }, + id = "<id>", + extension = new object[] + { + null + }, + } + }, + } + }, + tag = new object[] + { + null + }, + }, + implicitRules = "<implicitRules>", + language = "<language>", + } + }, + }, + encounters = new object[] + { + new Dictionary<string, object> + { + ["id"] = "<id>", + ["period"] = new + { + start = "2022-05-10T14:57:31.2311892-04:00", + end = "2022-05-10T14:57:31.2311892-04:00", + }, + ["class"] = "inpatient" + } + }, + patientDocuments = new object[] + { + new + { + type = "note", + clinicalType = "consultation", + id = "<id>", + language = "<language>", + createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + authors = new object[] + { + new + { + id = "<id>", + fullName = "<fullName>", + } + }, + specialtyType = "pathology", + administrativeMetadata = new + { + orderedProcedures = new object[] + { + new + { + extension = new object[] + { + null + }, + description = "<description>", + } + }, + encounterId = "<encounterId>", + }, + content = new + { + sourceType = "inline", + value = "<value>", + }, + } + }, + } + }, + configuration = new + { + verbose = true, + includeEvidence = true, + }, +}); +Operation<BinaryData> operation = await client.InferPatientTimelineAsync(WaitUntil.Completed, content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("modelVersion").ToString()); +]]></code></example> + </member> + <member name="InferPatientTimeline(WaitUntil,RequestContent,RequestContext)"> + <example> +This sample shows how to call InferPatientTimeline and parse the result. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + patients = new object[] + { + new + { + id = "<id>", + } + }, +}); +Operation<BinaryData> operation = client.InferPatientTimeline(WaitUntil.Completed, content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].ToString()); +Console.WriteLine(result.GetProperty("modelVersion").ToString()); +]]></code> +This sample shows how to call InferPatientTimeline with all parameters and request content and parse the result. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + patients = new object[] + { + new + { + id = "<id>", + info = new + { + sex = "female", + birthDate = "2022-05-10", + clinicalInfo = new object[] + { + new + { + resourceType = "<resourceType>", + id = "<id>", + meta = new + { + versionId = "<versionId>", + lastUpdated = "<lastUpdated>", + source = "<source>", + profile = new object[] + { + "<profile>" + }, + security = new object[] + { + new + { + system = "<system>", + version = "<version>", + code = "<code>", + display = "<display>", + id = "<id>", + extension = new object[] + { + new + { + url = "<url>", + valueQuantity = new + { + value = 123.45, + comparator = "<comparator>", + unit = "<unit>", + system = "<system>", + code = "<code>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueCodeableConcept = new + { + coding = new object[] + { + null + }, + text = "<text>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueString = "<valueString>", + valueBoolean = true, + valueInteger = 1234, + valueRange = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueRatio = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueSampledData = new + { + period = 123.45, + factor = 123.45, + lowerLimit = 123.45, + upperLimit = 123.45, + dimensions = 1234, + data = "<data>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueTime = "01:23:45", + valueDateTime = "<valueDateTime>", + valuePeriod = new + { + start = "<start>", + end = "<end>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueReference = new + { + reference = "<reference>", + type = "<type>", + identifier = new + { + use = "<use>", + system = "<system>", + value = "<value>", + id = "<id>", + extension = new object[] + { + null + }, + }, + display = "<display>", + id = "<id>", + extension = new object[] + { + null + }, + }, + id = "<id>", + extension = new object[] + { + null + }, + } + }, + } + }, + tag = new object[] + { + null + }, + }, + implicitRules = "<implicitRules>", + language = "<language>", + } + }, + }, + encounters = new object[] + { + new Dictionary<string, object> + { + ["id"] = "<id>", + ["period"] = new + { + start = "2022-05-10T14:57:31.2311892-04:00", + end = "2022-05-10T14:57:31.2311892-04:00", + }, + ["class"] = "inpatient" + } + }, + patientDocuments = new object[] + { + new + { + type = "note", + clinicalType = "consultation", + id = "<id>", + language = "<language>", + createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + authors = new object[] + { + new + { + id = "<id>", + fullName = "<fullName>", + } + }, + specialtyType = "pathology", + administrativeMetadata = new + { + orderedProcedures = new object[] + { + new + { + extension = new object[] + { + null + }, + description = "<description>", + } + }, + encounterId = "<encounterId>", + }, + content = new + { + sourceType = "inline", + value = "<value>", + }, + } + }, + } + }, + configuration = new + { + verbose = true, + includeEvidence = true, + }, +}); +Operation<BinaryData> operation = client.InferPatientTimeline(WaitUntil.Completed, content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("modelVersion").ToString()); +]]></code></example> + </member> + </members> +</doc> \ No newline at end of file diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAdministrativeMetadata.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAdministrativeMetadata.Serialization.cs new file mode 100644 index 0000000000000..70d606adbd838 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAdministrativeMetadata.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class DocumentAdministrativeMetadata : IUtf8JsonSerializable, IJsonModel<DocumentAdministrativeMetadata> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<DocumentAdministrativeMetadata>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<DocumentAdministrativeMetadata>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(OrderedProcedures)) + { + writer.WritePropertyName("orderedProcedures"u8); + writer.WriteStartArray(); + foreach (var item in OrderedProcedures) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EncounterId)) + { + writer.WritePropertyName("encounterId"u8); + writer.WriteStringValue(EncounterId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentAdministrativeMetadata IJsonModel<DocumentAdministrativeMetadata>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentAdministrativeMetadata(document.RootElement, options); + } + + internal static DocumentAdministrativeMetadata DeserializeDocumentAdministrativeMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Extendible>> orderedProcedures = default; + Optional<string> encounterId = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("orderedProcedures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extendible> array = new List<FhirR4Extendible>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extendible.DeserializeFhirR4Extendible(item)); + } + orderedProcedures = array; + continue; + } + if (property.NameEquals("encounterId"u8)) + { + encounterId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentAdministrativeMetadata(Optional.ToList(orderedProcedures), encounterId.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<DocumentAdministrativeMetadata>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{options.Format}' format."); + } + } + + DocumentAdministrativeMetadata IPersistableModel<DocumentAdministrativeMetadata>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentAdministrativeMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<DocumentAdministrativeMetadata>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static DocumentAdministrativeMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentAdministrativeMetadata(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAdministrativeMetadata.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAdministrativeMetadata.cs new file mode 100644 index 0000000000000..930e507875b5d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAdministrativeMetadata.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Document administrative metadata. </summary> + public partial class DocumentAdministrativeMetadata + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="DocumentAdministrativeMetadata"/>. </summary> + public DocumentAdministrativeMetadata() + { + OrderedProcedures = new ChangeTrackingList<FhirR4Extendible>(); + } + + /// <summary> Initializes a new instance of <see cref="DocumentAdministrativeMetadata"/>. </summary> + /// <param name="orderedProcedures"> List of procedure information associated with the document. </param> + /// <param name="encounterId"> Reference to the encounter associated with the document. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal DocumentAdministrativeMetadata(IList<FhirR4Extendible> orderedProcedures, string encounterId, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + OrderedProcedures = orderedProcedures; + EncounterId = encounterId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> List of procedure information associated with the document. </summary> + public IList<FhirR4Extendible> OrderedProcedures { get; } + /// <summary> Reference to the encounter associated with the document. </summary> + public string EncounterId { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAuthor.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAuthor.Serialization.cs new file mode 100644 index 0000000000000..babce4c716817 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAuthor.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class DocumentAuthor : IUtf8JsonSerializable, IJsonModel<DocumentAuthor> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<DocumentAuthor>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<DocumentAuthor>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(FullName)) + { + writer.WritePropertyName("fullName"u8); + writer.WriteStringValue(FullName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentAuthor IJsonModel<DocumentAuthor>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentAuthor(document.RootElement, options); + } + + internal static DocumentAuthor DeserializeDocumentAuthor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> id = default; + Optional<string> fullName = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("fullName"u8)) + { + fullName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentAuthor(id.Value, fullName.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<DocumentAuthor>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{options.Format}' format."); + } + } + + DocumentAuthor IPersistableModel<DocumentAuthor>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentAuthor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<DocumentAuthor>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static DocumentAuthor FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentAuthor(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAuthor.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAuthor.cs new file mode 100644 index 0000000000000..5e3d2076b00f1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentAuthor.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Document author. </summary> + public partial class DocumentAuthor + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="DocumentAuthor"/>. </summary> + public DocumentAuthor() + { + } + + /// <summary> Initializes a new instance of <see cref="DocumentAuthor"/>. </summary> + /// <param name="id"> author id. </param> + /// <param name="fullName"> Text representation of the full name. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal DocumentAuthor(string id, string fullName, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + FullName = fullName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> author id. </summary> + public string Id { get; set; } + /// <summary> Text representation of the full name. </summary> + public string FullName { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContent.Serialization.cs similarity index 59% rename from sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.Serialization.cs rename to sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContent.Serialization.cs index 9dffa72d65147..8b7a4c18c628d 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/AcceptedAge.Serialization.cs +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContent.Serialization.cs @@ -12,25 +12,25 @@ using Azure; using Azure.Core; -namespace Azure.Health.Insights.ClinicalMatching +namespace Azure.Health.Insights.PatientTimeline { - public partial class AcceptedAge : IUtf8JsonSerializable, IJsonModel<AcceptedAge> + public partial class DocumentContent : IUtf8JsonSerializable, IJsonModel<DocumentContent> { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<AcceptedAge>)this).Write(writer, new ModelReaderWriterOptions("W")); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<DocumentContent>)this).Write(writer, new ModelReaderWriterOptions("W")); - void IJsonModel<AcceptedAge>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel<DocumentContent>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<AcceptedAge>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<DocumentContent>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AcceptedAge)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(DocumentContent)} does not support '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("unit"u8); - writer.WriteStringValue(Unit.ToString()); + writer.WritePropertyName("sourceType"u8); + writer.WriteStringValue(SourceType.ToString()); writer.WritePropertyName("value"u8); - writer.WriteNumberValue(Value); + writer.WriteStringValue(Value); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -49,19 +49,19 @@ void IJsonModel<AcceptedAge>.Write(Utf8JsonWriter writer, ModelReaderWriterOptio writer.WriteEndObject(); } - AcceptedAge IJsonModel<AcceptedAge>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DocumentContent IJsonModel<DocumentContent>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<AcceptedAge>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<DocumentContent>)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AcceptedAge)} does not support '{format}' format."); + throw new FormatException($"The model {nameof(DocumentContent)} does not support '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAcceptedAge(document.RootElement, options); + return DeserializeDocumentContent(document.RootElement, options); } - internal static AcceptedAge DeserializeAcceptedAge(JsonElement element, ModelReaderWriterOptions options = null) + internal static DocumentContent DeserializeDocumentContent(JsonElement element, ModelReaderWriterOptions options = null) { options ??= new ModelReaderWriterOptions("W"); @@ -69,20 +69,20 @@ internal static AcceptedAge DeserializeAcceptedAge(JsonElement element, ModelRea { return null; } - AgeUnit unit = default; - float value = default; + DocumentContentSourceType sourceType = default; + string value = default; IDictionary<string, BinaryData> serializedAdditionalRawData = default; Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("unit"u8)) + if (property.NameEquals("sourceType"u8)) { - unit = new AgeUnit(property.Value.GetString()); + sourceType = new DocumentContentSourceType(property.Value.GetString()); continue; } if (property.NameEquals("value"u8)) { - value = property.Value.GetSingle(); + value = property.Value.GetString(); continue; } if (options.Format != "W") @@ -91,46 +91,46 @@ internal static AcceptedAge DeserializeAcceptedAge(JsonElement element, ModelRea } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new AcceptedAge(unit, value, serializedAdditionalRawData); + return new DocumentContent(sourceType, value, serializedAdditionalRawData); } - BinaryData IPersistableModel<AcceptedAge>.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel<DocumentContent>.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<AcceptedAge>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<DocumentContent>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AcceptedAge)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(DocumentContent)} does not support '{options.Format}' format."); } } - AcceptedAge IPersistableModel<AcceptedAge>.Create(BinaryData data, ModelReaderWriterOptions options) + DocumentContent IPersistableModel<DocumentContent>.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel<AcceptedAge>)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel<DocumentContent>)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAcceptedAge(document.RootElement, options); + return DeserializeDocumentContent(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AcceptedAge)} does not support '{options.Format}' format."); + throw new FormatException($"The model {nameof(DocumentContent)} does not support '{options.Format}' format."); } } - string IPersistableModel<AcceptedAge>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel<DocumentContent>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// <summary> Deserializes the model from a raw response. </summary> /// <param name="response"> The response to deserialize the model from. </param> - internal static AcceptedAge FromResponse(Response response) + internal static DocumentContent FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAcceptedAge(document.RootElement); + return DeserializeDocumentContent(document.RootElement); } /// <summary> Convert into a Utf8JsonRequestContent. </summary> diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContent.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContent.cs new file mode 100644 index 0000000000000..e4d6b7b09d560 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContent.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> The content of the patient document. </summary> + public partial class DocumentContent + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="DocumentContent"/>. </summary> + /// <param name="sourceType"> + /// 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. + /// </param> + /// <param name="value"> The content of the document, given either inline (as a string) or as a reference (URI). </param> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public DocumentContent(DocumentContentSourceType sourceType, string value) + { + Argument.AssertNotNull(value, nameof(value)); + + SourceType = sourceType; + Value = value; + } + + /// <summary> Initializes a new instance of <see cref="DocumentContent"/>. </summary> + /// <param name="sourceType"> + /// 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. + /// </param> + /// <param name="value"> The content of the document, given either inline (as a string) or as a reference (URI). </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal DocumentContent(DocumentContentSourceType sourceType, string value, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + SourceType = sourceType; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="DocumentContent"/> for deserialization. </summary> + internal DocumentContent() + { + } + + /// <summary> + /// 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. + /// </summary> + public DocumentContentSourceType SourceType { get; } + /// <summary> The content of the document, given either inline (as a string) or as a reference (URI). </summary> + public string Value { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContentSourceType.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContentSourceType.cs new file mode 100644 index 0000000000000..672f9451c8f47 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentContentSourceType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// 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. + /// </summary> + public readonly partial struct DocumentContentSourceType : IEquatable<DocumentContentSourceType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="DocumentContentSourceType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public DocumentContentSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InlineValue = "inline"; + private const string ReferenceValue = "reference"; + + /// <summary> The content is given as a string (for instance, text). </summary> + public static DocumentContentSourceType Inline { get; } = new DocumentContentSourceType(InlineValue); + /// <summary> The content is given as a URI. </summary> + public static DocumentContentSourceType Reference { get; } = new DocumentContentSourceType(ReferenceValue); + /// <summary> Determines if two <see cref="DocumentContentSourceType"/> values are the same. </summary> + public static bool operator ==(DocumentContentSourceType left, DocumentContentSourceType right) => left.Equals(right); + /// <summary> Determines if two <see cref="DocumentContentSourceType"/> values are not the same. </summary> + public static bool operator !=(DocumentContentSourceType left, DocumentContentSourceType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="DocumentContentSourceType"/>. </summary> + public static implicit operator DocumentContentSourceType(string value) => new DocumentContentSourceType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentContentSourceType other && Equals(other); + /// <inheritdoc /> + public bool Equals(DocumentContentSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentType.cs new file mode 100644 index 0000000000000..32b38d2c0804c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/DocumentType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </summary> + public readonly partial struct DocumentType : IEquatable<DocumentType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="DocumentType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + 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"; + + /// <summary> note. </summary> + public static DocumentType Note { get; } = new DocumentType(NoteValue); + /// <summary> fhirBundle. </summary> + public static DocumentType FhirBundle { get; } = new DocumentType(FhirBundleValue); + /// <summary> dicom. </summary> + public static DocumentType Dicom { get; } = new DocumentType(DicomValue); + /// <summary> genomicSequencing. </summary> + public static DocumentType GenomicSequencing { get; } = new DocumentType(GenomicSequencingValue); + /// <summary> Determines if two <see cref="DocumentType"/> values are the same. </summary> + public static bool operator ==(DocumentType left, DocumentType right) => left.Equals(right); + /// <summary> Determines if two <see cref="DocumentType"/> values are not the same. </summary> + public static bool operator !=(DocumentType left, DocumentType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="DocumentType"/>. </summary> + public static implicit operator DocumentType(string value) => new DocumentType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentType other && Equals(other); + /// <inheritdoc /> + public bool Equals(DocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Encounter.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Encounter.Serialization.cs new file mode 100644 index 0000000000000..7e355a3dac477 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Encounter.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class Encounter : IUtf8JsonSerializable, IJsonModel<Encounter> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<Encounter>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<Encounter>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Encounter)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Period)) + { + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); + } + if (Optional.IsDefined(Class)) + { + writer.WritePropertyName("class"u8); + writer.WriteStringValue(Class.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Encounter IJsonModel<Encounter>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Encounter)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEncounter(document.RootElement, options); + } + + internal static Encounter DeserializeEncounter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + Optional<TimePeriod> period = default; + Optional<EncounterClass> @class = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("period"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + period = TimePeriod.DeserializeTimePeriod(property.Value); + continue; + } + if (property.NameEquals("class"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @class = new EncounterClass(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new Encounter(id, period.Value, Optional.ToNullable(@class), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<Encounter>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Encounter)} does not support '{options.Format}' format."); + } + } + + Encounter IPersistableModel<Encounter>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEncounter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Encounter)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<Encounter>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static Encounter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEncounter(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Encounter.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Encounter.cs new file mode 100644 index 0000000000000..da16cc6132369 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/Encounter.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> visit/encounter information. </summary> + public partial class Encounter + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <exception cref="ArgumentNullException"> <paramref name="id"/> is null. </exception> + public Encounter(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + } + + /// <summary> Initializes a new instance of <see cref="Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <param name="period"> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </param> + /// <param name="class"> The class of the encounter. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal Encounter(string id, TimePeriod period, EncounterClass? @class, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + Period = period; + Class = @class; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="Encounter"/> for deserialization. </summary> + internal Encounter() + { + } + + /// <summary> The id of the visit. </summary> + public string Id { get; } + /// <summary> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </summary> + public TimePeriod Period { get; set; } + /// <summary> The class of the encounter. </summary> + public EncounterClass? Class { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/EncounterClass.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/EncounterClass.cs new file mode 100644 index 0000000000000..c8e9324c8cbaf --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/EncounterClass.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Known values codes that can be used to indicate the class of encounter (TODO://Based on FHIR value set--http://....). </summary> + public readonly partial struct EncounterClass : IEquatable<EncounterClass> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="EncounterClass"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public EncounterClass(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InPatientValue = "inpatient"; + private const string AmbulatoryValue = "ambulatory"; + private const string ObservationValue = "observation"; + private const string EmergencyValue = "emergency"; + private const string VirtualValue = "virtual"; + private const string HealthHomeValue = "healthHome"; + + /// <summary> A patient encounter where a patient is admitted by a hospital or equivalent facility, assigned to a location where patients generally stay at least overnight and provided with room, board, and continuous nursing service. </summary> + public static EncounterClass InPatient { get; } = new EncounterClass(InPatientValue); + /// <summary> The term ambulatory usually implies that the patient has come to the location and is not assigned to a bed. Sometimes referred to as an outpatient encounter. </summary> + public static EncounterClass Ambulatory { get; } = new EncounterClass(AmbulatoryValue); + /// <summary> An encounter where the patient usually will start in different encounter, such as one in the emergency department but then transition to this type of encounter because they require a significant period of treatment and monitoring to determine whether or not their condition warrants an inpatient admission or discharge. </summary> + public static EncounterClass Observation { get; } = new EncounterClass(ObservationValue); + /// <summary> A patient encounter that takes place at a dedicated healthcare service delivery location where the patient receives immediate evaluation and treatment, provided until the patient can be discharged or responsibility for the patient's care is transferred elsewhere (for example, the patient could be admitted as an inpatient or transferred to another facility. </summary> + public static EncounterClass Emergency { get; } = new EncounterClass(EmergencyValue); + /// <summary> A patient encounter where the patient is not physically present for the encounter, such as in a telehealth encounter, phone call, or electronic communication. </summary> + public static EncounterClass Virtual { get; } = new EncounterClass(VirtualValue); + /// <summary> Healthcare encounter that takes place in the residence of the patient or a designee. </summary> + public static EncounterClass HealthHome { get; } = new EncounterClass(HealthHomeValue); + /// <summary> Determines if two <see cref="EncounterClass"/> values are the same. </summary> + public static bool operator ==(EncounterClass left, EncounterClass right) => left.Equals(right); + /// <summary> Determines if two <see cref="EncounterClass"/> values are not the same. </summary> + public static bool operator !=(EncounterClass left, EncounterClass right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="EncounterClass"/>. </summary> + public static implicit operator EncounterClass(string value) => new EncounterClass(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EncounterClass other && Equals(other); + /// <inheritdoc /> + public bool Equals(EncounterClass other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4CodeableConcept.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4CodeableConcept.Serialization.cs new file mode 100644 index 0000000000000..84b1e159e85c6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4CodeableConcept.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4CodeableConcept : IUtf8JsonSerializable, IJsonModel<FhirR4CodeableConcept> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4CodeableConcept>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4CodeableConcept>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Coding)) + { + writer.WritePropertyName("coding"u8); + writer.WriteStartArray(); + foreach (var item in Coding) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4CodeableConcept IJsonModel<FhirR4CodeableConcept>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4CodeableConcept(document.RootElement, options); + } + + internal static FhirR4CodeableConcept DeserializeFhirR4CodeableConcept(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Coding>> coding = default; + Optional<string> text = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("coding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + coding = array; + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4CodeableConcept(id.Value, Optional.ToList(extension), serializedAdditionalRawData, Optional.ToList(coding), text.Value); + } + + BinaryData IPersistableModel<FhirR4CodeableConcept>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{options.Format}' format."); + } + } + + FhirR4CodeableConcept IPersistableModel<FhirR4CodeableConcept>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4CodeableConcept(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4CodeableConcept>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4CodeableConcept FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4CodeableConcept(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4CodeableConcept.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4CodeableConcept.cs new file mode 100644 index 0000000000000..73c06e19df654 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4CodeableConcept.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// Concept - reference to a terminology or just text + /// Based on [FHIR CodeableConcept](https://www.hl7.org/fhir/R4/datatypes.html#CodeableConcept) + /// </summary> + public partial class FhirR4CodeableConcept : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4CodeableConcept"/>. </summary> + public FhirR4CodeableConcept() + { + Coding = new ChangeTrackingList<FhirR4Coding>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4CodeableConcept"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="coding"> Code defined by a terminology system. </param> + /// <param name="text"> Plain text representation of the concept. </param> + internal FhirR4CodeableConcept(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, IList<FhirR4Coding> coding, string text) : base(id, extension, serializedAdditionalRawData) + { + Coding = coding; + Text = text; + } + + /// <summary> Code defined by a terminology system. </summary> + public IList<FhirR4Coding> Coding { get; } + /// <summary> Plain text representation of the concept. </summary> + public string Text { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Coding.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Coding.Serialization.cs new file mode 100644 index 0000000000000..265a79fbded8d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Coding.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Coding : IUtf8JsonSerializable, IJsonModel<FhirR4Coding> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Coding>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Coding>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Coding IJsonModel<FhirR4Coding>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Coding(document.RootElement, options); + } + + internal static FhirR4Coding DeserializeFhirR4Coding(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> system = default; + Optional<string> version = default; + Optional<string> code = default; + Optional<string> display = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("display"u8)) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Coding(id.Value, Optional.ToList(extension), serializedAdditionalRawData, system.Value, version.Value, code.Value, display.Value); + } + + BinaryData IPersistableModel<FhirR4Coding>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{options.Format}' format."); + } + } + + FhirR4Coding IPersistableModel<FhirR4Coding>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Coding(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Coding>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Coding FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Coding(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Coding.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Coding.cs new file mode 100644 index 0000000000000..c11547ff9dcb0 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Coding.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// A Coding is a representation of a defined concept using a symbol from a defined "code system". + /// Based on [FHIR Coding](https://www.hl7.org/fhir/R4/datatypes.html#Coding) + /// </summary> + public partial class FhirR4Coding : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Coding"/>. </summary> + public FhirR4Coding() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Coding"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="system"> Identity of the terminology system. </param> + /// <param name="version"> Version of the system - if relevant. </param> + /// <param name="code"> Symbol in syntax defined by the system. </param> + /// <param name="display"> Representation defined by the system. </param> + internal FhirR4Coding(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string system, string version, string code, string display) : base(id, extension, serializedAdditionalRawData) + { + System = system; + Version = version; + Code = code; + Display = display; + } + + /// <summary> Identity of the terminology system. </summary> + public string System { get; set; } + /// <summary> Version of the system - if relevant. </summary> + public string Version { get; set; } + /// <summary> Symbol in syntax defined by the system. </summary> + public string Code { get; set; } + /// <summary> Representation defined by the system. </summary> + public string Display { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Element.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Element.Serialization.cs new file mode 100644 index 0000000000000..107a1b5baa0f1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Element.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Element : IUtf8JsonSerializable, IJsonModel<FhirR4Element> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Element>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Element>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Element IJsonModel<FhirR4Element>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Element(document.RootElement, options); + } + + internal static FhirR4Element DeserializeFhirR4Element(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Element(id.Value, Optional.ToList(extension), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Element>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{options.Format}' format."); + } + } + + FhirR4Element IPersistableModel<FhirR4Element>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Element(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Element>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Element FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Element(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Element.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Element.cs new file mode 100644 index 0000000000000..ebc7b869dc18a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Element.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// The base definition for all elements contained inside a resource. + /// Based on [FHIR Element](https://www.hl7.org/fhir/R4/element.html) + /// </summary> + public partial class FhirR4Element + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private protected IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Element"/>. </summary> + internal FhirR4Element() + { + Extension = new ChangeTrackingList<FhirR4Extension>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Element"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Element(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + Extension = extension; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Unique id for inter-element referencing. </summary> + public string Id { get; } + /// <summary> Additional Content defined by implementations. </summary> + public IReadOnlyList<FhirR4Extension> Extension { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extendible.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extendible.Serialization.cs new file mode 100644 index 0000000000000..b486da3ee2f4d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extendible.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Extendible : IUtf8JsonSerializable, IJsonModel<FhirR4Extendible> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Extendible>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Extendible>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteObjectValue(Code); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Extendible IJsonModel<FhirR4Extendible>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Extendible(document.RootElement, options); + } + + internal static FhirR4Extendible DeserializeFhirR4Extendible(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Extension>> extension = default; + Optional<FhirR4CodeableConcept> code = default; + Optional<string> description = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Extendible(Optional.ToList(extension), code.Value, description.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Extendible>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{options.Format}' format."); + } + } + + FhirR4Extendible IPersistableModel<FhirR4Extendible>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Extendible(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Extendible>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Extendible FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Extendible(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extendible.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extendible.cs new file mode 100644 index 0000000000000..f0a4556a06e7e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extendible.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Procedure information. </summary> + public partial class FhirR4Extendible + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Extendible"/>. </summary> + public FhirR4Extendible() + { + Extension = new ChangeTrackingList<FhirR4Extension>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extendible"/>. </summary> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="code"> Procedure code. </param> + /// <param name="description"> Procedure description. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Extendible(IList<FhirR4Extension> extension, FhirR4CodeableConcept code, string description, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Extension = extension; + Code = code; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Additional Content defined by implementations. </summary> + public IList<FhirR4Extension> Extension { get; } + /// <summary> Procedure code. </summary> + public FhirR4CodeableConcept Code { get; set; } + /// <summary> Procedure description. </summary> + public string Description { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extension.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extension.Serialization.cs new file mode 100644 index 0000000000000..1073f551c18e2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extension.Serialization.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Extension : IUtf8JsonSerializable, IJsonModel<FhirR4Extension> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Extension>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Extension>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url); + if (Optional.IsDefined(ValueQuantity)) + { + writer.WritePropertyName("valueQuantity"u8); + writer.WriteObjectValue(ValueQuantity); + } + if (Optional.IsDefined(ValueCodeableConcept)) + { + writer.WritePropertyName("valueCodeableConcept"u8); + writer.WriteObjectValue(ValueCodeableConcept); + } + if (Optional.IsDefined(ValueString)) + { + writer.WritePropertyName("valueString"u8); + writer.WriteStringValue(ValueString); + } + if (Optional.IsDefined(ValueBoolean)) + { + writer.WritePropertyName("valueBoolean"u8); + writer.WriteBooleanValue(ValueBoolean.Value); + } + if (Optional.IsDefined(ValueInteger)) + { + writer.WritePropertyName("valueInteger"u8); + writer.WriteNumberValue(ValueInteger.Value); + } + if (Optional.IsDefined(ValueRange)) + { + writer.WritePropertyName("valueRange"u8); + writer.WriteObjectValue(ValueRange); + } + if (Optional.IsDefined(ValueRatio)) + { + writer.WritePropertyName("valueRatio"u8); + writer.WriteObjectValue(ValueRatio); + } + if (Optional.IsDefined(ValueSampledData)) + { + writer.WritePropertyName("valueSampledData"u8); + writer.WriteObjectValue(ValueSampledData); + } + if (Optional.IsDefined(ValueTime)) + { + writer.WritePropertyName("valueTime"u8); + writer.WriteStringValue(ValueTime.Value, "T"); + } + if (Optional.IsDefined(ValueDateTime)) + { + writer.WritePropertyName("valueDateTime"u8); + writer.WriteStringValue(ValueDateTime); + } + if (Optional.IsDefined(ValuePeriod)) + { + writer.WritePropertyName("valuePeriod"u8); + writer.WriteObjectValue(ValuePeriod); + } + if (Optional.IsDefined(ValueReference)) + { + writer.WritePropertyName("valueReference"u8); + writer.WriteObjectValue(ValueReference); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Extension IJsonModel<FhirR4Extension>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Extension(document.RootElement, options); + } + + internal static FhirR4Extension DeserializeFhirR4Extension(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + Optional<FhirR4Quantity> valueQuantity = default; + Optional<FhirR4CodeableConcept> valueCodeableConcept = default; + Optional<string> valueString = default; + Optional<bool> valueBoolean = default; + Optional<int> valueInteger = default; + Optional<FhirR4Range> valueRange = default; + Optional<FhirR4Ratio> valueRatio = default; + Optional<FhirR4SampledData> valueSampledData = default; + Optional<TimeSpan> valueTime = default; + Optional<string> valueDateTime = default; + Optional<FhirR4Period> valuePeriod = default; + Optional<FhirR4Reference> valueReference = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueQuantity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueQuantity = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("valueCodeableConcept"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueCodeableConcept = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("valueString"u8)) + { + valueString = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueBoolean"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueBoolean = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("valueInteger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueInteger = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("valueRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRange = FhirR4Range.DeserializeFhirR4Range(property.Value); + continue; + } + if (property.NameEquals("valueRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRatio = FhirR4Ratio.DeserializeFhirR4Ratio(property.Value); + continue; + } + if (property.NameEquals("valueSampledData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueSampledData = FhirR4SampledData.DeserializeFhirR4SampledData(property.Value); + continue; + } + if (property.NameEquals("valueTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueTime = property.Value.GetTimeSpan("T"); + continue; + } + if (property.NameEquals("valueDateTime"u8)) + { + valueDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("valuePeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valuePeriod = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("valueReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueReference = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Extension(id.Value, Optional.ToList(extension), serializedAdditionalRawData, url, valueQuantity.Value, valueCodeableConcept.Value, valueString.Value, Optional.ToNullable(valueBoolean), Optional.ToNullable(valueInteger), valueRange.Value, valueRatio.Value, valueSampledData.Value, Optional.ToNullable(valueTime), valueDateTime.Value, valuePeriod.Value, valueReference.Value); + } + + BinaryData IPersistableModel<FhirR4Extension>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{options.Format}' format."); + } + } + + FhirR4Extension IPersistableModel<FhirR4Extension>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Extension(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Extension>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Extension FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Extension(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extension.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extension.cs new file mode 100644 index 0000000000000..abbae24aceb43 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Extension.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// Base for all elements + /// Based on [FHIR Element](https://www.hl7.org/fhir/datatypes.html#Element) + /// </summary> + public partial class FhirR4Extension : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/>. </summary> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <exception cref="ArgumentNullException"> <paramref name="url"/> is null. </exception> + public FhirR4Extension(string url) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <param name="valueQuantity"> Value as Quantity. </param> + /// <param name="valueCodeableConcept"> Value as CodeableConcept. </param> + /// <param name="valueString"> Value as string. </param> + /// <param name="valueBoolean"> Value as boolean. </param> + /// <param name="valueInteger"> Value as integer. </param> + /// <param name="valueRange"> Value as Range. </param> + /// <param name="valueRatio"> Value as Ratio. </param> + /// <param name="valueSampledData"> Value as SampledData. </param> + /// <param name="valueTime"> Value as time (hh:mm:ss). </param> + /// <param name="valueDateTime"> Value as dateTime. </param> + /// <param name="valuePeriod"> Value as Period. </param> + /// <param name="valueReference"> Value as reference. </param> + internal FhirR4Extension(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string url, FhirR4Quantity valueQuantity, FhirR4CodeableConcept valueCodeableConcept, string valueString, bool? valueBoolean, int? valueInteger, FhirR4Range valueRange, FhirR4Ratio valueRatio, FhirR4SampledData valueSampledData, TimeSpan? valueTime, string valueDateTime, FhirR4Period valuePeriod, FhirR4Reference valueReference) : base(id, extension, serializedAdditionalRawData) + { + Url = url; + ValueQuantity = valueQuantity; + ValueCodeableConcept = valueCodeableConcept; + ValueString = valueString; + ValueBoolean = valueBoolean; + ValueInteger = valueInteger; + ValueRange = valueRange; + ValueRatio = valueRatio; + ValueSampledData = valueSampledData; + ValueTime = valueTime; + ValueDateTime = valueDateTime; + ValuePeriod = valuePeriod; + ValueReference = valueReference; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/> for deserialization. </summary> + internal FhirR4Extension() + { + } + + /// <summary> Source of the definition for the extension code - a logical name or a URL. </summary> + public string Url { get; set; } + /// <summary> Value as Quantity. </summary> + public FhirR4Quantity ValueQuantity { get; set; } + /// <summary> Value as CodeableConcept. </summary> + public FhirR4CodeableConcept ValueCodeableConcept { get; set; } + /// <summary> Value as string. </summary> + public string ValueString { get; set; } + /// <summary> Value as boolean. </summary> + public bool? ValueBoolean { get; set; } + /// <summary> Value as integer. </summary> + public int? ValueInteger { get; set; } + /// <summary> Value as Range. </summary> + public FhirR4Range ValueRange { get; set; } + /// <summary> Value as Ratio. </summary> + public FhirR4Ratio ValueRatio { get; set; } + /// <summary> Value as SampledData. </summary> + public FhirR4SampledData ValueSampledData { get; set; } + /// <summary> Value as time (hh:mm:ss). </summary> + public TimeSpan? ValueTime { get; set; } + /// <summary> Value as dateTime. </summary> + public string ValueDateTime { get; set; } + /// <summary> Value as Period. </summary> + public FhirR4Period ValuePeriod { get; set; } + /// <summary> Value as reference. </summary> + public FhirR4Reference ValueReference { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Identifier.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Identifier.Serialization.cs new file mode 100644 index 0000000000000..c4e7e8e908192 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Identifier.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Identifier : IUtf8JsonSerializable, IJsonModel<FhirR4Identifier> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Identifier>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Identifier>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Use)) + { + writer.WritePropertyName("use"u8); + writer.WriteStringValue(Use); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteObjectValue(Type); + } + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(Period)) + { + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); + } + if (Optional.IsDefined(Assigner)) + { + writer.WritePropertyName("assigner"u8); + writer.WriteObjectValue(Assigner); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Identifier IJsonModel<FhirR4Identifier>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Identifier(document.RootElement, options); + } + + internal static FhirR4Identifier DeserializeFhirR4Identifier(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> use = default; + Optional<FhirR4CodeableConcept> type = default; + Optional<string> system = default; + Optional<string> value = default; + Optional<FhirR4Period> period = default; + Optional<FhirR4Reference> assigner = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("use"u8)) + { + use = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("period"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + period = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("assigner"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assigner = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Identifier(id.Value, Optional.ToList(extension), serializedAdditionalRawData, use.Value, type.Value, system.Value, value.Value, period.Value, assigner.Value); + } + + BinaryData IPersistableModel<FhirR4Identifier>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{options.Format}' format."); + } + } + + FhirR4Identifier IPersistableModel<FhirR4Identifier>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Identifier(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Identifier>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Identifier FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Identifier(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Identifier.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Identifier.cs new file mode 100644 index 0000000000000..2ece7ce64156a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Identifier.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// An identifier intended for computation + /// Based on [FHIR Identifier](https://www.hl7.org/fhir/R4/identifier.html) + /// </summary> + public partial class FhirR4Identifier : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Identifier"/>. </summary> + public FhirR4Identifier() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Identifier"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="use"> usual | official | temp | secondary | old (If known). </param> + /// <param name="type"> Description of identifier. </param> + /// <param name="system"> The namespace for the identifier value. </param> + /// <param name="value"> The value that is unique. </param> + /// <param name="period"> Time period when id is/was valid for use. </param> + /// <param name="assigner"> Organization that issued id (may be just text). </param> + internal FhirR4Identifier(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string use, FhirR4CodeableConcept type, string system, string value, FhirR4Period period, FhirR4Reference assigner) : base(id, extension, serializedAdditionalRawData) + { + Use = use; + Type = type; + System = system; + Value = value; + Period = period; + Assigner = assigner; + } + + /// <summary> usual | official | temp | secondary | old (If known). </summary> + public string Use { get; set; } + /// <summary> Description of identifier. </summary> + public FhirR4CodeableConcept Type { get; set; } + /// <summary> The namespace for the identifier value. </summary> + public string System { get; set; } + /// <summary> The value that is unique. </summary> + public string Value { get; set; } + /// <summary> Time period when id is/was valid for use. </summary> + public FhirR4Period Period { get; set; } + /// <summary> Organization that issued id (may be just text). </summary> + public FhirR4Reference Assigner { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Meta.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Meta.Serialization.cs new file mode 100644 index 0000000000000..ca94c0da6fd3e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Meta.Serialization.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Meta : IUtf8JsonSerializable, IJsonModel<FhirR4Meta> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Meta>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Meta>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(VersionId)) + { + writer.WritePropertyName("versionId"u8); + writer.WriteStringValue(VersionId); + } + if (Optional.IsDefined(LastUpdated)) + { + writer.WritePropertyName("lastUpdated"u8); + writer.WriteStringValue(LastUpdated); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsCollectionDefined(Profile)) + { + writer.WritePropertyName("profile"u8); + writer.WriteStartArray(); + foreach (var item in Profile) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Security)) + { + writer.WritePropertyName("security"u8); + writer.WriteStartArray(); + foreach (var item in Security) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Tag)) + { + writer.WritePropertyName("tag"u8); + writer.WriteStartArray(); + foreach (var item in Tag) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Meta IJsonModel<FhirR4Meta>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Meta(document.RootElement, options); + } + + internal static FhirR4Meta DeserializeFhirR4Meta(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> versionId = default; + Optional<string> lastUpdated = default; + Optional<string> source = default; + Optional<IList<string>> profile = default; + Optional<IList<FhirR4Coding>> security = default; + Optional<IList<FhirR4Coding>> tag = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("versionId"u8)) + { + versionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastUpdated"u8)) + { + lastUpdated = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("profile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<string> array = new List<string>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + profile = array; + continue; + } + if (property.NameEquals("security"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + security = array; + continue; + } + if (property.NameEquals("tag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + tag = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Meta(versionId.Value, lastUpdated.Value, source.Value, Optional.ToList(profile), Optional.ToList(security), Optional.ToList(tag), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Meta>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{options.Format}' format."); + } + } + + FhirR4Meta IPersistableModel<FhirR4Meta>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Meta(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Meta>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Meta FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Meta(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Meta.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Meta.cs new file mode 100644 index 0000000000000..372ac4aeeb7b2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Meta.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// Metadata about a resource + /// Based on [FHIR Meta](https://www.hl7.org/fhir/R4/resource.html#Meta) + /// </summary> + public partial class FhirR4Meta + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Meta"/>. </summary> + public FhirR4Meta() + { + Profile = new ChangeTrackingList<string>(); + Security = new ChangeTrackingList<FhirR4Coding>(); + Tag = new ChangeTrackingList<FhirR4Coding>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Meta"/>. </summary> + /// <param name="versionId"> The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. </param> + /// <param name="lastUpdated"> When the resource last changed - e.g. when the version changed. </param> + /// <param name="source"> A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. </param> + /// <param name="profile"> A list of profiles (references to [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). </param> + /// <param name="security"> Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. </param> + /// <param name="tag"> Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Meta(string versionId, string lastUpdated, string source, IList<string> profile, IList<FhirR4Coding> security, IList<FhirR4Coding> tag, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + VersionId = versionId; + LastUpdated = lastUpdated; + Source = source; + Profile = profile; + Security = security; + Tag = tag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. </summary> + public string VersionId { get; set; } + /// <summary> When the resource last changed - e.g. when the version changed. </summary> + public string LastUpdated { get; set; } + /// <summary> A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. </summary> + public string Source { get; set; } + /// <summary> A list of profiles (references to [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). </summary> + public IList<string> Profile { get; } + /// <summary> Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. </summary> + public IList<FhirR4Coding> Security { get; } + /// <summary> Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. </summary> + public IList<FhirR4Coding> Tag { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Period.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Period.Serialization.cs new file mode 100644 index 0000000000000..552ff2fe96e09 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Period.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Period : IUtf8JsonSerializable, IJsonModel<FhirR4Period> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Period>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Period>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start); + } + if (Optional.IsDefined(End)) + { + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Period IJsonModel<FhirR4Period>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Period(document.RootElement, options); + } + + internal static FhirR4Period DeserializeFhirR4Period(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> start = default; + Optional<string> end = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + start = property.Value.GetString(); + continue; + } + if (property.NameEquals("end"u8)) + { + end = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Period(id.Value, Optional.ToList(extension), serializedAdditionalRawData, start.Value, end.Value); + } + + BinaryData IPersistableModel<FhirR4Period>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{options.Format}' format."); + } + } + + FhirR4Period IPersistableModel<FhirR4Period>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Period(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Period>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Period FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Period(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Period.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Period.cs new file mode 100644 index 0000000000000..508fe22a2ab0b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Period.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// A time period defined by a start and end date and optionally time + /// Based on [FHIR Period](https://www.hl7.org/fhir/R4/datatypes.html#Period) + /// </summary> + public partial class FhirR4Period : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Period"/>. </summary> + public FhirR4Period() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Period"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> + internal FhirR4Period(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string start, string end) : base(id, extension, serializedAdditionalRawData) + { + Start = start; + End = end; + } + + /// <summary> Starting time with inclusive boundary. </summary> + public string Start { get; set; } + /// <summary> End time with inclusive boundary, if not ongoing. </summary> + public string End { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Quantity.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Quantity.Serialization.cs new file mode 100644 index 0000000000000..37fcac77400d3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Quantity.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Quantity : IUtf8JsonSerializable, IJsonModel<FhirR4Quantity> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Quantity>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Quantity>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.Value); + } + if (Optional.IsDefined(Comparator)) + { + writer.WritePropertyName("comparator"u8); + writer.WriteStringValue(Comparator); + } + if (Optional.IsDefined(Unit)) + { + writer.WritePropertyName("unit"u8); + writer.WriteStringValue(Unit); + } + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Quantity IJsonModel<FhirR4Quantity>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Quantity(document.RootElement, options); + } + + internal static FhirR4Quantity DeserializeFhirR4Quantity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<double> value = default; + Optional<string> comparator = default; + Optional<string> unit = default; + Optional<string> system = default; + Optional<string> code = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("comparator"u8)) + { + comparator = property.Value.GetString(); + continue; + } + if (property.NameEquals("unit"u8)) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Quantity(id.Value, Optional.ToList(extension), serializedAdditionalRawData, Optional.ToNullable(value), comparator.Value, unit.Value, system.Value, code.Value); + } + + BinaryData IPersistableModel<FhirR4Quantity>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{options.Format}' format."); + } + } + + FhirR4Quantity IPersistableModel<FhirR4Quantity>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Quantity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Quantity>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Quantity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Quantity(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Quantity.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Quantity.cs new file mode 100644 index 0000000000000..ce8743b36f2ca --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Quantity.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// A measured or measurable amount + /// Based on [FHIR Quantity](https://www.hl7.org/fhir/R4/datatypes.html#Quantity) + /// </summary> + public partial class FhirR4Quantity : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Quantity"/>. </summary> + public FhirR4Quantity() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Quantity"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="value"> Numerical value (with implicit precision). </param> + /// <param name="comparator"> < | <= | >= | > - how to understand the value. </param> + /// <param name="unit"> Unit representation. </param> + /// <param name="system"> System that defines coded unit form. </param> + /// <param name="code"> Coded form of the unit. </param> + internal FhirR4Quantity(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, double? value, string comparator, string unit, string system, string code) : base(id, extension, serializedAdditionalRawData) + { + Value = value; + Comparator = comparator; + Unit = unit; + System = system; + Code = code; + } + + /// <summary> Numerical value (with implicit precision). </summary> + public double? Value { get; set; } + /// <summary> < | <= | >= | > - how to understand the value. </summary> + public string Comparator { get; set; } + /// <summary> Unit representation. </summary> + public string Unit { get; set; } + /// <summary> System that defines coded unit form. </summary> + public string System { get; set; } + /// <summary> Coded form of the unit. </summary> + public string Code { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Range.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Range.Serialization.cs new file mode 100644 index 0000000000000..7f55c0acf714d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Range.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Range : IUtf8JsonSerializable, IJsonModel<FhirR4Range> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Range>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Range>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Low)) + { + writer.WritePropertyName("low"u8); + writer.WriteObjectValue(Low); + } + if (Optional.IsDefined(High)) + { + writer.WritePropertyName("high"u8); + writer.WriteObjectValue(High); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Range IJsonModel<FhirR4Range>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Range(document.RootElement, options); + } + + internal static FhirR4Range DeserializeFhirR4Range(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Quantity> low = default; + Optional<FhirR4Quantity> high = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("low"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + low = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("high"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + high = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Range(id.Value, Optional.ToList(extension), serializedAdditionalRawData, low.Value, high.Value); + } + + BinaryData IPersistableModel<FhirR4Range>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{options.Format}' format."); + } + } + + FhirR4Range IPersistableModel<FhirR4Range>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Range(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Range>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Range FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Range(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Range.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Range.cs new file mode 100644 index 0000000000000..ea57853a42237 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Range.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// A set of ordered Quantities defined by a low and high limit + /// Based on [FHIR Range](https://www.hl7.org/fhir/R4/datatypes.html#Range) + /// </summary> + public partial class FhirR4Range : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Range"/>. </summary> + public FhirR4Range() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Range"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="low"> Low limit. </param> + /// <param name="high"> High limit. </param> + internal FhirR4Range(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity low, FhirR4Quantity high) : base(id, extension, serializedAdditionalRawData) + { + Low = low; + High = high; + } + + /// <summary> Low limit. </summary> + public FhirR4Quantity Low { get; set; } + /// <summary> High limit. </summary> + public FhirR4Quantity High { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Ratio.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Ratio.Serialization.cs new file mode 100644 index 0000000000000..2d297a997f700 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Ratio.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Ratio : IUtf8JsonSerializable, IJsonModel<FhirR4Ratio> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Ratio>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Ratio>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Numerator)) + { + writer.WritePropertyName("numerator"u8); + writer.WriteObjectValue(Numerator); + } + if (Optional.IsDefined(Denominator)) + { + writer.WritePropertyName("denominator"u8); + writer.WriteObjectValue(Denominator); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Ratio IJsonModel<FhirR4Ratio>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Ratio(document.RootElement, options); + } + + internal static FhirR4Ratio DeserializeFhirR4Ratio(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Quantity> numerator = default; + Optional<FhirR4Quantity> denominator = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numerator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numerator = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("denominator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + denominator = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Ratio(id.Value, Optional.ToList(extension), serializedAdditionalRawData, numerator.Value, denominator.Value); + } + + BinaryData IPersistableModel<FhirR4Ratio>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{options.Format}' format."); + } + } + + FhirR4Ratio IPersistableModel<FhirR4Ratio>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Ratio(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Ratio>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Ratio FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Ratio(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Ratio.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Ratio.cs new file mode 100644 index 0000000000000..894665385fdfb --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Ratio.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// A ratio of two Quantity values - a numerator and a denominator + /// Based on [FHIR Ratio](https://www.hl7.org/fhir/R4/datatypes.html#Ratio) + /// </summary> + public partial class FhirR4Ratio : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Ratio"/>. </summary> + public FhirR4Ratio() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Ratio"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="numerator"> Numerator value. </param> + /// <param name="denominator"> Denominator value. </param> + internal FhirR4Ratio(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity numerator, FhirR4Quantity denominator) : base(id, extension, serializedAdditionalRawData) + { + Numerator = numerator; + Denominator = denominator; + } + + /// <summary> Numerator value. </summary> + public FhirR4Quantity Numerator { get; set; } + /// <summary> Denominator value. </summary> + public FhirR4Quantity Denominator { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Reference.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Reference.Serialization.cs new file mode 100644 index 0000000000000..85ea46dccfa3c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Reference.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Reference : IUtf8JsonSerializable, IJsonModel<FhirR4Reference> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Reference>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Reference>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Reference)) + { + writer.WritePropertyName("reference"u8); + writer.WriteStringValue(Reference); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (Optional.IsDefined(Identifier)) + { + writer.WritePropertyName("identifier"u8); + writer.WriteObjectValue(Identifier); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Reference IJsonModel<FhirR4Reference>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Reference(document.RootElement, options); + } + + internal static FhirR4Reference DeserializeFhirR4Reference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> reference = default; + Optional<string> type = default; + Optional<FhirR4Identifier> identifier = default; + Optional<string> display = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reference"u8)) + { + reference = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("identifier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identifier = FhirR4Identifier.DeserializeFhirR4Identifier(property.Value); + continue; + } + if (property.NameEquals("display"u8)) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Reference(id.Value, Optional.ToList(extension), serializedAdditionalRawData, reference.Value, type.Value, identifier.Value, display.Value); + } + + BinaryData IPersistableModel<FhirR4Reference>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{options.Format}' format."); + } + } + + FhirR4Reference IPersistableModel<FhirR4Reference>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Reference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Reference>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Reference FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Reference(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Reference.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Reference.cs new file mode 100644 index 0000000000000..61843fd6a5e18 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Reference.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// A reference from one resource to another + /// Based on [FHIR Reference](https://www.hl7.org/fhir/R4/references.html) + /// </summary> + public partial class FhirR4Reference : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Reference"/>. </summary> + public FhirR4Reference() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Reference"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="reference"> Literal reference, Relative, internal or absolute URL. </param> + /// <param name="type"> Type the reference refers to (e.g. "Patient"). </param> + /// <param name="identifier"> Logical reference, when literal reference is not known. </param> + /// <param name="display"> Text alternative for the resource. </param> + internal FhirR4Reference(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string reference, string type, FhirR4Identifier identifier, string display) : base(id, extension, serializedAdditionalRawData) + { + Reference = reference; + Type = type; + Identifier = identifier; + Display = display; + } + + /// <summary> Literal reference, Relative, internal or absolute URL. </summary> + public string Reference { get; set; } + /// <summary> Type the reference refers to (e.g. "Patient"). </summary> + public string Type { get; set; } + /// <summary> Logical reference, when literal reference is not known. </summary> + public FhirR4Identifier Identifier { get; set; } + /// <summary> Text alternative for the resource. </summary> + public string Display { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Resource.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Resource.Serialization.cs new file mode 100644 index 0000000000000..6005a5f0c3966 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Resource.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4Resource : IUtf8JsonSerializable, IJsonModel<FhirR4Resource> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Resource>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Resource>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4Resource IJsonModel<FhirR4Resource>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Resource(document.RootElement, options); + } + + internal static FhirR4Resource DeserializeFhirR4Resource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceType = default; + Optional<string> id = default; + Optional<FhirR4Meta> meta = default; + Optional<string> implicitRules = default; + Optional<string> language = default; + IDictionary<string, BinaryData> additionalProperties = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("meta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + meta = FhirR4Meta.DeserializeFhirR4Meta(property.Value); + continue; + } + if (property.NameEquals("implicitRules"u8)) + { + implicitRules = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new FhirR4Resource(resourceType, id.Value, meta.Value, implicitRules.Value, language.Value, additionalProperties); + } + + BinaryData IPersistableModel<FhirR4Resource>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{options.Format}' format."); + } + } + + FhirR4Resource IPersistableModel<FhirR4Resource>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Resource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Resource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Resource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Resource(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Resource.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Resource.cs new file mode 100644 index 0000000000000..33ce26a2f9ded --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4Resource.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// Resource is the ancestor of DomainResource from which most resources are derived. Bundle, Parameters, and Binary extend Resource directly. + /// Based on [FHIR Resource](https://www.hl7.org/fhir/r4/resource.html + /// </summary> + public partial class FhirR4Resource + { + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <exception cref="ArgumentNullException"> <paramref name="resourceType"/> is null. </exception> + public FhirR4Resource(string resourceType) + { + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + ResourceType = resourceType; + AdditionalProperties = new ChangeTrackingDictionary<string, BinaryData>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + internal FhirR4Resource(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties) + { + ResourceType = resourceType; + Id = id; + Meta = meta; + ImplicitRules = implicitRules; + Language = language; + AdditionalProperties = additionalProperties; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/> for deserialization. </summary> + internal FhirR4Resource() + { + } + + /// <summary> The type of resource. </summary> + public string ResourceType { get; set; } + /// <summary> Resource Id. </summary> + public string Id { get; set; } + /// <summary> Metadata about the resource. </summary> + public FhirR4Meta Meta { get; set; } + /// <summary> A set of rules under which this content was created. </summary> + public string ImplicitRules { get; set; } + /// <summary> Language of the resource content. </summary> + public string Language { get; set; } + /// <summary> + /// Additional Properties + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + public IDictionary<string, BinaryData> AdditionalProperties { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4SampledData.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4SampledData.Serialization.cs new file mode 100644 index 0000000000000..7482b237325ce --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4SampledData.Serialization.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class FhirR4SampledData : IUtf8JsonSerializable, IJsonModel<FhirR4SampledData> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4SampledData>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4SampledData>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("origin"u8); + writer.WriteObjectValue(Origin); + writer.WritePropertyName("period"u8); + writer.WriteNumberValue(Period); + if (Optional.IsDefined(Factor)) + { + writer.WritePropertyName("factor"u8); + writer.WriteNumberValue(Factor.Value); + } + if (Optional.IsDefined(LowerLimit)) + { + writer.WritePropertyName("lowerLimit"u8); + writer.WriteNumberValue(LowerLimit.Value); + } + if (Optional.IsDefined(UpperLimit)) + { + writer.WritePropertyName("upperLimit"u8); + writer.WriteNumberValue(UpperLimit.Value); + } + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions); + if (Optional.IsDefined(Data)) + { + writer.WritePropertyName("data"u8); + writer.WriteStringValue(Data); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4SampledData IJsonModel<FhirR4SampledData>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4SampledData(document.RootElement, options); + } + + internal static FhirR4SampledData DeserializeFhirR4SampledData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FhirR4Quantity origin = default; + double period = default; + Optional<double> factor = default; + Optional<double> lowerLimit = default; + Optional<double> upperLimit = default; + int dimensions = default; + Optional<string> data = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("origin"u8)) + { + origin = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("period"u8)) + { + period = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("factor"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + factor = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("lowerLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lowerLimit = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("upperLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upperLimit = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("data"u8)) + { + data = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4SampledData(id.Value, Optional.ToList(extension), serializedAdditionalRawData, origin, period, Optional.ToNullable(factor), Optional.ToNullable(lowerLimit), Optional.ToNullable(upperLimit), dimensions, data.Value); + } + + BinaryData IPersistableModel<FhirR4SampledData>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{options.Format}' format."); + } + } + + FhirR4SampledData IPersistableModel<FhirR4SampledData>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4SampledData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4SampledData>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4SampledData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4SampledData(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4SampledData.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4SampledData.cs new file mode 100644 index 0000000000000..2d8e9dd3bc631 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/FhirR4SampledData.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> + /// A series of measurements taken by a device + /// Based on [FHIR SampledData](https://www.hl7.org/fhir/R4/datatypes.html#SampledData) + /// </summary> + public partial class FhirR4SampledData : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/>. </summary> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <exception cref="ArgumentNullException"> <paramref name="origin"/> is null. </exception> + public FhirR4SampledData(FhirR4Quantity origin, double period, int dimensions) + { + Argument.AssertNotNull(origin, nameof(origin)); + + Origin = origin; + Period = period; + Dimensions = dimensions; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="factor"> Multiply data by this before adding to origin. </param> + /// <param name="lowerLimit"> Lower limit of detection. </param> + /// <param name="upperLimit"> Upper limit of detection. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <param name="data"> Decimal values with spaces, or "E" | "U" | "L". </param> + internal FhirR4SampledData(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity origin, double period, double? factor, double? lowerLimit, double? upperLimit, int dimensions, string data) : base(id, extension, serializedAdditionalRawData) + { + Origin = origin; + Period = period; + Factor = factor; + LowerLimit = lowerLimit; + UpperLimit = upperLimit; + Dimensions = dimensions; + Data = data; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/> for deserialization. </summary> + internal FhirR4SampledData() + { + } + + /// <summary> Zero value and units. </summary> + public FhirR4Quantity Origin { get; set; } + /// <summary> Number of milliseconds between samples. </summary> + public double Period { get; set; } + /// <summary> Multiply data by this before adding to origin. </summary> + public double? Factor { get; set; } + /// <summary> Lower limit of detection. </summary> + public double? LowerLimit { get; set; } + /// <summary> Upper limit of detection. </summary> + public double? UpperLimit { get; set; } + /// <summary> Number of sample points at each time point. </summary> + public int Dimensions { get; set; } + /// <summary> Decimal values with spaces, or "E" | "U" | "L". </summary> + public string Data { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/HealthInsightsPatientTimelineClientBuilderExtensions.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/HealthInsightsPatientTimelineClientBuilderExtensions.cs new file mode 100644 index 0000000000000..c2219ae42cf7e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/HealthInsightsPatientTimelineClientBuilderExtensions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using Azure; +using Azure.Core.Extensions; +using Azure.Health.Insights.PatientTimeline; + +namespace Microsoft.Extensions.Azure +{ + /// <summary> Extension methods to add <see cref="PatientTimelineClient"/> to client builder. </summary> + public static partial class HealthInsightsPatientTimelineClientBuilderExtensions + { + /// <summary> Registers a <see cref="PatientTimelineClient"/> instance. </summary> + /// <param name="builder"> The builder to register with. </param> + /// <param name="endpoint"> Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). </param> + /// <param name="credential"> A credential used to authenticate to an Azure Service. </param> + public static IAzureClientBuilder<PatientTimelineClient, PatientTimelineClientOptions> AddPatientTimelineClient<TBuilder>(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory<PatientTimelineClient, PatientTimelineClientOptions>((options) => new PatientTimelineClient(endpoint, credential, options)); + } + + /// <summary> Registers a <see cref="PatientTimelineClient"/> instance. </summary> + /// <param name="builder"> The builder to register with. </param> + /// <param name="configuration"> The configuration values. </param> + public static IAzureClientBuilder<PatientTimelineClient, PatientTimelineClientOptions> AddPatientTimelineClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration> + { + return builder.RegisterClientFactory<PatientTimelineClient, PatientTimelineClientOptions>(configuration); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/HealthInsightsPatientTimelineModelFactory.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/HealthInsightsPatientTimelineModelFactory.cs new file mode 100644 index 0000000000000..57ed7eb795e00 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/HealthInsightsPatientTimelineModelFactory.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Model factory for models. </summary> + public static partial class HealthInsightsPatientTimelineModelFactory + { + /// <summary> Initializes a new instance of <see cref="PatientTimeline.PatientRecord"/>. </summary> + /// <param name="id"> A given identifier for the patient. Has to be unique across all patients in a single request. </param> + /// <param name="info"> Patient structured information, including demographics and known structured clinical information. </param> + /// <param name="encounters"> Patient encounters/visits. </param> + /// <param name="patientDocuments"> Patient unstructured clinical data, given as documents. </param> + /// <returns> A new <see cref="PatientTimeline.PatientRecord"/> instance for mocking. </returns> + public static PatientRecord PatientRecord(string id = null, PatientDetails info = null, IEnumerable<Encounter> encounters = null, IEnumerable<PatientDocument> patientDocuments = null) + { + encounters ??= new List<Encounter>(); + patientDocuments ??= new List<PatientDocument>(); + + return new PatientRecord(id, info, encounters?.ToList(), patientDocuments?.ToList(), serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Element"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Element"/> instance for mocking. </returns> + public static FhirR4Element FhirR4Element(string id = null, IEnumerable<FhirR4Extension> extension = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Element(id, extension?.ToList(), serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Extension"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <param name="valueQuantity"> Value as Quantity. </param> + /// <param name="valueCodeableConcept"> Value as CodeableConcept. </param> + /// <param name="valueString"> Value as string. </param> + /// <param name="valueBoolean"> Value as boolean. </param> + /// <param name="valueInteger"> Value as integer. </param> + /// <param name="valueRange"> Value as Range. </param> + /// <param name="valueRatio"> Value as Ratio. </param> + /// <param name="valueSampledData"> Value as SampledData. </param> + /// <param name="valueTime"> Value as time (hh:mm:ss). </param> + /// <param name="valueDateTime"> Value as dateTime. </param> + /// <param name="valuePeriod"> Value as Period. </param> + /// <param name="valueReference"> Value as reference. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Extension"/> instance for mocking. </returns> + public static FhirR4Extension FhirR4Extension(string id = null, IEnumerable<FhirR4Extension> extension = null, string url = null, FhirR4Quantity valueQuantity = null, FhirR4CodeableConcept valueCodeableConcept = null, string valueString = null, bool? valueBoolean = null, int? valueInteger = null, FhirR4Range valueRange = null, FhirR4Ratio valueRatio = null, FhirR4SampledData valueSampledData = null, TimeSpan? valueTime = null, string valueDateTime = null, FhirR4Period valuePeriod = null, FhirR4Reference valueReference = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Extension(id, extension?.ToList(), serializedAdditionalRawData: null, url, valueQuantity, valueCodeableConcept, valueString, valueBoolean, valueInteger, valueRange, valueRatio, valueSampledData, valueTime, valueDateTime, valuePeriod, valueReference); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Quantity"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="value"> Numerical value (with implicit precision). </param> + /// <param name="comparator"> < | <= | >= | > - how to understand the value. </param> + /// <param name="unit"> Unit representation. </param> + /// <param name="system"> System that defines coded unit form. </param> + /// <param name="code"> Coded form of the unit. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Quantity"/> instance for mocking. </returns> + public static FhirR4Quantity FhirR4Quantity(string id = null, IEnumerable<FhirR4Extension> extension = null, double? value = null, string comparator = null, string unit = null, string system = null, string code = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Quantity(id, extension?.ToList(), serializedAdditionalRawData: null, value, comparator, unit, system, code); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4CodeableConcept"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="coding"> Code defined by a terminology system. </param> + /// <param name="text"> Plain text representation of the concept. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4CodeableConcept"/> instance for mocking. </returns> + public static FhirR4CodeableConcept FhirR4CodeableConcept(string id = null, IEnumerable<FhirR4Extension> extension = null, IEnumerable<FhirR4Coding> coding = null, string text = null) + { + extension ??= new List<FhirR4Extension>(); + coding ??= new List<FhirR4Coding>(); + + return new FhirR4CodeableConcept(id, extension?.ToList(), serializedAdditionalRawData: null, coding?.ToList(), text); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Coding"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="system"> Identity of the terminology system. </param> + /// <param name="version"> Version of the system - if relevant. </param> + /// <param name="code"> Symbol in syntax defined by the system. </param> + /// <param name="display"> Representation defined by the system. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Coding"/> instance for mocking. </returns> + public static FhirR4Coding FhirR4Coding(string id = null, IEnumerable<FhirR4Extension> extension = null, string system = null, string version = null, string code = null, string display = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Coding(id, extension?.ToList(), serializedAdditionalRawData: null, system, version, code, display); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Range"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="low"> Low limit. </param> + /// <param name="high"> High limit. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Range"/> instance for mocking. </returns> + public static FhirR4Range FhirR4Range(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity low = null, FhirR4Quantity high = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Range(id, extension?.ToList(), serializedAdditionalRawData: null, low, high); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Ratio"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="numerator"> Numerator value. </param> + /// <param name="denominator"> Denominator value. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Ratio"/> instance for mocking. </returns> + public static FhirR4Ratio FhirR4Ratio(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity numerator = null, FhirR4Quantity denominator = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Ratio(id, extension?.ToList(), serializedAdditionalRawData: null, numerator, denominator); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4SampledData"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="factor"> Multiply data by this before adding to origin. </param> + /// <param name="lowerLimit"> Lower limit of detection. </param> + /// <param name="upperLimit"> Upper limit of detection. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <param name="data"> Decimal values with spaces, or "E" | "U" | "L". </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4SampledData"/> instance for mocking. </returns> + public static FhirR4SampledData FhirR4SampledData(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity origin = null, double period = default, double? factor = null, double? lowerLimit = null, double? upperLimit = null, int dimensions = default, string data = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4SampledData(id, extension?.ToList(), serializedAdditionalRawData: null, origin, period, factor, lowerLimit, upperLimit, dimensions, data); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Period"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Period"/> instance for mocking. </returns> + public static FhirR4Period FhirR4Period(string id = null, IEnumerable<FhirR4Extension> extension = null, string start = null, string end = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Period(id, extension?.ToList(), serializedAdditionalRawData: null, start, end); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Reference"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="reference"> Literal reference, Relative, internal or absolute URL. </param> + /// <param name="type"> Type the reference refers to (e.g. "Patient"). </param> + /// <param name="identifier"> Logical reference, when literal reference is not known. </param> + /// <param name="display"> Text alternative for the resource. </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Reference"/> instance for mocking. </returns> + public static FhirR4Reference FhirR4Reference(string id = null, IEnumerable<FhirR4Extension> extension = null, string reference = null, string type = null, FhirR4Identifier identifier = null, string display = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Reference(id, extension?.ToList(), serializedAdditionalRawData: null, reference, type, identifier, display); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.FhirR4Identifier"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="use"> usual | official | temp | secondary | old (If known). </param> + /// <param name="type"> Description of identifier. </param> + /// <param name="system"> The namespace for the identifier value. </param> + /// <param name="value"> The value that is unique. </param> + /// <param name="period"> Time period when id is/was valid for use. </param> + /// <param name="assigner"> Organization that issued id (may be just text). </param> + /// <returns> A new <see cref="PatientTimeline.FhirR4Identifier"/> instance for mocking. </returns> + public static FhirR4Identifier FhirR4Identifier(string id = null, IEnumerable<FhirR4Extension> extension = null, string use = null, FhirR4CodeableConcept type = null, string system = null, string value = null, FhirR4Period period = null, FhirR4Reference assigner = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Identifier(id, extension?.ToList(), serializedAdditionalRawData: null, use, type, system, value, period, assigner); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <param name="period"> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </param> + /// <param name="class"> The class of the encounter. </param> + /// <returns> A new <see cref="PatientTimeline.Encounter"/> instance for mocking. </returns> + public static Encounter Encounter(string id = null, TimePeriod period = null, EncounterClass? @class = null) + { + return new Encounter(id, period, @class, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.PatientDocument"/>. </summary> + /// <param name="type"> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </param> + /// <param name="clinicalType"> The type of the clinical document. </param> + /// <param name="id"> A given identifier for the document. Has to be unique across all documents for a single patient. </param> + /// <param name="language"> A 2 letter ISO 639-1 representation of the language of the document. </param> + /// <param name="createdDateTime"> The date and time when the document was created. </param> + /// <param name="authors"> Document author(s). </param> + /// <param name="specialtyType"> specialty type the document. </param> + /// <param name="administrativeMetadata"> Administrative metadata for the document. </param> + /// <param name="content"> The content of the patient document. </param> + /// <returns> A new <see cref="PatientTimeline.PatientDocument"/> instance for mocking. </returns> + public static PatientDocument PatientDocument(DocumentType type = default, ClinicalDocumentType? clinicalType = null, string id = null, string language = null, DateTimeOffset? createdDateTime = null, IEnumerable<DocumentAuthor> authors = null, SpecialtyType? specialtyType = null, DocumentAdministrativeMetadata administrativeMetadata = null, DocumentContent content = null) + { + authors ??= new List<DocumentAuthor>(); + + return new PatientDocument(type, clinicalType, id, language, createdDateTime, authors?.ToList(), specialtyType, administrativeMetadata, content, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.PatientTimelineInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> + /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> + /// <returns> A new <see cref="PatientTimeline.PatientTimelineInferenceResult"/> instance for mocking. </returns> + public static PatientTimelineInferenceResult PatientTimelineInferenceResult(IEnumerable<PatientTimelinePatientResult> patientResults = null, string modelVersion = null) + { + patientResults ??= new List<PatientTimelinePatientResult>(); + + return new PatientTimelineInferenceResult(patientResults?.ToList(), modelVersion, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimeline.PatientTimelinePatientResult"/>. </summary> + /// <param name="patientId"> The identifier given for the patient in the request. </param> + /// <param name="inferences"> The model's inferences for the given patient. </param> + /// <returns> A new <see cref="PatientTimeline.PatientTimelinePatientResult"/> instance for mocking. </returns> + public static PatientTimelinePatientResult PatientTimelinePatientResult(string patientId = null, IEnumerable<FhirR4Extendible> inferences = null) + { + inferences ??= new List<FhirR4Extendible>(); + + return new PatientTimelinePatientResult(patientId, inferences?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDetails.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDetails.Serialization.cs new file mode 100644 index 0000000000000..bca1afade9701 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDetails.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class PatientDetails : IUtf8JsonSerializable, IJsonModel<PatientDetails> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientDetails>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Sex)) + { + writer.WritePropertyName("sex"u8); + writer.WriteStringValue(Sex.Value.ToString()); + } + if (Optional.IsDefined(BirthDate)) + { + writer.WritePropertyName("birthDate"u8); + writer.WriteStringValue(BirthDate.Value, "D"); + } + if (Optional.IsCollectionDefined(ClinicalInfo)) + { + writer.WritePropertyName("clinicalInfo"u8); + writer.WriteStartArray(); + foreach (var item in ClinicalInfo) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientDetails IJsonModel<PatientDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientDetails(document.RootElement, options); + } + + internal static PatientDetails DeserializePatientDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<PatientSex> sex = default; + Optional<DateTimeOffset> birthDate = default; + Optional<IList<FhirR4Resource>> clinicalInfo = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sex = new PatientSex(property.Value.GetString()); + continue; + } + if (property.NameEquals("birthDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + birthDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("clinicalInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Resource> array = new List<FhirR4Resource>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Resource.DeserializeFhirR4Resource(item)); + } + clinicalInfo = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientDetails(Optional.ToNullable(sex), Optional.ToNullable(birthDate), Optional.ToList(clinicalInfo), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientDetails>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{options.Format}' format."); + } + } + + PatientDetails IPersistableModel<PatientDetails>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientDetails>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientDetails(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDetails.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDetails.cs new file mode 100644 index 0000000000000..caf02c8e01f91 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDetails.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Patient structured information, including demographics and known structured clinical information. </summary> + public partial class PatientDetails + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientDetails"/>. </summary> + public PatientDetails() + { + ClinicalInfo = new ChangeTrackingList<FhirR4Resource>(); + } + + /// <summary> Initializes a new instance of <see cref="PatientDetails"/>. </summary> + /// <param name="sex"> The patient's sex. </param> + /// <param name="birthDate"> The patient's date of birth. </param> + /// <param name="clinicalInfo"> Known clinical information for the patient, structured. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientDetails(PatientSex? sex, DateTimeOffset? birthDate, IList<FhirR4Resource> clinicalInfo, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Sex = sex; + BirthDate = birthDate; + ClinicalInfo = clinicalInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> The patient's sex. </summary> + public PatientSex? Sex { get; set; } + /// <summary> The patient's date of birth. </summary> + public DateTimeOffset? BirthDate { get; set; } + /// <summary> Known clinical information for the patient, structured. </summary> + public IList<FhirR4Resource> ClinicalInfo { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDocument.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDocument.Serialization.cs new file mode 100644 index 0000000000000..c8d97ebf96d76 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDocument.Serialization.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class PatientDocument : IUtf8JsonSerializable, IJsonModel<PatientDocument> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientDocument>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientDocument>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDocument>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientDocument)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(ClinicalType)) + { + writer.WritePropertyName("clinicalType"u8); + writer.WriteStringValue(ClinicalType.Value.ToString()); + } + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(CreatedDateTime)) + { + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime.Value, "O"); + } + if (Optional.IsCollectionDefined(Authors)) + { + writer.WritePropertyName("authors"u8); + writer.WriteStartArray(); + foreach (var item in Authors) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SpecialtyType)) + { + writer.WritePropertyName("specialtyType"u8); + writer.WriteStringValue(SpecialtyType.Value.ToString()); + } + if (Optional.IsDefined(AdministrativeMetadata)) + { + writer.WritePropertyName("administrativeMetadata"u8); + writer.WriteObjectValue(AdministrativeMetadata); + } + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientDocument IJsonModel<PatientDocument>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDocument>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientDocument)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientDocument(document.RootElement, options); + } + + internal static PatientDocument DeserializePatientDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentType type = default; + Optional<ClinicalDocumentType> clinicalType = default; + string id = default; + Optional<string> language = default; + Optional<DateTimeOffset> createdDateTime = default; + Optional<IList<DocumentAuthor>> authors = default; + Optional<SpecialtyType> specialtyType = default; + Optional<DocumentAdministrativeMetadata> administrativeMetadata = default; + DocumentContent content = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new DocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("clinicalType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clinicalType = new ClinicalDocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("authors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<DocumentAuthor> array = new List<DocumentAuthor>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentAuthor.DeserializeDocumentAuthor(item)); + } + authors = array; + continue; + } + if (property.NameEquals("specialtyType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + specialtyType = new SpecialtyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeMetadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeMetadata = DocumentAdministrativeMetadata.DeserializeDocumentAdministrativeMetadata(property.Value); + continue; + } + if (property.NameEquals("content"u8)) + { + content = DocumentContent.DeserializeDocumentContent(property.Value); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientDocument(type, Optional.ToNullable(clinicalType), id, language.Value, Optional.ToNullable(createdDateTime), Optional.ToList(authors), Optional.ToNullable(specialtyType), administrativeMetadata.Value, content, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientDocument>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDocument>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientDocument)} does not support '{options.Format}' format."); + } + } + + PatientDocument IPersistableModel<PatientDocument>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDocument>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientDocument)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientDocument>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientDocument(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDocument.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDocument.cs new file mode 100644 index 0000000000000..b8185d4111c17 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientDocument.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> A clinical document related to a patient. Document here is in the wide sense - not just a text document (note). </summary> + public partial class PatientDocument + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientDocument"/>. </summary> + /// <param name="type"> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </param> + /// <param name="id"> A given identifier for the document. Has to be unique across all documents for a single patient. </param> + /// <param name="content"> The content of the patient document. </param> + /// <exception cref="ArgumentNullException"> <paramref name="id"/> or <paramref name="content"/> is null. </exception> + public PatientDocument(DocumentType type, string id, DocumentContent content) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(content, nameof(content)); + + Type = type; + Id = id; + Authors = new ChangeTrackingList<DocumentAuthor>(); + Content = content; + } + + /// <summary> Initializes a new instance of <see cref="PatientDocument"/>. </summary> + /// <param name="type"> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </param> + /// <param name="clinicalType"> The type of the clinical document. </param> + /// <param name="id"> A given identifier for the document. Has to be unique across all documents for a single patient. </param> + /// <param name="language"> A 2 letter ISO 639-1 representation of the language of the document. </param> + /// <param name="createdDateTime"> The date and time when the document was created. </param> + /// <param name="authors"> Document author(s). </param> + /// <param name="specialtyType"> specialty type the document. </param> + /// <param name="administrativeMetadata"> Administrative metadata for the document. </param> + /// <param name="content"> The content of the patient document. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientDocument(DocumentType type, ClinicalDocumentType? clinicalType, string id, string language, DateTimeOffset? createdDateTime, IList<DocumentAuthor> authors, SpecialtyType? specialtyType, DocumentAdministrativeMetadata administrativeMetadata, DocumentContent content, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Type = type; + ClinicalType = clinicalType; + Id = id; + Language = language; + CreatedDateTime = createdDateTime; + Authors = authors; + SpecialtyType = specialtyType; + AdministrativeMetadata = administrativeMetadata; + Content = content; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="PatientDocument"/> for deserialization. </summary> + internal PatientDocument() + { + } + + /// <summary> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </summary> + public DocumentType Type { get; } + /// <summary> The type of the clinical document. </summary> + public ClinicalDocumentType? ClinicalType { get; set; } + /// <summary> A given identifier for the document. Has to be unique across all documents for a single patient. </summary> + public string Id { get; } + /// <summary> A 2 letter ISO 639-1 representation of the language of the document. </summary> + public string Language { get; set; } + /// <summary> The date and time when the document was created. </summary> + public DateTimeOffset? CreatedDateTime { get; set; } + /// <summary> Document author(s). </summary> + public IList<DocumentAuthor> Authors { get; } + /// <summary> specialty type the document. </summary> + public SpecialtyType? SpecialtyType { get; set; } + /// <summary> Administrative metadata for the document. </summary> + public DocumentAdministrativeMetadata AdministrativeMetadata { get; set; } + /// <summary> The content of the patient document. </summary> + public DocumentContent Content { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientRecord.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientRecord.Serialization.cs new file mode 100644 index 0000000000000..a666ce9b9970d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientRecord.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class PatientRecord : IUtf8JsonSerializable, IJsonModel<PatientRecord> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientRecord>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientRecord>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientRecord>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientRecord)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Info)) + { + writer.WritePropertyName("info"u8); + writer.WriteObjectValue(Info); + } + if (Optional.IsCollectionDefined(Encounters)) + { + writer.WritePropertyName("encounters"u8); + writer.WriteStartArray(); + foreach (var item in Encounters) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PatientDocuments)) + { + writer.WritePropertyName("patientDocuments"u8); + writer.WriteStartArray(); + foreach (var item in PatientDocuments) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientRecord IJsonModel<PatientRecord>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientRecord>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientRecord)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientRecord(document.RootElement, options); + } + + internal static PatientRecord DeserializePatientRecord(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + Optional<PatientDetails> info = default; + Optional<IList<Encounter>> encounters = default; + Optional<IList<PatientDocument>> patientDocuments = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("info"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + info = PatientDetails.DeserializePatientDetails(property.Value); + continue; + } + if (property.NameEquals("encounters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<Encounter> array = new List<Encounter>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Encounter.DeserializeEncounter(item)); + } + encounters = array; + continue; + } + if (property.NameEquals("patientDocuments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<PatientDocument> array = new List<PatientDocument>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PatientDocument.DeserializePatientDocument(item)); + } + patientDocuments = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientRecord(id, info.Value, Optional.ToList(encounters), Optional.ToList(patientDocuments), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientRecord>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientRecord>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientRecord)} does not support '{options.Format}' format."); + } + } + + PatientRecord IPersistableModel<PatientRecord>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientRecord>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientRecord(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientRecord)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientRecord>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientRecord FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientRecord(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientRecord.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientRecord.cs new file mode 100644 index 0000000000000..091c7eb024ba1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientRecord.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> A patient record, including their clinical information and data. </summary> + public partial class PatientRecord + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientRecord"/>. </summary> + /// <param name="id"> A given identifier for the patient. Has to be unique across all patients in a single request. </param> + /// <exception cref="ArgumentNullException"> <paramref name="id"/> is null. </exception> + public PatientRecord(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Encounters = new ChangeTrackingList<Encounter>(); + PatientDocuments = new ChangeTrackingList<PatientDocument>(); + } + + /// <summary> Initializes a new instance of <see cref="PatientRecord"/>. </summary> + /// <param name="id"> A given identifier for the patient. Has to be unique across all patients in a single request. </param> + /// <param name="info"> Patient structured information, including demographics and known structured clinical information. </param> + /// <param name="encounters"> Patient encounters/visits. </param> + /// <param name="patientDocuments"> Patient unstructured clinical data, given as documents. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientRecord(string id, PatientDetails info, IList<Encounter> encounters, IList<PatientDocument> patientDocuments, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + Info = info; + Encounters = encounters; + PatientDocuments = patientDocuments; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="PatientRecord"/> for deserialization. </summary> + internal PatientRecord() + { + } + + /// <summary> A given identifier for the patient. Has to be unique across all patients in a single request. </summary> + public string Id { get; } + /// <summary> Patient structured information, including demographics and known structured clinical information. </summary> + public PatientDetails Info { get; set; } + /// <summary> Patient encounters/visits. </summary> + public IList<Encounter> Encounters { get; } + /// <summary> Patient unstructured clinical data, given as documents. </summary> + public IList<PatientDocument> PatientDocuments { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientSex.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientSex.cs new file mode 100644 index 0000000000000..ef54ab72b79bf --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientSex.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> The patient's sex. </summary> + public readonly partial struct PatientSex : IEquatable<PatientSex> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="PatientSex"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public PatientSex(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FemaleValue = "female"; + private const string MaleValue = "male"; + private const string UnspecifiedValue = "unspecified"; + + /// <summary> female. </summary> + public static PatientSex Female { get; } = new PatientSex(FemaleValue); + /// <summary> male. </summary> + public static PatientSex Male { get; } = new PatientSex(MaleValue); + /// <summary> unspecified. </summary> + public static PatientSex Unspecified { get; } = new PatientSex(UnspecifiedValue); + /// <summary> Determines if two <see cref="PatientSex"/> values are the same. </summary> + public static bool operator ==(PatientSex left, PatientSex right) => left.Equals(right); + /// <summary> Determines if two <see cref="PatientSex"/> values are not the same. </summary> + public static bool operator !=(PatientSex left, PatientSex right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="PatientSex"/>. </summary> + public static implicit operator PatientSex(string value) => new PatientSex(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatientSex other && Equals(other); + /// <inheritdoc /> + public bool Equals(PatientSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineClient.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineClient.cs new file mode 100644 index 0000000000000..3007fcf765135 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineClient.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Health.Insights.PatientTimeline +{ + // Data plane generated client. + /// <summary> The PatientTimeline service client. </summary> + public partial class PatientTimelineClient + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// <summary> The ClientDiagnostics is used to provide tracing support for the client library. </summary> + internal ClientDiagnostics ClientDiagnostics { get; } + + /// <summary> The HTTP pipeline for sending and receiving REST requests and responses. </summary> + public virtual HttpPipeline Pipeline => _pipeline; + + /// <summary> Initializes a new instance of PatientTimelineClient for mocking. </summary> + protected PatientTimelineClient() + { + } + + /// <summary> Initializes a new instance of PatientTimelineClient. </summary> + /// <param name="endpoint"> Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). </param> + /// <param name="credential"> A credential used to authenticate to an Azure Service. </param> + /// <exception cref="ArgumentNullException"> <paramref name="endpoint"/> or <paramref name="credential"/> is null. </exception> + public PatientTimelineClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new PatientTimelineClientOptions()) + { + } + + /// <summary> Initializes a new instance of PatientTimelineClient. </summary> + /// <param name="endpoint"> Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). </param> + /// <param name="credential"> A credential used to authenticate to an Azure Service. </param> + /// <param name="options"> The options for configuring the client. </param> + /// <exception cref="ArgumentNullException"> <paramref name="endpoint"/> or <paramref name="credential"/> is null. </exception> + public PatientTimelineClient(Uri endpoint, AzureKeyCredential credential, PatientTimelineClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new PatientTimelineClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty<HttpPipelinePolicy>(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// <summary> Create Patient Timeline job. </summary> + /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> + /// <param name="patientTimelineData"> The body of the Patient Timeline request. </param> + /// <param name="cancellationToken"> The cancellation token to use. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patientTimelineData"/> is null. </exception> + /// <remarks> Creates a Patient Timeline job with the given request body. </remarks> + /// <include file="Docs/PatientTimelineClient.xml" path="doc/members/member[@name='InferPatientTimelineAsync(WaitUntil,PatientTimelineData,CancellationToken)']/*" /> + public virtual async Task<Operation<PatientTimelineInferenceResult>> InferPatientTimelineAsync(WaitUntil waitUntil, PatientTimelineData patientTimelineData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patientTimelineData, nameof(patientTimelineData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = patientTimelineData.ToRequestContent(); + Operation<BinaryData> response = await InferPatientTimelineAsync(waitUntil, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchPatientTimelineInferenceResultFromPatientTimelineResult, ClientDiagnostics, "PatientTimelineClient.InferPatientTimeline"); + } + + /// <summary> Create Patient Timeline job. </summary> + /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> + /// <param name="patientTimelineData"> The body of the Patient Timeline request. </param> + /// <param name="cancellationToken"> The cancellation token to use. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patientTimelineData"/> is null. </exception> + /// <remarks> Creates a Patient Timeline job with the given request body. </remarks> + /// <include file="Docs/PatientTimelineClient.xml" path="doc/members/member[@name='InferPatientTimeline(WaitUntil,PatientTimelineData,CancellationToken)']/*" /> + public virtual Operation<PatientTimelineInferenceResult> InferPatientTimeline(WaitUntil waitUntil, PatientTimelineData patientTimelineData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patientTimelineData, nameof(patientTimelineData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = patientTimelineData.ToRequestContent(); + Operation<BinaryData> response = InferPatientTimeline(waitUntil, content, context); + return ProtocolOperationHelpers.Convert(response, FetchPatientTimelineInferenceResultFromPatientTimelineResult, ClientDiagnostics, "PatientTimelineClient.InferPatientTimeline"); + } + + /// <summary> + /// [Protocol Method] Create Patient Timeline job + /// <list type="bullet"> + /// <item> + /// <description> + /// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios. + /// </description> + /// </item> + /// <item> + /// <description> + /// Please try the simpler <see cref="InferPatientTimelineAsync(WaitUntil,PatientTimelineData,CancellationToken)"/> convenience overload with strongly typed models first. + /// </description> + /// </item> + /// </list> + /// </summary> + /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> + /// <param name="content"> The content to send as the body of the request. </param> + /// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param> + /// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception> + /// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception> + /// <returns> The <see cref="Operation"/> representing an asynchronous operation on the service. </returns> + /// <include file="Docs/PatientTimelineClient.xml" path="doc/members/member[@name='InferPatientTimelineAsync(WaitUntil,RequestContent,RequestContext)']/*" /> + public virtual async Task<Operation<BinaryData>> InferPatientTimelineAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PatientTimelineClient.InferPatientTimeline"); + scope.Start(); + try + { + using HttpMessage message = CreateInferPatientTimelineRequest(content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "PatientTimelineClient.InferPatientTimeline", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// <summary> + /// [Protocol Method] Create Patient Timeline job + /// <list type="bullet"> + /// <item> + /// <description> + /// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios. + /// </description> + /// </item> + /// <item> + /// <description> + /// Please try the simpler <see cref="InferPatientTimeline(WaitUntil,PatientTimelineData,CancellationToken)"/> convenience overload with strongly typed models first. + /// </description> + /// </item> + /// </list> + /// </summary> + /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> + /// <param name="content"> The content to send as the body of the request. </param> + /// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param> + /// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception> + /// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception> + /// <returns> The <see cref="Operation"/> representing an asynchronous operation on the service. </returns> + /// <include file="Docs/PatientTimelineClient.xml" path="doc/members/member[@name='InferPatientTimeline(WaitUntil,RequestContent,RequestContext)']/*" /> + public virtual Operation<BinaryData> InferPatientTimeline(WaitUntil waitUntil, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("PatientTimelineClient.InferPatientTimeline"); + scope.Start(); + try + { + using HttpMessage message = CreateInferPatientTimelineRequest(content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "PatientTimelineClient.InferPatientTimeline", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateInferPatientTimelineRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/health-insights", false); + uri.AppendPath("/patient-timeline/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + 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 _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + + private PatientTimelineInferenceResult FetchPatientTimelineInferenceResultFromPatientTimelineResult(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return PatientTimelineInferenceResult.DeserializePatientTimelineInferenceResult(resultJsonElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineClientOptions.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineClientOptions.cs new file mode 100644 index 0000000000000..428767e226869 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Client options for PatientTimelineClient. </summary> + public partial class PatientTimelineClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2023_09_01_Preview; + + /// <summary> The version of the service to use. </summary> + public enum ServiceVersion + { + /// <summary> Service version "2023-09-01-preview". </summary> + V2023_09_01_Preview = 1, + } + + internal string Version { get; } + + /// <summary> Initializes new instance of PatientTimelineClientOptions. </summary> + public PatientTimelineClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_09_01_Preview => "2023-09-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineData.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineData.Serialization.cs new file mode 100644 index 0000000000000..e505e0478d1dd --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineData.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class PatientTimelineData : IUtf8JsonSerializable, IJsonModel<PatientTimelineData> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientTimelineData>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientTimelineData>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientTimelineData)} does not support '{format}' format."); + } + + 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); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientTimelineData IJsonModel<PatientTimelineData>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientTimelineData)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientTimelineData(document.RootElement, options); + } + + internal static PatientTimelineData DeserializePatientTimelineData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList<PatientRecord> patients = default; + Optional<PatientTimelineModelConfiguration> configuration = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patients"u8)) + { + List<PatientRecord> array = new List<PatientRecord>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PatientRecord.DeserializePatientRecord(item)); + } + patients = array; + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = PatientTimelineModelConfiguration.DeserializePatientTimelineModelConfiguration(property.Value); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientTimelineData(patients, configuration.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientTimelineData>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientTimelineData)} does not support '{options.Format}' format."); + } + } + + PatientTimelineData IPersistableModel<PatientTimelineData>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientTimelineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientTimelineData)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientTimelineData>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientTimelineData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientTimelineData(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineData.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineData.cs new file mode 100644 index 0000000000000..13395ad697aa0 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineData.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> The body of the Patient Timeline request. </summary> + public partial class PatientTimelineData + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientTimelineData"/>. </summary> + /// <param name="patients"> The list of patients, including their clinical information and data. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patients"/> is null. </exception> + public PatientTimelineData(IEnumerable<PatientRecord> patients) + { + Argument.AssertNotNull(patients, nameof(patients)); + + Patients = patients.ToList(); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimelineData"/>. </summary> + /// <param name="patients"> The list of patients, including their clinical information and data. </param> + /// <param name="configuration"> Configuration affecting the Patient Timeline model's inference. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientTimelineData(IList<PatientRecord> patients, PatientTimelineModelConfiguration configuration, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Patients = patients; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="PatientTimelineData"/> for deserialization. </summary> + internal PatientTimelineData() + { + } + + /// <summary> The list of patients, including their clinical information and data. </summary> + public IList<PatientRecord> Patients { get; } + /// <summary> Configuration affecting the Patient Timeline model's inference. </summary> + public PatientTimelineModelConfiguration Configuration { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineInferenceResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineInferenceResult.Serialization.cs new file mode 100644 index 0000000000000..5c97293c7bf64 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineInferenceResult.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class PatientTimelineInferenceResult : IUtf8JsonSerializable, IJsonModel<PatientTimelineInferenceResult> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientTimelineInferenceResult>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientTimelineInferenceResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineInferenceResult>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientTimelineInferenceResult)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("patientResults"u8); + writer.WriteStartArray(); + foreach (var item in PatientResults) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("modelVersion"u8); + writer.WriteStringValue(ModelVersion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientTimelineInferenceResult IJsonModel<PatientTimelineInferenceResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineInferenceResult>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientTimelineInferenceResult)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientTimelineInferenceResult(document.RootElement, options); + } + + internal static PatientTimelineInferenceResult DeserializePatientTimelineInferenceResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList<PatientTimelinePatientResult> patientResults = default; + string modelVersion = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patientResults"u8)) + { + List<PatientTimelinePatientResult> array = new List<PatientTimelinePatientResult>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PatientTimelinePatientResult.DeserializePatientTimelinePatientResult(item)); + } + patientResults = array; + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientTimelineInferenceResult(patientResults, modelVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientTimelineInferenceResult>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineInferenceResult>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientTimelineInferenceResult)} does not support '{options.Format}' format."); + } + } + + PatientTimelineInferenceResult IPersistableModel<PatientTimelineInferenceResult>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineInferenceResult>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientTimelineInferenceResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientTimelineInferenceResult)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientTimelineInferenceResult>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientTimelineInferenceResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientTimelineInferenceResult(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineInferenceResult.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineInferenceResult.cs new file mode 100644 index 0000000000000..6f9ed4e1b2bf7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineInferenceResult.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> The inference results for the Patient Timeline request. </summary> + public partial class PatientTimelineInferenceResult + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientTimelineInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> + /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patientResults"/> or <paramref name="modelVersion"/> is null. </exception> + internal PatientTimelineInferenceResult(IEnumerable<PatientTimelinePatientResult> patientResults, string modelVersion) + { + Argument.AssertNotNull(patientResults, nameof(patientResults)); + Argument.AssertNotNull(modelVersion, nameof(modelVersion)); + + PatientResults = patientResults.ToList(); + ModelVersion = modelVersion; + } + + /// <summary> Initializes a new instance of <see cref="PatientTimelineInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> + /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientTimelineInferenceResult(IReadOnlyList<PatientTimelinePatientResult> patientResults, string modelVersion, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + PatientResults = patientResults; + ModelVersion = modelVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="PatientTimelineInferenceResult"/> for deserialization. </summary> + internal PatientTimelineInferenceResult() + { + } + + /// <summary> Results for the patients given in the request. </summary> + public IReadOnlyList<PatientTimelinePatientResult> PatientResults { get; } + /// <summary> The version of the model used for inference, expressed as the model date. </summary> + public string ModelVersion { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineModelConfiguration.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineModelConfiguration.Serialization.cs new file mode 100644 index 0000000000000..cc9a2073ea0dd --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineModelConfiguration.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class PatientTimelineModelConfiguration : IUtf8JsonSerializable, IJsonModel<PatientTimelineModelConfiguration> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientTimelineModelConfiguration>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientTimelineModelConfiguration>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineModelConfiguration>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientTimelineModelConfiguration)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Verbose)) + { + writer.WritePropertyName("verbose"u8); + writer.WriteBooleanValue(Verbose.Value); + } + if (Optional.IsDefined(IncludeEvidence)) + { + writer.WritePropertyName("includeEvidence"u8); + writer.WriteBooleanValue(IncludeEvidence.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientTimelineModelConfiguration IJsonModel<PatientTimelineModelConfiguration>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineModelConfiguration>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientTimelineModelConfiguration)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientTimelineModelConfiguration(document.RootElement, options); + } + + internal static PatientTimelineModelConfiguration DeserializePatientTimelineModelConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<bool> verbose = default; + Optional<bool> includeEvidence = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("verbose"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + verbose = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("includeEvidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeEvidence = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientTimelineModelConfiguration(Optional.ToNullable(verbose), Optional.ToNullable(includeEvidence), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientTimelineModelConfiguration>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineModelConfiguration>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientTimelineModelConfiguration)} does not support '{options.Format}' format."); + } + } + + PatientTimelineModelConfiguration IPersistableModel<PatientTimelineModelConfiguration>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelineModelConfiguration>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientTimelineModelConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientTimelineModelConfiguration)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientTimelineModelConfiguration>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientTimelineModelConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientTimelineModelConfiguration(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineModelConfiguration.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineModelConfiguration.cs new file mode 100644 index 0000000000000..e64dded434ca8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelineModelConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Configuration affecting the Patient Timeline model's inference. </summary> + public partial class PatientTimelineModelConfiguration + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientTimelineModelConfiguration"/>. </summary> + public PatientTimelineModelConfiguration() + { + } + + /// <summary> Initializes a new instance of <see cref="PatientTimelineModelConfiguration"/>. </summary> + /// <param name="verbose"> An indication whether the model should produce verbose output. </param> + /// <param name="includeEvidence"> An indication whether the model's output should include evidence for the inferences. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientTimelineModelConfiguration(bool? verbose, bool? includeEvidence, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Verbose = verbose; + IncludeEvidence = includeEvidence; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> An indication whether the model should produce verbose output. </summary> + public bool? Verbose { get; set; } + /// <summary> An indication whether the model's output should include evidence for the inferences. </summary> + public bool? IncludeEvidence { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelinePatientResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelinePatientResult.Serialization.cs new file mode 100644 index 0000000000000..a26ff6373adc1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelinePatientResult.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class PatientTimelinePatientResult : IUtf8JsonSerializable, IJsonModel<PatientTimelinePatientResult> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientTimelinePatientResult>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientTimelinePatientResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelinePatientResult>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientTimelinePatientResult)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("patientId"u8); + writer.WriteStringValue(PatientId); + writer.WritePropertyName("inferences"u8); + writer.WriteStartArray(); + foreach (var item in Inferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientTimelinePatientResult IJsonModel<PatientTimelinePatientResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelinePatientResult>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientTimelinePatientResult)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientTimelinePatientResult(document.RootElement, options); + } + + internal static PatientTimelinePatientResult DeserializePatientTimelinePatientResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string patientId = default; + IReadOnlyList<FhirR4Extendible> inferences = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patientId"u8)) + { + patientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("inferences"u8)) + { + List<FhirR4Extendible> array = new List<FhirR4Extendible>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extendible.DeserializeFhirR4Extendible(item)); + } + inferences = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientTimelinePatientResult(patientId, inferences, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientTimelinePatientResult>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelinePatientResult>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientTimelinePatientResult)} does not support '{options.Format}' format."); + } + } + + PatientTimelinePatientResult IPersistableModel<PatientTimelinePatientResult>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientTimelinePatientResult>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientTimelinePatientResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientTimelinePatientResult)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientTimelinePatientResult>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientTimelinePatientResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientTimelinePatientResult(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelinePatientResult.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelinePatientResult.cs new file mode 100644 index 0000000000000..db32ae4bfca2d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/PatientTimelinePatientResult.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> The results of the model's work for a single patient. </summary> + public partial class PatientTimelinePatientResult + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientTimelinePatientResult"/>. </summary> + /// <param name="patientId"> The identifier given for the patient in the request. </param> + /// <param name="inferences"> The model's inferences for the given patient. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patientId"/> or <paramref name="inferences"/> is null. </exception> + internal PatientTimelinePatientResult(string patientId, IEnumerable<FhirR4Extendible> inferences) + { + Argument.AssertNotNull(patientId, nameof(patientId)); + Argument.AssertNotNull(inferences, nameof(inferences)); + + PatientId = patientId; + Inferences = inferences.ToList(); + } + + /// <summary> Initializes a new instance of <see cref="PatientTimelinePatientResult"/>. </summary> + /// <param name="patientId"> The identifier given for the patient in the request. </param> + /// <param name="inferences"> The model's inferences for the given patient. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientTimelinePatientResult(string patientId, IReadOnlyList<FhirR4Extendible> inferences, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + PatientId = patientId; + Inferences = inferences; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="PatientTimelinePatientResult"/> for deserialization. </summary> + internal PatientTimelinePatientResult() + { + } + + /// <summary> The identifier given for the patient in the request. </summary> + public string PatientId { get; } + /// <summary> The model's inferences for the given patient. </summary> + public IReadOnlyList<FhirR4Extendible> Inferences { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/SpecialtyType.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/SpecialtyType.cs new file mode 100644 index 0000000000000..4ad60b141160d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/SpecialtyType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> Known values codes that can be used to indicate the type of the Specialty. </summary> + public readonly partial struct SpecialtyType : IEquatable<SpecialtyType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="SpecialtyType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public SpecialtyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PathologyValue = "pathology"; + private const string RadiologyValue = "radiology"; + + /// <summary> pathology. </summary> + public static SpecialtyType Pathology { get; } = new SpecialtyType(PathologyValue); + /// <summary> radiology. </summary> + public static SpecialtyType Radiology { get; } = new SpecialtyType(RadiologyValue); + /// <summary> Determines if two <see cref="SpecialtyType"/> values are the same. </summary> + public static bool operator ==(SpecialtyType left, SpecialtyType right) => left.Equals(right); + /// <summary> Determines if two <see cref="SpecialtyType"/> values are not the same. </summary> + public static bool operator !=(SpecialtyType left, SpecialtyType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="SpecialtyType"/>. </summary> + public static implicit operator SpecialtyType(string value) => new SpecialtyType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SpecialtyType other && Equals(other); + /// <inheritdoc /> + public bool Equals(SpecialtyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/TimePeriod.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/TimePeriod.Serialization.cs new file mode 100644 index 0000000000000..14c3165b3a56d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/TimePeriod.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.PatientTimeline +{ + public partial class TimePeriod : IUtf8JsonSerializable, IJsonModel<TimePeriod> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<TimePeriod>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<TimePeriod>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start.Value, "O"); + } + if (Optional.IsDefined(End)) + { + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TimePeriod IJsonModel<TimePeriod>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTimePeriod(document.RootElement, options); + } + + internal static TimePeriod DeserializeTimePeriod(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<DateTimeOffset> start = default; + Optional<DateTimeOffset> end = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + start = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("end"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + end = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new TimePeriod(Optional.ToNullable(start), Optional.ToNullable(end), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<TimePeriod>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{options.Format}' format."); + } + } + + TimePeriod IPersistableModel<TimePeriod>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTimePeriod(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<TimePeriod>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static TimePeriod FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTimePeriod(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/TimePeriod.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/TimePeriod.cs new file mode 100644 index 0000000000000..dfeeb828eb142 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Generated/TimePeriod.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.PatientTimeline +{ + /// <summary> A duration of time during which an event is happening. </summary> + public partial class TimePeriod + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="TimePeriod"/>. </summary> + public TimePeriod() + { + } + + /// <summary> Initializes a new instance of <see cref="TimePeriod"/>. </summary> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal TimePeriod(DateTimeOffset? start, DateTimeOffset? end, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Start = start; + End = end; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Starting time with inclusive boundary. </summary> + public DateTimeOffset? Start { get; set; } + /// <summary> End time with inclusive boundary, if not ongoing. </summary> + public DateTimeOffset? End { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Properties/AssemblyInfo.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..43028f87cdd22 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Health.Insights.PatientTimeline.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tests/Azure.Health.Insights.PatientTimeline.Tests.csproj b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tests/Azure.Health.Insights.PatientTimeline.Tests.csproj new file mode 100644 index 0000000000000..ccb5c8c973019 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tests/Azure.Health.Insights.PatientTimeline.Tests.csproj @@ -0,0 +1,20 @@ +<Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks> + <!--We don't care about XML doc comments on test types and members--> + <NoWarn>$(NoWarn);CS1591</NoWarn> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="$(AzureCoreTestFramework)" /> + <ProjectReference Include="..\src\Azure.Health.Insights.PatientTimeline.csproj" /> + </ItemGroup> + + <ItemGroup> + <PackageReference Include="Azure.Identity" /> + <PackageReference Include="NUnit" /> + <PackageReference Include="NUnit3TestAdapter" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" /> + <PackageReference Include="Moq" /> + </ItemGroup> +</Project> diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tests/Generated/Samples/Samples_PatientTimelineClient.cs b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tests/Generated/Samples/Samples_PatientTimelineClient.cs new file mode 100644 index 0000000000000..7bcca73764de0 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tests/Generated/Samples/Samples_PatientTimelineClient.cs @@ -0,0 +1,1170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Health.Insights.PatientTimeline; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Health.Insights.PatientTimeline.Samples +{ + public partial class Samples_PatientTimelineClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_PatientTimelineClient_InferPatientTimeline_ShortVersion() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + patients = new object[] + { +new +{ +id = "<id>", +} + }, + }); + Operation<BinaryData> operation = client.InferPatientTimeline(WaitUntil.Completed, content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].ToString()); + Console.WriteLine(result.GetProperty("modelVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_PatientTimelineClient_InferPatientTimeline_ShortVersion_Async() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + patients = new object[] + { +new +{ +id = "<id>", +} + }, + }); + Operation<BinaryData> operation = await client.InferPatientTimelineAsync(WaitUntil.Completed, content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].ToString()); + Console.WriteLine(result.GetProperty("modelVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_PatientTimelineClient_InferPatientTimeline_ShortVersion_Convenience() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + + PatientTimelineData patientTimelineData = new PatientTimelineData(new PatientRecord[] + { +new PatientRecord("<id>") + }); + Operation<PatientTimelineInferenceResult> operation = client.InferPatientTimeline(WaitUntil.Completed, patientTimelineData); + PatientTimelineInferenceResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_PatientTimelineClient_InferPatientTimeline_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + + PatientTimelineData patientTimelineData = new PatientTimelineData(new PatientRecord[] + { +new PatientRecord("<id>") + }); + Operation<PatientTimelineInferenceResult> operation = await client.InferPatientTimelineAsync(WaitUntil.Completed, patientTimelineData); + PatientTimelineInferenceResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_PatientTimelineClient_InferPatientTimeline_AllParameters() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + patients = new object[] + { +new +{ +id = "<id>", +info = new +{ +sex = "female", +birthDate = "2022-05-10", +clinicalInfo = new object[] +{ +new +{ +resourceType = "<resourceType>", +id = "<id>", +meta = new +{ +versionId = "<versionId>", +lastUpdated = "<lastUpdated>", +source = "<source>", +profile = new object[] +{ +"<profile>" +}, +security = new object[] +{ +new +{ +system = "<system>", +version = "<version>", +code = "<code>", +display = "<display>", +id = "<id>", +extension = new object[] +{ +new +{ +url = "<url>", +valueQuantity = new +{ +value = 123.45, +comparator = "<comparator>", +unit = "<unit>", +system = "<system>", +code = "<code>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueCodeableConcept = new +{ +coding = new object[] +{ +null +}, +text = "<text>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueString = "<valueString>", +valueBoolean = true, +valueInteger = 1234, +valueRange = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueRatio = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueSampledData = new +{ +period = 123.45, +factor = 123.45, +lowerLimit = 123.45, +upperLimit = 123.45, +dimensions = 1234, +data = "<data>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueTime = "01:23:45", +valueDateTime = "<valueDateTime>", +valuePeriod = new +{ +start = "<start>", +end = "<end>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueReference = new +{ +reference = "<reference>", +type = "<type>", +identifier = new +{ +use = "<use>", +system = "<system>", +value = "<value>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +display = "<display>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +id = "<id>", +extension = new object[] +{ +null +}, +} +}, +} +}, +tag = new object[] +{ +null +}, +}, +implicitRules = "<implicitRules>", +language = "<language>", +} +}, +}, +encounters = new object[] +{ +new Dictionary<string, object> +{ +["id"] = "<id>", +["period"] = new +{ +start = "2022-05-10T14:57:31.2311892-04:00", +end = "2022-05-10T14:57:31.2311892-04:00", +}, +["class"] = "inpatient" +} +}, +patientDocuments = new object[] +{ +new +{ +type = "note", +clinicalType = "consultation", +id = "<id>", +language = "<language>", +createdDateTime = "2022-05-10T14:57:31.2311892-04:00", +authors = new object[] +{ +new +{ +id = "<id>", +fullName = "<fullName>", +} +}, +specialtyType = "pathology", +administrativeMetadata = new +{ +orderedProcedures = new object[] +{ +new +{ +extension = new object[] +{ +null +}, +description = "<description>", +} +}, +encounterId = "<encounterId>", +}, +content = new +{ +sourceType = "inline", +value = "<value>", +}, +} +}, +} + }, + configuration = new + { + verbose = true, + includeEvidence = true, + }, + }); + Operation<BinaryData> operation = client.InferPatientTimeline(WaitUntil.Completed, content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("modelVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_PatientTimelineClient_InferPatientTimeline_AllParameters_Async() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + patients = new object[] + { +new +{ +id = "<id>", +info = new +{ +sex = "female", +birthDate = "2022-05-10", +clinicalInfo = new object[] +{ +new +{ +resourceType = "<resourceType>", +id = "<id>", +meta = new +{ +versionId = "<versionId>", +lastUpdated = "<lastUpdated>", +source = "<source>", +profile = new object[] +{ +"<profile>" +}, +security = new object[] +{ +new +{ +system = "<system>", +version = "<version>", +code = "<code>", +display = "<display>", +id = "<id>", +extension = new object[] +{ +new +{ +url = "<url>", +valueQuantity = new +{ +value = 123.45, +comparator = "<comparator>", +unit = "<unit>", +system = "<system>", +code = "<code>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueCodeableConcept = new +{ +coding = new object[] +{ +null +}, +text = "<text>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueString = "<valueString>", +valueBoolean = true, +valueInteger = 1234, +valueRange = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueRatio = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueSampledData = new +{ +period = 123.45, +factor = 123.45, +lowerLimit = 123.45, +upperLimit = 123.45, +dimensions = 1234, +data = "<data>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueTime = "01:23:45", +valueDateTime = "<valueDateTime>", +valuePeriod = new +{ +start = "<start>", +end = "<end>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueReference = new +{ +reference = "<reference>", +type = "<type>", +identifier = new +{ +use = "<use>", +system = "<system>", +value = "<value>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +display = "<display>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +id = "<id>", +extension = new object[] +{ +null +}, +} +}, +} +}, +tag = new object[] +{ +null +}, +}, +implicitRules = "<implicitRules>", +language = "<language>", +} +}, +}, +encounters = new object[] +{ +new Dictionary<string, object> +{ +["id"] = "<id>", +["period"] = new +{ +start = "2022-05-10T14:57:31.2311892-04:00", +end = "2022-05-10T14:57:31.2311892-04:00", +}, +["class"] = "inpatient" +} +}, +patientDocuments = new object[] +{ +new +{ +type = "note", +clinicalType = "consultation", +id = "<id>", +language = "<language>", +createdDateTime = "2022-05-10T14:57:31.2311892-04:00", +authors = new object[] +{ +new +{ +id = "<id>", +fullName = "<fullName>", +} +}, +specialtyType = "pathology", +administrativeMetadata = new +{ +orderedProcedures = new object[] +{ +new +{ +extension = new object[] +{ +null +}, +description = "<description>", +} +}, +encounterId = "<encounterId>", +}, +content = new +{ +sourceType = "inline", +value = "<value>", +}, +} +}, +} + }, + configuration = new + { + verbose = true, + includeEvidence = true, + }, + }); + Operation<BinaryData> operation = await client.InferPatientTimelineAsync(WaitUntil.Completed, content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("modelVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_PatientTimelineClient_InferPatientTimeline_AllParameters_Convenience() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + + PatientTimelineData patientTimelineData = new PatientTimelineData(new PatientRecord[] + { +new PatientRecord("<id>") +{ +Info = new PatientDetails +{ +Sex = PatientSex.Female, +BirthDate = DateTimeOffset.Parse("2022-05-10"), +ClinicalInfo = {new FhirR4Resource("<resourceType>") +{ +Id = "<id>", +Meta = new FhirR4Meta +{ +VersionId = "<versionId>", +LastUpdated = "<lastUpdated>", +Source = "<source>", +Profile = {"<profile>"}, +Security = {new FhirR4Coding +{ +System = "<system>", +Version = "<version>", +Code = "<code>", +Display = "<display>", +}}, +Tag = {default}, +}, +ImplicitRules = "<implicitRules>", +Language = "<language>", +}}, +}, +Encounters = {new Encounter("<id>") +{ +Period = new TimePeriod +{ +Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +}, +Class = EncounterClass.InPatient, +}}, +PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) +{ +ClinicalType = ClinicalDocumentType.Consultation, +Language = "<language>", +CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +Authors = {new DocumentAuthor +{ +Id = "<id>", +FullName = "<fullName>", +}}, +SpecialtyType = SpecialtyType.Pathology, +AdministrativeMetadata = new DocumentAdministrativeMetadata +{ +OrderedProcedures = {new FhirR4Extendible +{ +Extension = {default}, +Code = default, +Description = "<description>", +}}, +EncounterId = "<encounterId>", +}, +}}, +} + }) + { + Configuration = new PatientTimelineModelConfiguration + { + Verbose = true, + IncludeEvidence = true, + }, + }; + Operation<PatientTimelineInferenceResult> operation = client.InferPatientTimeline(WaitUntil.Completed, patientTimelineData); + PatientTimelineInferenceResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_PatientTimelineClient_InferPatientTimeline_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + PatientTimelineClient client = new PatientTimelineClient(endpoint, credential); + + PatientTimelineData patientTimelineData = new PatientTimelineData(new PatientRecord[] + { +new PatientRecord("<id>") +{ +Info = new PatientDetails +{ +Sex = PatientSex.Female, +BirthDate = DateTimeOffset.Parse("2022-05-10"), +ClinicalInfo = {new FhirR4Resource("<resourceType>") +{ +Id = "<id>", +Meta = new FhirR4Meta +{ +VersionId = "<versionId>", +LastUpdated = "<lastUpdated>", +Source = "<source>", +Profile = {"<profile>"}, +Security = {new FhirR4Coding +{ +System = "<system>", +Version = "<version>", +Code = "<code>", +Display = "<display>", +}}, +Tag = {default}, +}, +ImplicitRules = "<implicitRules>", +Language = "<language>", +}}, +}, +Encounters = {new Encounter("<id>") +{ +Period = new TimePeriod +{ +Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +}, +Class = EncounterClass.InPatient, +}}, +PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) +{ +ClinicalType = ClinicalDocumentType.Consultation, +Language = "<language>", +CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +Authors = {new DocumentAuthor +{ +Id = "<id>", +FullName = "<fullName>", +}}, +SpecialtyType = SpecialtyType.Pathology, +AdministrativeMetadata = new DocumentAdministrativeMetadata +{ +OrderedProcedures = {new FhirR4Extendible +{ +Extension = {default}, +Code = default, +Description = "<description>", +}}, +EncounterId = "<encounterId>", +}, +}}, +} + }) + { + Configuration = new PatientTimelineModelConfiguration + { + Verbose = true, + IncludeEvidence = true, + }, + }; + Operation<PatientTimelineInferenceResult> operation = await client.InferPatientTimelineAsync(WaitUntil.Completed, patientTimelineData); + PatientTimelineInferenceResult responseData = operation.Value; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tsp-location.yaml new file mode 100644 index 0000000000000..5c322f6e3ace2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.PatientTimeline/tsp-location.yaml @@ -0,0 +1,7 @@ +directory: specification/ai/HealthInsights/HealthInsights.PatientTimeline +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/ai/HealthInsights/HealthInsights.Common/ +- specification/ai/HealthInsights/HealthInsights.OpenAPI/ +commit: 0b86423a8256b66c84c4e0e0d7d52e75105bb4bb + diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/Azure.Health.Insights.RadiologyInsights.sln b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/Azure.Health.Insights.RadiologyInsights.sln new file mode 100644 index 0000000000000..5d8a2df889772 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/Azure.Health.Insights.RadiologyInsights.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Health.Insights.RadiologyInsights", "src\Azure.Health.Insights.RadiologyInsights.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Health.Insights.RadiologyInsights.Tests", "tests\Azure.Health.Insights.RadiologyInsights.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.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.RadiologyInsights/CHANGELOG.md b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/CHANGELOG.md new file mode 100644 index 0000000000000..13dd08af78abe --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/Directory.Build.props b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/Directory.Build.props new file mode 100644 index 0000000000000..63bd836ad44b7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/Directory.Build.props @@ -0,0 +1,6 @@ +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- + Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props + --> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" /> +</Project> diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.md b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.md new file mode 100644 index 0000000000000..3b37f81bbcc92 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.md @@ -0,0 +1,86 @@ +# Azure.Health.Insights.RadiologyInsights client library for .NET + +Azure.Health.Insights.RadiologyInsights is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Health.Insights.RadiologyInsights --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts +<!-- CLIENT COMMON BAR --> +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) +<!-- CLIENT COMMON BAR --> + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + +<!-- LINKS --> +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.png) diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Azure.Health.Insights.RadiologyInsights.csproj b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Azure.Health.Insights.RadiologyInsights.csproj new file mode 100644 index 0000000000000..f96c975c4a3ae --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Azure.Health.Insights.RadiologyInsights.csproj @@ -0,0 +1,21 @@ +<Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <Description>This is the Azure.Health.Insights.RadiologyInsights client library for developing .NET applications with rich experience.</Description> + <AssemblyTitle>Azure SDK Code Generation Azure.Health.Insights.RadiologyInsights for Azure Data Plane</AssemblyTitle> + <Version>1.0.0-beta.1</Version> + <PackageTags>Azure.Health.Insights.RadiologyInsights</PackageTags> + <TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks> + <IncludeOperationsSharedSource>true</IncludeOperationsSharedSource> + </PropertyGroup> + + <ItemGroup> + <Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared/Core" /> + <Compile Include="$(AzureCoreSharedSources)AzureKeyCredentialPolicy.cs" LinkBase="Shared/Core" /> + </ItemGroup> + + <ItemGroup> + <PackageReference Include="Azure.Core" /> + <PackageReference Include="System.Text.Json" /> + <PackageReference Include="System.ClientModel" /> + </ItemGroup> +</Project> diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ClinicalDocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ClinicalDocumentType.cs new file mode 100644 index 0000000000000..58cf185e996a8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ClinicalDocumentType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> The type of the clinical document. </summary> + public readonly partial struct ClinicalDocumentType : IEquatable<ClinicalDocumentType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="ClinicalDocumentType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + 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 RadiologyReportValue = "radiologyReport"; + private const string ProcedureValue = "procedure"; + private const string ProgressValue = "progress"; + private const string LaboratoryValue = "laboratory"; + private const string PathologyReportValue = "pathologyReport"; + + /// <summary> consultation. </summary> + public static ClinicalDocumentType Consultation { get; } = new ClinicalDocumentType(ConsultationValue); + /// <summary> dischargeSummary. </summary> + public static ClinicalDocumentType DischargeSummary { get; } = new ClinicalDocumentType(DischargeSummaryValue); + /// <summary> historyAndPhysical. </summary> + public static ClinicalDocumentType HistoryAndPhysical { get; } = new ClinicalDocumentType(HistoryAndPhysicalValue); + /// <summary> radiologyReport. </summary> + public static ClinicalDocumentType RadiologyReport { get; } = new ClinicalDocumentType(RadiologyReportValue); + /// <summary> procedure. </summary> + public static ClinicalDocumentType Procedure { get; } = new ClinicalDocumentType(ProcedureValue); + /// <summary> progress. </summary> + public static ClinicalDocumentType Progress { get; } = new ClinicalDocumentType(ProgressValue); + /// <summary> laboratory. </summary> + public static ClinicalDocumentType Laboratory { get; } = new ClinicalDocumentType(LaboratoryValue); + /// <summary> pathologyReport. </summary> + public static ClinicalDocumentType PathologyReport { get; } = new ClinicalDocumentType(PathologyReportValue); + /// <summary> Determines if two <see cref="ClinicalDocumentType"/> values are the same. </summary> + public static bool operator ==(ClinicalDocumentType left, ClinicalDocumentType right) => left.Equals(right); + /// <summary> Determines if two <see cref="ClinicalDocumentType"/> values are not the same. </summary> + public static bool operator !=(ClinicalDocumentType left, ClinicalDocumentType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="ClinicalDocumentType"/>. </summary> + public static implicit operator ClinicalDocumentType(string value) => new ClinicalDocumentType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClinicalDocumentType other && Equals(other); + /// <inheritdoc /> + public bool Equals(ClinicalDocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Docs/RadiologyInsightsClient.xml b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Docs/RadiologyInsightsClient.xml new file mode 100644 index 0000000000000..dab925793ad66 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Docs/RadiologyInsightsClient.xml @@ -0,0 +1,1207 @@ +<?xml version="1.0" encoding="utf-8"?> +<doc> + <members> + <member name="InferRadiologyInsightsAsync(WaitUntil,RadiologyInsightsData,CancellationToken)"> + <example> +This sample shows how to call InferRadiologyInsightsAsync. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + +RadiologyInsightsData radiologyInsightsData = new RadiologyInsightsData(new PatientRecord[] +{ + new PatientRecord("<id>") +}); +Operation<RadiologyInsightsInferenceResult> operation = await client.InferRadiologyInsightsAsync(WaitUntil.Completed, radiologyInsightsData); +RadiologyInsightsInferenceResult responseData = operation.Value; +]]></code> +This sample shows how to call InferRadiologyInsightsAsync with all parameters. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + +RadiologyInsightsData radiologyInsightsData = new RadiologyInsightsData(new PatientRecord[] +{ + new PatientRecord("<id>") + { + Info = new PatientDetails + { + Sex = PatientSex.Female, + BirthDate = DateTimeOffset.Parse("2022-05-10"), + ClinicalInfo = {new FhirR4Resource("<resourceType>") + { + Id = "<id>", + Meta = new FhirR4Meta + { + VersionId = "<versionId>", + LastUpdated = "<lastUpdated>", + Source = "<source>", + Profile = {"<profile>"}, + Security = {new FhirR4Coding + { + System = "<system>", + Version = "<version>", + Code = "<code>", + Display = "<display>", + }}, + Tag = {default}, + }, + ImplicitRules = "<implicitRules>", + Language = "<language>", + }}, + }, + Encounters = {new Encounter("<id>") + { + Period = new TimePeriod + { + Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + }, + Class = EncounterClass.InPatient, + }}, + PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) + { + ClinicalType = ClinicalDocumentType.Consultation, + Language = "<language>", + CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + Authors = {new DocumentAuthor + { + Id = "<id>", + FullName = "<fullName>", + }}, + SpecialtyType = SpecialtyType.Pathology, + AdministrativeMetadata = new DocumentAdministrativeMetadata + { + OrderedProcedures = {new FhirR4Extendible + { + Extension = {default}, + Code = default, + Description = "<description>", + }}, + EncounterId = "<encounterId>", + }, + }}, + } +}) +{ + Configuration = new RadiologyInsightsModelConfiguration + { + Verbose = true, + IncludeEvidence = true, + InferenceTypes = { RadiologyInsightsInferenceType.AgeMismatch }, + InferenceOptions = new RadiologyInsightsInferenceOptions + { + FollowupRecommendationOptions = new FollowupRecommendationOptions + { + IncludeRecommendationsWithNoSpecifiedModality = true, + IncludeRecommendationsInReferences = true, + ProvideFocusedSentenceEvidence = true, + }, + FindingOptions = new FindingOptions + { + ProvideFocusedSentenceEvidence = true, + }, + }, + Locale = "<locale>", + }, +}; +Operation<RadiologyInsightsInferenceResult> operation = await client.InferRadiologyInsightsAsync(WaitUntil.Completed, radiologyInsightsData); +RadiologyInsightsInferenceResult responseData = operation.Value; +]]></code></example> + </member> + <member name="InferRadiologyInsights(WaitUntil,RadiologyInsightsData,CancellationToken)"> + <example> +This sample shows how to call InferRadiologyInsights. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + +RadiologyInsightsData radiologyInsightsData = new RadiologyInsightsData(new PatientRecord[] +{ + new PatientRecord("<id>") +}); +Operation<RadiologyInsightsInferenceResult> operation = client.InferRadiologyInsights(WaitUntil.Completed, radiologyInsightsData); +RadiologyInsightsInferenceResult responseData = operation.Value; +]]></code> +This sample shows how to call InferRadiologyInsights with all parameters. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + +RadiologyInsightsData radiologyInsightsData = new RadiologyInsightsData(new PatientRecord[] +{ + new PatientRecord("<id>") + { + Info = new PatientDetails + { + Sex = PatientSex.Female, + BirthDate = DateTimeOffset.Parse("2022-05-10"), + ClinicalInfo = {new FhirR4Resource("<resourceType>") + { + Id = "<id>", + Meta = new FhirR4Meta + { + VersionId = "<versionId>", + LastUpdated = "<lastUpdated>", + Source = "<source>", + Profile = {"<profile>"}, + Security = {new FhirR4Coding + { + System = "<system>", + Version = "<version>", + Code = "<code>", + Display = "<display>", + }}, + Tag = {default}, + }, + ImplicitRules = "<implicitRules>", + Language = "<language>", + }}, + }, + Encounters = {new Encounter("<id>") + { + Period = new TimePeriod + { + Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + }, + Class = EncounterClass.InPatient, + }}, + PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) + { + ClinicalType = ClinicalDocumentType.Consultation, + Language = "<language>", + CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), + Authors = {new DocumentAuthor + { + Id = "<id>", + FullName = "<fullName>", + }}, + SpecialtyType = SpecialtyType.Pathology, + AdministrativeMetadata = new DocumentAdministrativeMetadata + { + OrderedProcedures = {new FhirR4Extendible + { + Extension = {default}, + Code = default, + Description = "<description>", + }}, + EncounterId = "<encounterId>", + }, + }}, + } +}) +{ + Configuration = new RadiologyInsightsModelConfiguration + { + Verbose = true, + IncludeEvidence = true, + InferenceTypes = { RadiologyInsightsInferenceType.AgeMismatch }, + InferenceOptions = new RadiologyInsightsInferenceOptions + { + FollowupRecommendationOptions = new FollowupRecommendationOptions + { + IncludeRecommendationsWithNoSpecifiedModality = true, + IncludeRecommendationsInReferences = true, + ProvideFocusedSentenceEvidence = true, + }, + FindingOptions = new FindingOptions + { + ProvideFocusedSentenceEvidence = true, + }, + }, + Locale = "<locale>", + }, +}; +Operation<RadiologyInsightsInferenceResult> operation = client.InferRadiologyInsights(WaitUntil.Completed, radiologyInsightsData); +RadiologyInsightsInferenceResult responseData = operation.Value; +]]></code></example> + </member> + <member name="InferRadiologyInsightsAsync(WaitUntil,RequestContent,RequestContext)"> + <example> +This sample shows how to call InferRadiologyInsightsAsync and parse the result. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + patients = new object[] + { + new + { + id = "<id>", + } + }, +}); +Operation<BinaryData> operation = await client.InferRadiologyInsightsAsync(WaitUntil.Completed, content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].ToString()); +Console.WriteLine(result.GetProperty("modelVersion").ToString()); +]]></code> +This sample shows how to call InferRadiologyInsightsAsync with all parameters and request content and parse the result. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + patients = new object[] + { + new + { + id = "<id>", + info = new + { + sex = "female", + birthDate = "2022-05-10", + clinicalInfo = new object[] + { + new + { + resourceType = "<resourceType>", + id = "<id>", + meta = new + { + versionId = "<versionId>", + lastUpdated = "<lastUpdated>", + source = "<source>", + profile = new object[] + { + "<profile>" + }, + security = new object[] + { + new + { + system = "<system>", + version = "<version>", + code = "<code>", + display = "<display>", + id = "<id>", + extension = new object[] + { + new + { + url = "<url>", + valueQuantity = new + { + value = 123.45, + comparator = "<comparator>", + unit = "<unit>", + system = "<system>", + code = "<code>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueCodeableConcept = new + { + coding = new object[] + { + null + }, + text = "<text>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueString = "<valueString>", + valueBoolean = true, + valueInteger = 1234, + valueRange = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueRatio = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueSampledData = new + { + period = 123.45, + factor = 123.45, + lowerLimit = 123.45, + upperLimit = 123.45, + dimensions = 1234, + data = "<data>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueTime = "01:23:45", + valueDateTime = "<valueDateTime>", + valuePeriod = new + { + start = "<start>", + end = "<end>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueReference = new + { + reference = "<reference>", + type = "<type>", + identifier = new + { + use = "<use>", + system = "<system>", + value = "<value>", + id = "<id>", + extension = new object[] + { + null + }, + }, + display = "<display>", + id = "<id>", + extension = new object[] + { + null + }, + }, + id = "<id>", + extension = new object[] + { + null + }, + } + }, + } + }, + tag = new object[] + { + null + }, + }, + implicitRules = "<implicitRules>", + language = "<language>", + } + }, + }, + encounters = new object[] + { + new Dictionary<string, object> + { + ["id"] = "<id>", + ["period"] = new + { + start = "2022-05-10T14:57:31.2311892-04:00", + end = "2022-05-10T14:57:31.2311892-04:00", + }, + ["class"] = "inpatient" + } + }, + patientDocuments = new object[] + { + new + { + type = "note", + clinicalType = "consultation", + id = "<id>", + language = "<language>", + createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + authors = new object[] + { + new + { + id = "<id>", + fullName = "<fullName>", + } + }, + specialtyType = "pathology", + administrativeMetadata = new + { + orderedProcedures = new object[] + { + new + { + extension = new object[] + { + null + }, + description = "<description>", + } + }, + encounterId = "<encounterId>", + }, + content = new + { + sourceType = "inline", + value = "<value>", + }, + } + }, + } + }, + configuration = new + { + verbose = true, + includeEvidence = true, + inferenceTypes = new object[] + { + "ageMismatch" + }, + inferenceOptions = new + { + followupRecommendationOptions = new + { + includeRecommendationsWithNoSpecifiedModality = true, + includeRecommendationsInReferences = true, + provideFocusedSentenceEvidence = true, + }, + findingOptions = new + { + provideFocusedSentenceEvidence = true, + }, + }, + locale = "<locale>", + }, +}); +Operation<BinaryData> operation = await client.InferRadiologyInsightsAsync(WaitUntil.Completed, content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("modelVersion").ToString()); +]]></code></example> + </member> + <member name="InferRadiologyInsights(WaitUntil,RequestContent,RequestContext)"> + <example> +This sample shows how to call InferRadiologyInsights and parse the result. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + patients = new object[] + { + new + { + id = "<id>", + } + }, +}); +Operation<BinaryData> operation = client.InferRadiologyInsights(WaitUntil.Completed, content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].ToString()); +Console.WriteLine(result.GetProperty("modelVersion").ToString()); +]]></code> +This sample shows how to call InferRadiologyInsights with all parameters and request content and parse the result. +<code><![CDATA[ +Uri endpoint = new Uri("<https://my-service.azure.com>"); +AzureKeyCredential credential = new AzureKeyCredential("<key>"); +RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + patients = new object[] + { + new + { + id = "<id>", + info = new + { + sex = "female", + birthDate = "2022-05-10", + clinicalInfo = new object[] + { + new + { + resourceType = "<resourceType>", + id = "<id>", + meta = new + { + versionId = "<versionId>", + lastUpdated = "<lastUpdated>", + source = "<source>", + profile = new object[] + { + "<profile>" + }, + security = new object[] + { + new + { + system = "<system>", + version = "<version>", + code = "<code>", + display = "<display>", + id = "<id>", + extension = new object[] + { + new + { + url = "<url>", + valueQuantity = new + { + value = 123.45, + comparator = "<comparator>", + unit = "<unit>", + system = "<system>", + code = "<code>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueCodeableConcept = new + { + coding = new object[] + { + null + }, + text = "<text>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueString = "<valueString>", + valueBoolean = true, + valueInteger = 1234, + valueRange = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueRatio = new + { + id = "<id>", + extension = new object[] + { + null + }, + }, + valueSampledData = new + { + period = 123.45, + factor = 123.45, + lowerLimit = 123.45, + upperLimit = 123.45, + dimensions = 1234, + data = "<data>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueTime = "01:23:45", + valueDateTime = "<valueDateTime>", + valuePeriod = new + { + start = "<start>", + end = "<end>", + id = "<id>", + extension = new object[] + { + null + }, + }, + valueReference = new + { + reference = "<reference>", + type = "<type>", + identifier = new + { + use = "<use>", + system = "<system>", + value = "<value>", + id = "<id>", + extension = new object[] + { + null + }, + }, + display = "<display>", + id = "<id>", + extension = new object[] + { + null + }, + }, + id = "<id>", + extension = new object[] + { + null + }, + } + }, + } + }, + tag = new object[] + { + null + }, + }, + implicitRules = "<implicitRules>", + language = "<language>", + } + }, + }, + encounters = new object[] + { + new Dictionary<string, object> + { + ["id"] = "<id>", + ["period"] = new + { + start = "2022-05-10T14:57:31.2311892-04:00", + end = "2022-05-10T14:57:31.2311892-04:00", + }, + ["class"] = "inpatient" + } + }, + patientDocuments = new object[] + { + new + { + type = "note", + clinicalType = "consultation", + id = "<id>", + language = "<language>", + createdDateTime = "2022-05-10T14:57:31.2311892-04:00", + authors = new object[] + { + new + { + id = "<id>", + fullName = "<fullName>", + } + }, + specialtyType = "pathology", + administrativeMetadata = new + { + orderedProcedures = new object[] + { + new + { + extension = new object[] + { + null + }, + description = "<description>", + } + }, + encounterId = "<encounterId>", + }, + content = new + { + sourceType = "inline", + value = "<value>", + }, + } + }, + } + }, + configuration = new + { + verbose = true, + includeEvidence = true, + inferenceTypes = new object[] + { + "ageMismatch" + }, + inferenceOptions = new + { + followupRecommendationOptions = new + { + includeRecommendationsWithNoSpecifiedModality = true, + includeRecommendationsInReferences = true, + provideFocusedSentenceEvidence = true, + }, + findingOptions = new + { + provideFocusedSentenceEvidence = true, + }, + }, + locale = "<locale>", + }, +}); +Operation<BinaryData> operation = client.InferRadiologyInsights(WaitUntil.Completed, content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("text").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueString").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueInteger").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("modelVersion").ToString()); +]]></code></example> + </member> + </members> +</doc> \ No newline at end of file diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAdministrativeMetadata.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAdministrativeMetadata.Serialization.cs new file mode 100644 index 0000000000000..fb06c049e8ae2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAdministrativeMetadata.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class DocumentAdministrativeMetadata : IUtf8JsonSerializable, IJsonModel<DocumentAdministrativeMetadata> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<DocumentAdministrativeMetadata>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<DocumentAdministrativeMetadata>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(OrderedProcedures)) + { + writer.WritePropertyName("orderedProcedures"u8); + writer.WriteStartArray(); + foreach (var item in OrderedProcedures) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EncounterId)) + { + writer.WritePropertyName("encounterId"u8); + writer.WriteStringValue(EncounterId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentAdministrativeMetadata IJsonModel<DocumentAdministrativeMetadata>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentAdministrativeMetadata(document.RootElement, options); + } + + internal static DocumentAdministrativeMetadata DeserializeDocumentAdministrativeMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Extendible>> orderedProcedures = default; + Optional<string> encounterId = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("orderedProcedures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extendible> array = new List<FhirR4Extendible>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extendible.DeserializeFhirR4Extendible(item)); + } + orderedProcedures = array; + continue; + } + if (property.NameEquals("encounterId"u8)) + { + encounterId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentAdministrativeMetadata(Optional.ToList(orderedProcedures), encounterId.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<DocumentAdministrativeMetadata>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{options.Format}' format."); + } + } + + DocumentAdministrativeMetadata IPersistableModel<DocumentAdministrativeMetadata>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAdministrativeMetadata>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentAdministrativeMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentAdministrativeMetadata)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<DocumentAdministrativeMetadata>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static DocumentAdministrativeMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentAdministrativeMetadata(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAdministrativeMetadata.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAdministrativeMetadata.cs new file mode 100644 index 0000000000000..8b3c5b9580677 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAdministrativeMetadata.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Document administrative metadata. </summary> + public partial class DocumentAdministrativeMetadata + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="DocumentAdministrativeMetadata"/>. </summary> + public DocumentAdministrativeMetadata() + { + OrderedProcedures = new ChangeTrackingList<FhirR4Extendible>(); + } + + /// <summary> Initializes a new instance of <see cref="DocumentAdministrativeMetadata"/>. </summary> + /// <param name="orderedProcedures"> List of procedure information associated with the document. </param> + /// <param name="encounterId"> Reference to the encounter associated with the document. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal DocumentAdministrativeMetadata(IList<FhirR4Extendible> orderedProcedures, string encounterId, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + OrderedProcedures = orderedProcedures; + EncounterId = encounterId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> List of procedure information associated with the document. </summary> + public IList<FhirR4Extendible> OrderedProcedures { get; } + /// <summary> Reference to the encounter associated with the document. </summary> + public string EncounterId { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAuthor.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAuthor.Serialization.cs new file mode 100644 index 0000000000000..acf9f353b55c2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAuthor.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class DocumentAuthor : IUtf8JsonSerializable, IJsonModel<DocumentAuthor> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<DocumentAuthor>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<DocumentAuthor>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(FullName)) + { + writer.WritePropertyName("fullName"u8); + writer.WriteStringValue(FullName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentAuthor IJsonModel<DocumentAuthor>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentAuthor(document.RootElement, options); + } + + internal static DocumentAuthor DeserializeDocumentAuthor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> id = default; + Optional<string> fullName = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("fullName"u8)) + { + fullName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentAuthor(id.Value, fullName.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<DocumentAuthor>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{options.Format}' format."); + } + } + + DocumentAuthor IPersistableModel<DocumentAuthor>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentAuthor>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentAuthor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentAuthor)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<DocumentAuthor>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static DocumentAuthor FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentAuthor(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAuthor.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAuthor.cs new file mode 100644 index 0000000000000..5ed4275b0f1ee --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentAuthor.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Document author. </summary> + public partial class DocumentAuthor + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="DocumentAuthor"/>. </summary> + public DocumentAuthor() + { + } + + /// <summary> Initializes a new instance of <see cref="DocumentAuthor"/>. </summary> + /// <param name="id"> author id. </param> + /// <param name="fullName"> Text representation of the full name. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal DocumentAuthor(string id, string fullName, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + FullName = fullName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> author id. </summary> + public string Id { get; set; } + /// <summary> Text representation of the full name. </summary> + public string FullName { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContent.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContent.Serialization.cs new file mode 100644 index 0000000000000..44a659dbc6bd6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContent.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class DocumentContent : IUtf8JsonSerializable, IJsonModel<DocumentContent> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<DocumentContent>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<DocumentContent>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentContent>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentContent)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("sourceType"u8); + writer.WriteStringValue(SourceType.ToString()); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentContent IJsonModel<DocumentContent>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentContent>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentContent)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentContent(document.RootElement, options); + } + + internal static DocumentContent DeserializeDocumentContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentContentSourceType sourceType = default; + string value = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceType"u8)) + { + sourceType = new DocumentContentSourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new DocumentContent(sourceType, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<DocumentContent>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentContent>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentContent)} does not support '{options.Format}' format."); + } + } + + DocumentContent IPersistableModel<DocumentContent>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<DocumentContent>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentContent)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<DocumentContent>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static DocumentContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentContent(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContent.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContent.cs new file mode 100644 index 0000000000000..3408a431051b0 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContent.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> The content of the patient document. </summary> + public partial class DocumentContent + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="DocumentContent"/>. </summary> + /// <param name="sourceType"> + /// 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. + /// </param> + /// <param name="value"> The content of the document, given either inline (as a string) or as a reference (URI). </param> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public DocumentContent(DocumentContentSourceType sourceType, string value) + { + Argument.AssertNotNull(value, nameof(value)); + + SourceType = sourceType; + Value = value; + } + + /// <summary> Initializes a new instance of <see cref="DocumentContent"/>. </summary> + /// <param name="sourceType"> + /// 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. + /// </param> + /// <param name="value"> The content of the document, given either inline (as a string) or as a reference (URI). </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal DocumentContent(DocumentContentSourceType sourceType, string value, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + SourceType = sourceType; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="DocumentContent"/> for deserialization. </summary> + internal DocumentContent() + { + } + + /// <summary> + /// 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. + /// </summary> + public DocumentContentSourceType SourceType { get; } + /// <summary> The content of the document, given either inline (as a string) or as a reference (URI). </summary> + public string Value { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContentSourceType.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContentSourceType.cs new file mode 100644 index 0000000000000..0c75c38d211cb --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentContentSourceType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// 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. + /// </summary> + public readonly partial struct DocumentContentSourceType : IEquatable<DocumentContentSourceType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="DocumentContentSourceType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public DocumentContentSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InlineValue = "inline"; + private const string ReferenceValue = "reference"; + + /// <summary> The content is given as a string (for instance, text). </summary> + public static DocumentContentSourceType Inline { get; } = new DocumentContentSourceType(InlineValue); + /// <summary> The content is given as a URI. </summary> + public static DocumentContentSourceType Reference { get; } = new DocumentContentSourceType(ReferenceValue); + /// <summary> Determines if two <see cref="DocumentContentSourceType"/> values are the same. </summary> + public static bool operator ==(DocumentContentSourceType left, DocumentContentSourceType right) => left.Equals(right); + /// <summary> Determines if two <see cref="DocumentContentSourceType"/> values are not the same. </summary> + public static bool operator !=(DocumentContentSourceType left, DocumentContentSourceType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="DocumentContentSourceType"/>. </summary> + public static implicit operator DocumentContentSourceType(string value) => new DocumentContentSourceType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentContentSourceType other && Equals(other); + /// <inheritdoc /> + public bool Equals(DocumentContentSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentType.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentType.cs new file mode 100644 index 0000000000000..9cb400c900ca8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/DocumentType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </summary> + public readonly partial struct DocumentType : IEquatable<DocumentType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="DocumentType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + 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"; + + /// <summary> note. </summary> + public static DocumentType Note { get; } = new DocumentType(NoteValue); + /// <summary> fhirBundle. </summary> + public static DocumentType FhirBundle { get; } = new DocumentType(FhirBundleValue); + /// <summary> dicom. </summary> + public static DocumentType Dicom { get; } = new DocumentType(DicomValue); + /// <summary> genomicSequencing. </summary> + public static DocumentType GenomicSequencing { get; } = new DocumentType(GenomicSequencingValue); + /// <summary> Determines if two <see cref="DocumentType"/> values are the same. </summary> + public static bool operator ==(DocumentType left, DocumentType right) => left.Equals(right); + /// <summary> Determines if two <see cref="DocumentType"/> values are not the same. </summary> + public static bool operator !=(DocumentType left, DocumentType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="DocumentType"/>. </summary> + public static implicit operator DocumentType(string value) => new DocumentType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentType other && Equals(other); + /// <inheritdoc /> + public bool Equals(DocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Encounter.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Encounter.Serialization.cs new file mode 100644 index 0000000000000..bfa78ec05919d --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Encounter.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class Encounter : IUtf8JsonSerializable, IJsonModel<Encounter> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<Encounter>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<Encounter>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Encounter)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Period)) + { + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); + } + if (Optional.IsDefined(Class)) + { + writer.WritePropertyName("class"u8); + writer.WriteStringValue(Class.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Encounter IJsonModel<Encounter>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Encounter)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEncounter(document.RootElement, options); + } + + internal static Encounter DeserializeEncounter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + Optional<TimePeriod> period = default; + Optional<EncounterClass> @class = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("period"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + period = TimePeriod.DeserializeTimePeriod(property.Value); + continue; + } + if (property.NameEquals("class"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @class = new EncounterClass(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new Encounter(id, period.Value, Optional.ToNullable(@class), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<Encounter>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Encounter)} does not support '{options.Format}' format."); + } + } + + Encounter IPersistableModel<Encounter>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<Encounter>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEncounter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Encounter)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<Encounter>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static Encounter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEncounter(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Encounter.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Encounter.cs new file mode 100644 index 0000000000000..7ecfbc7041ea9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/Encounter.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> visit/encounter information. </summary> + public partial class Encounter + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <exception cref="ArgumentNullException"> <paramref name="id"/> is null. </exception> + public Encounter(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + } + + /// <summary> Initializes a new instance of <see cref="Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <param name="period"> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </param> + /// <param name="class"> The class of the encounter. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal Encounter(string id, TimePeriod period, EncounterClass? @class, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + Period = period; + Class = @class; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="Encounter"/> for deserialization. </summary> + internal Encounter() + { + } + + /// <summary> The id of the visit. </summary> + public string Id { get; } + /// <summary> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </summary> + public TimePeriod Period { get; set; } + /// <summary> The class of the encounter. </summary> + public EncounterClass? Class { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/EncounterClass.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/EncounterClass.cs new file mode 100644 index 0000000000000..390f150c5774e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/EncounterClass.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Known values codes that can be used to indicate the class of encounter (TODO://Based on FHIR value set--http://....). </summary> + public readonly partial struct EncounterClass : IEquatable<EncounterClass> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="EncounterClass"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public EncounterClass(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InPatientValue = "inpatient"; + private const string AmbulatoryValue = "ambulatory"; + private const string ObservationValue = "observation"; + private const string EmergencyValue = "emergency"; + private const string VirtualValue = "virtual"; + private const string HealthHomeValue = "healthHome"; + + /// <summary> A patient encounter where a patient is admitted by a hospital or equivalent facility, assigned to a location where patients generally stay at least overnight and provided with room, board, and continuous nursing service. </summary> + public static EncounterClass InPatient { get; } = new EncounterClass(InPatientValue); + /// <summary> The term ambulatory usually implies that the patient has come to the location and is not assigned to a bed. Sometimes referred to as an outpatient encounter. </summary> + public static EncounterClass Ambulatory { get; } = new EncounterClass(AmbulatoryValue); + /// <summary> An encounter where the patient usually will start in different encounter, such as one in the emergency department but then transition to this type of encounter because they require a significant period of treatment and monitoring to determine whether or not their condition warrants an inpatient admission or discharge. </summary> + public static EncounterClass Observation { get; } = new EncounterClass(ObservationValue); + /// <summary> A patient encounter that takes place at a dedicated healthcare service delivery location where the patient receives immediate evaluation and treatment, provided until the patient can be discharged or responsibility for the patient's care is transferred elsewhere (for example, the patient could be admitted as an inpatient or transferred to another facility. </summary> + public static EncounterClass Emergency { get; } = new EncounterClass(EmergencyValue); + /// <summary> A patient encounter where the patient is not physically present for the encounter, such as in a telehealth encounter, phone call, or electronic communication. </summary> + public static EncounterClass Virtual { get; } = new EncounterClass(VirtualValue); + /// <summary> Healthcare encounter that takes place in the residence of the patient or a designee. </summary> + public static EncounterClass HealthHome { get; } = new EncounterClass(HealthHomeValue); + /// <summary> Determines if two <see cref="EncounterClass"/> values are the same. </summary> + public static bool operator ==(EncounterClass left, EncounterClass right) => left.Equals(right); + /// <summary> Determines if two <see cref="EncounterClass"/> values are not the same. </summary> + public static bool operator !=(EncounterClass left, EncounterClass right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="EncounterClass"/>. </summary> + public static implicit operator EncounterClass(string value) => new EncounterClass(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EncounterClass other && Equals(other); + /// <inheritdoc /> + public bool Equals(EncounterClass other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Annotation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Annotation.Serialization.cs new file mode 100644 index 0000000000000..1b07cff682fd0 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Annotation.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class FhirR4Annotation : IUtf8JsonSerializable, IJsonModel<FhirR4Annotation> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Annotation>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Annotation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Annotation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Annotation)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthorString)) + { + writer.WritePropertyName("authorString"u8); + writer.WriteStringValue(AuthorString); + } + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time); + } + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Annotation IJsonModel<FhirR4Annotation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Annotation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Annotation)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Annotation(document.RootElement, options); + } + + internal static FhirR4Annotation DeserializeFhirR4Annotation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> authorString = default; + Optional<string> time = default; + string text = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authorString"u8)) + { + authorString = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + time = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Annotation(id.Value, Optional.ToList(extension), serializedAdditionalRawData, authorString.Value, time.Value, text); + } + + BinaryData IPersistableModel<FhirR4Annotation>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Annotation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Annotation)} does not support '{options.Format}' format."); + } + } + + FhirR4Annotation IPersistableModel<FhirR4Annotation>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Annotation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Annotation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Annotation)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Annotation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Annotation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Annotation(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Annotation.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Annotation.cs new file mode 100644 index 0000000000000..5b2c5ab5181f4 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Annotation.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A text note which also contains information about who made the statement and when + /// Based on [FHIR Annotation](https://www.hl7.org/fhir/R4/datatypes.html#Annotation) + /// </summary> + internal partial class FhirR4Annotation : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Annotation"/>. </summary> + /// <param name="text"> The annotation - text content (as markdown). </param> + /// <exception cref="ArgumentNullException"> <paramref name="text"/> is null. </exception> + public FhirR4Annotation(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Annotation"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="authorString"> Individual responsible for the annotation. </param> + /// <param name="time"> When the annotation was made. </param> + /// <param name="text"> The annotation - text content (as markdown). </param> + internal FhirR4Annotation(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string authorString, string time, string text) : base(id, extension, serializedAdditionalRawData) + { + AuthorString = authorString; + Time = time; + Text = text; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Annotation"/> for deserialization. </summary> + internal FhirR4Annotation() + { + } + + /// <summary> Individual responsible for the annotation. </summary> + public string AuthorString { get; set; } + /// <summary> When the annotation was made. </summary> + public string Time { get; set; } + /// <summary> The annotation - text content (as markdown). </summary> + public string Text { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4CodeableConcept.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4CodeableConcept.Serialization.cs new file mode 100644 index 0000000000000..d99c576256cf3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4CodeableConcept.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4CodeableConcept : IUtf8JsonSerializable, IJsonModel<FhirR4CodeableConcept> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4CodeableConcept>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4CodeableConcept>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Coding)) + { + writer.WritePropertyName("coding"u8); + writer.WriteStartArray(); + foreach (var item in Coding) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4CodeableConcept IJsonModel<FhirR4CodeableConcept>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4CodeableConcept(document.RootElement, options); + } + + internal static FhirR4CodeableConcept DeserializeFhirR4CodeableConcept(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Coding>> coding = default; + Optional<string> text = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("coding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + coding = array; + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4CodeableConcept(id.Value, Optional.ToList(extension), serializedAdditionalRawData, Optional.ToList(coding), text.Value); + } + + BinaryData IPersistableModel<FhirR4CodeableConcept>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{options.Format}' format."); + } + } + + FhirR4CodeableConcept IPersistableModel<FhirR4CodeableConcept>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4CodeableConcept>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4CodeableConcept(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4CodeableConcept)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4CodeableConcept>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4CodeableConcept FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4CodeableConcept(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4CodeableConcept.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4CodeableConcept.cs new file mode 100644 index 0000000000000..572f056f201b9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4CodeableConcept.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Concept - reference to a terminology or just text + /// Based on [FHIR CodeableConcept](https://www.hl7.org/fhir/R4/datatypes.html#CodeableConcept) + /// </summary> + public partial class FhirR4CodeableConcept : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4CodeableConcept"/>. </summary> + public FhirR4CodeableConcept() + { + Coding = new ChangeTrackingList<FhirR4Coding>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4CodeableConcept"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="coding"> Code defined by a terminology system. </param> + /// <param name="text"> Plain text representation of the concept. </param> + internal FhirR4CodeableConcept(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, IList<FhirR4Coding> coding, string text) : base(id, extension, serializedAdditionalRawData) + { + Coding = coding; + Text = text; + } + + /// <summary> Code defined by a terminology system. </summary> + public IList<FhirR4Coding> Coding { get; } + /// <summary> Plain text representation of the concept. </summary> + public string Text { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Coding.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Coding.Serialization.cs new file mode 100644 index 0000000000000..8bf5065e86fe9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Coding.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Coding : IUtf8JsonSerializable, IJsonModel<FhirR4Coding> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Coding>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Coding>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Coding IJsonModel<FhirR4Coding>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Coding(document.RootElement, options); + } + + internal static FhirR4Coding DeserializeFhirR4Coding(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> system = default; + Optional<string> version = default; + Optional<string> code = default; + Optional<string> display = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("display"u8)) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Coding(id.Value, Optional.ToList(extension), serializedAdditionalRawData, system.Value, version.Value, code.Value, display.Value); + } + + BinaryData IPersistableModel<FhirR4Coding>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{options.Format}' format."); + } + } + + FhirR4Coding IPersistableModel<FhirR4Coding>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Coding>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Coding(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Coding)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Coding>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Coding FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Coding(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Coding.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Coding.cs new file mode 100644 index 0000000000000..1b1946d799e17 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Coding.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A Coding is a representation of a defined concept using a symbol from a defined "code system". + /// Based on [FHIR Coding](https://www.hl7.org/fhir/R4/datatypes.html#Coding) + /// </summary> + public partial class FhirR4Coding : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Coding"/>. </summary> + public FhirR4Coding() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Coding"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="system"> Identity of the terminology system. </param> + /// <param name="version"> Version of the system - if relevant. </param> + /// <param name="code"> Symbol in syntax defined by the system. </param> + /// <param name="display"> Representation defined by the system. </param> + internal FhirR4Coding(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string system, string version, string code, string display) : base(id, extension, serializedAdditionalRawData) + { + System = system; + Version = version; + Code = code; + Display = display; + } + + /// <summary> Identity of the terminology system. </summary> + public string System { get; set; } + /// <summary> Version of the system - if relevant. </summary> + public string Version { get; set; } + /// <summary> Symbol in syntax defined by the system. </summary> + public string Code { get; set; } + /// <summary> Representation defined by the system. </summary> + public string Display { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4DomainResource.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4DomainResource.Serialization.cs new file mode 100644 index 0000000000000..a2b4aa62cb1d4 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4DomainResource.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + [PersistableModelProxy(typeof(UnknownFhirR4DomainResource))] + internal partial class FhirR4DomainResource : IUtf8JsonSerializable, IJsonModel<FhirR4DomainResource> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4DomainResource>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4DomainResource>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteObjectValue(Text); + } + if (Optional.IsCollectionDefined(Contained)) + { + writer.WritePropertyName("contained"u8); + writer.WriteStartArray(); + foreach (var item in Contained) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ModifierExtension)) + { + writer.WritePropertyName("modifierExtension"u8); + writer.WriteStartArray(); + foreach (var item in ModifierExtension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4DomainResource IJsonModel<FhirR4DomainResource>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4DomainResource(document.RootElement, options); + } + + internal static FhirR4DomainResource DeserializeFhirR4DomainResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("resourceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Observation": return FhirR4Observation.DeserializeFhirR4Observation(element); + } + } + return UnknownFhirR4DomainResource.DeserializeUnknownFhirR4DomainResource(element); + } + + BinaryData IPersistableModel<FhirR4DomainResource>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{options.Format}' format."); + } + } + + FhirR4DomainResource IPersistableModel<FhirR4DomainResource>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4DomainResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4DomainResource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4DomainResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4DomainResource(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4DomainResource.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4DomainResource.cs new file mode 100644 index 0000000000000..ae7dd3b895824 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4DomainResource.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A resource with narrative, extensions, and contained resources + /// Based on [FHIR DomainResource](https://www.hl7.org/fhir/domainresource.html) + /// Please note <see cref="FhirR4DomainResource"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include <see cref="FhirR4Observation"/>. + /// </summary> + internal abstract partial class FhirR4DomainResource : FhirR4Resource + { + /// <summary> Initializes a new instance of <see cref="FhirR4DomainResource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <exception cref="ArgumentNullException"> <paramref name="resourceType"/> is null. </exception> + protected FhirR4DomainResource(string resourceType) : base(resourceType) + { + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + Contained = new ChangeTrackingList<FhirR4Resource>(); + Extension = new ChangeTrackingList<FhirR4Extension>(); + ModifierExtension = new ChangeTrackingList<FhirR4Extension>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4DomainResource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <param name="text"> Text summary of the resource, for human interpretation. </param> + /// <param name="contained"> Contained, inline Resources. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="modifierExtension"> Extensions that cannot be ignored. </param> + internal FhirR4DomainResource(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties, FhirR4Narrative text, IList<FhirR4Resource> contained, IList<FhirR4Extension> extension, IList<FhirR4Extension> modifierExtension) : base(resourceType, id, meta, implicitRules, language, additionalProperties) + { + Text = text; + Contained = contained; + Extension = extension; + ModifierExtension = modifierExtension; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4DomainResource"/> for deserialization. </summary> + internal FhirR4DomainResource() + { + } + + /// <summary> Text summary of the resource, for human interpretation. </summary> + public FhirR4Narrative Text { get; set; } + /// <summary> Contained, inline Resources. </summary> + public IList<FhirR4Resource> Contained { get; } + /// <summary> Additional Content defined by implementations. </summary> + public IList<FhirR4Extension> Extension { get; } + /// <summary> Extensions that cannot be ignored. </summary> + public IList<FhirR4Extension> ModifierExtension { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Element.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Element.Serialization.cs new file mode 100644 index 0000000000000..c777eb12637a3 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Element.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Element : IUtf8JsonSerializable, IJsonModel<FhirR4Element> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Element>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Element>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Element IJsonModel<FhirR4Element>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Element(document.RootElement, options); + } + + internal static FhirR4Element DeserializeFhirR4Element(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Element(id.Value, Optional.ToList(extension), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Element>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{options.Format}' format."); + } + } + + FhirR4Element IPersistableModel<FhirR4Element>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Element>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Element(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Element)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Element>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Element FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Element(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Element.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Element.cs new file mode 100644 index 0000000000000..413658620aa34 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Element.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// The base definition for all elements contained inside a resource. + /// Based on [FHIR Element](https://www.hl7.org/fhir/R4/element.html) + /// </summary> + public partial class FhirR4Element + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private protected IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Element"/>. </summary> + internal FhirR4Element() + { + Extension = new ChangeTrackingList<FhirR4Extension>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Element"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Element(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + Extension = extension; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Unique id for inter-element referencing. </summary> + public string Id { get; } + /// <summary> Additional Content defined by implementations. </summary> + public IReadOnlyList<FhirR4Extension> Extension { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extendible.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extendible.Serialization.cs new file mode 100644 index 0000000000000..c8656bf944751 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extendible.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Extendible : IUtf8JsonSerializable, IJsonModel<FhirR4Extendible> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Extendible>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Extendible>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteObjectValue(Code); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Extendible IJsonModel<FhirR4Extendible>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Extendible(document.RootElement, options); + } + + internal static FhirR4Extendible DeserializeFhirR4Extendible(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Extension>> extension = default; + Optional<FhirR4CodeableConcept> code = default; + Optional<string> description = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Extendible(Optional.ToList(extension), code.Value, description.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Extendible>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{options.Format}' format."); + } + } + + FhirR4Extendible IPersistableModel<FhirR4Extendible>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extendible>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Extendible(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Extendible)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Extendible>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Extendible FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Extendible(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extendible.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extendible.cs new file mode 100644 index 0000000000000..d15a4efebeb5e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extendible.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Procedure information. </summary> + public partial class FhirR4Extendible + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private protected IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Extendible"/>. </summary> + public FhirR4Extendible() + { + Extension = new ChangeTrackingList<FhirR4Extension>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extendible"/>. </summary> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="code"> Procedure code. </param> + /// <param name="description"> Procedure description. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Extendible(IList<FhirR4Extension> extension, FhirR4CodeableConcept code, string description, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Extension = extension; + Code = code; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Additional Content defined by implementations. </summary> + public IList<FhirR4Extension> Extension { get; } + /// <summary> Procedure code. </summary> + public FhirR4CodeableConcept Code { get; set; } + /// <summary> Procedure description. </summary> + public string Description { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extension.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extension.Serialization.cs new file mode 100644 index 0000000000000..3c30d94bda8b2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extension.Serialization.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Extension : IUtf8JsonSerializable, IJsonModel<FhirR4Extension> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Extension>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Extension>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url); + if (Optional.IsDefined(ValueQuantity)) + { + writer.WritePropertyName("valueQuantity"u8); + writer.WriteObjectValue(ValueQuantity); + } + if (Optional.IsDefined(ValueCodeableConcept)) + { + writer.WritePropertyName("valueCodeableConcept"u8); + writer.WriteObjectValue(ValueCodeableConcept); + } + if (Optional.IsDefined(ValueString)) + { + writer.WritePropertyName("valueString"u8); + writer.WriteStringValue(ValueString); + } + if (Optional.IsDefined(ValueBoolean)) + { + writer.WritePropertyName("valueBoolean"u8); + writer.WriteBooleanValue(ValueBoolean.Value); + } + if (Optional.IsDefined(ValueInteger)) + { + writer.WritePropertyName("valueInteger"u8); + writer.WriteNumberValue(ValueInteger.Value); + } + if (Optional.IsDefined(ValueRange)) + { + writer.WritePropertyName("valueRange"u8); + writer.WriteObjectValue(ValueRange); + } + if (Optional.IsDefined(ValueRatio)) + { + writer.WritePropertyName("valueRatio"u8); + writer.WriteObjectValue(ValueRatio); + } + if (Optional.IsDefined(ValueSampledData)) + { + writer.WritePropertyName("valueSampledData"u8); + writer.WriteObjectValue(ValueSampledData); + } + if (Optional.IsDefined(ValueTime)) + { + writer.WritePropertyName("valueTime"u8); + writer.WriteStringValue(ValueTime.Value, "T"); + } + if (Optional.IsDefined(ValueDateTime)) + { + writer.WritePropertyName("valueDateTime"u8); + writer.WriteStringValue(ValueDateTime); + } + if (Optional.IsDefined(ValuePeriod)) + { + writer.WritePropertyName("valuePeriod"u8); + writer.WriteObjectValue(ValuePeriod); + } + if (Optional.IsDefined(ValueReference)) + { + writer.WritePropertyName("valueReference"u8); + writer.WriteObjectValue(ValueReference); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Extension IJsonModel<FhirR4Extension>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Extension(document.RootElement, options); + } + + internal static FhirR4Extension DeserializeFhirR4Extension(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + Optional<FhirR4Quantity> valueQuantity = default; + Optional<FhirR4CodeableConcept> valueCodeableConcept = default; + Optional<string> valueString = default; + Optional<bool> valueBoolean = default; + Optional<int> valueInteger = default; + Optional<FhirR4Range> valueRange = default; + Optional<FhirR4Ratio> valueRatio = default; + Optional<FhirR4SampledData> valueSampledData = default; + Optional<TimeSpan> valueTime = default; + Optional<string> valueDateTime = default; + Optional<FhirR4Period> valuePeriod = default; + Optional<FhirR4Reference> valueReference = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueQuantity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueQuantity = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("valueCodeableConcept"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueCodeableConcept = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("valueString"u8)) + { + valueString = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueBoolean"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueBoolean = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("valueInteger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueInteger = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("valueRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRange = FhirR4Range.DeserializeFhirR4Range(property.Value); + continue; + } + if (property.NameEquals("valueRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRatio = FhirR4Ratio.DeserializeFhirR4Ratio(property.Value); + continue; + } + if (property.NameEquals("valueSampledData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueSampledData = FhirR4SampledData.DeserializeFhirR4SampledData(property.Value); + continue; + } + if (property.NameEquals("valueTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueTime = property.Value.GetTimeSpan("T"); + continue; + } + if (property.NameEquals("valueDateTime"u8)) + { + valueDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("valuePeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valuePeriod = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("valueReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueReference = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Extension(id.Value, Optional.ToList(extension), serializedAdditionalRawData, url, valueQuantity.Value, valueCodeableConcept.Value, valueString.Value, Optional.ToNullable(valueBoolean), Optional.ToNullable(valueInteger), valueRange.Value, valueRatio.Value, valueSampledData.Value, Optional.ToNullable(valueTime), valueDateTime.Value, valuePeriod.Value, valueReference.Value); + } + + BinaryData IPersistableModel<FhirR4Extension>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{options.Format}' format."); + } + } + + FhirR4Extension IPersistableModel<FhirR4Extension>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Extension>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Extension(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Extension)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Extension>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Extension FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Extension(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extension.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extension.cs new file mode 100644 index 0000000000000..bec8ce438ee40 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Extension.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Base for all elements + /// Based on [FHIR Element](https://www.hl7.org/fhir/datatypes.html#Element) + /// </summary> + public partial class FhirR4Extension : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/>. </summary> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <exception cref="ArgumentNullException"> <paramref name="url"/> is null. </exception> + public FhirR4Extension(string url) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <param name="valueQuantity"> Value as Quantity. </param> + /// <param name="valueCodeableConcept"> Value as CodeableConcept. </param> + /// <param name="valueString"> Value as string. </param> + /// <param name="valueBoolean"> Value as boolean. </param> + /// <param name="valueInteger"> Value as integer. </param> + /// <param name="valueRange"> Value as Range. </param> + /// <param name="valueRatio"> Value as Ratio. </param> + /// <param name="valueSampledData"> Value as SampledData. </param> + /// <param name="valueTime"> Value as time (hh:mm:ss). </param> + /// <param name="valueDateTime"> Value as dateTime. </param> + /// <param name="valuePeriod"> Value as Period. </param> + /// <param name="valueReference"> Value as reference. </param> + internal FhirR4Extension(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string url, FhirR4Quantity valueQuantity, FhirR4CodeableConcept valueCodeableConcept, string valueString, bool? valueBoolean, int? valueInteger, FhirR4Range valueRange, FhirR4Ratio valueRatio, FhirR4SampledData valueSampledData, TimeSpan? valueTime, string valueDateTime, FhirR4Period valuePeriod, FhirR4Reference valueReference) : base(id, extension, serializedAdditionalRawData) + { + Url = url; + ValueQuantity = valueQuantity; + ValueCodeableConcept = valueCodeableConcept; + ValueString = valueString; + ValueBoolean = valueBoolean; + ValueInteger = valueInteger; + ValueRange = valueRange; + ValueRatio = valueRatio; + ValueSampledData = valueSampledData; + ValueTime = valueTime; + ValueDateTime = valueDateTime; + ValuePeriod = valuePeriod; + ValueReference = valueReference; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Extension"/> for deserialization. </summary> + internal FhirR4Extension() + { + } + + /// <summary> Source of the definition for the extension code - a logical name or a URL. </summary> + public string Url { get; set; } + /// <summary> Value as Quantity. </summary> + public FhirR4Quantity ValueQuantity { get; set; } + /// <summary> Value as CodeableConcept. </summary> + public FhirR4CodeableConcept ValueCodeableConcept { get; set; } + /// <summary> Value as string. </summary> + public string ValueString { get; set; } + /// <summary> Value as boolean. </summary> + public bool? ValueBoolean { get; set; } + /// <summary> Value as integer. </summary> + public int? ValueInteger { get; set; } + /// <summary> Value as Range. </summary> + public FhirR4Range ValueRange { get; set; } + /// <summary> Value as Ratio. </summary> + public FhirR4Ratio ValueRatio { get; set; } + /// <summary> Value as SampledData. </summary> + public FhirR4SampledData ValueSampledData { get; set; } + /// <summary> Value as time (hh:mm:ss). </summary> + public TimeSpan? ValueTime { get; set; } + /// <summary> Value as dateTime. </summary> + public string ValueDateTime { get; set; } + /// <summary> Value as Period. </summary> + public FhirR4Period ValuePeriod { get; set; } + /// <summary> Value as reference. </summary> + public FhirR4Reference ValueReference { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Identifier.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Identifier.Serialization.cs new file mode 100644 index 0000000000000..89a6460d3c60b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Identifier.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Identifier : IUtf8JsonSerializable, IJsonModel<FhirR4Identifier> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Identifier>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Identifier>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Use)) + { + writer.WritePropertyName("use"u8); + writer.WriteStringValue(Use); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteObjectValue(Type); + } + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(Period)) + { + writer.WritePropertyName("period"u8); + writer.WriteObjectValue(Period); + } + if (Optional.IsDefined(Assigner)) + { + writer.WritePropertyName("assigner"u8); + writer.WriteObjectValue(Assigner); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Identifier IJsonModel<FhirR4Identifier>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Identifier(document.RootElement, options); + } + + internal static FhirR4Identifier DeserializeFhirR4Identifier(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> use = default; + Optional<FhirR4CodeableConcept> type = default; + Optional<string> system = default; + Optional<string> value = default; + Optional<FhirR4Period> period = default; + Optional<FhirR4Reference> assigner = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("use"u8)) + { + use = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("period"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + period = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("assigner"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assigner = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Identifier(id.Value, Optional.ToList(extension), serializedAdditionalRawData, use.Value, type.Value, system.Value, value.Value, period.Value, assigner.Value); + } + + BinaryData IPersistableModel<FhirR4Identifier>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{options.Format}' format."); + } + } + + FhirR4Identifier IPersistableModel<FhirR4Identifier>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Identifier>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Identifier(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Identifier)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Identifier>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Identifier FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Identifier(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Identifier.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Identifier.cs new file mode 100644 index 0000000000000..4ab92d0588d9b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Identifier.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// An identifier intended for computation + /// Based on [FHIR Identifier](https://www.hl7.org/fhir/R4/identifier.html) + /// </summary> + public partial class FhirR4Identifier : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Identifier"/>. </summary> + public FhirR4Identifier() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Identifier"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="use"> usual | official | temp | secondary | old (If known). </param> + /// <param name="type"> Description of identifier. </param> + /// <param name="system"> The namespace for the identifier value. </param> + /// <param name="value"> The value that is unique. </param> + /// <param name="period"> Time period when id is/was valid for use. </param> + /// <param name="assigner"> Organization that issued id (may be just text). </param> + internal FhirR4Identifier(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string use, FhirR4CodeableConcept type, string system, string value, FhirR4Period period, FhirR4Reference assigner) : base(id, extension, serializedAdditionalRawData) + { + Use = use; + Type = type; + System = system; + Value = value; + Period = period; + Assigner = assigner; + } + + /// <summary> usual | official | temp | secondary | old (If known). </summary> + public string Use { get; set; } + /// <summary> Description of identifier. </summary> + public FhirR4CodeableConcept Type { get; set; } + /// <summary> The namespace for the identifier value. </summary> + public string System { get; set; } + /// <summary> The value that is unique. </summary> + public string Value { get; set; } + /// <summary> Time period when id is/was valid for use. </summary> + public FhirR4Period Period { get; set; } + /// <summary> Organization that issued id (may be just text). </summary> + public FhirR4Reference Assigner { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Meta.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Meta.Serialization.cs new file mode 100644 index 0000000000000..5749893e80ad9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Meta.Serialization.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Meta : IUtf8JsonSerializable, IJsonModel<FhirR4Meta> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Meta>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Meta>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(VersionId)) + { + writer.WritePropertyName("versionId"u8); + writer.WriteStringValue(VersionId); + } + if (Optional.IsDefined(LastUpdated)) + { + writer.WritePropertyName("lastUpdated"u8); + writer.WriteStringValue(LastUpdated); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsCollectionDefined(Profile)) + { + writer.WritePropertyName("profile"u8); + writer.WriteStartArray(); + foreach (var item in Profile) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Security)) + { + writer.WritePropertyName("security"u8); + writer.WriteStartArray(); + foreach (var item in Security) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Tag)) + { + writer.WritePropertyName("tag"u8); + writer.WriteStartArray(); + foreach (var item in Tag) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Meta IJsonModel<FhirR4Meta>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Meta(document.RootElement, options); + } + + internal static FhirR4Meta DeserializeFhirR4Meta(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> versionId = default; + Optional<string> lastUpdated = default; + Optional<string> source = default; + Optional<IList<string>> profile = default; + Optional<IList<FhirR4Coding>> security = default; + Optional<IList<FhirR4Coding>> tag = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("versionId"u8)) + { + versionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastUpdated"u8)) + { + lastUpdated = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("profile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<string> array = new List<string>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + profile = array; + continue; + } + if (property.NameEquals("security"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + security = array; + continue; + } + if (property.NameEquals("tag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Coding> array = new List<FhirR4Coding>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Coding.DeserializeFhirR4Coding(item)); + } + tag = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Meta(versionId.Value, lastUpdated.Value, source.Value, Optional.ToList(profile), Optional.ToList(security), Optional.ToList(tag), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4Meta>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{options.Format}' format."); + } + } + + FhirR4Meta IPersistableModel<FhirR4Meta>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Meta>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Meta(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Meta)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Meta>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Meta FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Meta(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Meta.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Meta.cs new file mode 100644 index 0000000000000..b12ac338ba6dc --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Meta.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Metadata about a resource + /// Based on [FHIR Meta](https://www.hl7.org/fhir/R4/resource.html#Meta) + /// </summary> + public partial class FhirR4Meta + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4Meta"/>. </summary> + public FhirR4Meta() + { + Profile = new ChangeTrackingList<string>(); + Security = new ChangeTrackingList<FhirR4Coding>(); + Tag = new ChangeTrackingList<FhirR4Coding>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Meta"/>. </summary> + /// <param name="versionId"> The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. </param> + /// <param name="lastUpdated"> When the resource last changed - e.g. when the version changed. </param> + /// <param name="source"> A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. </param> + /// <param name="profile"> A list of profiles (references to [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). </param> + /// <param name="security"> Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. </param> + /// <param name="tag"> Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4Meta(string versionId, string lastUpdated, string source, IList<string> profile, IList<FhirR4Coding> security, IList<FhirR4Coding> tag, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + VersionId = versionId; + LastUpdated = lastUpdated; + Source = source; + Profile = profile; + Security = security; + Tag = tag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. </summary> + public string VersionId { get; set; } + /// <summary> When the resource last changed - e.g. when the version changed. </summary> + public string LastUpdated { get; set; } + /// <summary> A uri that identifies the source system of the resource. This provides a minimal amount of Provenance information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. </summary> + public string Source { get; set; } + /// <summary> A list of profiles (references to [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). </summary> + public IList<string> Profile { get; } + /// <summary> Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. </summary> + public IList<FhirR4Coding> Security { get; } + /// <summary> Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. </summary> + public IList<FhirR4Coding> Tag { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Narrative.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Narrative.Serialization.cs new file mode 100644 index 0000000000000..62f8984b13b3e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Narrative.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class FhirR4Narrative : IUtf8JsonSerializable, IJsonModel<FhirR4Narrative> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Narrative>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Narrative>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Narrative>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Narrative)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + writer.WritePropertyName("div"u8); + writer.WriteStringValue(Div); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Narrative IJsonModel<FhirR4Narrative>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Narrative>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Narrative)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Narrative(document.RootElement, options); + } + + internal static FhirR4Narrative DeserializeFhirR4Narrative(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string status = default; + string div = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("div"u8)) + { + div = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Narrative(id.Value, Optional.ToList(extension), serializedAdditionalRawData, status, div); + } + + BinaryData IPersistableModel<FhirR4Narrative>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Narrative>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Narrative)} does not support '{options.Format}' format."); + } + } + + FhirR4Narrative IPersistableModel<FhirR4Narrative>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Narrative>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Narrative(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Narrative)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Narrative>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Narrative FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Narrative(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Narrative.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Narrative.cs new file mode 100644 index 0000000000000..24d09b42ab836 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Narrative.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Any resource that is a [DomainResource](https://www.hl7.org/fhir/domainresource.html) may include a human-readable narrative that contains a summary of the resource and may be used to represent the content of the resource to a human. + /// Based on [FHIR Narrative](https://www.hl7.org/fhir/R4/narrative.html#Narrative) + /// </summary> + internal partial class FhirR4Narrative : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Narrative"/>. </summary> + /// <param name="status"> generated, extensions, additional, empty. </param> + /// <param name="div"> xhtml. </param> + /// <exception cref="ArgumentNullException"> <paramref name="status"/> or <paramref name="div"/> is null. </exception> + public FhirR4Narrative(string status, string div) + { + Argument.AssertNotNull(status, nameof(status)); + Argument.AssertNotNull(div, nameof(div)); + + Status = status; + Div = div; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Narrative"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="status"> generated, extensions, additional, empty. </param> + /// <param name="div"> xhtml. </param> + internal FhirR4Narrative(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string status, string div) : base(id, extension, serializedAdditionalRawData) + { + Status = status; + Div = div; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Narrative"/> for deserialization. </summary> + internal FhirR4Narrative() + { + } + + /// <summary> generated, extensions, additional, empty. </summary> + public string Status { get; set; } + /// <summary> xhtml. </summary> + public string Div { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Observation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Observation.Serialization.cs new file mode 100644 index 0000000000000..e843a63f73835 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Observation.Serialization.cs @@ -0,0 +1,764 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class FhirR4Observation : IUtf8JsonSerializable, IJsonModel<FhirR4Observation> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Observation>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Observation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Observation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Observation)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Identifier)) + { + writer.WritePropertyName("identifier"u8); + writer.WriteStartArray(); + foreach (var item in Identifier) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStartArray(); + foreach (var item in Category) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("code"u8); + writer.WriteObjectValue(Code); + if (Optional.IsDefined(Subject)) + { + writer.WritePropertyName("subject"u8); + writer.WriteObjectValue(Subject); + } + if (Optional.IsDefined(Encounter)) + { + writer.WritePropertyName("encounter"u8); + writer.WriteObjectValue(Encounter); + } + if (Optional.IsDefined(EffectiveDateTime)) + { + writer.WritePropertyName("effectiveDateTime"u8); + writer.WriteStringValue(EffectiveDateTime); + } + if (Optional.IsDefined(EffectivePeriod)) + { + writer.WritePropertyName("effectivePeriod"u8); + writer.WriteObjectValue(EffectivePeriod); + } + if (Optional.IsDefined(EffectiveInstant)) + { + writer.WritePropertyName("effectiveInstant"u8); + writer.WriteStringValue(EffectiveInstant); + } + if (Optional.IsDefined(Issued)) + { + writer.WritePropertyName("issued"u8); + writer.WriteStringValue(Issued); + } + if (Optional.IsDefined(ValueQuantity)) + { + writer.WritePropertyName("valueQuantity"u8); + writer.WriteObjectValue(ValueQuantity); + } + if (Optional.IsDefined(ValueCodeableConcept)) + { + writer.WritePropertyName("valueCodeableConcept"u8); + writer.WriteObjectValue(ValueCodeableConcept); + } + if (Optional.IsDefined(ValueString)) + { + writer.WritePropertyName("valueString"u8); + writer.WriteStringValue(ValueString); + } + if (Optional.IsDefined(ValueBoolean)) + { + writer.WritePropertyName("valueBoolean"u8); + writer.WriteBooleanValue(ValueBoolean.Value); + } + if (Optional.IsDefined(ValueInteger)) + { + writer.WritePropertyName("valueInteger"u8); + writer.WriteNumberValue(ValueInteger.Value); + } + if (Optional.IsDefined(ValueRange)) + { + writer.WritePropertyName("valueRange"u8); + writer.WriteObjectValue(ValueRange); + } + if (Optional.IsDefined(ValueRatio)) + { + writer.WritePropertyName("valueRatio"u8); + writer.WriteObjectValue(ValueRatio); + } + if (Optional.IsDefined(ValueSampledData)) + { + writer.WritePropertyName("valueSampledData"u8); + writer.WriteObjectValue(ValueSampledData); + } + if (Optional.IsDefined(ValueTime)) + { + writer.WritePropertyName("valueTime"u8); + writer.WriteStringValue(ValueTime.Value, "T"); + } + if (Optional.IsDefined(ValueDateTime)) + { + writer.WritePropertyName("valueDateTime"u8); + writer.WriteStringValue(ValueDateTime); + } + if (Optional.IsDefined(ValuePeriod)) + { + writer.WritePropertyName("valuePeriod"u8); + writer.WriteObjectValue(ValuePeriod); + } + if (Optional.IsDefined(DataAbsentReason)) + { + writer.WritePropertyName("dataAbsentReason"u8); + writer.WriteObjectValue(DataAbsentReason); + } + if (Optional.IsCollectionDefined(Interpretation)) + { + writer.WritePropertyName("interpretation"u8); + writer.WriteStartArray(); + foreach (var item in Interpretation) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Note)) + { + writer.WritePropertyName("note"u8); + writer.WriteStartArray(); + foreach (var item in Note) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BodySite)) + { + writer.WritePropertyName("bodySite"u8); + writer.WriteObjectValue(BodySite); + } + if (Optional.IsDefined(Method)) + { + writer.WritePropertyName("method"u8); + writer.WriteObjectValue(Method); + } + if (Optional.IsCollectionDefined(ReferenceRange)) + { + writer.WritePropertyName("referenceRange"u8); + writer.WriteStartArray(); + foreach (var item in ReferenceRange) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(HasMember)) + { + writer.WritePropertyName("hasMember"u8); + writer.WriteStartArray(); + foreach (var item in HasMember) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(DerivedFrom)) + { + writer.WritePropertyName("derivedFrom"u8); + writer.WriteStartArray(); + foreach (var item in DerivedFrom) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Component)) + { + writer.WritePropertyName("component"u8); + writer.WriteStartArray(); + foreach (var item in Component) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteObjectValue(Text); + } + if (Optional.IsCollectionDefined(Contained)) + { + writer.WritePropertyName("contained"u8); + writer.WriteStartArray(); + foreach (var item in Contained) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ModifierExtension)) + { + writer.WritePropertyName("modifierExtension"u8); + writer.WriteStartArray(); + foreach (var item in ModifierExtension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4Observation IJsonModel<FhirR4Observation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Observation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Observation)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Observation(document.RootElement, options); + } + + internal static FhirR4Observation DeserializeFhirR4Observation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IList<FhirR4Identifier>> identifier = default; + ObservationStatusCodeType status = default; + Optional<IList<FhirR4CodeableConcept>> category = default; + FhirR4CodeableConcept code = default; + Optional<FhirR4Reference> subject = default; + Optional<FhirR4Reference> encounter = default; + Optional<string> effectiveDateTime = default; + Optional<FhirR4Period> effectivePeriod = default; + Optional<string> effectiveInstant = default; + Optional<string> issued = default; + Optional<FhirR4Quantity> valueQuantity = default; + Optional<FhirR4CodeableConcept> valueCodeableConcept = default; + Optional<string> valueString = default; + Optional<bool> valueBoolean = default; + Optional<int> valueInteger = default; + Optional<FhirR4Range> valueRange = default; + Optional<FhirR4Ratio> valueRatio = default; + Optional<FhirR4SampledData> valueSampledData = default; + Optional<TimeSpan> valueTime = default; + Optional<string> valueDateTime = default; + Optional<FhirR4Period> valuePeriod = default; + Optional<FhirR4CodeableConcept> dataAbsentReason = default; + Optional<IList<FhirR4CodeableConcept>> interpretation = default; + Optional<IList<FhirR4Annotation>> note = default; + Optional<FhirR4CodeableConcept> bodySite = default; + Optional<FhirR4CodeableConcept> method = default; + Optional<IList<FhirR4ObservationReferenceRange>> referenceRange = default; + Optional<IList<FhirR4Reference>> hasMember = default; + Optional<IList<FhirR4Reference>> derivedFrom = default; + Optional<IList<FhirR4ObservationComponent>> component = default; + Optional<FhirR4Narrative> text = default; + Optional<IList<FhirR4Resource>> contained = default; + Optional<IList<FhirR4Extension>> extension = default; + Optional<IList<FhirR4Extension>> modifierExtension = default; + string resourceType = default; + Optional<string> id = default; + Optional<FhirR4Meta> meta = default; + Optional<string> implicitRules = default; + Optional<string> language = default; + IDictionary<string, BinaryData> additionalProperties = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identifier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Identifier> array = new List<FhirR4Identifier>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Identifier.DeserializeFhirR4Identifier(item)); + } + identifier = array; + continue; + } + if (property.NameEquals("status"u8)) + { + status = new ObservationStatusCodeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + category = array; + continue; + } + if (property.NameEquals("code"u8)) + { + code = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("subject"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subject = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("encounter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encounter = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("effectiveDateTime"u8)) + { + effectiveDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("effectivePeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + effectivePeriod = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("effectiveInstant"u8)) + { + effectiveInstant = property.Value.GetString(); + continue; + } + if (property.NameEquals("issued"u8)) + { + issued = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueQuantity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueQuantity = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("valueCodeableConcept"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueCodeableConcept = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("valueString"u8)) + { + valueString = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueBoolean"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueBoolean = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("valueInteger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueInteger = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("valueRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRange = FhirR4Range.DeserializeFhirR4Range(property.Value); + continue; + } + if (property.NameEquals("valueRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRatio = FhirR4Ratio.DeserializeFhirR4Ratio(property.Value); + continue; + } + if (property.NameEquals("valueSampledData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueSampledData = FhirR4SampledData.DeserializeFhirR4SampledData(property.Value); + continue; + } + if (property.NameEquals("valueTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueTime = property.Value.GetTimeSpan("T"); + continue; + } + if (property.NameEquals("valueDateTime"u8)) + { + valueDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("valuePeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valuePeriod = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("dataAbsentReason"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataAbsentReason = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("interpretation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + interpretation = array; + continue; + } + if (property.NameEquals("note"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Annotation> array = new List<FhirR4Annotation>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Annotation.DeserializeFhirR4Annotation(item)); + } + note = array; + continue; + } + if (property.NameEquals("bodySite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bodySite = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("method"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + method = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("referenceRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4ObservationReferenceRange> array = new List<FhirR4ObservationReferenceRange>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4ObservationReferenceRange.DeserializeFhirR4ObservationReferenceRange(item)); + } + referenceRange = array; + continue; + } + if (property.NameEquals("hasMember"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Reference> array = new List<FhirR4Reference>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Reference.DeserializeFhirR4Reference(item)); + } + hasMember = array; + continue; + } + if (property.NameEquals("derivedFrom"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Reference> array = new List<FhirR4Reference>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Reference.DeserializeFhirR4Reference(item)); + } + derivedFrom = array; + continue; + } + if (property.NameEquals("component"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4ObservationComponent> array = new List<FhirR4ObservationComponent>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4ObservationComponent.DeserializeFhirR4ObservationComponent(item)); + } + component = array; + continue; + } + if (property.NameEquals("text"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + text = FhirR4Narrative.DeserializeFhirR4Narrative(property.Value); + continue; + } + if (property.NameEquals("contained"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Resource> array = new List<FhirR4Resource>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeFhirR4Resource(item)); + } + contained = array; + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (property.NameEquals("modifierExtension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + modifierExtension = array; + continue; + } + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("meta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + meta = FhirR4Meta.DeserializeFhirR4Meta(property.Value); + continue; + } + if (property.NameEquals("implicitRules"u8)) + { + implicitRules = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new FhirR4Observation(resourceType, id.Value, meta.Value, implicitRules.Value, language.Value, additionalProperties, text.Value, Optional.ToList(contained), Optional.ToList(extension), Optional.ToList(modifierExtension), Optional.ToList(identifier), status, Optional.ToList(category), code, subject.Value, encounter.Value, effectiveDateTime.Value, effectivePeriod.Value, effectiveInstant.Value, issued.Value, valueQuantity.Value, valueCodeableConcept.Value, valueString.Value, Optional.ToNullable(valueBoolean), Optional.ToNullable(valueInteger), valueRange.Value, valueRatio.Value, valueSampledData.Value, Optional.ToNullable(valueTime), valueDateTime.Value, valuePeriod.Value, dataAbsentReason.Value, Optional.ToList(interpretation), Optional.ToList(note), bodySite.Value, method.Value, Optional.ToList(referenceRange), Optional.ToList(hasMember), Optional.ToList(derivedFrom), Optional.ToList(component)); + } + + BinaryData IPersistableModel<FhirR4Observation>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Observation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Observation)} does not support '{options.Format}' format."); + } + } + + FhirR4Observation IPersistableModel<FhirR4Observation>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Observation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Observation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Observation)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Observation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Observation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Observation(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Observation.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Observation.cs new file mode 100644 index 0000000000000..01226852a2111 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Observation.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Detailed information about observations + /// Based on [FHIR Observation](https://www.hl7.org/fhir/R4/observation.html) + /// </summary> + internal partial class FhirR4Observation : FhirR4DomainResource + { + /// <summary> Initializes a new instance of <see cref="FhirR4Observation"/>. </summary> + /// <param name="status"> registered | preliminary | final | amended +. </param> + /// <param name="code"> Type of observation (code / type). </param> + /// <exception cref="ArgumentNullException"> <paramref name="code"/> is null. </exception> + public FhirR4Observation(ObservationStatusCodeType status, FhirR4CodeableConcept code) : base("Observation") + { + Argument.AssertNotNull(code, nameof(code)); + + Identifier = new ChangeTrackingList<FhirR4Identifier>(); + Status = status; + Category = new ChangeTrackingList<FhirR4CodeableConcept>(); + Code = code; + Interpretation = new ChangeTrackingList<FhirR4CodeableConcept>(); + Note = new ChangeTrackingList<FhirR4Annotation>(); + ReferenceRange = new ChangeTrackingList<FhirR4ObservationReferenceRange>(); + HasMember = new ChangeTrackingList<FhirR4Reference>(); + DerivedFrom = new ChangeTrackingList<FhirR4Reference>(); + Component = new ChangeTrackingList<FhirR4ObservationComponent>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Observation"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <param name="text"> Text summary of the resource, for human interpretation. </param> + /// <param name="contained"> Contained, inline Resources. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="modifierExtension"> Extensions that cannot be ignored. </param> + /// <param name="identifier"> Business Identifier for observation. </param> + /// <param name="status"> registered | preliminary | final | amended +. </param> + /// <param name="category"> Classification of type of observation. </param> + /// <param name="code"> Type of observation (code / type). </param> + /// <param name="subject"> Who and/or what the observation is about. </param> + /// <param name="encounter"> Healthcare event during which this observation is made. </param> + /// <param name="effectiveDateTime"> Clinically relevant time/time-period for observation. </param> + /// <param name="effectivePeriod"> Clinically relevant time/time-period for observation. </param> + /// <param name="effectiveInstant"> Clinically relevant time/time-period for observation. </param> + /// <param name="issued"> Date/Time this version was made available. </param> + /// <param name="valueQuantity"> Actual result. </param> + /// <param name="valueCodeableConcept"> Actual result. </param> + /// <param name="valueString"> Actual result. </param> + /// <param name="valueBoolean"> Actual result. </param> + /// <param name="valueInteger"> Actual result. </param> + /// <param name="valueRange"> Actual result. </param> + /// <param name="valueRatio"> Actual result. </param> + /// <param name="valueSampledData"> Actual result. </param> + /// <param name="valueTime"> Actual result. </param> + /// <param name="valueDateTime"> Actual result. </param> + /// <param name="valuePeriod"> Actual result. </param> + /// <param name="dataAbsentReason"> Why the result is missing. </param> + /// <param name="interpretation"> High, low, normal, etc. </param> + /// <param name="note"> Comments about the observation. </param> + /// <param name="bodySite"> Observed body part. </param> + /// <param name="method"> How it was done. </param> + /// <param name="referenceRange"> Provides guide for interpretation. </param> + /// <param name="hasMember"> Related resource that belongs to the Observation group. </param> + /// <param name="derivedFrom"> Related measurements the observation is made from. </param> + /// <param name="component"> Component results. </param> + internal FhirR4Observation(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties, FhirR4Narrative text, IList<FhirR4Resource> contained, IList<FhirR4Extension> extension, IList<FhirR4Extension> modifierExtension, IList<FhirR4Identifier> identifier, ObservationStatusCodeType status, IList<FhirR4CodeableConcept> category, FhirR4CodeableConcept code, FhirR4Reference subject, FhirR4Reference encounter, string effectiveDateTime, FhirR4Period effectivePeriod, string effectiveInstant, string issued, FhirR4Quantity valueQuantity, FhirR4CodeableConcept valueCodeableConcept, string valueString, bool? valueBoolean, int? valueInteger, FhirR4Range valueRange, FhirR4Ratio valueRatio, FhirR4SampledData valueSampledData, TimeSpan? valueTime, string valueDateTime, FhirR4Period valuePeriod, FhirR4CodeableConcept dataAbsentReason, IList<FhirR4CodeableConcept> interpretation, IList<FhirR4Annotation> note, FhirR4CodeableConcept bodySite, FhirR4CodeableConcept method, IList<FhirR4ObservationReferenceRange> referenceRange, IList<FhirR4Reference> hasMember, IList<FhirR4Reference> derivedFrom, IList<FhirR4ObservationComponent> component) : base(resourceType, id, meta, implicitRules, language, additionalProperties, text, contained, extension, modifierExtension) + { + Identifier = identifier; + Status = status; + Category = category; + Code = code; + Subject = subject; + Encounter = encounter; + EffectiveDateTime = effectiveDateTime; + EffectivePeriod = effectivePeriod; + EffectiveInstant = effectiveInstant; + Issued = issued; + ValueQuantity = valueQuantity; + ValueCodeableConcept = valueCodeableConcept; + ValueString = valueString; + ValueBoolean = valueBoolean; + ValueInteger = valueInteger; + ValueRange = valueRange; + ValueRatio = valueRatio; + ValueSampledData = valueSampledData; + ValueTime = valueTime; + ValueDateTime = valueDateTime; + ValuePeriod = valuePeriod; + DataAbsentReason = dataAbsentReason; + Interpretation = interpretation; + Note = note; + BodySite = bodySite; + Method = method; + ReferenceRange = referenceRange; + HasMember = hasMember; + DerivedFrom = derivedFrom; + Component = component; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Observation"/> for deserialization. </summary> + internal FhirR4Observation() + { + } + + /// <summary> Business Identifier for observation. </summary> + public IList<FhirR4Identifier> Identifier { get; } + /// <summary> registered | preliminary | final | amended +. </summary> + public ObservationStatusCodeType Status { get; set; } + /// <summary> Classification of type of observation. </summary> + public IList<FhirR4CodeableConcept> Category { get; } + /// <summary> Type of observation (code / type). </summary> + public FhirR4CodeableConcept Code { get; set; } + /// <summary> Who and/or what the observation is about. </summary> + public FhirR4Reference Subject { get; set; } + /// <summary> Healthcare event during which this observation is made. </summary> + public FhirR4Reference Encounter { get; set; } + /// <summary> Clinically relevant time/time-period for observation. </summary> + public string EffectiveDateTime { get; set; } + /// <summary> Clinically relevant time/time-period for observation. </summary> + public FhirR4Period EffectivePeriod { get; set; } + /// <summary> Clinically relevant time/time-period for observation. </summary> + public string EffectiveInstant { get; set; } + /// <summary> Date/Time this version was made available. </summary> + public string Issued { get; set; } + /// <summary> Actual result. </summary> + public FhirR4Quantity ValueQuantity { get; set; } + /// <summary> Actual result. </summary> + public FhirR4CodeableConcept ValueCodeableConcept { get; set; } + /// <summary> Actual result. </summary> + public string ValueString { get; set; } + /// <summary> Actual result. </summary> + public bool? ValueBoolean { get; set; } + /// <summary> Actual result. </summary> + public int? ValueInteger { get; set; } + /// <summary> Actual result. </summary> + public FhirR4Range ValueRange { get; set; } + /// <summary> Actual result. </summary> + public FhirR4Ratio ValueRatio { get; set; } + /// <summary> Actual result. </summary> + public FhirR4SampledData ValueSampledData { get; set; } + /// <summary> Actual result. </summary> + public TimeSpan? ValueTime { get; set; } + /// <summary> Actual result. </summary> + public string ValueDateTime { get; set; } + /// <summary> Actual result. </summary> + public FhirR4Period ValuePeriod { get; set; } + /// <summary> Why the result is missing. </summary> + public FhirR4CodeableConcept DataAbsentReason { get; set; } + /// <summary> High, low, normal, etc. </summary> + public IList<FhirR4CodeableConcept> Interpretation { get; } + /// <summary> Comments about the observation. </summary> + public IList<FhirR4Annotation> Note { get; } + /// <summary> Observed body part. </summary> + public FhirR4CodeableConcept BodySite { get; set; } + /// <summary> How it was done. </summary> + public FhirR4CodeableConcept Method { get; set; } + /// <summary> Provides guide for interpretation. </summary> + public IList<FhirR4ObservationReferenceRange> ReferenceRange { get; } + /// <summary> Related resource that belongs to the Observation group. </summary> + public IList<FhirR4Reference> HasMember { get; } + /// <summary> Related measurements the observation is made from. </summary> + public IList<FhirR4Reference> DerivedFrom { get; } + /// <summary> Component results. </summary> + public IList<FhirR4ObservationComponent> Component { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationComponent.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationComponent.Serialization.cs new file mode 100644 index 0000000000000..dd571e94a61c8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationComponent.Serialization.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class FhirR4ObservationComponent : IUtf8JsonSerializable, IJsonModel<FhirR4ObservationComponent> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4ObservationComponent>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4ObservationComponent>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ObservationComponent>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ObservationComponent)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("code"u8); + writer.WriteObjectValue(Code); + if (Optional.IsDefined(ValueQuantity)) + { + writer.WritePropertyName("valueQuantity"u8); + writer.WriteObjectValue(ValueQuantity); + } + if (Optional.IsDefined(ValueCodeableConcept)) + { + writer.WritePropertyName("valueCodeableConcept"u8); + writer.WriteObjectValue(ValueCodeableConcept); + } + if (Optional.IsDefined(ValueString)) + { + writer.WritePropertyName("valueString"u8); + writer.WriteStringValue(ValueString); + } + if (Optional.IsDefined(ValueBoolean)) + { + writer.WritePropertyName("valueBoolean"u8); + writer.WriteBooleanValue(ValueBoolean.Value); + } + if (Optional.IsDefined(ValueInteger)) + { + writer.WritePropertyName("valueInteger"u8); + writer.WriteNumberValue(ValueInteger.Value); + } + if (Optional.IsDefined(ValueRange)) + { + writer.WritePropertyName("valueRange"u8); + writer.WriteObjectValue(ValueRange); + } + if (Optional.IsDefined(ValueRatio)) + { + writer.WritePropertyName("valueRatio"u8); + writer.WriteObjectValue(ValueRatio); + } + if (Optional.IsDefined(ValueSampledData)) + { + writer.WritePropertyName("valueSampledData"u8); + writer.WriteObjectValue(ValueSampledData); + } + if (Optional.IsDefined(ValueTime)) + { + writer.WritePropertyName("valueTime"u8); + writer.WriteStringValue(ValueTime.Value, "T"); + } + if (Optional.IsDefined(ValueDateTime)) + { + writer.WritePropertyName("valueDateTime"u8); + writer.WriteStringValue(ValueDateTime); + } + if (Optional.IsDefined(ValuePeriod)) + { + writer.WritePropertyName("valuePeriod"u8); + writer.WriteObjectValue(ValuePeriod); + } + if (Optional.IsDefined(ValueReference)) + { + writer.WritePropertyName("valueReference"u8); + writer.WriteObjectValue(ValueReference); + } + if (Optional.IsDefined(DataAbsentReason)) + { + writer.WritePropertyName("dataAbsentReason"u8); + writer.WriteObjectValue(DataAbsentReason); + } + if (Optional.IsCollectionDefined(Interpretation)) + { + writer.WritePropertyName("interpretation"u8); + writer.WriteStartArray(); + foreach (var item in Interpretation) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReferenceRange)) + { + writer.WritePropertyName("referenceRange"u8); + writer.WriteStartArray(); + foreach (var item in ReferenceRange) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4ObservationComponent IJsonModel<FhirR4ObservationComponent>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ObservationComponent>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ObservationComponent)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4ObservationComponent(document.RootElement, options); + } + + internal static FhirR4ObservationComponent DeserializeFhirR4ObservationComponent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FhirR4CodeableConcept code = default; + Optional<FhirR4Quantity> valueQuantity = default; + Optional<FhirR4CodeableConcept> valueCodeableConcept = default; + Optional<string> valueString = default; + Optional<bool> valueBoolean = default; + Optional<int> valueInteger = default; + Optional<FhirR4Range> valueRange = default; + Optional<FhirR4Ratio> valueRatio = default; + Optional<FhirR4SampledData> valueSampledData = default; + Optional<TimeSpan> valueTime = default; + Optional<string> valueDateTime = default; + Optional<FhirR4Period> valuePeriod = default; + Optional<FhirR4Reference> valueReference = default; + Optional<FhirR4CodeableConcept> dataAbsentReason = default; + Optional<IList<FhirR4CodeableConcept>> interpretation = default; + Optional<IList<FhirR4ObservationReferenceRange>> referenceRange = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("valueQuantity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueQuantity = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("valueCodeableConcept"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueCodeableConcept = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("valueString"u8)) + { + valueString = property.Value.GetString(); + continue; + } + if (property.NameEquals("valueBoolean"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueBoolean = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("valueInteger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueInteger = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("valueRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRange = FhirR4Range.DeserializeFhirR4Range(property.Value); + continue; + } + if (property.NameEquals("valueRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueRatio = FhirR4Ratio.DeserializeFhirR4Ratio(property.Value); + continue; + } + if (property.NameEquals("valueSampledData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueSampledData = FhirR4SampledData.DeserializeFhirR4SampledData(property.Value); + continue; + } + if (property.NameEquals("valueTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueTime = property.Value.GetTimeSpan("T"); + continue; + } + if (property.NameEquals("valueDateTime"u8)) + { + valueDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("valuePeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valuePeriod = FhirR4Period.DeserializeFhirR4Period(property.Value); + continue; + } + if (property.NameEquals("valueReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + valueReference = FhirR4Reference.DeserializeFhirR4Reference(property.Value); + continue; + } + if (property.NameEquals("dataAbsentReason"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataAbsentReason = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("interpretation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + interpretation = array; + continue; + } + if (property.NameEquals("referenceRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4ObservationReferenceRange> array = new List<FhirR4ObservationReferenceRange>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4ObservationReferenceRange.DeserializeFhirR4ObservationReferenceRange(item)); + } + referenceRange = array; + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4ObservationComponent(id.Value, Optional.ToList(extension), serializedAdditionalRawData, code, valueQuantity.Value, valueCodeableConcept.Value, valueString.Value, Optional.ToNullable(valueBoolean), Optional.ToNullable(valueInteger), valueRange.Value, valueRatio.Value, valueSampledData.Value, Optional.ToNullable(valueTime), valueDateTime.Value, valuePeriod.Value, valueReference.Value, dataAbsentReason.Value, Optional.ToList(interpretation), Optional.ToList(referenceRange)); + } + + BinaryData IPersistableModel<FhirR4ObservationComponent>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ObservationComponent>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4ObservationComponent)} does not support '{options.Format}' format."); + } + } + + FhirR4ObservationComponent IPersistableModel<FhirR4ObservationComponent>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ObservationComponent>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4ObservationComponent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4ObservationComponent)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4ObservationComponent>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4ObservationComponent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4ObservationComponent(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationComponent.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationComponent.cs new file mode 100644 index 0000000000000..b78b02cb8551f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationComponent.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Component results + /// Based on [FHIR Observation.component](https://www.hl7.org/fhir/R4/observation.html) + /// </summary> + internal partial class FhirR4ObservationComponent : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4ObservationComponent"/>. </summary> + /// <param name="code"> Type of component observation (code / type). </param> + /// <exception cref="ArgumentNullException"> <paramref name="code"/> is null. </exception> + public FhirR4ObservationComponent(FhirR4CodeableConcept code) + { + Argument.AssertNotNull(code, nameof(code)); + + Code = code; + Interpretation = new ChangeTrackingList<FhirR4CodeableConcept>(); + ReferenceRange = new ChangeTrackingList<FhirR4ObservationReferenceRange>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4ObservationComponent"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="code"> Type of component observation (code / type). </param> + /// <param name="valueQuantity"> Value as Quantity. </param> + /// <param name="valueCodeableConcept"> Value as CodeableConcept. </param> + /// <param name="valueString"> Value as string. </param> + /// <param name="valueBoolean"> Value as boolean. </param> + /// <param name="valueInteger"> Value as integer. </param> + /// <param name="valueRange"> Value as Range. </param> + /// <param name="valueRatio"> Value as Ratio. </param> + /// <param name="valueSampledData"> Value as SampledData. </param> + /// <param name="valueTime"> Value as time (hh:mm:ss). </param> + /// <param name="valueDateTime"> Value as dateTime. </param> + /// <param name="valuePeriod"> Value as Period. </param> + /// <param name="valueReference"> Value as reference. </param> + /// <param name="dataAbsentReason"> Why the component result is missing. </param> + /// <param name="interpretation"> High, low, normal, etc. </param> + /// <param name="referenceRange"> Provides guide for interpretation of component result. </param> + internal FhirR4ObservationComponent(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4CodeableConcept code, FhirR4Quantity valueQuantity, FhirR4CodeableConcept valueCodeableConcept, string valueString, bool? valueBoolean, int? valueInteger, FhirR4Range valueRange, FhirR4Ratio valueRatio, FhirR4SampledData valueSampledData, TimeSpan? valueTime, string valueDateTime, FhirR4Period valuePeriod, FhirR4Reference valueReference, FhirR4CodeableConcept dataAbsentReason, IList<FhirR4CodeableConcept> interpretation, IList<FhirR4ObservationReferenceRange> referenceRange) : base(id, extension, serializedAdditionalRawData) + { + Code = code; + ValueQuantity = valueQuantity; + ValueCodeableConcept = valueCodeableConcept; + ValueString = valueString; + ValueBoolean = valueBoolean; + ValueInteger = valueInteger; + ValueRange = valueRange; + ValueRatio = valueRatio; + ValueSampledData = valueSampledData; + ValueTime = valueTime; + ValueDateTime = valueDateTime; + ValuePeriod = valuePeriod; + ValueReference = valueReference; + DataAbsentReason = dataAbsentReason; + Interpretation = interpretation; + ReferenceRange = referenceRange; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4ObservationComponent"/> for deserialization. </summary> + internal FhirR4ObservationComponent() + { + } + + /// <summary> Type of component observation (code / type). </summary> + public FhirR4CodeableConcept Code { get; set; } + /// <summary> Value as Quantity. </summary> + public FhirR4Quantity ValueQuantity { get; set; } + /// <summary> Value as CodeableConcept. </summary> + public FhirR4CodeableConcept ValueCodeableConcept { get; set; } + /// <summary> Value as string. </summary> + public string ValueString { get; set; } + /// <summary> Value as boolean. </summary> + public bool? ValueBoolean { get; set; } + /// <summary> Value as integer. </summary> + public int? ValueInteger { get; set; } + /// <summary> Value as Range. </summary> + public FhirR4Range ValueRange { get; set; } + /// <summary> Value as Ratio. </summary> + public FhirR4Ratio ValueRatio { get; set; } + /// <summary> Value as SampledData. </summary> + public FhirR4SampledData ValueSampledData { get; set; } + /// <summary> Value as time (hh:mm:ss). </summary> + public TimeSpan? ValueTime { get; set; } + /// <summary> Value as dateTime. </summary> + public string ValueDateTime { get; set; } + /// <summary> Value as Period. </summary> + public FhirR4Period ValuePeriod { get; set; } + /// <summary> Value as reference. </summary> + public FhirR4Reference ValueReference { get; set; } + /// <summary> Why the component result is missing. </summary> + public FhirR4CodeableConcept DataAbsentReason { get; set; } + /// <summary> High, low, normal, etc. </summary> + public IList<FhirR4CodeableConcept> Interpretation { get; } + /// <summary> Provides guide for interpretation of component result. </summary> + public IList<FhirR4ObservationReferenceRange> ReferenceRange { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationReferenceRange.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationReferenceRange.Serialization.cs new file mode 100644 index 0000000000000..0f26225d6b9c9 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationReferenceRange.Serialization.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class FhirR4ObservationReferenceRange : IUtf8JsonSerializable, IJsonModel<FhirR4ObservationReferenceRange> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4ObservationReferenceRange>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4ObservationReferenceRange>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ObservationReferenceRange>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ObservationReferenceRange)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Low)) + { + writer.WritePropertyName("low"u8); + writer.WriteObjectValue(Low); + } + if (Optional.IsDefined(High)) + { + writer.WritePropertyName("high"u8); + writer.WriteObjectValue(High); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteObjectValue(Type); + } + if (Optional.IsCollectionDefined(AppliesTo)) + { + writer.WritePropertyName("appliesTo"u8); + writer.WriteStartArray(); + foreach (var item in AppliesTo) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Age)) + { + writer.WritePropertyName("age"u8); + writer.WriteObjectValue(Age); + } + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4ObservationReferenceRange IJsonModel<FhirR4ObservationReferenceRange>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ObservationReferenceRange>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4ObservationReferenceRange)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4ObservationReferenceRange(document.RootElement, options); + } + + internal static FhirR4ObservationReferenceRange DeserializeFhirR4ObservationReferenceRange(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Quantity> low = default; + Optional<FhirR4Quantity> high = default; + Optional<FhirR4CodeableConcept> type = default; + Optional<IList<FhirR4CodeableConcept>> appliesTo = default; + Optional<FhirR4Range> age = default; + Optional<string> text = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("low"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + low = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("high"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + high = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("appliesTo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + appliesTo = array; + continue; + } + if (property.NameEquals("age"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + age = FhirR4Range.DeserializeFhirR4Range(property.Value); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4ObservationReferenceRange(low.Value, high.Value, type.Value, Optional.ToList(appliesTo), age.Value, text.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FhirR4ObservationReferenceRange>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ObservationReferenceRange>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4ObservationReferenceRange)} does not support '{options.Format}' format."); + } + } + + FhirR4ObservationReferenceRange IPersistableModel<FhirR4ObservationReferenceRange>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4ObservationReferenceRange>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4ObservationReferenceRange(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4ObservationReferenceRange)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4ObservationReferenceRange>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4ObservationReferenceRange FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4ObservationReferenceRange(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationReferenceRange.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationReferenceRange.cs new file mode 100644 index 0000000000000..41f7c5ffbcf51 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4ObservationReferenceRange.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Provides guide for interpretation of component result + /// Based on [FHIR Observation.referenceRange](https://www.hl7.org/fhir/R4/observation.html) + /// </summary> + internal partial class FhirR4ObservationReferenceRange + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FhirR4ObservationReferenceRange"/>. </summary> + public FhirR4ObservationReferenceRange() + { + AppliesTo = new ChangeTrackingList<FhirR4CodeableConcept>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4ObservationReferenceRange"/>. </summary> + /// <param name="low"> Low Range, if relevant. </param> + /// <param name="high"> High Range, if relevant. </param> + /// <param name="type"> Reference range qualifier. </param> + /// <param name="appliesTo"> Reference range population. </param> + /// <param name="age"> Applicable age range, if relevant. </param> + /// <param name="text"> Text based reference range in an observation. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FhirR4ObservationReferenceRange(FhirR4Quantity low, FhirR4Quantity high, FhirR4CodeableConcept type, IList<FhirR4CodeableConcept> appliesTo, FhirR4Range age, string text, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Low = low; + High = high; + Type = type; + AppliesTo = appliesTo; + Age = age; + Text = text; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Low Range, if relevant. </summary> + public FhirR4Quantity Low { get; set; } + /// <summary> High Range, if relevant. </summary> + public FhirR4Quantity High { get; set; } + /// <summary> Reference range qualifier. </summary> + public FhirR4CodeableConcept Type { get; set; } + /// <summary> Reference range population. </summary> + public IList<FhirR4CodeableConcept> AppliesTo { get; } + /// <summary> Applicable age range, if relevant. </summary> + public FhirR4Range Age { get; set; } + /// <summary> Text based reference range in an observation. </summary> + public string Text { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Period.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Period.Serialization.cs new file mode 100644 index 0000000000000..b7b3ce37012d5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Period.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Period : IUtf8JsonSerializable, IJsonModel<FhirR4Period> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Period>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Period>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start); + } + if (Optional.IsDefined(End)) + { + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Period IJsonModel<FhirR4Period>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Period(document.RootElement, options); + } + + internal static FhirR4Period DeserializeFhirR4Period(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> start = default; + Optional<string> end = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + start = property.Value.GetString(); + continue; + } + if (property.NameEquals("end"u8)) + { + end = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Period(id.Value, Optional.ToList(extension), serializedAdditionalRawData, start.Value, end.Value); + } + + BinaryData IPersistableModel<FhirR4Period>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{options.Format}' format."); + } + } + + FhirR4Period IPersistableModel<FhirR4Period>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Period>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Period(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Period)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Period>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Period FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Period(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Period.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Period.cs new file mode 100644 index 0000000000000..c1e2d6ebbc572 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Period.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A time period defined by a start and end date and optionally time + /// Based on [FHIR Period](https://www.hl7.org/fhir/R4/datatypes.html#Period) + /// </summary> + public partial class FhirR4Period : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Period"/>. </summary> + public FhirR4Period() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Period"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> + internal FhirR4Period(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string start, string end) : base(id, extension, serializedAdditionalRawData) + { + Start = start; + End = end; + } + + /// <summary> Starting time with inclusive boundary. </summary> + public string Start { get; set; } + /// <summary> End time with inclusive boundary, if not ongoing. </summary> + public string End { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Quantity.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Quantity.Serialization.cs new file mode 100644 index 0000000000000..5247c79c70ee7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Quantity.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Quantity : IUtf8JsonSerializable, IJsonModel<FhirR4Quantity> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Quantity>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Quantity>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.Value); + } + if (Optional.IsDefined(Comparator)) + { + writer.WritePropertyName("comparator"u8); + writer.WriteStringValue(Comparator); + } + if (Optional.IsDefined(Unit)) + { + writer.WritePropertyName("unit"u8); + writer.WriteStringValue(Unit); + } + if (Optional.IsDefined(System)) + { + writer.WritePropertyName("system"u8); + writer.WriteStringValue(System); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Quantity IJsonModel<FhirR4Quantity>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Quantity(document.RootElement, options); + } + + internal static FhirR4Quantity DeserializeFhirR4Quantity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<double> value = default; + Optional<string> comparator = default; + Optional<string> unit = default; + Optional<string> system = default; + Optional<string> code = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("comparator"u8)) + { + comparator = property.Value.GetString(); + continue; + } + if (property.NameEquals("unit"u8)) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("system"u8)) + { + system = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Quantity(id.Value, Optional.ToList(extension), serializedAdditionalRawData, Optional.ToNullable(value), comparator.Value, unit.Value, system.Value, code.Value); + } + + BinaryData IPersistableModel<FhirR4Quantity>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{options.Format}' format."); + } + } + + FhirR4Quantity IPersistableModel<FhirR4Quantity>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Quantity>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Quantity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Quantity)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Quantity>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Quantity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Quantity(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Quantity.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Quantity.cs new file mode 100644 index 0000000000000..1540721f3f337 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Quantity.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A measured or measurable amount + /// Based on [FHIR Quantity](https://www.hl7.org/fhir/R4/datatypes.html#Quantity) + /// </summary> + public partial class FhirR4Quantity : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Quantity"/>. </summary> + public FhirR4Quantity() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Quantity"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="value"> Numerical value (with implicit precision). </param> + /// <param name="comparator"> < | <= | >= | > - how to understand the value. </param> + /// <param name="unit"> Unit representation. </param> + /// <param name="system"> System that defines coded unit form. </param> + /// <param name="code"> Coded form of the unit. </param> + internal FhirR4Quantity(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, double? value, string comparator, string unit, string system, string code) : base(id, extension, serializedAdditionalRawData) + { + Value = value; + Comparator = comparator; + Unit = unit; + System = system; + Code = code; + } + + /// <summary> Numerical value (with implicit precision). </summary> + public double? Value { get; set; } + /// <summary> < | <= | >= | > - how to understand the value. </summary> + public string Comparator { get; set; } + /// <summary> Unit representation. </summary> + public string Unit { get; set; } + /// <summary> System that defines coded unit form. </summary> + public string System { get; set; } + /// <summary> Coded form of the unit. </summary> + public string Code { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Range.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Range.Serialization.cs new file mode 100644 index 0000000000000..0e953904a6df8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Range.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Range : IUtf8JsonSerializable, IJsonModel<FhirR4Range> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Range>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Range>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Low)) + { + writer.WritePropertyName("low"u8); + writer.WriteObjectValue(Low); + } + if (Optional.IsDefined(High)) + { + writer.WritePropertyName("high"u8); + writer.WriteObjectValue(High); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Range IJsonModel<FhirR4Range>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Range(document.RootElement, options); + } + + internal static FhirR4Range DeserializeFhirR4Range(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Quantity> low = default; + Optional<FhirR4Quantity> high = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("low"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + low = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("high"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + high = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Range(id.Value, Optional.ToList(extension), serializedAdditionalRawData, low.Value, high.Value); + } + + BinaryData IPersistableModel<FhirR4Range>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{options.Format}' format."); + } + } + + FhirR4Range IPersistableModel<FhirR4Range>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Range>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Range(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Range)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Range>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Range FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Range(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Range.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Range.cs new file mode 100644 index 0000000000000..d4c694685dba8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Range.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A set of ordered Quantities defined by a low and high limit + /// Based on [FHIR Range](https://www.hl7.org/fhir/R4/datatypes.html#Range) + /// </summary> + public partial class FhirR4Range : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Range"/>. </summary> + public FhirR4Range() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Range"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="low"> Low limit. </param> + /// <param name="high"> High limit. </param> + internal FhirR4Range(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity low, FhirR4Quantity high) : base(id, extension, serializedAdditionalRawData) + { + Low = low; + High = high; + } + + /// <summary> Low limit. </summary> + public FhirR4Quantity Low { get; set; } + /// <summary> High limit. </summary> + public FhirR4Quantity High { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Ratio.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Ratio.Serialization.cs new file mode 100644 index 0000000000000..22458b0e184dc --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Ratio.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Ratio : IUtf8JsonSerializable, IJsonModel<FhirR4Ratio> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Ratio>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Ratio>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Numerator)) + { + writer.WritePropertyName("numerator"u8); + writer.WriteObjectValue(Numerator); + } + if (Optional.IsDefined(Denominator)) + { + writer.WritePropertyName("denominator"u8); + writer.WriteObjectValue(Denominator); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Ratio IJsonModel<FhirR4Ratio>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Ratio(document.RootElement, options); + } + + internal static FhirR4Ratio DeserializeFhirR4Ratio(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Quantity> numerator = default; + Optional<FhirR4Quantity> denominator = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numerator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numerator = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("denominator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + denominator = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Ratio(id.Value, Optional.ToList(extension), serializedAdditionalRawData, numerator.Value, denominator.Value); + } + + BinaryData IPersistableModel<FhirR4Ratio>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{options.Format}' format."); + } + } + + FhirR4Ratio IPersistableModel<FhirR4Ratio>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Ratio>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Ratio(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Ratio)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Ratio>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Ratio FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Ratio(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Ratio.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Ratio.cs new file mode 100644 index 0000000000000..65078b702198f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Ratio.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A ratio of two Quantity values - a numerator and a denominator + /// Based on [FHIR Ratio](https://www.hl7.org/fhir/R4/datatypes.html#Ratio) + /// </summary> + public partial class FhirR4Ratio : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Ratio"/>. </summary> + public FhirR4Ratio() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Ratio"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="numerator"> Numerator value. </param> + /// <param name="denominator"> Denominator value. </param> + internal FhirR4Ratio(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity numerator, FhirR4Quantity denominator) : base(id, extension, serializedAdditionalRawData) + { + Numerator = numerator; + Denominator = denominator; + } + + /// <summary> Numerator value. </summary> + public FhirR4Quantity Numerator { get; set; } + /// <summary> Denominator value. </summary> + public FhirR4Quantity Denominator { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Reference.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Reference.Serialization.cs new file mode 100644 index 0000000000000..961b56395e5a1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Reference.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Reference : IUtf8JsonSerializable, IJsonModel<FhirR4Reference> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Reference>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Reference>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Reference)) + { + writer.WritePropertyName("reference"u8); + writer.WriteStringValue(Reference); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (Optional.IsDefined(Identifier)) + { + writer.WritePropertyName("identifier"u8); + writer.WriteObjectValue(Identifier); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4Reference IJsonModel<FhirR4Reference>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Reference(document.RootElement, options); + } + + internal static FhirR4Reference DeserializeFhirR4Reference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<string> reference = default; + Optional<string> type = default; + Optional<FhirR4Identifier> identifier = default; + Optional<string> display = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reference"u8)) + { + reference = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("identifier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identifier = FhirR4Identifier.DeserializeFhirR4Identifier(property.Value); + continue; + } + if (property.NameEquals("display"u8)) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4Reference(id.Value, Optional.ToList(extension), serializedAdditionalRawData, reference.Value, type.Value, identifier.Value, display.Value); + } + + BinaryData IPersistableModel<FhirR4Reference>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{options.Format}' format."); + } + } + + FhirR4Reference IPersistableModel<FhirR4Reference>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Reference>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Reference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Reference)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Reference>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4Reference FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Reference(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Reference.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Reference.cs new file mode 100644 index 0000000000000..793da4e76f9fb --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Reference.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A reference from one resource to another + /// Based on [FHIR Reference](https://www.hl7.org/fhir/R4/references.html) + /// </summary> + public partial class FhirR4Reference : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4Reference"/>. </summary> + public FhirR4Reference() + { + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Reference"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="reference"> Literal reference, Relative, internal or absolute URL. </param> + /// <param name="type"> Type the reference refers to (e.g. "Patient"). </param> + /// <param name="identifier"> Logical reference, when literal reference is not known. </param> + /// <param name="display"> Text alternative for the resource. </param> + internal FhirR4Reference(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, string reference, string type, FhirR4Identifier identifier, string display) : base(id, extension, serializedAdditionalRawData) + { + Reference = reference; + Type = type; + Identifier = identifier; + Display = display; + } + + /// <summary> Literal reference, Relative, internal or absolute URL. </summary> + public string Reference { get; set; } + /// <summary> Type the reference refers to (e.g. "Patient"). </summary> + public string Type { get; set; } + /// <summary> Logical reference, when literal reference is not known. </summary> + public FhirR4Identifier Identifier { get; set; } + /// <summary> Text alternative for the resource. </summary> + public string Display { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Resource.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Resource.Serialization.cs new file mode 100644 index 0000000000000..8fe0fba78e52c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Resource.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4Resource : IUtf8JsonSerializable, IJsonModel<FhirR4Resource> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4Resource>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4Resource>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4Resource IJsonModel<FhirR4Resource>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4Resource(document.RootElement, options); + } + + internal static FhirR4Resource DeserializeFhirR4Resource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceType = default; + Optional<string> id = default; + Optional<FhirR4Meta> meta = default; + Optional<string> implicitRules = default; + Optional<string> language = default; + IDictionary<string, BinaryData> additionalProperties = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("meta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + meta = FhirR4Meta.DeserializeFhirR4Meta(property.Value); + continue; + } + if (property.NameEquals("implicitRules"u8)) + { + implicitRules = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new FhirR4Resource(resourceType, id.Value, meta.Value, implicitRules.Value, language.Value, additionalProperties); + } + + BinaryData IPersistableModel<FhirR4Resource>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{options.Format}' format."); + } + } + + FhirR4Resource IPersistableModel<FhirR4Resource>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4Resource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4Resource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4Resource)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4Resource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FhirR4Resource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4Resource(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Resource.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Resource.cs new file mode 100644 index 0000000000000..0163844cb117a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4Resource.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Resource is the ancestor of DomainResource from which most resources are derived. Bundle, Parameters, and Binary extend Resource directly. + /// Based on [FHIR Resource](https://www.hl7.org/fhir/r4/resource.html + /// </summary> + public partial class FhirR4Resource + { + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <exception cref="ArgumentNullException"> <paramref name="resourceType"/> is null. </exception> + public FhirR4Resource(string resourceType) + { + Argument.AssertNotNull(resourceType, nameof(resourceType)); + + ResourceType = resourceType; + AdditionalProperties = new ChangeTrackingDictionary<string, BinaryData>(); + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + internal FhirR4Resource(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties) + { + ResourceType = resourceType; + Id = id; + Meta = meta; + ImplicitRules = implicitRules; + Language = language; + AdditionalProperties = additionalProperties; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4Resource"/> for deserialization. </summary> + internal FhirR4Resource() + { + } + + /// <summary> The type of resource. </summary> + public string ResourceType { get; set; } + /// <summary> Resource Id. </summary> + public string Id { get; set; } + /// <summary> Metadata about the resource. </summary> + public FhirR4Meta Meta { get; set; } + /// <summary> A set of rules under which this content was created. </summary> + public string ImplicitRules { get; set; } + /// <summary> Language of the resource content. </summary> + public string Language { get; set; } + /// <summary> + /// Additional Properties + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + public IDictionary<string, BinaryData> AdditionalProperties { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4SampledData.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4SampledData.Serialization.cs new file mode 100644 index 0000000000000..3c99364da3ae4 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4SampledData.Serialization.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FhirR4SampledData : IUtf8JsonSerializable, IJsonModel<FhirR4SampledData> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4SampledData>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4SampledData>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("origin"u8); + writer.WriteObjectValue(Origin); + writer.WritePropertyName("period"u8); + writer.WriteNumberValue(Period); + if (Optional.IsDefined(Factor)) + { + writer.WritePropertyName("factor"u8); + writer.WriteNumberValue(Factor.Value); + } + if (Optional.IsDefined(LowerLimit)) + { + writer.WritePropertyName("lowerLimit"u8); + writer.WriteNumberValue(LowerLimit.Value); + } + if (Optional.IsDefined(UpperLimit)) + { + writer.WritePropertyName("upperLimit"u8); + writer.WriteNumberValue(UpperLimit.Value); + } + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions); + if (Optional.IsDefined(Data)) + { + writer.WritePropertyName("data"u8); + writer.WriteStringValue(Data); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FhirR4SampledData IJsonModel<FhirR4SampledData>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFhirR4SampledData(document.RootElement, options); + } + + internal static FhirR4SampledData DeserializeFhirR4SampledData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FhirR4Quantity origin = default; + double period = default; + Optional<double> factor = default; + Optional<double> lowerLimit = default; + Optional<double> upperLimit = default; + int dimensions = default; + Optional<string> data = default; + Optional<string> id = default; + Optional<IReadOnlyList<FhirR4Extension>> extension = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("origin"u8)) + { + origin = FhirR4Quantity.DeserializeFhirR4Quantity(property.Value); + continue; + } + if (property.NameEquals("period"u8)) + { + period = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("factor"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + factor = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("lowerLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lowerLimit = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("upperLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upperLimit = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("data"u8)) + { + data = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FhirR4SampledData(id.Value, Optional.ToList(extension), serializedAdditionalRawData, origin, period, Optional.ToNullable(factor), Optional.ToNullable(lowerLimit), Optional.ToNullable(upperLimit), dimensions, data.Value); + } + + BinaryData IPersistableModel<FhirR4SampledData>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{options.Format}' format."); + } + } + + FhirR4SampledData IPersistableModel<FhirR4SampledData>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4SampledData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFhirR4SampledData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4SampledData)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4SampledData>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new FhirR4SampledData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFhirR4SampledData(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4SampledData.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4SampledData.cs new file mode 100644 index 0000000000000..675c80700f40c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FhirR4SampledData.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// A series of measurements taken by a device + /// Based on [FHIR SampledData](https://www.hl7.org/fhir/R4/datatypes.html#SampledData) + /// </summary> + public partial class FhirR4SampledData : FhirR4Element + { + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/>. </summary> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <exception cref="ArgumentNullException"> <paramref name="origin"/> is null. </exception> + public FhirR4SampledData(FhirR4Quantity origin, double period, int dimensions) + { + Argument.AssertNotNull(origin, nameof(origin)); + + Origin = origin; + Period = period; + Dimensions = dimensions; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="factor"> Multiply data by this before adding to origin. </param> + /// <param name="lowerLimit"> Lower limit of detection. </param> + /// <param name="upperLimit"> Upper limit of detection. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <param name="data"> Decimal values with spaces, or "E" | "U" | "L". </param> + internal FhirR4SampledData(string id, IReadOnlyList<FhirR4Extension> extension, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4Quantity origin, double period, double? factor, double? lowerLimit, double? upperLimit, int dimensions, string data) : base(id, extension, serializedAdditionalRawData) + { + Origin = origin; + Period = period; + Factor = factor; + LowerLimit = lowerLimit; + UpperLimit = upperLimit; + Dimensions = dimensions; + Data = data; + } + + /// <summary> Initializes a new instance of <see cref="FhirR4SampledData"/> for deserialization. </summary> + internal FhirR4SampledData() + { + } + + /// <summary> Zero value and units. </summary> + public FhirR4Quantity Origin { get; set; } + /// <summary> Number of milliseconds between samples. </summary> + public double Period { get; set; } + /// <summary> Multiply data by this before adding to origin. </summary> + public double? Factor { get; set; } + /// <summary> Lower limit of detection. </summary> + public double? LowerLimit { get; set; } + /// <summary> Upper limit of detection. </summary> + public double? UpperLimit { get; set; } + /// <summary> Number of sample points at each time point. </summary> + public int Dimensions { get; set; } + /// <summary> Decimal values with spaces, or "E" | "U" | "L". </summary> + public string Data { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FindingOptions.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FindingOptions.Serialization.cs new file mode 100644 index 0000000000000..2cf0fead4a91e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FindingOptions.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FindingOptions : IUtf8JsonSerializable, IJsonModel<FindingOptions> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FindingOptions>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FindingOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FindingOptions>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FindingOptions)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ProvideFocusedSentenceEvidence)) + { + writer.WritePropertyName("provideFocusedSentenceEvidence"u8); + writer.WriteBooleanValue(ProvideFocusedSentenceEvidence.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FindingOptions IJsonModel<FindingOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FindingOptions>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FindingOptions)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFindingOptions(document.RootElement, options); + } + + internal static FindingOptions DeserializeFindingOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<bool> provideFocusedSentenceEvidence = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provideFocusedSentenceEvidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provideFocusedSentenceEvidence = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FindingOptions(Optional.ToNullable(provideFocusedSentenceEvidence), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FindingOptions>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FindingOptions>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FindingOptions)} does not support '{options.Format}' format."); + } + } + + FindingOptions IPersistableModel<FindingOptions>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FindingOptions>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFindingOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FindingOptions)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FindingOptions>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FindingOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFindingOptions(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FindingOptions.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FindingOptions.cs new file mode 100644 index 0000000000000..172eb91bedebf --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FindingOptions.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Finding options. </summary> + public partial class FindingOptions + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FindingOptions"/>. </summary> + public FindingOptions() + { + } + + /// <summary> Initializes a new instance of <see cref="FindingOptions"/>. </summary> + /// <param name="provideFocusedSentenceEvidence"> If this is true, provide the sentence that contains the first token of the finding's clinical indicator (i.e. the medical problem), if there is one. This sentence is provided as an extension with url 'ci_sentence', next to the token evidence. Default is false. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FindingOptions(bool? provideFocusedSentenceEvidence, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + ProvideFocusedSentenceEvidence = provideFocusedSentenceEvidence; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> If this is true, provide the sentence that contains the first token of the finding's clinical indicator (i.e. the medical problem), if there is one. This sentence is provided as an extension with url 'ci_sentence', next to the token evidence. Default is false. </summary> + public bool? ProvideFocusedSentenceEvidence { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FollowupRecommendationOptions.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FollowupRecommendationOptions.Serialization.cs new file mode 100644 index 0000000000000..4531455648c11 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FollowupRecommendationOptions.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class FollowupRecommendationOptions : IUtf8JsonSerializable, IJsonModel<FollowupRecommendationOptions> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FollowupRecommendationOptions>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FollowupRecommendationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FollowupRecommendationOptions>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FollowupRecommendationOptions)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IncludeRecommendationsWithNoSpecifiedModality)) + { + writer.WritePropertyName("includeRecommendationsWithNoSpecifiedModality"u8); + writer.WriteBooleanValue(IncludeRecommendationsWithNoSpecifiedModality.Value); + } + if (Optional.IsDefined(IncludeRecommendationsInReferences)) + { + writer.WritePropertyName("includeRecommendationsInReferences"u8); + writer.WriteBooleanValue(IncludeRecommendationsInReferences.Value); + } + if (Optional.IsDefined(ProvideFocusedSentenceEvidence)) + { + writer.WritePropertyName("provideFocusedSentenceEvidence"u8); + writer.WriteBooleanValue(ProvideFocusedSentenceEvidence.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FollowupRecommendationOptions IJsonModel<FollowupRecommendationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FollowupRecommendationOptions>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FollowupRecommendationOptions)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFollowupRecommendationOptions(document.RootElement, options); + } + + internal static FollowupRecommendationOptions DeserializeFollowupRecommendationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<bool> includeRecommendationsWithNoSpecifiedModality = default; + Optional<bool> includeRecommendationsInReferences = default; + Optional<bool> provideFocusedSentenceEvidence = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("includeRecommendationsWithNoSpecifiedModality"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeRecommendationsWithNoSpecifiedModality = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("includeRecommendationsInReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeRecommendationsInReferences = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("provideFocusedSentenceEvidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provideFocusedSentenceEvidence = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new FollowupRecommendationOptions(Optional.ToNullable(includeRecommendationsWithNoSpecifiedModality), Optional.ToNullable(includeRecommendationsInReferences), Optional.ToNullable(provideFocusedSentenceEvidence), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<FollowupRecommendationOptions>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FollowupRecommendationOptions>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FollowupRecommendationOptions)} does not support '{options.Format}' format."); + } + } + + FollowupRecommendationOptions IPersistableModel<FollowupRecommendationOptions>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FollowupRecommendationOptions>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFollowupRecommendationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FollowupRecommendationOptions)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FollowupRecommendationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static FollowupRecommendationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFollowupRecommendationOptions(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FollowupRecommendationOptions.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FollowupRecommendationOptions.cs new file mode 100644 index 0000000000000..691e9de234a3f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/FollowupRecommendationOptions.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Follow-up recommendation options. </summary> + public partial class FollowupRecommendationOptions + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="FollowupRecommendationOptions"/>. </summary> + public FollowupRecommendationOptions() + { + } + + /// <summary> Initializes a new instance of <see cref="FollowupRecommendationOptions"/>. </summary> + /// <param name="includeRecommendationsWithNoSpecifiedModality"> Include/Exclude follow-up recommendations without a specific radiology procedure. Default is false. </param> + /// <param name="includeRecommendationsInReferences"> Include/Exclude follow-up recommendations in references to a guideline or article. Default is false. </param> + /// <param name="provideFocusedSentenceEvidence"> If this is true, provide one or more sentences as evidence for the recommendation, next to the token evidence. The start and end positions of these sentences will be put in an extension with url 'modality_sentences'. Default is false. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal FollowupRecommendationOptions(bool? includeRecommendationsWithNoSpecifiedModality, bool? includeRecommendationsInReferences, bool? provideFocusedSentenceEvidence, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + IncludeRecommendationsWithNoSpecifiedModality = includeRecommendationsWithNoSpecifiedModality; + IncludeRecommendationsInReferences = includeRecommendationsInReferences; + ProvideFocusedSentenceEvidence = provideFocusedSentenceEvidence; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Include/Exclude follow-up recommendations without a specific radiology procedure. Default is false. </summary> + public bool? IncludeRecommendationsWithNoSpecifiedModality { get; set; } + /// <summary> Include/Exclude follow-up recommendations in references to a guideline or article. Default is false. </summary> + public bool? IncludeRecommendationsInReferences { get; set; } + /// <summary> If this is true, provide one or more sentences as evidence for the recommendation, next to the token evidence. The start and end positions of these sentences will be put in an extension with url 'modality_sentences'. Default is false. </summary> + public bool? ProvideFocusedSentenceEvidence { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/GenericProcedureRecommendation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/GenericProcedureRecommendation.Serialization.cs new file mode 100644 index 0000000000000..5b0de45b1287f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/GenericProcedureRecommendation.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class GenericProcedureRecommendation : IUtf8JsonSerializable, IJsonModel<GenericProcedureRecommendation> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<GenericProcedureRecommendation>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<GenericProcedureRecommendation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<GenericProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GenericProcedureRecommendation)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("code"u8); + writer.WriteObjectValue(Code); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GenericProcedureRecommendation IJsonModel<GenericProcedureRecommendation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<GenericProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GenericProcedureRecommendation)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGenericProcedureRecommendation(document.RootElement, options); + } + + internal static GenericProcedureRecommendation DeserializeGenericProcedureRecommendation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FhirR4CodeableConcept code = default; + Optional<string> description = default; + string kind = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new GenericProcedureRecommendation(kind, serializedAdditionalRawData, code, description.Value); + } + + BinaryData IPersistableModel<GenericProcedureRecommendation>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<GenericProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GenericProcedureRecommendation)} does not support '{options.Format}' format."); + } + } + + GenericProcedureRecommendation IPersistableModel<GenericProcedureRecommendation>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<GenericProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGenericProcedureRecommendation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GenericProcedureRecommendation)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<GenericProcedureRecommendation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new GenericProcedureRecommendation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGenericProcedureRecommendation(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/GenericProcedureRecommendation.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/GenericProcedureRecommendation.cs new file mode 100644 index 0000000000000..0a1d865b924bb --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/GenericProcedureRecommendation.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Generic procedure information. </summary> + internal partial class GenericProcedureRecommendation : ProcedureRecommendation + { + /// <summary> Initializes a new instance of <see cref="GenericProcedureRecommendation"/>. </summary> + /// <param name="code"> Procedure modality : SNOMED CT code. </param> + /// <exception cref="ArgumentNullException"> <paramref name="code"/> is null. </exception> + internal GenericProcedureRecommendation(FhirR4CodeableConcept code) + { + Argument.AssertNotNull(code, nameof(code)); + + Kind = "genericProcedureRecommendation"; + Code = code; + } + + /// <summary> Initializes a new instance of <see cref="GenericProcedureRecommendation"/>. </summary> + /// <param name="kind"> Discriminator. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="code"> Procedure modality : SNOMED CT code. </param> + /// <param name="description"> Procedure description : MANAGEMENT PROCEDURE (PROCEDURE) or CONSULTATION (PROCEDURE) based on SNOMED CT. </param> + internal GenericProcedureRecommendation(string kind, IDictionary<string, BinaryData> serializedAdditionalRawData, FhirR4CodeableConcept code, string description) : base(kind, serializedAdditionalRawData) + { + Code = code; + Description = description; + } + + /// <summary> Initializes a new instance of <see cref="GenericProcedureRecommendation"/> for deserialization. </summary> + internal GenericProcedureRecommendation() + { + } + + /// <summary> Procedure modality : SNOMED CT code. </summary> + public FhirR4CodeableConcept Code { get; } + /// <summary> Procedure description : MANAGEMENT PROCEDURE (PROCEDURE) or CONSULTATION (PROCEDURE) based on SNOMED CT. </summary> + public string Description { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/HealthInsightsRadiologyInsightsClientBuilderExtensions.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/HealthInsightsRadiologyInsightsClientBuilderExtensions.cs new file mode 100644 index 0000000000000..e169c038f9bf8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/HealthInsightsRadiologyInsightsClientBuilderExtensions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using Azure; +using Azure.Core.Extensions; +using Azure.Health.Insights.RadiologyInsights; + +namespace Microsoft.Extensions.Azure +{ + /// <summary> Extension methods to add <see cref="RadiologyInsightsClient"/> to client builder. </summary> + public static partial class HealthInsightsRadiologyInsightsClientBuilderExtensions + { + /// <summary> Registers a <see cref="RadiologyInsightsClient"/> instance. </summary> + /// <param name="builder"> The builder to register with. </param> + /// <param name="endpoint"> Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). </param> + /// <param name="credential"> A credential used to authenticate to an Azure Service. </param> + public static IAzureClientBuilder<RadiologyInsightsClient, RadiologyInsightsClientOptions> AddRadiologyInsightsClient<TBuilder>(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory<RadiologyInsightsClient, RadiologyInsightsClientOptions>((options) => new RadiologyInsightsClient(endpoint, credential, options)); + } + + /// <summary> Registers a <see cref="RadiologyInsightsClient"/> instance. </summary> + /// <param name="builder"> The builder to register with. </param> + /// <param name="configuration"> The configuration values. </param> + public static IAzureClientBuilder<RadiologyInsightsClient, RadiologyInsightsClientOptions> AddRadiologyInsightsClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration> + { + return builder.RegisterClientFactory<RadiologyInsightsClient, RadiologyInsightsClientOptions>(configuration); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/HealthInsightsRadiologyInsightsModelFactory.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/HealthInsightsRadiologyInsightsModelFactory.cs new file mode 100644 index 0000000000000..4160b0ed34319 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/HealthInsightsRadiologyInsightsModelFactory.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Model factory for models. </summary> + public static partial class HealthInsightsRadiologyInsightsModelFactory + { + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.PatientRecord"/>. </summary> + /// <param name="id"> A given identifier for the patient. Has to be unique across all patients in a single request. </param> + /// <param name="info"> Patient structured information, including demographics and known structured clinical information. </param> + /// <param name="encounters"> Patient encounters/visits. </param> + /// <param name="patientDocuments"> Patient unstructured clinical data, given as documents. </param> + /// <returns> A new <see cref="RadiologyInsights.PatientRecord"/> instance for mocking. </returns> + public static PatientRecord PatientRecord(string id = null, PatientDetails info = null, IEnumerable<Encounter> encounters = null, IEnumerable<PatientDocument> patientDocuments = null) + { + encounters ??= new List<Encounter>(); + patientDocuments ??= new List<PatientDocument>(); + + return new PatientRecord(id, info, encounters?.ToList(), patientDocuments?.ToList(), serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Element"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Element"/> instance for mocking. </returns> + public static FhirR4Element FhirR4Element(string id = null, IEnumerable<FhirR4Extension> extension = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Element(id, extension?.ToList(), serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Extension"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="url"> Source of the definition for the extension code - a logical name or a URL. </param> + /// <param name="valueQuantity"> Value as Quantity. </param> + /// <param name="valueCodeableConcept"> Value as CodeableConcept. </param> + /// <param name="valueString"> Value as string. </param> + /// <param name="valueBoolean"> Value as boolean. </param> + /// <param name="valueInteger"> Value as integer. </param> + /// <param name="valueRange"> Value as Range. </param> + /// <param name="valueRatio"> Value as Ratio. </param> + /// <param name="valueSampledData"> Value as SampledData. </param> + /// <param name="valueTime"> Value as time (hh:mm:ss). </param> + /// <param name="valueDateTime"> Value as dateTime. </param> + /// <param name="valuePeriod"> Value as Period. </param> + /// <param name="valueReference"> Value as reference. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Extension"/> instance for mocking. </returns> + public static FhirR4Extension FhirR4Extension(string id = null, IEnumerable<FhirR4Extension> extension = null, string url = null, FhirR4Quantity valueQuantity = null, FhirR4CodeableConcept valueCodeableConcept = null, string valueString = null, bool? valueBoolean = null, int? valueInteger = null, FhirR4Range valueRange = null, FhirR4Ratio valueRatio = null, FhirR4SampledData valueSampledData = null, TimeSpan? valueTime = null, string valueDateTime = null, FhirR4Period valuePeriod = null, FhirR4Reference valueReference = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Extension(id, extension?.ToList(), serializedAdditionalRawData: null, url, valueQuantity, valueCodeableConcept, valueString, valueBoolean, valueInteger, valueRange, valueRatio, valueSampledData, valueTime, valueDateTime, valuePeriod, valueReference); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Quantity"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="value"> Numerical value (with implicit precision). </param> + /// <param name="comparator"> < | <= | >= | > - how to understand the value. </param> + /// <param name="unit"> Unit representation. </param> + /// <param name="system"> System that defines coded unit form. </param> + /// <param name="code"> Coded form of the unit. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Quantity"/> instance for mocking. </returns> + public static FhirR4Quantity FhirR4Quantity(string id = null, IEnumerable<FhirR4Extension> extension = null, double? value = null, string comparator = null, string unit = null, string system = null, string code = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Quantity(id, extension?.ToList(), serializedAdditionalRawData: null, value, comparator, unit, system, code); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4CodeableConcept"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="coding"> Code defined by a terminology system. </param> + /// <param name="text"> Plain text representation of the concept. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4CodeableConcept"/> instance for mocking. </returns> + public static FhirR4CodeableConcept FhirR4CodeableConcept(string id = null, IEnumerable<FhirR4Extension> extension = null, IEnumerable<FhirR4Coding> coding = null, string text = null) + { + extension ??= new List<FhirR4Extension>(); + coding ??= new List<FhirR4Coding>(); + + return new FhirR4CodeableConcept(id, extension?.ToList(), serializedAdditionalRawData: null, coding?.ToList(), text); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Coding"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="system"> Identity of the terminology system. </param> + /// <param name="version"> Version of the system - if relevant. </param> + /// <param name="code"> Symbol in syntax defined by the system. </param> + /// <param name="display"> Representation defined by the system. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Coding"/> instance for mocking. </returns> + public static FhirR4Coding FhirR4Coding(string id = null, IEnumerable<FhirR4Extension> extension = null, string system = null, string version = null, string code = null, string display = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Coding(id, extension?.ToList(), serializedAdditionalRawData: null, system, version, code, display); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Range"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="low"> Low limit. </param> + /// <param name="high"> High limit. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Range"/> instance for mocking. </returns> + public static FhirR4Range FhirR4Range(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity low = null, FhirR4Quantity high = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Range(id, extension?.ToList(), serializedAdditionalRawData: null, low, high); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Ratio"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="numerator"> Numerator value. </param> + /// <param name="denominator"> Denominator value. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Ratio"/> instance for mocking. </returns> + public static FhirR4Ratio FhirR4Ratio(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity numerator = null, FhirR4Quantity denominator = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Ratio(id, extension?.ToList(), serializedAdditionalRawData: null, numerator, denominator); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4SampledData"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="origin"> Zero value and units. </param> + /// <param name="period"> Number of milliseconds between samples. </param> + /// <param name="factor"> Multiply data by this before adding to origin. </param> + /// <param name="lowerLimit"> Lower limit of detection. </param> + /// <param name="upperLimit"> Upper limit of detection. </param> + /// <param name="dimensions"> Number of sample points at each time point. </param> + /// <param name="data"> Decimal values with spaces, or "E" | "U" | "L". </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4SampledData"/> instance for mocking. </returns> + public static FhirR4SampledData FhirR4SampledData(string id = null, IEnumerable<FhirR4Extension> extension = null, FhirR4Quantity origin = null, double period = default, double? factor = null, double? lowerLimit = null, double? upperLimit = null, int dimensions = default, string data = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4SampledData(id, extension?.ToList(), serializedAdditionalRawData: null, origin, period, factor, lowerLimit, upperLimit, dimensions, data); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Period"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Period"/> instance for mocking. </returns> + public static FhirR4Period FhirR4Period(string id = null, IEnumerable<FhirR4Extension> extension = null, string start = null, string end = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Period(id, extension?.ToList(), serializedAdditionalRawData: null, start, end); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Reference"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="reference"> Literal reference, Relative, internal or absolute URL. </param> + /// <param name="type"> Type the reference refers to (e.g. "Patient"). </param> + /// <param name="identifier"> Logical reference, when literal reference is not known. </param> + /// <param name="display"> Text alternative for the resource. </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Reference"/> instance for mocking. </returns> + public static FhirR4Reference FhirR4Reference(string id = null, IEnumerable<FhirR4Extension> extension = null, string reference = null, string type = null, FhirR4Identifier identifier = null, string display = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Reference(id, extension?.ToList(), serializedAdditionalRawData: null, reference, type, identifier, display); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.FhirR4Identifier"/>. </summary> + /// <param name="id"> Unique id for inter-element referencing. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="use"> usual | official | temp | secondary | old (If known). </param> + /// <param name="type"> Description of identifier. </param> + /// <param name="system"> The namespace for the identifier value. </param> + /// <param name="value"> The value that is unique. </param> + /// <param name="period"> Time period when id is/was valid for use. </param> + /// <param name="assigner"> Organization that issued id (may be just text). </param> + /// <returns> A new <see cref="RadiologyInsights.FhirR4Identifier"/> instance for mocking. </returns> + public static FhirR4Identifier FhirR4Identifier(string id = null, IEnumerable<FhirR4Extension> extension = null, string use = null, FhirR4CodeableConcept type = null, string system = null, string value = null, FhirR4Period period = null, FhirR4Reference assigner = null) + { + extension ??= new List<FhirR4Extension>(); + + return new FhirR4Identifier(id, extension?.ToList(), serializedAdditionalRawData: null, use, type, system, value, period, assigner); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.Encounter"/>. </summary> + /// <param name="id"> The id of the visit. </param> + /// <param name="period"> + /// Time period of the visit. + /// In case of admission, use timePeriod.start to indicate the admission time and timePeriod.end to indicate the discharge time. + /// </param> + /// <param name="class"> The class of the encounter. </param> + /// <returns> A new <see cref="RadiologyInsights.Encounter"/> instance for mocking. </returns> + public static Encounter Encounter(string id = null, TimePeriod period = null, EncounterClass? @class = null) + { + return new Encounter(id, period, @class, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.PatientDocument"/>. </summary> + /// <param name="type"> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </param> + /// <param name="clinicalType"> The type of the clinical document. </param> + /// <param name="id"> A given identifier for the document. Has to be unique across all documents for a single patient. </param> + /// <param name="language"> A 2 letter ISO 639-1 representation of the language of the document. </param> + /// <param name="createdDateTime"> The date and time when the document was created. </param> + /// <param name="authors"> Document author(s). </param> + /// <param name="specialtyType"> specialty type the document. </param> + /// <param name="administrativeMetadata"> Administrative metadata for the document. </param> + /// <param name="content"> The content of the patient document. </param> + /// <returns> A new <see cref="RadiologyInsights.PatientDocument"/> instance for mocking. </returns> + public static PatientDocument PatientDocument(DocumentType type = default, ClinicalDocumentType? clinicalType = null, string id = null, string language = null, DateTimeOffset? createdDateTime = null, IEnumerable<DocumentAuthor> authors = null, SpecialtyType? specialtyType = null, DocumentAdministrativeMetadata administrativeMetadata = null, DocumentContent content = null) + { + authors ??= new List<DocumentAuthor>(); + + return new PatientDocument(type, clinicalType, id, language, createdDateTime, authors?.ToList(), specialtyType, administrativeMetadata, content, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.RadiologyInsightsInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> + /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> + /// <returns> A new <see cref="RadiologyInsights.RadiologyInsightsInferenceResult"/> instance for mocking. </returns> + public static RadiologyInsightsInferenceResult RadiologyInsightsInferenceResult(IEnumerable<RadiologyInsightsPatientResult> patientResults = null, string modelVersion = null) + { + patientResults ??= new List<RadiologyInsightsPatientResult>(); + + return new RadiologyInsightsInferenceResult(patientResults?.ToList(), modelVersion, serializedAdditionalRawData: null); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsights.RadiologyInsightsPatientResult"/>. </summary> + /// <param name="patientId"> Identifier given for the patient in the request. </param> + /// <param name="inferences"> The model's inferences for the given patient. </param> + /// <returns> A new <see cref="RadiologyInsights.RadiologyInsightsPatientResult"/> instance for mocking. </returns> + public static RadiologyInsightsPatientResult RadiologyInsightsPatientResult(string patientId = null, IEnumerable<FhirR4Extendible> inferences = null) + { + inferences ??= new List<FhirR4Extendible>(); + + return new RadiologyInsightsPatientResult(patientId, inferences?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedure.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedure.Serialization.cs new file mode 100644 index 0000000000000..0168abc3e01e7 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedure.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class ImagingProcedure : IUtf8JsonSerializable, IJsonModel<ImagingProcedure> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<ImagingProcedure>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<ImagingProcedure>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ImagingProcedure>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImagingProcedure)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modality"u8); + writer.WriteObjectValue(Modality); + writer.WritePropertyName("anatomy"u8); + writer.WriteObjectValue(Anatomy); + if (Optional.IsDefined(Laterality)) + { + writer.WritePropertyName("laterality"u8); + writer.WriteObjectValue(Laterality); + } + if (Optional.IsDefined(Contrast)) + { + writer.WritePropertyName("contrast"u8); + writer.WriteObjectValue(Contrast); + } + if (Optional.IsDefined(View)) + { + writer.WritePropertyName("view"u8); + writer.WriteObjectValue(View); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ImagingProcedure IJsonModel<ImagingProcedure>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ImagingProcedure>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImagingProcedure)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImagingProcedure(document.RootElement, options); + } + + internal static ImagingProcedure DeserializeImagingProcedure(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FhirR4CodeableConcept modality = default; + FhirR4CodeableConcept anatomy = default; + Optional<FhirR4CodeableConcept> laterality = default; + Optional<RadiologyCodeWithTypes> contrast = default; + Optional<RadiologyCodeWithTypes> view = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modality"u8)) + { + modality = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("anatomy"u8)) + { + anatomy = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("laterality"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + laterality = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("contrast"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + contrast = RadiologyCodeWithTypes.DeserializeRadiologyCodeWithTypes(property.Value); + continue; + } + if (property.NameEquals("view"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + view = RadiologyCodeWithTypes.DeserializeRadiologyCodeWithTypes(property.Value); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new ImagingProcedure(modality, anatomy, laterality.Value, contrast.Value, view.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<ImagingProcedure>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ImagingProcedure>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImagingProcedure)} does not support '{options.Format}' format."); + } + } + + ImagingProcedure IPersistableModel<ImagingProcedure>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ImagingProcedure>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImagingProcedure(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImagingProcedure)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<ImagingProcedure>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static ImagingProcedure FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImagingProcedure(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedure.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedure.cs new file mode 100644 index 0000000000000..a0cf85a763d25 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedure.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Imaging procedure. </summary> + internal partial class ImagingProcedure + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="ImagingProcedure"/>. </summary> + /// <param name="modality"> Modality : SNOMED CT code. </param> + /// <param name="anatomy"> Anatomy : SNOMED CT code. </param> + /// <exception cref="ArgumentNullException"> <paramref name="modality"/> or <paramref name="anatomy"/> is null. </exception> + internal ImagingProcedure(FhirR4CodeableConcept modality, FhirR4CodeableConcept anatomy) + { + Argument.AssertNotNull(modality, nameof(modality)); + Argument.AssertNotNull(anatomy, nameof(anatomy)); + + Modality = modality; + Anatomy = anatomy; + } + + /// <summary> Initializes a new instance of <see cref="ImagingProcedure"/>. </summary> + /// <param name="modality"> Modality : SNOMED CT code. </param> + /// <param name="anatomy"> Anatomy : SNOMED CT code. </param> + /// <param name="laterality"> Laterality : SNOMED CT code. </param> + /// <param name="contrast"> Contrast : see RadiologyCodeWithTypes (below). </param> + /// <param name="view"> View : see RadiologyCodeWithTypes (below). </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal ImagingProcedure(FhirR4CodeableConcept modality, FhirR4CodeableConcept anatomy, FhirR4CodeableConcept laterality, RadiologyCodeWithTypes contrast, RadiologyCodeWithTypes view, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Modality = modality; + Anatomy = anatomy; + Laterality = laterality; + Contrast = contrast; + View = view; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="ImagingProcedure"/> for deserialization. </summary> + internal ImagingProcedure() + { + } + + /// <summary> Modality : SNOMED CT code. </summary> + public FhirR4CodeableConcept Modality { get; } + /// <summary> Anatomy : SNOMED CT code. </summary> + public FhirR4CodeableConcept Anatomy { get; } + /// <summary> Laterality : SNOMED CT code. </summary> + public FhirR4CodeableConcept Laterality { get; } + /// <summary> Contrast : see RadiologyCodeWithTypes (below). </summary> + public RadiologyCodeWithTypes Contrast { get; } + /// <summary> View : see RadiologyCodeWithTypes (below). </summary> + public RadiologyCodeWithTypes View { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedureRecommendation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedureRecommendation.Serialization.cs new file mode 100644 index 0000000000000..620f377ef5f9b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedureRecommendation.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class ImagingProcedureRecommendation : IUtf8JsonSerializable, IJsonModel<ImagingProcedureRecommendation> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<ImagingProcedureRecommendation>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<ImagingProcedureRecommendation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ImagingProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImagingProcedureRecommendation)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ProcedureCodes)) + { + writer.WritePropertyName("procedureCodes"u8); + writer.WriteStartArray(); + foreach (var item in ProcedureCodes) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("imagingProcedures"u8); + writer.WriteStartArray(); + foreach (var item in ImagingProcedures) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ImagingProcedureRecommendation IJsonModel<ImagingProcedureRecommendation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ImagingProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImagingProcedureRecommendation)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImagingProcedureRecommendation(document.RootElement, options); + } + + internal static ImagingProcedureRecommendation DeserializeImagingProcedureRecommendation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<IReadOnlyList<FhirR4CodeableConcept>> procedureCodes = default; + IReadOnlyList<ImagingProcedure> imagingProcedures = default; + string kind = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("procedureCodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + procedureCodes = array; + continue; + } + if (property.NameEquals("imagingProcedures"u8)) + { + List<ImagingProcedure> array = new List<ImagingProcedure>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ImagingProcedure.DeserializeImagingProcedure(item)); + } + imagingProcedures = array; + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new ImagingProcedureRecommendation(kind, serializedAdditionalRawData, Optional.ToList(procedureCodes), imagingProcedures); + } + + BinaryData IPersistableModel<ImagingProcedureRecommendation>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ImagingProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImagingProcedureRecommendation)} does not support '{options.Format}' format."); + } + } + + ImagingProcedureRecommendation IPersistableModel<ImagingProcedureRecommendation>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ImagingProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImagingProcedureRecommendation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImagingProcedureRecommendation)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<ImagingProcedureRecommendation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new ImagingProcedureRecommendation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImagingProcedureRecommendation(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedureRecommendation.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedureRecommendation.cs new file mode 100644 index 0000000000000..b030315104611 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ImagingProcedureRecommendation.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Imaging procedures. </summary> + internal partial class ImagingProcedureRecommendation : ProcedureRecommendation + { + /// <summary> Initializes a new instance of <see cref="ImagingProcedureRecommendation"/>. </summary> + /// <param name="imagingProcedures"> Imaging procedures. </param> + /// <exception cref="ArgumentNullException"> <paramref name="imagingProcedures"/> is null. </exception> + internal ImagingProcedureRecommendation(IEnumerable<ImagingProcedure> imagingProcedures) + { + Argument.AssertNotNull(imagingProcedures, nameof(imagingProcedures)); + + Kind = "imagingProcedureRecommendation"; + ProcedureCodes = new ChangeTrackingList<FhirR4CodeableConcept>(); + ImagingProcedures = imagingProcedures.ToList(); + } + + /// <summary> Initializes a new instance of <see cref="ImagingProcedureRecommendation"/>. </summary> + /// <param name="kind"> Discriminator. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + /// <param name="procedureCodes"> LOINC codes for the procedure. </param> + /// <param name="imagingProcedures"> Imaging procedures. </param> + internal ImagingProcedureRecommendation(string kind, IDictionary<string, BinaryData> serializedAdditionalRawData, IReadOnlyList<FhirR4CodeableConcept> procedureCodes, IReadOnlyList<ImagingProcedure> imagingProcedures) : base(kind, serializedAdditionalRawData) + { + ProcedureCodes = procedureCodes; + ImagingProcedures = imagingProcedures; + } + + /// <summary> Initializes a new instance of <see cref="ImagingProcedureRecommendation"/> for deserialization. </summary> + internal ImagingProcedureRecommendation() + { + } + + /// <summary> LOINC codes for the procedure. </summary> + public IReadOnlyList<FhirR4CodeableConcept> ProcedureCodes { get; } + /// <summary> Imaging procedures. </summary> + public IReadOnlyList<ImagingProcedure> ImagingProcedures { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ObservationStatusCodeType.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ObservationStatusCodeType.cs new file mode 100644 index 0000000000000..8e98dd4831a33 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ObservationStatusCodeType.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// Observation Status + /// Based on [FHIR ObservationStatus](https://www.hl7.org/fhir/R4/valueset-observation-status.html) + /// </summary> + internal readonly partial struct ObservationStatusCodeType : IEquatable<ObservationStatusCodeType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="ObservationStatusCodeType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public ObservationStatusCodeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegisteredValue = "registered"; + private const string PreliminaryValue = "preliminary"; + private const string FinalValue = "final"; + private const string AmendedValue = "amended"; + private const string CorrectedValue = "corrected"; + private const string CancelledValue = "cancelled"; + private const string EnteredInErrorValue = "entered-in-error"; + private const string UnknownValue = "unknown"; + + /// <summary> The existence of the observation is registered, but there is no result yet available. </summary> + public static ObservationStatusCodeType Registered { get; } = new ObservationStatusCodeType(RegisteredValue); + /// <summary> This is an initial or interim observation: data may be incomplete or unverified. </summary> + public static ObservationStatusCodeType Preliminary { get; } = new ObservationStatusCodeType(PreliminaryValue); + /// <summary> The observation is complete and verified by an authorized person. </summary> + public static ObservationStatusCodeType Final { get; } = new ObservationStatusCodeType(FinalValue); + /// <summary> Subsequent to being Final, the observation has been modified subsequent. This includes updates/new information and corrections. </summary> + public static ObservationStatusCodeType Amended { get; } = new ObservationStatusCodeType(AmendedValue); + /// <summary> Subsequent to being Final, the observation has been modified to correct an error in the test result. </summary> + public static ObservationStatusCodeType Corrected { get; } = new ObservationStatusCodeType(CorrectedValue); + /// <summary> The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). </summary> + public static ObservationStatusCodeType Cancelled { get; } = new ObservationStatusCodeType(CancelledValue); + /// <summary> The observation has been withdrawn following previous final release. </summary> + public static ObservationStatusCodeType EnteredInError { get; } = new ObservationStatusCodeType(EnteredInErrorValue); + /// <summary> The observation status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". </summary> + public static ObservationStatusCodeType Unknown { get; } = new ObservationStatusCodeType(UnknownValue); + /// <summary> Determines if two <see cref="ObservationStatusCodeType"/> values are the same. </summary> + public static bool operator ==(ObservationStatusCodeType left, ObservationStatusCodeType right) => left.Equals(right); + /// <summary> Determines if two <see cref="ObservationStatusCodeType"/> values are not the same. </summary> + public static bool operator !=(ObservationStatusCodeType left, ObservationStatusCodeType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="ObservationStatusCodeType"/>. </summary> + public static implicit operator ObservationStatusCodeType(string value) => new ObservationStatusCodeType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ObservationStatusCodeType other && Equals(other); + /// <inheritdoc /> + public bool Equals(ObservationStatusCodeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDetails.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDetails.Serialization.cs new file mode 100644 index 0000000000000..8c6368ccdeb0f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDetails.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class PatientDetails : IUtf8JsonSerializable, IJsonModel<PatientDetails> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientDetails>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Sex)) + { + writer.WritePropertyName("sex"u8); + writer.WriteStringValue(Sex.Value.ToString()); + } + if (Optional.IsDefined(BirthDate)) + { + writer.WritePropertyName("birthDate"u8); + writer.WriteStringValue(BirthDate.Value, "D"); + } + if (Optional.IsCollectionDefined(ClinicalInfo)) + { + writer.WritePropertyName("clinicalInfo"u8); + writer.WriteStartArray(); + foreach (var item in ClinicalInfo) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientDetails IJsonModel<PatientDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientDetails(document.RootElement, options); + } + + internal static PatientDetails DeserializePatientDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<PatientSex> sex = default; + Optional<DateTimeOffset> birthDate = default; + Optional<IList<FhirR4Resource>> clinicalInfo = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sex = new PatientSex(property.Value.GetString()); + continue; + } + if (property.NameEquals("birthDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + birthDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("clinicalInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Resource> array = new List<FhirR4Resource>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Resource.DeserializeFhirR4Resource(item)); + } + clinicalInfo = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientDetails(Optional.ToNullable(sex), Optional.ToNullable(birthDate), Optional.ToList(clinicalInfo), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientDetails>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{options.Format}' format."); + } + } + + PatientDetails IPersistableModel<PatientDetails>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDetails>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientDetails)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientDetails>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientDetails(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDetails.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDetails.cs new file mode 100644 index 0000000000000..ce39c98a20acb --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDetails.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Patient structured information, including demographics and known structured clinical information. </summary> + public partial class PatientDetails + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientDetails"/>. </summary> + public PatientDetails() + { + ClinicalInfo = new ChangeTrackingList<FhirR4Resource>(); + } + + /// <summary> Initializes a new instance of <see cref="PatientDetails"/>. </summary> + /// <param name="sex"> The patient's sex. </param> + /// <param name="birthDate"> The patient's date of birth. </param> + /// <param name="clinicalInfo"> Known clinical information for the patient, structured. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientDetails(PatientSex? sex, DateTimeOffset? birthDate, IList<FhirR4Resource> clinicalInfo, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Sex = sex; + BirthDate = birthDate; + ClinicalInfo = clinicalInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> The patient's sex. </summary> + public PatientSex? Sex { get; set; } + /// <summary> The patient's date of birth. </summary> + public DateTimeOffset? BirthDate { get; set; } + /// <summary> Known clinical information for the patient, structured. </summary> + public IList<FhirR4Resource> ClinicalInfo { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDocument.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDocument.Serialization.cs new file mode 100644 index 0000000000000..3bf2ab2d0b454 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDocument.Serialization.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class PatientDocument : IUtf8JsonSerializable, IJsonModel<PatientDocument> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientDocument>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientDocument>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDocument>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientDocument)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(ClinicalType)) + { + writer.WritePropertyName("clinicalType"u8); + writer.WriteStringValue(ClinicalType.Value.ToString()); + } + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(CreatedDateTime)) + { + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime.Value, "O"); + } + if (Optional.IsCollectionDefined(Authors)) + { + writer.WritePropertyName("authors"u8); + writer.WriteStartArray(); + foreach (var item in Authors) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SpecialtyType)) + { + writer.WritePropertyName("specialtyType"u8); + writer.WriteStringValue(SpecialtyType.Value.ToString()); + } + if (Optional.IsDefined(AdministrativeMetadata)) + { + writer.WritePropertyName("administrativeMetadata"u8); + writer.WriteObjectValue(AdministrativeMetadata); + } + writer.WritePropertyName("content"u8); + writer.WriteObjectValue(Content); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientDocument IJsonModel<PatientDocument>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDocument>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientDocument)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientDocument(document.RootElement, options); + } + + internal static PatientDocument DeserializePatientDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentType type = default; + Optional<ClinicalDocumentType> clinicalType = default; + string id = default; + Optional<string> language = default; + Optional<DateTimeOffset> createdDateTime = default; + Optional<IList<DocumentAuthor>> authors = default; + Optional<SpecialtyType> specialtyType = default; + Optional<DocumentAdministrativeMetadata> administrativeMetadata = default; + DocumentContent content = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new DocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("clinicalType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clinicalType = new ClinicalDocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("authors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<DocumentAuthor> array = new List<DocumentAuthor>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentAuthor.DeserializeDocumentAuthor(item)); + } + authors = array; + continue; + } + if (property.NameEquals("specialtyType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + specialtyType = new SpecialtyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("administrativeMetadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + administrativeMetadata = DocumentAdministrativeMetadata.DeserializeDocumentAdministrativeMetadata(property.Value); + continue; + } + if (property.NameEquals("content"u8)) + { + content = DocumentContent.DeserializeDocumentContent(property.Value); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientDocument(type, Optional.ToNullable(clinicalType), id, language.Value, Optional.ToNullable(createdDateTime), Optional.ToList(authors), Optional.ToNullable(specialtyType), administrativeMetadata.Value, content, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientDocument>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDocument>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientDocument)} does not support '{options.Format}' format."); + } + } + + PatientDocument IPersistableModel<PatientDocument>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientDocument>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientDocument)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientDocument>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientDocument(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDocument.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDocument.cs new file mode 100644 index 0000000000000..73d97f5cffa53 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientDocument.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> A clinical document related to a patient. Document here is in the wide sense - not just a text document (note). </summary> + public partial class PatientDocument + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientDocument"/>. </summary> + /// <param name="type"> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </param> + /// <param name="id"> A given identifier for the document. Has to be unique across all documents for a single patient. </param> + /// <param name="content"> The content of the patient document. </param> + /// <exception cref="ArgumentNullException"> <paramref name="id"/> or <paramref name="content"/> is null. </exception> + public PatientDocument(DocumentType type, string id, DocumentContent content) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(content, nameof(content)); + + Type = type; + Id = id; + Authors = new ChangeTrackingList<DocumentAuthor>(); + Content = content; + } + + /// <summary> Initializes a new instance of <see cref="PatientDocument"/>. </summary> + /// <param name="type"> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </param> + /// <param name="clinicalType"> The type of the clinical document. </param> + /// <param name="id"> A given identifier for the document. Has to be unique across all documents for a single patient. </param> + /// <param name="language"> A 2 letter ISO 639-1 representation of the language of the document. </param> + /// <param name="createdDateTime"> The date and time when the document was created. </param> + /// <param name="authors"> Document author(s). </param> + /// <param name="specialtyType"> specialty type the document. </param> + /// <param name="administrativeMetadata"> Administrative metadata for the document. </param> + /// <param name="content"> The content of the patient document. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientDocument(DocumentType type, ClinicalDocumentType? clinicalType, string id, string language, DateTimeOffset? createdDateTime, IList<DocumentAuthor> authors, SpecialtyType? specialtyType, DocumentAdministrativeMetadata administrativeMetadata, DocumentContent content, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Type = type; + ClinicalType = clinicalType; + Id = id; + Language = language; + CreatedDateTime = createdDateTime; + Authors = authors; + SpecialtyType = specialtyType; + AdministrativeMetadata = administrativeMetadata; + Content = content; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="PatientDocument"/> for deserialization. </summary> + internal PatientDocument() + { + } + + /// <summary> The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). </summary> + public DocumentType Type { get; } + /// <summary> The type of the clinical document. </summary> + public ClinicalDocumentType? ClinicalType { get; set; } + /// <summary> A given identifier for the document. Has to be unique across all documents for a single patient. </summary> + public string Id { get; } + /// <summary> A 2 letter ISO 639-1 representation of the language of the document. </summary> + public string Language { get; set; } + /// <summary> The date and time when the document was created. </summary> + public DateTimeOffset? CreatedDateTime { get; set; } + /// <summary> Document author(s). </summary> + public IList<DocumentAuthor> Authors { get; } + /// <summary> specialty type the document. </summary> + public SpecialtyType? SpecialtyType { get; set; } + /// <summary> Administrative metadata for the document. </summary> + public DocumentAdministrativeMetadata AdministrativeMetadata { get; set; } + /// <summary> The content of the patient document. </summary> + public DocumentContent Content { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientRecord.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientRecord.Serialization.cs new file mode 100644 index 0000000000000..d46406baf3400 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientRecord.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class PatientRecord : IUtf8JsonSerializable, IJsonModel<PatientRecord> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<PatientRecord>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<PatientRecord>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientRecord>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientRecord)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Info)) + { + writer.WritePropertyName("info"u8); + writer.WriteObjectValue(Info); + } + if (Optional.IsCollectionDefined(Encounters)) + { + writer.WritePropertyName("encounters"u8); + writer.WriteStartArray(); + foreach (var item in Encounters) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PatientDocuments)) + { + writer.WritePropertyName("patientDocuments"u8); + writer.WriteStartArray(); + foreach (var item in PatientDocuments) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatientRecord IJsonModel<PatientRecord>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientRecord>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatientRecord)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatientRecord(document.RootElement, options); + } + + internal static PatientRecord DeserializePatientRecord(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + Optional<PatientDetails> info = default; + Optional<IList<Encounter>> encounters = default; + Optional<IList<PatientDocument>> patientDocuments = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("info"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + info = PatientDetails.DeserializePatientDetails(property.Value); + continue; + } + if (property.NameEquals("encounters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<Encounter> array = new List<Encounter>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Encounter.DeserializeEncounter(item)); + } + encounters = array; + continue; + } + if (property.NameEquals("patientDocuments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<PatientDocument> array = new List<PatientDocument>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PatientDocument.DeserializePatientDocument(item)); + } + patientDocuments = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new PatientRecord(id, info.Value, Optional.ToList(encounters), Optional.ToList(patientDocuments), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<PatientRecord>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientRecord>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PatientRecord)} does not support '{options.Format}' format."); + } + } + + PatientRecord IPersistableModel<PatientRecord>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<PatientRecord>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePatientRecord(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatientRecord)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<PatientRecord>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static PatientRecord FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePatientRecord(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientRecord.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientRecord.cs new file mode 100644 index 0000000000000..8e8c8d7ea17f6 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientRecord.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> A patient record, including their clinical information and data. </summary> + public partial class PatientRecord + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="PatientRecord"/>. </summary> + /// <param name="id"> A given identifier for the patient. Has to be unique across all patients in a single request. </param> + /// <exception cref="ArgumentNullException"> <paramref name="id"/> is null. </exception> + public PatientRecord(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Encounters = new ChangeTrackingList<Encounter>(); + PatientDocuments = new ChangeTrackingList<PatientDocument>(); + } + + /// <summary> Initializes a new instance of <see cref="PatientRecord"/>. </summary> + /// <param name="id"> A given identifier for the patient. Has to be unique across all patients in a single request. </param> + /// <param name="info"> Patient structured information, including demographics and known structured clinical information. </param> + /// <param name="encounters"> Patient encounters/visits. </param> + /// <param name="patientDocuments"> Patient unstructured clinical data, given as documents. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal PatientRecord(string id, PatientDetails info, IList<Encounter> encounters, IList<PatientDocument> patientDocuments, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Id = id; + Info = info; + Encounters = encounters; + PatientDocuments = patientDocuments; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="PatientRecord"/> for deserialization. </summary> + internal PatientRecord() + { + } + + /// <summary> A given identifier for the patient. Has to be unique across all patients in a single request. </summary> + public string Id { get; } + /// <summary> Patient structured information, including demographics and known structured clinical information. </summary> + public PatientDetails Info { get; set; } + /// <summary> Patient encounters/visits. </summary> + public IList<Encounter> Encounters { get; } + /// <summary> Patient unstructured clinical data, given as documents. </summary> + public IList<PatientDocument> PatientDocuments { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientSex.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientSex.cs new file mode 100644 index 0000000000000..68b7e9860e09a --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/PatientSex.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> The patient's sex. </summary> + public readonly partial struct PatientSex : IEquatable<PatientSex> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="PatientSex"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public PatientSex(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FemaleValue = "female"; + private const string MaleValue = "male"; + private const string UnspecifiedValue = "unspecified"; + + /// <summary> female. </summary> + public static PatientSex Female { get; } = new PatientSex(FemaleValue); + /// <summary> male. </summary> + public static PatientSex Male { get; } = new PatientSex(MaleValue); + /// <summary> unspecified. </summary> + public static PatientSex Unspecified { get; } = new PatientSex(UnspecifiedValue); + /// <summary> Determines if two <see cref="PatientSex"/> values are the same. </summary> + public static bool operator ==(PatientSex left, PatientSex right) => left.Equals(right); + /// <summary> Determines if two <see cref="PatientSex"/> values are not the same. </summary> + public static bool operator !=(PatientSex left, PatientSex right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="PatientSex"/>. </summary> + public static implicit operator PatientSex(string value) => new PatientSex(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatientSex other && Equals(other); + /// <inheritdoc /> + public bool Equals(PatientSex other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ProcedureRecommendation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ProcedureRecommendation.Serialization.cs new file mode 100644 index 0000000000000..f0b64739cce14 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ProcedureRecommendation.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + [PersistableModelProxy(typeof(UnknownProcedureRecommendation))] + internal partial class ProcedureRecommendation : IUtf8JsonSerializable, IJsonModel<ProcedureRecommendation> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<ProcedureRecommendation>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<ProcedureRecommendation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcedureRecommendation)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ProcedureRecommendation IJsonModel<ProcedureRecommendation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcedureRecommendation)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProcedureRecommendation(document.RootElement, options); + } + + internal static ProcedureRecommendation DeserializeProcedureRecommendation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "genericProcedureRecommendation": return GenericProcedureRecommendation.DeserializeGenericProcedureRecommendation(element); + case "imagingProcedureRecommendation": return ImagingProcedureRecommendation.DeserializeImagingProcedureRecommendation(element); + } + } + return UnknownProcedureRecommendation.DeserializeUnknownProcedureRecommendation(element); + } + + BinaryData IPersistableModel<ProcedureRecommendation>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProcedureRecommendation)} does not support '{options.Format}' format."); + } + } + + ProcedureRecommendation IPersistableModel<ProcedureRecommendation>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProcedureRecommendation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProcedureRecommendation)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<ProcedureRecommendation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static ProcedureRecommendation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProcedureRecommendation(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ProcedureRecommendation.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ProcedureRecommendation.cs new file mode 100644 index 0000000000000..ba76c20bed79e --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/ProcedureRecommendation.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> + /// The procedure recommendation can be a generic procedure or an imaging procedure. + /// Please note <see cref="ProcedureRecommendation"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include <see cref="GenericProcedureRecommendation"/> and <see cref="ImagingProcedureRecommendation"/>. + /// </summary> + internal abstract partial class ProcedureRecommendation + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private protected IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="ProcedureRecommendation"/>. </summary> + protected ProcedureRecommendation() + { + } + + /// <summary> Initializes a new instance of <see cref="ProcedureRecommendation"/>. </summary> + /// <param name="kind"> Discriminator. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal ProcedureRecommendation(string kind, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Kind = kind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Discriminator. </summary> + internal string Kind { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyCodeWithTypes.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyCodeWithTypes.Serialization.cs new file mode 100644 index 0000000000000..04f6dfa8df56b --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyCodeWithTypes.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class RadiologyCodeWithTypes : IUtf8JsonSerializable, IJsonModel<RadiologyCodeWithTypes> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<RadiologyCodeWithTypes>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<RadiologyCodeWithTypes>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyCodeWithTypes>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyCodeWithTypes)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("code"u8); + writer.WriteObjectValue(Code); + writer.WritePropertyName("types"u8); + writer.WriteStartArray(); + foreach (var item in Types) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RadiologyCodeWithTypes IJsonModel<RadiologyCodeWithTypes>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyCodeWithTypes>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyCodeWithTypes)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRadiologyCodeWithTypes(document.RootElement, options); + } + + internal static RadiologyCodeWithTypes DeserializeRadiologyCodeWithTypes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FhirR4CodeableConcept code = default; + IReadOnlyList<FhirR4CodeableConcept> types = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(property.Value); + continue; + } + if (property.NameEquals("types"u8)) + { + List<FhirR4CodeableConcept> array = new List<FhirR4CodeableConcept>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4CodeableConcept.DeserializeFhirR4CodeableConcept(item)); + } + types = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new RadiologyCodeWithTypes(code, types, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<RadiologyCodeWithTypes>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyCodeWithTypes>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RadiologyCodeWithTypes)} does not support '{options.Format}' format."); + } + } + + RadiologyCodeWithTypes IPersistableModel<RadiologyCodeWithTypes>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyCodeWithTypes>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRadiologyCodeWithTypes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RadiologyCodeWithTypes)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<RadiologyCodeWithTypes>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static RadiologyCodeWithTypes FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRadiologyCodeWithTypes(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyCodeWithTypes.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyCodeWithTypes.cs new file mode 100644 index 0000000000000..e7ebb4e482462 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyCodeWithTypes.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Radiology code with types : used in imaging procedure recommendation for contrast and view. </summary> + internal partial class RadiologyCodeWithTypes + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="RadiologyCodeWithTypes"/>. </summary> + /// <param name="code"> The SNOMED CT code indicates whether imaging was conducted with or without contrast in the case of contrast, and in the case of views, it denotes the number of views. </param> + /// <param name="types"> The collection of types will indicate the contrast substance used in the case of contrast and, in the case of views, it will specify the types of views, such as lateral and frontal, etc. </param> + /// <exception cref="ArgumentNullException"> <paramref name="code"/> or <paramref name="types"/> is null. </exception> + internal RadiologyCodeWithTypes(FhirR4CodeableConcept code, IEnumerable<FhirR4CodeableConcept> types) + { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(types, nameof(types)); + + Code = code; + Types = types.ToList(); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyCodeWithTypes"/>. </summary> + /// <param name="code"> The SNOMED CT code indicates whether imaging was conducted with or without contrast in the case of contrast, and in the case of views, it denotes the number of views. </param> + /// <param name="types"> The collection of types will indicate the contrast substance used in the case of contrast and, in the case of views, it will specify the types of views, such as lateral and frontal, etc. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal RadiologyCodeWithTypes(FhirR4CodeableConcept code, IReadOnlyList<FhirR4CodeableConcept> types, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Code = code; + Types = types; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="RadiologyCodeWithTypes"/> for deserialization. </summary> + internal RadiologyCodeWithTypes() + { + } + + /// <summary> The SNOMED CT code indicates whether imaging was conducted with or without contrast in the case of contrast, and in the case of views, it denotes the number of views. </summary> + public FhirR4CodeableConcept Code { get; } + /// <summary> The collection of types will indicate the contrast substance used in the case of contrast and, in the case of views, it will specify the types of views, such as lateral and frontal, etc. </summary> + public IReadOnlyList<FhirR4CodeableConcept> Types { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsClient.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsClient.cs new file mode 100644 index 0000000000000..7cb58557b40de --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsClient.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Health.Insights.RadiologyInsights +{ + // Data plane generated client. + /// <summary> The RadiologyInsights service client. </summary> + public partial class RadiologyInsightsClient + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// <summary> The ClientDiagnostics is used to provide tracing support for the client library. </summary> + internal ClientDiagnostics ClientDiagnostics { get; } + + /// <summary> The HTTP pipeline for sending and receiving REST requests and responses. </summary> + public virtual HttpPipeline Pipeline => _pipeline; + + /// <summary> Initializes a new instance of RadiologyInsightsClient for mocking. </summary> + protected RadiologyInsightsClient() + { + } + + /// <summary> Initializes a new instance of RadiologyInsightsClient. </summary> + /// <param name="endpoint"> Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). </param> + /// <param name="credential"> A credential used to authenticate to an Azure Service. </param> + /// <exception cref="ArgumentNullException"> <paramref name="endpoint"/> or <paramref name="credential"/> is null. </exception> + public RadiologyInsightsClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new RadiologyInsightsClientOptions()) + { + } + + /// <summary> Initializes a new instance of RadiologyInsightsClient. </summary> + /// <param name="endpoint"> Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). </param> + /// <param name="credential"> A credential used to authenticate to an Azure Service. </param> + /// <param name="options"> The options for configuring the client. </param> + /// <exception cref="ArgumentNullException"> <paramref name="endpoint"/> or <paramref name="credential"/> is null. </exception> + public RadiologyInsightsClient(Uri endpoint, AzureKeyCredential credential, RadiologyInsightsClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new RadiologyInsightsClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty<HttpPipelinePolicy>(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// <summary> Create Radiology Insights job. </summary> + /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> + /// <param name="radiologyInsightsData"> Contains the list of patients, and configuration data. </param> + /// <param name="cancellationToken"> The cancellation token to use. </param> + /// <exception cref="ArgumentNullException"> <paramref name="radiologyInsightsData"/> is null. </exception> + /// <remarks> Creates a Radiology Insights job with the given request body. </remarks> + /// <include file="Docs/RadiologyInsightsClient.xml" path="doc/members/member[@name='InferRadiologyInsightsAsync(WaitUntil,RadiologyInsightsData,CancellationToken)']/*" /> + public virtual async Task<Operation<RadiologyInsightsInferenceResult>> InferRadiologyInsightsAsync(WaitUntil waitUntil, RadiologyInsightsData radiologyInsightsData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(radiologyInsightsData, nameof(radiologyInsightsData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = radiologyInsightsData.ToRequestContent(); + Operation<BinaryData> response = await InferRadiologyInsightsAsync(waitUntil, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchRadiologyInsightsInferenceResultFromRadiologyInsightsResult, ClientDiagnostics, "RadiologyInsightsClient.InferRadiologyInsights"); + } + + /// <summary> Create Radiology Insights job. </summary> + /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> + /// <param name="radiologyInsightsData"> Contains the list of patients, and configuration data. </param> + /// <param name="cancellationToken"> The cancellation token to use. </param> + /// <exception cref="ArgumentNullException"> <paramref name="radiologyInsightsData"/> is null. </exception> + /// <remarks> Creates a Radiology Insights job with the given request body. </remarks> + /// <include file="Docs/RadiologyInsightsClient.xml" path="doc/members/member[@name='InferRadiologyInsights(WaitUntil,RadiologyInsightsData,CancellationToken)']/*" /> + public virtual Operation<RadiologyInsightsInferenceResult> InferRadiologyInsights(WaitUntil waitUntil, RadiologyInsightsData radiologyInsightsData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(radiologyInsightsData, nameof(radiologyInsightsData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = radiologyInsightsData.ToRequestContent(); + Operation<BinaryData> response = InferRadiologyInsights(waitUntil, content, context); + return ProtocolOperationHelpers.Convert(response, FetchRadiologyInsightsInferenceResultFromRadiologyInsightsResult, ClientDiagnostics, "RadiologyInsightsClient.InferRadiologyInsights"); + } + + /// <summary> + /// [Protocol Method] Create Radiology Insights job + /// <list type="bullet"> + /// <item> + /// <description> + /// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios. + /// </description> + /// </item> + /// <item> + /// <description> + /// Please try the simpler <see cref="InferRadiologyInsightsAsync(WaitUntil,RadiologyInsightsData,CancellationToken)"/> convenience overload with strongly typed models first. + /// </description> + /// </item> + /// </list> + /// </summary> + /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> + /// <param name="content"> The content to send as the body of the request. </param> + /// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param> + /// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception> + /// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception> + /// <returns> The <see cref="Operation"/> representing an asynchronous operation on the service. </returns> + /// <include file="Docs/RadiologyInsightsClient.xml" path="doc/members/member[@name='InferRadiologyInsightsAsync(WaitUntil,RequestContent,RequestContext)']/*" /> + public virtual async Task<Operation<BinaryData>> InferRadiologyInsightsAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("RadiologyInsightsClient.InferRadiologyInsights"); + scope.Start(); + try + { + using HttpMessage message = CreateInferRadiologyInsightsRequest(content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "RadiologyInsightsClient.InferRadiologyInsights", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// <summary> + /// [Protocol Method] Create Radiology Insights job + /// <list type="bullet"> + /// <item> + /// <description> + /// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios. + /// </description> + /// </item> + /// <item> + /// <description> + /// Please try the simpler <see cref="InferRadiologyInsights(WaitUntil,RadiologyInsightsData,CancellationToken)"/> convenience overload with strongly typed models first. + /// </description> + /// </item> + /// </list> + /// </summary> + /// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param> + /// <param name="content"> The content to send as the body of the request. </param> + /// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param> + /// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception> + /// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception> + /// <returns> The <see cref="Operation"/> representing an asynchronous operation on the service. </returns> + /// <include file="Docs/RadiologyInsightsClient.xml" path="doc/members/member[@name='InferRadiologyInsights(WaitUntil,RequestContent,RequestContext)']/*" /> + public virtual Operation<BinaryData> InferRadiologyInsights(WaitUntil waitUntil, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("RadiologyInsightsClient.InferRadiologyInsights"); + scope.Start(); + try + { + using HttpMessage message = CreateInferRadiologyInsightsRequest(content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "RadiologyInsightsClient.InferRadiologyInsights", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateInferRadiologyInsightsRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/health-insights", false); + uri.AppendPath("/radiology-insights/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + 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 _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + + private RadiologyInsightsInferenceResult FetchRadiologyInsightsInferenceResultFromRadiologyInsightsResult(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return RadiologyInsightsInferenceResult.DeserializeRadiologyInsightsInferenceResult(resultJsonElement); + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsClientOptions.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsClientOptions.cs new file mode 100644 index 0000000000000..14716cdb426db --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Client options for RadiologyInsightsClient. </summary> + public partial class RadiologyInsightsClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2023_09_01_Preview; + + /// <summary> The version of the service to use. </summary> + public enum ServiceVersion + { + /// <summary> Service version "2023-09-01-preview". </summary> + V2023_09_01_Preview = 1, + } + + internal string Version { get; } + + /// <summary> Initializes new instance of RadiologyInsightsClientOptions. </summary> + public RadiologyInsightsClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_09_01_Preview => "2023-09-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsData.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsData.Serialization.cs new file mode 100644 index 0000000000000..823b96191d7d2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsData.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class RadiologyInsightsData : IUtf8JsonSerializable, IJsonModel<RadiologyInsightsData> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<RadiologyInsightsData>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<RadiologyInsightsData>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsData)} does not support '{format}' format."); + } + + 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); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RadiologyInsightsData IJsonModel<RadiologyInsightsData>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsData>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsData)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRadiologyInsightsData(document.RootElement, options); + } + + internal static RadiologyInsightsData DeserializeRadiologyInsightsData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList<PatientRecord> patients = default; + Optional<RadiologyInsightsModelConfiguration> configuration = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patients"u8)) + { + List<PatientRecord> array = new List<PatientRecord>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PatientRecord.DeserializePatientRecord(item)); + } + patients = array; + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = RadiologyInsightsModelConfiguration.DeserializeRadiologyInsightsModelConfiguration(property.Value); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new RadiologyInsightsData(patients, configuration.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<RadiologyInsightsData>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RadiologyInsightsData)} does not support '{options.Format}' format."); + } + } + + RadiologyInsightsData IPersistableModel<RadiologyInsightsData>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsData>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRadiologyInsightsData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RadiologyInsightsData)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<RadiologyInsightsData>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static RadiologyInsightsData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRadiologyInsightsData(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsData.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsData.cs new file mode 100644 index 0000000000000..a118e80ad3f45 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsData.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Contains the list of patients, and configuration data. </summary> + public partial class RadiologyInsightsData + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsData"/>. </summary> + /// <param name="patients"> The list of patients, including their clinical information and data. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patients"/> is null. </exception> + public RadiologyInsightsData(IEnumerable<PatientRecord> patients) + { + Argument.AssertNotNull(patients, nameof(patients)); + + Patients = patients.ToList(); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsData"/>. </summary> + /// <param name="patients"> The list of patients, including their clinical information and data. </param> + /// <param name="configuration"> Configuration affecting the Radiology Insights model's inference. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal RadiologyInsightsData(IList<PatientRecord> patients, RadiologyInsightsModelConfiguration configuration, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Patients = patients; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsData"/> for deserialization. </summary> + internal RadiologyInsightsData() + { + } + + /// <summary> The list of patients, including their clinical information and data. </summary> + public IList<PatientRecord> Patients { get; } + /// <summary> Configuration affecting the Radiology Insights model's inference. </summary> + public RadiologyInsightsModelConfiguration Configuration { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceOptions.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceOptions.Serialization.cs new file mode 100644 index 0000000000000..e4c3ceca5bb78 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceOptions.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class RadiologyInsightsInferenceOptions : IUtf8JsonSerializable, IJsonModel<RadiologyInsightsInferenceOptions> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<RadiologyInsightsInferenceOptions>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<RadiologyInsightsInferenceOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsInferenceOptions>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsInferenceOptions)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FollowupRecommendationOptions)) + { + writer.WritePropertyName("followupRecommendationOptions"u8); + writer.WriteObjectValue(FollowupRecommendationOptions); + } + if (Optional.IsDefined(FindingOptions)) + { + writer.WritePropertyName("findingOptions"u8); + writer.WriteObjectValue(FindingOptions); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RadiologyInsightsInferenceOptions IJsonModel<RadiologyInsightsInferenceOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsInferenceOptions>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsInferenceOptions)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRadiologyInsightsInferenceOptions(document.RootElement, options); + } + + internal static RadiologyInsightsInferenceOptions DeserializeRadiologyInsightsInferenceOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FollowupRecommendationOptions> followupRecommendationOptions = default; + Optional<FindingOptions> findingOptions = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("followupRecommendationOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + followupRecommendationOptions = FollowupRecommendationOptions.DeserializeFollowupRecommendationOptions(property.Value); + continue; + } + if (property.NameEquals("findingOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + findingOptions = FindingOptions.DeserializeFindingOptions(property.Value); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new RadiologyInsightsInferenceOptions(followupRecommendationOptions.Value, findingOptions.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<RadiologyInsightsInferenceOptions>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsInferenceOptions>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RadiologyInsightsInferenceOptions)} does not support '{options.Format}' format."); + } + } + + RadiologyInsightsInferenceOptions IPersistableModel<RadiologyInsightsInferenceOptions>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsInferenceOptions>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRadiologyInsightsInferenceOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RadiologyInsightsInferenceOptions)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<RadiologyInsightsInferenceOptions>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static RadiologyInsightsInferenceOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRadiologyInsightsInferenceOptions(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceOptions.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceOptions.cs new file mode 100644 index 0000000000000..66db2f6242566 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceOptions.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Options regarding follow up recommendation inferences and finding inferences. </summary> + public partial class RadiologyInsightsInferenceOptions + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsInferenceOptions"/>. </summary> + public RadiologyInsightsInferenceOptions() + { + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsInferenceOptions"/>. </summary> + /// <param name="followupRecommendationOptions"> Follow-up recommendation options. </param> + /// <param name="findingOptions"> Finding options. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal RadiologyInsightsInferenceOptions(FollowupRecommendationOptions followupRecommendationOptions, FindingOptions findingOptions, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + FollowupRecommendationOptions = followupRecommendationOptions; + FindingOptions = findingOptions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Follow-up recommendation options. </summary> + public FollowupRecommendationOptions FollowupRecommendationOptions { get; set; } + /// <summary> Finding options. </summary> + public FindingOptions FindingOptions { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceResult.Serialization.cs new file mode 100644 index 0000000000000..6995a88b45f63 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceResult.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class RadiologyInsightsInferenceResult : IUtf8JsonSerializable, IJsonModel<RadiologyInsightsInferenceResult> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<RadiologyInsightsInferenceResult>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<RadiologyInsightsInferenceResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsInferenceResult>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsInferenceResult)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("patientResults"u8); + writer.WriteStartArray(); + foreach (var item in PatientResults) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("modelVersion"u8); + writer.WriteStringValue(ModelVersion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RadiologyInsightsInferenceResult IJsonModel<RadiologyInsightsInferenceResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsInferenceResult>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsInferenceResult)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRadiologyInsightsInferenceResult(document.RootElement, options); + } + + internal static RadiologyInsightsInferenceResult DeserializeRadiologyInsightsInferenceResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList<RadiologyInsightsPatientResult> patientResults = default; + string modelVersion = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patientResults"u8)) + { + List<RadiologyInsightsPatientResult> array = new List<RadiologyInsightsPatientResult>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RadiologyInsightsPatientResult.DeserializeRadiologyInsightsPatientResult(item)); + } + patientResults = array; + continue; + } + if (property.NameEquals("modelVersion"u8)) + { + modelVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new RadiologyInsightsInferenceResult(patientResults, modelVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<RadiologyInsightsInferenceResult>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsInferenceResult>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RadiologyInsightsInferenceResult)} does not support '{options.Format}' format."); + } + } + + RadiologyInsightsInferenceResult IPersistableModel<RadiologyInsightsInferenceResult>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsInferenceResult>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRadiologyInsightsInferenceResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RadiologyInsightsInferenceResult)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<RadiologyInsightsInferenceResult>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static RadiologyInsightsInferenceResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRadiologyInsightsInferenceResult(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceResult.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceResult.cs new file mode 100644 index 0000000000000..9bfcd2a9a0d20 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceResult.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> The inference results for the Radiology Insights request. If field 'status' has value 'succeeded', then field 'result' will contain an instance of RadiologyInsightsInferenceResult. </summary> + public partial class RadiologyInsightsInferenceResult + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> + /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patientResults"/> or <paramref name="modelVersion"/> is null. </exception> + internal RadiologyInsightsInferenceResult(IEnumerable<RadiologyInsightsPatientResult> patientResults, string modelVersion) + { + Argument.AssertNotNull(patientResults, nameof(patientResults)); + Argument.AssertNotNull(modelVersion, nameof(modelVersion)); + + PatientResults = patientResults.ToList(); + ModelVersion = modelVersion; + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsInferenceResult"/>. </summary> + /// <param name="patientResults"> Results for the patients given in the request. </param> + /// <param name="modelVersion"> The version of the model used for inference, expressed as the model date. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal RadiologyInsightsInferenceResult(IReadOnlyList<RadiologyInsightsPatientResult> patientResults, string modelVersion, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + PatientResults = patientResults; + ModelVersion = modelVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsInferenceResult"/> for deserialization. </summary> + internal RadiologyInsightsInferenceResult() + { + } + + /// <summary> Results for the patients given in the request. </summary> + public IReadOnlyList<RadiologyInsightsPatientResult> PatientResults { get; } + /// <summary> The version of the model used for inference, expressed as the model date. </summary> + public string ModelVersion { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceType.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceType.cs new file mode 100644 index 0000000000000..3732ff6a8bc1c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsInferenceType.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> A Radiology Insights inference types. </summary> + public readonly partial struct RadiologyInsightsInferenceType : IEquatable<RadiologyInsightsInferenceType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsInferenceType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public RadiologyInsightsInferenceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AgeMismatchValue = "ageMismatch"; + private const string LateralityDiscrepancyValue = "lateralityDiscrepancy"; + private const string SexMismatchValue = "sexMismatch"; + private const string CompleteOrderDiscrepancyValue = "completeOrderDiscrepancy"; + private const string LimitedOrderDiscrepancyValue = "limitedOrderDiscrepancy"; + private const string FindingValue = "finding"; + private const string CriticalResultValue = "criticalResult"; + private const string FollowupRecommendationValue = "followupRecommendation"; + private const string FollowupCommunicationValue = "followupCommunication"; + private const string RadiologyProcedureValue = "radiologyProcedure"; + + /// <summary> Age mismatch inference type. </summary> + public static RadiologyInsightsInferenceType AgeMismatch { get; } = new RadiologyInsightsInferenceType(AgeMismatchValue); + /// <summary> Laterality discrepancy inference type. </summary> + public static RadiologyInsightsInferenceType LateralityDiscrepancy { get; } = new RadiologyInsightsInferenceType(LateralityDiscrepancyValue); + /// <summary> Sex mismatch inference type. </summary> + public static RadiologyInsightsInferenceType SexMismatch { get; } = new RadiologyInsightsInferenceType(SexMismatchValue); + /// <summary> Complete order discrepancy inference type. </summary> + public static RadiologyInsightsInferenceType CompleteOrderDiscrepancy { get; } = new RadiologyInsightsInferenceType(CompleteOrderDiscrepancyValue); + /// <summary> Limited order discrepancy inference type. </summary> + public static RadiologyInsightsInferenceType LimitedOrderDiscrepancy { get; } = new RadiologyInsightsInferenceType(LimitedOrderDiscrepancyValue); + /// <summary> Finding inference type. </summary> + public static RadiologyInsightsInferenceType Finding { get; } = new RadiologyInsightsInferenceType(FindingValue); + /// <summary> Critical finding inference type. </summary> + public static RadiologyInsightsInferenceType CriticalResult { get; } = new RadiologyInsightsInferenceType(CriticalResultValue); + /// <summary> Recommendation inference type. </summary> + public static RadiologyInsightsInferenceType FollowupRecommendation { get; } = new RadiologyInsightsInferenceType(FollowupRecommendationValue); + /// <summary> Followup Communication inference type. </summary> + public static RadiologyInsightsInferenceType FollowupCommunication { get; } = new RadiologyInsightsInferenceType(FollowupCommunicationValue); + /// <summary> Radiology Procedure inference type. </summary> + public static RadiologyInsightsInferenceType RadiologyProcedure { get; } = new RadiologyInsightsInferenceType(RadiologyProcedureValue); + /// <summary> Determines if two <see cref="RadiologyInsightsInferenceType"/> values are the same. </summary> + public static bool operator ==(RadiologyInsightsInferenceType left, RadiologyInsightsInferenceType right) => left.Equals(right); + /// <summary> Determines if two <see cref="RadiologyInsightsInferenceType"/> values are not the same. </summary> + public static bool operator !=(RadiologyInsightsInferenceType left, RadiologyInsightsInferenceType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="RadiologyInsightsInferenceType"/>. </summary> + public static implicit operator RadiologyInsightsInferenceType(string value) => new RadiologyInsightsInferenceType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RadiologyInsightsInferenceType other && Equals(other); + /// <inheritdoc /> + public bool Equals(RadiologyInsightsInferenceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsModelConfiguration.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsModelConfiguration.Serialization.cs new file mode 100644 index 0000000000000..239dd9d884d29 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsModelConfiguration.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class RadiologyInsightsModelConfiguration : IUtf8JsonSerializable, IJsonModel<RadiologyInsightsModelConfiguration> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<RadiologyInsightsModelConfiguration>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<RadiologyInsightsModelConfiguration>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsModelConfiguration>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsModelConfiguration)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Verbose)) + { + writer.WritePropertyName("verbose"u8); + writer.WriteBooleanValue(Verbose.Value); + } + if (Optional.IsDefined(IncludeEvidence)) + { + writer.WritePropertyName("includeEvidence"u8); + writer.WriteBooleanValue(IncludeEvidence.Value); + } + if (Optional.IsCollectionDefined(InferenceTypes)) + { + writer.WritePropertyName("inferenceTypes"u8); + writer.WriteStartArray(); + foreach (var item in InferenceTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(InferenceOptions)) + { + writer.WritePropertyName("inferenceOptions"u8); + writer.WriteObjectValue(InferenceOptions); + } + if (Optional.IsDefined(Locale)) + { + writer.WritePropertyName("locale"u8); + writer.WriteStringValue(Locale); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RadiologyInsightsModelConfiguration IJsonModel<RadiologyInsightsModelConfiguration>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsModelConfiguration>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsModelConfiguration)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRadiologyInsightsModelConfiguration(document.RootElement, options); + } + + internal static RadiologyInsightsModelConfiguration DeserializeRadiologyInsightsModelConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<bool> verbose = default; + Optional<bool> includeEvidence = default; + Optional<IList<RadiologyInsightsInferenceType>> inferenceTypes = default; + Optional<RadiologyInsightsInferenceOptions> inferenceOptions = default; + Optional<string> locale = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("verbose"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + verbose = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("includeEvidence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeEvidence = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("inferenceTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<RadiologyInsightsInferenceType> array = new List<RadiologyInsightsInferenceType>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new RadiologyInsightsInferenceType(item.GetString())); + } + inferenceTypes = array; + continue; + } + if (property.NameEquals("inferenceOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inferenceOptions = RadiologyInsightsInferenceOptions.DeserializeRadiologyInsightsInferenceOptions(property.Value); + continue; + } + if (property.NameEquals("locale"u8)) + { + locale = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new RadiologyInsightsModelConfiguration(Optional.ToNullable(verbose), Optional.ToNullable(includeEvidence), Optional.ToList(inferenceTypes), inferenceOptions.Value, locale.Value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<RadiologyInsightsModelConfiguration>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsModelConfiguration>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RadiologyInsightsModelConfiguration)} does not support '{options.Format}' format."); + } + } + + RadiologyInsightsModelConfiguration IPersistableModel<RadiologyInsightsModelConfiguration>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsModelConfiguration>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRadiologyInsightsModelConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RadiologyInsightsModelConfiguration)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<RadiologyInsightsModelConfiguration>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static RadiologyInsightsModelConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRadiologyInsightsModelConfiguration(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsModelConfiguration.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsModelConfiguration.cs new file mode 100644 index 0000000000000..ad200ee61222f --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsModelConfiguration.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Configuration affecting the Radiology Insights model's inference. </summary> + public partial class RadiologyInsightsModelConfiguration + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsModelConfiguration"/>. </summary> + public RadiologyInsightsModelConfiguration() + { + InferenceTypes = new ChangeTrackingList<RadiologyInsightsInferenceType>(); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsModelConfiguration"/>. </summary> + /// <param name="verbose"> An indication whether the model should produce verbose output. </param> + /// <param name="includeEvidence"> An indication whether the model's output should include evidence for the inferences. </param> + /// <param name="inferenceTypes"> This is a list of inference types to be inferred for the current request. It could be used if only part of the Radiology Insights inferences are required. If this list is omitted or empty, the model will return all the inference types. </param> + /// <param name="inferenceOptions"> Options regarding follow up recommendation inferences and finding inferences. </param> + /// <param name="locale"> Local for the model to use. If not specified, the model will use the default locale. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal RadiologyInsightsModelConfiguration(bool? verbose, bool? includeEvidence, IList<RadiologyInsightsInferenceType> inferenceTypes, RadiologyInsightsInferenceOptions inferenceOptions, string locale, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Verbose = verbose; + IncludeEvidence = includeEvidence; + InferenceTypes = inferenceTypes; + InferenceOptions = inferenceOptions; + Locale = locale; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> An indication whether the model should produce verbose output. </summary> + public bool? Verbose { get; set; } + /// <summary> An indication whether the model's output should include evidence for the inferences. </summary> + public bool? IncludeEvidence { get; set; } + /// <summary> This is a list of inference types to be inferred for the current request. It could be used if only part of the Radiology Insights inferences are required. If this list is omitted or empty, the model will return all the inference types. </summary> + public IList<RadiologyInsightsInferenceType> InferenceTypes { get; } + /// <summary> Options regarding follow up recommendation inferences and finding inferences. </summary> + public RadiologyInsightsInferenceOptions InferenceOptions { get; set; } + /// <summary> Local for the model to use. If not specified, the model will use the default locale. </summary> + public string Locale { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsPatientResult.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsPatientResult.Serialization.cs new file mode 100644 index 0000000000000..06a4ecc703e26 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsPatientResult.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class RadiologyInsightsPatientResult : IUtf8JsonSerializable, IJsonModel<RadiologyInsightsPatientResult> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<RadiologyInsightsPatientResult>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<RadiologyInsightsPatientResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsPatientResult>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsPatientResult)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("patientId"u8); + writer.WriteStringValue(PatientId); + writer.WritePropertyName("inferences"u8); + writer.WriteStartArray(); + foreach (var item in Inferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RadiologyInsightsPatientResult IJsonModel<RadiologyInsightsPatientResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsPatientResult>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RadiologyInsightsPatientResult)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRadiologyInsightsPatientResult(document.RootElement, options); + } + + internal static RadiologyInsightsPatientResult DeserializeRadiologyInsightsPatientResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string patientId = default; + IReadOnlyList<FhirR4Extendible> inferences = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patientId"u8)) + { + patientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("inferences"u8)) + { + List<FhirR4Extendible> array = new List<FhirR4Extendible>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extendible.DeserializeFhirR4Extendible(item)); + } + inferences = array; + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new RadiologyInsightsPatientResult(patientId, inferences, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<RadiologyInsightsPatientResult>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsPatientResult>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RadiologyInsightsPatientResult)} does not support '{options.Format}' format."); + } + } + + RadiologyInsightsPatientResult IPersistableModel<RadiologyInsightsPatientResult>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<RadiologyInsightsPatientResult>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRadiologyInsightsPatientResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RadiologyInsightsPatientResult)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<RadiologyInsightsPatientResult>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static RadiologyInsightsPatientResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRadiologyInsightsPatientResult(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsPatientResult.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsPatientResult.cs new file mode 100644 index 0000000000000..427d34fc719ce --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/RadiologyInsightsPatientResult.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Results of the model's work for a single patient. </summary> + public partial class RadiologyInsightsPatientResult + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsPatientResult"/>. </summary> + /// <param name="patientId"> Identifier given for the patient in the request. </param> + /// <param name="inferences"> The model's inferences for the given patient. </param> + /// <exception cref="ArgumentNullException"> <paramref name="patientId"/> or <paramref name="inferences"/> is null. </exception> + internal RadiologyInsightsPatientResult(string patientId, IEnumerable<FhirR4Extendible> inferences) + { + Argument.AssertNotNull(patientId, nameof(patientId)); + Argument.AssertNotNull(inferences, nameof(inferences)); + + PatientId = patientId; + Inferences = inferences.ToList(); + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsPatientResult"/>. </summary> + /// <param name="patientId"> Identifier given for the patient in the request. </param> + /// <param name="inferences"> The model's inferences for the given patient. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal RadiologyInsightsPatientResult(string patientId, IReadOnlyList<FhirR4Extendible> inferences, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + PatientId = patientId; + Inferences = inferences; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Initializes a new instance of <see cref="RadiologyInsightsPatientResult"/> for deserialization. </summary> + internal RadiologyInsightsPatientResult() + { + } + + /// <summary> Identifier given for the patient in the request. </summary> + public string PatientId { get; } + /// <summary> The model's inferences for the given patient. </summary> + public IReadOnlyList<FhirR4Extendible> Inferences { get; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/SpecialtyType.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/SpecialtyType.cs new file mode 100644 index 0000000000000..801fc3573e0d2 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/SpecialtyType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Known values codes that can be used to indicate the type of the Specialty. </summary> + public readonly partial struct SpecialtyType : IEquatable<SpecialtyType> + { + private readonly string _value; + + /// <summary> Initializes a new instance of <see cref="SpecialtyType"/>. </summary> + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> + public SpecialtyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PathologyValue = "pathology"; + private const string RadiologyValue = "radiology"; + + /// <summary> pathology. </summary> + public static SpecialtyType Pathology { get; } = new SpecialtyType(PathologyValue); + /// <summary> radiology. </summary> + public static SpecialtyType Radiology { get; } = new SpecialtyType(RadiologyValue); + /// <summary> Determines if two <see cref="SpecialtyType"/> values are the same. </summary> + public static bool operator ==(SpecialtyType left, SpecialtyType right) => left.Equals(right); + /// <summary> Determines if two <see cref="SpecialtyType"/> values are not the same. </summary> + public static bool operator !=(SpecialtyType left, SpecialtyType right) => !left.Equals(right); + /// <summary> Converts a string to a <see cref="SpecialtyType"/>. </summary> + public static implicit operator SpecialtyType(string value) => new SpecialtyType(value); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SpecialtyType other && Equals(other); + /// <inheritdoc /> + public bool Equals(SpecialtyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// <inheritdoc /> + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// <inheritdoc /> + public override string ToString() => _value; + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/TimePeriod.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/TimePeriod.Serialization.cs new file mode 100644 index 0000000000000..3295f69de0369 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/TimePeriod.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + public partial class TimePeriod : IUtf8JsonSerializable, IJsonModel<TimePeriod> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<TimePeriod>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<TimePeriod>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start.Value, "O"); + } + if (Optional.IsDefined(End)) + { + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TimePeriod IJsonModel<TimePeriod>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTimePeriod(document.RootElement, options); + } + + internal static TimePeriod DeserializeTimePeriod(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<DateTimeOffset> start = default; + Optional<DateTimeOffset> end = default; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + start = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("end"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + end = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new TimePeriod(Optional.ToNullable(start), Optional.ToNullable(end), serializedAdditionalRawData); + } + + BinaryData IPersistableModel<TimePeriod>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{options.Format}' format."); + } + } + + TimePeriod IPersistableModel<TimePeriod>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<TimePeriod>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTimePeriod(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TimePeriod)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<TimePeriod>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static TimePeriod FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTimePeriod(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/TimePeriod.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/TimePeriod.cs new file mode 100644 index 0000000000000..e813081c92c71 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/TimePeriod.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> A duration of time during which an event is happening. </summary> + public partial class TimePeriod + { + /// <summary> + /// Keeps track of any properties unknown to the library. + /// <para> + /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>. + /// </para> + /// <para> + /// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>. + /// </para> + /// <para> + /// Examples: + /// <list type="bullet"> + /// <item> + /// <term>BinaryData.FromObjectAsJson("foo")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("\"foo\"")</term> + /// <description>Creates a payload of "foo".</description> + /// </item> + /// <item> + /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// <item> + /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term> + /// <description>Creates a payload of { "key": "value" }.</description> + /// </item> + /// </list> + /// </para> + /// </summary> + private IDictionary<string, BinaryData> _serializedAdditionalRawData; + + /// <summary> Initializes a new instance of <see cref="TimePeriod"/>. </summary> + public TimePeriod() + { + } + + /// <summary> Initializes a new instance of <see cref="TimePeriod"/>. </summary> + /// <param name="start"> Starting time with inclusive boundary. </param> + /// <param name="end"> End time with inclusive boundary, if not ongoing. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal TimePeriod(DateTimeOffset? start, DateTimeOffset? end, IDictionary<string, BinaryData> serializedAdditionalRawData) + { + Start = start; + End = end; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// <summary> Starting time with inclusive boundary. </summary> + public DateTimeOffset? Start { get; set; } + /// <summary> End time with inclusive boundary, if not ongoing. </summary> + public DateTimeOffset? End { get; set; } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownFhirR4DomainResource.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownFhirR4DomainResource.Serialization.cs new file mode 100644 index 0000000000000..a5252b074fbfb --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownFhirR4DomainResource.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class UnknownFhirR4DomainResource : IUtf8JsonSerializable, IJsonModel<FhirR4DomainResource> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<FhirR4DomainResource>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<FhirR4DomainResource>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"u8); + writer.WriteObjectValue(Text); + } + if (Optional.IsCollectionDefined(Contained)) + { + writer.WritePropertyName("contained"u8); + writer.WriteStartArray(); + foreach (var item in Contained) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Extension)) + { + writer.WritePropertyName("extension"u8); + writer.WriteStartArray(); + foreach (var item in Extension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ModifierExtension)) + { + writer.WritePropertyName("modifierExtension"u8); + writer.WriteStartArray(); + foreach (var item in ModifierExtension) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Meta)) + { + writer.WritePropertyName("meta"u8); + writer.WriteObjectValue(Meta); + } + if (Optional.IsDefined(ImplicitRules)) + { + writer.WritePropertyName("implicitRules"u8); + writer.WriteStringValue(ImplicitRules); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + FhirR4DomainResource IJsonModel<FhirR4DomainResource>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnknownFhirR4DomainResource(document.RootElement, options); + } + + internal static UnknownFhirR4DomainResource DeserializeUnknownFhirR4DomainResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional<FhirR4Narrative> text = default; + Optional<IList<FhirR4Resource>> contained = default; + Optional<IList<FhirR4Extension>> extension = default; + Optional<IList<FhirR4Extension>> modifierExtension = default; + string resourceType = "Unknown"; + Optional<string> id = default; + Optional<FhirR4Meta> meta = default; + Optional<string> implicitRules = default; + Optional<string> language = default; + IDictionary<string, BinaryData> additionalProperties = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + text = FhirR4Narrative.DeserializeFhirR4Narrative(property.Value); + continue; + } + if (property.NameEquals("contained"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Resource> array = new List<FhirR4Resource>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeFhirR4Resource(item)); + } + contained = array; + continue; + } + if (property.NameEquals("extension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + extension = array; + continue; + } + if (property.NameEquals("modifierExtension"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List<FhirR4Extension> array = new List<FhirR4Extension>(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FhirR4Extension.DeserializeFhirR4Extension(item)); + } + modifierExtension = array; + continue; + } + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("meta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + meta = FhirR4Meta.DeserializeFhirR4Meta(property.Value); + continue; + } + if (property.NameEquals("implicitRules"u8)) + { + implicitRules = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new UnknownFhirR4DomainResource(resourceType, id.Value, meta.Value, implicitRules.Value, language.Value, additionalProperties, text.Value, Optional.ToList(contained), Optional.ToList(extension), Optional.ToList(modifierExtension)); + } + + BinaryData IPersistableModel<FhirR4DomainResource>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{options.Format}' format."); + } + } + + FhirR4DomainResource IPersistableModel<FhirR4DomainResource>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<FhirR4DomainResource>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUnknownFhirR4DomainResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FhirR4DomainResource)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<FhirR4DomainResource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new UnknownFhirR4DomainResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownFhirR4DomainResource(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownFhirR4DomainResource.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownFhirR4DomainResource.cs new file mode 100644 index 0000000000000..7a3478c6c872c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownFhirR4DomainResource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Unknown version of Fhir_R4_DomainResource. </summary> + internal partial class UnknownFhirR4DomainResource : FhirR4DomainResource + { + /// <summary> Initializes a new instance of <see cref="UnknownFhirR4DomainResource"/>. </summary> + /// <param name="resourceType"> The type of resource. </param> + /// <param name="id"> Resource Id. </param> + /// <param name="meta"> Metadata about the resource. </param> + /// <param name="implicitRules"> A set of rules under which this content was created. </param> + /// <param name="language"> Language of the resource content. </param> + /// <param name="additionalProperties"> Additional Properties. </param> + /// <param name="text"> Text summary of the resource, for human interpretation. </param> + /// <param name="contained"> Contained, inline Resources. </param> + /// <param name="extension"> Additional Content defined by implementations. </param> + /// <param name="modifierExtension"> Extensions that cannot be ignored. </param> + internal UnknownFhirR4DomainResource(string resourceType, string id, FhirR4Meta meta, string implicitRules, string language, IDictionary<string, BinaryData> additionalProperties, FhirR4Narrative text, IList<FhirR4Resource> contained, IList<FhirR4Extension> extension, IList<FhirR4Extension> modifierExtension) : base(resourceType, id, meta, implicitRules, language, additionalProperties, text, contained, extension, modifierExtension) + { + } + + /// <summary> Initializes a new instance of <see cref="UnknownFhirR4DomainResource"/> for deserialization. </summary> + internal UnknownFhirR4DomainResource() + { + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownProcedureRecommendation.Serialization.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownProcedureRecommendation.Serialization.cs new file mode 100644 index 0000000000000..5cf03332ef013 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownProcedureRecommendation.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Health.Insights.RadiologyInsights +{ + internal partial class UnknownProcedureRecommendation : IUtf8JsonSerializable, IJsonModel<ProcedureRecommendation> + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<ProcedureRecommendation>)this).Write(writer, new ModelReaderWriterOptions("W")); + + void IJsonModel<ProcedureRecommendation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcedureRecommendation)} does not support '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ProcedureRecommendation IJsonModel<ProcedureRecommendation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcedureRecommendation)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnknownProcedureRecommendation(document.RootElement, options); + } + + internal static UnknownProcedureRecommendation DeserializeUnknownProcedureRecommendation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= new ModelReaderWriterOptions("W"); + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string kind = "Unknown"; + IDictionary<string, BinaryData> serializedAdditionalRawData = default; + Dictionary<string, BinaryData> additionalPropertiesDictionary = new Dictionary<string, BinaryData>(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = additionalPropertiesDictionary; + return new UnknownProcedureRecommendation(kind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel<ProcedureRecommendation>.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProcedureRecommendation)} does not support '{options.Format}' format."); + } + } + + ProcedureRecommendation IPersistableModel<ProcedureRecommendation>.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel<ProcedureRecommendation>)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUnknownProcedureRecommendation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProcedureRecommendation)} does not support '{options.Format}' format."); + } + } + + string IPersistableModel<ProcedureRecommendation>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// <summary> Deserializes the model from a raw response. </summary> + /// <param name="response"> The response to deserialize the model from. </param> + internal static new UnknownProcedureRecommendation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownProcedureRecommendation(document.RootElement); + } + + /// <summary> Convert into a Utf8JsonRequestContent. </summary> + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownProcedureRecommendation.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownProcedureRecommendation.cs new file mode 100644 index 0000000000000..8a04496d2fbf8 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Generated/UnknownProcedureRecommendation.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Health.Insights.RadiologyInsights +{ + /// <summary> Unknown version of ProcedureRecommendation. </summary> + internal partial class UnknownProcedureRecommendation : ProcedureRecommendation + { + /// <summary> Initializes a new instance of <see cref="UnknownProcedureRecommendation"/>. </summary> + /// <param name="kind"> Discriminator. </param> + /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> + internal UnknownProcedureRecommendation(string kind, IDictionary<string, BinaryData> serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) + { + } + + /// <summary> Initializes a new instance of <see cref="UnknownProcedureRecommendation"/> for deserialization. </summary> + internal UnknownProcedureRecommendation() + { + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Properties/AssemblyInfo.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..abdfc901b1f71 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Health.Insights.RadiologyInsights.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tests/Azure.Health.Insights.RadiologyInsights.Tests.csproj b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tests/Azure.Health.Insights.RadiologyInsights.Tests.csproj new file mode 100644 index 0000000000000..0cebe8e26600c --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tests/Azure.Health.Insights.RadiologyInsights.Tests.csproj @@ -0,0 +1,20 @@ +<Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks> + <!--We don't care about XML doc comments on test types and members--> + <NoWarn>$(NoWarn);CS1591</NoWarn> + </PropertyGroup> + + <ItemGroup> + <ProjectReference Include="$(AzureCoreTestFramework)" /> + <ProjectReference Include="..\src\Azure.Health.Insights.RadiologyInsights.csproj" /> + </ItemGroup> + + <ItemGroup> + <PackageReference Include="Azure.Identity" /> + <PackageReference Include="NUnit" /> + <PackageReference Include="NUnit3TestAdapter" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" /> + <PackageReference Include="Moq" /> + </ItemGroup> +</Project> diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tests/Generated/Samples/Samples_RadiologyInsightsClient.cs b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tests/Generated/Samples/Samples_RadiologyInsightsClient.cs new file mode 100644 index 0000000000000..48474e1e1edc1 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tests/Generated/Samples/Samples_RadiologyInsightsClient.cs @@ -0,0 +1,1236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// <auto-generated/> + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Health.Insights.RadiologyInsights; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Health.Insights.RadiologyInsights.Samples +{ + public partial class Samples_RadiologyInsightsClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RadiologyInsightsClient_InferRadiologyInsights_ShortVersion() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + patients = new object[] + { +new +{ +id = "<id>", +} + }, + }); + Operation<BinaryData> operation = client.InferRadiologyInsights(WaitUntil.Completed, content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].ToString()); + Console.WriteLine(result.GetProperty("modelVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RadiologyInsightsClient_InferRadiologyInsights_ShortVersion_Async() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + patients = new object[] + { +new +{ +id = "<id>", +} + }, + }); + Operation<BinaryData> operation = await client.InferRadiologyInsightsAsync(WaitUntil.Completed, content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].ToString()); + Console.WriteLine(result.GetProperty("modelVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RadiologyInsightsClient_InferRadiologyInsights_ShortVersion_Convenience() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + + RadiologyInsightsData radiologyInsightsData = new RadiologyInsightsData(new PatientRecord[] + { +new PatientRecord("<id>") + }); + Operation<RadiologyInsightsInferenceResult> operation = client.InferRadiologyInsights(WaitUntil.Completed, radiologyInsightsData); + RadiologyInsightsInferenceResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RadiologyInsightsClient_InferRadiologyInsights_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + + RadiologyInsightsData radiologyInsightsData = new RadiologyInsightsData(new PatientRecord[] + { +new PatientRecord("<id>") + }); + Operation<RadiologyInsightsInferenceResult> operation = await client.InferRadiologyInsightsAsync(WaitUntil.Completed, radiologyInsightsData); + RadiologyInsightsInferenceResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RadiologyInsightsClient_InferRadiologyInsights_AllParameters() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + patients = new object[] + { +new +{ +id = "<id>", +info = new +{ +sex = "female", +birthDate = "2022-05-10", +clinicalInfo = new object[] +{ +new +{ +resourceType = "<resourceType>", +id = "<id>", +meta = new +{ +versionId = "<versionId>", +lastUpdated = "<lastUpdated>", +source = "<source>", +profile = new object[] +{ +"<profile>" +}, +security = new object[] +{ +new +{ +system = "<system>", +version = "<version>", +code = "<code>", +display = "<display>", +id = "<id>", +extension = new object[] +{ +new +{ +url = "<url>", +valueQuantity = new +{ +value = 123.45, +comparator = "<comparator>", +unit = "<unit>", +system = "<system>", +code = "<code>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueCodeableConcept = new +{ +coding = new object[] +{ +null +}, +text = "<text>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueString = "<valueString>", +valueBoolean = true, +valueInteger = 1234, +valueRange = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueRatio = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueSampledData = new +{ +period = 123.45, +factor = 123.45, +lowerLimit = 123.45, +upperLimit = 123.45, +dimensions = 1234, +data = "<data>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueTime = "01:23:45", +valueDateTime = "<valueDateTime>", +valuePeriod = new +{ +start = "<start>", +end = "<end>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueReference = new +{ +reference = "<reference>", +type = "<type>", +identifier = new +{ +use = "<use>", +system = "<system>", +value = "<value>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +display = "<display>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +id = "<id>", +extension = new object[] +{ +null +}, +} +}, +} +}, +tag = new object[] +{ +null +}, +}, +implicitRules = "<implicitRules>", +language = "<language>", +} +}, +}, +encounters = new object[] +{ +new Dictionary<string, object> +{ +["id"] = "<id>", +["period"] = new +{ +start = "2022-05-10T14:57:31.2311892-04:00", +end = "2022-05-10T14:57:31.2311892-04:00", +}, +["class"] = "inpatient" +} +}, +patientDocuments = new object[] +{ +new +{ +type = "note", +clinicalType = "consultation", +id = "<id>", +language = "<language>", +createdDateTime = "2022-05-10T14:57:31.2311892-04:00", +authors = new object[] +{ +new +{ +id = "<id>", +fullName = "<fullName>", +} +}, +specialtyType = "pathology", +administrativeMetadata = new +{ +orderedProcedures = new object[] +{ +new +{ +extension = new object[] +{ +null +}, +description = "<description>", +} +}, +encounterId = "<encounterId>", +}, +content = new +{ +sourceType = "inline", +value = "<value>", +}, +} +}, +} + }, + configuration = new + { + verbose = true, + includeEvidence = true, + inferenceTypes = new object[] + { +"ageMismatch" + }, + inferenceOptions = new + { + followupRecommendationOptions = new + { + includeRecommendationsWithNoSpecifiedModality = true, + includeRecommendationsInReferences = true, + provideFocusedSentenceEvidence = true, + }, + findingOptions = new + { + provideFocusedSentenceEvidence = true, + }, + }, + locale = "<locale>", + }, + }); + Operation<BinaryData> operation = client.InferRadiologyInsights(WaitUntil.Completed, content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("modelVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RadiologyInsightsClient_InferRadiologyInsights_AllParameters_Async() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + patients = new object[] + { +new +{ +id = "<id>", +info = new +{ +sex = "female", +birthDate = "2022-05-10", +clinicalInfo = new object[] +{ +new +{ +resourceType = "<resourceType>", +id = "<id>", +meta = new +{ +versionId = "<versionId>", +lastUpdated = "<lastUpdated>", +source = "<source>", +profile = new object[] +{ +"<profile>" +}, +security = new object[] +{ +new +{ +system = "<system>", +version = "<version>", +code = "<code>", +display = "<display>", +id = "<id>", +extension = new object[] +{ +new +{ +url = "<url>", +valueQuantity = new +{ +value = 123.45, +comparator = "<comparator>", +unit = "<unit>", +system = "<system>", +code = "<code>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueCodeableConcept = new +{ +coding = new object[] +{ +null +}, +text = "<text>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueString = "<valueString>", +valueBoolean = true, +valueInteger = 1234, +valueRange = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueRatio = new +{ +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueSampledData = new +{ +period = 123.45, +factor = 123.45, +lowerLimit = 123.45, +upperLimit = 123.45, +dimensions = 1234, +data = "<data>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueTime = "01:23:45", +valueDateTime = "<valueDateTime>", +valuePeriod = new +{ +start = "<start>", +end = "<end>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +valueReference = new +{ +reference = "<reference>", +type = "<type>", +identifier = new +{ +use = "<use>", +system = "<system>", +value = "<value>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +display = "<display>", +id = "<id>", +extension = new object[] +{ +null +}, +}, +id = "<id>", +extension = new object[] +{ +null +}, +} +}, +} +}, +tag = new object[] +{ +null +}, +}, +implicitRules = "<implicitRules>", +language = "<language>", +} +}, +}, +encounters = new object[] +{ +new Dictionary<string, object> +{ +["id"] = "<id>", +["period"] = new +{ +start = "2022-05-10T14:57:31.2311892-04:00", +end = "2022-05-10T14:57:31.2311892-04:00", +}, +["class"] = "inpatient" +} +}, +patientDocuments = new object[] +{ +new +{ +type = "note", +clinicalType = "consultation", +id = "<id>", +language = "<language>", +createdDateTime = "2022-05-10T14:57:31.2311892-04:00", +authors = new object[] +{ +new +{ +id = "<id>", +fullName = "<fullName>", +} +}, +specialtyType = "pathology", +administrativeMetadata = new +{ +orderedProcedures = new object[] +{ +new +{ +extension = new object[] +{ +null +}, +description = "<description>", +} +}, +encounterId = "<encounterId>", +}, +content = new +{ +sourceType = "inline", +value = "<value>", +}, +} +}, +} + }, + configuration = new + { + verbose = true, + includeEvidence = true, + inferenceTypes = new object[] + { +"ageMismatch" + }, + inferenceOptions = new + { + followupRecommendationOptions = new + { + includeRecommendationsWithNoSpecifiedModality = true, + includeRecommendationsInReferences = true, + provideFocusedSentenceEvidence = true, + }, + findingOptions = new + { + provideFocusedSentenceEvidence = true, + }, + }, + locale = "<locale>", + }, + }); + Operation<BinaryData> operation = await client.InferRadiologyInsightsAsync(WaitUntil.Completed, content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("patientId").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueCodeableConcept").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("type").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("coding")[0].GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueQuantity").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueString").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueBoolean").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueInteger").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("low").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("high").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRange").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("numerator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("denominator").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueRatio").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("comparator").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("unit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("origin").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("period").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("factor").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("lowerLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("upperLimit").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("dimensions").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("data").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueSampledData").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueDateTime").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valuePeriod").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("reference").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("use").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("system").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("value").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("start").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("end").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("period").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("identifier").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("display").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("valueReference").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("code").GetProperty("extension")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("patientResults")[0].GetProperty("inferences")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("modelVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RadiologyInsightsClient_InferRadiologyInsights_AllParameters_Convenience() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + + RadiologyInsightsData radiologyInsightsData = new RadiologyInsightsData(new PatientRecord[] + { +new PatientRecord("<id>") +{ +Info = new PatientDetails +{ +Sex = PatientSex.Female, +BirthDate = DateTimeOffset.Parse("2022-05-10"), +ClinicalInfo = {new FhirR4Resource("<resourceType>") +{ +Id = "<id>", +Meta = new FhirR4Meta +{ +VersionId = "<versionId>", +LastUpdated = "<lastUpdated>", +Source = "<source>", +Profile = {"<profile>"}, +Security = {new FhirR4Coding +{ +System = "<system>", +Version = "<version>", +Code = "<code>", +Display = "<display>", +}}, +Tag = {default}, +}, +ImplicitRules = "<implicitRules>", +Language = "<language>", +}}, +}, +Encounters = {new Encounter("<id>") +{ +Period = new TimePeriod +{ +Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +}, +Class = EncounterClass.InPatient, +}}, +PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) +{ +ClinicalType = ClinicalDocumentType.Consultation, +Language = "<language>", +CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +Authors = {new DocumentAuthor +{ +Id = "<id>", +FullName = "<fullName>", +}}, +SpecialtyType = SpecialtyType.Pathology, +AdministrativeMetadata = new DocumentAdministrativeMetadata +{ +OrderedProcedures = {new FhirR4Extendible +{ +Extension = {default}, +Code = default, +Description = "<description>", +}}, +EncounterId = "<encounterId>", +}, +}}, +} + }) + { + Configuration = new RadiologyInsightsModelConfiguration + { + Verbose = true, + IncludeEvidence = true, + InferenceTypes = { RadiologyInsightsInferenceType.AgeMismatch }, + InferenceOptions = new RadiologyInsightsInferenceOptions + { + FollowupRecommendationOptions = new FollowupRecommendationOptions + { + IncludeRecommendationsWithNoSpecifiedModality = true, + IncludeRecommendationsInReferences = true, + ProvideFocusedSentenceEvidence = true, + }, + FindingOptions = new FindingOptions + { + ProvideFocusedSentenceEvidence = true, + }, + }, + Locale = "<locale>", + }, + }; + Operation<RadiologyInsightsInferenceResult> operation = client.InferRadiologyInsights(WaitUntil.Completed, radiologyInsightsData); + RadiologyInsightsInferenceResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RadiologyInsightsClient_InferRadiologyInsights_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri("<https://my-service.azure.com>"); + AzureKeyCredential credential = new AzureKeyCredential("<key>"); + RadiologyInsightsClient client = new RadiologyInsightsClient(endpoint, credential); + + RadiologyInsightsData radiologyInsightsData = new RadiologyInsightsData(new PatientRecord[] + { +new PatientRecord("<id>") +{ +Info = new PatientDetails +{ +Sex = PatientSex.Female, +BirthDate = DateTimeOffset.Parse("2022-05-10"), +ClinicalInfo = {new FhirR4Resource("<resourceType>") +{ +Id = "<id>", +Meta = new FhirR4Meta +{ +VersionId = "<versionId>", +LastUpdated = "<lastUpdated>", +Source = "<source>", +Profile = {"<profile>"}, +Security = {new FhirR4Coding +{ +System = "<system>", +Version = "<version>", +Code = "<code>", +Display = "<display>", +}}, +Tag = {default}, +}, +ImplicitRules = "<implicitRules>", +Language = "<language>", +}}, +}, +Encounters = {new Encounter("<id>") +{ +Period = new TimePeriod +{ +Start = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +End = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +}, +Class = EncounterClass.InPatient, +}}, +PatientDocuments = {new PatientDocument(DocumentType.Note, "<id>", new DocumentContent(DocumentContentSourceType.Inline, "<value>")) +{ +ClinicalType = ClinicalDocumentType.Consultation, +Language = "<language>", +CreatedDateTime = DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), +Authors = {new DocumentAuthor +{ +Id = "<id>", +FullName = "<fullName>", +}}, +SpecialtyType = SpecialtyType.Pathology, +AdministrativeMetadata = new DocumentAdministrativeMetadata +{ +OrderedProcedures = {new FhirR4Extendible +{ +Extension = {default}, +Code = default, +Description = "<description>", +}}, +EncounterId = "<encounterId>", +}, +}}, +} + }) + { + Configuration = new RadiologyInsightsModelConfiguration + { + Verbose = true, + IncludeEvidence = true, + InferenceTypes = { RadiologyInsightsInferenceType.AgeMismatch }, + InferenceOptions = new RadiologyInsightsInferenceOptions + { + FollowupRecommendationOptions = new FollowupRecommendationOptions + { + IncludeRecommendationsWithNoSpecifiedModality = true, + IncludeRecommendationsInReferences = true, + ProvideFocusedSentenceEvidence = true, + }, + FindingOptions = new FindingOptions + { + ProvideFocusedSentenceEvidence = true, + }, + }, + Locale = "<locale>", + }, + }; + Operation<RadiologyInsightsInferenceResult> operation = await client.InferRadiologyInsightsAsync(WaitUntil.Completed, radiologyInsightsData); + RadiologyInsightsInferenceResult responseData = operation.Value; + } + } +} diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tsp-location.yaml b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tsp-location.yaml new file mode 100644 index 0000000000000..8c5a333cdc6d5 --- /dev/null +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/tsp-location.yaml @@ -0,0 +1,7 @@ +directory: specification/ai/HealthInsights/HealthInsights.RadiologyInsights +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/ai/HealthInsights/HealthInsights.Common/ +- specification/ai/HealthInsights/HealthInsights.OpenAPI/ +commit: 0b86423a8256b66c84c4e0e0d7d52e75105bb4bb +